pb-sxp-ui 1.20.1 → 1.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/index.cjs +253 -120
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +253 -120
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +6 -6
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +6 -6
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +253 -120
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +6 -6
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/LikeButton/index.js +12 -4
  14. package/es/core/components/SxpPageRender/VideoWidget/index.js +6 -2
  15. package/es/core/components/SxpPageRender/WaterFall/List.js +15 -16
  16. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +14 -2
  17. package/es/core/components/SxpPageRender/WaterFall/index.d.ts +2 -0
  18. package/es/core/components/SxpPageRender/WaterFall/index.js +1 -4
  19. package/es/core/components/SxpPageRender/index.js +62 -18
  20. package/es/core/context/SxpDataSourceProvider.d.ts +8 -3
  21. package/es/core/context/SxpDataSourceProvider.js +76 -43
  22. package/es/core/utils/tool.d.ts +2 -1
  23. package/es/core/utils/tool.js +15 -1
  24. package/es/materials/sxp/cta/AniLink/index.js +7 -7
  25. package/es/materials/sxp/cta/AniLinkPopup/index.js +10 -10
  26. package/es/materials/sxp/popup/CommodityDetail/index.js +9 -3
  27. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +9 -3
  28. package/es/materials/sxp/popup/CommodityList/index.js +10 -6
  29. package/es/materials/sxp/template/components/EventProvider.js +9 -9
  30. package/lib/core/components/SxpPageRender/LikeButton/index.js +12 -4
  31. package/lib/core/components/SxpPageRender/VideoWidget/index.js +6 -2
  32. package/lib/core/components/SxpPageRender/WaterFall/List.js +14 -15
  33. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +14 -2
  34. package/lib/core/components/SxpPageRender/WaterFall/index.d.ts +2 -0
  35. package/lib/core/components/SxpPageRender/WaterFall/index.js +1 -4
  36. package/lib/core/components/SxpPageRender/index.js +62 -18
  37. package/lib/core/context/SxpDataSourceProvider.d.ts +8 -3
  38. package/lib/core/context/SxpDataSourceProvider.js +74 -41
  39. package/lib/core/utils/tool.d.ts +2 -1
  40. package/lib/core/utils/tool.js +16 -1
  41. package/lib/materials/sxp/cta/AniLink/index.js +7 -7
  42. package/lib/materials/sxp/cta/AniLinkPopup/index.js +10 -10
  43. package/lib/materials/sxp/popup/CommodityDetail/index.js +9 -3
  44. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +9 -3
  45. package/lib/materials/sxp/popup/CommodityList/index.js +10 -6
  46. package/lib/materials/sxp/template/components/EventProvider.js +9 -9
  47. package/package.json +1 -1
package/dist/pb-ui.js CHANGED
@@ -300,6 +300,20 @@
300
300
  document.cookie = `${name}=; ${expiration}${pathPart}${domainPart}`;
301
301
  console.log(`已尝试删除Cookie: ${name}`);
302
302
  }
303
+ function getUrlParamByKey(key) {
304
+ var _a, _b;
305
+ const queryString = location.search.slice(1);
306
+ const params = {};
307
+ (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
308
+ const key = val.split('=')[0];
309
+ const value = val.split('=')[1];
310
+ params[key] = value;
311
+ });
312
+ for (const key in params) {
313
+ params[key] = params[key].replace(/%2B/g, '+');
314
+ }
315
+ return (_b = params[key]) !== null && _b !== void 0 ? _b : '';
316
+ }
303
317
 
304
318
  function unzip(b64Data) {
305
319
  const strData = atob(b64Data);
@@ -1194,19 +1208,51 @@
1194
1208
  playbookType,
1195
1209
  bffDataSource
1196
1210
  ]);
