@builder.io/sdk-react-nextjs 0.12.7 → 0.13.0
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/lib/browser/USE_CLIENT_BUNDLE-159cd63c.cjs +21 -0
- package/lib/browser/{USE_CLIENT_BUNDLE-456ca2b5.js → USE_CLIENT_BUNDLE-21701cae.js} +169 -175
- package/lib/{edge/USE_SERVER_BUNDLE-dbf92938.cjs → browser/USE_SERVER_BUNDLE-316838af.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-dffaa191.js → browser/USE_SERVER_BUNDLE-37ad955b.js} +1 -1
- package/lib/browser/{bundle-56e0b400.js → bundle-2b431a2f.js} +347 -300
- package/lib/browser/{bundle-a408994f.cjs → bundle-f3f9789e.cjs} +19 -19
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +20 -19
- package/lib/{node/USE_CLIENT_BUNDLE-499aeaa2.js → edge/USE_CLIENT_BUNDLE-45eaf3a0.js} +169 -175
- package/lib/edge/USE_CLIENT_BUNDLE-4cfda43e.cjs +21 -0
- package/lib/{node/USE_SERVER_BUNDLE-b3ad9a89.cjs → edge/USE_SERVER_BUNDLE-b7a4b5c9.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-e3da6caa.js → edge/USE_SERVER_BUNDLE-e82f4d04.js} +1 -1
- package/lib/edge/{bundle-97ad81d1.cjs → bundle-27694b25.cjs} +25 -25
- package/lib/edge/{bundle-4bf88f38.js → bundle-85928e24.js} +388 -341
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +20 -19
- package/lib/{edge/USE_CLIENT_BUNDLE-789e694f.js → node/USE_CLIENT_BUNDLE-354a3b9c.js} +169 -175
- package/lib/node/USE_CLIENT_BUNDLE-79508098.cjs +21 -0
- package/lib/{browser/USE_SERVER_BUNDLE-ee4a5d19.cjs → node/USE_SERVER_BUNDLE-2d5ccb94.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-e0f1c15b.js → node/USE_SERVER_BUNDLE-81b76cf3.js} +1 -1
- package/lib/node/{bundle-97b4832a.cjs → bundle-48c4d422.cjs} +9 -9
- package/lib/node/{bundle-d3f89e99.js → bundle-7efdf8b6.js} +64 -17
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +20 -19
- package/package.json +1 -1
- package/types/cjs/components/content-variants/helpers.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/get-content/types.d.ts +2 -2
- package/types/cjs/helpers/preview-lru-cache/get.d.ts +1 -1
- package/types/cjs/helpers/subscribe-to-editor.d.ts +35 -0
- package/types/cjs/server-index.d.ts +18 -3
- package/types/cjs/types/api-version.d.ts +1 -1
- package/types/esm/components/content-variants/helpers.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-content/types.d.ts +2 -2
- package/types/esm/helpers/preview-lru-cache/get.d.ts +1 -1
- package/types/esm/helpers/subscribe-to-editor.d.ts +35 -0
- package/types/esm/server-index.d.ts +18 -3
- package/types/esm/types/api-version.d.ts +1 -1
- package/lib/browser/USE_CLIENT_BUNDLE-9d2b983d.cjs +0 -21
- package/lib/edge/USE_CLIENT_BUNDLE-a6a0becc.cjs +0 -21
- package/lib/node/USE_CLIENT_BUNDLE-b2f9be29.cjs +0 -21
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { LRUCache as
|
|
2
|
-
import { jsx as l, Fragment as
|
|
3
|
-
import { I as
|
|
1
|
+
import { LRUCache as $e } from "lru-cache";
|
|
2
|
+
import { jsx as l, Fragment as k, jsxs as R } from "react/jsx-runtime";
|
|
3
|
+
import { I as We, B as Oe, a as Ne, D as Fe, b as Le, C as Ue, E as _e, F as De, c as Me, d as je, S as He, V as Ke, e as ze } from "./USE_CLIENT_BUNDLE-21701cae.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "next/navigation";
|
|
6
|
-
const
|
|
6
|
+
const qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), to = (e) => typeof e == "string" && qe.has(e.toLowerCase()), I = "rsc", M = () => {
|
|
7
7
|
switch (I) {
|
|
8
8
|
case "react":
|
|
9
9
|
case "reactNative":
|
|
@@ -16,7 +16,7 @@ const ze = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr",
|
|
|
16
16
|
return "class";
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
function
|
|
19
|
+
function Ge(e) {
|
|
20
20
|
var t;
|
|
21
21
|
return {
|
|
22
22
|
...(t = e.component) == null ? void 0 : t.options,
|
|
@@ -27,29 +27,29 @@ function qe(e) {
|
|
|
27
27
|
builderBlock: e
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
const P = "[Builder.io]: ",
|
|
30
|
+
const P = "[Builder.io]: ", v = {
|
|
31
31
|
log: (...e) => console.log(P, ...e),
|
|
32
32
|
error: (...e) => console.error(P, ...e),
|
|
33
33
|
warn: (...e) => console.warn(P, ...e),
|
|
34
34
|
debug: (...e) => console.debug(P, ...e)
|
|
35
35
|
};
|
|
36
|
-
function
|
|
36
|
+
function S() {
|
|
37
37
|
return typeof window < "u" && typeof document < "u";
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
return
|
|
39
|
+
function Je() {
|
|
40
|
+
return S() && window.self !== window.top;
|
|
41
41
|
}
|
|
42
42
|
function j() {
|
|
43
|
-
return
|
|
43
|
+
return Je() && window.location.search.indexOf("builder.frameEditing=") !== -1;
|
|
44
44
|
}
|
|
45
45
|
const Ye = () => {
|
|
46
|
-
if (
|
|
46
|
+
if (S()) {
|
|
47
47
|
const e = new URL(location.href);
|
|
48
48
|
return e.pathname === "" && (e.pathname = "/"), e;
|
|
49
49
|
} else
|
|
50
50
|
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
51
|
-
},
|
|
52
|
-
const e =
|
|
51
|
+
}, Qe = () => typeof navigator == "object" && navigator.userAgent || "", le = () => {
|
|
52
|
+
const e = Qe(), t = {
|
|
53
53
|
Android() {
|
|
54
54
|
return e.match(/Android/i);
|
|
55
55
|
},
|
|
@@ -74,7 +74,7 @@ const Ye = () => {
|
|
|
74
74
|
host: (o == null ? void 0 : o.host) || (o == null ? void 0 : o.hostname),
|
|
75
75
|
device: n ? "tablet" : t.any() ? "mobile" : "desktop"
|
|
76
76
|
};
|
|
77
|
-
},
|
|
77
|
+
}, Xe = ({
|
|
78
78
|
builder: e,
|
|
79
79
|
context: t,
|
|
80
80
|
event: n,
|
|
@@ -86,12 +86,12 @@ const Ye = () => {
|
|
|
86
86
|
builder: e,
|
|
87
87
|
context: t,
|
|
88
88
|
event: n
|
|
89
|
-
}),
|
|
89
|
+
}), Ze = () => ({
|
|
90
90
|
isEditing: j(),
|
|
91
|
-
isBrowser:
|
|
92
|
-
isServer: !
|
|
91
|
+
isBrowser: S(),
|
|
92
|
+
isServer: !S(),
|
|
93
93
|
getUserAttributes: () => le()
|
|
94
|
-
}),
|
|
94
|
+
}), et = (e, {
|
|
95
95
|
isExpression: t = !0
|
|
96
96
|
}) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, G = ({
|
|
97
97
|
code: e,
|
|
@@ -102,7 +102,7 @@ const Ye = () => {
|
|
|
102
102
|
rootSetState: r,
|
|
103
103
|
rootState: a
|
|
104
104
|
}) => {
|
|
105
|
-
const s =
|
|
105
|
+
const s = Xe({
|
|
106
106
|
builder: t,
|
|
107
107
|
context: n,
|
|
108
108
|
event: o,
|
|
@@ -140,17 +140,17 @@ function de({
|
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
const C = (e) => e != null;
|
|
143
|
-
function
|
|
143
|
+
function tt() {
|
|
144
144
|
var e;
|
|
145
145
|
return typeof process < "u" && C((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
|
|
146
146
|
}
|
|
147
|
-
const
|
|
147
|
+
const nt = () => {
|
|
148
148
|
var o;
|
|
149
|
-
if (!
|
|
149
|
+
if (!tt())
|
|
150
150
|
return !1;
|
|
151
151
|
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
|
|
152
|
-
return e && t && !n ? (
|
|
153
|
-
},
|
|
152
|
+
return e && t && !n ? (v.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
|
|
153
|
+
}, ot = (e) => (S() || nt(), G(e));
|
|
154
154
|
function H({
|
|
155
155
|
code: e,
|
|
156
156
|
context: t,
|
|
@@ -161,14 +161,14 @@ function H({
|
|
|
161
161
|
isExpression: a = !0
|
|
162
162
|
}) {
|
|
163
163
|
if (e === "") {
|
|
164
|
-
|
|
164
|
+
v.warn("Skipping evaluation of empty code block.");
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
167
|
const s = {
|
|
168
|
-
code:
|
|
168
|
+
code: et(e, {
|
|
169
169
|
isExpression: a
|
|
170
170
|
}),
|
|
171
|
-
builder:
|
|
171
|
+
builder: Ze(),
|
|
172
172
|
context: t,
|
|
173
173
|
event: r,
|
|
174
174
|
rootSetState: i,
|
|
@@ -176,21 +176,21 @@ function H({
|
|
|
176
176
|
localState: n
|
|
177
177
|
};
|
|
178
178
|
try {
|
|
179
|
-
return
|
|
179
|
+
return ot(s);
|
|
180
180
|
} catch (c) {
|
|
181
|
-
|
|
181
|
+
v.error("Failed code evaluation: " + c.message, {
|
|
182
182
|
code: e
|
|
183
183
|
});
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
const W = (e) => JSON.parse(JSON.stringify(e)),
|
|
187
|
+
const W = (e) => JSON.parse(JSON.stringify(e)), it = (e, t, n) => {
|
|
188
188
|
if (Object(e) !== e)
|
|
189
189
|
return e;
|
|
190
190
|
const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
191
191
|
return o.slice(0, -1).reduce((i, r, a) => Object(i[r]) === i[r] ? i[r] : i[r] = Math.abs(Number(o[a + 1])) >> 0 === +o[a + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
|
|
192
192
|
};
|
|
193
|
-
const
|
|
193
|
+
const rt = ({
|
|
194
194
|
block: e,
|
|
195
195
|
context: t,
|
|
196
196
|
localState: n,
|
|
@@ -216,7 +216,7 @@ const it = ({
|
|
|
216
216
|
rootSetState: i,
|
|
217
217
|
context: t
|
|
218
218
|
});
|
|
219
|
-
|
|
219
|
+
it(a, s, m);
|
|
220
220
|
}
|
|
221
221
|
return a;
|
|
222
222
|
};
|
|
@@ -229,7 +229,7 @@ function $({
|
|
|
229
229
|
rootSetState: r
|
|
230
230
|
}) {
|
|
231
231
|
const a = e;
|
|
232
|
-
return n ?
|
|
232
|
+
return n ? rt({
|
|
233
233
|
block: a,
|
|
234
234
|
localState: o,
|
|
235
235
|
rootState: i,
|
|
@@ -237,7 +237,7 @@ function $({
|
|
|
237
237
|
context: t
|
|
238
238
|
}) : a;
|
|
239
239
|
}
|
|
240
|
-
const
|
|
240
|
+
const at = ({
|
|
241
241
|
block: e,
|
|
242
242
|
context: t,
|
|
243
243
|
registeredComponents: n
|
|
@@ -259,7 +259,7 @@ const rt = ({
|
|
|
259
259
|
console.warn(`
|
|
260
260
|
Could not find a registered component named "${o}".
|
|
261
261
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
262
|
-
},
|
|
262
|
+
}, st = ({
|
|
263
263
|
block: e,
|
|
264
264
|
context: t
|
|
265
265
|
}) => {
|
|
@@ -308,7 +308,7 @@ const rt = ({
|
|
|
308
308
|
default: 991,
|
|
309
309
|
max: 1200
|
|
310
310
|
}
|
|
311
|
-
},
|
|
311
|
+
}, J = (e, t = ue) => `@media (max-width: ${t[e].max}px)`, me = ({
|
|
312
312
|
small: e,
|
|
313
313
|
medium: t
|
|
314
314
|
}) => {
|
|
@@ -334,17 +334,17 @@ const rt = ({
|
|
|
334
334
|
min: r,
|
|
335
335
|
default: r + 1
|
|
336
336
|
}, n;
|
|
337
|
-
},
|
|
337
|
+
}, ct = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), fe = (e) => Object.entries(e).map(([n, o]) => {
|
|
338
338
|
if (typeof o == "string")
|
|
339
|
-
return `${
|
|
340
|
-
}).filter(C),
|
|
339
|
+
return `${ct(n)}: ${o};`;
|
|
340
|
+
}).filter(C), lt = (e) => fe(e).join(`
|
|
341
341
|
`), L = ({
|
|
342
342
|
mediaQuery: e,
|
|
343
343
|
className: t,
|
|
344
344
|
styles: n
|
|
345
345
|
}) => {
|
|
346
346
|
const o = `.${t} {
|
|
347
|
-
${
|
|
347
|
+
${lt(n)}
|
|
348
348
|
}`;
|
|
349
349
|
return e ? `${e} {
|
|
350
350
|
${o}
|
|
@@ -353,7 +353,7 @@ const rt = ({
|
|
|
353
353
|
function O(e) {
|
|
354
354
|
return /* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function dt(e) {
|
|
357
357
|
const t = function() {
|
|
358
358
|
const i = $({
|
|
359
359
|
block: e.block,
|
|
@@ -384,26 +384,26 @@ function lt(e) {
|
|
|
384
384
|
}) : "", h = m ? L({
|
|
385
385
|
className: p,
|
|
386
386
|
styles: m,
|
|
387
|
-
mediaQuery:
|
|
387
|
+
mediaQuery: J(
|
|
388
388
|
"medium",
|
|
389
389
|
s
|
|
390
390
|
)
|
|
391
391
|
}) : "", u = g ? L({
|
|
392
392
|
className: p,
|
|
393
393
|
styles: g,
|
|
394
|
-
mediaQuery:
|
|
394
|
+
mediaQuery: J(
|
|
395
395
|
"small",
|
|
396
396
|
s
|
|
397
397
|
)
|
|
398
398
|
}) : "";
|
|
399
399
|
return [f, h, u].join(" ");
|
|
400
400
|
};
|
|
401
|
-
return /* @__PURE__ */ l(
|
|
401
|
+
return /* @__PURE__ */ l(k, { children: n() && t() ? /* @__PURE__ */ l(k, { children: /* @__PURE__ */ l(O, { styles: n() }) }) : null });
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function ut(e) {
|
|
404
404
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
405
405
|
}
|
|
406
|
-
const
|
|
406
|
+
const mt = (e) => `on${ut(e)}`, ft = (e, t) => (n) => H({
|
|
407
407
|
code: e,
|
|
408
408
|
context: t.context,
|
|
409
409
|
localState: t.localState,
|
|
@@ -412,13 +412,13 @@ const ut = (e) => `on${dt(e)}`, mt = (e, t) => (n) => H({
|
|
|
412
412
|
event: n,
|
|
413
413
|
isExpression: !1
|
|
414
414
|
});
|
|
415
|
-
function
|
|
415
|
+
function no(e) {
|
|
416
416
|
const t = {}, n = e.block.actions ?? {};
|
|
417
417
|
for (const o in n) {
|
|
418
418
|
if (!n.hasOwnProperty(o))
|
|
419
419
|
continue;
|
|
420
420
|
const i = n[o];
|
|
421
|
-
let r =
|
|
421
|
+
let r = mt(o);
|
|
422
422
|
if (e.stripPrefix)
|
|
423
423
|
switch (I) {
|
|
424
424
|
case "vue":
|
|
@@ -428,19 +428,19 @@ function eo(e) {
|
|
|
428
428
|
r = r.replace("on:", "");
|
|
429
429
|
break;
|
|
430
430
|
}
|
|
431
|
-
t[r] =
|
|
431
|
+
t[r] = ft(i, e);
|
|
432
432
|
}
|
|
433
433
|
return t;
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function ht({
|
|
436
436
|
style: e
|
|
437
437
|
}) {
|
|
438
438
|
return e;
|
|
439
439
|
}
|
|
440
|
-
const
|
|
440
|
+
const pt = ({
|
|
441
441
|
block: e,
|
|
442
442
|
context: t
|
|
443
|
-
}) => he(
|
|
443
|
+
}) => he(ht({
|
|
444
444
|
style: e.style || {},
|
|
445
445
|
context: t,
|
|
446
446
|
block: e
|
|
@@ -458,36 +458,36 @@ function he(e) {
|
|
|
458
458
|
return e;
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function gt({
|
|
462
462
|
properties: e
|
|
463
463
|
}) {
|
|
464
464
|
return e;
|
|
465
465
|
}
|
|
466
|
-
const
|
|
466
|
+
const bt = (e) => ({
|
|
467
467
|
href: e.href
|
|
468
468
|
});
|
|
469
|
-
function
|
|
469
|
+
function yt({
|
|
470
470
|
block: e,
|
|
471
471
|
context: t
|
|
472
472
|
}) {
|
|
473
473
|
var o;
|
|
474
474
|
const n = {
|
|
475
|
-
...
|
|
475
|
+
...bt(e),
|
|
476
476
|
...e.properties,
|
|
477
477
|
"builder-id": e.id,
|
|
478
|
-
style:
|
|
478
|
+
style: pt({
|
|
479
479
|
block: e,
|
|
480
480
|
context: t
|
|
481
481
|
}),
|
|
482
482
|
[M()]: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
|
|
483
483
|
};
|
|
484
|
-
return
|
|
484
|
+
return gt({
|
|
485
485
|
properties: n,
|
|
486
486
|
context: t,
|
|
487
487
|
block: e
|
|
488
488
|
});
|
|
489
489
|
}
|
|
490
|
-
const
|
|
490
|
+
const kt = ({
|
|
491
491
|
componentOptions: e,
|
|
492
492
|
builderBlock: t,
|
|
493
493
|
context: n,
|
|
@@ -503,7 +503,7 @@ const yt = ({
|
|
|
503
503
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
504
504
|
*/
|
|
505
505
|
...i ? {
|
|
506
|
-
attributes:
|
|
506
|
+
attributes: yt({
|
|
507
507
|
block: t,
|
|
508
508
|
context: a
|
|
509
509
|
})
|
|
@@ -517,13 +517,13 @@ const yt = ({
|
|
|
517
517
|
includeBlockProps: i
|
|
518
518
|
} : s;
|
|
519
519
|
};
|
|
520
|
-
function
|
|
520
|
+
function Y(e) {
|
|
521
521
|
var n;
|
|
522
|
-
const t = e.isInteractive ?
|
|
523
|
-
return /* @__PURE__ */ l(
|
|
522
|
+
const t = e.isInteractive ? We : e.componentRef;
|
|
523
|
+
return /* @__PURE__ */ l(k, { children: e.componentRef ? /* @__PURE__ */ l(k, { children: /* @__PURE__ */ l(
|
|
524
524
|
t,
|
|
525
525
|
{
|
|
526
|
-
...
|
|
526
|
+
...kt({
|
|
527
527
|
componentOptions: e.componentOptions,
|
|
528
528
|
builderBlock: e.builderBlock,
|
|
529
529
|
context: e.context,
|
|
@@ -561,13 +561,13 @@ function St(e) {
|
|
|
561
561
|
function N(e) {
|
|
562
562
|
var m, g, p;
|
|
563
563
|
const t = function() {
|
|
564
|
-
return
|
|
564
|
+
return at({
|
|
565
565
|
block: e.block,
|
|
566
566
|
context: e.context,
|
|
567
567
|
registeredComponents: e.registeredComponents
|
|
568
568
|
});
|
|
569
569
|
}, n = function() {
|
|
570
|
-
return
|
|
570
|
+
return st({
|
|
571
571
|
block: e.block,
|
|
572
572
|
context: e.context
|
|
573
573
|
});
|
|
@@ -594,17 +594,17 @@ function N(e) {
|
|
|
594
594
|
var u;
|
|
595
595
|
return !((u = t()) != null && u.component) && !n() ? o().children ?? [] : [];
|
|
596
596
|
}, s = function() {
|
|
597
|
-
var h, u, d, y,
|
|
597
|
+
var h, u, d, y, x, b, E, T;
|
|
598
598
|
return {
|
|
599
599
|
blockChildren: o().children ?? [],
|
|
600
600
|
componentRef: (h = t()) == null ? void 0 : h.component,
|
|
601
601
|
componentOptions: {
|
|
602
|
-
...
|
|
602
|
+
...Ge(o()),
|
|
603
603
|
builderContext: e.context,
|
|
604
604
|
...((u = t()) == null ? void 0 : u.name) === "Core:Button" || ((d = t()) == null ? void 0 : d.name) === "Symbol" || ((y = t()) == null ? void 0 : y.name) === "Columns" ? {
|
|
605
605
|
builderLinkComponent: e.linkComponent
|
|
606
606
|
} : {},
|
|
607
|
-
...((
|
|
607
|
+
...((x = t()) == null ? void 0 : x.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" ? {
|
|
608
608
|
builderComponents: e.registeredComponents
|
|
609
609
|
} : {}
|
|
610
610
|
},
|
|
@@ -616,10 +616,10 @@ function N(e) {
|
|
|
616
616
|
isInteractive: !((T = t()) != null && T.isRSC)
|
|
617
617
|
};
|
|
618
618
|
}, c = e.context;
|
|
619
|
-
return /* @__PURE__ */ l(
|
|
620
|
-
/* @__PURE__ */ l(
|
|
621
|
-
(m = t()) != null && m.noWrap ? /* @__PURE__ */ l(
|
|
622
|
-
|
|
619
|
+
return /* @__PURE__ */ l(k, { children: r() ? /* @__PURE__ */ R(k, { children: [
|
|
620
|
+
/* @__PURE__ */ l(dt, { block: e.block, context: e.context }),
|
|
621
|
+
(m = t()) != null && m.noWrap ? /* @__PURE__ */ l(k, { children: /* @__PURE__ */ l(
|
|
622
|
+
Y,
|
|
623
623
|
{
|
|
624
624
|
componentRef: s().componentRef,
|
|
625
625
|
componentOptions: s().componentOptions,
|
|
@@ -631,7 +631,7 @@ function N(e) {
|
|
|
631
631
|
includeBlockProps: s().includeBlockProps,
|
|
632
632
|
isInteractive: s().isInteractive
|
|
633
633
|
}
|
|
634
|
-
) }) : /* @__PURE__ */ l(
|
|
634
|
+
) }) : /* @__PURE__ */ l(k, { children: n() ? /* @__PURE__ */ l(k, { children: (p = n()) == null ? void 0 : p.map((f, h) => /* @__PURE__ */ l(
|
|
635
635
|
St,
|
|
636
636
|
{
|
|
637
637
|
repeatContext: f.context,
|
|
@@ -640,8 +640,8 @@ function N(e) {
|
|
|
640
640
|
linkComponent: e.linkComponent
|
|
641
641
|
},
|
|
642
642
|
h
|
|
643
|
-
)) }) : /* @__PURE__ */ l(
|
|
644
|
-
|
|
643
|
+
)) }) : /* @__PURE__ */ l(k, { children: /* @__PURE__ */ R(
|
|
644
|
+
Oe,
|
|
645
645
|
{
|
|
646
646
|
Wrapper: i(),
|
|
647
647
|
block: o(),
|
|
@@ -649,7 +649,7 @@ function N(e) {
|
|
|
649
649
|
linkComponent: e.linkComponent,
|
|
650
650
|
children: [
|
|
651
651
|
/* @__PURE__ */ l(
|
|
652
|
-
|
|
652
|
+
Y,
|
|
653
653
|
{
|
|
654
654
|
componentRef: s().componentRef,
|
|
655
655
|
componentOptions: s().componentOptions,
|
|
@@ -680,7 +680,7 @@ function N(e) {
|
|
|
680
680
|
function F(e) {
|
|
681
681
|
var t, n, o;
|
|
682
682
|
return /* @__PURE__ */ l(
|
|
683
|
-
|
|
683
|
+
Ne,
|
|
684
684
|
{
|
|
685
685
|
blocks: e.blocks,
|
|
686
686
|
parent: e.parent,
|
|
@@ -688,7 +688,7 @@ function F(e) {
|
|
|
688
688
|
styleProp: e.styleProp,
|
|
689
689
|
BlocksWrapper: (t = e.context) == null ? void 0 : t.BlocksWrapper,
|
|
690
690
|
BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
|
|
691
|
-
children: e.blocks ? /* @__PURE__ */ l(
|
|
691
|
+
children: e.blocks ? /* @__PURE__ */ l(k, { children: (o = e.blocks) == null ? void 0 : o.map((i) => /* @__PURE__ */ l(
|
|
692
692
|
N,
|
|
693
693
|
{
|
|
694
694
|
block: i,
|
|
@@ -701,7 +701,7 @@ function F(e) {
|
|
|
701
701
|
}
|
|
702
702
|
);
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function vt(e) {
|
|
705
705
|
var h;
|
|
706
706
|
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", i = function(d) {
|
|
707
707
|
var y;
|
|
@@ -728,18 +728,18 @@ function kt(e) {
|
|
|
728
728
|
})
|
|
729
729
|
};
|
|
730
730
|
}, g = function(d) {
|
|
731
|
-
const y = d === 0 ? 0 : t,
|
|
731
|
+
const y = d === 0 ? 0 : t, x = r(d), b = `${y}px`, E = "100%", T = 0;
|
|
732
732
|
return {
|
|
733
733
|
...{
|
|
734
734
|
display: "flex",
|
|
735
735
|
flexDirection: "column",
|
|
736
736
|
alignItems: "stretch"
|
|
737
737
|
},
|
|
738
|
-
width:
|
|
738
|
+
width: x,
|
|
739
739
|
["marginLeft"]: b,
|
|
740
740
|
"--column-width-mobile": s({
|
|
741
741
|
stackedStyle: E,
|
|
742
|
-
desktopStyle:
|
|
742
|
+
desktopStyle: x
|
|
743
743
|
}),
|
|
744
744
|
"--column-margin-left-mobile": s({
|
|
745
745
|
stackedStyle: T,
|
|
@@ -747,7 +747,7 @@ function kt(e) {
|
|
|
747
747
|
}),
|
|
748
748
|
"--column-width-tablet": a({
|
|
749
749
|
stackedStyle: E,
|
|
750
|
-
desktopStyle:
|
|
750
|
+
desktopStyle: x
|
|
751
751
|
}),
|
|
752
752
|
"--column-margin-left-tablet": a({
|
|
753
753
|
stackedStyle: T,
|
|
@@ -755,9 +755,9 @@ function kt(e) {
|
|
|
755
755
|
})
|
|
756
756
|
};
|
|
757
757
|
}, p = function(d) {
|
|
758
|
-
var
|
|
758
|
+
var x, b;
|
|
759
759
|
return me(
|
|
760
|
-
((b = (
|
|
760
|
+
((b = (x = e.builderContext.content) == null ? void 0 : x.meta) == null ? void 0 : b.breakpoints) || {}
|
|
761
761
|
)[d].max;
|
|
762
762
|
}, f = function() {
|
|
763
763
|
return `
|
|
@@ -786,16 +786,16 @@ function kt(e) {
|
|
|
786
786
|
},
|
|
787
787
|
`;
|
|
788
788
|
};
|
|
789
|
-
return /* @__PURE__ */ R(
|
|
789
|
+
return /* @__PURE__ */ R(k, { children: [
|
|
790
790
|
/* @__PURE__ */ R(
|
|
791
791
|
"div",
|
|
792
792
|
{
|
|
793
793
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-3d816b82`,
|
|
794
794
|
style: m(),
|
|
795
795
|
children: [
|
|
796
|
-
/* @__PURE__ */ l(
|
|
796
|
+
/* @__PURE__ */ l(k, { children: /* @__PURE__ */ l(O, { styles: f() }) }),
|
|
797
797
|
(h = e.columns) == null ? void 0 : h.map((u, d) => /* @__PURE__ */ l(
|
|
798
|
-
|
|
798
|
+
Fe,
|
|
799
799
|
{
|
|
800
800
|
TagName: u.link ? e.builderLinkComponent || "a" : "div",
|
|
801
801
|
actionAttributes: {},
|
|
@@ -835,11 +835,11 @@ function kt(e) {
|
|
|
835
835
|
function Q(e) {
|
|
836
836
|
return e.replace(/http(s)?:/, "");
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function xt(e = "", t, n) {
|
|
839
839
|
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
|
|
840
840
|
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
|
|
841
841
|
}
|
|
842
|
-
function
|
|
842
|
+
function Ct(e, t) {
|
|
843
843
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
844
844
|
return e;
|
|
845
845
|
if (t === "master")
|
|
@@ -851,18 +851,18 @@ function xt(e, t) {
|
|
|
851
851
|
}
|
|
852
852
|
return null;
|
|
853
853
|
}
|
|
854
|
-
function
|
|
854
|
+
function oo(e) {
|
|
855
855
|
if (!e)
|
|
856
856
|
return e;
|
|
857
857
|
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
858
858
|
if (e.match(/builder\.io/)) {
|
|
859
859
|
let n = e;
|
|
860
860
|
const o = Number(e.split("?width=")[1]);
|
|
861
|
-
return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${
|
|
861
|
+
return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${xt(e, "width", i)} ${i}w`).concat([n]).join(", ");
|
|
862
862
|
}
|
|
863
|
-
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [
|
|
863
|
+
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [Ct(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
|
|
864
864
|
}
|
|
865
|
-
const
|
|
865
|
+
const wt = (e) => {
|
|
866
866
|
if (e === "localhost" || e === "127.0.0.1")
|
|
867
867
|
return e;
|
|
868
868
|
const t = e.split(".");
|
|
@@ -875,16 +875,16 @@ const Ct = (e) => {
|
|
|
875
875
|
try {
|
|
876
876
|
return t ? (n = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : n.split("=")[1] : void 0;
|
|
877
877
|
} catch (o) {
|
|
878
|
-
|
|
878
|
+
v.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
|
|
879
879
|
return;
|
|
880
880
|
}
|
|
881
|
-
}, ge = async (e) => pe(e),
|
|
881
|
+
}, ge = async (e) => pe(e), It = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(C).join("; "), Tt = [["secure", ""], ["SameSite", "None"]], Et = ({
|
|
882
882
|
name: e,
|
|
883
883
|
value: t,
|
|
884
884
|
expires: n
|
|
885
885
|
}) => {
|
|
886
|
-
const i = (
|
|
887
|
-
return
|
|
886
|
+
const i = (S() ? location.protocol === "https:" : !0) ? Tt : [[]], r = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...r, ["path", "/"], ["domain", wt(window.location.hostname)], ...i];
|
|
887
|
+
return It(a);
|
|
888
888
|
}, be = async ({
|
|
889
889
|
name: e,
|
|
890
890
|
value: t,
|
|
@@ -894,33 +894,33 @@ const Ct = (e) => {
|
|
|
894
894
|
try {
|
|
895
895
|
if (!o)
|
|
896
896
|
return;
|
|
897
|
-
const i =
|
|
897
|
+
const i = Et({
|
|
898
898
|
name: e,
|
|
899
899
|
value: t,
|
|
900
900
|
expires: n
|
|
901
901
|
});
|
|
902
902
|
document.cookie = i;
|
|
903
903
|
} catch (i) {
|
|
904
|
-
|
|
904
|
+
v.warn("[COOKIE] SET error: ", (i == null ? void 0 : i.message) || i);
|
|
905
905
|
}
|
|
906
|
-
},
|
|
906
|
+
}, Rt = "builder.tests", K = (e) => `${Rt}.${e}`, At = ({
|
|
907
907
|
contentId: e
|
|
908
908
|
}) => ge({
|
|
909
909
|
name: K(e),
|
|
910
910
|
canTrack: !0
|
|
911
|
-
}),
|
|
911
|
+
}), Pt = ({
|
|
912
912
|
contentId: e
|
|
913
913
|
}) => pe({
|
|
914
914
|
name: K(e),
|
|
915
915
|
canTrack: !0
|
|
916
|
-
}),
|
|
916
|
+
}), Bt = ({
|
|
917
917
|
contentId: e,
|
|
918
918
|
value: t
|
|
919
919
|
}) => be({
|
|
920
920
|
name: K(e),
|
|
921
921
|
value: t,
|
|
922
922
|
canTrack: !0
|
|
923
|
-
}), ye = (e) => C(e.id) && C(e.variations) && Object.keys(e.variations).length > 0,
|
|
923
|
+
}), ye = (e) => C(e.id) && C(e.variations) && Object.keys(e.variations).length > 0, Vt = ({
|
|
924
924
|
id: e,
|
|
925
925
|
variations: t
|
|
926
926
|
}) => {
|
|
@@ -933,15 +933,15 @@ const Ct = (e) => {
|
|
|
933
933
|
return r;
|
|
934
934
|
}
|
|
935
935
|
return e;
|
|
936
|
-
},
|
|
937
|
-
const t =
|
|
938
|
-
return
|
|
936
|
+
}, ke = (e) => {
|
|
937
|
+
const t = Vt(e);
|
|
938
|
+
return Bt({
|
|
939
939
|
contentId: e.id,
|
|
940
940
|
value: t
|
|
941
941
|
}).catch((n) => {
|
|
942
|
-
|
|
942
|
+
v.error("could not store A/B test variation: ", n);
|
|
943
943
|
}), t;
|
|
944
|
-
},
|
|
944
|
+
}, Se = ({
|
|
945
945
|
item: e,
|
|
946
946
|
testGroupId: t
|
|
947
947
|
}) => {
|
|
@@ -955,7 +955,7 @@ const Ct = (e) => {
|
|
|
955
955
|
testVariationId: n.id,
|
|
956
956
|
testVariationName: n.name || (n.id === e.id ? "Default" : "")
|
|
957
957
|
};
|
|
958
|
-
},
|
|
958
|
+
}, $t = ({
|
|
959
959
|
item: e,
|
|
960
960
|
canTrack: t
|
|
961
961
|
}) => {
|
|
@@ -965,12 +965,12 @@ const Ct = (e) => {
|
|
|
965
965
|
return;
|
|
966
966
|
if (!ye(e))
|
|
967
967
|
return e;
|
|
968
|
-
const n =
|
|
968
|
+
const n = Pt({
|
|
969
969
|
contentId: e.id
|
|
970
|
-
}) ||
|
|
970
|
+
}) || ke({
|
|
971
971
|
variations: e.variations,
|
|
972
972
|
id: e.id
|
|
973
|
-
}), o =
|
|
973
|
+
}), o = Se({
|
|
974
974
|
item: e,
|
|
975
975
|
testGroupId: n
|
|
976
976
|
});
|
|
@@ -978,18 +978,18 @@ const Ct = (e) => {
|
|
|
978
978
|
...e,
|
|
979
979
|
...o
|
|
980
980
|
};
|
|
981
|
-
},
|
|
981
|
+
}, Wt = async ({
|
|
982
982
|
item: e,
|
|
983
983
|
canTrack: t
|
|
984
984
|
}) => {
|
|
985
985
|
if (!t || !ye(e))
|
|
986
986
|
return e;
|
|
987
|
-
const o = await
|
|
987
|
+
const o = await At({
|
|
988
988
|
contentId: e.id
|
|
989
|
-
}) ||
|
|
989
|
+
}) || ke({
|
|
990
990
|
variations: e.variations,
|
|
991
991
|
id: e.id
|
|
992
|
-
}), i =
|
|
992
|
+
}), i = Se({
|
|
993
993
|
item: e,
|
|
994
994
|
testGroupId: o
|
|
995
995
|
});
|
|
@@ -997,7 +997,7 @@ const Ct = (e) => {
|
|
|
997
997
|
...e,
|
|
998
998
|
...i
|
|
999
999
|
};
|
|
1000
|
-
}, U = (e) => C(e) ? e : !0,
|
|
1000
|
+
}, U = (e) => C(e) ? e : !0, Ot = {
|
|
1001
1001
|
name: "Core:Button",
|
|
1002
1002
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
1003
1003
|
defaultStyles: {
|
|
@@ -1030,7 +1030,7 @@ const Ct = (e) => {
|
|
|
1030
1030
|
}],
|
|
1031
1031
|
static: !0,
|
|
1032
1032
|
noWrap: !0
|
|
1033
|
-
},
|
|
1033
|
+
}, Nt = {
|
|
1034
1034
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
1035
1035
|
name: "Columns",
|
|
1036
1036
|
isRSC: !0,
|
|
@@ -1231,7 +1231,7 @@ const Ct = (e) => {
|
|
|
1231
1231
|
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
1232
1232
|
advanced: !0
|
|
1233
1233
|
}]
|
|
1234
|
-
},
|
|
1234
|
+
}, Ft = {
|
|
1235
1235
|
name: "Custom Code",
|
|
1236
1236
|
static: !0,
|
|
1237
1237
|
requiredPermissions: ["editCode"],
|
|
@@ -1253,7 +1253,7 @@ const Ct = (e) => {
|
|
|
1253
1253
|
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
1254
1254
|
advanced: !0
|
|
1255
1255
|
}]
|
|
1256
|
-
},
|
|
1256
|
+
}, Lt = {
|
|
1257
1257
|
name: "Embed",
|
|
1258
1258
|
static: !0,
|
|
1259
1259
|
inputs: [{
|
|
@@ -1278,13 +1278,13 @@ const Ct = (e) => {
|
|
|
1278
1278
|
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
1279
1279
|
hideFromUI: !0
|
|
1280
1280
|
}]
|
|
1281
|
-
},
|
|
1281
|
+
}, Ut = ["text/javascript", "application/javascript", "application/ecmascript"], io = (e) => Ut.includes(e.type), _t = {
|
|
1282
1282
|
name: "Fragment",
|
|
1283
1283
|
static: !0,
|
|
1284
1284
|
hidden: !0,
|
|
1285
1285
|
canHaveChildren: !0,
|
|
1286
1286
|
noWrap: !0
|
|
1287
|
-
},
|
|
1287
|
+
}, Dt = {
|
|
1288
1288
|
name: "Image",
|
|
1289
1289
|
static: !0,
|
|
1290
1290
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -1384,7 +1384,7 @@ const Ct = (e) => {
|
|
|
1384
1384
|
advanced: !0,
|
|
1385
1385
|
defaultValue: 0.7041
|
|
1386
1386
|
}]
|
|
1387
|
-
},
|
|
1387
|
+
}, Mt = {
|
|
1388
1388
|
// friendlyName?
|
|
1389
1389
|
name: "Raw:Img",
|
|
1390
1390
|
hideFromInsertMenu: !0,
|
|
@@ -1398,7 +1398,7 @@ const Ct = (e) => {
|
|
|
1398
1398
|
}],
|
|
1399
1399
|
noWrap: !0,
|
|
1400
1400
|
static: !0
|
|
1401
|
-
},
|
|
1401
|
+
}, jt = {
|
|
1402
1402
|
name: "Core:Section",
|
|
1403
1403
|
static: !0,
|
|
1404
1404
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -1437,7 +1437,7 @@ const Ct = (e) => {
|
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
1439
|
}]
|
|
1440
|
-
},
|
|
1440
|
+
}, Ht = {
|
|
1441
1441
|
name: "Slot",
|
|
1442
1442
|
isRSC: !0,
|
|
1443
1443
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -1451,7 +1451,7 @@ const Ct = (e) => {
|
|
|
1451
1451
|
defaultValue: "children"
|
|
1452
1452
|
}]
|
|
1453
1453
|
};
|
|
1454
|
-
function
|
|
1454
|
+
function Kt(e) {
|
|
1455
1455
|
var t, n, o;
|
|
1456
1456
|
return /* @__PURE__ */ l(
|
|
1457
1457
|
"div",
|
|
@@ -1474,7 +1474,7 @@ function Ht(e) {
|
|
|
1474
1474
|
}
|
|
1475
1475
|
);
|
|
1476
1476
|
}
|
|
1477
|
-
const
|
|
1477
|
+
const zt = {
|
|
1478
1478
|
name: "Symbol",
|
|
1479
1479
|
noWrap: !0,
|
|
1480
1480
|
static: !0,
|
|
@@ -1507,7 +1507,7 @@ const Kt = {
|
|
|
1507
1507
|
hideFromUI: !0,
|
|
1508
1508
|
type: "boolean"
|
|
1509
1509
|
}]
|
|
1510
|
-
},
|
|
1510
|
+
}, qt = {
|
|
1511
1511
|
name: "Text",
|
|
1512
1512
|
static: !0,
|
|
1513
1513
|
isRSC: !0,
|
|
@@ -1526,7 +1526,7 @@ const Kt = {
|
|
|
1526
1526
|
textAlign: "center"
|
|
1527
1527
|
}
|
|
1528
1528
|
};
|
|
1529
|
-
function
|
|
1529
|
+
function Gt(e) {
|
|
1530
1530
|
var t;
|
|
1531
1531
|
return /* @__PURE__ */ l(
|
|
1532
1532
|
"div",
|
|
@@ -1539,7 +1539,7 @@ function qt(e) {
|
|
|
1539
1539
|
}
|
|
1540
1540
|
);
|
|
1541
1541
|
}
|
|
1542
|
-
const
|
|
1542
|
+
const Jt = {
|
|
1543
1543
|
name: "Video",
|
|
1544
1544
|
canHaveChildren: !0,
|
|
1545
1545
|
defaultStyles: {
|
|
@@ -1621,20 +1621,17 @@ const Gt = {
|
|
|
1621
1621
|
advanced: !0
|
|
1622
1622
|
}]
|
|
1623
1623
|
}, X = () => [{
|
|
1624
|
-
component:
|
|
1625
|
-
...Wt
|
|
1626
|
-
}, {
|
|
1627
|
-
component: kt,
|
|
1624
|
+
component: Le,
|
|
1628
1625
|
...Ot
|
|
1629
1626
|
}, {
|
|
1630
|
-
component:
|
|
1627
|
+
component: vt,
|
|
1631
1628
|
...Nt
|
|
1632
1629
|
}, {
|
|
1633
1630
|
component: Ue,
|
|
1634
1631
|
...Ft
|
|
1635
1632
|
}, {
|
|
1636
1633
|
component: _e,
|
|
1637
|
-
...
|
|
1634
|
+
...Lt
|
|
1638
1635
|
}, {
|
|
1639
1636
|
component: De,
|
|
1640
1637
|
..._t
|
|
@@ -1645,33 +1642,36 @@ const Gt = {
|
|
|
1645
1642
|
component: je,
|
|
1646
1643
|
...Mt
|
|
1647
1644
|
}, {
|
|
1648
|
-
component:
|
|
1649
|
-
...
|
|
1645
|
+
component: He,
|
|
1646
|
+
...jt
|
|
1650
1647
|
}, {
|
|
1651
|
-
component:
|
|
1648
|
+
component: Jn,
|
|
1652
1649
|
...zt
|
|
1653
1650
|
}, {
|
|
1654
|
-
component:
|
|
1655
|
-
...
|
|
1651
|
+
component: Gt,
|
|
1652
|
+
...qt
|
|
1656
1653
|
}, {
|
|
1657
|
-
component:
|
|
1658
|
-
...
|
|
1659
|
-
}
|
|
1654
|
+
component: Ke,
|
|
1655
|
+
...Jt
|
|
1656
|
+
}, {
|
|
1657
|
+
component: Kt,
|
|
1658
|
+
...Ht
|
|
1659
|
+
}], Z = [], ro = (e) => ({
|
|
1660
1660
|
type: "builder.registerComponent",
|
|
1661
1661
|
data: _(e)
|
|
1662
1662
|
}), Yt = (e) => {
|
|
1663
1663
|
const t = e.toString().trim();
|
|
1664
1664
|
return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
|
|
1665
|
-
},
|
|
1665
|
+
}, Qt = (e) => typeof e == "function" ? Yt(e) : W(e), _ = ({
|
|
1666
1666
|
inputs: e,
|
|
1667
1667
|
...t
|
|
1668
1668
|
}) => ({
|
|
1669
1669
|
...W(t),
|
|
1670
1670
|
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [i, r]) => ({
|
|
1671
1671
|
...o,
|
|
1672
|
-
[i]:
|
|
1672
|
+
[i]: Qt(r)
|
|
1673
1673
|
}), {}))
|
|
1674
|
-
}),
|
|
1674
|
+
}), Xt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
1675
1675
|
function getAndSetVariantId() {
|
|
1676
1676
|
function setCookie(name, value, days) {
|
|
1677
1677
|
let expires = '';
|
|
@@ -1727,7 +1727,7 @@ const Gt = {
|
|
|
1727
1727
|
}).join('');
|
|
1728
1728
|
styleEl.innerHTML = newStyleStr;
|
|
1729
1729
|
}
|
|
1730
|
-
}`,
|
|
1730
|
+
}`, Zt = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
1731
1731
|
if (!navigator.cookieEnabled) {
|
|
1732
1732
|
return;
|
|
1733
1733
|
}
|
|
@@ -1765,16 +1765,16 @@ const Gt = {
|
|
|
1765
1765
|
...t,
|
|
1766
1766
|
testVariationId: t.id,
|
|
1767
1767
|
id: e == null ? void 0 : e.id
|
|
1768
|
-
})),
|
|
1768
|
+
})), en = ({
|
|
1769
1769
|
canTrack: e,
|
|
1770
1770
|
content: t
|
|
1771
|
-
}) => !(!(B(t).length > 0) || !e ||
|
|
1772
|
-
window.${ve} = ${
|
|
1773
|
-
window.${xe} = ${
|
|
1774
|
-
`,
|
|
1771
|
+
}) => !(!(B(t).length > 0) || !e || S()), tn = (e) => e === "react" || e === "reactNative", Ce = tn(I), nn = () => `
|
|
1772
|
+
window.${ve} = ${Xt}
|
|
1773
|
+
window.${xe} = ${Zt}
|
|
1774
|
+
`, on = (e, t) => `
|
|
1775
1775
|
window.${ve}(
|
|
1776
1776
|
"${t}",${JSON.stringify(e)}, ${Ce}
|
|
1777
|
-
)`,
|
|
1777
|
+
)`, rn = ({
|
|
1778
1778
|
contentId: e,
|
|
1779
1779
|
variationId: t
|
|
1780
1780
|
}) => `window.${xe}(
|
|
@@ -1789,33 +1789,33 @@ function D(e) {
|
|
|
1789
1789
|
}
|
|
1790
1790
|
);
|
|
1791
1791
|
}
|
|
1792
|
-
const
|
|
1792
|
+
const an = (e) => {
|
|
1793
1793
|
const t = e.get("preview"), n = e.get("overrides." + t);
|
|
1794
|
-
return n ||
|
|
1794
|
+
return n || v.warn("No previewed ID found in search params."), n;
|
|
1795
1795
|
};
|
|
1796
|
-
function
|
|
1797
|
-
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new
|
|
1796
|
+
function sn() {
|
|
1797
|
+
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new $e({
|
|
1798
1798
|
max: 500,
|
|
1799
1799
|
// how long to live in ms
|
|
1800
1800
|
ttl: 1e3 * 60 * 5
|
|
1801
1801
|
}));
|
|
1802
1802
|
}
|
|
1803
|
-
function
|
|
1804
|
-
|
|
1805
|
-
const t =
|
|
1803
|
+
function cn(e) {
|
|
1804
|
+
sn();
|
|
1805
|
+
const t = an(e);
|
|
1806
1806
|
return typeof t == "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t) : void 0;
|
|
1807
1807
|
}
|
|
1808
|
-
function
|
|
1808
|
+
function ln() {
|
|
1809
1809
|
return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
|
|
1810
1810
|
}
|
|
1811
|
-
function
|
|
1812
|
-
const e =
|
|
1811
|
+
function dn() {
|
|
1812
|
+
const e = ln().fetch;
|
|
1813
1813
|
if (typeof e > "u")
|
|
1814
1814
|
throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
1815
1815
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
|
|
1816
1816
|
return e;
|
|
1817
1817
|
}
|
|
1818
|
-
const
|
|
1818
|
+
const un = dn();
|
|
1819
1819
|
function V(e, t = null, n = ".") {
|
|
1820
1820
|
return Object.keys(e).reduce((o, i) => {
|
|
1821
1821
|
const r = e[i], a = [t, i].filter(Boolean).join(n);
|
|
@@ -1828,7 +1828,7 @@ function V(e, t = null, n = ".") {
|
|
|
1828
1828
|
};
|
|
1829
1829
|
}, {});
|
|
1830
1830
|
}
|
|
1831
|
-
const
|
|
1831
|
+
const mn = "v3", ee = "builder.", fn = "options.", hn = (e) => {
|
|
1832
1832
|
const t = {};
|
|
1833
1833
|
return e.forEach((n, o) => {
|
|
1834
1834
|
t[o] = n;
|
|
@@ -1839,16 +1839,16 @@ const un = "v3", ee = "builder.", mn = "options.", fn = (e) => {
|
|
|
1839
1839
|
const t = Ie(e), n = {};
|
|
1840
1840
|
return Object.keys(t).forEach((o) => {
|
|
1841
1841
|
if (o.startsWith(ee)) {
|
|
1842
|
-
const i = o.replace(ee, "").replace(
|
|
1842
|
+
const i = o.replace(ee, "").replace(fn, "");
|
|
1843
1843
|
n[i] = t[o];
|
|
1844
1844
|
}
|
|
1845
1845
|
}), n;
|
|
1846
|
-
},
|
|
1847
|
-
if (!
|
|
1846
|
+
}, pn = () => {
|
|
1847
|
+
if (!S())
|
|
1848
1848
|
return {};
|
|
1849
1849
|
const e = new URLSearchParams(window.location.search);
|
|
1850
1850
|
return we(e);
|
|
1851
|
-
}, Ie = (e) => e instanceof URLSearchParams ?
|
|
1851
|
+
}, Ie = (e) => e instanceof URLSearchParams ? hn(e) : e, te = (e) => typeof e == "number" && !isNaN(e) && e >= 0, z = (e) => {
|
|
1852
1852
|
let {
|
|
1853
1853
|
noTraverse: t = !1
|
|
1854
1854
|
} = e;
|
|
@@ -1861,22 +1861,22 @@ const un = "v3", ee = "builder.", mn = "options.", fn = (e) => {
|
|
|
1861
1861
|
includeRefs: s = !0,
|
|
1862
1862
|
enrich: c,
|
|
1863
1863
|
locale: m,
|
|
1864
|
-
apiVersion: g =
|
|
1864
|
+
apiVersion: g = mn,
|
|
1865
1865
|
fields: p,
|
|
1866
1866
|
omit: f,
|
|
1867
1867
|
offset: h,
|
|
1868
1868
|
cacheSeconds: u,
|
|
1869
1869
|
staleCacheSeconds: d,
|
|
1870
1870
|
sort: y,
|
|
1871
|
-
includeUnpublished:
|
|
1871
|
+
includeUnpublished: x
|
|
1872
1872
|
} = e;
|
|
1873
1873
|
if (!a)
|
|
1874
1874
|
throw new Error("Missing API key");
|
|
1875
|
-
if (!["
|
|
1876
|
-
throw new Error(`Invalid apiVersion: expected '
|
|
1875
|
+
if (!["v3"].includes(g))
|
|
1876
|
+
throw new Error(`Invalid apiVersion: expected 'v3', received '${g}'`);
|
|
1877
1877
|
(e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
|
|
1878
1878
|
const b = new URL(`https://cdn.builder.io/api/${g}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${s}${m ? `&locale=${m}` : ""}${c ? `&enrich=${c}` : ""}`);
|
|
1879
|
-
if (b.searchParams.set("omit", f || "meta.componentsUsed"), p && b.searchParams.set("fields", p), Number.isFinite(h) && h > -1 && b.searchParams.set("offset", String(Math.floor(h))), typeof
|
|
1879
|
+
if (b.searchParams.set("omit", f || "meta.componentsUsed"), p && b.searchParams.set("fields", p), Number.isFinite(h) && h > -1 && b.searchParams.set("offset", String(Math.floor(h))), typeof x == "boolean" && b.searchParams.set("includeUnpublished", String(x)), u && te(u) && b.searchParams.set("cacheSeconds", String(u)), d && te(d) && b.searchParams.set("staleCacheSeconds", String(d)), y) {
|
|
1880
1880
|
const w = V({
|
|
1881
1881
|
sort: y
|
|
1882
1882
|
});
|
|
@@ -1884,7 +1884,7 @@ const un = "v3", ee = "builder.", mn = "options.", fn = (e) => {
|
|
|
1884
1884
|
b.searchParams.set(A, JSON.stringify(w[A]));
|
|
1885
1885
|
}
|
|
1886
1886
|
const E = {
|
|
1887
|
-
...
|
|
1887
|
+
...pn(),
|
|
1888
1888
|
...Ie(e.options || {})
|
|
1889
1889
|
}, T = V(E);
|
|
1890
1890
|
for (const w in T)
|
|
@@ -1897,7 +1897,7 @@ const un = "v3", ee = "builder.", mn = "options.", fn = (e) => {
|
|
|
1897
1897
|
b.searchParams.set(A, JSON.stringify(w[A]));
|
|
1898
1898
|
}
|
|
1899
1899
|
return b;
|
|
1900
|
-
},
|
|
1900
|
+
}, gn = (e) => "results" in e;
|
|
1901
1901
|
async function q(e) {
|
|
1902
1902
|
const t = await Te({
|
|
1903
1903
|
...e,
|
|
@@ -1905,53 +1905,49 @@ async function q(e) {
|
|
|
1905
1905
|
});
|
|
1906
1906
|
return t && t[0] || null;
|
|
1907
1907
|
}
|
|
1908
|
-
const
|
|
1908
|
+
const ao = q, bn = async (e) => {
|
|
1909
1909
|
const t = z(e);
|
|
1910
|
-
return await (await
|
|
1911
|
-
},
|
|
1910
|
+
return await (await un(t.href)).json();
|
|
1911
|
+
}, yn = async (e, t, n = z(e)) => {
|
|
1912
1912
|
const o = U(e.canTrack);
|
|
1913
1913
|
if (n.search.includes("preview=")) {
|
|
1914
1914
|
const r = [];
|
|
1915
1915
|
for (const a of t.results) {
|
|
1916
|
-
const s =
|
|
1916
|
+
const s = cn(n.searchParams);
|
|
1917
1917
|
r.push(s || a);
|
|
1918
1918
|
}
|
|
1919
1919
|
t.results = r;
|
|
1920
1920
|
}
|
|
1921
|
-
if (!o || !(
|
|
1921
|
+
if (!o || !(S() || I === "reactNative"))
|
|
1922
1922
|
return t.results;
|
|
1923
1923
|
try {
|
|
1924
1924
|
const r = [];
|
|
1925
1925
|
for (const a of t.results)
|
|
1926
|
-
r.push(await
|
|
1926
|
+
r.push(await Wt({
|
|
1927
1927
|
item: a,
|
|
1928
1928
|
canTrack: o
|
|
1929
1929
|
}));
|
|
1930
1930
|
t.results = r;
|
|
1931
1931
|
} catch (r) {
|
|
1932
|
-
|
|
1932
|
+
v.error("Could not process A/B tests. ", r);
|
|
1933
1933
|
}
|
|
1934
1934
|
return t.results;
|
|
1935
1935
|
};
|
|
1936
1936
|
async function Te(e) {
|
|
1937
1937
|
try {
|
|
1938
|
-
const t = z(e), n = await
|
|
1939
|
-
return
|
|
1938
|
+
const t = z(e), n = await bn(e);
|
|
1939
|
+
return gn(n) ? yn(e, n) : (v.error("Error fetching data. ", {
|
|
1940
1940
|
url: t,
|
|
1941
1941
|
content: n,
|
|
1942
1942
|
options: e
|
|
1943
1943
|
}), null);
|
|
1944
1944
|
} catch (t) {
|
|
1945
|
-
return
|
|
1945
|
+
return v.error("Error fetching data. ", t), null;
|
|
1946
1946
|
}
|
|
1947
1947
|
}
|
|
1948
|
-
const
|
|
1949
|
-
function
|
|
1950
|
-
|
|
1951
|
-
return (e || yn).findIndex((i) => i.startsWith("*.") ? o.endsWith(i.slice(1)) : i === o) > -1;
|
|
1952
|
-
}
|
|
1953
|
-
function ao() {
|
|
1954
|
-
return !k() || j() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
1948
|
+
const so = Te;
|
|
1949
|
+
function co() {
|
|
1950
|
+
return !S() || j() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
1955
1951
|
}
|
|
1956
1952
|
function kn() {
|
|
1957
1953
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
@@ -1962,7 +1958,7 @@ function kn() {
|
|
|
1962
1958
|
function Ee() {
|
|
1963
1959
|
return kn().replace(/-/g, "");
|
|
1964
1960
|
}
|
|
1965
|
-
const Re = "builderSessionId",
|
|
1961
|
+
const Re = "builderSessionId", Sn = async ({
|
|
1966
1962
|
canTrack: e
|
|
1967
1963
|
}) => {
|
|
1968
1964
|
if (!e)
|
|
@@ -1974,20 +1970,20 @@ const Re = "builderSessionId", vn = async ({
|
|
|
1974
1970
|
if (C(t))
|
|
1975
1971
|
return t;
|
|
1976
1972
|
{
|
|
1977
|
-
const n =
|
|
1978
|
-
return
|
|
1973
|
+
const n = vn();
|
|
1974
|
+
return xn({
|
|
1979
1975
|
id: n,
|
|
1980
1976
|
canTrack: e
|
|
1981
1977
|
}), n;
|
|
1982
1978
|
}
|
|
1983
|
-
},
|
|
1979
|
+
}, vn = () => Ee(), xn = ({
|
|
1984
1980
|
id: e,
|
|
1985
1981
|
canTrack: t
|
|
1986
1982
|
}) => be({
|
|
1987
1983
|
name: Re,
|
|
1988
1984
|
value: e,
|
|
1989
1985
|
canTrack: t
|
|
1990
|
-
}), Ae = () =>
|
|
1986
|
+
}), Ae = () => S() && typeof localStorage < "u" ? localStorage : void 0, Cn = ({
|
|
1991
1987
|
key: e,
|
|
1992
1988
|
canTrack: t
|
|
1993
1989
|
}) => {
|
|
@@ -1998,7 +1994,7 @@ const Re = "builderSessionId", vn = async ({
|
|
|
1998
1994
|
console.debug("[LocalStorage] GET error: ", o);
|
|
1999
1995
|
return;
|
|
2000
1996
|
}
|
|
2001
|
-
},
|
|
1997
|
+
}, wn = ({
|
|
2002
1998
|
key: e,
|
|
2003
1999
|
canTrack: t,
|
|
2004
2000
|
value: n
|
|
@@ -2009,32 +2005,32 @@ const Re = "builderSessionId", vn = async ({
|
|
|
2009
2005
|
} catch (i) {
|
|
2010
2006
|
console.debug("[LocalStorage] SET error: ", i);
|
|
2011
2007
|
}
|
|
2012
|
-
}, Pe = "builderVisitorId",
|
|
2008
|
+
}, Pe = "builderVisitorId", In = ({
|
|
2013
2009
|
canTrack: e
|
|
2014
2010
|
}) => {
|
|
2015
2011
|
if (!e)
|
|
2016
2012
|
return;
|
|
2017
|
-
const t =
|
|
2013
|
+
const t = Cn({
|
|
2018
2014
|
key: Pe,
|
|
2019
2015
|
canTrack: e
|
|
2020
2016
|
});
|
|
2021
2017
|
if (C(t))
|
|
2022
2018
|
return t;
|
|
2023
2019
|
{
|
|
2024
|
-
const n =
|
|
2025
|
-
return
|
|
2020
|
+
const n = Tn();
|
|
2021
|
+
return En({
|
|
2026
2022
|
id: n,
|
|
2027
2023
|
canTrack: e
|
|
2028
2024
|
}), n;
|
|
2029
2025
|
}
|
|
2030
|
-
},
|
|
2026
|
+
}, Tn = () => Ee(), En = ({
|
|
2031
2027
|
id: e,
|
|
2032
2028
|
canTrack: t
|
|
2033
|
-
}) =>
|
|
2029
|
+
}) => wn({
|
|
2034
2030
|
key: Pe,
|
|
2035
2031
|
value: e,
|
|
2036
2032
|
canTrack: t
|
|
2037
|
-
}),
|
|
2033
|
+
}), Rn = async ({
|
|
2038
2034
|
canTrack: e
|
|
2039
2035
|
}) => {
|
|
2040
2036
|
if (!e)
|
|
@@ -2042,16 +2038,16 @@ const Re = "builderSessionId", vn = async ({
|
|
|
2042
2038
|
visitorId: void 0,
|
|
2043
2039
|
sessionId: void 0
|
|
2044
2040
|
};
|
|
2045
|
-
const t = await
|
|
2041
|
+
const t = await Sn({
|
|
2046
2042
|
canTrack: e
|
|
2047
|
-
}), n =
|
|
2043
|
+
}), n = In({
|
|
2048
2044
|
canTrack: e
|
|
2049
2045
|
});
|
|
2050
2046
|
return {
|
|
2051
2047
|
sessionId: t,
|
|
2052
2048
|
visitorId: n
|
|
2053
2049
|
};
|
|
2054
|
-
},
|
|
2050
|
+
}, An = async ({
|
|
2055
2051
|
type: e,
|
|
2056
2052
|
canTrack: t,
|
|
2057
2053
|
apiKey: n,
|
|
@@ -2065,23 +2061,23 @@ const Re = "builderSessionId", vn = async ({
|
|
|
2065
2061
|
url: location.href,
|
|
2066
2062
|
...o
|
|
2067
2063
|
},
|
|
2068
|
-
...await
|
|
2064
|
+
...await Rn({
|
|
2069
2065
|
canTrack: t
|
|
2070
2066
|
}),
|
|
2071
2067
|
userAttributes: le(),
|
|
2072
2068
|
ownerId: n
|
|
2073
2069
|
}
|
|
2074
2070
|
});
|
|
2075
|
-
async function
|
|
2071
|
+
async function Pn(e) {
|
|
2076
2072
|
if (!e.apiKey) {
|
|
2077
|
-
|
|
2073
|
+
v.error("Missing API key for track call. Please provide your API key.");
|
|
2078
2074
|
return;
|
|
2079
2075
|
}
|
|
2080
|
-
if (e.canTrack && !j() && (
|
|
2076
|
+
if (e.canTrack && !j() && (S() || I === "reactNative"))
|
|
2081
2077
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
2082
2078
|
method: "POST",
|
|
2083
2079
|
body: JSON.stringify({
|
|
2084
|
-
events: [await
|
|
2080
|
+
events: [await An(e)]
|
|
2085
2081
|
}),
|
|
2086
2082
|
headers: {
|
|
2087
2083
|
"content-type": "application/json"
|
|
@@ -2091,14 +2087,14 @@ async function Bn(e) {
|
|
|
2091
2087
|
console.error("Failed to track: ", t);
|
|
2092
2088
|
});
|
|
2093
2089
|
}
|
|
2094
|
-
const
|
|
2090
|
+
const lo = (e) => Pn({
|
|
2095
2091
|
...e,
|
|
2096
2092
|
canTrack: !0
|
|
2097
2093
|
});
|
|
2098
2094
|
function ne(e) {
|
|
2099
2095
|
return Math.round(e * 1e3) / 1e3;
|
|
2100
2096
|
}
|
|
2101
|
-
const
|
|
2097
|
+
const Bn = (e, t, n = !0) => {
|
|
2102
2098
|
if (!(e instanceof HTMLElement))
|
|
2103
2099
|
return null;
|
|
2104
2100
|
let o = n ? e : e.parentElement;
|
|
@@ -2109,7 +2105,7 @@ const Vn = (e, t, n = !0) => {
|
|
|
2109
2105
|
return o;
|
|
2110
2106
|
} while (o = o.parentElement);
|
|
2111
2107
|
return null;
|
|
2112
|
-
},
|
|
2108
|
+
}, Vn = (e) => Bn(e, (t) => {
|
|
2113
2109
|
const n = t.getAttribute("builder-id") || t.id;
|
|
2114
2110
|
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
2115
2111
|
}), oe = ({
|
|
@@ -2121,8 +2117,8 @@ const Vn = (e, t, n = !0) => {
|
|
|
2121
2117
|
x: r,
|
|
2122
2118
|
y: a
|
|
2123
2119
|
};
|
|
2124
|
-
},
|
|
2125
|
-
const t = e.target, n = t &&
|
|
2120
|
+
}, uo = (e) => {
|
|
2121
|
+
const t = e.target, n = t && Vn(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
2126
2122
|
return {
|
|
2127
2123
|
targetBuilderElement: o || void 0,
|
|
2128
2124
|
metadata: {
|
|
@@ -2137,10 +2133,15 @@ const Vn = (e, t, n = !0) => {
|
|
|
2137
2133
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2138
2134
|
}
|
|
2139
2135
|
};
|
|
2140
|
-
},
|
|
2136
|
+
}, $n = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
2137
|
+
function Be(e, t) {
|
|
2138
|
+
const n = new URL(t.origin), o = n.hostname;
|
|
2139
|
+
return (e || $n).findIndex((i) => i.startsWith("*.") ? o.endsWith(i.slice(1)) : i === o) > -1;
|
|
2140
|
+
}
|
|
2141
|
+
const Wn = "0.13.0", ie = {};
|
|
2141
2142
|
function On(e, t) {
|
|
2142
2143
|
let n = ie[e];
|
|
2143
|
-
if (n || (n = ie[e] = []), n.push(t),
|
|
2144
|
+
if (n || (n = ie[e] = []), n.push(t), S()) {
|
|
2144
2145
|
const o = {
|
|
2145
2146
|
type: "builder.register",
|
|
2146
2147
|
data: {
|
|
@@ -2155,7 +2156,7 @@ function On(e, t) {
|
|
|
2155
2156
|
}
|
|
2156
2157
|
}
|
|
2157
2158
|
}
|
|
2158
|
-
const
|
|
2159
|
+
const mo = () => {
|
|
2159
2160
|
On("insertMenu", {
|
|
2160
2161
|
name: "_default",
|
|
2161
2162
|
default: !0,
|
|
@@ -2179,9 +2180,9 @@ const lo = () => {
|
|
|
2179
2180
|
});
|
|
2180
2181
|
};
|
|
2181
2182
|
let re = !1;
|
|
2182
|
-
const
|
|
2183
|
+
const Nn = (e = {}) => {
|
|
2183
2184
|
var t, n;
|
|
2184
|
-
re || (re = !0,
|
|
2185
|
+
re || (re = !0, S() && ((t = window.parent) == null || t.postMessage({
|
|
2185
2186
|
type: "builder.sdkInfo",
|
|
2186
2187
|
data: {
|
|
2187
2188
|
target: I,
|
|
@@ -2199,7 +2200,7 @@ const uo = (e = {}) => {
|
|
|
2199
2200
|
}
|
|
2200
2201
|
}, "*"), window.addEventListener("message", (o) => {
|
|
2201
2202
|
var r, a;
|
|
2202
|
-
if (!
|
|
2203
|
+
if (!Be(e.trustedHosts, o))
|
|
2203
2204
|
return;
|
|
2204
2205
|
const {
|
|
2205
2206
|
data: i
|
|
@@ -2240,6 +2241,51 @@ const uo = (e = {}) => {
|
|
|
2240
2241
|
}
|
|
2241
2242
|
}
|
|
2242
2243
|
})));
|
|
2244
|
+
}, Fn = ({
|
|
2245
|
+
model: e,
|
|
2246
|
+
trustedHosts: t,
|
|
2247
|
+
callbacks: n
|
|
2248
|
+
}) => (o) => {
|
|
2249
|
+
if (!Be(t, o))
|
|
2250
|
+
return;
|
|
2251
|
+
const {
|
|
2252
|
+
data: i
|
|
2253
|
+
} = o;
|
|
2254
|
+
if (i)
|
|
2255
|
+
switch (i.type) {
|
|
2256
|
+
case "builder.configureSdk": {
|
|
2257
|
+
n.configureSdk(i.data);
|
|
2258
|
+
break;
|
|
2259
|
+
}
|
|
2260
|
+
case "builder.triggerAnimation": {
|
|
2261
|
+
n.animation(i.data);
|
|
2262
|
+
break;
|
|
2263
|
+
}
|
|
2264
|
+
case "builder.contentUpdate": {
|
|
2265
|
+
const r = i.data, a = r.key || r.alias || r.entry || r.modelName, s = r.data;
|
|
2266
|
+
a === e && n.contentUpdate(s);
|
|
2267
|
+
break;
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
}, fo = (e, t, n) => {
|
|
2271
|
+
if (!S)
|
|
2272
|
+
return v.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
|
|
2273
|
+
};
|
|
2274
|
+
Nn();
|
|
2275
|
+
const o = Fn({
|
|
2276
|
+
callbacks: {
|
|
2277
|
+
contentUpdate: t,
|
|
2278
|
+
animation: () => {
|
|
2279
|
+
},
|
|
2280
|
+
configureSdk: () => {
|
|
2281
|
+
}
|
|
2282
|
+
},
|
|
2283
|
+
model: e,
|
|
2284
|
+
trustedHosts: n == null ? void 0 : n.trustedHosts
|
|
2285
|
+
});
|
|
2286
|
+
return window.addEventListener("message", o), () => {
|
|
2287
|
+
window.removeEventListener("message", o);
|
|
2288
|
+
};
|
|
2243
2289
|
};
|
|
2244
2290
|
function ae(e, ...t) {
|
|
2245
2291
|
const n = Object(e);
|
|
@@ -2251,38 +2297,38 @@ function ae(e, ...t) {
|
|
|
2251
2297
|
}
|
|
2252
2298
|
return n;
|
|
2253
2299
|
}
|
|
2254
|
-
const
|
|
2255
|
-
function
|
|
2300
|
+
const Ln = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
|
|
2301
|
+
function Un(e) {
|
|
2256
2302
|
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
2257
2303
|
}
|
|
2258
|
-
function
|
|
2259
|
-
const n =
|
|
2304
|
+
function _n(e, t) {
|
|
2305
|
+
const n = Dn(e), o = getComputedStyle(t), i = e.steps[0].styles, r = e.steps[e.steps.length - 1].styles, a = [i, r];
|
|
2260
2306
|
for (const s of a)
|
|
2261
2307
|
for (const c of n)
|
|
2262
2308
|
c in s || (s[c] = o[c]);
|
|
2263
2309
|
}
|
|
2264
|
-
function
|
|
2310
|
+
function Dn(e) {
|
|
2265
2311
|
const t = [];
|
|
2266
2312
|
for (const n of e.steps)
|
|
2267
2313
|
for (const o in n.styles)
|
|
2268
2314
|
t.indexOf(o) === -1 && t.push(o);
|
|
2269
2315
|
return t;
|
|
2270
2316
|
}
|
|
2271
|
-
function
|
|
2317
|
+
function ho(e) {
|
|
2272
2318
|
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
2273
2319
|
if (!t.length) {
|
|
2274
|
-
|
|
2320
|
+
Un(e.elementId || e.id || "");
|
|
2275
2321
|
return;
|
|
2276
2322
|
}
|
|
2277
2323
|
Array.from(t).forEach((n) => {
|
|
2278
|
-
|
|
2279
|
-
n.style.transition = `all ${e.duration}s ${
|
|
2324
|
+
_n(e, n), n.style.transition = "none", n.style.transitionDelay = "0", ae(n.style, e.steps[0].styles), setTimeout(() => {
|
|
2325
|
+
n.style.transition = `all ${e.duration}s ${Ln(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), ae(n.style, e.steps[1].styles), setTimeout(() => {
|
|
2280
2326
|
n.style.transition = "", n.style.transitionDelay = "";
|
|
2281
2327
|
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
2282
2328
|
});
|
|
2283
2329
|
});
|
|
2284
2330
|
}
|
|
2285
|
-
const
|
|
2331
|
+
const Mn = (e) => {
|
|
2286
2332
|
var r;
|
|
2287
2333
|
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((r = e == null ? void 0 : e.files) == null ? void 0 : r.regular);
|
|
2288
2334
|
let i = "";
|
|
@@ -2308,22 +2354,22 @@ font-weight: ${a};
|
|
|
2308
2354
|
`.trim());
|
|
2309
2355
|
}
|
|
2310
2356
|
return i;
|
|
2311
|
-
},
|
|
2357
|
+
}, jn = ({
|
|
2312
2358
|
customFonts: e
|
|
2313
2359
|
}) => {
|
|
2314
2360
|
var t;
|
|
2315
|
-
return ((t = e == null ? void 0 : e.map((n) =>
|
|
2316
|
-
},
|
|
2361
|
+
return ((t = e == null ? void 0 : e.map((n) => Mn(n))) == null ? void 0 : t.join(" ")) || "";
|
|
2362
|
+
}, Hn = ({
|
|
2317
2363
|
cssCode: e,
|
|
2318
2364
|
contentId: t
|
|
2319
2365
|
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
|
|
2320
|
-
function
|
|
2366
|
+
function Kn(e) {
|
|
2321
2367
|
const t = `
|
|
2322
|
-
${
|
|
2368
|
+
${Hn({
|
|
2323
2369
|
cssCode: e.cssCode,
|
|
2324
2370
|
contentId: e.contentId
|
|
2325
2371
|
})}
|
|
2326
|
-
${
|
|
2372
|
+
${jn({
|
|
2327
2373
|
customFonts: e.customFonts
|
|
2328
2374
|
})}
|
|
2329
2375
|
|
|
@@ -2346,7 +2392,7 @@ ${Dn({
|
|
|
2346
2392
|
`.trim();
|
|
2347
2393
|
return /* @__PURE__ */ l(O, { styles: t });
|
|
2348
2394
|
}
|
|
2349
|
-
const
|
|
2395
|
+
const zn = ({
|
|
2350
2396
|
content: e,
|
|
2351
2397
|
data: t,
|
|
2352
2398
|
locale: n
|
|
@@ -2363,7 +2409,7 @@ const Hn = ({
|
|
|
2363
2409
|
locale: n
|
|
2364
2410
|
} : {}
|
|
2365
2411
|
};
|
|
2366
|
-
},
|
|
2412
|
+
}, qn = ({
|
|
2367
2413
|
content: e,
|
|
2368
2414
|
data: t
|
|
2369
2415
|
}) => e ? {
|
|
@@ -2376,7 +2422,7 @@ const Hn = ({
|
|
|
2376
2422
|
} : void 0;
|
|
2377
2423
|
function se(e) {
|
|
2378
2424
|
var i, r, a, s, c, m, g, p, f;
|
|
2379
|
-
const t =
|
|
2425
|
+
const t = rn({
|
|
2380
2426
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2381
2427
|
variationId: (i = e.content) == null ? void 0 : i.testVariationId,
|
|
2382
2428
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
@@ -2400,12 +2446,12 @@ function se(e) {
|
|
|
2400
2446
|
}),
|
|
2401
2447
|
{}
|
|
2402
2448
|
), o = {
|
|
2403
|
-
content:
|
|
2449
|
+
content: qn({
|
|
2404
2450
|
content: e.content,
|
|
2405
2451
|
data: e.data
|
|
2406
2452
|
}),
|
|
2407
2453
|
localState: void 0,
|
|
2408
|
-
rootState:
|
|
2454
|
+
rootState: zn({
|
|
2409
2455
|
content: e.content,
|
|
2410
2456
|
data: e.data,
|
|
2411
2457
|
locale: e.locale
|
|
@@ -2435,7 +2481,7 @@ function se(e) {
|
|
|
2435
2481
|
BlocksWrapperProps: e.blocksWrapperProps || {}
|
|
2436
2482
|
};
|
|
2437
2483
|
return /* @__PURE__ */ R(
|
|
2438
|
-
|
|
2484
|
+
ze,
|
|
2439
2485
|
{
|
|
2440
2486
|
content: e.content,
|
|
2441
2487
|
data: e.data,
|
|
@@ -2453,9 +2499,9 @@ function se(e) {
|
|
|
2453
2499
|
linkComponent: e.linkComponent,
|
|
2454
2500
|
trustedHosts: e.trustedHosts,
|
|
2455
2501
|
children: [
|
|
2456
|
-
e.isSsrAbTest ? /* @__PURE__ */ l(
|
|
2457
|
-
/* @__PURE__ */ l(
|
|
2458
|
-
|
|
2502
|
+
e.isSsrAbTest ? /* @__PURE__ */ l(k, { children: /* @__PURE__ */ l(D, { scriptStr: t }) }) : null,
|
|
2503
|
+
/* @__PURE__ */ l(k, { children: /* @__PURE__ */ l(
|
|
2504
|
+
Kn,
|
|
2459
2505
|
{
|
|
2460
2506
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
2461
2507
|
cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
|
|
@@ -2475,14 +2521,14 @@ function se(e) {
|
|
|
2475
2521
|
}
|
|
2476
2522
|
);
|
|
2477
2523
|
}
|
|
2478
|
-
function
|
|
2524
|
+
function Ve(e) {
|
|
2479
2525
|
var r, a;
|
|
2480
|
-
const t =
|
|
2526
|
+
const t = en({
|
|
2481
2527
|
canTrack: U(e.canTrack),
|
|
2482
2528
|
content: e.content
|
|
2483
2529
|
}), n = function() {
|
|
2484
2530
|
var c;
|
|
2485
|
-
return
|
|
2531
|
+
return on(
|
|
2486
2532
|
B(e.content).map((m) => ({
|
|
2487
2533
|
id: m.testVariationId,
|
|
2488
2534
|
testRatio: m.testRatio
|
|
@@ -2496,14 +2542,14 @@ function Be(e) {
|
|
|
2496
2542
|
return t ? {
|
|
2497
2543
|
...e.content,
|
|
2498
2544
|
testVariationId: (c = e.content) == null ? void 0 : c.id
|
|
2499
|
-
} :
|
|
2545
|
+
} : $t({
|
|
2500
2546
|
item: e.content,
|
|
2501
2547
|
canTrack: U(e.canTrack)
|
|
2502
2548
|
});
|
|
2503
2549
|
};
|
|
2504
|
-
return /* @__PURE__ */ R(
|
|
2505
|
-
!e.__isNestedRender && I !== "reactNative" ? /* @__PURE__ */ l(
|
|
2506
|
-
t ? /* @__PURE__ */ R(
|
|
2550
|
+
return /* @__PURE__ */ R(k, { children: [
|
|
2551
|
+
!e.__isNestedRender && I !== "reactNative" ? /* @__PURE__ */ l(k, { children: /* @__PURE__ */ l(D, { scriptStr: nn() }) }) : null,
|
|
2552
|
+
t ? /* @__PURE__ */ R(k, { children: [
|
|
2507
2553
|
/* @__PURE__ */ l(
|
|
2508
2554
|
O,
|
|
2509
2555
|
{
|
|
@@ -2564,7 +2610,7 @@ function Be(e) {
|
|
|
2564
2610
|
)
|
|
2565
2611
|
] });
|
|
2566
2612
|
}
|
|
2567
|
-
const
|
|
2613
|
+
const Gn = async ({
|
|
2568
2614
|
builderContextValue: e,
|
|
2569
2615
|
symbol: t
|
|
2570
2616
|
}) => {
|
|
@@ -2580,10 +2626,10 @@ const zn = async ({
|
|
|
2580
2626
|
}
|
|
2581
2627
|
}
|
|
2582
2628
|
}).catch((n) => {
|
|
2583
|
-
|
|
2629
|
+
v.error("Could not fetch symbol content: ", n);
|
|
2584
2630
|
});
|
|
2585
2631
|
};
|
|
2586
|
-
async function
|
|
2632
|
+
async function Jn(e) {
|
|
2587
2633
|
var o, i, r, a, s;
|
|
2588
2634
|
const t = function() {
|
|
2589
2635
|
var m, g;
|
|
@@ -2593,12 +2639,12 @@ async function qn(e) {
|
|
|
2593
2639
|
(m = e.symbol) != null && m.inline ? "builder-inline-symbol" : void 0,
|
|
2594
2640
|
(g = e.symbol) != null && g.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2595
2641
|
].filter(Boolean).join(" ");
|
|
2596
|
-
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await
|
|
2642
|
+
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await Gn({
|
|
2597
2643
|
symbol: e.symbol,
|
|
2598
2644
|
builderContextValue: e.builderContext
|
|
2599
2645
|
});
|
|
2600
2646
|
return /* @__PURE__ */ l("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ l(
|
|
2601
|
-
|
|
2647
|
+
Ve,
|
|
2602
2648
|
{
|
|
2603
2649
|
__isNestedRender: !0,
|
|
2604
2650
|
apiVersion: e.builderContext.apiVersion,
|
|
@@ -2619,9 +2665,9 @@ async function qn(e) {
|
|
|
2619
2665
|
}
|
|
2620
2666
|
) });
|
|
2621
2667
|
}
|
|
2622
|
-
const
|
|
2623
|
-
function
|
|
2624
|
-
if (
|
|
2668
|
+
const po = F, go = Ve, ce = {};
|
|
2669
|
+
function bo(e) {
|
|
2670
|
+
if (S()) {
|
|
2625
2671
|
Object.assign(ce, e);
|
|
2626
2672
|
const t = {
|
|
2627
2673
|
type: "builder.settingsChange",
|
|
@@ -2630,7 +2676,7 @@ function po(e) {
|
|
|
2630
2676
|
parent.postMessage(t, "*");
|
|
2631
2677
|
}
|
|
2632
2678
|
}
|
|
2633
|
-
const
|
|
2679
|
+
const yo = async (e) => {
|
|
2634
2680
|
var o, i, r;
|
|
2635
2681
|
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((i = e.userAttributes) == null ? void 0 : i.urlPath), n = {
|
|
2636
2682
|
...e,
|
|
@@ -2651,43 +2697,44 @@ const go = async (e) => {
|
|
|
2651
2697
|
};
|
|
2652
2698
|
};
|
|
2653
2699
|
export {
|
|
2654
|
-
|
|
2700
|
+
we as A,
|
|
2655
2701
|
F as B,
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2702
|
+
Ve as C,
|
|
2703
|
+
lo as D,
|
|
2704
|
+
fo as E,
|
|
2705
|
+
yo as F,
|
|
2706
|
+
yn as G,
|
|
2707
|
+
Te as H,
|
|
2708
|
+
so as I,
|
|
2709
|
+
ao as J,
|
|
2710
|
+
po as R,
|
|
2711
|
+
Jn as S,
|
|
2712
|
+
Gt as T,
|
|
2713
|
+
Pn as _,
|
|
2714
|
+
yt as a,
|
|
2715
|
+
no as b,
|
|
2669
2716
|
j as c,
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2717
|
+
oo as d,
|
|
2718
|
+
io as e,
|
|
2719
|
+
S as f,
|
|
2673
2720
|
M as g,
|
|
2674
2721
|
U as h,
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2722
|
+
to as i,
|
|
2723
|
+
co as j,
|
|
2724
|
+
Fn as k,
|
|
2725
|
+
v as l,
|
|
2679
2726
|
H as m,
|
|
2680
|
-
|
|
2727
|
+
uo as n,
|
|
2681
2728
|
W as o,
|
|
2682
|
-
|
|
2729
|
+
ro as p,
|
|
2683
2730
|
q,
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2731
|
+
mo as r,
|
|
2732
|
+
Nn as s,
|
|
2733
|
+
ho as t,
|
|
2734
|
+
un as u,
|
|
2735
|
+
sn as v,
|
|
2736
|
+
go as w,
|
|
2737
|
+
vt as x,
|
|
2691
2738
|
On as y,
|
|
2692
|
-
|
|
2739
|
+
bo as z
|
|
2693
2740
|
};
|