pb-sxp-ui 1.20.2 → 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 +252 -119
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +252 -119
  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 +252 -119
  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 +61 -17
  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 +61 -17
  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.cjs CHANGED
@@ -307,6 +307,20 @@ function deleteCookie(name, path = '/', domain = '') {
307
307
  document.cookie = `${name}=; ${expiration}${pathPart}${domainPart}`;
308
308
  console.log(`已尝试删除Cookie: ${name}`);
309
309
  }
310
+ function getUrlParamByKey(key) {
311
+ var _a, _b;
312
+ const queryString = location.search.slice(1);
313
+ const params = {};
314
+ (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
315
+ const key = val.split('=')[0];
316
+ const value = val.split('=')[1];
317
+ params[key] = value;
318
+ });
319
+ for (const key in params) {
320
+ params[key] = params[key].replace(/%2B/g, '+');
321
+ }
322
+ return (_b = params[key]) !== null && _b !== void 0 ? _b : '';
323
+ }
310
324
 
311
325
  function unzip(b64Data) {
312
326
  const strData = atob(b64Data);
@@ -1201,19 +1215,51 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1201
1215
  playbookType,
1202
1216
  bffDataSource
1203
1217
  ]);
1204
- const getEventParamsByJson = React.useCallback((json, product) => {
1205
- var _a, _b, _c;
1218
+ const getEventParamsByJson = React.useCallback((_a) => {
1219
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1220
+ var { json, product = [], rec, contentType = 'post', position, eventName } = _a, props = __rest(_a, ["json", "product", "rec", "contentType", "position", "eventName"]);
1206
1221
  const jsonParams = lodash.cloneDeep(json);
1207
1222
  const urlParams = new URLSearchParams(window.location.search);
1208
1223
  const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
1209
1224
  const fix_par = {
1210
- event_source_url: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href,
1225
+ event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
1211
1226
  external_id: fakeUserId,
1212
- 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 : '',
1227
+ 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 : '',
1213
1228
  fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
1214
1229
  fbp: getCookie('_fbp') ? `${getCookie('_fbp')}` : '',
1215
1230
  time: Math.floor(Date.now() / 1000)
1216
1231
  };
1232
+ let customData = Object.assign({
1233
+ // funnel_type
1234
+ 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,
1235
+ // content_category
1236
+ 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) => ({
1237
+ item_id: item === null || item === void 0 ? void 0 : item.itemId,
1238
+ item_price: item === null || item === void 0 ? void 0 : item.price
1239
+ }))) !== 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,
1240
+ // prompt
1241
+ 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);
1242
+ 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) {
1243
+ const product = rec === null || rec === void 0 ? void 0 : rec.product;
1244
+ const productCustomData = {
1245
+ content_ids: [product === null || product === void 0 ? void 0 : product.itemId],
1246
+ content_type: 'product',
1247
+ content_name: product === null || product === void 0 ? void 0 : product.title,
1248
+ contents: [{
1249
+ item_id: product === null || product === void 0 ? void 0 : product.itemId,
1250
+ item_price: product === null || product === void 0 ? void 0 : product.price
1251
+ }],
1252
+ image_urls: (_s = product.homePage) !== null && _s !== void 0 ? _s : []
1253
+ };
1254
+ customData = Object.assign(Object.assign({}, customData), productCustomData);
1255
+ }
1256
+ if (eventName === 'ContentSwipe' || eventName === 'Engagement' || eventName === 'ExitFeed') {
1257
+ const deleteKeys = ['content_ids', 'content_category', 'currency', 'contents', 'image_urls', 'video_urls', 'prompt'];
1258
+ deleteKeys.forEach(key => {
1259
+ if (customData === null || customData === void 0 ? void 0 : customData[key])
1260
+ delete customData[key];
1261
+ });
1262
+ }
1217
1263
  const regex = /\{\{(.*?)\}\}/g;
1218
1264
  const getEventParams = (obj) => {
1219
1265
  if (!obj)
@@ -1226,6 +1272,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1226
1272
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
1227
1273
  const value = obj === null || obj === void 0 ? void 0 : obj[key];
1228
1274
  if (typeof value === 'object') {
1275
+ if (key === 'custom_data') {
1276
+ obj[key] = customData !== null && customData !== void 0 ? customData : {};
1277
+ }
1229
1278
  getEventParams(value);
1230
1279
  }
1231
1280
  else if (typeof value === 'string') {
@@ -1235,7 +1284,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1235
1284
  var _a;
1236
1285
  const prop = match.substring(2, match.length - 2);
1237
1286
  try {
1238
- let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
1287
+ let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product === null || product === void 0 ? void 0 : product[0]);
1239
1288
  if (replaceValue) {
1240
1289
  if ((prop === null || prop === void 0 ? void 0 : prop.indexOf('currency')) !== -1 &&
1241
1290
  (replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.indexOf('-')) !== -1 &&
@@ -1260,15 +1309,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1260
1309
  }
1261
1310
  };
1262
1311
  getEventParams(jsonParams);
1312
+ console.log('capi event params:', jsonParams);
1263
1313
  return jsonParams;
1264
- }, [fakeUserId]);
1265
- const bffFbReport = React.useCallback(({ eventName, product }) => {
1266
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1314
+ }, [fakeUserId, globalConfig, rtcList]);
1315
+ const bffFbReport = React.useCallback((_a) => {
1316
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1317
+ var { eventName } = _a, props = __rest(_a, ["eventName"]);
1267
1318
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || getTargetingCookie()) {
1268
1319
  return;
1269
1320
  }
1270
1321
  let isPushState = false;
1271
- const pixelEventParamsJson = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _a === void 0 ? void 0 : _a[eventName];
1322
+ const pixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _b === void 0 ? void 0 : _b[eventName];
1272
1323
  if ((pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
1273
1324
  function updateQueryStringParameter(uri, key, value) {
1274
1325
  const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
@@ -1292,39 +1343,39 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1292
1343
  }
1293
1344
  }
1294
1345
  else {
1295
- window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, getEventParamsByJson(pixelEventParamsJson, product));
1346
+ 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)));
1296
1347
  }
