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/index.js CHANGED
@@ -285,6 +285,20 @@ function deleteCookie(name, path = '/', domain = '') {
285
285
  document.cookie = `${name}=; ${expiration}${pathPart}${domainPart}`;
286
286
  console.log(`已尝试删除Cookie: ${name}`);
287
287
  }
288
+ function getUrlParamByKey(key) {
289
+ var _a, _b;
290
+ const queryString = location.search.slice(1);
291
+ const params = {};
292
+ (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
293
+ const key = val.split('=')[0];
294
+ const value = val.split('=')[1];
295
+ params[key] = value;
296
+ });
297
+ for (const key in params) {
298
+ params[key] = params[key].replace(/%2B/g, '+');
299
+ }
300
+ return (_b = params[key]) !== null && _b !== void 0 ? _b : '';
301
+ }
288
302
 
289
303
  function unzip(b64Data) {
290
304
  const strData = atob(b64Data);
@@ -1179,19 +1193,51 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1179
1193
  playbookType,
1180
1194
  bffDataSource
1181
1195
  ]);
1182
- const getEventParamsByJson = useCallback((json, product) => {
1183
- var _a, _b, _c;
1196
+ const getEventParamsByJson = useCallback((_a) => {
1197
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1198
+ var { json, product = [], rec, contentType = 'post', position, eventName } = _a, props = __rest(_a, ["json", "product", "rec", "contentType", "position", "eventName"]);
1184
1199
  const jsonParams = cloneDeep(json);
1185
1200
  const urlParams = new URLSearchParams(window.location.search);
1186
1201
  const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
1187
1202
  const fix_par = {
1188
- event_source_url: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href,
1203
+ event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
1189
1204
  external_id: fakeUserId,
1190
- 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 : '',
1205
+ 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 : '',
1191
1206
  fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
1192
1207
  fbp: getCookie('_fbp') ? `${getCookie('_fbp')}` : '',
1193
1208
  time: Math.floor(Date.now() / 1000)
1194
1209
  };
1210
+ let customData = Object.assign({
1211
+ // funnel_type
1212
+ 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,
1213
+ // content_category
1214
+ 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) => ({
1215
+ item_id: item === null || item === void 0 ? void 0 : item.itemId,
1216
+ item_price: item === null || item === void 0 ? void 0 : item.price
1217
+ }))) !== 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,
1218
+ // prompt
1219
+ 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);
1220
+ 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) {
1221
+ const product = rec === null || rec === void 0 ? void 0 : rec.product;
1222
+ const productCustomData = {
1223
+ content_ids: [product === null || product === void 0 ? void 0 : product.itemId],
1224
+ content_type: 'product',
1225
+ content_name: product === null || product === void 0 ? void 0 : product.title,
1226
+ contents: [{
1227
+ item_id: product === null || product === void 0 ? void 0 : product.itemId,
1228
+ item_price: product === null || product === void 0 ? void 0 : product.price
1229
+ }],
1230
+ image_urls: (_s = product.homePage) !== null && _s !== void 0 ? _s : []
1231
+ };
1232
+ customData = Object.assign(Object.assign({}, customData), productCustomData);
1233
+ }
1234
+ if (eventName === 'ContentSwipe' || eventName === 'Engagement' || eventName === 'ExitFeed') {
1235
+ const deleteKeys = ['content_ids', 'content_category', 'currency', 'contents', 'image_urls', 'video_urls', 'prompt'];
1236
+ deleteKeys.forEach(key => {
1237
+ if (customData === null || customData === void 0 ? void 0 : customData[key])
1238
+ delete customData[key];
1239
+ });
1240
+ }
1195
1241
  const regex = /\{\{(.*?)\}\}/g;
1196
1242
  const getEventParams = (obj) => {
1197
1243
  if (!obj)
@@ -1204,6 +1250,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1204
1250
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
1205
1251
  const value = obj === null || obj === void 0 ? void 0 : obj[key];
1206
1252
  if (typeof value === 'object') {
1253
+ if (key === 'custom_data') {
1254
+ obj[key] = customData !== null && customData !== void 0 ? customData : {};
1255
+ }
1207
1256
  getEventParams(value);
1208
1257
  }
1209
1258
  else if (typeof value === 'string') {
@@ -1213,7 +1262,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1213
1262
  var _a;
1214
1263
  const prop = match.substring(2, match.length - 2);
1215
1264
  try {
1216
- let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
1265
+ let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product === null || product === void 0 ? void 0 : product[0]);
1217
1266
  if (replaceValue) {
1218
1267
  if ((prop === null || prop === void 0 ? void 0 : prop.indexOf('currency')) !== -1 &&
1219
1268
  (replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.indexOf('-')) !== -1 &&
@@ -1238,15 +1287,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1238
1287
  }
1239
1288
  };
1240
1289
  getEventParams(jsonParams);
1290
+ console.log('capi event params:', jsonParams);
1241
1291
  return jsonParams;
1242
- }, [fakeUserId]);
1243
- const bffFbReport = useCallback(({ eventName, product }) => {
1244
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1292
+ }, [fakeUserId, globalConfig, rtcList]);
1293
+ const bffFbReport = useCallback((_a) => {
1294
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1295
+ var { eventName } = _a, props = __rest(_a, ["eventName"]);
1245
1296
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || getTargetingCookie()) {
1246
1297
  return;
1247
1298
  }
1248
1299
  let isPushState = false;
1249
- const pixelEventParamsJson = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _a === void 0 ? void 0 : _a[eventName];
1300
+ const pixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _b === void 0 ? void 0 : _b[eventName];
1250
1301
  if ((pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
1251
1302
  function updateQueryStringParameter(uri, key, value) {
1252
1303
  const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
@@ -1270,39 +1321,39 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1270
1321
  }
1271
1322
  }
1272
1323
  else {
1273
- window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, getEventParamsByJson(pixelEventParamsJson, product));
1324
+ 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)));
1274
1325
  }
