pb-sxp-ui 1.16.19 → 1.16.20

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 (33) hide show
  1. package/dist/index.cjs +192 -228
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +192 -228
  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 +192 -228
  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/DiyPortalPreview/VideoWidget.js +8 -10
  14. package/es/core/components/SxpPageRender/LikeButton/index.js +16 -18
  15. package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
  16. package/es/core/components/SxpPageRender/PictureGroup/index.js +13 -39
  17. package/es/core/components/SxpPageRender/VideoWidget/index.js +45 -32
  18. package/es/core/components/SxpPageRender/WaterFall/index.js +3 -4
  19. package/es/core/components/SxpPageRender/index.js +37 -53
  20. package/es/core/context/SxpDataSourceProvider.d.ts +12 -5
  21. package/es/core/context/SxpDataSourceProvider.js +63 -63
  22. package/es/core/hooks/useEventReport.js +5 -6
  23. package/lib/core/components/DiyPortalPreview/VideoWidget.js +8 -10
  24. package/lib/core/components/SxpPageRender/LikeButton/index.js +16 -18
  25. package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +0 -5
  26. package/lib/core/components/SxpPageRender/PictureGroup/index.js +12 -38
  27. package/lib/core/components/SxpPageRender/VideoWidget/index.js +45 -32
  28. package/lib/core/components/SxpPageRender/WaterFall/index.js +3 -4
  29. package/lib/core/components/SxpPageRender/index.js +37 -53
  30. package/lib/core/context/SxpDataSourceProvider.d.ts +12 -5
  31. package/lib/core/context/SxpDataSourceProvider.js +63 -63
  32. package/lib/core/hooks/useEventReport.js +5 -6
  33. package/package.json +1 -1
package/dist/pb-ui.js CHANGED
@@ -637,7 +637,6 @@
637
637
  const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent = true, maxSize, defaultSize, isPreview = false, sxpParameter, appDomain, hashTagSize, loadingImage, isOpenHashTag = false, enabledMetaConversionApi = false, consentHeight, consentWidth, isOpenConsent = false, isEditor = false, utmParameter, channelQueryList, data, dataList, isDiyH5, onUpdateSchema, onUpdateChannel }) => {
638
638
  var _a, _b, _c, _d, _e;
639
639
  const [rtcList, setRtcList] = React.useState([]);
640
- const [firstRtcList, setFirstRtcList] = React.useState([]);
641
640
  const [tagList, setTagList] = React.useState([]);
642
641
  const [loading, setLoading] = React.useState(true);
643
642
  const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
@@ -731,7 +730,7 @@
731
730
  }, [bffDataSource]);
732
731
  // bff API 请求方法
733
732
  const bffFetch = React.useCallback((path, options, isBota = true) => {
734
- var _a, _b;
733
+ var _a;
735
734
  if (!bffDataSource)
736
735
  return;
737
736
  const url = bffDataSource.url;
@@ -744,9 +743,8 @@
744
743
  val.split('=')[0];
745
744
  val.split('=')[1];
746
745
  });
747
- options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
748
746
  return window
