@builder.io/sdk-react-nextjs 0.14.8 → 0.14.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/{node/USE_CLIENT_BUNDLE-690f58c3.js → browser/USE_CLIENT_BUNDLE-07d1ba4b.js} +205 -212
- package/lib/browser/USE_CLIENT_BUNDLE-5b3511d0.cjs +21 -0
- package/lib/{edge/USE_SERVER_BUNDLE-2cb317bc.js → browser/USE_SERVER_BUNDLE-059335ee.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-7cb08770.cjs → browser/USE_SERVER_BUNDLE-4e489369.cjs} +1 -1
- package/lib/browser/{bundle-d78727c9.js → bundle-53a4ab4a.js} +2 -2
- package/lib/browser/{bundle-eca4b0ba.cjs → bundle-9d3cdb5c.cjs} +2 -2
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/edge/USE_CLIENT_BUNDLE-0d437014.cjs +21 -0
- package/lib/{browser/USE_CLIENT_BUNDLE-78517750.js → edge/USE_CLIENT_BUNDLE-99299aaa.js} +205 -212
- package/lib/{node/USE_SERVER_BUNDLE-649f2942.js → edge/USE_SERVER_BUNDLE-2d91be32.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-e8d80664.cjs → edge/USE_SERVER_BUNDLE-37a2c2d3.cjs} +1 -1
- package/lib/edge/{bundle-7da386a2.js → bundle-d76be364.js} +2 -2
- package/lib/edge/{bundle-07c68bbe.cjs → bundle-da19475d.cjs} +2 -2
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/node/USE_CLIENT_BUNDLE-94a936b5.cjs +21 -0
- package/lib/{edge/USE_CLIENT_BUNDLE-01cf3cc1.js → node/USE_CLIENT_BUNDLE-aa4a4eb2.js} +205 -212
- package/lib/{browser/USE_SERVER_BUNDLE-29f23050.js → node/USE_SERVER_BUNDLE-91781c1b.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-d3d0c3a5.cjs → node/USE_SERVER_BUNDLE-d58e151a.cjs} +1 -1
- package/lib/node/{bundle-001f0cdc.js → bundle-49817803.js} +2 -2
- package/lib/node/{bundle-77f045ce.cjs → bundle-955ea489.cjs} +2 -2
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/lib/browser/USE_CLIENT_BUNDLE-2046b4f7.cjs +0 -21
- package/lib/edge/USE_CLIENT_BUNDLE-23418377.cjs +0 -21
- package/lib/node/USE_CLIENT_BUNDLE-f9317c5f.cjs +0 -21
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { i as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { p as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
2
|
+
import { jsx as a, Fragment as C, jsxs as w } from "react/jsx-runtime";
|
|
3
|
+
import { i as X, g as _, a as U, b as $, c as E, d as P, e as Y, f as q, h as H, _ as V, j as Z, l as p, k as ee, t as te, m as D, n as ne, o as ie, r as ae, s as ce, p as re, q as le, u as oe } from "./bundle-d76be364.js";
|
|
4
|
+
import { useRef as R, useState as y, useEffect as f, createContext as de } from "react";
|
|
5
|
+
import { p as se } from "./USE_SERVER_BUNDLE-2d91be32.js";
|
|
6
|
+
import { useRouter as ue } from "next/navigation";
|
|
7
|
+
function O(e) {
|
|
8
|
+
return /* @__PURE__ */ a(C, { children: X(e.TagName) ? /* @__PURE__ */ a(C, { children: /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ a(C, { children: typeof e.TagName == "string" ? /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
10
|
+
function ve(e) {
|
|
11
|
+
return /* @__PURE__ */ a(
|
|
12
|
+
O,
|
|
13
13
|
{
|
|
14
14
|
attributes: {
|
|
15
15
|
...e.attributes,
|
|
16
|
-
[
|
|
16
|
+
[_()]: `${e.link ? "" : "builder-button"} ${e.attributes[_()] || ""}`,
|
|
17
17
|
...e.link ? {
|
|
18
18
|
href: e.link,
|
|
19
19
|
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
@@ -28,16 +28,16 @@ function we(e) {
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
31
|
+
function xe(e) {
|
|
32
|
+
return /* @__PURE__ */ a(
|
|
33
|
+
O,
|
|
34
34
|
{
|
|
35
35
|
TagName: e.Wrapper,
|
|
36
|
-
attributes:
|
|
36
|
+
attributes: U({
|
|
37
37
|
block: e.block,
|
|
38
38
|
context: e.context
|
|
39
39
|
}),
|
|
40
|
-
actionAttributes:
|
|
40
|
+
actionAttributes: $({
|
|
41
41
|
block: e.block,
|
|
42
42
|
rootState: e.context.rootState,
|
|
43
43
|
rootSetState: e.context.rootSetState,
|
|
@@ -49,17 +49,17 @@ function Ee(e) {
|
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return /* @__PURE__ */
|
|
52
|
+
function ye(e) {
|
|
53
|
+
return /* @__PURE__ */ a(
|
|
54
54
|
e.Wrapper,
|
|
55
55
|
{
|
|
56
56
|
...e.wrapperProps,
|
|
57
57
|
attributes: e.includeBlockProps ? {
|
|
58
|
-
|
|
58
|
+
...U({
|
|
59
59
|
block: e.block,
|
|
60
60
|
context: e.context
|
|
61
61
|
}),
|
|
62
|
-
|
|
62
|
+
...$({
|
|
63
63
|
block: e.block,
|
|
64
64
|
rootState: e.context.rootState,
|
|
65
65
|
rootSetState: e.context.rootSetState,
|
|
@@ -71,14 +71,14 @@ function Ie(e) {
|
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
function
|
|
74
|
+
function ke(e) {
|
|
75
|
+
function c() {
|
|
76
76
|
var r;
|
|
77
77
|
return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
var r,
|
|
81
|
-
|
|
79
|
+
function u() {
|
|
80
|
+
var r, g;
|
|
81
|
+
E() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
|
|
82
82
|
{
|
|
83
83
|
type: "builder.clickEmptyBlocks",
|
|
84
84
|
data: {
|
|
@@ -89,9 +89,9 @@ function Re(e) {
|
|
|
89
89
|
"*"
|
|
90
90
|
));
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
var r,
|
|
94
|
-
|
|
92
|
+
function S() {
|
|
93
|
+
var r, g;
|
|
94
|
+
E() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
|
|
95
95
|
{
|
|
96
96
|
type: "builder.hoverEmptyBlocks",
|
|
97
97
|
data: {
|
|
@@ -102,34 +102,34 @@ function Re(e) {
|
|
|
102
102
|
"*"
|
|
103
103
|
));
|
|
104
104
|
}
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ w(C, { children: [
|
|
106
|
+
/* @__PURE__ */ a(
|
|
107
107
|
e.BlocksWrapper,
|
|
108
108
|
{
|
|
109
|
-
className:
|
|
109
|
+
className: c() + " props-blocks-wrapper-7cd1560e",
|
|
110
110
|
"builder-path": e.path,
|
|
111
111
|
"builder-parent-id": e.parent,
|
|
112
112
|
style: e.styleProp,
|
|
113
|
-
onClick: (r) =>
|
|
114
|
-
onMouseEnter: (r) =>
|
|
115
|
-
onKeyPress: (r) =>
|
|
113
|
+
onClick: (r) => u(),
|
|
114
|
+
onMouseEnter: (r) => S(),
|
|
115
|
+
onKeyPress: (r) => u(),
|
|
116
116
|
...e.BlocksWrapperProps,
|
|
117
117
|
children: e.children
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ a("style", { children: `.props-blocks-wrapper-7cd1560e {
|
|
121
121
|
display: flex;
|
|
122
122
|
flex-direction: column;
|
|
123
123
|
align-items: stretch;
|
|
124
124
|
}` })
|
|
125
125
|
] });
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
return /* @__PURE__ */
|
|
127
|
+
function Ce(e) {
|
|
128
|
+
return /* @__PURE__ */ a("span", { children: e.children });
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
var r,
|
|
132
|
-
function
|
|
130
|
+
function Ee(e) {
|
|
131
|
+
var r, g, b, h;
|
|
132
|
+
function c() {
|
|
133
133
|
var m;
|
|
134
134
|
const l = e.image || e.src;
|
|
135
135
|
if (!l || // We can auto add srcset for cdn.builder.io and shopify
|
|
@@ -138,30 +138,30 @@ function Te(e) {
|
|
|
138
138
|
return e.srcset;
|
|
139
139
|
if (e.srcset && ((m = e.image) != null && m.includes("builder.io/api/v1/image"))) {
|
|
140
140
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
141
|
-
return console.debug("Removed given srcset"),
|
|
141
|
+
return console.debug("Removed given srcset"), P(l);
|
|
142
142
|
} else if (e.image && !e.srcset)
|
|
143
|
-
return
|
|
144
|
-
return
|
|
143
|
+
return P(l);
|
|
144
|
+
return P(l);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
var
|
|
148
|
-
return (
|
|
146
|
+
function u() {
|
|
147
|
+
var s;
|
|
148
|
+
return (s = c == null ? void 0 : c()) != null && s.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
const
|
|
150
|
+
function S() {
|
|
151
|
+
const s = {
|
|
152
152
|
position: "absolute",
|
|
153
153
|
height: "100%",
|
|
154
154
|
width: "100%",
|
|
155
155
|
left: "0px",
|
|
156
156
|
top: "0px"
|
|
157
157
|
};
|
|
158
|
-
return e.aspectRatio ?
|
|
158
|
+
return e.aspectRatio ? s : void 0;
|
|
159
159
|
}
|
|
160
|
-
return /* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
|
|
164
|
-
/* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ w(C, { children: [
|
|
161
|
+
/* @__PURE__ */ w(C, { children: [
|
|
162
|
+
/* @__PURE__ */ w("picture", { children: [
|
|
163
|
+
u() ? /* @__PURE__ */ a("source", { type: "image/webp", srcSet: u() }) : null,
|
|
164
|
+
/* @__PURE__ */ a(
|
|
165
165
|
"img",
|
|
166
166
|
{
|
|
167
167
|
loading: "lazy",
|
|
@@ -170,16 +170,16 @@ function Te(e) {
|
|
|
170
170
|
style: {
|
|
171
171
|
objectPosition: e.backgroundPosition || "center",
|
|
172
172
|
objectFit: e.backgroundSize || "cover",
|
|
173
|
-
...
|
|
173
|
+
...S()
|
|
174
174
|
},
|
|
175
175
|
className: "builder-image" + (e.className ? " " + e.className : "") + " img-a0c95e8c",
|
|
176
176
|
src: e.image,
|
|
177
|
-
srcSet:
|
|
177
|
+
srcSet: c(),
|
|
178
178
|
sizes: e.sizes
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
] }),
|
|
182
|
-
e.aspectRatio && !((
|
|
182
|
+
e.aspectRatio && !((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length && e.fitContent) ? /* @__PURE__ */ a(
|
|
183
183
|
"div",
|
|
184
184
|
{
|
|
185
185
|
className: "builder-image-sizer div-a0c95e8c",
|
|
@@ -188,10 +188,10 @@ function Te(e) {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
) : null,
|
|
191
|
-
(
|
|
192
|
-
!e.fitContent && e.children ? /* @__PURE__ */
|
|
191
|
+
(h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ a(C, { children: e.children }) : null,
|
|
192
|
+
!e.fitContent && e.children ? /* @__PURE__ */ a("div", { className: "div-a0c95e8c-2", children: e.children }) : null
|
|
193
193
|
] }),
|
|
194
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ a("style", { children: `.img-a0c95e8c {
|
|
195
195
|
opacity: 1;
|
|
196
196
|
transition: opacity 0.2s ease-in-out;
|
|
197
197
|
}.div-a0c95e8c {
|
|
@@ -210,8 +210,8 @@ function Te(e) {
|
|
|
210
210
|
}` })
|
|
211
211
|
] });
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return /* @__PURE__ */
|
|
213
|
+
function we(e) {
|
|
214
|
+
return /* @__PURE__ */ a(
|
|
215
215
|
"section",
|
|
216
216
|
{
|
|
217
217
|
...e.attributes,
|
|
@@ -231,19 +231,19 @@ function Ne(e) {
|
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
const
|
|
236
|
-
return
|
|
237
|
-
var
|
|
238
|
-
if (!((
|
|
234
|
+
function Ie(e) {
|
|
235
|
+
const c = R(null), [u, S] = y(() => []), [r, g] = y(() => []);
|
|
236
|
+
return f(() => {
|
|
237
|
+
var h;
|
|
238
|
+
if (!((h = c.current) != null && h.getElementsByTagName) || typeof window > "u")
|
|
239
239
|
return;
|
|
240
|
-
const
|
|
241
|
-
for (let
|
|
242
|
-
const l =
|
|
240
|
+
const b = c.current.getElementsByTagName("script");
|
|
241
|
+
for (let s = 0; s < b.length; s++) {
|
|
242
|
+
const l = b[s];
|
|
243
243
|
if (l.src) {
|
|
244
|
-
if (
|
|
244
|
+
if (u.includes(l.src))
|
|
245
245
|
continue;
|
|
246
|
-
|
|
246
|
+
u.push(l.src);
|
|
247
247
|
const m = document.createElement("script");
|
|
248
248
|
m.async = !0, m.src = l.src, document.head.appendChild(m);
|
|
249
249
|
} else if (!l.type || [
|
|
@@ -260,48 +260,48 @@ function Be(e) {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
}, []), /* @__PURE__ */
|
|
263
|
+
}, []), /* @__PURE__ */ a(
|
|
264
264
|
"div",
|
|
265
265
|
{
|
|
266
|
-
ref:
|
|
266
|
+
ref: c,
|
|
267
267
|
className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
|
|
268
268
|
dangerouslySetInnerHTML: { __html: e.code }
|
|
269
269
|
}
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
const
|
|
274
|
-
function
|
|
275
|
-
if (!
|
|
272
|
+
function Pe(e) {
|
|
273
|
+
const c = R(null), [u, S] = y(() => []), [r, g] = y(() => []), [b, h] = y(() => !1);
|
|
274
|
+
function s() {
|
|
275
|
+
if (!c.current || !c.current.getElementsByTagName)
|
|
276
276
|
return;
|
|
277
|
-
const l =
|
|
277
|
+
const l = c.current.getElementsByTagName("script");
|
|
278
278
|
for (let m = 0; m < l.length; m++) {
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
|
|
279
|
+
const x = l[m];
|
|
280
|
+
if (x.src && !u.includes(x.src)) {
|
|
281
|
+
u.push(x.src);
|
|
282
282
|
const k = document.createElement("script");
|
|
283
|
-
k.async = !0, k.src =
|
|
284
|
-
} else if (
|
|
283
|
+
k.async = !0, k.src = x.src, document.head.appendChild(k);
|
|
284
|
+
} else if (Y(x) && !r.includes(x.innerText))
|
|
285
285
|
try {
|
|
286
|
-
r.push(
|
|
286
|
+
r.push(x.innerText), new Function(x.innerText)();
|
|
287
287
|
} catch (k) {
|
|
288
288
|
console.warn("`Embed`: Error running script:", k);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
return
|
|
293
|
-
|
|
294
|
-
}, [
|
|
292
|
+
return f(() => {
|
|
293
|
+
c.current && !b && (h(!0), s());
|
|
294
|
+
}, [c.current, b]), /* @__PURE__ */ a(
|
|
295
295
|
"div",
|
|
296
296
|
{
|
|
297
297
|
className: "builder-embed",
|
|
298
|
-
ref:
|
|
298
|
+
ref: c,
|
|
299
299
|
dangerouslySetInnerHTML: { __html: e.content }
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
return /* @__PURE__ */
|
|
303
|
+
function Re(e) {
|
|
304
|
+
return /* @__PURE__ */ a(
|
|
305
305
|
"img",
|
|
306
306
|
{
|
|
307
307
|
style: {
|
|
@@ -312,12 +312,12 @@ function je(e) {
|
|
|
312
312
|
src: e.imgSrc || e.image,
|
|
313
313
|
...e.attributes
|
|
314
314
|
},
|
|
315
|
-
|
|
315
|
+
E() && e.imgSrc || "default-key"
|
|
316
316
|
);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
var
|
|
320
|
-
function
|
|
318
|
+
function Te(e) {
|
|
319
|
+
var S, r, g, b, h, s, l;
|
|
320
|
+
function c() {
|
|
321
321
|
return {
|
|
322
322
|
...e.autoPlay === !0 ? {
|
|
323
323
|
autoPlay: !0
|
|
@@ -336,28 +336,28 @@ function We(e) {
|
|
|
336
336
|
} : {}
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function u() {
|
|
340
340
|
return {
|
|
341
|
-
...
|
|
341
|
+
...c()
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ w(
|
|
345
345
|
"div",
|
|
346
346
|
{
|
|
347
347
|
style: {
|
|
348
348
|
position: "relative"
|
|
349
349
|
},
|
|
350
350
|
children: [
|
|
351
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ a(
|
|
352
352
|
"video",
|
|
353
353
|
{
|
|
354
354
|
className: "builder-video",
|
|
355
|
-
...
|
|
355
|
+
...u(),
|
|
356
356
|
preload: e.preload || "metadata",
|
|
357
357
|
style: {
|
|
358
358
|
width: "100%",
|
|
359
359
|
height: "100%",
|
|
360
|
-
...(
|
|
360
|
+
...(S = e.attributes) == null ? void 0 : S.style,
|
|
361
361
|
objectFit: e.fit,
|
|
362
362
|
objectPosition: e.position,
|
|
363
363
|
// Hack to get object fit to work as expected and
|
|
@@ -370,10 +370,10 @@ function We(e) {
|
|
|
370
370
|
},
|
|
371
371
|
src: e.video || "no-src",
|
|
372
372
|
poster: e.posterImage,
|
|
373
|
-
children: e.lazyLoad ? null : /* @__PURE__ */
|
|
373
|
+
children: e.lazyLoad ? null : /* @__PURE__ */ a("source", { type: "video/mp4", src: e.video })
|
|
374
374
|
}
|
|
375
375
|
),
|
|
376
|
-
e.aspectRatio && !(e.fitContent && ((
|
|
376
|
+
e.aspectRatio && !(e.fitContent && ((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length)) ? /* @__PURE__ */ a(
|
|
377
377
|
"div",
|
|
378
378
|
{
|
|
379
379
|
style: {
|
|
@@ -384,7 +384,7 @@ function We(e) {
|
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
) : null,
|
|
387
|
-
(
|
|
387
|
+
(h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ a(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
390
|
style: {
|
|
@@ -395,7 +395,7 @@ function We(e) {
|
|
|
395
395
|
children: e.children
|
|
396
396
|
}
|
|
397
397
|
) : null,
|
|
398
|
-
(l = (
|
|
398
|
+
(l = (s = e.builderBlock) == null ? void 0 : s.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ a(
|
|
399
399
|
"div",
|
|
400
400
|
{
|
|
401
401
|
style: {
|
|
@@ -416,7 +416,7 @@ function We(e) {
|
|
|
416
416
|
}
|
|
417
417
|
);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
419
|
+
const me = de({
|
|
420
420
|
content: null,
|
|
421
421
|
context: {},
|
|
422
422
|
localState: void 0,
|
|
@@ -430,11 +430,10 @@ const fe = me({
|
|
|
430
430
|
BlocksWrapper: "div",
|
|
431
431
|
BlocksWrapperProps: {}
|
|
432
432
|
});
|
|
433
|
-
function
|
|
434
|
-
var W, K, A, F, z
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
function r(n) {
|
|
433
|
+
function Ne(e) {
|
|
434
|
+
var L, j, W, K, A, F, z;
|
|
435
|
+
const c = R(null);
|
|
436
|
+
function u(n) {
|
|
438
437
|
var i, o;
|
|
439
438
|
const t = {
|
|
440
439
|
...e.builderContextSignal.rootState,
|
|
@@ -442,8 +441,8 @@ function Ke(e) {
|
|
|
442
441
|
};
|
|
443
442
|
e.builderContextSignal.rootSetState ? (o = (i = e.builderContextSignal).rootSetState) == null || o.call(i, t) : e.builderContextSignal.rootState = t;
|
|
444
443
|
}
|
|
445
|
-
function
|
|
446
|
-
var i, o, d,
|
|
444
|
+
function S(n) {
|
|
445
|
+
var i, o, d, v, M;
|
|
447
446
|
const t = {
|
|
448
447
|
...e.builderContextSignal.content,
|
|
449
448
|
...n,
|
|
@@ -454,49 +453,46 @@ function Ke(e) {
|
|
|
454
453
|
meta: {
|
|
455
454
|
...(o = e.builderContextSignal.content) == null ? void 0 : o.meta,
|
|
456
455
|
...n == null ? void 0 : n.meta,
|
|
457
|
-
breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((
|
|
456
|
+
breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((M = (v = e.builderContextSignal.content) == null ? void 0 : v.meta) == null ? void 0 : M.breakpoints)
|
|
458
457
|
}
|
|
459
458
|
};
|
|
460
|
-
|
|
459
|
+
se({
|
|
461
460
|
value: t,
|
|
462
461
|
key: t.id
|
|
463
462
|
}).then(() => {
|
|
464
|
-
|
|
463
|
+
Q.refresh();
|
|
465
464
|
});
|
|
466
465
|
}
|
|
467
|
-
|
|
468
|
-
const [h, x] = v(
|
|
469
|
-
() => !1
|
|
470
|
-
), [g, l] = v(
|
|
466
|
+
const [r, g] = y(
|
|
471
467
|
() => e.contentWrapper || "div"
|
|
472
468
|
);
|
|
473
|
-
function
|
|
474
|
-
return
|
|
469
|
+
function b(n) {
|
|
470
|
+
return ee({
|
|
475
471
|
model: e.model,
|
|
476
472
|
trustedHosts: e.trustedHosts,
|
|
477
473
|
callbacks: {
|
|
478
474
|
configureSdk: (t) => {
|
|
479
475
|
var d;
|
|
480
476
|
const { breakpoints: i, contentId: o } = t;
|
|
481
|
-
!o || o !== ((d = e.builderContextSignal.content) == null ? void 0 : d.id) || i && (
|
|
477
|
+
!o || o !== ((d = e.builderContextSignal.content) == null ? void 0 : d.id) || i && S({
|
|
482
478
|
meta: {
|
|
483
479
|
breakpoints: i
|
|
484
480
|
}
|
|
485
|
-
})
|
|
481
|
+
});
|
|
486
482
|
},
|
|
487
483
|
animation: (t) => {
|
|
488
|
-
|
|
484
|
+
te(t);
|
|
489
485
|
},
|
|
490
486
|
contentUpdate: (t) => {
|
|
491
|
-
|
|
487
|
+
S(t);
|
|
492
488
|
}
|
|
493
489
|
}
|
|
494
490
|
})(n);
|
|
495
491
|
}
|
|
496
|
-
function
|
|
492
|
+
function h() {
|
|
497
493
|
var t, i;
|
|
498
494
|
const n = (i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.jsCode;
|
|
499
|
-
n &&
|
|
495
|
+
n && D({
|
|
500
496
|
code: n,
|
|
501
497
|
context: e.context || {},
|
|
502
498
|
localState: void 0,
|
|
@@ -508,28 +504,28 @@ function Ke(e) {
|
|
|
508
504
|
enableCache: !1
|
|
509
505
|
});
|
|
510
506
|
}
|
|
511
|
-
const [
|
|
512
|
-
function
|
|
507
|
+
const [s, l] = y(() => ({})), [m, x] = y(() => !1);
|
|
508
|
+
function k(n) {
|
|
513
509
|
var t, i;
|
|
514
510
|
if (e.builderContextSignal.content) {
|
|
515
511
|
const o = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
|
|
516
|
-
|
|
512
|
+
V({
|
|
517
513
|
type: "click",
|
|
518
|
-
canTrack:
|
|
514
|
+
canTrack: H(e.canTrack),
|
|
519
515
|
contentId: d,
|
|
520
516
|
apiKey: e.apiKey,
|
|
521
517
|
variationId: o !== d ? o : void 0,
|
|
522
|
-
...
|
|
523
|
-
unique: !
|
|
518
|
+
...ne(n),
|
|
519
|
+
unique: !m
|
|
524
520
|
});
|
|
525
521
|
}
|
|
526
|
-
|
|
522
|
+
m || x(!0);
|
|
527
523
|
}
|
|
528
|
-
function
|
|
524
|
+
function J(n) {
|
|
529
525
|
return n.replace(
|
|
530
526
|
/{{([^}]+)}}/g,
|
|
531
527
|
(t, i) => String(
|
|
532
|
-
|
|
528
|
+
D({
|
|
533
529
|
code: i,
|
|
534
530
|
context: e.context || {},
|
|
535
531
|
localState: void 0,
|
|
@@ -540,38 +536,38 @@ function Ke(e) {
|
|
|
540
536
|
)
|
|
541
537
|
);
|
|
542
538
|
}
|
|
543
|
-
function
|
|
544
|
-
|
|
545
|
-
var d,
|
|
539
|
+
function G({ url: n, key: t }) {
|
|
540
|
+
oe(n).then((i) => i.json()).then((i) => {
|
|
541
|
+
var d, v;
|
|
546
542
|
const o = {
|
|
547
543
|
...e.builderContextSignal.rootState,
|
|
548
544
|
[t]: i
|
|
549
545
|
};
|
|
550
|
-
(
|
|
546
|
+
(v = (d = e.builderContextSignal).rootSetState) == null || v.call(d, o), s[t] = !0;
|
|
551
547
|
}).catch((i) => {
|
|
552
548
|
console.error("error fetching dynamic data", n, i);
|
|
553
549
|
});
|
|
554
550
|
}
|
|
555
|
-
function
|
|
551
|
+
function T() {
|
|
556
552
|
var t, i;
|
|
557
553
|
const n = ((i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.httpRequests) ?? {};
|
|
558
554
|
Object.entries(n).forEach(([o, d]) => {
|
|
559
|
-
if (d && (!
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
url:
|
|
555
|
+
if (d && (!s[o] || E())) {
|
|
556
|
+
const v = J(d);
|
|
557
|
+
G({
|
|
558
|
+
url: v,
|
|
563
559
|
key: o
|
|
564
560
|
});
|
|
565
561
|
}
|
|
566
562
|
});
|
|
567
563
|
}
|
|
568
564
|
function I() {
|
|
569
|
-
|
|
565
|
+
E() && window.dispatchEvent(
|
|
570
566
|
new CustomEvent(
|
|
571
567
|
"builder:component:stateChange",
|
|
572
568
|
{
|
|
573
569
|
detail: {
|
|
574
|
-
state:
|
|
570
|
+
state: ie(e.builderContextSignal.rootState),
|
|
575
571
|
ref: {
|
|
576
572
|
name: e.model
|
|
577
573
|
}
|
|
@@ -580,8 +576,8 @@ function Ke(e) {
|
|
|
580
576
|
)
|
|
581
577
|
);
|
|
582
578
|
}
|
|
583
|
-
function
|
|
584
|
-
|
|
579
|
+
function N(n) {
|
|
580
|
+
window.addEventListener("message", b), ae(), ce({
|
|
585
581
|
...e.locale ? {
|
|
586
582
|
locale: e.locale
|
|
587
583
|
} : {},
|
|
@@ -595,119 +591,116 @@ function Ke(e) {
|
|
|
595
591
|
e.builderContextSignal.componentInfos
|
|
596
592
|
).forEach((t) => {
|
|
597
593
|
var o;
|
|
598
|
-
const i =
|
|
594
|
+
const i = re(t);
|
|
599
595
|
(o = window.parent) == null || o.postMessage(i, "*");
|
|
600
596
|
}), window.addEventListener(
|
|
601
597
|
"builder:component:stateChangeListenerActivated",
|
|
602
598
|
I
|
|
603
599
|
);
|
|
604
600
|
}
|
|
605
|
-
function
|
|
601
|
+
function B(n) {
|
|
606
602
|
const t = new URL(location.href).searchParams, i = t.get("builder.preview"), o = t.get(
|
|
607
603
|
`builder.preview.${i}`
|
|
608
604
|
), d = t.get("apiKey") || t.get("builder.space");
|
|
609
|
-
i === e.model && d === e.apiKey && (!e.content || o === e.content.id) &&
|
|
605
|
+
i === e.model && d === e.apiKey && (!e.content || o === e.content.id) && le({
|
|
610
606
|
model: e.model,
|
|
611
607
|
apiKey: e.apiKey,
|
|
612
608
|
apiVersion: e.builderContextSignal.apiVersion
|
|
613
|
-
}).then((
|
|
614
|
-
|
|
609
|
+
}).then((v) => {
|
|
610
|
+
v && S(v);
|
|
615
611
|
});
|
|
616
612
|
}
|
|
617
|
-
const
|
|
618
|
-
return
|
|
613
|
+
const Q = ue();
|
|
614
|
+
return f(() => {
|
|
619
615
|
var n;
|
|
620
|
-
return (n =
|
|
616
|
+
return (n = c.current) == null || n.addEventListener(
|
|
621
617
|
"initeditingbldr",
|
|
622
|
-
|
|
618
|
+
N
|
|
623
619
|
), () => {
|
|
624
620
|
var t;
|
|
625
|
-
return (t =
|
|
621
|
+
return (t = c.current) == null ? void 0 : t.removeEventListener(
|
|
626
622
|
"initeditingbldr",
|
|
627
|
-
|
|
623
|
+
N
|
|
628
624
|
);
|
|
629
625
|
};
|
|
630
|
-
}, []),
|
|
626
|
+
}, []), f(() => {
|
|
631
627
|
var n;
|
|
632
|
-
return (n =
|
|
628
|
+
return (n = c.current) == null || n.addEventListener(
|
|
633
629
|
"initpreviewingbldr",
|
|
634
|
-
|
|
630
|
+
B
|
|
635
631
|
), () => {
|
|
636
632
|
var t;
|
|
637
|
-
return (t =
|
|
633
|
+
return (t = c.current) == null ? void 0 : t.removeEventListener(
|
|
638
634
|
"initpreviewingbldr",
|
|
639
|
-
|
|
635
|
+
B
|
|
640
636
|
);
|
|
641
637
|
};
|
|
642
|
-
}, []),
|
|
638
|
+
}, []), f(() => {
|
|
643
639
|
var n, t;
|
|
644
|
-
if (
|
|
645
|
-
if (
|
|
646
|
-
const o = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (t = e.builderContextSignal.content) == null ? void 0 : t.id,
|
|
647
|
-
|
|
640
|
+
if (q()) {
|
|
641
|
+
if (E() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && H(e.canTrack)) {
|
|
642
|
+
const o = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (t = e.builderContextSignal.content) == null ? void 0 : t.id, v = e.apiKey;
|
|
643
|
+
V({
|
|
648
644
|
type: "impression",
|
|
649
645
|
canTrack: !0,
|
|
650
646
|
contentId: d,
|
|
651
|
-
apiKey:
|
|
647
|
+
apiKey: v,
|
|
652
648
|
variationId: o !== d ? o : void 0
|
|
653
649
|
});
|
|
654
650
|
}
|
|
655
|
-
|
|
651
|
+
Z();
|
|
656
652
|
}
|
|
657
|
-
}, []),
|
|
658
|
-
e.apiKey ||
|
|
653
|
+
}, []), f(() => {
|
|
654
|
+
e.apiKey || p.error(
|
|
659
655
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
660
|
-
),
|
|
661
|
-
}, []),
|
|
662
|
-
}, [e.content]),
|
|
663
|
-
|
|
664
|
-
}, [
|
|
665
|
-
|
|
666
|
-
}, [(K = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : K.
|
|
667
|
-
B();
|
|
668
|
-
}, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), b(() => {
|
|
656
|
+
), h(), T(), I();
|
|
657
|
+
}, []), f(() => {
|
|
658
|
+
}, [e.content]), f(() => {
|
|
659
|
+
h();
|
|
660
|
+
}, [(j = (L = e.builderContextSignal.content) == null ? void 0 : L.data) == null ? void 0 : j.jsCode]), f(() => {
|
|
661
|
+
T();
|
|
662
|
+
}, [(K = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : K.httpRequests]), f(() => {
|
|
669
663
|
I();
|
|
670
|
-
}, [e.builderContextSignal.rootState]),
|
|
671
|
-
e.data &&
|
|
672
|
-
}, [e.data]),
|
|
673
|
-
e.locale &&
|
|
664
|
+
}, [e.builderContextSignal.rootState]), f(() => {
|
|
665
|
+
e.data && u(e.data);
|
|
666
|
+
}, [e.data]), f(() => {
|
|
667
|
+
e.locale && u({
|
|
674
668
|
locale: e.locale
|
|
675
669
|
});
|
|
676
|
-
}, [e.locale]),
|
|
677
|
-
|
|
670
|
+
}, [e.locale]), f(() => () => {
|
|
671
|
+
q() && (window.removeEventListener("message", b), window.removeEventListener(
|
|
678
672
|
"builder:component:stateChangeListenerActivated",
|
|
679
673
|
I
|
|
680
674
|
));
|
|
681
|
-
}, []), /* @__PURE__ */
|
|
682
|
-
|
|
675
|
+
}, []), /* @__PURE__ */ a(me.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ a(
|
|
676
|
+
r,
|
|
683
677
|
{
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
"builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
|
|
678
|
+
ref: c,
|
|
679
|
+
onClick: (n) => k(n),
|
|
680
|
+
"builder-content-id": (A = e.builderContextSignal.content) == null ? void 0 : A.id,
|
|
688
681
|
"builder-model": e.model,
|
|
689
682
|
...e.showContent ? {} : {
|
|
690
683
|
hidden: !0,
|
|
691
684
|
"aria-hidden": !0
|
|
692
685
|
},
|
|
693
686
|
...e.contentWrapperProps,
|
|
694
|
-
className: `variant-${((
|
|
695
|
-
|
|
696
|
-
|
|
687
|
+
className: `variant-${((F = e.content) == null ? void 0 : F.testVariationId) || ((z = e.content) == null ? void 0 : z.id)}`,
|
|
688
|
+
children: e.children
|
|
689
|
+
}
|
|
697
690
|
) : null });
|
|
698
691
|
}
|
|
699
692
|
export {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
693
|
+
xe as B,
|
|
694
|
+
Ie as C,
|
|
695
|
+
O as D,
|
|
696
|
+
Pe as E,
|
|
697
|
+
Ce as F,
|
|
698
|
+
ye as I,
|
|
699
|
+
we as S,
|
|
700
|
+
Te as V,
|
|
701
|
+
ke as a,
|
|
702
|
+
Re as b,
|
|
703
|
+
ve as c,
|
|
704
|
+
Ee as d,
|
|
705
|
+
Ne as e
|
|
713
706
|
};
|