1275
1326
  }
1276
1327
  if (!isPushState) {
1277
1328
  if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
1278
1329
  window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
1279
1330
  }
1280
- const tiktokPixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _b === void 0 ? void 0 : _b[eventName];
1331
+ const tiktokPixelEventParamsJson = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _c === void 0 ? void 0 : _c[eventName];
1281
1332
  if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) &&
1282
1333
  typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'object' &&
1283
- typeof ((_c = window === null || window === void 0 ? void 0 : window.ttq) === null || _c === void 0 ? void 0 : _c.track) === 'function') {
1284
- (_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));
1334
+ typeof ((_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track) === 'function') {
1335
+ (_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)));
1285
1336
  }
1286
1337
  }
1287
- const snapchatPixelEventParamsJson = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _e === void 0 ? void 0 : _e[eventName];
1338
+ const snapchatPixelEventParamsJson = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _f === void 0 ? void 0 : _f[eventName];
1288
1339
  if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
1289
- window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(snapchatPixelEventParamsJson, product));
1340
+ 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)));
1290
1341
  }
1291
- 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') {
1292
- (_g = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _g === void 0 ? void 0 : _g.trackPageView();
1342
+ 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') {
1343
+ (_h = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _h === void 0 ? void 0 : _h.trackPageView();
1293
1344
  }
1294
- const converApiEventParamsJson = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _h === void 0 ? void 0 : _h[eventName];
1345
+ const converApiEventParamsJson = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _j === void 0 ? void 0 : _j[eventName];
1295
1346
  if (enabledMetaConversionApi && converApiEventParamsJson) {
1296
- const body = getEventParamsByJson(converApiEventParamsJson, product);
1347
+ const body = getEventParamsByJson(Object.assign({ json: converApiEventParamsJson, eventName }, props));
1297
1348
  const params = {};
1298
1349
  const queryString = location.search.slice(1);
1299
- (_j = splitUrlParams(queryString)) === null || _j === void 0 ? void 0 : _j.forEach((val) => {
1350
+ (_k = splitUrlParams(queryString)) === null || _k === void 0 ? void 0 : _k.forEach((val) => {
1300
1351
  const key = val.split('=')[0];
1301
1352
  const value = val.split('=')[1];
1302
1353
  params[key] = value;
1303
1354
  });
1304
1355
  const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
1305
- 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)}` : ''}`, {
1356
+ 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)}` : ''}`, {
1306
1357
  method: 'POST',
1307
1358
  body,
1308
1359
  type: 'beacon'
@@ -1340,7 +1391,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1340
1391
  console.log('e', e);
1341
1392
  }
1342
1393
  }), [bffFetch, utmVal]);