749
- .fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId, 'tenant-id': (_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id'] }, bffDataSource.headers), method: options.method, body: options.type === 'beacon' && isBota
747
+ .fetch(`${url}/api/${path}`, Object.assign({ headers: Object.assign({ 'Content-Type': 'application/json', 'x-user-id': fakeUserId }, bffDataSource.headers), method: options.method, body: options.type === 'beacon' && isBota
750
748
  ? JSON.stringify({
751
749
  body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
752
750
  })
@@ -881,50 +879,66 @@
881
879
  console.error('解析请求URL失败:', error);
882
880
  return _originalFetch.apply(this, arguments_1);
883
881
  }
884
- // 非GA4请求直接放行
885
- if (!url.includes('https://www.google-analytics.com/g/collect')) {
886
- return _originalFetch.apply(this, arguments_1);
887
- }
888
- // 检查是否是 GA4 收集端点
889
882
  try {
890
883
  // 1. 先执行原始请求
891
884
  const response = _originalFetch.apply(this, arguments_1);
892
- // 2. 检查请求是否成功 (HTTP 200-299)
893
- // 安全解析 URL
894
- const urlObj = new URL(url);
895
- const params = Object.fromEntries(urlObj.searchParams.entries());
896
- const body = (_a = arguments_1[1]) === null || _a === void 0 ? void 0 : _a.body;
897
- if (params === null || params === void 0 ? void 0 : params.en) {
898
- bffCollectEvent({
899
- eventName: params === null || params === void 0 ? void 0 : params.en,
900
- eventSource: 'Google Analytics'
901
- });
902
- }
903
- else if (body) {
904
- function extractAllEnValuesSplit(queryString) {
905
- if (typeof queryString !== 'string') {
906
- return [];
885
+ if (url.includes('https://i.giesswein.com/nb-collector')) {
886
+ if ((init === null || init === void 0 ? void 0 : init.method) === 'POST' && typeof (init === null || init === void 0 ? void 0 : init.body) === 'string') {
887
+ try {
888
+ const payload = JSON.parse(init.body);
889
+ if (payload && Array.isArray(payload.data)) {
890
+ payload.data.forEach((item) => {
891
+ if (item && item.e) {
892
+ bffCollectEvent({
893
+ eventName: item.e,
894
+ eventSource: 'Northbeam Pixel'
895
+ });
896
+ }
897
+ });
898
+ }
907
899
  }
908
- const matches = [];
909
- const regex = /en=([^&\r\n]*)/g;
910
- let match;
911
- while ((match = regex.exec(queryString)) !== null) {
912
- matches.push(decodeURIComponent(match[1]));
900
+ catch (e) {
901
+ console.error('Failed to parse Northbeam event', e);
913
902
  }
914
- return matches;
915
903
  }
916
- const enValues = extractAllEnValuesSplit(body);
917
- enValues === null || enValues === void 0 ? void 0 : enValues.forEach((en) => {
904
+ }
905
+ // 检查是否是 GA4 收集端点
906
+ if (url.includes('https://www.google-analytics.com/g/collect')) {
907
+ const urlObj = new URL(url);
908
+ const params = Object.fromEntries(urlObj.searchParams.entries());
909
+ const body = (_a = arguments_1[1]) === null || _a === void 0 ? void 0 : _a.body;
910
+ if (params === null || params === void 0 ? void 0 : params.en) {
918
911
  bffCollectEvent({
919
- eventName: en,
912
+ eventName: params === null || params === void 0 ? void 0 : params.en,
920
913
  eventSource: 'Google Analytics'
921
914
  });
922
- });
915
+ }
916
+ else if (body) {
917
+ function extractAllEnValuesSplit(queryString) {
918
+ if (typeof queryString !== 'string') {
919
+ return [];
920
+ }
921
+ const matches = [];
922
+ const regex = /en=([^&\r\n]*)/g;
923
+ let match;
924
+ while ((match = regex.exec(queryString)) !== null) {
925
+ matches.push(decodeURIComponent(match[1]));
926
+ }
927
+ return matches;
928
+ }
929
+ const enValues = extractAllEnValuesSplit(body);
930
+ enValues === null || enValues === void 0 ? void 0 : enValues.forEach((en) => {
931
+ bffCollectEvent({
932
+ eventName: en,
933
+ eventSource: 'Google Analytics'
934
+ });
935
+ });
936
+ }
923
937
  }
924
938
  return response;
925
939
  }
926
940
  catch (error) {
927
- console.error('处理 GA4 请求时出错:', error);
941
+ console.error(error);
928
942
  throw error;
929
943
  }
930
944
  });
@@ -990,9 +1004,6 @@
990
1004
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
991
1005
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
992
1006
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
993
- if (isDiyH5) {
994
- setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
995
- }
996
1007
  }
997
1008
  const isNotNullList = (_0 = (_z = result === null || result === void 0 ? void 0 : result.data) === null || _z === void 0 ? void 0 : _z.recList) === null || _0 === void 0 ? void 0 : _0.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
998
1009
  if (isNotNullList) {
@@ -1032,17 +1043,12 @@
1032
1043
  if (rtcList.length <= 0) {
1033
1044
  return;
1034
1045
  }
1035
- if (isDiyH5 && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
1036
- setRtcList(rtcList.concat(firstRtcList));
1037
- setCacheRtcList(cacheRtcList.concat(firstRtcList));
1038
- return;
1039
- }
1040
1046
  const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
1041
1047
  const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_1 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _1 === void 0 ? void 0 : _1.itemId) && { productFilter: [(_2 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _2 === void 0 ? void 0 : _2.itemId] })), (((_3 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _3 === void 0 ? void 0 : _3.itemId) && { contentFilter: [(_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _4 === void 0 ? void 0 : _4.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
1042
1048
  setRtcList(rtcList.concat(getFilterRecList(data)));
1043
1049
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
1044
1050
  return data;
1045
- }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyH5, firstRtcList]);
1051
+ }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
1046
1052
  const refreshFeSession = React.useCallback((enableReSid, event) => {
1047
1053
  var _a, _b, _c, _d, _e;
1048
1054
  let expire = false;
@@ -1073,8 +1079,8 @@
1073
1079
  // 用户信息都是公共的
1074
1080
  if (!userInfo) {
1075
1081
  userInfo = {
1076
- productUserId: fakeUserId // 后端逻辑会从请求头获取,所以不需要传
1077
- // tpChannelId: 'H5' // 后端处理
1082
+ // productUserId: fakeUserId, // 后端逻辑会从请求头获取,所以不需要传
1083
+ // tpChannelId: 'H5' // 后端处理
1078
1084
  };
1079
1085
  }
1080
1086
  const sessionID = storeAndLoadFeSessionId();
@@ -1108,8 +1114,7 @@
1108
1114
  layoutVariantId,
1109
1115
  globalConfig,
1110
1116
  playbookType,
1111
- bffDataSource,
1112
- fakeUserId
1117
+ bffDataSource
1113
1118
  ]);
1114
1119
  const getEventParamsByJson = React.useCallback((json, product) => {
1115
1120
  var _a, _b, _c;
@@ -1173,7 +1178,7 @@
1173
1178
  return jsonParams;
1174
1179
  }, [fakeUserId]);
1175
1180
  const bffFbReport = React.useCallback(({ eventName, product }) => {
1176
- var _a, _b, _c, _d, _e, _f, _g, _h;
1181
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1177
1182
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
1178
1183
  return;
1179
1184
  }
@@ -1220,18 +1225,21 @@
1220
1225
  if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
1221
1226
  window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(snapchatPixelEventParamsJson, product));
1222
1227
  }
1223
- const converApiEventParamsJson = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _f === void 0 ? void 0 : _f[eventName];
1228
+ 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') {
1229
+ window === null || window === void 0 ? void 0 : window.Northbeam.trackPageView();
1230
+ }
1231
+ const converApiEventParamsJson = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _g === void 0 ? void 0 : _g[eventName];
1224
1232
  if (enabledMetaConversionApi && converApiEventParamsJson) {
1225
1233
  const body = getEventParamsByJson(converApiEventParamsJson, product);
1226
1234
  const params = {};
1227
1235
  const queryString = location.search.slice(1);
1228
- (_g = splitUrlParams(queryString)) === null || _g === void 0 ? void 0 : _g.forEach((val) => {
1236
+ (_h = splitUrlParams(queryString)) === null || _h === void 0 ? void 0 : _h.forEach((val) => {
1229
1237
  const key = val.split('=')[0];
1230
1238
  const value = val.split('=')[1];
1231
1239
  params[key] = value;
1232
1240
  });
1233
1241
  const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
1234
- bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_h = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _h === void 0 ? void 0 : _h['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
1242
+ bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_j = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _j === void 0 ? void 0 : _j['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
1235
1243
  method: 'POST',
1236
1244
  body,
1237
1245
  type: 'beacon'
@@ -1239,15 +1247,13 @@
1239
1247
  }
1240
1248
  }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
1241
1249
  const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1242
- body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
1243
1250
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
1244
1251
  return res === null || res === void 0 ? void 0 : res.success;
1245
- }), [bffFetch, fakeUserId]);
1252
+ }), [bffFetch]);
1246
1253
  const bffMutateUnlike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1247
- body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
1248
1254
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
1249
1255
  return res === null || res === void 0 ? void 0 : res.success;
1250
- }), [bffFetch, fakeUserId]);
1256
+ }), [bffFetch]);
1251
1257
  const bffSubmitForm = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1252
1258
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
1253
1259
  return res === null || res === void 0 ? void 0 : res.success;
@@ -1272,7 +1278,7 @@
1272
1278
  }
1273
1279
  }), [bffFetch, utmVal]);
1274
1280
  const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
1275
- 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, _13, _14;
1281
+ 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;
1276
1282
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
1277
1283
  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);
1278
1284
  let fromKName = '';
@@ -1290,7 +1296,7 @@
1290
1296
  }
1291
1297
  const contentTags = (_p = (_m = (_h = product === null || product === void 0 ? void 0 : product.tags) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : (_q = rec === null || rec === void 0 ? void 0 : rec.product) === null || _q === void 0 ? void 0 : _q.tags;
1292
1298
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1293
- 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 : '', sceneId: (_x = (_w = (_v = rec === null || rec === void 0 ? void 0 : rec.video) === null || _v === void 0 ? void 0 : _v.scene) === null || _w === void 0 ? void 0 : _w.sceneId) !== null && _x !== void 0 ? _x : '', productId: isProd ? product === null || product === void 0 ? void 0 : product.itemId : '', traceInfo: (_13 = (_10 = (_5 = (_1 = (_y = cta === null || cta === void 0 ? void 0 : cta.traceInfo) !== null && _y !== void 0 ? _y : (_0 = (_z = rec === null || rec === void 0 ? void 0 : rec.video) === null || _z === void 0 ? void 0 : _z.bindCta) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : (_4 = (_3 = (_2 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.bindCta) === null || _4 === void 0 ? void 0 : _4.traceInfo) !== null && _5 !== void 0 ? _5 : (_9 = (_8 = (_7 = (_6 = rec === null || rec === void 0 ? void 0 : rec.video) === null || _6 === void 0 ? void 0 : _6.bindProducts) === null || _7 === void 0 ? void 0 : _7[0]) === null || _8 === void 0 ? void 0 : _8.bindCta) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = rec === null || rec === void 0 ? void 0 : rec.product) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '', fromKName, fromKPage: (_14 = location === null || location === void 0 ? void 0 : location.href) !== null && _14 !== void 0 ? _14 : '', contentFormat })
1299
+ 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 })
1294
1300
  });