1297
1348
  }
1298
1349
  if (!isPushState) {
1299
1350
  if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
1300
1351
  window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
1301
1352
  }
1302
- const tiktokPixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _b === void 0 ? void 0 : _b[eventName];
1353
+ const tiktokPixelEventParamsJson = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _c === void 0 ? void 0 : _c[eventName];
1303
1354
  if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) &&
1304
1355
  typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'object' &&
1305
- typeof ((_c = window === null || window === void 0 ? void 0 : window.ttq) === null || _c === void 0 ? void 0 : _c.track) === 'function') {
1306
- (_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));
1356
+ typeof ((_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track) === 'function') {
1357
+ (_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)));
1307
1358
  }
1308
1359
  }
1309
- const snapchatPixelEventParamsJson = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _e === void 0 ? void 0 : _e[eventName];
1360
+ const snapchatPixelEventParamsJson = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _f === void 0 ? void 0 : _f[eventName];
1310
1361
  if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
1311
- window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(snapchatPixelEventParamsJson, product));
1362
+ 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)));
1312
1363
  }
1313
- 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') {
1314
- (_g = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _g === void 0 ? void 0 : _g.trackPageView();
1364
+ 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') {
1365
+ (_h = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _h === void 0 ? void 0 : _h.trackPageView();
1315
1366
  }
1316
- const converApiEventParamsJson = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _h === void 0 ? void 0 : _h[eventName];
1367
+ const converApiEventParamsJson = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _j === void 0 ? void 0 : _j[eventName];
1317
1368
  if (enabledMetaConversionApi && converApiEventParamsJson) {
1318
- const body = getEventParamsByJson(converApiEventParamsJson, product);
1369
+ const body = getEventParamsByJson(Object.assign({ json: converApiEventParamsJson, eventName }, props));
1319
1370
  const params = {};
1320
1371
  const queryString = location.search.slice(1);
1321
- (_j = splitUrlParams(queryString)) === null || _j === void 0 ? void 0 : _j.forEach((val) => {
1372
+ (_k = splitUrlParams(queryString)) === null || _k === void 0 ? void 0 : _k.forEach((val) => {
1322
1373
  const key = val.split('=')[0];
1323
1374
  const value = val.split('=')[1];
1324
1375
  params[key] = value;
1325
1376
  });
1326
1377
  const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
1327
- 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)}` : ''}`, {
1378
+ 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)}` : ''}`, {
1328
1379
  method: 'POST',
1329
1380
  body,
1330
1381
  type: 'beacon'
@@ -1362,7 +1413,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1362
1413
  console.log('e', e);
1363
1414
  }
1364
1415
  }), [bffFetch, utmVal]);
