2026-09-16 07:03:15 +00:00
|
|
|
// Module ID: 13282
|
|
|
|
|
// Function ID: 13283
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: useTrackPdpClick
|
2026-09-16 07:03:15 +00:00
|
|
|
// Dependencies: [19, 1074, 8907, 8307, 7664, 1241, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: useTrackPdpClick
|
|
|
|
|
|
2026-09-16 07:03:15 +00:00
|
|
|
// Module 13282 (useTrackPdpClick)
|
2026-09-15 14:23:42 +00:00
|
|
|
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
|
2026-09-16 07:03:15 +00:00
|
|
|
import CollectiblesUtils from "CollectiblesUtils" /* 7664 */;
|
2026-09-10 05:38:07 +00:00
|
|
|
import noop from "module_19" /* 19 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
require = fn;
|
|
|
|
|
const AnalyticEvents = fn(1074).AnalyticEvents;
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/collectibles/hooks/useTrackPdpClick.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export const useTrackPdpClick = function useTrackPdpClick(skuId) {
|
|
|
|
|
skuId = skuId.skuId;
|
|
|
|
|
const productSkuIds = skuId.productSkuIds;
|
|
|
|
|
const analyticsLocations = skuId.analyticsLocations;
|
2026-07-23 10:11:24 +00:00
|
|
|
let cardId;
|
|
|
|
|
let sessionId;
|
2026-07-20 16:05:17 +00:00
|
|
|
let shopDiscountSource;
|
2026-07-23 10:11:24 +00:00
|
|
|
let collectiblesAnalyticsContext = skuId(analyticsLocations[2]).useCollectiblesAnalyticsContext();
|
2026-07-29 08:29:29 +00:00
|
|
|
if (collectiblesAnalyticsContext == null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
collectiblesAnalyticsContext = {};
|
|
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
cardId = collectiblesAnalyticsContext.cardId;
|
|
|
|
|
sessionId = collectiblesAnalyticsContext.sessionId;
|
2026-09-10 05:38:07 +00:00
|
|
|
let obj = skuId(analyticsLocations[2]);
|
|
|
|
|
const currentUserIfAvailable = skuId(analyticsLocations[3]).useCurrentUserIfAvailable();
|
|
|
|
|
const tmpResult = skuId(analyticsLocations[3]);
|
|
|
|
|
shopDiscountSource = skuId(analyticsLocations[4]).getShopDiscountSource(currentUserIfAvailable);
|
2026-07-20 16:05:17 +00:00
|
|
|
const items = [skuId, analyticsLocations, cardId, productSkuIds, sessionId, shopDiscountSource];
|
2026-09-10 05:38:07 +00:00
|
|
|
return cardId.useCallback((cta, arg1) => {
|
2026-07-20 16:05:17 +00:00
|
|
|
let tmp = arg1;
|
2026-07-29 08:29:29 +00:00
|
|
|
if (arg1 == null) {
|
2026-07-20 16:05:17 +00:00
|
|
|
tmp = skuId;
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj2 = { sku_id: tmp, cta, shop_session_id: sessionId, card_id: cardId, product_sku_ids: productSkuIds, location_stack: analyticsLocations, discount_source: null };
|
|
|
|
|
const obj = AnalyticsUtilsDefault;
|
|
|
|
|
obj2.discount_source = CollectiblesUtils.getAnalyticsShopDiscountSource(shopDiscountSource);
|
|
|
|
|
obj.track(AnalyticEvents.SHOP_PRODUCT_DETAIL_PAGE_CLICKED, obj2);
|
2026-07-20 16:05:17 +00:00
|
|
|
}, items);
|
|
|
|
|
};
|