1295
1301
  }, [bffEventReport, isFromHashtag]);
1296
1302
  const h5EnterLink = React.useCallback(() => {
@@ -1392,9 +1398,6 @@
1392
1398
  }
1393
1399
  setRtcList(list);
1394
1400
  setCacheRtcList(list);
1395
- if (isDiyH5) {
1396
- setFirstRtcList(list);
1397
- }
1398
1401
  bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
1399
1402
  if (channel) {
1400
1403
  const item = list === null || list === void 0 ? void 0 : list[0];
@@ -1430,9 +1433,6 @@
1430
1433
  }
1431
1434
  setRtcList(list);
1432
1435
  setCacheRtcList(list);
1433
- if (isDiyH5) {
1434
- setFirstRtcList(list);
1435
- }
1436
1436
  }
1437
1437
  })
1438
1438
  .finally(() => {
@@ -1496,8 +1496,7 @@
1496
1496
  refreshFeSession,
1497
1497
  getAccount,
1498
1498
  accountSonsent,
1499
- isDiyH5,
1500
- firstRtcList
1499
+ isDiyH5
1501
1500
  } }, isShowConsent ? (React.createElement(Consent$4, Object.assign({}, (_e = (_d = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.item) === null || _e === void 0 ? void 0 : _e.props))) : (render({
1502
1501
  rtcList,
1503
1502
  mutateLike: bffMutateLike,
@@ -1958,14 +1957,14 @@
1958
1957
  * @Author: binruan@chatlabs.com
1959
1958
  * @Date: 2024-03-12 10:59:06
1960
1959
  * @LastEditors: binruan@chatlabs.com
1961
- * @LastEditTime: 2025-05-09 15:30:59
1960
+ * @LastEditTime: 2024-11-28 11:17:16
1962
1961
  * @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
1963
1962
  *
1964
1963
  */
1965
1964
  function useEventReport() {
1966
1965
  const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
1967
1966
  const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
1968
- 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, _13, _14, _15, _16;
1967
+ 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, _13;
1969
1968
  const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
1970
1969
  if (i !== -1) {
1971
1970
  return;
@@ -1998,11 +1997,11 @@
1998
1997
  contentFormat = 'image';
1999
1998
  }
2000
1999
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
2001
- eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', sceneId: (_2 = (_1 = (_0 = data === null || data === void 0 ? void 0 : data.video) === null || _0 === void 0 ? void 0 : _0.scene) === null || _1 === void 0 ? void 0 : _1.sceneId) !== null && _2 !== void 0 ? _2 : '', ctatId: (_3 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _3 !== void 0 ? _3 : '', traceInfo: (_16 = (_13 = (_11 = (_7 = (_4 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _4 !== void 0 ? _4 : (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProduct) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = data === null || data === void 0 ? void 0 : data.video) === null || _8 === void 0 ? void 0 : _8.bindProducts) === null || _9 === void 0 ? void 0 : _9[0]) === null || _10 === void 0 ? void 0 : _10.traceInfo) !== null && _11 !== void 0 ? _11 : (_12 = data === null || data === void 0 ? void 0 : data.product) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : (_15 = (_14 = data === null || data === void 0 ? void 0 : data.video) === null || _14 === void 0 ? void 0 : _14.bindCta) === null || _15 === void 0 ? void 0 : _15.traceInfo) !== null && _16 !== void 0 ? _16 : '' }, (contentFormat && { contentFormat }))
2000
+ eventInfo: Object.assign({ eventSubject: 'jumpToWeb', eventDescription: 'User jumped to website', productId: (_v = product === null || product === void 0 ? void 0 : product.itemId) !== null && _v !== void 0 ? _v : '', productName: (_w = product === null || product === void 0 ? void 0 : product.title) !== null && _w !== void 0 ? _w : '', price: (product === null || product === void 0 ? void 0 : product.price) ? (product === null || product === void 0 ? void 0 : product.price) + '' : '0', productCollection: (_x = product === null || product === void 0 ? void 0 : product.collection) !== null && _x !== void 0 ? _x : '', fromKName, fromKPage: location === null || location === void 0 ? void 0 : location.href, contentTags: contentTags ? JSON.stringify(contentTags) : '', position: position + '', contentId: (_z = (_y = data === null || data === void 0 ? void 0 : data.video) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '', ctatId: (_0 = cta === null || cta === void 0 ? void 0 : cta.itemId) !== null && _0 !== void 0 ? _0 : '', traceInfo: (_13 = (_10 = (_8 = (_4 = (_1 = traceInfo !== null && traceInfo !== void 0 ? traceInfo : product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = data === null || data === void 0 ? void 0 : data.video) === null || _2 === void 0 ? void 0 : _2.bindProduct) === null || _3 === void 0 ? void 0 : _3.traceInfo) !== null && _4 !== void 0 ? _4 : (_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.video) === null || _5 === void 0 ? void 0 : _5.bindProducts) === null || _6 === void 0 ? void 0 : _6[0]) === null || _7 === void 0 ? void 0 : _7.traceInfo) !== null && _8 !== void 0 ? _8 : (_9 = data === null || data === void 0 ? void 0 : data.product) === null || _9 === void 0 ? void 0 : _9.traceInfo) !== null && _10 !== void 0 ? _10 : (_12 = (_11 = data === null || data === void 0 ? void 0 : data.video) === null || _11 === void 0 ? void 0 : _11.bindCta) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : '' }, (contentFormat && { contentFormat }))
2002
2001
  });
2003
2002
  }, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
2004
2003
  const productView = React.useCallback((data, product, cta, viewTime, position) => {
2005
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
2004
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
2006
2005
  let fromKName = '';
2007
2006
  if (popupDetailData && (((_b = (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = data === null || data === void 0 ? void 0 : data.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
2008
2007
  fromKName = 'pdpPage';
@@ -2021,9 +2020,8 @@
2021
2020
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
2022
2021
  position: position + '',
2023
2022
  contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
2024
- sceneId: (_g = (_f = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
2025
2023
  ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
2026
- traceInfo: (_s = (_q = (_l = (_h = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _h !== void 0 ? _h : (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProduct) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : (_p = (_o = (_m = data === null || data === void 0 ? void 0 : data.video) === null || _m === void 0 ? void 0 : _m.bindProducts) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.traceInfo) !== null && _q !== void 0 ? _q : (_r = data === null || data === void 0 ? void 0 : data.product) === null || _r === void 0 ? void 0 : _r.traceInfo) !== null && _s !== void 0 ? _s : '',
2024
+ traceInfo: (_p = (_m = (_h = (_e = product === null || product === void 0 ? void 0 : product.traceInfo) !== null && _e !== void 0 ? _e : (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.traceInfo) !== null && _h !== void 0 ? _h : (_l = (_k = (_j = data === null || data === void 0 ? void 0 : data.video) === null || _j === void 0 ? void 0 : _j.bindProducts) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = data === null || data === void 0 ? void 0 : data.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
2027
2025
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
2028
2026
  eventSubject: 'productView',
2029
2027
  eventDescription: 'User browsed the product'
@@ -15838,7 +15836,7 @@ Made in Italy` })));
15838
15836
  * @Author: binruan@chatlabs.com
15839
15837
  * @Date: 2024-01-10 10:58:24
15840
15838
  * @LastEditors: binruan@chatlabs.com
15841
- * @LastEditTime: 2025-05-09 15:30:41
15839
+ * @LastEditTime: 2025-02-28 10:00:31
15842
15840
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
15843
15841
  *
15844
15842
  */
@@ -15876,7 +15874,7 @@ Made in Italy` })));
15876
15874
  }
15877
15875
  }, [waterFallData]);
15878
15876
  const reportTagsView = React.useCallback(() => {
15879
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
15877
+ var _a, _b, _c, _d, _e, _f;
15880
15878
  const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
15881
15879
  if (!rec)
15882
15880
  return;
@@ -15896,10 +15894,9 @@ Made in Italy` })));
15896
15894
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
15897
15895
  eventInfo: {
15898
15896
  contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
15899
- sceneId: (_g = (_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
15900
15897
  position: cacheActiveIndex + '',
15901
- contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
15902
- traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
15898
+ contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
15899
+ traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
15903
15900
  hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
15904
15901
  fromKName,
15905
15902
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
@@ -17981,22 +17978,21 @@ Made in Italy` })));
17981
17978
  const likeIcon = useIconLink(defaultLikeIconPath$2);
17982
17979
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
17983
17980
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
17984
- 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, _3, _4, _5, _6, _7;
17981
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
17985
17982
  if (state) {
17986
17983
  // 先设置状态
17987
17984
  setState(false);
17988
- const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ itemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
17985
+ const result = (_e = (yield (mutateUnlike === null || mutateUnlike === void 0 ? void 0 : mutateUnlike({ videoItemId: (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '' })))) !== null && _e !== void 0 ? _e : false;
17989
17986
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
17990
17987
  eventInfo: {
17991
17988
  eventSubject: 'favoriteContentCanceled',
17992
17989
  eventDescription: 'This content was unfavorite by the user',
17993
17990
  contentId: (_g = (_f = recData === null || recData === void 0 ? void 0 : recData.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
17994
- sceneId: (_k = (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.scene) === null || _j === void 0 ? void 0 : _j.sceneId) !== null && _k !== void 0 ? _k : '',
17995
- contentName: (_m = (_l = recData === null || recData === void 0 ? void 0 : recData.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '',
17996
- contentTags: JSON.stringify((_p = (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []),
17991
+ contentName: (_j = (_h = recData === null || recData === void 0 ? void 0 : recData.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '',
17992
+ contentTags: JSON.stringify((_l = (_k = recData === null || recData === void 0 ? void 0 : recData.video) === null || _k === void 0 ? void 0 : _k.tags) !== null && _l !== void 0 ? _l : []),
17997
17993
  position: position + '',
17998
- contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
17999
- traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
17994
+ contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
17995
+ traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
18000
17996
  }
18001
17997
  });
18002
17998
  // 如果接口调用失败,则回滚状态
@@ -18004,41 +18000,40 @@ Made in Italy` })));
18004
18000
  setState(true);
18005
18001
  }
18006
18002
  else {
18007
- const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18003
+ const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18008
18004
  if (index === position) {
18009
18005
  item.isCollected = false;
18010
18006
  }
18011
18007
  return item;
18012
- })) !== null && _s !== void 0 ? _s : [];
18008
+ })) !== null && _p !== void 0 ? _p : [];
18013
18009
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18014
18010
  }
18015
18011
  }
18016
18012
  else {
18017
18013
  setState(true);
18018
- const result = (_v = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData), itemId: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '' })))) !== null && _v !== void 0 ? _v : false;
18014
+ const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
18019
18015
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
18020
18016
  eventInfo: {
18021
18017
  eventSubject: 'favoriteContent',
18022
18018
  eventDescription: 'This content was favorite by the user',
18023
- contentId: (_x = (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
18024
- sceneId: (_0 = (_z = (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.scene) === null || _z === void 0 ? void 0 : _z.sceneId) !== null && _0 !== void 0 ? _0 : '',
18025
- contentName: (_2 = (_1 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _1 === void 0 ? void 0 : _1.title) !== null && _2 !== void 0 ? _2 : '',
18026
- contentTags: JSON.stringify((_4 = (_3 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _3 === void 0 ? void 0 : _3.tags) !== null && _4 !== void 0 ? _4 : []),
18019
+ contentId: (_s = (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
18020
+ contentName: (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.title) !== null && _u !== void 0 ? _u : '',
18021
+ contentTags: JSON.stringify((_w = (_v = recData === null || recData === void 0 ? void 0 : recData.video) === null || _v === void 0 ? void 0 : _v.tags) !== null && _w !== void 0 ? _w : []),
18027
18022
  position: position + '',
18028
- contentFormat: ((_5 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _5 === void 0 ? void 0 : _5.url) ? 'video' : 'image',
18029
- traceInfo: (_6 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _6 === void 0 ? void 0 : _6.traceInfo
18023
+ contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
18024
+ traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
18030
18025
  }
18031
18026
  });
18032
18027
  if (!result) {
18033
18028
  setState(false);
18034
18029
  }
18035
18030
  else {
18036
- const nRtcList = (_7 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18031
+ const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18037
18032
  if (index === position) {
18038
18033
  item.isCollected = true;
18039
18034
  }
18040
18035
  return item;
18041
- })) !== null && _7 !== void 0 ? _7 : [];
18036
+ })) !== null && _z !== void 0 ? _z : [];
18042
18037
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18043
18038
  }
18044
18039
  }
@@ -18075,7 +18070,7 @@ Made in Italy` })));
18075
18070
  const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef }, ref) => {
18076
18071
  var _a, _b;
18077
18072
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
18078
- const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
18073
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
18079
18074
  const videoStartTime = React.useRef(0);
18080
18075
  const [isLoadFinish, setIsLoadFinish] = React.useState(false);
18081
18076
  const { isActive } = useSwiperSlide();
@@ -18141,23 +18136,6 @@ Made in Italy` })));
18141
18136
  return;
18142
18137
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
18143
18138
  }, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
18144
- const handleEnd = () => {
18145
- var _a, _b, _c, _d, _e, _f;
18146
- if (!videoRef.current)
18147
- return;
18148
- if (isDiyH5) {
18149
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
18150
- if (!loopPlayRef.current)
18151
- return;
18152
- if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
18153
- const i = (_c = (_b = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _b === void 0 ? void 0 : _b.swiper) === null || _c === void 0 ? void 0 : _c.activeIndex;
18154
- (_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(i + 1);
18155
- }
18156
- }
18157
- else {
18158
- (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
18159
- }
18160
- };
18161
18139
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
18162
18140
  const handlePlaying = React.useCallback(() => {
18163
18141
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
@@ -18166,7 +18144,7 @@ Made in Italy` })));
18166
18144
  setIsLoadFinish(true);
18167
18145
  }, []);
18168
18146
  const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
18169
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
18147
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
18170
18148
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
18171
18149
  return;
18172
18150
  setIsPauseVideo(false);
@@ -18177,11 +18155,16 @@ Made in Italy` })));
18177
18155
  const videoCurrentTime = ((_h = (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.currentTime) !== null && _h !== void 0 ? _h : 0).toFixed(2);
18178
18156
  const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
18179
18157
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
18180
- eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '', sceneId: (_o = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.scene) === null || _m === void 0 ? void 0 : _m.sceneId) !== null && _o !== void 0 ? _o : '', contentName: (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.title) !== null && _q !== void 0 ? _q : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.tags) !== null && _s !== void 0 ? _s : []), position: index + '', contentFormat: 'video', traceInfo: (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.traceInfo }, ((isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) && { loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + '' }))
18158
+ eventInfo: Object.assign({ eventSubject: 'playVideo', eventDescription: 'User played the video', contentId: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '', contentName: (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.title) !== null && _m !== void 0 ? _m : '', playType, startTime: videoCurrentTime, videoDuration, contentTags: JSON.stringify((_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.tags) !== null && _p !== void 0 ? _p : []), position: index + '', contentFormat: 'video', traceInfo: (_q = item === null || item === void 0 ? void 0 : item.video) === null || _q === void 0 ? void 0 : _q.traceInfo }, ((isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) && { loadTime: (loadedTimeRef === null || loadedTimeRef === void 0 ? void 0 : loadedTimeRef.current) - (initTimeRef === null || initTimeRef === void 0 ? void 0 : initTimeRef.current) + '' }))
18181
18159
  });
18182
18160
  isFirstPlayRef.current = false;
18183
18161
  }
18184
18162
  }), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
18163
+ const setCurrentTimeByStartTime = React.useCallback(() => {
18164
+ if (isDiyH5) {
18165
+ videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
18166
+ }
18167
+ }, []);
18185
18168
  const handLoadeddata = React.useCallback(() => {
18186
18169
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
18187
18170
  return;
@@ -18206,12 +18189,13 @@ Made in Italy` })));
18206
18189
  const handleLoadedmetadata = React.useCallback(() => {
18207
18190
  if (!videoRef.current)
18208
18191
  return;
18192
+ setCurrentTimeByStartTime();
18209
18193
  loadedTimeRef.current = new Date();
18210
18194
  handleStartPlay();
18211
18195
  handLoadeddata();
18212
18196
  }, [videoRef.current, handLoadeddata, handleStartPlay]);
18213
18197
  const handleClickVideo = React.useCallback((type) => () => {
18214
- var _a, _b, _c, _d, _e;
18198
+ var _a, _b, _c, _d, _e, _f;
18215
18199
  if (!videoRef.current)
18216
18200
  return;
18217
18201
  if (!isLoadFinish)
@@ -18232,17 +18216,20 @@ Made in Italy` })));
18232
18216
  break;
18233
18217
  default:
18234
18218
  if (isPause) {
18235
- (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
18219
+ if (isDiyH5 && Math.round((_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime) >= (scene === null || scene === void 0 ? void 0 : scene.endTime)) {
18220
+ videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
18221
+ }
18222
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
18236
18223
  }
18237
18224
  else {
18238
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
18225
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
18239
18226
  }
18240
18227
  setIsPauseVideo(!isPause);
18241
18228
  break;
18242
18229
  }
18243
18230
  }, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
18244
18231
  const handlePause = React.useCallback(() => {
18245
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
18232
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
18246
18233
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
18247
18234
  return;
18248
18235
  if (activeIndex !== index)
@@ -18258,15 +18245,14 @@ Made in Italy` })));
18258
18245
  eventSubject: 'playOverVideo',