1365
- const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
1416
+ const ctaEvent = React.useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
1366
1417
  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;
1367
1418
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
1368
1419
  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);
@@ -1383,34 +1434,36 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1383
1434
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1384
1435
  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 })
1385
1436
  });
1386
- }, [bffEventReport, isFromHashtag]);
1387
- const h5EnterLink = React.useCallback(() => {
1388
- var _a, _b, _c;
1389
- const queryString = location.search.slice(1);
1390
- const params = {};
1391
- (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
1392
- const key = val.split('=')[0];
1393
- const value = val.split('=')[1];
1394
- params[key] = value;
1395
- });
1396
- for (const key in params) {
1397
- params[key] = params[key].replace(/%2B/g, '+');
1437
+ if ((eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject) === 'clickCta') {
1438
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
1439
+ eventName: 'ClickCTA',
1440
+ product: product ? [product] : undefined,
1441
+ contentType: contentType !== null && contentType !== void 0 ? contentType : 'post',
1442
+ rec,
1443
+ position,
1444
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
1445
+ cta_action_type: ctaActionType,
1446
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
1447
+ target_url: targetUrl
1448
+ });
1398
1449
  }
1399
- const getVal = (key) => { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ''; };
1450
+ }, [bffEventReport, isFromHashtag, bffFbReport]);
1451
+ const h5EnterLink = React.useCallback(() => {
1452
+ var _a, _b;
1400
1453
  const time = new Date();
1401
1454
  curTime.current = time;
1402
1455
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1403
1456
  eventInfo: {
1404
1457
  eventSubject: 'h5LinkEnterFeed',
1405
1458
  eventDescription: 'User enter h5 link',
1406
- utmSource: getVal('utm_source'),
1407
- utmMedium: getVal('utm_medium'),
1408
- utmCampaign: getVal('utm_campaign'),
1409
- utmId: getVal('utm_id'),
1410
- utmContent: getVal('utm_content'),
1459
+ utmSource: getUrlParamByKey('utm_source'),
1460
+ utmMedium: getUrlParamByKey('utm_medium'),
1461
+ utmCampaign: getUrlParamByKey('utm_campaign'),
1462
+ utmId: getUrlParamByKey('utm_id'),
1463
+ utmContent: getUrlParamByKey('utm_content'),
1411
1464
  enterTime: Math.floor(time / 1000) + '',
1412
1465
  requestId: null,
1413
- 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 : ''
1466
+ 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 : ''
1414
1467
  },
1415
1468
  reportLayId: false
1416
1469
  });
@@ -10829,7 +10882,7 @@ const CommodityDetail$1 = (_a) => {
10829
10882
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
10830
10883
  eventSubject: 'clickCta',
10831
10884
  eventDescription: 'User clicked the CTA'
10832
- }, data, product, position);
10885
+ }, data, product, position, 'open_external_link', product.link, 'product');
10833
10886
  }
10834
10887
  window.location.href = window.getJointUtmLink(product.link);
10835
10888
  }
@@ -10839,11 +10892,17 @@ const CommodityDetail$1 = (_a) => {
10839
10892
  return;
10840
10893
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10841
10894
  eventName: 'ProductView',
10842
- product
10895
+ product: product ? [product] : undefined,
10896
+ contentType: 'product',
10897
+ rec: data,
10898
+ position
10843
10899
  });
10844
10900
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10845
10901
  eventName: 'PageView',
10846
- product
10902
+ product: product ? [product] : undefined,
10903
+ contentType: 'product',
10904
+ rec: data,
10905
+ position
10847
10906
  });
10848
10907
  }, [isActive, bffFbReport]);
10849
10908
  React.useEffect(() => {
@@ -11736,7 +11795,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
11736
11795
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
11737
11796
  eventSubject: 'clickCta',
11738
11797
  eventDescription: 'User clicked the CTA'
11739
- }, data, product, position);
11798
+ }, data, product, position, 'open_external_link', product.link, 'product');
11740
11799
  }
