pb-sxp-ui 1.15.12-alpha.8 → 1.15.13-alpha.2

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 (43) hide show
  1. package/dist/index.cjs +666 -56
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +664 -55
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +6 -6
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +6 -6
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +666 -56
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +6 -6
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/DiyStoryPreview/PictureGroup.d.ts +16 -0
  14. package/es/core/components/DiyStoryPreview/PictureGroup.js +34 -0
  15. package/es/core/components/DiyStoryPreview/VideoWidget.d.ts +17 -0
  16. package/es/core/components/DiyStoryPreview/VideoWidget.js +196 -0
  17. package/es/core/components/DiyStoryPreview/index.d.ts +28 -0
  18. package/es/core/components/DiyStoryPreview/index.js +377 -0
  19. package/es/core/components/SxpPageRender/ExpandableText.js +10 -2
  20. package/es/core/components/SxpPageRender/RenderCard.js +4 -4
  21. package/es/core/context/SxpDataSourceProvider.js +5 -17
  22. package/es/index.d.ts +1 -0
  23. package/es/index.js +1 -0
  24. package/es/materials/sxp/template/MultiCommodity/index.js +1 -1
  25. package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -1
  26. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -1
  27. package/es/materials/sxp/template/components/EventProvider.js +2 -2
  28. package/lib/core/components/DiyStoryPreview/PictureGroup.d.ts +16 -0
  29. package/lib/core/components/DiyStoryPreview/PictureGroup.js +37 -0
  30. package/lib/core/components/DiyStoryPreview/VideoWidget.d.ts +17 -0
  31. package/lib/core/components/DiyStoryPreview/VideoWidget.js +199 -0
  32. package/lib/core/components/DiyStoryPreview/index.d.ts +28 -0
  33. package/lib/core/components/DiyStoryPreview/index.js +380 -0
  34. package/lib/core/components/SxpPageRender/ExpandableText.js +10 -2
  35. package/lib/core/components/SxpPageRender/RenderCard.js +4 -4
  36. package/lib/core/context/SxpDataSourceProvider.js +5 -17
  37. package/lib/index.d.ts +1 -0
  38. package/lib/index.js +3 -1
  39. package/lib/materials/sxp/template/MultiCommodity/index.js +1 -1
  40. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -1
  41. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -1
  42. package/lib/materials/sxp/template/components/EventProvider.js +2 -2
  43. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -44,7 +44,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
44
44
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
45
  PERFORMANCE OF THIS SOFTWARE.
46
46
  ***************************************************************************** */
47
- /* global Reflect, Promise, SuppressedError, Symbol */
47
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
48
48
 
49
49
 
50
50
  function __rest(s, e) {
@@ -747,12 +747,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
747
747
  // Beacon API 用于发送异步和非阻塞请求到服务器。这类请求不需要响应。
748
748
  if (options.type === 'beacon' && navigator.sendBeacon) {
749
749
  return navigator.sendBeacon(`${url}/api/${path}`, new Blob([
750
- JSON.stringify({
751
- body: btoa(encodeURIComponent(JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))))
752
- })
753
- ], {
754
- type: 'application/json;charset=UTF-8'
755
- }));
750
+ JSON.stringify(Object.assign(Object.assign(Object.assign({}, options.body), bffDataSource.headers), { 'x-user-id': fakeUserId }))
751
+ ], { type: 'application/json;charset=UTF-8' }));
756
752
  }
757
753
  return window