18259
18246
  eventDescription: 'User finished playing the video',
18260
18247
  contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
18261
- sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
18262
- contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
18248
+ contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
18263
18249
  endTime: videoCurrentTime,
18264
18250
  videoDuration,
18265
18251
  playDuration,
18266
- contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
18252
+ contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
18267
18253
  position: index + '',
18268
18254
  contentFormat: 'video',
18269
- traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
18255
+ traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
18270
18256
  }
18271
18257
  });
18272
18258
  }
@@ -18274,8 +18260,27 @@ Made in Italy` })));
18274
18260
  const handleWaiting = React.useCallback(() => {
18275
18261
  setWaiting(true);
18276
18262
  }, []);
18263
+ const handleTimeUpload = () => {
18264
+ if (!videoRef.current || !isDiyH5)
18265
+ return;
18266
+ setTimeout(() => {
18267
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
18268
+ if (Math.round((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = scene === null || scene === void 0 ? void 0 : scene.endTime) !== null && _b !== void 0 ? _b : 0)) {
18269
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
18270
+ if (!loopPlayRef.current)
18271
+ return;
18272
+ if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
18273
+ (_e = (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper) === null || _e === void 0 ? void 0 : _e.slideTo(0);
18274
+ }
18275
+ else {
18276
+ const i = (_g = (_f = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _f === void 0 ? void 0 : _f.swiper) === null || _g === void 0 ? void 0 : _g.activeIndex;
18277
+ (_j = (_h = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _h === void 0 ? void 0 : _h.swiper) === null || _j === void 0 ? void 0 : _j.slideTo(i + 1);
18278
+ }
18279
+ }
18280
+ });
18281
+ };
18277
18282
  React.useEffect(() => {
18278
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18283
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
18279
18284
  if (!isActive)
18280
18285
  return;
18281
18286
  const videoSrc = videoUrl;
@@ -18296,6 +18301,7 @@ Made in Italy` })));
18296
18301
  hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