1343
- const ctaEvent = useCallback((eventInfo, rec, product, position) => {
1394
+ const ctaEvent = useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
1344
1395
  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;
1345
1396
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
1346
1397
  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);
@@ -1361,34 +1412,36 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1361
1412
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1362
1413
  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 })
1363
1414
  });
1364
- }, [bffEventReport, isFromHashtag]);
1365
- const h5EnterLink = useCallback(() => {
1366
- var _a, _b, _c;
1367
- const queryString = location.search.slice(1);
1368
- const params = {};
1369
- (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
1370
- const key = val.split('=')[0];
1371
- const value = val.split('=')[1];
1372
- params[key] = value;
1373
- });
1374
- for (const key in params) {
1375
- params[key] = params[key].replace(/%2B/g, '+');
1415
+ if ((eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject) === 'clickCta') {
1416
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
1417
+ eventName: 'ClickCTA',
1418
+ product: product ? [product] : undefined,
1419
+ contentType: contentType !== null && contentType !== void 0 ? contentType : 'post',
1420
+ rec,
1421
+ position,
1422
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
1423
+ cta_action_type: ctaActionType,
1424
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
1425
+ target_url: targetUrl
1426
+ });
1376
1427
  }
1377
- const getVal = (key) => { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ''; };
1428
+ }, [bffEventReport, isFromHashtag, bffFbReport]);
1429
+ const h5EnterLink = useCallback(() => {
1430
+ var _a, _b;
1378
1431
  const time = new Date();
1379
1432
  curTime.current = time;
1380
1433
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1381
1434
  eventInfo: {
1382
1435
  eventSubject: 'h5LinkEnterFeed',
1383
1436
  eventDescription: 'User enter h5 link',
1384
- utmSource: getVal('utm_source'),
1385
- utmMedium: getVal('utm_medium'),
1386
- utmCampaign: getVal('utm_campaign'),
1387
- utmId: getVal('utm_id'),
1388
- utmContent: getVal('utm_content'),
1437
+ utmSource: getUrlParamByKey('utm_source'),
1438
+ utmMedium: getUrlParamByKey('utm_medium'),
1439
+ utmCampaign: getUrlParamByKey('utm_campaign'),
1440
+ utmId: getUrlParamByKey('utm_id'),
1441
+ utmContent: getUrlParamByKey('utm_content'),
1389
1442
  enterTime: Math.floor(time / 1000) + '',
1390
1443
  requestId: null,
1391
- 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 : ''
1444
+ 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 : ''
1392
1445
  },
1393
1446
  reportLayId: false
1394
1447
  });
@@ -10807,7 +10860,7 @@ const CommodityDetail$1 = (_a) => {
10807
10860
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10808
10861
  eventSubject: 'clickCta',
10809
10862
  eventDescription: 'User clicked the CTA'
10810
- }, data, product, position);
10863
+ }, data, product, position, 'open_external_link', product.link, 'product');
10811
10864
  }
10812
10865
  window.location.href = window.getJointUtmLink(product.link);
10813
10866
  }
@@ -10817,11 +10870,17 @@ const CommodityDetail$1 = (_a) => {
10817
10870
  return;
10818
10871
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10819
10872
  eventName: 'ProductView',
10820
- product
10873
+ product: product ? [product] : undefined,
10874
+ contentType: 'product',
10875
+ rec: data,
10876
+ position
10821
10877
  });
10822
10878
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10823
10879
  eventName: 'PageView',
10824
- product
10880
+ product: product ? [product] : undefined,
10881
+ contentType: 'product',
10882
+ rec: data,
10883
+ position
10825
10884
  });
10826
10885
  }, [isActive, bffFbReport]);
10827
10886
  useEffect(() => {
@@ -11714,7 +11773,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
11714
11773
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11715
11774
  eventSubject: 'clickCta',
11716
11775
  eventDescription: 'User clicked the CTA'
11717
- }, data, product, position);
11776
+ }, data, product, position, 'open_external_link', product.link, 'product');
11718
11777
  }
11719
11778
  window.location.href = window.getJointUtmLink(product.link);
11720
11779
  }