11741
11800
  window.location.href = window.getJointUtmLink(product.link);
11742
11801
  }
@@ -11746,11 +11805,17 @@ const CommodityDetailDiroNew$1 = (_a) => {
11746
11805
  return;
11747
11806
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11748
11807
  eventName: 'ProductView',
11749
- product
11808
+ product: product ? [product] : undefined,
11809
+ contentType: 'product',
11810
+ rec: data,
11811
+ position
11750
11812
  });
11751
11813
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11752
11814
  eventName: 'PageView',
11753
- product
11815
+ product: product ? [product] : undefined,
11816
+ contentType: 'product',
11817
+ rec: data,
11818
+ position
11754
11819
  });
11755
11820
  }, [isActive, bffFbReport]);
11756
11821
  React.useEffect(() => {
@@ -12420,13 +12485,13 @@ const CommodityList$1 = (_a) => {
12420
12485
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12421
12486
  eventSubject: 'clickCta',
12422
12487
  eventDescription: 'User clicked the CTA'
12423
- }, recData, item, index);
12488
+ }, recData, item, index, isExternalLink && !!(item === null || item === void 0 ? void 0 : item.link) ? 'open_external_link' : 'open_internal_popup', item.link, 'product');
12424
12489
  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 }));
12425
12490
  if (isExternalLink) {
12426
- if (item === null || item === void 0 ? void 0 : item.link) {
12427
- jumpToWeb(e, recData, item, item.bindCta, index);
12428
- window.location.href = window.getJointUtmLink(item.link);
12429
- }
12491
+ if (!(item === null || item === void 0 ? void 0 : item.link))
12492
+ return;
12493
+ jumpToWeb(e, recData, item, item.bindCta, index);
12494
+ window.location.href = window.getJointUtmLink(item.link);
12430
12495
  }
12431
12496
  else {
12432
12497
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -12434,7 +12499,11 @@ const CommodityList$1 = (_a) => {
12434
12499
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
12435
12500
  React.useEffect(() => {
12436
12501
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
12437
- eventName: 'PageView'
12502
+ eventName: 'PageView',
12503
+ product: (product !== null && product !== void 0 ? product : []),
12504
+ contentType: 'product',
12505
+ rec: recData,
12506
+ position: index
12438
12507
  });
12439
12508
  }, []);
12440
12509
  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) => {
@@ -12952,22 +13021,22 @@ const EventProvider = (_a) => {
12952
13021
  const handleClick = lodash.throttle((e) => {
12953
13022
  var _a, _b, _c, _d, _e, _f;
12954
13023
  e.preventDefault();
12955
- 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;
13024
+ 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);
13025
+ 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);
12956
13026
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12957
13027
  eventSubject: 'clickCta',
12958
13028
  eventDescription: 'User clicked the CTA'
12959
- }, rec, item, index);
13029
+ }, rec, item, index, isExternalLink && (jumpLink || !!link) ? 'open_external_link' : 'open_internal_popup', link);
12960
13030
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(multItem && multiCheckIndex !== undefined && multiCheckIndex >= 0
12961
13031
  ? 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 }));
12962
13032
  setElement(ref === null || ref === void 0 ? void 0 : ref.current);
12963
13033
  if (isExternalLink) {
12964
- 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);
12965
- if (jumpLink || link) {
12966
- 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);
12967
- const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
12968
- jumpToWeb(e, rec, product, cta, index);
12969
- window.location.href = window.getJointUtmLink(jumpLink || link || '');
12970
- }
13034
+ if (!jumpLink && !link)
13035
+ return;
13036
+ 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);
13037
+ const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
13038
+ jumpToWeb(e, rec, product, cta, index);
13039
+ window.location.href = window.getJointUtmLink(link);
12971
13040
  }