1197
- const getEventParamsByJson = React.useCallback((json, product) => {
1198
- var _a, _b, _c;
1211
+ const getEventParamsByJson = React.useCallback((_a) => {
1212
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1213
+ var { json, product = [], rec, contentType = 'post', position, eventName } = _a, props = __rest(_a, ["json", "product", "rec", "contentType", "position", "eventName"]);
1199
1214
  const jsonParams = lodash.cloneDeep(json);
1200
1215
  const urlParams = new URLSearchParams(window.location.search);
1201
1216
  const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
1202
1217
  const fix_par = {
1203
- event_source_url: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href,
1218
+ event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
1204
1219
  external_id: fakeUserId,
1205
- client_user_agent: (_c = (_b = window === null || window === void 0 ? void 0 : window.navigator) === null || _b === void 0 ? void 0 : _b.userAgent) !== null && _c !== void 0 ? _c : '',
1220
+ client_user_agent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '',
1206
1221
  fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
1207
1222
  fbp: getCookie('_fbp') ? `${getCookie('_fbp')}` : '',
1208
1223
  time: Math.floor(Date.now() / 1000)
1209
1224
  };
1225
+ let customData = Object.assign({
1226
+ // funnel_type
1227
+ content_ids: [(_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.itemId, ...((_f = product === null || product === void 0 ? void 0 : product.map((item) => item === null || item === void 0 ? void 0 : item.itemId)) !== null && _f !== void 0 ? _f : [])], content_type: contentType, content_name: (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.title, total_posts: rtcList === null || rtcList === void 0 ? void 0 : rtcList.length, position,
1228
+ // content_category
1229
+ currency: (_h = product === null || product === void 0 ? void 0 : product[0]) === null || _h === void 0 ? void 0 : _h.currency, contents: (_j = product === null || product === void 0 ? void 0 : product.map((item) => ({
1230
+ item_id: item === null || item === void 0 ? void 0 : item.itemId,
1231
+ item_price: item === null || item === void 0 ? void 0 : item.price
1232
+ }))) !== null && _j !== void 0 ? _j : [], image_urls: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) !== null && _l !== void 0 ? _l : [], video_urls: (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.url,
1233
+ // prompt
1234
+ headline: getUrlParamByKey('headline'), scene: getUrlParamByKey('scene'), campaign_id: getUrlParamByKey('campaign_id'), ad_id: getUrlParamByKey('ad_id'), utm_source: getUrlParamByKey('utm_source'), utm_medium: getUrlParamByKey('utm_medium'), utm_campaign: getUrlParamByKey('utm_campaign'), utm_content: getUrlParamByKey('utm_content') }, props);
1235
+ if (!((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.url) && !((_q = (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.imgUrls) === null || _q === void 0 ? void 0 : _q.length) && (rec === null || rec === void 0 ? void 0 : rec.product) && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _r === void 0 ? void 0 : _r.length) > 0) {
1236
+ const product = rec === null || rec === void 0 ? void 0 : rec.product;
1237
+ const productCustomData = {
1238
+ content_ids: [product === null || product === void 0 ? void 0 : product.itemId],
1239
+ content_type: 'product',
1240
+ content_name: product === null || product === void 0 ? void 0 : product.title,
1241
+ contents: [{
1242
+ item_id: product === null || product === void 0 ? void 0 : product.itemId,
1243
+ item_price: product === null || product === void 0 ? void 0 : product.price
1244
+ }],
1245
+ image_urls: (_s = product.homePage) !== null && _s !== void 0 ? _s : []
1246
+ };
1247
+ customData = Object.assign(Object.assign({}, customData), productCustomData);
1248
+ }
1249
+ if (eventName === 'ContentSwipe' || eventName === 'Engagement' || eventName === 'ExitFeed') {
1250
+ const deleteKeys = ['content_ids', 'content_category', 'currency', 'contents', 'image_urls', 'video_urls', 'prompt'];
1251
+ deleteKeys.forEach(key => {
1252
+ if (customData === null || customData === void 0 ? void 0 : customData[key])
1253
+ delete customData[key];
1254
+ });
1255
+ }
1210
1256
  const regex = /\{\{(.*?)\}\}/g;
1211
1257
  const getEventParams = (obj) => {
1212
1258
  if (!obj)
@@ -1219,6 +1265,9 @@
1219
1265
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
1220
1266
  const value = obj === null || obj === void 0 ? void 0 : obj[key];
1221
1267
  if (typeof value === 'object') {
1268
+ if (key === 'custom_data') {
1269
+ obj[key] = customData !== null && customData !== void 0 ? customData : {};
1270
+ }
1222
1271
  getEventParams(value);
1223
1272
  }
1224
1273
  else if (typeof value === 'string') {
@@ -1228,7 +1277,7 @@
1228
1277
  var _a;
1229
1278
  const prop = match.substring(2, match.length - 2);
1230
1279
  try {
1231
- let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
1280
+ let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product === null || product === void 0 ? void 0 : product[0]);
1232
1281
  if (replaceValue) {
1233
1282
  if ((prop === null || prop === void 0 ? void 0 : prop.indexOf('currency')) !== -1 &&
1234
1283
  (replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.indexOf('-')) !== -1 &&
@@ -1253,15 +1302,17 @@
1253
1302
  }
1254
1303
  };
1255
1304
  getEventParams(jsonParams);
1305
+ console.log('capi event params:', jsonParams);
1256
1306
  return jsonParams;
1257
- }, [fakeUserId]);
1258
- const bffFbReport = React.useCallback(({ eventName, product }) => {
1259
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1307
+ }, [fakeUserId, globalConfig, rtcList]);
1308
+ const bffFbReport = React.useCallback((_a) => {
1309
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1310
+ var { eventName } = _a, props = __rest(_a, ["eventName"]);
1260
1311
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || getTargetingCookie()) {
1261
1312
  return;
1262
1313
  }
1263
1314
  let isPushState = false;
1264
- const pixelEventParamsJson = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _a === void 0 ? void 0 : _a[eventName];
1315
+ const pixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _b === void 0 ? void 0 : _b[eventName];
1265
1316
  if ((pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
1266
1317
  function updateQueryStringParameter(uri, key, value) {
1267
1318
  const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
@@ -1285,39 +1336,39 @@
1285
1336
  }
1286
1337
  }
1287
1338
  else {
1288
- window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, getEventParamsByJson(pixelEventParamsJson, product));
1339
+ window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, getEventParamsByJson(Object.assign({ json: pixelEventParamsJson, eventName }, props)));
1289
1340
  }
1290
1341
  }
1291
1342
  if (!isPushState) {
1292
1343
  if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
1293
1344
  window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
1294
1345
  }
1295
- const tiktokPixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _b === void 0 ? void 0 : _b[eventName];
1346
+ const tiktokPixelEventParamsJson = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _c === void 0 ? void 0 : _c[eventName];
1296
1347
  if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) &&
1297
1348
  typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'object' &&
1298
- typeof ((_c = window === null || window === void 0 ? void 0 : window.ttq) === null || _c === void 0 ? void 0 : _c.track) === 'function') {
1299
- (_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, getEventParamsByJson(tiktokPixelEventParamsJson, product));
1349
+ typeof ((_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track) === 'function') {
1350
+ (_e = window === null || window === void 0 ? void 0 : window.ttq) === null || _e === void 0 ? void 0 : _e.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, getEventParamsByJson(Object.assign({ json: tiktokPixelEventParamsJson, eventName }, props)));
1300
1351
  }
1301
1352
  }
1302
- const snapchatPixelEventParamsJson = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _e === void 0 ? void 0 : _e[eventName];
1353
+ const snapchatPixelEventParamsJson = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _f === void 0 ? void 0 : _f[eventName];
1303
1354
  if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
1304
- window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(snapchatPixelEventParamsJson, product));
1355
+ window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(Object.assign({ json: snapchatPixelEventParamsJson, eventName }, props)));
1305
1356
  }