18297
18302
  hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
18298
18303
  var _a;
18304
+ setCurrentTimeByStartTime();
18299
18305
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
18300
18306
  });
18301
18307
  }
@@ -18309,11 +18315,12 @@ Made in Italy` })));
18309
18315
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
18310
18316
  (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
18311
18317
  (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
18312
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
18318
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
18313
18319
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
18314
18320
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
18321
+ (_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
18315
18322
  return () => {
18316
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18323
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
18317
18324
  const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
18318
18325
  if (!isPause)
18319
18326
  handlePause();
@@ -18325,9 +18332,10 @@ Made in Italy` })));
18325
18332
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
18326
18333
  (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
18327
18334
  (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
18328
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
18335
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
18329
18336
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
18330
18337
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
18338
+ (_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
18331
18339
  };
18332
18340
  }, [isActive]);
18333
18341
  React.useEffect(() => {
@@ -18538,45 +18546,19 @@ Made in Italy` })));
18538
18546
  }, onLoad: onShowFirstImage }))));
18539
18547
  };
18540
18548
 
18541
- const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
18549
+ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
18542
18550
  var _a, _b;
18543
18551
  const { isActive } = useSwiperSlide();
18544
- const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
18552
+ const { sxpParameter, openHashtag } = useSxpDataSource();
18545
18553
  const [isLoad, setIsLoad] = React.useState(false);
18546
18554
  const [imgInfo, setImgInfo] = React.useState();
18547
18555
  const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
18548
- const imgsSwiperRef = React.useRef();
18556
+ const swiperRef = React.useRef();
18549
18557
  const isFirstPlayRef = React.useRef(true);
18550
- const loopPlayRef = React.useRef(true);
18551
18558
  const initTime = new Date();
18552
- React.useImperativeHandle(ref, () => {
18553
- return {
18554
- setLoopPlay(v) {
18555
- loopPlayRef.current = v;
18556
- }
18557
- };
18558
- });
18559
- React.useEffect(() => {
18560
- let timerId;
18561
- if (isLoad && isActive && isDiyH5) {
18562
- timerId = setTimeout(() => {
18563
- var _a, _b, _c, _d;
18564
- if (!loopPlayRef.current)
18565
- return;
18566
- if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
18567
- const i = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
18568
- (_d = (_c = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _c === void 0 ? void 0 : _c.swiper) === null || _d === void 0 ? void 0 : _d.slideTo(i + 1);
18569
- }
18570
- }, 3000);
18571
- }
18572
- return () => {
18573
- if (timerId)
18574
- clearTimeout(timerId);
18575
- };
18576
- }, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
18577
18559
  React.useEffect(() => {
18578
18560
  if (isLoad && isActive) {
18579
- (imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
18561
+ (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
18580
18562
  if (openHashtag) {
18581
18563
  onViewImageEndEvent(rec);
18582
18564
  }
@@ -18586,7 +18568,7 @@ Made in Italy` })));
18586
18568
  }
