@builder.io/sdk-react-nextjs 0.18.10 → 0.18.13

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 (105) hide show
  1. package/lib/browser/blocks/image/image.cjs +4 -4
  2. package/lib/browser/blocks/image/image.mjs +19 -17
  3. package/lib/browser/blocks/personalization-container/component-info.cjs +1 -0
  4. package/lib/browser/blocks/personalization-container/component-info.mjs +40 -0
  5. package/lib/browser/blocks/personalization-container/helpers/inlined-fns.cjs +162 -0
  6. package/lib/browser/blocks/personalization-container/helpers/inlined-fns.mjs +225 -0
  7. package/lib/browser/blocks/personalization-container/helpers.cjs +5 -0
  8. package/lib/browser/blocks/personalization-container/helpers.mjs +64 -0
  9. package/lib/browser/blocks/personalization-container/personalization-container.cjs +1 -0
  10. package/lib/browser/blocks/personalization-container/personalization-container.mjs +211 -0
  11. package/lib/browser/blocks/symbol/symbol.cjs +1 -1
  12. package/lib/browser/blocks/symbol/symbol.mjs +23 -23
  13. package/lib/browser/blocks/text/component-info.cjs +1 -1
  14. package/lib/browser/blocks/text/component-info.mjs +1 -4
  15. package/lib/browser/components/block/block.cjs +1 -1
  16. package/lib/browser/components/block/block.helpers.cjs +2 -2
  17. package/lib/browser/components/block/block.helpers.mjs +19 -18
  18. package/lib/browser/components/block/block.mjs +34 -34
  19. package/lib/browser/components/block/components/interactive-element.cjs +1 -1
  20. package/lib/browser/components/block/components/interactive-element.mjs +18 -11
  21. package/lib/browser/components/blocks/blocks-wrapper.cjs +1 -1
  22. package/lib/browser/components/blocks/blocks-wrapper.mjs +2 -2
  23. package/lib/browser/components/blocks/blocks.cjs +1 -1
  24. package/lib/browser/components/blocks/blocks.mjs +21 -18
  25. package/lib/browser/components/content-variants/content-variants.cjs +1 -1
  26. package/lib/browser/components/content-variants/content-variants.mjs +51 -40
  27. package/lib/browser/constants/builder-registered-components.cjs +1 -1
  28. package/lib/browser/constants/builder-registered-components.mjs +43 -36
  29. package/lib/browser/constants/sdk-version.cjs +1 -1
  30. package/lib/browser/constants/sdk-version.mjs +1 -1
  31. package/lib/edge/blocks/image/image.cjs +4 -4
  32. package/lib/edge/blocks/image/image.mjs +19 -17
  33. package/lib/edge/blocks/personalization-container/component-info.cjs +1 -0
  34. package/lib/edge/blocks/personalization-container/component-info.mjs +40 -0
  35. package/lib/edge/blocks/personalization-container/helpers/inlined-fns.cjs +162 -0
  36. package/lib/edge/blocks/personalization-container/helpers/inlined-fns.mjs +225 -0
  37. package/lib/edge/blocks/personalization-container/helpers.cjs +5 -0
  38. package/lib/edge/blocks/personalization-container/helpers.mjs +64 -0
  39. package/lib/edge/blocks/personalization-container/personalization-container.cjs +1 -0
  40. package/lib/edge/blocks/personalization-container/personalization-container.mjs +211 -0
  41. package/lib/edge/blocks/symbol/symbol.cjs +1 -1
  42. package/lib/edge/blocks/symbol/symbol.mjs +23 -23
  43. package/lib/edge/blocks/text/component-info.cjs +1 -1
  44. package/lib/edge/blocks/text/component-info.mjs +1 -4
  45. package/lib/edge/components/block/block.cjs +1 -1
  46. package/lib/edge/components/block/block.helpers.cjs +2 -2
  47. package/lib/edge/components/block/block.helpers.mjs +19 -18
  48. package/lib/edge/components/block/block.mjs +34 -34
  49. package/lib/edge/components/block/components/interactive-element.cjs +1 -1
  50. package/lib/edge/components/block/components/interactive-element.mjs +18 -11
  51. package/lib/edge/components/blocks/blocks-wrapper.cjs +1 -1
  52. package/lib/edge/components/blocks/blocks-wrapper.mjs +2 -2
  53. package/lib/edge/components/blocks/blocks.cjs +1 -1
  54. package/lib/edge/components/blocks/blocks.mjs +21 -18
  55. package/lib/edge/components/content-variants/content-variants.cjs +1 -1
  56. package/lib/edge/components/content-variants/content-variants.mjs +51 -40
  57. package/lib/edge/constants/builder-registered-components.cjs +1 -1
  58. package/lib/edge/constants/builder-registered-components.mjs +41 -34
  59. package/lib/edge/constants/sdk-version.cjs +1 -1
  60. package/lib/edge/constants/sdk-version.mjs +1 -1
  61. package/lib/node/blocks/image/image.cjs +4 -4
  62. package/lib/node/blocks/image/image.mjs +19 -17
  63. package/lib/node/blocks/personalization-container/component-info.cjs +1 -0
  64. package/lib/node/blocks/personalization-container/component-info.mjs +40 -0
  65. package/lib/node/blocks/personalization-container/helpers/inlined-fns.cjs +162 -0
  66. package/lib/node/blocks/personalization-container/helpers/inlined-fns.mjs +225 -0
  67. package/lib/node/blocks/personalization-container/helpers.cjs +5 -0
  68. package/lib/node/blocks/personalization-container/helpers.mjs +64 -0
  69. package/lib/node/blocks/personalization-container/personalization-container.cjs +1 -0
  70. package/lib/node/blocks/personalization-container/personalization-container.mjs +211 -0
  71. package/lib/node/blocks/symbol/symbol.cjs +1 -1
  72. package/lib/node/blocks/symbol/symbol.mjs +23 -23
  73. package/lib/node/blocks/text/component-info.cjs +1 -1
  74. package/lib/node/blocks/text/component-info.mjs +1 -4
  75. package/lib/node/components/block/block.cjs +1 -1
  76. package/lib/node/components/block/block.helpers.cjs +2 -2
  77. package/lib/node/components/block/block.helpers.mjs +19 -18
  78. package/lib/node/components/block/block.mjs +34 -34
  79. package/lib/node/components/block/components/interactive-element.cjs +1 -1
  80. package/lib/node/components/block/components/interactive-element.mjs +18 -11
  81. package/lib/node/components/blocks/blocks-wrapper.cjs +1 -1
  82. package/lib/node/components/blocks/blocks-wrapper.mjs +2 -2
  83. package/lib/node/components/blocks/blocks.cjs +1 -1
  84. package/lib/node/components/blocks/blocks.mjs +21 -18
  85. package/lib/node/components/content-variants/content-variants.cjs +1 -1
  86. package/lib/node/components/content-variants/content-variants.mjs +51 -40
  87. package/lib/node/constants/builder-registered-components.cjs +1 -1
  88. package/lib/node/constants/builder-registered-components.mjs +41 -34
  89. package/lib/node/constants/sdk-version.cjs +1 -1
  90. package/lib/node/constants/sdk-version.mjs +1 -1
  91. package/package.json +2 -2
  92. package/types/cjs/blocks/personalization-container/helpers/inlined-fns.d.ts +4 -1
  93. package/types/cjs/blocks/personalization-container/helpers.d.ts +24 -4
  94. package/types/cjs/blocks/personalization-container/personalization-container.types.d.ts +2 -2
  95. package/types/cjs/components/block/block.helpers.d.ts +1 -0
  96. package/types/cjs/components/blocks/blocks-wrapper.d.ts +13 -1
  97. package/types/cjs/components/blocks/blocks.types.d.ts +1 -1
  98. package/types/cjs/constants/sdk-version.d.ts +1 -1
  99. package/types/esm/blocks/personalization-container/helpers/inlined-fns.d.ts +4 -1
  100. package/types/esm/blocks/personalization-container/helpers.d.ts +24 -4
  101. package/types/esm/blocks/personalization-container/personalization-container.types.d.ts +2 -2
  102. package/types/esm/components/block/block.helpers.d.ts +1 -0
  103. package/types/esm/components/blocks/blocks-wrapper.d.ts +13 -1
  104. package/types/esm/components/blocks/blocks.types.d.ts +1 -1
  105. package/types/esm/constants/sdk-version.d.ts +1 -1
@@ -1,11 +1,11 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),l=require("./image.helpers.cjs");function f(e){var s,r,u,d,o,g;function n(){var h;const i=e.image||e.src;if(!i||!(typeof i=="string"&&(i.match(/builder\.io/)||i.match(/cdn\.shopify\.com/))))return e.srcset;if(!e.noWebp){if(e.srcset&&((h=e.image)!=null&&h.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),l.getSrcSet(i)}else if(e.image&&!e.srcset)return l.getSrcSet(i);return l.getSrcSet(i)}}function a(){var c;return(c=n==null?void 0:n())!=null&&c.match(/builder\.io/)&&!e.noWebp?n().replace(/\?/g,"?format=webp&"):""}function m(){const c={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?c:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[a()?t.jsx("source",{type:"image/webp",srcSet:a()}):null,t.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,title:e.title,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...m()},className:"builder-image"+(e.className?" "+e.className:"")+" img-0525a549",src:e.image,srcSet:n(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(s=e.builderBlock)==null?void 0:s.children)!=null&&r.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-0525a549",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(d=(u=e.builderBlock)==null?void 0:u.children)!=null&&d.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&((g=(o=e.builderBlock)==null?void 0:o.children)!=null&&g.length)?t.jsx("div",{className:"div-0525a549-2",children:e.children}):null]}),t.jsx("style",{children:`.img-0525a549 {
1
+ "use client";"use strict";const t=require("react/jsx-runtime"),f=require("react"),c=require("./image.helpers.cjs");function b(e){var s,r,u,o,d,g;function n(){var h;const i=e.image||e.src;if(!i||!(typeof i=="string"&&(i.match(/builder\.io/)||i.match(/cdn\.shopify\.com/))))return e.srcset;if(!e.noWebp){if(e.srcset&&((h=e.image)!=null&&h.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),c.getSrcSet(i)}else if(e.image&&!e.srcset)return c.getSrcSet(i);return c.getSrcSet(i)}}function l(){var a;return(a=n==null?void 0:n())!=null&&a.match(/builder\.io/)&&!e.noWebp?n().replace(/\?/g,"?format=webp&"):""}function m(){const a={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?a:void 0}return f.useEffect(()=>{},[]),t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[l()?t.jsx("source",{type:"image/webp",srcSet:l()}):null,t.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,title:e.title,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...m()},className:"builder-image"+(e.className?" "+e.className:"")+" img-0aa95e74",src:e.image,srcSet:n(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(s=e.builderBlock)==null?void 0:s.children)!=null&&r.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-0aa95e74",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(o=(u=e.builderBlock)==null?void 0:u.children)!=null&&o.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&((g=(d=e.builderBlock)==null?void 0:d.children)!=null&&g.length)?t.jsx("div",{className:"div-0aa95e74-2",children:e.children}):null]}),t.jsx("style",{children:`.img-0aa95e74 {
2
2
  opacity: 1;
3
3
  transition: opacity 0.2s ease-in-out;
4
- }.div-0525a549 {
4
+ }.div-0aa95e74 {
5
5
  width: 100%;
6
6
  pointer-events: none;
7
7
  font-size: 0;
8
- }.div-0525a549-2 {
8
+ }.div-0aa95e74-2 {
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  align-items: stretch;
@@ -14,4 +14,4 @@
14
14
  left: 0;
15
15
  width: 100%;
16
16
  height: 100%;
17
- }`})]})}module.exports=f;
17
+ }`})]})}module.exports=b;
@@ -1,8 +1,9 @@
1
1
  "use client";
2
- import { jsxs as a, Fragment as c, jsx as t } from "react/jsx-runtime";
2
+ import { jsxs as l, Fragment as c, jsx as t } from "react/jsx-runtime";
3
+ import { useEffect as v } from "react";
3
4
  import { getSrcSet as o } from "./image.helpers.mjs";
4
- function x(e) {
5
- var d, u, s, g, h, m;
5
+ function w(e) {
6
+ var d, u, s, g, m, h;
6
7
  function n() {
7
8
  var f;
8
9
  const i = e.image || e.src;
@@ -20,22 +21,23 @@ function x(e) {
20
21
  }
21
22
  }
22
23
  function r() {
23
- var l;
24
- return (l = n == null ? void 0 : n()) != null && l.match(/builder\.io/) && !e.noWebp ? n().replace(/\?/g, "?format=webp&") : "";
24
+ var a;
25
+ return (a = n == null ? void 0 : n()) != null && a.match(/builder\.io/) && !e.noWebp ? n().replace(/\?/g, "?format=webp&") : "";
25
26
  }
26
27
  function b() {
27
- const l = {
28
+ const a = {
28
29
  position: "absolute",
29
30
  height: "100%",
30
31
  width: "100%",
31
32
  left: "0px",
32
33
  top: "0px"
33
34
  };
34
- return e.aspectRatio ? l : void 0;
35
+ return e.aspectRatio ? a : void 0;
35
36
  }
36
- return /* @__PURE__ */ a(c, { children: [
37
- /* @__PURE__ */ a(c, { children: [
38
- /* @__PURE__ */ a("picture", { children: [
37
+ return v(() => {
38
+ }, []), /* @__PURE__ */ l(c, { children: [
39
+ /* @__PURE__ */ l(c, { children: [
40
+ /* @__PURE__ */ l("picture", { children: [
39
41
  r() ? /* @__PURE__ */ t("source", { type: "image/webp", srcSet: r() }) : null,
40
42
  /* @__PURE__ */ t(
41
43
  "img",
@@ -50,7 +52,7 @@ function x(e) {
50
52
  objectFit: e.backgroundSize || "cover",
51
53
  ...b()
52
54
  },
53
- className: "builder-image" + (e.className ? " " + e.className : "") + " img-0525a549",
55
+ className: "builder-image" + (e.className ? " " + e.className : "") + " img-0aa95e74",
54
56
  src: e.image,
55
57
  srcSet: n(),
56
58
  sizes: e.sizes
@@ -60,23 +62,23 @@ function x(e) {
60
62
  e.aspectRatio && !((u = (d = e.builderBlock) == null ? void 0 : d.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ t(
61
63
  "div",
62
64
  {
63
- className: "builder-image-sizer div-0525a549",
65
+ className: "builder-image-sizer div-0aa95e74",
64
66
  style: {
65
67
  paddingTop: e.aspectRatio * 100 + "%"
66
68
  }
67
69
  }
68
70
  ) : null,
69
71
  (g = (s = e.builderBlock) == null ? void 0 : s.children) != null && g.length && e.fitContent ? /* @__PURE__ */ t(c, { children: e.children }) : null,
70
- !e.fitContent && ((m = (h = e.builderBlock) == null ? void 0 : h.children) != null && m.length) ? /* @__PURE__ */ t("div", { className: "div-0525a549-2", children: e.children }) : null
72
+ !e.fitContent && ((h = (m = e.builderBlock) == null ? void 0 : m.children) != null && h.length) ? /* @__PURE__ */ t("div", { className: "div-0aa95e74-2", children: e.children }) : null
71
73
  ] }),
72
- /* @__PURE__ */ t("style", { children: `.img-0525a549 {
74
+ /* @__PURE__ */ t("style", { children: `.img-0aa95e74 {
73
75
  opacity: 1;
74
76
  transition: opacity 0.2s ease-in-out;
75
- }.div-0525a549 {
77
+ }.div-0aa95e74 {
76
78
  width: 100%;
77
79
  pointer-events: none;
78
80
  font-size: 0;
79
- }.div-0525a549-2 {
81
+ }.div-0aa95e74-2 {
80
82
  display: flex;
81
83
  flex-direction: column;
82
84
  align-items: stretch;
@@ -89,5 +91,5 @@ function x(e) {
89
91
  ] });
90
92
  }
91
93
  export {
92
- x as default
94
+ w as default
93
95
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"PersonalizationContainer",shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0},noWrap:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",canHaveChildren:!0,inputs:[{name:"variants",defaultValue:[],behavior:"personalizationVariantList",type:"list",subFields:[{name:"name",type:"text"},{name:"query",friendlyName:"Targeting rules",type:"BuilderQuery",defaultValue:[]},{name:"startDate",type:"date"},{name:"endDate",type:"date"},{name:"blocks",type:"uiBlocks",hideFromUI:!0,defaultValue:[]}]}]};exports.componentInfo=e;
@@ -0,0 +1,40 @@
1
+ const e = {
2
+ name: "PersonalizationContainer",
3
+ shouldReceiveBuilderProps: {
4
+ builderBlock: !0,
5
+ builderContext: !0,
6
+ builderComponents: !0
7
+ },
8
+ noWrap: !0,
9
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
10
+ canHaveChildren: !0,
11
+ inputs: [{
12
+ name: "variants",
13
+ defaultValue: [],
14
+ behavior: "personalizationVariantList",
15
+ type: "list",
16
+ subFields: [{
17
+ name: "name",
18
+ type: "text"
19
+ }, {
20
+ name: "query",
21
+ friendlyName: "Targeting rules",
22
+ type: "BuilderQuery",
23
+ defaultValue: []
24
+ }, {
25
+ name: "startDate",
26
+ type: "date"
27
+ }, {
28
+ name: "endDate",
29
+ type: "date"
30
+ }, {
31
+ name: "blocks",
32
+ type: "uiBlocks",
33
+ hideFromUI: !0,
34
+ defaultValue: []
35
+ }]
36
+ }]
37
+ };
38
+ export {
39
+ e as componentInfo
40
+ };
@@ -0,0 +1,162 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function p(l,f,y,g){function o(r){return typeof r=="string"}function a(r){return typeof r=="number"}function c(r,n){return(()=>{const s=n.property,u=n.operator;let e=n.value;if(n&&n.property==="urlPath"&&n.value&&typeof n.value=="string"&&n.value!=="/"&&n.value.endsWith("/")&&(e=n.value.slice(0,-1)),!(s&&u))return!0;if(Array.isArray(e))return u==="isNot"?e.every(v=>c(r,{property:s,operator:u,value:v})):!!e.find(v=>c(r,{property:s,operator:u,value:v}));const t=r[s];if(Array.isArray(t))return t.includes(e);switch(u){case"is":return t===e;case"isNot":return t!==e;case"contains":return(o(t)||Array.isArray(t))&&t.includes(String(e));case"startsWith":return o(t)&&t.startsWith(String(e));case"endsWith":return o(t)&&t.endsWith(String(e));case"greaterThan":return a(t)&&a(e)&&t>e;case"lessThan":return a(t)&&a(e)&&t<e;case"greaterThanOrEqualTo":return a(t)&&a(e)&&t>=e;case"lessThanOrEqualTo":return a(t)&&a(e)&&t<=e;default:return!1}})()}const i={query:f,startDate:y,endDate:g},d=l.date&&new Date(l.date)||new Date;return i.startDate&&new Date(i.startDate)>d||i.endDate&&new Date(i.endDate)<d?!1:!i.query||!i.query.length?!0:i.query.every(r=>c(l,r))}const S=`function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {
2
+ if (!navigator.cookieEnabled) {
3
+ return;
4
+ }
5
+ function getCookie(name) {
6
+ const nameEQ = name + '=';
7
+ const ca = document.cookie.split(';');
8
+ for (let i = 0; i < ca.length; i++) {
9
+ let c = ca[i];
10
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
11
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
12
+ }
13
+ return null;
14
+ }
15
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
16
+ if (locale) {
17
+ attributes.locale = locale;
18
+ }
19
+ const winningVariantIndex = variants?.findIndex(function (variant) {
20
+ return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
21
+ });
22
+ const parentDiv = document.currentScript?.parentElement;
23
+ const variantId = parentDiv?.getAttribute('data-variant-id');
24
+ const isDefaultVariant = variantId === \`\${blockId}-default\`;
25
+ const isWinningVariant = winningVariantIndex !== -1 && variantId === \`\${blockId}-\${winningVariantIndex}\` || winningVariantIndex === -1 && isDefaultVariant;
26
+ if (isWinningVariant && !isDefaultVariant) {
27
+ parentDiv?.removeAttribute('hidden');
28
+ parentDiv?.removeAttribute('aria-hidden');
29
+ } else if (!isWinningVariant && isDefaultVariant) {
30
+ parentDiv?.setAttribute('hidden', 'true');
31
+ parentDiv?.setAttribute('aria-hidden', 'true');
32
+ }
33
+ if (isHydrationTarget) {
34
+ if (!isWinningVariant) {
35
+ const itsStyleEl = parentDiv?.previousElementSibling;
36
+ if (itsStyleEl) {
37
+ itsStyleEl.remove();
38
+ }
39
+ parentDiv?.remove();
40
+ }
41
+ const thisScript = document.currentScript;
42
+ if (thisScript) {
43
+ thisScript.remove();
44
+ }
45
+ }
46
+ }`,m=`function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
47
+ function isString(val) {
48
+ return typeof val === 'string';
49
+ }
50
+ function isNumber(val) {
51
+ return typeof val === 'number';
52
+ }
53
+ function objectMatchesQuery(userattr, query) {
54
+ const result = (() => {
55
+ const property = query.property;
56
+ const operator = query.operator;
57
+ let testValue = query.value;
58
+ if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {
59
+ testValue = query.value.slice(0, -1);
60
+ }
61
+ if (!(property && operator)) {
62
+ return true;
63
+ }
64
+ if (Array.isArray(testValue)) {
65
+ if (operator === 'isNot') {
66
+ return testValue.every(val => objectMatchesQuery(userattr, {
67
+ property,
68
+ operator,
69
+ value: val
70
+ }));
71
+ }
72
+ return !!testValue.find(val => objectMatchesQuery(userattr, {
73
+ property,
74
+ operator,
75
+ value: val
76
+ }));
77
+ }
78
+ const value = userattr[property];
79
+ if (Array.isArray(value)) {
80
+ return value.includes(testValue);
81
+ }
82
+ switch (operator) {
83
+ case 'is':
84
+ return value === testValue;
85
+ case 'isNot':
86
+ return value !== testValue;
87
+ case 'contains':
88
+ return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
89
+ case 'startsWith':
90
+ return isString(value) && value.startsWith(String(testValue));
91
+ case 'endsWith':
92
+ return isString(value) && value.endsWith(String(testValue));
93
+ case 'greaterThan':
94
+ return isNumber(value) && isNumber(testValue) && value > testValue;
95
+ case 'lessThan':
96
+ return isNumber(value) && isNumber(testValue) && value < testValue;
97
+ case 'greaterThanOrEqualTo':
98
+ return isNumber(value) && isNumber(testValue) && value >= testValue;
99
+ case 'lessThanOrEqualTo':
100
+ return isNumber(value) && isNumber(testValue) && value <= testValue;
101
+ default:
102
+ return false;
103
+ }
104
+ })();
105
+ return result;
106
+ }
107
+ const item = {
108
+ query,
109
+ startDate,
110
+ endDate
111
+ };
112
+ const now = userAttributes.date && new Date(userAttributes.date) || new Date();
113
+ if (item.startDate && new Date(item.startDate) > now) {
114
+ return false;
115
+ } else if (item.endDate && new Date(item.endDate) < now) {
116
+ return false;
117
+ }
118
+ if (!item.query || !item.query.length) {
119
+ return true;
120
+ }
121
+ return item.query.every(filter => {
122
+ return objectMatchesQuery(userAttributes, filter);
123
+ });
124
+ }`,b=`function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {
125
+ function getCookie(name) {
126
+ const nameEQ = name + '=';
127
+ const ca = document.cookie.split(';');
128
+ for (let i = 0; i < ca.length; i++) {
129
+ let c = ca[i];
130
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
131
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
132
+ }
133
+ return null;
134
+ }
135
+ const visibilityStylesEl = document.currentScript?.previousElementSibling;
136
+ if (!visibilityStylesEl) {
137
+ return;
138
+ }
139
+ if (isHydrationTarget) {
140
+ visibilityStylesEl.remove();
141
+ const currentScript = document.currentScript;
142
+ if (currentScript) {
143
+ currentScript.remove();
144
+ }
145
+ } else {
146
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
147
+ if (locale) {
148
+ attributes.locale = locale;
149
+ }
150
+ const winningVariantIndex = variants?.findIndex(function (variant) {
151
+ return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
152
+ });
153
+ if (winningVariantIndex !== -1) {
154
+ let newStyleStr = variants?.map((_, index) => {
155
+ if (index === winningVariantIndex) return '';
156
+ return \`div[data-variant-id="\${blockId}-\${index}"] { display: none !important; } \`;
157
+ }).join('') || '';
158
+ newStyleStr += \`div[data-variant-id="\${blockId}-default"] { display: none !important; } \`;
159
+ visibilityStylesEl.innerHTML = newStyleStr;
160
+ }
161
+ }
162
+ }`;exports.FILTER_WITH_CUSTOM_TARGETING_SCRIPT=m;exports.PERSONALIZATION_SCRIPT=S;exports.UPDATE_VISIBILITY_STYLES_SCRIPT=b;exports.filterWithCustomTargeting=p;
@@ -0,0 +1,225 @@
1
+ function m(l, f, y, p) {
2
+ function o(r) {
3
+ return typeof r == "string";
4
+ }
5
+ function a(r) {
6
+ return typeof r == "number";
7
+ }
8
+ function c(r, n) {
9
+ return (() => {
10
+ const u = n.property, s = n.operator;
11
+ let e = n.value;
12
+ if (n && n.property === "urlPath" && n.value && typeof n.value == "string" && n.value !== "/" && n.value.endsWith("/") && (e = n.value.slice(0, -1)), !(u && s))
13
+ return !0;
14
+ if (Array.isArray(e))
15
+ return s === "isNot" ? e.every((v) => c(r, {
16
+ property: u,
17
+ operator: s,
18
+ value: v
19
+ })) : !!e.find((v) => c(r, {
20
+ property: u,
21
+ operator: s,
22
+ value: v
23
+ }));
24
+ const t = r[u];
25
+ if (Array.isArray(t))
26
+ return t.includes(e);
27
+ switch (s) {
28
+ case "is":
29
+ return t === e;
30
+ case "isNot":
31
+ return t !== e;
32
+ case "contains":
33
+ return (o(t) || Array.isArray(t)) && t.includes(String(e));
34
+ case "startsWith":
35
+ return o(t) && t.startsWith(String(e));
36
+ case "endsWith":
37
+ return o(t) && t.endsWith(String(e));
38
+ case "greaterThan":
39
+ return a(t) && a(e) && t > e;
40
+ case "lessThan":
41
+ return a(t) && a(e) && t < e;
42
+ case "greaterThanOrEqualTo":
43
+ return a(t) && a(e) && t >= e;
44
+ case "lessThanOrEqualTo":
45
+ return a(t) && a(e) && t <= e;
46
+ default:
47
+ return !1;
48
+ }
49
+ })();
50
+ }
51
+ const i = {
52
+ query: f,
53
+ startDate: y,
54
+ endDate: p
55
+ }, d = l.date && new Date(l.date) || /* @__PURE__ */ new Date();
56
+ return i.startDate && new Date(i.startDate) > d || i.endDate && new Date(i.endDate) < d ? !1 : !i.query || !i.query.length ? !0 : i.query.every((r) => c(l, r));
57
+ }
58
+ const b = `function getPersonalizedVariant(variants, blockId, isHydrationTarget, locale) {
59
+ if (!navigator.cookieEnabled) {
60
+ return;
61
+ }
62
+ function getCookie(name) {
63
+ const nameEQ = name + '=';
64
+ const ca = document.cookie.split(';');
65
+ for (let i = 0; i < ca.length; i++) {
66
+ let c = ca[i];
67
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
68
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
69
+ }
70
+ return null;
71
+ }
72
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
73
+ if (locale) {
74
+ attributes.locale = locale;
75
+ }
76
+ const winningVariantIndex = variants?.findIndex(function (variant) {
77
+ return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
78
+ });
79
+ const parentDiv = document.currentScript?.parentElement;
80
+ const variantId = parentDiv?.getAttribute('data-variant-id');
81
+ const isDefaultVariant = variantId === \`\${blockId}-default\`;
82
+ const isWinningVariant = winningVariantIndex !== -1 && variantId === \`\${blockId}-\${winningVariantIndex}\` || winningVariantIndex === -1 && isDefaultVariant;
83
+ if (isWinningVariant && !isDefaultVariant) {
84
+ parentDiv?.removeAttribute('hidden');
85
+ parentDiv?.removeAttribute('aria-hidden');
86
+ } else if (!isWinningVariant && isDefaultVariant) {
87
+ parentDiv?.setAttribute('hidden', 'true');
88
+ parentDiv?.setAttribute('aria-hidden', 'true');
89
+ }
90
+ if (isHydrationTarget) {
91
+ if (!isWinningVariant) {
92
+ const itsStyleEl = parentDiv?.previousElementSibling;
93
+ if (itsStyleEl) {
94
+ itsStyleEl.remove();
95
+ }
96
+ parentDiv?.remove();
97
+ }
98
+ const thisScript = document.currentScript;
99
+ if (thisScript) {
100
+ thisScript.remove();
101
+ }
102
+ }
103
+ }`, h = `function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
104
+ function isString(val) {
105
+ return typeof val === 'string';
106
+ }
107
+ function isNumber(val) {
108
+ return typeof val === 'number';
109
+ }
110
+ function objectMatchesQuery(userattr, query) {
111
+ const result = (() => {
112
+ const property = query.property;
113
+ const operator = query.operator;
114
+ let testValue = query.value;
115
+ if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {
116
+ testValue = query.value.slice(0, -1);
117
+ }
118
+ if (!(property && operator)) {
119
+ return true;
120
+ }
121
+ if (Array.isArray(testValue)) {
122
+ if (operator === 'isNot') {
123
+ return testValue.every(val => objectMatchesQuery(userattr, {
124
+ property,
125
+ operator,
126
+ value: val
127
+ }));
128
+ }
129
+ return !!testValue.find(val => objectMatchesQuery(userattr, {
130
+ property,
131
+ operator,
132
+ value: val
133
+ }));
134
+ }
135
+ const value = userattr[property];
136
+ if (Array.isArray(value)) {
137
+ return value.includes(testValue);
138
+ }
139
+ switch (operator) {
140
+ case 'is':
141
+ return value === testValue;
142
+ case 'isNot':
143
+ return value !== testValue;
144
+ case 'contains':
145
+ return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
146
+ case 'startsWith':
147
+ return isString(value) && value.startsWith(String(testValue));
148
+ case 'endsWith':
149
+ return isString(value) && value.endsWith(String(testValue));
150
+ case 'greaterThan':
151
+ return isNumber(value) && isNumber(testValue) && value > testValue;
152
+ case 'lessThan':
153
+ return isNumber(value) && isNumber(testValue) && value < testValue;
154
+ case 'greaterThanOrEqualTo':
155
+ return isNumber(value) && isNumber(testValue) && value >= testValue;
156
+ case 'lessThanOrEqualTo':
157
+ return isNumber(value) && isNumber(testValue) && value <= testValue;
158
+ default:
159
+ return false;
160
+ }
161
+ })();
162
+ return result;
163
+ }
164
+ const item = {
165
+ query,
166
+ startDate,
167
+ endDate
168
+ };
169
+ const now = userAttributes.date && new Date(userAttributes.date) || new Date();
170
+ if (item.startDate && new Date(item.startDate) > now) {
171
+ return false;
172
+ } else if (item.endDate && new Date(item.endDate) < now) {
173
+ return false;
174
+ }
175
+ if (!item.query || !item.query.length) {
176
+ return true;
177
+ }
178
+ return item.query.every(filter => {
179
+ return objectMatchesQuery(userAttributes, filter);
180
+ });
181
+ }`, S = `function updateVisibilityStylesScript(variants, blockId, isHydrationTarget, locale) {
182
+ function getCookie(name) {
183
+ const nameEQ = name + '=';
184
+ const ca = document.cookie.split(';');
185
+ for (let i = 0; i < ca.length; i++) {
186
+ let c = ca[i];
187
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
188
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
189
+ }
190
+ return null;
191
+ }
192
+ const visibilityStylesEl = document.currentScript?.previousElementSibling;
193
+ if (!visibilityStylesEl) {
194
+ return;
195
+ }
196
+ if (isHydrationTarget) {
197
+ visibilityStylesEl.remove();
198
+ const currentScript = document.currentScript;
199
+ if (currentScript) {
200
+ currentScript.remove();
201
+ }
202
+ } else {
203
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
204
+ if (locale) {
205
+ attributes.locale = locale;
206
+ }
207
+ const winningVariantIndex = variants?.findIndex(function (variant) {
208
+ return window.filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
209
+ });
210
+ if (winningVariantIndex !== -1) {
211
+ let newStyleStr = variants?.map((_, index) => {
212
+ if (index === winningVariantIndex) return '';
213
+ return \`div[data-variant-id="\${blockId}-\${index}"] { display: none !important; } \`;
214
+ }).join('') || '';
215
+ newStyleStr += \`div[data-variant-id="\${blockId}-default"] { display: none !important; } \`;
216
+ visibilityStylesEl.innerHTML = newStyleStr;
217
+ }
218
+ }
219
+ }`;
220
+ export {
221
+ h as FILTER_WITH_CUSTOM_TARGETING_SCRIPT,
222
+ b as PERSONALIZATION_SCRIPT,
223
+ S as UPDATE_VISIBILITY_STYLES_SCRIPT,
224
+ m as filterWithCustomTargeting
225
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../constants/target.cjs"),_=require("../../functions/is-browser.cjs"),N=require("../../functions/is-editing.cjs"),r=require("./helpers/inlined-fns.cjs"),u="default",g="filterWithCustomTargeting",R="builderIoPersonalization",E="updateVisibilityStylesScript",l=["react","vue","svelte"],P=["vue","svelte"];function d(t,i){return!(t&&t.length>0)||!i?!1:P.includes(c.TARGET)?!0:!_.isBrowser()}function $({variants:t,previewingIndex:i,isHydrated:n,filteredVariants:o,fallbackBlocks:s}){var I;const T={blocks:s!=null?s:[],path:"this.children",index:u};if(n&&N.isEditing()){if(typeof i=="number"&&i<((I=t==null?void 0:t.length)!=null?I:0)){const e=t==null?void 0:t[i];if(e)return{blocks:e.blocks,path:`variants.${i}.blocks`,index:i}}return T}if(_.isBrowser()){const e=o==null?void 0:o[0];if(e&&t){const S=t.indexOf(e);if(S!==-1)return{blocks:e.blocks,path:`variants.${S}.blocks`,index:S}}}return T}const O=()=>`
2
+ window.${g} = ${r.FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
3
+ window.${R} = ${r.PERSONALIZATION_SCRIPT}
4
+ window.${E} = ${r.UPDATE_VISIBILITY_STYLES_SCRIPT}
5
+ `,A=c.TARGET==="react",f=(t,i,n)=>`window.${R}(${JSON.stringify(t)}, "${i}", ${A}${n?`, "${n}"`:""})`,h=(t,i,n)=>`window.${E}(${JSON.stringify(t)}, "${i}", ${A}${n?`, "${n}"`:""})`;exports.filterWithCustomTargeting=r.filterWithCustomTargeting;exports.DEFAULT_INDEX=u;exports.SDKS_REQUIRING_RESET_APPROACH=P;exports.SDKS_SUPPORTING_PERSONALIZATION=l;exports.checkShouldRenderVariants=d;exports.getBlocksToRender=$;exports.getInitPersonalizationVariantsFnsScriptString=O;exports.getPersonalizationScript=f;exports.getUpdateVisibilityStylesScript=h;
@@ -0,0 +1,64 @@
1
+ import { TARGET as S } from "../../constants/target.mjs";
2
+ import { isBrowser as _ } from "../../functions/is-browser.mjs";
3
+ import { isEditing as E } from "../../functions/is-editing.mjs";
4
+ import { FILTER_WITH_CUSTOM_TARGETING_SCRIPT as f, PERSONALIZATION_SCRIPT as N, UPDATE_VISIBILITY_STYLES_SCRIPT as $ } from "./helpers/inlined-fns.mjs";
5
+ import { filterWithCustomTargeting as D } from "./helpers/inlined-fns.mjs";
6
+ const A = "default", P = "filterWithCustomTargeting", c = "builderIoPersonalization", u = "updateVisibilityStylesScript", p = ["react", "vue", "svelte"], O = ["vue", "svelte"];
7
+ function l(t, n) {
8
+ return !(t && t.length > 0) || !n ? !1 : O.includes(S) ? !0 : !_();
9
+ }
10
+ function C({
11
+ variants: t,
12
+ previewingIndex: n,
13
+ isHydrated: o,
14
+ filteredVariants: r,
15
+ fallbackBlocks: e
16
+ }) {
17
+ var I;
18
+ const T = {
19
+ blocks: e != null ? e : [],
20
+ path: "this.children",
21
+ index: A
22
+ };
23
+ if (o && E()) {
24
+ if (typeof n == "number" && n < ((I = t == null ? void 0 : t.length) != null ? I : 0)) {
25
+ const i = t == null ? void 0 : t[n];
26
+ if (i)
27
+ return {
28
+ blocks: i.blocks,
29
+ path: `variants.${n}.blocks`,
30
+ index: n
31
+ };
32
+ }
33
+ return T;
34
+ }
35
+ if (_()) {
36
+ const i = r == null ? void 0 : r[0];
37
+ if (i && t) {
38
+ const s = t.indexOf(i);
39
+ if (s !== -1)
40
+ return {
41
+ blocks: i.blocks,
42
+ path: `variants.${s}.blocks`,
43
+ index: s
44
+ };
45
+ }
46
+ }
47
+ return T;
48
+ }
49
+ const L = () => `
50
+ window.${P} = ${f}
51
+ window.${c} = ${N}
52
+ window.${u} = ${$}
53
+ `, R = S === "react", U = (t, n, o) => `window.${c}(${JSON.stringify(t)}, "${n}", ${R}${o ? `, "${o}"` : ""})`, b = (t, n, o) => `window.${u}(${JSON.stringify(t)}, "${n}", ${R}${o ? `, "${o}"` : ""})`;
54
+ export {
55
+ A as DEFAULT_INDEX,
56
+ O as SDKS_REQUIRING_RESET_APPROACH,
57
+ p as SDKS_SUPPORTING_PERSONALIZATION,
58
+ l as checkShouldRenderVariants,
59
+ D as filterWithCustomTargeting,
60
+ C as getBlocksToRender,
61
+ L as getInitPersonalizationVariantsFnsScriptString,
62
+ U as getPersonalizationScript,
63
+ b as getUpdateVisibilityStylesScript
64
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";const r=require("react/jsx-runtime"),a=require("react"),k=require("../../components/blocks/blocks.cjs"),v=require("../../components/inlined-script.cjs"),H=require("../../components/inlined-styles.cjs"),C=require("../../constants/target.cjs"),U=require("../../functions/get-class-prop-name.cjs"),L=require("../../functions/is-editing.cjs"),z=require("../../functions/is-previewing.cjs"),K=require("../../helpers/canTrack.cjs"),V=require("../../helpers/user-attributes.cjs"),s=require("./helpers.cjs"),Q=require("./helpers/inlined-fns.cjs");function X(e){var g,f,B,m,A,P,$,T,y,q,D,I,_;const c=a.useRef(null),[N,w]=a.useState(()=>V.userAttributesService.getUserAttributes()),[x,J]=a.useState(()=>{var t,n,i;return s.getPersonalizationScript(e.variants,((t=e.builderBlock)==null?void 0:t.id)||"none",(i=(n=e.builderContext)==null?void 0:n.rootState)==null?void 0:i.locale)}),[W,M]=a.useState(()=>{var t,n,i;return s.getUpdateVisibilityStylesScript(e.variants,((t=e.builderBlock)==null?void 0:t.id)||"none",(i=(n=e.builderContext)==null?void 0:n.rootState)==null?void 0:i.locale)}),[h,Y]=a.useState(()=>[]),[E,Z]=a.useState(()=>{var t;return s.checkShouldRenderVariants(e.variants,K.getDefaultCanTrack((t=e.builderContext)==null?void 0:t.canTrack))}),[S,F]=a.useState(()=>!1);function G(){return{...e.attributes,[U.getClassPropName()]:`builder-personalization-container ${e.attributes[U.getClassPropName()]||""}`}}function R(){return(e.variants||[]).filter(t=>{var n,i,o,l;return Q.filterWithCustomTargeting({...(i=(n=e.builderContext)==null?void 0:n.rootState)!=null&&i.locale?{locale:(l=(o=e.builderContext)==null?void 0:o.rootState)==null?void 0:l.locale}:{},...N},t.query,t.startDate,t.endDate)})}function u(){var t;return s.getBlocksToRender({variants:e.variants,fallbackBlocks:(t=e.builderBlock)==null?void 0:t.children,isHydrated:S,filteredVariants:R(),previewingIndex:e.previewingIndex})}function O(){return(e.variants||[]).map((t,n)=>{var i;return`div[data-variant-id="${(i=e.builderBlock)==null?void 0:i.id}-${n}"] { display: none !important; } `}).join("")}return a.useEffect(()=>{var n;F(!0);const t=V.userAttributesService.subscribeOnUserAttributesChange(i=>{w(i)});if(!(L.isEditing()||z.isPreviewing())){const i=R()[0];c.current&&(c.current.dispatchEvent(new CustomEvent("builder.variantLoaded",{detail:{variant:i||s.DEFAULT_INDEX,content:(n=e.builderContext)==null?void 0:n.content},bubbles:!0})),new IntersectionObserver(l=>{l.forEach(b=>{var d;b.isIntersecting&&c.current&&c.current.dispatchEvent(new CustomEvent("builder.variantDisplayed",{detail:{variant:i||s.DEFAULT_INDEX,content:(d=e.builderContext)==null?void 0:d.content},bubbles:!0}))})}).observe(c.current))}h.push(t)},[]),a.useEffect(()=>()=>{h.forEach(t=>t())},[]),r.jsxs("div",{ref:c,...G(),children:[S&&s.SDKS_REQUIRING_RESET_APPROACH.includes(C.TARGET)?r.jsx(k,{blocks:u().blocks,parent:(g=e.builderBlock)==null?void 0:g.id,path:u().path,context:e.builderContext,registeredComponents:e.builderComponents,BlocksWrapperProps:{...(f=e.builderContext)==null?void 0:f.BlocksWrapperProps,"data-variant-id":`${(B=e.builderBlock)==null?void 0:B.id}-${u().index}`}}):null,!S&&s.SDKS_REQUIRING_RESET_APPROACH.includes(C.TARGET)||!s.SDKS_REQUIRING_RESET_APPROACH.includes(C.TARGET)?r.jsxs(r.Fragment,{children:[E?r.jsxs(r.Fragment,{children:[r.jsx(H,{nonce:((m=e.builderContext)==null?void 0:m.nonce)||"",styles:O(),id:`variants-styles-${(A=e.builderBlock)==null?void 0:A.id}`}),r.jsx(v,{nonce:((P=e.builderContext)==null?void 0:P.nonce)||"",scriptStr:W,id:`variants-visibility-script-${($=e.builderBlock)==null?void 0:$.id}`}),(T=e.variants)==null?void 0:T.map((t,n)=>{var i,o,l,b,d,j;return r.jsx(k,{BlocksWrapperProps:{...(i=e.builderContext)==null?void 0:i.BlocksWrapperProps,"aria-hidden":!0,hidden:!0,"data-variant-id":`${(o=e.builderBlock)==null?void 0:o.id}-${n}`},blocks:t.blocks,parent:(l=e.builderBlock)==null?void 0:l.id,path:`component.options.variants.${n}.blocks`,context:e.builderContext,registeredComponents:e.builderComponents,children:r.jsx(v,{nonce:((b=e.builderContext)==null?void 0:b.nonce)||"",scriptStr:x,id:`variants-script-${(d=e.builderBlock)==null?void 0:d.id}-${n}`})},`${(j=e.builderBlock)==null?void 0:j.id}-${n}`)})]}):null,r.jsx(k,{blocks:u().blocks,parent:(y=e.builderBlock)==null?void 0:y.id,path:u().path,context:e.builderContext,registeredComponents:e.builderComponents,BlocksWrapperProps:{...(q=e.builderContext)==null?void 0:q.BlocksWrapperProps,"data-variant-id":`${(D=e.builderBlock)==null?void 0:D.id}-${u().index}`},children:E?r.jsx(v,{nonce:((I=e.builderContext)==null?void 0:I.nonce)||"",scriptStr:x,id:`variants-script-${(_=e.builderBlock)==null?void 0:_.id}-${s.DEFAULT_INDEX}`}):null})]}):null]})}module.exports=X;