1306
- if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.Northbeam) === 'object' && typeof ((_f = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _f === void 0 ? void 0 : _f.trackPageView) === 'function') {
1307
- (_g = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _g === void 0 ? void 0 : _g.trackPageView();
1357
+ if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.Northbeam) === 'object' && typeof ((_g = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _g === void 0 ? void 0 : _g.trackPageView) === 'function') {
1358
+ (_h = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _h === void 0 ? void 0 : _h.trackPageView();
1308
1359
  }
1309
- const converApiEventParamsJson = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _h === void 0 ? void 0 : _h[eventName];
1360
+ const converApiEventParamsJson = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _j === void 0 ? void 0 : _j[eventName];
1310
1361
  if (enabledMetaConversionApi && converApiEventParamsJson) {
1311
- const body = getEventParamsByJson(converApiEventParamsJson, product);
1362
+ const body = getEventParamsByJson(Object.assign({ json: converApiEventParamsJson, eventName }, props));
1312
1363
  const params = {};
1313
1364
  const queryString = location.search.slice(1);
1314
- (_j = splitUrlParams(queryString)) === null || _j === void 0 ? void 0 : _j.forEach((val) => {
1365
+ (_k = splitUrlParams(queryString)) === null || _k === void 0 ? void 0 : _k.forEach((val) => {
1315
1366
  const key = val.split('=')[0];
1316
1367
  const value = val.split('=')[1];
1317
1368
  params[key] = value;
1318
1369
  });
1319
1370
  const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
1320
- bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_k = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _k === void 0 ? void 0 : _k['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
1371
+ bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_l = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _l === void 0 ? void 0 : _l['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
1321
1372
  method: 'POST',
1322
1373
  body,
1323
1374
  type: 'beacon'
@@ -1355,7 +1406,7 @@
1355
1406
  console.log('e', e);
1356
1407
  }
1357
1408
  }), [bffFetch, utmVal]);
1358
- const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
1409
+ const ctaEvent = React.useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
1359
1410
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
1360
1411
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
1361
1412
  const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
@@ -1376,34 +1427,36 @@
1376
1427
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1377
1428
  eventInfo: Object.assign(Object.assign({}, eventInfo), { ctaId: (_r = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _r !== void 0 ? _r : '', ctaName: (_s = cta === null || cta === void 0 ? void 0 : cta.title) !== null && _s !== void 0 ? _s : '', contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_u = (_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_10 = (_7 = (_2 = (_y = (_v = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _v !== void 0 ? _v : (_x = (_w = rec === null || rec === void 0 ? void 0 : rec.video) === null || _w === void 0 ? void 0 : _w.bindCta) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_1 = (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindProduct) === null || _0 === void 0 ? void 0 : _0.bindCta) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : (_6 = (_5 = (_4 = (_3 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _3 === void 0 ? void 0 : _3.bindProducts) === null || _4 === void 0 ? void 0 : _4[0]) === null || _5 === void 0 ? void 0 : _5.bindCta) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : '', fromKName, fromKPage: (_11 = location === null || location === void 0 ? void 0 : location.href) !== null && _11 !== void 0 ? _11 : '', contentFormat })
1378
1429
  });
1379
- }, [bffEventReport, isFromHashtag]);
1380
- const h5EnterLink = React.useCallback(() => {
1381
- var _a, _b, _c;
1382
- const queryString = location.search.slice(1);
1383
- const params = {};
1384
- (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
1385
- const key = val.split('=')[0];
1386
- const value = val.split('=')[1];
1387
- params[key] = value;
1388
- });
1389
- for (const key in params) {
1390
- params[key] = params[key].replace(/%2B/g, '+');
1430
+ if ((eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject) === 'clickCta') {
1431
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
1432
+ eventName: 'ClickCTA',
1433
+ product: product ? [product] : undefined,
1434
+ contentType: contentType !== null && contentType !== void 0 ? contentType : 'post',
1435
+ rec,
1436
+ position,
1437
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
1438
+ cta_action_type: ctaActionType,
1439
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
1440
+ target_url: targetUrl
1441
+ });
1391
1442
  }
1392
- const getVal = (key) => { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ''; };
1443
+ }, [bffEventReport, isFromHashtag, bffFbReport]);
1444
+ const h5EnterLink = React.useCallback(() => {
1445
+ var _a, _b;
1393
1446
  const time = new Date();
1394
1447
  curTime.current = time;
1395
1448
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1396
1449
  eventInfo: {
1397
1450
  eventSubject: 'h5LinkEnterFeed',
1398
1451
  eventDescription: 'User enter h5 link',
1399
- utmSource: getVal('utm_source'),
1400
- utmMedium: getVal('utm_medium'),
1401
- utmCampaign: getVal('utm_campaign'),
1402
- utmId: getVal('utm_id'),
1403
- utmContent: getVal('utm_content'),
1452
+ utmSource: getUrlParamByKey('utm_source'),
1453
+ utmMedium: getUrlParamByKey('utm_medium'),
1454
+ utmCampaign: getUrlParamByKey('utm_campaign'),
1455
+ utmId: getUrlParamByKey('utm_id'),
1456
+ utmContent: getUrlParamByKey('utm_content'),
1404
1457
  enterTime: Math.floor(time / 1000) + '',
1405
1458
  requestId: null,
1406
- enterUrl: (_c = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href) !== null && _c !== void 0 ? _c : ''
1459
+ enterUrl: (_b = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : ''
1407
1460
  },
1408
1461
  reportLayId: false
1409
1462
  });
@@ -10822,7 +10875,7 @@
10822
10875
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10823
10876
  eventSubject: 'clickCta',
10824
10877
  eventDescription: 'User clicked the CTA'
10825
- }, data, product, position);
10878
+ }, data, product, position, 'open_external_link', product.link, 'product');
10826
10879
  }
