pb-sxp-ui 1.20.13 → 1.20.15

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 (62) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +111 -111
  3. package/dist/index.cjs +1187 -383
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.css +73 -72
  6. package/dist/index.js +1187 -384
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.cjs +7 -7
  9. package/dist/index.min.cjs.map +1 -1
  10. package/dist/index.min.js +7 -7
  11. package/dist/index.min.js.map +1 -1
  12. package/dist/pb-ui.js +1187 -383
  13. package/dist/pb-ui.js.map +1 -1
  14. package/dist/pb-ui.min.js +7 -7
  15. package/dist/pb-ui.min.js.map +1 -1
  16. package/es/core/components/DiyPortalPreview/VideoWidget.js +10 -8
  17. package/es/core/components/DiyStoryPreview/index.js +10 -4
  18. package/es/core/components/StructurePage/index.d.ts +89 -0
  19. package/es/core/components/StructurePage/index.js +700 -0
  20. package/es/core/components/SxpPageRender/LikeButton/index.js +20 -18
  21. package/es/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
  22. package/es/core/components/SxpPageRender/PictureGroup/index.js +39 -13
  23. package/es/core/components/SxpPageRender/VideoWidget/index.js +33 -46
  24. package/es/core/components/SxpPageRender/WaterFall/index.js +4 -3
  25. package/es/core/components/SxpPageRender/fakeData.js +1 -1
  26. package/es/core/components/SxpPageRender/index.js +66 -44
  27. package/es/core/context/SxpDataSourceProvider.d.ts +5 -12
  28. package/es/core/context/SxpDataSourceProvider.js +84 -38
  29. package/es/core/hooks/useEventReport.js +6 -5
  30. package/es/core/hooks/useVisibleHeight.js +7 -7
  31. package/es/core/index.d.ts +2 -0
  32. package/es/core/index.js +1 -0
  33. package/es/core/utils/materials.d.ts +1 -1
  34. package/es/index.d.ts +1 -0
  35. package/es/index.js +1 -0
  36. package/es/materials/sxp/MultiPosts/index.js +4 -4
  37. package/es/materials/sxp/popup/CommodityDetail/index.js +4 -4
  38. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  39. package/lib/core/components/DiyPortalPreview/VideoWidget.js +10 -8
  40. package/lib/core/components/DiyStoryPreview/index.js +10 -4
  41. package/lib/core/components/StructurePage/index.d.ts +89 -0
  42. package/lib/core/components/StructurePage/index.js +702 -0
  43. package/lib/core/components/SxpPageRender/LikeButton/index.js +20 -18
  44. package/lib/core/components/SxpPageRender/PictureGroup/index.d.ts +5 -0
  45. package/lib/core/components/SxpPageRender/PictureGroup/index.js +38 -12
  46. package/lib/core/components/SxpPageRender/VideoWidget/index.js +33 -46
  47. package/lib/core/components/SxpPageRender/WaterFall/index.js +4 -3
  48. package/lib/core/components/SxpPageRender/fakeData.js +1 -1
  49. package/lib/core/components/SxpPageRender/index.js +66 -44
  50. package/lib/core/context/SxpDataSourceProvider.d.ts +5 -12
  51. package/lib/core/context/SxpDataSourceProvider.js +84 -38
  52. package/lib/core/hooks/useEventReport.js +6 -5
  53. package/lib/core/hooks/useVisibleHeight.js +7 -7
  54. package/lib/core/index.d.ts +2 -0
  55. package/lib/core/index.js +6 -1
  56. package/lib/core/utils/materials.d.ts +1 -1
  57. package/lib/index.d.ts +1 -0
  58. package/lib/index.js +3 -1
  59. package/lib/materials/sxp/MultiPosts/index.js +4 -4
  60. package/lib/materials/sxp/popup/CommodityDetail/index.js +4 -4
  61. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +1 -1
  62. package/package.json +111 -111
package/dist/index.js CHANGED
@@ -645,6 +645,7 @@ const DEFAULT_TAG = 'FOR U';
645
645
  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 }) => {
646
646
  var _a, _b, _c, _d, _e;
647
647
  const [rtcList, setRtcList] = useState([]);
648
+ const [firstRtcList, setFirstRtcList] = useState([]);
648
649
  const [tagList, setTagList] = useState([]);
649
650
  const [loading, setLoading] = useState(true);
650
651
  const [curReqInfo, setCurReqInfo] = useState({ rtc: '', requestId: '' });
@@ -655,6 +656,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
655
656
  const [popupDetailData, setPopupDetailData] = useState();
656
657
  const [waterFallData, setWaterFallData] = useState();
657
658
  const [openHashtag, setOpenHashtag] = useState(isOpenHashTag);
659
+ // 将 setPopupDetailData 挂载到 window 对象,供 StructurePage 使用
660
+ if (typeof window !== 'undefined') {
661
+ window.setPopupDetailData = setPopupDetailData;
662
+ }
658
663
  const [cacheRtcList, setCacheRtcList] = useState([]);
659
664
  const [cacheActiveIndex, setCacheActiveIndex] = useState(0);
660
665
  const [isFromHashtag, setIsFromHashtag] = useState(false);
@@ -676,6 +681,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
676
681
  const [chatlabsId, setChatlabsId] = useState();
677
682
  const finalPageData = useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
678
683
  const pixelPvStatusRef = useRef(false);
684
+ const isDiyPage = useMemo(() => {
685
+ var _a, _b, _c;
686
+ return isDiyH5 && !((_c = (_b = (_a = finalPageData === null || finalPageData === void 0 ? void 0 : finalPageData.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig) === null || _c === void 0 ? void 0 : _c.enablePreview);
687
+ }, [isDiyH5, finalPageData]);
679
688
  useEffect(() => {
680
689
  var _a, _b;
681
690
  setGlobalConfig((_b = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.sxpPageConf) === null || _b === void 0 ? void 0 : _b.globalConfig);
@@ -781,7 +790,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
781
790
  };
782
791
  // bff API 请求方法
783
792
  const bffFetch = useCallback((path, options, isBota = true) => {
784
- var _a;
793
+ var _a, _b;
785
794
  if (!bffDataSource)
786
795
  return;
787
796
  const url = bffDataSource.url;
@@ -794,8 +803,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
794
803
  val.split('=')[0];
795
804
  val.split('=')[1];
796
805
  });
806
+ options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
797
807
  return window
798
- .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
808
+ .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
799
809
  ? JSON.stringify({
800
810
  body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
801
811
  })
@@ -1080,8 +1090,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1080
1090
  }, [bffDataSource]);
1081
1091
  // 获取推荐视频数据
1082
1092
  const getRecommendVideos = useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
1083
- var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
1084
- query = Object.assign(Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId })), (isDiyH5 && { type: 'story' }));
1093
+ var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
1094
+ query = Object.assign(Object.assign({ maxSize: (_f = query === null || query === void 0 ? void 0 : query.maxSize) !== null && _f !== void 0 ? _f : maxSize, defaultSize: (_g = query === null || query === void 0 ? void 0 : query.defaultSize) !== null && _g !== void 0 ? _g : defaultSize, hashTag: query === null || query === void 0 ? void 0 : query.hashTag, traceInfo: query === null || query === void 0 ? void 0 : query.traceInfo, themeTag: query === null || query === void 0 ? void 0 : query.themeTag, pageNum: query === null || query === void 0 ? void 0 : query.pageNum, contentFilter: query === null || query === void 0 ? void 0 : query.contentFilter, productFilter: query === null || query === void 0 ? void 0 : query.productFilter }, (chatlabsId && { chatlabsId })), (isDiyPage && { type: 'story' }));
1085
1095
  if (channel) {
1086
1096
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
1087
1097
  }
@@ -1094,9 +1104,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1094
1104
  if (val)
1095
1105
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
1096
1106
  }
1107
+ const isDiy = isDiyH5 && ((_o = (_m = (_l = finalPageData === null || finalPageData === void 0 ? void 0 : finalPageData.data) === null || _l === void 0 ? void 0 : _l.sxpPageConf) === null || _m === void 0 ? void 0 : _m.globalConfig) === null || _o === void 0 ? void 0 : _o.enablePreview);
1097
1108
  if (isEditor) {
1098
1109
  let pageNum = 1;
1099
- query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] }));
1110
+ query = Object.assign(Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1 }), (!utmVal && channelQueryList && (channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList.length) > 0 && { channel: channelQueryList === null || channelQueryList === void 0 ? void 0 : channelQueryList[0] })), (isDiy && { maxRecs: query === null || query === void 0 ? void 0 : query.maxSize }));
1100
1111
  if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current) {
1101
1112
  return undefined;
1102
1113
  }
@@ -1104,19 +1115,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1104
1115
  let list = [];
1105
1116
  let result = null;
1106
1117
  const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
1107
- var _v, _w, _x, _y, _z, _0;
1118
+ var _y, _z, _0, _1, _2, _3;
1108
1119
  query.pageNum = pageNum;
1109
- result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
1120
+ result = isDiyH5
1121
+ ? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
1122
+ : yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/direct_page', { method: 'POST', body: query }));
1110
1123
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
1111
1124
  return undefined;
1112
1125
  }
1113
1126
  setLoading(false);
1114
- list = list.concat((_y = (_x = (_w = (_v = result === null || result === void 0 ? void 0 : result.data) === null || _v === void 0 ? void 0 : _v.recList) === null || _w === void 0 ? void 0 : _w.filter) === null || _x === void 0 ? void 0 : _x.call(_w, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _y !== void 0 ? _y : []);
1127
+ list = list.concat((_1 = (_0 = (_z = (_y = result === null || result === void 0 ? void 0 : result.data) === null || _y === void 0 ? void 0 : _y.recList) === null || _z === void 0 ? void 0 : _z.filter) === null || _0 === void 0 ? void 0 : _0.call(_z, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _1 !== void 0 ? _1 : []);
1115
1128
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
1116
1129
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
1117
1130
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
1131
+ if (isDiyPage) {
1132
+ setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
1133
+ }
1118
1134
  }
1119
- 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));
1135
+ const isNotNullList = (_3 = (_2 = result === null || result === void 0 ? void 0 : result.data) === null || _2 === void 0 ? void 0 : _2.recList) === null || _3 === void 0 ? void 0 : _3.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
1120
1136
  if (isNotNullList) {
1121
1137
  pageNum = pageNum + 1;
1122
1138
  yield recurveRecList(query);
@@ -1124,42 +1140,61 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1124
1140
  });
1125
1141
  yield recurveRecList(query);
1126
1142
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
1127
- setCurReqInfo({ rtc: (_l = result === null || result === void 0 ? void 0 : result.data) === null || _l === void 0 ? void 0 : _l.rtc, requestId: (_m = result === null || result === void 0 ? void 0 : result.data) === null || _m === void 0 ? void 0 : _m.requestId });
1143
+ setCurReqInfo({ rtc: (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.rtc, requestId: (_q = result === null || result === void 0 ? void 0 : result.data) === null || _q === void 0 ? void 0 : _q.requestId });
1128
1144
  return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
1129
1145
  }
1130
1146
  if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
1131
- query = Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_o = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _o !== void 0 ? _o : 1 });
1147
+ query = Object.assign(Object.assign(Object.assign({}, query), { directPage: true, level: 1, pageNum: (_r = query === null || query === void 0 ? void 0 : query.pageNum) !== null && _r !== void 0 ? _r : 1 }), (isDiy && { maxRecs: query === null || query === void 0 ? void 0 : query.maxSize }));
1132
1148
  }
1133
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
1134
- method: 'POST',
1135
- body: query
1136
- }));
1149
+ const result = isDiy
1150
+ ? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
1151
+ : yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
1152
+ method: 'POST',
1153
+ body: query
1154
+ }));
1137
1155
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
1138
1156
  return undefined;
1139
1157
  }
1140
1158
  if (!(query === null || query === void 0 ? void 0 : query.hashTag))
1141
1159
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
1142
1160
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
1143
- const isNotNullList = (_q = (_p = result === null || result === void 0 ? void 0 : result.data) === null || _p === void 0 ? void 0 : _p.recList) === null || _q === void 0 ? void 0 : _q.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
1161
+ const isNotNullList = (_t = (_s = result === null || result === void 0 ? void 0 : result.data) === null || _s === void 0 ? void 0 : _s.recList) === null || _t === void 0 ? void 0 : _t.some((item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video));
1144
1162
  if (!isNotNullList) {
1145
1163
  setIsNoMoreData(true);
1146
1164
  }
1147
1165
  }
1148
1166
  let list = [];
1149
- list = list.concat((_u = (_t = (_s = (_r = result === null || result === void 0 ? void 0 : result.data) === null || _r === void 0 ? void 0 : _r.recList) === null || _s === void 0 ? void 0 : _s.filter) === null || _t === void 0 ? void 0 : _t.call(_s, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _u !== void 0 ? _u : []);
1167
+ list = list.concat((_x = (_w = (_v = (_u = result === null || result === void 0 ? void 0 : result.data) === null || _u === void 0 ? void 0 : _u.recList) === null || _v === void 0 ? void 0 : _v.filter) === null || _w === void 0 ? void 0 : _w.call(_v, (item) => (item === null || item === void 0 ? void 0 : item.product) || (item === null || item === void 0 ? void 0 : item.video))) !== null && _x !== void 0 ? _x : []);
1150
1168
  return Object.assign(Object.assign({}, result.data), { recList: list });
1151
- }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
1169
+ }), [
1170
+ bffFetch,
1171
+ utmVal,
1172
+ maxSize,
1173
+ defaultSize,
1174
+ channelQueryList,
1175
+ channel,
1176
+ chatlabsId,
1177
+ bffFetchAdmin,
1178
+ isDiyPage,
1179
+ finalPageData,
1180
+ isDiyH5
1181
+ ]);
1152
1182
  const loadVideos = useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
1153
- var _1, _2, _3, _4;
1183
+ var _4, _5, _6, _7;
1154
1184
  if (rtcList.length <= 0) {
1155
1185
  return;
1156
1186
  }
1187
+ if (isDiyPage && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
1188
+ setRtcList(rtcList.concat(firstRtcList));
1189
+ setCacheRtcList(cacheRtcList.concat(firstRtcList));
1190
+ return;
1191
+ }
1157
1192
  const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
1158
- 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 })));
1193
+ const data = yield getRecommendVideos(Object.assign(Object.assign(Object.assign(Object.assign({ hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag }, (((_4 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _4 === void 0 ? void 0 : _4.itemId) && { productFilter: [(_5 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.product) === null || _5 === void 0 ? void 0 : _5.itemId] })), (((_6 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _6 === void 0 ? void 0 : _6.itemId) && { contentFilter: [(_7 = lastItem === null || lastItem === void 0 ? void 0 : lastItem.video) === null || _7 === void 0 ? void 0 : _7.itemId] })), { themeTag: themeTag.current }), ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor && { pageNum })));
1159
1194
  setRtcList(rtcList.concat(getFilterRecList(data)));
1160
1195
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
1161
1196
  return data;
1162
- }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
1197
+ }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyPage, firstRtcList]);
1163
1198
  const refreshFeSession = useCallback((enableReSid, event) => {
1164
1199
  var _a, _b, _c, _d, _e;
1165
1200
  let expire = false;
@@ -1190,8 +1225,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1190
1225
  // 用户信息都是公共的
1191
1226
  if (!userInfo) {
1192
1227
  userInfo = {
1193
- // productUserId: fakeUserId, // 后端逻辑会从请求头获取,所以不需要传
1194
- // tpChannelId: 'H5' // 后端处理
1228
+ productUserId: fakeUserId // 后端逻辑会从请求头获取,所以不需要传
1229
+ // tpChannelId: 'H5' // 后端处理
1195
1230
  };
1196
1231
  }
1197
1232
  const sessionID = storeAndLoadFeSessionId();
@@ -1225,7 +1260,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1225
1260
  layoutVariantId,
1226
1261
  globalConfig,
1227
1262
  playbookType,
1228
- bffDataSource
1263
+ bffDataSource,
1264
+ fakeUserId
1229
1265
  ]);
1230
1266
  const getEventParamsByJson = useCallback((_a) => {
1231
1267
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
@@ -1311,6 +1347,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1311
1347
  var _a;
1312
1348
  const prop = match.substring(2, match.length - 2);
1313
1349
  try {
1350
+ // eslint-disable-next-line no-new-func
1314
1351
  let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product === null || product === void 0 ? void 0 : product[0]);
1315
1352
  if (replaceValue) {
1316
1353
  if ((prop === null || prop === void 0 ? void 0 : prop.indexOf('currency')) !== -1 &&
@@ -1412,38 +1449,40 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1412
1449
  }
1413
1450
  }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
1414
1451
  const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1452
+ body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
1415
1453
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
1416
1454
  return res === null || res === void 0 ? void 0 : res.success;
1417
- }), [bffFetch]);
1455
+ }), [bffFetch, fakeUserId]);
1418
1456
  const bffMutateUnlike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1457
+ body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
1419
1458
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
1420
1459
  return res === null || res === void 0 ? void 0 : res.success;
1421
- }), [bffFetch]);
1460
+ }), [bffFetch, fakeUserId]);
1422
1461
  const bffSubmitForm = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1423
1462
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
1424
1463
  return res === null || res === void 0 ? void 0 : res.success;
1425
1464
  }), [bffFetch]);
1426
1465
  // 获取 Tag
1427
1466
  const bffGetTagList = useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
1428
- var _5, _6, _7, _8, _9, _10, _11, _12;
1429
- const isShowTag = !!((_7 = (_6 = (_5 = data === null || data === void 0 ? void 0 : data.data) === null || _5 === void 0 ? void 0 : _5.sxpPageConf) === null || _6 === void 0 ? void 0 : _6.globalConfig) === null || _7 === void 0 ? void 0 : _7.isShowTag);
1467
+ var _8, _9, _10, _11, _12, _13, _14, _15;
1468
+ const isShowTag = !!((_10 = (_9 = (_8 = data === null || data === void 0 ? void 0 : data.data) === null || _8 === void 0 ? void 0 : _8.sxpPageConf) === null || _9 === void 0 ? void 0 : _9.globalConfig) === null || _10 === void 0 ? void 0 : _10.isShowTag);
1430
1469
  if (!utmVal || !isShowTag)
1431
1470
  return;
1432
1471
  try {
1433
- const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
1472
+ const val = (_13 = (_12 = (_11 = splitUrlParams(utmVal)) === null || _11 === void 0 ? void 0 : _11.filter((val) => {
1434
1473
  var _a, _b;
1435
1474
  const key = val.split('=')[0];
1436
1475
  return (_b = ((_a = utmParameter === null || utmParameter === void 0 ? void 0 : utmParameter.channels) !== null && _a !== void 0 ? _a : [])) === null || _b === void 0 ? void 0 : _b.includes(key);
1437
- })) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
1476
+ })) === null || _12 === void 0 ? void 0 : _12.join('&')) !== null && _13 !== void 0 ? _13 : '';
1438
1477
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
1439
- setTagList((_12 = (_11 = result === null || result === void 0 ? void 0 : result.data) === null || _11 === void 0 ? void 0 : _11.tags) !== null && _12 !== void 0 ? _12 : []);
1478
+ setTagList((_15 = (_14 = result === null || result === void 0 ? void 0 : result.data) === null || _14 === void 0 ? void 0 : _14.tags) !== null && _15 !== void 0 ? _15 : []);
1440
1479
  }
1441
1480
  catch (e) {
1442
1481
  console.log('e', e);
1443
1482
  }
1444
1483
  }), [bffFetch, utmVal]);
1445
1484
  const ctaEvent = useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
1446
- 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;
1485
+ 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;
1447
1486
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
1448
1487
  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);
1449
1488
  let fromKName = '';
@@ -1461,7 +1500,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1461
1500
  }
1462
1501
  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;
1463
1502
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1464
- 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 })
1503
+ 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 })
1465
1504
  });
1466
1505
  }, [bffEventReport, isFromHashtag]);
1467
1506
  const h5EnterLink = useCallback(() => {
@@ -1485,10 +1524,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1485
1524
  });
1486
1525
  }, [bffEventReport]);
1487
1526
  const getAccount = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
1488
- var _13, _14;
1527
+ var _16, _17;
1489
1528
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
1490
- setChatlabsId((_13 = res === null || res === void 0 ? void 0 : res.data) === null || _13 === void 0 ? void 0 : _13.chatLabsId);
1491
- return ((_14 = res === null || res === void 0 ? void 0 : res.data) === null || _14 === void 0 ? void 0 : _14.consentResult) === 'true';
1529
+ setChatlabsId((_16 = res === null || res === void 0 ? void 0 : res.data) === null || _16 === void 0 ? void 0 : _16.chatLabsId);
1530
+ return ((_17 = res === null || res === void 0 ? void 0 : res.data) === null || _17 === void 0 ? void 0 : _17.consentResult) === 'true';
1492
1531
  }), [bffFetch]);
1493
1532
  const accountSonsent = useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
1494
1533
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
@@ -1552,6 +1591,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1552
1591
  }
1553
1592
  setRtcList(list);
1554
1593
  setCacheRtcList(list);
1594
+ if (isDiyPage) {
1595
+ setFirstRtcList(list);
1596
+ }
1555
1597
  bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
1556
1598
  if (channel) {
1557
1599
  const item = list === null || list === void 0 ? void 0 : list[0];
@@ -1571,7 +1613,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1571
1613
  });
1572
1614
  setLoading(false);
1573
1615
  });
1574
- }, [isShowConsent, channel]);
1616
+ }, [isShowConsent, channel, isDiyPage]);
1575
1617
  // cms预览
1576
1618
  useEffect(() => {
1577
1619
  if (!isPreview)
@@ -1587,12 +1629,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1587
1629
  }
1588
1630
  setRtcList(list);
1589
1631
  setCacheRtcList(list);
1632
+ if (isDiyPage) {
1633
+ setFirstRtcList(list);
1634
+ }
1590
1635
  }
1591
1636
  })
1592
1637
  .finally(() => {
1593
1638
  setLoading(false);
1594
1639
  });
1595
- }, [getRecommendVideos, bffGetTagList, channel]);
1640
+ }, [getRecommendVideos, bffGetTagList, channel, isDiyPage]);
1596
1641
  const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
1597
1642
  return (React.createElement(SxpDataSourceContext.Provider, { value: {
1598
1643
  rtcList,
@@ -1650,7 +1695,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1650
1695
  refreshFeSession,
1651
1696
  getAccount,
1652
1697
  accountSonsent,
1653
- isDiyH5,
1698
+ isDiyH5: isDiyPage,
1699
+ firstRtcList,
1654
1700
  pixelPvStatusRef
1655
1701
  } }, 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({
1656
1702
  rtcList,
@@ -1885,9 +1931,820 @@ const EditorCore = forwardRef(({ children, resolver, isSsr, schema, enableDataSo
1885
1931
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
1886
1932
  });
1887
1933
 
1934
+ const FormatImage = forwardRef((props, ref) => {
1935
+ const { src, onLoad, style, className, loading, alt = 'image' } = props;
1936
+ const [imgSrc, setImgSrc] = useState(src);
1937
+ const imgRef = useRef(null);
1938
+ const [visible, setVisible] = useState(false);
1939
+ useImperativeHandle(ref, () => ({
1940
+ setSrc: (v) => {
1941
+ if (v)
1942
+ setImgSrc(v);
1943
+ }
1944
+ }));
1945
+ useEffect(() => {
1946
+ if (src)
1947
+ setImgSrc(src);
1948
+ }, [src]);
1949
+ useEffect(() => {
1950
+ const onShow = () => {
1951
+ if (src && !visible && imgRef.current) {
1952
+ imgRef.current.src = '';
1953
+ imgRef.current.src = src;
1954
+ }
1955
+ };
1956
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
1957
+ return () => {
1958
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
1959
+ };
1960
+ }, [src, visible]);
1961
+ return (React.createElement(React.Fragment, null,
1962
+ !visible && !imgSrc && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
1963
+ (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
1964
+ React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
1965
+ React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
1966
+ React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
1967
+ React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
1968
+ setVisible(true);
1969
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
1970
+ }, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
1971
+ setVisible(true);
1972
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
1973
+ }, alt: alt }))));
1974
+ });
1975
+ var FormatImage$1 = memo(FormatImage);
1976
+
1977
+ // 动态导入材料库(避免循环依赖)
1978
+ const RESOLVER$3 = {};
1979
+ try {
1980
+ // 尝试动态导入材料库
1981
+ const materialsModule = require('../../materials/sxp');
1982
+ Object.values(materialsModule).forEach((v) => {
1983
+ var _a;
1984
+ if ((_a = v === null || v === void 0 ? void 0 : v.extend) === null || _a === void 0 ? void 0 : _a.type) {
1985
+ RESOLVER$3[v.extend.type] = v;
1986
+ }
1987
+ });
1988
+ }
1989
+ catch (error) {
1990
+ console.warn('Failed to load materials for StructurePage:', error);
1991
+ }
1992
+ // 基础样式定义
1993
+ const baseStyles = {
1994
+ container: {
1995
+ backgroundColor: '#000',
1996
+ overflowY: 'auto',
1997
+ overflowX: 'hidden',
1998
+ padding: 0,
1999
+ boxSizing: 'border-box'
2000
+ },
2001
+ section: {
2002
+ width: '100%',
2003
+ position: 'relative',
2004
+ boxSizing: 'border-box'
2005
+ },
2006
+ // Hero Section
2007
+ heroSection: {
2008
+ width: '100%',
2009
+ height: 'auto',
2010
+ position: 'relative',
2011
+ overflow: 'hidden',
2012
+ backgroundColor: '#000'
2013
+ },
2014
+ heroTopText: {
2015
+ width: '100%',
2016
+ padding: '20px',
2017
+ backgroundColor: '#fff',
2018
+ color: '#000',
2019
+ fontSize: '16px',
2020
+ fontWeight: 'bold',
2021
+ textAlign: 'center',
2022
+ boxSizing: 'border-box'
2023
+ },
2024
+ heroImageContainer: {
2025
+ width: '100%',
2026
+ position: 'relative',
2027
+ overflow: 'hidden'
2028
+ },
2029
+ heroImage: {
2030
+ width: '100%',
2031
+ height: 'auto',
2032
+ display: 'block',
2033
+ objectFit: 'cover'
2034
+ },
2035
+ heroVideo: {
2036
+ width: '100%',
2037
+ height: 'auto',
2038
+ display: 'block',
2039
+ objectFit: 'cover'
2040
+ },
2041
+ heroOverlay: {
2042
+ position: 'absolute',
2043
+ bottom: 0,
2044
+ left: 0,
2045
+ right: 0,
2046
+ padding: '40px 20px',
2047
+ background: 'linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%)',
2048
+ color: '#fff',
2049
+ display: 'flex',
2050
+ justifyContent: 'center',
2051
+ alignItems: 'center'
2052
+ },
2053
+ heroButton: {
2054
+ padding: '12px 30px',
2055
+ backgroundColor: '#fff',
2056
+ color: '#000',
2057
+ border: 'none',
2058
+ fontSize: '14px',
2059
+ fontWeight: 500,
2060
+ cursor: 'pointer',
2061
+ textTransform: 'uppercase'
2062
+ },
2063
+ // Carousel Section
2064
+ carouselSection: {
2065
+ width: '100%',
2066
+ position: 'relative'
2067
+ },
2068
+ carouselImageContainer: {
2069
+ width: '100%',
2070
+ height: 'auto',
2071
+ position: 'relative',
2072
+ overflow: 'hidden'
2073
+ },
2074
+ carouselContainer: {
2075
+ display: 'flex',
2076
+ transition: 'transform 0.5s ease-in-out',
2077
+ width: '100%'
2078
+ },
2079
+ carouselSlide: {
2080
+ minWidth: '100%',
2081
+ position: 'relative'
2082
+ },
2083
+ carouselImage: {
2084
+ width: '100%',
2085
+ height: 'auto',
2086
+ display: 'block',
2087
+ objectFit: 'cover'
2088
+ },
2089
+ carouselVideo: {
2090
+ width: '100%',
2091
+ height: 'auto',
2092
+ display: 'block',
2093
+ objectFit: 'cover'
2094
+ },
2095
+ carouselInfoSection: {
2096
+ width: '100%',
2097
+ padding: '20px',
2098
+ backgroundColor: '#000',
2099
+ color: '#fff',
2100
+ textAlign: 'center'
2101
+ },
2102
+ carouselText: {
2103
+ fontSize: '16px',
2104
+ fontWeight: 'normal',
2105
+ marginBottom: '15px',
2106
+ color: '#fff'
2107
+ },
2108
+ carouselButton: {
2109
+ padding: '10px 25px',
2110
+ backgroundColor: '#fff',
2111
+ color: '#000',
2112
+ border: '1px solid #fff',
2113
+ fontSize: '13px',
2114
+ fontWeight: 500,
2115
+ cursor: 'pointer',
2116
+ textTransform: 'uppercase'
2117
+ },
2118
+ arrowButton: {
2119
+ position: 'absolute',
2120
+ top: '50%',
2121
+ transform: 'translateY(-50%)',
2122
+ width: '40px',
2123
+ height: '40px',
2124
+ backgroundColor: 'rgba(255,255,255,0.8)',
2125
+ border: 'none',
2126
+ borderRadius: '50%',
2127
+ fontSize: '18px',
2128
+ cursor: 'pointer',
2129
+ zIndex: 10,
2130
+ display: 'flex',
2131
+ alignItems: 'center',
2132
+ justifyContent: 'center'
2133
+ },
2134
+ // Highlight Reveal Section
2135
+ highlightSection: {
2136
+ width: '100%',
2137
+ position: 'relative',
2138
+ backgroundColor: '#000'
2139
+ },
2140
+ highlightImageContainer: {
2141
+ width: '100%',
2142
+ aspectRatio: '1/1',
2143
+ position: 'relative',
2144
+ overflow: 'hidden'
2145
+ },
2146
+ highlightImage: {
2147
+ width: '100%',
2148
+ height: '100%',
2149
+ objectFit: 'cover',
2150
+ display: 'block'
2151
+ },
2152
+ highlightInfoSection: {
2153
+ width: '100%',
2154
+ padding: '20px',
2155
+ backgroundColor: '#000',
2156
+ color: '#fff',
2157
+ textAlign: 'center'
2158
+ },
2159
+ highlightTitle: {
2160
+ fontSize: '18px',
2161
+ fontWeight: 'bold',
2162
+ marginBottom: '10px',
2163
+ textAlign: 'center',
2164
+ color: '#fff'
2165
+ },
2166
+ highlightDesc: {
2167
+ fontSize: '14px',
2168
+ marginBottom: '15px',
2169
+ textAlign: 'center',
2170
+ lineHeight: '1.5',
2171
+ color: '#ccc'
2172
+ },
2173
+ highlightButton: {
2174
+ padding: '10px 25px',
2175
+ backgroundColor: 'transparent',
2176
+ color: '#fff',
2177
+ border: '1px solid #fff',
2178
+ fontSize: '13px',
2179
+ fontWeight: 500,
2180
+ cursor: 'pointer',
2181
+ textTransform: 'uppercase'
2182
+ },
2183
+ // Product Grid Section
2184
+ productGrid: {
2185
+ display: 'grid',
2186
+ gridTemplateColumns: '50% 50%',
2187
+ gridAutoRows: 'auto',
2188
+ gap: '0',
2189
+ width: '100%',
2190
+ backgroundColor: '#000',
2191
+ boxSizing: 'border-box',
2192
+ margin: 0,
2193
+ padding: 0,
2194
+ overflow: 'hidden'
2195
+ },
2196
+ productItem: {
2197
+ position: 'relative',
2198
+ backgroundColor: '#000',
2199
+ display: 'block',
2200
+ boxSizing: 'border-box',
2201
+ width: '100%',
2202
+ minWidth: 0,
2203
+ overflow: 'hidden'
2204
+ },
2205
+ productImageContainer: {
2206
+ width: '100%',
2207
+ paddingBottom: '100%',
2208
+ position: 'relative',
2209
+ overflow: 'hidden'
2210
+ },
2211
+ productImage: {
2212
+ position: 'absolute',
2213
+ top: 0,
2214
+ left: 0,
2215
+ width: '100%',
2216
+ height: '100%',
2217
+ objectFit: 'cover',
2218
+ display: 'block'
2219
+ },
2220
+ productCtaContainer: {
2221
+ width: '100%',
2222
+ padding: '15px',
2223
+ backgroundColor: '#000',
2224
+ textAlign: 'center',
2225
+ boxSizing: 'border-box'
2226
+ },
2227
+ productText: {
2228
+ width: '100%',
2229
+ padding: '15px',
2230
+ backgroundColor: '#000',
2231
+ color: '#fff',
2232
+ textAlign: 'center',
2233
+ fontSize: '14px',
2234
+ fontWeight: 'normal',
2235
+ boxSizing: 'border-box'
2236
+ },
2237
+ productButton: {
2238
+ padding: '8px 20px',
2239
+ backgroundColor: 'transparent',
2240
+ color: '#fff',
2241
+ border: '1px solid #fff',
2242
+ fontSize: '12px',
2243
+ fontWeight: 500,
2244
+ cursor: 'pointer',
2245
+ textTransform: 'uppercase',
2246
+ whiteSpace: 'nowrap'
2247
+ },
2248
+ // Footer Section
2249
+ footerSection: {
2250
+ width: '100%',
2251
+ position: 'relative',
2252
+ backgroundColor: '#000'
2253
+ },
2254
+ footerInfoSection: {
2255
+ width: '100%',
2256
+ padding: '20px',
2257
+ backgroundColor: '#000',
2258
+ color: '#fff',
2259
+ textAlign: 'center'
2260
+ },
2261
+ footerText: {
2262
+ fontSize: '18px',
2263
+ fontWeight: 'normal',
2264
+ marginBottom: '15px',
2265
+ lineHeight: '1.4',
2266
+ color: '#fff'
2267
+ },
2268
+ footerButton: {
2269
+ padding: '10px 25px',
2270
+ backgroundColor: 'transparent',
2271
+ color: '#fff',
2272
+ border: '1px solid #fff',
2273
+ fontSize: '13px',
2274
+ fontWeight: 500,
2275
+ cursor: 'pointer',
2276
+ textTransform: 'uppercase',
2277
+ marginBottom: '20px',
2278
+ display: 'inline-block'
2279
+ },
2280
+ footerImageContainer: {
2281
+ width: '100%',
2282
+ aspectRatio: '1/1',
2283
+ overflow: 'hidden'
2284
+ },
2285
+ footerImage: {
2286
+ width: '100%',
2287
+ height: '100%',
2288
+ objectFit: 'cover',
2289
+ display: 'block'
2290
+ }
2291
+ };
2292
+ const StructurePage = (_a) => {
2293
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
2294
+ var { containerStyle, containerHeight = 664, containerWidth = 375, className = '', apiUrl = 'https://bff-be-dev.chatlabs.net/api/v1/recommend/list', requestBody, editorMode = false, multiCTAConfig: propMultiCTAConfig, videoPlayIcon: propVideoPlayIcon, isCmsMode = false, storyId, customHeaders } = _a, rest = __rest(_a, ["containerStyle", "containerHeight", "containerWidth", "className", "apiUrl", "requestBody", "editorMode", "multiCTAConfig", "videoPlayIcon", "isCmsMode", "storyId", "customHeaders"]);
2295
+ const [data, setData] = useState(null);
2296
+ const [loading, setLoading] = useState(true);
2297
+ const [error, setError] = useState(null);
2298
+ const [carouselIndex, setCarouselIndex] = useState(0);
2299
+ const heroVideoRef = useRef(null);
2300
+ const carouselVideoRefs = useRef([]);
2301
+ // 视频暂停状态管理
2302
+ const [isHeroVideoPaused, setIsHeroVideoPaused] = useState(false);
2303
+ const [carouselVideoPausedStates, setCarouselVideoPausedStates] = useState([]);
2304
+ // 从 schema 中获取 multiCTAConfig(优先使用 props 传入的)
2305
+ const { schema } = useEditor();
2306
+ const multiCTAConfig = useMemo(() => {
2307
+ var _a;
2308
+ return propMultiCTAConfig || ((_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.multiCTAConfig) || {};
2309
+ }, [propMultiCTAConfig, (_b = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _b === void 0 ? void 0 : _b.multiCTAConfig]);
2310
+ // 默认播放图标 URL(直接使用 CDN 地址作为后备)
2311
+ const DEFAULT_PAUSE_ICON = 'https://sxph5-uat.chatlabs.net/pb_static/06f28a2025c74c1cb49be6767316d827.png';
2312
+ // 获取视频播放图标
2313
+ const videoPlayIcon = useMemo(() => {
2314
+ var _a, _b;
2315
+ // 优先使用 props 传入的
2316
+ if (propVideoPlayIcon)
2317
+ return propVideoPlayIcon;
2318
+ // 然后使用 schema 配置的
2319
+ const configIcon = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.videoPlayIcon;
2320
+ if (configIcon) {
2321
+ // 如果是完整 URL,直接使用
2322
+ if (configIcon.startsWith('http://') || configIcon.startsWith('https://')) {
2323
+ return configIcon;
2324
+ }
2325
+ // 如果是相对路径,拼接当前域名
2326
+ if (configIcon.startsWith('/')) {
2327
+ return `${window.location.origin}${configIcon}`;
2328
+ }
2329
+ return configIcon;
2330
+ }
2331
+ // 最后使用默认图标
2332
+ return DEFAULT_PAUSE_ICON;
2333
+ }, [propVideoPlayIcon, (_d = (_c = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _c === void 0 ? void 0 : _c.globalConfig) === null || _d === void 0 ? void 0 : _d.videoPlayIcon]);
2334
+ // 处理 CTA 点击
2335
+ const handleCtaClick = useCallback((link, interaction, productData, ctaData) => {
2336
+ // 如果配置了交互设置,优先使用交互设置
2337
+ if (interaction) {
2338
+ const { linkType, popupType, popupAni } = interaction;
2339
+ if (linkType === 'popup' && popupType) {
2340
+ // 设置弹窗要显示的产品数据
2341
+ if (productData && typeof window !== 'undefined' && window.setPopupDetailData) {
2342
+ // 构造与原有系统一致的数据结构
2343
+ const popupData = {
2344
+ video: {
2345
+ bindProduct: productData,
2346
+ bindProducts: [productData],
2347
+ bindCta: ctaData
2348
+ }
2349
+ };
2350
+ window.setPopupDetailData(popupData);
2351
+ }
2352
+ // 打开弹窗 - 使用与现有系统一致的方式
2353
+ if (typeof window !== 'undefined' && window.sxpPopup) {
2354
+ // 如果有动画配置,传递动画参数;否则只传弹窗 ID
2355
+ if (popupAni && popupAni.name) {
2356
+ window.sxpPopup(popupType, popupAni);
2357
+ }
2358
+ else {
2359
+ window.sxpPopup(popupType);
2360
+ }
2361
+ }
2362
+ return;
2363
+ }
2364
+ }
2365
+ // 默认行为:打开外部链接
2366
+ if (link) {
2367
+ window.open(link, '_blank');
2368
+ }
2369
+ }, []);
2370
+ // 合并基础样式和编辑器配置的样式
2371
+ const mergeStyles = useCallback((baseStyle, configKey) => {
2372
+ if (!editorMode || !multiCTAConfig[configKey]) {
2373
+ return baseStyle;
2374
+ }
2375
+ const config = multiCTAConfig[configKey];
2376
+ // 定义允许的样式属性列表
2377
+ const styleKeys = [
2378
+ 'fontSize', 'color', 'textAlign', 'fontWeight',
2379
+ 'backgroundColor', 'padding', 'margin', 'borderRadius',
2380
+ 'showBorder', 'borderWidth', 'borderColor',
2381
+ 'buttonBackgroundColor', 'buttonTextColor', 'buttonWidth', 'buttonHeight'
2382
+ ];
2383
+ // 只处理样式相关的属性,忽略 interaction 等非样式属性
2384
+ const styleConfig = Object.keys(config)
2385
+ .filter(key => styleKeys.includes(key))
2386
+ .reduce((obj, key) => {
2387
+ obj[key] = config[key];
2388
+ return obj;
2389
+ }, {});
2390
+ // 如果配置中没有任何样式字段(只有 interaction),直接返回基础样式
2391
+ if (Object.keys(styleConfig).length === 0) {
2392
+ return baseStyle;
2393
+ }
2394
+ const customStyle = {};
2395
+ // 应用配置中的样式
2396
+ if (styleConfig.fontSize && typeof styleConfig.fontSize === 'number') {
2397
+ customStyle.fontSize = `${styleConfig.fontSize}px`;
2398
+ }
2399
+ if (styleConfig.color && typeof styleConfig.color === 'string') {
2400
+ customStyle.color = styleConfig.color;
2401
+ }
2402
+ if (styleConfig.textAlign && typeof styleConfig.textAlign === 'string') {
2403
+ customStyle.textAlign = styleConfig.textAlign;
2404
+ }
2405
+ if (styleConfig.fontWeight && typeof styleConfig.fontWeight === 'number') {
2406
+ customStyle.fontWeight = styleConfig.fontWeight;
2407
+ }
2408
+ if (styleConfig.backgroundColor && typeof styleConfig.backgroundColor === 'string') {
2409
+ customStyle.backgroundColor = styleConfig.backgroundColor;
2410
+ }
2411
+ if (styleConfig.padding && typeof styleConfig.padding === 'string') {
2412
+ customStyle.padding = styleConfig.padding;
2413
+ }
2414
+ if (styleConfig.margin && typeof styleConfig.margin === 'string') {
2415
+ customStyle.margin = styleConfig.margin;
2416
+ }
2417
+ if (styleConfig.borderRadius && typeof styleConfig.borderRadius === 'number') {
2418
+ customStyle.borderRadius = `${styleConfig.borderRadius}px`;
2419
+ }
2420
+ if (styleConfig.showBorder && styleConfig.borderWidth && typeof styleConfig.borderWidth === 'number') {
2421
+ customStyle.border = `${styleConfig.borderWidth}px solid ${styleConfig.borderColor || '#d9d9d9'}`;
2422
+ }
2423
+ // 按钮特殊样式
2424
+ if (styleConfig.buttonBackgroundColor && typeof styleConfig.buttonBackgroundColor === 'string') {
2425
+ customStyle.backgroundColor = styleConfig.buttonBackgroundColor;
2426
+ }
2427
+ if (styleConfig.buttonTextColor && typeof styleConfig.buttonTextColor === 'string') {
2428
+ customStyle.color = styleConfig.buttonTextColor;
2429
+ }
2430
+ if (styleConfig.buttonWidth && typeof styleConfig.buttonWidth === 'number') {
2431
+ customStyle.width = `${styleConfig.buttonWidth}px`;
2432
+ }
2433
+ if (styleConfig.buttonHeight && typeof styleConfig.buttonHeight === 'number') {
2434
+ customStyle.height = `${styleConfig.buttonHeight}px`;
2435
+ }
2436
+ return Object.assign(Object.assign({}, baseStyle), customStyle);
2437
+ }, [editorMode, multiCTAConfig]);
2438
+ // 渲染 CTA 按钮或模版组件
2439
+ const renderCTA = useCallback((buttonKey, ctaData, productData, fallbackStyle) => {
2440
+ var _a, _b, _c;
2441
+ if (!ctaData) {
2442
+ return null;
2443
+ }
2444
+ const config = multiCTAConfig[buttonKey];
2445
+ const templateType = config === null || config === void 0 ? void 0 : config.templateType;
2446
+ const interaction = config === null || config === void 0 ? void 0 : config.interaction;
2447
+ // 如果配置了模版类型,渲染对应的模版组件
2448
+ if (editorMode && templateType && RESOLVER$3[templateType]) {
2449
+ const TemplateComponent = RESOLVER$3[templateType];
2450
+ const templateExtend = TemplateComponent === null || TemplateComponent === void 0 ? void 0 : TemplateComponent.extend;
2451
+ if (templateExtend) {
2452
+ // 准备模版组件的 props
2453
+ const templateProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (_a = templateExtend.defaulSetting) === null || _a === void 0 ? void 0 : _a.props), { style: Object.assign(Object.assign(Object.assign({}, (_b = templateExtend.defaulSetting) === null || _b === void 0 ? void 0 : _b.style), mergeStyles(fallbackStyle || {}, buttonKey)), { marginBottom: 0, width: '100%' }), textStyle: (_c = templateExtend.defaulSetting) === null || _c === void 0 ? void 0 : _c.textStyle }), (productData && { bindProduct: productData })), { isTel: true }), rest);
2454
+ // 渲染模版组件
2455
+ return React.createElement(TemplateComponent, templateProps);
2456
+ }
2457
+ }
2458
+ // 默认渲染按钮
2459
+ return (React.createElement("button", { style: mergeStyles(fallbackStyle || baseStyles.heroButton, buttonKey), onClick: () => handleCtaClick(ctaData === null || ctaData === void 0 ? void 0 : ctaData.link, interaction, productData, ctaData) }, ctaData.title));
2460
+ }, [multiCTAConfig, editorMode, handleCtaClick, mergeStyles, rest]);
2461
+ // 获取数据 - 只在组件挂载时执行一次
2462
+ useEffect(() => {
2463
+ // 重要:在 PB 编辑器模式下,propMultiCTAConfig 只是样式配置,不是数据源
2464
+ // 只有在 CMS 模式 (isCmsMode=false) 且 propMultiCTAConfig 包含实际数据时才跳过 API 调用
2465
+ // 判断是否包含实际数据:检查是否有 heroSection, carouselSection 等数据字段
2466
+ const hasActualData = propMultiCTAConfig && (propMultiCTAConfig.heroSection ||
2467
+ propMultiCTAConfig.carouselSection ||
2468
+ propMultiCTAConfig.highlightRevealSection ||
2469
+ propMultiCTAConfig.productGridSection ||
2470
+ propMultiCTAConfig.footerSection);
2471
+ if (editorMode && hasActualData && !isCmsMode) {
2472
+ setLoading(false);
2473
+ setError(null);
2474
+ // 使用传入的 multiCTAConfig 作为数据源
2475
+ setData(propMultiCTAConfig);
2476
+ return;
2477
+ }
2478
+ // 如果已经有数据了,且在编辑器模式下,不要重新请求
2479
+ if (editorMode && data && !isCmsMode) {
2480
+ return;
2481
+ }
2482
+ setLoading(true);
2483
+ setError(null);
2484
+ // 根据模式决定使用哪个接口
2485
+ let finalApiUrl = apiUrl;
2486
+ let bodyToSend = {};
2487
+ if (isCmsMode) {
2488
+ // CMS 模式:使用 /api/console/ad/multiCta/rec/detail 接口
2489
+ if (!storyId) {
2490
+ console.error('[StructurePage CMS Mode] storyId is required but not provided');
2491
+ setError('storyId is required in CMS mode');
2492
+ setLoading(false);
2493
+ return;
2494
+ }
2495
+ // 构建 CMS 接口的 URL 和请求体
2496
+ // apiUrl 应该是域名(如 http://localhost:8001),然后拼接 /api/console/ad/multiCta/rec/detail
2497
+ finalApiUrl = `${apiUrl}/api/console/ad/multiCta/rec/detail`;
2498
+ bodyToSend = { storyId };
2499
+ }
2500
+ else {
2501
+ // 普通模式:使用原有的 /api/v1/recommend/list 接口
2502
+ const defaultBody = {
2503
+ maxSize: 20,
2504
+ defaultSize: 10,
2505
+ type: 'story'
2506
+ };
2507
+ bodyToSend = requestBody ? Object.assign(Object.assign({}, defaultBody), requestBody) : defaultBody;
2508
+ }
2509
+ // 构建请求头
2510
+ const headers = {
2511
+ 'Content-Type': 'application/json'
2512
+ };
2513
+ if (isCmsMode) {
2514
+ // CMS 模式:使用自定义 headers(如果有传入)
2515
+ if (customHeaders) {
2516
+ Object.assign(headers, customHeaders);
2517
+ }
2518
+ }
2519
+ else {
2520
+ // 普通模式:从 requestBody 或 bodyToSend 中提取 BFF headers
2521
+ if (bodyToSend['x-app-id']) {
2522
+ headers['x-app-id'] = bodyToSend['x-app-id'];
2523
+ delete bodyToSend['x-app-id'];
2524
+ }
2525
+ if (bodyToSend['x-user-id']) {
2526
+ headers['x-user-id'] = bodyToSend['x-user-id'];
2527
+ delete bodyToSend['x-user-id'];
2528
+ }
2529
+ if (bodyToSend['tenant-id']) {
2530
+ headers['tenant-id'] = bodyToSend['tenant-id'];
2531
+ delete bodyToSend['tenant-id'];
2532
+ }
2533
+ }
2534
+ fetch(finalApiUrl, {
2535
+ method: 'POST',
2536
+ headers,
2537
+ body: JSON.stringify(bodyToSend),
2538
+ credentials: 'include'
2539
+ })
2540
+ .then((res) => {
2541
+ if (!res.ok) {
2542
+ throw new Error(`HTTP error! status: ${res.status}`);
2543
+ }
2544
+ return res.json();
2545
+ })
2546
+ .then((result) => {
2547
+ var _a, _b, _c, _d;
2548
+ if (result.code === '0' || result.code === '00000') {
2549
+ // 判断数据结构:CMS 模式和普通模式可能不同
2550
+ let multiCtaData = null;
2551
+ if (isCmsMode) {
2552
+ // CMS 模式:data.multiCta
2553
+ multiCtaData = (_a = result.data) === null || _a === void 0 ? void 0 : _a.multiCta;
2554
+ }
2555
+ else {
2556
+ // 普通模式:data.recList[0].multiCta
2557
+ multiCtaData = (_d = (_c = (_b = result.data) === null || _b === void 0 ? void 0 : _b.recList) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.multiCta;
2558
+ }
2559
+ if (multiCtaData) {
2560
+ setData(multiCtaData);
2561
+ }
2562
+ else {
2563
+ console.error('[StructurePage] No multiCta data found in response:', result);
2564
+ setError(result.message || 'No multiCta data found');
2565
+ }
2566
+ }
2567
+ else {
2568
+ setError(result.message || 'Failed to load data');
2569
+ }
2570
+ setLoading(false);
2571
+ })
2572
+ .catch((err) => {
2573
+ console.error('[StructurePage] Failed to fetch data:', {
2574
+ error: err,
2575
+ message: err.message,
2576
+ url: finalApiUrl,
2577
+ body: bodyToSend,
2578
+ isCmsMode,
2579
+ storyId
2580
+ });
2581
+ setError(err.message || 'Network error');
2582
+ setLoading(false);
2583
+ });
2584
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2585
+ }, [apiUrl, isCmsMode, storyId, customHeaders]);
2586
+ // 注意:移除了 editorMode 和 propMultiCTAConfig 依赖,因为:
2587
+ // 1. editorMode 和 propMultiCTAConfig 在编辑器中频繁变化
2588
+ // 2. propMultiCTAConfig 只是样式配置,不是数据源
2589
+ // 3. 数据获取只应该在组件挂载时执行一次(除非 apiUrl/storyId 等关键参数变化)
2590
+ // Hero Section 视频自动播放
2591
+ useEffect(() => {
2592
+ var _a;
2593
+ if (heroVideoRef.current && ((_a = data === null || data === void 0 ? void 0 : data.heroSection) === null || _a === void 0 ? void 0 : _a.url)) {
2594
+ heroVideoRef.current.play().catch((err) => console.log('Video autoplay failed:', err));
2595
+ setIsHeroVideoPaused(false);
2596
+ }
2597
+ }, [data === null || data === void 0 ? void 0 : data.heroSection]);
2598
+ // 初始化 carousel 视频暂停状态
2599
+ useEffect(() => {
2600
+ if (data === null || data === void 0 ? void 0 : data.carouselSection) {
2601
+ // carousel 视频默认不自动播放,所以初始状态应该是暂停(true)
2602
+ setCarouselVideoPausedStates(new Array(data.carouselSection.length).fill(true));
2603
+ }
2604
+ }, [data === null || data === void 0 ? void 0 : data.carouselSection]);
2605
+ // Hero 视频点击处理
2606
+ const handleHeroVideoClick = useCallback(() => {
2607
+ if (heroVideoRef.current) {
2608
+ if (heroVideoRef.current.paused) {
2609
+ heroVideoRef.current.play();
2610
+ setIsHeroVideoPaused(false);
2611
+ }
2612
+ else {
2613
+ heroVideoRef.current.pause();
2614
+ setIsHeroVideoPaused(true);
2615
+ }
2616
+ }
2617
+ }, []);
2618
+ // Carousel 视频点击处理
2619
+ const handleCarouselVideoClick = useCallback((index) => {
2620
+ const videoRef = carouselVideoRefs.current[index];
2621
+ if (videoRef) {
2622
+ if (videoRef.paused) {
2623
+ videoRef.play();
2624
+ setCarouselVideoPausedStates(prev => {
2625
+ const newStates = [...prev];
2626
+ newStates[index] = false;
2627
+ return newStates;
2628
+ });
2629
+ }
2630
+ else {
2631
+ videoRef.pause();
2632
+ setCarouselVideoPausedStates(prev => {
2633
+ const newStates = [...prev];
2634
+ newStates[index] = true;
2635
+ return newStates;
2636
+ });
2637
+ }
2638
+ }
2639
+ }, []);
2640
+ // Carousel 导航
2641
+ const handleCarouselPrev = () => {
2642
+ if (data === null || data === void 0 ? void 0 : data.carouselSection) {
2643
+ setCarouselIndex((prev) => (prev === 0 ? data.carouselSection.length - 1 : prev - 1));
2644
+ }
2645
+ };
2646
+ const handleCarouselNext = () => {
2647
+ if (data === null || data === void 0 ? void 0 : data.carouselSection) {
2648
+ setCarouselIndex((prev) => (prev === data.carouselSection.length - 1 ? 0 : prev + 1));
2649
+ }
2650
+ };
2651
+ if (loading) {
2652
+ return (React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth, display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff', fontSize: '16px' }) }, "Loading..."));
2653
+ }
2654
+ if (error) {
2655
+ return (React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', color: '#fff', padding: '20px', textAlign: 'center' }) },
2656
+ React.createElement("div", { style: { fontSize: '18px', marginBottom: '10px' } }, "\u26A0\uFE0F Error"),
2657
+ React.createElement("div", { style: { fontSize: '14px', opacity: 0.8 } }, error)));
2658
+ }
2659
+ if (!data) {
2660
+ return (React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth, display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#fff', fontSize: '16px' }) }, "No data available"));
2661
+ }
2662
+ return (React.createElement("div", { className: className, style: Object.assign(Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth }), containerStyle) },
2663
+ data.heroSection && (React.createElement("div", { style: baseStyles.heroSection },
2664
+ data.heroSection.text && (React.createElement("div", { style: mergeStyles(baseStyles.heroTopText, 'heroTopText') }, data.heroSection.text)),
2665
+ React.createElement("div", { style: baseStyles.heroImageContainer },
2666
+ data.heroSection.url ? (React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' }, onClick: handleHeroVideoClick },
2667
+ React.createElement("video", { ref: heroVideoRef, src: data.heroSection.url, style: baseStyles.heroVideo, autoPlay: true, muted: true, loop: true, playsInline: true, controls: false }),
2668
+ isHeroVideoPaused && (React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon, alt: 'play' })))) : ((_e = data.heroSection.imgUrls) === null || _e === void 0 ? void 0 : _e[0]) ? (React.createElement("img", { src: data.heroSection.imgUrls[0], alt: 'Hero', style: baseStyles.heroImage })) : null,
2669
+ React.createElement("div", { style: baseStyles.heroOverlay }, renderCTA('heroButton', (_g = (_f = data.heroSection.bindProducts) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.bindCta, (_h = data.heroSection.bindProducts) === null || _h === void 0 ? void 0 : _h[0], baseStyles.heroButton))))),
2670
+ data.carouselSection && data.carouselSection.length > 0 && (React.createElement("div", { style: mergeStyles(baseStyles.carouselSection, 'carouselSection') },
2671
+ React.createElement("div", { style: baseStyles.carouselImageContainer },
2672
+ React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.carouselContainer), { transform: `translateX(-${carouselIndex * 100}%)` }) }, data.carouselSection.map((item, index) => {
2673
+ var _a;
2674
+ return (React.createElement("div", { key: item.itemId, style: baseStyles.carouselSlide }, item.url ? (React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' }, onClick: () => handleCarouselVideoClick(index) },
2675
+ React.createElement("video", { ref: (el) => {
2676
+ carouselVideoRefs.current[index] = el;
2677
+ }, src: item.url, style: baseStyles.carouselVideo, muted: true, loop: true, playsInline: true, controls: false }),
2678
+ carouselVideoPausedStates[index] && (React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon, alt: 'play' })))) : ((_a = item.imgUrls) === null || _a === void 0 ? void 0 : _a[0]) ? (React.createElement("img", { src: item.imgUrls[0], alt: item.text || 'Carousel', style: baseStyles.carouselImage })) : null));
2679
+ })),
2680
+ React.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { left: '10px' }), onClick: handleCarouselPrev }, "\u2039"),
2681
+ React.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { right: '10px' }), onClick: handleCarouselNext }, "\u203A")),
2682
+ React.createElement("div", { style: mergeStyles(baseStyles.carouselInfoSection, 'carouselSection') },
2683
+ ((_j = data.carouselSection[carouselIndex]) === null || _j === void 0 ? void 0 : _j.text) && (React.createElement("div", { style: mergeStyles(baseStyles.carouselText, 'carouselSection') }, (_k = data.carouselSection[carouselIndex]) === null || _k === void 0 ? void 0 : _k.text)),
2684
+ renderCTA('carouselButton', (_o = (_m = (_l = data.carouselSection[carouselIndex]) === null || _l === void 0 ? void 0 : _l.bindProducts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.bindCta, (_q = (_p = data.carouselSection[carouselIndex]) === null || _p === void 0 ? void 0 : _p.bindProducts) === null || _q === void 0 ? void 0 : _q[0], baseStyles.carouselButton)))),
2685
+ data.highlightRevealSection && (React.createElement("div", { style: mergeStyles(baseStyles.highlightSection, 'highlightSection') },
2686
+ React.createElement("div", { style: baseStyles.highlightImageContainer },
2687
+ React.createElement("img", { src: data.highlightRevealSection.landingImageUrl || data.highlightRevealSection.cover, alt: data.highlightRevealSection.title, style: baseStyles.highlightImage })),
2688
+ React.createElement("div", { style: mergeStyles(baseStyles.highlightInfoSection, 'highlightSection') },
2689
+ React.createElement("div", { style: mergeStyles(baseStyles.highlightTitle, 'highlightSection') }, data.highlightRevealSection.title),
2690
+ renderCTA('highlightButton', data.highlightRevealSection.bindCta, data.highlightRevealSection, baseStyles.highlightButton)))),
2691
+ data.productGridSection && data.productGridSection.length > 0 && (React.createElement("div", { style: mergeStyles(baseStyles.productGrid, 'productGrid') }, (() => {
2692
+ // 创建一个6格的网格 (3行 x 2列),根据position放置产品
2693
+ const gridItems = [null, null, null, null, null, null];
2694
+ // 创建产品索引映射表:gridIndex -> 产品在数据数组中的索引(从1开始)
2695
+ const productIndexMap = {};
2696
+ data.productGridSection.forEach((product, idx) => {
2697
+ var _a;
2698
+ const pos = (_a = product.position) === null || _a === void 0 ? void 0 : _a.toLowerCase();
2699
+ let gridIndex = -1;
2700
+ if (pos === 'top_right') {
2701
+ gridIndex = 1; // 第一行右侧
2702
+ }
2703
+ else if (pos === 'top_left') {
2704
+ gridIndex = 0; // 第一行左侧
2705
+ }
2706
+ else if (pos === 'center_left') {
2707
+ gridIndex = 2; // 第二行左侧
2708
+ }
2709
+ else if (pos === 'center_right') {
2710
+ gridIndex = 3; // 第二行右侧
2711
+ }
2712
+ else if (pos === 'bottom_left') {
2713
+ gridIndex = 4; // 第三行左侧
2714
+ }
2715
+ else if (pos === 'bottom_right') {
2716
+ gridIndex = 5; // 第三行右侧
2717
+ }
2718
+ if (gridIndex >= 0) {
2719
+ gridItems[gridIndex] = product;
2720
+ // 映射:网格位置 -> 产品序号(基于数据数组的顺序,从1开始)
2721
+ productIndexMap[gridIndex] = idx + 1;
2722
+ }
2723
+ });
2724
+ return gridItems.map((product, gridIndex) => {
2725
+ // 使用产品在数据数组中的实际索引来确定 buttonKey
2726
+ const productDataIndex = productIndexMap[gridIndex];
2727
+ const buttonKey = `productButton${productDataIndex || gridIndex + 1}`;
2728
+ return (React.createElement("div", { key: (product === null || product === void 0 ? void 0 : product.itemId) || `empty-${gridIndex}`, style: baseStyles.productItem }, product ? (React.createElement(React.Fragment, null,
2729
+ React.createElement("div", { style: baseStyles.productImageContainer },
2730
+ React.createElement("img", { src: product.landingImageUrl || product.cover,
2731
+ // alt={product.title}
2732
+ style: baseStyles.productImage })),
2733
+ product.bindCta && (React.createElement("div", { style: baseStyles.productCtaContainer }, renderCTA(buttonKey, product.bindCta, product, baseStyles.productButton))))) : (
2734
+ // 空格子
2735
+ React.createElement("div", { style: { width: '100%', paddingBottom: '100%' } }))));
2736
+ });
2737
+ })())),
2738
+ data.footerSection && (React.createElement("div", { style: mergeStyles(baseStyles.footerSection, 'footerSection') },
2739
+ React.createElement("div", { style: mergeStyles(baseStyles.footerInfoSection, 'footerSection') }, renderCTA('footerButton', data.footerSection.bindCta, data.footerSection, baseStyles.footerButton)),
2740
+ React.createElement("div", { style: baseStyles.footerImageContainer },
2741
+ React.createElement("img", { src: data.footerSection.landingImageUrl || data.footerSection.cover, alt: data.footerSection.title, style: baseStyles.footerImage }))))));
2742
+ };
2743
+
1888
2744
  var index$3 = /*#__PURE__*/Object.freeze({
1889
2745
  __proto__: null,
1890
- EditorCore: EditorCore
2746
+ EditorCore: EditorCore,
2747
+ StructurePage: StructurePage
1891
2748
  });
1892
2749
 
1893
2750
  var interactionRender$h = [
@@ -2112,14 +2969,14 @@ var settingRender$f = [
2112
2969
  * @Author: binruan@chatlabs.com
2113
2970
  * @Date: 2024-03-12 10:59:06
2114
2971
  * @LastEditors: binruan@chatlabs.com
2115
- * @LastEditTime: 2024-11-28 11:17:16
2972
+ * @LastEditTime: 2025-05-09 15:30:59
2116
2973
  * @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
2117
2974
  *
2118
2975
  */
2119
2976
  function useEventReport() {
2120
2977
  const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
2121
2978
  const jumpToWeb = useCallback((e, data, product, cta, position, traceInfo) => {
2122
- 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;
2979
+ 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;
2123
2980
  const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
2124
2981
  if (i !== -1) {
2125
2982
  return;
@@ -2152,11 +3009,11 @@ function useEventReport() {
2152
3009
  contentFormat = 'image';
2153
3010
  }
2154
3011
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
2155
- 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 }))
3012
+ 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 }))
2156
3013
  });
2157
3014
  }, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
2158
3015
  const productView = useCallback((data, product, cta, viewTime, position) => {
2159
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
3016
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
2160
3017
  let fromKName = '';
2161
3018
  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))) {
2162
3019
  fromKName = 'pdpPage';
@@ -2175,8 +3032,9 @@ function useEventReport() {
2175
3032
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
2176
3033
  position: position + '',
2177
3034
  contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
3035
+ 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 : '',
2178
3036
  ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
2179
- 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 : '',
3037
+ 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 : '',
2180
3038
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
2181
3039
  eventSubject: 'productView',
2182
3040
  eventDescription: 'User browsed the product'
@@ -3835,9 +4693,8 @@ function updateSlides() {
3835
4693
  allSlidesSize += slideSizeValue + (spaceBetween || 0);
3836
4694
  });
3837
4695
  allSlidesSize -= spaceBetween;
3838
- const offsetSize = (params.slidesOffsetBefore || 0) + (params.slidesOffsetAfter || 0);
3839
- if (allSlidesSize + offsetSize < swiperSize) {
3840
- const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
4696
+ if (allSlidesSize < swiperSize) {
4697
+ const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
3841
4698
  snapGrid.forEach((snap, snapIndex) => {
3842
4699
  snapGrid[snapIndex] = snap - allSlidesOffset;
3843
4700
  });
@@ -3941,13 +4798,6 @@ function updateSlidesOffset() {
3941
4798
  }
3942
4799
  }
3943
4800
 
3944
- const toggleSlideClasses$1 = (slideEl, condition, className) => {
3945
- if (condition && !slideEl.classList.contains(className)) {
3946
- slideEl.classList.add(className);
3947
- } else if (!condition && slideEl.classList.contains(className)) {
3948
- slideEl.classList.remove(className);
3949
- }
3950
- };
3951
4801
  function updateSlidesProgress(translate) {
3952
4802
  if (translate === void 0) {
3953
4803
  translate = this && this.translate || 0;
@@ -3963,6 +4813,11 @@ function updateSlidesProgress(translate) {
3963
4813
  if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
3964
4814
  let offsetCenter = -translate;
3965
4815
  if (rtl) offsetCenter = translate;
4816
+
4817
+ // Visible Slides
4818
+ slides.forEach(slideEl => {
4819
+ slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass);
4820
+ });
3966
4821
  swiper.visibleSlidesIndexes = [];
3967
4822
  swiper.visibleSlides = [];
3968
4823
  let spaceBetween = params.spaceBetween;
@@ -3986,9 +4841,11 @@ function updateSlidesProgress(translate) {
3986
4841
  if (isVisible) {
3987
4842
  swiper.visibleSlides.push(slide);
3988
4843
  swiper.visibleSlidesIndexes.push(i);
4844
+ slides[i].classList.add(params.slideVisibleClass);
4845
+ }
4846
+ if (isFullyVisible) {
4847
+ slides[i].classList.add(params.slideFullyVisibleClass);
3989
4848
  }
3990
- toggleSlideClasses$1(slide, isVisible, params.slideVisibleClass);
3991
- toggleSlideClasses$1(slide, isFullyVisible, params.slideFullyVisibleClass);
3992
4849
  slide.progress = rtl ? -slideProgress : slideProgress;
3993
4850
  slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
3994
4851
  }
@@ -4057,13 +4914,6 @@ function updateProgress(translate) {
4057
4914
  swiper.emit('progress', progress);
4058
4915
  }
4059
4916
 
4060
- const toggleSlideClasses = (slideEl, condition, className) => {
4061
- if (condition && !slideEl.classList.contains(className)) {
4062
- slideEl.classList.add(className);
4063
- } else if (!condition && slideEl.classList.contains(className)) {
4064
- slideEl.classList.remove(className);
4065
- }
4066
- };
4067
4917
  function updateSlidesClasses() {
4068
4918
  const swiper = this;
4069
4919
  const {
@@ -4077,6 +4927,9 @@ function updateSlidesClasses() {
4077
4927
  const getFilteredSlide = selector => {
4078
4928
  return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
4079
4929
  };
4930
+ slides.forEach(slideEl => {
4931
+ slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
4932
+ });
4080
4933
  let activeSlide;
4081
4934
  let prevSlide;
4082
4935
  let nextSlide;
@@ -4099,25 +4952,35 @@ function updateSlidesClasses() {
4099
4952
  }
4100
4953
  }
4101
4954
  if (activeSlide) {
4102
- if (!gridEnabled) {
4955
+ // Active classes
4956
+ activeSlide.classList.add(params.slideActiveClass);
4957
+ if (gridEnabled) {
4958
+ if (nextSlide) {
4959
+ nextSlide.classList.add(params.slideNextClass);
4960
+ }
4961
+ if (prevSlide) {
4962
+ prevSlide.classList.add(params.slidePrevClass);
4963
+ }
4964
+ } else {
4103
4965
  // Next Slide
4104
4966
  nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
4105
4967
  if (params.loop && !nextSlide) {
4106
4968
  nextSlide = slides[0];
4107
4969
  }
4970
+ if (nextSlide) {
4971
+ nextSlide.classList.add(params.slideNextClass);
4972
+ }
4108
4973
 
4109
4974
  // Prev Slide
4110
4975
  prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
4111
4976
  if (params.loop && !prevSlide === 0) {
4112
4977
  prevSlide = slides[slides.length - 1];
4113
4978
  }
4979
+ if (prevSlide) {
4980
+ prevSlide.classList.add(params.slidePrevClass);
4981
+ }
4114
4982
  }
4115
4983
  }
4116
- slides.forEach(slideEl => {
4117
- toggleSlideClasses(slideEl, slideEl === activeSlide, params.slideActiveClass);
4118
- toggleSlideClasses(slideEl, slideEl === nextSlide, params.slideNextClass);
4119
- toggleSlideClasses(slideEl, slideEl === prevSlide, params.slidePrevClass);
4120
- });
4121
4984
  swiper.emitSlidesClasses();
4122
4985
  }
4123
4986
 
@@ -4495,7 +5358,6 @@ function translateTo(translate, speed, runCallbacks, translateBounds, internal)
4495
5358
  swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
4496
5359
  swiper.onTranslateToWrapperTransitionEnd = null;
4497
5360
  delete swiper.onTranslateToWrapperTransitionEnd;
4498
- swiper.animating = false;
4499
5361
  if (runCallbacks) {
4500
5362
  swiper.emit('transitionEnd');
4501
5363
  }
@@ -4603,6 +5465,9 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
4603
5465
  if (index === void 0) {
4604
5466
  index = 0;
4605
5467
  }
5468
+ if (speed === void 0) {
5469
+ speed = this.params.speed;
5470
+ }
4606
5471
  if (runCallbacks === void 0) {
4607
5472
  runCallbacks = true;
4608
5473
  }
@@ -4622,12 +5487,9 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
4622
5487
  wrapperEl,
4623
5488
  enabled
4624
5489
  } = swiper;
4625
- if (!enabled && !internal && !initial || swiper.destroyed || swiper.animating && params.preventInteractionOnTransition) {
5490
+ if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial || swiper.destroyed) {
4626
5491
  return false;
4627
5492
  }
4628
- if (typeof speed === 'undefined') {
4629
- speed = swiper.params.speed;
4630
- }
4631
5493
  const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
4632
5494
  let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
4633
5495
  if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
@@ -4754,6 +5616,9 @@ function slideToLoop(index, speed, runCallbacks, internal) {
4754
5616
  if (index === void 0) {
4755
5617
  index = 0;
4756
5618
  }
5619
+ if (speed === void 0) {
5620
+ speed = this.params.speed;
5621
+ }
4757
5622
  if (runCallbacks === void 0) {
4758
5623
  runCallbacks = true;
4759
5624
  }
@@ -4763,9 +5628,6 @@ function slideToLoop(index, speed, runCallbacks, internal) {
4763
5628
  }
4764
5629
  const swiper = this;
4765
5630
  if (swiper.destroyed) return;
4766
- if (typeof speed === 'undefined') {
4767
- speed = swiper.params.speed;
4768
- }
4769
5631
  const gridEnabled = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
4770
5632
  let newIndex = index;
4771
5633
  if (swiper.params.loop) {
@@ -4797,9 +5659,6 @@ function slideToLoop(index, speed, runCallbacks, internal) {
4797
5659
  if (centeredSlides) {
4798
5660
  needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
4799
5661
  }
4800
- if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
4801
- needLoopFix = false;
4802
- }
4803
5662
  if (needLoopFix) {
4804
5663
  const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
4805
5664
  swiper.loopFix({
@@ -4825,6 +5684,9 @@ function slideToLoop(index, speed, runCallbacks, internal) {
4825
5684
 
4826
5685
  /* eslint no-unused-vars: "off" */
4827
5686
  function slideNext(speed, runCallbacks, internal) {
5687
+ if (speed === void 0) {
5688
+ speed = this.params.speed;
5689
+ }
4828
5690
  if (runCallbacks === void 0) {
4829
5691
  runCallbacks = true;
4830
5692
  }
@@ -4835,9 +5697,6 @@ function slideNext(speed, runCallbacks, internal) {
4835
5697
  animating
4836
5698
  } = swiper;
4837
5699
  if (!enabled || swiper.destroyed) return swiper;
4838
- if (typeof speed === 'undefined') {
4839
- speed = swiper.params.speed;
4840
- }
4841
5700
  let perGroup = params.slidesPerGroup;
4842
5701
  if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
4843
5702
  perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
@@ -4866,6 +5725,9 @@ function slideNext(speed, runCallbacks, internal) {
4866
5725
 
4867
5726
  /* eslint no-unused-vars: "off" */
4868
5727
  function slidePrev(speed, runCallbacks, internal) {
5728
+ if (speed === void 0) {
5729
+ speed = this.params.speed;
5730
+ }
4869
5731
  if (runCallbacks === void 0) {
4870
5732
  runCallbacks = true;
4871
5733
  }
@@ -4879,9 +5741,6 @@ function slidePrev(speed, runCallbacks, internal) {
4879
5741
  animating
4880
5742
  } = swiper;
4881
5743
  if (!enabled || swiper.destroyed) return swiper;
4882
- if (typeof speed === 'undefined') {
4883
- speed = swiper.params.speed;
4884
- }
4885
5744
  const isVirtual = swiper.virtual && params.virtual.enabled;
4886
5745
  if (params.loop) {
4887
5746
  if (animating && !isVirtual && params.loopPreventsSliding) return false;
@@ -4934,19 +5793,22 @@ function slidePrev(speed, runCallbacks, internal) {
4934
5793
 
4935
5794
  /* eslint no-unused-vars: "off" */
4936
5795
  function slideReset(speed, runCallbacks, internal) {
5796
+ if (speed === void 0) {
5797
+ speed = this.params.speed;
5798
+ }
4937
5799
  if (runCallbacks === void 0) {
4938
5800
  runCallbacks = true;
4939
5801
  }
4940
5802
  const swiper = this;
4941
5803
  if (swiper.destroyed) return;
4942
- if (typeof speed === 'undefined') {
4943
- speed = swiper.params.speed;
4944
- }
4945
5804
  return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
4946
5805
  }
4947
5806
 
4948
5807
  /* eslint no-unused-vars: "off" */
4949
5808
  function slideToClosest(speed, runCallbacks, internal, threshold) {
5809
+ if (speed === void 0) {
5810
+ speed = this.params.speed;
5811
+ }
4950
5812
  if (runCallbacks === void 0) {
4951
5813
  runCallbacks = true;
4952
5814
  }
@@ -4955,9 +5817,6 @@ function slideToClosest(speed, runCallbacks, internal, threshold) {
4955
5817
  }
4956
5818
  const swiper = this;
4957
5819
  if (swiper.destroyed) return;
4958
- if (typeof speed === 'undefined') {
4959
- speed = swiper.params.speed;
4960
- }
4961
5820
  let index = swiper.activeIndex;
4962
5821
  const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
4963
5822
  const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
@@ -5592,7 +6451,7 @@ function onTouchMove(event) {
5592
6451
  data.startMoving = true;
5593
6452
  }
5594
6453
  }
5595
- if (data.isScrolling || e.type === 'touchmove' && data.preventTouchMoveFromPointerMove) {
6454
+ if (data.isScrolling) {
5596
6455
  data.isTouched = false;
5597
6456
  return;
5598
6457
  }
@@ -5634,10 +6493,7 @@ function onTouchMove(event) {
5634
6493
  if (swiper.animating) {
5635
6494
  const evt = new window.CustomEvent('transitionend', {
5636
6495
  bubbles: true,
5637
- cancelable: true,
5638
- detail: {
5639
- bySwiperTouchMove: true
5640
- }
6496
+ cancelable: true
5641
6497
  });
5642
6498
  swiper.wrapperEl.dispatchEvent(evt);
5643
6499
  }
@@ -6031,7 +6887,6 @@ const events = (swiper, method) => {
6031
6887
  const capture = !!params.nested;
6032
6888
  const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
6033
6889
  const swiperMethod = method;
6034
- if (!el || typeof el === 'string') return;
6035
6890
 
6036
6891
  // Touch Events
6037
6892
  document[domMethod]('touchstart', swiper.onDocumentTouchStart, {
@@ -6140,8 +6995,6 @@ function setBreakpoint() {
6140
6995
  const breakpointParams = breakpointOnlyParams || swiper.originalParams;
6141
6996
  const wasMultiRow = isGridEnabled(swiper, params);
6142
6997
  const isMultiRow = isGridEnabled(swiper, breakpointParams);
6143
- const wasGrabCursor = swiper.params.grabCursor;
6144
- const isGrabCursor = breakpointParams.grabCursor;
6145
6998
  const wasEnabled = params.enabled;
6146
6999
  if (wasMultiRow && !isMultiRow) {
6147
7000
  el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
@@ -6153,11 +7006,6 @@ function setBreakpoint() {
6153
7006
  }
6154
7007
  swiper.emitContainerClasses();
6155
7008
  }
6156
- if (wasGrabCursor && !isGrabCursor) {
6157
- swiper.unsetGrabCursor();
6158
- } else if (!wasGrabCursor && isGrabCursor) {
6159
- swiper.setGrabCursor();
6160
- }
6161
7009
 
6162
7010
  // Toggle navigation, pagination, scrollbar
6163
7011
  ['navigation', 'pagination', 'scrollbar'].forEach(prop => {
@@ -6308,7 +7156,6 @@ function removeClasses() {
6308
7156
  el,
6309
7157
  classNames
6310
7158
  } = swiper;
6311
- if (!el || typeof el === 'string') return;
6312
7159
  el.classList.remove(...classNames);
6313
7160
  swiper.emitContainerClasses();
6314
7161
  }
@@ -7073,12 +7920,8 @@ let Swiper$1 = class Swiper {
7073
7920
  // Cleanup styles
7074
7921
  if (cleanStyles) {
7075
7922
  swiper.removeClasses();
7076
- if (el && typeof el !== 'string') {
7077
- el.removeAttribute('style');
7078
- }
7079
- if (wrapperEl) {
7080
- wrapperEl.removeAttribute('style');
7081
- }
7923
+ el.removeAttribute('style');
7924
+ wrapperEl.removeAttribute('style');
7082
7925
  if (slides && slides.length) {
7083
7926
  slides.forEach(slideEl => {
7084
7927
  slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
@@ -7094,9 +7937,7 @@ let Swiper$1 = class Swiper {
7094
7937
  swiper.off(eventName);
7095
7938
  });
7096
7939
  if (deleteInstance !== false) {
7097
- if (swiper.el && typeof swiper.el !== 'string') {
7098
- swiper.el.swiper = null;
7099
- }
7940
+ swiper.el.swiper = null;
7100
7941
  deleteProps(swiper);
7101
7942
  }
7102
7943
  swiper.destroyed = true;
@@ -7490,7 +8331,7 @@ const updateOnVirtualData = swiper => {
7490
8331
  };
7491
8332
 
7492
8333
  /**
7493
- * Swiper React 11.1.4
8334
+ * Swiper React 11.0.7
7494
8335
  * Most modern mobile touch slider and framework with hardware accelerated transitions
7495
8336
  * https://swiperjs.com
7496
8337
  *
@@ -7498,7 +8339,7 @@ const updateOnVirtualData = swiper => {
7498
8339
  *
7499
8340
  * Released under the MIT License
7500
8341
  *
7501
- * Released on: May 30, 2024
8342
+ * Released on: February 27, 2024
7502
8343
  */
7503
8344
 
7504
8345
 
@@ -8425,10 +9266,8 @@ function Navigation(_ref) {
8425
9266
  }
8426
9267
  if (el) {
8427
9268
  if (typeof el === 'string') res = [...document.querySelectorAll(el)];
8428
- if (swiper.params.uniqueNavElements && typeof el === 'string' && res && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
9269
+ if (swiper.params.uniqueNavElements && typeof el === 'string' && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
8429
9270
  res = swiper.el.querySelector(el);
8430
- } else if (res && res.length === 1) {
8431
- res = res[0];
8432
9271
  }
8433
9272
  }
8434
9273
  if (el && !res) return el;
@@ -8550,14 +9389,7 @@ function Navigation(_ref) {
8550
9389
  nextEl = makeElementsArray(nextEl);
8551
9390
  prevEl = makeElementsArray(prevEl);
8552
9391
  const targetEl = e.target;
8553
- let targetIsButton = prevEl.includes(targetEl) || nextEl.includes(targetEl);
8554
- if (swiper.isElement && !targetIsButton) {
8555
- const path = e.path || e.composedPath && e.composedPath();
8556
- if (path) {
8557
- targetIsButton = path.find(pathEl => nextEl.includes(pathEl) || prevEl.includes(pathEl));
8558
- }
8559
- }
8560
- if (swiper.params.navigation.hideOnClick && !targetIsButton) {
9392
+ if (swiper.params.navigation.hideOnClick && !prevEl.includes(targetEl) && !nextEl.includes(targetEl)) {
8561
9393
  if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
8562
9394
  let isHidden;
8563
9395
  if (nextEl.length) {
@@ -9213,7 +10045,7 @@ function Scrollbar(_ref) {
9213
10045
  dragEl
9214
10046
  } = scrollbar;
9215
10047
  if (!isTouched) return;
9216
- if (e.preventDefault && e.cancelable) e.preventDefault();else e.returnValue = false;
10048
+ if (e.preventDefault) e.preventDefault();else e.returnValue = false;
9217
10049
  setDragPosition(e);
9218
10050
  wrapperEl.style.transitionDuration = '0ms';
9219
10051
  el.style.transitionDuration = '0ms';
@@ -9424,9 +10256,6 @@ function A11y(_ref) {
9424
10256
  clicked: false
9425
10257
  };
9426
10258
  let liveRegion = null;
9427
- let preventFocusHandler;
9428
- let focusTargetSlideEl;
9429
- let visibilityChangedTimestamp = new Date().getTime();
9430
10259
  function notify(message) {
9431
10260
  const notification = liveRegion;
9432
10261
  if (notification.length === 0) return;
@@ -9507,28 +10336,24 @@ function A11y(_ref) {
9507
10336
  if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
9508
10337
  if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
9509
10338
  }
9510
- if (swiper.navigation && swiper.navigation.prevEl && swiper.navigation.nextEl) {
9511
- const prevEls = makeElementsArray(swiper.navigation.prevEl);
9512
- const nextEls = makeElementsArray(swiper.navigation.nextEl);
9513
- if (nextEls.includes(targetEl)) {
9514
- if (!(swiper.isEnd && !swiper.params.loop)) {
9515
- swiper.slideNext();
9516
- }
9517
- if (swiper.isEnd) {
9518
- notify(params.lastSlideMessage);
9519
- } else {
9520
- notify(params.nextSlideMessage);
9521
- }
10339
+ if (swiper.navigation && swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl) {
10340
+ if (!(swiper.isEnd && !swiper.params.loop)) {
10341
+ swiper.slideNext();
9522
10342
  }
9523
- if (prevEls.includes(targetEl)) {
9524
- if (!(swiper.isBeginning && !swiper.params.loop)) {
9525
- swiper.slidePrev();
9526
- }
9527
- if (swiper.isBeginning) {
9528
- notify(params.firstSlideMessage);
9529
- } else {
9530
- notify(params.prevSlideMessage);
9531
- }
10343
+ if (swiper.isEnd) {
10344
+ notify(params.lastSlideMessage);
10345
+ } else {
10346
+ notify(params.nextSlideMessage);
10347
+ }
10348
+ }
10349
+ if (swiper.navigation && swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl) {
10350
+ if (!(swiper.isBeginning && !swiper.params.loop)) {
10351
+ swiper.slidePrev();
10352
+ }
10353
+ if (swiper.isBeginning) {
10354
+ notify(params.firstSlideMessage);
10355
+ } else {
10356
+ notify(params.prevSlideMessage);
9532
10357
  }
9533
10358
  }
9534
10359
  if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
@@ -9593,14 +10418,10 @@ function A11y(_ref) {
9593
10418
  addElLabel(el, message);
9594
10419
  addElControls(el, wrapperId);
9595
10420
  };
9596
- const handlePointerDown = e => {
9597
- if (focusTargetSlideEl && focusTargetSlideEl !== e.target && !focusTargetSlideEl.contains(e.target)) {
9598
- preventFocusHandler = true;
9599
- }
10421
+ const handlePointerDown = () => {
9600
10422
  swiper.a11y.clicked = true;
9601
10423
  };
9602
10424
  const handlePointerUp = () => {
9603
- preventFocusHandler = false;
9604
10425
  requestAnimationFrame(() => {
9605
10426
  requestAnimationFrame(() => {
9606
10427
  if (!swiper.destroyed) {
@@ -9609,15 +10430,10 @@ function A11y(_ref) {
9609
10430
  });
9610
10431
  });
9611
10432
  };
9612
- const onVisibilityChange = e => {
9613
- visibilityChangedTimestamp = new Date().getTime();
9614
- };
9615
10433
  const handleFocus = e => {
9616
10434
  if (swiper.a11y.clicked) return;
9617
- if (new Date().getTime() - visibilityChangedTimestamp < 100) return;
9618
10435
  const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
9619
10436
  if (!slideEl || !swiper.slides.includes(slideEl)) return;
9620
- focusTargetSlideEl = slideEl;
9621
10437
  const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;
9622
10438
  const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
9623
10439
  if (isActive || isVisible) return;
@@ -9627,15 +10443,7 @@ function A11y(_ref) {
9627
10443
  } else {
9628
10444
  swiper.el.scrollTop = 0;
9629
10445
  }
9630
- requestAnimationFrame(() => {
9631
- if (preventFocusHandler) return;
9632
- if (swiper.params.loop) {
9633
- swiper.slideToLoop(parseInt(slideEl.getAttribute('data-swiper-slide-index')), 0);
9634
- } else {
9635
- swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
9636
- }
9637
- preventFocusHandler = false;
9638
- });
10446
+ swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
9639
10447
  };
9640
10448
  const initSlides = () => {
9641
10449
  const params = swiper.params.a11y;
@@ -9700,9 +10508,6 @@ function A11y(_ref) {
9700
10508
  }
9701
10509
 
9702
10510
  // Tab focus
9703
- const document = getDocument();
9704
- document.addEventListener('visibilitychange', onVisibilityChange);
9705
- swiper.el.addEventListener('focus', handleFocus, true);
9706
10511
  swiper.el.addEventListener('focus', handleFocus, true);
9707
10512
  swiper.el.addEventListener('pointerdown', handlePointerDown, true);
9708
10513
  swiper.el.addEventListener('pointerup', handlePointerUp, true);
@@ -9729,14 +10534,11 @@ function A11y(_ref) {
9729
10534
  el.removeEventListener('keydown', onEnterOrSpaceKey);
9730
10535
  });
9731
10536
  }
9732
- const document = getDocument();
9733
- document.removeEventListener('visibilitychange', onVisibilityChange);
10537
+
9734
10538
  // Tab focus
9735
- if (swiper.el && typeof swiper.el !== 'string') {
9736
- swiper.el.removeEventListener('focus', handleFocus, true);
9737
- swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
9738
- swiper.el.removeEventListener('pointerup', handlePointerUp, true);
9739
- }
10539
+ swiper.el.removeEventListener('focus', handleFocus, true);
10540
+ swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
10541
+ swiper.el.removeEventListener('pointerup', handlePointerUp, true);
9740
10542
  }
9741
10543
  on('beforeInit', () => {
9742
10544
  liveRegion = createElement('span', swiper.params.a11y.notificationClass);
@@ -9808,7 +10610,7 @@ function Autoplay(_ref) {
9808
10610
  if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
9809
10611
  if (e.target !== swiper.wrapperEl) return;
9810
10612
  swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
9811
- if (pausedByPointerEnter || e.detail && e.detail.bySwiperTouchMove) {
10613
+ if (pausedByPointerEnter) {
9812
10614
  return;
9813
10615
  }
9814
10616
  resume();
@@ -9979,10 +10781,8 @@ function Autoplay(_ref) {
9979
10781
  }
9980
10782
  };
9981
10783
  const detachMouseEvents = () => {
9982
- if (swiper.el && typeof swiper.el !== 'string') {
9983
- swiper.el.removeEventListener('pointerenter', onPointerEnter);
9984
- swiper.el.removeEventListener('pointerleave', onPointerLeave);
9985
- }
10784
+ swiper.el.removeEventListener('pointerenter', onPointerEnter);
10785
+ swiper.el.removeEventListener('pointerleave', onPointerLeave);
9986
10786
  };
9987
10787
  const attachDocumentEvents = () => {
9988
10788
  const document = getDocument();
@@ -10320,49 +11120,6 @@ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }
10320
11120
  };
10321
11121
  var Scroll$1 = memo(Scroll);
10322
11122
 
10323
- const FormatImage = forwardRef((props, ref) => {
10324
- const { src, onLoad, style, className, loading, alt = 'image' } = props;
10325
- const [imgSrc, setImgSrc] = useState(src);
10326
- const imgRef = useRef(null);
10327
- const [visible, setVisible] = useState(false);
10328
- useImperativeHandle(ref, () => ({
10329
- setSrc: (v) => {
10330
- if (v)
10331
- setImgSrc(v);
10332
- }
10333
- }));
10334
- useEffect(() => {
10335
- if (src)
10336
- setImgSrc(src);
10337
- }, [src]);
10338
- useEffect(() => {
10339
- const onShow = () => {
10340
- if (src && !visible && imgRef.current) {
10341
- imgRef.current.src = '';
10342
- imgRef.current.src = src;
10343
- }
10344
- };
10345
- SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
10346
- return () => {
10347
- SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
10348
- };
10349
- }, [src, visible]);
10350
- return (React.createElement(React.Fragment, null,
10351
- !visible && !imgSrc && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
10352
- (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
10353
- React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
10354
- React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
10355
- React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
10356
- React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
10357
- setVisible(true);
10358
- onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
10359
- }, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
10360
- setVisible(true);
10361
- onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
10362
- }, alt: alt }))));
10363
- });
10364
- var FormatImage$1 = memo(FormatImage);
10365
-
10366
11123
  const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
10367
11124
  var _a;
10368
11125
  const { productView } = useEventReport();
@@ -10452,13 +11209,13 @@ function useVisibleHeight() {
10452
11209
  styleElement.id = 'onetrust-pc-sdk';
10453
11210
  styleElement.setAttribute('type', 'text/css');
10454
11211
  document.head.appendChild(styleElement);
10455
- const css = `
10456
- #onetrust-pc-sdk {
10457
- height: ${finalHeight}px !important;
10458
- }
10459
- #onetrust-pc-sdk #ot-pc-content{
10460
- bottom: ${b}px !important;
10461
- }
11212
+ const css = `
11213
+ #onetrust-pc-sdk {
11214
+ height: ${finalHeight}px !important;
11215
+ }
11216
+ #onetrust-pc-sdk #ot-pc-content{
11217
+ bottom: ${b}px !important;
11218
+ }
10462
11219
  `;
10463
11220
  styleElement.textContent = css;
10464
11221
  }
@@ -11005,10 +11762,10 @@ const CommodityDetail$1 = (_a) => {
11005
11762
  __html: setFontForText((_c = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _c !== void 0 ? _c : '税费', commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo)
11006
11763
  } }),
11007
11764
  React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
11008
- React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
11009
- bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
11010
- collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
11011
- necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
11765
+ React.createElement(ExpandableText$1, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_d = product === null || product === void 0 ? void 0 : product.info) !== null && _d !== void 0 ? _d : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
11766
+ bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
11767
+ collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
11768
+ necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
11012
11769
  18-karat gold, this necklace is embellished with hand-set diamonds.`, maxStr: 79, className: 'pb-commondity-content-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info }))));
11013
11770
  };
11014
11771
  const renderBtn = () => {
@@ -12007,7 +12764,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
12007
12764
  const productInfoText = ({ isPost }) => {
12008
12765
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
12009
12766
  React.createElement(ExpandableText$1, { isPost: isPost, onClick: () => setShowModal(true), className: 'pb-commondityDiroNew-info', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.info, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (product === null || product === void 0 ? void 0 : product.info) ||
12010
- `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
12767
+ `Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
12011
12768
  Made in Italy` })));
12012
12769
  };
12013
12770
  const getStyle = useCallback((style) => {
@@ -16220,7 +16977,7 @@ function WaterfallList(_a) {
16220
16977
  * @Author: binruan@chatlabs.com
16221
16978
  * @Date: 2024-01-10 10:58:24
16222
16979
  * @LastEditors: binruan@chatlabs.com
16223
- * @LastEditTime: 2025-02-28 10:00:31
16980
+ * @LastEditTime: 2025-05-09 15:30:41
16224
16981
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
16225
16982
  *
16226
16983
  */
@@ -16258,7 +17015,7 @@ const WaterFall = (props) => {
16258
17015
  }
16259
17016
  }, [waterFallData]);
16260
17017
  const reportTagsView = useCallback(() => {
16261
- var _a, _b, _c, _d, _e, _f;
17018
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
16262
17019
  const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
16263
17020
  if (!rec)
16264
17021
  return;
@@ -16278,9 +17035,10 @@ const WaterFall = (props) => {
16278
17035
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
16279
17036
  eventInfo: {
16280
17037
  contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
17038
+ 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 : '',
16281
17039
  position: cacheActiveIndex + '',
16282
- contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
16283
- traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
17040
+ contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
17041
+ traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
16284
17042
  hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
16285
17043
  fromKName,
16286
17044
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
@@ -18188,10 +18946,10 @@ const MultiPosts$1 = (_a) => {
18188
18946
  const traceInfo = ((_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.traceInfo) || ((_c = recData === null || recData === void 0 ? void 0 : recData.product) === null || _c === void 0 ? void 0 : _c.traceInfo) || '';
18189
18947
  const getPropsVal = useCallback((index, str) => {
18190
18948
  try {
18191
- return new Function('props', 'str', `if (str) {
18192
- return props?.button${index + 1}${str}
18193
- } else {
18194
- return props?.button${index + 1}
18949
+ return new Function('props', 'str', `if (str) {
18950
+ return props?.button${index + 1}${str}
18951
+ } else {
18952
+ return props?.button${index + 1}
18195
18953
  }`)(props, str);
18196
18954
  }
18197
18955
  catch (_a) { }
@@ -18387,21 +19145,22 @@ const LikeButton = (_a) => {
18387
19145
  const likeIcon = useIconLink(defaultLikeIconPath$2);
18388
19146
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
18389
19147
  const handleClick = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
18390
- 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;
19148
+ 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, _8, _9, _10;
18391
19149
  if (state) {
18392
19150
  // 先设置状态
18393
19151
  setState(false);
18394
- 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;
19152
+ 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;
18395
19153
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
18396
19154
  eventInfo: {
18397
19155
  eventSubject: 'favoriteContentCanceled',
18398
19156
  eventDescription: 'This content was unfavorite by the user',
18399
19157
  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 : '',
18400
- 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 : '',
18401
- 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 : []),
19158
+ 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 : '',
19159
+ 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 : '',
19160
+ 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 : []),
18402
19161
  position: position + '',
18403
- contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
18404
- traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
19162
+ contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
19163
+ traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
18405
19164
  }
18406
19165
  });
18407
19166
  // 如果接口调用失败,则回滚状态
@@ -18409,48 +19168,49 @@ const LikeButton = (_a) => {
18409
19168
  setState(true);
18410
19169
  }
18411
19170
  else {
18412
- const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
19171
+ const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18413
19172
  if (index === position) {
18414
19173
  item.isCollected = false;
18415
19174
  }
18416
19175
  return item;
18417
- })) !== null && _p !== void 0 ? _p : [];
19176
+ })) !== null && _s !== void 0 ? _s : [];
18418
19177
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18419
19178
  }
18420
19179
  }
18421
19180
  else {
18422
19181
  setState(true);
18423
- const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
19182
+ 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;
18424
19183
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
18425
19184
  eventInfo: {
18426
19185
  eventSubject: 'favoriteContent',
18427
19186
  eventDescription: 'This content was favorite by the user',
18428
- 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 : '',
18429
- 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 : '',
18430
- 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 : []),
19187
+ 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 : '',
19188
+ 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 : '',
19189
+ 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 : '',
19190
+ 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 : []),
18431
19191
  position: position + '',
18432
- contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
18433
- traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
19192
+ contentFormat: ((_5 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _5 === void 0 ? void 0 : _5.url) ? 'video' : 'image',
19193
+ traceInfo: (_6 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _6 === void 0 ? void 0 : _6.traceInfo
18434
19194
  }
18435
19195
  });
18436
19196
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18437
19197
  eventName: 'Engagement',
18438
- product: (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.bindProducts,
19198
+ product: (_7 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _7 === void 0 ? void 0 : _7.bindProducts,
18439
19199
  rec: recData,
18440
19200
  position,
18441
- content_id: (_1 = (_0 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '',
19201
+ content_id: (_9 = (_8 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _8 === void 0 ? void 0 : _8.itemId) !== null && _9 !== void 0 ? _9 : '',
18442
19202
  engagement_type: 'like'
18443
19203
  });
18444
19204
  if (!result) {
18445
19205
  setState(false);
18446
19206
  }
18447
19207
  else {
18448
- const nRtcList = (_2 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
19208
+ const nRtcList = (_10 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18449
19209
  if (index === position) {
18450
19210
  item.isCollected = true;
18451
19211
  }
18452
19212
  return item;
18453
- })) !== null && _2 !== void 0 ? _2 : [];
19213
+ })) !== null && _10 !== void 0 ? _10 : [];
18454
19214
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18455
19215
  }
18456
19216
  }
@@ -18487,7 +19247,7 @@ const mountVideoPlayerAtNode = (() => {
18487
19247
  const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef, visibleHeight }, ref) => {
18488
19248
  var _a, _b;
18489
19249
  const [isPauseVideo, setIsPauseVideo] = useState(false);
18490
- const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
19250
+ const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
18491
19251
  const videoStartTime = useRef(0);
18492
19252
  const [isLoadFinish, setIsLoadFinish] = useState(false);
18493
19253
  const { isActive } = useSwiperSlide();
@@ -18504,7 +19264,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18504
19264
  const loopPlayRef = useRef(loopPlay);
18505
19265
  const scene = rec.video.scene;
18506
19266
  const videoUrl = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) || ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url);
18507
- const videoCover = (scene === null || scene === void 0 ? void 0 : scene.mediaUrl) ? scene === null || scene === void 0 ? void 0 : scene.cover : (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
19267
+ const videoCover = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
18508
19268
  const videoPoster = videoCover || (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image);
18509
19269
  useImperativeHandle(ref, () => {
18510
19270
  return {
@@ -18553,6 +19313,23 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18553
19313
  return;
18554
19314
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
18555
19315
  }, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
19316
+ const handleEnd = () => {
19317
+ var _a, _b, _c, _d, _e, _f;
19318
+ if (!videoRef.current)
19319
+ return;
19320
+ if (isDiyH5) {
19321
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
19322
+ if (!loopPlayRef.current)
19323
+ return;
19324
+ if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
19325
+ 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;
19326
+ (_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);
19327
+ }
19328
+ }
19329
+ else {
19330
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
19331
+ }
19332
+ };
18556
19333
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
18557
19334
  const handlePlaying = useCallback(() => {
18558
19335
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
@@ -18561,7 +19338,7 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18561
19338
  setIsLoadFinish(true);
18562
19339
  }, []);
18563
19340
  const handleStartPlay = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
18564
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
19341
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
18565
19342
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
18566
19343
  return;
18567
19344
  setIsPauseVideo(false);
@@ -18572,16 +19349,11 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18572
19349
  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);
18573
19350
  const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
18574
19351
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
18575
- 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) + '' }))
19352
+ 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) + '' }))
18576
19353
  });
18577
19354
  isFirstPlayRef.current = false;
18578
19355
  }
18579
19356
  }), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
18580
- const setCurrentTimeByStartTime = useCallback(() => {
18581
- if (isDiyH5) {
18582
- videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
18583
- }
18584
- }, []);
18585
19357
  const handLoadeddata = useCallback(() => {
18586
19358
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
18587
19359
  return;
@@ -18606,13 +19378,12 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18606
19378
  const handleLoadedmetadata = useCallback(() => {
18607
19379
  if (!videoRef.current)
18608
19380
  return;
18609
- setCurrentTimeByStartTime();
18610
19381
  loadedTimeRef.current = new Date();
18611
19382
  handleStartPlay();
18612
19383
  handLoadeddata();
18613
19384
  }, [videoRef.current, handLoadeddata, handleStartPlay]);
18614
19385
  const handleClickVideo = useCallback((type) => () => {
18615
- var _a, _b, _c, _d, _e, _f;
19386
+ var _a, _b, _c, _d, _e;
18616
19387
  if (!videoRef.current)
18617
19388
  return;
18618
19389
  if (!isLoadFinish)
@@ -18633,20 +19404,17 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18633
19404
  break;
18634
19405
  default:
18635
19406
  if (isPause) {
18636
- 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)) {
18637
- videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
18638
- }
18639
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
19407
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
18640
19408
  }
18641
19409
  else {
18642
- (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
19410
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
18643
19411
  }
18644
19412
  setIsPauseVideo(!isPause);
18645
19413
  break;
18646
19414
  }
18647
19415
  }, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
18648
19416
  const handlePause = useCallback(() => {
18649
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
19417
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
18650
19418
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
18651
19419
  return;
18652
19420
  if (activeIndex !== index)
@@ -18662,14 +19430,15 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18662
19430
  eventSubject: 'playOverVideo',
18663
19431
  eventDescription: 'User finished playing the video',
18664
19432
  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 : '',
18665
- 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 : '',
19433
+ 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 : '',
19434
+ 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 : '',
18666
19435
  endTime: videoCurrentTime,
18667
19436
  videoDuration,
18668
19437
  playDuration,
18669
- 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 : []),
19438
+ 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 : []),
18670
19439
  position: index + '',
18671
19440
  contentFormat: 'video',
18672
- traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
19441
+ traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
18673
19442
  }
18674
19443
  });
18675
19444
  }
@@ -18677,27 +19446,8 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18677
19446
  const handleWaiting = useCallback(() => {
18678
19447
  setWaiting(true);
18679
19448
  }, []);
18680
- const handleTimeUpload = () => {
18681
- if (!videoRef.current || !isDiyH5)
18682
- return;
18683
- setTimeout(() => {
18684
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
18685
- 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)) {
18686
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
18687
- if (!loopPlayRef.current)
18688
- return;
18689
- if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
18690
- (_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);
18691
- }
18692
- else {
18693
- 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;
18694
- (_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);
18695
- }
18696
- }
18697
- });
18698
- };
18699
19449
  useEffect(() => {
18700
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
19450
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18701
19451
  if (!isActive)
18702
19452
  return;
18703
19453
  const videoSrc = videoUrl;
@@ -18718,7 +19468,6 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18718
19468
  hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
18719
19469
  hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
18720
19470
  var _a;
18721
- setCurrentTimeByStartTime();
18722
19471
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
18723
19472
  });
18724
19473
  }
@@ -18732,12 +19481,11 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18732
19481
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
18733
19482
  (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
18734
19483
  (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
18735
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
19484
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
18736
19485
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
18737
19486
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
18738
- (_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
18739
19487
  return () => {
18740
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
19488
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18741
19489
  const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
18742
19490
  if (!isPause)
18743
19491
  handlePause();
@@ -18749,10 +19497,9 @@ const VideoWidget$4 = forwardRef(({ rec, index, height, data, muted, activeIndex
18749
19497
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
18750
19498
  (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
18751
19499
  (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
18752
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
19500
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
18753
19501
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
18754
19502
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
18755
- (_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
18756
19503
  };
18757
19504
  }, [isActive]);
18758
19505
  useEffect(() => {
@@ -18967,19 +19714,45 @@ const Picture = (props) => {
18967
19714
  }, onLoad: onShowFirstImage }))));
18968
19715
  };
18969
19716
 
18970
- const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
19717
+ const PictureGroup$4 = forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
18971
19718
  var _a, _b;
18972
19719
  const { isActive } = useSwiperSlide();
18973
- const { sxpParameter, openHashtag } = useSxpDataSource();
19720
+ const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
18974
19721
  const [isLoad, setIsLoad] = useState(false);
18975
19722
  const [imgInfo, setImgInfo] = useState();
18976
19723
  const [swiperActiveIndex, setSwiperActiveIndex] = useState(0);
18977
- const swiperRef = useRef();
19724
+ const imgsSwiperRef = useRef();
18978
19725
  const isFirstPlayRef = useRef(true);
19726
+ const loopPlayRef = useRef(true);
18979
19727
  const initTime = new Date();
19728
+ useImperativeHandle(ref, () => {
19729
+ return {
19730
+ setLoopPlay(v) {
19731
+ loopPlayRef.current = v;
19732
+ }
19733
+ };
19734
+ });
19735
+ useEffect(() => {
19736
+ let timerId;
19737
+ if (isLoad && isActive && isDiyH5) {
19738
+ timerId = setTimeout(() => {
19739
+ var _a, _b, _c, _d;
19740
+ if (!loopPlayRef.current)
19741
+ return;
19742
+ if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
19743
+ 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;
19744
+ (_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);
19745
+ }
19746
+ }, 3000);
19747
+ }
19748
+ return () => {
19749
+ if (timerId)
19750
+ clearTimeout(timerId);
19751
+ };
19752
+ }, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
18980
19753
  useEffect(() => {
18981
19754
  if (isLoad && isActive) {
18982
- (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
19755
+ (imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
18983
19756
  if (openHashtag) {
18984
19757
  onViewImageEndEvent(rec);
18985
19758
  }
@@ -18989,7 +19762,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
18989
19762
  }
18990
19763
  }
18991
19764
  else {
18992
- (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
19765
+ (imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
18993
19766
  }
18994
19767
  }, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
18995
19768
  const showFirstImageFn = useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
@@ -19016,13 +19789,13 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
19016
19789
  };
19017
19790
  }, [isActive, imgInfo]);
19018
19791
  const handleMouseEnter = useCallback(() => {
19019
- if (swiperRef.current && swiperRef.current.swiper && isAlly) {
19020
- swiperRef.current.swiper.autoplay.stop();
19792
+ if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
19793
+ imgsSwiperRef.current.swiper.autoplay.stop();
19021
19794
  }
19022
19795
  }, []);
19023
19796
  const handleMouseLeave = useCallback(() => {
19024
- if (swiperRef.current && swiperRef.current.swiper && isAlly) {
19025
- swiperRef.current.swiper.autoplay.start();
19797
+ if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
19798
+ imgsSwiperRef.current.swiper.autoplay.start();
19026
19799
  }
19027
19800
  }, []);
19028
19801
  const handleSlideChange = useCallback((swiper) => {
@@ -19043,7 +19816,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
19043
19816
  enabled: true
19044
19817
  }
19045
19818
  }
19046
- : {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
19819
+ : {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: css(Object.assign(Object.assign({ '.swiper-pagination': {
19047
19820
  bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
19048
19821
  fontSize: '14px'
19049
19822
  } }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
@@ -19060,7 +19833,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
19060
19833
  return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
19061
19834
  React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
19062
19835
  }))));
19063
- };
19836
+ });
19064
19837
  var PictureGroup$5 = memo(PictureGroup$4);
19065
19838
 
19066
19839
  /*
@@ -19352,7 +20125,7 @@ var NavBack$1 = memo(NavBack);
19352
20125
  * @Author: binruan@chatlabs.com
19353
20126
  * @Date: 2024-03-20 10:27:31
19354
20127
  * @LastEditors: binruan@chatlabs.com
19355
- * @LastEditTime: 2025-05-09 15:51:40
20128
+ * @LastEditTime: 2025-05-12 14:26:15
19356
20129
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
19357
20130
  *
19358
20131
  */
@@ -19373,6 +20146,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19373
20146
  const [pageNum, setPageNum] = useState(2);
19374
20147
  useState(false);
19375
20148
  const videoWidgetRef = useRef(null);
20149
+ const pictureGroupRef = useRef(null);
19376
20150
  const fbcRef = useRef('');
19377
20151
  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, pixelPvStatusRef } = useSxpDataSource();
19378
20152
  const { backMainFeed, productView, jumpToWeb } = useEventReport();
@@ -19422,7 +20196,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19422
20196
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
19423
20197
  }, [data, ctaType, swiperRef]);
19424
20198
  const handleSessionCompleted = useCallback((fk) => {
19425
- 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;
20199
+ 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;
19426
20200
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19427
20201
  let fromKName = '';
19428
20202
  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))) {
@@ -19449,22 +20223,23 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19449
20223
  eventSubject: 'sessionCompleted',
19450
20224
  eventDescription: 'Session completed',
19451
20225
  contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
19452
- productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
20226
+ 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 : '',
20227
+ productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
19453
20228
  position: activeIndex + '',
19454
20229
  fromKName: fk || fromKName,
19455
20230
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
19456
- 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 : '',
19457
- 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 : ''
20231
+ 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 : '',
20232
+ 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 : ''
19458
20233
  }
19459
20234
  });
19460
- const isPostType = ((_w = item === null || item === void 0 ? void 0 : item.video) === null || _w === void 0 ? void 0 : _w.url) || ((_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.imgUrls) === null || _y === void 0 ? void 0 : _y.length);
20235
+ const isPostType = ((_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.url) || ((_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.imgUrls) === null || _1 === void 0 ? void 0 : _1.length);
19461
20236
  if (!popupDetailData) {
19462
20237
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19463
20238
  eventName: 'ExitFeed',
19464
- product: isPostType ? (_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
20239
+ product: isPostType ? (_2 = item === null || item === void 0 ? void 0 : item.video) === null || _2 === void 0 ? void 0 : _2.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
19465
20240
  rec: item,
19466
20241
  position: activeIndex,
19467
- content_id: isPostType ? (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '' : (_3 = (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
20242
+ content_id: isPostType ? (_4 = (_3 = item === null || item === void 0 ? void 0 : item.video) === null || _3 === void 0 ? void 0 : _3.itemId) !== null && _4 !== void 0 ? _4 : '' : (_6 = (_5 = item === null || item === void 0 ? void 0 : item.product) === null || _5 === void 0 ? void 0 : _5.itemId) !== null && _6 !== void 0 ? _6 : '',
19468
20243
  view_time: new Date() - viewTime.current
19469
20244
  });
19470
20245
  }
@@ -19524,8 +20299,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19524
20299
  refreshFeSession
19525
20300
  ]);
19526
20301
  const handleSessionExpire = useCallback(debounce(() => {
19527
- var _a;
20302
+ var _a, _b;
19528
20303
  (_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
20304
+ (_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
19529
20305
  refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
19530
20306
  }, 1000), [handleSessionCompleted, refreshFeSession]);
19531
20307
  useEffect(() => {
@@ -19596,18 +20372,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19596
20372
  return null;
19597
20373
  }, [globalConfig, activeIndex, visList]);
19598
20374
  const renderContent = useCallback((rec, index) => {
19599
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
20375
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
19600
20376
  if (rec === 'organic menu') {
19601
20377
  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)));
19602
20378
  }
19603
- if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
20379
+ 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)) {
19604
20380
  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, visibleHeight: visibleHeight })));
19605
20381
  }
19606
- if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
19607
- 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 }));
20382
+ if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
20383
+ 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 })));
19608
20384
  }
19609
- 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) {
19610
- return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
20385
+ 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) {
20386
+ return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
19611
20387
  var _a, _b, _c, _d, _e, _f, _g, _h;
19612
20388
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
19613
20389
  const Component = withBindDataSource(t);
@@ -19646,7 +20422,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19646
20422
  };
19647
20423
  }, [isShowMore]);
19648
20424
  const renderBottom = useCallback((rec, index) => {
19649
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
20425
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
19650
20426
  if (rec === null || rec === void 0 ? void 0 : rec.video) {
19651
20427
  let cta = null;
19652
20428
  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) {
@@ -19655,24 +20431,27 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19655
20431
  else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
19656
20432
  cta = '商品CTA';
19657
20433
  }
20434
+ 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)) {
20435
+ cta = '服务CTA';
20436
+ }
19658
20437
  else {
19659
- 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;
20438
+ 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;
19660
20439
  }
19661
20440
  const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
19662
20441
  const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
19663
20442
  index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 1 : 0) &&
19664
- ((_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));
20443
+ ((_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));
19665
20444
  return (React.createElement(React.Fragment, null,
19666
20445
  isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, isNineProduct: isNineProduct })),
19667
- ((_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' }),
19668
- 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` } },
20446
+ ((_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' }),
20447
+ 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` } },
19669
20448
  React.createElement(Nudge, { nudge: nudge }),
19670
20449
  ((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' },
19671
20450
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
19672
20451
  React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
19673
- 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 }),
20452
+ 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 }),
19674
20453
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
19675
- 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) }))),
20454
+ 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) }))),
19676
20455
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
19677
20456
  }
19678
20457
  return null;
@@ -19714,7 +20493,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19714
20493
  return null;
19715
20494
  }, [globalConfig, waterFallData, bottomHeight]);
19716
20495
  const handleViewImageStartEnd = (item) => {
19717
- var _a, _b, _c, _d, _e, _f;
20496
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
19718
20497
  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)) {
19719
20498
  const endTime = Date.now();
19720
20499
  const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
@@ -19723,10 +20502,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19723
20502
  eventSubject: 'viewImageCarouselEnd',
19724
20503
  eventDescription: 'User end view the image carousel',
19725
20504
  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 : '',
19726
- contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
20505
+ 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 : '',
20506
+ contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
19727
20507
  imageEndTime: `${endTime}`,
19728
20508
  playDuration: `${duration}`,
19729
- contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
20509
+ contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
19730
20510
  position: activeIndex + '',
19731
20511
  contentFormat: 'image',
19732
20512
  traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
@@ -19735,7 +20515,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19735
20515
  }
