pb-sxp-ui 1.19.0 → 1.19.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.
package/dist/index.js CHANGED
@@ -19443,11 +19443,25 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19443
19443
  useEffect(() => {
19444
19444
  if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting))
19445
19445
  return;
19446
+ function extractRootDomain(hostname) {
19447
+ // 处理特殊情况
19448
+ if (!hostname || hostname.indexOf('.') === -1) {
19449
+ return '';
19450
+ }
19451
+ const parts = hostname.split('.');
19452
+ // 对于标准的域名格式(如 xxx.yyy.zzz)
19453
+ if (parts.length >= 2) {
19454
+ return '.' + parts.slice(-2).join('.');
19455
+ }
19456
+ return '';
19457
+ }
19446
19458
  window.OptanonWrapper = function () {
19447
- var _a;
19448
- console.log('OptanonWrapper');
19449
- if ((window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) && ((_a = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) === null || _a === void 0 ? void 0 : _a.length) > 2) {
19459
+ const activeGroups = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups;
19460
+ if (activeGroups && (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.length) > 2) {
19450
19461
  setIsShowCookieSetting(true);
19462
+ if (!(activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4'))) {
19463
+ deleteCookie('_fbp', '/', extractRootDomain(window.location.hostname));
19464
+ }
19451
19465
  }
19452
19466
  };
19453
19467
  const handleClick = (event) => {
@@ -19463,31 +19477,21 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19463
19477
  if (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4')) {
19464
19478
  if (fbcRef.current && !(beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4'))) ;
19465
19479
  }
19466
- else if (beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4')) {
19480
+ else {
19467
19481
  fbcRef.current = getCookie('_fbp');
19468
- function extractRootDomain(hostname) {
19469
- // 处理特殊情况
19470
- if (!hostname || hostname.indexOf('.') === -1) {
19471
- return '';
19472
- }
19473
- const parts = hostname.split('.');
19474
- // 对于标准的域名格式(如 xxx.yyy.zzz)
19475
- if (parts.length >= 2) {
19476
- return '.' + parts.slice(-2).join('.');
19477
- }
19478
- return '';
19479
- }
19480
19482
  deleteCookie('_fbp', '/', extractRootDomain(window.location.hostname));
19481
19483
  const item = data[activeIndex];
19482
19484
  const 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) || '';
19483
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19484
- eventInfo: {
19485
- eventSubject: 'refuseCookie',
19486
- eventDescription: 'refuseCookie',
19487
- traceInfo
19488
- },
19489
- isActiveTargetingCookie: false
19490
- });
19485
+ if (beForeactiveGroups === null || beForeactiveGroups === void 0 ? void 0 : beForeactiveGroups.includes('4')) {
19486
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19487
+ eventInfo: {
19488
+ eventSubject: 'refuseCookie',
19489
+ eventDescription: 'refuseCookie',
19490
+ traceInfo
19491
+ },
19492
+ isActiveTargetingCookie: false
19493
+ });
19494
+ }
19491
19495
  }
19492
19496
  };
19493
19497
  }