pb-sxp-ui 1.18.2 → 1.19.0-alpha.1

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.
package/dist/pb-ui.js CHANGED
@@ -291,6 +291,42 @@
291
291
  });
292
292
  return splitList !== null && splitList !== void 0 ? splitList : [];
293
293
  }
294
+ function deleteCookie(name, path = '/', domain = '') {
295
+ // 设置过期时间为过去的时间
296
+ const expiration = 'expires=Thu, 01 Jan 1970 00:00:00 GMT';
297
+ const pathPart = path ? `; path=${path}` : '';
298
+ const domainPart = domain ? `; domain=${domain}` : '';
299
+ // 设置Cookie值为空,过期时间设为过去
300
+ document.cookie = `${name}=; ${expiration}${pathPart}${domainPart}`;
301
+ console.log(`已尝试删除Cookie: ${name}`);
302
+ }
303
+ function setCookie(name, value, days = 0, path = '/', domain = '', secure = false, sameSite = 'Lax') {
304
+ let cookieString = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
305
+ // 设置过期时间
306
+ if (days) {
307
+ const date = new Date();
308
+ date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
309
+ cookieString += `; expires=${date.toUTCString()}`;
310
+ }
311
+ // 设置路径
312
+ if (path) {
313
+ cookieString += `; path=${path}`;
314
+ }
315
+ // 设置域名
316
+ if (domain) {
317
+ cookieString += `; domain=${domain}`;
318
+ }
319
+ // 设置Secure标志
320
+ if (secure) {
321
+ cookieString += '; secure';
322
+ }
323
+ // 设置SameSite属性
324
+ if (sameSite) {
325
+ cookieString += `; samesite=${sameSite}`;
326
+ }
327
+ // 设置Cookie
328
+ document.cookie = cookieString;
329
+ }
294
330
 
295
331
  function unzip(b64Data) {
296
332
  const strData = atob(b64Data);
@@ -668,6 +704,7 @@
668
704
  const [chatlabsId, setChatlabsId] = React.useState();
669
705
  const finalPageData = React.useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
670
706
  const pixelPvStatusRef = React.useRef(false);
707
+ const fbcRef = React.useRef('');
671
708
  const isShowConsent = React.useMemo(() => {
672
709
  var _a, _b, _c, _d;
673
710
  return (((((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent) &&
@@ -728,6 +765,38 @@
728
765
  var _a;
729
766
  return ((_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']) + storeAndLoadFeUserId();
730
767
  }, [bffDataSource]);
768
+ React.useEffect(() => {
769
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting))
770
+ return;
771
+ fbcRef.current = getCookie('_fbc');
772
+ window.OptanonWrapper = function () {
773
+ const activeGroups = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups;
774
+ if (!activeGroups)
775
+ return;
776
+ if (!(activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4'))) {
777
+ deleteCookie('_fbc');
778
+ }
779
+ else if (fbcRef.current) {
780
+ setCookie('_fbc', fbcRef.current, 90);
781
+ }
782
+ };
783
+ }, [globalConfig]);
784
+ const isActiveTargetingCookie = React.useMemo(() => {
785
+ var _a;
786
+ function getCookie(name) {
787
+ var _a;
788
+ const value = `; ${document.cookie}`;
789
+ const parts = value.split(`; ${name}=`);
790
+ if (parts.length === 2)
791
+ return (_a = parts.pop()) === null || _a === void 0 ? void 0 : _a.split(';').shift();
792
+ return '';
793
+ }
794
+ decodeURIComponent((_a = getCookie('OptanonConsent')) !== null && _a !== void 0 ? _a : '');
795
+ if (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) && !(window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups.includes('4')))) {
796
+ return true;
797
+ }
798
+ return false;
799
+ }, [globalConfig]);
731
800
  // bff API 请求方法
732
801
  const bffFetch = React.useCallback((path, options, isBota = true) => {
733
802
  var _a;
@@ -754,6 +823,8 @@
754
823
  }, [bffDataSource, fakeUserId]);
755
824
  const bffCollectEvent = React.useCallback((params) => {
756
825
  var _a;
826
+ if (isActiveTargetingCookie)
827
+ return Promise.resolve();
757
828
  const body = {
758
829
  eventName: params === null || params === void 0 ? void 0 : params.eventName,
759
830
  eventSource: params === null || params === void 0 ? void 0 : params.eventSource
@@ -764,39 +835,42 @@
764
835
  body,
765
836
  type: 'beacon'
766
837
  }, false);
767
- }, [bffFetch, bffDataSource]);
838
+ }, [bffFetch, bffDataSource, isActiveTargetingCookie]);
768
839
  React.useEffect(() => {
769
- if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
770
- const OriginalImage = window.Image;
771
- window.Image = function () {
772
- const img = new OriginalImage();
773
- // 劫持 src 的 setter
774
- const originalSrcDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src');
775
- Object.defineProperty(img, 'src', {
776
- set(value) {
777
- // 继续正常设置 src
778
- originalSrcDescriptor.set.call(this, value);
779
- // img.onload = function () {
780
- // 检查是否是目标 URL
781
- if (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/')) {
782
- // 解析 URL 参数
783
- const url = new URL(value);
784
- const params = Object.fromEntries(url.searchParams.entries());
785
- bffCollectEvent({
786
- eventName: params === null || params === void 0 ? void 0 : params.ev,
787
- eventSource: 'Meta Pixel'
788
- });
789
- // }
790
- }
791
- },
792
- get() {
793
- return originalSrcDescriptor.get.call(this);
840
+ // if (typeof (window as any)?.fbq === 'function') {
841
+ const OriginalImage = window.Image;
842
+ window.Image = function () {
843
+ const img = new OriginalImage();
844
+ // 劫持 src 的 setter
845
+ const originalSrcDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src');
846
+ Object.defineProperty(img, 'src', {
847
+ set(value) {
848
+ if (isActiveTargetingCookie && (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/') || value.includes('https://www.facebook.com/tr'))) {
849
+ return;
794
850
  }
795
- });
796
- return img;
797
- };
798
- }
799
- }, [bffCollectEvent]);
851
+ // 继续正常设置 src
852
+ originalSrcDescriptor.set.call(this, value);
853
+ // img.onload = function () {
854
+ // 检查是否是目标 URL
855
+ if (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/')) {
856
+ // 解析 URL 参数
857
+ const url = new URL(value);
858
+ const params = Object.fromEntries(url.searchParams.entries());
859
+ bffCollectEvent({
860
+ eventName: params === null || params === void 0 ? void 0 : params.ev,
861
+ eventSource: 'Meta Pixel'
862
+ });
863
+ // }
864
+ }
865
+ },
866
+ get() {
867
+ return originalSrcDescriptor.get.call(this);
868
+ }
869
+ });
870
+ return img;
871
+ };
872
+ // }
873
+ }, [bffCollectEvent, isActiveTargetingCookie]);
800
874
  React.useEffect(() => {
801
875
  // 类型安全声明
802
876
  const navigatorWithBeacon = navigator;
@@ -809,6 +883,9 @@
809
883
  // 覆盖方法
810
884
  navigatorWithBeacon.sendBeacon = function (url, data) {
811
885
  const urlString = url instanceof URL ? url.href : url.toString();
886
+ if (isActiveTargetingCookie && (urlString.includes('https://tr.snapchat.com/p') || urlString.includes('https://analytics.tiktok.com/api/v2/pixel'))) {
887
+ return true;
888
+ }
812
889
  const success = originalSendBeacon(url, data);
813
890
  function parseBeaconData(data) {
814
891
  return __awaiter(this, void 0, void 0, function* () {
@@ -858,7 +935,7 @@
858
935
  return () => {
859
936
  navigatorWithBeacon.sendBeacon = originalSendBeacon;
860
937
  };
861
- }, [bffCollectEvent]);
938
+ }, [bffCollectEvent, isActiveTargetingCookie]);
862
939
  React.useEffect(() => {
863
940
  const _originalFetch = window.fetch;
864
941
  // 覆盖 fetch 方法
@@ -880,6 +957,9 @@
880
957
  return _originalFetch.apply(this, arguments_1);
881
958
  }
882
959
  try {
960
+ if (isActiveTargetingCookie && (url.includes('https://www.google-analytics.com/g/collect') || url.includes('https://arms-retcode.aliyuncs.com/r.png'))) {
961
+ return Promise.resolve(new Response(''));
962
+ }
883
963
  // 1. 先执行原始请求
884
964
  const response = _originalFetch.apply(this, arguments_1);
885
965
  // 检查是否是 GA4 收集端点
@@ -923,7 +1003,7 @@
923
1003
  }
924
1004
  });
925
1005
  };
926
- }, [bffCollectEvent]);
1006
+ }, [bffCollectEvent, isActiveTargetingCookie]);
927
1007
  React.useEffect(() => {
928
1008
  const originalOpen = XMLHttpRequest.prototype.open;
929
1009
  const originalSend = XMLHttpRequest.prototype.send;
@@ -933,6 +1013,9 @@
933
1013
  };
934
1014
  XMLHttpRequest.prototype.send = function (body) {
935
1015
  var _a;
1016
+ if (isActiveTargetingCookie && this._url && typeof this._url === 'string' && (this._url.includes('https://rumcollector.uptime.com') || this._url.includes('https://arms-retcode.aliyuncs.com/r.png') || this._url.includes('https://i.giesswein.com/nb-collector'))) {
1017
+ return;
1018
+ }
936
1019
  if (this._url && typeof this._url === 'string' && this._url.includes('https://i.giesswein.com/nb-collector')) {
937
1020
  if (body && typeof body === 'string') {
938
1021
  try {
@@ -958,7 +1041,7 @@
958
1041
  XMLHttpRequest.prototype.open = originalOpen;
959
1042
  XMLHttpRequest.prototype.send = originalSend;
960
1043
  };
961
- }, [bffCollectEvent]);
1044
+ }, [bffCollectEvent, isActiveTargetingCookie]);
962
1045
  React.useEffect(() => {
963
1046
  if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
964
1047
  window === null || window === void 0 ? void 0 : window.fbq('track', 'PageView');
@@ -1088,7 +1171,7 @@
1088
1171
  const bffEventReport = React.useCallback(({ userInfo, eventInfo, reportLayId = true }) => {
1089
1172
  var _a, _b;
1090
1173
  // 关闭 BFF 事件上报
1091
- if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
1174
+ if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isActiveTargetingCookie) {
1092
1175
  return;
1093
1176
  }
1094
1177
  // 用户信息都是公共的
@@ -1129,7 +1212,8 @@
1129
1212
  layoutVariantId,
1130
1213
  globalConfig,
1131
1214
  playbookType,
1132
- bffDataSource
1215
+ bffDataSource,
1216
+ isActiveTargetingCookie
1133
1217
  ]);
1134
1218
  const getEventParamsByJson = React.useCallback((json, product) => {
1135
1219
  var _a, _b, _c;
@@ -1194,7 +1278,7 @@
1194
1278
  }, [fakeUserId]);
1195
1279
  const bffFbReport = React.useCallback(({ eventName, product }) => {
1196
1280
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1197
- if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
1281
+ if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isActiveTargetingCookie) {
1198
1282
  return;
1199
1283
  }
1200
1284
  let isPushState = false;
@@ -1260,7 +1344,7 @@
1260
1344
  type: 'beacon'
1261
1345
  });
1262
1346
  }
1263
- }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
1347
+ }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson, isActiveTargetingCookie]);
1264
1348
  const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1265
1349
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
1266
1350
  return res === null || res === void 0 ? void 0 : res.success;
@@ -19232,7 +19316,7 @@ Made in Italy` })));
19232
19316
  React.createElement(Nudge, { nudge: nudge }),
19233
19317
  ((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' },
19234
19318
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
19235
- React.createElement("div", null,
19319
+ React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
19236
19320
  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 }),
19237
19321
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
19238
19322
  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) }))),
@@ -19478,68 +19562,71 @@ Made in Italy` })));
19478
19562
  isReload,
19479
19563
  renderToggleButton
19480
19564
  ]);
19481
- return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
19482
- React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
19483
- waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
19484
- const isEq = lodash.isEqual(rtcList, cacheRtcList);
19485
- if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
19486
- setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
19487
- }
19488
- setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
19489
- } })),
19490
- renderLogo,
19491
- React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
19492
- top: minusHeight
19493
- } }),
19494
- ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && !waterFallData && (React.createElement(NavBack$1, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
19495
- ((((_l = (_k = (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.backButton) === null || _l === void 0 ? void 0 : _l.enable) && channel) || openMultiPosts) &&
19496
- !waterFallData && (React.createElement(NavBack$1, { data: (_q = (_p = (_o = (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.item) === null || _p === void 0 ? void 0 : _p.props) === null || _q === void 0 ? void 0 : _q.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => {
19497
- var _a, _b;
19498
- const item = visList === null || visList === void 0 ? void 0 : visList[activeIndex];
19499
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19500
- eventInfo: {
19501
- eventSubject: 'backMultiPostClick',
19502
- eventDescription: 'backMultiPostClick',
19503
- traceInfo: ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.traceInfo) || ((_b = item === null || item === void 0 ? void 0 : item.product) === null || _b === void 0 ? void 0 : _b.traceInfo) || ''
19565
+ return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
19566
+ (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
19567
+ React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
19568
+ waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
19569
+ const isEq = lodash.isEqual(rtcList, cacheRtcList);
19570
+ if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
19571
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
19504
19572
  }
19505
- });
19506
- location === null || location === void 0 ? void 0 : location.reload();
19507
- } })),
19508
- isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _r !== void 0 ? _r : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
19509
- React.createElement(Swiper, { style: {
19510
- marginTop: tagHeight
19511
- }, ref: swiperRef, onSlideChange: () => {
19512
- swiperRef.current.swiper.allowTouchMove = false;
19513
- setTimeout(() => {
19514
- swiperRef.current.swiper.allowTouchMove = true;
19515
- }, 500);
19516
- }, onActiveIndexChange: (swiper) => {
19517
- setActiveIndex(swiper.activeIndex);
19518
- if (openHashtag)
19519
- return;
19520
- // 处理上滑下滑事件
19521
- handleScrollEvent(swiper);
19522
- if (waterFallData || isEditor || isDiyH5)
19523
- return;
19524
- if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
19525
- if (!isLoadMore) {
19526
- setIsLoadMore(true);
19527
- loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
19528
- var _a;
19529
- setIsLoadMore(false);
19530
- if (res && ((_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
19531
- setPageNum(pageNum + 1);
19532
- }
19533
- });
19573
+ setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
19574
+ } })),
19575
+ renderLogo,
19576
+ React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
19577
+ top: minusHeight
19578
+ } }),
19579
+ ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && !waterFallData && (React.createElement(NavBack$1, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
19580
+ ((((_l = (_k = (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.backButton) === null || _l === void 0 ? void 0 : _l.enable) && channel) || openMultiPosts) &&
19581
+ !waterFallData && (React.createElement(NavBack$1, { data: (_q = (_p = (_o = (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.item) === null || _p === void 0 ? void 0 : _p.props) === null || _q === void 0 ? void 0 : _q.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => {
19582
+ var _a, _b;
19583
+ const item = visList === null || visList === void 0 ? void 0 : visList[activeIndex];
19584
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19585
+ eventInfo: {
19586
+ eventSubject: 'backMultiPostClick',
19587
+ eventDescription: 'backMultiPostClick',
19588
+ traceInfo: ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.traceInfo) || ((_b = item === null || item === void 0 ? void 0 : item.product) === null || _b === void 0 ? void 0 : _b.traceInfo) || ''
19589
+ }
19590
+ });
19591
+ location === null || location === void 0 ? void 0 : location.reload();
19592
+ } })),
19593
+ isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _r !== void 0 ? _r : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
19594
+ React.createElement(Swiper, { style: {
19595
+ marginTop: tagHeight
19596
+ }, ref: swiperRef, onSlideChange: () => {
19597
+ swiperRef.current.swiper.allowTouchMove = false;
19598
+ setTimeout(() => {
19599
+ swiperRef.current.swiper.allowTouchMove = true;
19600
+ }, 500);
19601
+ }, onActiveIndexChange: (swiper) => {
19602
+ setActiveIndex(swiper.activeIndex);
19603
+ if (openHashtag)
19604
+ return;
19605
+ // 处理上滑下滑事件
19606
+ handleScrollEvent(swiper);
19607
+ if (waterFallData || isEditor || isDiyH5)
19608
+ return;
19609
+ if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
19610
+ if (!isLoadMore) {
19611
+ setIsLoadMore(true);
19612
+ loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
19613
+ var _a;
19614
+ setIsLoadMore(false);
19615
+ if (res && ((_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
19616
+ setPageNum(pageNum + 1);
19617
+ }
19618
+ });
19619
+ }
19534
19620
  }
19535
- }
19536
- }, direction: 'vertical', height: height },
19537
- renderView,
19538
- renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
19539
- renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
19540
- React.createElement(WaterFall$1, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
19541
- React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19542
- openMultiPosts && (React.createElement(MultiPosts$2, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } })))))));
19621
+ }, direction: 'vertical', height: height },
19622
+ renderView,
19623
+ renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
19624
+ renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
19625
+ React.createElement(WaterFall$1, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
19626
+ React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19627
+ openMultiPosts && (React.createElement(MultiPosts$2, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } }))))),
19628
+ (window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: { position: 'fixed', bottom: 0, left: 0, right: 0, width: '100%', zIndex: 10, backgroundColor: '#000', fontSize: 0 } },
19629
+ React.createElement("button", { id: 'ot-sdk-btn', className: 'ot-sdk-show-settings', style: { textDecoration: 'underline', width: 'fit-content', border: 'none', lineHeight: '24px', fontSize: '10px', color: '#fff', padding: '0 20px' } }, "Cookie settings")))));
19543
19630
  };
19544
19631
  var SxpPageRender$1 = React.memo(SxpPageRender);
19545
19632