@builder.io/sdk-react 2.0.5 → 2.0.9
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/blocks-exports.cjs +17 -17
- package/lib/browser/blocks-exports.mjs +53 -53
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/init.cjs +1 -1
- package/lib/browser/init.mjs +1 -1
- package/lib/{node/server-entry-7e145817.cjs → browser/server-entry-16fc27fe.cjs} +2 -2
- package/lib/browser/{server-entry-0c6c220c.js → server-entry-8bf52a55.js} +74 -73
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-99129d68.js → accordion-589b3ac8.js} +1 -1
- package/lib/edge/{accordion-72dab8ce.cjs → accordion-afed3bd3.cjs} +1 -1
- package/lib/edge/{blocks-53ae1b87.cjs → blocks-854f4022.cjs} +2 -2
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{blocks-426e0c44.js → blocks-fdb24842.js} +33 -33
- package/lib/edge/{button-778062cd.js → button-08412b69.js} +2 -2
- package/lib/edge/{button-967d0268.cjs → button-26b76a4a.cjs} +1 -1
- package/lib/edge/{columns-3a8c4d3f.js → columns-bd2a004b.js} +4 -4
- package/lib/edge/{columns-3b921658.cjs → columns-ccdafcc7.cjs} +1 -1
- package/lib/edge/{content-variants-15d191de.js → content-variants-dd7ea0f9.js} +11 -11
- package/lib/edge/{content-variants-4b8718f8.cjs → content-variants-fc207487.cjs} +4 -4
- package/lib/edge/{evaluate-c0eeb4f8.cjs → evaluate-3991fda5.cjs} +1 -1
- package/lib/edge/{evaluate-26c0fdb7.js → evaluate-e2f692df.js} +1 -1
- package/lib/edge/{form-9d9dce5d.cjs → form-5eb85abf.cjs} +1 -1
- package/lib/edge/{form-ccb0b912.js → form-b9148162.js} +4 -4
- package/lib/edge/{get-class-prop-name-0a91c3bd.js → get-class-prop-name-0c783f8c.js} +1 -1
- package/lib/edge/{get-class-prop-name-eae60eae.cjs → get-class-prop-name-2fa91d70.cjs} +1 -1
- package/lib/edge/{img-183de27d.cjs → img-2f30658b.cjs} +1 -1
- package/lib/edge/{img-75751c89.js → img-602f7d3a.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/init.cjs +1 -1
- package/lib/edge/init.mjs +1 -1
- package/lib/edge/{input-27972020.js → input-4c791db9.js} +1 -1
- package/lib/edge/{input-fd18a67d.cjs → input-551362f3.cjs} +1 -1
- package/lib/edge/{select-60ff549c.js → select-d1391d12.js} +1 -1
- package/lib/edge/{select-6ea0d59f.cjs → select-eb26f837.cjs} +1 -1
- package/lib/edge/server-entry-7b4fa72f.cjs +2 -0
- package/lib/edge/{server-entry-feff6177.js → server-entry-c537d834.js} +59 -58
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-2347377e.js → slot-d375d5eb.js} +4 -4
- package/lib/edge/{slot-a4509cae.cjs → slot-d723d000.cjs} +1 -1
- package/lib/edge/{symbol-98650b06.cjs → symbol-6c18ca90.cjs} +1 -1
- package/lib/edge/{symbol-dcef0d8e.js → symbol-8b3a6b98.js} +2 -2
- package/lib/edge/{tabs-0784574b.js → tabs-1e47cfd4.js} +4 -4
- package/lib/edge/{tabs-4c131e17.cjs → tabs-8296bce7.cjs} +1 -1
- package/lib/edge/{text-1c1986aa.cjs → text-9eac9e4d.cjs} +1 -1
- package/lib/edge/{text-6f7cbc35.js → text-d3c86634.js} +2 -2
- package/lib/node/blocks-exports.cjs +3 -3
- package/lib/node/blocks-exports.mjs +19 -19
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +2 -2
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +2 -2
- package/lib/node/{node-runtime-4978bc21.cjs → node-runtime-c7c85f6c.cjs} +1 -1
- package/lib/node/{node-runtime-ce5c71e5.js → node-runtime-e41e9eb6.js} +1 -1
- package/lib/{browser/server-entry-7e145817.cjs → node/server-entry-16fc27fe.cjs} +2 -2
- package/lib/node/{server-entry-0c6c220c.js → server-entry-8bf52a55.js} +74 -73
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/components/content-variants/content-variants.types.d.ts +2 -1
- package/types/components/content-variants/extra-framework-props-types.d.ts +2 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/context/extra-context-types.d.ts +6 -0
- package/types/context/types.d.ts +2 -1
- package/types/functions/register-component.d.ts +1 -1
- package/lib/edge/server-entry-4133a544.cjs +0 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const v = "react",
|
|
1
|
+
const v = "react", Q = (t) => {
|
|
2
2
|
const e = {};
|
|
3
3
|
return t.forEach((n, r) => {
|
|
4
4
|
e[r] = n;
|
|
5
5
|
}), e;
|
|
6
|
-
}, L = (t) => t instanceof URLSearchParams ?
|
|
6
|
+
}, L = (t) => t instanceof URLSearchParams ? Q(t) : t, V = (t) => typeof t == "string" ? t : t instanceof URLSearchParams ? t.toString() : new URLSearchParams(t).toString();
|
|
7
7
|
function c() {
|
|
8
8
|
return typeof window != "undefined" && typeof document != "undefined";
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Y() {
|
|
11
11
|
return c() && window.self !== window.top;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function Z(t) {
|
|
14
|
+
return Y() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
|
|
15
15
|
V(t || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
16
16
|
}
|
|
17
17
|
function _t(t) {
|
|
@@ -20,16 +20,17 @@ function _t(t) {
|
|
|
20
20
|
}
|
|
21
21
|
const $t = (t) => ({
|
|
22
22
|
type: "builder.registerComponent",
|
|
23
|
-
data:
|
|
24
|
-
}),
|
|
23
|
+
data: U(t)
|
|
24
|
+
}), tt = (t) => {
|
|
25
25
|
const e = t.toString().trim();
|
|
26
26
|
return `return (${!e.startsWith("function") && !e.startsWith("(") ? "function " : ""}${e}).apply(this, arguments)`;
|
|
27
27
|
};
|
|
28
|
-
function
|
|
29
|
-
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ?
|
|
28
|
+
function U(t) {
|
|
29
|
+
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ? tt(n) : n));
|
|
30
30
|
}
|
|
31
31
|
const x = {};
|
|
32
32
|
function et(t, e) {
|
|
33
|
+
t === "plugin" && (e = U(e));
|
|
33
34
|
let n = x[t];
|
|
34
35
|
if (n || (n = x[t] = []), n.push(e), c()) {
|
|
35
36
|
const r = {
|
|
@@ -57,7 +58,7 @@ function Gt(t) {
|
|
|
57
58
|
parent.postMessage(e, "*");
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
const T = "builder.", nt = "options.",
|
|
61
|
+
const T = "builder.", nt = "options.", M = (t) => {
|
|
61
62
|
if (!t)
|
|
62
63
|
return {};
|
|
63
64
|
const e = L(t), n = {};
|
|
@@ -71,7 +72,7 @@ const T = "builder.", nt = "options.", U = (t) => {
|
|
|
71
72
|
if (!c())
|
|
72
73
|
return {};
|
|
73
74
|
const t = new URLSearchParams(window.location.search);
|
|
74
|
-
return
|
|
75
|
+
return M(t);
|
|
75
76
|
}, b = "[Builder.io]: ", f = {
|
|
76
77
|
log: (...t) => console.log(b, ...t),
|
|
77
78
|
error: (...t) => console.error(b, ...t),
|
|
@@ -82,7 +83,7 @@ const T = "builder.", nt = "options.", U = (t) => {
|
|
|
82
83
|
return t;
|
|
83
84
|
const e = t.split(".");
|
|
84
85
|
return e.length > 2 ? e.slice(1).join(".") : t;
|
|
85
|
-
},
|
|
86
|
+
}, F = ({
|
|
86
87
|
name: t,
|
|
87
88
|
canTrack: e
|
|
88
89
|
}) => {
|
|
@@ -93,14 +94,14 @@ const T = "builder.", nt = "options.", U = (t) => {
|
|
|
93
94
|
f.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
96
|
-
}, N = async (t) =>
|
|
97
|
+
}, N = async (t) => F(t), st = (t) => t.map(([e, n]) => n ? `${e}=${n}` : e).filter(m).join("; "), it = [["secure", ""], ["SameSite", "None"]], at = ({
|
|
97
98
|
name: t,
|
|
98
99
|
value: e,
|
|
99
100
|
expires: n
|
|
100
101
|
}) => {
|
|
101
102
|
const o = (c() ? location.protocol === "https:" : !0) ? it : [[]], s = n ? [["expires", n.toUTCString()]] : [[]], a = [[t, e], ...s, ["path", "/"], ["domain", ot(window.location.hostname)], ...o];
|
|
102
103
|
return st(a);
|
|
103
|
-
},
|
|
104
|
+
}, j = async ({
|
|
104
105
|
name: t,
|
|
105
106
|
value: e,
|
|
106
107
|
expires: n,
|
|
@@ -125,16 +126,16 @@ function ct() {
|
|
|
125
126
|
return (t == "x" ? e : e & 3 | 8).toString(16);
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
+
function D() {
|
|
129
130
|
return ct().replace(/-/g, "");
|
|
130
131
|
}
|
|
131
|
-
const
|
|
132
|
+
const K = "builderSessionId", ut = async ({
|
|
132
133
|
canTrack: t
|
|
133
134
|
}) => {
|
|
134
135
|
if (!t)
|
|
135
136
|
return;
|
|
136
137
|
const e = await N({
|
|
137
|
-
name:
|
|
138
|
+
name: K,
|
|
138
139
|
canTrack: t
|
|
139
140
|
});
|
|
140
141
|
if (m(e))
|
|
@@ -146,20 +147,20 @@ const D = "builderSessionId", ut = async ({
|
|
|
146
147
|
canTrack: t
|
|
147
148
|
}), n;
|
|
148
149
|
}
|
|
149
|
-
}, dt = () =>
|
|
150
|
+
}, dt = () => D(), lt = ({
|
|
150
151
|
id: t,
|
|
151
152
|
canTrack: e
|
|
152
|
-
}) =>
|
|
153
|
-
name:
|
|
153
|
+
}) => j({
|
|
154
|
+
name: K,
|
|
154
155
|
value: t,
|
|
155
156
|
canTrack: e
|
|
156
|
-
}),
|
|
157
|
+
}), W = () => c() && typeof localStorage != "undefined" ? localStorage : void 0, ft = ({
|
|
157
158
|
key: t,
|
|
158
159
|
canTrack: e
|
|
159
160
|
}) => {
|
|
160
161
|
var n;
|
|
161
162
|
try {
|
|
162
|
-
return e ? (n =
|
|
163
|
+
return e ? (n = W()) == null ? void 0 : n.getItem(t) : void 0;
|
|
163
164
|
} catch (r) {
|
|
164
165
|
console.debug("[LocalStorage] GET error: ", r);
|
|
165
166
|
return;
|
|
@@ -171,17 +172,17 @@ const D = "builderSessionId", ut = async ({
|
|
|
171
172
|
}) => {
|
|
172
173
|
var r;
|
|
173
174
|
try {
|
|
174
|
-
e && ((r =
|
|
175
|
+
e && ((r = W()) == null || r.setItem(t, n));
|
|
175
176
|
} catch (o) {
|
|
176
177
|
console.debug("[LocalStorage] SET error: ", o);
|
|
177
178
|
}
|
|
178
|
-
},
|
|
179
|
+
}, _ = "builderVisitorId", gt = ({
|
|
179
180
|
canTrack: t
|
|
180
181
|
}) => {
|
|
181
182
|
if (!t)
|
|
182
183
|
return;
|
|
183
184
|
const e = ft({
|
|
184
|
-
key:
|
|
185
|
+
key: _,
|
|
185
186
|
canTrack: t
|
|
186
187
|
});
|
|
187
188
|
if (m(e))
|
|
@@ -193,11 +194,11 @@ const D = "builderSessionId", ut = async ({
|
|
|
193
194
|
canTrack: t
|
|
194
195
|
}), n;
|
|
195
196
|
}
|
|
196
|
-
}, pt = () =>
|
|
197
|
+
}, pt = () => D(), mt = ({
|
|
197
198
|
id: t,
|
|
198
199
|
canTrack: e
|
|
199
200
|
}) => ht({
|
|
200
|
-
key:
|
|
201
|
+
key: _,
|
|
201
202
|
value: t,
|
|
202
203
|
canTrack: e
|
|
203
204
|
}), yt = () => {
|
|
@@ -275,7 +276,7 @@ async function It(t) {
|
|
|
275
276
|
f.error("Missing API key for track call. Please provide your API key.");
|
|
276
277
|
return;
|
|
277
278
|
}
|
|
278
|
-
if (t.canTrack && !
|
|
279
|
+
if (t.canTrack && !Z() && (c() || v === "reactNative"))
|
|
279
280
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
280
281
|
method: "POST",
|
|
281
282
|
body: JSON.stringify({
|
|
@@ -293,13 +294,13 @@ const Jt = (t) => It({
|
|
|
293
294
|
...t,
|
|
294
295
|
canTrack: !0
|
|
295
296
|
}), kt = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
296
|
-
function
|
|
297
|
+
function $(t, e) {
|
|
297
298
|
if (!e.origin.startsWith("http") && !e.origin.startsWith("https"))
|
|
298
299
|
return !1;
|
|
299
300
|
const n = new URL(e.origin), r = n.hostname;
|
|
300
301
|
return (t || kt).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
301
302
|
}
|
|
302
|
-
const Et = "2.0.
|
|
303
|
+
const Et = "2.0.9", zt = () => {
|
|
303
304
|
et("insertMenu", {
|
|
304
305
|
name: "_default",
|
|
305
306
|
default: !0,
|
|
@@ -343,7 +344,7 @@ const Pt = (t = {}) => {
|
|
|
343
344
|
}
|
|
344
345
|
}, "*"), window.addEventListener("message", (r) => {
|
|
345
346
|
var s, a;
|
|
346
|
-
if (
|
|
347
|
+
if (!$(t.trustedHosts, r))
|
|
347
348
|
return;
|
|
348
349
|
const {
|
|
349
350
|
data: o
|
|
@@ -389,7 +390,7 @@ const Pt = (t = {}) => {
|
|
|
389
390
|
trustedHosts: e,
|
|
390
391
|
callbacks: n
|
|
391
392
|
}) => (r) => {
|
|
392
|
-
if (
|
|
393
|
+
if (!$(e, r))
|
|
393
394
|
return;
|
|
394
395
|
const {
|
|
395
396
|
data: o
|
|
@@ -436,17 +437,17 @@ const Pt = (t = {}) => {
|
|
|
436
437
|
canTrack: !0
|
|
437
438
|
}), At = ({
|
|
438
439
|
contentId: t
|
|
439
|
-
}) =>
|
|
440
|
+
}) => F({
|
|
440
441
|
name: E(t),
|
|
441
442
|
canTrack: !0
|
|
442
443
|
}), Tt = ({
|
|
443
444
|
contentId: t,
|
|
444
445
|
value: e
|
|
445
|
-
}) =>
|
|
446
|
+
}) => j({
|
|
446
447
|
name: E(t),
|
|
447
448
|
value: e,
|
|
448
449
|
canTrack: !0
|
|
449
|
-
}),
|
|
450
|
+
}), G = (t) => m(t.id) && m(t.variations) && Object.keys(t.variations).length > 0, Rt = ({
|
|
450
451
|
id: t,
|
|
451
452
|
variations: e
|
|
452
453
|
}) => {
|
|
@@ -459,7 +460,7 @@ const Pt = (t = {}) => {
|
|
|
459
460
|
return s;
|
|
460
461
|
}
|
|
461
462
|
return t;
|
|
462
|
-
},
|
|
463
|
+
}, J = (t) => {
|
|
463
464
|
const e = Rt(t);
|
|
464
465
|
return Tt({
|
|
465
466
|
contentId: t.id,
|
|
@@ -467,7 +468,7 @@ const Pt = (t = {}) => {
|
|
|
467
468
|
}).catch((n) => {
|
|
468
469
|
f.error("could not store A/B test variation: ", n);
|
|
469
470
|
}), e;
|
|
470
|
-
},
|
|
471
|
+
}, z = ({
|
|
471
472
|
item: t,
|
|
472
473
|
testGroupId: e
|
|
473
474
|
}) => {
|
|
@@ -489,14 +490,14 @@ const Pt = (t = {}) => {
|
|
|
489
490
|
return t;
|
|
490
491
|
if (!t)
|
|
491
492
|
return;
|
|
492
|
-
if (
|
|
493
|
+
if (!G(t))
|
|
493
494
|
return t;
|
|
494
495
|
const n = At({
|
|
495
496
|
contentId: t.id
|
|
496
|
-
}) ||
|
|
497
|
+
}) || J({
|
|
497
498
|
variations: t.variations,
|
|
498
499
|
id: t.id
|
|
499
|
-
}), r =
|
|
500
|
+
}), r = z({
|
|
500
501
|
item: t,
|
|
501
502
|
testGroupId: n
|
|
502
503
|
});
|
|
@@ -508,14 +509,14 @@ const Pt = (t = {}) => {
|
|
|
508
509
|
item: t,
|
|
509
510
|
canTrack: e
|
|
510
511
|
}) => {
|
|
511
|
-
if (!e ||
|
|
512
|
+
if (!e || !G(t))
|
|
512
513
|
return t;
|
|
513
514
|
const r = await xt({
|
|
514
515
|
contentId: t.id
|
|
515
|
-
}) ||
|
|
516
|
+
}) || J({
|
|
516
517
|
variations: t.variations,
|
|
517
518
|
id: t.id
|
|
518
|
-
}), o =
|
|
519
|
+
}), o = z({
|
|
519
520
|
item: t,
|
|
520
521
|
testGroupId: r
|
|
521
522
|
});
|
|
@@ -547,14 +548,14 @@ function k(t, e = null, n = ".") {
|
|
|
547
548
|
};
|
|
548
549
|
}, {});
|
|
549
550
|
}
|
|
550
|
-
function
|
|
551
|
+
function H(t, e, n = {}) {
|
|
551
552
|
for (const r in t) {
|
|
552
553
|
const o = t[r], s = e ? e + "." + r : r;
|
|
553
|
-
o && typeof o == "object" && !Array.isArray(o) && !Object.keys(o).find((a) => a.startsWith("$")) ?
|
|
554
|
+
o && typeof o == "object" && !Array.isArray(o) && !Object.keys(o).find((a) => a.startsWith("$")) ? H(o, s, n) : n[s] = o;
|
|
554
555
|
}
|
|
555
556
|
return n;
|
|
556
557
|
}
|
|
557
|
-
const
|
|
558
|
+
const Ft = "v3", B = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t) => {
|
|
558
559
|
const {
|
|
559
560
|
limit: e = 30,
|
|
560
561
|
userAttributes: n,
|
|
@@ -563,7 +564,7 @@ const Nt = "v3", B = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t)
|
|
|
563
564
|
apiKey: s,
|
|
564
565
|
enrich: a,
|
|
565
566
|
locale: d,
|
|
566
|
-
apiVersion: y =
|
|
567
|
+
apiVersion: y = Ft,
|
|
567
568
|
fields: p,
|
|
568
569
|
omit: I,
|
|
569
570
|
offset: u,
|
|
@@ -576,29 +577,29 @@ const Nt = "v3", B = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t)
|
|
|
576
577
|
throw new Error("Missing API key");
|
|
577
578
|
if (!["v3"].includes(y))
|
|
578
579
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);
|
|
579
|
-
const
|
|
580
|
-
if (i.searchParams.set("apiKey", s), i.searchParams.set("limit", String(e)), i.searchParams.set("noTraverse", String(
|
|
580
|
+
const X = e !== 1, i = new URL(`https://cdn.builder.io/api/${y}/content/${o}`);
|
|
581
|
+
if (i.searchParams.set("apiKey", s), i.searchParams.set("limit", String(e)), i.searchParams.set("noTraverse", String(X)), i.searchParams.set("includeRefs", String(!0)), d && i.searchParams.set("locale", d), a && i.searchParams.set("enrich", String(a)), i.searchParams.set("omit", I || "meta.componentsUsed"), p && i.searchParams.set("fields", p), Number.isFinite(u) && u > -1 && i.searchParams.set("offset", String(Math.floor(u))), typeof O == "boolean" && i.searchParams.set("includeUnpublished", String(O)), h && B(h) && i.searchParams.set("cacheSeconds", String(h)), g && B(g) && i.searchParams.set("staleCacheSeconds", String(g)), w) {
|
|
581
582
|
const l = k({
|
|
582
583
|
sort: w
|
|
583
584
|
});
|
|
584
585
|
for (const S in l)
|
|
585
586
|
i.searchParams.set(S, JSON.stringify(l[S]));
|
|
586
587
|
}
|
|
587
|
-
const
|
|
588
|
+
const q = {
|
|
588
589
|
...rt(),
|
|
589
590
|
...L(t.options || {})
|
|
590
|
-
}, C = k(
|
|
591
|
+
}, C = k(q);
|
|
591
592
|
for (const l in C)
|
|
592
593
|
i.searchParams.set(l, String(C[l]));
|
|
593
594
|
if (n && i.searchParams.set("userAttributes", JSON.stringify(n)), r) {
|
|
594
|
-
const l =
|
|
595
|
+
const l = H({
|
|
595
596
|
query: r
|
|
596
597
|
});
|
|
597
598
|
for (const S in l)
|
|
598
599
|
i.searchParams.set(S, JSON.stringify(l[S]));
|
|
599
600
|
}
|
|
600
601
|
return i;
|
|
601
|
-
},
|
|
602
|
+
}, Nt = (t) => "results" in t;
|
|
602
603
|
async function jt(t) {
|
|
603
604
|
const e = await Wt({
|
|
604
605
|
...t,
|
|
@@ -630,7 +631,7 @@ const Dt = async (t) => {
|
|
|
630
631
|
async function Wt(t) {
|
|
631
632
|
try {
|
|
632
633
|
const e = P(t), n = await Dt(t);
|
|
633
|
-
return
|
|
634
|
+
return Nt(n) ? Kt(t, n) : (f.error("Error fetching data. ", {
|
|
634
635
|
url: e,
|
|
635
636
|
content: n,
|
|
636
637
|
options: t
|
|
@@ -651,7 +652,7 @@ const qt = async (t) => {
|
|
|
651
652
|
urlPath: e
|
|
652
653
|
} : {}
|
|
653
654
|
},
|
|
654
|
-
options:
|
|
655
|
+
options: M(t.searchParams || ((s = t.url) == null ? void 0 : s.searchParams) || t.options)
|
|
655
656
|
};
|
|
656
657
|
return {
|
|
657
658
|
apiKey: n.apiKey,
|
|
@@ -671,17 +672,17 @@ export {
|
|
|
671
672
|
qt as fetchBuilderProps,
|
|
672
673
|
Wt as fetchEntries,
|
|
673
674
|
jt as fetchOneEntry,
|
|
674
|
-
|
|
675
|
+
M as getBuilderSearchParams,
|
|
675
676
|
Lt as getDefaultCanTrack,
|
|
676
677
|
St as getUserAttributes,
|
|
677
678
|
Xt as handleABTestingSync,
|
|
678
679
|
c as isBrowser,
|
|
679
|
-
|
|
680
|
+
Z as isEditing,
|
|
680
681
|
_t as isPreviewing,
|
|
681
682
|
f as logger,
|
|
682
683
|
et as register,
|
|
683
684
|
zt as registerInsertMenu,
|
|
684
|
-
|
|
685
|
+
U as serializeIncludingFunctions,
|
|
685
686
|
Gt as setEditorSettings,
|
|
686
687
|
Pt as setupBrowserForEditing,
|
|
687
688
|
Ht as subscribeToEditor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-7b4fa72f.cjs");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-
|
|
1
|
+
import { _processContentResult as r, createRegisterComponentMessage as s, fetchBuilderProps as i, fetchEntries as n, fetchOneEntry as o, getBuilderSearchParams as c, isEditing as g, isPreviewing as a, register as d, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-c537d834.js";
|
|
2
2
|
export {
|
|
3
3
|
r as _processContentResult,
|
|
4
4
|
s as createRegisterComponentMessage,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { Blocks as m } from "./blocks-
|
|
2
|
+
import { Blocks as m } from "./blocks-fdb24842.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./evaluate-
|
|
7
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-c537d834.js";
|
|
6
|
+
import "./evaluate-e2f692df.js";
|
|
7
|
+
import "./get-class-prop-name-0c783f8c.js";
|
|
8
8
|
import "./dynamic-renderer-8b343325.js";
|
|
9
9
|
function f(t) {
|
|
10
10
|
var e, o, i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("./blocks-854f4022.cjs");require("react");require("./blocks-exports.cjs");require("./server-entry-7b4fa72f.cjs");require("./evaluate-3991fda5.cjs");require("./get-class-prop-name-2fa91d70.cjs");require("./dynamic-renderer-b29b45ca.cjs");function o(e){var t,r,n;return i.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:i.jsx(u.Blocks,{parent:(r=e.builderContext.context)==null?void 0:r.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(n=e.builderContext.rootState)==null?void 0:n[e.name]})})}exports.default=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),C=require("./blocks-exports.cjs"),v=require("./get-class-prop-name-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("react"),C=require("./blocks-exports.cjs"),v=require("./get-class-prop-name-2fa91d70.cjs"),m=require("./server-entry-7b4fa72f.cjs"),k=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return m.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(r=>{m.logger.error("Could not fetch symbol content: ",r)})};function x(e){var c,a,d,u;function t(){return"div"}function r(){return"div"}function b(){var n,l;return[e.attributes[v.getClassPropName()],"builder-symbol",(n=e.symbol)!=null&&n.inline?"builder-inline-symbol":void 0,(l=e.symbol)!=null&&l.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[i,y]=o.useState(()=>{var n;return(n=e.symbol)==null?void 0:n.content});function f(){i||k({symbol:e.symbol,builderContextValue:e.builderContext}).then(n=>{n&&y(n)})}return o.useEffect(()=>{},[]),o.useEffect(()=>{f()},[e.symbol]),s.jsx("div",{...e.attributes,className:b(),children:s.jsx(C.Content,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(c=e.builderBlock)==null?void 0:c.id},customComponents:Object.values(e.builderComponents),data:{...(a=e.symbol)==null?void 0:a.data,...e.builderContext.localState,...(d=i==null?void 0:i.data)==null?void 0:d.state},canTrack:e.builderContext.canTrack,model:(u=e.symbol)==null?void 0:u.model,content:i,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:r()})})}exports.default=x;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { useState as s, useEffect as u } from "react";
|
|
3
3
|
import { Content as C } from "./blocks-exports.mjs";
|
|
4
|
-
import { getClassPropName as v } from "./get-class-prop-name-
|
|
5
|
-
import { fetchOneEntry as k, logger as h } from "./server-entry-
|
|
4
|
+
import { getClassPropName as v } from "./get-class-prop-name-0c783f8c.js";
|
|
5
|
+
import { fetchOneEntry as k, logger as h } from "./server-entry-c537d834.js";
|
|
6
6
|
const x = async ({
|
|
7
7
|
builderContextValue: e,
|
|
8
8
|
symbol: t
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as m, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u } from "react";
|
|
3
|
-
import { Blocks as c } from "./blocks-
|
|
3
|
+
import { Blocks as c } from "./blocks-fdb24842.js";
|
|
4
4
|
import "./blocks-exports.mjs";
|
|
5
|
-
import "./server-entry-
|
|
6
|
-
import "./evaluate-
|
|
7
|
-
import "./get-class-prop-name-
|
|
5
|
+
import "./server-entry-c537d834.js";
|
|
6
|
+
import "./evaluate-e2f692df.js";
|
|
7
|
+
import "./get-class-prop-name-0c783f8c.js";
|
|
8
8
|
import "./dynamic-renderer-8b343325.js";
|
|
9
9
|
function x(t) {
|
|
10
10
|
var b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),b=require("react"),r=require("./blocks-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),b=require("react"),r=require("./blocks-854f4022.cjs");require("./blocks-exports.cjs");require("./server-entry-7b4fa72f.cjs");require("./evaluate-3991fda5.cjs");require("./get-class-prop-name-2fa91d70.cjs");require("./dynamic-renderer-b29b45ca.cjs");function s(e){var c;const[t,a]=b.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function o(n){return e.tabs&&e.tabs[n].content}function u(n){n===t&&e.collapsible?a(-1):a(n)}return i.jsxs("div",{children:[i.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(c=e.tabs)==null?void 0:c.map((n,l)=>i.jsx("span",{className:`builder-tab-wrap ${t===l?"builder-tab-active":""}`,style:{...t===l?e.activeTabStyle:{}},onClick:d=>u(l),children:i.jsx(r.Blocks,{parent:e.builderBlock.id,path:`component.options.tabs.${l}.label`,blocks:n.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},l))}),o(t)?i.jsx("div",{children:i.jsx(r.Blocks,{parent:e.builderBlock.id,path:`component.options.tabs.${t}.content`,blocks:o(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}exports.default=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("./evaluate-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("./evaluate-3991fda5.cjs");require("./server-entry-7b4fa72f.cjs");function x(e){function n(){var t;const o=e.builderContext,{context:r,localState:a,rootState:c,rootSetState:l}=o;return String(((t=e.text)==null?void 0:t.toString())||"").replace(/{{([^}]+)}}/g,(d,u)=>s.evaluate({code:u,context:r,localState:a,rootState:c,rootSetState:l,enableCache:!1}))}return i.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:n()},style:{outline:"none"}})}exports.default=x;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { evaluate as s } from "./evaluate-
|
|
3
|
-
import "./server-entry-
|
|
2
|
+
import { evaluate as s } from "./evaluate-e2f692df.js";
|
|
3
|
+
import "./server-entry-c537d834.js";
|
|
4
4
|
function f(t) {
|
|
5
5
|
function o() {
|
|
6
6
|
var e;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use client";"use strict";var We=Object.defineProperty;var $e=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>($e(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),p=require("./server-entry-
|
|
1
|
+
"use client";"use strict";var We=Object.defineProperty;var $e=(e,t,n)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>($e(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),p=require("./server-entry-16fc27fe.cjs"),h=require("react"),W=require("./node-runtime-c7c85f6c.cjs"),De=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Le=e=>typeof e=="string"&&De.has(e.toLowerCase());function ie(e){return a.jsx(a.Fragment,{children:Le(e.TagName)?a.jsx(a.Fragment,{children:a.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):a.jsx(a.Fragment,{children:typeof e.TagName=="string"?a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const U=()=>{switch(p.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function fe(e){function t(){return{...e.attributes,[U()]:`${e.link?"":"builder-button"} ${e.attributes[U()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return a.jsx(ie,{attributes:t(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const _=h.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{},nonce:""}),he=h.createContext({registeredComponents:{}});function Oe(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options}}const Me=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:s,rootState:r})=>{const l=W.getFunctionArguments({builder:t,context:n,event:i,state:ge({rootState:r,localState:o,rootSetState:s})});return new Function(...l.map(([c])=>c),e)(...l.map(([,c])=>c))};function ge({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(i,o)=>{if(t&&o in t)return t[o];const s=i[o];return typeof s=="object"&&s!==null?ge({rootState:s,localState:void 0,rootSetState:n?r=>{i[o]=r,n(i)}:void 0}):s},set:(i,o,s)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return i[o]=s,n==null||n(i),!0}})}function Ue(){var e;return typeof process!="undefined"&&p.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const He=()=>{var i;if(!Ue())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(i=process.env.NODE_OPTIONS)==null?void 0:i.includes("--no-node-snapshot");return e&&t&&!n?(p.logger.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},qe=e=>p.isBrowser()||He()?Me(e):W.runInNode(e),N=class N{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return N.cache.get(t)}static setCachedValue(t,n){N.cache.size>20&&N.cache.delete(N.cache.keys().next().value),N.cache.set(t,{value:n})}};Y(N,"cacheLimit",20),Y(N,"cache",new Map);let L=N;function O({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:s,isExpression:r=!0,enableCache:l}){if(e==="")return;const c={code:W.parseCode(e,{isExpression:r}),builder:W.getBuilderGlobals(),context:t,event:s,rootSetState:o,rootState:i,localState:n};if(l){const d=L.getCacheKey(c),f=L.getCachedValue(d);if(f)return f.value}try{const d=qe(c);if(l){const f=L.getCacheKey(c);L.setCachedValue(f,d)}return d}catch(d){p.logger.error("Failed code evaluation: "+d.message,{code:e});return}}const Ke=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const s=W.fastClone(e),r={...s,properties:{...s.properties},actions:{...s.actions}};for(const l in e.bindings){const c=e.bindings[l],d=O({code:c,localState:n,rootState:i,rootSetState:o,context:t,enableCache:!0});W.set(r,l,d)}return r};function z({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:s}){const r=e;return n?Ke({block:r,localState:i,rootState:o,rootSetState:s,context:t}):r}const J=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"";function ze(e,t,n={}){let i,o,s,r=null,l=0;const c=function(){l=n.leading===!1?0:Date.now(),r=null,s=e.apply(i,o),r||(i=o=null)};return function(){const d=Date.now();!l&&n.leading===!1&&(l=d);const f=t-(d-l);return i=this,o=arguments,f<=0||f>t?(r&&(clearTimeout(r),r=null),l=d,s=e.apply(i,o),r||(i=o=null)):!r&&n.trailing!==!1&&(r=setTimeout(c,f)),s}}function M(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const o=arguments[i];if(o!=null)for(const s in o)Object.prototype.hasOwnProperty.call(o,s)&&(n[s]=o[s])}return n}function _e(e){for(const t of e)switch(t.trigger){case"pageLoad":pe(t);break;case"scrollInView":Ge(t);break}}function be(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function xe(e,t){const n=Je(e),i=getComputedStyle(t),o=e.steps[0].styles,s=e.steps[e.steps.length-1].styles,r=[o,s];for(const l of r)for(const c of n)c in l||(l[c]=i[c])}function Je(e){const t=[];for(const n of e.steps)for(const i in n.styles)t.indexOf(i)===-1&&t.push(i);return t}function pe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){be(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{xe(e,n),n.style.transition="none",n.style.transitionDelay="0",M(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${J(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),M(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function Ge(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){be(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{xe(e,n);let i=!1,o=!1;function s(){!i&&l(n)?(i=!0,o=!0,setTimeout(()=>{M(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",r),setTimeout(()=>{o=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!o&&!l(n)&&(i=!1,M(n.style,e.steps[0].styles))}const r=ze(s,200,{leading:!1});function l(f){const u=f.getBoundingClientRect(),m=window.innerHeight,S=(e.thresholdPercent||0)/100*m;return u.bottom>S&&u.top<m-S}const c=e.steps[0].styles;function d(){M(n.style,c)}d(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${J(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",r,{capture:!0,passive:!0}),s()})}const ye=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${J(n)}: ${i};`}).filter(p.checkIsDefined),Ye=e=>ye(e).join(`
|
|
2
2
|
`),q=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
3
|
${Ye(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
5
5
|
${i}
|
|
6
6
|
}`:i};function Qe({style:e}){return e}const Xe=({block:e,context:t})=>Se(Qe({style:e.style||{},context:t,block:e}));function Se(e){switch(p.TARGET){case"svelte":case"vue":case"solid":case"angular":return ye(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const Ze=({block:e,context:t,registeredComponents:n})=>{var s;const i=(s=z({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:s.name;if(!i)return null;const o=n[i];if(o)return o;console.warn(`
|
|
7
7
|
Could not find a registered component named "${i}".
|
|
8
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},et=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=O({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(o))return;const s=n.collection.split(".").pop(),r=n.itemName||(s?s+"Item":"item");return o.map((c,d)=>({context:{...t,localState:{...t.localState,$index:d,$item:c,[r]:c,[`$${r}Index`]:d}},block:i}))},tt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},nt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderComponents?{builderComponents:t}:{}},it=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},ot=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},ve={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ae=(e,t=ve)=>`@media (max-width: ${t[e].max}px)`,ke=({small:e,medium:t})=>{const n=W.fastClone(ve);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const s=n.medium.max+1;return n.large={max:2e3,min:s,default:s+1},n};function G(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function at(e){function t(){const i=z({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return p.checkIsDefined(i.hide)?!i.hide:p.checkIsDefined(i.show)?i.show:!0}function n(){var y,j,R;const i=z({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),o=i.responsiveStyles,s=e.context.content,r=ke(((y=s==null?void 0:s.meta)==null?void 0:y.breakpoints)||{}),l=o==null?void 0:o.large,c=o==null?void 0:o.medium,d=o==null?void 0:o.small,f=i.id;if(!f)return"";const u=l?q({className:f,styles:l}):"",m=c?q({className:f,styles:c,mediaQuery:ae("medium",r)}):"",b=d?q({className:f,styles:d,mediaQuery:ae("small",r)}):"",S=i.animations&&i.animations.find(B=>B.trigger==="hover");let I="";if(S){const B=((R=(j=S.steps)==null?void 0:j[1])==null?void 0:R.styles)||{};I=q({className:`${f}:hover`,styles:{...B,transition:`all ${S.duration}s ${J(S.easing)}`,transitionDelay:S.delay?`${S.delay}s`:"0s"}})||""}return[u,m,b,I].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(G,{id:"builderio-block",styles:n(),nonce:e.context.nonce})}):null})}function rt(e){return e.charAt(0).toUpperCase()+e.slice(1)}const lt=e=>`on${rt(e)}`,st=(e,t)=>n=>O({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function Ce(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const s=n[o];let r=lt(o);if(e.stripPrefix)switch(p.TARGET){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=st(s,e)}return t}function ct({properties:e}){return e}const dt=e=>({href:e.href});function oe({block:e,context:t}){var i;const n={...dt(e),...e.properties,"builder-id":e.id,style:Xe({block:e,context:t}),[U()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return ct({properties:n,context:t,block:e})}function ut(e){return a.jsx(ie,{TagName:e.Wrapper,attributes:oe({block:e.block,context:e.context}),actionAttributes:Ce({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function mt(e){function t(){return e.includeBlockProps?{...oe({block:e.block,context:e.context}),...Ce({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return a.jsx(e.Wrapper,{...e.wrapperProps,attributes:t(),children:e.children})}const ft=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:s,contextValue:r})=>{const l={...e,...o?{attributes:oe({block:t,context:r})}:{}};return s?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:l};function re(e){var i;const[t,n]=h.useState(()=>e.isInteractive?mt:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...ft({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(i=e.blockChildren)==null?void 0:i.map(o=>a.jsx(H,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function ht(e){const[t,n]=h.useState(()=>e.repeatContext);return a.jsx(_.Provider,{value:t,children:a.jsx(H,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function H(e){var c,d,f;function t(){return Ze({block:e.block,context:e.context,registeredComponents:e.registeredComponents})}function n(){return et({block:e.block,context:e.context})}function i(){var u;return(u=e.block.repeat)!=null&&u.collection?e.block:z({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})}function o(){var m;return e.block.tagName==="a"||((m=i().properties)==null?void 0:m.href)||i().href?e.linkComponent||"a":e.block.tagName||"div"}function s(){var b,S;if((b=e.block.repeat)!=null&&b.collection)return!!((S=n==null?void 0:n())!=null&&S.length);const u="hide"in i()?i().hide:!1;return("show"in i()?i().show:!0)&&!u}function r(){var m,b;return!((m=t==null?void 0:t())!=null&&m.component)&&!n()?(b=i().children)!=null?b:[]:[]}function l(){var u,m,b,S;return{blockChildren:(u=i().children)!=null?u:[],componentRef:(m=t==null?void 0:t())==null?void 0:m.component,componentOptions:{...Oe(i()),...it(t(),i()),...ot(t(),e.context),...tt(t(),e.linkComponent),...nt(t(),e.registeredComponents)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((b=t==null?void 0:t())==null?void 0:b.noWrap)===!0,isInteractive:!((S=t==null?void 0:t())!=null&&S.isRSC)}}return h.useEffect(()=>{const u=i().id,m=i().animations;m&&u&&_e(m.map(b=>({...b,elementId:u})))},[]),a.jsx(a.Fragment,{children:s()?a.jsxs(a.Fragment,{children:[a.jsx(at,{block:e.block,context:e.context}),(c=t==null?void 0:t())!=null&&c.noWrap?a.jsx(a.Fragment,{children:a.jsx(re,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive})}):a.jsx(a.Fragment,{children:n()?a.jsx(a.Fragment,{children:(f=n())==null?void 0:f.map((u,m)=>a.jsx(ht,{repeatContext:u.context,block:u.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},m))}):a.jsxs(ut,{Wrapper:o(),block:i(),context:e.context,children:[a.jsx(re,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive}),(d=r())==null?void 0:d.map(u=>a.jsx(H,{block:u,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},u.id))]})})]}):null})}function gt(e){function t(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function n(){var o,s;p.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((s=window.parent)==null||s.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var o,s;p.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((s=window.parent)==null||s.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{className:t()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>n(),onMouseEnter:o=>i(),onKeyPress:o=>n(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},et=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=O({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(o))return;const s=n.collection.split(".").pop(),r=n.itemName||(s?s+"Item":"item");return o.map((c,d)=>({context:{...t,localState:{...t.localState,$index:d,$item:c,[r]:c,[`$${r}Index`]:d}},block:i}))},tt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},nt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderComponents?{builderComponents:t}:{}},it=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},ot=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},ve={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ae=(e,t=ve)=>`@media (max-width: ${t[e].max}px)`,ke=({small:e,medium:t})=>{const n=W.fastClone(ve);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const s=n.medium.max+1;return n.large={max:2e3,min:s,default:s+1},n};function G(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function at(e){function t(){const i=z({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return p.checkIsDefined(i.hide)?!i.hide:p.checkIsDefined(i.show)?i.show:!0}function n(){var y,j,R;const i=z({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),o=i.responsiveStyles,s=e.context.content,r=ke(((y=s==null?void 0:s.meta)==null?void 0:y.breakpoints)||{}),l=o==null?void 0:o.large,c=o==null?void 0:o.medium,d=o==null?void 0:o.small,f=i.id;if(!f)return"";const u=l?q({className:f,styles:l}):"",m=c?q({className:f,styles:c,mediaQuery:ae("medium",r)}):"",b=d?q({className:f,styles:d,mediaQuery:ae("small",r)}):"",S=i.animations&&i.animations.find(B=>B.trigger==="hover");let I="";if(S){const B=((R=(j=S.steps)==null?void 0:j[1])==null?void 0:R.styles)||{};I=q({className:`${f}:hover`,styles:{...B,transition:`all ${S.duration}s ${J(S.easing)}`,transitionDelay:S.delay?`${S.delay}s`:"0s"}})||""}return[u,m,b,I].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(G,{id:"builderio-block",styles:n(),nonce:e.context.nonce})}):null})}function rt(e){return e.charAt(0).toUpperCase()+e.slice(1)}const lt=e=>`on${rt(e)}`,st=(e,t)=>n=>O({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function Ce(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const s=n[o];let r=lt(o);if(e.stripPrefix)switch(p.TARGET){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=st(s,e)}return t}function ct({properties:e}){return e}const dt=e=>({href:e.href});function oe({block:e,context:t}){var i;const n={...dt(e),...e.properties,"builder-id":e.id,style:Xe({block:e,context:t}),[U()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return ct({properties:n,context:t,block:e})}function ut(e){return a.jsx(ie,{TagName:e.Wrapper,attributes:oe({block:e.block,context:e.context}),actionAttributes:Ce({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function mt(e){function t(){return e.includeBlockProps?{...oe({block:e.block,context:e.context}),...Ce({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return a.jsx(e.Wrapper,{...e.wrapperProps,attributes:t(),children:e.children})}const ft=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:s,contextValue:r})=>{const l={...e,...o?{attributes:oe({block:t,context:r})}:{}};return s?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:l};function re(e){var i;const[t,n]=h.useState(()=>e.isInteractive?mt:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...ft({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(i=e.blockChildren)==null?void 0:i.map(o=>a.jsx(H,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function ht(e){const[t,n]=h.useState(()=>e.repeatContext);return a.jsx(_.Provider,{value:t,children:a.jsx(H,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function H(e){var c,d,f;function t(){return Ze({block:e.block,context:e.context,registeredComponents:e.registeredComponents})}function n(){return et({block:e.block,context:e.context})}function i(){var u;return(u=e.block.repeat)!=null&&u.collection?e.block:z({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})}function o(){var m;return e.block.tagName==="a"||((m=i().properties)==null?void 0:m.href)||i().href?e.linkComponent||"a":e.block.tagName||"div"}function s(){var b,S;if((b=e.block.repeat)!=null&&b.collection)return!!((S=n==null?void 0:n())!=null&&S.length);const u="hide"in i()?i().hide:!1;return("show"in i()?i().show:!0)&&!u}function r(){var m,b;return!((m=t==null?void 0:t())!=null&&m.component)&&!n()?(b=i().children)!=null?b:[]:[]}function l(){var u,m,b,S;return{blockChildren:(u=i().children)!=null?u:[],componentRef:(m=t==null?void 0:t())==null?void 0:m.component,componentOptions:{...Oe(i()),...it(t(),i()),...ot(t(),e.context),...tt(t(),e.linkComponent),...nt(t(),e.registeredComponents)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((b=t==null?void 0:t())==null?void 0:b.noWrap)===!0,isInteractive:!((S=t==null?void 0:t())!=null&&S.isRSC&&p.TARGET==="rsc")}}return h.useEffect(()=>{const u=i().id,m=i().animations;m&&u&&_e(m.map(b=>({...b,elementId:u})))},[]),a.jsx(a.Fragment,{children:s()?a.jsxs(a.Fragment,{children:[a.jsx(at,{block:e.block,context:e.context}),(c=t==null?void 0:t())!=null&&c.noWrap?a.jsx(a.Fragment,{children:a.jsx(re,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive})}):a.jsx(a.Fragment,{children:n()?a.jsx(a.Fragment,{children:(f=n())==null?void 0:f.map((u,m)=>a.jsx(ht,{repeatContext:u.context,block:u.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},m))}):a.jsxs(ut,{Wrapper:o(),block:i(),context:e.context,children:[a.jsx(re,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive}),(d=r())==null?void 0:d.map(u=>a.jsx(H,{block:u,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},u.id))]})})]}):null})}function gt(e){function t(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function n(){var o,s;p.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((s=window.parent)==null||s.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var o,s;p.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((s=window.parent)==null||s.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{className:t()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>n(),onMouseEnter:o=>i(),onKeyPress:o=>n(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
@@ -185,4 +185,4 @@ font-weight: ${l};
|
|
|
185
185
|
${hn({cssCode:e.cssCode,contentId:e.contentId})}
|
|
186
186
|
${fn({customFonts:e.customFonts})}
|
|
187
187
|
${bn(e.isNestedRender)}
|
|
188
|
-
`.trim());return a.jsx(G,{id:"builderio-content",styles:t,nonce:e.nonce})}const Sn=({content:e,data:t,locale:n})=>{var s,r,l;const i={},o=((s=e==null?void 0:e.data)==null?void 0:s.state)||{};return(l=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||l.forEach(c=>{c.name&&c.defaultValue!==void 0&&(i[c.name]=c.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},vn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function me(e){var c,d,f,u,m,b,S;const[t,n]=h.useState(()=>{var I,y;return sn({variationId:(I=e.content)==null?void 0:I.testVariationId,contentId:(y=e.content)==null?void 0:y.id})});function i(I){l(y=>({...y,rootState:I}))}const[o,s]=h.useState(()=>{var I;return[...ce(),...((I=e.customComponents)==null?void 0:I.filter(({models:y})=>!(y!=null&&y.length)||!e.model?!0:y.includes(e.model)))||[]].reduce((y,{component:j,...R})=>({...y,[R.name]:{component:j,...p.
|
|
188
|
+
`.trim());return a.jsx(G,{id:"builderio-content",styles:t,nonce:e.nonce})}const Sn=({content:e,data:t,locale:n})=>{var s,r,l;const i={},o=((s=e==null?void 0:e.data)==null?void 0:s.state)||{};return(l=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||l.forEach(c=>{c.name&&c.defaultValue!==void 0&&(i[c.name]=c.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},vn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function me(e){var c,d,f,u,m,b,S;const[t,n]=h.useState(()=>{var I,y;return sn({variationId:(I=e.content)==null?void 0:I.testVariationId,contentId:(y=e.content)==null?void 0:y.id})});function i(I){l(y=>({...y,rootState:I}))}const[o,s]=h.useState(()=>{var I;return[...ce(),...((I=e.customComponents)==null?void 0:I.filter(({models:y})=>!(y!=null&&y.length)||!e.model?!0:y.includes(e.model)))||[]].reduce((y,{component:j,...R})=>({...y,[R.name]:{component:j,...p.serializeIncludingFunctions(R)}}),{})}),[r,l]=h.useState(()=>{var I;return{content:vn({content:e.content,data:e.data}),localState:void 0,rootState:Sn({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ce(),...((I=e.customComponents)==null?void 0:I.filter(({models:y})=>!(y!=null&&y.length)||!e.model?!0:y.includes(e.model)))||[]].reduce((y,{component:j,...R})=>({...y,[R.name]:p.serializeIncludingFunctions(R)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||""}});return a.jsx(he.Provider,{value:{registeredComponents:o},children:a.jsxs(pn,{nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:r,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,setBuilderContextSignal:l,children:[e.isSsrAbTest?a.jsx(ne,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,a.jsx(yn,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(c=r.content)==null?void 0:c.id,cssCode:(f=(d=r.content)==null?void 0:d.data)==null?void 0:f.cssCode,customFonts:(m=(u=r.content)==null?void 0:u.data)==null?void 0:m.customFonts}),a.jsx(A,{blocks:(S=(b=r.content)==null?void 0:b.data)==null?void 0:S.blocks,context:r,registeredComponents:o,linkComponent:e.linkComponent})]})})}function Fe(e){var r;const[t,n]=h.useState(()=>on({canTrack:p.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var l;return ln(K(e.content).map(c=>({id:c.testVariationId,testRatio:c.testRatio})),((l=e.content)==null?void 0:l.id)||"")}function o(){return K(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")}function s(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:p.handleABTestingSync({item:e.content,canTrack:p.getDefaultCanTrack(e.canTrack)})}return h.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.isNestedRender&&p.TARGET!=="reactNative"?a.jsx(ne,{id:"builderio-init-variants-fns",scriptStr:rn(),nonce:e.nonce||""}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(G,{id:"builderio-variants",styles:o(),nonce:e.nonce||""}),a.jsx(ne,{id:"builderio-variants-visibility",scriptStr:i(),nonce:e.nonce||""}),(r=K(e.content))==null?void 0:r.map(l=>a.jsx(me,{isNestedRender:e.isNestedRender,nonce:e.nonce,content:l,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},l.testVariationId))]}):null,a.jsx(me,{nonce:e.nonce,isNestedRender:e.isNestedRender,content:s(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const kn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return p.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{p.logger.error("Could not fetch symbol content: ",n)})};function Ae(e){var l,c,d,f;function t(){return"div"}function n(){return"div"}function i(){var u,m;return[e.attributes[U()],"builder-symbol",(u=e.symbol)!=null&&u.inline?"builder-inline-symbol":void 0,(m=e.symbol)!=null&&m.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[o,s]=h.useState(()=>{var u;return(u=e.symbol)==null?void 0:u.content});function r(){o||kn({symbol:e.symbol,builderContextValue:e.builderContext}).then(u=>{u&&s(u)})}return h.useEffect(()=>{},[]),h.useEffect(()=>{r()},[e.symbol]),a.jsx("div",{...e.attributes,className:i(),children:a.jsx(Fe,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(l=e.builderBlock)==null?void 0:l.id},customComponents:Object.values(e.builderComponents),data:{...(c=e.symbol)==null?void 0:c.data,...e.builderContext.localState,...(d=o==null?void 0:o.data)==null?void 0:d.state},canTrack:e.builderContext.canTrack,model:(f=e.symbol)==null?void 0:f.model,content:o,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.Blocks=A;exports.BuilderContext=_;exports.Button=fe;exports.Columns=Te;exports.Content=Fe;exports.Fragment=Ie;exports.Image=we;exports.Section=Ee;exports.Symbol=Ae;exports.Text=Re;exports.Video=je;
|