@builder.io/sdk-react 0.7.5 → 0.8.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/index.cjs +8 -8
- package/lib/browser/index.mjs +161 -158
- package/lib/edge/index.cjs +9 -9
- package/lib/edge/index.mjs +174 -171
- package/lib/node/index.cjs +8 -8
- package/lib/node/index.mjs +130 -127
- package/package.json +7 -1
- package/types/constants/sdk-version.d.ts +1 -1
package/lib/browser/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { createContext as pe, useState as
|
|
2
|
+
import { jsxs as E, Fragment as f, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as pe, useState as v, useContext as le, createElement as ke, useRef as Z, useEffect as P } from "react";
|
|
4
4
|
import { i as $, j as N, k as $e, l as M, m as ee, n as G, T as L, r as Ne, o as U, p as ce, a as Fe, c as We, b as Ce, q as _e, u as se, v as de, w as Le } from "./server-entry-0aebe4be.mjs";
|
|
5
5
|
import { _ as sn, h as dn, f as un, g as mn, e as fn, d as hn, s as gn, t as bn } from "./server-entry-0aebe4be.mjs";
|
|
6
6
|
function je(e) {
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ E(f, { children: [
|
|
8
8
|
e.link ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(
|
|
9
9
|
"a",
|
|
10
10
|
{
|
|
@@ -315,7 +315,7 @@ function ne(e) {
|
|
|
315
315
|
return G(i.hide) ? !i.hide : G(i.show) ? i.show : !0;
|
|
316
316
|
}
|
|
317
317
|
function n() {
|
|
318
|
-
var
|
|
318
|
+
var x;
|
|
319
319
|
const i = D({
|
|
320
320
|
block: e.block,
|
|
321
321
|
localState: e.context.localState,
|
|
@@ -324,14 +324,14 @@ function ne(e) {
|
|
|
324
324
|
context: e.context.context,
|
|
325
325
|
shouldEvaluateBindings: !0
|
|
326
326
|
}), a = i.responsiveStyles, o = e.context.content, l = Te(
|
|
327
|
-
((
|
|
327
|
+
((x = o == null ? void 0 : o.meta) == null ? void 0 : x.breakpoints) || {}
|
|
328
328
|
), s = a == null ? void 0 : a.large, c = a == null ? void 0 : a.medium, d = a == null ? void 0 : a.small, u = i.id;
|
|
329
329
|
if (!u)
|
|
330
330
|
return "";
|
|
331
331
|
const g = s ? Y({
|
|
332
332
|
className: u,
|
|
333
333
|
styles: s
|
|
334
|
-
}) : "",
|
|
334
|
+
}) : "", S = c ? Y({
|
|
335
335
|
className: u,
|
|
336
336
|
styles: c,
|
|
337
337
|
mediaQuery: me(
|
|
@@ -346,7 +346,7 @@ function ne(e) {
|
|
|
346
346
|
l
|
|
347
347
|
)
|
|
348
348
|
}) : "";
|
|
349
|
-
return [g,
|
|
349
|
+
return [g, S, V].join(" ");
|
|
350
350
|
}
|
|
351
351
|
return /* @__PURE__ */ r(f, { children: n() && t() ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(K, { styles: n() }) }) : null });
|
|
352
352
|
}
|
|
@@ -418,9 +418,9 @@ function at(e) {
|
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
function fe(e) {
|
|
421
|
-
return /* @__PURE__ */
|
|
421
|
+
return /* @__PURE__ */ E(f, { children: [
|
|
422
422
|
" ",
|
|
423
|
-
e.hasChildren ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */
|
|
423
|
+
e.hasChildren ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ E(
|
|
424
424
|
e.Wrapper,
|
|
425
425
|
{
|
|
426
426
|
...O({
|
|
@@ -511,10 +511,10 @@ const rt = ({
|
|
|
511
511
|
};
|
|
512
512
|
function he(e) {
|
|
513
513
|
var i, a;
|
|
514
|
-
const [t, n] =
|
|
514
|
+
const [t, n] = v(
|
|
515
515
|
() => e.isInteractive ? ot : e.componentRef
|
|
516
516
|
);
|
|
517
|
-
return /* @__PURE__ */ r(f, { children: e.componentRef ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */
|
|
517
|
+
return /* @__PURE__ */ r(f, { children: e.componentRef ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ E(
|
|
518
518
|
t,
|
|
519
519
|
{
|
|
520
520
|
...rt({
|
|
@@ -549,7 +549,7 @@ function he(e) {
|
|
|
549
549
|
) }) : null });
|
|
550
550
|
}
|
|
551
551
|
function lt(e) {
|
|
552
|
-
const [t, n] =
|
|
552
|
+
const [t, n] = v(() => e.repeatContext);
|
|
553
553
|
return /* @__PURE__ */ r(te.Provider, { value: t, children: /* @__PURE__ */ r(
|
|
554
554
|
H,
|
|
555
555
|
{
|
|
@@ -560,7 +560,7 @@ function lt(e) {
|
|
|
560
560
|
) });
|
|
561
561
|
}
|
|
562
562
|
function H(e) {
|
|
563
|
-
var u, g,
|
|
563
|
+
var u, g, S, V;
|
|
564
564
|
function t() {
|
|
565
565
|
return Qe({
|
|
566
566
|
block: e.block,
|
|
@@ -575,8 +575,8 @@ function H(e) {
|
|
|
575
575
|
});
|
|
576
576
|
}
|
|
577
577
|
function i() {
|
|
578
|
-
var
|
|
579
|
-
return (
|
|
578
|
+
var x;
|
|
579
|
+
return (x = e.block.repeat) != null && x.collection ? e.block : D({
|
|
580
580
|
block: e.block,
|
|
581
581
|
localState: e.context.localState,
|
|
582
582
|
rootState: e.context.rootState,
|
|
@@ -589,33 +589,36 @@ function H(e) {
|
|
|
589
589
|
return e.block.tagName || "div";
|
|
590
590
|
}
|
|
591
591
|
function o() {
|
|
592
|
-
var
|
|
593
|
-
|
|
592
|
+
var I, w;
|
|
593
|
+
if ((I = e.block.repeat) != null && I.collection)
|
|
594
|
+
return !!((w = n == null ? void 0 : n()) != null && w.length);
|
|
595
|
+
const x = "hide" in i() ? i().hide : !1;
|
|
596
|
+
return ("show" in i() ? i().show : !0) && !x;
|
|
594
597
|
}
|
|
595
598
|
function l() {
|
|
596
|
-
var
|
|
597
|
-
return !((
|
|
599
|
+
var p;
|
|
600
|
+
return !((p = t == null ? void 0 : t()) != null && p.component) && !n() ? i().children ?? [] : [];
|
|
598
601
|
}
|
|
599
602
|
function s() {
|
|
600
|
-
var
|
|
603
|
+
var x, p, I, w, C;
|
|
601
604
|
return {
|
|
602
605
|
blockChildren: i().children ?? [],
|
|
603
|
-
componentRef: (
|
|
606
|
+
componentRef: (x = t == null ? void 0 : t()) == null ? void 0 : x.component,
|
|
604
607
|
componentOptions: {
|
|
605
608
|
...Me(i()),
|
|
606
609
|
builderContext: e.context,
|
|
607
|
-
...((
|
|
610
|
+
...((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Symbol" || ((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Columns" ? {
|
|
608
611
|
builderComponents: e.registeredComponents
|
|
609
612
|
} : {}
|
|
610
613
|
},
|
|
611
614
|
context: c,
|
|
612
615
|
registeredComponents: e.registeredComponents,
|
|
613
616
|
builderBlock: i(),
|
|
614
|
-
includeBlockProps: ((
|
|
617
|
+
includeBlockProps: ((w = t == null ? void 0 : t()) == null ? void 0 : w.noWrap) === !0,
|
|
615
618
|
isInteractive: !((C = t == null ? void 0 : t()) != null && C.isRSC)
|
|
616
619
|
};
|
|
617
620
|
}
|
|
618
|
-
const [c, d] =
|
|
621
|
+
const [c, d] = v(() => e.context);
|
|
619
622
|
return /* @__PURE__ */ r(f, { children: o() ? /* @__PURE__ */ r(f, { children: (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(
|
|
620
623
|
he,
|
|
621
624
|
{
|
|
@@ -628,7 +631,7 @@ function H(e) {
|
|
|
628
631
|
includeBlockProps: s().includeBlockProps,
|
|
629
632
|
isInteractive: s().isInteractive
|
|
630
633
|
}
|
|
631
|
-
) }) : /* @__PURE__ */
|
|
634
|
+
) }) : /* @__PURE__ */ E(f, { children: [
|
|
632
635
|
q(a()) ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(
|
|
633
636
|
fe,
|
|
634
637
|
{
|
|
@@ -638,16 +641,16 @@ function H(e) {
|
|
|
638
641
|
hasChildren: !1
|
|
639
642
|
}
|
|
640
643
|
) }) : null,
|
|
641
|
-
!q(a()) && n() ? /* @__PURE__ */ r(f, { children: (g = n()) == null ? void 0 : g.map((
|
|
644
|
+
!q(a()) && n() ? /* @__PURE__ */ r(f, { children: (g = n()) == null ? void 0 : g.map((x, p) => /* @__PURE__ */ r(
|
|
642
645
|
lt,
|
|
643
646
|
{
|
|
644
|
-
repeatContext:
|
|
645
|
-
block:
|
|
647
|
+
repeatContext: x.context,
|
|
648
|
+
block: x.block,
|
|
646
649
|
registeredComponents: e.registeredComponents
|
|
647
650
|
},
|
|
648
|
-
|
|
651
|
+
p
|
|
649
652
|
)) }) : null,
|
|
650
|
-
!q(a()) && !n() ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */
|
|
653
|
+
!q(a()) && !n() ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ E(
|
|
651
654
|
fe,
|
|
652
655
|
{
|
|
653
656
|
Wrapper: a(),
|
|
@@ -668,22 +671,22 @@ function H(e) {
|
|
|
668
671
|
isInteractive: s().isInteractive
|
|
669
672
|
}
|
|
670
673
|
),
|
|
671
|
-
(
|
|
674
|
+
(S = l()) == null ? void 0 : S.map((x) => /* @__PURE__ */ r(
|
|
672
675
|
H,
|
|
673
676
|
{
|
|
674
|
-
block:
|
|
677
|
+
block: x,
|
|
675
678
|
context: c,
|
|
676
679
|
registeredComponents: e.registeredComponents
|
|
677
680
|
},
|
|
678
|
-
"block-" +
|
|
681
|
+
"block-" + x.id
|
|
679
682
|
)),
|
|
680
|
-
(V = l()) == null ? void 0 : V.map((
|
|
683
|
+
(V = l()) == null ? void 0 : V.map((x) => /* @__PURE__ */ r(
|
|
681
684
|
ne,
|
|
682
685
|
{
|
|
683
|
-
block:
|
|
686
|
+
block: x,
|
|
684
687
|
context: c
|
|
685
688
|
},
|
|
686
|
-
"block-style-" +
|
|
689
|
+
"block-style-" + x.id
|
|
687
690
|
))
|
|
688
691
|
]
|
|
689
692
|
}
|
|
@@ -721,7 +724,7 @@ function ct(e) {
|
|
|
721
724
|
"*"
|
|
722
725
|
));
|
|
723
726
|
}
|
|
724
|
-
return /* @__PURE__ */
|
|
727
|
+
return /* @__PURE__ */ E(f, { children: [
|
|
725
728
|
/* @__PURE__ */ r(
|
|
726
729
|
"div",
|
|
727
730
|
{
|
|
@@ -745,7 +748,7 @@ function ct(e) {
|
|
|
745
748
|
function ie(e) {
|
|
746
749
|
var i, a;
|
|
747
750
|
const t = le(te), n = le(we);
|
|
748
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ E(
|
|
749
752
|
ct,
|
|
750
753
|
{
|
|
751
754
|
blocks: e.blocks,
|
|
@@ -775,33 +778,33 @@ function ie(e) {
|
|
|
775
778
|
);
|
|
776
779
|
}
|
|
777
780
|
function st(e) {
|
|
778
|
-
var
|
|
779
|
-
const [t, n] =
|
|
781
|
+
var w;
|
|
782
|
+
const [t, n] = v(
|
|
780
783
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
781
|
-
), [i, a] =
|
|
784
|
+
), [i, a] = v(() => e.columns || []), [o, l] = v(
|
|
782
785
|
() => e.stackColumnsAt || "tablet"
|
|
783
786
|
);
|
|
784
787
|
function s(C) {
|
|
785
|
-
var
|
|
786
|
-
return ((
|
|
788
|
+
var T;
|
|
789
|
+
return ((T = i[C]) == null ? void 0 : T.width) || 100 / i.length;
|
|
787
790
|
}
|
|
788
791
|
function c(C) {
|
|
789
|
-
const
|
|
790
|
-
return `calc(${s(C)}% - ${
|
|
792
|
+
const T = t * (i.length - 1) / i.length;
|
|
793
|
+
return `calc(${s(C)}% - ${T}px)`;
|
|
791
794
|
}
|
|
792
795
|
function d({
|
|
793
796
|
stackedStyle: C,
|
|
794
|
-
desktopStyle:
|
|
797
|
+
desktopStyle: T
|
|
795
798
|
}) {
|
|
796
|
-
return o === "tablet" ? C :
|
|
799
|
+
return o === "tablet" ? C : T;
|
|
797
800
|
}
|
|
798
801
|
function u({
|
|
799
802
|
stackedStyle: C,
|
|
800
|
-
desktopStyle:
|
|
803
|
+
desktopStyle: T
|
|
801
804
|
}) {
|
|
802
|
-
return o === "never" ?
|
|
805
|
+
return o === "never" ? T : C;
|
|
803
806
|
}
|
|
804
|
-
const [g,
|
|
807
|
+
const [g, S] = v(
|
|
805
808
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
806
809
|
);
|
|
807
810
|
function V() {
|
|
@@ -813,8 +816,8 @@ function st(e) {
|
|
|
813
816
|
})
|
|
814
817
|
};
|
|
815
818
|
}
|
|
816
|
-
function
|
|
817
|
-
const
|
|
819
|
+
function x(C) {
|
|
820
|
+
const T = C === 0 ? 0 : t, A = c(C), B = `${T}px`, F = "100%", W = 0;
|
|
818
821
|
return {
|
|
819
822
|
width: A,
|
|
820
823
|
["marginLeft"]: B,
|
|
@@ -836,15 +839,15 @@ function st(e) {
|
|
|
836
839
|
})
|
|
837
840
|
};
|
|
838
841
|
}
|
|
839
|
-
function
|
|
842
|
+
function p(C) {
|
|
840
843
|
var A, B;
|
|
841
844
|
return Te(
|
|
842
845
|
((B = (A = e.builderContext.content) == null ? void 0 : A.meta) == null ? void 0 : B.breakpoints) || {}
|
|
843
846
|
)[C].max;
|
|
844
847
|
}
|
|
845
|
-
function
|
|
848
|
+
function I() {
|
|
846
849
|
return `
|
|
847
|
-
@media (max-width: ${
|
|
850
|
+
@media (max-width: ${p("medium")}px) {
|
|
848
851
|
.${e.builderBlock.id}-breakpoints {
|
|
849
852
|
flex-direction: var(--flex-dir-tablet);
|
|
850
853
|
align-items: stretch;
|
|
@@ -856,7 +859,7 @@ function st(e) {
|
|
|
856
859
|
}
|
|
857
860
|
}
|
|
858
861
|
|
|
859
|
-
@media (max-width: ${
|
|
862
|
+
@media (max-width: ${p("small")}px) {
|
|
860
863
|
.${e.builderBlock.id}-breakpoints {
|
|
861
864
|
flex-direction: var(--flex-dir);
|
|
862
865
|
align-items: stretch;
|
|
@@ -869,25 +872,25 @@ function st(e) {
|
|
|
869
872
|
},
|
|
870
873
|
`;
|
|
871
874
|
}
|
|
872
|
-
return /* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */
|
|
875
|
+
return /* @__PURE__ */ E(f, { children: [
|
|
876
|
+
/* @__PURE__ */ E(
|
|
874
877
|
"div",
|
|
875
878
|
{
|
|
876
879
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-53636e90`,
|
|
877
880
|
style: V(),
|
|
878
881
|
children: [
|
|
879
|
-
/* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(K, { styles:
|
|
880
|
-
(
|
|
882
|
+
/* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(K, { styles: I() }) }),
|
|
883
|
+
(w = e.columns) == null ? void 0 : w.map((C, T) => /* @__PURE__ */ ke(
|
|
881
884
|
"div",
|
|
882
885
|
{
|
|
883
886
|
className: "builder-column div-53636e90-2",
|
|
884
|
-
style:
|
|
885
|
-
key:
|
|
887
|
+
style: x(T),
|
|
888
|
+
key: T
|
|
886
889
|
},
|
|
887
890
|
/* @__PURE__ */ r(
|
|
888
891
|
ie,
|
|
889
892
|
{
|
|
890
|
-
path: `component.options.columns.${
|
|
893
|
+
path: `component.options.columns.${T}.blocks`,
|
|
891
894
|
parent: e.builderBlock.id,
|
|
892
895
|
styleProp: {
|
|
893
896
|
flexGrow: "1"
|
|
@@ -974,9 +977,9 @@ function ft(e) {
|
|
|
974
977
|
};
|
|
975
978
|
return e.aspectRatio ? c : void 0;
|
|
976
979
|
}
|
|
977
|
-
return /* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */
|
|
979
|
-
/* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ E(f, { children: [
|
|
981
|
+
/* @__PURE__ */ E(f, { children: [
|
|
982
|
+
/* @__PURE__ */ E("picture", { children: [
|
|
980
983
|
n() ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r("source", { type: "image/webp", srcSet: n() }) }) : null,
|
|
981
984
|
/* @__PURE__ */ r(
|
|
982
985
|
"img",
|
|
@@ -1306,7 +1309,7 @@ const gt = {
|
|
|
1306
1309
|
}]
|
|
1307
1310
|
};
|
|
1308
1311
|
function yt(e) {
|
|
1309
|
-
const t = Z(null), [n, i] =
|
|
1312
|
+
const t = Z(null), [n, i] = v(() => []), [a, o] = v(() => []);
|
|
1310
1313
|
return P(() => {
|
|
1311
1314
|
var s;
|
|
1312
1315
|
if (!((s = t.current) != null && s.getElementsByTagName) || typeof window > "u")
|
|
@@ -1370,7 +1373,7 @@ const St = {
|
|
|
1370
1373
|
}]
|
|
1371
1374
|
}, vt = ["text/javascript", "application/javascript", "application/ecmascript"], pt = (e) => vt.includes(e.type);
|
|
1372
1375
|
function kt(e) {
|
|
1373
|
-
const t = Z(null), [n, i] =
|
|
1376
|
+
const t = Z(null), [n, i] = v(() => []), [a, o] = v(() => []), [l, s] = v(() => !1);
|
|
1374
1377
|
function c() {
|
|
1375
1378
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1376
1379
|
return;
|
|
@@ -1379,13 +1382,13 @@ function kt(e) {
|
|
|
1379
1382
|
const g = d[u];
|
|
1380
1383
|
if (g.src && !n.includes(g.src)) {
|
|
1381
1384
|
n.push(g.src);
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1385
|
+
const S = document.createElement("script");
|
|
1386
|
+
S.async = !0, S.src = g.src, document.head.appendChild(S);
|
|
1384
1387
|
} else if (pt(g) && !a.includes(g.innerText))
|
|
1385
1388
|
try {
|
|
1386
1389
|
a.push(g.innerText), new Function(g.innerText)();
|
|
1387
|
-
} catch (
|
|
1388
|
-
console.warn("`Embed`: Error running script:",
|
|
1390
|
+
} catch (S) {
|
|
1391
|
+
console.warn("`Embed`: Error running script:", S);
|
|
1389
1392
|
}
|
|
1390
1393
|
}
|
|
1391
1394
|
}
|
|
@@ -1432,8 +1435,8 @@ const Ct = {
|
|
|
1432
1435
|
let g = !1;
|
|
1433
1436
|
u.onload = () => {
|
|
1434
1437
|
g = !0, c(u);
|
|
1435
|
-
}, u.addEventListener("error", (
|
|
1436
|
-
console.warn("Image load failed",
|
|
1438
|
+
}, u.addEventListener("error", (S) => {
|
|
1439
|
+
console.warn("Image load failed", S.error), d(S.error);
|
|
1437
1440
|
}), u.src = l, setTimeout(() => {
|
|
1438
1441
|
g || d(new Error("Image load timed out"));
|
|
1439
1442
|
}, s);
|
|
@@ -1748,7 +1751,7 @@ function Bt(e) {
|
|
|
1748
1751
|
...t()
|
|
1749
1752
|
};
|
|
1750
1753
|
}
|
|
1751
|
-
return /* @__PURE__ */
|
|
1754
|
+
return /* @__PURE__ */ E(
|
|
1752
1755
|
"div",
|
|
1753
1756
|
{
|
|
1754
1757
|
style: {
|
|
@@ -2016,7 +2019,7 @@ const Mt = (e, t, n = !0) => {
|
|
|
2016
2019
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2017
2020
|
}
|
|
2018
2021
|
};
|
|
2019
|
-
}, Ot = "0.
|
|
2022
|
+
}, Ot = "0.8.0", Kt = () => {
|
|
2020
2023
|
Ne("insertMenu", {
|
|
2021
2024
|
name: "_default",
|
|
2022
2025
|
default: !0,
|
|
@@ -2069,8 +2072,8 @@ const Ht = (e = {}) => {
|
|
|
2069
2072
|
let u, g = null;
|
|
2070
2073
|
try {
|
|
2071
2074
|
u = d.apply(null, s);
|
|
2072
|
-
} catch (
|
|
2073
|
-
g =
|
|
2075
|
+
} catch (S) {
|
|
2076
|
+
g = S;
|
|
2074
2077
|
}
|
|
2075
2078
|
g ? (a = window.parent) == null || a.postMessage({
|
|
2076
2079
|
type: "builder.evaluateError",
|
|
@@ -2078,13 +2081,13 @@ const Ht = (e = {}) => {
|
|
|
2078
2081
|
id: c,
|
|
2079
2082
|
error: g.message
|
|
2080
2083
|
}
|
|
2081
|
-
}, "*") : u && typeof u.then == "function" ? u.then((
|
|
2084
|
+
}, "*") : u && typeof u.then == "function" ? u.then((S) => {
|
|
2082
2085
|
var V;
|
|
2083
2086
|
(V = window.parent) == null || V.postMessage({
|
|
2084
2087
|
type: "builder.evaluateResult",
|
|
2085
2088
|
data: {
|
|
2086
2089
|
id: c,
|
|
2087
|
-
result:
|
|
2090
|
+
result: S
|
|
2088
2091
|
}
|
|
2089
2092
|
}, "*");
|
|
2090
2093
|
}).catch(console.error) : (o = window.parent) == null || o.postMessage({
|
|
@@ -2101,20 +2104,20 @@ const Ht = (e = {}) => {
|
|
|
2101
2104
|
};
|
|
2102
2105
|
function zt(e) {
|
|
2103
2106
|
var A, B, F, W, z, ae, oe;
|
|
2104
|
-
const t = Z(null), [n, i] =
|
|
2107
|
+
const t = Z(null), [n, i] = v(() => 0);
|
|
2105
2108
|
function a(m) {
|
|
2106
|
-
var
|
|
2109
|
+
var b, y, k, R, re;
|
|
2107
2110
|
const h = {
|
|
2108
2111
|
...e.builderContextSignal.content,
|
|
2109
2112
|
...m,
|
|
2110
2113
|
data: {
|
|
2111
|
-
...(
|
|
2114
|
+
...(b = e.builderContextSignal.content) == null ? void 0 : b.data,
|
|
2112
2115
|
...m == null ? void 0 : m.data
|
|
2113
2116
|
},
|
|
2114
2117
|
meta: {
|
|
2115
2118
|
...(y = e.builderContextSignal.content) == null ? void 0 : y.meta,
|
|
2116
2119
|
...m == null ? void 0 : m.meta,
|
|
2117
|
-
breakpoints: ((k = m == null ? void 0 : m.meta) == null ? void 0 : k.breakpoints) || ((re = (
|
|
2120
|
+
breakpoints: ((k = m == null ? void 0 : m.meta) == null ? void 0 : k.breakpoints) || ((re = (R = e.builderContextSignal.content) == null ? void 0 : R.meta) == null ? void 0 : re.breakpoints)
|
|
2118
2121
|
}
|
|
2119
2122
|
};
|
|
2120
2123
|
e.setBuilderContextSignal((Be) => ({
|
|
@@ -2122,18 +2125,18 @@ function zt(e) {
|
|
|
2122
2125
|
content: h
|
|
2123
2126
|
}));
|
|
2124
2127
|
}
|
|
2125
|
-
|
|
2126
|
-
const [o, l] =
|
|
2128
|
+
v(() => 0);
|
|
2129
|
+
const [o, l] = v(
|
|
2127
2130
|
() => !1
|
|
2128
2131
|
);
|
|
2129
2132
|
function s(m) {
|
|
2130
|
-
var
|
|
2133
|
+
var b;
|
|
2131
2134
|
const { data: h } = m;
|
|
2132
2135
|
if (h)
|
|
2133
2136
|
switch (h.type) {
|
|
2134
2137
|
case "builder.configureSdk": {
|
|
2135
|
-
const y = h.data, { breakpoints: k, contentId:
|
|
2136
|
-
if (!
|
|
2138
|
+
const y = h.data, { breakpoints: k, contentId: R } = y;
|
|
2139
|
+
if (!R || R !== ((b = e.builderContextSignal.content) == null ? void 0 : b.id))
|
|
2137
2140
|
return;
|
|
2138
2141
|
k && a({
|
|
2139
2142
|
meta: {
|
|
@@ -2143,15 +2146,15 @@ function zt(e) {
|
|
|
2143
2146
|
break;
|
|
2144
2147
|
}
|
|
2145
2148
|
case "builder.contentUpdate": {
|
|
2146
|
-
const y = h.data, k = y.key || y.alias || y.entry || y.modelName,
|
|
2147
|
-
k === e.model && (a(
|
|
2149
|
+
const y = h.data, k = y.key || y.alias || y.entry || y.modelName, R = y.data;
|
|
2150
|
+
k === e.model && (a(R), i(n + 1));
|
|
2148
2151
|
break;
|
|
2149
2152
|
}
|
|
2150
2153
|
}
|
|
2151
2154
|
}
|
|
2152
2155
|
function c() {
|
|
2153
|
-
var h,
|
|
2154
|
-
const m = (
|
|
2156
|
+
var h, b;
|
|
2157
|
+
const m = (b = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : b.jsCode;
|
|
2155
2158
|
m && _({
|
|
2156
2159
|
code: m,
|
|
2157
2160
|
context: e.context || {},
|
|
@@ -2160,11 +2163,11 @@ function zt(e) {
|
|
|
2160
2163
|
rootSetState: e.builderContextSignal.rootSetState
|
|
2161
2164
|
});
|
|
2162
2165
|
}
|
|
2163
|
-
const [d, u] =
|
|
2166
|
+
const [d, u] = v(() => ({})), [g, S] = v(() => !1);
|
|
2164
2167
|
function V(m) {
|
|
2165
|
-
var h,
|
|
2168
|
+
var h, b;
|
|
2166
2169
|
if (e.builderContextSignal.content) {
|
|
2167
|
-
const y = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId, k = (
|
|
2170
|
+
const y = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId, k = (b = e.builderContextSignal.content) == null ? void 0 : b.id;
|
|
2168
2171
|
ce({
|
|
2169
2172
|
type: "click",
|
|
2170
2173
|
canTrack: U(e.canTrack),
|
|
@@ -2175,13 +2178,13 @@ function zt(e) {
|
|
|
2175
2178
|
unique: !g
|
|
2176
2179
|
});
|
|
2177
2180
|
}
|
|
2178
|
-
g ||
|
|
2181
|
+
g || S(!0);
|
|
2179
2182
|
}
|
|
2180
|
-
function
|
|
2183
|
+
function x(m) {
|
|
2181
2184
|
return m.replace(
|
|
2182
2185
|
/{{([^}]+)}}/g,
|
|
2183
|
-
(h,
|
|
2184
|
-
code:
|
|
2186
|
+
(h, b) => _({
|
|
2187
|
+
code: b,
|
|
2185
2188
|
context: e.context || {},
|
|
2186
2189
|
localState: void 0,
|
|
2187
2190
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -2189,32 +2192,32 @@ function zt(e) {
|
|
|
2189
2192
|
})
|
|
2190
2193
|
);
|
|
2191
2194
|
}
|
|
2192
|
-
function
|
|
2193
|
-
_e(m).then((
|
|
2194
|
-
var k,
|
|
2195
|
+
function p({ url: m, key: h }) {
|
|
2196
|
+
_e(m).then((b) => b.json()).then((b) => {
|
|
2197
|
+
var k, R;
|
|
2195
2198
|
const y = {
|
|
2196
2199
|
...e.builderContextSignal.rootState,
|
|
2197
|
-
[h]:
|
|
2200
|
+
[h]: b
|
|
2198
2201
|
};
|
|
2199
|
-
(
|
|
2200
|
-
}).catch((
|
|
2201
|
-
console.error("error fetching dynamic data", m,
|
|
2202
|
+
(R = (k = e.builderContextSignal).rootSetState) == null || R.call(k, y), d[h] = !0;
|
|
2203
|
+
}).catch((b) => {
|
|
2204
|
+
console.error("error fetching dynamic data", m, b);
|
|
2202
2205
|
});
|
|
2203
2206
|
}
|
|
2204
|
-
function
|
|
2205
|
-
var h,
|
|
2206
|
-
const m = ((
|
|
2207
|
+
function I() {
|
|
2208
|
+
var h, b;
|
|
2209
|
+
const m = ((b = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : b.httpRequests) ?? {};
|
|
2207
2210
|
Object.entries(m).forEach(([y, k]) => {
|
|
2208
2211
|
if (k && (!d[y] || $())) {
|
|
2209
|
-
const
|
|
2210
|
-
|
|
2211
|
-
url:
|
|
2212
|
+
const R = x(k);
|
|
2213
|
+
p({
|
|
2214
|
+
url: R,
|
|
2212
2215
|
key: y
|
|
2213
2216
|
});
|
|
2214
2217
|
}
|
|
2215
2218
|
});
|
|
2216
2219
|
}
|
|
2217
|
-
function
|
|
2220
|
+
function w() {
|
|
2218
2221
|
$() && window.dispatchEvent(
|
|
2219
2222
|
new CustomEvent(
|
|
2220
2223
|
"builder:component:stateChange",
|
|
@@ -2244,23 +2247,23 @@ function zt(e) {
|
|
|
2244
2247
|
e.builderContextSignal.componentInfos
|
|
2245
2248
|
).forEach((h) => {
|
|
2246
2249
|
var y;
|
|
2247
|
-
const
|
|
2248
|
-
(y = window.parent) == null || y.postMessage(
|
|
2250
|
+
const b = We(h);
|
|
2251
|
+
(y = window.parent) == null || y.postMessage(b, "*");
|
|
2249
2252
|
}), window.addEventListener(
|
|
2250
2253
|
"builder:component:stateChangeListenerActivated",
|
|
2251
|
-
|
|
2254
|
+
w
|
|
2252
2255
|
);
|
|
2253
2256
|
}
|
|
2254
|
-
function
|
|
2255
|
-
const h = new URL(location.href).searchParams,
|
|
2256
|
-
`builder.preview.${
|
|
2257
|
+
function T(m) {
|
|
2258
|
+
const h = new URL(location.href).searchParams, b = h.get("builder.preview"), y = h.get(
|
|
2259
|
+
`builder.preview.${b}`
|
|
2257
2260
|
), k = h.get("apiKey") || h.get("builder.space");
|
|
2258
|
-
|
|
2261
|
+
b === e.model && k === e.apiKey && (!e.content || y === e.content.id) && Ce({
|
|
2259
2262
|
model: e.model,
|
|
2260
2263
|
apiKey: e.apiKey,
|
|
2261
2264
|
apiVersion: e.builderContextSignal.apiVersion
|
|
2262
|
-
}).then((
|
|
2263
|
-
|
|
2265
|
+
}).then((R) => {
|
|
2266
|
+
R && a(R);
|
|
2264
2267
|
});
|
|
2265
2268
|
}
|
|
2266
2269
|
return P(() => {
|
|
@@ -2279,24 +2282,24 @@ function zt(e) {
|
|
|
2279
2282
|
var m;
|
|
2280
2283
|
return (m = t.current) == null || m.addEventListener(
|
|
2281
2284
|
"initpreviewingbldr",
|
|
2282
|
-
|
|
2285
|
+
T
|
|
2283
2286
|
), () => {
|
|
2284
2287
|
var h;
|
|
2285
2288
|
return (h = t.current) == null ? void 0 : h.removeEventListener(
|
|
2286
2289
|
"initpreviewingbldr",
|
|
2287
|
-
|
|
2290
|
+
T
|
|
2288
2291
|
);
|
|
2289
2292
|
};
|
|
2290
2293
|
}, []), P(() => {
|
|
2291
2294
|
var m, h;
|
|
2292
2295
|
if (N()) {
|
|
2293
2296
|
if ($() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && U(e.canTrack)) {
|
|
2294
|
-
const y = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, k = (h = e.builderContextSignal.content) == null ? void 0 : h.id,
|
|
2297
|
+
const y = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, k = (h = e.builderContextSignal.content) == null ? void 0 : h.id, R = e.apiKey;
|
|
2295
2298
|
ce({
|
|
2296
2299
|
type: "impression",
|
|
2297
2300
|
canTrack: !0,
|
|
2298
2301
|
contentId: k,
|
|
2299
|
-
apiKey:
|
|
2302
|
+
apiKey: R,
|
|
2300
2303
|
variationId: y !== k ? y : void 0
|
|
2301
2304
|
});
|
|
2302
2305
|
}
|
|
@@ -2305,7 +2308,7 @@ function zt(e) {
|
|
|
2305
2308
|
}, []), P(() => {
|
|
2306
2309
|
e.apiKey || M.error(
|
|
2307
2310
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
2308
|
-
), c(),
|
|
2311
|
+
), c(), I(), w();
|
|
2309
2312
|
}, []), P(() => {
|
|
2310
2313
|
e.content && a(e.content);
|
|
2311
2314
|
}, [e.content]), P(() => {
|
|
@@ -2315,13 +2318,13 @@ function zt(e) {
|
|
|
2315
2318
|
(B = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : B.jsCode,
|
|
2316
2319
|
e.builderContextSignal.rootState
|
|
2317
2320
|
]), P(() => {
|
|
2318
|
-
|
|
2321
|
+
I();
|
|
2319
2322
|
}, [(W = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : W.httpRequests]), P(() => {
|
|
2320
|
-
|
|
2323
|
+
w();
|
|
2321
2324
|
}, [e.builderContextSignal.rootState]), P(() => () => {
|
|
2322
2325
|
N() && (window.removeEventListener("message", s), window.removeEventListener(
|
|
2323
2326
|
"builder:component:stateChangeListenerActivated",
|
|
2324
|
-
|
|
2327
|
+
w
|
|
2325
2328
|
));
|
|
2326
2329
|
}, []), /* @__PURE__ */ r(te.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ ke(
|
|
2327
2330
|
"div",
|
|
@@ -2376,7 +2379,7 @@ font-weight: ${l};
|
|
|
2376
2379
|
contentId: t
|
|
2377
2380
|
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
|
|
2378
2381
|
function Gt(e) {
|
|
2379
|
-
const [t, n] =
|
|
2382
|
+
const [t, n] = v(
|
|
2380
2383
|
() => `
|
|
2381
2384
|
${Qt({
|
|
2382
2385
|
cssCode: e.cssCode,
|
|
@@ -2431,25 +2434,25 @@ const Jt = ({
|
|
|
2431
2434
|
meta: e == null ? void 0 : e.meta
|
|
2432
2435
|
} : void 0;
|
|
2433
2436
|
function ve(e) {
|
|
2434
|
-
var c, d, u, g,
|
|
2435
|
-
const [t, n] =
|
|
2437
|
+
var c, d, u, g, S, V, x;
|
|
2438
|
+
const [t, n] = v(
|
|
2436
2439
|
() => {
|
|
2437
|
-
var
|
|
2440
|
+
var p, I;
|
|
2438
2441
|
return jt({
|
|
2439
2442
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2440
|
-
variationId: (
|
|
2443
|
+
variationId: (p = e.content) == null ? void 0 : p.testVariationId,
|
|
2441
2444
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2442
|
-
contentId: (
|
|
2445
|
+
contentId: (I = e.content) == null ? void 0 : I.id
|
|
2443
2446
|
});
|
|
2444
2447
|
}
|
|
2445
2448
|
);
|
|
2446
|
-
function i(
|
|
2447
|
-
s((
|
|
2448
|
-
...
|
|
2449
|
-
rootState:
|
|
2449
|
+
function i(p) {
|
|
2450
|
+
s((I) => ({
|
|
2451
|
+
...I,
|
|
2452
|
+
rootState: p
|
|
2450
2453
|
}));
|
|
2451
2454
|
}
|
|
2452
|
-
const [a, o] =
|
|
2455
|
+
const [a, o] = v(
|
|
2453
2456
|
() => [
|
|
2454
2457
|
...be(),
|
|
2455
2458
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
@@ -2460,16 +2463,16 @@ function ve(e) {
|
|
|
2460
2463
|
...se,
|
|
2461
2464
|
...e.customComponents || []
|
|
2462
2465
|
].reduce(
|
|
2463
|
-
(
|
|
2464
|
-
...
|
|
2465
|
-
[
|
|
2466
|
-
component:
|
|
2467
|
-
...de(
|
|
2466
|
+
(p, { component: I, ...w }) => ({
|
|
2467
|
+
...p,
|
|
2468
|
+
[w.name]: {
|
|
2469
|
+
component: I,
|
|
2470
|
+
...de(w)
|
|
2468
2471
|
}
|
|
2469
2472
|
}),
|
|
2470
2473
|
{}
|
|
2471
2474
|
)
|
|
2472
|
-
), [l, s] =
|
|
2475
|
+
), [l, s] = v(() => ({
|
|
2473
2476
|
content: Xt({
|
|
2474
2477
|
content: e.content,
|
|
2475
2478
|
data: e.data
|
|
@@ -2494,9 +2497,9 @@ function ve(e) {
|
|
|
2494
2497
|
...se,
|
|
2495
2498
|
...e.customComponents || []
|
|
2496
2499
|
].reduce(
|
|
2497
|
-
(
|
|
2498
|
-
...
|
|
2499
|
-
[
|
|
2500
|
+
(p, { component: I, ...w }) => ({
|
|
2501
|
+
...p,
|
|
2502
|
+
[w.name]: de(w)
|
|
2500
2503
|
}),
|
|
2501
2504
|
{}
|
|
2502
2505
|
),
|
|
@@ -2508,7 +2511,7 @@ function ve(e) {
|
|
|
2508
2511
|
value: {
|
|
2509
2512
|
registeredComponents: a
|
|
2510
2513
|
},
|
|
2511
|
-
children: /* @__PURE__ */
|
|
2514
|
+
children: /* @__PURE__ */ E(
|
|
2512
2515
|
zt,
|
|
2513
2516
|
{
|
|
2514
2517
|
content: e.content,
|
|
@@ -2529,13 +2532,13 @@ function ve(e) {
|
|
|
2529
2532
|
{
|
|
2530
2533
|
contentId: (c = l.content) == null ? void 0 : c.id,
|
|
2531
2534
|
cssCode: (u = (d = l.content) == null ? void 0 : d.data) == null ? void 0 : u.cssCode,
|
|
2532
|
-
customFonts: (
|
|
2535
|
+
customFonts: (S = (g = l.content) == null ? void 0 : g.data) == null ? void 0 : S.customFonts
|
|
2533
2536
|
}
|
|
2534
2537
|
) }),
|
|
2535
2538
|
/* @__PURE__ */ r(
|
|
2536
2539
|
ie,
|
|
2537
2540
|
{
|
|
2538
|
-
blocks: (
|
|
2541
|
+
blocks: (x = (V = l.content) == null ? void 0 : V.data) == null ? void 0 : x.blocks,
|
|
2539
2542
|
context: l,
|
|
2540
2543
|
registeredComponents: a
|
|
2541
2544
|
}
|
|
@@ -2548,7 +2551,7 @@ function ve(e) {
|
|
|
2548
2551
|
}
|
|
2549
2552
|
function Ae(e) {
|
|
2550
2553
|
var l, s;
|
|
2551
|
-
const [t, n] =
|
|
2554
|
+
const [t, n] = v(
|
|
2552
2555
|
() => Ft({
|
|
2553
2556
|
canTrack: U(e.canTrack),
|
|
2554
2557
|
content: e.content
|
|
@@ -2578,9 +2581,9 @@ function Ae(e) {
|
|
|
2578
2581
|
});
|
|
2579
2582
|
}
|
|
2580
2583
|
return P(() => {
|
|
2581
|
-
}, []), /* @__PURE__ */
|
|
2584
|
+
}, []), /* @__PURE__ */ E(f, { children: [
|
|
2582
2585
|
!e.__isNestedRender && L !== "reactNative" ? /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(X, { scriptStr: _t() }) }) : null,
|
|
2583
|
-
t ? /* @__PURE__ */
|
|
2586
|
+
t ? /* @__PURE__ */ E(f, { children: [
|
|
2584
2587
|
/* @__PURE__ */ r(
|
|
2585
2588
|
K,
|
|
2586
2589
|
{
|
|
@@ -2659,7 +2662,7 @@ function en(e) {
|
|
|
2659
2662
|
(d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2660
2663
|
].filter(Boolean).join(" ");
|
|
2661
2664
|
}
|
|
2662
|
-
const [n, i] =
|
|
2665
|
+
const [n, i] = v(() => {
|
|
2663
2666
|
var c;
|
|
2664
2667
|
return (c = e.symbol) == null ? void 0 : c.content;
|
|
2665
2668
|
});
|