10827
10880
  window.location.href = window.getJointUtmLink(product.link);
10828
10881
  }
@@ -10832,11 +10885,17 @@
10832
10885
  return;
10833
10886
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10834
10887
  eventName: 'ProductView',
10835
- product
10888
+ product: product ? [product] : undefined,
10889
+ contentType: 'product',
10890
+ rec: data,
10891
+ position
10836
10892
  });
10837
10893
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10838
10894
  eventName: 'PageView',
10839
- product
10895
+ product: product ? [product] : undefined,
10896
+ contentType: 'product',
10897
+ rec: data,
10898
+ position
10840
10899
  });
10841
10900
  }, [isActive, bffFbReport]);
10842
10901
  React.useEffect(() => {
@@ -11729,7 +11788,7 @@
11729
11788
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11730
11789
  eventSubject: 'clickCta',
11731
11790
  eventDescription: 'User clicked the CTA'
11732
- }, data, product, position);
11791
+ }, data, product, position, 'open_external_link', product.link, 'product');
11733
11792
  }
11734
11793
  window.location.href = window.getJointUtmLink(product.link);
11735
11794
  }
@@ -11739,11 +11798,17 @@
11739
11798
  return;
11740
11799
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11741
11800
  eventName: 'ProductView',
11742
- product
11801
+ product: product ? [product] : undefined,
11802
+ contentType: 'product',
11803
+ rec: data,
11804
+ position
11743
11805
  });
11744
11806
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11745
11807
  eventName: 'PageView',
11746
- product
11808
+ product: product ? [product] : undefined,
11809
+ contentType: 'product',
11810
+ rec: data,
11811
+ position
11747
11812
  });
11748
11813
  }, [isActive, bffFbReport]);