@@ -11724,11 +11783,17 @@ const CommodityDetailDiroNew$1 = (_a) => {
11724
11783
  return;
11725
11784
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11726
11785
  eventName: 'ProductView',
11727
- product
11786
+ product: product ? [product] : undefined,
11787
+ contentType: 'product',
11788
+ rec: data,
11789
+ position
11728
11790
  });
11729
11791
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11730
11792
  eventName: 'PageView',
11731
- product
11793
+ product: product ? [product] : undefined,
11794
+ contentType: 'product',
11795
+ rec: data,
11796
+ position
11732
11797
  });
11733
11798
  }, [isActive, bffFbReport]);
11734
11799
  useEffect(() => {
@@ -12398,13 +12463,13 @@ const CommodityList$1 = (_a) => {
12398
12463
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12399
12464
  eventSubject: 'clickCta',
12400
12465
  eventDescription: 'User clicked the CTA'
12401
- }, recData, item, index);
12466
+ }, recData, item, index, isExternalLink && !!(item === null || item === void 0 ? void 0 : item.link) ? 'open_external_link' : 'open_internal_popup', item.link, 'product');
12402
12467
  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 }));
12403
12468
  if (isExternalLink) {
12404
- if (item === null || item === void 0 ? void 0 : item.link) {
12405
- jumpToWeb(e, recData, item, item.bindCta, index);
12406
- window.location.href = window.getJointUtmLink(item.link);
12407
- }
12469
+ if (!(item === null || item === void 0 ? void 0 : item.link))
12470
+ return;
12471
+ jumpToWeb(e, recData, item, item.bindCta, index);
12472
+ window.location.href = window.getJointUtmLink(item.link);
12408
12473
  }
12409
12474
  else {
12410
12475
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -12412,7 +12477,11 @@ const CommodityList$1 = (_a) => {
12412
12477
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
12413
12478
  useEffect(() => {
12414
12479
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
12415
- eventName: 'PageView'
12480
+ eventName: 'PageView',
12481
+ product: (product !== null && product !== void 0 ? product : []),
12482
+ contentType: 'product',
12483
+ rec: recData,
12484
+ position: index
12416
12485
  });
12417
12486
  }, []);
12418
12487
  return (React.createElement("ul", { role: 'list', className: 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) => {
@@ -12930,22 +12999,22 @@ const EventProvider = (_a) => {
12930
12999
  const handleClick = throttle((e) => {
12931
13000
  var _a, _b, _c, _d, _e, _f;
12932
13001
  e.preventDefault();
12933
- 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;
13002
+ 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);
13003
+ 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);
12934
13004
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12935
13005
  eventSubject: 'clickCta',
12936
13006
  eventDescription: 'User clicked the CTA'
12937
- }, rec, item, index);
13007
+ }, rec, item, index, isExternalLink && (jumpLink || !!link) ? 'open_external_link' : 'open_internal_popup', link);
12938
13008
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(multItem && multiCheckIndex !== undefined && multiCheckIndex >= 0
12939
13009
  ? 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 }));
12940
13010
  setElement(ref === null || ref === void 0 ? void 0 : ref.current);
12941
13011
  if (isExternalLink) {
12942
- 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);
12943
- if (jumpLink || link) {
12944
- 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);
12945
- const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
12946
- jumpToWeb(e, rec, product, cta, index);
12947
- window.location.href = window.getJointUtmLink(jumpLink || link || '');
12948
- }
13012
+ if (!jumpLink && !link)
13013
+ return;
13014
+ 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);
13015
+ const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
13016
+ jumpToWeb(e, rec, product, cta, index);
13017
+ window.location.href = window.getJointUtmLink(link);
12949
13018
  }
12950
13019
  else {
12951
13020
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -15535,7 +15604,7 @@ const WaterfallFlowItem$1 = (props) => {
15535
15604
  function WaterfallList$1(_a) {
15536
15605
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
15537
15606
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
15538
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
15607
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex, bffFbReport } = useSxpDataSource();
15539
15608
  const { jumpToWeb } = useEventReport();
15540
15609
  /** 滚动的父元素 */
15541
15610
  const scrollParent = useRef(null);
@@ -15662,8 +15731,20 @@ function WaterfallList$1(_a) {
15662
15731
  }).then((res) => {
15663
15732
  var _a, _b;
15664
15733
  setData(res);
15665
- 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 : []);
15734
+ 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 : [];
15735
+ setList(list);
15666
15736
  setIsLoadingData(false);
15737
+ const products = [];
15738
+ list === null || list === void 0 ? void 0 : list.forEach((item) => {
15739
+ var _a, _b;
15740
+ 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 : []));
15741
+ });
15742
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15743
+ eventName: 'PageView',
15744
+ product: products,
15745
+ rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
15746
+ position: cacheActiveIndex
15747
+ });
15667
15748
  }));