12972
13041
  else {
12973
13042
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -15557,7 +15626,7 @@ const WaterfallFlowItem$1 = (props) => {
15557
15626
  function WaterfallList$1(_a) {
15558
15627
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
15559
15628
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
15560
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
15629
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex, bffFbReport } = useSxpDataSource();
15561
15630
  const { jumpToWeb } = useEventReport();
15562
15631
  /** 滚动的父元素 */
15563
15632
  const scrollParent = React.useRef(null);
@@ -15684,8 +15753,20 @@ function WaterfallList$1(_a) {
15684
15753
  }).then((res) => {
15685
15754
  var _a, _b;
15686
15755
  setData(res);
15687
- 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 : []);
15756
+ 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 : [];
15757
+ setList(list);
15688
15758
  setIsLoadingData(false);
15759
+ const products = [];
15760
+ list === null || list === void 0 ? void 0 : list.forEach((item) => {
15761
+ var _a, _b;
15762
+ 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 : []));
15763
+ });
15764
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
15765
+ eventName: 'PageView',
15766
+ product: products,
15767
+ rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
15768
+ position: cacheActiveIndex
15769
+ });
15689
15770
  }));
15690
15771
  if (isOpenHashTag) {
15691
15772
  const res = previewData;
@@ -15920,26 +16001,13 @@ const WaterfallFlowItem = (props) => {
15920
16001
  function WaterfallList(_a) {
15921
16002
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
15922
16003
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
15923
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
16004
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex, bffFbReport } = useSxpDataSource();
15924
16005
  const { jumpToWeb } = useEventReport();
15925
16006
  const [list, setList] = React.useState();
15926
16007
  const [data, setData] = React.useState();
15927
16008
  const [isLoadingData, setIsLoadingData] = React.useState(false);
15928
16009
  const containerRef = React.useRef(null);
15929
16010
  const [isLoadMore, setIsLoadMore] = React.useState(false);
15930
- React.useCallback(() => {
15931
- if (isLoadMore)
15932
- return;
15933
- setIsLoadMore(true);
15934
- waterFallData &&
15935
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
15936
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag
15937
- }).then((res) => {
15938
- var _a;
15939
- 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 : []));
15940
- setIsLoadMore(false);
15941
- }));
15942
- }, [waterFallData, getRecommendVideos, list, isLoadMore]);
15943
16011
  React.useEffect(() => {
15944
16012
  var _a, _b;
15945
16013
  setIsLoadingData(true);
@@ -15951,8 +16019,20 @@ function WaterfallList(_a) {
15951
16019
  }).then((res) => {
15952
16020
  var _a, _b;
15953
16021
  setData(res);
15954
- 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 : []);
16022
+ 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 : [];
16023
+ setList(list);
15955
16024
  setIsLoadingData(false);
16025
+ const products = [];
16026
+ list === null || list === void 0 ? void 0 : list.forEach((item) => {
16027
+ var _a, _b;
16028
+ 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 : []));
16029
+ });
16030
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16031
+ eventName: 'PageView',
16032
+ product: products,
16033
+ rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
16034
+ position: cacheActiveIndex
16035
+ });
15956
16036
  }));
15957
16037
  if (isOpenHashTag) {
15958
16038
  const res = previewData;
@@ -16093,11 +16173,8 @@ const WaterFall = (props) => {
16093
16173
  React.useEffect(() => {
16094
16174
  if (openHashtag) {
16095
16175
  setViewTime(new Date());
16096
- bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16097
- eventName: 'PageView'
16098
- });
16099
16176
  }
16100
- }, [openHashtag, bffFbReport]);
16177
+ }, [openHashtag]);
16101
16178
  React.useEffect(() => {
16102
16179
  const initTime = () => {
16103
16180
  setViewTime(new Date());
@@ -16418,17 +16495,17 @@ const AniLink$1 = (_a) => {
16418
16495
  const handleTo = (e) => {
16419
16496
  var _a, _b, _c, _d;
16420
16497
  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);
16498
+ 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
16499
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16422
16500
  eventSubject: 'clickCta',
16423
16501
  eventDescription: 'User clicked the CTA'
16424
- }, recData, item, index);
16502
+ }, recData, item, index, (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup', link);
16425
16503
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
16426
16504
  if (isExternalLink) {
16427
- 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);
16428
- if (link) {
16429
- jumpToWeb(e, recData, product, cta, index);
16430
- window.location.href = window.getJointUtmLink(link);
16431
- }
16505
+ if (!link)
16506
+ return;
16507
+ jumpToWeb(e, recData, product, cta, index);
16508
+ window.location.href = window.getJointUtmLink(link);
16432
16509
  }
16433
16510
  else {
16434
16511
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -16919,17 +16996,17 @@ const AniLinkPopup$1 = (_a) => {
16919
16996
  const handleTo = (e) => {
16920
16997
  var _a, _b, _c, _d;
16921
16998
  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);
16999
+ 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
17000
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16923
17001
  eventSubject: 'clickCta',
16924
17002
  eventDescription: 'User clicked the CTA'
16925
- }, recData, item, index);
17003
+ }, recData, item, index, (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup', link);
16926
17004
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
16927
17005
  if (isExternalLink) {
16928
- 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);
16929
- if (link) {
16930
- jumpToWeb(e, recData, product, cta, index);
16931
- window.location.href = window.getJointUtmLink(link);
16932
- }
17006
+ if (!link)
17007
+ return;
17008
+ jumpToWeb(e, recData, product, cta, index);
17009
+ window.location.href = window.getJointUtmLink(link);
16933
17010
  }