11749
11814
  React.useEffect(() => {
@@ -12413,13 +12478,13 @@ Made in Italy` })));
12413
12478
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12414
12479
  eventSubject: 'clickCta',
12415
12480
  eventDescription: 'User clicked the CTA'
12416
- }, recData, item, index);
12481
+ }, recData, item, index, isExternalLink && !!(item === null || item === void 0 ? void 0 : item.link) ? 'open_external_link' : 'open_internal_popup', item.link, 'product');
12417
12482
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
12418
12483
  if (isExternalLink) {
12419
- if (item === null || item === void 0 ? void 0 : item.link) {
12420
- jumpToWeb(e, recData, item, item.bindCta, index);
12421
- window.location.href = window.getJointUtmLink(item.link);
12422
- }
12484
+ if (!(item === null || item === void 0 ? void 0 : item.link))
12485
+ return;
12486
+ jumpToWeb(e, recData, item, item.bindCta, index);
12487
+ window.location.href = window.getJointUtmLink(item.link);
12423
12488
  }
12424
12489
  else {
12425
12490
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -12427,7 +12492,11 @@ Made in Italy` })));
12427
12492
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
12428
12493
  React.useEffect(() => {
12429
12494
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
12430
- eventName: 'PageView'
12495
+ eventName: 'PageView',
12496
+ product: (product !== null && product !== void 0 ? product : []),
12497
+ contentType: 'product',
12498
+ rec: recData,
12499
+ position: index
12431
12500
  });
12432
12501
  }, []);
12433
12502
  return (React.createElement("ul", { role: 'list', className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
@@ -12945,22 +13014,22 @@ Made in Italy` })));
12945
13014
  const handleClick = lodash.throttle((e) => {
12946
13015
  var _a, _b, _c, _d, _e, _f;
12947
13016
  e.preventDefault();
12948
- const item = multItem ? multItem : (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
13017
+ const item = multItem || ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video);
13018
+ const link = ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) || (multItem === null || multItem === void 0 ? void 0 : multItem.link);
12949
13019
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12950
13020
  eventSubject: 'clickCta',
12951
13021
  eventDescription: 'User clicked the CTA'
12952
- }, rec, item, index);
13022
+ }, rec, item, index, isExternalLink && (jumpLink || !!link) ? 'open_external_link' : 'open_internal_popup', link);
12953
13023
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(multItem && multiCheckIndex !== undefined && multiCheckIndex >= 0
12954
13024
  ? Object.assign(Object.assign({}, rec), { video: Object.assign(Object.assign({}, rec === null || rec === void 0 ? void 0 : rec.video), { bindProduct: multItem }), index, multiCheckIndex }) : Object.assign(Object.assign({}, rec), { index }));
12955
13025
  setElement(ref === null || ref === void 0 ? void 0 : ref.current);
12956
13026
  if (isExternalLink) {
12957
- const link = ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) || (multItem === null || multItem === void 0 ? void 0 : multItem.link);
12958
- if (jumpLink || link) {
12959
- const cta = ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
12960
- const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
12961
- jumpToWeb(e, rec, product, cta, index);
12962
- window.location.href = window.getJointUtmLink(jumpLink || link || '');
12963
- }
13027
+ if (!jumpLink && !link)
13028
+ return;
13029
+ const cta = ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
13030
+ const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
13031
+ jumpToWeb(e, rec, product, cta, index);
13032
+ window.location.href = window.getJointUtmLink(link);
12964
13033
  }
12965
13034
  else {
12966
13035
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -15550,7 +15619,7 @@ Made in Italy` })));
15550
15619
  function WaterfallList$1(_a) {
15551
15620
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
15552
15621
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
15553
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
15622
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex, bffFbReport } = useSxpDataSource();
15554
15623
  const { jumpToWeb } = useEventReport();
15555
15624
  /** 滚动的父元素 */
15556
15625
  const scrollParent = React.useRef(null);
@@ -15677,8 +15746,20 @@ Made in Italy` })));
15677
15746
  }).then((res) => {
15678
15747
  var _a, _b;
15679
15748
  setData(res);
15680
- setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
15749
+ const list = (_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : [];
15750
+ setList(list);
15681
15751
  setIsLoadingData(false);
15752
+ const products = [];
15753
+ list === null || list === void 0 ? void 0 : list.forEach((item) => {
15754
+ var _a, _b;
15755
+ products.push(...((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) !== null && _b !== void 0 ? _b : []));
15756
+ });
15757
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15758
+ eventName: 'PageView',
15759
+ product: products,
15760
+ rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
15761
+ position: cacheActiveIndex
15762
+ });
15682
15763
  }));
15683
15764
  if (isOpenHashTag) {
15684
15765
  const res = previewData;
@@ -15913,26 +15994,13 @@ Made in Italy` })));
15913
15994
  function WaterfallList(_a) {
15914
15995
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
15915
15996
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
15916
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
15997
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex, bffFbReport } = useSxpDataSource();
15917
15998
  const { jumpToWeb } = useEventReport();
15918
15999
  const [list, setList] = React.useState();
15919
16000
  const [data, setData] = React.useState();
15920
16001
  const [isLoadingData, setIsLoadingData] = React.useState(false);
15921
16002
  const containerRef = React.useRef(null);
15922
16003
  const [isLoadMore, setIsLoadMore] = React.useState(false);
