@builder.io/sdk-react-nextjs 0.12.2 → 0.12.4
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-d30db795.js → browser/USE_CLIENT_BUNDLE-e6d429be.js} +212 -215
- package/lib/browser/{USE_CLIENT_BUNDLE-4b1b3c99.cjs → USE_CLIENT_BUNDLE-e9e1ee85.cjs} +3 -5
- package/lib/{edge/USE_SERVER_BUNDLE-70c27ea1.js → browser/USE_SERVER_BUNDLE-44c49b1e.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-f0eeb33e.cjs → browser/USE_SERVER_BUNDLE-9bcc0ad4.cjs} +1 -1
- package/lib/browser/bundle-0e5cec1c.cjs +168 -0
- package/lib/browser/{bundle-d905bf70.js → bundle-bab67847.js} +577 -516
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +14 -14
- package/lib/{browser/USE_CLIENT_BUNDLE-550679f9.js → edge/USE_CLIENT_BUNDLE-8d251b8b.js} +212 -215
- package/lib/{node/USE_CLIENT_BUNDLE-def5165a.cjs → edge/USE_CLIENT_BUNDLE-d87c391a.cjs} +3 -5
- package/lib/{node/USE_SERVER_BUNDLE-a5db98bc.cjs → edge/USE_SERVER_BUNDLE-816ab6e4.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-610c83b3.js → edge/USE_SERVER_BUNDLE-c0911af0.js} +1 -1
- package/lib/edge/{bundle-834dbf29.js → bundle-28d9d04c.js} +1022 -961
- package/lib/edge/{bundle-25fa71b1.cjs → bundle-e64fe0fd.cjs} +37 -37
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +14 -14
- package/lib/{edge/USE_CLIENT_BUNDLE-aa38a343.js → node/USE_CLIENT_BUNDLE-75f921e2.js} +212 -215
- package/lib/{edge/USE_CLIENT_BUNDLE-edb18eb8.cjs → node/USE_CLIENT_BUNDLE-ee5a9d6f.cjs} +3 -5
- package/lib/{browser/USE_SERVER_BUNDLE-6234c5ea.cjs → node/USE_SERVER_BUNDLE-793c12c9.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-464dccd7.js → node/USE_SERVER_BUNDLE-86d90afe.js} +1 -1
- package/lib/node/{bundle-1f73ead0.js → bundle-031e3608.js} +352 -291
- package/lib/node/{bundle-4efd9623.cjs → bundle-72df28b3.cjs} +10 -10
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +14 -14
- package/package.json +1 -1
- package/types/cjs/blocks/button/button.types.d.ts +2 -1
- package/types/cjs/blocks/columns/columns.types.d.ts +3 -3
- package/types/cjs/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/cjs/components/block/block.d.ts +1 -0
- package/types/cjs/components/block/components/block-wrapper.d.ts +1 -0
- package/types/cjs/components/block/components/component-ref/component-ref.helpers.d.ts +8 -1
- package/types/cjs/components/block/components/repeated-block.d.ts +3 -5
- package/types/cjs/components/blocks/blocks.types.d.ts +1 -0
- package/types/cjs/components/content-variants/content-variants.types.d.ts +6 -2
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/get-block-properties.d.ts +5 -1
- package/types/cjs/functions/get-class-prop-name.d.ts +1 -0
- package/types/cjs/functions/get-style.d.ts +12 -0
- package/types/cjs/functions/transform-block-properties.d.ts +7 -5
- package/types/cjs/functions/transform-style-property.d.ts +7 -0
- package/types/cjs/types/builder-block.d.ts +1 -0
- package/types/cjs/types/builder-props.d.ts +3 -0
- package/types/esm/blocks/button/button.types.d.ts +2 -1
- package/types/esm/blocks/columns/columns.types.d.ts +3 -3
- package/types/esm/blocks/symbol/symbol.types.d.ts +2 -2
- package/types/esm/components/block/block.d.ts +1 -0
- package/types/esm/components/block/components/block-wrapper.d.ts +1 -0
- package/types/esm/components/block/components/component-ref/component-ref.helpers.d.ts +8 -1
- package/types/esm/components/block/components/repeated-block.d.ts +3 -5
- package/types/esm/components/blocks/blocks.types.d.ts +1 -0
- package/types/esm/components/content-variants/content-variants.types.d.ts +6 -2
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-block-properties.d.ts +5 -1
- package/types/esm/functions/get-class-prop-name.d.ts +1 -0
- package/types/esm/functions/get-style.d.ts +12 -0
- package/types/esm/functions/transform-block-properties.d.ts +7 -5
- package/types/esm/functions/transform-style-property.d.ts +7 -0
- package/types/esm/types/builder-block.d.ts +1 -0
- package/types/esm/types/builder-props.d.ts +3 -0
- package/lib/browser/bundle-1d763be7.cjs +0 -168
|
@@ -1,43 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { i as
|
|
4
|
-
import { useRef as T, useState as x, useEffect as f, createContext as
|
|
5
|
-
import { p as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
e.link ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
10
|
-
"a",
|
|
11
|
-
{
|
|
12
|
-
...e.attributes,
|
|
13
|
-
href: e.link,
|
|
14
|
-
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
15
|
-
role: "button",
|
|
16
|
-
children: e.text
|
|
17
|
-
}
|
|
18
|
-
) }) : /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
|
|
19
|
-
"button",
|
|
20
|
-
{
|
|
21
|
-
...e.attributes,
|
|
22
|
-
style: e.attributes.style,
|
|
23
|
-
className: e.attributes.className + " button-fdf49de0",
|
|
24
|
-
children: e.text
|
|
25
|
-
}
|
|
26
|
-
) }),
|
|
27
|
-
/* @__PURE__ */ t("style", { children: `.button-fdf49de0 {
|
|
28
|
-
all: unset;
|
|
29
|
-
}` })
|
|
30
|
-
] });
|
|
31
|
-
}
|
|
32
|
-
function ge(e) {
|
|
33
|
-
return /* @__PURE__ */ t(s, { children: Y(e.TagName) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ t(s, { children: typeof e.TagName == "string" ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
2
|
+
import { jsx as i, Fragment as h, jsxs as E } from "react/jsx-runtime";
|
|
3
|
+
import { i as p, g as D, a as $, b as O, c as w, d as R, e as ee, f as P, h as H, _ as V, j as te, l as ne, k as ie, m as U, n as ae, o as ce, r as re, s as le, p as oe, q as de, t as se } from "./bundle-28d9d04c.js";
|
|
4
|
+
import { useRef as T, useState as x, useEffect as f, createContext as ue, createElement as me } from "react";
|
|
5
|
+
import { p as ge } from "./USE_SERVER_BUNDLE-c0911af0.js";
|
|
6
|
+
import { useRouter as be } from "next/navigation";
|
|
7
|
+
function J(e) {
|
|
8
|
+
return /* @__PURE__ */ i(h, { children: p(e.TagName) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(h, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
34
9
|
}
|
|
35
10
|
function Ce(e) {
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
11
|
+
return /* @__PURE__ */ i(
|
|
12
|
+
J,
|
|
13
|
+
{
|
|
14
|
+
TagName: e.link ? e.builderLinkComponent || "a" : "button",
|
|
15
|
+
attributes: {
|
|
16
|
+
...e.attributes,
|
|
17
|
+
[D()]: `${e.link ? "" : "builder-button"} ${e.attributes[D()] || ""}`,
|
|
18
|
+
...e.link ? {
|
|
19
|
+
href: e.link,
|
|
20
|
+
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
21
|
+
role: "link"
|
|
22
|
+
} : {
|
|
23
|
+
role: "button"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
actionAttributes: {},
|
|
27
|
+
children: e.text
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function we(e) {
|
|
32
|
+
return /* @__PURE__ */ i(
|
|
33
|
+
J,
|
|
38
34
|
{
|
|
39
35
|
TagName: e.Wrapper,
|
|
40
|
-
attributes:
|
|
36
|
+
attributes: $({
|
|
41
37
|
block: e.block,
|
|
42
38
|
context: e.context
|
|
43
39
|
}),
|
|
@@ -53,13 +49,13 @@ function Ce(e) {
|
|
|
53
49
|
}
|
|
54
50
|
);
|
|
55
51
|
}
|
|
56
|
-
function
|
|
57
|
-
return /* @__PURE__ */
|
|
52
|
+
function Ee(e) {
|
|
53
|
+
return /* @__PURE__ */ i(
|
|
58
54
|
e.Wrapper,
|
|
59
55
|
{
|
|
60
56
|
...e.wrapperProps,
|
|
61
57
|
attributes: e.includeBlockProps ? {
|
|
62
|
-
|
|
58
|
+
...$({
|
|
63
59
|
block: e.block,
|
|
64
60
|
context: e.context
|
|
65
61
|
}),
|
|
@@ -75,14 +71,14 @@ function we(e) {
|
|
|
75
71
|
}
|
|
76
72
|
);
|
|
77
73
|
}
|
|
78
|
-
function
|
|
74
|
+
function Ie(e) {
|
|
79
75
|
function c() {
|
|
80
|
-
var
|
|
81
|
-
return "builder-blocks" + ((
|
|
76
|
+
var l;
|
|
77
|
+
return "builder-blocks" + ((l = e.blocks) != null && l.length ? "" : " no-blocks");
|
|
82
78
|
}
|
|
83
|
-
function
|
|
84
|
-
var
|
|
85
|
-
|
|
79
|
+
function s() {
|
|
80
|
+
var l, u;
|
|
81
|
+
w() && !((l = e.blocks) != null && l.length) && ((u = window.parent) == null || u.postMessage(
|
|
86
82
|
{
|
|
87
83
|
type: "builder.clickEmptyBlocks",
|
|
88
84
|
data: {
|
|
@@ -94,8 +90,8 @@ function Ee(e) {
|
|
|
94
90
|
));
|
|
95
91
|
}
|
|
96
92
|
function v() {
|
|
97
|
-
var
|
|
98
|
-
|
|
93
|
+
var l, u;
|
|
94
|
+
w() && !((l = e.blocks) != null && l.length) && ((u = window.parent) == null || u.postMessage(
|
|
99
95
|
{
|
|
100
96
|
type: "builder.hoverEmptyBlocks",
|
|
101
97
|
data: {
|
|
@@ -106,48 +102,48 @@ function Ee(e) {
|
|
|
106
102
|
"*"
|
|
107
103
|
));
|
|
108
104
|
}
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ E(h, { children: [
|
|
106
|
+
/* @__PURE__ */ i(
|
|
111
107
|
e.BlocksWrapper,
|
|
112
108
|
{
|
|
113
109
|
className: c() + " props-blocks-wrapper-4f2c12d8",
|
|
114
110
|
"builder-path": e.path,
|
|
115
111
|
"builder-parent-id": e.parent,
|
|
116
112
|
style: e.styleProp,
|
|
117
|
-
onClick: (
|
|
118
|
-
onMouseEnter: (
|
|
119
|
-
onKeyPress: (
|
|
113
|
+
onClick: (l) => s(),
|
|
114
|
+
onMouseEnter: (l) => v(),
|
|
115
|
+
onKeyPress: (l) => s(),
|
|
120
116
|
...e.BlocksWrapperProps,
|
|
121
117
|
children: e.children
|
|
122
118
|
}
|
|
123
119
|
),
|
|
124
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-4f2c12d8 {
|
|
125
121
|
display: flex;
|
|
126
122
|
flex-direction: column;
|
|
127
123
|
align-items: stretch;
|
|
128
124
|
}` })
|
|
129
125
|
] });
|
|
130
126
|
}
|
|
131
|
-
function Ie(e) {
|
|
132
|
-
return /* @__PURE__ */ t("span", { children: e.children });
|
|
133
|
-
}
|
|
134
127
|
function Re(e) {
|
|
135
|
-
|
|
128
|
+
return /* @__PURE__ */ i("span", { children: e.children });
|
|
129
|
+
}
|
|
130
|
+
function Pe(e) {
|
|
131
|
+
var l, u, S, y;
|
|
136
132
|
function c() {
|
|
137
|
-
var
|
|
133
|
+
var m;
|
|
138
134
|
const o = e.image || e.src;
|
|
139
135
|
if (!o || // We can auto add srcset for cdn.builder.io and shopify
|
|
140
136
|
// images, otherwise you can supply this prop manually
|
|
141
137
|
!(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
|
|
142
138
|
return e.srcset;
|
|
143
|
-
if (e.srcset && ((
|
|
139
|
+
if (e.srcset && ((m = e.image) != null && m.includes("builder.io/api/v1/image"))) {
|
|
144
140
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
145
141
|
return console.debug("Removed given srcset"), R(o);
|
|
146
142
|
} else if (e.image && !e.srcset)
|
|
147
143
|
return R(o);
|
|
148
144
|
return R(o);
|
|
149
145
|
}
|
|
150
|
-
function
|
|
146
|
+
function s() {
|
|
151
147
|
var b;
|
|
152
148
|
return (b = c == null ? void 0 : c()) != null && b.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
|
|
153
149
|
}
|
|
@@ -161,11 +157,11 @@ function Re(e) {
|
|
|
161
157
|
};
|
|
162
158
|
return e.aspectRatio ? b : void 0;
|
|
163
159
|
}
|
|
164
|
-
return /* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
167
|
-
|
|
168
|
-
/* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ E(h, { children: [
|
|
161
|
+
/* @__PURE__ */ E(h, { children: [
|
|
162
|
+
/* @__PURE__ */ E("picture", { children: [
|
|
163
|
+
s() ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("source", { type: "image/webp", srcSet: s() }) }) : null,
|
|
164
|
+
/* @__PURE__ */ i(
|
|
169
165
|
"img",
|
|
170
166
|
{
|
|
171
167
|
loading: "lazy",
|
|
@@ -183,7 +179,7 @@ function Re(e) {
|
|
|
183
179
|
}
|
|
184
180
|
)
|
|
185
181
|
] }),
|
|
186
|
-
e.aspectRatio && !((
|
|
182
|
+
e.aspectRatio && !((u = (l = e.builderBlock) == null ? void 0 : l.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
187
183
|
"div",
|
|
188
184
|
{
|
|
189
185
|
className: "builder-image-sizer div-40c70c9b",
|
|
@@ -192,10 +188,10 @@ function Re(e) {
|
|
|
192
188
|
}
|
|
193
189
|
}
|
|
194
190
|
) }) : null,
|
|
195
|
-
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */
|
|
196
|
-
!e.fitContent && e.children ? /* @__PURE__ */
|
|
191
|
+
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: e.children }) : null,
|
|
192
|
+
!e.fitContent && e.children ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
|
|
197
193
|
] }),
|
|
198
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ i("style", { children: `.img-40c70c9b {
|
|
199
195
|
opacity: 1;
|
|
200
196
|
transition: opacity 0.2s ease-in-out;
|
|
201
197
|
}.div-40c70c9b {
|
|
@@ -214,8 +210,8 @@ function Re(e) {
|
|
|
214
210
|
}` })
|
|
215
211
|
] });
|
|
216
212
|
}
|
|
217
|
-
function
|
|
218
|
-
return /* @__PURE__ */
|
|
213
|
+
function Te(e) {
|
|
214
|
+
return /* @__PURE__ */ i(
|
|
219
215
|
"section",
|
|
220
216
|
{
|
|
221
217
|
...e.attributes,
|
|
@@ -235,8 +231,8 @@ function Pe(e) {
|
|
|
235
231
|
}
|
|
236
232
|
);
|
|
237
233
|
}
|
|
238
|
-
function
|
|
239
|
-
const c = T(null), [
|
|
234
|
+
function Ne(e) {
|
|
235
|
+
const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []);
|
|
240
236
|
return f(() => {
|
|
241
237
|
var y;
|
|
242
238
|
if (!((y = c.current) != null && y.getElementsByTagName) || typeof window > "u")
|
|
@@ -245,26 +241,26 @@ function Te(e) {
|
|
|
245
241
|
for (let b = 0; b < S.length; b++) {
|
|
246
242
|
const o = S[b];
|
|
247
243
|
if (o.src) {
|
|
248
|
-
if (
|
|
244
|
+
if (s.includes(o.src))
|
|
249
245
|
continue;
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
|
|
246
|
+
s.push(o.src);
|
|
247
|
+
const m = document.createElement("script");
|
|
248
|
+
m.async = !0, m.src = o.src, document.head.appendChild(m);
|
|
253
249
|
} else if (!o.type || [
|
|
254
250
|
"text/javascript",
|
|
255
251
|
"application/javascript",
|
|
256
252
|
"application/ecmascript"
|
|
257
253
|
].includes(o.type)) {
|
|
258
|
-
if (
|
|
254
|
+
if (l.includes(o.innerText))
|
|
259
255
|
continue;
|
|
260
256
|
try {
|
|
261
|
-
|
|
262
|
-
} catch (
|
|
263
|
-
console.warn("`CustomCode`: Error running script:",
|
|
257
|
+
l.push(o.innerText), new Function(o.innerText)();
|
|
258
|
+
} catch (m) {
|
|
259
|
+
console.warn("`CustomCode`: Error running script:", m);
|
|
264
260
|
}
|
|
265
261
|
}
|
|
266
262
|
}
|
|
267
|
-
}, []), /* @__PURE__ */
|
|
263
|
+
}, []), /* @__PURE__ */ i(
|
|
268
264
|
"div",
|
|
269
265
|
{
|
|
270
266
|
ref: c,
|
|
@@ -273,21 +269,21 @@ function Te(e) {
|
|
|
273
269
|
}
|
|
274
270
|
);
|
|
275
271
|
}
|
|
276
|
-
function
|
|
277
|
-
const c = T(null), [
|
|
272
|
+
function Be(e) {
|
|
273
|
+
const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []), [S, y] = x(() => !1);
|
|
278
274
|
function b() {
|
|
279
275
|
if (!c.current || !c.current.getElementsByTagName)
|
|
280
276
|
return;
|
|
281
277
|
const o = c.current.getElementsByTagName("script");
|
|
282
|
-
for (let
|
|
283
|
-
const k = o[
|
|
284
|
-
if (k.src && !
|
|
285
|
-
|
|
278
|
+
for (let m = 0; m < o.length; m++) {
|
|
279
|
+
const k = o[m];
|
|
280
|
+
if (k.src && !s.includes(k.src)) {
|
|
281
|
+
s.push(k.src);
|
|
286
282
|
const C = document.createElement("script");
|
|
287
283
|
C.async = !0, C.src = k.src, document.head.appendChild(C);
|
|
288
|
-
} else if (
|
|
284
|
+
} else if (ee(k) && !l.includes(k.innerText))
|
|
289
285
|
try {
|
|
290
|
-
|
|
286
|
+
l.push(k.innerText), new Function(k.innerText)();
|
|
291
287
|
} catch (C) {
|
|
292
288
|
console.warn("`Embed`: Error running script:", C);
|
|
293
289
|
}
|
|
@@ -295,7 +291,7 @@ function Ne(e) {
|
|
|
295
291
|
}
|
|
296
292
|
return f(() => {
|
|
297
293
|
c.current && !S && (y(!0), b());
|
|
298
|
-
}, [c.current, S]), /* @__PURE__ */
|
|
294
|
+
}, [c.current, S]), /* @__PURE__ */ i(
|
|
299
295
|
"div",
|
|
300
296
|
{
|
|
301
297
|
className: "builder-embed",
|
|
@@ -304,8 +300,8 @@ function Ne(e) {
|
|
|
304
300
|
}
|
|
305
301
|
);
|
|
306
302
|
}
|
|
307
|
-
function
|
|
308
|
-
return /* @__PURE__ */
|
|
303
|
+
function Le(e) {
|
|
304
|
+
return /* @__PURE__ */ i(
|
|
309
305
|
"img",
|
|
310
306
|
{
|
|
311
307
|
style: {
|
|
@@ -316,11 +312,11 @@ function Be(e) {
|
|
|
316
312
|
src: e.imgSrc || e.image,
|
|
317
313
|
...e.attributes
|
|
318
314
|
},
|
|
319
|
-
|
|
315
|
+
w() && e.imgSrc || "default-key"
|
|
320
316
|
);
|
|
321
317
|
}
|
|
322
|
-
function
|
|
323
|
-
var v,
|
|
318
|
+
function je(e) {
|
|
319
|
+
var v, l, u, S, y, b, o;
|
|
324
320
|
function c() {
|
|
325
321
|
return {
|
|
326
322
|
...e.autoPlay === !0 ? {
|
|
@@ -340,23 +336,23 @@ function Le(e) {
|
|
|
340
336
|
} : {}
|
|
341
337
|
};
|
|
342
338
|
}
|
|
343
|
-
function
|
|
339
|
+
function s() {
|
|
344
340
|
return {
|
|
345
341
|
...c()
|
|
346
342
|
};
|
|
347
343
|
}
|
|
348
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ E(
|
|
349
345
|
"div",
|
|
350
346
|
{
|
|
351
347
|
style: {
|
|
352
348
|
position: "relative"
|
|
353
349
|
},
|
|
354
350
|
children: [
|
|
355
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ i(
|
|
356
352
|
"video",
|
|
357
353
|
{
|
|
358
354
|
className: "builder-video",
|
|
359
|
-
...
|
|
355
|
+
...s(),
|
|
360
356
|
preload: e.preload || "metadata",
|
|
361
357
|
style: {
|
|
362
358
|
width: "100%",
|
|
@@ -374,10 +370,10 @@ function Le(e) {
|
|
|
374
370
|
},
|
|
375
371
|
src: e.video || "no-src",
|
|
376
372
|
poster: e.posterImage,
|
|
377
|
-
children: e.lazyLoad ? null : /* @__PURE__ */
|
|
373
|
+
children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
|
|
378
374
|
}
|
|
379
375
|
),
|
|
380
|
-
e.aspectRatio && !(e.fitContent && ((
|
|
376
|
+
e.aspectRatio && !(e.fitContent && ((u = (l = e.builderBlock) == null ? void 0 : l.children) != null && u.length)) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
381
377
|
"div",
|
|
382
378
|
{
|
|
383
379
|
style: {
|
|
@@ -388,7 +384,7 @@ function Le(e) {
|
|
|
388
384
|
}
|
|
389
385
|
}
|
|
390
386
|
) }) : null,
|
|
391
|
-
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */
|
|
387
|
+
(y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
392
388
|
"div",
|
|
393
389
|
{
|
|
394
390
|
style: {
|
|
@@ -399,7 +395,7 @@ function Le(e) {
|
|
|
399
395
|
children: e.children
|
|
400
396
|
}
|
|
401
397
|
) }) : null,
|
|
402
|
-
(o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length && !e.fitContent ? /* @__PURE__ */
|
|
398
|
+
(o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length && !e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
|
|
403
399
|
"div",
|
|
404
400
|
{
|
|
405
401
|
style: {
|
|
@@ -420,7 +416,7 @@ function Le(e) {
|
|
|
420
416
|
}
|
|
421
417
|
);
|
|
422
418
|
}
|
|
423
|
-
const he =
|
|
419
|
+
const he = ue({
|
|
424
420
|
content: null,
|
|
425
421
|
context: {},
|
|
426
422
|
localState: void 0,
|
|
@@ -434,38 +430,38 @@ const he = de({
|
|
|
434
430
|
BlocksWrapper: "div",
|
|
435
431
|
BlocksWrapperProps: {}
|
|
436
432
|
});
|
|
437
|
-
function
|
|
438
|
-
var W, F, K,
|
|
439
|
-
const c = T(null), [
|
|
433
|
+
function We(e) {
|
|
434
|
+
var W, F, K, A, z, M, _;
|
|
435
|
+
const c = T(null), [s, v] = x(() => 0);
|
|
440
436
|
x(() => !0);
|
|
441
|
-
function
|
|
442
|
-
var a,
|
|
443
|
-
const
|
|
437
|
+
function l(t) {
|
|
438
|
+
var a, r;
|
|
439
|
+
const n = {
|
|
444
440
|
...e.builderContextSignal.rootState,
|
|
445
|
-
...
|
|
441
|
+
...t
|
|
446
442
|
};
|
|
447
|
-
e.builderContextSignal.rootSetState ? (
|
|
443
|
+
e.builderContextSignal.rootSetState ? (r = (a = e.builderContextSignal).rootSetState) == null || r.call(a, n) : e.builderContextSignal.rootState = n;
|
|
448
444
|
}
|
|
449
|
-
function
|
|
450
|
-
var a,
|
|
451
|
-
const
|
|
445
|
+
function u(t) {
|
|
446
|
+
var a, r, d, g, q;
|
|
447
|
+
const n = {
|
|
452
448
|
...e.builderContextSignal.content,
|
|
453
|
-
...
|
|
449
|
+
...t,
|
|
454
450
|
data: {
|
|
455
451
|
...(a = e.builderContextSignal.content) == null ? void 0 : a.data,
|
|
456
|
-
...
|
|
452
|
+
...t == null ? void 0 : t.data
|
|
457
453
|
},
|
|
458
454
|
meta: {
|
|
459
|
-
...(
|
|
460
|
-
...
|
|
461
|
-
breakpoints: ((d =
|
|
455
|
+
...(r = e.builderContextSignal.content) == null ? void 0 : r.meta,
|
|
456
|
+
...t == null ? void 0 : t.meta,
|
|
457
|
+
breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((q = (g = e.builderContextSignal.content) == null ? void 0 : g.meta) == null ? void 0 : q.breakpoints)
|
|
462
458
|
}
|
|
463
459
|
};
|
|
464
|
-
|
|
465
|
-
value:
|
|
466
|
-
key:
|
|
460
|
+
ge({
|
|
461
|
+
value: n,
|
|
462
|
+
key: n.id
|
|
467
463
|
}).then(() => {
|
|
468
|
-
|
|
464
|
+
Z.refresh();
|
|
469
465
|
});
|
|
470
466
|
}
|
|
471
467
|
x(() => 0);
|
|
@@ -474,63 +470,63 @@ function je(e) {
|
|
|
474
470
|
), [b, o] = x(
|
|
475
471
|
() => e.contentWrapper || "div"
|
|
476
472
|
);
|
|
477
|
-
function
|
|
473
|
+
function m(t) {
|
|
478
474
|
var a;
|
|
479
|
-
if (!
|
|
475
|
+
if (!ie(e.trustedHosts, t))
|
|
480
476
|
return;
|
|
481
|
-
const { data:
|
|
482
|
-
if (
|
|
483
|
-
switch (
|
|
477
|
+
const { data: n } = t;
|
|
478
|
+
if (n)
|
|
479
|
+
switch (n.type) {
|
|
484
480
|
case "builder.configureSdk": {
|
|
485
|
-
const
|
|
486
|
-
if (!
|
|
481
|
+
const r = n.data, { breakpoints: d, contentId: g } = r;
|
|
482
|
+
if (!g || g !== ((a = e.builderContextSignal.content) == null ? void 0 : a.id))
|
|
487
483
|
return;
|
|
488
|
-
d &&
|
|
484
|
+
d && u({
|
|
489
485
|
meta: {
|
|
490
486
|
breakpoints: d
|
|
491
487
|
}
|
|
492
|
-
}), v(
|
|
488
|
+
}), v(s + 1);
|
|
493
489
|
break;
|
|
494
490
|
}
|
|
495
491
|
case "builder.contentUpdate": {
|
|
496
|
-
const
|
|
497
|
-
d === e.model && (
|
|
492
|
+
const r = n.data, d = r.key || r.alias || r.entry || r.modelName, g = r.data;
|
|
493
|
+
d === e.model && (u(g), v(s + 1));
|
|
498
494
|
break;
|
|
499
495
|
}
|
|
500
496
|
}
|
|
501
497
|
}
|
|
502
498
|
function k() {
|
|
503
|
-
var
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
code:
|
|
499
|
+
var n, a;
|
|
500
|
+
const t = (a = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : a.jsCode;
|
|
501
|
+
t && U({
|
|
502
|
+
code: t,
|
|
507
503
|
context: e.context || {},
|
|
508
504
|
localState: void 0,
|
|
509
505
|
rootState: e.builderContextSignal.rootState,
|
|
510
506
|
rootSetState: e.builderContextSignal.rootSetState
|
|
511
507
|
});
|
|
512
508
|
}
|
|
513
|
-
const [C,
|
|
514
|
-
function
|
|
515
|
-
var
|
|
509
|
+
const [C, fe] = x(() => ({})), [N, G] = x(() => !1);
|
|
510
|
+
function Q(t) {
|
|
511
|
+
var n, a;
|
|
516
512
|
if (e.builderContextSignal.content) {
|
|
517
|
-
const
|
|
513
|
+
const r = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
|
|
518
514
|
V({
|
|
519
515
|
type: "click",
|
|
520
516
|
canTrack: H(e.canTrack),
|
|
521
517
|
contentId: d,
|
|
522
518
|
apiKey: e.apiKey,
|
|
523
|
-
variationId:
|
|
524
|
-
...
|
|
519
|
+
variationId: r !== d ? r : void 0,
|
|
520
|
+
...ae(t),
|
|
525
521
|
unique: !N
|
|
526
522
|
});
|
|
527
523
|
}
|
|
528
|
-
N ||
|
|
524
|
+
N || G(!0);
|
|
529
525
|
}
|
|
530
|
-
function
|
|
531
|
-
return
|
|
526
|
+
function X(t) {
|
|
527
|
+
return t.replace(
|
|
532
528
|
/{{([^}]+)}}/g,
|
|
533
|
-
(
|
|
529
|
+
(n, a) => U({
|
|
534
530
|
code: a,
|
|
535
531
|
context: e.context || {},
|
|
536
532
|
localState: void 0,
|
|
@@ -539,38 +535,38 @@ function je(e) {
|
|
|
539
535
|
})
|
|
540
536
|
);
|
|
541
537
|
}
|
|
542
|
-
function
|
|
543
|
-
|
|
544
|
-
var d,
|
|
545
|
-
const
|
|
538
|
+
function Y({ url: t, key: n }) {
|
|
539
|
+
se(t).then((a) => a.json()).then((a) => {
|
|
540
|
+
var d, g;
|
|
541
|
+
const r = {
|
|
546
542
|
...e.builderContextSignal.rootState,
|
|
547
|
-
[
|
|
543
|
+
[n]: a
|
|
548
544
|
};
|
|
549
|
-
(
|
|
545
|
+
(g = (d = e.builderContextSignal).rootSetState) == null || g.call(d, r), C[n] = !0;
|
|
550
546
|
}).catch((a) => {
|
|
551
|
-
console.error("error fetching dynamic data",
|
|
547
|
+
console.error("error fetching dynamic data", t, a);
|
|
552
548
|
});
|
|
553
549
|
}
|
|
554
550
|
function B() {
|
|
555
|
-
var
|
|
556
|
-
const
|
|
557
|
-
Object.entries(
|
|
558
|
-
if (d && (!C[
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
url:
|
|
562
|
-
key:
|
|
551
|
+
var n, a;
|
|
552
|
+
const t = ((a = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : a.httpRequests) ?? {};
|
|
553
|
+
Object.entries(t).forEach(([r, d]) => {
|
|
554
|
+
if (d && (!C[r] || w())) {
|
|
555
|
+
const g = X(d);
|
|
556
|
+
Y({
|
|
557
|
+
url: g,
|
|
558
|
+
key: r
|
|
563
559
|
});
|
|
564
560
|
}
|
|
565
561
|
});
|
|
566
562
|
}
|
|
567
563
|
function I() {
|
|
568
|
-
|
|
564
|
+
w() && window.dispatchEvent(
|
|
569
565
|
new CustomEvent(
|
|
570
566
|
"builder:component:stateChange",
|
|
571
567
|
{
|
|
572
568
|
detail: {
|
|
573
|
-
state:
|
|
569
|
+
state: ce(e.builderContextSignal.rootState),
|
|
574
570
|
ref: {
|
|
575
571
|
name: e.model
|
|
576
572
|
}
|
|
@@ -579,8 +575,8 @@ function je(e) {
|
|
|
579
575
|
)
|
|
580
576
|
);
|
|
581
577
|
}
|
|
582
|
-
function L(
|
|
583
|
-
v(
|
|
578
|
+
function L(t) {
|
|
579
|
+
v(s + 1), window.addEventListener("message", m), re(), le({
|
|
584
580
|
...e.locale ? {
|
|
585
581
|
locale: e.locale
|
|
586
582
|
} : {},
|
|
@@ -595,74 +591,74 @@ function je(e) {
|
|
|
595
591
|
} : {}
|
|
596
592
|
}), Object.values(
|
|
597
593
|
e.builderContextSignal.componentInfos
|
|
598
|
-
).forEach((
|
|
599
|
-
var
|
|
600
|
-
const a =
|
|
601
|
-
(
|
|
594
|
+
).forEach((n) => {
|
|
595
|
+
var r;
|
|
596
|
+
const a = oe(n);
|
|
597
|
+
(r = window.parent) == null || r.postMessage(a, "*");
|
|
602
598
|
}), window.addEventListener(
|
|
603
599
|
"builder:component:stateChangeListenerActivated",
|
|
604
600
|
I
|
|
605
601
|
);
|
|
606
602
|
}
|
|
607
|
-
function j(
|
|
608
|
-
const
|
|
603
|
+
function j(t) {
|
|
604
|
+
const n = new URL(location.href).searchParams, a = n.get("builder.preview"), r = n.get(
|
|
609
605
|
`builder.preview.${a}`
|
|
610
|
-
), d =
|
|
611
|
-
a === e.model && d === e.apiKey && (!e.content ||
|
|
606
|
+
), d = n.get("apiKey") || n.get("builder.space");
|
|
607
|
+
a === e.model && d === e.apiKey && (!e.content || r === e.content.id) && de({
|
|
612
608
|
model: e.model,
|
|
613
609
|
apiKey: e.apiKey,
|
|
614
610
|
apiVersion: e.builderContextSignal.apiVersion
|
|
615
|
-
}).then((
|
|
616
|
-
|
|
611
|
+
}).then((g) => {
|
|
612
|
+
g && u(g);
|
|
617
613
|
});
|
|
618
614
|
}
|
|
619
|
-
const
|
|
615
|
+
const Z = be();
|
|
620
616
|
return f(() => {
|
|
621
|
-
var
|
|
622
|
-
return (
|
|
617
|
+
var t;
|
|
618
|
+
return (t = c.current) == null || t.addEventListener(
|
|
623
619
|
"initeditingbldr",
|
|
624
620
|
L
|
|
625
621
|
), () => {
|
|
626
|
-
var
|
|
627
|
-
return (
|
|
622
|
+
var n;
|
|
623
|
+
return (n = c.current) == null ? void 0 : n.removeEventListener(
|
|
628
624
|
"initeditingbldr",
|
|
629
625
|
L
|
|
630
626
|
);
|
|
631
627
|
};
|
|
632
628
|
}, []), f(() => {
|
|
633
|
-
var
|
|
634
|
-
return (
|
|
629
|
+
var t;
|
|
630
|
+
return (t = c.current) == null || t.addEventListener(
|
|
635
631
|
"initpreviewingbldr",
|
|
636
632
|
j
|
|
637
633
|
), () => {
|
|
638
|
-
var
|
|
639
|
-
return (
|
|
634
|
+
var n;
|
|
635
|
+
return (n = c.current) == null ? void 0 : n.removeEventListener(
|
|
640
636
|
"initpreviewingbldr",
|
|
641
637
|
j
|
|
642
638
|
);
|
|
643
639
|
};
|
|
644
640
|
}, []), f(() => {
|
|
645
|
-
var
|
|
641
|
+
var t, n;
|
|
646
642
|
if (P()) {
|
|
647
|
-
if (
|
|
648
|
-
const
|
|
643
|
+
if (w() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && H(e.canTrack)) {
|
|
644
|
+
const r = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (n = e.builderContextSignal.content) == null ? void 0 : n.id, g = e.apiKey;
|
|
649
645
|
V({
|
|
650
646
|
type: "impression",
|
|
651
647
|
canTrack: !0,
|
|
652
648
|
contentId: d,
|
|
653
|
-
apiKey:
|
|
654
|
-
variationId:
|
|
649
|
+
apiKey: g,
|
|
650
|
+
variationId: r !== d ? r : void 0
|
|
655
651
|
});
|
|
656
652
|
}
|
|
657
|
-
|
|
653
|
+
te() && c.current;
|
|
658
654
|
}
|
|
659
655
|
}, []), f(() => {
|
|
660
|
-
e.apiKey ||
|
|
656
|
+
e.apiKey || ne.error(
|
|
661
657
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
662
658
|
), k(), B(), I();
|
|
663
659
|
}, []), f(() => {
|
|
664
660
|
}, [e.content]), f(() => {
|
|
665
|
-
P() && (window.removeEventListener("message",
|
|
661
|
+
P() && (window.removeEventListener("message", m), window.addEventListener("message", m));
|
|
666
662
|
}, [S]), f(() => {
|
|
667
663
|
k();
|
|
668
664
|
}, [
|
|
@@ -670,26 +666,26 @@ function je(e) {
|
|
|
670
666
|
e.builderContextSignal.rootState
|
|
671
667
|
]), f(() => {
|
|
672
668
|
B();
|
|
673
|
-
}, [(
|
|
669
|
+
}, [(A = (K = e.builderContextSignal.content) == null ? void 0 : K.data) == null ? void 0 : A.httpRequests]), f(() => {
|
|
674
670
|
I();
|
|
675
671
|
}, [e.builderContextSignal.rootState]), f(() => {
|
|
676
|
-
e.data &&
|
|
672
|
+
e.data && l(e.data);
|
|
677
673
|
}, [e.data]), f(() => {
|
|
678
|
-
e.locale &&
|
|
674
|
+
e.locale && l({
|
|
679
675
|
locale: e.locale
|
|
680
676
|
});
|
|
681
677
|
}, [e.locale]), f(() => () => {
|
|
682
|
-
P() && (window.removeEventListener("message",
|
|
678
|
+
P() && (window.removeEventListener("message", m), window.removeEventListener(
|
|
683
679
|
"builder:component:stateChangeListenerActivated",
|
|
684
680
|
I
|
|
685
681
|
));
|
|
686
|
-
}, []), /* @__PURE__ */
|
|
682
|
+
}, []), /* @__PURE__ */ i(he.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ me(
|
|
687
683
|
b,
|
|
688
684
|
{
|
|
689
|
-
key:
|
|
685
|
+
key: s,
|
|
690
686
|
ref: c,
|
|
691
|
-
onClick: (
|
|
692
|
-
"builder-content-id": (
|
|
687
|
+
onClick: (t) => Q(t),
|
|
688
|
+
"builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
|
|
693
689
|
"builder-model": e.model,
|
|
694
690
|
...e.showContent ? {} : {
|
|
695
691
|
hidden: !0,
|
|
@@ -702,16 +698,17 @@ function je(e) {
|
|
|
702
698
|
) }) : null });
|
|
703
699
|
}
|
|
704
700
|
export {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
701
|
+
we as B,
|
|
702
|
+
Ne as C,
|
|
703
|
+
J as D,
|
|
704
|
+
Be as E,
|
|
705
|
+
Re as F,
|
|
706
|
+
Ee as I,
|
|
707
|
+
Te as S,
|
|
708
|
+
je as V,
|
|
709
|
+
Ie as a,
|
|
710
|
+
Ce as b,
|
|
711
|
+
Pe as c,
|
|
712
|
+
Le as d,
|
|
713
|
+
We as e
|
|
717
714
|
};
|