758
754
  .fetch(`${url}/api/${path}`, {
@@ -913,7 +909,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
913
909
  console.log('userInfo:', userInfo);
914
910
  console.log('eventInfo:', ef);
915
911
  console.log('========= 结束 =========');
916
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/cld/${(_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
912
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/CLD/${(_b = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _b === void 0 ? void 0 : _b['x-app-id']}/${eventInfo === null || eventInfo === void 0 ? void 0 : eventInfo.eventSubject}`, {
917
913
  method: 'POST',
918
914
  body: { userInfo: realUserInfo, eventInfo: realEventInfo },
919
915
  type: 'beacon'
@@ -929,7 +925,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
929
925
  bffDataSource
930
926
  ]);
931
927
  const bffFbReport = React.useCallback(({ eventName, product }) => {
932
- var _a, _b, _c, _d, _e, _f, _g;
928
+ var _a, _b, _c, _d, _e, _f;
933
929
  if (!enableReportEvent ||
934
930
  !enabledMetaConversionApi ||
935
931
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
@@ -993,15 +989,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
993
989
  }
994
990
  };
995
991
  getEventParams(jsonParams);
996
- const params = {};
997
- const queryString = location.search.slice(1);
998
- (_f = splitUrlParams(queryString)) === null || _f === void 0 ? void 0 : _f.map((val) => {
999
- const key = val.split('=')[0];
1000
- const value = val.split('=')[1];
1001
- params[key] = value;
1002
- });
1003
- const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
1004
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_g = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _g === void 0 ? void 0 : _g['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
992
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/FB/${(_f = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _f === void 0 ? void 0 : _f['x-app-id']}/${eventName}`, {
1005
993
  method: 'POST',
1006
994
  body: jsonParams,
1007
995
  type: 'beacon'
@@ -1498,7 +1486,7 @@ const EditorCore = React.forwardRef(({ children, resolver, isSsr, schema, enable
1498
1486
  React.createElement(DataSourceProvider$1, { isSsr: isSsr, enable: enableDataSource }, children)));
1499
1487
  });
1500
1488
 
1501
- var index$2 = /*#__PURE__*/Object.freeze({
1489
+ var index$3 = /*#__PURE__*/Object.freeze({
1502
1490
  __proto__: null,
1503
1491
  EditorCore: EditorCore
1504
1492
  });
@@ -10118,7 +10106,15 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
10118
10106
  wordBreak: 'break-word'
10119
10107
  }, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
10120
10108
  React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
10121
- text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
10109
+ text && isPost && isShow && (React.createElement("button", { "aria-label": isShowMore ? unfoldText || 'show less' : foldText || 'show more', style: {
10110
+ textDecoration: 'underline',
10111
+ cursor: 'pointer',
10112
+ outline: 'none',
10113
+ border: 'none',
10114
+ boxSizing: 'content-box',
10115
+ padding: 0,
10116
+ background: 'transparent'
10117
+ }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
10122
10118
  __html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', style)
10123
10119
  } }))));
10124
10120
  };
@@ -12476,7 +12472,7 @@ const EventProvider = (_a) => {
12476
12472
  const handleClick = lodash.throttle((e) => {
12477
12473
  var _a, _b, _c, _d, _e, _f;
12478
12474
  e.preventDefault();
12479
- const item = multItem ? multItem : (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
12475
+ const item = multItem || ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video);
12480
12476
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12481
12477
  eventSubject: 'clickCta',
12482
12478
  eventDescription: 'User clicked the CTA'
@@ -12503,7 +12499,7 @@ const EventProvider = (_a) => {
12503
12499
  setElement(null);
12504
12500
  }
12505
12501
  }, [element, popup]);
12506
- return (React.createElement("button", { ref: ref, className: className, style: Object.assign({ display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
12502
+ return (React.createElement("button", { ref: ref, className: className, style: Object.assign({ outline: 'none', border: 'none', boxSizing: 'content-box', padding: 0, background: 'transparent', display: 'flex', alignItems: 'normal' }, style), onClick: handleClick, role: 'button', "aria-label": 'CTA', tabIndex: 0 }, children));
12507
12503
  };
12508
12504
  var EventProvider$1 = React.memo(EventProvider);
12509
12505
 
@@ -13099,6 +13095,7 @@ const MultiCommodityDiro$1 = (_a) => {
13099
13095
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
13100
13096
  const { sxpParameter } = useSxpDataSource();
13101
13097
  const [products] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
13098
+ console.log(recData, '222');
13102
13099
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
13103
13100
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
13104
13101
  return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css.css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
@@ -13305,6 +13302,7 @@ const MultiCommodityDiroNew$1 = (_a) => {
13305
13302
  var { content, style, bgImg, recData, bottom_image, ctaTempStyles, translateY = 0, isActive, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "translateY", "isActive", "index"]);
13306
13303
  const { sxpParameter } = useSxpDataSource();
13307
13304
  const [products] = React.useState((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
13305
+ console.log(recData, '333');
13308
13306
  return (React.createElement(Scroll$1, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, itemIndex) => {
13309
13307
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
13310
13308
  return (React.createElement(React.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (React.createElement(SwiperSlide, { key: itemIndex, className: css.css(Object.assign(Object.assign({}, style), { flexShrink: 0, marginLeft: 0, marginRight: '8px' })), tag: 'li', role: 'listitem' },
@@ -17580,15 +17578,15 @@ var _materials_ = /*#__PURE__*/Object.freeze({
17580
17578
  Swipe: Swipe
17581
17579
  });
17582
17580
 
17583
- const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
17584
- const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
17581
+ const defaultUnLikeIconPath$2 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
17582
+ const defaultLikeIconPath$2 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
17585
17583
  const LikeButton = (_a) => {
17586
17584
  var _b;
17587
17585
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
17588
17586
  const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
17589
17587
  const [state, setState] = React.useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
17590
- const likeIcon = useIconLink(defaultLikeIconPath$1);
17591
- const unlikeIcon = useIconLink(defaultUnLikeIconPath$1);
17588
+ const likeIcon = useIconLink(defaultLikeIconPath$2);
17589
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
17592
17590
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
17593
17591
  var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
17594
17592
  if (state) {
@@ -17679,7 +17677,7 @@ const mountVideoPlayerAtNode = (() => {
17679
17677
  };
17680
17678
  })();
17681
17679
 
17682
- const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon }) => {
17680
+ const VideoWidget$4 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoPlayIcon }) => {
17683
17681
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
17684
17682
  const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
17685
17683
  const videoStartTime = React.useRef(0);
@@ -18024,7 +18022,7 @@ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPost
18024
18022
  renderLoading,
18025
18023
  isPauseVideo && React.createElement(FormatImage$1, { className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))));
18026
18024
  };
18027
- var VideoWidget$3 = React.memo(VideoWidget$2);
18025
+ var VideoWidget$5 = React.memo(VideoWidget$4);
18028
18026
 
18029
18027
  const ToggleButton = ({ defaultValue, activeIcon, unactiveIcon, onChange, style }) => {
18030
18028
  const [isTrue, setIsTure] = React.useState(defaultValue);
@@ -18113,7 +18111,7 @@ const Picture = (props) => {
18113
18111
  }, onLoad: onShowFirstImage }))));
18114
18112
  };
18115
18113
 
18116
- const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
18114
+ const PictureGroup$4 = ({ imgUrls, width, height, rec, index, onViewImageEndEvent, onViewImageStartEvent, imgUrlsPostConfig }) => {
18117
18115
  var _a, _b;
18118
18116
  const { isActive } = useSwiperSlide();
18119
18117
  const { sxpParameter, openHashtag } = useSxpDataSource();
@@ -18207,7 +18205,7 @@ const PictureGroup$2 = ({ imgUrls, width, height, rec, index, onViewImageEndEven
18207
18205
  React.createElement(Picture, { src: !isLoad && srcKey > 0 ? '' : url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: showFirstImageFn })));
18208
18206
  }))));
18209
18207
  };
18210
- var PictureGroup$3 = React.memo(PictureGroup$2);
18208
+ var PictureGroup$5 = React.memo(PictureGroup$4);
18211
18209
 
18212
18210
  /*
18213
18211
  * @Author: binruan@chatlabs.com
@@ -18323,7 +18321,7 @@ function withBindDataSource(Component) {
18323
18321
  * @Author: binruan@chatlabs.com
18324
18322
  * @Date: 2023-12-26 16:11:34
18325
18323
  * @LastEditors: binruan@chatlabs.com
18326
- * @LastEditTime: 2024-10-31 10:30:55
18324
+ * @LastEditTime: 2025-03-26 19:32:00
18327
18325
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\RenderCard.tsx
18328
18326
  *
18329
18327
  */
@@ -18333,10 +18331,10 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
18333
18331
  return null;
18334
18332
  const renderComp = React.useMemo(() => {
18335
18333
  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;
18336
- //如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
18334
+ // 如果includesCtaType有值,则只渲染includesCtaType包含的cta类型组件,用于在页面某处只显示某一组件
18337
18335
  if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
18338
18336
  return;
18339
- //默认不渲染category为cta类型的组件,该类型的组件只用于某一处
18337
+ // 默认不渲染category为cta类型的组件,该类型的组件只用于某一处
18340
18338
  if (!includesCtaType && ((_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.category) === 'cta')
18341
18339
  return;
18342
18340
  if ((((_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.type) === 'CommodityDiro' && !((_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindProduct)) ||
@@ -18353,10 +18351,10 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
18353
18351
  const Component = withBindDataSource(t);
18354
18352
  const defaulSetting = (_u = t === null || t === void 0 ? void 0 : t.extend) === null || _u === void 0 ? void 0 : _u.defaulSetting;
18355
18353
  const isExternalLink = ((_x = (_w = (_v = value === null || value === void 0 ? void 0 : value.item) === null || _v === void 0 ? void 0 : _v.event) === null || _w === void 0 ? void 0 : _w.onClick) === null || _x === void 0 ? void 0 : _x.linkType) === 'externalLink';
18356
- let style = lodash.cloneDeep((_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.style);
18354
+ const style = lodash.cloneDeep((_y = value === null || value === void 0 ? void 0 : value.item) === null || _y === void 0 ? void 0 : _y.style);
18357
18355
  if (style.hasOwnProperty('backdropFilter')) {
18358
- let sbf = style['backdropFilter'];
18359
- style['backdropFilter'] = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
18356
+ const sbf = style.backdropFilter;
18357
+ style.backdropFilter = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
18360
18358
  }
18361
18359
  return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
18362
18360
  }
@@ -18717,10 +18715,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
18717
18715
  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)));
18718
18716
  }
18719
18717
  if ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.url) {
18720
- return (React.createElement(VideoWidget$3, { key: isReload, 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 }));
18718
+ return (React.createElement(VideoWidget$5, { key: isReload, 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 }));
18721
18719
  }
18722
18720
  if ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.imgUrls) {
18723
- return (React.createElement(PictureGroup$3, { 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 }));
18721
+ 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 }));
18724
18722
  }
18725
18723
  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) {
18726
18724
  return (_k = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _k === void 0 ? void 0 : _k.map((value, idx) => {
@@ -19090,7 +19088,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19090
19088
  };
19091
19089
  var SxpPageRender$1 = React.memo(SxpPageRender);
19092
19090
 
19093
- const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
19091
+ const PictureGroup$2 = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index }) => {
19094
19092
  return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
19095
19093
  clickable: true,
19096
19094
  bulletActiveClass: 'swipe-item-active-bullet',
@@ -19100,9 +19098,9 @@ const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index })
19100
19098
  React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig })));
19101
19099
  })));
19102
19100
  };
19103
- var PictureGroup$1 = React.memo(PictureGroup);
19101
+ var PictureGroup$3 = React.memo(PictureGroup$2);
19104
19102
 
19105
- const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
19103
+ const VideoWidget$2 = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width }) => {
19106
19104
  const [isPauseVideo, setIsPauseVideo] = React.useState(false);
19107
19105
  const videoRef = React.useRef(null);
19108
19106
  const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
@@ -19332,14 +19330,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
19332
19330
  renderPoster,
19333
19331
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'video pause image' })))));
19334
19332
  };
19335
- var VideoWidget$1 = React.memo(VideoWidget);
19333
+ var VideoWidget$3 = React.memo(VideoWidget$2);
19336
19334
 
19337
- const RESOLVER$1 = {};
19335
+ const RESOLVER$2 = {};
19338
19336
  Object.values(_materials_).forEach((v) => {
19339
- RESOLVER$1[v.extend.type] = v;
19337
+ RESOLVER$2[v.extend.type] = v;
19340
19338
  });
19341
- const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
19342
- const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
19339
+ const defaultUnLikeIconPath$1 = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
19340
+ const defaultLikeIconPath$1 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
19343
19341
  const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [] }) => {
19344
19342
  const height = React.useMemo(() => {
19345
19343
  let minusHeight = 0;
@@ -19354,16 +19352,16 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
19354
19352
  const renderContent = (rec, index) => {
19355
19353
  var _a, _b, _c, _d;
19356
19354
  if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
19357
- return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: true, width: containerWidth, data: data !== null && data !== void 0 ? data : [], height: height, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
19355
+ return (React.createElement(VideoWidget$3, { rec: rec, index: index, muted: true, width: containerWidth, data: data !== null && data !== void 0 ? data : [], height: height, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost }));
19358
19356
  }
19359
19357
  if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
19360
- return (React.createElement(PictureGroup$1, { 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, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
19358
+ return (React.createElement(PictureGroup$3, { 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, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
19361
19359
  }
19362
19360
  if (rec.product) {
19363
19361
  if (rec.product && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _c === void 0 ? void 0 : _c.length) > 0) {
19364
19362
  return (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _d === void 0 ? void 0 : _d.map((value, idx) => {
19365
19363
  var _a, _b, _c, _d, _e, _f, _g, _h;
19366
- const t = RESOLVER$1[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
19364
+ const t = RESOLVER$2[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
19367
19365
  const Component = withBindDataSource(t);
19368
19366
  const defaulSetting = (_b = t === null || t === void 0 ? void 0 : t.extend) === null || _b === void 0 ? void 0 : _b.defaulSetting;
19369
19367
  return (React.createElement(Component, Object.assign({ key: `${index}${idx}`, textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_c = value === null || value === void 0 ? void 0 : value.item) === null || _c === void 0 ? void 0 : _c.textStyle), bindDatas: (_e = (_d = value === null || value === void 0 ? void 0 : value.item) === null || _d === void 0 ? void 0 : _d.bindDatas) !== null && _e !== void 0 ? _e : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.props, { event: ((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.event) || {},
@@ -19385,7 +19383,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
19385
19383
  const CTA = (rec, index) => {
19386
19384
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
19387
19385
  return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
19388
- React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1 })));
19386
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$2 })));
19389
19387
  }
19390
19388
  return null;
19391
19389
  };
@@ -19403,8 +19401,8 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
19403
19401
  }
19404
19402
  return null;
19405
19403
  };
19406
- const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
19407
- const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
19404
+ const likeIcon = useIconLink(defaultLikeIconPath$1, appDomain);
19405
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath$1, appDomain);
19408
19406
  const renderLikeButton = (rec, index) => {
19409
19407
  var _a, _b, _c, _d;
19410
19408
  if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
@@ -19452,7 +19450,618 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
19452
19450
  return renderView(rec, index);
19453
19451
  })));
19454
19452
  };
19455
- var index$1 = React.memo(DiyPortalPreview);
19453
+ var index$2 = React.memo(DiyPortalPreview);
19454
+
19455
+ const PictureGroup = ({ imgUrls, width, height, imgUrlsPostConfig, rec, index, swiperRef, data = [], loopPlay }) => {
19456
+ const { isActive } = useSwiperSlide();
19457
+ const [isload, setIsLoad] = React.useState(false);
19458
+ React.useEffect(() => {
19459
+ if (isActive && isload && loopPlay) {
19460
+ setTimeout(() => {
19461
+ var _a, _b, _c, _d;
19462
+ if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
19463
+ (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(0);
19464
+ }
19465
+ else {
19466
+ 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;
19467
+ (_d = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _d === void 0 ? void 0 : _d.swiper.slideTo(i + 1);
19468
+ }
19469
+ }, 3000);
19470
+ }
19471
+ }, [isActive, isload, data, index, swiperRef, loopPlay]);
19472
+ const loadFinishImage = () => {
19473
+ setIsLoad(true);
19474
+ };
19475
+ return (React.createElement(Swiper, { defaultValue: 0, direction: 'horizontal', modules: [Pagination, Autoplay], pagination: {
19476
+ clickable: true,
19477
+ bulletActiveClass: 'swipe-item-active-bullet',
19478
+ bulletElement: 'button'
19479
+ }, height: height, style: { width }, loop: true, autoplay: false }, imgUrls === null || imgUrls === void 0 ? void 0 : imgUrls.map((url) => {
19480
+ return (React.createElement(SwiperSlide, { key: url },
19481
+ React.createElement(Picture, { src: url, height: height, imgUrlsPostConfig: imgUrlsPostConfig, onShowFirstImage: loadFinishImage })));
19482
+ })));
19483
+ };
19484
+ var PictureGroup$1 = React.memo(PictureGroup);
19485
+
19486
+ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, width, swiperRef, loopPlay }) => {
19487
+ const { isActive } = useSwiperSlide();
19488
+ const [isPauseVideo, setIsPauseVideo] = React.useState(false);
19489
+ const videoRef = React.useRef(null);
19490
+ const { bffEventReport, sxpParameter, waterFallData, openHashtag } = useSxpDataSource();
19491
+ const videoStartTime = React.useRef(0);
19492
+ const [isLoadFinish, setIsLoadFinish] = React.useState(false);
19493
+ const [isFirstPlay, setIsFirstPlay] = React.useState(true);
19494
+ const canvasRef = React.useRef(null);
19495
+ const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
19496
+ const videoId = `pb-cache-video-${index}`;
19497
+ const hlsRef = React.useRef(null);
19498
+ React.useEffect(() => {
19499
+ if (!videoRef.current)
19500
+ return;
19501
+ videoRef.current.muted = muted;
19502
+ }, [muted]);
19503
+ React.useCallback(() => {
19504
+ var _a;
19505
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
19506
+ }, []);
19507
+ useIconLink('/pb_static/06f28a2025c74c1cb49be6767316d827.png');
19508
+ const handlePlaying = React.useCallback(() => {
19509
+ var _a, _b, _c, _d, _e, _f;
19510
+ setIsPauseVideo(false);
19511
+ const item = data[index];
19512
+ if (item && ((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.duration)) {
19513
+ videoStartTime.current = ((_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime) || 0;
19514
+ ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.duration) !== null && _d !== void 0 ? _d : 0).toFixed(2);
19515
+ ((_f = (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.currentTime) !== null && _f !== void 0 ? _f : 0).toFixed(2);
19516
+ setIsFirstPlay(false);
19517
+ }
19518
+ }, [bffEventReport, data, index, isFirstPlay]);
19519
+ const handleLoadedMetadata = React.useCallback(() => {
19520
+ var _a;
19521
+ videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
19522
+ (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
19523
+ setIsLoadFinish(true);
19524
+ }, []);
19525
+ React.useCallback((type) => () => {
19526
+ var _a, _b, _c, _d, _e;
19527
+ if (!isLoadFinish)
19528
+ return;
19529
+ const isPause = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.paused;
19530
+ switch (type) {
19531
+ case 'start':
19532
+ if (!isPause)
19533
+ return;
19534
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.play();
19535
+ setIsPauseVideo(false);
19536
+ break;
19537
+ case 'pause':
19538
+ if (isPause)
19539
+ return;
19540
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
19541
+ setIsPauseVideo(true);
19542
+ break;
19543
+ default:
19544
+ if (isPause) {
19545
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.play();
19546
+ }
19547
+ else {
19548
+ (_e = videoRef.current) === null || _e === void 0 ? void 0 : _e.pause();
19549
+ }
19550
+ setIsPauseVideo(!isPause);
19551
+ break;
19552
+ }
19553
+ }, [isLoadFinish]);
19554
+ React.useCallback(() => {
19555
+ var _a, _b, _c, _d, _e, _f;
19556
+ data[index];
19557
+ ((_b = (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0).toFixed(2);
19558
+ ((_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.currentTime) !== null && _d !== void 0 ? _d : 0).toFixed(2);
19559
+ if ((_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.duration) {
19560
+ (((_f = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _f === void 0 ? void 0 : _f.currentTime) - videoStartTime.current).toFixed(2);
19561
+ }
19562
+ }, [data, index, bffEventReport]);
19563
+ const blur = React.useMemo(() => {
19564
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
19565
+ }, [videoPostConfig]);
19566
+ React.useMemo(() => {
19567
+ var _a;
19568
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
19569
+ ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
19570
+ : 'translateY(-50%)';
19571
+ }, [videoPostConfig]);
19572
+ const handLoadeddata = React.useCallback(() => {
19573
+ if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
19574
+ return;
19575
+ const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
19576
+ const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
19577
+ const ctx = canvas.getContext('2d');
19578
+ const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
19579
+ const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
19580
+ canvas.height = targetHeight;
19581
+ canvas.width = targetWidth;
19582
+ ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
19583
+ setFirstFrameSrc(canvas.toDataURL());
19584
+ }, []);
19585
+ const handleTimeUpload = React.useCallback(() => {
19586
+ var _a, _b, _c;
19587
+ if (!videoRef.current)
19588
+ return;
19589
+ if (((_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.currentTime) >= ((_b = rec === null || rec === void 0 ? void 0 : rec.endTime) !== null && _b !== void 0 ? _b : 0)) {
19590
+ (_c = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _c === void 0 ? void 0 : _c.pause();
19591
+ }
19592
+ }, []);
19593
+ const handlePause = () => {
19594
+ var _a, _b, _c, _d, _e, _f;
19595
+ if (!videoRef.current || !isActive)
19596
+ return;
19597
+ if (!loopPlay)
19598
+ return;
19599
+ if (index === (data === null || data === void 0 ? void 0 : data.length) - 1) {
19600
+ (_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.slideTo(0);
19601
+ }
19602
+ else {
19603
+ const i = (_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.activeIndex;
19604
+ (_f = (_e = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _e === void 0 ? void 0 : _e.swiper) === null || _f === void 0 ? void 0 : _f.slideTo(i + 1);
19605
+ }
19606
+ };
19607
+ // useEffect(() => {
19608
+ // if (!videoRef.current) return;
19609
+ // if (!isActive) return;
19610
+ // if (!loopPlay) {
19611
+ // videoRef?.current?.pause();
19612
+ // } else {
19613
+ // videoRef?.current?.play();
19614
+ // }
19615
+ // }, [loopPlay, isActive]);
19616
+ React.useEffect(() => {
19617
+ var _a, _b, _c;
19618
+ if (!isActive)
19619
+ return;
19620
+ const videoSrc = rec === null || rec === void 0 ? void 0 : rec.mediaUrl;
19621
+ if (!videoSrc)
19622
+ return;
19623
+ setIsPauseVideo(false);
19624
+ const videoPlayerWrapperNode = document.querySelector(`#${videoId}`);
19625
+ if (!videoPlayerWrapperNode)
19626
+ return;
19627
+ videoRef.current = mountVideoPlayerAtNode === null || mountVideoPlayerAtNode === void 0 ? void 0 : mountVideoPlayerAtNode(videoPlayerWrapperNode);
19628
+ if (!(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current))
19629
+ return;
19630
+ const Hls = window === null || window === void 0 ? void 0 : window.Hls;
19631
+ let hls = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current;
19632
+ if (videoSrc.includes('.m3u8') && Hls && Hls.isSupported()) {
19633
+ hls = new Hls();
19634
+ hls === null || hls === void 0 ? void 0 : hls.loadSource(videoSrc);
19635
+ hls === null || hls === void 0 ? void 0 : hls.attachMedia(videoRef === null || videoRef === void 0 ? void 0 : videoRef.current);
19636
+ hls === null || hls === void 0 ? void 0 : hls.on(Hls.Events.MANIFEST_PARSED, function () {
19637
+ var _a;
19638
+ videoRef.current.currentTime = rec === null || rec === void 0 ? void 0 : rec.startTime;
19639
+ (_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
19640
+ });
19641
+ }
19642
+ else {
19643
+ videoRef.current.src = videoSrc;
19644
+ }
19645
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
19646
+ // videoRef.current?.addEventListener('playing', handlePlaying);
19647
+ // videoRef.current?.addEventListener('loadeddata', handLoadeddata);
19648
+ (_b = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('pause', handlePause);
19649
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('timeupdate', handleTimeUpload);
19650
+ return () => {
19651
+ var _a, _b, _c, _d;
19652
+ if (hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current)
19653
+ (_a = hlsRef === null || hlsRef === void 0 ? void 0 : hlsRef.current) === null || _a === void 0 ? void 0 : _a.destroy();
19654
+ setIsLoadFinish(false);
19655
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('loadedmetadata', handleLoadedMetadata);
19656
+ // videoRef.current?.removeEventListener('playing', handlePlaying);
19657
+ // videoRef.current?.removeEventListener('loadeddata', handLoadeddata);
19658
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('pause', handlePause);
19659
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('timeupdate', handleTimeUpload);
19660
+ };
19661
+ }, [handleLoadedMetadata, handlePlaying, rec, handLoadeddata, isActive, loopPlay]);
19662
+ React.useMemo(() => {
19663
+ if (!(sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image) || isLoadFinish) {
19664
+ return null;
19665
+ }
19666
+ return (React.createElement("img", { style: { position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', objectFit: 'cover' }, src: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, alt: 'video poster' }));
19667
+ }, [isLoadFinish, sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image]);
19668
+ React.useMemo(() => {
19669
+ return blur
19670
+ ? {
19671
+ filter: 'blur(10px)',
19672
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
19673
+ }
19674
+ : {};
19675
+ }, [blur]);
19676
+ if (!(rec === null || rec === void 0 ? void 0 : rec.mediaUrl)) {
19677
+ return null;
19678
+ }
19679
+ return (React.createElement("div", { className: 'video-container', key: rec.itemId, style: {
19680
+ position: 'relative',
19681
+ width: '100%',
19682
+ height,
19683
+ overflow: 'hidden',
19684
+ pointerEvents: 'none'
19685
+ } },
19686
+ React.createElement("div", { className: 'n-full-screen', id: videoId, style: { width: '100%', height: '100%' } })));
19687
+ };
19688
+ var VideoWidget$1 = React.memo(VideoWidget);
19689
+
19690
+ /*
19691
+ * @Author: binruan@chatlabs.com
19692
+ * @Date: 2025-03-25 13:54:27
19693
+ * @LastEditors: binruan@chatlabs.com
19694
+ * @LastEditTime: 2025-03-26 22:40:52
19695
+ * @FilePath: \pb-sxp-ui\src\core\components\DiyStoryPreview\index.tsx
19696
+ *
19697
+ */
19698
+ const RESOLVER$1 = {};
19699
+ Object.values(_materials_).forEach((v) => {
19700
+ RESOLVER$1[v.extend.type] = v;
19701
+ });
19702
+ const defaultUnLikeIconPath = '/pb_static/f71266d2c64446c5ae6a5a7f5489cc0a.png';
19703
+ const defaultLikeIconPath = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
19704
+ const recData = {
19705
+ position: 0,
19706
+ isCollected: false,
19707
+ product: null,
19708
+ video: {
19709
+ appId: null,
19710
+ itemId: 'VIDEOSsRgI1695278974368',
19711
+ title: '8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片8张尺寸不一样的图片',
19712
+ enTitle: null,
19713
+ icon: null,
19714
+ cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20231017/fsJFWmW1dGyW7XmDspbJPTn5esL3U1697538777398.png',
19715
+ link: null,
19716
+ linkTitle: null,
19717
+ linkType: null,
19718
+ menuCategoryId: null,
19719
+ remark: null,
19720
+ tags: [
19721
+ 'Gift-Giving',
19722
+ 'Daily Wear',
19723
+ 'Business Formal',
19724
+ 'Sports/Casual',
19725
+ 'Anniversary Gifts',
19726
+ 'Wedding/Engagement',
19727
+ 'Formal Dinner/Party'
19728
+ ],
19729
+ traceInfo: ':VIDEO:VIDEOSsRgI1695278974368:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19730
+ value: 385,
19731
+ weight: null,
19732
+ bindCta: null,
19733
+ bindProduct: null,
19734
+ bindProducts: [
19735
+ {
19736
+ appId: 'wx448578f8851f3dce',
19737
+ itemId: 'test02178888',
19738
+ title: 'christian dior小包包 新CDN',
19739
+ enTitle: null,
19740
+ icon: null,
19741
+ cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs2jqiurjftpoaba67iiwr9jt5sc31726213277754.avif',
19742
+ link: '/pages/details/index?spu_id=1702262707659534338',
19743
+ linkTitle: '',
19744
+ linkType: 'MP',
19745
+ menuCategoryId: null,
19746
+ remark: null,
19747
+ tags: [],
19748
+ traceInfo: ':PRODUCT:test02178888:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19749
+ value: null,
19750
+ weight: null,
19751
+ bindCta: {
19752
+ appId: 'wx448578f8851f3dce',
19753
+ itemId: 'CTA3KofE1716186622249',
19754
+ title: 'SHOP NOW 立即购买',
19755
+ enTitle: 'BUY NOW立即购买,选择你所喜爱的;',
19756
+ icon: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240520/fssfxbmiwghixmgblz9uriwennd2r1716186615574.avif',
19757
+ cover: null,
19758
+ link: '/pages/details/index?spu_id=1702262707659534338',
19759
+ linkTitle: '',
19760
+ linkType: 'MP',
19761
+ menuCategoryId: '64b60b202caf0e1c1ce1e17d',
19762
+ remark: null,
19763
+ tags: [
19764
+ "Woman's Perfumes",
19765
+ 'Plates & Bowls',
19766
+ 'Glasses',
19767
+ 'Multicolor',
19768
+ 'Carafes',
19769
+ 'Tea & Coffee',
19770
+ 'Green',
19771
+ 'Grey',
19772
+ 'Cutlery'
19773
+ ],
19774
+ traceInfo: ':CTA:CTA3KofE1716186622249:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19775
+ value: null,
19776
+ weight: null
19777
+ },
19778
+ collection: 'Ricco',
19779
+ currency: 'INR-₹',
19780
+ homePage: [
19781
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs2jqiurjftpoaba67iiwr9jt5sc31726213277754.avif',
19782
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fsr9ttuzuljs85smqi6lsidovnyoy1726213285994.avif',
19783
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fsknmfhx2lxukxews05guwwxr8rju1726213281108.avif',
19784
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20240913/fs0acnua4f1clamdpwdsrh0v5dgc61726213289247.avif'
19785
+ ],
19786
+ info: 'test',
19787
+ price: 53200,
19788
+ shippingInfo: null,
19789
+ taxInfo: null
19790
+ },
19791
+ {
19792
+ appId: null,
19793
+ itemId: '113J631A0684_C520',
19794
+ title: 'Sweatshirt à capuche Dior Oblique, coupe relax',
19795
+ enTitle: null,
19796
+ icon: null,
19797
+ cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fsaf0xq8vx8gkkl30y1h1swpinmbt1731661943891.avif',
19798
+ link: 'https://www.dior.com/fr_fr/fashion/products/113J631A0684_C520',
19799
+ linkTitle: null,
19800
+ linkType: 'WEB',
19801
+ menuCategoryId: null,
19802
+ remark: null,
19803
+ tags: [],
19804
+ traceInfo: ':PRODUCT:113J631A0684_C520:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19805
+ value: null,
19806
+ weight: null,
19807
+ bindCta: {
19808
+ appId: null,
19809
+ itemId: 'CTAAfaKf1730796437032',
19810
+ title: 'test',
19811
+ enTitle: 'test',
19812
+ icon: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241105/fsjblxoud2tmehpiqqomh0oktwqrd1730796431496.avif',
19813
+ cover: null,
19814
+ link: null,
19815
+ linkTitle: null,
19816
+ linkType: null,
19817
+ menuCategoryId: '64b60b202caf0e1c1ce1e17d',
19818
+ remark: '',
19819
+ tags: [],
19820
+ traceInfo: ':CTA:CTAAfaKf1730796437032:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19821
+ value: null,
19822
+ weight: null
19823
+ },
19824
+ collection: 'Jacquard de coton éponge bleu',
19825
+ currency: 'EUR-€',
19826
+ homePage: [
19827
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fsaf0xq8vx8gkkl30y1h1swpinmbt1731661943891.avif',
19828
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fszxkdcjfjql2oiy90ffbal5tsfd81731661964913.avif',
19829
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20241115/fs1jhd9jwxvfqmrbjwy5abfzb0fde1731661994996.avif'
19830
+ ],
19831
+ info: "Le sweatshirt à capuche bleu met à l'honneur l'emblématique motif dior oblique. Confectionné en jacquard de coton éponge bleu, il présente une coupe relax très confortable. Doté de poches latérales fendues, ce sweatshirt à capuche s'associera à tous vos jeans ou pantalons de survêtement pour un look décontracté.. Sweatshirt à capuche dior oblique, coupe relax Jacquard de coton éponge bleu",
19832
+ price: 1800,
19833
+ shippingInfo: null,
19834
+ taxInfo: null
19835
+ },
19836
+ {
19837
+ appId: null,
19838
+ itemId: 'S5573CRIW_M928',
19839
+ title: 'Mini Dior Book Tote',
19840
+ enTitle: null,
19841
+ icon: null,
19842
+ cover: 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsvewk9etrawxrzznmvvewgt1bctu1739415576729.avif',
19843
+ link: 'https://www.dior.com/en_gb/fashion/products/S5573CRIW_M928',
19844
+ linkTitle: null,
19845
+ linkType: 'WEB',
19846
+ menuCategoryId: null,
19847
+ remark: null,
19848
+ tags: ['ダイヤモンド'],
19849
+ traceInfo: ':PRODUCT:S5573CRIW_M928:regular:1:VPRHSkRS1697701789894:main::0:EXPMW20250305155940:COMBTh20250305160047:',
19850
+ value: null,
19851
+ weight: null,
19852
+ bindCta: null,
19853
+ collection: null,
19854
+ currency: 'GBP-£',
19855
+ homePage: [
19856
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsvewk9etrawxrzznmvvewgt1bctu1739415576729.avif',
19857
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsngtlvhid7xwt5if0viw7vqanm831739415582147.avif',
19858
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fs4hotdvyzjtnqb9vszlynuzplddc1739415586910.avif',
19859
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fswffx9kwexf3z3vcnxisut1qxtez1739415591629.avif',
19860
+ 'https://graff-cdn.chatlabs.net/dev/img/8922b5b8-a954-4a61-9ffc-80edebdf02b4/sxp-portal/20250213/fsbfsi7tttx1hnzldoiw7eoea7fvh1739415597388.avif'
19861
+ ],
19862
+ info: "The Dior Book Tote is a House classic and original design by Maria Grazia Chiuri, Creative Director of Christian Dior. The style is fully embroidered with the House's hallmark blue Dior Oblique motif and showcases the Christian Dior Paris signature. Exemplifying House savoir-faire, the miniature style features an adjustable and removable strap that allows it to be carried by hand, worn over the shoulder or crossbody.",
19863
+ price: 1950,
19864
+ shippingInfo: null,
19865
+ taxInfo: null
19866
+ }
19867
+ ],
19868
+ url: null,
19869
+ blockCta: 1,
19870
+ blockProduct: 1,
19871
+ hashTags: [
19872
+ 'Sports/Casual',
19873
+ 'Formal Dinner/Party',
19874
+ 'Business Formal',
19875
+ 'Wedding/Engagement',
19876
+ 'Gift-Giving',
19877
+ 'Daily Wear',
19878
+ 'Anniversary Gifts'
19879
+ ]
19880
+ }
19881
+ };
19882
+ const DiyStoryPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, descStyle, hashTagStyle, containerHeight = 664, containerWidth = 375, appDomain, tagList = [], scenes, onActiveChange, activeIndex, loopPlay = false }) => {
19883
+ const swiperRef = React.useRef(null);
19884
+ React.useMemo(() => {
19885
+ let minusHeight = 0;
19886
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
19887
+ minusHeight += 45;
19888
+ }
19889
+ if (tagList.length > 0) {
19890
+ minusHeight += 45;
19891
+ }
19892
+ return containerHeight - minusHeight;
19893
+ }, [globalConfig, containerHeight, tagList]);
19894
+ // 判断是否是视频
19895
+ const isVideoUrl = (url) => {
19896
+ if (url && url !== '' && typeof url === 'string') {
19897
+ const imageExtensions = ['.mp4', '.m3u8'];
19898
+ const lowerCaseUrl = url === null || url === void 0 ? void 0 : url.toLowerCase();
19899
+ return imageExtensions.some((ext) => lowerCaseUrl === null || lowerCaseUrl === void 0 ? void 0 : lowerCaseUrl.endsWith(ext));
19900
+ }
19901
+ else {
19902
+ return false;
19903
+ }
19904
+ };
19905
+ const renderContent = (rec, index) => {
19906
+ const isVideo = isVideoUrl(rec === null || rec === void 0 ? void 0 : rec.mediaUrl);
19907
+ if (isVideo) {
19908
+ return (React.createElement(VideoWidget$1, { rec: rec, index: index, muted: true, width: containerWidth, data: scenes !== null && scenes !== void 0 ? scenes : [], height: containerHeight, activeIndex: index, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, swiperRef: swiperRef, loopPlay: loopPlay }));
19909
+ }
19910
+ else {
19911
+ return (React.createElement(PictureGroup$1, { key: rec.itemId, imgUrls: [rec === null || rec === void 0 ? void 0 : rec.mediaUrl], width: containerWidth, height: containerHeight, rec: rec, index: index, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost, data: scenes !== null && scenes !== void 0 ? scenes : [], swiperRef: swiperRef, loopPlay: loopPlay }));
19912
+ }
19913
+ };
19914
+ React.useMemo(() => {
19915
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
19916
+ return (React.createElement("div", { className: 'clc-sxp-logo-banner', style: { backgroundColor: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.color } },
19917
+ React.createElement("img", { src: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl, alt: 'logo' })));
19918
+ }
19919
+ return null;
19920
+ }, [globalConfig]);
19921
+ const renderBottom = (rec, index) => {
19922
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
19923
+ if (rec === null || rec === void 0 ? void 0 : rec.video) {
19924
+ let cta = null;
19925
+ 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) {
19926
+ cta = '多商品CTA';
19927
+ }
19928
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
19929
+ cta = '商品CTA';
19930
+ }
19931
+ else {
19932
+ 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;
19933
+ }
19934
+ const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
19935
+ return (React.createElement(React.Fragment, null,
19936
+ ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && (React.createElement("div", { style: {
19937
+ background: 'repeating-linear-gradient(0deg, rgba(26, 26, 25, 0.7), hsla(0, 0%, 100%, 0))',
19938
+ height: '130px',
19939
+ position: 'absolute',
19940
+ bottom: 0,
19941
+ width: '100%',
19942
+ willChange: 'transform',
19943
+ zIndex: 2,
19944
+ pointerEvents: 'none'
19945
+ } })),
19946
+ React.createElement("div", { style: {
19947
+ marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
19948
+ zIndex: 999,
19949
+ position: 'absolute',
19950
+ bottom: 0,
19951
+ left: 0,
19952
+ right: 0,
19953
+ paddingTop: '20px'
19954
+ } },
19955
+ (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { style: {} },
19956
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, isActive: index === activeIndex, value: value }))) : null,
19957
+ React.createElement("div", null,
19958
+ React.createElement(ExpandableText$1
19959
+ // className='clc-sxp-bottom-text'
19960
+ , {
19961
+ // className='clc-sxp-bottom-text'
19962
+ isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', 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', padding: '0 20px', fontSize: '12px' }) }),
19963
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }))),
19964
+ React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER$1, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
19965
+ }
19966
+ return null;
19967
+ };
19968
+ const likeIcon = useIconLink(defaultLikeIconPath, appDomain);
19969
+ const unlikeIcon = useIconLink(defaultUnLikeIconPath, appDomain);
19970
+ const renderLikeButton = (rec, index) => {
19971
+ var _a, _b, _c, _d;
19972
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLike))
19973
+ return;
19974
+ let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconY) !== null && _a !== void 0 ? _a : 400;
19975
+ if (top < 40) {
19976
+ top += 40;
19977
+ }
19978
+ if (rec === null || rec === void 0 ? void 0 : rec.video) {
19979
+ return (React.createElement(LikeButton$1, { key: rec.position, activeIcon: (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIcon) !== null && _b !== void 0 ? _b : likeIcon, unActicveIcon: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unlikeIcon) !== null && _c !== void 0 ? _c : unlikeIcon, position: index, active: rec.isCollected, recData: rec,
19980
+ // className={style['clc-sxp-like-button']}
19981
+ style: {
19982
+ top,
19983
+ right: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconX) !== null && _d !== void 0 ? _d : 0,
19984
+ position: 'absolute',
19985
+ zIndex: 999,
19986
+ backgroundColor: 'transparent',
19987
+ width: '50px',
19988
+ height: '50px',
19989
+ outline: 'none',
19990
+ border: 'none',
19991
+ boxSizing: 'content-box',
19992
+ padding: 0,
19993
+ transform: 'translate3d(0px, 0px, 0px)'
19994
+ } }));
19995
+ }
19996
+ return null;
19997
+ };
19998
+ const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png', appDomain);
19999
+ const unmutedIcon = useIconLink('/pb_static/fea8668a8a894e4aa3a86bcc775e895e.png', appDomain);
20000
+ const renderToggleButton = (visible) => {
20001
+ var _a, _b, _c, _d;
20002
+ if (!visible)
20003
+ return;
20004
+ let top = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _a !== void 0 ? _a : 23;
20005
+ if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) === 'top') {
20006
+ top += 45;
20007
+ }
20008
+ return (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowMute) === true) && (React.createElement(ToggleButton$1, { style: {
20009
+ position: 'absolute',
20010
+ visibility: 'visible',
20011
+ zIndex: 999,
20012
+ transform: 'translate3d(0px,0px,0px)',
20013
+ [(_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconXPosit) !== null && _b !== void 0 ? _b : 'right']: (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _c !== void 0 ? _c : 0,
20014
+ [(_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconYPosit) !== null && _d !== void 0 ? _d : 'bottom']: top,
20015
+ backgroundColor: 'transparent',
20016
+ width: '50px',
20017
+ height: '50px',
20018
+ outline: 'none',
20019
+ border: 'none',
20020
+ boxSizing: 'content-box',
20021
+ padding: 0
20022
+ }, defaultValue: true, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon })));
20023
+ };
20024
+ const renderView = (item, index) => {
20025
+ var _a, _b, _c, _d;
20026
+ const rec = lodash.cloneDeep(recData);
20027
+ rec.video.bindProducts = item === null || item === void 0 ? void 0 : item.bindProducts;
20028
+ return (React.createElement("div", { style: { position: 'relative' } },
20029
+ React.createElement(SwiperSlide, { key: index, virtualIndex: index, style: { overflow: 'hidden', position: 'relative' } },
20030
+ renderBottom(rec, index),
20031
+ renderLikeButton(rec, index),
20032
+ renderToggleButton(!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed)),
20033
+ React.createElement(ToggleButton$1, { style: {
20034
+ position: 'absolute',
20035
+ right: (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconX) !== null && _a !== void 0 ? _a : 0,
20036
+ visibility: ((_c = (_b = data === null || data === void 0 ? void 0 : data[index]) === null || _b === void 0 ? void 0 : _b.video) === null || _c === void 0 ? void 0 : _c.url) ? 'visible' : 'hidden',
20037
+ bottom: (_d = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconY) !== null && _d !== void 0 ? _d : 23,
20038
+ zIndex: 999
20039
+ }, defaultValue: true, activeIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.unMuteIcon : mutedIcon, unactiveIcon: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon) ? globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIcon : unmutedIcon }),
20040
+ renderContent(item, index))));
20041
+ };
20042
+ React.useEffect(() => {
20043
+ var _a, _b;
20044
+ if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
20045
+ return;
20046
+ (_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.slideTo(activeIndex);
20047
+ }, [activeIndex]);
20048
+ React.useEffect(() => {
20049
+ var _a, _b;
20050
+ if (!(swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current))
20051
+ return;
20052
+ (_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.slideTo(0);
20053
+ }, [loopPlay]);
20054
+ return (React.createElement("div", { id: 'sxp-render',
20055
+ // className={style['clc-sxp-container']}
20056
+ style: { height: containerHeight, position: 'relative', pointerEvents: 'none' } },
20057
+ React.createElement(Swiper, { ref: swiperRef, allowTouchMove: false, onActiveIndexChange: (swiper) => {
20058
+ // setActiveIndex(swiper.activeIndex);
20059
+ onActiveChange === null || onActiveChange === void 0 ? void 0 : onActiveChange(swiper.activeIndex);
20060
+ }, direction: 'vertical', style: { overflow: 'hidden', height: containerHeight }, height: containerHeight }, scenes === null || scenes === void 0 ? void 0 : scenes.map((rec, index) => {
20061
+ return renderView(rec, index);
20062
+ }))));
20063
+ };
20064
+ var index$1 = React.memo(DiyStoryPreview);
19456
20065
 
19457
20066
  /*
19458
20067
  * @Author: binruan@chatlabs.com
@@ -19591,17 +20200,18 @@ var index = React.memo(SxpPageCore);
19591
20200
  * @Author : haocanweng@chatlabs.cn
19592
20201
  * @Date : 2023-08-21 16:31:58
19593
20202
  * @LastEditors: binruan@chatlabs.com
19594
- * @LastEditTime: 2024-06-25 11:37:48
20203
+ * @LastEditTime: 2025-03-25 14:31:53
19595
20204
  * @FilePath: \pb-sxp-ui\src\index.ts
19596
20205
  */
19597
20206
 
19598
- exports.DiyPortalPreview = index$1;
20207
+ exports.DiyPortalPreview = index$2;
20208
+ exports.DiyStoryPreview = index$1;
19599
20209
  exports.EditorDataProvider = EditorDataProvider;
19600
20210
  exports.Modal = Modal$1;
19601
20211
  exports.SxpDataSourceProvider = SxpDataSourceProvider$1;
19602
20212
  exports.SxpPageCore = index;
19603
20213
  exports.SxpPageRender = SxpPageRender$1;
19604
- exports.core = index$2;
20214
+ exports.core = index$3;
19605
20215
  exports.default = Pagebuilder;
19606
20216
  exports.materials = _materials_;
19607
20217
  exports.useEditorDataProvider = useEditorDataProvider;