16934
17011
  else {
16935
17012
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -16963,8 +17040,8 @@ const AniLinkPopup$1 = (_a) => {
16963
17040
  height: '40px',
16964
17041
  lineHeight: '40px',
16965
17042
  paddingLeft: '6px'
16966
- } }, "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 }),
16967
- 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 } },
17043
+ } }, "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 }),
17044
+ 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 } },
16968
17045
  React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
16969
17046
  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 }),
16970
17047
  (!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: {
@@ -18155,12 +18232,12 @@ const defaultLikeIconPath$2 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
18155
18232
  const LikeButton = (_a) => {
18156
18233
  var _b;
18157
18234
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
18158
- const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
18235
+ const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList, bffFbReport } = useSxpDataSource();
18159
18236
  const [state, setState] = React.useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
18160
18237
  const likeIcon = useIconLink(defaultLikeIconPath$2);
18161
18238
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
18162
18239
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
18163
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
18240
+ 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;
18164
18241
  if (state) {
18165
18242
  // 先设置状态
18166
18243
  setState(false);
@@ -18206,16 +18283,24 @@ const LikeButton = (_a) => {
18206
18283
  traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
18207
18284
  }
18208
18285
  });
18286
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18287
+ eventName: 'Engagement',
18288
+ product: (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.bindProducts,
18289
+ rec: recData,
18290
+ position,
18291
+ 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 : '',
18292
+ engagement_type: 'like'
18293
+ });
18209
18294
  if (!result) {
18210
18295
  setState(false);
18211
18296
  }
18212
18297
  else {
18213
- const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18298
+ const nRtcList = (_2 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18214
18299
  if (index === position) {
18215
18300
  item.isCollected = true;
18216
18301
  }
18217
18302
  return item;
18218
- })) !== null && _z !== void 0 ? _z : [];
18303
+ })) !== null && _2 !== void 0 ? _2 : [];
18219
18304
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18220
18305
  }
18221
18306
  }
@@ -18527,11 +18612,15 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18527
18612
  if (isActive) {
18528
18613
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18529
18614
  eventName: 'ViewContent',
18530
- 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
18615
+ 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,
18616
+ rec: data === null || data === void 0 ? void 0 : data[index],
18617
+ position: index
18531
18618
  });
18532
18619
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18533
18620
  eventName: 'PageView',
18534
- 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
18621
+ 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,
18622
+ rec: data === null || data === void 0 ? void 0 : data[index],
18623
+ position: index
18535
18624
  });
18536
18625
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
18537
18626
  }
@@ -19183,7 +19272,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19183
19272
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
19184
19273
  }, [data, ctaType, swiperRef]);
19185
19274
  const handleSessionCompleted = React.useCallback((fk) => {
19186
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
19275
+ 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;
19187
19276
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19188
19277
  let fromKName = '';
19189
19278
  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))) {
@@ -19218,7 +19307,16 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19218
19307
  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 : ''
19219
19308
  }
19220
19309
  });