15668
15749
  if (isOpenHashTag) {
15669
15750
  const res = previewData;
@@ -15898,26 +15979,13 @@ const WaterfallFlowItem = (props) => {
15898
15979
  function WaterfallList(_a) {
15899
15980
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
15900
15981
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
15901
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
15982
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex, bffFbReport } = useSxpDataSource();
15902
15983
  const { jumpToWeb } = useEventReport();
15903
15984
  const [list, setList] = useState();
15904
15985
  const [data, setData] = useState();
15905
15986
  const [isLoadingData, setIsLoadingData] = useState(false);
15906
15987
  const containerRef = useRef(null);
15907
15988
  const [isLoadMore, setIsLoadMore] = useState(false);
15908
- useCallback(() => {
15909
- if (isLoadMore)
15910
- return;
15911
- setIsLoadMore(true);
15912
- waterFallData &&
15913
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
15914
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag
15915
- }).then((res) => {
15916
- var _a;
15917
- 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 : []));
15918
- setIsLoadMore(false);
15919
- }));
15920
- }, [waterFallData, getRecommendVideos, list, isLoadMore]);
15921
15989
  useEffect(() => {
15922
15990
  var _a, _b;
15923
15991
  setIsLoadingData(true);
@@ -15929,8 +15997,20 @@ function WaterfallList(_a) {
15929
15997
  }).then((res) => {
15930
15998
  var _a, _b;
15931
15999
  setData(res);
15932
- 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 : []);
16000
+ 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 : [];
16001
+ setList(list);
15933
16002
  setIsLoadingData(false);
16003
+ const products = [];
16004
+ list === null || list === void 0 ? void 0 : list.forEach((item) => {
16005
+ var _a, _b;
16006
+ 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 : []));
16007
+ });
16008
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16009
+ eventName: 'PageView',
16010
+ product: products,
16011
+ rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
16012
+ position: cacheActiveIndex
16013
+ });
15934
16014
  }));
15935
16015
  if (isOpenHashTag) {
15936
16016
  const res = previewData;
@@ -16071,11 +16151,8 @@ const WaterFall = (props) => {
16071
16151
  useEffect(() => {
16072
16152
  if (openHashtag) {
16073
16153
  setViewTime(new Date());
16074
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16075
- eventName: 'PageView'
16076
- });
16077
16154
  }
16078
- }, [openHashtag, bffFbReport]);
16155
+ }, [openHashtag]);
16079
16156
  useEffect(() => {
16080
16157
  const initTime = () => {
16081
16158
  setViewTime(new Date());
@@ -16396,17 +16473,17 @@ const AniLink$1 = (_a) => {
16396
16473
  const handleTo = (e) => {
16397
16474
  var _a, _b, _c, _d;
16398
16475
  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);
16476
+ 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);
16399
16477
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16400
16478
  eventSubject: 'clickCta',
16401
16479
  eventDescription: 'User clicked the CTA'
16402
- }, recData, item, index);
16480
+ }, recData, item, index, (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup', link);
16403
16481
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
16404
16482
  if (isExternalLink) {
16405
- 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);
16406
- if (link) {
16407
- jumpToWeb(e, recData, product, cta, index);
16408
- window.location.href = window.getJointUtmLink(link);
16409
- }
16483
+ if (!link)
16484
+ return;
16485
+ jumpToWeb(e, recData, product, cta, index);
16486
+ window.location.href = window.getJointUtmLink(link);
16410
16487
  }
16411
16488
  else {
16412
16489
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -16897,17 +16974,17 @@ const AniLinkPopup$1 = (_a) => {
16897
16974
  const handleTo = (e) => {
16898
16975
  var _a, _b, _c, _d;
16899
16976
  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);
16977
+ 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);
16900
16978
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16901
16979
  eventSubject: 'clickCta',
16902
16980
  eventDescription: 'User clicked the CTA'
16903
- }, recData, item, index);
16981
+ }, recData, item, index, (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup', link);
16904
16982
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
16905
16983
  if (isExternalLink) {
16906
- 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);
16907
- if (link) {
16908
- jumpToWeb(e, recData, product, cta, index);
16909
- window.location.href = window.getJointUtmLink(link);
16910
- }
16984
+ if (!link)
16985
+ return;
16986
+ jumpToWeb(e, recData, product, cta, index);
16987
+ window.location.href = window.getJointUtmLink(link);
16911
16988
  }