15923
- React.useCallback(() => {
15924
- if (isLoadMore)
15925
- return;
15926
- setIsLoadMore(true);
15927
- waterFallData &&
15928
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
15929
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag
15930
- }).then((res) => {
15931
- var _a;
15932
- setList(list === null || list === void 0 ? void 0 : list.concat((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []));
15933
- setIsLoadMore(false);
15934
- }));
15935
- }, [waterFallData, getRecommendVideos, list, isLoadMore]);
15936
16004
  React.useEffect(() => {
15937
16005
  var _a, _b;
15938
16006
  setIsLoadingData(true);
@@ -15944,8 +16012,20 @@ Made in Italy` })));
15944
16012
  }).then((res) => {
15945
16013
  var _a, _b;
15946
16014
  setData(res);
15947
- setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
16015
+ const list = (_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : [];
16016
+ setList(list);
15948
16017
  setIsLoadingData(false);
16018
+ const products = [];
16019
+ list === null || list === void 0 ? void 0 : list.forEach((item) => {
16020
+ var _a, _b;
16021
+ products.push(...((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) !== null && _b !== void 0 ? _b : []));
16022
+ });
16023
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16024
+ eventName: 'PageView',
16025
+ product: products,
16026
+ rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
16027
+ position: cacheActiveIndex
16028
+ });
15949
16029
  }));
15950
16030
  if (isOpenHashTag) {
15951
16031
  const res = previewData;
@@ -16086,11 +16166,8 @@ Made in Italy` })));
16086
16166
  React.useEffect(() => {
16087
16167
  if (openHashtag) {
16088
16168
  setViewTime(new Date());
16089
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16090
- eventName: 'PageView'
16091
- });
16092
16169
  }
16093
- }, [openHashtag, bffFbReport]);
16170
+ }, [openHashtag]);
16094
16171
  React.useEffect(() => {
16095
16172
  const initTime = () => {
16096
16173
  setViewTime(new Date());
@@ -16411,17 +16488,17 @@ Made in Italy` })));
16411
16488
  const handleTo = (e) => {
16412
16489
  var _a, _b, _c, _d;
16413
16490
  const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
16491
+ const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16414
16492
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16415
16493
  eventSubject: 'clickCta',
16416
16494
  eventDescription: 'User clicked the CTA'
16417
- }, recData, item, index);
16495
+ }, recData, item, index, (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup', link);
16418
16496
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
16419
16497
  if (isExternalLink) {
16420
- const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16421
- if (link) {
16422
- jumpToWeb(e, recData, product, cta, index);
16423
- window.location.href = window.getJointUtmLink(link);
16424
- }
16498
+ if (!link)
16499
+ return;
16500
+ jumpToWeb(e, recData, product, cta, index);
16501
+ window.location.href = window.getJointUtmLink(link);
16425
16502
  }
16426
16503
  else {
16427
16504
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -16912,17 +16989,17 @@ Made in Italy` })));
16912
16989
  const handleTo = (e) => {
16913
16990
  var _a, _b, _c, _d;
16914
16991
  const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
16992
+ const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16915
16993
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16916
16994
  eventSubject: 'clickCta',
16917
16995
  eventDescription: 'User clicked the CTA'
16918
- }, recData, item, index);
16996
+ }, recData, item, index, (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup', link);
16919
16997
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
16920
16998
  if (isExternalLink) {
16921
- const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16922
- if (link) {
16923
- jumpToWeb(e, recData, product, cta, index);
16924
- window.location.href = window.getJointUtmLink(link);
16925
- }
16999
+ if (!link)
17000
+ return;
17001
+ jumpToWeb(e, recData, product, cta, index);
17002
+ window.location.href = window.getJointUtmLink(link);
16926
17003
  }
16927
17004
  else {
16928
17005
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -16956,8 +17033,8 @@ Made in Italy` })));
16956
17033
  height: '40px',
16957
17034
  lineHeight: '40px',
16958
17035
  paddingLeft: '6px'
16959
- } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css.css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css.css(aniTimStyle)}`, onClick: handleTo }),
16960
- React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
17036
+ } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css.css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles.aniLinkPopup} ${aniNamStyle} ${css.css(aniTimStyle)}`, onClick: handleTo }),
17037
+ React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style.padding) !== null && _s !== void 0 ? _s : 0 } },
16961
17038
  React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
16962
17039
  React.createElement(Img$1, { src: src, rec: recData, item: (_x = (_v = (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) !== null && _v !== void 0 ? _v : (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.bindProduct) !== null && _x !== void 0 ? _x : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
16963
17040
  (!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['one-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
@@ -18148,12 +18225,12 @@ Made in Italy` })));
18148
18225
  const LikeButton = (_a) => {
18149
18226
  var _b;
18150
18227
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
18151
- const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
18228
+ const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList, bffFbReport } = useSxpDataSource();
18152
18229
  const [state, setState] = React.useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
18153
18230
  const likeIcon = useIconLink(defaultLikeIconPath$2);
18154
18231
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
18155
18232
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
18156
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
18233
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
18157
18234
  if (state) {
18158
18235
  // 先设置状态
18159
18236
  setState(false);
@@ -18199,16 +18276,24 @@ Made in Italy` })));
18199
18276
  traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
18200
18277
  }
18201
18278
  });
18279
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18280
+ eventName: 'Engagement',
18281
+ product: (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.bindProducts,
18282
+ rec: recData,
18283
+ position,
18284
+ content_id: (_1 = (_0 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '',
18285
+ engagement_type: 'like'
18286
+ });
18202
18287
  if (!result) {
18203
18288
  setState(false);
18204
18289
  }
18205
18290
  else {
18206
- const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18291
+ const nRtcList = (_2 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18207
18292
  if (index === position) {
18208
18293
  item.isCollected = true;
18209
18294
  }
18210
18295
  return item;
18211
- })) !== null && _z !== void 0 ? _z : [];
18296
+ })) !== null && _2 !== void 0 ? _2 : [];
18212
18297
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18213
18298
  }
18214
18299
  }
@@ -18520,11 +18605,15 @@ Made in Italy` })));
18520
18605
  if (isActive) {
18521
18606
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18522
18607
  eventName: 'ViewContent',
18523
- product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
18608
+ product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProducts,
18609
+ rec: data === null || data === void 0 ? void 0 : data[index],
18610
+ position: index
18524
18611
  });
18525
18612
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18526
18613
  eventName: 'PageView',
18527
- product: (_d = (_c = data === null || data === void 0 ? void 0 : data[index]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.bindProduct
18614
+ product: (_d = (_c = data === null || data === void 0 ? void 0 : data[index]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.bindProducts,
18615
+ rec: data === null || data === void 0 ? void 0 : data[index],
18616
+ position: index
18528
18617
  });
18529
18618
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
18530
18619
  }
@@ -19176,7 +19265,7 @@ Made in Italy` })));
19176
19265
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
19177
19266
  }, [data, ctaType, swiperRef]);
19178
19267
  const handleSessionCompleted = React.useCallback((fk) => {
19179
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
19268
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
19180
19269
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19181
19270
  let fromKName = '';
19182
19271
  if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
@@ -19211,7 +19300,16 @@ Made in Italy` })));
19211
19300
  traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
19212
19301
  }
19213
19302
  });
19214
- }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
19303
+ const isPostType = ((_w = item === null || item === void 0 ? void 0 : item.video) === null || _w === void 0 ? void 0 : _w.url) || ((_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.imgUrls) === null || _y === void 0 ? void 0 : _y.length);
19304
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19305
+ eventName: 'ExitFeed',
19306
+ product: isPostType ? (_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
19307
+ rec: item,
19308
+ position: activeIndex,
19309
+ content_id: isPostType ? (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '' : (_3 = (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
19310
+ view_time: new Date() - viewTime.current
19311
+ });
19312
+ }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime, bffFbReport]);
19215
19313
  React.useEffect(() => {
19216
19314
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19217
19315
  const visibleChange = () => {
@@ -19514,50 +19612,81 @@ Made in Italy` })));
19514
19612
  }
19515
19613
  };
19516
19614
  const handleScrollEvent = (swiper) => {
19517
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
19615
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12;
19518
19616
  const item = data[swiper.previousIndex];
19617
+ const activeItem = data[swiper.activeIndex];
19519
19618
  if (!item)
19520
19619
  return;
19521
19620
  let contentFormat = null;
19522
- if ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) {
19621
+ let previousContentType = 'post';
19622
+ let previousContentId = (_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '';
19623
+ let previousProduct = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProducts;
19624
+ let previousContentsName = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : '';
19625
+ let previousDirection = '';
19626
+ let contentId = (_g = (_f = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '';
19627
+ if ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.url) {
19523
19628
  contentFormat = 'video';
19524
19629
  }
19525
- else if ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) === null || _c === void 0 ? void 0 : _c.length) {
19630
+ else if ((_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.imgUrls) === null || _k === void 0 ? void 0 : _k.length) {
19526
19631
  contentFormat = 'image';
19527
19632
  }
19633
+ else {
19634
+ previousContentType = 'product';
19635
+ previousContentId = (_m = (_l = item === null || item === void 0 ? void 0 : item.product) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '';
19636
+ previousProduct = (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [];
19637
+ previousContentsName = (_p = (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.title) !== null && _p !== void 0 ? _p : '';
19638
+ }
19639
+ if (!((_q = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _q === void 0 ? void 0 : _q.url) && !((_s = (_r = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _r === void 0 ? void 0 : _r.imgUrls) === null || _s === void 0 ? void 0 : _s.length)) {
19640
+ contentId = (_u = (_t = activeItem === null || activeItem === void 0 ? void 0 : activeItem.product) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '';
19641
+ }
19528
19642
  if (swiper.previousIndex - swiper.activeIndex < 0) {
19529
19643
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19530
19644
  eventInfo: {
19531
19645
  eventSubject: 'scrollDown',
19532
19646
  eventDescription: 'User scroll down',
19533
- contentId: (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.itemId) !== null && _e !== void 0 ? _e : '',
19534
- productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
19647
+ contentId: (_w = (_v = item === null || item === void 0 ? void 0 : item.video) === null || _v === void 0 ? void 0 : _v.itemId) !== null && _w !== void 0 ? _w : '',
19648
+ productId: (_y = (_x = item === null || item === void 0 ? void 0 : item.product) === null || _x === void 0 ? void 0 : _x.itemId) !== null && _y !== void 0 ? _y : '',
19535
19649
  requestId: null,
19536
- traceInfo: (_l = (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : (_k = item === null || item === void 0 ? void 0 : item.product) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : '',
19650
+ traceInfo: (_2 = (_0 = (_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : (_1 = item === null || item === void 0 ? void 0 : item.product) === null || _1 === void 0 ? void 0 : _1.traceInfo) !== null && _2 !== void 0 ? _2 : '',
19537
19651
  contentFormat,
19538
- position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
19652
+ position: ((_3 = swiper.previousIndex) !== null && _3 !== void 0 ? _3 : 0) + ''
19539
19653
  }
19540
19654
  });
19541
19655
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
19542
19656
  handleViewImageStartEnd(item);
19543
19657
  handleSlideSkip(item, swiper.previousIndex);
19658
+ previousDirection = 'up';
19544
19659
  }
19545
19660
  else {
19546
19661
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19547
19662
  eventInfo: {
19548
19663
  eventSubject: 'scrollUp',
19549
19664
  eventDescription: 'User scroll up',
19550
- contentId: (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
19551
- productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
19665
+ contentId: (_5 = (_4 = item === null || item === void 0 ? void 0 : item.video) === null || _4 === void 0 ? void 0 : _4.itemId) !== null && _5 !== void 0 ? _5 : '',
19666
+ productId: (_7 = (_6 = item.product) === null || _6 === void 0 ? void 0 : _6.itemId) !== null && _7 !== void 0 ? _7 : '',
19552
19667
  requestId: null,
19553
- traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : '',
19668
+ traceInfo: (_11 = (_9 = (_8 = item === null || item === void 0 ? void 0 : item.video) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : (_10 = item === null || item === void 0 ? void 0 : item.product) === null || _10 === void 0 ? void 0 : _10.traceInfo) !== null && _11 !== void 0 ? _11 : '',
19554
19669
  contentFormat,
19555
- position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
19670
+ position: ((_12 = swiper.previousIndex) !== null && _12 !== void 0 ? _12 : 0) + ''
19556
19671
  }
19557
19672
  });
19558
19673
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
19559
19674
  handleViewImageStartEnd(item);
19675
+ previousDirection = 'down';
19560
19676
  }
19677
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19678
+ eventName: 'ContentSwipe',
19679
+ product: previousProduct,
19680
+ rec: activeItem,
19681
+ position: swiper.activeIndex,
19682
+ previous_content_id: previousContentId,
19683
+ previous_content_type: previousContentType,
19684
+ previous_contents_name: previousContentsName,
19685
+ previosu_position: swiper.previousIndex,
19686
+ swipe_direction: previousDirection,
19687
+ view_time: new Date() - viewTime.current,
19688
+ content_id: contentId
19689
+ });
19561
19690
  // 商品浏览事件
19562
19691
  handleReportProductView(item);
19563
19692
  viewTime.current = new Date();
@@ -19661,11 +19790,15 @@ Made in Italy` })));
19661
19790
  if (enableCapi) {
19662
19791
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19663
19792
  eventName: 'ViewContent',
19664
- product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
19793
+ product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProducts,
19794
+ rec: item,
19795
+ position: activeIndex
19665
19796
  });
19666
19797
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19667
19798
  eventName: 'PageView',
19668
- product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
19799
+ product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProducts,
19800
+ rec: item,
19801
+ position: activeIndex
19669
19802
  });
19670
19803
  }
19671
19804
  }
@@ -19724,7 +19857,7 @@ Made in Italy` })));
19724
19857
  isReload,
19725
19858
  renderToggleButton
19726
19859
  ]);
19727
- return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: { height } },
19860
+ return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: { height: height + minusHeight + tagHeight } },
19728
19861
  (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
19729
19862
  React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
19730
19863
  waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
@@ -19784,7 +19917,7 @@ Made in Italy` })));
19784
19917
  renderView,
19785
19918
  renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
19786
19919
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
19787
- React.createElement(WaterFall$1, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
19920
+ React.createElement(WaterFall$1, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props, { rec: visList[activeIndex] })),
19788
19921
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19789
19922
  openMultiPosts && (React.createElement(MultiPosts$2, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0, bottom: bottomHeight + 'px' } }))))),
19790
19923
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {