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.cjs CHANGED
@@ -667,6 +667,7 @@ const DEFAULT_TAG = 'FOR U';
667
667
  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 }) => {
668
668
  var _a, _b, _c, _d, _e;
669
669
  const [rtcList, setRtcList] = React.useState([]);
670
+ const [firstRtcList, setFirstRtcList] = React.useState([]);
670
671
  const [tagList, setTagList] = React.useState([]);
671
672
  const [loading, setLoading] = React.useState(true);
672
673
  const [curReqInfo, setCurReqInfo] = React.useState({ rtc: '', requestId: '' });
@@ -677,6 +678,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
677
678
  const [popupDetailData, setPopupDetailData] = React.useState();
678
679
  const [waterFallData, setWaterFallData] = React.useState();
679
680
  const [openHashtag, setOpenHashtag] = React.useState(isOpenHashTag);
681
+ // 将 setPopupDetailData 挂载到 window 对象,供 StructurePage 使用
682
+ if (typeof window !== 'undefined') {
683
+ window.setPopupDetailData = setPopupDetailData;
684
+ }
680
685
  const [cacheRtcList, setCacheRtcList] = React.useState([]);
681
686
  const [cacheActiveIndex, setCacheActiveIndex] = React.useState(0);
682
687
  const [isFromHashtag, setIsFromHashtag] = React.useState(false);
@@ -698,6 +703,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
698
703
  const [chatlabsId, setChatlabsId] = React.useState();
699
704
  const finalPageData = React.useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
700
705
  const pixelPvStatusRef = React.useRef(false);
706
+ const isDiyPage = React.useMemo(() => {
707
+ var _a, _b, _c;
708
+ 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);
709
+ }, [isDiyH5, finalPageData]);
701
710
  React.useEffect(() => {
702
711
  var _a, _b;
703
712
  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);
@@ -803,7 +812,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
803
812
  };
804
813
  // bff API 请求方法
805
814
  const bffFetch = React.useCallback((path, options, isBota = true) => {
806
- var _a;
815
+ var _a, _b;
807
816
  if (!bffDataSource)
808
817
  return;
809
818
  const url = bffDataSource.url;
@@ -816,8 +825,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
816
825
  val.split('=')[0];
817
826
  val.split('=')[1];
818
827
  });
828
+ options.body = Object.assign(Object.assign({}, options.body), { productUserId: fakeUserId });
819
829
  return window
820
- .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
830
+ .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
821
831
  ? JSON.stringify({
822
832
  body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
823
833
  })
@@ -1102,8 +1112,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1102
1112
  }, [bffDataSource]);
1103
1113
  // 获取推荐视频数据
1104
1114
  const getRecommendVideos = React.useCallback((query) => __awaiter(void 0, void 0, void 0, function* () {
1105
- var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
1106
- 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' }));
1115
+ var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
1116
+ 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' }));
1107
1117
  if (channel) {
1108
1118
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(channel) });
1109
1119
  }
@@ -1116,9 +1126,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1116
1126
  if (val)
1117
1127
  query = Object.assign(Object.assign({}, query), { channel: decodeURIComponent(val) });
1118
1128
  }
1129
+ 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);
1119
1130
  if (isEditor) {
1120
1131
  let pageNum = 1;
1121
- 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] }));
1132
+ 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 }));
1122
1133
  if (!(query === null || query === void 0 ? void 0 : query.channel) || isInit.current) {
1123
1134
  return undefined;
1124
1135
  }
@@ -1126,19 +1137,24 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1126
1137
  let list = [];
1127
1138
  let result = null;
1128
1139
  const recurveRecList = (query) => __awaiter(void 0, void 0, void 0, function* () {
1129
- var _v, _w, _x, _y, _z, _0;
1140
+ var _y, _z, _0, _1, _2, _3;
1130
1141
  query.pageNum = pageNum;
1131
- result = yield (bffFetchAdmin === null || bffFetchAdmin === void 0 ? void 0 : bffFetchAdmin('recommend/direct_page', { method: 'POST', body: query }));
1142
+ result = isDiyH5
1143
+ ? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
1144
+ : yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/direct_page', { method: 'POST', body: query }));
1132
1145
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
1133
1146
  return undefined;
1134
1147
  }
1135
1148
  setLoading(false);
1136
- 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 : []);
1149
+ 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 : []);
1137
1150
  if ((rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) === 0) {
1138
1151
  setRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
1139
1152
  setCacheRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
1153
+ if (isDiyPage) {
1154
+ setFirstRtcList(getFilterRecList(Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list })));
1155
+ }
1140
1156
  }
1141
- 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));
1157
+ 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));
1142
1158
  if (isNotNullList) {
1143
1159
  pageNum = pageNum + 1;
1144
1160
  yield recurveRecList(query);
@@ -1146,42 +1162,61 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1146
1162
  });
1147
1163
  yield recurveRecList(query);
1148
1164
  if (!(query === null || query === void 0 ? void 0 : query.hashTag) && result)
1149
- 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 });
1165
+ 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 });
1150
1166
  return Object.assign(Object.assign({}, result === null || result === void 0 ? void 0 : result.data), { recList: list });
1151
1167
  }
1152
1168
  if (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) {
1153
- 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 });
1169
+ 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 }));
1154
1170
  }
1155
- const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
1156
- method: 'POST',
1157
- body: query
1158
- }));
1171
+ const result = isDiy
1172
+ ? yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v3/recommend/direct/page/view', { method: 'POST', body: query }))
1173
+ : yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/list', {
1174
+ method: 'POST',
1175
+ body: query
1176
+ }));
1159
1177
  if (!(result === null || result === void 0 ? void 0 : result.success)) {
1160
1178
  return undefined;
1161
1179
  }
1162
1180
  if (!(query === null || query === void 0 ? void 0 : query.hashTag))
1163
1181
  setCurReqInfo({ rtc: result.data.rtc, requestId: result.data.requestId });
1164
1182
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) && !isEditor) {
1165
- 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));
1183
+ 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));
1166
1184
  if (!isNotNullList) {
1167
1185
  setIsNoMoreData(true);
1168
1186
  }
1169
1187
  }
1170
1188
  let list = [];
1171
- 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 : []);
1189
+ 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 : []);
1172
1190
  return Object.assign(Object.assign({}, result.data), { recList: list });
1173
- }), [bffFetch, utmVal, maxSize, defaultSize, channelQueryList, channel, chatlabsId, bffFetchAdmin]);
1191
+ }), [
1192
+ bffFetch,
1193
+ utmVal,
1194
+ maxSize,
1195
+ defaultSize,
1196
+ channelQueryList,
1197
+ channel,
1198
+ chatlabsId,
1199
+ bffFetchAdmin,
1200
+ isDiyPage,
1201
+ finalPageData,
1202
+ isDiyH5
1203
+ ]);
1174
1204
  const loadVideos = React.useCallback((pageNum) => __awaiter(void 0, void 0, void 0, function* () {
1175
- var _1, _2, _3, _4;
1205
+ var _4, _5, _6, _7;
1176
1206
  if (rtcList.length <= 0) {
1177
1207
  return;
1178
1208
  }
1209
+ if (isDiyPage && (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) > 0) {
1210
+ setRtcList(rtcList.concat(firstRtcList));
1211
+ setCacheRtcList(cacheRtcList.concat(firstRtcList));
1212
+ return;
1213
+ }
1179
1214
  const lastItem = rtcList === null || rtcList === void 0 ? void 0 : rtcList[(rtcList === null || rtcList === void 0 ? void 0 : rtcList.length) - 1];
1180
- 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 })));
1215
+ 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 })));
1181
1216
  setRtcList(rtcList.concat(getFilterRecList(data)));
1182
1217
  setCacheRtcList(cacheRtcList.concat(getFilterRecList(data)));
1183
1218
  return data;
1184
- }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList]);
1219
+ }), [getRecommendVideos, rtcList, waterFallData, cacheRtcList, isDiyPage, firstRtcList]);
1185
1220
  const refreshFeSession = React.useCallback((enableReSid, event) => {
1186
1221
  var _a, _b, _c, _d, _e;
1187
1222
  let expire = false;
@@ -1212,8 +1247,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1212
1247
  // 用户信息都是公共的
1213
1248
  if (!userInfo) {
1214
1249
  userInfo = {
1215
- // productUserId: fakeUserId, // 后端逻辑会从请求头获取,所以不需要传
1216
- // tpChannelId: 'H5' // 后端处理
1250
+ productUserId: fakeUserId // 后端逻辑会从请求头获取,所以不需要传
1251
+ // tpChannelId: 'H5' // 后端处理
1217
1252
  };
1218
1253
  }
1219
1254
  const sessionID = storeAndLoadFeSessionId();
@@ -1247,7 +1282,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1247
1282
  layoutVariantId,
1248
1283
  globalConfig,
1249
1284
  playbookType,
1250
- bffDataSource
1285
+ bffDataSource,
1286
+ fakeUserId
1251
1287
  ]);
1252
1288
  const getEventParamsByJson = React.useCallback((_a) => {
1253
1289
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
@@ -1333,6 +1369,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1333
1369
  var _a;
1334
1370
  const prop = match.substring(2, match.length - 2);
1335
1371
  try {
1372
+ // eslint-disable-next-line no-new-func
1336
1373
  let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product === null || product === void 0 ? void 0 : product[0]);
1337
1374
  if (replaceValue) {
1338
1375
  if ((prop === null || prop === void 0 ? void 0 : prop.indexOf('currency')) !== -1 &&
@@ -1434,38 +1471,40 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1434
1471
  }
1435
1472
  }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
1436
1473
  const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1474
+ body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
1437
1475
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
1438
1476
  return res === null || res === void 0 ? void 0 : res.success;
1439
- }), [bffFetch]);
1477
+ }), [bffFetch, fakeUserId]);
1440
1478
  const bffMutateUnlike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1479
+ body = Object.assign(Object.assign({}, body), { productUserId: fakeUserId });
1441
1480
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/unlike', { method: 'POST', body }));
1442
1481
  return res === null || res === void 0 ? void 0 : res.success;
1443
- }), [bffFetch]);
1482
+ }), [bffFetch, fakeUserId]);
1444
1483
  const bffSubmitForm = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1445
1484
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/customform', { method: 'POST', body }));
1446
1485
  return res === null || res === void 0 ? void 0 : res.success;
1447
1486
  }), [bffFetch]);
1448
1487
  // 获取 Tag
1449
1488
  const bffGetTagList = React.useCallback((data) => __awaiter(void 0, void 0, void 0, function* () {
1450
- var _5, _6, _7, _8, _9, _10, _11, _12;
1451
- 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);
1489
+ var _8, _9, _10, _11, _12, _13, _14, _15;
1490
+ 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);
1452
1491
  if (!utmVal || !isShowTag)
1453
1492
  return;
1454
1493
  try {
1455
- const val = (_10 = (_9 = (_8 = splitUrlParams(utmVal)) === null || _8 === void 0 ? void 0 : _8.filter((val) => {
1494
+ const val = (_13 = (_12 = (_11 = splitUrlParams(utmVal)) === null || _11 === void 0 ? void 0 : _11.filter((val) => {
1456
1495
  var _a, _b;
1457
1496
  const key = val.split('=')[0];
1458
1497
  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);
1459
- })) === null || _9 === void 0 ? void 0 : _9.join('&')) !== null && _10 !== void 0 ? _10 : '';
1498
+ })) === null || _12 === void 0 ? void 0 : _12.join('&')) !== null && _13 !== void 0 ? _13 : '';
1460
1499
  const result = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/tag/list', { method: 'GET', query: { channel: decodeURIComponent(val) } }));
1461
- 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 : []);
1500
+ 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 : []);
1462
1501
  }
1463
1502
  catch (e) {
1464
1503
  console.log('e', e);
1465
1504
  }
1466
1505
  }), [bffFetch, utmVal]);
1467
1506
  const ctaEvent = React.useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
1468
- 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;
1507
+ 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;
1469
1508
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
1470
1509
  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);
1471
1510
  let fromKName = '';
@@ -1483,7 +1522,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1483
1522
  }
1484
1523
  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;
1485
1524
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1486
- 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 })
1525
+ 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 })
1487
1526
  });
1488
1527
  }, [bffEventReport, isFromHashtag]);
1489
1528
  const h5EnterLink = React.useCallback(() => {
@@ -1507,10 +1546,10 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1507
1546
  });
1508
1547
  }, [bffEventReport]);
1509
1548
  const getAccount = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
1510
- var _13, _14;
1549
+ var _16, _17;
1511
1550
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account', { method: 'GET' }));
1512
- setChatlabsId((_13 = res === null || res === void 0 ? void 0 : res.data) === null || _13 === void 0 ? void 0 : _13.chatLabsId);
1513
- return ((_14 = res === null || res === void 0 ? void 0 : res.data) === null || _14 === void 0 ? void 0 : _14.consentResult) === 'true';
1551
+ setChatlabsId((_16 = res === null || res === void 0 ? void 0 : res.data) === null || _16 === void 0 ? void 0 : _16.chatLabsId);
1552
+ return ((_17 = res === null || res === void 0 ? void 0 : res.data) === null || _17 === void 0 ? void 0 : _17.consentResult) === 'true';
1514
1553
  }), [bffFetch]);
1515
1554
  const accountSonsent = React.useCallback((consentResult) => __awaiter(void 0, void 0, void 0, function* () {
1516
1555
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/account/consent', {
@@ -1574,6 +1613,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1574
1613
  }
1575
1614
  setRtcList(list);
1576
1615
  setCacheRtcList(list);
1616
+ if (isDiyPage) {
1617
+ setFirstRtcList(list);
1618
+ }
1577
1619
  bffGetTagList(curData !== null && curData !== void 0 ? curData : finalPageData);
1578
1620
  if (channel) {
1579
1621
  const item = list === null || list === void 0 ? void 0 : list[0];
@@ -1593,7 +1635,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1593
1635
  });
1594
1636
  setLoading(false);
1595
1637
  });
1596
- }, [isShowConsent, channel]);
1638
+ }, [isShowConsent, channel, isDiyPage]);
1597
1639
  // cms预览
1598
1640
  React.useEffect(() => {
1599
1641
  if (!isPreview)
@@ -1609,12 +1651,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1609
1651
  }
1610
1652
  setRtcList(list);
1611
1653
  setCacheRtcList(list);
1654
+ if (isDiyPage) {
1655
+ setFirstRtcList(list);
1656
+ }
1612
1657
  }
1613
1658
  })
1614
1659
  .finally(() => {
1615
1660
  setLoading(false);
1616
1661
  });
1617
- }, [getRecommendVideos, bffGetTagList, channel]);
1662
+ }, [getRecommendVideos, bffGetTagList, channel, isDiyPage]);
1618
1663
  const defaultLoadingImage = useIconLink('/pb_static/a65d23c5893c49d7aaaa81681d3179e2.gif', appDomain);
1619
1664
  return (React.createElement(SxpDataSourceContext.Provider, { value: {
1620
1665
  rtcList,
@@ -1672,7 +1717,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1672
1717
  refreshFeSession,
1673
1718
  getAccount,
1674
1719
  accountSonsent,
1675
- isDiyH5,
1720
+ isDiyH5: isDiyPage,
1721
+ firstRtcList,
1676
1722
  pixelPvStatusRef
1677
1723
  } }, 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({
1678
1724
  rtcList,
@@ -1907,9 +1953,820 @@ const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enable
1907
1953
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
1908
1954
  });
1909
1955
 
1956
+ const FormatImage = React.forwardRef((props, ref) => {
1957
+ const { src, onLoad, style, className, loading, alt = 'image' } = props;
1958
+ const [imgSrc, setImgSrc] = React.useState(src);
1959
+ const imgRef = React.useRef(null);
1960
+ const [visible, setVisible] = React.useState(false);
1961
+ React.useImperativeHandle(ref, () => ({
1962
+ setSrc: (v) => {
1963
+ if (v)
1964
+ setImgSrc(v);
1965
+ }
1966
+ }));
1967
+ React.useEffect(() => {
1968
+ if (src)
1969
+ setImgSrc(src);
1970
+ }, [src]);
1971
+ React.useEffect(() => {
1972
+ const onShow = () => {
1973
+ if (src && !visible && imgRef.current) {
1974
+ imgRef.current.src = '';
1975
+ imgRef.current.src = src;
1976
+ }
1977
+ };
1978
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
1979
+ return () => {
1980
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
1981
+ };
1982
+ }, [src, visible]);
1983
+ return (React.createElement(React.Fragment, null,
1984
+ !visible && !imgSrc && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
1985
+ (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
1986
+ React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
1987
+ React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
1988
+ React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
1989
+ React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
1990
+ setVisible(true);
1991
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
1992
+ }, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
1993
+ setVisible(true);
1994
+ onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
1995
+ }, alt: alt }))));
1996
+ });
1997
+ var FormatImage$1 = React.memo(FormatImage);
1998
+
1999
+ // 动态导入材料库(避免循环依赖)
2000
+ const RESOLVER$3 = {};
2001
+ try {
2002
+ // 尝试动态导入材料库
2003
+ const materialsModule = require('../../materials/sxp');
2004
+ Object.values(materialsModule).forEach((v) => {
2005
+ var _a;
2006
+ if ((_a = v === null || v === void 0 ? void 0 : v.extend) === null || _a === void 0 ? void 0 : _a.type) {
2007
+ RESOLVER$3[v.extend.type] = v;
2008
+ }
2009
+ });
2010
+ }
2011
+ catch (error) {
2012
+ console.warn('Failed to load materials for StructurePage:', error);
2013
+ }
2014
+ // 基础样式定义
2015
+ const baseStyles = {
2016
+ container: {
2017
+ backgroundColor: '#000',
2018
+ overflowY: 'auto',
2019
+ overflowX: 'hidden',
2020
+ padding: 0,
2021
+ boxSizing: 'border-box'
2022
+ },
2023
+ section: {
2024
+ width: '100%',
2025
+ position: 'relative',
2026
+ boxSizing: 'border-box'
2027
+ },
2028
+ // Hero Section
2029
+ heroSection: {
2030
+ width: '100%',
2031
+ height: 'auto',
2032
+ position: 'relative',
2033
+ overflow: 'hidden',
2034
+ backgroundColor: '#000'
2035
+ },
2036
+ heroTopText: {
2037
+ width: '100%',
2038
+ padding: '20px',
2039
+ backgroundColor: '#fff',
2040
+ color: '#000',
2041
+ fontSize: '16px',
2042
+ fontWeight: 'bold',
2043
+ textAlign: 'center',
2044
+ boxSizing: 'border-box'
2045
+ },
2046
+ heroImageContainer: {
2047
+ width: '100%',
2048
+ position: 'relative',
2049
+ overflow: 'hidden'
2050
+ },
2051
+ heroImage: {
2052
+ width: '100%',
2053
+ height: 'auto',
2054
+ display: 'block',
2055
+ objectFit: 'cover'
2056
+ },
2057
+ heroVideo: {
2058
+ width: '100%',
2059
+ height: 'auto',
2060
+ display: 'block',
2061
+ objectFit: 'cover'
2062
+ },
2063
+ heroOverlay: {
2064
+ position: 'absolute',
2065
+ bottom: 0,
2066
+ left: 0,
2067
+ right: 0,
2068
+ padding: '40px 20px',
2069
+ background: 'linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%)',
2070
+ color: '#fff',
2071
+ display: 'flex',
2072
+ justifyContent: 'center',
2073
+ alignItems: 'center'
2074
+ },
2075
+ heroButton: {
2076
+ padding: '12px 30px',
2077
+ backgroundColor: '#fff',
2078
+ color: '#000',
2079
+ border: 'none',
2080
+ fontSize: '14px',
2081
+ fontWeight: 500,
2082
+ cursor: 'pointer',
2083
+ textTransform: 'uppercase'
2084
+ },
2085
+ // Carousel Section
2086
+ carouselSection: {
2087
+ width: '100%',
2088
+ position: 'relative'
2089
+ },
2090
+ carouselImageContainer: {
2091
+ width: '100%',
2092
+ height: 'auto',
2093
+ position: 'relative',
2094
+ overflow: 'hidden'
2095
+ },
2096
+ carouselContainer: {
2097
+ display: 'flex',
2098
+ transition: 'transform 0.5s ease-in-out',
2099
+ width: '100%'
2100
+ },
2101
+ carouselSlide: {
2102
+ minWidth: '100%',
2103
+ position: 'relative'
2104
+ },
2105
+ carouselImage: {
2106
+ width: '100%',
2107
+ height: 'auto',
2108
+ display: 'block',
2109
+ objectFit: 'cover'
2110
+ },
2111
+ carouselVideo: {
2112
+ width: '100%',
2113
+ height: 'auto',
2114
+ display: 'block',
2115
+ objectFit: 'cover'
2116
+ },
2117
+ carouselInfoSection: {
2118
+ width: '100%',
2119
+ padding: '20px',
2120
+ backgroundColor: '#000',
2121
+ color: '#fff',
2122
+ textAlign: 'center'
2123
+ },
2124
+ carouselText: {
2125
+ fontSize: '16px',
2126
+ fontWeight: 'normal',
2127
+ marginBottom: '15px',
2128
+ color: '#fff'
2129
+ },
2130
+ carouselButton: {
2131
+ padding: '10px 25px',
2132
+ backgroundColor: '#fff',
2133
+ color: '#000',
2134
+ border: '1px solid #fff',
2135
+ fontSize: '13px',
2136
+ fontWeight: 500,
2137
+ cursor: 'pointer',
2138
+ textTransform: 'uppercase'
2139
+ },
2140
+ arrowButton: {
2141
+ position: 'absolute',
2142
+ top: '50%',
2143
+ transform: 'translateY(-50%)',
2144
+ width: '40px',
2145
+ height: '40px',
2146
+ backgroundColor: 'rgba(255,255,255,0.8)',
2147
+ border: 'none',
2148
+ borderRadius: '50%',
2149
+ fontSize: '18px',
2150
+ cursor: 'pointer',
2151
+ zIndex: 10,
2152
+ display: 'flex',
2153
+ alignItems: 'center',
2154
+ justifyContent: 'center'
2155
+ },
2156
+ // Highlight Reveal Section
2157
+ highlightSection: {
2158
+ width: '100%',
2159
+ position: 'relative',
2160
+ backgroundColor: '#000'
2161
+ },
2162
+ highlightImageContainer: {
2163
+ width: '100%',
2164
+ aspectRatio: '1/1',
2165
+ position: 'relative',
2166
+ overflow: 'hidden'
2167
+ },
2168
+ highlightImage: {
2169
+ width: '100%',
2170
+ height: '100%',
2171
+ objectFit: 'cover',
2172
+ display: 'block'
2173
+ },
2174
+ highlightInfoSection: {
2175
+ width: '100%',
2176
+ padding: '20px',
2177
+ backgroundColor: '#000',
2178
+ color: '#fff',
2179
+ textAlign: 'center'
2180
+ },
2181
+ highlightTitle: {
2182
+ fontSize: '18px',
2183
+ fontWeight: 'bold',
2184
+ marginBottom: '10px',
2185
+ textAlign: 'center',
2186
+ color: '#fff'
2187
+ },
2188
+ highlightDesc: {
2189
+ fontSize: '14px',
2190
+ marginBottom: '15px',
2191
+ textAlign: 'center',
2192
+ lineHeight: '1.5',
2193
+ color: '#ccc'
2194
+ },
2195
+ highlightButton: {
2196
+ padding: '10px 25px',
2197
+ backgroundColor: 'transparent',
2198
+ color: '#fff',
2199
+ border: '1px solid #fff',
2200
+ fontSize: '13px',
2201
+ fontWeight: 500,
2202
+ cursor: 'pointer',
2203
+ textTransform: 'uppercase'
2204
+ },
2205
+ // Product Grid Section
2206
+ productGrid: {
2207
+ display: 'grid',
2208
+ gridTemplateColumns: '50% 50%',
2209
+ gridAutoRows: 'auto',
2210
+ gap: '0',
2211
+ width: '100%',
2212
+ backgroundColor: '#000',
2213
+ boxSizing: 'border-box',
2214
+ margin: 0,
2215
+ padding: 0,
2216
+ overflow: 'hidden'
2217
+ },
2218
+ productItem: {
2219
+ position: 'relative',
2220
+ backgroundColor: '#000',
2221
+ display: 'block',
2222
+ boxSizing: 'border-box',
2223
+ width: '100%',
2224
+ minWidth: 0,
2225
+ overflow: 'hidden'
2226
+ },
2227
+ productImageContainer: {
2228
+ width: '100%',
2229
+ paddingBottom: '100%',
2230
+ position: 'relative',
2231
+ overflow: 'hidden'
2232
+ },
2233
+ productImage: {
2234
+ position: 'absolute',
2235
+ top: 0,
2236
+ left: 0,
2237
+ width: '100%',
2238
+ height: '100%',
2239
+ objectFit: 'cover',
2240
+ display: 'block'
2241
+ },
2242
+ productCtaContainer: {
2243
+ width: '100%',
2244
+ padding: '15px',
2245
+ backgroundColor: '#000',
2246
+ textAlign: 'center',
2247
+ boxSizing: 'border-box'
2248
+ },
2249
+ productText: {
2250
+ width: '100%',
2251
+ padding: '15px',
2252
+ backgroundColor: '#000',
2253
+ color: '#fff',
2254
+ textAlign: 'center',
2255
+ fontSize: '14px',
2256
+ fontWeight: 'normal',
2257
+ boxSizing: 'border-box'
2258
+ },
2259
+ productButton: {
2260
+ padding: '8px 20px',
2261
+ backgroundColor: 'transparent',
2262
+ color: '#fff',
2263
+ border: '1px solid #fff',
2264
+ fontSize: '12px',
2265
+ fontWeight: 500,
2266
+ cursor: 'pointer',
2267
+ textTransform: 'uppercase',
2268
+ whiteSpace: 'nowrap'
2269
+ },
2270
+ // Footer Section
2271
+ footerSection: {
2272
+ width: '100%',
2273
+ position: 'relative',
2274
+ backgroundColor: '#000'
2275
+ },
2276
+ footerInfoSection: {
2277
+ width: '100%',
2278
+ padding: '20px',
2279
+ backgroundColor: '#000',
2280
+ color: '#fff',
2281
+ textAlign: 'center'
2282
+ },
2283
+ footerText: {
2284
+ fontSize: '18px',
2285
+ fontWeight: 'normal',
2286
+ marginBottom: '15px',
2287
+ lineHeight: '1.4',
2288
+ color: '#fff'
2289
+ },
2290
+ footerButton: {
2291
+ padding: '10px 25px',
2292
+ backgroundColor: 'transparent',
2293
+ color: '#fff',
2294
+ border: '1px solid #fff',
2295
+ fontSize: '13px',
2296
+ fontWeight: 500,
2297
+ cursor: 'pointer',
2298
+ textTransform: 'uppercase',
2299
+ marginBottom: '20px',
2300
+ display: 'inline-block'
2301
+ },
2302
+ footerImageContainer: {
2303
+ width: '100%',
2304
+ aspectRatio: '1/1',
2305
+ overflow: 'hidden'
2306
+ },
2307
+ footerImage: {
2308
+ width: '100%',
2309
+ height: '100%',
2310
+ objectFit: 'cover',
2311
+ display: 'block'
2312
+ }
2313
+ };
2314
+ const StructurePage = (_a) => {
2315
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
2316
+ 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"]);
2317
+ const [data, setData] = React.useState(null);
2318
+ const [loading, setLoading] = React.useState(true);
2319
+ const [error, setError] = React.useState(null);
2320
+ const [carouselIndex, setCarouselIndex] = React.useState(0);
2321
+ const heroVideoRef = React.useRef(null);
2322
+ const carouselVideoRefs = React.useRef([]);
2323
+ // 视频暂停状态管理
2324
+ const [isHeroVideoPaused, setIsHeroVideoPaused] = React.useState(false);
2325
+ const [carouselVideoPausedStates, setCarouselVideoPausedStates] = React.useState([]);
2326
+ // 从 schema 中获取 multiCTAConfig(优先使用 props 传入的)
2327
+ const { schema } = useEditor();
2328
+ const multiCTAConfig = React.useMemo(() => {
2329
+ var _a;
2330
+ return propMultiCTAConfig || ((_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.multiCTAConfig) || {};
2331
+ }, [propMultiCTAConfig, (_b = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _b === void 0 ? void 0 : _b.multiCTAConfig]);
2332
+ // 默认播放图标 URL(直接使用 CDN 地址作为后备)
2333
+ const DEFAULT_PAUSE_ICON = 'https://sxph5-uat.chatlabs.net/pb_static/06f28a2025c74c1cb49be6767316d827.png';
2334
+ // 获取视频播放图标
2335
+ const videoPlayIcon = React.useMemo(() => {
2336
+ var _a, _b;
2337
+ // 优先使用 props 传入的
2338
+ if (propVideoPlayIcon)
2339
+ return propVideoPlayIcon;
2340
+ // 然后使用 schema 配置的
2341
+ 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;
2342
+ if (configIcon) {
2343
+ // 如果是完整 URL,直接使用
2344
+ if (configIcon.startsWith('http://') || configIcon.startsWith('https://')) {
2345
+ return configIcon;
2346
+ }
2347
+ // 如果是相对路径,拼接当前域名
2348
+ if (configIcon.startsWith('/')) {
2349
+ return `${window.location.origin}${configIcon}`;
2350
+ }
2351
+ return configIcon;
2352
+ }
2353
+ // 最后使用默认图标
2354
+ return DEFAULT_PAUSE_ICON;
2355
+ }, [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]);
2356
+ // 处理 CTA 点击
2357
+ const handleCtaClick = React.useCallback((link, interaction, productData, ctaData) => {
2358
+ // 如果配置了交互设置,优先使用交互设置
2359
+ if (interaction) {
2360
+ const { linkType, popupType, popupAni } = interaction;
2361
+ if (linkType === 'popup' && popupType) {
2362
+ // 设置弹窗要显示的产品数据
2363
+ if (productData && typeof window !== 'undefined' && window.setPopupDetailData) {
2364
+ // 构造与原有系统一致的数据结构
2365
+ const popupData = {
2366
+ video: {
2367
+ bindProduct: productData,
2368
+ bindProducts: [productData],
2369
+ bindCta: ctaData
2370
+ }
2371
+ };
2372
+ window.setPopupDetailData(popupData);
2373
+ }
2374
+ // 打开弹窗 - 使用与现有系统一致的方式
2375
+ if (typeof window !== 'undefined' && window.sxpPopup) {
2376
+ // 如果有动画配置,传递动画参数;否则只传弹窗 ID
2377
+ if (popupAni && popupAni.name) {
2378
+ window.sxpPopup(popupType, popupAni);
2379
+ }
2380
+ else {
2381
+ window.sxpPopup(popupType);
2382
+ }
2383
+ }
2384
+ return;
2385
+ }
2386
+ }
2387
+ // 默认行为:打开外部链接
2388
+ if (link) {
2389
+ window.open(link, '_blank');
2390
+ }
2391
+ }, []);
2392
+ // 合并基础样式和编辑器配置的样式
2393
+ const mergeStyles = React.useCallback((baseStyle, configKey) => {
2394
+ if (!editorMode || !multiCTAConfig[configKey]) {
2395
+ return baseStyle;
2396
+ }
2397
+ const config = multiCTAConfig[configKey];
2398
+ // 定义允许的样式属性列表
2399
+ const styleKeys = [
2400
+ 'fontSize', 'color', 'textAlign', 'fontWeight',
2401
+ 'backgroundColor', 'padding', 'margin', 'borderRadius',
2402
+ 'showBorder', 'borderWidth', 'borderColor',
2403
+ 'buttonBackgroundColor', 'buttonTextColor', 'buttonWidth', 'buttonHeight'
2404
+ ];
2405
+ // 只处理样式相关的属性,忽略 interaction 等非样式属性
2406
+ const styleConfig = Object.keys(config)
2407
+ .filter(key => styleKeys.includes(key))
2408
+ .reduce((obj, key) => {
2409
+ obj[key] = config[key];
2410
+ return obj;
2411
+ }, {});
2412
+ // 如果配置中没有任何样式字段(只有 interaction),直接返回基础样式
2413
+ if (Object.keys(styleConfig).length === 0) {
2414
+ return baseStyle;
2415
+ }
2416
+ const customStyle = {};
2417
+ // 应用配置中的样式
2418
+ if (styleConfig.fontSize && typeof styleConfig.fontSize === 'number') {
2419
+ customStyle.fontSize = `${styleConfig.fontSize}px`;
2420
+ }
2421
+ if (styleConfig.color && typeof styleConfig.color === 'string') {
2422
+ customStyle.color = styleConfig.color;
2423
+ }
2424
+ if (styleConfig.textAlign && typeof styleConfig.textAlign === 'string') {
2425
+ customStyle.textAlign = styleConfig.textAlign;
2426
+ }
2427
+ if (styleConfig.fontWeight && typeof styleConfig.fontWeight === 'number') {
2428
+ customStyle.fontWeight = styleConfig.fontWeight;
2429
+ }
2430
+ if (styleConfig.backgroundColor && typeof styleConfig.backgroundColor === 'string') {
2431
+ customStyle.backgroundColor = styleConfig.backgroundColor;
2432
+ }
2433
+ if (styleConfig.padding && typeof styleConfig.padding === 'string') {
2434
+ customStyle.padding = styleConfig.padding;
2435
+ }
2436
+ if (styleConfig.margin && typeof styleConfig.margin === 'string') {
2437
+ customStyle.margin = styleConfig.margin;
2438
+ }
2439
+ if (styleConfig.borderRadius && typeof styleConfig.borderRadius === 'number') {
2440
+ customStyle.borderRadius = `${styleConfig.borderRadius}px`;
2441
+ }
2442
+ if (styleConfig.showBorder && styleConfig.borderWidth && typeof styleConfig.borderWidth === 'number') {
2443
+ customStyle.border = `${styleConfig.borderWidth}px solid ${styleConfig.borderColor || '#d9d9d9'}`;
2444
+ }
2445
+ // 按钮特殊样式
2446
+ if (styleConfig.buttonBackgroundColor && typeof styleConfig.buttonBackgroundColor === 'string') {
2447
+ customStyle.backgroundColor = styleConfig.buttonBackgroundColor;
2448
+ }
2449
+ if (styleConfig.buttonTextColor && typeof styleConfig.buttonTextColor === 'string') {
2450
+ customStyle.color = styleConfig.buttonTextColor;
2451
+ }
2452
+ if (styleConfig.buttonWidth && typeof styleConfig.buttonWidth === 'number') {
2453
+ customStyle.width = `${styleConfig.buttonWidth}px`;
2454
+ }
2455
+ if (styleConfig.buttonHeight && typeof styleConfig.buttonHeight === 'number') {
2456
+ customStyle.height = `${styleConfig.buttonHeight}px`;
2457
+ }
2458
+ return Object.assign(Object.assign({}, baseStyle), customStyle);
2459
+ }, [editorMode, multiCTAConfig]);
2460
+ // 渲染 CTA 按钮或模版组件
2461
+ const renderCTA = React.useCallback((buttonKey, ctaData, productData, fallbackStyle) => {
2462
+ var _a, _b, _c;
2463
+ if (!ctaData) {
2464
+ return null;
2465
+ }
2466
+ const config = multiCTAConfig[buttonKey];
2467
+ const templateType = config === null || config === void 0 ? void 0 : config.templateType;
2468
+ const interaction = config === null || config === void 0 ? void 0 : config.interaction;
2469
+ // 如果配置了模版类型,渲染对应的模版组件
2470
+ if (editorMode && templateType && RESOLVER$3[templateType]) {
2471
+ const TemplateComponent = RESOLVER$3[templateType];
2472
+ const templateExtend = TemplateComponent === null || TemplateComponent === void 0 ? void 0 : TemplateComponent.extend;
2473
+ if (templateExtend) {
2474
+ // 准备模版组件的 props
2475
+ 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);
2476
+ // 渲染模版组件
2477
+ return React.createElement(TemplateComponent, templateProps);
2478
+ }
2479
+ }
2480
+ // 默认渲染按钮
2481
+ 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));
2482
+ }, [multiCTAConfig, editorMode, handleCtaClick, mergeStyles, rest]);
2483
+ // 获取数据 - 只在组件挂载时执行一次
2484
+ React.useEffect(() => {
2485
+ // 重要:在 PB 编辑器模式下,propMultiCTAConfig 只是样式配置,不是数据源
2486
+ // 只有在 CMS 模式 (isCmsMode=false) 且 propMultiCTAConfig 包含实际数据时才跳过 API 调用
2487
+ // 判断是否包含实际数据:检查是否有 heroSection, carouselSection 等数据字段
2488
+ const hasActualData = propMultiCTAConfig && (propMultiCTAConfig.heroSection ||
2489
+ propMultiCTAConfig.carouselSection ||
2490
+ propMultiCTAConfig.highlightRevealSection ||
2491
+ propMultiCTAConfig.productGridSection ||
2492
+ propMultiCTAConfig.footerSection);
2493
+ if (editorMode && hasActualData && !isCmsMode) {
2494
+ setLoading(false);
2495
+ setError(null);
2496
+ // 使用传入的 multiCTAConfig 作为数据源
2497
+ setData(propMultiCTAConfig);
2498
+ return;
2499
+ }
2500
+ // 如果已经有数据了,且在编辑器模式下,不要重新请求
2501
+ if (editorMode && data && !isCmsMode) {
2502
+ return;
2503
+ }
2504
+ setLoading(true);
2505
+ setError(null);
2506
+ // 根据模式决定使用哪个接口
2507
+ let finalApiUrl = apiUrl;
2508
+ let bodyToSend = {};
2509
+ if (isCmsMode) {
2510
+ // CMS 模式:使用 /api/console/ad/multiCta/rec/detail 接口
2511
+ if (!storyId) {
2512
+ console.error('[StructurePage CMS Mode] storyId is required but not provided');
2513
+ setError('storyId is required in CMS mode');
2514
+ setLoading(false);
2515
+ return;
2516
+ }
2517
+ // 构建 CMS 接口的 URL 和请求体
2518
+ // apiUrl 应该是域名(如 http://localhost:8001),然后拼接 /api/console/ad/multiCta/rec/detail
2519
+ finalApiUrl = `${apiUrl}/api/console/ad/multiCta/rec/detail`;
2520
+ bodyToSend = { storyId };
2521
+ }
2522
+ else {
2523
+ // 普通模式:使用原有的 /api/v1/recommend/list 接口
2524
+ const defaultBody = {
2525
+ maxSize: 20,
2526
+ defaultSize: 10,
2527
+ type: 'story'
2528
+ };
2529
+ bodyToSend = requestBody ? Object.assign(Object.assign({}, defaultBody), requestBody) : defaultBody;
2530
+ }
2531
+ // 构建请求头
2532
+ const headers = {
2533
+ 'Content-Type': 'application/json'
2534
+ };
2535
+ if (isCmsMode) {
2536
+ // CMS 模式:使用自定义 headers(如果有传入)
2537
+ if (customHeaders) {
2538
+ Object.assign(headers, customHeaders);
2539
+ }
2540
+ }
2541
+ else {
2542
+ // 普通模式:从 requestBody 或 bodyToSend 中提取 BFF headers
2543
+ if (bodyToSend['x-app-id']) {
2544
+ headers['x-app-id'] = bodyToSend['x-app-id'];
2545
+ delete bodyToSend['x-app-id'];
2546
+ }
2547
+ if (bodyToSend['x-user-id']) {
2548
+ headers['x-user-id'] = bodyToSend['x-user-id'];
2549
+ delete bodyToSend['x-user-id'];
2550
+ }
2551
+ if (bodyToSend['tenant-id']) {
2552
+ headers['tenant-id'] = bodyToSend['tenant-id'];
2553
+ delete bodyToSend['tenant-id'];
2554
+ }
2555
+ }
2556
+ fetch(finalApiUrl, {
2557
+ method: 'POST',
2558
+ headers,
2559
+ body: JSON.stringify(bodyToSend),
2560
+ credentials: 'include'
2561
+ })
2562
+ .then((res) => {
2563
+ if (!res.ok) {
2564
+ throw new Error(`HTTP error! status: ${res.status}`);
2565
+ }
2566
+ return res.json();
2567
+ })
2568
+ .then((result) => {
2569
+ var _a, _b, _c, _d;
2570
+ if (result.code === '0' || result.code === '00000') {
2571
+ // 判断数据结构:CMS 模式和普通模式可能不同
2572
+ let multiCtaData = null;
2573
+ if (isCmsMode) {
2574
+ // CMS 模式:data.multiCta
2575
+ multiCtaData = (_a = result.data) === null || _a === void 0 ? void 0 : _a.multiCta;
2576
+ }
2577
+ else {
2578
+ // 普通模式:data.recList[0].multiCta
2579
+ 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;
2580
+ }
2581
+ if (multiCtaData) {
2582
+ setData(multiCtaData);
2583
+ }
2584
+ else {
2585
+ console.error('[StructurePage] No multiCta data found in response:', result);
2586
+ setError(result.message || 'No multiCta data found');
2587
+ }
2588
+ }
2589
+ else {
2590
+ setError(result.message || 'Failed to load data');
2591
+ }
2592
+ setLoading(false);
2593
+ })
2594
+ .catch((err) => {
2595
+ console.error('[StructurePage] Failed to fetch data:', {
2596
+ error: err,
2597
+ message: err.message,
2598
+ url: finalApiUrl,
2599
+ body: bodyToSend,
2600
+ isCmsMode,
2601
+ storyId
2602
+ });
2603
+ setError(err.message || 'Network error');
2604
+ setLoading(false);
2605
+ });
2606
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2607
+ }, [apiUrl, isCmsMode, storyId, customHeaders]);
2608
+ // 注意:移除了 editorMode 和 propMultiCTAConfig 依赖,因为:
2609
+ // 1. editorMode 和 propMultiCTAConfig 在编辑器中频繁变化
2610
+ // 2. propMultiCTAConfig 只是样式配置,不是数据源
2611
+ // 3. 数据获取只应该在组件挂载时执行一次(除非 apiUrl/storyId 等关键参数变化)
2612
+ // Hero Section 视频自动播放
2613
+ React.useEffect(() => {
2614
+ var _a;
2615
+ if (heroVideoRef.current && ((_a = data === null || data === void 0 ? void 0 : data.heroSection) === null || _a === void 0 ? void 0 : _a.url)) {
2616
+ heroVideoRef.current.play().catch((err) => console.log('Video autoplay failed:', err));
2617
+ setIsHeroVideoPaused(false);
2618
+ }
2619
+ }, [data === null || data === void 0 ? void 0 : data.heroSection]);
2620
+ // 初始化 carousel 视频暂停状态
2621
+ React.useEffect(() => {
2622
+ if (data === null || data === void 0 ? void 0 : data.carouselSection) {
2623
+ // carousel 视频默认不自动播放,所以初始状态应该是暂停(true)
2624
+ setCarouselVideoPausedStates(new Array(data.carouselSection.length).fill(true));
2625
+ }
2626
+ }, [data === null || data === void 0 ? void 0 : data.carouselSection]);
2627
+ // Hero 视频点击处理
2628
+ const handleHeroVideoClick = React.useCallback(() => {
2629
+ if (heroVideoRef.current) {
2630
+ if (heroVideoRef.current.paused) {
2631
+ heroVideoRef.current.play();
2632
+ setIsHeroVideoPaused(false);
2633
+ }
2634
+ else {
2635
+ heroVideoRef.current.pause();
2636
+ setIsHeroVideoPaused(true);
2637
+ }
2638
+ }
2639
+ }, []);
2640
+ // Carousel 视频点击处理
2641
+ const handleCarouselVideoClick = React.useCallback((index) => {
2642
+ const videoRef = carouselVideoRefs.current[index];
2643
+ if (videoRef) {
2644
+ if (videoRef.paused) {
2645
+ videoRef.play();
2646
+ setCarouselVideoPausedStates(prev => {
2647
+ const newStates = [...prev];
2648
+ newStates[index] = false;
2649
+ return newStates;
2650
+ });
2651
+ }
2652
+ else {
2653
+ videoRef.pause();
2654
+ setCarouselVideoPausedStates(prev => {
2655
+ const newStates = [...prev];
2656
+ newStates[index] = true;
2657
+ return newStates;
2658
+ });
2659
+ }
2660
+ }
2661
+ }, []);
2662
+ // Carousel 导航
2663
+ const handleCarouselPrev = () => {
2664
+ if (data === null || data === void 0 ? void 0 : data.carouselSection) {
2665
+ setCarouselIndex((prev) => (prev === 0 ? data.carouselSection.length - 1 : prev - 1));
2666
+ }
2667
+ };
2668
+ const handleCarouselNext = () => {
2669
+ if (data === null || data === void 0 ? void 0 : data.carouselSection) {
2670
+ setCarouselIndex((prev) => (prev === data.carouselSection.length - 1 ? 0 : prev + 1));
2671
+ }
2672
+ };
2673
+ if (loading) {
2674
+ 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..."));
2675
+ }
2676
+ if (error) {
2677
+ 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' }) },
2678
+ React.createElement("div", { style: { fontSize: '18px', marginBottom: '10px' } }, "\u26A0\uFE0F Error"),
2679
+ React.createElement("div", { style: { fontSize: '14px', opacity: 0.8 } }, error)));
2680
+ }
2681
+ if (!data) {
2682
+ 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"));
2683
+ }
2684
+ return (React.createElement("div", { className: className, style: Object.assign(Object.assign(Object.assign({}, baseStyles.container), { height: containerHeight, width: containerWidth }), containerStyle) },
2685
+ data.heroSection && (React.createElement("div", { style: baseStyles.heroSection },
2686
+ data.heroSection.text && (React.createElement("div", { style: mergeStyles(baseStyles.heroTopText, 'heroTopText') }, data.heroSection.text)),
2687
+ React.createElement("div", { style: baseStyles.heroImageContainer },
2688
+ data.heroSection.url ? (React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' }, onClick: handleHeroVideoClick },
2689
+ React.createElement("video", { ref: heroVideoRef, src: data.heroSection.url, style: baseStyles.heroVideo, autoPlay: true, muted: true, loop: true, playsInline: true, controls: false }),
2690
+ 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,
2691
+ 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))))),
2692
+ data.carouselSection && data.carouselSection.length > 0 && (React.createElement("div", { style: mergeStyles(baseStyles.carouselSection, 'carouselSection') },
2693
+ React.createElement("div", { style: baseStyles.carouselImageContainer },
2694
+ React.createElement("div", { style: Object.assign(Object.assign({}, baseStyles.carouselContainer), { transform: `translateX(-${carouselIndex * 100}%)` }) }, data.carouselSection.map((item, index) => {
2695
+ var _a;
2696
+ 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) },
2697
+ React.createElement("video", { ref: (el) => {
2698
+ carouselVideoRefs.current[index] = el;
2699
+ }, src: item.url, style: baseStyles.carouselVideo, muted: true, loop: true, playsInline: true, controls: false }),
2700
+ 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));
2701
+ })),
2702
+ React.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { left: '10px' }), onClick: handleCarouselPrev }, "\u2039"),
2703
+ React.createElement("button", { style: Object.assign(Object.assign({}, baseStyles.arrowButton), { right: '10px' }), onClick: handleCarouselNext }, "\u203A")),
2704
+ React.createElement("div", { style: mergeStyles(baseStyles.carouselInfoSection, 'carouselSection') },
2705
+ ((_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)),
2706
+ 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)))),
2707
+ data.highlightRevealSection && (React.createElement("div", { style: mergeStyles(baseStyles.highlightSection, 'highlightSection') },
2708
+ React.createElement("div", { style: baseStyles.highlightImageContainer },
2709
+ React.createElement("img", { src: data.highlightRevealSection.landingImageUrl || data.highlightRevealSection.cover, alt: data.highlightRevealSection.title, style: baseStyles.highlightImage })),
2710
+ React.createElement("div", { style: mergeStyles(baseStyles.highlightInfoSection, 'highlightSection') },
2711
+ React.createElement("div", { style: mergeStyles(baseStyles.highlightTitle, 'highlightSection') }, data.highlightRevealSection.title),
2712
+ renderCTA('highlightButton', data.highlightRevealSection.bindCta, data.highlightRevealSection, baseStyles.highlightButton)))),
2713
+ data.productGridSection && data.productGridSection.length > 0 && (React.createElement("div", { style: mergeStyles(baseStyles.productGrid, 'productGrid') }, (() => {
2714
+ // 创建一个6格的网格 (3行 x 2列),根据position放置产品
2715
+ const gridItems = [null, null, null, null, null, null];
2716
+ // 创建产品索引映射表:gridIndex -> 产品在数据数组中的索引(从1开始)
2717
+ const productIndexMap = {};
2718
+ data.productGridSection.forEach((product, idx) => {
2719
+ var _a;
2720
+ const pos = (_a = product.position) === null || _a === void 0 ? void 0 : _a.toLowerCase();
2721
+ let gridIndex = -1;
2722
+ if (pos === 'top_right') {
2723
+ gridIndex = 1; // 第一行右侧
2724
+ }
2725
+ else if (pos === 'top_left') {
2726
+ gridIndex = 0; // 第一行左侧
2727
+ }
2728
+ else if (pos === 'center_left') {
2729
+ gridIndex = 2; // 第二行左侧
2730
+ }
2731
+ else if (pos === 'center_right') {
2732
+ gridIndex = 3; // 第二行右侧
2733
+ }
2734
+ else if (pos === 'bottom_left') {
2735
+ gridIndex = 4; // 第三行左侧
2736
+ }
2737
+ else if (pos === 'bottom_right') {
2738
+ gridIndex = 5; // 第三行右侧
2739
+ }
2740
+ if (gridIndex >= 0) {
2741
+ gridItems[gridIndex] = product;
2742
+ // 映射:网格位置 -> 产品序号(基于数据数组的顺序,从1开始)
2743
+ productIndexMap[gridIndex] = idx + 1;
2744
+ }
2745
+ });
2746
+ return gridItems.map((product, gridIndex) => {
2747
+ // 使用产品在数据数组中的实际索引来确定 buttonKey
2748
+ const productDataIndex = productIndexMap[gridIndex];
2749
+ const buttonKey = `productButton${productDataIndex || gridIndex + 1}`;
2750
+ 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,
2751
+ React.createElement("div", { style: baseStyles.productImageContainer },
2752
+ React.createElement("img", { src: product.landingImageUrl || product.cover,
2753
+ // alt={product.title}
2754
+ style: baseStyles.productImage })),
2755
+ product.bindCta && (React.createElement("div", { style: baseStyles.productCtaContainer }, renderCTA(buttonKey, product.bindCta, product, baseStyles.productButton))))) : (
2756
+ // 空格子
2757
+ React.createElement("div", { style: { width: '100%', paddingBottom: '100%' } }))));
2758
+ });
2759
+ })())),
2760
+ data.footerSection && (React.createElement("div", { style: mergeStyles(baseStyles.footerSection, 'footerSection') },
2761
+ React.createElement("div", { style: mergeStyles(baseStyles.footerInfoSection, 'footerSection') }, renderCTA('footerButton', data.footerSection.bindCta, data.footerSection, baseStyles.footerButton)),
2762
+ React.createElement("div", { style: baseStyles.footerImageContainer },
2763
+ React.createElement("img", { src: data.footerSection.landingImageUrl || data.footerSection.cover, alt: data.footerSection.title, style: baseStyles.footerImage }))))));
2764
+ };
2765
+
1910
2766
  var index$3 = /*#__PURE__*/Object.freeze({
1911
2767
  __proto__: null,
1912
- EditorCore: EditorCore
2768
+ EditorCore: EditorCore,
2769
+ StructurePage: StructurePage
1913
2770
  });
1914
2771
 
1915
2772
  var interactionRender$h = [
@@ -2134,14 +2991,14 @@ var settingRender$f = [
2134
2991
  * @Author: binruan@chatlabs.com
2135
2992
  * @Date: 2024-03-12 10:59:06
2136
2993
  * @LastEditors: binruan@chatlabs.com
2137
- * @LastEditTime: 2024-11-28 11:17:16
2994
+ * @LastEditTime: 2025-05-09 15:30:59
2138
2995
  * @FilePath: \pb-sxp-ui\src\core\hooks\useEventReport.ts
2139
2996
  *
2140
2997
  */
2141
2998
  function useEventReport() {
2142
2999
  const { bffEventReport, popupDetailData, isFromHashtag, eventTimeList, setEventTimeList } = useSxpDataSource();
2143
3000
  const jumpToWeb = React.useCallback((e, data, product, cta, position, traceInfo) => {
2144
- 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;
3001
+ 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;
2145
3002
  const i = eventTimeList === null || eventTimeList === void 0 ? void 0 : eventTimeList.findIndex((item) => item.target === (e === null || e === void 0 ? void 0 : e.target));
2146
3003
  if (i !== -1) {
2147
3004
  return;
@@ -2174,11 +3031,11 @@ function useEventReport() {
2174
3031
  contentFormat = 'image';
2175
3032
  }
2176
3033
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
2177
- 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 }))
3034
+ 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 }))
2178
3035
  });
