@builder.io/sdk-react-nextjs 0.7.1-0 → 0.7.1-2
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-9195e6a5.js → USE_CLIENT_BUNDLE-11d41596.js} +1 -1
- package/lib/browser/{USE_CLIENT_BUNDLE-7a3bf41a.mjs → USE_CLIENT_BUNDLE-48d9356f.mjs} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-f184d7eb.mjs → browser/USE_SERVER_BUNDLE-3875256b.mjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-3f12faf4.js → browser/USE_SERVER_BUNDLE-568694d9.js} +1 -1
- package/lib/browser/bundle-05622db1.js +76 -0
- package/lib/browser/{bundle-7285a09d.mjs → bundle-242ae8b5.mjs} +522 -502
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/edge/{USE_CLIENT_BUNDLE-4a0cfa69.mjs → USE_CLIENT_BUNDLE-6eb1ee54.mjs} +2 -2
- package/lib/edge/{USE_CLIENT_BUNDLE-3cca560e.js → USE_CLIENT_BUNDLE-bba76732.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-cd844269.js → edge/USE_SERVER_BUNDLE-305bf94a.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-22e86776.mjs → edge/USE_SERVER_BUNDLE-66d4b8c4.mjs} +1 -1
- package/lib/edge/bundle-1b9b93c7.js +96 -0
- package/lib/edge/{bundle-a5949d33.mjs → bundle-3d31ba5d.mjs} +1936 -1888
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/node/USE_CLIENT_BUNDLE-8147b412.js +23 -0
- package/lib/node/USE_CLIENT_BUNDLE-e041d92c.mjs +657 -0
- package/lib/{browser/USE_SERVER_BUNDLE-e5c2279a.mjs → node/USE_SERVER_BUNDLE-1634816a.mjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-d7b13097.js → node/USE_SERVER_BUNDLE-8c1ae1f0.js} +1 -1
- package/lib/node/bundle-4203318d.js +116 -0
- package/lib/node/{bundle-0358b224.mjs → bundle-7ebcd79e.mjs} +783 -640
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +22 -23
- package/package.json +1 -2
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/evaluate/choose-eval.d.ts +6 -0
- package/types/functions/evaluate/evaluate.d.ts +1 -5
- package/types/functions/evaluate/helpers.d.ts +7 -1
- package/types/functions/get-content/types.d.ts +94 -3
- package/lib/browser/bundle-620ae296.js +0 -76
- package/lib/edge/bundle-a0f5cad2.js +0 -96
- package/lib/node/USE_CLIENT_BUNDLE-63c7fe77.js +0 -61
- package/lib/node/USE_CLIENT_BUNDLE-d9e90ed7.mjs +0 -747
- package/lib/node/bundle-630ffe6d.js +0 -76
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { e as Ae, I as Ve, B as q, a as $e, b as Be, C as Pe, E as Fe, F as Oe, c as We, d as Ne, S as Le, V as Me, f as Ue } from "./USE_CLIENT_BUNDLE-d9e90ed7.mjs";
|
|
1
|
+
import { LRUCache } from "lru-cache";
|
|
2
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createElement } from "react";
|
|
4
|
+
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-e041d92c.mjs";
|
|
6
5
|
import "next/navigation";
|
|
7
|
-
const
|
|
6
|
+
const fastClone = (e) => JSON.parse(JSON.stringify(e)), SIZES = {
|
|
8
7
|
small: {
|
|
9
8
|
min: 320,
|
|
10
9
|
default: 321,
|
|
@@ -20,11 +19,11 @@ const A = (e) => JSON.parse(JSON.stringify(e)), ae = {
|
|
|
20
19
|
default: 991,
|
|
21
20
|
max: 1200
|
|
22
21
|
}
|
|
23
|
-
},
|
|
22
|
+
}, getMaxWidthQueryForSize = (e, t = SIZES) => `@media (max-width: ${t[e].max}px)`, getSizesForBreakpoints = ({
|
|
24
23
|
small: e,
|
|
25
24
|
medium: t
|
|
26
25
|
}) => {
|
|
27
|
-
const n =
|
|
26
|
+
const n = fastClone(SIZES);
|
|
28
27
|
if (!e || !t)
|
|
29
28
|
return n;
|
|
30
29
|
const o = Math.floor(e / 2);
|
|
@@ -33,42 +32,42 @@ const A = (e) => JSON.parse(JSON.stringify(e)), ae = {
|
|
|
33
32
|
min: o,
|
|
34
33
|
default: o + 1
|
|
35
34
|
};
|
|
36
|
-
const
|
|
35
|
+
const r = n.small.max + 1;
|
|
37
36
|
n.medium = {
|
|
38
37
|
max: t,
|
|
39
|
-
min:
|
|
40
|
-
default:
|
|
38
|
+
min: r,
|
|
39
|
+
default: r + 1
|
|
41
40
|
};
|
|
42
|
-
const
|
|
41
|
+
const i = n.medium.max + 1;
|
|
43
42
|
return n.large = {
|
|
44
43
|
max: 2e3,
|
|
45
44
|
// TODO: decide upper limit
|
|
46
|
-
min:
|
|
47
|
-
default:
|
|
45
|
+
min: i,
|
|
46
|
+
default: i + 1
|
|
48
47
|
}, n;
|
|
49
|
-
},
|
|
50
|
-
log: (...e) => console.log(
|
|
51
|
-
error: (...e) => console.error(
|
|
52
|
-
warn: (...e) => console.warn(
|
|
53
|
-
debug: (...e) => console.debug(
|
|
48
|
+
}, TARGET = "rsc", MSG_PREFIX = "[Builder.io]: ", logger = {
|
|
49
|
+
log: (...e) => console.log(MSG_PREFIX, ...e),
|
|
50
|
+
error: (...e) => console.error(MSG_PREFIX, ...e),
|
|
51
|
+
warn: (...e) => console.warn(MSG_PREFIX, ...e),
|
|
52
|
+
debug: (...e) => console.debug(MSG_PREFIX, ...e)
|
|
54
53
|
};
|
|
55
|
-
function
|
|
54
|
+
function isBrowser() {
|
|
56
55
|
return typeof window < "u" && typeof document < "u";
|
|
57
56
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
57
|
+
function isIframe() {
|
|
58
|
+
return isBrowser() && window.self !== window.top;
|
|
60
59
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
60
|
+
function isEditing() {
|
|
61
|
+
return isIframe() && window.location.search.indexOf("builder.frameEditing=") !== -1;
|
|
63
62
|
}
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
63
|
+
const getLocation = () => {
|
|
64
|
+
if (isBrowser()) {
|
|
66
65
|
const e = new URL(location.href);
|
|
67
66
|
return e.pathname === "" && (e.pathname = "/"), e;
|
|
68
67
|
} else
|
|
69
68
|
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
70
|
-
},
|
|
71
|
-
const e =
|
|
69
|
+
}, getUserAgent = () => typeof navigator == "object" && navigator.userAgent || "", getUserAttributes = () => {
|
|
70
|
+
const e = getUserAgent(), t = {
|
|
72
71
|
Android() {
|
|
73
72
|
return e.match(/Android/i);
|
|
74
73
|
},
|
|
@@ -85,15 +84,15 @@ const je = () => {
|
|
|
85
84
|
return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
|
|
86
85
|
},
|
|
87
86
|
any() {
|
|
88
|
-
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() ||
|
|
87
|
+
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || TARGET === "reactNative";
|
|
89
88
|
}
|
|
90
|
-
}, n = e.match(/Tablet|iPad/i), o =
|
|
89
|
+
}, n = e.match(/Tablet|iPad/i), o = getLocation();
|
|
91
90
|
return {
|
|
92
91
|
urlPath: o == null ? void 0 : o.pathname,
|
|
93
92
|
host: (o == null ? void 0 : o.host) || (o == null ? void 0 : o.hostname),
|
|
94
93
|
device: n ? "tablet" : t.any() ? "mobile" : "desktop"
|
|
95
94
|
};
|
|
96
|
-
},
|
|
95
|
+
}, getFunctionArguments = ({
|
|
97
96
|
builder: e,
|
|
98
97
|
context: t,
|
|
99
98
|
event: n,
|
|
@@ -105,118 +104,248 @@ const je = () => {
|
|
|
105
104
|
builder: e,
|
|
106
105
|
context: t,
|
|
107
106
|
event: n
|
|
108
|
-
})
|
|
109
|
-
|
|
107
|
+
}), getBuilderGlobals = () => ({
|
|
108
|
+
isEditing: isEditing(),
|
|
109
|
+
isBrowser: isBrowser(),
|
|
110
|
+
isServer: !isBrowser(),
|
|
111
|
+
getUserAttributes: () => getUserAttributes()
|
|
112
|
+
}), parseCode = (e, {
|
|
113
|
+
isExpression: t = !0
|
|
114
|
+
}) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, runInBrowser = ({
|
|
115
|
+
code: e,
|
|
116
|
+
builder: t,
|
|
117
|
+
context: n,
|
|
118
|
+
event: o,
|
|
119
|
+
localState: r,
|
|
120
|
+
rootSetState: i,
|
|
121
|
+
rootState: a
|
|
122
|
+
}) => {
|
|
123
|
+
const c = getFunctionArguments({
|
|
124
|
+
builder: t,
|
|
125
|
+
context: n,
|
|
126
|
+
event: o,
|
|
127
|
+
state: flattenState(a, r, i)
|
|
128
|
+
});
|
|
129
|
+
return new Function(...c.map(([s]) => s), e)(...c.map(([, s]) => s));
|
|
130
|
+
};
|
|
131
|
+
function flattenState(e, t, n) {
|
|
132
|
+
if (e === t)
|
|
133
|
+
throw new Error("rootState === localState");
|
|
134
|
+
return new Proxy(e, {
|
|
135
|
+
get: (o, r) => t && r in t ? t[r] : e[r],
|
|
136
|
+
set: (o, r, i) => {
|
|
137
|
+
if (t && r in t)
|
|
138
|
+
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
139
|
+
return e[r] = i, n == null || n(e), !0;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const noop = () => null;
|
|
144
|
+
let safeDynamicRequire = noop;
|
|
145
|
+
try {
|
|
146
|
+
safeDynamicRequire = eval("require");
|
|
147
|
+
} catch (e) {
|
|
148
|
+
}
|
|
149
|
+
const set = (e, t, n) => {
|
|
150
|
+
if (Object(e) !== e)
|
|
151
|
+
return e;
|
|
152
|
+
const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
153
|
+
return o.slice(0, -1).reduce((r, i, a) => Object(r[i]) === r[i] ? r[i] : r[i] = Math.abs(Number(o[a + 1])) >> 0 === +o[a + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
|
|
154
|
+
}, ivm = safeDynamicRequire("isolated-vm"), getSyncValName = (e) => `bldr_${e}_sync`, BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE", INJECTED_IVM_GLOBAL = "BUILDER_IVM", REF_TO_PROXY_FN = `
|
|
155
|
+
var refToProxy = (obj) => {
|
|
156
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
157
|
+
return obj;
|
|
158
|
+
}
|
|
159
|
+
return new Proxy({}, {
|
|
160
|
+
get(target, key) {
|
|
161
|
+
if (key === 'copySync') {
|
|
162
|
+
return () => obj.copySync();
|
|
163
|
+
}
|
|
164
|
+
const val = obj.getSync(key);
|
|
165
|
+
if (typeof val?.getSync === 'function') {
|
|
166
|
+
return refToProxy(val);
|
|
167
|
+
}
|
|
168
|
+
return val;
|
|
169
|
+
},
|
|
170
|
+
set(target, key, value) {
|
|
171
|
+
const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
|
|
172
|
+
obj.setSync(key, v);
|
|
173
|
+
${BUILDER_SET_STATE_NAME}(key, value)
|
|
174
|
+
},
|
|
175
|
+
deleteProperty(target, key) {
|
|
176
|
+
obj.deleteSync(key);
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
}
|
|
180
|
+
`, processCode = ({
|
|
181
|
+
code: e,
|
|
182
|
+
args: t
|
|
183
|
+
}) => {
|
|
184
|
+
const n = t.map(([o]) => `var ${o} = refToProxy(${getSyncValName(o)}); `).join("");
|
|
185
|
+
return `
|
|
186
|
+
${REF_TO_PROXY_FN}
|
|
187
|
+
${n}
|
|
188
|
+
function theFunction() {
|
|
189
|
+
${e}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
let output = theFunction()
|
|
193
|
+
|
|
194
|
+
if (typeof output === 'object' && output !== null) {
|
|
195
|
+
output = JSON.stringify(output.copySync ? output.copySync() : output);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
output;
|
|
199
|
+
`;
|
|
200
|
+
}, getIsolateContext = () => new ivm.Isolate({
|
|
201
|
+
memoryLimit: 128
|
|
202
|
+
}).createContextSync(), runInNode = ({
|
|
203
|
+
code: e,
|
|
204
|
+
builder: t,
|
|
205
|
+
context: n,
|
|
206
|
+
event: o,
|
|
207
|
+
localState: r,
|
|
208
|
+
rootSetState: i,
|
|
209
|
+
rootState: a
|
|
210
|
+
}) => {
|
|
211
|
+
const c = fastClone({
|
|
212
|
+
...a,
|
|
213
|
+
...r
|
|
214
|
+
}), s = getFunctionArguments({
|
|
215
|
+
builder: t,
|
|
216
|
+
context: n,
|
|
217
|
+
event: o,
|
|
218
|
+
state: c
|
|
219
|
+
}), u = getIsolateContext(), m = u.global;
|
|
220
|
+
m.setSync("global", m.derefInto()), m.setSync("log", function(...l) {
|
|
221
|
+
console.log(...l);
|
|
222
|
+
}), m.setSync(BUILDER_SET_STATE_NAME, function(l, f) {
|
|
223
|
+
set(a, l, f), i == null || i(a);
|
|
224
|
+
}), s.forEach(([l, f]) => {
|
|
225
|
+
const d = typeof f == "object" ? new ivm.Reference(
|
|
226
|
+
// workaround: methods with default values for arguments is not being cloned over
|
|
227
|
+
l === "builder" ? {
|
|
228
|
+
...f,
|
|
229
|
+
getUserAttributes: () => f.getUserAttributes()
|
|
230
|
+
} : f
|
|
231
|
+
) : null;
|
|
232
|
+
m.setSync(getSyncValName(l), d);
|
|
233
|
+
}), m.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
234
|
+
const h = processCode({
|
|
235
|
+
code: e,
|
|
236
|
+
args: s
|
|
237
|
+
}), p = u.evalSync(h);
|
|
238
|
+
try {
|
|
239
|
+
return JSON.parse(p);
|
|
240
|
+
} catch {
|
|
241
|
+
return p;
|
|
242
|
+
}
|
|
243
|
+
}, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
|
|
244
|
+
function evaluate({
|
|
110
245
|
code: e,
|
|
111
246
|
context: t,
|
|
112
247
|
localState: n,
|
|
113
248
|
rootState: o,
|
|
114
|
-
rootSetState:
|
|
115
|
-
event:
|
|
249
|
+
rootSetState: r,
|
|
250
|
+
event: i,
|
|
116
251
|
isExpression: a = !0
|
|
117
252
|
}) {
|
|
118
253
|
if (e === "") {
|
|
119
|
-
|
|
254
|
+
logger.warn("Skipping evaluation of empty code block.");
|
|
120
255
|
return;
|
|
121
256
|
}
|
|
122
257
|
const c = {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}, f = {
|
|
128
|
-
code: /* we disable this for cases where we definitely don't want a return */ a && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e,
|
|
129
|
-
builder: c,
|
|
258
|
+
code: parseCode(e, {
|
|
259
|
+
isExpression: a
|
|
260
|
+
}),
|
|
261
|
+
builder: getBuilderGlobals(),
|
|
130
262
|
context: t,
|
|
131
|
-
event:
|
|
132
|
-
rootSetState:
|
|
263
|
+
event: i,
|
|
264
|
+
rootSetState: r,
|
|
133
265
|
rootState: o,
|
|
134
266
|
localState: n
|
|
135
267
|
};
|
|
136
268
|
try {
|
|
137
|
-
return
|
|
138
|
-
} catch (
|
|
139
|
-
|
|
269
|
+
return chooseBrowserOrServerEval(c);
|
|
270
|
+
} catch (s) {
|
|
271
|
+
logger.error("Failed code evaluation: " + s.message, {
|
|
140
272
|
code: e
|
|
141
273
|
});
|
|
142
274
|
return;
|
|
143
275
|
}
|
|
144
276
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return o.slice(0, -1).reduce((i, r, a) => Object(i[r]) === i[r] ? i[r] : i[r] = Math.abs(Number(o[a + 1])) >> 0 === +o[a + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
|
|
150
|
-
};
|
|
151
|
-
const De = ({
|
|
277
|
+
function transformBlock(e) {
|
|
278
|
+
return e;
|
|
279
|
+
}
|
|
280
|
+
const evaluateBindings = ({
|
|
152
281
|
block: e,
|
|
153
282
|
context: t,
|
|
154
283
|
localState: n,
|
|
155
284
|
rootState: o,
|
|
156
|
-
rootSetState:
|
|
285
|
+
rootSetState: r
|
|
157
286
|
}) => {
|
|
158
287
|
if (!e.bindings)
|
|
159
288
|
return e;
|
|
160
|
-
const
|
|
161
|
-
...
|
|
289
|
+
const i = fastClone(e), a = {
|
|
290
|
+
...i,
|
|
162
291
|
properties: {
|
|
163
|
-
...
|
|
292
|
+
...i.properties
|
|
164
293
|
},
|
|
165
294
|
actions: {
|
|
166
|
-
...
|
|
295
|
+
...i.actions
|
|
167
296
|
}
|
|
168
297
|
};
|
|
169
298
|
for (const c in e.bindings) {
|
|
170
|
-
const s = e.bindings[c], u =
|
|
299
|
+
const s = e.bindings[c], u = evaluate({
|
|
171
300
|
code: s,
|
|
172
301
|
localState: n,
|
|
173
302
|
rootState: o,
|
|
174
|
-
rootSetState:
|
|
303
|
+
rootSetState: r,
|
|
175
304
|
context: t
|
|
176
305
|
});
|
|
177
|
-
|
|
306
|
+
set(a, c, u);
|
|
178
307
|
}
|
|
179
308
|
return a;
|
|
180
309
|
};
|
|
181
|
-
function
|
|
310
|
+
function getProcessedBlock({
|
|
182
311
|
block: e,
|
|
183
312
|
context: t,
|
|
184
313
|
shouldEvaluateBindings: n,
|
|
185
314
|
localState: o,
|
|
186
|
-
rootState:
|
|
187
|
-
rootSetState:
|
|
315
|
+
rootState: r,
|
|
316
|
+
rootSetState: i
|
|
188
317
|
}) {
|
|
189
318
|
const a = e;
|
|
190
|
-
return n ?
|
|
319
|
+
return n ? evaluateBindings({
|
|
191
320
|
block: a,
|
|
192
321
|
localState: o,
|
|
193
|
-
rootState:
|
|
194
|
-
rootSetState:
|
|
322
|
+
rootState: r,
|
|
323
|
+
rootSetState: i,
|
|
195
324
|
context: t
|
|
196
325
|
}) : a;
|
|
197
326
|
}
|
|
198
|
-
const
|
|
327
|
+
const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), checkIsDefined = (e) => e != null, convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
|
|
199
328
|
if (typeof o == "string")
|
|
200
|
-
return `${
|
|
201
|
-
}).filter(
|
|
202
|
-
`),
|
|
329
|
+
return `${camelToKebabCase(n)}: ${o};`;
|
|
330
|
+
}).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
|
|
331
|
+
`), createCssClass = ({
|
|
203
332
|
mediaQuery: e,
|
|
204
333
|
className: t,
|
|
205
334
|
styles: n
|
|
206
335
|
}) => {
|
|
207
336
|
const o = `.${t} {
|
|
208
|
-
${
|
|
337
|
+
${convertStyleMapToCSS(n)}
|
|
209
338
|
}`;
|
|
210
339
|
return e ? `${e} {
|
|
211
340
|
${o}
|
|
212
341
|
}` : o;
|
|
213
342
|
};
|
|
214
|
-
function
|
|
215
|
-
return /* @__PURE__ */
|
|
343
|
+
function InlinedStyles(e) {
|
|
344
|
+
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
|
|
216
345
|
}
|
|
217
|
-
function
|
|
346
|
+
function BlockStyles(e) {
|
|
218
347
|
const t = function() {
|
|
219
|
-
const
|
|
348
|
+
const r = getProcessedBlock({
|
|
220
349
|
block: e.block,
|
|
221
350
|
localState: e.context.localState,
|
|
222
351
|
rootState: e.context.rootState,
|
|
@@ -224,44 +353,44 @@ function U(e) {
|
|
|
224
353
|
context: e.context.context,
|
|
225
354
|
shouldEvaluateBindings: !0
|
|
226
355
|
});
|
|
227
|
-
return
|
|
356
|
+
return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
|
|
228
357
|
}, n = function() {
|
|
229
358
|
var d;
|
|
230
|
-
const
|
|
359
|
+
const r = getProcessedBlock({
|
|
231
360
|
block: e.block,
|
|
232
361
|
localState: e.context.localState,
|
|
233
362
|
rootState: e.context.rootState,
|
|
234
363
|
rootSetState: e.context.rootSetState,
|
|
235
364
|
context: e.context.context,
|
|
236
365
|
shouldEvaluateBindings: !0
|
|
237
|
-
}),
|
|
366
|
+
}), i = r.responsiveStyles, a = e.context.content, c = getSizesForBreakpoints(
|
|
238
367
|
((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
|
|
239
|
-
), s =
|
|
240
|
-
if (!
|
|
368
|
+
), s = i == null ? void 0 : i.large, u = i == null ? void 0 : i.medium, m = i == null ? void 0 : i.small, h = r.id;
|
|
369
|
+
if (!h)
|
|
241
370
|
return "";
|
|
242
|
-
const p = s ?
|
|
243
|
-
className:
|
|
371
|
+
const p = s ? createCssClass({
|
|
372
|
+
className: h,
|
|
244
373
|
styles: s
|
|
245
|
-
}) : "",
|
|
246
|
-
className:
|
|
374
|
+
}) : "", l = u ? createCssClass({
|
|
375
|
+
className: h,
|
|
247
376
|
styles: u,
|
|
248
|
-
mediaQuery:
|
|
377
|
+
mediaQuery: getMaxWidthQueryForSize(
|
|
249
378
|
"medium",
|
|
250
379
|
c
|
|
251
380
|
)
|
|
252
|
-
}) : "",
|
|
253
|
-
className:
|
|
254
|
-
styles:
|
|
255
|
-
mediaQuery:
|
|
381
|
+
}) : "", f = m ? createCssClass({
|
|
382
|
+
className: h,
|
|
383
|
+
styles: m,
|
|
384
|
+
mediaQuery: getMaxWidthQueryForSize(
|
|
256
385
|
"small",
|
|
257
386
|
c
|
|
258
387
|
)
|
|
259
388
|
}) : "";
|
|
260
|
-
return [p,
|
|
389
|
+
return [p, l, f].join(" ");
|
|
261
390
|
};
|
|
262
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
263
392
|
}
|
|
264
|
-
function
|
|
393
|
+
function getBlockComponentOptions(e) {
|
|
265
394
|
var t;
|
|
266
395
|
return {
|
|
267
396
|
...(t = e.component) == null ? void 0 : t.options,
|
|
@@ -272,29 +401,29 @@ function Ge(e) {
|
|
|
272
401
|
builderBlock: e
|
|
273
402
|
};
|
|
274
403
|
}
|
|
275
|
-
const
|
|
404
|
+
const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], isEmptyHtmlElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.includes(e.toLowerCase()), getComponent = ({
|
|
276
405
|
block: e,
|
|
277
406
|
context: t,
|
|
278
407
|
registeredComponents: n
|
|
279
408
|
}) => {
|
|
280
|
-
var
|
|
281
|
-
const o = (
|
|
409
|
+
var i;
|
|
410
|
+
const o = (i = getProcessedBlock({
|
|
282
411
|
block: e,
|
|
283
412
|
localState: t.localState,
|
|
284
413
|
rootState: t.rootState,
|
|
285
414
|
rootSetState: t.rootSetState,
|
|
286
415
|
context: t.context,
|
|
287
416
|
shouldEvaluateBindings: !1
|
|
288
|
-
}).component) == null ? void 0 :
|
|
417
|
+
}).component) == null ? void 0 : i.name;
|
|
289
418
|
if (!o)
|
|
290
419
|
return null;
|
|
291
|
-
const
|
|
292
|
-
if (
|
|
293
|
-
return
|
|
420
|
+
const r = n[o];
|
|
421
|
+
if (r)
|
|
422
|
+
return r;
|
|
294
423
|
console.warn(`
|
|
295
424
|
Could not find a registered component named "${o}".
|
|
296
425
|
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
297
|
-
},
|
|
426
|
+
}, getRepeatItemData = ({
|
|
298
427
|
block: e,
|
|
299
428
|
context: t
|
|
300
429
|
}) => {
|
|
@@ -304,17 +433,17 @@ const Je = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen"
|
|
|
304
433
|
} = e;
|
|
305
434
|
if (!(n != null && n.collection))
|
|
306
435
|
return;
|
|
307
|
-
const
|
|
436
|
+
const r = evaluate({
|
|
308
437
|
code: n.collection,
|
|
309
438
|
localState: t.localState,
|
|
310
439
|
rootState: t.rootState,
|
|
311
440
|
rootSetState: t.rootSetState,
|
|
312
441
|
context: t.context
|
|
313
442
|
});
|
|
314
|
-
if (!Array.isArray(
|
|
443
|
+
if (!Array.isArray(r))
|
|
315
444
|
return;
|
|
316
|
-
const
|
|
317
|
-
return
|
|
445
|
+
const i = n.collection.split(".").pop(), a = n.itemName || (i ? i + "Item" : "item");
|
|
446
|
+
return r.map((s, u) => ({
|
|
318
447
|
context: {
|
|
319
448
|
...t,
|
|
320
449
|
localState: {
|
|
@@ -328,10 +457,10 @@ const Je = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen"
|
|
|
328
457
|
block: o
|
|
329
458
|
}));
|
|
330
459
|
};
|
|
331
|
-
function
|
|
460
|
+
function RepeatedBlock(e) {
|
|
332
461
|
const t = e.repeatContext;
|
|
333
|
-
return /* @__PURE__ */
|
|
334
|
-
|
|
462
|
+
return /* @__PURE__ */ jsx(
|
|
463
|
+
Block,
|
|
335
464
|
{
|
|
336
465
|
block: e.block,
|
|
337
466
|
context: t,
|
|
@@ -339,10 +468,10 @@ function Qe(e) {
|
|
|
339
468
|
}
|
|
340
469
|
);
|
|
341
470
|
}
|
|
342
|
-
function
|
|
471
|
+
function capitalizeFirstLetter(e) {
|
|
343
472
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
344
473
|
}
|
|
345
|
-
const
|
|
474
|
+
const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventHandler = (e, t) => (n) => evaluate({
|
|
346
475
|
code: e,
|
|
347
476
|
context: t.context,
|
|
348
477
|
localState: t.localState,
|
|
@@ -351,54 +480,54 @@ const et = (e) => `on${Ze(e)}`, tt = (e, t) => (n) => M({
|
|
|
351
480
|
event: n,
|
|
352
481
|
isExpression: !1
|
|
353
482
|
});
|
|
354
|
-
function
|
|
483
|
+
function getBlockActions(e) {
|
|
355
484
|
const t = {}, n = e.block.actions ?? {};
|
|
356
485
|
for (const o in n) {
|
|
357
486
|
if (!n.hasOwnProperty(o))
|
|
358
487
|
continue;
|
|
359
|
-
const
|
|
360
|
-
let
|
|
488
|
+
const r = n[o];
|
|
489
|
+
let i = getEventHandlerName(o);
|
|
361
490
|
if (e.stripPrefix)
|
|
362
|
-
switch (
|
|
491
|
+
switch (TARGET) {
|
|
363
492
|
case "vue2":
|
|
364
493
|
case "vue3":
|
|
365
|
-
|
|
494
|
+
i = i.replace("v-on:", "");
|
|
366
495
|
break;
|
|
367
496
|
case "svelte":
|
|
368
|
-
|
|
497
|
+
i = i.replace("on:", "");
|
|
369
498
|
break;
|
|
370
499
|
}
|
|
371
|
-
t[
|
|
500
|
+
t[i] = createEventHandler(r, e);
|
|
372
501
|
}
|
|
373
502
|
return t;
|
|
374
503
|
}
|
|
375
|
-
function
|
|
504
|
+
function transformBlockProperties(e) {
|
|
376
505
|
return e.className = e.class, delete e.class, e;
|
|
377
506
|
}
|
|
378
|
-
const
|
|
507
|
+
const extractRelevantRootBlockProperties = (e) => ({
|
|
379
508
|
href: e.href
|
|
380
509
|
});
|
|
381
|
-
function
|
|
510
|
+
function getBlockProperties({
|
|
382
511
|
block: e,
|
|
383
512
|
context: t
|
|
384
513
|
}) {
|
|
385
514
|
var o;
|
|
386
515
|
const n = {
|
|
387
|
-
...
|
|
516
|
+
...extractRelevantRootBlockProperties(e),
|
|
388
517
|
...e.properties,
|
|
389
518
|
"builder-id": e.id,
|
|
390
|
-
style: e.style ?
|
|
519
|
+
style: e.style ? getStyleAttribute(e.style) : void 0,
|
|
391
520
|
class: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
|
|
392
521
|
};
|
|
393
|
-
return
|
|
522
|
+
return transformBlockProperties(n);
|
|
394
523
|
}
|
|
395
|
-
function
|
|
396
|
-
switch (
|
|
524
|
+
function getStyleAttribute(e) {
|
|
525
|
+
switch (TARGET) {
|
|
397
526
|
case "svelte":
|
|
398
527
|
case "vue2":
|
|
399
528
|
case "vue3":
|
|
400
529
|
case "solid":
|
|
401
|
-
return
|
|
530
|
+
return convertStyleMapToCSSArray(e).join(" ");
|
|
402
531
|
case "qwik":
|
|
403
532
|
case "reactNative":
|
|
404
533
|
case "react":
|
|
@@ -406,15 +535,15 @@ function rt(e) {
|
|
|
406
535
|
return e;
|
|
407
536
|
}
|
|
408
537
|
}
|
|
409
|
-
const
|
|
538
|
+
const getWrapperProps = ({
|
|
410
539
|
componentOptions: e,
|
|
411
540
|
builderBlock: t,
|
|
412
541
|
context: n,
|
|
413
542
|
componentRef: o,
|
|
414
|
-
includeBlockProps:
|
|
415
|
-
isInteractive:
|
|
543
|
+
includeBlockProps: r,
|
|
544
|
+
isInteractive: i,
|
|
416
545
|
contextValue: a
|
|
417
|
-
}) =>
|
|
546
|
+
}) => i ? {
|
|
418
547
|
Wrapper: o,
|
|
419
548
|
block: t,
|
|
420
549
|
context: n,
|
|
@@ -425,20 +554,20 @@ const at = ({
|
|
|
425
554
|
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
426
555
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
427
556
|
*/
|
|
428
|
-
...
|
|
429
|
-
attributes:
|
|
557
|
+
...r ? {
|
|
558
|
+
attributes: getBlockProperties({
|
|
430
559
|
block: t,
|
|
431
560
|
context: a
|
|
432
561
|
})
|
|
433
562
|
} : {}
|
|
434
563
|
};
|
|
435
|
-
function
|
|
564
|
+
function ComponentRef(e) {
|
|
436
565
|
var n, o;
|
|
437
|
-
const t = e.isInteractive ?
|
|
438
|
-
return /* @__PURE__ */
|
|
566
|
+
const t = e.isInteractive ? InteractiveElement : e.componentRef;
|
|
567
|
+
return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
439
568
|
t,
|
|
440
569
|
{
|
|
441
|
-
...
|
|
570
|
+
...getWrapperProps({
|
|
442
571
|
componentOptions: e.componentOptions,
|
|
443
572
|
builderBlock: e.builderBlock,
|
|
444
573
|
context: e.context,
|
|
@@ -448,42 +577,42 @@ function J(e) {
|
|
|
448
577
|
contextValue: e.context
|
|
449
578
|
}),
|
|
450
579
|
children: [
|
|
451
|
-
(n = e.blockChildren) == null ? void 0 : n.map((
|
|
452
|
-
|
|
580
|
+
(n = e.blockChildren) == null ? void 0 : n.map((r) => /* @__PURE__ */ jsx(
|
|
581
|
+
Block,
|
|
453
582
|
{
|
|
454
|
-
block:
|
|
583
|
+
block: r,
|
|
455
584
|
context: e.context,
|
|
456
585
|
registeredComponents: e.registeredComponents
|
|
457
586
|
},
|
|
458
|
-
"block-" +
|
|
587
|
+
"block-" + r.id
|
|
459
588
|
)),
|
|
460
|
-
(o = e.blockChildren) == null ? void 0 : o.map((
|
|
461
|
-
|
|
589
|
+
(o = e.blockChildren) == null ? void 0 : o.map((r) => /* @__PURE__ */ jsx(
|
|
590
|
+
BlockStyles,
|
|
462
591
|
{
|
|
463
|
-
block:
|
|
592
|
+
block: r,
|
|
464
593
|
context: e.context
|
|
465
594
|
},
|
|
466
|
-
"block-style-" +
|
|
595
|
+
"block-style-" + r.id
|
|
467
596
|
))
|
|
468
597
|
]
|
|
469
598
|
}
|
|
470
599
|
) }) : null });
|
|
471
600
|
}
|
|
472
|
-
function
|
|
473
|
-
var u,
|
|
601
|
+
function Block(e) {
|
|
602
|
+
var u, m, h, p;
|
|
474
603
|
const t = function() {
|
|
475
|
-
return
|
|
604
|
+
return getComponent({
|
|
476
605
|
block: e.block,
|
|
477
606
|
context: e.context,
|
|
478
607
|
registeredComponents: e.registeredComponents
|
|
479
608
|
});
|
|
480
609
|
}, n = function() {
|
|
481
|
-
return
|
|
610
|
+
return getRepeatItemData({
|
|
482
611
|
block: e.block,
|
|
483
612
|
context: e.context
|
|
484
613
|
});
|
|
485
614
|
}, o = function() {
|
|
486
|
-
return n() ? e.block :
|
|
615
|
+
return n() ? e.block : getProcessedBlock({
|
|
487
616
|
block: e.block,
|
|
488
617
|
localState: e.context.localState,
|
|
489
618
|
rootState: e.context.rootState,
|
|
@@ -491,20 +620,20 @@ function $(e) {
|
|
|
491
620
|
context: e.context.context,
|
|
492
621
|
shouldEvaluateBindings: !0
|
|
493
622
|
});
|
|
494
|
-
}, i = function() {
|
|
495
|
-
return e.block.tagName || "div";
|
|
496
623
|
}, r = function() {
|
|
624
|
+
return e.block.tagName || "div";
|
|
625
|
+
}, i = function() {
|
|
497
626
|
return "hide" in o() ? !o().hide : "show" in o() ? o().show : !0;
|
|
498
627
|
}, a = function() {
|
|
499
628
|
var d;
|
|
500
629
|
return !((d = t()) != null && d.component) && !n() ? o().children ?? [] : [];
|
|
501
630
|
}, c = function() {
|
|
502
|
-
var
|
|
631
|
+
var f, d, b, y, g;
|
|
503
632
|
return {
|
|
504
633
|
blockChildren: o().children ?? [],
|
|
505
|
-
componentRef: (
|
|
634
|
+
componentRef: (f = t()) == null ? void 0 : f.component,
|
|
506
635
|
componentOptions: {
|
|
507
|
-
...
|
|
636
|
+
...getBlockComponentOptions(o()),
|
|
508
637
|
builderContext: e.context,
|
|
509
638
|
...((d = t()) == null ? void 0 : d.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" ? {
|
|
510
639
|
builderComponents: e.registeredComponents
|
|
@@ -513,72 +642,72 @@ function $(e) {
|
|
|
513
642
|
context: s,
|
|
514
643
|
registeredComponents: e.registeredComponents,
|
|
515
644
|
builderBlock: o(),
|
|
516
|
-
includeBlockProps: ((
|
|
517
|
-
isInteractive: !((
|
|
645
|
+
includeBlockProps: ((y = t()) == null ? void 0 : y.noWrap) === !0,
|
|
646
|
+
isInteractive: !((g = t()) != null && g.isRSC)
|
|
518
647
|
};
|
|
519
648
|
}, s = e.context;
|
|
520
|
-
return /* @__PURE__ */
|
|
521
|
-
|
|
522
|
-
|
|
649
|
+
return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsx(Fragment, { children: (u = t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ComponentRef, { ...c() }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
650
|
+
isEmptyHtmlElement(r()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
651
|
+
BlockWrapper,
|
|
523
652
|
{
|
|
524
|
-
Wrapper:
|
|
653
|
+
Wrapper: r(),
|
|
525
654
|
block: o(),
|
|
526
655
|
context: e.context,
|
|
527
656
|
hasChildren: !1
|
|
528
657
|
}
|
|
529
658
|
) }) : null,
|
|
530
|
-
!
|
|
531
|
-
|
|
659
|
+
!isEmptyHtmlElement(r()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (m = n()) == null ? void 0 : m.map((l, f) => /* @__PURE__ */ jsx(
|
|
660
|
+
RepeatedBlock,
|
|
532
661
|
{
|
|
533
|
-
repeatContext:
|
|
534
|
-
block:
|
|
662
|
+
repeatContext: l.context,
|
|
663
|
+
block: l.block,
|
|
535
664
|
registeredComponents: e.registeredComponents
|
|
536
665
|
},
|
|
537
|
-
|
|
666
|
+
f
|
|
538
667
|
)) }) : null,
|
|
539
|
-
!
|
|
540
|
-
|
|
668
|
+
!isEmptyHtmlElement(r()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
669
|
+
BlockWrapper,
|
|
541
670
|
{
|
|
542
|
-
Wrapper:
|
|
671
|
+
Wrapper: r(),
|
|
543
672
|
block: o(),
|
|
544
673
|
context: e.context,
|
|
545
674
|
hasChildren: !0,
|
|
546
675
|
children: [
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
(
|
|
549
|
-
|
|
676
|
+
/* @__PURE__ */ jsx(ComponentRef, { ...c() }),
|
|
677
|
+
(h = a()) == null ? void 0 : h.map((l) => /* @__PURE__ */ jsx(
|
|
678
|
+
Block,
|
|
550
679
|
{
|
|
551
|
-
block:
|
|
680
|
+
block: l,
|
|
552
681
|
context: s,
|
|
553
682
|
registeredComponents: e.registeredComponents
|
|
554
683
|
},
|
|
555
|
-
"block-" +
|
|
684
|
+
"block-" + l.id
|
|
556
685
|
)),
|
|
557
|
-
(p = a()) == null ? void 0 : p.map((
|
|
558
|
-
|
|
686
|
+
(p = a()) == null ? void 0 : p.map((l) => /* @__PURE__ */ jsx(
|
|
687
|
+
BlockStyles,
|
|
559
688
|
{
|
|
560
|
-
block:
|
|
689
|
+
block: l,
|
|
561
690
|
context: s
|
|
562
691
|
},
|
|
563
|
-
"block-style-" +
|
|
692
|
+
"block-style-" + l.id
|
|
564
693
|
))
|
|
565
694
|
]
|
|
566
695
|
}
|
|
567
696
|
) }) : null
|
|
568
697
|
] }) }) : null });
|
|
569
698
|
}
|
|
570
|
-
function
|
|
699
|
+
function Blocks(e) {
|
|
571
700
|
var t, n;
|
|
572
|
-
return /* @__PURE__ */
|
|
573
|
-
|
|
701
|
+
return /* @__PURE__ */ jsxs(
|
|
702
|
+
BlocksWrapper,
|
|
574
703
|
{
|
|
575
704
|
blocks: e.blocks,
|
|
576
705
|
parent: e.parent,
|
|
577
706
|
path: e.path,
|
|
578
707
|
styleProp: e.styleProp,
|
|
579
708
|
children: [
|
|
580
|
-
e.blocks ? /* @__PURE__ */
|
|
581
|
-
|
|
709
|
+
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (t = e.blocks) == null ? void 0 : t.map((o) => /* @__PURE__ */ jsx(
|
|
710
|
+
Block,
|
|
582
711
|
{
|
|
583
712
|
block: o,
|
|
584
713
|
context: e.context,
|
|
@@ -586,8 +715,8 @@ function _(e) {
|
|
|
586
715
|
},
|
|
587
716
|
"render-block-" + o.id
|
|
588
717
|
)) }) : null,
|
|
589
|
-
e.blocks ? /* @__PURE__ */
|
|
590
|
-
|
|
718
|
+
e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (n = e.blocks) == null ? void 0 : n.map((o) => /* @__PURE__ */ jsx(
|
|
719
|
+
BlockStyles,
|
|
591
720
|
{
|
|
592
721
|
block: o,
|
|
593
722
|
context: e.context
|
|
@@ -598,14 +727,14 @@ function _(e) {
|
|
|
598
727
|
}
|
|
599
728
|
);
|
|
600
729
|
}
|
|
601
|
-
function
|
|
602
|
-
var
|
|
603
|
-
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet",
|
|
730
|
+
function Columns(e) {
|
|
731
|
+
var l;
|
|
732
|
+
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(d) {
|
|
604
733
|
var b;
|
|
605
734
|
return ((b = n[d]) == null ? void 0 : b.width) || 100 / n.length;
|
|
606
|
-
},
|
|
735
|
+
}, i = function(d) {
|
|
607
736
|
const b = t * (n.length - 1) / n.length;
|
|
608
|
-
return `calc(${
|
|
737
|
+
return `calc(${r(d)}% - ${b}px)`;
|
|
609
738
|
}, a = function({
|
|
610
739
|
stackedStyle: d,
|
|
611
740
|
desktopStyle: b
|
|
@@ -624,36 +753,36 @@ function st(e) {
|
|
|
624
753
|
desktopStyle: "row"
|
|
625
754
|
})
|
|
626
755
|
};
|
|
627
|
-
},
|
|
628
|
-
const b = d === 0 ? 0 : t,
|
|
756
|
+
}, m = function(d) {
|
|
757
|
+
const b = d === 0 ? 0 : t, y = i(d), g = `${b}px`, v = "100%", x = 0;
|
|
629
758
|
return {
|
|
630
|
-
width:
|
|
631
|
-
["marginLeft"]:
|
|
759
|
+
width: y,
|
|
760
|
+
["marginLeft"]: g,
|
|
632
761
|
"--column-width-mobile": c({
|
|
633
|
-
stackedStyle:
|
|
634
|
-
desktopStyle:
|
|
762
|
+
stackedStyle: v,
|
|
763
|
+
desktopStyle: y
|
|
635
764
|
}),
|
|
636
765
|
"--column-margin-left-mobile": c({
|
|
637
|
-
stackedStyle:
|
|
638
|
-
desktopStyle:
|
|
766
|
+
stackedStyle: x,
|
|
767
|
+
desktopStyle: g
|
|
639
768
|
}),
|
|
640
769
|
"--column-width-tablet": a({
|
|
641
|
-
stackedStyle:
|
|
642
|
-
desktopStyle:
|
|
770
|
+
stackedStyle: v,
|
|
771
|
+
desktopStyle: y
|
|
643
772
|
}),
|
|
644
773
|
"--column-margin-left-tablet": a({
|
|
645
|
-
stackedStyle:
|
|
646
|
-
desktopStyle:
|
|
774
|
+
stackedStyle: x,
|
|
775
|
+
desktopStyle: g
|
|
647
776
|
})
|
|
648
777
|
};
|
|
649
|
-
},
|
|
650
|
-
var
|
|
651
|
-
return
|
|
652
|
-
((
|
|
778
|
+
}, h = function(d) {
|
|
779
|
+
var y, g;
|
|
780
|
+
return getSizesForBreakpoints(
|
|
781
|
+
((g = (y = e.builderContext.content) == null ? void 0 : y.meta) == null ? void 0 : g.breakpoints) || {}
|
|
653
782
|
)[d].max;
|
|
654
783
|
}, p = function() {
|
|
655
784
|
return `
|
|
656
|
-
@media (max-width: ${
|
|
785
|
+
@media (max-width: ${h("medium")}px) {
|
|
657
786
|
.${e.builderBlock.id}-breakpoints {
|
|
658
787
|
flex-direction: var(--flex-dir-tablet);
|
|
659
788
|
align-items: stretch;
|
|
@@ -665,7 +794,7 @@ function st(e) {
|
|
|
665
794
|
}
|
|
666
795
|
}
|
|
667
796
|
|
|
668
|
-
@media (max-width: ${
|
|
797
|
+
@media (max-width: ${h("small")}px) {
|
|
669
798
|
.${e.builderBlock.id}-breakpoints {
|
|
670
799
|
flex-direction: var(--flex-dir);
|
|
671
800
|
align-items: stretch;
|
|
@@ -678,23 +807,23 @@ function st(e) {
|
|
|
678
807
|
},
|
|
679
808
|
`;
|
|
680
809
|
};
|
|
681
|
-
return /* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
811
|
+
/* @__PURE__ */ jsxs(
|
|
683
812
|
"div",
|
|
684
813
|
{
|
|
685
814
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-666689ca`,
|
|
686
815
|
style: u(),
|
|
687
816
|
children: [
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
(
|
|
817
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: p() }) }),
|
|
818
|
+
(l = e.columns) == null ? void 0 : l.map((f, d) => /* @__PURE__ */ createElement(
|
|
690
819
|
"div",
|
|
691
820
|
{
|
|
692
821
|
className: "builder-column div-666689ca-2",
|
|
693
|
-
style:
|
|
822
|
+
style: m(d),
|
|
694
823
|
key: d
|
|
695
824
|
},
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
|
|
825
|
+
/* @__PURE__ */ jsx(
|
|
826
|
+
Blocks,
|
|
698
827
|
{
|
|
699
828
|
path: `component.options.columns.${d}.blocks`,
|
|
700
829
|
parent: e.builderBlock.id,
|
|
@@ -703,14 +832,14 @@ function st(e) {
|
|
|
703
832
|
},
|
|
704
833
|
context: e.builderContext,
|
|
705
834
|
registeredComponents: e.builderComponents,
|
|
706
|
-
blocks:
|
|
835
|
+
blocks: f.blocks
|
|
707
836
|
}
|
|
708
837
|
)
|
|
709
838
|
))
|
|
710
839
|
]
|
|
711
840
|
}
|
|
712
841
|
),
|
|
713
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ jsx("style", { children: `.div-666689ca {
|
|
714
843
|
display: flex;
|
|
715
844
|
line-height: normal;
|
|
716
845
|
}.div-666689ca-2 {
|
|
@@ -720,108 +849,108 @@ function st(e) {
|
|
|
720
849
|
}` })
|
|
721
850
|
] });
|
|
722
851
|
}
|
|
723
|
-
function
|
|
852
|
+
function removeProtocol(e) {
|
|
724
853
|
return e.replace(/http(s)?:/, "");
|
|
725
854
|
}
|
|
726
|
-
function
|
|
727
|
-
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"),
|
|
728
|
-
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e +
|
|
855
|
+
function updateQueryParam(e = "", t, n) {
|
|
856
|
+
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), r = e.indexOf("?") !== -1 ? "&" : "?";
|
|
857
|
+
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + r + t + "=" + encodeURIComponent(n);
|
|
729
858
|
}
|
|
730
|
-
function
|
|
859
|
+
function getShopifyImageUrl(e, t) {
|
|
731
860
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
732
861
|
return e;
|
|
733
862
|
if (t === "master")
|
|
734
|
-
return
|
|
863
|
+
return removeProtocol(e);
|
|
735
864
|
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
736
865
|
if (n) {
|
|
737
|
-
const o = e.split(n[0]),
|
|
738
|
-
return
|
|
866
|
+
const o = e.split(n[0]), r = n[3], i = t.match("x") ? t : `${t}x`;
|
|
867
|
+
return removeProtocol(`${o[0]}_${i}${r}`);
|
|
739
868
|
}
|
|
740
869
|
return null;
|
|
741
870
|
}
|
|
742
|
-
function
|
|
871
|
+
function getSrcSet(e) {
|
|
743
872
|
if (!e)
|
|
744
873
|
return e;
|
|
745
874
|
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
746
875
|
if (e.match(/builder\.io/)) {
|
|
747
876
|
let n = e;
|
|
748
877
|
const o = Number(e.split("?width=")[1]);
|
|
749
|
-
return isNaN(o) || (n = `${n} ${o}w`), t.filter((
|
|
878
|
+
return isNaN(o) || (n = `${n} ${o}w`), t.filter((r) => r !== o).map((r) => `${updateQueryParam(e, "width", r)} ${r}w`).concat([n]).join(", ");
|
|
750
879
|
}
|
|
751
|
-
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [
|
|
880
|
+
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
|
|
752
881
|
}
|
|
753
|
-
const
|
|
882
|
+
const getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
|
|
754
883
|
...t,
|
|
755
884
|
testVariationId: t.id,
|
|
756
885
|
id: e == null ? void 0 : e.id
|
|
757
|
-
})),
|
|
886
|
+
})), checkShouldRunVariants = ({
|
|
758
887
|
canTrack: e,
|
|
759
888
|
content: t
|
|
760
|
-
}) => !(!(
|
|
761
|
-
function
|
|
889
|
+
}) => !(!(getVariants(t).length > 0) || !e || isBrowser());
|
|
890
|
+
function bldrAbTest(e, t, n) {
|
|
762
891
|
var a;
|
|
763
892
|
function o() {
|
|
764
|
-
function c(
|
|
765
|
-
let
|
|
893
|
+
function c(f, d, b) {
|
|
894
|
+
let y = "";
|
|
766
895
|
if (b) {
|
|
767
|
-
const
|
|
768
|
-
|
|
896
|
+
const g = /* @__PURE__ */ new Date();
|
|
897
|
+
g.setTime(g.getTime() + b * 24 * 60 * 60 * 1e3), y = "; expires=" + g.toUTCString();
|
|
769
898
|
}
|
|
770
|
-
document.cookie =
|
|
899
|
+
document.cookie = f + "=" + (d || "") + y + "; path=/; Secure; SameSite=None";
|
|
771
900
|
}
|
|
772
|
-
function s(
|
|
773
|
-
const d =
|
|
774
|
-
for (let
|
|
775
|
-
let
|
|
776
|
-
for (;
|
|
777
|
-
|
|
778
|
-
if (
|
|
779
|
-
return
|
|
901
|
+
function s(f) {
|
|
902
|
+
const d = f + "=", b = document.cookie.split(";");
|
|
903
|
+
for (let y = 0; y < b.length; y++) {
|
|
904
|
+
let g = b[y];
|
|
905
|
+
for (; g.charAt(0) === " "; )
|
|
906
|
+
g = g.substring(1, g.length);
|
|
907
|
+
if (g.indexOf(d) === 0)
|
|
908
|
+
return g.substring(d.length, g.length);
|
|
780
909
|
}
|
|
781
910
|
return null;
|
|
782
911
|
}
|
|
783
|
-
const u = `builder.tests.${e}`,
|
|
784
|
-
if (
|
|
785
|
-
return
|
|
912
|
+
const u = `builder.tests.${e}`, m = s(u), h = t.map((f) => f.id).concat(e);
|
|
913
|
+
if (m && h.includes(m))
|
|
914
|
+
return m;
|
|
786
915
|
let p = 0;
|
|
787
|
-
const
|
|
788
|
-
for (let
|
|
789
|
-
const d = t[
|
|
790
|
-
if (p += b,
|
|
916
|
+
const l = Math.random();
|
|
917
|
+
for (let f = 0; f < t.length; f++) {
|
|
918
|
+
const d = t[f], b = d.testRatio;
|
|
919
|
+
if (p += b, l < p)
|
|
791
920
|
return c(u, d.id), d.id;
|
|
792
921
|
}
|
|
793
922
|
return c(u, e), e;
|
|
794
923
|
}
|
|
795
|
-
const
|
|
924
|
+
const r = o(), i = (a = document.currentScript) == null ? void 0 : a.previousElementSibling;
|
|
796
925
|
if (n) {
|
|
797
|
-
|
|
926
|
+
i.remove();
|
|
798
927
|
const c = document.currentScript;
|
|
799
928
|
c == null || c.remove();
|
|
800
929
|
} else {
|
|
801
930
|
const c = t.concat({
|
|
802
931
|
id: e
|
|
803
|
-
}).filter((s) => s.id !==
|
|
932
|
+
}).filter((s) => s.id !== r).map((s) => `.variant-${s.id} { display: none; }
|
|
804
933
|
`).join("");
|
|
805
|
-
|
|
934
|
+
i.innerHTML = c;
|
|
806
935
|
}
|
|
807
936
|
}
|
|
808
|
-
function
|
|
937
|
+
function bldrCntntScrpt(e, t, n) {
|
|
809
938
|
var s;
|
|
810
939
|
if (!navigator.cookieEnabled)
|
|
811
940
|
return;
|
|
812
941
|
function o(u) {
|
|
813
|
-
const
|
|
814
|
-
for (let p = 0; p <
|
|
815
|
-
let
|
|
816
|
-
for (;
|
|
817
|
-
|
|
818
|
-
if (
|
|
819
|
-
return
|
|
942
|
+
const m = u + "=", h = document.cookie.split(";");
|
|
943
|
+
for (let p = 0; p < h.length; p++) {
|
|
944
|
+
let l = h[p];
|
|
945
|
+
for (; l.charAt(0) === " "; )
|
|
946
|
+
l = l.substring(1, l.length);
|
|
947
|
+
if (l.indexOf(m) === 0)
|
|
948
|
+
return l.substring(m.length, l.length);
|
|
820
949
|
}
|
|
821
950
|
return null;
|
|
822
951
|
}
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
952
|
+
const r = `builder.tests.${t}`, i = o(r), a = (s = document.currentScript) == null ? void 0 : s.parentElement, c = e === t;
|
|
953
|
+
if (i === e) {
|
|
825
954
|
if (c)
|
|
826
955
|
return;
|
|
827
956
|
a == null || a.removeAttribute("hidden"), a == null || a.removeAttribute("aria-hidden");
|
|
@@ -830,18 +959,18 @@ function mt(e, t, n) {
|
|
|
830
959
|
return;
|
|
831
960
|
}
|
|
832
961
|
}
|
|
833
|
-
const
|
|
834
|
-
const e =
|
|
962
|
+
const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), AB_TEST_FN_NAME = "builderIoAbTest", CONTENT_FN_NAME = "builderIoRenderContent", getScriptString = () => {
|
|
963
|
+
const e = bldrAbTest.toString().replace(/\s+/g, " "), t = bldrCntntScrpt.toString().replace(/\s+/g, " ");
|
|
835
964
|
return `
|
|
836
|
-
window.${
|
|
837
|
-
window.${
|
|
965
|
+
window.${AB_TEST_FN_NAME} = ${e}
|
|
966
|
+
window.${CONTENT_FN_NAME} = ${t}
|
|
838
967
|
`;
|
|
839
|
-
},
|
|
840
|
-
window.${
|
|
968
|
+
}, getVariantsScriptString = (e, t) => `
|
|
969
|
+
window.${AB_TEST_FN_NAME}("${t}",${JSON.stringify(e)}, ${isHydrationTarget})`, getRenderContentScriptString = ({
|
|
841
970
|
contentId: e,
|
|
842
971
|
variationId: t
|
|
843
972
|
}) => `
|
|
844
|
-
window.${
|
|
973
|
+
window.${CONTENT_FN_NAME}("${t}", "${e}", ${isHydrationTarget})`, componentInfo$a = {
|
|
845
974
|
name: "Core:Button",
|
|
846
975
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
847
976
|
defaultStyles: {
|
|
@@ -874,7 +1003,7 @@ const ft = (e) => e === "react" || e === "reactNative", ue = ft(I), de = "builde
|
|
|
874
1003
|
}],
|
|
875
1004
|
static: !0,
|
|
876
1005
|
noWrap: !0
|
|
877
|
-
},
|
|
1006
|
+
}, componentInfo$9 = {
|
|
878
1007
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
879
1008
|
name: "Columns",
|
|
880
1009
|
isRSC: !0,
|
|
@@ -1053,7 +1182,7 @@ const ft = (e) => e === "react" || e === "reactNative", ue = ft(I), de = "builde
|
|
|
1053
1182
|
});
|
|
1054
1183
|
}
|
|
1055
1184
|
const n = e.get("columns");
|
|
1056
|
-
Array.isArray(n) && n.find((
|
|
1185
|
+
Array.isArray(n) && n.find((r) => r.get("width")) && (n.find((i) => !i.get("width")) || n.reduce((c, s) => c + s.get("width"), 0) !== 100) && t();
|
|
1057
1186
|
}
|
|
1058
1187
|
}, {
|
|
1059
1188
|
name: "space",
|
|
@@ -1075,13 +1204,13 @@ const ft = (e) => e === "react" || e === "reactNative", ue = ft(I), de = "builde
|
|
|
1075
1204
|
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
1076
1205
|
advanced: !0
|
|
1077
1206
|
}]
|
|
1078
|
-
},
|
|
1207
|
+
}, componentInfo$8 = {
|
|
1079
1208
|
name: "Fragment",
|
|
1080
1209
|
static: !0,
|
|
1081
1210
|
hidden: !0,
|
|
1082
1211
|
canHaveChildren: !0,
|
|
1083
1212
|
noWrap: !0
|
|
1084
|
-
},
|
|
1213
|
+
}, componentInfo$7 = {
|
|
1085
1214
|
name: "Image",
|
|
1086
1215
|
static: !0,
|
|
1087
1216
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -1103,27 +1232,27 @@ const ft = (e) => e === "react" || e === "reactNative", ue = ft(I), de = "builde
|
|
|
1103
1232
|
e.delete("srcset"), e.delete("noWebp");
|
|
1104
1233
|
function n(a, c = 6e4) {
|
|
1105
1234
|
return new Promise((s, u) => {
|
|
1106
|
-
const
|
|
1107
|
-
let
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
},
|
|
1235
|
+
const m = document.createElement("img");
|
|
1236
|
+
let h = !1;
|
|
1237
|
+
m.onload = () => {
|
|
1238
|
+
h = !0, s(m);
|
|
1239
|
+
}, m.addEventListener("error", (p) => {
|
|
1111
1240
|
console.warn("Image load failed", p.error), u(p.error);
|
|
1112
|
-
}),
|
|
1113
|
-
|
|
1241
|
+
}), m.src = a, setTimeout(() => {
|
|
1242
|
+
h || u(new Error("Image load timed out"));
|
|
1114
1243
|
}, c);
|
|
1115
1244
|
});
|
|
1116
1245
|
}
|
|
1117
1246
|
function o(a) {
|
|
1118
1247
|
return Math.round(a * 1e3) / 1e3;
|
|
1119
1248
|
}
|
|
1120
|
-
const
|
|
1121
|
-
if (fetch(
|
|
1249
|
+
const r = e.get("image"), i = e.get("aspectRatio");
|
|
1250
|
+
if (fetch(r).then((a) => a.blob()).then((a) => {
|
|
1122
1251
|
a.type.includes("svg") && e.set("noWebp", !0);
|
|
1123
|
-
}),
|
|
1124
|
-
return n(
|
|
1252
|
+
}), r && (!i || i === 0.7041))
|
|
1253
|
+
return n(r).then((a) => {
|
|
1125
1254
|
const c = e.get("aspectRatio");
|
|
1126
|
-
e.get("image") ===
|
|
1255
|
+
e.get("image") === r && (!c || c === 0.7041) && a.width && a.height && (e.set("aspectRatio", o(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
|
|
1127
1256
|
});
|
|
1128
1257
|
}
|
|
1129
1258
|
}, {
|
|
@@ -1181,7 +1310,7 @@ const ft = (e) => e === "react" || e === "reactNative", ue = ft(I), de = "builde
|
|
|
1181
1310
|
advanced: !0,
|
|
1182
1311
|
defaultValue: 0.7041
|
|
1183
1312
|
}]
|
|
1184
|
-
},
|
|
1313
|
+
}, componentInfo$6 = {
|
|
1185
1314
|
name: "Core:Section",
|
|
1186
1315
|
static: !0,
|
|
1187
1316
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -1220,7 +1349,7 @@ const ft = (e) => e === "react" || e === "reactNative", ue = ft(I), de = "builde
|
|
|
1220
1349
|
}
|
|
1221
1350
|
}
|
|
1222
1351
|
}]
|
|
1223
|
-
},
|
|
1352
|
+
}, componentInfo$5 = {
|
|
1224
1353
|
name: "Symbol",
|
|
1225
1354
|
noWrap: !0,
|
|
1226
1355
|
static: !0,
|
|
@@ -1253,7 +1382,7 @@ const ft = (e) => e === "react" || e === "reactNative", ue = ft(I), de = "builde
|
|
|
1253
1382
|
hideFromUI: !0,
|
|
1254
1383
|
type: "boolean"
|
|
1255
1384
|
}]
|
|
1256
|
-
},
|
|
1385
|
+
}, componentInfo$4 = {
|
|
1257
1386
|
name: "Text",
|
|
1258
1387
|
static: !0,
|
|
1259
1388
|
isRSC: !0,
|
|
@@ -1272,9 +1401,9 @@ const ft = (e) => e === "react" || e === "reactNative", ue = ft(I), de = "builde
|
|
|
1272
1401
|
textAlign: "center"
|
|
1273
1402
|
}
|
|
1274
1403
|
};
|
|
1275
|
-
function
|
|
1404
|
+
function Text(e) {
|
|
1276
1405
|
var t;
|
|
1277
|
-
return /* @__PURE__ */
|
|
1406
|
+
return /* @__PURE__ */ jsx(
|
|
1278
1407
|
"div",
|
|
1279
1408
|
{
|
|
1280
1409
|
className: "builder-text",
|
|
@@ -1285,7 +1414,7 @@ function Ct(e) {
|
|
|
1285
1414
|
}
|
|
1286
1415
|
);
|
|
1287
1416
|
}
|
|
1288
|
-
const
|
|
1417
|
+
const componentInfo$3 = {
|
|
1289
1418
|
name: "Video",
|
|
1290
1419
|
canHaveChildren: !0,
|
|
1291
1420
|
defaultStyles: {
|
|
@@ -1366,7 +1495,7 @@ const It = {
|
|
|
1366
1495
|
defaultValue: !0,
|
|
1367
1496
|
advanced: !0
|
|
1368
1497
|
}]
|
|
1369
|
-
},
|
|
1498
|
+
}, componentInfo$2 = {
|
|
1370
1499
|
name: "Embed",
|
|
1371
1500
|
static: !0,
|
|
1372
1501
|
inputs: [{
|
|
@@ -1391,7 +1520,7 @@ const It = {
|
|
|
1391
1520
|
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
1392
1521
|
hideFromUI: !0
|
|
1393
1522
|
}]
|
|
1394
|
-
},
|
|
1523
|
+
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type), componentInfo$1 = {
|
|
1395
1524
|
// friendlyName?
|
|
1396
1525
|
name: "Raw:Img",
|
|
1397
1526
|
hideFromInsertMenu: !0,
|
|
@@ -1405,7 +1534,7 @@ const It = {
|
|
|
1405
1534
|
}],
|
|
1406
1535
|
noWrap: !0,
|
|
1407
1536
|
static: !0
|
|
1408
|
-
},
|
|
1537
|
+
}, componentInfo = {
|
|
1409
1538
|
name: "Custom Code",
|
|
1410
1539
|
static: !0,
|
|
1411
1540
|
requiredPermissions: ["editCode"],
|
|
@@ -1427,59 +1556,59 @@ const It = {
|
|
|
1427
1556
|
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
1428
1557
|
advanced: !0
|
|
1429
1558
|
}]
|
|
1430
|
-
},
|
|
1431
|
-
component:
|
|
1432
|
-
...
|
|
1559
|
+
}, getDefaultRegisteredComponents = () => [{
|
|
1560
|
+
component: Button,
|
|
1561
|
+
...componentInfo$a
|
|
1433
1562
|
}, {
|
|
1434
|
-
component:
|
|
1435
|
-
...
|
|
1563
|
+
component: Columns,
|
|
1564
|
+
...componentInfo$9
|
|
1436
1565
|
}, {
|
|
1437
|
-
component:
|
|
1438
|
-
...
|
|
1566
|
+
component: CustomCode,
|
|
1567
|
+
...componentInfo
|
|
1439
1568
|
}, {
|
|
1440
|
-
component:
|
|
1441
|
-
...
|
|
1569
|
+
component: Embed,
|
|
1570
|
+
...componentInfo$2
|
|
1442
1571
|
}, {
|
|
1443
|
-
component:
|
|
1444
|
-
...
|
|
1572
|
+
component: FragmentComponent,
|
|
1573
|
+
...componentInfo$8
|
|
1445
1574
|
}, {
|
|
1446
|
-
component:
|
|
1447
|
-
...
|
|
1575
|
+
component: Image,
|
|
1576
|
+
...componentInfo$7
|
|
1448
1577
|
}, {
|
|
1449
|
-
component:
|
|
1450
|
-
...
|
|
1578
|
+
component: ImgComponent,
|
|
1579
|
+
...componentInfo$1
|
|
1451
1580
|
}, {
|
|
1452
|
-
component:
|
|
1453
|
-
...
|
|
1581
|
+
component: SectionComponent,
|
|
1582
|
+
...componentInfo$6
|
|
1454
1583
|
}, {
|
|
1455
|
-
component:
|
|
1456
|
-
...
|
|
1584
|
+
component: Symbol$1,
|
|
1585
|
+
...componentInfo$5
|
|
1457
1586
|
}, {
|
|
1458
|
-
component:
|
|
1459
|
-
...
|
|
1587
|
+
component: Text,
|
|
1588
|
+
...componentInfo$4
|
|
1460
1589
|
}, {
|
|
1461
|
-
component:
|
|
1462
|
-
...
|
|
1463
|
-
}],
|
|
1590
|
+
component: Video,
|
|
1591
|
+
...componentInfo$3
|
|
1592
|
+
}], components = [], createRegisterComponentMessage = (e) => ({
|
|
1464
1593
|
type: "builder.registerComponent",
|
|
1465
|
-
data:
|
|
1466
|
-
}),
|
|
1594
|
+
data: serializeComponentInfo(e)
|
|
1595
|
+
}), serializeFn = (e) => {
|
|
1467
1596
|
const t = e.toString().trim();
|
|
1468
1597
|
return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
|
|
1469
|
-
},
|
|
1598
|
+
}, serializeValue = (e) => typeof e == "function" ? serializeFn(e) : fastClone(e), serializeComponentInfo = ({
|
|
1470
1599
|
inputs: e,
|
|
1471
1600
|
...t
|
|
1472
1601
|
}) => ({
|
|
1473
|
-
...
|
|
1474
|
-
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [
|
|
1602
|
+
...fastClone(t),
|
|
1603
|
+
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [r, i]) => ({
|
|
1475
1604
|
...o,
|
|
1476
|
-
[
|
|
1605
|
+
[r]: serializeValue(i)
|
|
1477
1606
|
}), {}))
|
|
1478
|
-
}),
|
|
1479
|
-
var
|
|
1480
|
-
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((
|
|
1481
|
-
let
|
|
1482
|
-
if (o && t && n && (
|
|
1607
|
+
}), getCssFromFont = (e) => {
|
|
1608
|
+
var i;
|
|
1609
|
+
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((i = e == null ? void 0 : e.files) == null ? void 0 : i.regular);
|
|
1610
|
+
let r = "";
|
|
1611
|
+
if (o && t && n && (r += `
|
|
1483
1612
|
@font-face {
|
|
1484
1613
|
font-family: "${t}";
|
|
1485
1614
|
src: local("${n}"), url('${o}') format('woff2');
|
|
@@ -1491,7 +1620,7 @@ font-weight: 400;
|
|
|
1491
1620
|
if (!(String(Number(a)) === a))
|
|
1492
1621
|
continue;
|
|
1493
1622
|
const s = e.files[a];
|
|
1494
|
-
s && s !== o && (
|
|
1623
|
+
s && s !== o && (r += `
|
|
1495
1624
|
@font-face {
|
|
1496
1625
|
font-family: "${t}";
|
|
1497
1626
|
src: url('${s}') format('woff2');
|
|
@@ -1500,23 +1629,23 @@ font-weight: ${a};
|
|
|
1500
1629
|
}
|
|
1501
1630
|
`.trim());
|
|
1502
1631
|
}
|
|
1503
|
-
return
|
|
1504
|
-
},
|
|
1632
|
+
return r;
|
|
1633
|
+
}, getFontCss = ({
|
|
1505
1634
|
customFonts: e
|
|
1506
1635
|
}) => {
|
|
1507
1636
|
var t;
|
|
1508
|
-
return ((t = e == null ? void 0 : e.map((n) =>
|
|
1509
|
-
},
|
|
1637
|
+
return ((t = e == null ? void 0 : e.map((n) => getCssFromFont(n))) == null ? void 0 : t.join(" ")) || "";
|
|
1638
|
+
}, getCss = ({
|
|
1510
1639
|
cssCode: e,
|
|
1511
1640
|
contentId: t
|
|
1512
1641
|
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
|
|
1513
|
-
function
|
|
1642
|
+
function ContentStyles(e) {
|
|
1514
1643
|
const t = `
|
|
1515
|
-
${
|
|
1644
|
+
${getCss({
|
|
1516
1645
|
cssCode: e.cssCode,
|
|
1517
1646
|
contentId: e.contentId
|
|
1518
1647
|
})}
|
|
1519
|
-
${
|
|
1648
|
+
${getFontCss({
|
|
1520
1649
|
customFonts: e.customFonts
|
|
1521
1650
|
})}
|
|
1522
1651
|
|
|
@@ -1533,20 +1662,20 @@ ${Pt({
|
|
|
1533
1662
|
font-family: inherit;
|
|
1534
1663
|
}
|
|
1535
1664
|
`.trim();
|
|
1536
|
-
return /* @__PURE__ */
|
|
1665
|
+
return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
|
|
1537
1666
|
}
|
|
1538
|
-
const
|
|
1667
|
+
const getContextStateInitialValue = ({
|
|
1539
1668
|
content: e,
|
|
1540
1669
|
data: t,
|
|
1541
1670
|
locale: n
|
|
1542
1671
|
}) => {
|
|
1543
|
-
var
|
|
1672
|
+
var i, a, c;
|
|
1544
1673
|
const o = {};
|
|
1545
|
-
(a = (
|
|
1674
|
+
(a = (i = e == null ? void 0 : e.data) == null ? void 0 : i.inputs) == null || a.forEach((s) => {
|
|
1546
1675
|
var u;
|
|
1547
1676
|
s.name && s.defaultValue !== void 0 && ((u = e == null ? void 0 : e.data) != null && u.state) && e.data.state[s.name] === void 0 && (o[s.name] = s.defaultValue);
|
|
1548
1677
|
});
|
|
1549
|
-
const
|
|
1678
|
+
const r = {
|
|
1550
1679
|
...(c = e == null ? void 0 : e.data) == null ? void 0 : c.state,
|
|
1551
1680
|
...t,
|
|
1552
1681
|
...n ? {
|
|
@@ -1555,9 +1684,9 @@ const Wt = ({
|
|
|
1555
1684
|
};
|
|
1556
1685
|
return {
|
|
1557
1686
|
...o,
|
|
1558
|
-
...
|
|
1687
|
+
...r
|
|
1559
1688
|
};
|
|
1560
|
-
},
|
|
1689
|
+
}, getContentInitialValue = ({
|
|
1561
1690
|
content: e,
|
|
1562
1691
|
data: t
|
|
1563
1692
|
}) => e ? {
|
|
@@ -1568,22 +1697,22 @@ const Wt = ({
|
|
|
1568
1697
|
},
|
|
1569
1698
|
meta: e == null ? void 0 : e.meta
|
|
1570
1699
|
} : void 0;
|
|
1571
|
-
function
|
|
1700
|
+
function getGlobalThis() {
|
|
1572
1701
|
return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
|
|
1573
1702
|
}
|
|
1574
|
-
function
|
|
1575
|
-
const e =
|
|
1703
|
+
function getFetch() {
|
|
1704
|
+
const e = getGlobalThis().fetch;
|
|
1576
1705
|
if (typeof e > "u")
|
|
1577
1706
|
throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
1578
1707
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
|
|
1579
1708
|
return e;
|
|
1580
1709
|
}
|
|
1581
|
-
const
|
|
1710
|
+
const fetch$1 = getFetch(), getTopLevelDomain = (e) => {
|
|
1582
1711
|
if (e === "localhost" || e === "127.0.0.1")
|
|
1583
1712
|
return e;
|
|
1584
1713
|
const t = e.split(".");
|
|
1585
1714
|
return t.length > 2 ? t.slice(1).join(".") : e;
|
|
1586
|
-
},
|
|
1715
|
+
}, getCookieSync = ({
|
|
1587
1716
|
name: e,
|
|
1588
1717
|
canTrack: t
|
|
1589
1718
|
}) => {
|
|
@@ -1591,17 +1720,17 @@ const Ut = Mt(), _t = (e) => {
|
|
|
1591
1720
|
try {
|
|
1592
1721
|
return t ? (n = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : n.split("=")[1] : void 0;
|
|
1593
1722
|
} catch (o) {
|
|
1594
|
-
|
|
1723
|
+
logger.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
|
|
1595
1724
|
return;
|
|
1596
1725
|
}
|
|
1597
|
-
},
|
|
1726
|
+
}, getCookie = async (e) => getCookieSync(e), stringifyCookie = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(checkIsDefined).join("; "), SECURE_CONFIG = [["secure", ""], ["SameSite", "None"]], createCookieString = ({
|
|
1598
1727
|
name: e,
|
|
1599
1728
|
value: t,
|
|
1600
1729
|
expires: n
|
|
1601
1730
|
}) => {
|
|
1602
|
-
const
|
|
1603
|
-
return
|
|
1604
|
-
},
|
|
1731
|
+
const r = (isBrowser() ? location.protocol === "https:" : !0) ? SECURE_CONFIG : [[]], i = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...i, ["path", "/"], ["domain", getTopLevelDomain(window.location.hostname)], ...r];
|
|
1732
|
+
return stringifyCookie(a);
|
|
1733
|
+
}, setCookie = async ({
|
|
1605
1734
|
name: e,
|
|
1606
1735
|
value: t,
|
|
1607
1736
|
expires: n,
|
|
@@ -1610,98 +1739,98 @@ const Ut = Mt(), _t = (e) => {
|
|
|
1610
1739
|
try {
|
|
1611
1740
|
if (!o)
|
|
1612
1741
|
return;
|
|
1613
|
-
const
|
|
1742
|
+
const r = createCookieString({
|
|
1614
1743
|
name: e,
|
|
1615
1744
|
value: t,
|
|
1616
1745
|
expires: n
|
|
1617
1746
|
});
|
|
1618
|
-
document.cookie =
|
|
1619
|
-
} catch (
|
|
1620
|
-
|
|
1747
|
+
document.cookie = r;
|
|
1748
|
+
} catch (r) {
|
|
1749
|
+
logger.warn("[COOKIE] SET error: ", (r == null ? void 0 : r.message) || r);
|
|
1621
1750
|
}
|
|
1622
1751
|
};
|
|
1623
|
-
function
|
|
1752
|
+
function uuidv4() {
|
|
1624
1753
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
1625
1754
|
const t = Math.random() * 16 | 0;
|
|
1626
1755
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
1627
1756
|
});
|
|
1628
1757
|
}
|
|
1629
|
-
function
|
|
1630
|
-
return
|
|
1758
|
+
function uuid() {
|
|
1759
|
+
return uuidv4().replace(/-/g, "");
|
|
1631
1760
|
}
|
|
1632
|
-
const
|
|
1761
|
+
const SESSION_LOCAL_STORAGE_KEY = "builderSessionId", getSessionId = async ({
|
|
1633
1762
|
canTrack: e
|
|
1634
1763
|
}) => {
|
|
1635
1764
|
if (!e)
|
|
1636
1765
|
return;
|
|
1637
|
-
const t = await
|
|
1638
|
-
name:
|
|
1766
|
+
const t = await getCookie({
|
|
1767
|
+
name: SESSION_LOCAL_STORAGE_KEY,
|
|
1639
1768
|
canTrack: e
|
|
1640
1769
|
});
|
|
1641
|
-
if (
|
|
1770
|
+
if (checkIsDefined(t))
|
|
1642
1771
|
return t;
|
|
1643
1772
|
{
|
|
1644
|
-
const n =
|
|
1645
|
-
return
|
|
1773
|
+
const n = createSessionId();
|
|
1774
|
+
return setSessionId({
|
|
1646
1775
|
id: n,
|
|
1647
1776
|
canTrack: e
|
|
1648
1777
|
}), n;
|
|
1649
1778
|
}
|
|
1650
|
-
},
|
|
1779
|
+
}, createSessionId = () => uuid(), setSessionId = ({
|
|
1651
1780
|
id: e,
|
|
1652
1781
|
canTrack: t
|
|
1653
|
-
}) =>
|
|
1654
|
-
name:
|
|
1782
|
+
}) => setCookie({
|
|
1783
|
+
name: SESSION_LOCAL_STORAGE_KEY,
|
|
1655
1784
|
value: e,
|
|
1656
1785
|
canTrack: t
|
|
1657
|
-
}),
|
|
1786
|
+
}), getLocalStorage = () => isBrowser() && typeof localStorage < "u" ? localStorage : void 0, getLocalStorageItem = ({
|
|
1658
1787
|
key: e,
|
|
1659
1788
|
canTrack: t
|
|
1660
1789
|
}) => {
|
|
1661
1790
|
var n;
|
|
1662
1791
|
try {
|
|
1663
|
-
return t ? (n =
|
|
1792
|
+
return t ? (n = getLocalStorage()) == null ? void 0 : n.getItem(e) : void 0;
|
|
1664
1793
|
} catch (o) {
|
|
1665
1794
|
console.debug("[LocalStorage] GET error: ", o);
|
|
1666
1795
|
return;
|
|
1667
1796
|
}
|
|
1668
|
-
},
|
|
1797
|
+
}, setLocalStorageItem = ({
|
|
1669
1798
|
key: e,
|
|
1670
1799
|
canTrack: t,
|
|
1671
1800
|
value: n
|
|
1672
1801
|
}) => {
|
|
1673
1802
|
var o;
|
|
1674
1803
|
try {
|
|
1675
|
-
t && ((o =
|
|
1676
|
-
} catch (
|
|
1677
|
-
console.debug("[LocalStorage] SET error: ",
|
|
1804
|
+
t && ((o = getLocalStorage()) == null || o.setItem(e, n));
|
|
1805
|
+
} catch (r) {
|
|
1806
|
+
console.debug("[LocalStorage] SET error: ", r);
|
|
1678
1807
|
}
|
|
1679
|
-
},
|
|
1808
|
+
}, VISITOR_LOCAL_STORAGE_KEY = "builderVisitorId", getVisitorId = ({
|
|
1680
1809
|
canTrack: e
|
|
1681
1810
|
}) => {
|
|
1682
1811
|
if (!e)
|
|
1683
1812
|
return;
|
|
1684
|
-
const t =
|
|
1685
|
-
key:
|
|
1813
|
+
const t = getLocalStorageItem({
|
|
1814
|
+
key: VISITOR_LOCAL_STORAGE_KEY,
|
|
1686
1815
|
canTrack: e
|
|
1687
1816
|
});
|
|
1688
|
-
if (
|
|
1817
|
+
if (checkIsDefined(t))
|
|
1689
1818
|
return t;
|
|
1690
1819
|
{
|
|
1691
|
-
const n =
|
|
1692
|
-
return
|
|
1820
|
+
const n = createVisitorId();
|
|
1821
|
+
return setVisitorId({
|
|
1693
1822
|
id: n,
|
|
1694
1823
|
canTrack: e
|
|
1695
1824
|
}), n;
|
|
1696
1825
|
}
|
|
1697
|
-
},
|
|
1826
|
+
}, createVisitorId = () => uuid(), setVisitorId = ({
|
|
1698
1827
|
id: e,
|
|
1699
1828
|
canTrack: t
|
|
1700
|
-
}) =>
|
|
1701
|
-
key:
|
|
1829
|
+
}) => setLocalStorageItem({
|
|
1830
|
+
key: VISITOR_LOCAL_STORAGE_KEY,
|
|
1702
1831
|
value: e,
|
|
1703
1832
|
canTrack: t
|
|
1704
|
-
}),
|
|
1833
|
+
}), getTrackingEventData = async ({
|
|
1705
1834
|
canTrack: e
|
|
1706
1835
|
}) => {
|
|
1707
1836
|
if (!e)
|
|
@@ -1709,46 +1838,46 @@ const be = "builderSessionId", zt = async ({
|
|
|
1709
1838
|
visitorId: void 0,
|
|
1710
1839
|
sessionId: void 0
|
|
1711
1840
|
};
|
|
1712
|
-
const t = await
|
|
1841
|
+
const t = await getSessionId({
|
|
1713
1842
|
canTrack: e
|
|
1714
|
-
}), n =
|
|
1843
|
+
}), n = getVisitorId({
|
|
1715
1844
|
canTrack: e
|
|
1716
1845
|
});
|
|
1717
1846
|
return {
|
|
1718
1847
|
sessionId: t,
|
|
1719
1848
|
visitorId: n
|
|
1720
1849
|
};
|
|
1721
|
-
},
|
|
1850
|
+
}, createEvent = async ({
|
|
1722
1851
|
type: e,
|
|
1723
1852
|
canTrack: t,
|
|
1724
1853
|
apiKey: n,
|
|
1725
1854
|
metadata: o,
|
|
1726
|
-
...
|
|
1855
|
+
...r
|
|
1727
1856
|
}) => ({
|
|
1728
1857
|
type: e,
|
|
1729
1858
|
data: {
|
|
1730
|
-
...
|
|
1859
|
+
...r,
|
|
1731
1860
|
metadata: {
|
|
1732
1861
|
url: location.href,
|
|
1733
1862
|
...o
|
|
1734
1863
|
},
|
|
1735
|
-
...await
|
|
1864
|
+
...await getTrackingEventData({
|
|
1736
1865
|
canTrack: t
|
|
1737
1866
|
}),
|
|
1738
|
-
userAttributes:
|
|
1867
|
+
userAttributes: getUserAttributes(),
|
|
1739
1868
|
ownerId: n
|
|
1740
1869
|
}
|
|
1741
1870
|
});
|
|
1742
|
-
async function
|
|
1871
|
+
async function _track(e) {
|
|
1743
1872
|
if (!e.apiKey) {
|
|
1744
|
-
|
|
1873
|
+
logger.error("Missing API key for track call. Please provide your API key.");
|
|
1745
1874
|
return;
|
|
1746
1875
|
}
|
|
1747
|
-
if (e.canTrack && !
|
|
1876
|
+
if (e.canTrack && !isEditing() && (isBrowser() || TARGET === "reactNative"))
|
|
1748
1877
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
1749
1878
|
method: "POST",
|
|
1750
1879
|
body: JSON.stringify({
|
|
1751
|
-
events: [await
|
|
1880
|
+
events: [await createEvent(e)]
|
|
1752
1881
|
}),
|
|
1753
1882
|
headers: {
|
|
1754
1883
|
"content-type": "application/json"
|
|
@@ -1758,13 +1887,13 @@ async function nn(e) {
|
|
|
1758
1887
|
console.error("Failed to track: ", t);
|
|
1759
1888
|
});
|
|
1760
1889
|
}
|
|
1761
|
-
const
|
|
1890
|
+
const track = (e) => _track({
|
|
1762
1891
|
...e,
|
|
1763
1892
|
canTrack: !0
|
|
1764
|
-
}),
|
|
1765
|
-
function
|
|
1766
|
-
let n =
|
|
1767
|
-
if (n || (n =
|
|
1893
|
+
}), SDK_VERSION = "0.7.1-2", registry = {};
|
|
1894
|
+
function register(e, t) {
|
|
1895
|
+
let n = registry[e];
|
|
1896
|
+
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
1768
1897
|
const o = {
|
|
1769
1898
|
type: "builder.register",
|
|
1770
1899
|
data: {
|
|
@@ -1774,13 +1903,13 @@ function rn(e, t) {
|
|
|
1774
1903
|
};
|
|
1775
1904
|
try {
|
|
1776
1905
|
parent.postMessage(o, "*"), parent !== window && window.postMessage(o, "*");
|
|
1777
|
-
} catch (
|
|
1778
|
-
console.debug("Could not postmessage",
|
|
1906
|
+
} catch (r) {
|
|
1907
|
+
console.debug("Could not postmessage", r);
|
|
1779
1908
|
}
|
|
1780
1909
|
}
|
|
1781
1910
|
}
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1911
|
+
const registerInsertMenu = () => {
|
|
1912
|
+
register("insertMenu", {
|
|
1784
1913
|
name: "_default",
|
|
1785
1914
|
default: !0,
|
|
1786
1915
|
items: [{
|
|
@@ -1802,14 +1931,14 @@ const Un = () => {
|
|
|
1802
1931
|
}]
|
|
1803
1932
|
});
|
|
1804
1933
|
};
|
|
1805
|
-
let
|
|
1806
|
-
const
|
|
1934
|
+
let isSetupForEditing = !1;
|
|
1935
|
+
const setupBrowserForEditing = (e = {}) => {
|
|
1807
1936
|
var t, n;
|
|
1808
|
-
|
|
1937
|
+
isSetupForEditing || (isSetupForEditing = !0, isBrowser() && ((t = window.parent) == null || t.postMessage({
|
|
1809
1938
|
type: "builder.sdkInfo",
|
|
1810
1939
|
data: {
|
|
1811
|
-
target:
|
|
1812
|
-
version:
|
|
1940
|
+
target: TARGET,
|
|
1941
|
+
version: SDK_VERSION,
|
|
1813
1942
|
supportsPatchUpdates: !1,
|
|
1814
1943
|
// Supports builder-model="..." attribute which is needed to
|
|
1815
1944
|
// scope our '+ add block' button styling
|
|
@@ -1824,36 +1953,36 @@ const _n = (e = {}) => {
|
|
|
1824
1953
|
}, "*"), window.addEventListener("message", ({
|
|
1825
1954
|
data: o
|
|
1826
1955
|
}) => {
|
|
1827
|
-
var
|
|
1956
|
+
var r, i;
|
|
1828
1957
|
if (o != null && o.type)
|
|
1829
1958
|
switch (o.type) {
|
|
1830
1959
|
case "builder.evaluate": {
|
|
1831
1960
|
const a = o.data.text, c = o.data.arguments || [], s = o.data.id, u = new Function(a);
|
|
1832
|
-
let
|
|
1961
|
+
let m, h = null;
|
|
1833
1962
|
try {
|
|
1834
|
-
|
|
1963
|
+
m = u.apply(null, c);
|
|
1835
1964
|
} catch (p) {
|
|
1836
|
-
|
|
1965
|
+
h = p;
|
|
1837
1966
|
}
|
|
1838
|
-
|
|
1967
|
+
h ? (r = window.parent) == null || r.postMessage({
|
|
1839
1968
|
type: "builder.evaluateError",
|
|
1840
1969
|
data: {
|
|
1841
1970
|
id: s,
|
|
1842
|
-
error:
|
|
1971
|
+
error: h.message
|
|
1843
1972
|
}
|
|
1844
|
-
}, "*") :
|
|
1845
|
-
var
|
|
1846
|
-
(
|
|
1973
|
+
}, "*") : m && typeof m.then == "function" ? m.then((p) => {
|
|
1974
|
+
var l;
|
|
1975
|
+
(l = window.parent) == null || l.postMessage({
|
|
1847
1976
|
type: "builder.evaluateResult",
|
|
1848
1977
|
data: {
|
|
1849
1978
|
id: s,
|
|
1850
1979
|
result: p
|
|
1851
1980
|
}
|
|
1852
1981
|
}, "*");
|
|
1853
|
-
}).catch(console.error) : (
|
|
1982
|
+
}).catch(console.error) : (i = window.parent) == null || i.postMessage({
|
|
1854
1983
|
type: "builder.evaluateResult",
|
|
1855
1984
|
data: {
|
|
1856
|
-
result:
|
|
1985
|
+
result: m,
|
|
1857
1986
|
id: s
|
|
1858
1987
|
}
|
|
1859
1988
|
}, "*");
|
|
@@ -1862,10 +1991,10 @@ const _n = (e = {}) => {
|
|
|
1862
1991
|
}
|
|
1863
1992
|
})));
|
|
1864
1993
|
};
|
|
1865
|
-
function
|
|
1994
|
+
function round(e) {
|
|
1866
1995
|
return Math.round(e * 1e3) / 1e3;
|
|
1867
1996
|
}
|
|
1868
|
-
const
|
|
1997
|
+
const findParentElement = (e, t, n = !0) => {
|
|
1869
1998
|
if (!(e instanceof HTMLElement))
|
|
1870
1999
|
return null;
|
|
1871
2000
|
let o = n ? e : e.parentElement;
|
|
@@ -1876,73 +2005,73 @@ const an = (e, t, n = !0) => {
|
|
|
1876
2005
|
return o;
|
|
1877
2006
|
} while (o = o.parentElement);
|
|
1878
2007
|
return null;
|
|
1879
|
-
},
|
|
2008
|
+
}, findBuilderParent = (e) => findParentElement(e, (t) => {
|
|
1880
2009
|
const n = t.getAttribute("builder-id") || t.id;
|
|
1881
2010
|
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
1882
|
-
}),
|
|
2011
|
+
}), computeOffset = ({
|
|
1883
2012
|
event: e,
|
|
1884
2013
|
target: t
|
|
1885
2014
|
}) => {
|
|
1886
|
-
const n = t.getBoundingClientRect(), o = e.clientX - n.left,
|
|
2015
|
+
const n = t.getBoundingClientRect(), o = e.clientX - n.left, r = e.clientY - n.top, i = round(o / n.width), a = round(r / n.height);
|
|
1887
2016
|
return {
|
|
1888
|
-
x:
|
|
2017
|
+
x: i,
|
|
1889
2018
|
y: a
|
|
1890
2019
|
};
|
|
1891
|
-
},
|
|
1892
|
-
const t = e.target, n = t &&
|
|
2020
|
+
}, getInteractionPropertiesForEvent = (e) => {
|
|
2021
|
+
const t = e.target, n = t && findBuilderParent(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
1893
2022
|
return {
|
|
1894
2023
|
targetBuilderElement: o || void 0,
|
|
1895
2024
|
metadata: {
|
|
1896
|
-
targetOffset: t ?
|
|
2025
|
+
targetOffset: t ? computeOffset({
|
|
1897
2026
|
event: e,
|
|
1898
2027
|
target: t
|
|
1899
2028
|
}) : void 0,
|
|
1900
|
-
builderTargetOffset: n ?
|
|
2029
|
+
builderTargetOffset: n ? computeOffset({
|
|
1901
2030
|
event: e,
|
|
1902
2031
|
target: n
|
|
1903
2032
|
}) : void 0,
|
|
1904
2033
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
1905
2034
|
}
|
|
1906
2035
|
};
|
|
1907
|
-
},
|
|
2036
|
+
}, BUILDER_STORE_PREFIX = "builder.tests", getContentTestKey = (e) => `${BUILDER_STORE_PREFIX}.${e}`, getContentVariationCookie = ({
|
|
1908
2037
|
contentId: e
|
|
1909
|
-
}) =>
|
|
1910
|
-
name:
|
|
2038
|
+
}) => getCookie({
|
|
2039
|
+
name: getContentTestKey(e),
|
|
1911
2040
|
canTrack: !0
|
|
1912
|
-
}),
|
|
2041
|
+
}), getContentVariationCookieSync = ({
|
|
1913
2042
|
contentId: e
|
|
1914
|
-
}) =>
|
|
1915
|
-
name:
|
|
2043
|
+
}) => getCookieSync({
|
|
2044
|
+
name: getContentTestKey(e),
|
|
1916
2045
|
canTrack: !0
|
|
1917
|
-
}),
|
|
2046
|
+
}), setContentVariationCookie = ({
|
|
1918
2047
|
contentId: e,
|
|
1919
2048
|
value: t
|
|
1920
|
-
}) =>
|
|
1921
|
-
name:
|
|
2049
|
+
}) => setCookie({
|
|
2050
|
+
name: getContentTestKey(e),
|
|
1922
2051
|
value: t,
|
|
1923
2052
|
canTrack: !0
|
|
1924
|
-
}),
|
|
2053
|
+
}), checkIsBuilderContentWithVariations = (e) => checkIsDefined(e.id) && checkIsDefined(e.variations) && Object.keys(e.variations).length > 0, getRandomVariationId = ({
|
|
1925
2054
|
id: e,
|
|
1926
2055
|
variations: t
|
|
1927
2056
|
}) => {
|
|
1928
|
-
var
|
|
2057
|
+
var r;
|
|
1929
2058
|
let n = 0;
|
|
1930
2059
|
const o = Math.random();
|
|
1931
|
-
for (const
|
|
1932
|
-
const a = (
|
|
2060
|
+
for (const i in t) {
|
|
2061
|
+
const a = (r = t[i]) == null ? void 0 : r.testRatio;
|
|
1933
2062
|
if (n += a, o < n)
|
|
1934
|
-
return
|
|
2063
|
+
return i;
|
|
1935
2064
|
}
|
|
1936
2065
|
return e;
|
|
1937
|
-
},
|
|
1938
|
-
const t =
|
|
1939
|
-
return
|
|
2066
|
+
}, getAndSetVariantId = (e) => {
|
|
2067
|
+
const t = getRandomVariationId(e);
|
|
2068
|
+
return setContentVariationCookie({
|
|
1940
2069
|
contentId: e.id,
|
|
1941
2070
|
value: t
|
|
1942
2071
|
}).catch((n) => {
|
|
1943
|
-
|
|
2072
|
+
logger.error("could not store A/B test variation: ", n);
|
|
1944
2073
|
}), t;
|
|
1945
|
-
},
|
|
2074
|
+
}, getTestFields = ({
|
|
1946
2075
|
item: e,
|
|
1947
2076
|
testGroupId: t
|
|
1948
2077
|
}) => {
|
|
@@ -1956,7 +2085,7 @@ const an = (e, t, n = !0) => {
|
|
|
1956
2085
|
testVariationId: n.id,
|
|
1957
2086
|
testVariationName: n.name || (n.id === e.id ? "Default" : "")
|
|
1958
2087
|
};
|
|
1959
|
-
},
|
|
2088
|
+
}, handleABTestingSync = ({
|
|
1960
2089
|
item: e,
|
|
1961
2090
|
canTrack: t
|
|
1962
2091
|
}) => {
|
|
@@ -1964,14 +2093,14 @@ const an = (e, t, n = !0) => {
|
|
|
1964
2093
|
return e;
|
|
1965
2094
|
if (!e)
|
|
1966
2095
|
return;
|
|
1967
|
-
if (!
|
|
2096
|
+
if (!checkIsBuilderContentWithVariations(e))
|
|
1968
2097
|
return e;
|
|
1969
|
-
const n =
|
|
2098
|
+
const n = getContentVariationCookieSync({
|
|
1970
2099
|
contentId: e.id
|
|
1971
|
-
}) ||
|
|
2100
|
+
}) || getAndSetVariantId({
|
|
1972
2101
|
variations: e.variations,
|
|
1973
2102
|
id: e.id
|
|
1974
|
-
}), o =
|
|
2103
|
+
}), o = getTestFields({
|
|
1975
2104
|
item: e,
|
|
1976
2105
|
testGroupId: n
|
|
1977
2106
|
});
|
|
@@ -1979,161 +2108,176 @@ const an = (e, t, n = !0) => {
|
|
|
1979
2108
|
...e,
|
|
1980
2109
|
...o
|
|
1981
2110
|
};
|
|
1982
|
-
},
|
|
2111
|
+
}, handleABTesting = async ({
|
|
1983
2112
|
item: e,
|
|
1984
2113
|
canTrack: t
|
|
1985
2114
|
}) => {
|
|
1986
|
-
if (!t || !
|
|
2115
|
+
if (!t || !checkIsBuilderContentWithVariations(e))
|
|
1987
2116
|
return e;
|
|
1988
|
-
const o = await
|
|
2117
|
+
const o = await getContentVariationCookie({
|
|
1989
2118
|
contentId: e.id
|
|
1990
|
-
}) ||
|
|
2119
|
+
}) || getAndSetVariantId({
|
|
1991
2120
|
variations: e.variations,
|
|
1992
2121
|
id: e.id
|
|
1993
|
-
}),
|
|
2122
|
+
}), r = getTestFields({
|
|
1994
2123
|
item: e,
|
|
1995
2124
|
testGroupId: o
|
|
1996
2125
|
});
|
|
1997
2126
|
return {
|
|
1998
2127
|
...e,
|
|
1999
|
-
...
|
|
2128
|
+
...r
|
|
2000
2129
|
};
|
|
2001
|
-
},
|
|
2130
|
+
}, getDefaultCanTrack = (e) => checkIsDefined(e) ? e : !0, getIdFromSearchParams = (e) => {
|
|
2002
2131
|
const t = e.get("preview"), n = e.get("overrides." + t);
|
|
2003
|
-
return n ||
|
|
2132
|
+
return n || logger.warn("No previewed ID found in search params."), n;
|
|
2004
2133
|
};
|
|
2005
|
-
function
|
|
2006
|
-
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new
|
|
2134
|
+
function init() {
|
|
2135
|
+
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new LRUCache({
|
|
2007
2136
|
max: 500,
|
|
2008
2137
|
// how long to live in ms
|
|
2009
2138
|
ttl: 1e3 * 60 * 5
|
|
2010
2139
|
}));
|
|
2011
2140
|
}
|
|
2012
|
-
function
|
|
2013
|
-
|
|
2014
|
-
const t =
|
|
2141
|
+
function getPreviewContent(e) {
|
|
2142
|
+
init();
|
|
2143
|
+
const t = getIdFromSearchParams(e);
|
|
2015
2144
|
return typeof t == "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t) : void 0;
|
|
2016
2145
|
}
|
|
2017
|
-
function
|
|
2018
|
-
return Object.keys(e).reduce((o,
|
|
2019
|
-
const
|
|
2020
|
-
return [typeof
|
|
2146
|
+
function flatten(e, t = null, n = ".") {
|
|
2147
|
+
return Object.keys(e).reduce((o, r) => {
|
|
2148
|
+
const i = e[r], a = [t, r].filter(Boolean).join(n);
|
|
2149
|
+
return [typeof i == "object", i !== null, !(Array.isArray(i) && i.length === 0)].every(Boolean) ? {
|
|
2021
2150
|
...o,
|
|
2022
|
-
...
|
|
2151
|
+
...flatten(i, a, n)
|
|
2023
2152
|
} : {
|
|
2024
2153
|
...o,
|
|
2025
|
-
[a]:
|
|
2154
|
+
[a]: i
|
|
2026
2155
|
};
|
|
2027
2156
|
}, {});
|
|
2028
2157
|
}
|
|
2029
|
-
const
|
|
2158
|
+
const BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUILDER_OPTIONS_PREFIX = "options.", convertSearchParamsToQueryObject = (e) => {
|
|
2030
2159
|
const t = {};
|
|
2031
2160
|
return e.forEach((n, o) => {
|
|
2032
2161
|
t[o] = n;
|
|
2033
2162
|
}), t;
|
|
2034
|
-
},
|
|
2163
|
+
}, getBuilderSearchParams = (e) => {
|
|
2035
2164
|
if (!e)
|
|
2036
2165
|
return {};
|
|
2037
|
-
const t =
|
|
2166
|
+
const t = normalizeSearchParams(e), n = {};
|
|
2038
2167
|
return Object.keys(t).forEach((o) => {
|
|
2039
|
-
if (o.startsWith(
|
|
2040
|
-
const
|
|
2041
|
-
n[
|
|
2168
|
+
if (o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)) {
|
|
2169
|
+
const r = o.replace(BUILDER_SEARCHPARAMS_PREFIX, "").replace(BUILDER_OPTIONS_PREFIX, "");
|
|
2170
|
+
n[r] = t[o];
|
|
2042
2171
|
}
|
|
2043
2172
|
}), n;
|
|
2044
|
-
},
|
|
2045
|
-
if (!
|
|
2173
|
+
}, getBuilderSearchParamsFromWindow = () => {
|
|
2174
|
+
if (!isBrowser())
|
|
2046
2175
|
return {};
|
|
2047
2176
|
const e = new URLSearchParams(window.location.search);
|
|
2048
|
-
return
|
|
2049
|
-
},
|
|
2177
|
+
return getBuilderSearchParams(e);
|
|
2178
|
+
}, normalizeSearchParams = (e) => e instanceof URLSearchParams ? convertSearchParamsToQueryObject(e) : e, DEFAULT_API_VERSION = "v3", isPositiveNumber = (e) => typeof e == "number" && !isNaN(e) && e >= 0, generateContentUrl = (e) => {
|
|
2050
2179
|
let {
|
|
2051
2180
|
noTraverse: t = !1
|
|
2052
2181
|
} = e;
|
|
2053
2182
|
const {
|
|
2054
2183
|
limit: n = 30,
|
|
2055
2184
|
userAttributes: o,
|
|
2056
|
-
query:
|
|
2057
|
-
model:
|
|
2185
|
+
query: r,
|
|
2186
|
+
model: i,
|
|
2058
2187
|
apiKey: a,
|
|
2059
2188
|
includeRefs: c = !0,
|
|
2060
2189
|
enrich: s,
|
|
2061
2190
|
locale: u,
|
|
2062
|
-
apiVersion:
|
|
2191
|
+
apiVersion: m = DEFAULT_API_VERSION,
|
|
2192
|
+
fields: h,
|
|
2193
|
+
omit: p,
|
|
2194
|
+
offset: l,
|
|
2195
|
+
cacheSeconds: f,
|
|
2196
|
+
staleCacheSeconds: d,
|
|
2197
|
+
sort: b,
|
|
2198
|
+
includeUnpublished: y
|
|
2063
2199
|
} = e;
|
|
2064
2200
|
if (!a)
|
|
2065
2201
|
throw new Error("Missing API key");
|
|
2066
|
-
if (!["v2", "v3"].includes(
|
|
2067
|
-
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${
|
|
2202
|
+
if (!["v2", "v3"].includes(m))
|
|
2203
|
+
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${m}'`);
|
|
2068
2204
|
(e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
|
|
2069
|
-
const g = new URL(`https://cdn.builder.io/api/${
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2205
|
+
const g = new URL(`https://cdn.builder.io/api/${m}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${c}${u ? `&locale=${u}` : ""}${s ? `&enrich=${s}` : ""}`);
|
|
2206
|
+
if (g.searchParams.set("omit", p || "meta.componentsUsed"), h && g.searchParams.set("fields", h), Number.isFinite(l) && l > -1 && g.searchParams.set("offset", String(Math.floor(l))), typeof y == "boolean" && g.searchParams.set("includeUnpublished", String(y)), f && isPositiveNumber(f) && g.searchParams.set("cacheSeconds", String(f)), d && isPositiveNumber(d) && g.searchParams.set("staleCacheSeconds", String(d)), b) {
|
|
2207
|
+
const S = flatten({
|
|
2208
|
+
sort: b
|
|
2209
|
+
});
|
|
2210
|
+
for (const C in S)
|
|
2211
|
+
g.searchParams.set(C, JSON.stringify(S[C]));
|
|
2212
|
+
}
|
|
2213
|
+
const v = {
|
|
2214
|
+
...getBuilderSearchParamsFromWindow(),
|
|
2215
|
+
...normalizeSearchParams(e.options || {})
|
|
2216
|
+
}, x = flatten(v);
|
|
2217
|
+
for (const S in x)
|
|
2218
|
+
g.searchParams.set(S, String(x[S]));
|
|
2219
|
+
if (o && g.searchParams.set("userAttributes", JSON.stringify(o)), r) {
|
|
2220
|
+
const S = flatten({
|
|
2221
|
+
query: r
|
|
2078
2222
|
});
|
|
2079
|
-
for (const
|
|
2080
|
-
g.searchParams.set(
|
|
2223
|
+
for (const C in S)
|
|
2224
|
+
g.searchParams.set(C, JSON.stringify(S[C]));
|
|
2081
2225
|
}
|
|
2082
2226
|
return g;
|
|
2083
|
-
},
|
|
2084
|
-
async function
|
|
2085
|
-
const t = await
|
|
2227
|
+
}, checkContentHasResults = (e) => "results" in e;
|
|
2228
|
+
async function fetchOneEntry(e) {
|
|
2229
|
+
const t = await fetchEntries({
|
|
2086
2230
|
...e,
|
|
2087
2231
|
limit: 1
|
|
2088
2232
|
});
|
|
2089
2233
|
return t && t.results[0] || null;
|
|
2090
2234
|
}
|
|
2091
|
-
const
|
|
2092
|
-
const t =
|
|
2093
|
-
return await (await
|
|
2094
|
-
},
|
|
2095
|
-
const o =
|
|
2235
|
+
const getContent = fetchOneEntry, _fetchContent = async (e) => {
|
|
2236
|
+
const t = generateContentUrl(e);
|
|
2237
|
+
return await (await fetch$1(t.href)).json();
|
|
2238
|
+
}, _processContentResult = async (e, t, n = generateContentUrl(e)) => {
|
|
2239
|
+
const o = getDefaultCanTrack(e.canTrack);
|
|
2096
2240
|
if (n.search.includes("preview=")) {
|
|
2097
|
-
const
|
|
2241
|
+
const i = [];
|
|
2098
2242
|
for (const a of t.results) {
|
|
2099
|
-
const c =
|
|
2100
|
-
|
|
2243
|
+
const c = getPreviewContent(n.searchParams);
|
|
2244
|
+
i.push(c || a);
|
|
2101
2245
|
}
|
|
2102
|
-
t.results =
|
|
2246
|
+
t.results = i;
|
|
2103
2247
|
}
|
|
2104
|
-
if (!o || !(
|
|
2248
|
+
if (!o || !(isBrowser() || TARGET === "reactNative"))
|
|
2105
2249
|
return t;
|
|
2106
2250
|
try {
|
|
2107
|
-
const
|
|
2251
|
+
const i = [];
|
|
2108
2252
|
for (const a of t.results)
|
|
2109
|
-
|
|
2253
|
+
i.push(await handleABTesting({
|
|
2110
2254
|
item: a,
|
|
2111
2255
|
canTrack: o
|
|
2112
2256
|
}));
|
|
2113
|
-
t.results =
|
|
2114
|
-
} catch (
|
|
2115
|
-
|
|
2257
|
+
t.results = i;
|
|
2258
|
+
} catch (i) {
|
|
2259
|
+
logger.error("Could not process A/B tests. ", i);
|
|
2116
2260
|
}
|
|
2117
2261
|
return t;
|
|
2118
2262
|
};
|
|
2119
|
-
async function
|
|
2263
|
+
async function fetchEntries(e) {
|
|
2120
2264
|
try {
|
|
2121
|
-
const t =
|
|
2122
|
-
return
|
|
2265
|
+
const t = generateContentUrl(e), n = await _fetchContent(e);
|
|
2266
|
+
return checkContentHasResults(n) ? _processContentResult(e, n) : (logger.error("Error fetching data. ", {
|
|
2123
2267
|
url: t,
|
|
2124
2268
|
content: n,
|
|
2125
2269
|
options: e
|
|
2126
2270
|
}), null);
|
|
2127
2271
|
} catch (t) {
|
|
2128
|
-
return
|
|
2272
|
+
return logger.error("Error fetching data. ", t), null;
|
|
2129
2273
|
}
|
|
2130
2274
|
}
|
|
2131
|
-
const
|
|
2132
|
-
function
|
|
2133
|
-
return !
|
|
2275
|
+
const getAllContent = fetchEntries;
|
|
2276
|
+
function isPreviewing() {
|
|
2277
|
+
return !isBrowser() || isEditing() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
2134
2278
|
}
|
|
2135
|
-
function
|
|
2136
|
-
return /* @__PURE__ */
|
|
2279
|
+
function InlinedScript(e) {
|
|
2280
|
+
return /* @__PURE__ */ jsx(
|
|
2137
2281
|
"script",
|
|
2138
2282
|
{
|
|
2139
2283
|
dangerouslySetInnerHTML: { __html: e.scriptStr },
|
|
@@ -2141,38 +2285,38 @@ function N(e) {
|
|
|
2141
2285
|
}
|
|
2142
2286
|
);
|
|
2143
2287
|
}
|
|
2144
|
-
function
|
|
2145
|
-
var
|
|
2146
|
-
const t =
|
|
2288
|
+
function ContentComponent(e) {
|
|
2289
|
+
var r, i, a, c, s, u, m, h, p;
|
|
2290
|
+
const t = getRenderContentScriptString({
|
|
2147
2291
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2148
|
-
variationId: (
|
|
2292
|
+
variationId: (r = e.content) == null ? void 0 : r.testVariationId,
|
|
2149
2293
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2150
|
-
contentId: (
|
|
2294
|
+
contentId: (i = e.content) == null ? void 0 : i.id
|
|
2151
2295
|
}), n = [
|
|
2152
|
-
...
|
|
2296
|
+
...getDefaultRegisteredComponents(),
|
|
2153
2297
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
2154
2298
|
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
2155
2299
|
// existing usage.
|
|
2156
2300
|
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
2157
2301
|
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
2158
|
-
...
|
|
2302
|
+
...components,
|
|
2159
2303
|
...e.customComponents || []
|
|
2160
2304
|
].reduce(
|
|
2161
|
-
(
|
|
2162
|
-
...
|
|
2305
|
+
(l, { component: f, ...d }) => ({
|
|
2306
|
+
...l,
|
|
2163
2307
|
[d.name]: {
|
|
2164
|
-
component:
|
|
2165
|
-
...
|
|
2308
|
+
component: f,
|
|
2309
|
+
...serializeComponentInfo(d)
|
|
2166
2310
|
}
|
|
2167
2311
|
}),
|
|
2168
2312
|
{}
|
|
2169
2313
|
), o = {
|
|
2170
|
-
content:
|
|
2314
|
+
content: getContentInitialValue({
|
|
2171
2315
|
content: e.content,
|
|
2172
2316
|
data: e.data
|
|
2173
2317
|
}),
|
|
2174
2318
|
localState: void 0,
|
|
2175
|
-
rootState:
|
|
2319
|
+
rootState: getContextStateInitialValue({
|
|
2176
2320
|
content: e.content,
|
|
2177
2321
|
data: e.data,
|
|
2178
2322
|
locale: e.locale
|
|
@@ -2182,25 +2326,25 @@ function ie(e) {
|
|
|
2182
2326
|
apiKey: e.apiKey,
|
|
2183
2327
|
apiVersion: e.apiVersion,
|
|
2184
2328
|
componentInfos: [
|
|
2185
|
-
...
|
|
2329
|
+
...getDefaultRegisteredComponents(),
|
|
2186
2330
|
// While this `components` object is deprecated, we must maintain support for it.
|
|
2187
2331
|
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
2188
2332
|
// existing usage.
|
|
2189
2333
|
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
2190
2334
|
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
2191
|
-
...
|
|
2335
|
+
...components,
|
|
2192
2336
|
...e.customComponents || []
|
|
2193
2337
|
].reduce(
|
|
2194
|
-
(
|
|
2195
|
-
...
|
|
2196
|
-
[d.name]:
|
|
2338
|
+
(l, { component: f, ...d }) => ({
|
|
2339
|
+
...l,
|
|
2340
|
+
[d.name]: serializeComponentInfo(d)
|
|
2197
2341
|
}),
|
|
2198
2342
|
{}
|
|
2199
2343
|
),
|
|
2200
2344
|
inheritedStyles: {}
|
|
2201
2345
|
};
|
|
2202
|
-
return /* @__PURE__ */
|
|
2203
|
-
|
|
2346
|
+
return /* @__PURE__ */ jsxs(
|
|
2347
|
+
EnableEditor,
|
|
2204
2348
|
{
|
|
2205
2349
|
content: e.content,
|
|
2206
2350
|
model: e.model,
|
|
@@ -2214,19 +2358,19 @@ function ie(e) {
|
|
|
2214
2358
|
showContent: e.showContent,
|
|
2215
2359
|
builderContextSignal: o,
|
|
2216
2360
|
children: [
|
|
2217
|
-
e.isSsrAbTest ? /* @__PURE__ */
|
|
2218
|
-
/* @__PURE__ */
|
|
2219
|
-
|
|
2361
|
+
e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
|
|
2362
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2363
|
+
ContentStyles,
|
|
2220
2364
|
{
|
|
2221
2365
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
2222
2366
|
cssCode: (s = (c = o.content) == null ? void 0 : c.data) == null ? void 0 : s.cssCode,
|
|
2223
|
-
customFonts: (
|
|
2367
|
+
customFonts: (m = (u = o.content) == null ? void 0 : u.data) == null ? void 0 : m.customFonts
|
|
2224
2368
|
}
|
|
2225
2369
|
) }),
|
|
2226
|
-
/* @__PURE__ */
|
|
2227
|
-
|
|
2370
|
+
/* @__PURE__ */ jsx(
|
|
2371
|
+
Blocks,
|
|
2228
2372
|
{
|
|
2229
|
-
blocks: (p = (
|
|
2373
|
+
blocks: (p = (h = o.content) == null ? void 0 : h.data) == null ? void 0 : p.blocks,
|
|
2230
2374
|
context: o,
|
|
2231
2375
|
registeredComponents: n
|
|
2232
2376
|
}
|
|
@@ -2235,45 +2379,45 @@ function ie(e) {
|
|
|
2235
2379
|
}
|
|
2236
2380
|
);
|
|
2237
2381
|
}
|
|
2238
|
-
function
|
|
2239
|
-
var
|
|
2240
|
-
const t =
|
|
2241
|
-
canTrack:
|
|
2382
|
+
function ContentVariants(e) {
|
|
2383
|
+
var i, a, c;
|
|
2384
|
+
const t = checkShouldRunVariants({
|
|
2385
|
+
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2242
2386
|
content: e.content
|
|
2243
2387
|
}), n = function() {
|
|
2244
2388
|
var u;
|
|
2245
|
-
return
|
|
2246
|
-
|
|
2247
|
-
id:
|
|
2248
|
-
testRatio:
|
|
2389
|
+
return getVariantsScriptString(
|
|
2390
|
+
getVariants(e.content).map((m) => ({
|
|
2391
|
+
id: m.testVariationId,
|
|
2392
|
+
testRatio: m.testRatio
|
|
2249
2393
|
})),
|
|
2250
2394
|
((u = e.content) == null ? void 0 : u.id) || ""
|
|
2251
2395
|
);
|
|
2252
2396
|
}, o = function() {
|
|
2253
|
-
return
|
|
2254
|
-
},
|
|
2397
|
+
return getVariants(e.content).map((u) => `.variant-${u.testVariationId} { display: none; } `).join("");
|
|
2398
|
+
}, r = function() {
|
|
2255
2399
|
var u;
|
|
2256
2400
|
return t ? {
|
|
2257
2401
|
...e.content,
|
|
2258
2402
|
testVariationId: (u = e.content) == null ? void 0 : u.id
|
|
2259
|
-
} :
|
|
2403
|
+
} : handleABTestingSync({
|
|
2260
2404
|
item: e.content,
|
|
2261
|
-
canTrack:
|
|
2405
|
+
canTrack: getDefaultCanTrack(e.canTrack)
|
|
2262
2406
|
});
|
|
2263
2407
|
};
|
|
2264
|
-
return /* @__PURE__ */
|
|
2265
|
-
!e.__isNestedRender &&
|
|
2266
|
-
t ? /* @__PURE__ */
|
|
2267
|
-
/* @__PURE__ */
|
|
2268
|
-
|
|
2408
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2409
|
+
!e.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: getScriptString() }) }) : null,
|
|
2410
|
+
t ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2411
|
+
/* @__PURE__ */ jsx(
|
|
2412
|
+
InlinedStyles,
|
|
2269
2413
|
{
|
|
2270
|
-
id: `variants-styles-${(
|
|
2414
|
+
id: `variants-styles-${(i = e.content) == null ? void 0 : i.id}`,
|
|
2271
2415
|
styles: o()
|
|
2272
2416
|
}
|
|
2273
2417
|
),
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
(a =
|
|
2276
|
-
|
|
2418
|
+
/* @__PURE__ */ jsx(InlinedScript, { scriptStr: n() }),
|
|
2419
|
+
(a = getVariants(e.content)) == null ? void 0 : a.map((s) => /* @__PURE__ */ jsx(
|
|
2420
|
+
ContentComponent,
|
|
2277
2421
|
{
|
|
2278
2422
|
content: s,
|
|
2279
2423
|
showContent: !1,
|
|
@@ -2293,10 +2437,10 @@ function Te(e) {
|
|
|
2293
2437
|
s.testVariationId
|
|
2294
2438
|
))
|
|
2295
2439
|
] }) : null,
|
|
2296
|
-
/* @__PURE__ */
|
|
2297
|
-
|
|
2440
|
+
/* @__PURE__ */ jsx(
|
|
2441
|
+
ContentComponent,
|
|
2298
2442
|
{
|
|
2299
|
-
content:
|
|
2443
|
+
content: r(),
|
|
2300
2444
|
classNameProp: `variant-${(c = e.content) == null ? void 0 : c.id}`,
|
|
2301
2445
|
showContent: !0,
|
|
2302
2446
|
model: e.model,
|
|
@@ -2314,13 +2458,13 @@ function Te(e) {
|
|
|
2314
2458
|
)
|
|
2315
2459
|
] });
|
|
2316
2460
|
}
|
|
2317
|
-
const
|
|
2461
|
+
const fetchSymbolContent = async ({
|
|
2318
2462
|
builderContextValue: e,
|
|
2319
2463
|
symbol: t
|
|
2320
2464
|
}) => {
|
|
2321
2465
|
if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
2322
2466
|
(e != null && e.apiKey))
|
|
2323
|
-
return
|
|
2467
|
+
return fetchOneEntry({
|
|
2324
2468
|
model: t.model,
|
|
2325
2469
|
apiKey: e.apiKey,
|
|
2326
2470
|
apiVersion: e.apiVersion,
|
|
@@ -2330,11 +2474,11 @@ const In = async ({
|
|
|
2330
2474
|
}
|
|
2331
2475
|
}
|
|
2332
2476
|
}).catch((n) => {
|
|
2333
|
-
|
|
2477
|
+
logger.error("Could not fetch symbol content: ", n);
|
|
2334
2478
|
});
|
|
2335
2479
|
};
|
|
2336
|
-
async function
|
|
2337
|
-
var o,
|
|
2480
|
+
async function Symbol$1(e) {
|
|
2481
|
+
var o, r, i, a;
|
|
2338
2482
|
const t = function() {
|
|
2339
2483
|
var s, u;
|
|
2340
2484
|
return [
|
|
@@ -2343,12 +2487,12 @@ async function Tn(e) {
|
|
|
2343
2487
|
(s = e.symbol) != null && s.inline ? "builder-inline-symbol" : void 0,
|
|
2344
2488
|
(u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2345
2489
|
].filter(Boolean).join(" ");
|
|
2346
|
-
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await
|
|
2490
|
+
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
|
|
2347
2491
|
symbol: e.symbol,
|
|
2348
2492
|
builderContextValue: e.builderContext
|
|
2349
2493
|
});
|
|
2350
|
-
return /* @__PURE__ */
|
|
2351
|
-
|
|
2494
|
+
return /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
|
|
2495
|
+
ContentVariants,
|
|
2352
2496
|
{
|
|
2353
2497
|
__isNestedRender: !0,
|
|
2354
2498
|
apiVersion: e.builderContext.apiVersion,
|
|
@@ -2356,29 +2500,29 @@ async function Tn(e) {
|
|
|
2356
2500
|
context: e.builderContext.context,
|
|
2357
2501
|
customComponents: Object.values(e.builderComponents),
|
|
2358
2502
|
data: {
|
|
2359
|
-
...(
|
|
2503
|
+
...(r = e.symbol) == null ? void 0 : r.data,
|
|
2360
2504
|
...e.builderContext.localState,
|
|
2361
|
-
...(
|
|
2505
|
+
...(i = n == null ? void 0 : n.data) == null ? void 0 : i.state
|
|
2362
2506
|
},
|
|
2363
2507
|
model: (a = e.symbol) == null ? void 0 : a.model,
|
|
2364
2508
|
content: n
|
|
2365
2509
|
}
|
|
2366
2510
|
) });
|
|
2367
2511
|
}
|
|
2368
|
-
const
|
|
2369
|
-
function
|
|
2370
|
-
if (
|
|
2371
|
-
Object.assign(
|
|
2512
|
+
const RenderBlocks = Blocks, RenderContent = ContentVariants, settings = {};
|
|
2513
|
+
function setEditorSettings(e) {
|
|
2514
|
+
if (isBrowser()) {
|
|
2515
|
+
Object.assign(settings, e);
|
|
2372
2516
|
const t = {
|
|
2373
2517
|
type: "builder.settingsChange",
|
|
2374
|
-
data:
|
|
2518
|
+
data: settings
|
|
2375
2519
|
};
|
|
2376
2520
|
parent.postMessage(t, "*");
|
|
2377
2521
|
}
|
|
2378
2522
|
}
|
|
2379
|
-
const
|
|
2380
|
-
var o,
|
|
2381
|
-
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((
|
|
2523
|
+
const fetchBuilderProps = async (e) => {
|
|
2524
|
+
var o, r, i;
|
|
2525
|
+
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((r = e.userAttributes) == null ? void 0 : r.urlPath), n = {
|
|
2382
2526
|
...e,
|
|
2383
2527
|
apiKey: e.apiKey,
|
|
2384
2528
|
model: e.model || "page",
|
|
@@ -2388,49 +2532,48 @@ const Jn = async (e) => {
|
|
|
2388
2532
|
urlPath: t
|
|
2389
2533
|
} : {}
|
|
2390
2534
|
},
|
|
2391
|
-
options:
|
|
2535
|
+
options: getBuilderSearchParams(e.searchParams || ((i = e.url) == null ? void 0 : i.searchParams) || e.options)
|
|
2392
2536
|
};
|
|
2393
2537
|
return {
|
|
2394
2538
|
apiKey: n.apiKey,
|
|
2395
2539
|
model: n.model,
|
|
2396
|
-
content: await
|
|
2540
|
+
content: await fetchOneEntry(n)
|
|
2397
2541
|
};
|
|
2398
2542
|
};
|
|
2399
2543
|
export {
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
Kn as z
|
|
2544
|
+
getBuilderSearchParams as A,
|
|
2545
|
+
Blocks as B,
|
|
2546
|
+
ContentVariants as C,
|
|
2547
|
+
track as D,
|
|
2548
|
+
fetchBuilderProps as E,
|
|
2549
|
+
RenderBlocks as R,
|
|
2550
|
+
Symbol$1 as S,
|
|
2551
|
+
Text as T,
|
|
2552
|
+
_track as _,
|
|
2553
|
+
getBlockActions as a,
|
|
2554
|
+
getSrcSet as b,
|
|
2555
|
+
isJsScript as c,
|
|
2556
|
+
isBrowser as d,
|
|
2557
|
+
getDefaultCanTrack as e,
|
|
2558
|
+
isPreviewing as f,
|
|
2559
|
+
getBlockProperties as g,
|
|
2560
|
+
evaluate as h,
|
|
2561
|
+
isEditing as i,
|
|
2562
|
+
getInteractionPropertiesForEvent as j,
|
|
2563
|
+
fastClone as k,
|
|
2564
|
+
logger as l,
|
|
2565
|
+
createRegisterComponentMessage as m,
|
|
2566
|
+
fetchOneEntry as n,
|
|
2567
|
+
fetch$1 as o,
|
|
2568
|
+
init as p,
|
|
2569
|
+
RenderContent as q,
|
|
2570
|
+
registerInsertMenu as r,
|
|
2571
|
+
setupBrowserForEditing as s,
|
|
2572
|
+
Columns as t,
|
|
2573
|
+
register as u,
|
|
2574
|
+
setEditorSettings as v,
|
|
2575
|
+
fetchEntries as w,
|
|
2576
|
+
getAllContent as x,
|
|
2577
|
+
getContent as y,
|
|
2578
|
+
_processContentResult as z
|
|
2436
2579
|
};
|