19221
- }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
19310
+ 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);
19311
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19312
+ eventName: 'ExitFeed',
19313
+ 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] : [],
19314
+ rec: item,
19315
+ position: activeIndex,
19316
+ 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 : '',
19317
+ view_time: new Date() - viewTime.current
19318
+ });
19319
+ }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime, bffFbReport]);
19222
19320
  React.useEffect(() => {
19223
19321
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19224
19322
  const visibleChange = () => {
@@ -19521,50 +19619,81 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19521
19619
  }
19522
19620
  };
19523
19621
  const handleScrollEvent = (swiper) => {
19524
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
19622
+ 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;
19525
19623
  const item = data[swiper.previousIndex];
19624
+ const activeItem = data[swiper.activeIndex];
19526
19625
  if (!item)
19527
19626
  return;
19528
19627
  let contentFormat = null;
19529
- if ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) {
19628
+ let previousContentType = 'post';
19629
+ 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 : '';
19630
+ let previousProduct = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProducts;
19631
+ 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 : '';
19632
+ let previousDirection = '';
19633
+ 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 : '';
19634
+ if ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.url) {
19530
19635
  contentFormat = 'video';
19531
19636
  }
19532
- 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) {
19637
+ 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) {
19533
19638
  contentFormat = 'image';
19534
19639
  }
19640
+ else {
19641
+ previousContentType = 'product';
19642
+ 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 : '';
19643
+ previousProduct = (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [];
19644
+ 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 : '';
19645
+ }
19646
+ 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)) {
19647
+ 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 : '';
19648
+ }
19535
19649
  if (swiper.previousIndex - swiper.activeIndex < 0) {
19536
19650
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19537
19651
  eventInfo: {
19538
19652
  eventSubject: 'scrollDown',
19539
19653
  eventDescription: 'User scroll down',
19540
- 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 : '',
19541
- 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 : '',
19654
+ 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 : '',
19655
+ 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 : '',
19542
19656
  requestId: null,
19543
- 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 : '',
19657
+ 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 : '',
19544
19658
  contentFormat,
19545
- position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
19659
+ position: ((_3 = swiper.previousIndex) !== null && _3 !== void 0 ? _3 : 0) + ''
19546
19660
  }
19547
19661
  });
19548
19662
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
19549
19663
  handleViewImageStartEnd(item);
19550
19664
  handleSlideSkip(item, swiper.previousIndex);
19665
+ previousDirection = 'up';
19551
19666
  }
19552
19667
  else {
19553
19668
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19554
19669
  eventInfo: {
19555
19670
  eventSubject: 'scrollUp',
19556
19671
  eventDescription: 'User scroll up',
19557
- 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 : '',
19558
- productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
19672
+ 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 : '',
19673
+ productId: (_7 = (_6 = item.product) === null || _6 === void 0 ? void 0 : _6.itemId) !== null && _7 !== void 0 ? _7 : '',
19559
19674
  requestId: null,
19560
- 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 : '',
19675
+ 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 : '',
19561
19676
  contentFormat,
19562
- position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
19677
+ position: ((_12 = swiper.previousIndex) !== null && _12 !== void 0 ? _12 : 0) + ''
19563
19678
  }
19564
19679
  });
19565
19680
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
19566
19681
  handleViewImageStartEnd(item);
19682
+ previousDirection = 'down';
19567
19683
  }
19684
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19685
+ eventName: 'ContentSwipe',
19686
+ product: previousProduct,
19687
+ rec: activeItem,
19688
+ position: swiper.activeIndex,
19689
+ previous_content_id: previousContentId,
19690
+ previous_content_type: previousContentType,
19691
+ previous_contents_name: previousContentsName,
19692
+ previosu_position: swiper.previousIndex,
19693
+ swipe_direction: previousDirection,
19694
+ view_time: new Date() - viewTime.current,
19695
+ content_id: contentId
19696
+ });
19568
19697
  // 商品浏览事件
19569
19698
  handleReportProductView(item);
19570
19699
  viewTime.current = new Date();
@@ -19668,11 +19797,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19668
19797
  if (enableCapi) {
19669
19798
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19670
19799
  eventName: 'ViewContent',
19671
- product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
19800
+ product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProducts,
19801
+ rec: item,
19802
+ position: activeIndex
19672
19803
  });
19673
19804
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19674
19805
  eventName: 'PageView',
19675
- product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
19806
+ product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProducts,
19807
+ rec: item,
19808
+ position: activeIndex
19676
19809
  });
19677
19810
  }
19678
19811
  }
@@ -19791,7 +19924,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19791
19924
  renderView,
19792
19925
  renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
19793
19926
  renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
19794
- 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)),
19927
+ 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] })),
19795
19928
  React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19796
19929
  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' } }))))),
19797
19930
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: {