16912
16989
  else {
16913
16990
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -16941,8 +17018,8 @@ const AniLinkPopup$1 = (_a) => {
16941
17018
  height: '40px',
16942
17019
  lineHeight: '40px',
16943
17020
  paddingLeft: '6px'
16944
- } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${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(aniTimStyle)}`, onClick: handleTo }),
16945
- 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 } },
17021
+ } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${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(aniTimStyle)}`, onClick: handleTo }),
17022
+ 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 } },
16946
17023
  React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
16947
17024
  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 }),
16948
17025
  (!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: {
@@ -18133,12 +18210,12 @@ const defaultLikeIconPath$2 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
18133
18210
  const LikeButton = (_a) => {
18134
18211
  var _b;
18135
18212
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
18136
- const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
18213
+ const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList, bffFbReport } = useSxpDataSource();
18137
18214
  const [state, setState] = useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
18138
18215
  const likeIcon = useIconLink(defaultLikeIconPath$2);
18139
18216
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
18140
18217
  const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
18141
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
18218
+ 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;
18142
18219
  if (state) {
18143
18220
  // 先设置状态
18144
18221
  setState(false);
@@ -18184,16 +18261,24 @@ const LikeButton = (_a) => {
18184
18261
  traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
18185
18262
  }
18186
18263
  });
18264
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18265
+ eventName: 'Engagement',
18266
+ product: (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.bindProducts,
18267
+ rec: recData,
18268
+ position,
18269
+ 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 : '',
18270
+ engagement_type: 'like'
18271
+ });
18187
18272
  if (!result) {
18188
18273
  setState(false);
18189
18274
  }
18190
18275
  else {
18191
- const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18276
+ const nRtcList = (_2 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18192
18277
  if (index === position) {
18193
18278
  item.isCollected = true;
18194
18279
  }
18195
18280
  return item;
18196
- })) !== null && _z !== void 0 ? _z : [];
18281
+ })) !== null && _2 !== void 0 ? _2 : [];
18197
18282
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18198
18283
  }
18199
18284
  }
@@ -18505,11 +18590,15 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18505
18590
  if (isActive) {
18506
18591
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18507
18592
  eventName: 'ViewContent',
18508
- 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
18593
+ 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,
18594
+ rec: data === null || data === void 0 ? void 0 : data[index],
18595
+ position: index
18509
18596
  });
18510
18597
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18511
18598
  eventName: 'PageView',
18512
- 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
18599
+ 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,
18600
+ rec: data === null || data === void 0 ? void 0 : data[index],
18601
+ position: index
18513
18602
  });
18514
18603
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
18515
18604
  }
@@ -19161,7 +19250,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19161
19250
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
19162
19251
  }, [data, ctaType, swiperRef]);
19163
19252
  const handleSessionCompleted = useCallback((fk) => {
19164
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
19253
+ 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;
19165
19254
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19166
19255
  let fromKName = '';
19167
19256
  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))) {
@@ -19196,7 +19285,16 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19196
19285
  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 : ''
19197
19286
  }
19198
19287
  });
19199
- }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
19288
+ 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);
19289
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19290
+ eventName: 'ExitFeed',
19291
+ 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] : [],
19292
+ rec: item,
19293
+ position: activeIndex,
19294
+ 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 : '',
19295
+ view_time: new Date() - viewTime.current
19296
+ });
19297
+ }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime, bffFbReport]);
19200
19298
  useEffect(() => {
19201
19299
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19202
19300
  const visibleChange = () => {
@@ -19499,50 +19597,81 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19499
19597
  }
19500
19598
  };
19501
19599
  const handleScrollEvent = (swiper) => {
19502
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
19600
+ 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;
19503
19601
  const item = data[swiper.previousIndex];
19602
+ const activeItem = data[swiper.activeIndex];
19504
19603
  if (!item)
19505
19604
  return;
19506
19605
  let contentFormat = null;
19507
- if ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) {
19606
+ let previousContentType = 'post';
19607
+ 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 : '';
19608
+ let previousProduct = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProducts;
19609
+ 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 : '';
19610
+ let previousDirection = '';
19611
+ 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 : '';
19612
+ if ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.url) {
19508
19613
  contentFormat = 'video';
19509
19614
  }
19510
- 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) {
19615
+ 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) {
19511
19616
  contentFormat = 'image';
19512
19617
  }