18587
18569
  }
18588
18570
  else {
18589
- (imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
18571
+ (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
18590
18572
  }
18591
18573
  }, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
18592
18574
  const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
@@ -18613,13 +18595,13 @@ Made in Italy` })));
18613
18595
  };
18614
18596
  }, [isActive, imgInfo]);
18615
18597
  const handleMouseEnter = React.useCallback(() => {
18616
- if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
18617
- imgsSwiperRef.current.swiper.autoplay.stop();
18598
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
18599
+ swiperRef.current.swiper.autoplay.stop();
18618
18600
  }
18619
18601
  }, []);
18620
18602
  const handleMouseLeave = React.useCallback(() => {
18621
- if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
18622
- imgsSwiperRef.current.swiper.autoplay.start();
18603
+ if (swiperRef.current && swiperRef.current.swiper && isAlly) {
18604
+ swiperRef.current.swiper.autoplay.start();
18623
18605
  }
18624
18606
  }, []);
18625
18607
  const handleSlideChange = React.useCallback((swiper) => {
@@ -18640,7 +18622,7 @@ Made in Italy` })));
18640
18622
  enabled: true
18641
18623
  }
18642
18624
  }
18643
- : {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
18625
+ : {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
18644
18626
  bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
18645
18627
  fontSize: '14px'
18646
18628
  } }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
@@ -18657,7 +18639,7 @@ Made in Italy` })));
18657
18639
  return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
18658
18640
  React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
18659
18641
  }))));
18660
- });
18642
+ };
18661
18643
  var PictureGroup$5 = React.memo(PictureGroup$4);
18662
18644
 
18663
18645
  /*
@@ -18937,7 +18919,7 @@ Made in Italy` })));
18937
18919
  * @Author: binruan@chatlabs.com
18938
18920
  * @Date: 2024-03-20 10:27:31
18939
18921
  * @LastEditors: binruan@chatlabs.com
18940
- * @LastEditTime: 2025-05-12 14:26:15
18922
+ * @LastEditTime: 2025-05-09 15:51:40
18941
18923
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
18942
18924
  *
18943
18925
  */
@@ -18957,7 +18939,6 @@ Made in Italy` })));
18957
18939
  const skipLinkRef = React.useRef(false);
18958
18940
  const [pageNum, setPageNum] = React.useState(2);
18959
18941
  const videoWidgetRef = React.useRef(null);
18960
- const pictureGroupRef = React.useRef(null);
18961
18942
  const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5 } = useSxpDataSource();
18962
18943
  const { backMainFeed, productView, jumpToWeb } = useEventReport();
18963
18944
  const isShowFingerTip = React.useMemo(() => {
@@ -19005,7 +18986,7 @@ Made in Italy` })));
19005
18986
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
19006
18987
  }, [data, ctaType, swiperRef]);
19007
18988
  const handleSessionCompleted = React.useCallback((fk) => {
19008
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
18989
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
19009
18990
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19010
18991
  let fromKName = '';
19011
18992
  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))) {
@@ -19032,13 +19013,12 @@ Made in Italy` })));
19032
19013
  eventSubject: 'sessionCompleted',
19033
19014
  eventDescription: 'Session completed',
19034
19015
  contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
19035
- sceneId: (_q = (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.scene) === null || _p === void 0 ? void 0 : _p.sceneId) !== null && _q !== void 0 ? _q : '',
19036
- productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
19016
+ productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
19037
19017
  position: activeIndex + '',
19038
19018
  fromKName: fk || fromKName,
19039
19019
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
19040
- ctatId: (_u = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.bindCta) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
19041
- traceInfo: (_y = (_w = (_v = item === null || item === void 0 ? void 0 : item.video) === null || _v === void 0 ? void 0 : _v.traceInfo) !== null && _w !== void 0 ? _w : (_x = item === null || item === void 0 ? void 0 : item.product) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : ''
19020
+ ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
19021
+ 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 : ''
19042
19022
  }
19043
19023
  });
19044
19024
  }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
@@ -19097,9 +19077,8 @@ Made in Italy` })));
19097
19077
  refreshFeSession
19098
19078
  ]);
19099
19079
  const handleSessionExpire = React.useCallback(lodash.debounce(() => {
19100
- var _a, _b;
19080
+ var _a;
19101
19081
  (_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
19102
- (_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
19103
19082
  refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
19104
19083
  }, 1000), [handleSessionCompleted, refreshFeSession]);
19105
19084
  React.useEffect(() => {
@@ -19169,18 +19148,18 @@ Made in Italy` })));
19169
19148
  return null;
19170
19149
  }, [globalConfig, activeIndex, visList]);
19171
19150
  const renderContent = React.useCallback((rec, index) => {
19172
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
19151
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
19173
19152
  if (rec === 'organic menu') {
19174
19153
  return (React.createElement(MultiPosts$2, Object.assign({ recData: data === null || data === void 0 ? void 0 : data[1] }, (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props, (_f = (_e = (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.item) === null || _f === void 0 ? void 0 : _f.event)));
19175
19154
  }
19176
- if (((_h = (_g = rec.video) === null || _g === void 0 ? void 0 : _g.scene) === null || _h === void 0 ? void 0 : _h.mediaUrl) || ((_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.url)) {
19155
+ if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
19177
19156
  return (React.createElement(VideoWidget$5, Object.assign({ key: isReload }, (activeIndex === index && { ref: videoWidgetRef }), { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon, loopPlay: true, swiperRef: swiperRef })));
19178
19157
  }
19179
- if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
19180
- return (React.createElement(PictureGroup$5, Object.assign({ data: data }, (activeIndex === index && { ref: pictureGroupRef }), { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, swiperRef: swiperRef })));
19158
+ if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
19159
+ return (React.createElement(PictureGroup$5, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onViewImageEndEvent: handleViewImageStartEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
19181
19160
  }
19182
- if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_l = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _l === void 0 ? void 0 : _l.length) > 0) {
19183
- return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
19161
+ if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _j === void 0 ? void 0 : _j.length) > 0) {
19162
+ return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
19184
19163
  var _a, _b, _c, _d, _e, _f, _g, _h;
19185
19164
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
19186
19165
  const Component = withBindDataSource(t);
@@ -19218,7 +19197,7 @@ Made in Italy` })));
19218
19197
  };
19219
19198
  }, [isShowMore]);
19220
19199
  const renderBottom = React.useCallback((rec, index) => {
19221
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
19200
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
19222
19201
  if (rec === null || rec === void 0 ? void 0 : rec.video) {
19223
19202
  let cta = null;
19224
19203
  if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
@@ -19227,27 +19206,24 @@ Made in Italy` })));
19227
19206
  else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
19228
19207
  cta = '商品CTA';
19229
19208
  }
19230
- else if (tempMap && ((_d = Object.keys(tempMap)) === null || _d === void 0 ? void 0 : _d.includes('服务CTA')) && ((_f = (_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) === null || _f === void 0 ? void 0 : _f.itemId)) {
19231
- cta = '服务CTA';
19232
- }
19233
19209
  else {
19234
- cta = (_h = (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindCta) === null || _h === void 0 ? void 0 : _h.itemId;
19210
+ cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
19235
19211
  }
19236
19212
  const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
19237
19213
  const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
19238
19214
  index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
19239
- ((_j = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _j === void 0 ? void 0 : _j.includes((_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.type));
19215
+ ((_f = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _f === void 0 ? void 0 : _f.includes((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type));
19240
19216
  return (React.createElement(React.Fragment, null,
19241
19217
  isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
19242
- ((_l = rec === null || rec === void 0 ? void 0 : rec.video) === null || _l === void 0 ? void 0 : _l.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
19243
- React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _m !== void 0 ? _m : 40}px` } },
19218
+ ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
19219
+ React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _j !== void 0 ? _j : 40}px` } },
19244
19220
  React.createElement(Nudge, { nudge: nudge }),
19245
19221
  ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
19246
19222
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
19247
19223
  React.createElement("div", null,
19248
- React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_p = (_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.title) !== null && _p !== void 0 ? _p : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
19224
+ React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
19249
19225
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
19250
- React.createElement(Hashtag$1, { index: activeIndex, tags: (_r = (_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.hashTags) !== null && _r !== void 0 ? _r : [], itemId: (_s = rec === null || rec === void 0 ? void 0 : rec.video) === null || _s === void 0 ? void 0 : _s.itemId, itemType: ((_t = rec === null || rec === void 0 ? void 0 : rec.video) === null || _t === void 0 ? void 0 : _t.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
19226
+ React.createElement(Hashtag$1, { index: activeIndex, tags: (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.hashTags) !== null && _o !== void 0 ? _o : [], itemId: (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.itemId, itemType: ((_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
19251
19227
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
19252
19228
  }
19253
19229
  return null;
@@ -19286,7 +19262,7 @@ Made in Italy` })));
19286
19262
  return null;
19287
19263
  }, [globalConfig, waterFallData]);
19288
19264
  const handleViewImageStartEnd = (item) => {
19289
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
19265
+ var _a, _b, _c, _d, _e, _f;
19290
19266
  if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
19291
19267
  const endTime = Date.now();
19292
19268
  const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
@@ -19295,11 +19271,10 @@ Made in Italy` })));
19295
19271
  eventSubject: 'viewImageCarouselEnd',
19296
19272
  eventDescription: 'User end view the image carousel',
19297
19273
  contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
19298
- sceneId: (_g = (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
19299
- contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
19274
+ contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
19300
19275
  imageEndTime: `${endTime}`,
19301
19276
  playDuration: `${duration}`,
19302
- contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
19277
+ contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
19303
19278
  position: activeIndex + '',
19304
19279
  contentFormat: 'image',
19305
19280
  traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
@@ -19308,7 +19283,7 @@ Made in Italy` })));
19308
19283
  }
19309
19284
  };
19310
19285
  const handleSlideSkip = (item, position) => {
19311
- 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;
19286
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
19312
19287
  if (isPreview || waterFallData)
19313
19288
  return;
19314
19289
  const t = new Date() - curTime.current;
@@ -19334,8 +19309,7 @@ Made in Italy` })));
19334
19309
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
19335
19310
  position: position + '',
19336
19311
  contentId: (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.itemId) !== null && _t !== void 0 ? _t : '',
19337
- sceneId: (_w = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.scene) === null || _v === void 0 ? void 0 : _v.sceneId) !== null && _w !== void 0 ? _w : '',
19338
- traceInfo: (_0 = (_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_z = item === null || item === void 0 ? void 0 : item.product) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : '',
19312
+ traceInfo: (_x = (_v = (_u = item === null || item === void 0 ? void 0 : item.video) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : (_w = item === null || item === void 0 ? void 0 : item.product) === null || _w === void 0 ? void 0 : _w.traceInfo) !== null && _x !== void 0 ? _x : '',
19339
19313
  contentFormat
19340
19314
  }
19341
19315
  });
@@ -19345,7 +19319,7 @@ Made in Italy` })));
19345
19319
  }
19346
19320
  };