19736
20516
  };
19737
20517
  const handleSlideSkip = (item, position) => {
19738
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
20518
+ 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;
19739
20519
  if (isPreview || waterFallData)
19740
20520
  return;
19741
20521
  const t = new Date() - curTime.current;
@@ -19761,7 +20541,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19761
20541
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
19762
20542
  position: position + '',
19763
20543
  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 : '',
19764
- 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 : '',
20544
+ 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 : '',
20545
+ 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 : '',
19765
20546
  contentFormat
19766
20547
  }
19767
20548
  });
@@ -19771,7 +20552,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19771
20552
  }
19772
20553
  };
19773
20554
  const handleScrollEvent = (swiper) => {
19774
- 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;
20555
+ 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;
19775
20556
  const item = data[swiper.previousIndex];
19776
20557
  const activeItem = data[swiper.activeIndex];
19777
20558
  if (!item)
@@ -19804,11 +20585,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19804
20585
  eventSubject: 'scrollDown',
19805
20586
  eventDescription: 'User scroll down',
19806
20587
  contentId: (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
19807
- productId: (_w = (_v = item === null || item === void 0 ? void 0 : item.product) === null || _v === void 0 ? void 0 : _v.itemId) !== null && _w !== void 0 ? _w : '',
20588
+ sceneId: (_x = (_w = (_v = item === null || item === void 0 ? void 0 : item.video) === null || _v === void 0 ? void 0 : _v.scene) === null || _w === void 0 ? void 0 : _w.sceneId) !== null && _x !== void 0 ? _x : '',
20589
+ productId: (_z = (_y = item === null || item === void 0 ? void 0 : item.product) === null || _y === void 0 ? void 0 : _y.itemId) !== null && _z !== void 0 ? _z : '',
19808
20590
  requestId: null,
19809
- 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 : '',
20591
+ traceInfo: (_3 = (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.traceInfo) !== null && _1 !== void 0 ? _1 : (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.traceInfo) !== null && _3 !== void 0 ? _3 : '',
19810
20592
  contentFormat,
19811
- position: ((_1 = swiper.previousIndex) !== null && _1 !== void 0 ? _1 : 0) + ''
20593
+ position: ((_4 = swiper.previousIndex) !== null && _4 !== void 0 ? _4 : 0) + ''
19812
20594
  }
19813
20595
  });
19814
20596
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
@@ -19821,12 +20603,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19821
20603
  eventInfo: {
19822
20604
  eventSubject: 'scrollUp',
19823
20605
  eventDescription: 'User scroll up',
19824
- contentId: (_3 = (_2 = item === null || item === void 0 ? void 0 : item.video) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
19825
- productId: (_5 = (_4 = item.product) === null || _4 === void 0 ? void 0 : _4.itemId) !== null && _5 !== void 0 ? _5 : '',
20606
+ contentId: (_6 = (_5 = item === null || item === void 0 ? void 0 : item.video) === null || _5 === void 0 ? void 0 : _5.itemId) !== null && _6 !== void 0 ? _6 : '',
20607
+ sceneId: (_9 = (_8 = (_7 = item === null || item === void 0 ? void 0 : item.video) === null || _7 === void 0 ? void 0 : _7.scene) === null || _8 === void 0 ? void 0 : _8.sceneId) !== null && _9 !== void 0 ? _9 : '',
20608
+ productId: (_11 = (_10 = item.product) === null || _10 === void 0 ? void 0 : _10.itemId) !== null && _11 !== void 0 ? _11 : '',
19826
20609
  requestId: null,
19827
- traceInfo: (_9 = (_7 = (_6 = item === null || item === void 0 ? void 0 : item.video) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_8 = item === null || item === void 0 ? void 0 : item.product) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : '',
20610
+ traceInfo: (_15 = (_13 = (_12 = item === null || item === void 0 ? void 0 : item.video) === null || _12 === void 0 ? void 0 : _12.traceInfo) !== null && _13 !== void 0 ? _13 : (_14 = item === null || item === void 0 ? void 0 : item.product) === null || _14 === void 0 ? void 0 : _14.traceInfo) !== null && _15 !== void 0 ? _15 : '',
19828
20611
  contentFormat,
19829
- position: ((_10 = swiper.previousIndex) !== null && _10 !== void 0 ? _10 : 0) + ''
20612
+ position: ((_16 = swiper.previousIndex) !== null && _16 !== void 0 ? _16 : 0) + ''
19830
20613
  }
19831
20614
  });
19832
20615
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
@@ -19926,7 +20709,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19926
20709
  };
19927
20710
  }, [globalConfig, bffEventReport, data, activeIndex]);
19928
20711
  const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
19929
- var _a, _b, _c, _d, _e, _f, _g, _h;
20712
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
19930
20713
  const item = data[activeIndex];
19931
20714
  // 如果是图片集则上报事件
19932
20715
  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)) {
@@ -19937,9 +20720,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19937
20720
  eventSubject: 'viewImageCarouselStart',
19938
20721
  eventDescription: 'User start view the image carousel',
19939
20722
  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 : '',
19940
- contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
20723
+ 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 : '',
20724
+ contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
19941
20725
  imageStartTime: `${startTime}`,
19942
- contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
20726
+ contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
19943
20727
  position: activeIndex + '',
19944
20728
  contentFormat: 'image',
19945
20729
  traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
@@ -19949,13 +20733,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19949
20733
  if (enableCapi) {
19950
20734
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19951
20735
  eventName: 'ViewContent',
19952
- product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProducts,
20736
+ product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProducts,
19953
20737
  rec: item,
19954
20738
  position: activeIndex
19955
20739
  });
19956
20740
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19957
20741
  eventName: 'PageView',
19958
- product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProducts,
20742
+ product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProducts,
19959
20743
  rec: item,
19960
20744
  position: activeIndex
19961
20745
  });
@@ -20048,20 +20832,31 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
20048
20832
  React.createElement(Swiper, { style: {
20049
20833
  marginTop: tagHeight
20050
20834
  }, ref: swiperRef, onSlideChange: () => {
20051
- swiperRef.current.swiper.allowTouchMove = false;
20052
- setTimeout(() => {
20053
- swiperRef.current.swiper.allowTouchMove = true;
20054
- }, 500);
20835
+ var _a;
20836
+ if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
20837
+ swiperRef.current.swiper.allowTouchMove = false;
20838
+ setTimeout(() => {
20839
+ var _a;
20840
+ if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
20841
+ swiperRef.current.swiper.allowTouchMove = true;
20842
+ }
20843
+ }, 500);
20844
+ }
20055
20845
  }, onActiveIndexChange: (swiper) => {
20846
+ var _a, _b;
20056
20847
  setActiveIndex(swiper.activeIndex);
20057
20848
  if (openHashtag)
20058
20849
  return;
20059
20850
  // 处理上滑下滑事件
20060
20851
  handleScrollEvent(swiper);
20061
- if (waterFallData || isEditor || isDiyH5)
20852
+ if (waterFallData || isEditor)
20062
20853
  return;
20063
20854
  if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
20064
20855
  if (!isLoadMore) {
20856
+ if (isDiyH5) {
20857
+ (_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
20858
+ (_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
20859
+ }
20065
20860
  setIsLoadMore(true);
20066
20861
  loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
20067
20862
  var _a;
@@ -20134,7 +20929,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
20134
20929
  }, []);
20135
20930
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
20136
20931
  const handlePlaying = useCallback(() => {
20137
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
20932
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
20138
20933
  setIsPauseVideo(false);
20139
20934
  const item = data[index];
20140
20935
  if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
@@ -20147,14 +20942,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
20147
20942
  eventSubject: 'playVideo',
20148
20943
  eventDescription: 'User played the video',
20149
20944
  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 : '',
20150
- 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 : '',
20945
+ 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 : '',
20946
+ 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 : '',
20151
20947
  playType,
20152
20948
  startTime: videoCurrentTime,
20153
20949
  videoDuration,
20154
- 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 : []),
20950
+ 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 : []),
20155
20951
  position: index + '',
20156
20952
  contentFormat: 'video',
20157
- traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
20953
+ traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
20158
20954
  }
20159
20955
  });
20160
20956
  setIsFirstPlay(false);
@@ -20193,7 +20989,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
20193
20989
  }
20194
20990
  }, [isLoadFinish]);
20195
20991
  const onPause = useCallback(() => {
20196
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
20992
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
20197
20993
  const item = data[index];
20198
20994
  const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
20199
20995
  const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
@@ -20204,14 +21000,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
20204
21000
  eventSubject: 'playOverVideo',
20205
21001
  eventDescription: 'User finished playing the video',
20206
21002
  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 : '',
20207
- 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 : '',
21003
+ 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 : '',
21004
+ 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 : '',
20208
21005
  endTime: videoCurrentTime,
20209
21006
  videoDuration,
20210
21007
  playDuration,
20211
- 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 : []),
21008
+ 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 : []),
20212
21009
  position: index + '',
20213
21010
  contentFormat: 'video',
20214
- traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
21011
+ traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
20215
21012
  }
20216
21013
  });
20217
21014
  }
@@ -20937,10 +21734,16 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
20937
21734
  // className={style['clc-sxp-container']}
20938
21735
  style: { height: containerHeight, position: 'relative', pointerEvents } },
20939
21736
  React.createElement(Swiper, { ref: swiperRef, allowTouchMove: pointerEvents !== 'none', onSlideChange: () => {
20940
- swiperRef.current.swiper.allowTouchMove = false;
20941
- setTimeout(() => {
20942
- swiperRef.current.swiper.allowTouchMove = true;
20943
- }, 500);
21737
+ var _a;
21738
+ if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
21739
+ swiperRef.current.swiper.allowTouchMove = false;
21740
+ setTimeout(() => {
21741
+ var _a;
21742
+ if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
21743
+ swiperRef.current.swiper.allowTouchMove = true;
21744
+ }
21745
+ }, 500);
21746
+ }
20944
21747
  }, onActiveIndexChange: (swiper) => {
20945
21748
  setCurIndex(swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex);
20946
21749
  onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
@@ -21092,5 +21895,5 @@ var index = memo(SxpPageCore);
21092
21895
  * @FilePath: \pb-sxp-ui\src\index.ts
21093
21896
  */
21094
21897
 
21095
- export { index$2 as DiyPortalPreview, index$1 as DiyStoryPreview, EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender$1 as SxpPageRender, index$3 as core, Pagebuilder as default, _materials_ as materials, useEditorDataProvider };
21898
+ export { index$2 as DiyPortalPreview, index$1 as DiyStoryPreview, EditorDataProvider, Modal$1 as Modal, StructurePage, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender$1 as SxpPageRender, index$3 as core, Pagebuilder as default, _materials_ as materials, useEditorDataProvider };
21096
21899
  //# sourceMappingURL=index.js.map