19618
+ else {
19619
+ previousContentType = 'product';
19620
+ 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 : '';
19621
+ previousProduct = (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [];
19622
+ 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 : '';
19623
+ }
19624
+ 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)) {
19625
+ 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 : '';
19626
+ }
19513
19627
  if (swiper.previousIndex - swiper.activeIndex < 0) {
19514
19628
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19515
19629
  eventInfo: {
19516
19630
  eventSubject: 'scrollDown',
19517
19631
  eventDescription: 'User scroll down',
19518
- 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 : '',
19519
- 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 : '',
19632
+ 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 : '',
19633
+ 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 : '',
19520
19634
  requestId: null,
19521
- 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 : '',
19635
+ 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 : '',
19522
19636
  contentFormat,
19523
- position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
19637
+ position: ((_3 = swiper.previousIndex) !== null && _3 !== void 0 ? _3 : 0) + ''
19524
19638
  }
19525
19639
  });
19526
19640
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
19527
19641
  handleViewImageStartEnd(item);
19528
19642
  handleSlideSkip(item, swiper.previousIndex);
19643
+ previousDirection = 'up';
19529
19644
  }
19530
19645
  else {
19531
19646
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19532
19647
  eventInfo: {
19533
19648
  eventSubject: 'scrollUp',
19534
19649
  eventDescription: 'User scroll up',
19535
- 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 : '',
19536
- productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
19650
+ 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 : '',
19651
+ productId: (_7 = (_6 = item.product) === null || _6 === void 0 ? void 0 : _6.itemId) !== null && _7 !== void 0 ? _7 : '',
19537
19652
  requestId: null,
19538
- 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 : '',
19653
+ 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 : '',
19539
19654
  contentFormat,
19540
- position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
19655
+ position: ((_12 = swiper.previousIndex) !== null && _12 !== void 0 ? _12 : 0) + ''
19541
19656
  }
19542
19657
  });
19543
19658
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
19544
19659
  handleViewImageStartEnd(item);
19660
+ previousDirection = 'down';
19545
19661
  }
19662
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19663
+ eventName: 'ContentSwipe',
19664
+ product: previousProduct,
19665
+ rec: activeItem,
19666
+ position: swiper.activeIndex,
19667
+ previous_content_id: previousContentId,
19668
+ previous_content_type: previousContentType,
19669
+ previous_contents_name: previousContentsName,
19670
+ previosu_position: swiper.previousIndex,
19671
+ swipe_direction: previousDirection,
19672
+ view_time: new Date() - viewTime.current,
19673
+ content_id: contentId
19674
+ });
19546
19675
  // 商品浏览事件
19547
19676
  handleReportProductView(item);
19548
19677
  viewTime.current = new Date();
@@ -19646,11 +19775,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19646
19775
  if (enableCapi) {
19647
19776
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19648
19777
  eventName: 'ViewContent',
19649
- product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
19778
+ product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProducts,
19779
+ rec: item,
19780
+ position: activeIndex
19650
19781
  });
19651
19782
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19652
19783
  eventName: 'PageView',
19653
- product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
19784
+ product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProducts,
19785
+ rec: item,
19786
+ position: activeIndex
19654
19787
  });
19655
19788
  }
19656
19789
  }
@@ -19709,7 +19842,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19709
19842
  isReload,
19710
19843
  renderToggleButton
19711
19844
  ]);
19712
- return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: { height } },
19845
+ return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container', style: { height: height + minusHeight + tagHeight } },
19713
19846
  (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
19714
19847
  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` })) },
19715
19848
  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: () => {
@@ -19769,7 +19902,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19769
19902
  renderView,
19770
19903
  renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
19771
19904
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
19772
- 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)),
19905
+ 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] })),
19773
19906
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19774
19907
  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' } }))))),
19775
19908
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {