@builder.io/sdk-react-nextjs 0.7.0 → 0.7.1-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/USE_CLIENT_BUNDLE-7a3bf41a.mjs +657 -0
- package/lib/browser/USE_CLIENT_BUNDLE-9195e6a5.js +23 -0
- package/lib/{edge/USE_SERVER_BUNDLE-105e9ef3.js → browser/USE_SERVER_BUNDLE-d7b13097.js} +1 -1
- package/lib/browser/USE_SERVER_BUNDLE-e5c2279a.mjs +11 -0
- package/lib/browser/{bundle-0fae602b.js → bundle-620ae296.js} +5 -5
- package/lib/browser/{bundle-3b073b16.mjs → bundle-7285a09d.mjs} +265 -268
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +7 -7
- package/lib/edge/USE_CLIENT_BUNDLE-3cca560e.js +23 -0
- package/lib/edge/USE_CLIENT_BUNDLE-4a0cfa69.mjs +657 -0
- package/lib/{node/USE_SERVER_BUNDLE-d8c698c8.js → edge/USE_SERVER_BUNDLE-3f12faf4.js} +1 -1
- package/lib/edge/USE_SERVER_BUNDLE-f184d7eb.mjs +11 -0
- package/lib/edge/{bundle-0c1d9099.js → bundle-a0f5cad2.js} +5 -5
- package/lib/edge/{bundle-ed178c62.mjs → bundle-a5949d33.mjs} +265 -268
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +7 -7
- package/lib/node/USE_CLIENT_BUNDLE-63c7fe77.js +61 -0
- package/lib/node/USE_CLIENT_BUNDLE-d9e90ed7.mjs +747 -0
- package/lib/node/USE_SERVER_BUNDLE-22e86776.mjs +11 -0
- package/lib/{browser/USE_SERVER_BUNDLE-d8c698c8.js → node/USE_SERVER_BUNDLE-cd844269.js} +1 -1
- package/lib/node/{bundle-3b073b16.mjs → bundle-0358b224.mjs} +415 -444
- package/lib/node/bundle-630ffe6d.js +76 -0
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +23 -22
- package/package.json +5 -3
- package/types/blocks/image/image.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/lib/browser/USE_CLIENT_BUNDLE-3a41b1ba.js +0 -23
- package/lib/browser/USE_CLIENT_BUNDLE-fc8c1bc0.mjs +0 -618
- package/lib/browser/USE_SERVER_BUNDLE-226a15ac.mjs +0 -11
- package/lib/edge/USE_CLIENT_BUNDLE-0e9f8e67.mjs +0 -618
- package/lib/edge/USE_CLIENT_BUNDLE-d48583e8.js +0 -23
- package/lib/edge/USE_SERVER_BUNDLE-f6a1e321.mjs +0 -11
- package/lib/node/USE_CLIENT_BUNDLE-3a41b1ba.js +0 -23
- package/lib/node/USE_CLIENT_BUNDLE-fc8c1bc0.mjs +0 -618
- package/lib/node/USE_SERVER_BUNDLE-226a15ac.mjs +0 -11
- package/lib/node/bundle-0fae602b.js +0 -76
|
@@ -1,618 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as E, Fragment as m, jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import { g as T, a as N, i as R, b as w, c as J, l as O, d as P, r as G, s as Q, e as X, _ as W, f as _, h as A, j as Y, k as Z, m as $ } from "./bundle-ed178c62.mjs";
|
|
4
|
-
import { useRef as j, useState as v, useEffect as k, createContext as p } from "react";
|
|
5
|
-
import { p as ee } from "./USE_SERVER_BUNDLE-f6a1e321.mjs";
|
|
6
|
-
import { useRouter as te } from "next/navigation";
|
|
7
|
-
function re(e) {
|
|
8
|
-
return /* @__PURE__ */ E(m, { children: [
|
|
9
|
-
e.link ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
|
|
10
|
-
"a",
|
|
11
|
-
{
|
|
12
|
-
role: "button",
|
|
13
|
-
...e.attributes,
|
|
14
|
-
href: e.link,
|
|
15
|
-
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
16
|
-
children: e.text
|
|
17
|
-
}
|
|
18
|
-
) }) : /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
|
|
19
|
-
"button",
|
|
20
|
-
{
|
|
21
|
-
...e.attributes,
|
|
22
|
-
style: e.attributes.style,
|
|
23
|
-
className: e.attributes.className + " button-3e7bc8b2",
|
|
24
|
-
children: e.text
|
|
25
|
-
}
|
|
26
|
-
) }),
|
|
27
|
-
/* @__PURE__ */ n("style", { children: `.button-3e7bc8b2 {
|
|
28
|
-
all: unset;
|
|
29
|
-
}` })
|
|
30
|
-
] });
|
|
31
|
-
}
|
|
32
|
-
function de(e) {
|
|
33
|
-
return /* @__PURE__ */ n(
|
|
34
|
-
e.Wrapper,
|
|
35
|
-
{
|
|
36
|
-
...e.wrapperProps,
|
|
37
|
-
attributes: {
|
|
38
|
-
...T({
|
|
39
|
-
block: e.block,
|
|
40
|
-
context: e.context
|
|
41
|
-
}),
|
|
42
|
-
...N({
|
|
43
|
-
block: e.block,
|
|
44
|
-
rootState: e.context.rootState,
|
|
45
|
-
rootSetState: e.context.rootSetState,
|
|
46
|
-
localState: e.context.localState,
|
|
47
|
-
context: e.context.context
|
|
48
|
-
})
|
|
49
|
-
},
|
|
50
|
-
children: e.children
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
function se(e) {
|
|
55
|
-
return /* @__PURE__ */ E(m, { children: [
|
|
56
|
-
" ",
|
|
57
|
-
e.hasChildren ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ E(
|
|
58
|
-
e.Wrapper,
|
|
59
|
-
{
|
|
60
|
-
...T({
|
|
61
|
-
block: e.block,
|
|
62
|
-
context: e.context
|
|
63
|
-
}),
|
|
64
|
-
...N({
|
|
65
|
-
block: e.block,
|
|
66
|
-
rootState: e.context.rootState,
|
|
67
|
-
rootSetState: e.context.rootSetState,
|
|
68
|
-
localState: e.context.localState,
|
|
69
|
-
context: e.context.context,
|
|
70
|
-
stripPrefix: !0
|
|
71
|
-
}),
|
|
72
|
-
children: [
|
|
73
|
-
" ",
|
|
74
|
-
e.children,
|
|
75
|
-
" "
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
) }) : /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
|
|
79
|
-
e.Wrapper,
|
|
80
|
-
{
|
|
81
|
-
...T({
|
|
82
|
-
block: e.block,
|
|
83
|
-
context: e.context
|
|
84
|
-
}),
|
|
85
|
-
...N({
|
|
86
|
-
block: e.block,
|
|
87
|
-
rootState: e.context.rootState,
|
|
88
|
-
rootSetState: e.context.rootSetState,
|
|
89
|
-
localState: e.context.localState,
|
|
90
|
-
context: e.context.context,
|
|
91
|
-
stripPrefix: !0
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
) }),
|
|
95
|
-
" "
|
|
96
|
-
] });
|
|
97
|
-
}
|
|
98
|
-
function ue(e) {
|
|
99
|
-
function a() {
|
|
100
|
-
var c;
|
|
101
|
-
return "builder-blocks" + ((c = e.blocks) != null && c.length ? "" : " no-blocks");
|
|
102
|
-
}
|
|
103
|
-
function s() {
|
|
104
|
-
var c, g;
|
|
105
|
-
R() && !((c = e.blocks) != null && c.length) && ((g = window.parent) == null || g.postMessage(
|
|
106
|
-
{
|
|
107
|
-
type: "builder.clickEmptyBlocks",
|
|
108
|
-
data: {
|
|
109
|
-
parentElementId: e.parent,
|
|
110
|
-
dataPath: e.path
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"*"
|
|
114
|
-
));
|
|
115
|
-
}
|
|
116
|
-
function f() {
|
|
117
|
-
var c, g;
|
|
118
|
-
R() && !((c = e.blocks) != null && c.length) && ((g = window.parent) == null || g.postMessage(
|
|
119
|
-
{
|
|
120
|
-
type: "builder.hoverEmptyBlocks",
|
|
121
|
-
data: {
|
|
122
|
-
parentElementId: e.parent,
|
|
123
|
-
dataPath: e.path
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"*"
|
|
127
|
-
));
|
|
128
|
-
}
|
|
129
|
-
return /* @__PURE__ */ E(m, { children: [
|
|
130
|
-
/* @__PURE__ */ n(
|
|
131
|
-
"div",
|
|
132
|
-
{
|
|
133
|
-
className: a() + " div-5821bd52",
|
|
134
|
-
"builder-path": e.path,
|
|
135
|
-
"builder-parent-id": e.parent,
|
|
136
|
-
style: e.styleProp,
|
|
137
|
-
onClick: (c) => s(),
|
|
138
|
-
onMouseEnter: (c) => f(),
|
|
139
|
-
onKeyPress: (c) => s(),
|
|
140
|
-
children: e.children
|
|
141
|
-
}
|
|
142
|
-
),
|
|
143
|
-
/* @__PURE__ */ n("style", { children: `.div-5821bd52 {
|
|
144
|
-
display: flex;
|
|
145
|
-
flex-direction: column;
|
|
146
|
-
align-items: stretch;
|
|
147
|
-
}` })
|
|
148
|
-
] });
|
|
149
|
-
}
|
|
150
|
-
function me(e) {
|
|
151
|
-
return /* @__PURE__ */ n("span", { children: e.children });
|
|
152
|
-
}
|
|
153
|
-
function be(e) {
|
|
154
|
-
var c, g, y, h;
|
|
155
|
-
function a() {
|
|
156
|
-
var b;
|
|
157
|
-
const o = e.image || e.src;
|
|
158
|
-
if (!o || // We can auto add srcset for cdn.builder.io and shopify
|
|
159
|
-
// images, otherwise you can supply this prop manually
|
|
160
|
-
!(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
|
|
161
|
-
return e.srcset;
|
|
162
|
-
if (e.srcset && ((b = e.image) != null && b.includes("builder.io/api/v1/image"))) {
|
|
163
|
-
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
164
|
-
return console.debug("Removed given srcset"), w(o);
|
|
165
|
-
} else if (e.image && !e.srcset)
|
|
166
|
-
return w(o);
|
|
167
|
-
return w(o);
|
|
168
|
-
}
|
|
169
|
-
function s() {
|
|
170
|
-
var u;
|
|
171
|
-
return (u = a == null ? void 0 : a()) != null && u.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
|
|
172
|
-
}
|
|
173
|
-
function f() {
|
|
174
|
-
const u = {
|
|
175
|
-
position: "absolute",
|
|
176
|
-
height: "100%",
|
|
177
|
-
width: "100%",
|
|
178
|
-
left: "0px",
|
|
179
|
-
top: "0px"
|
|
180
|
-
};
|
|
181
|
-
return e.aspectRatio ? u : void 0;
|
|
182
|
-
}
|
|
183
|
-
return /* @__PURE__ */ E(m, { children: [
|
|
184
|
-
/* @__PURE__ */ E(m, { children: [
|
|
185
|
-
/* @__PURE__ */ E("picture", { children: [
|
|
186
|
-
s() ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n("source", { type: "image/webp", srcSet: s() }) }) : null,
|
|
187
|
-
/* @__PURE__ */ n(
|
|
188
|
-
"img",
|
|
189
|
-
{
|
|
190
|
-
loading: "lazy",
|
|
191
|
-
alt: e.altText,
|
|
192
|
-
role: e.altText ? "presentation" : void 0,
|
|
193
|
-
style: {
|
|
194
|
-
objectPosition: e.backgroundPosition || "center",
|
|
195
|
-
objectFit: e.backgroundSize || "cover",
|
|
196
|
-
...f()
|
|
197
|
-
},
|
|
198
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-ef11a6be",
|
|
199
|
-
src: e.image,
|
|
200
|
-
srcSet: a(),
|
|
201
|
-
sizes: e.sizes
|
|
202
|
-
}
|
|
203
|
-
)
|
|
204
|
-
] }),
|
|
205
|
-
e.aspectRatio && !((g = (c = e.builderBlock) == null ? void 0 : c.children) != null && g.length && e.fitContent) ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
|
|
206
|
-
"div",
|
|
207
|
-
{
|
|
208
|
-
className: "builder-image-sizer div-ef11a6be",
|
|
209
|
-
style: {
|
|
210
|
-
paddingTop: e.aspectRatio * 100 + "%"
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
) }) : null,
|
|
214
|
-
(h = (y = e.builderBlock) == null ? void 0 : y.children) != null && h.length && e.fitContent ? /* @__PURE__ */ n(m, { children: e.children }) : null,
|
|
215
|
-
!e.fitContent && e.children ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n("div", { className: "div-ef11a6be-2", children: e.children }) }) : null
|
|
216
|
-
] }),
|
|
217
|
-
/* @__PURE__ */ n("style", { children: `.img-ef11a6be {
|
|
218
|
-
opacity: 1;
|
|
219
|
-
transition: opacity 0.2s ease-in-out;
|
|
220
|
-
}.div-ef11a6be {
|
|
221
|
-
width: 100%;
|
|
222
|
-
pointer-events: none;
|
|
223
|
-
font-size: 0;
|
|
224
|
-
}.div-ef11a6be-2 {
|
|
225
|
-
display: flex;
|
|
226
|
-
flex-direction: column;
|
|
227
|
-
align-items: stretch;
|
|
228
|
-
position: absolute;
|
|
229
|
-
top: 0;
|
|
230
|
-
left: 0;
|
|
231
|
-
width: 100%;
|
|
232
|
-
height: 100%;
|
|
233
|
-
}` })
|
|
234
|
-
] });
|
|
235
|
-
}
|
|
236
|
-
function fe(e) {
|
|
237
|
-
return /* @__PURE__ */ n(
|
|
238
|
-
"section",
|
|
239
|
-
{
|
|
240
|
-
...e.attributes,
|
|
241
|
-
style: {
|
|
242
|
-
width: "100%",
|
|
243
|
-
alignSelf: "stretch",
|
|
244
|
-
flexGrow: 1,
|
|
245
|
-
boxSizing: "border-box",
|
|
246
|
-
maxWidth: e.maxWidth || 1200,
|
|
247
|
-
display: "flex",
|
|
248
|
-
flexDirection: "column",
|
|
249
|
-
alignItems: "stretch",
|
|
250
|
-
marginLeft: "auto",
|
|
251
|
-
marginRight: "auto"
|
|
252
|
-
},
|
|
253
|
-
children: e.children
|
|
254
|
-
}
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
function ge(e) {
|
|
258
|
-
var f;
|
|
259
|
-
function a() {
|
|
260
|
-
return {
|
|
261
|
-
...e.autoPlay === !0 ? {
|
|
262
|
-
autoPlay: !0
|
|
263
|
-
} : {},
|
|
264
|
-
...e.muted === !0 ? {
|
|
265
|
-
muted: !0
|
|
266
|
-
} : {},
|
|
267
|
-
...e.controls === !0 ? {
|
|
268
|
-
controls: !0
|
|
269
|
-
} : {},
|
|
270
|
-
...e.loop === !0 ? {
|
|
271
|
-
loop: !0
|
|
272
|
-
} : {},
|
|
273
|
-
...e.playsInline === !0 ? {
|
|
274
|
-
playsInline: !0
|
|
275
|
-
} : {}
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
function s() {
|
|
279
|
-
return {
|
|
280
|
-
...e.attributes,
|
|
281
|
-
...a()
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
return /* @__PURE__ */ n(
|
|
285
|
-
"video",
|
|
286
|
-
{
|
|
287
|
-
...s(),
|
|
288
|
-
preload: e.preload || "metadata",
|
|
289
|
-
style: {
|
|
290
|
-
width: "100%",
|
|
291
|
-
height: "100%",
|
|
292
|
-
...(f = e.attributes) == null ? void 0 : f.style,
|
|
293
|
-
objectFit: e.fit,
|
|
294
|
-
objectPosition: e.position,
|
|
295
|
-
// Hack to get object fit to work as expected and
|
|
296
|
-
// not have the video overflow
|
|
297
|
-
borderRadius: 1
|
|
298
|
-
},
|
|
299
|
-
src: e.video || "no-src",
|
|
300
|
-
poster: e.posterImage
|
|
301
|
-
}
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
function he(e) {
|
|
305
|
-
const a = j(null), [s, f] = v(() => []), [c, g] = v(() => []), [y, h] = v(() => !1);
|
|
306
|
-
function u() {
|
|
307
|
-
if (!a.current || !a.current.getElementsByTagName)
|
|
308
|
-
return;
|
|
309
|
-
const o = a.current.getElementsByTagName("script");
|
|
310
|
-
for (let b = 0; b < o.length; b++) {
|
|
311
|
-
const x = o[b];
|
|
312
|
-
if (x.src && !s.includes(x.src)) {
|
|
313
|
-
s.push(x.src);
|
|
314
|
-
const C = document.createElement("script");
|
|
315
|
-
C.async = !0, C.src = x.src, document.head.appendChild(C);
|
|
316
|
-
} else if (J(x) && !c.includes(x.innerText))
|
|
317
|
-
try {
|
|
318
|
-
c.push(x.innerText), new Function(x.innerText)();
|
|
319
|
-
} catch (C) {
|
|
320
|
-
console.warn("`Embed`: Error running script:", C);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
return k(() => {
|
|
325
|
-
a.current && !y && (h(!0), u());
|
|
326
|
-
}, [a.current, y]), /* @__PURE__ */ n(
|
|
327
|
-
"div",
|
|
328
|
-
{
|
|
329
|
-
className: "builder-embed",
|
|
330
|
-
ref: a,
|
|
331
|
-
dangerouslySetInnerHTML: { __html: e.content }
|
|
332
|
-
}
|
|
333
|
-
);
|
|
334
|
-
}
|
|
335
|
-
function Se(e) {
|
|
336
|
-
return /* @__PURE__ */ n(
|
|
337
|
-
"img",
|
|
338
|
-
{
|
|
339
|
-
style: {
|
|
340
|
-
objectFit: e.backgroundSize || "cover",
|
|
341
|
-
objectPosition: e.backgroundPosition || "center"
|
|
342
|
-
},
|
|
343
|
-
alt: e.altText,
|
|
344
|
-
src: e.imgSrc || e.image,
|
|
345
|
-
...e.attributes
|
|
346
|
-
},
|
|
347
|
-
R() && e.imgSrc || "default-key"
|
|
348
|
-
);
|
|
349
|
-
}
|
|
350
|
-
function xe(e) {
|
|
351
|
-
const a = j(null), [s, f] = v(() => []), [c, g] = v(() => []);
|
|
352
|
-
function y() {
|
|
353
|
-
if (a.current && a.current.getElementsByTagName && typeof window < "u") {
|
|
354
|
-
const h = a.current.getElementsByTagName("script");
|
|
355
|
-
for (let u = 0; u < h.length; u++) {
|
|
356
|
-
const o = h[u];
|
|
357
|
-
if (o.src) {
|
|
358
|
-
if (s.includes(o.src))
|
|
359
|
-
continue;
|
|
360
|
-
s.push(o.src);
|
|
361
|
-
const b = document.createElement("script");
|
|
362
|
-
b.async = !0, b.src = o.src, document.head.appendChild(b);
|
|
363
|
-
} else if (!o.type || [
|
|
364
|
-
"text/javascript",
|
|
365
|
-
"application/javascript",
|
|
366
|
-
"application/ecmascript"
|
|
367
|
-
].includes(o.type)) {
|
|
368
|
-
if (c.includes(o.innerText))
|
|
369
|
-
continue;
|
|
370
|
-
try {
|
|
371
|
-
c.push(o.innerText), new Function(o.innerText)();
|
|
372
|
-
} catch (b) {
|
|
373
|
-
console.warn("`CustomCode`: Error running script:", b);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
return k(() => {
|
|
380
|
-
y();
|
|
381
|
-
}, []), /* @__PURE__ */ n(
|
|
382
|
-
"div",
|
|
383
|
-
{
|
|
384
|
-
ref: a,
|
|
385
|
-
className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
|
|
386
|
-
dangerouslySetInnerHTML: { __html: e.code }
|
|
387
|
-
}
|
|
388
|
-
);
|
|
389
|
-
}
|
|
390
|
-
const ne = p({
|
|
391
|
-
content: null,
|
|
392
|
-
context: {},
|
|
393
|
-
localState: void 0,
|
|
394
|
-
rootSetState() {
|
|
395
|
-
},
|
|
396
|
-
rootState: {},
|
|
397
|
-
apiKey: null,
|
|
398
|
-
apiVersion: void 0,
|
|
399
|
-
componentInfos: {},
|
|
400
|
-
inheritedStyles: {}
|
|
401
|
-
});
|
|
402
|
-
function ve(e) {
|
|
403
|
-
var F, L, M, q, z;
|
|
404
|
-
const a = j(null), [s, f] = v(() => 0);
|
|
405
|
-
function c(t) {
|
|
406
|
-
var i, r, d, S, K;
|
|
407
|
-
const l = {
|
|
408
|
-
...e.builderContextSignal.content,
|
|
409
|
-
...t,
|
|
410
|
-
data: {
|
|
411
|
-
...(i = e.builderContextSignal.content) == null ? void 0 : i.data,
|
|
412
|
-
...t == null ? void 0 : t.data
|
|
413
|
-
},
|
|
414
|
-
meta: {
|
|
415
|
-
...(r = e.builderContextSignal.content) == null ? void 0 : r.meta,
|
|
416
|
-
...t == null ? void 0 : t.meta,
|
|
417
|
-
breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((K = (S = e.builderContextSignal.content) == null ? void 0 : S.meta) == null ? void 0 : K.breakpoints)
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
ee({
|
|
421
|
-
value: l,
|
|
422
|
-
key: l.id
|
|
423
|
-
}).then(() => {
|
|
424
|
-
U.refresh();
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
v(() => 0);
|
|
428
|
-
const [g, y] = v(
|
|
429
|
-
() => !1
|
|
430
|
-
);
|
|
431
|
-
function h(t) {
|
|
432
|
-
var i;
|
|
433
|
-
const { data: l } = t;
|
|
434
|
-
if (l)
|
|
435
|
-
switch (l.type) {
|
|
436
|
-
case "builder.configureSdk": {
|
|
437
|
-
const r = l.data, { breakpoints: d, contentId: S } = r;
|
|
438
|
-
if (!S || S !== ((i = e.builderContextSignal.content) == null ? void 0 : i.id))
|
|
439
|
-
return;
|
|
440
|
-
d && c({
|
|
441
|
-
meta: {
|
|
442
|
-
breakpoints: d
|
|
443
|
-
}
|
|
444
|
-
}), f(s + 1);
|
|
445
|
-
break;
|
|
446
|
-
}
|
|
447
|
-
case "builder.contentUpdate": {
|
|
448
|
-
const r = l.data, d = r.key || r.alias || r.entry || r.modelName, S = r.data;
|
|
449
|
-
d === e.model && (c(S), f(s + 1));
|
|
450
|
-
break;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
function u() {
|
|
455
|
-
var l, i;
|
|
456
|
-
const t = (i = (l = e.builderContextSignal.content) == null ? void 0 : l.data) == null ? void 0 : i.jsCode;
|
|
457
|
-
t && A({
|
|
458
|
-
code: t,
|
|
459
|
-
context: e.context || {},
|
|
460
|
-
localState: void 0,
|
|
461
|
-
rootState: e.builderContextSignal.rootState,
|
|
462
|
-
rootSetState: e.builderContextSignal.rootSetState
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
const [o, b] = v(() => ({})), [x, C] = v(() => !1);
|
|
466
|
-
function V(t) {
|
|
467
|
-
var l, i;
|
|
468
|
-
if (e.builderContextSignal.content) {
|
|
469
|
-
const r = (l = e.builderContextSignal.content) == null ? void 0 : l.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
|
|
470
|
-
W({
|
|
471
|
-
type: "click",
|
|
472
|
-
canTrack: _(e.canTrack),
|
|
473
|
-
contentId: d,
|
|
474
|
-
apiKey: e.apiKey,
|
|
475
|
-
variationId: r !== d ? r : void 0,
|
|
476
|
-
...Y(t),
|
|
477
|
-
unique: !x
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
x || C(!0);
|
|
481
|
-
}
|
|
482
|
-
function D(t) {
|
|
483
|
-
return t.replace(
|
|
484
|
-
/{{([^}]+)}}/g,
|
|
485
|
-
(l, i) => A({
|
|
486
|
-
code: i,
|
|
487
|
-
context: e.context || {},
|
|
488
|
-
localState: void 0,
|
|
489
|
-
rootState: e.builderContextSignal.rootState,
|
|
490
|
-
rootSetState: e.builderContextSignal.rootSetState
|
|
491
|
-
})
|
|
492
|
-
);
|
|
493
|
-
}
|
|
494
|
-
function H({ url: t, key: l }) {
|
|
495
|
-
$(t).then((i) => i.json()).then((i) => {
|
|
496
|
-
var d, S;
|
|
497
|
-
const r = {
|
|
498
|
-
...e.builderContextSignal.rootState,
|
|
499
|
-
[l]: i
|
|
500
|
-
};
|
|
501
|
-
(S = (d = e.builderContextSignal).rootSetState) == null || S.call(d, r), o[l] = !0;
|
|
502
|
-
}).catch((i) => {
|
|
503
|
-
console.error("error fetching dynamic data", t, i);
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
function B() {
|
|
507
|
-
var l, i;
|
|
508
|
-
const t = ((i = (l = e.builderContextSignal.content) == null ? void 0 : l.data) == null ? void 0 : i.httpRequests) ?? {};
|
|
509
|
-
Object.entries(t).forEach(([r, d]) => {
|
|
510
|
-
if (d && (!o[r] || R())) {
|
|
511
|
-
const S = D(d);
|
|
512
|
-
H({
|
|
513
|
-
url: S,
|
|
514
|
-
key: r
|
|
515
|
-
});
|
|
516
|
-
}
|
|
517
|
-
});
|
|
518
|
-
}
|
|
519
|
-
function I() {
|
|
520
|
-
R() && window.dispatchEvent(
|
|
521
|
-
new CustomEvent(
|
|
522
|
-
"builder:component:stateChange",
|
|
523
|
-
{
|
|
524
|
-
detail: {
|
|
525
|
-
state: Z(e.builderContextSignal.rootState),
|
|
526
|
-
ref: {
|
|
527
|
-
name: e.model
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
)
|
|
532
|
-
);
|
|
533
|
-
}
|
|
534
|
-
const U = te();
|
|
535
|
-
return k(() => {
|
|
536
|
-
var t, l;
|
|
537
|
-
if (e.apiKey || O.error(
|
|
538
|
-
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
539
|
-
), P()) {
|
|
540
|
-
if (R() && (f(s + 1), window.addEventListener("message", h), G(), Q({
|
|
541
|
-
...e.locale ? {
|
|
542
|
-
locale: e.locale
|
|
543
|
-
} : {},
|
|
544
|
-
...e.includeRefs ? {
|
|
545
|
-
includeRefs: e.includeRefs
|
|
546
|
-
} : {},
|
|
547
|
-
...e.enrich ? {
|
|
548
|
-
enrich: e.enrich
|
|
549
|
-
} : {}
|
|
550
|
-
}), Object.values(
|
|
551
|
-
e.builderContextSignal.componentInfos
|
|
552
|
-
).forEach((i) => {
|
|
553
|
-
var d;
|
|
554
|
-
const r = X(i);
|
|
555
|
-
(d = window.parent) == null || d.postMessage(r, "*");
|
|
556
|
-
}), window.addEventListener(
|
|
557
|
-
"builder:component:stateChangeListenerActivated",
|
|
558
|
-
I
|
|
559
|
-
)), e.builderContextSignal.content) {
|
|
560
|
-
const i = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, r = (l = e.builderContextSignal.content) == null ? void 0 : l.id;
|
|
561
|
-
W({
|
|
562
|
-
type: "impression",
|
|
563
|
-
canTrack: _(e.canTrack),
|
|
564
|
-
contentId: r,
|
|
565
|
-
apiKey: e.apiKey,
|
|
566
|
-
variationId: i !== r ? i : void 0
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
u(), B(), I();
|
|
570
|
-
}
|
|
571
|
-
}, []), k(() => {
|
|
572
|
-
}, [e.content]), k(() => {
|
|
573
|
-
P() && (window.removeEventListener("message", h), window.addEventListener("message", h));
|
|
574
|
-
}, [g]), k(() => {
|
|
575
|
-
u();
|
|
576
|
-
}, [
|
|
577
|
-
(L = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : L.jsCode,
|
|
578
|
-
e.builderContextSignal.rootState
|
|
579
|
-
]), k(() => {
|
|
580
|
-
B();
|
|
581
|
-
}, [(q = (M = e.builderContextSignal.content) == null ? void 0 : M.data) == null ? void 0 : q.httpRequests]), k(() => {
|
|
582
|
-
I();
|
|
583
|
-
}, [e.builderContextSignal.rootState]), k(() => () => {
|
|
584
|
-
P() && (window.removeEventListener("message", h), window.removeEventListener(
|
|
585
|
-
"builder:component:stateChangeListenerActivated",
|
|
586
|
-
I
|
|
587
|
-
));
|
|
588
|
-
}, []), /* @__PURE__ */ n(ne.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ n(m, { children: /* @__PURE__ */ n(
|
|
589
|
-
"div",
|
|
590
|
-
{
|
|
591
|
-
ref: a,
|
|
592
|
-
onClick: (t) => V(t),
|
|
593
|
-
"builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
|
|
594
|
-
"builder-model": e.model,
|
|
595
|
-
...e.showContent ? {} : {
|
|
596
|
-
hidden: !0,
|
|
597
|
-
"aria-hidden": !0
|
|
598
|
-
},
|
|
599
|
-
className: e.classNameProp,
|
|
600
|
-
children: e.children
|
|
601
|
-
},
|
|
602
|
-
s
|
|
603
|
-
) }) : null });
|
|
604
|
-
}
|
|
605
|
-
export {
|
|
606
|
-
se as B,
|
|
607
|
-
xe as C,
|
|
608
|
-
he as E,
|
|
609
|
-
me as F,
|
|
610
|
-
de as I,
|
|
611
|
-
fe as S,
|
|
612
|
-
ge as V,
|
|
613
|
-
ue as a,
|
|
614
|
-
re as b,
|
|
615
|
-
be as c,
|
|
616
|
-
Se as d,
|
|
617
|
-
ve as e
|
|
618
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./bundle-0c1d9099.js"),d=require("react"),L=require("./USE_SERVER_BUNDLE-105e9ef3.js"),M=require("next/navigation");function W(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{role:"button",...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-3e7bc8b2",children:e.text})}),t.jsx("style",{children:`.button-3e7bc8b2 {
|
|
2
|
-
all: unset;
|
|
3
|
-
}`})]})}function _(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})},children:e.children})}function A(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function z(e){function c(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,x;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((x=window.parent)==null||x.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function b(){var o,x;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((x=window.parent)==null||x.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:c()+" div-5821bd52","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>b(),onKeyPress:o=>g(),children:e.children}),t.jsx("style",{children:`.div-5821bd52 {
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
align-items: stretch;
|
|
7
|
-
}`})]})}function K(e){return t.jsx("span",{children:e.children})}function D(e){var o,x,k,S;function c(){var f;const r=e.image||e.src;if(!r||!(r.match(/builder\.io/)||r.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),n.getSrcSet(r)}else if(e.image&&!e.srcset)return n.getSrcSet(r);return n.getSrcSet(r)}function g(){var m;return(m=c==null?void 0:c())!=null&&m.match(/builder\.io/)&&!e.noWebp?c().replace(/\?/g,"?format=webp&"):""}function b(){const m={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?m:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[g()?t.jsx(t.Fragment,{children:t.jsx("source",{type:"image/webp",srcSet:g()})}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...b()},className:"builder-image"+(e.className?" "+e.className:"")+" img-ef11a6be",src:e.image,srcSet:c(),sizes:e.sizes})]}),e.aspectRatio&&!((x=(o=e.builderBlock)==null?void 0:o.children)!=null&&x.length&&e.fitContent)?t.jsx(t.Fragment,{children:t.jsx("div",{className:"builder-image-sizer div-ef11a6be",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(S=(k=e.builderBlock)==null?void 0:k.children)!=null&&S.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx(t.Fragment,{children:t.jsx("div",{className:"div-ef11a6be-2",children:e.children})}):null]}),t.jsx("style",{children:`.img-ef11a6be {
|
|
8
|
-
opacity: 1;
|
|
9
|
-
transition: opacity 0.2s ease-in-out;
|
|
10
|
-
}.div-ef11a6be {
|
|
11
|
-
width: 100%;
|
|
12
|
-
pointer-events: none;
|
|
13
|
-
font-size: 0;
|
|
14
|
-
}.div-ef11a6be-2 {
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
align-items: stretch;
|
|
18
|
-
position: absolute;
|
|
19
|
-
top: 0;
|
|
20
|
-
left: 0;
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 100%;
|
|
23
|
-
}`})]})}function V(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function U(e){var b;function c(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function g(){return{...e.attributes,...c()}}return t.jsx("video",{...g(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(b=e.attributes)==null?void 0:b.style,objectFit:e.fit,objectPosition:e.position,borderRadius:1},src:e.video||"no-src",poster:e.posterImage})}function H(e){const c=d.useRef(null),[g,b]=d.useState(()=>[]),[o,x]=d.useState(()=>[]),[k,S]=d.useState(()=>!1);function m(){if(!c.current||!c.current.getElementsByTagName)return;const r=c.current.getElementsByTagName("script");for(let f=0;f<r.length;f++){const v=r[f];if(v.src&&!g.includes(v.src)){g.push(v.src);const C=document.createElement("script");C.async=!0,C.src=v.src,document.head.appendChild(C)}else if(n.isJsScript(v)&&!o.includes(v.innerText))try{o.push(v.innerText),new Function(v.innerText)()}catch(C){console.warn("`Embed`: Error running script:",C)}}}return d.useEffect(()=>{c.current&&!k&&(S(!0),m())},[c.current,k]),t.jsx("div",{className:"builder-embed",ref:c,dangerouslySetInnerHTML:{__html:e.content}})}function J(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},n.isEditing()&&e.imgSrc||"default-key")}function O(e){const c=d.useRef(null),[g,b]=d.useState(()=>[]),[o,x]=d.useState(()=>[]);function k(){if(c.current&&c.current.getElementsByTagName&&typeof window<"u"){const S=c.current.getElementsByTagName("script");for(let m=0;m<S.length;m++){const r=S[m];if(r.src){if(g.includes(r.src))continue;g.push(r.src);const f=document.createElement("script");f.async=!0,f.src=r.src,document.head.appendChild(f)}else if(!r.type||["text/javascript","application/javascript","application/ecmascript"].includes(r.type)){if(o.includes(r.innerText))continue;try{o.push(r.innerText),new Function(r.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}}}return d.useEffect(()=>{k()},[]),t.jsx("div",{ref:c,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const G=d.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}});function Q(e){var j,R,I,w,F;const c=d.useRef(null),[g,b]=d.useState(()=>0);function o(i){var a,s,u,h,P;const l={...e.builderContextSignal.content,...i,data:{...(a=e.builderContextSignal.content)==null?void 0:a.data,...i==null?void 0:i.data},meta:{...(s=e.builderContextSignal.content)==null?void 0:s.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((P=(h=e.builderContextSignal.content)==null?void 0:h.meta)==null?void 0:P.breakpoints)}};L.postPreviewContent({value:l,key:l.id}).then(()=>{q.refresh()})}d.useState(()=>0);const[x,k]=d.useState(()=>!1);function S(i){var a;const{data:l}=i;if(l)switch(l.type){case"builder.configureSdk":{const s=l.data,{breakpoints:u,contentId:h}=s;if(!h||h!==((a=e.builderContextSignal.content)==null?void 0:a.id))return;u&&o({meta:{breakpoints:u}}),b(g+1);break}case"builder.contentUpdate":{const s=l.data,u=s.key||s.alias||s.entry||s.modelName,h=s.data;u===e.model&&(o(h),b(g+1));break}}}function m(){var l,a;const i=(a=(l=e.builderContextSignal.content)==null?void 0:l.data)==null?void 0:a.jsCode;i&&n.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[r,f]=d.useState(()=>({})),[v,C]=d.useState(()=>!1);function B(i){var l,a;if(e.builderContextSignal.content){const s=(l=e.builderContextSignal.content)==null?void 0:l.testVariationId,u=(a=e.builderContextSignal.content)==null?void 0:a.id;n._track({type:"click",canTrack:n.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:s!==u?s:void 0,...n.getInteractionPropertiesForEvent(i),unique:!v})}v||C(!0)}function T(i){return i.replace(/{{([^}]+)}}/g,(l,a)=>n.evaluate({code:a,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function N({url:i,key:l}){n.fetch(i).then(a=>a.json()).then(a=>{var u,h;const s={...e.builderContextSignal.rootState,[l]:a};(h=(u=e.builderContextSignal).rootSetState)==null||h.call(u,s),r[l]=!0}).catch(a=>{console.error("error fetching dynamic data",i,a)})}function E(){var l,a;const i=((a=(l=e.builderContextSignal.content)==null?void 0:l.data)==null?void 0:a.httpRequests)??{};Object.entries(i).forEach(([s,u])=>{if(u&&(!r[s]||n.isEditing())){const h=T(u);N({url:h,key:s})}})}function y(){n.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:n.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const q=M.useRouter();return d.useEffect(()=>{var i,l;if(e.apiKey||n.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),n.isBrowser()){if(n.isEditing()&&(b(g+1),window.addEventListener("message",S),n.registerInsertMenu(),n.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(a=>{var u;const s=n.createRegisterComponentMessage(a);(u=window.parent)==null||u.postMessage(s,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",y)),e.builderContextSignal.content){const a=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,s=(l=e.builderContextSignal.content)==null?void 0:l.id;n._track({type:"impression",canTrack:n.getDefaultCanTrack(e.canTrack),contentId:s,apiKey:e.apiKey,variationId:a!==s?a:void 0})}m(),E(),y()}},[]),d.useEffect(()=>{},[e.content]),d.useEffect(()=>{n.isBrowser()&&(window.removeEventListener("message",S),window.addEventListener("message",S))},[x]),d.useEffect(()=>{m()},[(R=(j=e.builderContextSignal.content)==null?void 0:j.data)==null?void 0:R.jsCode,e.builderContextSignal.rootState]),d.useEffect(()=>{E()},[(w=(I=e.builderContextSignal.content)==null?void 0:I.data)==null?void 0:w.httpRequests]),d.useEffect(()=>{y()},[e.builderContextSignal.rootState]),d.useEffect(()=>()=>{n.isBrowser()&&(window.removeEventListener("message",S),window.removeEventListener("builder:component:stateChangeListenerActivated",y))},[]),t.jsx(G.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(t.Fragment,{children:t.jsx("div",{ref:c,onClick:i=>B(i),"builder-content-id":(F=e.builderContextSignal.content)==null?void 0:F.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},className:e.classNameProp,children:e.children},g)}):null})}exports.BlockWrapper=A;exports.BlocksWrapper=z;exports.Button=W;exports.CustomCode=O;exports.Embed=H;exports.EnableEditor=Q;exports.FragmentComponent=K;exports.Image=D;exports.ImgComponent=J;exports.InteractiveElement=_;exports.SectionComponent=V;exports.Video=U;
|