19347
19321
  const handleScrollEvent = (swiper) => {
19348
- 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;
19322
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
19349
19323
  const item = data[swiper.previousIndex];
19350
19324
  if (!item)
19351
19325
  return;
@@ -19362,12 +19336,11 @@ Made in Italy` })));
19362
19336
  eventSubject: 'scrollDown',
19363
19337
  eventDescription: 'User scroll down',
19364
19338
  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 : '',
19365
- sceneId: (_h = (_g = (_f = item === null || item === void 0 ? void 0 : item.video) === null || _f === void 0 ? void 0 : _f.scene) === null || _g === void 0 ? void 0 : _g.sceneId) !== null && _h !== void 0 ? _h : '',
19366
- productId: (_k = (_j = item === null || item === void 0 ? void 0 : item.product) === null || _j === void 0 ? void 0 : _j.itemId) !== null && _k !== void 0 ? _k : '',
19339
+ 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 : '',
19367
19340
  requestId: null,
19368
- traceInfo: (_p = (_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.traceInfo) !== null && _m !== void 0 ? _m : (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.traceInfo) !== null && _p !== void 0 ? _p : '',
19341
+ 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 : '',
19369
19342
  contentFormat,
19370
- position: ((_q = swiper.previousIndex) !== null && _q !== void 0 ? _q : 0) + ''
19343
+ position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
19371
19344
  }
19372
19345
  });
19373
19346
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
@@ -19379,13 +19352,12 @@ Made in Italy` })));
19379
19352
  eventInfo: {
19380
19353
  eventSubject: 'scrollUp',
19381
19354
  eventDescription: 'User scroll up',
19382
- contentId: (_s = (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '',
19383
- sceneId: (_v = (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.scene) === null || _u === void 0 ? void 0 : _u.sceneId) !== null && _v !== void 0 ? _v : '',
19384
- productId: (_x = (_w = item.product) === null || _w === void 0 ? void 0 : _w.itemId) !== null && _x !== void 0 ? _x : '',
19355
+ 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 : '',
19356
+ productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
19385
19357
  requestId: null,
19386
- traceInfo: (_1 = (_z = (_y = item === null || item === void 0 ? void 0 : item.video) === null || _y === void 0 ? void 0 : _y.traceInfo) !== null && _z !== void 0 ? _z : (_0 = item === null || item === void 0 ? void 0 : item.product) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : '',
19358
+ 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 : '',
19387
19359
  contentFormat,
19388
- position: ((_2 = swiper.previousIndex) !== null && _2 !== void 0 ? _2 : 0) + ''
19360
+ position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
19389
19361
  }
19390
19362
  });
19391
19363
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
@@ -19411,7 +19383,7 @@ Made in Italy` })));
19411
19383
  }
19412
19384
  }, [openHashtag, data, activeIndex]);
19413
19385
  const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
19414
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
19386
+ var _a, _b, _c, _d, _e, _f, _g, _h;
19415
19387
  const item = data[activeIndex];
19416
19388
  // 如果是图片集则上报事件
19417
19389
  if (!((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) && ((_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls)) {
@@ -19422,10 +19394,9 @@ Made in Italy` })));
19422
19394
  eventSubject: 'viewImageCarouselStart',
19423
19395
  eventDescription: 'User start view the image carousel',
19424
19396
  contentId: (_d = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.itemId) !== null && _d !== void 0 ? _d : '',
19425
- sceneId: (_g = (_f = (_e = item === null || item === void 0 ? void 0 : item.video) === null || _e === void 0 ? void 0 : _e.scene) === null || _f === void 0 ? void 0 : _f.sceneId) !== null && _g !== void 0 ? _g : '',
19426
- contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
19397
+ contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
19427
19398
  imageStartTime: `${startTime}`,
19428
- contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
19399
+ contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
19429
19400
  position: activeIndex + '',
19430
19401
  contentFormat: 'image',
19431
19402
  traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
@@ -19435,11 +19406,11 @@ Made in Italy` })));
19435
19406
  if (enableCapi) {
19436
19407
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19437
19408
  eventName: 'ViewContent',
19438
- product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProduct
19409
+ product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
19439
19410
  });
19440
19411
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19441
19412
  eventName: 'PageView',
19442
- product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProduct
19413
+ product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
19443
19414
  });
19444
19415
  }
19445
19416
  }
@@ -19531,20 +19502,15 @@ Made in Italy` })));
19531
19502
  swiperRef.current.swiper.allowTouchMove = true;
19532
19503
  }, 500);
19533
19504
  }, onActiveIndexChange: (swiper) => {
19534
- var _a, _b;
19535
19505
  setActiveIndex(swiper.activeIndex);
19536
19506
  if (openHashtag)
19537
19507
  return;
19538
19508
  // 处理上滑下滑事件
19539
19509
  handleScrollEvent(swiper);
19540
- if (waterFallData || isEditor)
19510
+ if (waterFallData || isEditor || isDiyH5)
19541
19511
  return;
19542
19512
  if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
19543
19513
  if (!isLoadMore) {
19544
- if (isDiyH5) {
19545
- (_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
19546
- (_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
19547
- }
19548
19514
  setIsLoadMore(true);
19549
19515
  loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
19550
19516
  var _a;
@@ -19597,7 +19563,7 @@ Made in Italy` })));
19597
19563
  }, []);
19598
19564
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
19599
19565
  const handlePlaying = React.useCallback(() => {
19600
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
19566
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
19601
19567
  setIsPauseVideo(false);
19602
19568
  const item = data[index];
19603
19569
  if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
@@ -19610,15 +19576,14 @@ Made in Italy` })));
19610
19576
  eventSubject: 'playVideo',
19611
19577
  eventDescription: 'User played the video',
19612
19578
  contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
19613
- sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
19614
- contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
19579
+ contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
19615
19580
  playType,
19616
19581
  startTime: videoCurrentTime,
19617
19582
  videoDuration,
19618
- contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
19583
+ contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
19619
19584
  position: index + '',
19620
19585
  contentFormat: 'video',
19621
- traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
19586
+ traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
19622
19587
  }
19623
19588
  });
19624
19589
  setIsFirstPlay(false);
@@ -19657,7 +19622,7 @@ Made in Italy` })));
19657
19622
  }
19658
19623
  }, [isLoadFinish]);
19659
19624
  const onPause = React.useCallback(() => {
19660
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
19625
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
19661
19626
  const item = data[index];
19662
19627
  const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
19663
19628
  const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
@@ -19668,15 +19633,14 @@ Made in Italy` })));
19668
19633
  eventSubject: 'playOverVideo',
19669
19634
  eventDescription: 'User finished playing the video',
19670
19635
  contentId: (_h = (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.itemId) !== null && _h !== void 0 ? _h : '',
19671
- sceneId: (_l = (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.scene) === null || _k === void 0 ? void 0 : _k.sceneId) !== null && _l !== void 0 ? _l : '',
19672
- contentName: (_o = (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.title) !== null && _o !== void 0 ? _o : '',
19636
+ contentName: (_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.title) !== null && _k !== void 0 ? _k : '',
19673
19637
  endTime: videoCurrentTime,
19674
19638
  videoDuration,
19675
19639
  playDuration,
19676
- contentTags: JSON.stringify((_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.tags) !== null && _q !== void 0 ? _q : []),
19640
+ contentTags: JSON.stringify((_m = (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.tags) !== null && _m !== void 0 ? _m : []),
19677
19641
  position: index + '',
19678
19642
  contentFormat: 'video',
19679
- traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
19643
+ traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
19680
19644
  }
19681
19645
  });
19682
19646
  }