2179
3036
  }, [bffEventReport, popupDetailData, isFromHashtag, eventTimeList]);
2180
3037
  const productView = React.useCallback((data, product, cta, viewTime, position) => {
2181
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
3038
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
2182
3039
  let fromKName = '';
2183
3040
  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))) {
2184
3041
  fromKName = 'pdpPage';
@@ -2197,8 +3054,9 @@ function useEventReport() {
2197
3054
  contentTags: JSON.stringify(product === null || product === void 0 ? void 0 : product.tags),
2198
3055
  position: position + '',
2199
3056
  contentId: (_d = data === null || data === void 0 ? void 0 : data.video) === null || _d === void 0 ? void 0 : _d.itemId,
3057
+ 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 : '',
2200
3058
  ctatId: cta === null || cta === void 0 ? void 0 : cta.itemId,
2201
- 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 : '',
3059
+ 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 : '',
2202
3060
  timeOnSite: Math.floor((new Date() - viewTime) / 1000) + '',
2203
3061
  eventSubject: 'productView',
2204
3062
  eventDescription: 'User browsed the product'
@@ -3857,9 +4715,8 @@ function updateSlides() {
3857
4715
  allSlidesSize += slideSizeValue + (spaceBetween || 0);
3858
4716
  });
3859
4717
  allSlidesSize -= spaceBetween;
3860
- const offsetSize = (params.slidesOffsetBefore || 0) + (params.slidesOffsetAfter || 0);
3861
- if (allSlidesSize + offsetSize < swiperSize) {
3862
- const allSlidesOffset = (swiperSize - allSlidesSize - offsetSize) / 2;
4718
+ if (allSlidesSize < swiperSize) {
4719
+ const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
3863
4720
  snapGrid.forEach((snap, snapIndex) => {
3864
4721
  snapGrid[snapIndex] = snap - allSlidesOffset;
3865
4722
  });
@@ -3963,13 +4820,6 @@ function updateSlidesOffset() {
3963
4820
  }
3964
4821
  }
3965
4822
 
3966
- const toggleSlideClasses$1 = (slideEl, condition, className) => {
3967
- if (condition && !slideEl.classList.contains(className)) {
3968
- slideEl.classList.add(className);
3969
- } else if (!condition && slideEl.classList.contains(className)) {
3970
- slideEl.classList.remove(className);
3971
- }
3972
- };
3973
4823
  function updateSlidesProgress(translate) {
3974
4824
  if (translate === void 0) {
3975
4825
  translate = this && this.translate || 0;
@@ -3985,6 +4835,11 @@ function updateSlidesProgress(translate) {
3985
4835
  if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
3986
4836
  let offsetCenter = -translate;
3987
4837
  if (rtl) offsetCenter = translate;
4838
+
4839
+ // Visible Slides
4840
+ slides.forEach(slideEl => {
4841
+ slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass);
4842
+ });
3988
4843
  swiper.visibleSlidesIndexes = [];
3989
4844
  swiper.visibleSlides = [];
3990
4845
  let spaceBetween = params.spaceBetween;
@@ -4008,9 +4863,11 @@ function updateSlidesProgress(translate) {
4008
4863
  if (isVisible) {
4009
4864
  swiper.visibleSlides.push(slide);
4010
4865
  swiper.visibleSlidesIndexes.push(i);
4866
+ slides[i].classList.add(params.slideVisibleClass);
4867
+ }
4868
+ if (isFullyVisible) {
4869
+ slides[i].classList.add(params.slideFullyVisibleClass);
4011
4870
  }
4012
- toggleSlideClasses$1(slide, isVisible, params.slideVisibleClass);
4013
- toggleSlideClasses$1(slide, isFullyVisible, params.slideFullyVisibleClass);
4014
4871
  slide.progress = rtl ? -slideProgress : slideProgress;
4015
4872
  slide.originalProgress = rtl ? -originalSlideProgress : originalSlideProgress;
4016
4873
  }
@@ -4079,13 +4936,6 @@ function updateProgress(translate) {
4079
4936
  swiper.emit('progress', progress);
4080
4937
  }
4081
4938
 
4082
- const toggleSlideClasses = (slideEl, condition, className) => {
4083
- if (condition && !slideEl.classList.contains(className)) {
4084
- slideEl.classList.add(className);
4085
- } else if (!condition && slideEl.classList.contains(className)) {
4086
- slideEl.classList.remove(className);
4087
- }
4088
- };
4089
4939
  function updateSlidesClasses() {
4090
4940
  const swiper = this;
4091
4941
  const {
@@ -4099,6 +4949,9 @@ function updateSlidesClasses() {
4099
4949
  const getFilteredSlide = selector => {
4100
4950
  return elementChildren(slidesEl, `.${params.slideClass}${selector}, swiper-slide${selector}`)[0];
4101
4951
  };
4952
+ slides.forEach(slideEl => {
4953
+ slideEl.classList.remove(params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
4954
+ });
4102
4955
  let activeSlide;
4103
4956
  let prevSlide;
4104
4957
  let nextSlide;
@@ -4121,25 +4974,35 @@ function updateSlidesClasses() {
4121
4974
  }
4122
4975
  }
4123
4976
  if (activeSlide) {
4124
- if (!gridEnabled) {
4977
+ // Active classes
4978
+ activeSlide.classList.add(params.slideActiveClass);
4979
+ if (gridEnabled) {
4980
+ if (nextSlide) {
4981
+ nextSlide.classList.add(params.slideNextClass);
4982
+ }
4983
+ if (prevSlide) {
4984
+ prevSlide.classList.add(params.slidePrevClass);
4985
+ }
4986
+ } else {
4125
4987
  // Next Slide
4126
4988
  nextSlide = elementNextAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
4127
4989
  if (params.loop && !nextSlide) {
4128
4990
  nextSlide = slides[0];
4129
4991
  }
4992
+ if (nextSlide) {
4993
+ nextSlide.classList.add(params.slideNextClass);
4994
+ }
4130
4995
 
4131
4996
  // Prev Slide
4132
4997
  prevSlide = elementPrevAll(activeSlide, `.${params.slideClass}, swiper-slide`)[0];
4133
4998
  if (params.loop && !prevSlide === 0) {
4134
4999
  prevSlide = slides[slides.length - 1];
4135
5000
  }
5001
+ if (prevSlide) {
5002
+ prevSlide.classList.add(params.slidePrevClass);
5003
+ }
4136
5004
  }
4137
5005
  }
4138
- slides.forEach(slideEl => {
4139
- toggleSlideClasses(slideEl, slideEl === activeSlide, params.slideActiveClass);
4140
- toggleSlideClasses(slideEl, slideEl === nextSlide, params.slideNextClass);
4141
- toggleSlideClasses(slideEl, slideEl === prevSlide, params.slidePrevClass);
4142
- });
4143
5006
  swiper.emitSlidesClasses();
4144
5007
  }
4145
5008
 
@@ -4517,7 +5380,6 @@ function translateTo(translate, speed, runCallbacks, translateBounds, internal)
4517
5380
  swiper.wrapperEl.removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
4518
5381
  swiper.onTranslateToWrapperTransitionEnd = null;
4519
5382
  delete swiper.onTranslateToWrapperTransitionEnd;
4520
- swiper.animating = false;
4521
5383
  if (runCallbacks) {
4522
5384
  swiper.emit('transitionEnd');
4523
5385
  }
@@ -4625,6 +5487,9 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
4625
5487
  if (index === void 0) {
4626
5488
  index = 0;
4627
5489
  }
5490
+ if (speed === void 0) {
5491
+ speed = this.params.speed;
5492
+ }
4628
5493
  if (runCallbacks === void 0) {
4629
5494
  runCallbacks = true;
4630
5495
  }
@@ -4644,12 +5509,9 @@ function slideTo(index, speed, runCallbacks, internal, initial) {
4644
5509
  wrapperEl,
4645
5510
  enabled
4646
5511
  } = swiper;
4647
- if (!enabled && !internal && !initial || swiper.destroyed || swiper.animating && params.preventInteractionOnTransition) {
5512
+ if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial || swiper.destroyed) {
4648
5513
  return false;
4649
5514
  }
4650
- if (typeof speed === 'undefined') {
4651
- speed = swiper.params.speed;
4652
- }
4653
5515
  const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
4654
5516
  let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
4655
5517
  if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
@@ -4776,6 +5638,9 @@ function slideToLoop(index, speed, runCallbacks, internal) {
4776
5638
  if (index === void 0) {
4777
5639
  index = 0;
4778
5640
  }
5641
+ if (speed === void 0) {
5642
+ speed = this.params.speed;
5643
+ }
4779
5644
  if (runCallbacks === void 0) {
4780
5645
  runCallbacks = true;
4781
5646
  }
@@ -4785,9 +5650,6 @@ function slideToLoop(index, speed, runCallbacks, internal) {
4785
5650
  }
4786
5651
  const swiper = this;
4787
5652
  if (swiper.destroyed) return;
4788
- if (typeof speed === 'undefined') {
4789
- speed = swiper.params.speed;
4790
- }
4791
5653
  const gridEnabled = swiper.grid && swiper.params.grid && swiper.params.grid.rows > 1;
4792
5654
  let newIndex = index;
4793
5655
  if (swiper.params.loop) {
@@ -4819,9 +5681,6 @@ function slideToLoop(index, speed, runCallbacks, internal) {
4819
5681
  if (centeredSlides) {
4820
5682
  needLoopFix = needLoopFix || targetSlideIndex < Math.ceil(slidesPerView / 2);
4821
5683
  }
4822
- if (internal && centeredSlides && swiper.params.slidesPerView !== 'auto' && !gridEnabled) {
4823
- needLoopFix = false;
4824
- }
4825
5684
  if (needLoopFix) {
4826
5685
  const direction = centeredSlides ? targetSlideIndex < swiper.activeIndex ? 'prev' : 'next' : targetSlideIndex - swiper.activeIndex - 1 < swiper.params.slidesPerView ? 'next' : 'prev';
4827
5686
  swiper.loopFix({
@@ -4847,6 +5706,9 @@ function slideToLoop(index, speed, runCallbacks, internal) {
4847
5706
 
4848
5707
  /* eslint no-unused-vars: "off" */
4849
5708
  function slideNext(speed, runCallbacks, internal) {
5709
+ if (speed === void 0) {
5710
+ speed = this.params.speed;
5711
+ }
4850
5712
  if (runCallbacks === void 0) {
4851
5713
  runCallbacks = true;
4852
5714
  }
@@ -4857,9 +5719,6 @@ function slideNext(speed, runCallbacks, internal) {
4857
5719
  animating
4858
5720
  } = swiper;
4859
5721
  if (!enabled || swiper.destroyed) return swiper;
4860
- if (typeof speed === 'undefined') {
4861
- speed = swiper.params.speed;
4862
- }
4863
5722
  let perGroup = params.slidesPerGroup;
4864
5723
  if (params.slidesPerView === 'auto' && params.slidesPerGroup === 1 && params.slidesPerGroupAuto) {
4865
5724
  perGroup = Math.max(swiper.slidesPerViewDynamic('current', true), 1);
@@ -4888,6 +5747,9 @@ function slideNext(speed, runCallbacks, internal) {
4888
5747
 
4889
5748
  /* eslint no-unused-vars: "off" */
4890
5749
  function slidePrev(speed, runCallbacks, internal) {
5750
+ if (speed === void 0) {
5751
+ speed = this.params.speed;
5752
+ }
4891
5753
  if (runCallbacks === void 0) {
4892
5754
  runCallbacks = true;
4893
5755
  }
@@ -4901,9 +5763,6 @@ function slidePrev(speed, runCallbacks, internal) {
4901
5763
  animating
4902
5764
  } = swiper;
4903
5765
  if (!enabled || swiper.destroyed) return swiper;
4904
- if (typeof speed === 'undefined') {
4905
- speed = swiper.params.speed;
4906
- }
4907
5766
  const isVirtual = swiper.virtual && params.virtual.enabled;
4908
5767
  if (params.loop) {
4909
5768
  if (animating && !isVirtual && params.loopPreventsSliding) return false;
@@ -4956,19 +5815,22 @@ function slidePrev(speed, runCallbacks, internal) {
4956
5815
 
4957
5816
  /* eslint no-unused-vars: "off" */
4958
5817
  function slideReset(speed, runCallbacks, internal) {
5818
+ if (speed === void 0) {
5819
+ speed = this.params.speed;
5820
+ }
4959
5821
  if (runCallbacks === void 0) {
4960
5822
  runCallbacks = true;
4961
5823
  }
4962
5824
  const swiper = this;
4963
5825
  if (swiper.destroyed) return;
4964
- if (typeof speed === 'undefined') {
4965
- speed = swiper.params.speed;
4966
- }
4967
5826
  return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
4968
5827
  }
4969
5828
 
4970
5829
  /* eslint no-unused-vars: "off" */
4971
5830
  function slideToClosest(speed, runCallbacks, internal, threshold) {
5831
+ if (speed === void 0) {
5832
+ speed = this.params.speed;
5833
+ }
4972
5834
  if (runCallbacks === void 0) {
4973
5835
  runCallbacks = true;
4974
5836
  }
@@ -4977,9 +5839,6 @@ function slideToClosest(speed, runCallbacks, internal, threshold) {
4977
5839
  }
4978
5840
  const swiper = this;
4979
5841
  if (swiper.destroyed) return;
4980
- if (typeof speed === 'undefined') {
4981
- speed = swiper.params.speed;
4982
- }
4983
5842
  let index = swiper.activeIndex;
4984
5843
  const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
4985
5844
  const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
@@ -5614,7 +6473,7 @@ function onTouchMove(event) {
5614
6473
  data.startMoving = true;
5615
6474
  }
5616
6475
  }
5617
- if (data.isScrolling || e.type === 'touchmove' && data.preventTouchMoveFromPointerMove) {
6476
+ if (data.isScrolling) {
5618
6477
  data.isTouched = false;
5619
6478
  return;
5620
6479
  }
@@ -5656,10 +6515,7 @@ function onTouchMove(event) {
5656
6515
  if (swiper.animating) {
5657
6516
  const evt = new window.CustomEvent('transitionend', {
5658
6517
  bubbles: true,
5659
- cancelable: true,
5660
- detail: {
5661
- bySwiperTouchMove: true
5662
- }
6518
+ cancelable: true
5663
6519
  });
5664
6520
  swiper.wrapperEl.dispatchEvent(evt);
5665
6521
  }
@@ -6053,7 +6909,6 @@ const events = (swiper, method) => {
6053
6909
  const capture = !!params.nested;
6054
6910
  const domMethod = method === 'on' ? 'addEventListener' : 'removeEventListener';
6055
6911
  const swiperMethod = method;
6056
- if (!el || typeof el === 'string') return;
6057
6912
 
6058
6913
  // Touch Events
6059
6914
  document[domMethod]('touchstart', swiper.onDocumentTouchStart, {
@@ -6162,8 +7017,6 @@ function setBreakpoint() {
6162
7017
  const breakpointParams = breakpointOnlyParams || swiper.originalParams;
6163
7018
  const wasMultiRow = isGridEnabled(swiper, params);
6164
7019
  const isMultiRow = isGridEnabled(swiper, breakpointParams);
6165
- const wasGrabCursor = swiper.params.grabCursor;
6166
- const isGrabCursor = breakpointParams.grabCursor;
6167
7020
  const wasEnabled = params.enabled;
6168
7021
  if (wasMultiRow && !isMultiRow) {
6169
7022
  el.classList.remove(`${params.containerModifierClass}grid`, `${params.containerModifierClass}grid-column`);
@@ -6175,11 +7028,6 @@ function setBreakpoint() {
6175
7028
  }
6176
7029
  swiper.emitContainerClasses();
6177
7030
  }
6178
- if (wasGrabCursor && !isGrabCursor) {
6179
- swiper.unsetGrabCursor();
6180
- } else if (!wasGrabCursor && isGrabCursor) {
6181
- swiper.setGrabCursor();
6182
- }
6183
7031
 
6184
7032
  // Toggle navigation, pagination, scrollbar
6185
7033
  ['navigation', 'pagination', 'scrollbar'].forEach(prop => {
@@ -6330,7 +7178,6 @@ function removeClasses() {
6330
7178
  el,
6331
7179
  classNames
6332
7180
  } = swiper;
6333
- if (!el || typeof el === 'string') return;
6334
7181
  el.classList.remove(...classNames);
6335
7182
  swiper.emitContainerClasses();
6336
7183
  }
@@ -7095,12 +7942,8 @@ let Swiper$1 = class Swiper {
7095
7942
  // Cleanup styles
7096
7943
  if (cleanStyles) {
7097
7944
  swiper.removeClasses();
7098
- if (el && typeof el !== 'string') {
7099
- el.removeAttribute('style');
7100
- }
7101
- if (wrapperEl) {
7102
- wrapperEl.removeAttribute('style');
7103
- }
7945
+ el.removeAttribute('style');
7946
+ wrapperEl.removeAttribute('style');
7104
7947
  if (slides && slides.length) {
7105
7948
  slides.forEach(slideEl => {
7106
7949
  slideEl.classList.remove(params.slideVisibleClass, params.slideFullyVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass);
@@ -7116,9 +7959,7 @@ let Swiper$1 = class Swiper {
7116
7959
  swiper.off(eventName);
7117
7960
  });
7118
7961
  if (deleteInstance !== false) {
7119
- if (swiper.el && typeof swiper.el !== 'string') {
7120
- swiper.el.swiper = null;
7121
- }
7962
+ swiper.el.swiper = null;
7122
7963
  deleteProps(swiper);
7123
7964
  }
7124
7965
  swiper.destroyed = true;
@@ -7512,7 +8353,7 @@ const updateOnVirtualData = swiper => {
7512
8353
  };
7513
8354
 
7514
8355
  /**
7515
- * Swiper React 11.1.4
8356
+ * Swiper React 11.0.7
7516
8357
  * Most modern mobile touch slider and framework with hardware accelerated transitions
7517
8358
  * https://swiperjs.com
7518
8359
  *
@@ -7520,7 +8361,7 @@ const updateOnVirtualData = swiper => {
7520
8361
  *
7521
8362
  * Released under the MIT License
7522
8363
  *
7523
- * Released on: May 30, 2024
8364
+ * Released on: February 27, 2024
7524
8365
  */
7525
8366
 
7526
8367
 
@@ -8447,10 +9288,8 @@ function Navigation(_ref) {
8447
9288
  }
8448
9289
  if (el) {
8449
9290
  if (typeof el === 'string') res = [...document.querySelectorAll(el)];
8450
- if (swiper.params.uniqueNavElements && typeof el === 'string' && res && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
9291
+ if (swiper.params.uniqueNavElements && typeof el === 'string' && res.length > 1 && swiper.el.querySelectorAll(el).length === 1) {
8451
9292
  res = swiper.el.querySelector(el);
8452
- } else if (res && res.length === 1) {
8453
- res = res[0];
8454
9293
  }
8455
9294
  }
8456
9295
  if (el && !res) return el;
@@ -8572,14 +9411,7 @@ function Navigation(_ref) {
8572
9411
  nextEl = makeElementsArray(nextEl);
8573
9412
  prevEl = makeElementsArray(prevEl);
8574
9413
  const targetEl = e.target;
8575
- let targetIsButton = prevEl.includes(targetEl) || nextEl.includes(targetEl);
8576
- if (swiper.isElement && !targetIsButton) {
8577
- const path = e.path || e.composedPath && e.composedPath();
8578
- if (path) {
8579
- targetIsButton = path.find(pathEl => nextEl.includes(pathEl) || prevEl.includes(pathEl));
8580
- }
8581
- }
8582
- if (swiper.params.navigation.hideOnClick && !targetIsButton) {
9414
+ if (swiper.params.navigation.hideOnClick && !prevEl.includes(targetEl) && !nextEl.includes(targetEl)) {
8583
9415
  if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;
8584
9416
  let isHidden;
8585
9417
  if (nextEl.length) {
@@ -9235,7 +10067,7 @@ function Scrollbar(_ref) {
9235
10067
  dragEl
9236
10068
  } = scrollbar;
9237
10069
  if (!isTouched) return;
9238
- if (e.preventDefault && e.cancelable) e.preventDefault();else e.returnValue = false;
10070
+ if (e.preventDefault) e.preventDefault();else e.returnValue = false;
9239
10071
  setDragPosition(e);
9240
10072
  wrapperEl.style.transitionDuration = '0ms';
9241
10073
  el.style.transitionDuration = '0ms';
@@ -9446,9 +10278,6 @@ function A11y(_ref) {
9446
10278
  clicked: false
9447
10279
  };
9448
10280
  let liveRegion = null;
9449
- let preventFocusHandler;
9450
- let focusTargetSlideEl;
9451
- let visibilityChangedTimestamp = new Date().getTime();
9452
10281
  function notify(message) {
9453
10282
  const notification = liveRegion;
9454
10283
  if (notification.length === 0) return;
@@ -9529,28 +10358,24 @@ function A11y(_ref) {
9529
10358
  if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
9530
10359
  if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
9531
10360
  }
9532
- if (swiper.navigation && swiper.navigation.prevEl && swiper.navigation.nextEl) {
9533
- const prevEls = makeElementsArray(swiper.navigation.prevEl);
9534
- const nextEls = makeElementsArray(swiper.navigation.nextEl);
9535
- if (nextEls.includes(targetEl)) {
9536
- if (!(swiper.isEnd && !swiper.params.loop)) {
9537
- swiper.slideNext();
9538
- }
9539
- if (swiper.isEnd) {
9540
- notify(params.lastSlideMessage);
9541
- } else {
9542
- notify(params.nextSlideMessage);
9543
- }
10361
+ if (swiper.navigation && swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl) {
10362
+ if (!(swiper.isEnd && !swiper.params.loop)) {
10363
+ swiper.slideNext();
9544
10364
  }
9545
- if (prevEls.includes(targetEl)) {
9546
- if (!(swiper.isBeginning && !swiper.params.loop)) {
9547
- swiper.slidePrev();
9548
- }
9549
- if (swiper.isBeginning) {
9550
- notify(params.firstSlideMessage);
9551
- } else {
9552
- notify(params.prevSlideMessage);
9553
- }
10365
+ if (swiper.isEnd) {
10366
+ notify(params.lastSlideMessage);
10367
+ } else {
10368
+ notify(params.nextSlideMessage);
10369
+ }
10370
+ }
10371
+ if (swiper.navigation && swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl) {
10372
+ if (!(swiper.isBeginning && !swiper.params.loop)) {
10373
+ swiper.slidePrev();
10374
+ }
10375
+ if (swiper.isBeginning) {
10376
+ notify(params.firstSlideMessage);
10377
+ } else {
10378
+ notify(params.prevSlideMessage);
9554
10379
  }
9555
10380
  }
9556
10381
  if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
@@ -9615,14 +10440,10 @@ function A11y(_ref) {
9615
10440
  addElLabel(el, message);
9616
10441
  addElControls(el, wrapperId);
9617
10442
  };
9618
- const handlePointerDown = e => {
9619
- if (focusTargetSlideEl && focusTargetSlideEl !== e.target && !focusTargetSlideEl.contains(e.target)) {
9620
- preventFocusHandler = true;
9621
- }
10443
+ const handlePointerDown = () => {
9622
10444
  swiper.a11y.clicked = true;
9623
10445
  };
9624
10446
  const handlePointerUp = () => {
9625
- preventFocusHandler = false;
9626
10447
  requestAnimationFrame(() => {
9627
10448
  requestAnimationFrame(() => {
9628
10449
  if (!swiper.destroyed) {
@@ -9631,15 +10452,10 @@ function A11y(_ref) {
9631
10452
  });
9632
10453
  });
9633
10454
  };
9634
- const onVisibilityChange = e => {
9635
- visibilityChangedTimestamp = new Date().getTime();
9636
- };
9637
10455
  const handleFocus = e => {
9638
10456
  if (swiper.a11y.clicked) return;
9639
- if (new Date().getTime() - visibilityChangedTimestamp < 100) return;
9640
10457
  const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
9641
10458
  if (!slideEl || !swiper.slides.includes(slideEl)) return;
9642
- focusTargetSlideEl = slideEl;
9643
10459
  const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;
9644
10460
  const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
9645
10461
  if (isActive || isVisible) return;
@@ -9649,15 +10465,7 @@ function A11y(_ref) {
9649
10465
  } else {
9650
10466
  swiper.el.scrollTop = 0;
9651
10467
  }
9652
- requestAnimationFrame(() => {
9653
- if (preventFocusHandler) return;
9654
- if (swiper.params.loop) {
9655
- swiper.slideToLoop(parseInt(slideEl.getAttribute('data-swiper-slide-index')), 0);
9656
- } else {
9657
- swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
9658
- }
9659
- preventFocusHandler = false;
9660
- });
10468
+ swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
9661
10469
  };
9662
10470
  const initSlides = () => {
9663
10471
  const params = swiper.params.a11y;
@@ -9722,9 +10530,6 @@ function A11y(_ref) {
9722
10530
  }
9723
10531
 
9724
10532
  // Tab focus
9725
- const document = getDocument();
9726
- document.addEventListener('visibilitychange', onVisibilityChange);
9727
- swiper.el.addEventListener('focus', handleFocus, true);
9728
10533
  swiper.el.addEventListener('focus', handleFocus, true);
9729
10534
  swiper.el.addEventListener('pointerdown', handlePointerDown, true);
9730
10535
  swiper.el.addEventListener('pointerup', handlePointerUp, true);
@@ -9751,14 +10556,11 @@ function A11y(_ref) {
9751
10556
  el.removeEventListener('keydown', onEnterOrSpaceKey);
9752
10557
  });
9753
10558
  }
9754
- const document = getDocument();
9755
- document.removeEventListener('visibilitychange', onVisibilityChange);
10559
+
9756
10560
  // Tab focus
9757
- if (swiper.el && typeof swiper.el !== 'string') {
9758
- swiper.el.removeEventListener('focus', handleFocus, true);
9759
- swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
9760
- swiper.el.removeEventListener('pointerup', handlePointerUp, true);
9761
- }
10561
+ swiper.el.removeEventListener('focus', handleFocus, true);
10562
+ swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
10563
+ swiper.el.removeEventListener('pointerup', handlePointerUp, true);
9762
10564
  }
9763
10565
  on('beforeInit', () => {
9764
10566
  liveRegion = createElement('span', swiper.params.a11y.notificationClass);
@@ -9830,7 +10632,7 @@ function Autoplay(_ref) {
9830
10632
  if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
9831
10633
  if (e.target !== swiper.wrapperEl) return;
9832
10634
  swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
9833
- if (pausedByPointerEnter || e.detail && e.detail.bySwiperTouchMove) {
10635
+ if (pausedByPointerEnter) {
9834
10636
  return;
9835
10637
  }
9836
10638
  resume();
@@ -10001,10 +10803,8 @@ function Autoplay(_ref) {
10001
10803
  }
10002
10804
  };
10003
10805
  const detachMouseEvents = () => {
10004
- if (swiper.el && typeof swiper.el !== 'string') {
10005
- swiper.el.removeEventListener('pointerenter', onPointerEnter);
10006
- swiper.el.removeEventListener('pointerleave', onPointerLeave);
10007
- }
10806
+ swiper.el.removeEventListener('pointerenter', onPointerEnter);
10807
+ swiper.el.removeEventListener('pointerleave', onPointerLeave);
10008
10808
  };
10009
10809
  const attachDocumentEvents = () => {
10010
10810
  const document = getDocument();
@@ -10342,49 +11142,6 @@ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }
10342
11142
  };
10343
11143
  var Scroll$1 = React.memo(Scroll);
10344
11144
 
10345
- const FormatImage = React.forwardRef((props, ref) => {
10346
- const { src, onLoad, style, className, loading, alt = 'image' } = props;
10347
- const [imgSrc, setImgSrc] = React.useState(src);
10348
- const imgRef = React.useRef(null);
10349
- const [visible, setVisible] = React.useState(false);
10350
- React.useImperativeHandle(ref, () => ({
10351
- setSrc: (v) => {
10352
- if (v)
10353
- setImgSrc(v);
10354
- }
10355
- }));
10356
- React.useEffect(() => {
10357
- if (src)
10358
- setImgSrc(src);
10359
- }, [src]);
10360
- React.useEffect(() => {
10361
- const onShow = () => {
10362
- if (src && !visible && imgRef.current) {
10363
- imgRef.current.src = '';
10364
- imgRef.current.src = src;
10365
- }
10366
- };
10367
- SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
10368
- return () => {
10369
- SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, onShow);
10370
- };
10371
- }, [src, visible]);
10372
- return (React.createElement(React.Fragment, null,
10373
- !visible && !imgSrc && React.createElement("div", { style: { width: '100%', height: '100%', zIndex: 1, backgroundColor: '#fff' } }),
10374
- (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
10375
- React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
10376
- React.createElement("source", { type: 'image/webp', srcSet: `${imgSrc}?imageMogr2/format/webp` }),
10377
- React.createElement("source", { type: 'image/jpeg', srcSet: `${imgSrc}?imageMogr2/format/jpg` }),
10378
- React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
10379
- setVisible(true);
10380
- onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
10381
- }, alt: alt }))) : (React.createElement("img", { ref: imgRef, className: className, src: imgSrc, style: Object.assign({}, style), loading: loading, onLoad: (e) => {
10382
- setVisible(true);
10383
- onLoad === null || onLoad === void 0 ? void 0 : onLoad(e.target);
10384
- }, alt: alt }))));
10385
- });
10386
- var FormatImage$1 = React.memo(FormatImage);
10387
-
10388
11145
  const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
10389
11146
  var _a;
10390
11147
  const { productView } = useEventReport();
@@ -10474,13 +11231,13 @@ function useVisibleHeight() {
10474
11231
  styleElement.id = 'onetrust-pc-sdk';
10475
11232
  styleElement.setAttribute('type', 'text/css');
10476
11233
  document.head.appendChild(styleElement);
10477
- const css = `
10478
- #onetrust-pc-sdk {
10479
- height: ${finalHeight}px !important;
10480
- }
10481
- #onetrust-pc-sdk #ot-pc-content{
10482
- bottom: ${b}px !important;
10483
- }
11234
+ const css = `
11235
+ #onetrust-pc-sdk {
11236
+ height: ${finalHeight}px !important;
11237
+ }
11238
+ #onetrust-pc-sdk #ot-pc-content{
11239
+ bottom: ${b}px !important;
11240
+ }
10484
11241
  `;
10485
11242
  styleElement.textContent = css;
10486
11243
  }
@@ -11027,10 +11784,10 @@ const CommodityDetail$1 = (_a) => {
11027
11784
  __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)
11028
11785
  } }),
11029
11786
  React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
11030
- 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
11031
- bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
11032
- collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
11033
- necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
11787
+ 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
11788
+ bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
11789
+ collection is unisex and is inspired by the padlock pattern found in the Tiffany Antique Collection. This
11790
+ necklace features a stylish and eye-catching oval clasp chain decorated with a lock pattern. Crafted from
11034
11791
  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 }))));
11035
11792
  };
11036
11793
  const renderBtn = () => {
@@ -12029,7 +12786,7 @@ const CommodityDetailDiroNew$1 = (_a) => {
12029
12786
  const productInfoText = ({ isPost }) => {
12030
12787
  return (React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
12031
12788
  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) ||
12032
- `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
12789
+ `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
12033
12790
  Made in Italy` })));
12034
12791
  };
12035
12792
  const getStyle = React.useCallback((style) => {
@@ -16242,7 +16999,7 @@ function WaterfallList(_a) {
16242
16999
  * @Author: binruan@chatlabs.com
16243
17000
  * @Date: 2024-01-10 10:58:24
16244
17001
  * @LastEditors: binruan@chatlabs.com
16245
- * @LastEditTime: 2025-02-28 10:00:31
17002
+ * @LastEditTime: 2025-05-09 15:30:41
16246
17003
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\WaterFall\index.tsx
16247
17004
  *
16248
17005
  */
@@ -16280,7 +17037,7 @@ const WaterFall = (props) => {
16280
17037
  }
16281
17038
  }, [waterFallData]);
16282
17039
  const reportTagsView = React.useCallback(() => {
16283
- var _a, _b, _c, _d, _e, _f;
17040
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
16284
17041
  const rec = recData === null || recData === void 0 ? void 0 : recData.rec;
16285
17042
  if (!rec)
16286
17043
  return;
@@ -16300,9 +17057,10 @@ const WaterFall = (props) => {
16300
17057
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
16301
17058
  eventInfo: {
16302
17059
  contentId: (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.itemId,
17060
+ 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 : '',
16303
17061
  position: cacheActiveIndex + '',
16304
- contentTags: JSON.stringify((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.tags),
16305
- traceInfo: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.traceInfo,
17062
+ contentTags: JSON.stringify((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.tags),
17063
+ traceInfo: (_j = rec === null || rec === void 0 ? void 0 : rec.video) === null || _j === void 0 ? void 0 : _j.traceInfo,
16306
17064
  hashTags: JSON.stringify([recData === null || recData === void 0 ? void 0 : recData.hashTag]),
16307
17065
  fromKName,
16308
17066
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
@@ -18210,10 +18968,10 @@ const MultiPosts$1 = (_a) => {
18210
18968
  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) || '';
18211
18969
  const getPropsVal = React.useCallback((index, str) => {
18212
18970
  try {
18213
- return new Function('props', 'str', `if (str) {
18214
- return props?.button${index + 1}${str}
18215
- } else {
18216
- return props?.button${index + 1}
18971
+ return new Function('props', 'str', `if (str) {
18972
+ return props?.button${index + 1}${str}
18973
+ } else {
18974
+ return props?.button${index + 1}
18217
18975
  }`)(props, str);
18218
18976
  }
18219
18977
  catch (_a) { }
@@ -18409,21 +19167,22 @@ const LikeButton = (_a) => {
18409
19167
  const likeIcon = useIconLink(defaultLikeIconPath$2);
18410
19168
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
18411
19169
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
18412
- 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;
19170
+ 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;
18413
19171
  if (state) {
18414
19172
  // 先设置状态
18415
19173
  setState(false);
18416
- 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;
19174
+ 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;
18417
19175
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
18418
19176
  eventInfo: {
18419
19177
  eventSubject: 'favoriteContentCanceled',
18420
19178
  eventDescription: 'This content was unfavorite by the user',
18421
19179
  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 : '',
18422
- 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 : '',
18423
- 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 : []),
19180
+ 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 : '',
19181
+ 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 : '',
19182
+ 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 : []),
18424
19183
  position: position + '',
18425
- contentFormat: ((_m = recData === null || recData === void 0 ? void 0 : recData.video) === null || _m === void 0 ? void 0 : _m.url) ? 'video' : 'image',
18426
- traceInfo: (_o = recData === null || recData === void 0 ? void 0 : recData.video) === null || _o === void 0 ? void 0 : _o.traceInfo
19184
+ contentFormat: ((_q = recData === null || recData === void 0 ? void 0 : recData.video) === null || _q === void 0 ? void 0 : _q.url) ? 'video' : 'image',
19185
+ traceInfo: (_r = recData === null || recData === void 0 ? void 0 : recData.video) === null || _r === void 0 ? void 0 : _r.traceInfo
18427
19186
  }
18428
19187
  });
18429
19188
  // 如果接口调用失败,则回滚状态
@@ -18431,48 +19190,49 @@ const LikeButton = (_a) => {
18431
19190
  setState(true);
18432
19191
  }
18433
19192
  else {
18434
- const nRtcList = (_p = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
19193
+ const nRtcList = (_s = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18435
19194
  if (index === position) {
18436
19195
  item.isCollected = false;
18437
19196
  }
18438
19197
  return item;
18439
- })) !== null && _p !== void 0 ? _p : [];
19198
+ })) !== null && _s !== void 0 ? _s : [];
18440
19199
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18441
19200
  }
18442
19201
  }
18443
19202
  else {
18444
19203
  setState(true);
18445
- const result = (_q = (yield (mutateLike === null || mutateLike === void 0 ? void 0 : mutateLike({ content: JSON.stringify(recData) })))) !== null && _q !== void 0 ? _q : false;
19204
+ 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;
18446
19205
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
18447
19206
  eventInfo: {
18448
19207
  eventSubject: 'favoriteContent',
18449
19208
  eventDescription: 'This content was favorite by the user',
18450
- 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 : '',
18451
- 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 : '',
18452
- 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 : []),
19209
+ 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 : '',
19210
+ 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 : '',
19211
+ 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 : '',
19212
+ 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 : []),
18453
19213
  position: position + '',
18454
- contentFormat: ((_x = recData === null || recData === void 0 ? void 0 : recData.video) === null || _x === void 0 ? void 0 : _x.url) ? 'video' : 'image',
18455
- traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
19214
+ contentFormat: ((_5 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _5 === void 0 ? void 0 : _5.url) ? 'video' : 'image',
19215
+ traceInfo: (_6 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _6 === void 0 ? void 0 : _6.traceInfo
18456
19216
  }
18457
19217
  });
18458
19218
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18459
19219
  eventName: 'Engagement',
18460
- product: (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.bindProducts,
19220
+ product: (_7 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _7 === void 0 ? void 0 : _7.bindProducts,
18461
19221
  rec: recData,
18462
19222
  position,
18463
- 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 : '',
19223
+ 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 : '',
18464
19224
  engagement_type: 'like'
18465
19225
  });
18466
19226
  if (!result) {
18467
19227
  setState(false);
18468
19228
  }
18469
19229
  else {
18470
- const nRtcList = (_2 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
19230
+ const nRtcList = (_10 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18471
19231
  if (index === position) {
18472
19232
  item.isCollected = true;
18473
19233
  }
18474
19234
  return item;
18475
- })) !== null && _2 !== void 0 ? _2 : [];
19235
+ })) !== null && _10 !== void 0 ? _10 : [];
18476
19236
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18477
19237
  }
18478
19238
  }
@@ -18509,7 +19269,7 @@ const mountVideoPlayerAtNode = (() => {
18509
19269
  const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon, loopPlay, swiperRef, visibleHeight }, ref) => {
18510
19270
  var _a, _b;
18511
19271
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
18512
- const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
19272
+ const { bffEventReport, sxpParameter, firstRtcList, openHashtag, bffFbReport, isDiyH5 } = useSxpDataSource();
18513
19273
  const videoStartTime = React.useRef(0);
18514
19274
  const [isLoadFinish, setIsLoadFinish] = React.useState(false);
18515
19275
  const { isActive } = useSwiperSlide();
@@ -18526,7 +19286,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18526
19286
  const loopPlayRef = React.useRef(loopPlay);
18527
19287
  const scene = rec.video.scene;
18528
19288
  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);
18529
- 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;
19289
+ const videoCover = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.cover;
18530
19290
  const videoPoster = videoCover || (sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image);
18531
19291
  React.useImperativeHandle(ref, () => {
18532
19292
  return {
@@ -18575,6 +19335,23 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18575
19335
  return;
18576
19336
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
18577
19337
  }, [videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
19338
+ const handleEnd = () => {
19339
+ var _a, _b, _c, _d, _e, _f;
19340
+ if (!videoRef.current)
19341
+ return;
19342
+ if (isDiyH5) {
19343
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.pause();
19344
+ if (!loopPlayRef.current)
19345
+ return;
19346
+ if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
19347
+ 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;
19348
+ (_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);
19349
+ }
19350
+ }
19351
+ else {
19352
+ (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.play();
19353
+ }
19354
+ };
18578
19355
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
18579
19356
  const handlePlaying = React.useCallback(() => {
18580
19357
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
@@ -18583,7 +19360,7 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18583
19360
  setIsLoadFinish(true);
18584
19361
  }, []);
18585
19362
  const handleStartPlay = React.useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
18586
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
19363
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
18587
19364
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
18588
19365
  return;
18589
19366
  setIsPauseVideo(false);
@@ -18594,16 +19371,11 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18594
19371
  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);
18595
19372
  const playType = (isFirstPlayRef === null || isFirstPlayRef === void 0 ? void 0 : isFirstPlayRef.current) ? '0' : '1';
18596
19373
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
18597
- 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) + '' }))
19374
+ 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) + '' }))
18598
19375
  });
18599
19376
  isFirstPlayRef.current = false;
18600
19377
  }
18601
19378
  }), [bffEventReport, data, index, isFirstPlayRef, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
18602
- const setCurrentTimeByStartTime = React.useCallback(() => {
18603
- if (isDiyH5) {
18604
- videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
18605
- }
18606
- }, []);
18607
19379
  const handLoadeddata = React.useCallback(() => {
18608
19380
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) || firstFrameSrc || !blur)
18609
19381
  return;
@@ -18628,13 +19400,12 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18628
19400
  const handleLoadedmetadata = React.useCallback(() => {
18629
19401
  if (!videoRef.current)
18630
19402
  return;
18631
- setCurrentTimeByStartTime();
18632
19403
  loadedTimeRef.current = new Date();
18633
19404
  handleStartPlay();
18634
19405
  handLoadeddata();
18635
19406
  }, [videoRef.current, handLoadeddata, handleStartPlay]);
18636
19407
  const handleClickVideo = React.useCallback((type) => () => {
18637
- var _a, _b, _c, _d, _e, _f;
19408
+ var _a, _b, _c, _d, _e;
18638
19409
  if (!videoRef.current)
18639
19410
  return;
18640
19411
  if (!isLoadFinish)
@@ -18655,20 +19426,17 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18655
19426
  break;
18656
19427
  default:
18657
19428
  if (isPause) {
18658
- 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)) {
18659
- videoRef.current.currentTime = scene === null || scene === void 0 ? void 0 : scene.startTime;
18660
- }
18661
- (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
19429
+ (_d = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
18662
19430
  }
18663
19431
  else {
18664
- (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.pause();
19432
+ (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
18665
19433
  }
18666
19434
  setIsPauseVideo(!isPause);
18667
19435
  break;
18668
19436
  }
18669
19437
  }, [isLoadFinish, videoRef === null || videoRef === void 0 ? void 0 : videoRef.current]);
18670
19438
  const handlePause = React.useCallback(() => {
18671
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
19439
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
18672
19440
  if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
18673
19441
  return;
18674
19442
  if (activeIndex !== index)
@@ -18684,14 +19452,15 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18684
19452
  eventSubject: 'playOverVideo',
18685
19453
  eventDescription: 'User finished playing the video',
18686
19454
  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 : '',
18687
- 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 : '',
19455
+ 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 : '',
19456
+ 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 : '',
18688
19457
  endTime: videoCurrentTime,
18689
19458
  videoDuration,
18690
19459
  playDuration,
18691
- 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 : []),
19460
+ 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 : []),
18692
19461
  position: index + '',
18693
19462
  contentFormat: 'video',
18694
- traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
19463
+ traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
18695
19464
  }
18696
19465
  });
18697
19466
  }
@@ -18699,27 +19468,8 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18699
19468
  const handleWaiting = React.useCallback(() => {
18700
19469
  setWaiting(true);
18701
19470
  }, []);
18702
- const handleTimeUpload = () => {
18703
- if (!videoRef.current || !isDiyH5)
18704
- return;
18705
- setTimeout(() => {
18706
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
18707
- 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)) {
18708
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
18709
- if (!loopPlayRef.current)
18710
- return;
18711
- if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
18712
- (_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);
18713
- }
18714
- else {
18715
- 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;
18716
- (_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);
18717
- }
18718
- }
18719
- });
18720
- };
18721
19471
  React.useEffect(() => {
18722
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
19472
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18723
19473
  if (!isActive)
18724
19474
  return;
18725
19475
  const videoSrc = videoUrl;
@@ -18740,7 +19490,6 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18740
19490
  hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
18741
19491
  hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
18742
19492
  var _a;
18743
- setCurrentTimeByStartTime();
18744
19493
  (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
18745
19494
  });
18746
19495
  }
@@ -18754,12 +19503,11 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18754
19503
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.addEventListener('play', handleStartPlay);
18755
19504
  (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.addEventListener('playing', handlePlaying);
18756
19505
  (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.addEventListener('pause', handlePause);
18757
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handlePlay);
19506
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.addEventListener('ended', handleEnd);
18758
19507
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.addEventListener('canplay', handlePlay);
18759
19508
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.addEventListener('waiting', handleWaiting);
18760
- (_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.addEventListener('timeupdate', handleTimeUpload);
18761
19509
  return () => {
18762
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
19510
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
18763
19511
  const isPause = (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
18764
19512
  if (!isPause)
18765
19513
  handlePause();
@@ -18771,10 +19519,9 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18771
19519
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.removeEventListener('play', handleStartPlay);
18772
19520
  (_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.removeEventListener('playing', handlePlaying);
18773
19521
  (_g = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _g === void 0 ? void 0 : _g.removeEventListener('pause', handlePause);
18774
- (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handlePlay);
19522
+ (_h = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _h === void 0 ? void 0 : _h.removeEventListener('ended', handleEnd);
18775
19523
  (_j = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _j === void 0 ? void 0 : _j.removeEventListener('canplay', handlePlay);
18776
19524
  (_k = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _k === void 0 ? void 0 : _k.removeEventListener('waiting', handleWaiting);
18777
- (_l = videoRef.current) === null || _l === void 0 ? void 0 : _l.removeEventListener('timeupdate', handleTimeUpload);
18778
19525
  };
18779
19526
  }, [isActive]);
18780
19527
  React.useEffect(() => {
@@ -18989,19 +19736,45 @@ const Picture = (props) => {
18989
19736
  }, onLoad: onShowFirstImage }))));
18990
19737
  };
18991
19738
 
18992
- const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
19739
+ const PictureGroup$4 = React.forwardRef(({ imgUrls, data, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig, swiperRef }, ref) => {
18993
19740
  var _a, _b;
18994
19741
  const { isActive } = useSwiperSlide();
18995
- const { sxpParameter, openHashtag } = useSxpDataSource();
19742
+ const { firstRtcList, openHashtag, isDiyH5 } = useSxpDataSource();
18996
19743
  const [isLoad, setIsLoad] = React.useState(false);
18997
19744
  const [imgInfo, setImgInfo] = React.useState();
18998
19745
  const [swiperActiveIndex, setSwiperActiveIndex] = React.useState(0);
18999
- const swiperRef = React.useRef();
19746
+ const imgsSwiperRef = React.useRef();
19000
19747
  const isFirstPlayRef = React.useRef(true);
19748
+ const loopPlayRef = React.useRef(true);
19001
19749
  const initTime = new Date();
19750
+ React.useImperativeHandle(ref, () => {
19751
+ return {
19752
+ setLoopPlay(v) {
19753
+ loopPlayRef.current = v;
19754
+ }
19755
+ };
19756
+ });
19757
+ React.useEffect(() => {
19758
+ let timerId;
19759
+ if (isLoad && isActive && isDiyH5) {
19760
+ timerId = setTimeout(() => {
19761
+ var _a, _b, _c, _d;
19762
+ if (!loopPlayRef.current)
19763
+ return;
19764
+ if (firstRtcList && index < (firstRtcList === null || firstRtcList === void 0 ? void 0 : firstRtcList.length) - 1) {
19765
+ 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;
19766
+ (_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);
19767
+ }
19768
+ }, 3000);
19769
+ }
19770
+ return () => {
19771
+ if (timerId)
19772
+ clearTimeout(timerId);
19773
+ };
19774
+ }, [isLoad, isActive, isDiyH5, index, swiperRef, firstRtcList]);
19002
19775
  React.useEffect(() => {
19003
19776
  if (isLoad && isActive) {
19004
- (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.start();
19777
+ (imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.start();
19005
19778
  if (openHashtag) {
19006
19779
  onViewImageEndEvent(rec);
19007
19780
  }
@@ -19011,7 +19784,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
19011
19784
  }
19012
19785
  }
19013
19786
  else {
19014
- (swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) && swiperRef.current.swiper.autoplay.stop();
19787
+ (imgsSwiperRef === null || imgsSwiperRef === void 0 ? void 0 : imgsSwiperRef.current) && imgsSwiperRef.current.swiper.autoplay.stop();
19015
19788
  }
19016
19789
  }, [rec, isActive, onViewImageEndEvent, openHashtag, index, onViewImageStartEvent, isLoad, imgInfo]);
19017
19790
  const showFirstImageFn = React.useCallback((e) => __awaiter(void 0, void 0, void 0, function* () {
@@ -19038,13 +19811,13 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
19038
19811
  };
19039
19812
  }, [isActive, imgInfo]);
19040
19813
  const handleMouseEnter = React.useCallback(() => {
19041
- if (swiperRef.current && swiperRef.current.swiper && isAlly) {
19042
- swiperRef.current.swiper.autoplay.stop();
19814
+ if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
19815
+ imgsSwiperRef.current.swiper.autoplay.stop();
19043
19816
  }
19044
19817
  }, []);
19045
19818
  const handleMouseLeave = React.useCallback(() => {
19046
- if (swiperRef.current && swiperRef.current.swiper && isAlly) {
19047
- swiperRef.current.swiper.autoplay.start();
19819
+ if (imgsSwiperRef.current && imgsSwiperRef.current.swiper && isAlly) {
19820
+ imgsSwiperRef.current.swiper.autoplay.start();
19048
19821
  }
19049
19822
  }, []);
19050
19823
  const handleSlideChange = React.useCallback((swiper) => {
@@ -19065,7 +19838,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
19065
19838
  enabled: true
19066
19839
  }
19067
19840
  }
19068
- : {}), { loop: true, ref: swiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
19841
+ : {}), { loop: true, ref: imgsSwiperRef, onSlideChange: handleSlideChange, className: css.css(Object.assign(Object.assign({ '.swiper-pagination': {
19069
19842
  bottom: (_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.marginBottom) !== null && _a !== void 0 ? _a : 0,
19070
19843
  fontSize: '14px'
19071
19844
  } }, ((imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.dotsBgColor) && {
@@ -19082,7 +19855,7 @@ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
19082
19855
  return (React.createElement(SwiperSlide, { key: srcKey, "aria-hidden": srcKey !== swiperActiveIndex },
19083
19856
  React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
19084
19857
  }))));
19085
- };
19858
+ });
19086
19859
  var PictureGroup$5 = React.memo(PictureGroup$4);
19087
19860
 
19088
19861
  /*
@@ -19374,7 +20147,7 @@ var NavBack$1 = React.memo(NavBack);
19374
20147
  * @Author: binruan@chatlabs.com
19375
20148
  * @Date: 2024-03-20 10:27:31
19376
20149
  * @LastEditors: binruan@chatlabs.com
19377
- * @LastEditTime: 2025-05-09 15:51:40
20150
+ * @LastEditTime: 2025-05-12 14:26:15
19378
20151
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
19379
20152
  *
19380
20153
  */
@@ -19395,6 +20168,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19395
20168
  const [pageNum, setPageNum] = React.useState(2);
19396
20169
  React.useState(false);
19397
20170
  const videoWidgetRef = React.useRef(null);
20171
+ const pictureGroupRef = React.useRef(null);
19398
20172
  const fbcRef = React.useRef('');
19399
20173
  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();
19400
20174
  const { backMainFeed, productView, jumpToWeb } = useEventReport();
@@ -19444,7 +20218,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19444
20218
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
19445
20219
  }, [data, ctaType, swiperRef]);
19446
20220
  const handleSessionCompleted = React.useCallback((fk) => {
19447
- 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;
20221
+ 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;
19448
20222
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19449
20223
  let fromKName = '';
19450
20224
  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))) {
@@ -19471,22 +20245,23 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19471
20245
  eventSubject: 'sessionCompleted',
19472
20246
  eventDescription: 'Session completed',
19473
20247
  contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
19474
- productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
20248
+ 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 : '',
20249
+ productId: (_r = item === null || item === void 0 ? void 0 : item.product) === null || _r === void 0 ? void 0 : _r.itemId,
19475
20250
  position: activeIndex + '',
19476
20251
  fromKName: fk || fromKName,
19477
20252
  fromKPage: location === null || location === void 0 ? void 0 : location.href,
19478
- 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 : '',
19479
- 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 : ''
20253
+ 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 : '',
20254
+ 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 : ''
19480
20255
  }
19481
20256
  });
19482
- 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);
20257
+ 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);
19483
20258
  if (!popupDetailData) {
19484
20259
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19485
20260
  eventName: 'ExitFeed',
19486
- 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] : [],
20261
+ 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] : [],
19487
20262
  rec: item,
19488
20263
  position: activeIndex,
19489
- 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 : '',
20264
+ 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 : '',
19490
20265
  view_time: new Date() - viewTime.current
19491
20266
  });
19492
20267
  }
@@ -19546,8 +20321,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19546
20321
  refreshFeSession
19547
20322
  ]);
19548
20323
  const handleSessionExpire = React.useCallback(lodash.debounce(() => {
19549
- var _a;
20324
+ var _a, _b;
19550
20325
  (_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
20326
+ (_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
19551
20327
  refreshFeSession === null || refreshFeSession === void 0 ? void 0 : refreshFeSession(false, handleSessionCompleted);
19552
20328
  }, 1000), [handleSessionCompleted, refreshFeSession]);
19553
20329
  React.useEffect(() => {
@@ -19618,18 +20394,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19618
20394
  return null;
19619
20395
  }, [globalConfig, activeIndex, visList]);
19620
20396
  const renderContent = React.useCallback((rec, index) => {
19621
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
20397
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
19622
20398
  if (rec === 'organic menu') {
19623
20399
  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)));
19624
20400
  }
19625
- if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
20401
+ 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)) {
19626
20402
  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 })));
19627
20403
  }
19628
- if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
19629
- 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 }));
20404
+ if ((_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) {
20405
+ 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 })));
19630
20406
  }
19631
- 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) {
19632
- return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
20407
+ 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) {
20408
+ return (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _m === void 0 ? void 0 : _m.map((value, idx) => {
19633
20409
  var _a, _b, _c, _d, _e, _f, _g, _h;
19634
20410
  const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
19635
20411
  const Component = withBindDataSource(t);
@@ -19668,7 +20444,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19668
20444
  };
19669
20445
  }, [isShowMore]);
19670
20446
  const renderBottom = React.useCallback((rec, index) => {
19671
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
20447
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
19672
20448
  if (rec === null || rec === void 0 ? void 0 : rec.video) {
19673
20449
  let cta = null;
19674
20450
  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) {
@@ -19677,24 +20453,27 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19677
20453
  else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
19678
20454
  cta = '商品CTA';
19679
20455
  }
20456
+ 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)) {
20457
+ cta = '服务CTA';
20458
+ }
19680
20459
  else {
19681
- 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;
20460
+ 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;
19682
20461
  }
19683
20462
  const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
19684
20463
  const isNineProduct = (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.nineProductEnable) &&
19685
20464
  index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 1 : 0) &&
19686
- ((_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));
20465
+ ((_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));
19687
20466
  return (React.createElement(React.Fragment, null,
19688
20467
  isNineProduct && (React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, isNineProduct: isNineProduct })),
19689
- ((_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' }),
19690
- 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` } },
20468
+ ((_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' }),
20469
+ 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` } },
19691
20470
  React.createElement(Nudge, { nudge: nudge }),
19692
20471
  ((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' },
19693
20472
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, includesCtaType: [] }))) : null,
19694
20473
  React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
19695
- 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 }),
20474
+ 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 }),
19696
20475
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
19697
- 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) }))),
20476
+ 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) }))),
19698
20477
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
19699
20478
  }
19700
20479
  return null;
@@ -19736,7 +20515,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19736
20515
  return null;
19737
20516
  }, [globalConfig, waterFallData, bottomHeight]);
19738
20517
  const handleViewImageStartEnd = (item) => {
19739
- var _a, _b, _c, _d, _e, _f;
20518
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
19740
20519
  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)) {
19741
20520
  const endTime = Date.now();
19742
20521
  const duration = viewImageStartTime.current === 0 ? 0 : (endTime - viewImageStartTime.current) / 1000;
@@ -19745,10 +20524,11 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19745
20524
  eventSubject: 'viewImageCarouselEnd',
19746
20525
  eventDescription: 'User end view the image carousel',
19747
20526
  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 : '',
19748
- contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
20527
+ 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 : '',
20528
+ contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
19749
20529
  imageEndTime: `${endTime}`,
19750
20530
  playDuration: `${duration}`,
19751
- contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
20531
+ contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
19752
20532
  position: activeIndex + '',
19753
20533
  contentFormat: 'image',
19754
20534
  traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo
@@ -19757,7 +20537,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19757
20537
  }
19758
20538
  };
19759
20539
  const handleSlideSkip = (item, position) => {
19760
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
20540
+ 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;
19761
20541
  if (isPreview || waterFallData)
19762
20542
  return;
19763
20543
  const t = new Date() - curTime.current;
@@ -19783,7 +20563,8 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19783
20563
  contentTags: (product === null || product === void 0 ? void 0 : product.tags) ? JSON.stringify(product === null || product === void 0 ? void 0 : product.tags) : '',
19784
20564
  position: position + '',
19785
20565
  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 : '',
19786
- 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 : '',
20566
+ 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 : '',
20567
+ 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 : '',
19787
20568
  contentFormat
19788
20569
  }
19789
20570
  });
@@ -19793,7 +20574,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19793
20574
  }
19794
20575
  };
19795
20576
  const handleScrollEvent = (swiper) => {
19796
- 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;
20577
+ 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;
19797
20578
  const item = data[swiper.previousIndex];
19798
20579
  const activeItem = data[swiper.activeIndex];
19799
20580
  if (!item)
@@ -19826,11 +20607,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19826
20607
  eventSubject: 'scrollDown',
19827
20608
  eventDescription: 'User scroll down',
19828
20609
  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 : '',
19829
- 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 : '',
20610
+ 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 : '',
20611
+ 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 : '',
19830
20612
  requestId: null,
19831
- 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 : '',
20613
+ 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 : '',
19832
20614
  contentFormat,
19833
- position: ((_1 = swiper.previousIndex) !== null && _1 !== void 0 ? _1 : 0) + ''
20615
+ position: ((_4 = swiper.previousIndex) !== null && _4 !== void 0 ? _4 : 0) + ''
19834
20616
  }
19835
20617
  });
19836
20618
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
@@ -19843,12 +20625,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19843
20625
  eventInfo: {
19844
20626
  eventSubject: 'scrollUp',
19845
20627
  eventDescription: 'User scroll up',
19846
- 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 : '',
19847
- productId: (_5 = (_4 = item.product) === null || _4 === void 0 ? void 0 : _4.itemId) !== null && _5 !== void 0 ? _5 : '',
20628
+ 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 : '',
20629
+ 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 : '',
20630
+ productId: (_11 = (_10 = item.product) === null || _10 === void 0 ? void 0 : _10.itemId) !== null && _11 !== void 0 ? _11 : '',
19848
20631
  requestId: null,
19849
- 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 : '',
20632
+ 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 : '',
19850
20633
  contentFormat,
19851
- position: ((_10 = swiper.previousIndex) !== null && _10 !== void 0 ? _10 : 0) + ''
20634
+ position: ((_16 = swiper.previousIndex) !== null && _16 !== void 0 ? _16 : 0) + ''
19852
20635
  }
19853
20636
  });
19854
20637
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
@@ -19948,7 +20731,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19948
20731
  };
19949
20732
  }, [globalConfig, bffEventReport, data, activeIndex]);
19950
20733
  const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
19951
- var _a, _b, _c, _d, _e, _f, _g, _h;
20734
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
19952
20735
  const item = data[activeIndex];
19953
20736
  // 如果是图片集则上报事件
19954
20737
  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)) {
@@ -19959,9 +20742,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19959
20742
  eventSubject: 'viewImageCarouselStart',
19960
20743
  eventDescription: 'User start view the image carousel',
19961
20744
  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 : '',
19962
- contentName: (_e = item === null || item === void 0 ? void 0 : item.video.title) !== null && _e !== void 0 ? _e : '',
20745
+ 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 : '',
20746
+ contentName: (_h = item === null || item === void 0 ? void 0 : item.video.title) !== null && _h !== void 0 ? _h : '',
19963
20747
  imageStartTime: `${startTime}`,
19964
- contentTags: JSON.stringify((_f = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _f !== void 0 ? _f : []),
20748
+ contentTags: JSON.stringify((_j = item === null || item === void 0 ? void 0 : item.video.tags) !== null && _j !== void 0 ? _j : []),
19965
20749
  position: activeIndex + '',
19966
20750
  contentFormat: 'image',
19967
20751
  traceInfo: item === null || item === void 0 ? void 0 : item.video.traceInfo,
@@ -19971,13 +20755,13 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19971
20755
  if (enableCapi) {
19972
20756
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19973
20757
  eventName: 'ViewContent',
19974
- product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProducts,
20758
+ product: (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.bindProducts,
19975
20759
  rec: item,
19976
20760
  position: activeIndex
19977
20761
  });
19978
20762
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19979
20763
  eventName: 'PageView',
19980
- product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProducts,
20764
+ product: (_l = item === null || item === void 0 ? void 0 : item.video) === null || _l === void 0 ? void 0 : _l.bindProducts,
19981
20765
  rec: item,
19982
20766
  position: activeIndex
19983
20767
  });
@@ -20070,20 +20854,31 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
20070
20854
  React.createElement(Swiper, { style: {
20071
20855
  marginTop: tagHeight
20072
20856
  }, ref: swiperRef, onSlideChange: () => {
20073
- swiperRef.current.swiper.allowTouchMove = false;
20074
- setTimeout(() => {
20075
- swiperRef.current.swiper.allowTouchMove = true;
20076
- }, 500);
20857
+ var _a;
20858
+ if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
20859
+ swiperRef.current.swiper.allowTouchMove = false;
20860
+ setTimeout(() => {
20861
+ var _a;
20862
+ if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
20863
+ swiperRef.current.swiper.allowTouchMove = true;
20864
+ }
20865
+ }, 500);
20866
+ }
20077
20867
  }, onActiveIndexChange: (swiper) => {
20868
+ var _a, _b;
20078
20869
  setActiveIndex(swiper.activeIndex);
20079
20870
  if (openHashtag)
20080
20871
  return;
20081
20872
  // 处理上滑下滑事件
20082
20873
  handleScrollEvent(swiper);
20083
- if (waterFallData || isEditor || isDiyH5)
20874
+ if (waterFallData || isEditor)
20084
20875
  return;
20085
20876
  if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
20086
20877
  if (!isLoadMore) {
20878
+ if (isDiyH5) {
20879
+ (_a = videoWidgetRef.current) === null || _a === void 0 ? void 0 : _a.setLoopPlay(false);
20880
+ (_b = pictureGroupRef.current) === null || _b === void 0 ? void 0 : _b.setLoopPlay(false);
20881
+ }
20087
20882
  setIsLoadMore(true);
20088
20883
  loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
20089
20884
  var _a;
@@ -20156,7 +20951,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
20156
20951
  }, []);
20157
20952
  const PAUSE_ICON = useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
20158
20953
  const handlePlaying = React.useCallback(() => {
20159
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
20954
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
20160
20955
  setIsPauseVideo(false);
20161
20956
  const item = data[index];
20162
20957
  if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
@@ -20169,14 +20964,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
20169
20964
  eventSubject: 'playVideo',
20170
20965
  eventDescription: 'User played the video',
20171
20966
  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 : '',
20172
- 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 : '',
20967
+ 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 : '',
20968
+ 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 : '',
20173
20969
  playType,
20174
20970
  startTime: videoCurrentTime,
20175
20971
  videoDuration,
20176
- 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 : []),
20972
+ 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 : []),
20177
20973
  position: index + '',
20178
20974
  contentFormat: 'video',
20179
- traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
20975
+ traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
20180
20976
  }
20181
20977
  });
20182
20978
  setIsFirstPlay(false);
@@ -20215,7 +21011,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
20215
21011
  }
20216
21012
  }, [isLoadFinish]);
20217
21013
  const onPause = React.useCallback(() => {
20218
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
21014
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
20219
21015
  const item = data[index];
20220
21016
  const videoDuration = ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
20221
21017
  const videoCurrentTime = ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
@@ -20226,14 +21022,15 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
20226
21022
  eventSubject: 'playOverVideo',
20227
21023
  eventDescription: 'User finished playing the video',
20228
21024
  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 : '',
20229
- 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 : '',
21025
+ 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 : '',
21026
+ 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 : '',
20230
21027
  endTime: videoCurrentTime,
20231
21028
  videoDuration,
20232
21029
  playDuration,
20233
- 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 : []),
21030
+ 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 : []),
20234
21031
  position: index + '',
20235
21032
  contentFormat: 'video',
20236
- traceInfo: (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.traceInfo
21033
+ traceInfo: (_r = item === null || item === void 0 ? void 0 : item.video) === null || _r === void 0 ? void 0 : _r.traceInfo
20237
21034
  }
20238
21035
  });
20239
21036
  }
@@ -20959,10 +21756,16 @@ const DiyStoryPreview = React.forwardRef(({ data = [], globalConfig, tipText, nu
20959
21756
  // className={style['clc-sxp-container']}
20960
21757
  style: { height: containerHeight, position: 'relative', pointerEvents } },
20961
21758
  React.createElement(Swiper, { ref: swiperRef, allowTouchMove: pointerEvents !== 'none', onSlideChange: () => {
20962
- swiperRef.current.swiper.allowTouchMove = false;
20963
- setTimeout(() => {
20964
- swiperRef.current.swiper.allowTouchMove = true;
20965
- }, 500);
21759
+ var _a;
21760
+ if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
21761
+ swiperRef.current.swiper.allowTouchMove = false;
21762
+ setTimeout(() => {
21763
+ var _a;
21764
+ if ((_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) {
21765
+ swiperRef.current.swiper.allowTouchMove = true;
21766
+ }
21767
+ }, 500);
21768
+ }
20966
21769
  }, onActiveIndexChange: (swiper) => {
20967
21770
  setCurIndex(swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex);
20968
21771
  onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
@@ -21118,6 +21921,7 @@ exports.DiyPortalPreview = index$2;
21118
21921
  exports.DiyStoryPreview = index$1;
21119
21922
  exports.EditorDataProvider = EditorDataProvider;
21120
21923
  exports.Modal = Modal$1;
21924
+ exports.StructurePage = StructurePage;
21121
21925
  exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
21122
21926
  exports.SxpPageCore = index;
21123
21927
  exports.SxpPageRender = SxpPageRender$1;