@builder.io/sdk-react 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/lib/browser/blocks-exports.cjs +187 -0
- package/lib/browser/blocks-exports.mjs +3441 -0
- package/lib/browser/index.cjs +1 -187
- package/lib/browser/index.mjs +26 -3449
- package/lib/browser/{server-entry-a595b1cf.cjs → server-entry-093e302c.cjs} +1 -1
- package/lib/browser/{server-entry-f6f9bdcb.js → server-entry-7839c812.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/blocks-0fc8e8d2.js +3385 -0
- package/lib/edge/blocks-exports.cjs +1 -0
- package/lib/edge/blocks-exports.mjs +16 -0
- package/lib/edge/blocks-f8688fcb.cjs +32 -0
- package/lib/edge/button-61181684.cjs +1 -0
- package/lib/edge/button-d9bbef90.js +29 -0
- package/lib/edge/columns-d152e266.cjs +28 -0
- package/lib/edge/columns-f7a9bca7.js +156 -0
- package/lib/edge/content-variants-cdcbcdd8.js +1711 -0
- package/lib/edge/content-variants-d2500971.cjs +133 -0
- package/lib/edge/custom-code-33b73ed1.js +44 -0
- package/lib/edge/custom-code-7390ba8b.cjs +1 -0
- package/lib/edge/dynamic-blocks-exports.cjs +39 -0
- package/lib/edge/dynamic-blocks-exports.mjs +37 -0
- package/lib/edge/dynamic-renderer-b5124984.js +9 -0
- package/lib/edge/dynamic-renderer-c00b8bcb.cjs +1 -0
- package/lib/edge/embed-11e03fa7.js +38 -0
- package/lib/edge/embed-9edce7df.cjs +1 -0
- package/lib/edge/form-ac531791.cjs +1 -0
- package/lib/edge/form-fb5fd55e.js +194 -0
- package/lib/edge/fragment-015b0912.js +8 -0
- package/lib/edge/fragment-61ef192d.cjs +1 -0
- package/lib/edge/get-class-prop-name-caee6506.cjs +1 -0
- package/lib/edge/get-class-prop-name-f22d7d53.js +18 -0
- package/lib/edge/image-6a3654d5.js +118 -0
- package/lib/edge/image-e4128296.cjs +17 -0
- package/lib/edge/img-317659e2.js +21 -0
- package/lib/edge/img-f2eeaa75.cjs +1 -0
- package/lib/edge/index.cjs +1 -207
- package/lib/edge/index.mjs +25 -5922
- package/lib/edge/input-526ea905.js +21 -0
- package/lib/edge/input-562438c4.cjs +1 -0
- package/lib/edge/section-68fbc212.js +26 -0
- package/lib/edge/section-70c8b709.cjs +1 -0
- package/lib/edge/select-17802399.js +21 -0
- package/lib/edge/select-d87a6280.cjs +1 -0
- package/lib/edge/server-entry-88f58ed4.cjs +2 -0
- package/lib/edge/{server-entry-f6f9bdcb.js → server-entry-e0830caf.js} +373 -372
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/slot-39b50f6b.cjs +1 -0
- package/lib/edge/slot-eb244885.js +33 -0
- package/lib/edge/submit-button-13d8d5a7.cjs +1 -0
- package/lib/edge/submit-button-71dd4015.js +8 -0
- package/lib/edge/symbol-bf773f2a.js +78 -0
- package/lib/edge/symbol-ee31bb7f.cjs +1 -0
- package/lib/edge/text-15f0a6f4.js +18 -0
- package/lib/edge/text-7fdbde16.cjs +1 -0
- package/lib/edge/video-66b20833.js +106 -0
- package/lib/edge/video-702696a8.cjs +1 -0
- package/lib/node/blocks-exports.cjs +227 -0
- package/lib/node/blocks-exports.mjs +3548 -0
- package/lib/node/index.cjs +1 -227
- package/lib/node/index.mjs +27 -3556
- package/lib/node/{server-entry-31b5d683.cjs → server-entry-0e638a4f.cjs} +1 -1
- package/lib/node/{server-entry-c2b6d198.js → server-entry-e1cc0803.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +19 -13
- package/types/blocks/button/index.d.ts +1 -0
- package/types/blocks/columns/index.d.ts +1 -0
- package/types/blocks/custom-code/index.d.ts +1 -0
- package/types/blocks/embed/index.d.ts +1 -0
- package/types/blocks/form/form/index.d.ts +1 -0
- package/types/blocks/form/input/index.d.ts +1 -0
- package/types/blocks/form/select/index.d.ts +1 -0
- package/types/blocks/form/submit-button/index.d.ts +1 -0
- package/types/blocks/fragment/index.d.ts +1 -0
- package/types/blocks/image/index.d.ts +1 -0
- package/types/blocks/img/index.d.ts +1 -0
- package/types/blocks/raw-text/index.d.ts +1 -0
- package/types/blocks/section/index.d.ts +1 -0
- package/types/blocks/slot/index.d.ts +1 -0
- package/types/blocks/symbol/index.d.ts +1 -0
- package/types/blocks/text/index.d.ts +1 -0
- package/types/blocks/textarea/index.d.ts +1 -0
- package/types/blocks/video/index.d.ts +1 -0
- package/types/components/blocks/index.d.ts +1 -0
- package/types/components/content-variants/index.d.ts +1 -0
- package/types/components/error-boundary.d.ts +11 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/get-content/types.d.ts +1 -1
- package/types/index-helpers/blocks-exports.d.ts +10 -11
- package/lib/edge/server-entry-a595b1cf.cjs +0 -2
|
@@ -0,0 +1,3548 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { T as TARGET, i as isEditing, h as isBrowser, j as getUserAttributes, k as fastClone, l as checkIsDefined, m as logger, n as getDefaultCanTrack, o as _track, a as isPreviewing, p as createEditorListener, q as registerInsertMenu, u as setupBrowserForEditing, c as createRegisterComponentMessage, e as fetchOneEntry, v as fetch$1, w as serializeComponentInfo, x as handleABTestingSync } from "./server-entry-e1cc0803.js";
|
|
4
|
+
import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
|
|
5
|
+
import { createRequire } from "node:module";
|
|
6
|
+
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase());
|
|
7
|
+
function DynamicRenderer(e) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Fragment, { children: isEmptyElement(e.TagName) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ jsx(Fragment, { children: typeof e.TagName == "string" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
9
|
+
}
|
|
10
|
+
const getClassPropName = () => {
|
|
11
|
+
switch (TARGET) {
|
|
12
|
+
case "react":
|
|
13
|
+
case "reactNative":
|
|
14
|
+
case "rsc":
|
|
15
|
+
return "className";
|
|
16
|
+
case "svelte":
|
|
17
|
+
case "vue":
|
|
18
|
+
case "solid":
|
|
19
|
+
case "qwik":
|
|
20
|
+
return "class";
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
function Button(e) {
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
DynamicRenderer,
|
|
26
|
+
{
|
|
27
|
+
attributes: {
|
|
28
|
+
...e.attributes,
|
|
29
|
+
[getClassPropName()]: `${e.link ? "" : "builder-button"} ${e.attributes[getClassPropName()] || ""}`,
|
|
30
|
+
...e.link ? {
|
|
31
|
+
href: e.link,
|
|
32
|
+
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
33
|
+
role: "link"
|
|
34
|
+
} : {
|
|
35
|
+
role: "button"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
TagName: e.link ? e.builderLinkComponent || "a" : "button",
|
|
39
|
+
actionAttributes: {},
|
|
40
|
+
children: e.text
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const builderContext = createContext({
|
|
45
|
+
content: null,
|
|
46
|
+
context: {},
|
|
47
|
+
localState: void 0,
|
|
48
|
+
rootSetState() {
|
|
49
|
+
},
|
|
50
|
+
rootState: {},
|
|
51
|
+
apiKey: null,
|
|
52
|
+
apiVersion: void 0,
|
|
53
|
+
componentInfos: {},
|
|
54
|
+
inheritedStyles: {},
|
|
55
|
+
BlocksWrapper: "div",
|
|
56
|
+
BlocksWrapperProps: {}
|
|
57
|
+
}), ComponentsContext = createContext({ registeredComponents: {} });
|
|
58
|
+
function getBlockComponentOptions(e) {
|
|
59
|
+
var t;
|
|
60
|
+
return {
|
|
61
|
+
...(t = e.component) == null ? void 0 : t.options,
|
|
62
|
+
...e.options,
|
|
63
|
+
/**
|
|
64
|
+
* Our built-in components frequently make use of the block, so we provide all of it under `builderBlock`
|
|
65
|
+
*/
|
|
66
|
+
builderBlock: e
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const getFunctionArguments = ({
|
|
70
|
+
builder: e,
|
|
71
|
+
context: t,
|
|
72
|
+
event: n,
|
|
73
|
+
state: o
|
|
74
|
+
}) => Object.entries({
|
|
75
|
+
state: o,
|
|
76
|
+
Builder: e,
|
|
77
|
+
// legacy
|
|
78
|
+
builder: e,
|
|
79
|
+
context: t,
|
|
80
|
+
event: n
|
|
81
|
+
}), getBuilderGlobals = () => ({
|
|
82
|
+
isEditing: isEditing(),
|
|
83
|
+
isBrowser: isBrowser(),
|
|
84
|
+
isServer: !isBrowser(),
|
|
85
|
+
getUserAttributes: () => getUserAttributes()
|
|
86
|
+
}), parseCode = (e, {
|
|
87
|
+
isExpression: t = !0
|
|
88
|
+
}) => /* 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 = ({
|
|
89
|
+
code: e,
|
|
90
|
+
builder: t,
|
|
91
|
+
context: n,
|
|
92
|
+
event: o,
|
|
93
|
+
localState: i,
|
|
94
|
+
rootSetState: a,
|
|
95
|
+
rootState: r
|
|
96
|
+
}) => {
|
|
97
|
+
const s = getFunctionArguments({
|
|
98
|
+
builder: t,
|
|
99
|
+
context: n,
|
|
100
|
+
event: o,
|
|
101
|
+
state: flattenState({
|
|
102
|
+
rootState: r,
|
|
103
|
+
localState: i,
|
|
104
|
+
rootSetState: a
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
return new Function(...s.map(([l]) => l), e)(...s.map(([, l]) => l));
|
|
108
|
+
};
|
|
109
|
+
function flattenState({
|
|
110
|
+
rootState: e,
|
|
111
|
+
localState: t,
|
|
112
|
+
rootSetState: n
|
|
113
|
+
}) {
|
|
114
|
+
return new Proxy(e, {
|
|
115
|
+
get: (o, i) => {
|
|
116
|
+
if (t && i in t)
|
|
117
|
+
return t[i];
|
|
118
|
+
const a = o[i];
|
|
119
|
+
return typeof a == "object" ? flattenState({
|
|
120
|
+
rootState: a,
|
|
121
|
+
localState: void 0,
|
|
122
|
+
rootSetState: n ? (r) => {
|
|
123
|
+
o[i] = r, n(o);
|
|
124
|
+
} : void 0
|
|
125
|
+
}) : a;
|
|
126
|
+
},
|
|
127
|
+
set: (o, i, a) => {
|
|
128
|
+
if (t && i in t)
|
|
129
|
+
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
130
|
+
return o[i] = a, n == null || n(o), !0;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
const set = (e, t, n) => {
|
|
135
|
+
if (Object(e) !== e)
|
|
136
|
+
return e;
|
|
137
|
+
const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
138
|
+
return o.slice(0, -1).reduce((i, a, r) => Object(i[a]) === i[a] ? i[a] : i[a] = Math.abs(Number(o[r + 1])) >> 0 === +o[r + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
|
|
139
|
+
}, noop = () => {
|
|
140
|
+
};
|
|
141
|
+
let safeDynamicRequire = noop;
|
|
142
|
+
try {
|
|
143
|
+
safeDynamicRequire = createRequire(import.meta.url);
|
|
144
|
+
} catch (error) {
|
|
145
|
+
try {
|
|
146
|
+
safeDynamicRequire = eval("require");
|
|
147
|
+
} catch (e) {
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const getSyncValName = (e) => `bldr_${e}_sync`, BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE", INJECTED_IVM_GLOBAL = "BUILDER_IVM", REF_TO_PROXY_FN = `
|
|
151
|
+
var refToProxy = (obj) => {
|
|
152
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
153
|
+
return obj;
|
|
154
|
+
}
|
|
155
|
+
return new Proxy({}, {
|
|
156
|
+
get(target, key) {
|
|
157
|
+
if (key === 'copySync') {
|
|
158
|
+
return () => obj.copySync();
|
|
159
|
+
}
|
|
160
|
+
const val = obj.getSync(key);
|
|
161
|
+
if (typeof val?.getSync === 'function') {
|
|
162
|
+
return refToProxy(val);
|
|
163
|
+
}
|
|
164
|
+
return val;
|
|
165
|
+
},
|
|
166
|
+
set(target, key, value) {
|
|
167
|
+
const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
|
|
168
|
+
obj.setSync(key, v);
|
|
169
|
+
${BUILDER_SET_STATE_NAME}(key, value)
|
|
170
|
+
},
|
|
171
|
+
deleteProperty(target, key) {
|
|
172
|
+
obj.deleteSync(key);
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
`, processCode = ({
|
|
177
|
+
code: e,
|
|
178
|
+
args: t
|
|
179
|
+
}) => {
|
|
180
|
+
const n = t.map(([o]) => `var ${o} = refToProxy(${getSyncValName(o)}); `).join("");
|
|
181
|
+
return `
|
|
182
|
+
${REF_TO_PROXY_FN}
|
|
183
|
+
${n}
|
|
184
|
+
function theFunction() {
|
|
185
|
+
${e}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
let output = theFunction()
|
|
189
|
+
|
|
190
|
+
if (typeof output === 'object' && output !== null) {
|
|
191
|
+
output = JSON.stringify(output.copySync ? output.copySync() : output);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
output;
|
|
195
|
+
`;
|
|
196
|
+
}, getIsolateContext = () => {
|
|
197
|
+
const e = safeDynamicRequire("isolated-vm");
|
|
198
|
+
return new e.Isolate({
|
|
199
|
+
memoryLimit: 128
|
|
200
|
+
}).createContextSync();
|
|
201
|
+
}, runInNode = ({
|
|
202
|
+
code: e,
|
|
203
|
+
builder: t,
|
|
204
|
+
context: n,
|
|
205
|
+
event: o,
|
|
206
|
+
localState: i,
|
|
207
|
+
rootSetState: a,
|
|
208
|
+
rootState: r
|
|
209
|
+
}) => {
|
|
210
|
+
const s = safeDynamicRequire("isolated-vm"), l = fastClone({
|
|
211
|
+
...r,
|
|
212
|
+
...i
|
|
213
|
+
}), c = getFunctionArguments({
|
|
214
|
+
builder: t,
|
|
215
|
+
context: n,
|
|
216
|
+
event: o,
|
|
217
|
+
state: l
|
|
218
|
+
}), u = getIsolateContext(), y = u.global;
|
|
219
|
+
y.setSync("global", y.derefInto()), y.setSync("log", function(...d) {
|
|
220
|
+
console.log(...d);
|
|
221
|
+
}), y.setSync(BUILDER_SET_STATE_NAME, function(d, f) {
|
|
222
|
+
set(r, d, f), a == null || a(r);
|
|
223
|
+
}), c.forEach(([d, f]) => {
|
|
224
|
+
const v = typeof f == "object" ? new s.Reference(
|
|
225
|
+
// workaround: methods with default values for arguments is not being cloned over
|
|
226
|
+
d === "builder" ? {
|
|
227
|
+
...f,
|
|
228
|
+
getUserAttributes: () => f.getUserAttributes()
|
|
229
|
+
} : f
|
|
230
|
+
) : null;
|
|
231
|
+
y.setSync(getSyncValName(d), v);
|
|
232
|
+
}), y.setSync(INJECTED_IVM_GLOBAL, s);
|
|
233
|
+
const x = processCode({
|
|
234
|
+
code: e,
|
|
235
|
+
args: c
|
|
236
|
+
}), m = u.evalSync(x);
|
|
237
|
+
try {
|
|
238
|
+
return JSON.parse(m);
|
|
239
|
+
} catch {
|
|
240
|
+
return m;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
function isNodeRuntime() {
|
|
244
|
+
var e;
|
|
245
|
+
return typeof process != "undefined" && checkIsDefined((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
|
|
246
|
+
}
|
|
247
|
+
const shouldForceBrowserRuntimeInNode = () => {
|
|
248
|
+
var o;
|
|
249
|
+
if (!isNodeRuntime())
|
|
250
|
+
return !1;
|
|
251
|
+
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
|
|
252
|
+
return e && t && !n ? (logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
|
|
253
|
+
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e);
|
|
254
|
+
function evaluate({
|
|
255
|
+
code: e,
|
|
256
|
+
context: t,
|
|
257
|
+
localState: n,
|
|
258
|
+
rootState: o,
|
|
259
|
+
rootSetState: i,
|
|
260
|
+
event: a,
|
|
261
|
+
isExpression: r = !0
|
|
262
|
+
}) {
|
|
263
|
+
if (e === "") {
|
|
264
|
+
logger.warn("Skipping evaluation of empty code block.");
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const s = {
|
|
268
|
+
code: parseCode(e, {
|
|
269
|
+
isExpression: r
|
|
270
|
+
}),
|
|
271
|
+
builder: getBuilderGlobals(),
|
|
272
|
+
context: t,
|
|
273
|
+
event: a,
|
|
274
|
+
rootSetState: i,
|
|
275
|
+
rootState: o,
|
|
276
|
+
localState: n
|
|
277
|
+
};
|
|
278
|
+
try {
|
|
279
|
+
return chooseBrowserOrServerEval(s);
|
|
280
|
+
} catch (l) {
|
|
281
|
+
logger.error("Failed code evaluation: " + l.message, {
|
|
282
|
+
code: e
|
|
283
|
+
});
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
function transformBlock(e) {
|
|
288
|
+
return e;
|
|
289
|
+
}
|
|
290
|
+
const evaluateBindings = ({
|
|
291
|
+
block: e,
|
|
292
|
+
context: t,
|
|
293
|
+
localState: n,
|
|
294
|
+
rootState: o,
|
|
295
|
+
rootSetState: i
|
|
296
|
+
}) => {
|
|
297
|
+
if (!e.bindings)
|
|
298
|
+
return e;
|
|
299
|
+
const a = fastClone(e), r = {
|
|
300
|
+
...a,
|
|
301
|
+
properties: {
|
|
302
|
+
...a.properties
|
|
303
|
+
},
|
|
304
|
+
actions: {
|
|
305
|
+
...a.actions
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
for (const s in e.bindings) {
|
|
309
|
+
const l = e.bindings[s], c = evaluate({
|
|
310
|
+
code: l,
|
|
311
|
+
localState: n,
|
|
312
|
+
rootState: o,
|
|
313
|
+
rootSetState: i,
|
|
314
|
+
context: t
|
|
315
|
+
});
|
|
316
|
+
set(r, s, c);
|
|
317
|
+
}
|
|
318
|
+
return r;
|
|
319
|
+
};
|
|
320
|
+
function getProcessedBlock({
|
|
321
|
+
block: e,
|
|
322
|
+
context: t,
|
|
323
|
+
shouldEvaluateBindings: n,
|
|
324
|
+
localState: o,
|
|
325
|
+
rootState: i,
|
|
326
|
+
rootSetState: a
|
|
327
|
+
}) {
|
|
328
|
+
const r = e;
|
|
329
|
+
return n ? evaluateBindings({
|
|
330
|
+
block: r,
|
|
331
|
+
localState: o,
|
|
332
|
+
rootState: i,
|
|
333
|
+
rootSetState: a,
|
|
334
|
+
context: t
|
|
335
|
+
}) : r;
|
|
336
|
+
}
|
|
337
|
+
function throttle(e, t, n = {}) {
|
|
338
|
+
let o, i, a, r = null, s = 0;
|
|
339
|
+
const l = function() {
|
|
340
|
+
s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(o, i), r || (o = i = null);
|
|
341
|
+
};
|
|
342
|
+
return function() {
|
|
343
|
+
const c = Date.now();
|
|
344
|
+
!s && n.leading === !1 && (s = c);
|
|
345
|
+
const u = t - (c - s);
|
|
346
|
+
return o = this, i = arguments, u <= 0 || u > t ? (r && (clearTimeout(r), r = null), s = c, a = e.apply(o, i), r || (o = i = null)) : !r && n.trailing !== !1 && (r = setTimeout(l, u)), a;
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
function assign(e, ...t) {
|
|
350
|
+
const n = Object(e);
|
|
351
|
+
for (let o = 1; o < arguments.length; o++) {
|
|
352
|
+
const i = arguments[o];
|
|
353
|
+
if (i != null)
|
|
354
|
+
for (const a in i)
|
|
355
|
+
Object.prototype.hasOwnProperty.call(i, a) && (n[a] = i[a]);
|
|
356
|
+
}
|
|
357
|
+
return n;
|
|
358
|
+
}
|
|
359
|
+
const camelCaseToKebabCase = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
|
|
360
|
+
function bindAnimations(e) {
|
|
361
|
+
for (const t of e)
|
|
362
|
+
switch (t.trigger) {
|
|
363
|
+
case "pageLoad":
|
|
364
|
+
triggerAnimation(t);
|
|
365
|
+
break;
|
|
366
|
+
case "hover":
|
|
367
|
+
bindHoverAnimation(t);
|
|
368
|
+
break;
|
|
369
|
+
case "scrollInView":
|
|
370
|
+
bindScrollInViewAnimation(t);
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
function warnElementNotPresent(e) {
|
|
375
|
+
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
376
|
+
}
|
|
377
|
+
function augmentAnimation(e, t) {
|
|
378
|
+
const n = getAllStylesUsed(e), o = getComputedStyle(t), i = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [i, a];
|
|
379
|
+
for (const s of r)
|
|
380
|
+
for (const l of n)
|
|
381
|
+
l in s || (s[l] = o[l]);
|
|
382
|
+
}
|
|
383
|
+
function getAllStylesUsed(e) {
|
|
384
|
+
const t = [];
|
|
385
|
+
for (const n of e.steps)
|
|
386
|
+
for (const o in n.styles)
|
|
387
|
+
t.indexOf(o) === -1 && t.push(o);
|
|
388
|
+
return t;
|
|
389
|
+
}
|
|
390
|
+
function triggerAnimation(e) {
|
|
391
|
+
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
392
|
+
if (!t.length) {
|
|
393
|
+
warnElementNotPresent(e.elementId || e.id || "");
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
Array.from(t).forEach((n) => {
|
|
397
|
+
augmentAnimation(e, n), n.style.transition = "none", n.style.transitionDelay = "0", assign(n.style, e.steps[0].styles), setTimeout(() => {
|
|
398
|
+
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), assign(n.style, e.steps[1].styles), setTimeout(() => {
|
|
399
|
+
n.style.transition = "", n.style.transitionDelay = "";
|
|
400
|
+
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
function bindHoverAnimation(e) {
|
|
405
|
+
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
406
|
+
if (!t.length) {
|
|
407
|
+
warnElementNotPresent(e.elementId || e.id || "");
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
Array.from(t).forEach((n) => {
|
|
411
|
+
augmentAnimation(e, n);
|
|
412
|
+
const o = e.steps[0].styles, i = e.steps[1].styles;
|
|
413
|
+
function a() {
|
|
414
|
+
assign(n.style, o);
|
|
415
|
+
}
|
|
416
|
+
function r() {
|
|
417
|
+
assign(n.style, i);
|
|
418
|
+
}
|
|
419
|
+
a(), n.addEventListener("mouseenter", r), n.addEventListener("mouseleave", a), setTimeout(() => {
|
|
420
|
+
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
|
|
421
|
+
});
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
function bindScrollInViewAnimation(e) {
|
|
425
|
+
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
426
|
+
if (!t.length) {
|
|
427
|
+
warnElementNotPresent(e.elementId || e.id || "");
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
Array.from(t).forEach((n) => {
|
|
431
|
+
augmentAnimation(e, n);
|
|
432
|
+
let o = !1, i = !1;
|
|
433
|
+
function a() {
|
|
434
|
+
!o && s(n) ? (o = !0, i = !0, setTimeout(() => {
|
|
435
|
+
assign(n.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", r), setTimeout(() => {
|
|
436
|
+
i = !1, e.repeat || (n.style.transition = "", n.style.transitionDelay = "");
|
|
437
|
+
}, (e.duration + (e.delay || 0)) * 1e3 + 100);
|
|
438
|
+
})) : e.repeat && o && !i && !s(n) && (o = !1, assign(n.style, e.steps[0].styles));
|
|
439
|
+
}
|
|
440
|
+
const r = throttle(a, 200, {
|
|
441
|
+
leading: !1
|
|
442
|
+
});
|
|
443
|
+
function s(u) {
|
|
444
|
+
const y = u.getBoundingClientRect(), x = window.innerHeight, d = (e.thresholdPercent || 0) / 100 * x;
|
|
445
|
+
return y.bottom > d && y.top < x - d;
|
|
446
|
+
}
|
|
447
|
+
const l = e.steps[0].styles;
|
|
448
|
+
function c() {
|
|
449
|
+
assign(n.style, l);
|
|
450
|
+
}
|
|
451
|
+
c(), setTimeout(() => {
|
|
452
|
+
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
|
|
453
|
+
}), document.addEventListener("scroll", r, {
|
|
454
|
+
capture: !0,
|
|
455
|
+
passive: !0
|
|
456
|
+
}), a();
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
const getComponent = ({
|
|
460
|
+
block: e,
|
|
461
|
+
context: t,
|
|
462
|
+
registeredComponents: n
|
|
463
|
+
}) => {
|
|
464
|
+
var a;
|
|
465
|
+
const o = (a = getProcessedBlock({
|
|
466
|
+
block: e,
|
|
467
|
+
localState: t.localState,
|
|
468
|
+
rootState: t.rootState,
|
|
469
|
+
rootSetState: t.rootSetState,
|
|
470
|
+
context: t.context,
|
|
471
|
+
shouldEvaluateBindings: !1
|
|
472
|
+
}).component) == null ? void 0 : a.name;
|
|
473
|
+
if (!o)
|
|
474
|
+
return null;
|
|
475
|
+
const i = n[o];
|
|
476
|
+
if (i)
|
|
477
|
+
return i;
|
|
478
|
+
console.warn(`
|
|
479
|
+
Could not find a registered component named "${o}".
|
|
480
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
481
|
+
}, getRepeatItemData = ({
|
|
482
|
+
block: e,
|
|
483
|
+
context: t
|
|
484
|
+
}) => {
|
|
485
|
+
const {
|
|
486
|
+
repeat: n,
|
|
487
|
+
...o
|
|
488
|
+
} = e;
|
|
489
|
+
if (!(n != null && n.collection))
|
|
490
|
+
return;
|
|
491
|
+
const i = evaluate({
|
|
492
|
+
code: n.collection,
|
|
493
|
+
localState: t.localState,
|
|
494
|
+
rootState: t.rootState,
|
|
495
|
+
rootSetState: t.rootSetState,
|
|
496
|
+
context: t.context
|
|
497
|
+
});
|
|
498
|
+
if (!Array.isArray(i))
|
|
499
|
+
return;
|
|
500
|
+
const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
|
|
501
|
+
return i.map((l, c) => ({
|
|
502
|
+
context: {
|
|
503
|
+
...t,
|
|
504
|
+
localState: {
|
|
505
|
+
...t.localState,
|
|
506
|
+
$index: c,
|
|
507
|
+
$item: l,
|
|
508
|
+
[r]: l,
|
|
509
|
+
[`$${r}Index`]: c
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
block: o
|
|
513
|
+
}));
|
|
514
|
+
}, SIZES = {
|
|
515
|
+
small: {
|
|
516
|
+
min: 320,
|
|
517
|
+
default: 321,
|
|
518
|
+
max: 640
|
|
519
|
+
},
|
|
520
|
+
medium: {
|
|
521
|
+
min: 641,
|
|
522
|
+
default: 642,
|
|
523
|
+
max: 991
|
|
524
|
+
},
|
|
525
|
+
large: {
|
|
526
|
+
min: 990,
|
|
527
|
+
default: 991,
|
|
528
|
+
max: 1200
|
|
529
|
+
}
|
|
530
|
+
}, getMaxWidthQueryForSize = (e, t = SIZES) => `@media (max-width: ${t[e].max}px)`, getSizesForBreakpoints = ({
|
|
531
|
+
small: e,
|
|
532
|
+
medium: t
|
|
533
|
+
}) => {
|
|
534
|
+
const n = fastClone(SIZES);
|
|
535
|
+
if (!e || !t)
|
|
536
|
+
return n;
|
|
537
|
+
const o = Math.floor(e / 2);
|
|
538
|
+
n.small = {
|
|
539
|
+
max: e,
|
|
540
|
+
min: o,
|
|
541
|
+
default: o + 1
|
|
542
|
+
};
|
|
543
|
+
const i = n.small.max + 1;
|
|
544
|
+
n.medium = {
|
|
545
|
+
max: t,
|
|
546
|
+
min: i,
|
|
547
|
+
default: i + 1
|
|
548
|
+
};
|
|
549
|
+
const a = n.medium.max + 1;
|
|
550
|
+
return n.large = {
|
|
551
|
+
max: 2e3,
|
|
552
|
+
// TODO: decide upper limit
|
|
553
|
+
min: a,
|
|
554
|
+
default: a + 1
|
|
555
|
+
}, n;
|
|
556
|
+
}, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
|
|
557
|
+
if (typeof o == "string")
|
|
558
|
+
return `${camelToKebabCase(n)}: ${o};`;
|
|
559
|
+
}).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
|
|
560
|
+
`), createCssClass = ({
|
|
561
|
+
mediaQuery: e,
|
|
562
|
+
className: t,
|
|
563
|
+
styles: n
|
|
564
|
+
}) => {
|
|
565
|
+
const o = `.${t} {
|
|
566
|
+
${convertStyleMapToCSS(n)}
|
|
567
|
+
}`;
|
|
568
|
+
return e ? `${e} {
|
|
569
|
+
${o}
|
|
570
|
+
}` : o;
|
|
571
|
+
};
|
|
572
|
+
function InlinedStyles(e) {
|
|
573
|
+
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
|
|
574
|
+
}
|
|
575
|
+
function BlockStyles(e) {
|
|
576
|
+
function t() {
|
|
577
|
+
const o = getProcessedBlock({
|
|
578
|
+
block: e.block,
|
|
579
|
+
localState: e.context.localState,
|
|
580
|
+
rootState: e.context.rootState,
|
|
581
|
+
rootSetState: e.context.rootSetState,
|
|
582
|
+
context: e.context.context,
|
|
583
|
+
shouldEvaluateBindings: !0
|
|
584
|
+
});
|
|
585
|
+
return checkIsDefined(o.hide) ? !o.hide : checkIsDefined(o.show) ? o.show : !0;
|
|
586
|
+
}
|
|
587
|
+
function n() {
|
|
588
|
+
var d;
|
|
589
|
+
const o = getProcessedBlock({
|
|
590
|
+
block: e.block,
|
|
591
|
+
localState: e.context.localState,
|
|
592
|
+
rootState: e.context.rootState,
|
|
593
|
+
rootSetState: e.context.rootSetState,
|
|
594
|
+
context: e.context.context,
|
|
595
|
+
shouldEvaluateBindings: !0
|
|
596
|
+
}), i = o.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
597
|
+
((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
|
|
598
|
+
), s = i == null ? void 0 : i.large, l = i == null ? void 0 : i.medium, c = i == null ? void 0 : i.small, u = o.id;
|
|
599
|
+
if (!u)
|
|
600
|
+
return "";
|
|
601
|
+
const y = s ? createCssClass({
|
|
602
|
+
className: u,
|
|
603
|
+
styles: s
|
|
604
|
+
}) : "", x = l ? createCssClass({
|
|
605
|
+
className: u,
|
|
606
|
+
styles: l,
|
|
607
|
+
mediaQuery: getMaxWidthQueryForSize(
|
|
608
|
+
"medium",
|
|
609
|
+
r
|
|
610
|
+
)
|
|
611
|
+
}) : "", m = c ? createCssClass({
|
|
612
|
+
className: u,
|
|
613
|
+
styles: c,
|
|
614
|
+
mediaQuery: getMaxWidthQueryForSize(
|
|
615
|
+
"small",
|
|
616
|
+
r
|
|
617
|
+
)
|
|
618
|
+
}) : "";
|
|
619
|
+
return [y, x, m].join(" ");
|
|
620
|
+
}
|
|
621
|
+
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
622
|
+
}
|
|
623
|
+
function capitalizeFirstLetter(e) {
|
|
624
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
625
|
+
}
|
|
626
|
+
const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventHandler = (e, t) => (n) => evaluate({
|
|
627
|
+
code: e,
|
|
628
|
+
context: t.context,
|
|
629
|
+
localState: t.localState,
|
|
630
|
+
rootState: t.rootState,
|
|
631
|
+
rootSetState: t.rootSetState,
|
|
632
|
+
event: n,
|
|
633
|
+
isExpression: !1
|
|
634
|
+
});
|
|
635
|
+
function getBlockActions(e) {
|
|
636
|
+
var o;
|
|
637
|
+
const t = {}, n = (o = e.block.actions) != null ? o : {};
|
|
638
|
+
for (const i in n) {
|
|
639
|
+
if (!n.hasOwnProperty(i))
|
|
640
|
+
continue;
|
|
641
|
+
const a = n[i];
|
|
642
|
+
let r = getEventHandlerName(i);
|
|
643
|
+
if (e.stripPrefix)
|
|
644
|
+
switch (TARGET) {
|
|
645
|
+
case "vue":
|
|
646
|
+
r = r.replace("v-on:", "");
|
|
647
|
+
break;
|
|
648
|
+
case "svelte":
|
|
649
|
+
r = r.replace("on:", "");
|
|
650
|
+
break;
|
|
651
|
+
}
|
|
652
|
+
t[r] = createEventHandler(a, e);
|
|
653
|
+
}
|
|
654
|
+
return t;
|
|
655
|
+
}
|
|
656
|
+
function transformStyleProperty({
|
|
657
|
+
style: e
|
|
658
|
+
}) {
|
|
659
|
+
return e;
|
|
660
|
+
}
|
|
661
|
+
const getStyle = ({
|
|
662
|
+
block: e,
|
|
663
|
+
context: t
|
|
664
|
+
}) => mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
665
|
+
style: e.style || {},
|
|
666
|
+
context: t,
|
|
667
|
+
block: e
|
|
668
|
+
}));
|
|
669
|
+
function mapStyleObjToStrIfNeeded(e) {
|
|
670
|
+
switch (TARGET) {
|
|
671
|
+
case "svelte":
|
|
672
|
+
case "vue":
|
|
673
|
+
case "solid":
|
|
674
|
+
return convertStyleMapToCSSArray(e).join(" ");
|
|
675
|
+
case "qwik":
|
|
676
|
+
case "reactNative":
|
|
677
|
+
case "react":
|
|
678
|
+
case "rsc":
|
|
679
|
+
return e;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
function transformBlockProperties({
|
|
683
|
+
properties: e
|
|
684
|
+
}) {
|
|
685
|
+
return e;
|
|
686
|
+
}
|
|
687
|
+
const extractRelevantRootBlockProperties = (e) => ({
|
|
688
|
+
href: e.href
|
|
689
|
+
});
|
|
690
|
+
function getBlockProperties({
|
|
691
|
+
block: e,
|
|
692
|
+
context: t
|
|
693
|
+
}) {
|
|
694
|
+
var o;
|
|
695
|
+
const n = {
|
|
696
|
+
...extractRelevantRootBlockProperties(e),
|
|
697
|
+
...e.properties,
|
|
698
|
+
"builder-id": e.id,
|
|
699
|
+
style: getStyle({
|
|
700
|
+
block: e,
|
|
701
|
+
context: t
|
|
702
|
+
}),
|
|
703
|
+
[getClassPropName()]: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
|
|
704
|
+
};
|
|
705
|
+
return transformBlockProperties({
|
|
706
|
+
properties: n,
|
|
707
|
+
context: t,
|
|
708
|
+
block: e
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
function BlockWrapper(e) {
|
|
712
|
+
return /* @__PURE__ */ jsx(
|
|
713
|
+
DynamicRenderer,
|
|
714
|
+
{
|
|
715
|
+
TagName: e.Wrapper,
|
|
716
|
+
attributes: getBlockProperties({
|
|
717
|
+
block: e.block,
|
|
718
|
+
context: e.context
|
|
719
|
+
}),
|
|
720
|
+
actionAttributes: getBlockActions({
|
|
721
|
+
block: e.block,
|
|
722
|
+
rootState: e.context.rootState,
|
|
723
|
+
rootSetState: e.context.rootSetState,
|
|
724
|
+
localState: e.context.localState,
|
|
725
|
+
context: e.context.context,
|
|
726
|
+
stripPrefix: !0
|
|
727
|
+
}),
|
|
728
|
+
children: e.children
|
|
729
|
+
}
|
|
730
|
+
);
|
|
731
|
+
}
|
|
732
|
+
function InteractiveElement(e) {
|
|
733
|
+
return /* @__PURE__ */ jsx(
|
|
734
|
+
e.Wrapper,
|
|
735
|
+
{
|
|
736
|
+
...e.wrapperProps,
|
|
737
|
+
attributes: e.includeBlockProps ? {
|
|
738
|
+
...getBlockProperties({
|
|
739
|
+
block: e.block,
|
|
740
|
+
context: e.context
|
|
741
|
+
}),
|
|
742
|
+
...getBlockActions({
|
|
743
|
+
block: e.block,
|
|
744
|
+
rootState: e.context.rootState,
|
|
745
|
+
rootSetState: e.context.rootSetState,
|
|
746
|
+
localState: e.context.localState,
|
|
747
|
+
context: e.context.context
|
|
748
|
+
})
|
|
749
|
+
} : {},
|
|
750
|
+
children: e.children
|
|
751
|
+
}
|
|
752
|
+
);
|
|
753
|
+
}
|
|
754
|
+
const getWrapperProps = ({
|
|
755
|
+
componentOptions: e,
|
|
756
|
+
builderBlock: t,
|
|
757
|
+
context: n,
|
|
758
|
+
componentRef: o,
|
|
759
|
+
includeBlockProps: i,
|
|
760
|
+
isInteractive: a,
|
|
761
|
+
contextValue: r
|
|
762
|
+
}) => {
|
|
763
|
+
const s = {
|
|
764
|
+
...e,
|
|
765
|
+
/**
|
|
766
|
+
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
767
|
+
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
768
|
+
*/
|
|
769
|
+
...i ? {
|
|
770
|
+
attributes: getBlockProperties({
|
|
771
|
+
block: t,
|
|
772
|
+
context: r
|
|
773
|
+
})
|
|
774
|
+
} : {}
|
|
775
|
+
};
|
|
776
|
+
return a ? {
|
|
777
|
+
Wrapper: o,
|
|
778
|
+
block: t,
|
|
779
|
+
context: n,
|
|
780
|
+
wrapperProps: e,
|
|
781
|
+
includeBlockProps: i
|
|
782
|
+
} : s;
|
|
783
|
+
};
|
|
784
|
+
function ComponentRef(e) {
|
|
785
|
+
var o;
|
|
786
|
+
const [t, n] = useState(
|
|
787
|
+
() => e.isInteractive ? InteractiveElement : e.componentRef
|
|
788
|
+
);
|
|
789
|
+
return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
790
|
+
t,
|
|
791
|
+
{
|
|
792
|
+
...getWrapperProps({
|
|
793
|
+
componentOptions: e.componentOptions,
|
|
794
|
+
builderBlock: e.builderBlock,
|
|
795
|
+
context: e.context,
|
|
796
|
+
componentRef: e.componentRef,
|
|
797
|
+
linkComponent: e.linkComponent,
|
|
798
|
+
includeBlockProps: e.includeBlockProps,
|
|
799
|
+
isInteractive: e.isInteractive,
|
|
800
|
+
contextValue: e.context
|
|
801
|
+
}),
|
|
802
|
+
children: (o = e.blockChildren) == null ? void 0 : o.map((i) => /* @__PURE__ */ jsx(
|
|
803
|
+
Block,
|
|
804
|
+
{
|
|
805
|
+
block: i,
|
|
806
|
+
context: e.context,
|
|
807
|
+
registeredComponents: e.registeredComponents,
|
|
808
|
+
linkComponent: e.linkComponent
|
|
809
|
+
},
|
|
810
|
+
i.id
|
|
811
|
+
))
|
|
812
|
+
}
|
|
813
|
+
) }) : null });
|
|
814
|
+
}
|
|
815
|
+
function RepeatedBlock(e) {
|
|
816
|
+
const [t, n] = useState(() => e.repeatContext);
|
|
817
|
+
return /* @__PURE__ */ jsx(builderContext.Provider, { value: t, children: /* @__PURE__ */ jsx(
|
|
818
|
+
Block,
|
|
819
|
+
{
|
|
820
|
+
block: e.block,
|
|
821
|
+
context: t,
|
|
822
|
+
registeredComponents: e.registeredComponents,
|
|
823
|
+
linkComponent: e.linkComponent
|
|
824
|
+
}
|
|
825
|
+
) });
|
|
826
|
+
}
|
|
827
|
+
function Block(e) {
|
|
828
|
+
var u, y, x;
|
|
829
|
+
function t() {
|
|
830
|
+
return getComponent({
|
|
831
|
+
block: e.block,
|
|
832
|
+
context: e.context,
|
|
833
|
+
registeredComponents: e.registeredComponents
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
function n() {
|
|
837
|
+
return getRepeatItemData({
|
|
838
|
+
block: e.block,
|
|
839
|
+
context: e.context
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
function o() {
|
|
843
|
+
var m;
|
|
844
|
+
return (m = e.block.repeat) != null && m.collection ? e.block : getProcessedBlock({
|
|
845
|
+
block: e.block,
|
|
846
|
+
localState: e.context.localState,
|
|
847
|
+
rootState: e.context.rootState,
|
|
848
|
+
rootSetState: e.context.rootSetState,
|
|
849
|
+
context: e.context.context,
|
|
850
|
+
shouldEvaluateBindings: !0
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
function i() {
|
|
854
|
+
var d;
|
|
855
|
+
return e.block.tagName === "a" || ((d = o().properties) == null ? void 0 : d.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
856
|
+
}
|
|
857
|
+
function a() {
|
|
858
|
+
var f, v;
|
|
859
|
+
if ((f = e.block.repeat) != null && f.collection)
|
|
860
|
+
return !!((v = n == null ? void 0 : n()) != null && v.length);
|
|
861
|
+
const m = "hide" in o() ? o().hide : !1;
|
|
862
|
+
return ("show" in o() ? o().show : !0) && !m;
|
|
863
|
+
}
|
|
864
|
+
function r() {
|
|
865
|
+
var d, f;
|
|
866
|
+
return !((d = t == null ? void 0 : t()) != null && d.component) && !n() ? (f = o().children) != null ? f : [] : [];
|
|
867
|
+
}
|
|
868
|
+
function s() {
|
|
869
|
+
var m, d, f, v, R, S, C, w, E, B, F;
|
|
870
|
+
return {
|
|
871
|
+
blockChildren: (m = o().children) != null ? m : [],
|
|
872
|
+
componentRef: (d = t == null ? void 0 : t()) == null ? void 0 : d.component,
|
|
873
|
+
componentOptions: {
|
|
874
|
+
...getBlockComponentOptions(o()),
|
|
875
|
+
builderContext: e.context,
|
|
876
|
+
...((f = t == null ? void 0 : t()) == null ? void 0 : f.name) === "Core:Button" || ((v = t == null ? void 0 : t()) == null ? void 0 : v.name) === "Symbol" || ((R = t == null ? void 0 : t()) == null ? void 0 : R.name) === "Columns" || ((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Form:Form" ? {
|
|
877
|
+
builderLinkComponent: e.linkComponent
|
|
878
|
+
} : {},
|
|
879
|
+
...((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Symbol" || ((w = t == null ? void 0 : t()) == null ? void 0 : w.name) === "Columns" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Form:Form" ? {
|
|
880
|
+
builderComponents: e.registeredComponents
|
|
881
|
+
} : {}
|
|
882
|
+
},
|
|
883
|
+
context: l,
|
|
884
|
+
linkComponent: e.linkComponent,
|
|
885
|
+
registeredComponents: e.registeredComponents,
|
|
886
|
+
builderBlock: o(),
|
|
887
|
+
includeBlockProps: ((B = t == null ? void 0 : t()) == null ? void 0 : B.noWrap) === !0,
|
|
888
|
+
isInteractive: !((F = t == null ? void 0 : t()) != null && F.isRSC)
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
const [l, c] = useState(() => e.context);
|
|
892
|
+
return useEffect(() => {
|
|
893
|
+
const m = o().id, d = o().animations;
|
|
894
|
+
d && m && bindAnimations(
|
|
895
|
+
d.filter((f) => f.trigger !== "hover").map((f) => ({
|
|
896
|
+
...f,
|
|
897
|
+
elementId: m
|
|
898
|
+
}))
|
|
899
|
+
);
|
|
900
|
+
}, []), /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
901
|
+
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
902
|
+
(u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
903
|
+
ComponentRef,
|
|
904
|
+
{
|
|
905
|
+
componentRef: s().componentRef,
|
|
906
|
+
componentOptions: s().componentOptions,
|
|
907
|
+
blockChildren: s().blockChildren,
|
|
908
|
+
context: s().context,
|
|
909
|
+
registeredComponents: s().registeredComponents,
|
|
910
|
+
linkComponent: s().linkComponent,
|
|
911
|
+
builderBlock: s().builderBlock,
|
|
912
|
+
includeBlockProps: s().includeBlockProps,
|
|
913
|
+
isInteractive: s().isInteractive
|
|
914
|
+
}
|
|
915
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (x = n()) == null ? void 0 : x.map((m, d) => /* @__PURE__ */ jsx(
|
|
916
|
+
RepeatedBlock,
|
|
917
|
+
{
|
|
918
|
+
repeatContext: m.context,
|
|
919
|
+
block: m.block,
|
|
920
|
+
registeredComponents: e.registeredComponents,
|
|
921
|
+
linkComponent: e.linkComponent
|
|
922
|
+
},
|
|
923
|
+
d
|
|
924
|
+
)) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
925
|
+
BlockWrapper,
|
|
926
|
+
{
|
|
927
|
+
Wrapper: i(),
|
|
928
|
+
block: o(),
|
|
929
|
+
context: e.context,
|
|
930
|
+
linkComponent: e.linkComponent,
|
|
931
|
+
children: [
|
|
932
|
+
/* @__PURE__ */ jsx(
|
|
933
|
+
ComponentRef,
|
|
934
|
+
{
|
|
935
|
+
componentRef: s().componentRef,
|
|
936
|
+
componentOptions: s().componentOptions,
|
|
937
|
+
blockChildren: s().blockChildren,
|
|
938
|
+
context: s().context,
|
|
939
|
+
registeredComponents: s().registeredComponents,
|
|
940
|
+
linkComponent: s().linkComponent,
|
|
941
|
+
builderBlock: s().builderBlock,
|
|
942
|
+
includeBlockProps: s().includeBlockProps,
|
|
943
|
+
isInteractive: s().isInteractive
|
|
944
|
+
}
|
|
945
|
+
),
|
|
946
|
+
(y = r()) == null ? void 0 : y.map((m) => /* @__PURE__ */ jsx(
|
|
947
|
+
Block,
|
|
948
|
+
{
|
|
949
|
+
block: m,
|
|
950
|
+
context: l,
|
|
951
|
+
registeredComponents: e.registeredComponents,
|
|
952
|
+
linkComponent: e.linkComponent
|
|
953
|
+
},
|
|
954
|
+
m.id
|
|
955
|
+
))
|
|
956
|
+
]
|
|
957
|
+
}
|
|
958
|
+
) }) })
|
|
959
|
+
] }) : null });
|
|
960
|
+
}
|
|
961
|
+
function BlocksWrapper(e) {
|
|
962
|
+
function t() {
|
|
963
|
+
var i;
|
|
964
|
+
return "builder-blocks" + ((i = e.blocks) != null && i.length ? "" : " no-blocks");
|
|
965
|
+
}
|
|
966
|
+
function n() {
|
|
967
|
+
var i, a;
|
|
968
|
+
isEditing() && !((i = e.blocks) != null && i.length) && ((a = window.parent) == null || a.postMessage(
|
|
969
|
+
{
|
|
970
|
+
type: "builder.clickEmptyBlocks",
|
|
971
|
+
data: {
|
|
972
|
+
parentElementId: e.parent,
|
|
973
|
+
dataPath: e.path
|
|
974
|
+
}
|
|
975
|
+
},
|
|
976
|
+
"*"
|
|
977
|
+
));
|
|
978
|
+
}
|
|
979
|
+
function o() {
|
|
980
|
+
var i, a;
|
|
981
|
+
isEditing() && !((i = e.blocks) != null && i.length) && ((a = window.parent) == null || a.postMessage(
|
|
982
|
+
{
|
|
983
|
+
type: "builder.hoverEmptyBlocks",
|
|
984
|
+
data: {
|
|
985
|
+
parentElementId: e.parent,
|
|
986
|
+
dataPath: e.path
|
|
987
|
+
}
|
|
988
|
+
},
|
|
989
|
+
"*"
|
|
990
|
+
));
|
|
991
|
+
}
|
|
992
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
993
|
+
/* @__PURE__ */ jsx(
|
|
994
|
+
e.BlocksWrapper,
|
|
995
|
+
{
|
|
996
|
+
className: t() + " props-blocks-wrapper-7354e098",
|
|
997
|
+
"builder-path": e.path,
|
|
998
|
+
"builder-parent-id": e.parent,
|
|
999
|
+
style: e.styleProp,
|
|
1000
|
+
onClick: (i) => n(),
|
|
1001
|
+
onMouseEnter: (i) => o(),
|
|
1002
|
+
onKeyPress: (i) => n(),
|
|
1003
|
+
...e.BlocksWrapperProps,
|
|
1004
|
+
children: e.children
|
|
1005
|
+
}
|
|
1006
|
+
),
|
|
1007
|
+
/* @__PURE__ */ jsx("style", { children: `.props-blocks-wrapper-7354e098 {
|
|
1008
|
+
display: flex;
|
|
1009
|
+
flex-direction: column;
|
|
1010
|
+
align-items: stretch;
|
|
1011
|
+
}` })
|
|
1012
|
+
] });
|
|
1013
|
+
}
|
|
1014
|
+
function Blocks(e) {
|
|
1015
|
+
var o, i, a;
|
|
1016
|
+
const t = useContext(builderContext), n = useContext(ComponentsContext);
|
|
1017
|
+
return /* @__PURE__ */ jsx(
|
|
1018
|
+
BlocksWrapper,
|
|
1019
|
+
{
|
|
1020
|
+
blocks: e.blocks,
|
|
1021
|
+
parent: e.parent,
|
|
1022
|
+
path: e.path,
|
|
1023
|
+
styleProp: e.styleProp,
|
|
1024
|
+
BlocksWrapper: (o = e.context) == null ? void 0 : o.BlocksWrapper,
|
|
1025
|
+
BlocksWrapperProps: (i = e.context) == null ? void 0 : i.BlocksWrapperProps,
|
|
1026
|
+
children: e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (a = e.blocks) == null ? void 0 : a.map((r) => /* @__PURE__ */ jsx(
|
|
1027
|
+
Block,
|
|
1028
|
+
{
|
|
1029
|
+
block: r,
|
|
1030
|
+
linkComponent: e.linkComponent,
|
|
1031
|
+
context: e.context || t,
|
|
1032
|
+
registeredComponents: e.registeredComponents || n.registeredComponents
|
|
1033
|
+
},
|
|
1034
|
+
r.id
|
|
1035
|
+
)) }) : null
|
|
1036
|
+
}
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
function Columns(e) {
|
|
1040
|
+
var R;
|
|
1041
|
+
const [t, n] = useState(
|
|
1042
|
+
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
1043
|
+
), [o, i] = useState(() => e.columns || []), [a, r] = useState(
|
|
1044
|
+
() => e.stackColumnsAt || "tablet"
|
|
1045
|
+
);
|
|
1046
|
+
function s(S) {
|
|
1047
|
+
var C;
|
|
1048
|
+
return ((C = o[S]) == null ? void 0 : C.width) || 100 / o.length;
|
|
1049
|
+
}
|
|
1050
|
+
function l(S) {
|
|
1051
|
+
const C = t * (o.length - 1) / o.length;
|
|
1052
|
+
return `calc(${s(S)}% - ${C}px)`;
|
|
1053
|
+
}
|
|
1054
|
+
function c({
|
|
1055
|
+
stackedStyle: S,
|
|
1056
|
+
desktopStyle: C
|
|
1057
|
+
}) {
|
|
1058
|
+
return a === "tablet" ? S : C;
|
|
1059
|
+
}
|
|
1060
|
+
function u({
|
|
1061
|
+
stackedStyle: S,
|
|
1062
|
+
desktopStyle: C
|
|
1063
|
+
}) {
|
|
1064
|
+
return a === "never" ? C : S;
|
|
1065
|
+
}
|
|
1066
|
+
const [y, x] = useState(
|
|
1067
|
+
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
1068
|
+
);
|
|
1069
|
+
function m() {
|
|
1070
|
+
return {
|
|
1071
|
+
"--flex-dir": y,
|
|
1072
|
+
"--flex-dir-tablet": c({
|
|
1073
|
+
stackedStyle: y,
|
|
1074
|
+
desktopStyle: "row"
|
|
1075
|
+
})
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
function d(S) {
|
|
1079
|
+
const C = S === 0 ? 0 : t, w = l(S), E = `${C}px`, B = "100%", F = 0;
|
|
1080
|
+
return {
|
|
1081
|
+
...{
|
|
1082
|
+
display: "flex",
|
|
1083
|
+
flexDirection: "column",
|
|
1084
|
+
alignItems: "stretch"
|
|
1085
|
+
},
|
|
1086
|
+
width: w,
|
|
1087
|
+
["marginLeft"]: E,
|
|
1088
|
+
"--column-width-mobile": u({
|
|
1089
|
+
stackedStyle: B,
|
|
1090
|
+
desktopStyle: w
|
|
1091
|
+
}),
|
|
1092
|
+
"--column-margin-left-mobile": u({
|
|
1093
|
+
stackedStyle: F,
|
|
1094
|
+
desktopStyle: E
|
|
1095
|
+
}),
|
|
1096
|
+
"--column-width-tablet": c({
|
|
1097
|
+
stackedStyle: B,
|
|
1098
|
+
desktopStyle: w
|
|
1099
|
+
}),
|
|
1100
|
+
"--column-margin-left-tablet": c({
|
|
1101
|
+
stackedStyle: F,
|
|
1102
|
+
desktopStyle: E
|
|
1103
|
+
})
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
function f(S) {
|
|
1107
|
+
var w, E;
|
|
1108
|
+
return getSizesForBreakpoints(
|
|
1109
|
+
((E = (w = e.builderContext.content) == null ? void 0 : w.meta) == null ? void 0 : E.breakpoints) || {}
|
|
1110
|
+
)[S].max;
|
|
1111
|
+
}
|
|
1112
|
+
function v() {
|
|
1113
|
+
return `
|
|
1114
|
+
@media (max-width: ${f("medium")}px) {
|
|
1115
|
+
.${e.builderBlock.id}-breakpoints {
|
|
1116
|
+
flex-direction: var(--flex-dir-tablet);
|
|
1117
|
+
align-items: stretch;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
.${e.builderBlock.id}-breakpoints > .builder-column {
|
|
1121
|
+
width: var(--column-width-tablet) !important;
|
|
1122
|
+
margin-left: var(--column-margin-left-tablet) !important;
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
@media (max-width: ${f("small")}px) {
|
|
1127
|
+
.${e.builderBlock.id}-breakpoints {
|
|
1128
|
+
flex-direction: var(--flex-dir);
|
|
1129
|
+
align-items: stretch;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
.${e.builderBlock.id}-breakpoints > .builder-column {
|
|
1133
|
+
width: var(--column-width-mobile) !important;
|
|
1134
|
+
margin-left: var(--column-margin-left-mobile) !important;
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
`;
|
|
1138
|
+
}
|
|
1139
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1140
|
+
/* @__PURE__ */ jsxs(
|
|
1141
|
+
"div",
|
|
1142
|
+
{
|
|
1143
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-f5024694`,
|
|
1144
|
+
style: m(),
|
|
1145
|
+
children: [
|
|
1146
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: v() }) }),
|
|
1147
|
+
(R = e.columns) == null ? void 0 : R.map((S, C) => /* @__PURE__ */ jsx(
|
|
1148
|
+
DynamicRenderer,
|
|
1149
|
+
{
|
|
1150
|
+
TagName: S.link ? e.builderLinkComponent || "a" : "div",
|
|
1151
|
+
actionAttributes: {},
|
|
1152
|
+
attributes: {
|
|
1153
|
+
...S.link ? {
|
|
1154
|
+
href: S.link
|
|
1155
|
+
} : {},
|
|
1156
|
+
[getClassPropName()]: "builder-column",
|
|
1157
|
+
style: mapStyleObjToStrIfNeeded(d(C))
|
|
1158
|
+
},
|
|
1159
|
+
children: /* @__PURE__ */ jsx(
|
|
1160
|
+
Blocks,
|
|
1161
|
+
{
|
|
1162
|
+
path: `component.options.columns.${C}.blocks`,
|
|
1163
|
+
parent: e.builderBlock.id,
|
|
1164
|
+
styleProp: {
|
|
1165
|
+
flexGrow: "1"
|
|
1166
|
+
},
|
|
1167
|
+
context: e.builderContext,
|
|
1168
|
+
registeredComponents: e.builderComponents,
|
|
1169
|
+
linkComponent: e.builderLinkComponent,
|
|
1170
|
+
blocks: S.blocks
|
|
1171
|
+
}
|
|
1172
|
+
)
|
|
1173
|
+
},
|
|
1174
|
+
C
|
|
1175
|
+
))
|
|
1176
|
+
]
|
|
1177
|
+
}
|
|
1178
|
+
),
|
|
1179
|
+
/* @__PURE__ */ jsx("style", { children: `.div-f5024694 {
|
|
1180
|
+
display: flex;
|
|
1181
|
+
line-height: normal;
|
|
1182
|
+
}` })
|
|
1183
|
+
] });
|
|
1184
|
+
}
|
|
1185
|
+
function FragmentComponent(e) {
|
|
1186
|
+
return /* @__PURE__ */ jsx("span", { children: e.children });
|
|
1187
|
+
}
|
|
1188
|
+
function removeProtocol(e) {
|
|
1189
|
+
return e.replace(/http(s)?:/, "");
|
|
1190
|
+
}
|
|
1191
|
+
function updateQueryParam(e = "", t, n) {
|
|
1192
|
+
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
|
|
1193
|
+
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
|
|
1194
|
+
}
|
|
1195
|
+
function getShopifyImageUrl(e, t) {
|
|
1196
|
+
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
1197
|
+
return e;
|
|
1198
|
+
if (t === "master")
|
|
1199
|
+
return removeProtocol(e);
|
|
1200
|
+
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
1201
|
+
if (n) {
|
|
1202
|
+
const o = e.split(n[0]), i = n[3], a = t.match("x") ? t : `${t}x`;
|
|
1203
|
+
return removeProtocol(`${o[0]}_${a}${i}`);
|
|
1204
|
+
}
|
|
1205
|
+
return null;
|
|
1206
|
+
}
|
|
1207
|
+
function getSrcSet(e) {
|
|
1208
|
+
if (!e)
|
|
1209
|
+
return e;
|
|
1210
|
+
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
1211
|
+
if (e.match(/builder\.io/)) {
|
|
1212
|
+
let n = e;
|
|
1213
|
+
const o = Number(e.split("?width=")[1]);
|
|
1214
|
+
return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${updateQueryParam(e, "width", i)} ${i}w`).concat([n]).join(", ");
|
|
1215
|
+
}
|
|
1216
|
+
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;
|
|
1217
|
+
}
|
|
1218
|
+
function Image(e) {
|
|
1219
|
+
var i, a, r, s;
|
|
1220
|
+
function t() {
|
|
1221
|
+
var u;
|
|
1222
|
+
const c = e.image || e.src;
|
|
1223
|
+
if (!c || // We can auto add srcset for cdn.builder.io and shopify
|
|
1224
|
+
// images, otherwise you can supply this prop manually
|
|
1225
|
+
!(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
|
|
1226
|
+
return e.srcset;
|
|
1227
|
+
if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
|
|
1228
|
+
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
1229
|
+
return console.debug("Removed given srcset"), getSrcSet(c);
|
|
1230
|
+
} else if (e.image && !e.srcset)
|
|
1231
|
+
return getSrcSet(c);
|
|
1232
|
+
return getSrcSet(c);
|
|
1233
|
+
}
|
|
1234
|
+
function n() {
|
|
1235
|
+
var l;
|
|
1236
|
+
return (l = t == null ? void 0 : t()) != null && l.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
|
|
1237
|
+
}
|
|
1238
|
+
function o() {
|
|
1239
|
+
const l = {
|
|
1240
|
+
position: "absolute",
|
|
1241
|
+
height: "100%",
|
|
1242
|
+
width: "100%",
|
|
1243
|
+
left: "0px",
|
|
1244
|
+
top: "0px"
|
|
1245
|
+
};
|
|
1246
|
+
return e.aspectRatio ? l : void 0;
|
|
1247
|
+
}
|
|
1248
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1249
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1250
|
+
/* @__PURE__ */ jsxs("picture", { children: [
|
|
1251
|
+
n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("source", { type: "image/webp", srcSet: n() }) }) : null,
|
|
1252
|
+
/* @__PURE__ */ jsx(
|
|
1253
|
+
"img",
|
|
1254
|
+
{
|
|
1255
|
+
loading: "lazy",
|
|
1256
|
+
alt: e.altText,
|
|
1257
|
+
role: e.altText ? "presentation" : void 0,
|
|
1258
|
+
style: {
|
|
1259
|
+
objectPosition: e.backgroundPosition || "center",
|
|
1260
|
+
objectFit: e.backgroundSize || "cover",
|
|
1261
|
+
...o()
|
|
1262
|
+
},
|
|
1263
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-40c70c9b",
|
|
1264
|
+
src: e.image,
|
|
1265
|
+
srcSet: t(),
|
|
1266
|
+
sizes: e.sizes
|
|
1267
|
+
}
|
|
1268
|
+
)
|
|
1269
|
+
] }),
|
|
1270
|
+
e.aspectRatio && !((a = (i = e.builderBlock) == null ? void 0 : i.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1271
|
+
"div",
|
|
1272
|
+
{
|
|
1273
|
+
className: "builder-image-sizer div-40c70c9b",
|
|
1274
|
+
style: {
|
|
1275
|
+
paddingTop: e.aspectRatio * 100 + "%"
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
) }) : null,
|
|
1279
|
+
(s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
|
|
1280
|
+
!e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
|
|
1281
|
+
] }),
|
|
1282
|
+
/* @__PURE__ */ jsx("style", { children: `.img-40c70c9b {
|
|
1283
|
+
opacity: 1;
|
|
1284
|
+
transition: opacity 0.2s ease-in-out;
|
|
1285
|
+
}.div-40c70c9b {
|
|
1286
|
+
width: 100%;
|
|
1287
|
+
pointer-events: none;
|
|
1288
|
+
font-size: 0;
|
|
1289
|
+
}.div-40c70c9b-2 {
|
|
1290
|
+
display: flex;
|
|
1291
|
+
flex-direction: column;
|
|
1292
|
+
align-items: stretch;
|
|
1293
|
+
position: absolute;
|
|
1294
|
+
top: 0;
|
|
1295
|
+
left: 0;
|
|
1296
|
+
width: 100%;
|
|
1297
|
+
height: 100%;
|
|
1298
|
+
}` })
|
|
1299
|
+
] });
|
|
1300
|
+
}
|
|
1301
|
+
function SectionComponent(e) {
|
|
1302
|
+
return /* @__PURE__ */ jsx(
|
|
1303
|
+
"section",
|
|
1304
|
+
{
|
|
1305
|
+
...e.attributes,
|
|
1306
|
+
style: {
|
|
1307
|
+
width: "100%",
|
|
1308
|
+
alignSelf: "stretch",
|
|
1309
|
+
flexGrow: 1,
|
|
1310
|
+
boxSizing: "border-box",
|
|
1311
|
+
maxWidth: e.maxWidth || 1200,
|
|
1312
|
+
display: "flex",
|
|
1313
|
+
flexDirection: "column",
|
|
1314
|
+
alignItems: "stretch",
|
|
1315
|
+
marginLeft: "auto",
|
|
1316
|
+
marginRight: "auto"
|
|
1317
|
+
},
|
|
1318
|
+
children: e.children
|
|
1319
|
+
}
|
|
1320
|
+
);
|
|
1321
|
+
}
|
|
1322
|
+
const componentInfo$f = {
|
|
1323
|
+
name: "Core:Button",
|
|
1324
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
1325
|
+
defaultStyles: {
|
|
1326
|
+
// TODO: make min width more intuitive and set one
|
|
1327
|
+
appearance: "none",
|
|
1328
|
+
paddingTop: "15px",
|
|
1329
|
+
paddingBottom: "15px",
|
|
1330
|
+
paddingLeft: "25px",
|
|
1331
|
+
paddingRight: "25px",
|
|
1332
|
+
backgroundColor: "#000000",
|
|
1333
|
+
color: "white",
|
|
1334
|
+
borderRadius: "4px",
|
|
1335
|
+
textAlign: "center",
|
|
1336
|
+
cursor: "pointer"
|
|
1337
|
+
},
|
|
1338
|
+
inputs: [{
|
|
1339
|
+
name: "text",
|
|
1340
|
+
type: "text",
|
|
1341
|
+
defaultValue: "Click me!",
|
|
1342
|
+
bubble: !0
|
|
1343
|
+
}, {
|
|
1344
|
+
name: "link",
|
|
1345
|
+
type: "url",
|
|
1346
|
+
bubble: !0
|
|
1347
|
+
}, {
|
|
1348
|
+
name: "openLinkInNewTab",
|
|
1349
|
+
type: "boolean",
|
|
1350
|
+
defaultValue: !1,
|
|
1351
|
+
friendlyName: "Open link in new tab"
|
|
1352
|
+
}],
|
|
1353
|
+
static: !0,
|
|
1354
|
+
noWrap: !0
|
|
1355
|
+
}, componentInfo$e = {
|
|
1356
|
+
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
1357
|
+
name: "Columns",
|
|
1358
|
+
isRSC: !0,
|
|
1359
|
+
inputs: [{
|
|
1360
|
+
name: "columns",
|
|
1361
|
+
type: "array",
|
|
1362
|
+
broadcast: !0,
|
|
1363
|
+
subFields: [{
|
|
1364
|
+
name: "blocks",
|
|
1365
|
+
type: "array",
|
|
1366
|
+
hideFromUI: !0,
|
|
1367
|
+
defaultValue: [{
|
|
1368
|
+
"@type": "@builder.io/sdk:Element",
|
|
1369
|
+
responsiveStyles: {
|
|
1370
|
+
large: {
|
|
1371
|
+
display: "flex",
|
|
1372
|
+
flexDirection: "column",
|
|
1373
|
+
alignItems: "stretch",
|
|
1374
|
+
flexShrink: "0",
|
|
1375
|
+
position: "relative",
|
|
1376
|
+
marginTop: "30px",
|
|
1377
|
+
textAlign: "center",
|
|
1378
|
+
lineHeight: "normal",
|
|
1379
|
+
height: "auto",
|
|
1380
|
+
minHeight: "20px",
|
|
1381
|
+
minWidth: "20px",
|
|
1382
|
+
overflow: "hidden"
|
|
1383
|
+
}
|
|
1384
|
+
},
|
|
1385
|
+
component: {
|
|
1386
|
+
name: "Image",
|
|
1387
|
+
options: {
|
|
1388
|
+
image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
1389
|
+
backgroundPosition: "center",
|
|
1390
|
+
backgroundSize: "cover",
|
|
1391
|
+
aspectRatio: 0.7004048582995948
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
}, {
|
|
1395
|
+
"@type": "@builder.io/sdk:Element",
|
|
1396
|
+
responsiveStyles: {
|
|
1397
|
+
large: {
|
|
1398
|
+
display: "flex",
|
|
1399
|
+
flexDirection: "column",
|
|
1400
|
+
alignItems: "stretch",
|
|
1401
|
+
flexShrink: "0",
|
|
1402
|
+
position: "relative",
|
|
1403
|
+
marginTop: "30px",
|
|
1404
|
+
textAlign: "center",
|
|
1405
|
+
lineHeight: "normal",
|
|
1406
|
+
height: "auto"
|
|
1407
|
+
}
|
|
1408
|
+
},
|
|
1409
|
+
component: {
|
|
1410
|
+
name: "Text",
|
|
1411
|
+
options: {
|
|
1412
|
+
text: "<p>Enter some text...</p>"
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
}]
|
|
1416
|
+
}, {
|
|
1417
|
+
name: "width",
|
|
1418
|
+
type: "number",
|
|
1419
|
+
hideFromUI: !0,
|
|
1420
|
+
helperText: "Width %, e.g. set to 50 to fill half of the space"
|
|
1421
|
+
}, {
|
|
1422
|
+
name: "link",
|
|
1423
|
+
type: "url",
|
|
1424
|
+
helperText: "Optionally set a url that clicking this column will link to"
|
|
1425
|
+
}],
|
|
1426
|
+
defaultValue: [{
|
|
1427
|
+
blocks: [{
|
|
1428
|
+
"@type": "@builder.io/sdk:Element",
|
|
1429
|
+
responsiveStyles: {
|
|
1430
|
+
large: {
|
|
1431
|
+
display: "flex",
|
|
1432
|
+
flexDirection: "column",
|
|
1433
|
+
alignItems: "stretch",
|
|
1434
|
+
flexShrink: "0",
|
|
1435
|
+
position: "relative",
|
|
1436
|
+
marginTop: "30px",
|
|
1437
|
+
textAlign: "center",
|
|
1438
|
+
lineHeight: "normal",
|
|
1439
|
+
height: "auto",
|
|
1440
|
+
minHeight: "20px",
|
|
1441
|
+
minWidth: "20px",
|
|
1442
|
+
overflow: "hidden"
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
component: {
|
|
1446
|
+
name: "Image",
|
|
1447
|
+
options: {
|
|
1448
|
+
image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
1449
|
+
backgroundPosition: "center",
|
|
1450
|
+
backgroundSize: "cover",
|
|
1451
|
+
aspectRatio: 0.7004048582995948
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
}, {
|
|
1455
|
+
"@type": "@builder.io/sdk:Element",
|
|
1456
|
+
responsiveStyles: {
|
|
1457
|
+
large: {
|
|
1458
|
+
display: "flex",
|
|
1459
|
+
flexDirection: "column",
|
|
1460
|
+
alignItems: "stretch",
|
|
1461
|
+
flexShrink: "0",
|
|
1462
|
+
position: "relative",
|
|
1463
|
+
marginTop: "30px",
|
|
1464
|
+
textAlign: "center",
|
|
1465
|
+
lineHeight: "normal",
|
|
1466
|
+
height: "auto"
|
|
1467
|
+
}
|
|
1468
|
+
},
|
|
1469
|
+
component: {
|
|
1470
|
+
name: "Text",
|
|
1471
|
+
options: {
|
|
1472
|
+
text: "<p>Enter some text...</p>"
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
}]
|
|
1476
|
+
}, {
|
|
1477
|
+
blocks: [{
|
|
1478
|
+
"@type": "@builder.io/sdk:Element",
|
|
1479
|
+
responsiveStyles: {
|
|
1480
|
+
large: {
|
|
1481
|
+
display: "flex",
|
|
1482
|
+
flexDirection: "column",
|
|
1483
|
+
alignItems: "stretch",
|
|
1484
|
+
flexShrink: "0",
|
|
1485
|
+
position: "relative",
|
|
1486
|
+
marginTop: "30px",
|
|
1487
|
+
textAlign: "center",
|
|
1488
|
+
lineHeight: "normal",
|
|
1489
|
+
height: "auto",
|
|
1490
|
+
minHeight: "20px",
|
|
1491
|
+
minWidth: "20px",
|
|
1492
|
+
overflow: "hidden"
|
|
1493
|
+
}
|
|
1494
|
+
},
|
|
1495
|
+
component: {
|
|
1496
|
+
name: "Image",
|
|
1497
|
+
options: {
|
|
1498
|
+
image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
1499
|
+
backgroundPosition: "center",
|
|
1500
|
+
backgroundSize: "cover",
|
|
1501
|
+
aspectRatio: 0.7004048582995948
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
}, {
|
|
1505
|
+
"@type": "@builder.io/sdk:Element",
|
|
1506
|
+
responsiveStyles: {
|
|
1507
|
+
large: {
|
|
1508
|
+
display: "flex",
|
|
1509
|
+
flexDirection: "column",
|
|
1510
|
+
alignItems: "stretch",
|
|
1511
|
+
flexShrink: "0",
|
|
1512
|
+
position: "relative",
|
|
1513
|
+
marginTop: "30px",
|
|
1514
|
+
textAlign: "center",
|
|
1515
|
+
lineHeight: "normal",
|
|
1516
|
+
height: "auto"
|
|
1517
|
+
}
|
|
1518
|
+
},
|
|
1519
|
+
component: {
|
|
1520
|
+
name: "Text",
|
|
1521
|
+
options: {
|
|
1522
|
+
text: "<p>Enter some text...</p>"
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
}]
|
|
1526
|
+
}],
|
|
1527
|
+
onChange: (e) => {
|
|
1528
|
+
function t() {
|
|
1529
|
+
n.forEach((o) => {
|
|
1530
|
+
o.delete("width");
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1533
|
+
const n = e.get("columns");
|
|
1534
|
+
Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((s, l) => s + l.get("width"), 0) !== 100) && t();
|
|
1535
|
+
}
|
|
1536
|
+
}, {
|
|
1537
|
+
name: "space",
|
|
1538
|
+
type: "number",
|
|
1539
|
+
defaultValue: 20,
|
|
1540
|
+
helperText: "Size of gap between columns",
|
|
1541
|
+
advanced: !0
|
|
1542
|
+
}, {
|
|
1543
|
+
name: "stackColumnsAt",
|
|
1544
|
+
type: "string",
|
|
1545
|
+
defaultValue: "tablet",
|
|
1546
|
+
helperText: "Convert horizontal columns to vertical at what device size",
|
|
1547
|
+
enum: ["tablet", "mobile", "never"],
|
|
1548
|
+
advanced: !0
|
|
1549
|
+
}, {
|
|
1550
|
+
name: "reverseColumnsWhenStacked",
|
|
1551
|
+
type: "boolean",
|
|
1552
|
+
defaultValue: !1,
|
|
1553
|
+
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
1554
|
+
advanced: !0
|
|
1555
|
+
}]
|
|
1556
|
+
}, componentInfo$d = {
|
|
1557
|
+
name: "Fragment",
|
|
1558
|
+
static: !0,
|
|
1559
|
+
hidden: !0,
|
|
1560
|
+
canHaveChildren: !0,
|
|
1561
|
+
noWrap: !0
|
|
1562
|
+
}, componentInfo$c = {
|
|
1563
|
+
name: "Image",
|
|
1564
|
+
static: !0,
|
|
1565
|
+
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",
|
|
1566
|
+
defaultStyles: {
|
|
1567
|
+
position: "relative",
|
|
1568
|
+
minHeight: "20px",
|
|
1569
|
+
minWidth: "20px",
|
|
1570
|
+
overflow: "hidden"
|
|
1571
|
+
},
|
|
1572
|
+
canHaveChildren: !0,
|
|
1573
|
+
inputs: [{
|
|
1574
|
+
name: "image",
|
|
1575
|
+
type: "file",
|
|
1576
|
+
bubble: !0,
|
|
1577
|
+
allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
|
|
1578
|
+
required: !0,
|
|
1579
|
+
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
1580
|
+
onChange: (e) => {
|
|
1581
|
+
e.delete("srcset"), e.delete("noWebp");
|
|
1582
|
+
function n(r, s = 6e4) {
|
|
1583
|
+
return new Promise((l, c) => {
|
|
1584
|
+
const u = document.createElement("img");
|
|
1585
|
+
let y = !1;
|
|
1586
|
+
u.onload = () => {
|
|
1587
|
+
y = !0, l(u);
|
|
1588
|
+
}, u.addEventListener("error", (x) => {
|
|
1589
|
+
console.warn("Image load failed", x.error), c(x.error);
|
|
1590
|
+
}), u.src = r, setTimeout(() => {
|
|
1591
|
+
y || c(new Error("Image load timed out"));
|
|
1592
|
+
}, s);
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
function o(r) {
|
|
1596
|
+
return Math.round(r * 1e3) / 1e3;
|
|
1597
|
+
}
|
|
1598
|
+
const i = e.get("image"), a = e.get("aspectRatio");
|
|
1599
|
+
if (fetch(i).then((r) => r.blob()).then((r) => {
|
|
1600
|
+
r.type.includes("svg") && e.set("noWebp", !0);
|
|
1601
|
+
}), i && (!a || a === 0.7041))
|
|
1602
|
+
return n(i).then((r) => {
|
|
1603
|
+
const s = e.get("aspectRatio");
|
|
1604
|
+
e.get("image") === i && (!s || s === 0.7041) && r.width && r.height && (e.set("aspectRatio", o(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
}, {
|
|
1608
|
+
name: "backgroundSize",
|
|
1609
|
+
type: "text",
|
|
1610
|
+
defaultValue: "cover",
|
|
1611
|
+
enum: [{
|
|
1612
|
+
label: "contain",
|
|
1613
|
+
value: "contain",
|
|
1614
|
+
helperText: "The image should never get cropped"
|
|
1615
|
+
}, {
|
|
1616
|
+
label: "cover",
|
|
1617
|
+
value: "cover",
|
|
1618
|
+
helperText: "The image should fill it's box, cropping when needed"
|
|
1619
|
+
}]
|
|
1620
|
+
}, {
|
|
1621
|
+
name: "backgroundPosition",
|
|
1622
|
+
type: "text",
|
|
1623
|
+
defaultValue: "center",
|
|
1624
|
+
enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
|
|
1625
|
+
}, {
|
|
1626
|
+
name: "altText",
|
|
1627
|
+
type: "string",
|
|
1628
|
+
helperText: "Text to display when the user has images off"
|
|
1629
|
+
}, {
|
|
1630
|
+
name: "height",
|
|
1631
|
+
type: "number",
|
|
1632
|
+
hideFromUI: !0
|
|
1633
|
+
}, {
|
|
1634
|
+
name: "width",
|
|
1635
|
+
type: "number",
|
|
1636
|
+
hideFromUI: !0
|
|
1637
|
+
}, {
|
|
1638
|
+
name: "sizes",
|
|
1639
|
+
type: "string",
|
|
1640
|
+
hideFromUI: !0
|
|
1641
|
+
}, {
|
|
1642
|
+
name: "srcset",
|
|
1643
|
+
type: "string",
|
|
1644
|
+
hideFromUI: !0
|
|
1645
|
+
}, {
|
|
1646
|
+
name: "lazy",
|
|
1647
|
+
type: "boolean",
|
|
1648
|
+
defaultValue: !0,
|
|
1649
|
+
hideFromUI: !0
|
|
1650
|
+
}, {
|
|
1651
|
+
name: "fitContent",
|
|
1652
|
+
type: "boolean",
|
|
1653
|
+
helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
|
|
1654
|
+
defaultValue: !0
|
|
1655
|
+
}, {
|
|
1656
|
+
name: "aspectRatio",
|
|
1657
|
+
type: "number",
|
|
1658
|
+
helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
|
|
1659
|
+
advanced: !0,
|
|
1660
|
+
defaultValue: 0.7041
|
|
1661
|
+
}]
|
|
1662
|
+
}, componentInfo$b = {
|
|
1663
|
+
name: "Core:Section",
|
|
1664
|
+
static: !0,
|
|
1665
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
1666
|
+
inputs: [{
|
|
1667
|
+
name: "maxWidth",
|
|
1668
|
+
type: "number",
|
|
1669
|
+
defaultValue: 1200
|
|
1670
|
+
}, {
|
|
1671
|
+
name: "lazyLoad",
|
|
1672
|
+
type: "boolean",
|
|
1673
|
+
defaultValue: !1,
|
|
1674
|
+
advanced: !0,
|
|
1675
|
+
description: "Only render this section when in view"
|
|
1676
|
+
}],
|
|
1677
|
+
defaultStyles: {
|
|
1678
|
+
paddingLeft: "20px",
|
|
1679
|
+
paddingRight: "20px",
|
|
1680
|
+
paddingTop: "50px",
|
|
1681
|
+
paddingBottom: "50px",
|
|
1682
|
+
marginTop: "0px",
|
|
1683
|
+
width: "100vw",
|
|
1684
|
+
marginLeft: "calc(50% - 50vw)"
|
|
1685
|
+
},
|
|
1686
|
+
canHaveChildren: !0,
|
|
1687
|
+
defaultChildren: [{
|
|
1688
|
+
"@type": "@builder.io/sdk:Element",
|
|
1689
|
+
responsiveStyles: {
|
|
1690
|
+
large: {
|
|
1691
|
+
textAlign: "center"
|
|
1692
|
+
}
|
|
1693
|
+
},
|
|
1694
|
+
component: {
|
|
1695
|
+
name: "Text",
|
|
1696
|
+
options: {
|
|
1697
|
+
text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
}]
|
|
1701
|
+
}, componentInfo$a = {
|
|
1702
|
+
name: "Slot",
|
|
1703
|
+
isRSC: !0,
|
|
1704
|
+
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
1705
|
+
docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
|
|
1706
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
|
|
1707
|
+
// Maybe wrap this for canHaveChildren so bind children to this hm
|
|
1708
|
+
inputs: [{
|
|
1709
|
+
name: "name",
|
|
1710
|
+
type: "string",
|
|
1711
|
+
required: !0,
|
|
1712
|
+
defaultValue: "children"
|
|
1713
|
+
}]
|
|
1714
|
+
};
|
|
1715
|
+
function Slot(e) {
|
|
1716
|
+
var t, n, o;
|
|
1717
|
+
return /* @__PURE__ */ jsx(
|
|
1718
|
+
"div",
|
|
1719
|
+
{
|
|
1720
|
+
style: {
|
|
1721
|
+
pointerEvents: "auto"
|
|
1722
|
+
},
|
|
1723
|
+
...!((t = e.builderContext.context) != null && t.symbolId) && {
|
|
1724
|
+
"builder-slot": e.name
|
|
1725
|
+
},
|
|
1726
|
+
children: /* @__PURE__ */ jsx(
|
|
1727
|
+
Blocks,
|
|
1728
|
+
{
|
|
1729
|
+
parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
|
|
1730
|
+
path: `symbol.data.${e.name}`,
|
|
1731
|
+
context: e.builderContext,
|
|
1732
|
+
blocks: (o = e.builderContext.rootState) == null ? void 0 : o[e.name]
|
|
1733
|
+
}
|
|
1734
|
+
)
|
|
1735
|
+
}
|
|
1736
|
+
);
|
|
1737
|
+
}
|
|
1738
|
+
const componentInfo$9 = {
|
|
1739
|
+
name: "Symbol",
|
|
1740
|
+
noWrap: !0,
|
|
1741
|
+
static: !0,
|
|
1742
|
+
isRSC: !0,
|
|
1743
|
+
inputs: [{
|
|
1744
|
+
name: "symbol",
|
|
1745
|
+
type: "uiSymbol"
|
|
1746
|
+
}, {
|
|
1747
|
+
name: "dataOnly",
|
|
1748
|
+
helperText: "Make this a data symbol that doesn't display any UI",
|
|
1749
|
+
type: "boolean",
|
|
1750
|
+
defaultValue: !1,
|
|
1751
|
+
advanced: !0,
|
|
1752
|
+
hideFromUI: !0
|
|
1753
|
+
}, {
|
|
1754
|
+
name: "inheritState",
|
|
1755
|
+
helperText: "Inherit the parent component state and data",
|
|
1756
|
+
type: "boolean",
|
|
1757
|
+
defaultValue: !1,
|
|
1758
|
+
advanced: !0
|
|
1759
|
+
}, {
|
|
1760
|
+
name: "renderToLiquid",
|
|
1761
|
+
helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
|
|
1762
|
+
type: "boolean",
|
|
1763
|
+
defaultValue: !1,
|
|
1764
|
+
advanced: !0,
|
|
1765
|
+
hideFromUI: !0
|
|
1766
|
+
}, {
|
|
1767
|
+
name: "useChildren",
|
|
1768
|
+
hideFromUI: !0,
|
|
1769
|
+
type: "boolean"
|
|
1770
|
+
}]
|
|
1771
|
+
}, componentInfo$8 = {
|
|
1772
|
+
name: "Text",
|
|
1773
|
+
static: !0,
|
|
1774
|
+
isRSC: !0,
|
|
1775
|
+
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
|
|
1776
|
+
inputs: [{
|
|
1777
|
+
name: "text",
|
|
1778
|
+
type: "html",
|
|
1779
|
+
required: !0,
|
|
1780
|
+
autoFocus: !0,
|
|
1781
|
+
bubble: !0,
|
|
1782
|
+
defaultValue: "Enter some text..."
|
|
1783
|
+
}],
|
|
1784
|
+
defaultStyles: {
|
|
1785
|
+
lineHeight: "normal",
|
|
1786
|
+
height: "auto",
|
|
1787
|
+
textAlign: "center"
|
|
1788
|
+
}
|
|
1789
|
+
};
|
|
1790
|
+
function Text(e) {
|
|
1791
|
+
var t;
|
|
1792
|
+
return /* @__PURE__ */ jsx(
|
|
1793
|
+
"div",
|
|
1794
|
+
{
|
|
1795
|
+
className: "builder-text",
|
|
1796
|
+
dangerouslySetInnerHTML: { __html: ((t = e.text) == null ? void 0 : t.toString()) || "" },
|
|
1797
|
+
style: {
|
|
1798
|
+
outline: "none"
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
);
|
|
1802
|
+
}
|
|
1803
|
+
const componentInfo$7 = {
|
|
1804
|
+
name: "Custom Code",
|
|
1805
|
+
static: !0,
|
|
1806
|
+
requiredPermissions: ["editCode"],
|
|
1807
|
+
inputs: [{
|
|
1808
|
+
name: "code",
|
|
1809
|
+
type: "html",
|
|
1810
|
+
required: !0,
|
|
1811
|
+
defaultValue: "<p>Hello there, I am custom HTML code!</p>",
|
|
1812
|
+
code: !0
|
|
1813
|
+
}, {
|
|
1814
|
+
name: "replaceNodes",
|
|
1815
|
+
type: "boolean",
|
|
1816
|
+
helperText: "Preserve server rendered dom nodes",
|
|
1817
|
+
advanced: !0
|
|
1818
|
+
}, {
|
|
1819
|
+
name: "scriptsClientOnly",
|
|
1820
|
+
type: "boolean",
|
|
1821
|
+
defaultValue: !1,
|
|
1822
|
+
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
1823
|
+
advanced: !0
|
|
1824
|
+
}]
|
|
1825
|
+
};
|
|
1826
|
+
function CustomCode(e) {
|
|
1827
|
+
const t = useRef(null), [n, o] = useState(() => []), [i, a] = useState(() => []);
|
|
1828
|
+
return useEffect(() => {
|
|
1829
|
+
var s;
|
|
1830
|
+
if (!((s = t.current) != null && s.getElementsByTagName) || typeof window == "undefined")
|
|
1831
|
+
return;
|
|
1832
|
+
const r = t.current.getElementsByTagName("script");
|
|
1833
|
+
for (let l = 0; l < r.length; l++) {
|
|
1834
|
+
const c = r[l];
|
|
1835
|
+
if (c.src) {
|
|
1836
|
+
if (n.includes(c.src))
|
|
1837
|
+
continue;
|
|
1838
|
+
n.push(c.src);
|
|
1839
|
+
const u = document.createElement("script");
|
|
1840
|
+
u.async = !0, u.src = c.src, document.head.appendChild(u);
|
|
1841
|
+
} else if (!c.type || [
|
|
1842
|
+
"text/javascript",
|
|
1843
|
+
"application/javascript",
|
|
1844
|
+
"application/ecmascript"
|
|
1845
|
+
].includes(c.type)) {
|
|
1846
|
+
if (i.includes(c.innerText))
|
|
1847
|
+
continue;
|
|
1848
|
+
try {
|
|
1849
|
+
i.push(c.innerText), new Function(c.innerText)();
|
|
1850
|
+
} catch (u) {
|
|
1851
|
+
console.warn("`CustomCode`: Error running script:", u);
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
}, []), /* @__PURE__ */ jsx(
|
|
1856
|
+
"div",
|
|
1857
|
+
{
|
|
1858
|
+
ref: t,
|
|
1859
|
+
className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
|
|
1860
|
+
dangerouslySetInnerHTML: { __html: e.code }
|
|
1861
|
+
}
|
|
1862
|
+
);
|
|
1863
|
+
}
|
|
1864
|
+
const componentInfo$6 = {
|
|
1865
|
+
name: "Embed",
|
|
1866
|
+
static: !0,
|
|
1867
|
+
inputs: [{
|
|
1868
|
+
name: "url",
|
|
1869
|
+
type: "url",
|
|
1870
|
+
required: !0,
|
|
1871
|
+
defaultValue: "",
|
|
1872
|
+
helperText: "e.g. enter a youtube url, google map, etc",
|
|
1873
|
+
onChange: (e) => {
|
|
1874
|
+
const t = e.get("url");
|
|
1875
|
+
if (t)
|
|
1876
|
+
return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((o) => o.json()).then((o) => {
|
|
1877
|
+
e.get("url") === t && (o.html ? e.set("content", o.html) : e.set("content", "Invalid url, please try another"));
|
|
1878
|
+
}).catch((o) => {
|
|
1879
|
+
e.set("content", "There was an error embedding this URL, please try again or another URL");
|
|
1880
|
+
});
|
|
1881
|
+
e.delete("content");
|
|
1882
|
+
}
|
|
1883
|
+
}, {
|
|
1884
|
+
name: "content",
|
|
1885
|
+
type: "html",
|
|
1886
|
+
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
1887
|
+
hideFromUI: !0
|
|
1888
|
+
}]
|
|
1889
|
+
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1890
|
+
function Embed(e) {
|
|
1891
|
+
const t = useRef(null), [n, o] = useState(() => []), [i, a] = useState(() => []), [r, s] = useState(() => !1);
|
|
1892
|
+
function l() {
|
|
1893
|
+
if (!t.current || !t.current.getElementsByTagName)
|
|
1894
|
+
return;
|
|
1895
|
+
const c = t.current.getElementsByTagName("script");
|
|
1896
|
+
for (let u = 0; u < c.length; u++) {
|
|
1897
|
+
const y = c[u];
|
|
1898
|
+
if (y.src && !n.includes(y.src)) {
|
|
1899
|
+
n.push(y.src);
|
|
1900
|
+
const x = document.createElement("script");
|
|
1901
|
+
x.async = !0, x.src = y.src, document.head.appendChild(x);
|
|
1902
|
+
} else if (isJsScript(y) && !i.includes(y.innerText))
|
|
1903
|
+
try {
|
|
1904
|
+
i.push(y.innerText), new Function(y.innerText)();
|
|
1905
|
+
} catch (x) {
|
|
1906
|
+
console.warn("`Embed`: Error running script:", x);
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
}
|
|
1910
|
+
return useEffect(() => {
|
|
1911
|
+
t.current && !r && (s(!0), l());
|
|
1912
|
+
}, [t.current, r]), /* @__PURE__ */ jsx(
|
|
1913
|
+
"div",
|
|
1914
|
+
{
|
|
1915
|
+
className: "builder-embed",
|
|
1916
|
+
ref: t,
|
|
1917
|
+
dangerouslySetInnerHTML: { __html: e.content }
|
|
1918
|
+
}
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1921
|
+
const componentInfo$5 = {
|
|
1922
|
+
name: "Form:Form",
|
|
1923
|
+
// editableTags: ['builder-form-error']
|
|
1924
|
+
defaults: {
|
|
1925
|
+
responsiveStyles: {
|
|
1926
|
+
large: {
|
|
1927
|
+
marginTop: "15px",
|
|
1928
|
+
paddingBottom: "15px"
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
},
|
|
1932
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",
|
|
1933
|
+
inputs: [{
|
|
1934
|
+
name: "sendSubmissionsTo",
|
|
1935
|
+
type: "string",
|
|
1936
|
+
// TODO: save to builder data and user can download as csv
|
|
1937
|
+
// TODO: easy for mode too or computed add/remove fields form mode
|
|
1938
|
+
// so you can edit details and high level mode at same time...
|
|
1939
|
+
// Later - more integrations like mailchimp
|
|
1940
|
+
// /api/v1/form-submit?to=mailchimp
|
|
1941
|
+
enum: [{
|
|
1942
|
+
label: "Send to email",
|
|
1943
|
+
value: "email",
|
|
1944
|
+
helperText: "Send form submissions to the email address of your choosing"
|
|
1945
|
+
}, {
|
|
1946
|
+
label: "Custom",
|
|
1947
|
+
value: "custom",
|
|
1948
|
+
helperText: "Handle where the form requests go manually with a little code, e.g. to your own custom backend"
|
|
1949
|
+
}],
|
|
1950
|
+
defaultValue: "email"
|
|
1951
|
+
}, {
|
|
1952
|
+
name: "sendSubmissionsToEmail",
|
|
1953
|
+
type: "string",
|
|
1954
|
+
required: !0,
|
|
1955
|
+
// TODO: required: () => options.get("sendSubmissionsTo") === "email"
|
|
1956
|
+
defaultValue: "your@email.com",
|
|
1957
|
+
showIf: 'options.get("sendSubmissionsTo") === "email"'
|
|
1958
|
+
}, {
|
|
1959
|
+
name: "sendWithJs",
|
|
1960
|
+
type: "boolean",
|
|
1961
|
+
helperText: "Set to false to use basic html form action",
|
|
1962
|
+
defaultValue: !0,
|
|
1963
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"'
|
|
1964
|
+
}, {
|
|
1965
|
+
name: "name",
|
|
1966
|
+
type: "string",
|
|
1967
|
+
defaultValue: "My form"
|
|
1968
|
+
// advanced: true
|
|
1969
|
+
}, {
|
|
1970
|
+
name: "action",
|
|
1971
|
+
type: "string",
|
|
1972
|
+
helperText: "URL to send the form data to",
|
|
1973
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"'
|
|
1974
|
+
}, {
|
|
1975
|
+
name: "contentType",
|
|
1976
|
+
type: "string",
|
|
1977
|
+
defaultValue: "application/json",
|
|
1978
|
+
advanced: !0,
|
|
1979
|
+
// TODO: do automatically if file input
|
|
1980
|
+
enum: ["application/json", "multipart/form-data", "application/x-www-form-urlencoded"],
|
|
1981
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
|
|
1982
|
+
}, {
|
|
1983
|
+
name: "method",
|
|
1984
|
+
type: "string",
|
|
1985
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom"',
|
|
1986
|
+
defaultValue: "POST",
|
|
1987
|
+
advanced: !0
|
|
1988
|
+
}, {
|
|
1989
|
+
name: "previewState",
|
|
1990
|
+
type: "string",
|
|
1991
|
+
// TODO: persist: false flag
|
|
1992
|
+
enum: ["unsubmitted", "sending", "success", "error"],
|
|
1993
|
+
defaultValue: "unsubmitted",
|
|
1994
|
+
helperText: 'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',
|
|
1995
|
+
showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
|
|
1996
|
+
}, {
|
|
1997
|
+
name: "successUrl",
|
|
1998
|
+
type: "url",
|
|
1999
|
+
helperText: "Optional URL to redirect the user to on form submission success",
|
|
2000
|
+
showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
|
|
2001
|
+
}, {
|
|
2002
|
+
name: "resetFormOnSubmit",
|
|
2003
|
+
type: "boolean",
|
|
2004
|
+
showIf: "options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",
|
|
2005
|
+
advanced: !0
|
|
2006
|
+
}, {
|
|
2007
|
+
name: "successMessage",
|
|
2008
|
+
type: "uiBlocks",
|
|
2009
|
+
hideFromUI: !0,
|
|
2010
|
+
defaultValue: [{
|
|
2011
|
+
"@type": "@builder.io/sdk:Element",
|
|
2012
|
+
responsiveStyles: {
|
|
2013
|
+
large: {
|
|
2014
|
+
marginTop: "10px"
|
|
2015
|
+
}
|
|
2016
|
+
},
|
|
2017
|
+
component: {
|
|
2018
|
+
name: "Text",
|
|
2019
|
+
options: {
|
|
2020
|
+
text: "<span>Thanks!</span>"
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
}]
|
|
2024
|
+
}, {
|
|
2025
|
+
name: "validate",
|
|
2026
|
+
type: "boolean",
|
|
2027
|
+
defaultValue: !0,
|
|
2028
|
+
advanced: !0
|
|
2029
|
+
}, {
|
|
2030
|
+
name: "errorMessagePath",
|
|
2031
|
+
type: "text",
|
|
2032
|
+
advanced: !0,
|
|
2033
|
+
helperText: 'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'
|
|
2034
|
+
}, {
|
|
2035
|
+
name: "errorMessage",
|
|
2036
|
+
type: "uiBlocks",
|
|
2037
|
+
hideFromUI: !0,
|
|
2038
|
+
defaultValue: [{
|
|
2039
|
+
"@type": "@builder.io/sdk:Element",
|
|
2040
|
+
responsiveStyles: {
|
|
2041
|
+
large: {
|
|
2042
|
+
marginTop: "10px"
|
|
2043
|
+
}
|
|
2044
|
+
},
|
|
2045
|
+
bindings: {
|
|
2046
|
+
"component.options.text": "state.formErrorMessage || block.component.options.text"
|
|
2047
|
+
},
|
|
2048
|
+
component: {
|
|
2049
|
+
name: "Text",
|
|
2050
|
+
options: {
|
|
2051
|
+
text: "<span>Form submission error :( Please check your answers and try again</span>"
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
}]
|
|
2055
|
+
}, {
|
|
2056
|
+
name: "sendingMessage",
|
|
2057
|
+
type: "uiBlocks",
|
|
2058
|
+
hideFromUI: !0,
|
|
2059
|
+
defaultValue: [{
|
|
2060
|
+
"@type": "@builder.io/sdk:Element",
|
|
2061
|
+
responsiveStyles: {
|
|
2062
|
+
large: {
|
|
2063
|
+
marginTop: "10px"
|
|
2064
|
+
}
|
|
2065
|
+
},
|
|
2066
|
+
component: {
|
|
2067
|
+
name: "Text",
|
|
2068
|
+
options: {
|
|
2069
|
+
text: "<span>Sending...</span>"
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
}]
|
|
2073
|
+
}, {
|
|
2074
|
+
name: "customHeaders",
|
|
2075
|
+
type: "map",
|
|
2076
|
+
valueType: {
|
|
2077
|
+
type: "string"
|
|
2078
|
+
},
|
|
2079
|
+
advanced: !0,
|
|
2080
|
+
showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
|
|
2081
|
+
}],
|
|
2082
|
+
noWrap: !0,
|
|
2083
|
+
canHaveChildren: !0,
|
|
2084
|
+
defaultChildren: [{
|
|
2085
|
+
"@type": "@builder.io/sdk:Element",
|
|
2086
|
+
responsiveStyles: {
|
|
2087
|
+
large: {
|
|
2088
|
+
marginTop: "10px"
|
|
2089
|
+
}
|
|
2090
|
+
},
|
|
2091
|
+
component: {
|
|
2092
|
+
name: "Text",
|
|
2093
|
+
options: {
|
|
2094
|
+
text: "<span>Enter your name</span>"
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
}, {
|
|
2098
|
+
"@type": "@builder.io/sdk:Element",
|
|
2099
|
+
responsiveStyles: {
|
|
2100
|
+
large: {
|
|
2101
|
+
marginTop: "10px"
|
|
2102
|
+
}
|
|
2103
|
+
},
|
|
2104
|
+
component: {
|
|
2105
|
+
name: "Form:Input",
|
|
2106
|
+
options: {
|
|
2107
|
+
name: "name",
|
|
2108
|
+
placeholder: "Jane Doe"
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
}, {
|
|
2112
|
+
"@type": "@builder.io/sdk:Element",
|
|
2113
|
+
responsiveStyles: {
|
|
2114
|
+
large: {
|
|
2115
|
+
marginTop: "10px"
|
|
2116
|
+
}
|
|
2117
|
+
},
|
|
2118
|
+
component: {
|
|
2119
|
+
name: "Text",
|
|
2120
|
+
options: {
|
|
2121
|
+
text: "<span>Enter your email</span>"
|
|
2122
|
+
}
|
|
2123
|
+
}
|
|
2124
|
+
}, {
|
|
2125
|
+
"@type": "@builder.io/sdk:Element",
|
|
2126
|
+
responsiveStyles: {
|
|
2127
|
+
large: {
|
|
2128
|
+
marginTop: "10px"
|
|
2129
|
+
}
|
|
2130
|
+
},
|
|
2131
|
+
component: {
|
|
2132
|
+
name: "Form:Input",
|
|
2133
|
+
options: {
|
|
2134
|
+
name: "email",
|
|
2135
|
+
placeholder: "jane@doe.com"
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
}, {
|
|
2139
|
+
"@type": "@builder.io/sdk:Element",
|
|
2140
|
+
responsiveStyles: {
|
|
2141
|
+
large: {
|
|
2142
|
+
marginTop: "10px"
|
|
2143
|
+
}
|
|
2144
|
+
},
|
|
2145
|
+
component: {
|
|
2146
|
+
name: "Form:SubmitButton",
|
|
2147
|
+
options: {
|
|
2148
|
+
text: "Submit"
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
}]
|
|
2152
|
+
}, validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], getEnv = () => {
|
|
2153
|
+
const e = process.env.NODE_ENV || "production";
|
|
2154
|
+
return validEnvList.includes(e) ? e : "production";
|
|
2155
|
+
}, get = (e, t, n) => {
|
|
2156
|
+
const o = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((i, a) => i != null ? i[a] : i, e);
|
|
2157
|
+
return o === void 0 || o === e ? n : o;
|
|
2158
|
+
};
|
|
2159
|
+
function FormComponent(e) {
|
|
2160
|
+
var y, x;
|
|
2161
|
+
const t = useRef(null), [n, o] = useState(() => "unsubmitted"), [i, a] = useState(() => null), [r, s] = useState(() => "");
|
|
2162
|
+
function l(m) {
|
|
2163
|
+
var f, v;
|
|
2164
|
+
const d = {
|
|
2165
|
+
...e.builderContext.rootState,
|
|
2166
|
+
...m
|
|
2167
|
+
};
|
|
2168
|
+
e.builderContext.rootSetState ? (v = (f = e.builderContext).rootSetState) == null || v.call(f, d) : e.builderContext.rootState = d;
|
|
2169
|
+
}
|
|
2170
|
+
function c() {
|
|
2171
|
+
return isEditing() && e.previewState || n;
|
|
2172
|
+
}
|
|
2173
|
+
function u(m) {
|
|
2174
|
+
var f;
|
|
2175
|
+
const d = e.sendWithJs || e.sendSubmissionsTo === "email";
|
|
2176
|
+
if (e.sendSubmissionsTo === "zapier")
|
|
2177
|
+
m.preventDefault();
|
|
2178
|
+
else if (d) {
|
|
2179
|
+
if (!(e.action || e.sendSubmissionsTo === "email")) {
|
|
2180
|
+
m.preventDefault();
|
|
2181
|
+
return;
|
|
2182
|
+
}
|
|
2183
|
+
m.preventDefault();
|
|
2184
|
+
const v = m.currentTarget, R = e.customHeaders || {};
|
|
2185
|
+
let S;
|
|
2186
|
+
const C = new FormData(v), w = Array.from(
|
|
2187
|
+
m.currentTarget.querySelectorAll("input,select,textarea")
|
|
2188
|
+
).filter((g) => !!g.name).map((g) => {
|
|
2189
|
+
let I;
|
|
2190
|
+
const A = g.name;
|
|
2191
|
+
if (g instanceof HTMLInputElement)
|
|
2192
|
+
if (g.type === "radio") {
|
|
2193
|
+
if (g.checked)
|
|
2194
|
+
return I = g.name, {
|
|
2195
|
+
key: A,
|
|
2196
|
+
value: I
|
|
2197
|
+
};
|
|
2198
|
+
} else if (g.type === "checkbox")
|
|
2199
|
+
I = g.checked;
|
|
2200
|
+
else if (g.type === "number" || g.type === "range") {
|
|
2201
|
+
const j = g.valueAsNumber;
|
|
2202
|
+
isNaN(j) || (I = j);
|
|
2203
|
+
} else
|
|
2204
|
+
g.type === "file" ? I = g.files : I = g.value;
|
|
2205
|
+
else
|
|
2206
|
+
I = g.value;
|
|
2207
|
+
return {
|
|
2208
|
+
key: A,
|
|
2209
|
+
value: I
|
|
2210
|
+
};
|
|
2211
|
+
});
|
|
2212
|
+
let E = e.contentType;
|
|
2213
|
+
if (e.sendSubmissionsTo === "email" && (E = "multipart/form-data"), Array.from(w).forEach(({ value: g }) => {
|
|
2214
|
+
(g instanceof File || Array.isArray(g) && g[0] instanceof File || g instanceof FileList) && (E = "multipart/form-data");
|
|
2215
|
+
}), E !== "application/json")
|
|
2216
|
+
S = C;
|
|
2217
|
+
else {
|
|
2218
|
+
const g = {};
|
|
2219
|
+
Array.from(w).forEach(({ value: I, key: A }) => {
|
|
2220
|
+
set(g, A, I);
|
|
2221
|
+
}), S = JSON.stringify(g);
|
|
2222
|
+
}
|
|
2223
|
+
E && E !== "multipart/form-data" && (d && ((f = e.action) != null && f.includes("zapier.com")) || (R["content-type"] = E));
|
|
2224
|
+
const B = new CustomEvent("presubmit", { detail: { body: S } });
|
|
2225
|
+
if (t.current && (t.current.dispatchEvent(B), B.defaultPrevented))
|
|
2226
|
+
return;
|
|
2227
|
+
o("sending");
|
|
2228
|
+
const F = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
2229
|
+
e.sendSubmissionsToEmail || ""
|
|
2230
|
+
)}&name=${encodeURIComponent(e.name || "")}`;
|
|
2231
|
+
fetch(
|
|
2232
|
+
e.sendSubmissionsTo === "email" ? F : e.action,
|
|
2233
|
+
{ body: S, headers: R, method: e.method || "post" }
|
|
2234
|
+
).then(
|
|
2235
|
+
async (g) => {
|
|
2236
|
+
let I;
|
|
2237
|
+
const A = g.headers.get("content-type");
|
|
2238
|
+
if (A && A.indexOf("application/json") !== -1 ? I = await g.json() : I = await g.text(), !g.ok && e.errorMessagePath) {
|
|
2239
|
+
let j = get(I, e.errorMessagePath);
|
|
2240
|
+
j && (typeof j != "string" && (j = JSON.stringify(j)), s(j), l({ formErrorMessage: j }));
|
|
2241
|
+
}
|
|
2242
|
+
if (a(I), o(g.ok ? "success" : "error"), g.ok) {
|
|
2243
|
+
const j = new CustomEvent("submit:success", {
|
|
2244
|
+
detail: { res: g, body: I }
|
|
2245
|
+
});
|
|
2246
|
+
if (t.current) {
|
|
2247
|
+
if (t.current.dispatchEvent(j), j.defaultPrevented)
|
|
2248
|
+
return;
|
|
2249
|
+
e.resetFormOnSubmit !== !1 && t.current.reset();
|
|
2250
|
+
}
|
|
2251
|
+
if (e.successUrl)
|
|
2252
|
+
if (t.current) {
|
|
2253
|
+
const V = new CustomEvent("route", {
|
|
2254
|
+
detail: { url: e.successUrl }
|
|
2255
|
+
});
|
|
2256
|
+
t.current.dispatchEvent(V), V.defaultPrevented || (location.href = e.successUrl);
|
|
2257
|
+
} else
|
|
2258
|
+
location.href = e.successUrl;
|
|
2259
|
+
}
|
|
2260
|
+
},
|
|
2261
|
+
(g) => {
|
|
2262
|
+
const I = new CustomEvent("submit:error", {
|
|
2263
|
+
detail: { error: g }
|
|
2264
|
+
});
|
|
2265
|
+
t.current && (t.current.dispatchEvent(I), I.defaultPrevented) || (a(g), o("error"));
|
|
2266
|
+
}
|
|
2267
|
+
);
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2271
|
+
" ",
|
|
2272
|
+
/* @__PURE__ */ jsxs(
|
|
2273
|
+
"form",
|
|
2274
|
+
{
|
|
2275
|
+
validate: e.validate,
|
|
2276
|
+
ref: t,
|
|
2277
|
+
action: !e.sendWithJs && e.action,
|
|
2278
|
+
method: e.method,
|
|
2279
|
+
name: e.name,
|
|
2280
|
+
onSubmit: (m) => u(m),
|
|
2281
|
+
...e.attributes,
|
|
2282
|
+
children: [
|
|
2283
|
+
" ",
|
|
2284
|
+
e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (x = (y = e.builderBlock) == null ? void 0 : y.children) == null ? void 0 : x.map((m, d) => /* @__PURE__ */ jsx(
|
|
2285
|
+
Block,
|
|
2286
|
+
{
|
|
2287
|
+
block: m,
|
|
2288
|
+
context: e.builderContext,
|
|
2289
|
+
registeredComponents: e.builderComponents,
|
|
2290
|
+
linkComponent: e.builderLinkComponent
|
|
2291
|
+
},
|
|
2292
|
+
`form-block-${d}`
|
|
2293
|
+
)) }) : null,
|
|
2294
|
+
" ",
|
|
2295
|
+
c() === "error" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2296
|
+
Blocks,
|
|
2297
|
+
{
|
|
2298
|
+
path: "errorMessage",
|
|
2299
|
+
blocks: e.errorMessage,
|
|
2300
|
+
context: e.builderContext
|
|
2301
|
+
}
|
|
2302
|
+
) }) : null,
|
|
2303
|
+
" ",
|
|
2304
|
+
c() === "sending" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2305
|
+
Blocks,
|
|
2306
|
+
{
|
|
2307
|
+
path: "sendingMessage",
|
|
2308
|
+
blocks: e.sendingMessage,
|
|
2309
|
+
context: e.builderContext
|
|
2310
|
+
}
|
|
2311
|
+
) }) : null,
|
|
2312
|
+
" ",
|
|
2313
|
+
c() === "error" && i ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("pre", { className: "builder-form-error-text pre-25b9edf0", children: [
|
|
2314
|
+
" ",
|
|
2315
|
+
JSON.stringify(i, null, 2),
|
|
2316
|
+
" "
|
|
2317
|
+
] }) }) : null,
|
|
2318
|
+
" ",
|
|
2319
|
+
c() === "success" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2320
|
+
Blocks,
|
|
2321
|
+
{
|
|
2322
|
+
path: "successMessage",
|
|
2323
|
+
blocks: e.successMessage,
|
|
2324
|
+
context: e.builderContext
|
|
2325
|
+
}
|
|
2326
|
+
) }) : null,
|
|
2327
|
+
" "
|
|
2328
|
+
]
|
|
2329
|
+
}
|
|
2330
|
+
),
|
|
2331
|
+
" ",
|
|
2332
|
+
/* @__PURE__ */ jsx("style", { children: ".pre-25b9edf0 { padding: 10px; color: red; text-align: center; }" }),
|
|
2333
|
+
" "
|
|
2334
|
+
] });
|
|
2335
|
+
}
|
|
2336
|
+
const componentInfo$4 = {
|
|
2337
|
+
name: "Form:Input",
|
|
2338
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
|
|
2339
|
+
inputs: [
|
|
2340
|
+
{
|
|
2341
|
+
name: "type",
|
|
2342
|
+
type: "text",
|
|
2343
|
+
enum: ["text", "number", "email", "url", "checkbox", "radio", "range", "date", "datetime-local", "search", "tel", "time", "file", "month", "week", "password", "color", "hidden"],
|
|
2344
|
+
defaultValue: "text"
|
|
2345
|
+
},
|
|
2346
|
+
{
|
|
2347
|
+
name: "name",
|
|
2348
|
+
type: "string",
|
|
2349
|
+
required: !0,
|
|
2350
|
+
helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
|
|
2351
|
+
},
|
|
2352
|
+
{
|
|
2353
|
+
name: "placeholder",
|
|
2354
|
+
type: "string",
|
|
2355
|
+
defaultValue: "Hello there",
|
|
2356
|
+
helperText: "Text to display when there is no value"
|
|
2357
|
+
},
|
|
2358
|
+
// TODO: handle value vs default value automatically like ng-model
|
|
2359
|
+
{
|
|
2360
|
+
name: "defaultValue",
|
|
2361
|
+
type: "string"
|
|
2362
|
+
},
|
|
2363
|
+
{
|
|
2364
|
+
name: "value",
|
|
2365
|
+
type: "string",
|
|
2366
|
+
advanced: !0
|
|
2367
|
+
},
|
|
2368
|
+
{
|
|
2369
|
+
name: "required",
|
|
2370
|
+
type: "boolean",
|
|
2371
|
+
helperText: "Is this input required to be filled out to submit a form",
|
|
2372
|
+
defaultValue: !1
|
|
2373
|
+
}
|
|
2374
|
+
],
|
|
2375
|
+
noWrap: !0,
|
|
2376
|
+
static: !0,
|
|
2377
|
+
defaultStyles: {
|
|
2378
|
+
paddingTop: "10px",
|
|
2379
|
+
paddingBottom: "10px",
|
|
2380
|
+
paddingLeft: "10px",
|
|
2381
|
+
paddingRight: "10px",
|
|
2382
|
+
borderRadius: "3px",
|
|
2383
|
+
borderWidth: "1px",
|
|
2384
|
+
borderStyle: "solid",
|
|
2385
|
+
borderColor: "#ccc"
|
|
2386
|
+
}
|
|
2387
|
+
};
|
|
2388
|
+
function FormInputComponent(e) {
|
|
2389
|
+
return /* @__PURE__ */ createElement(
|
|
2390
|
+
"input",
|
|
2391
|
+
{
|
|
2392
|
+
...e.attributes,
|
|
2393
|
+
key: isEditing() && e.defaultValue ? e.defaultValue : "default-key",
|
|
2394
|
+
placeholder: e.placeholder,
|
|
2395
|
+
type: e.type,
|
|
2396
|
+
name: e.name,
|
|
2397
|
+
value: e.value,
|
|
2398
|
+
defaultValue: e.defaultValue,
|
|
2399
|
+
required: e.required
|
|
2400
|
+
}
|
|
2401
|
+
);
|
|
2402
|
+
}
|
|
2403
|
+
const componentInfo$3 = {
|
|
2404
|
+
name: "Form:Select",
|
|
2405
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
|
|
2406
|
+
defaultStyles: {
|
|
2407
|
+
alignSelf: "flex-start"
|
|
2408
|
+
},
|
|
2409
|
+
inputs: [{
|
|
2410
|
+
name: "options",
|
|
2411
|
+
type: "list",
|
|
2412
|
+
required: !0,
|
|
2413
|
+
subFields: [{
|
|
2414
|
+
name: "value",
|
|
2415
|
+
type: "text",
|
|
2416
|
+
required: !0
|
|
2417
|
+
}, {
|
|
2418
|
+
name: "name",
|
|
2419
|
+
type: "text"
|
|
2420
|
+
}],
|
|
2421
|
+
defaultValue: [{
|
|
2422
|
+
value: "option 1"
|
|
2423
|
+
}, {
|
|
2424
|
+
value: "option 2"
|
|
2425
|
+
}]
|
|
2426
|
+
}, {
|
|
2427
|
+
name: "name",
|
|
2428
|
+
type: "string",
|
|
2429
|
+
required: !0,
|
|
2430
|
+
helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
|
|
2431
|
+
}, {
|
|
2432
|
+
name: "defaultValue",
|
|
2433
|
+
type: "string"
|
|
2434
|
+
}, {
|
|
2435
|
+
name: "value",
|
|
2436
|
+
type: "string",
|
|
2437
|
+
advanced: !0
|
|
2438
|
+
}, {
|
|
2439
|
+
name: "required",
|
|
2440
|
+
type: "boolean",
|
|
2441
|
+
defaultValue: !1
|
|
2442
|
+
}],
|
|
2443
|
+
static: !0,
|
|
2444
|
+
noWrap: !0
|
|
2445
|
+
};
|
|
2446
|
+
function SelectComponent(e) {
|
|
2447
|
+
var t;
|
|
2448
|
+
return /* @__PURE__ */ createElement(
|
|
2449
|
+
"select",
|
|
2450
|
+
{
|
|
2451
|
+
...e.attributes,
|
|
2452
|
+
value: e.value,
|
|
2453
|
+
key: isEditing() && e.defaultValue ? e.defaultValue : "default-key",
|
|
2454
|
+
defaultValue: e.defaultValue,
|
|
2455
|
+
name: e.name
|
|
2456
|
+
},
|
|
2457
|
+
(t = e.options) == null ? void 0 : t.map((n) => /* @__PURE__ */ jsx("option", { value: n.value, children: n.name || n.value }))
|
|
2458
|
+
);
|
|
2459
|
+
}
|
|
2460
|
+
const componentInfo$2 = {
|
|
2461
|
+
name: "Form:SubmitButton",
|
|
2462
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
|
|
2463
|
+
defaultStyles: {
|
|
2464
|
+
appearance: "none",
|
|
2465
|
+
paddingTop: "15px",
|
|
2466
|
+
paddingBottom: "15px",
|
|
2467
|
+
paddingLeft: "25px",
|
|
2468
|
+
paddingRight: "25px",
|
|
2469
|
+
backgroundColor: "#3898EC",
|
|
2470
|
+
color: "white",
|
|
2471
|
+
borderRadius: "4px",
|
|
2472
|
+
cursor: "pointer"
|
|
2473
|
+
},
|
|
2474
|
+
inputs: [{
|
|
2475
|
+
name: "text",
|
|
2476
|
+
type: "text",
|
|
2477
|
+
defaultValue: "Click me"
|
|
2478
|
+
}],
|
|
2479
|
+
static: !0,
|
|
2480
|
+
noWrap: !0
|
|
2481
|
+
// TODO: optional children? maybe as optional form input
|
|
2482
|
+
// that only shows if advanced setting is flipped
|
|
2483
|
+
// TODO: defaultChildren
|
|
2484
|
+
// canHaveChildren: true,
|
|
2485
|
+
};
|
|
2486
|
+
function SubmitButton(e) {
|
|
2487
|
+
return /* @__PURE__ */ jsx("button", { type: "submit", ...e.attributes, children: e.text });
|
|
2488
|
+
}
|
|
2489
|
+
const componentInfo$1 = {
|
|
2490
|
+
// friendlyName?
|
|
2491
|
+
name: "Raw:Img",
|
|
2492
|
+
hideFromInsertMenu: !0,
|
|
2493
|
+
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",
|
|
2494
|
+
inputs: [{
|
|
2495
|
+
name: "image",
|
|
2496
|
+
bubble: !0,
|
|
2497
|
+
type: "file",
|
|
2498
|
+
allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
|
|
2499
|
+
required: !0
|
|
2500
|
+
}],
|
|
2501
|
+
noWrap: !0,
|
|
2502
|
+
static: !0
|
|
2503
|
+
};
|
|
2504
|
+
function ImgComponent(e) {
|
|
2505
|
+
return /* @__PURE__ */ jsx(
|
|
2506
|
+
"img",
|
|
2507
|
+
{
|
|
2508
|
+
style: {
|
|
2509
|
+
objectFit: e.backgroundSize || "cover",
|
|
2510
|
+
objectPosition: e.backgroundPosition || "center"
|
|
2511
|
+
},
|
|
2512
|
+
alt: e.altText,
|
|
2513
|
+
src: e.imgSrc || e.image,
|
|
2514
|
+
...e.attributes
|
|
2515
|
+
},
|
|
2516
|
+
isEditing() && e.imgSrc || "default-key"
|
|
2517
|
+
);
|
|
2518
|
+
}
|
|
2519
|
+
const componentInfo = {
|
|
2520
|
+
name: "Video",
|
|
2521
|
+
canHaveChildren: !0,
|
|
2522
|
+
defaultStyles: {
|
|
2523
|
+
minHeight: "20px",
|
|
2524
|
+
minWidth: "20px"
|
|
2525
|
+
},
|
|
2526
|
+
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",
|
|
2527
|
+
inputs: [{
|
|
2528
|
+
name: "video",
|
|
2529
|
+
type: "file",
|
|
2530
|
+
allowedFileTypes: ["mp4"],
|
|
2531
|
+
bubble: !0,
|
|
2532
|
+
defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
|
|
2533
|
+
required: !0
|
|
2534
|
+
}, {
|
|
2535
|
+
name: "posterImage",
|
|
2536
|
+
type: "file",
|
|
2537
|
+
allowedFileTypes: ["jpeg", "png"],
|
|
2538
|
+
helperText: "Image to show before the video plays"
|
|
2539
|
+
}, {
|
|
2540
|
+
name: "autoPlay",
|
|
2541
|
+
type: "boolean",
|
|
2542
|
+
defaultValue: !0
|
|
2543
|
+
}, {
|
|
2544
|
+
name: "controls",
|
|
2545
|
+
type: "boolean",
|
|
2546
|
+
defaultValue: !1
|
|
2547
|
+
}, {
|
|
2548
|
+
name: "muted",
|
|
2549
|
+
type: "boolean",
|
|
2550
|
+
defaultValue: !0
|
|
2551
|
+
}, {
|
|
2552
|
+
name: "loop",
|
|
2553
|
+
type: "boolean",
|
|
2554
|
+
defaultValue: !0
|
|
2555
|
+
}, {
|
|
2556
|
+
name: "playsInline",
|
|
2557
|
+
type: "boolean",
|
|
2558
|
+
defaultValue: !0
|
|
2559
|
+
}, {
|
|
2560
|
+
name: "fit",
|
|
2561
|
+
type: "text",
|
|
2562
|
+
defaultValue: "cover",
|
|
2563
|
+
enum: ["contain", "cover", "fill", "auto"]
|
|
2564
|
+
}, {
|
|
2565
|
+
name: "preload",
|
|
2566
|
+
type: "text",
|
|
2567
|
+
defaultValue: "metadata",
|
|
2568
|
+
enum: ["auto", "metadata", "none"]
|
|
2569
|
+
}, {
|
|
2570
|
+
name: "fitContent",
|
|
2571
|
+
type: "boolean",
|
|
2572
|
+
helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
|
|
2573
|
+
defaultValue: !0,
|
|
2574
|
+
advanced: !0
|
|
2575
|
+
}, {
|
|
2576
|
+
name: "position",
|
|
2577
|
+
type: "text",
|
|
2578
|
+
defaultValue: "center",
|
|
2579
|
+
enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
|
|
2580
|
+
}, {
|
|
2581
|
+
name: "height",
|
|
2582
|
+
type: "number",
|
|
2583
|
+
advanced: !0
|
|
2584
|
+
}, {
|
|
2585
|
+
name: "width",
|
|
2586
|
+
type: "number",
|
|
2587
|
+
advanced: !0
|
|
2588
|
+
}, {
|
|
2589
|
+
name: "aspectRatio",
|
|
2590
|
+
type: "number",
|
|
2591
|
+
advanced: !0,
|
|
2592
|
+
defaultValue: 0.7004048582995948
|
|
2593
|
+
}, {
|
|
2594
|
+
name: "lazyLoad",
|
|
2595
|
+
type: "boolean",
|
|
2596
|
+
helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
|
|
2597
|
+
defaultValue: !0,
|
|
2598
|
+
advanced: !0
|
|
2599
|
+
}]
|
|
2600
|
+
};
|
|
2601
|
+
function Video(e) {
|
|
2602
|
+
var o, i, a, r, s, l, c;
|
|
2603
|
+
function t() {
|
|
2604
|
+
return {
|
|
2605
|
+
...e.autoPlay === !0 ? {
|
|
2606
|
+
autoPlay: !0
|
|
2607
|
+
} : {},
|
|
2608
|
+
...e.muted === !0 ? {
|
|
2609
|
+
muted: !0
|
|
2610
|
+
} : {},
|
|
2611
|
+
...e.controls === !0 ? {
|
|
2612
|
+
controls: !0
|
|
2613
|
+
} : {},
|
|
2614
|
+
...e.loop === !0 ? {
|
|
2615
|
+
loop: !0
|
|
2616
|
+
} : {},
|
|
2617
|
+
...e.playsInline === !0 ? {
|
|
2618
|
+
playsInline: !0
|
|
2619
|
+
} : {}
|
|
2620
|
+
};
|
|
2621
|
+
}
|
|
2622
|
+
function n() {
|
|
2623
|
+
return {
|
|
2624
|
+
...t()
|
|
2625
|
+
};
|
|
2626
|
+
}
|
|
2627
|
+
return /* @__PURE__ */ jsxs(
|
|
2628
|
+
"div",
|
|
2629
|
+
{
|
|
2630
|
+
style: {
|
|
2631
|
+
position: "relative"
|
|
2632
|
+
},
|
|
2633
|
+
children: [
|
|
2634
|
+
/* @__PURE__ */ jsx(
|
|
2635
|
+
"video",
|
|
2636
|
+
{
|
|
2637
|
+
className: "builder-video",
|
|
2638
|
+
...n(),
|
|
2639
|
+
preload: e.preload || "metadata",
|
|
2640
|
+
style: {
|
|
2641
|
+
width: "100%",
|
|
2642
|
+
height: "100%",
|
|
2643
|
+
...(o = e.attributes) == null ? void 0 : o.style,
|
|
2644
|
+
objectFit: e.fit,
|
|
2645
|
+
objectPosition: e.position,
|
|
2646
|
+
// Hack to get object fit to work as expected and
|
|
2647
|
+
// not have the video overflow
|
|
2648
|
+
zIndex: 2,
|
|
2649
|
+
borderRadius: "1px",
|
|
2650
|
+
...e.aspectRatio ? {
|
|
2651
|
+
position: "absolute"
|
|
2652
|
+
} : null
|
|
2653
|
+
},
|
|
2654
|
+
src: e.video || "no-src",
|
|
2655
|
+
poster: e.posterImage,
|
|
2656
|
+
children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
|
|
2657
|
+
}
|
|
2658
|
+
),
|
|
2659
|
+
e.aspectRatio && !(e.fitContent && ((a = (i = e.builderBlock) == null ? void 0 : i.children) != null && a.length)) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2660
|
+
"div",
|
|
2661
|
+
{
|
|
2662
|
+
style: {
|
|
2663
|
+
width: "100%",
|
|
2664
|
+
paddingTop: e.aspectRatio * 100 + "%",
|
|
2665
|
+
pointerEvents: "none",
|
|
2666
|
+
fontSize: "0px"
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
) }) : null,
|
|
2670
|
+
(s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2671
|
+
"div",
|
|
2672
|
+
{
|
|
2673
|
+
style: {
|
|
2674
|
+
display: "flex",
|
|
2675
|
+
flexDirection: "column",
|
|
2676
|
+
alignItems: "stretch"
|
|
2677
|
+
},
|
|
2678
|
+
children: e.children
|
|
2679
|
+
}
|
|
2680
|
+
) }) : null,
|
|
2681
|
+
(c = (l = e.builderBlock) == null ? void 0 : l.children) != null && c.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2682
|
+
"div",
|
|
2683
|
+
{
|
|
2684
|
+
style: {
|
|
2685
|
+
pointerEvents: "none",
|
|
2686
|
+
display: "flex",
|
|
2687
|
+
flexDirection: "column",
|
|
2688
|
+
alignItems: "stretch",
|
|
2689
|
+
position: "absolute",
|
|
2690
|
+
top: "0",
|
|
2691
|
+
left: "0",
|
|
2692
|
+
width: "100%",
|
|
2693
|
+
height: "100%"
|
|
2694
|
+
},
|
|
2695
|
+
children: e.children
|
|
2696
|
+
}
|
|
2697
|
+
) }) : null
|
|
2698
|
+
]
|
|
2699
|
+
}
|
|
2700
|
+
);
|
|
2701
|
+
}
|
|
2702
|
+
const getExtraComponents = () => [{
|
|
2703
|
+
component: CustomCode,
|
|
2704
|
+
...componentInfo$7
|
|
2705
|
+
}, {
|
|
2706
|
+
component: Embed,
|
|
2707
|
+
...componentInfo$6
|
|
2708
|
+
}, {
|
|
2709
|
+
component: FormComponent,
|
|
2710
|
+
...componentInfo$5
|
|
2711
|
+
}, {
|
|
2712
|
+
component: FormInputComponent,
|
|
2713
|
+
...componentInfo$4
|
|
2714
|
+
}, {
|
|
2715
|
+
component: SubmitButton,
|
|
2716
|
+
...componentInfo$2
|
|
2717
|
+
}, {
|
|
2718
|
+
component: SelectComponent,
|
|
2719
|
+
...componentInfo$3
|
|
2720
|
+
}, {
|
|
2721
|
+
component: ImgComponent,
|
|
2722
|
+
...componentInfo$1
|
|
2723
|
+
}, {
|
|
2724
|
+
component: Video,
|
|
2725
|
+
...componentInfo
|
|
2726
|
+
}], getDefaultRegisteredComponents = () => [{
|
|
2727
|
+
component: Button,
|
|
2728
|
+
...componentInfo$f
|
|
2729
|
+
}, {
|
|
2730
|
+
component: Columns,
|
|
2731
|
+
...componentInfo$e
|
|
2732
|
+
}, {
|
|
2733
|
+
component: FragmentComponent,
|
|
2734
|
+
...componentInfo$d
|
|
2735
|
+
}, {
|
|
2736
|
+
component: Image,
|
|
2737
|
+
...componentInfo$c
|
|
2738
|
+
}, {
|
|
2739
|
+
component: SectionComponent,
|
|
2740
|
+
...componentInfo$b
|
|
2741
|
+
}, {
|
|
2742
|
+
component: Slot,
|
|
2743
|
+
...componentInfo$a
|
|
2744
|
+
}, {
|
|
2745
|
+
component: Symbol$1,
|
|
2746
|
+
...componentInfo$9
|
|
2747
|
+
}, {
|
|
2748
|
+
component: Text,
|
|
2749
|
+
...componentInfo$8
|
|
2750
|
+
}, ...getExtraComponents()], UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
2751
|
+
function getAndSetVariantId() {
|
|
2752
|
+
function setCookie(name, value, days) {
|
|
2753
|
+
let expires = '';
|
|
2754
|
+
if (days) {
|
|
2755
|
+
const date = new Date();
|
|
2756
|
+
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
2757
|
+
expires = '; expires=' + date.toUTCString();
|
|
2758
|
+
}
|
|
2759
|
+
document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
|
|
2760
|
+
}
|
|
2761
|
+
function getCookie(name) {
|
|
2762
|
+
const nameEQ = name + '=';
|
|
2763
|
+
const ca = document.cookie.split(';');
|
|
2764
|
+
for (let i = 0; i < ca.length; i++) {
|
|
2765
|
+
let c = ca[i];
|
|
2766
|
+
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
2767
|
+
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
2768
|
+
}
|
|
2769
|
+
return null;
|
|
2770
|
+
}
|
|
2771
|
+
const cookieName = \`builder.tests.\${contentId}\`;
|
|
2772
|
+
const variantInCookie = getCookie(cookieName);
|
|
2773
|
+
const availableIDs = variants.map(vr => vr.id).concat(contentId);
|
|
2774
|
+
if (variantInCookie && availableIDs.includes(variantInCookie)) {
|
|
2775
|
+
return variantInCookie;
|
|
2776
|
+
}
|
|
2777
|
+
let n = 0;
|
|
2778
|
+
const random = Math.random();
|
|
2779
|
+
for (let i = 0; i < variants.length; i++) {
|
|
2780
|
+
const variant = variants[i];
|
|
2781
|
+
const testRatio = variant.testRatio;
|
|
2782
|
+
n += testRatio;
|
|
2783
|
+
if (random < n) {
|
|
2784
|
+
setCookie(cookieName, variant.id);
|
|
2785
|
+
return variant.id;
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
setCookie(cookieName, contentId);
|
|
2789
|
+
return contentId;
|
|
2790
|
+
}
|
|
2791
|
+
const winningVariantId = getAndSetVariantId();
|
|
2792
|
+
const styleEl = document.currentScript?.previousElementSibling;
|
|
2793
|
+
if (isHydrationTarget) {
|
|
2794
|
+
styleEl.remove();
|
|
2795
|
+
const thisScriptEl = document.currentScript;
|
|
2796
|
+
thisScriptEl?.remove();
|
|
2797
|
+
} else {
|
|
2798
|
+
const newStyleStr = variants.concat({
|
|
2799
|
+
id: contentId
|
|
2800
|
+
}).filter(variant => variant.id !== winningVariantId).map(value => {
|
|
2801
|
+
return \`.variant-\${value.id} { display: none; }
|
|
2802
|
+
\`;
|
|
2803
|
+
}).join('');
|
|
2804
|
+
styleEl.innerHTML = newStyleStr;
|
|
2805
|
+
}
|
|
2806
|
+
}`, UPDATE_VARIANT_VISIBILITY_SCRIPT = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
2807
|
+
if (!navigator.cookieEnabled) {
|
|
2808
|
+
return;
|
|
2809
|
+
}
|
|
2810
|
+
function getCookie(name) {
|
|
2811
|
+
const nameEQ = name + '=';
|
|
2812
|
+
const ca = document.cookie.split(';');
|
|
2813
|
+
for (let i = 0; i < ca.length; i++) {
|
|
2814
|
+
let c = ca[i];
|
|
2815
|
+
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
2816
|
+
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
2817
|
+
}
|
|
2818
|
+
return null;
|
|
2819
|
+
}
|
|
2820
|
+
const cookieName = \`builder.tests.\${defaultContentId}\`;
|
|
2821
|
+
const winningVariant = getCookie(cookieName);
|
|
2822
|
+
const parentDiv = document.currentScript?.parentElement;
|
|
2823
|
+
const isDefaultContent = variantContentId === defaultContentId;
|
|
2824
|
+
const isWinningVariant = winningVariant === variantContentId;
|
|
2825
|
+
if (isWinningVariant && !isDefaultContent) {
|
|
2826
|
+
parentDiv?.removeAttribute('hidden');
|
|
2827
|
+
parentDiv?.removeAttribute('aria-hidden');
|
|
2828
|
+
} else if (!isWinningVariant && isDefaultContent) {
|
|
2829
|
+
parentDiv?.setAttribute('hidden', 'true');
|
|
2830
|
+
parentDiv?.setAttribute('aria-hidden', 'true');
|
|
2831
|
+
}
|
|
2832
|
+
if (isHydrationTarget) {
|
|
2833
|
+
if (!isWinningVariant) {
|
|
2834
|
+
parentDiv?.remove();
|
|
2835
|
+
}
|
|
2836
|
+
const thisScriptEl = document.currentScript;
|
|
2837
|
+
thisScriptEl?.remove();
|
|
2838
|
+
}
|
|
2839
|
+
return;
|
|
2840
|
+
}`, UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest", UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent", getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
|
|
2841
|
+
...t,
|
|
2842
|
+
testVariationId: t.id,
|
|
2843
|
+
id: e == null ? void 0 : e.id
|
|
2844
|
+
})), checkShouldRenderVariants = ({
|
|
2845
|
+
canTrack: e,
|
|
2846
|
+
content: t
|
|
2847
|
+
}) => !(!(getVariants(t).length > 0) || !e || isBrowser()), getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), getScriptString = () => `
|
|
2848
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
2849
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
2850
|
+
`, getUpdateCookieAndStylesScript = (e, t) => `
|
|
2851
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
2852
|
+
"${t}",${JSON.stringify(e)}, ${isHydrationTarget}
|
|
2853
|
+
)`, getUpdateVariantVisibilityScript = ({
|
|
2854
|
+
contentId: e,
|
|
2855
|
+
variationId: t
|
|
2856
|
+
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2857
|
+
"${t}", "${e}", ${isHydrationTarget}
|
|
2858
|
+
)`;
|
|
2859
|
+
function InlinedScript(e) {
|
|
2860
|
+
return /* @__PURE__ */ jsx(
|
|
2861
|
+
"script",
|
|
2862
|
+
{
|
|
2863
|
+
dangerouslySetInnerHTML: { __html: e.scriptStr },
|
|
2864
|
+
id: e.id || ""
|
|
2865
|
+
}
|
|
2866
|
+
);
|
|
2867
|
+
}
|
|
2868
|
+
function round(e) {
|
|
2869
|
+
return Math.round(e * 1e3) / 1e3;
|
|
2870
|
+
}
|
|
2871
|
+
const findParentElement = (e, t, n = !0) => {
|
|
2872
|
+
if (!(e instanceof HTMLElement))
|
|
2873
|
+
return null;
|
|
2874
|
+
let o = n ? e : e.parentElement;
|
|
2875
|
+
do {
|
|
2876
|
+
if (!o)
|
|
2877
|
+
return null;
|
|
2878
|
+
if (t(o))
|
|
2879
|
+
return o;
|
|
2880
|
+
} while (o = o.parentElement);
|
|
2881
|
+
return null;
|
|
2882
|
+
}, findBuilderParent = (e) => findParentElement(e, (t) => {
|
|
2883
|
+
const n = t.getAttribute("builder-id") || t.id;
|
|
2884
|
+
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
2885
|
+
}), computeOffset = ({
|
|
2886
|
+
event: e,
|
|
2887
|
+
target: t
|
|
2888
|
+
}) => {
|
|
2889
|
+
const n = t.getBoundingClientRect(), o = e.clientX - n.left, i = e.clientY - n.top, a = round(o / n.width), r = round(i / n.height);
|
|
2890
|
+
return {
|
|
2891
|
+
x: a,
|
|
2892
|
+
y: r
|
|
2893
|
+
};
|
|
2894
|
+
}, getInteractionPropertiesForEvent = (e) => {
|
|
2895
|
+
const t = e.target, n = t && findBuilderParent(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
2896
|
+
return {
|
|
2897
|
+
targetBuilderElement: o || void 0,
|
|
2898
|
+
metadata: {
|
|
2899
|
+
targetOffset: t ? computeOffset({
|
|
2900
|
+
event: e,
|
|
2901
|
+
target: t
|
|
2902
|
+
}) : void 0,
|
|
2903
|
+
builderTargetOffset: n ? computeOffset({
|
|
2904
|
+
event: e,
|
|
2905
|
+
target: n
|
|
2906
|
+
}) : void 0,
|
|
2907
|
+
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2908
|
+
}
|
|
2909
|
+
};
|
|
2910
|
+
};
|
|
2911
|
+
function EnableEditor(e) {
|
|
2912
|
+
var F, g, I, A, j, V, $;
|
|
2913
|
+
const t = useRef(null), [n, o] = useState(() => 0);
|
|
2914
|
+
useState(() => !0);
|
|
2915
|
+
function i(h) {
|
|
2916
|
+
var p, k;
|
|
2917
|
+
const b = {
|
|
2918
|
+
...e.builderContextSignal.rootState,
|
|
2919
|
+
...h
|
|
2920
|
+
};
|
|
2921
|
+
e.builderContextSignal.rootSetState ? (k = (p = e.builderContextSignal).rootSetState) == null || k.call(p, b) : e.setBuilderContextSignal((T) => ({
|
|
2922
|
+
...T,
|
|
2923
|
+
rootState: b
|
|
2924
|
+
}));
|
|
2925
|
+
}
|
|
2926
|
+
function a(h) {
|
|
2927
|
+
var p, k, T, P, N;
|
|
2928
|
+
const b = {
|
|
2929
|
+
...e.builderContextSignal.content,
|
|
2930
|
+
...h,
|
|
2931
|
+
data: {
|
|
2932
|
+
...(p = e.builderContextSignal.content) == null ? void 0 : p.data,
|
|
2933
|
+
...h == null ? void 0 : h.data
|
|
2934
|
+
},
|
|
2935
|
+
meta: {
|
|
2936
|
+
...(k = e.builderContextSignal.content) == null ? void 0 : k.meta,
|
|
2937
|
+
...h == null ? void 0 : h.meta,
|
|
2938
|
+
breakpoints: ((T = h == null ? void 0 : h.meta) == null ? void 0 : T.breakpoints) || ((N = (P = e.builderContextSignal.content) == null ? void 0 : P.meta) == null ? void 0 : N.breakpoints)
|
|
2939
|
+
}
|
|
2940
|
+
};
|
|
2941
|
+
e.setBuilderContextSignal((W) => ({
|
|
2942
|
+
...W,
|
|
2943
|
+
content: b
|
|
2944
|
+
}));
|
|
2945
|
+
}
|
|
2946
|
+
useState(() => 0);
|
|
2947
|
+
const [r, s] = useState(
|
|
2948
|
+
() => !1
|
|
2949
|
+
), [l, c] = useState(
|
|
2950
|
+
() => e.contentWrapper || "div"
|
|
2951
|
+
);
|
|
2952
|
+
function u(h) {
|
|
2953
|
+
return createEditorListener({
|
|
2954
|
+
model: e.model,
|
|
2955
|
+
trustedHosts: e.trustedHosts,
|
|
2956
|
+
callbacks: {
|
|
2957
|
+
configureSdk: (b) => {
|
|
2958
|
+
var T;
|
|
2959
|
+
const { breakpoints: p, contentId: k } = b;
|
|
2960
|
+
!k || k !== ((T = e.builderContextSignal.content) == null ? void 0 : T.id) || p && (a({
|
|
2961
|
+
meta: {
|
|
2962
|
+
breakpoints: p
|
|
2963
|
+
}
|
|
2964
|
+
}), o(n + 1));
|
|
2965
|
+
},
|
|
2966
|
+
animation: (b) => {
|
|
2967
|
+
triggerAnimation(b);
|
|
2968
|
+
},
|
|
2969
|
+
contentUpdate: (b) => {
|
|
2970
|
+
a(b), o(n + 1);
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
})(h);
|
|
2974
|
+
}
|
|
2975
|
+
function y() {
|
|
2976
|
+
var b, p;
|
|
2977
|
+
const h = (p = (b = e.builderContextSignal.content) == null ? void 0 : b.data) == null ? void 0 : p.jsCode;
|
|
2978
|
+
h && evaluate({
|
|
2979
|
+
code: h,
|
|
2980
|
+
context: e.context || {},
|
|
2981
|
+
localState: void 0,
|
|
2982
|
+
rootState: e.builderContextSignal.rootState,
|
|
2983
|
+
rootSetState: e.builderContextSignal.rootSetState
|
|
2984
|
+
});
|
|
2985
|
+
}
|
|
2986
|
+
const [x, m] = useState(() => ({})), [d, f] = useState(() => !1);
|
|
2987
|
+
function v(h) {
|
|
2988
|
+
var b, p;
|
|
2989
|
+
if (e.builderContextSignal.content) {
|
|
2990
|
+
const k = (b = e.builderContextSignal.content) == null ? void 0 : b.testVariationId, T = (p = e.builderContextSignal.content) == null ? void 0 : p.id;
|
|
2991
|
+
_track({
|
|
2992
|
+
type: "click",
|
|
2993
|
+
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2994
|
+
contentId: T,
|
|
2995
|
+
apiKey: e.apiKey,
|
|
2996
|
+
variationId: k !== T ? k : void 0,
|
|
2997
|
+
...getInteractionPropertiesForEvent(h),
|
|
2998
|
+
unique: !d
|
|
2999
|
+
});
|
|
3000
|
+
}
|
|
3001
|
+
d || f(!0);
|
|
3002
|
+
}
|
|
3003
|
+
function R(h) {
|
|
3004
|
+
return h.replace(
|
|
3005
|
+
/{{([^}]+)}}/g,
|
|
3006
|
+
(b, p) => evaluate({
|
|
3007
|
+
code: p,
|
|
3008
|
+
context: e.context || {},
|
|
3009
|
+
localState: void 0,
|
|
3010
|
+
rootState: e.builderContextSignal.rootState,
|
|
3011
|
+
rootSetState: e.builderContextSignal.rootSetState
|
|
3012
|
+
})
|
|
3013
|
+
);
|
|
3014
|
+
}
|
|
3015
|
+
function S({ url: h, key: b }) {
|
|
3016
|
+
fetch$1(h).then((p) => p.json()).then((p) => {
|
|
3017
|
+
var T, P;
|
|
3018
|
+
const k = {
|
|
3019
|
+
...e.builderContextSignal.rootState,
|
|
3020
|
+
[b]: p
|
|
3021
|
+
};
|
|
3022
|
+
(P = (T = e.builderContextSignal).rootSetState) == null || P.call(T, k), x[b] = !0;
|
|
3023
|
+
}).catch((p) => {
|
|
3024
|
+
console.error("error fetching dynamic data", h, p);
|
|
3025
|
+
});
|
|
3026
|
+
}
|
|
3027
|
+
function C() {
|
|
3028
|
+
var b, p, k;
|
|
3029
|
+
const h = (k = (p = (b = e.builderContextSignal.content) == null ? void 0 : b.data) == null ? void 0 : p.httpRequests) != null ? k : {};
|
|
3030
|
+
Object.entries(h).forEach(([T, P]) => {
|
|
3031
|
+
if (P && (!x[T] || isEditing())) {
|
|
3032
|
+
const N = R(P);
|
|
3033
|
+
S({
|
|
3034
|
+
url: N,
|
|
3035
|
+
key: T
|
|
3036
|
+
});
|
|
3037
|
+
}
|
|
3038
|
+
});
|
|
3039
|
+
}
|
|
3040
|
+
function w() {
|
|
3041
|
+
isEditing() && window.dispatchEvent(
|
|
3042
|
+
new CustomEvent(
|
|
3043
|
+
"builder:component:stateChange",
|
|
3044
|
+
{
|
|
3045
|
+
detail: {
|
|
3046
|
+
state: fastClone(e.builderContextSignal.rootState),
|
|
3047
|
+
ref: {
|
|
3048
|
+
name: e.model
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
)
|
|
3053
|
+
);
|
|
3054
|
+
}
|
|
3055
|
+
function E(h) {
|
|
3056
|
+
o(n + 1), window.addEventListener("message", u), registerInsertMenu(), setupBrowserForEditing({
|
|
3057
|
+
...e.locale ? {
|
|
3058
|
+
locale: e.locale
|
|
3059
|
+
} : {},
|
|
3060
|
+
...e.enrich ? {
|
|
3061
|
+
enrich: e.enrich
|
|
3062
|
+
} : {},
|
|
3063
|
+
...e.trustedHosts ? {
|
|
3064
|
+
trustedHosts: e.trustedHosts
|
|
3065
|
+
} : {}
|
|
3066
|
+
}), Object.values(
|
|
3067
|
+
e.builderContextSignal.componentInfos
|
|
3068
|
+
).forEach((b) => {
|
|
3069
|
+
var k;
|
|
3070
|
+
const p = createRegisterComponentMessage(b);
|
|
3071
|
+
(k = window.parent) == null || k.postMessage(p, "*");
|
|
3072
|
+
}), window.addEventListener(
|
|
3073
|
+
"builder:component:stateChangeListenerActivated",
|
|
3074
|
+
w
|
|
3075
|
+
);
|
|
3076
|
+
}
|
|
3077
|
+
function B(h) {
|
|
3078
|
+
const b = new URL(location.href).searchParams, p = b.get("builder.preview"), k = b.get(
|
|
3079
|
+
`builder.preview.${p}`
|
|
3080
|
+
), T = b.get("apiKey") || b.get("builder.space");
|
|
3081
|
+
p === e.model && T === e.apiKey && (!e.content || k === e.content.id) && fetchOneEntry({
|
|
3082
|
+
model: e.model,
|
|
3083
|
+
apiKey: e.apiKey,
|
|
3084
|
+
apiVersion: e.builderContextSignal.apiVersion
|
|
3085
|
+
}).then((P) => {
|
|
3086
|
+
P && a(P);
|
|
3087
|
+
});
|
|
3088
|
+
}
|
|
3089
|
+
return useEffect(() => {
|
|
3090
|
+
var h;
|
|
3091
|
+
return (h = t.current) == null || h.addEventListener(
|
|
3092
|
+
"initeditingbldr",
|
|
3093
|
+
E
|
|
3094
|
+
), () => {
|
|
3095
|
+
var b;
|
|
3096
|
+
return (b = t.current) == null ? void 0 : b.removeEventListener(
|
|
3097
|
+
"initeditingbldr",
|
|
3098
|
+
E
|
|
3099
|
+
);
|
|
3100
|
+
};
|
|
3101
|
+
}, []), useEffect(() => {
|
|
3102
|
+
var h;
|
|
3103
|
+
return (h = t.current) == null || h.addEventListener(
|
|
3104
|
+
"initpreviewingbldr",
|
|
3105
|
+
B
|
|
3106
|
+
), () => {
|
|
3107
|
+
var b;
|
|
3108
|
+
return (b = t.current) == null ? void 0 : b.removeEventListener(
|
|
3109
|
+
"initpreviewingbldr",
|
|
3110
|
+
B
|
|
3111
|
+
);
|
|
3112
|
+
};
|
|
3113
|
+
}, []), useEffect(() => {
|
|
3114
|
+
var h, b;
|
|
3115
|
+
if (isBrowser()) {
|
|
3116
|
+
if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
3117
|
+
const k = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId, T = (b = e.builderContextSignal.content) == null ? void 0 : b.id, P = e.apiKey;
|
|
3118
|
+
_track({
|
|
3119
|
+
type: "impression",
|
|
3120
|
+
canTrack: !0,
|
|
3121
|
+
contentId: T,
|
|
3122
|
+
apiKey: P,
|
|
3123
|
+
variationId: k !== T ? k : void 0
|
|
3124
|
+
});
|
|
3125
|
+
}
|
|
3126
|
+
isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
3127
|
+
}
|
|
3128
|
+
}, []), useEffect(() => {
|
|
3129
|
+
e.apiKey || logger.error(
|
|
3130
|
+
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
3131
|
+
), y(), C(), w();
|
|
3132
|
+
}, []), useEffect(() => {
|
|
3133
|
+
e.content && a(e.content);
|
|
3134
|
+
}, [e.content]), useEffect(() => {
|
|
3135
|
+
}, [r]), useEffect(() => {
|
|
3136
|
+
y();
|
|
3137
|
+
}, [(g = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : g.jsCode]), useEffect(() => {
|
|
3138
|
+
C();
|
|
3139
|
+
}, [(A = (I = e.builderContextSignal.content) == null ? void 0 : I.data) == null ? void 0 : A.httpRequests]), useEffect(() => {
|
|
3140
|
+
w();
|
|
3141
|
+
}, [e.builderContextSignal.rootState]), useEffect(() => {
|
|
3142
|
+
e.data && i(e.data);
|
|
3143
|
+
}, [e.data]), useEffect(() => {
|
|
3144
|
+
e.locale && i({
|
|
3145
|
+
locale: e.locale
|
|
3146
|
+
});
|
|
3147
|
+
}, [e.locale]), useEffect(() => () => {
|
|
3148
|
+
isBrowser() && (window.removeEventListener("message", u), window.removeEventListener(
|
|
3149
|
+
"builder:component:stateChangeListenerActivated",
|
|
3150
|
+
w
|
|
3151
|
+
));
|
|
3152
|
+
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
|
|
3153
|
+
l,
|
|
3154
|
+
{
|
|
3155
|
+
key: n,
|
|
3156
|
+
ref: t,
|
|
3157
|
+
onClick: (h) => v(h),
|
|
3158
|
+
"builder-content-id": (j = e.builderContextSignal.content) == null ? void 0 : j.id,
|
|
3159
|
+
"builder-model": e.model,
|
|
3160
|
+
...e.showContent ? {} : {
|
|
3161
|
+
hidden: !0,
|
|
3162
|
+
"aria-hidden": !0
|
|
3163
|
+
},
|
|
3164
|
+
...e.contentWrapperProps,
|
|
3165
|
+
className: `variant-${((V = e.content) == null ? void 0 : V.testVariationId) || (($ = e.content) == null ? void 0 : $.id)}`
|
|
3166
|
+
},
|
|
3167
|
+
e.children
|
|
3168
|
+
) }) : null });
|
|
3169
|
+
}
|
|
3170
|
+
const getCssFromFont = (e) => {
|
|
3171
|
+
var a, r;
|
|
3172
|
+
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = (r = e.fileUrl) != null ? r : (a = e == null ? void 0 : e.files) == null ? void 0 : a.regular;
|
|
3173
|
+
let i = "";
|
|
3174
|
+
if (o && t && n && (i += `
|
|
3175
|
+
@font-face {
|
|
3176
|
+
font-family: "${t}";
|
|
3177
|
+
src: local("${n}"), url('${o}') format('woff2');
|
|
3178
|
+
font-display: fallback;
|
|
3179
|
+
font-weight: 400;
|
|
3180
|
+
}
|
|
3181
|
+
`.trim()), e.files)
|
|
3182
|
+
for (const s in e.files) {
|
|
3183
|
+
if (!(String(Number(s)) === s))
|
|
3184
|
+
continue;
|
|
3185
|
+
const c = e.files[s];
|
|
3186
|
+
c && c !== o && (i += `
|
|
3187
|
+
@font-face {
|
|
3188
|
+
font-family: "${t}";
|
|
3189
|
+
src: url('${c}') format('woff2');
|
|
3190
|
+
font-display: fallback;
|
|
3191
|
+
font-weight: ${s};
|
|
3192
|
+
}
|
|
3193
|
+
`.trim());
|
|
3194
|
+
}
|
|
3195
|
+
return i;
|
|
3196
|
+
}, getFontCss = ({
|
|
3197
|
+
customFonts: e
|
|
3198
|
+
}) => {
|
|
3199
|
+
var t;
|
|
3200
|
+
return ((t = e == null ? void 0 : e.map((n) => getCssFromFont(n))) == null ? void 0 : t.join(" ")) || "";
|
|
3201
|
+
}, getCss = ({
|
|
3202
|
+
cssCode: e,
|
|
3203
|
+
contentId: t
|
|
3204
|
+
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
|
|
3205
|
+
function ContentStyles(e) {
|
|
3206
|
+
const [t, n] = useState(
|
|
3207
|
+
() => `
|
|
3208
|
+
${getCss({
|
|
3209
|
+
cssCode: e.cssCode,
|
|
3210
|
+
contentId: e.contentId
|
|
3211
|
+
})}
|
|
3212
|
+
${getFontCss({
|
|
3213
|
+
customFonts: e.customFonts
|
|
3214
|
+
})}
|
|
3215
|
+
|
|
3216
|
+
.builder-button {
|
|
3217
|
+
all: unset;
|
|
3218
|
+
}
|
|
3219
|
+
|
|
3220
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
3221
|
+
margin: 0;
|
|
3222
|
+
}
|
|
3223
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
3224
|
+
color: inherit;
|
|
3225
|
+
line-height: inherit;
|
|
3226
|
+
letter-spacing: inherit;
|
|
3227
|
+
font-weight: inherit;
|
|
3228
|
+
font-size: inherit;
|
|
3229
|
+
text-align: inherit;
|
|
3230
|
+
font-family: inherit;
|
|
3231
|
+
}
|
|
3232
|
+
`.trim()
|
|
3233
|
+
);
|
|
3234
|
+
return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
|
|
3235
|
+
}
|
|
3236
|
+
const getRootStateInitialValue = ({
|
|
3237
|
+
content: e,
|
|
3238
|
+
data: t,
|
|
3239
|
+
locale: n
|
|
3240
|
+
}) => {
|
|
3241
|
+
var a, r, s;
|
|
3242
|
+
const o = {}, i = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
|
|
3243
|
+
return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((l) => {
|
|
3244
|
+
l.name && l.defaultValue !== void 0 && (o[l.name] = l.defaultValue);
|
|
3245
|
+
}), {
|
|
3246
|
+
...o,
|
|
3247
|
+
...i,
|
|
3248
|
+
...t,
|
|
3249
|
+
...n ? {
|
|
3250
|
+
locale: n
|
|
3251
|
+
} : {}
|
|
3252
|
+
};
|
|
3253
|
+
}, getContentInitialValue = ({
|
|
3254
|
+
content: e,
|
|
3255
|
+
data: t
|
|
3256
|
+
}) => e ? {
|
|
3257
|
+
...e,
|
|
3258
|
+
data: {
|
|
3259
|
+
...e == null ? void 0 : e.data,
|
|
3260
|
+
...t
|
|
3261
|
+
},
|
|
3262
|
+
meta: e == null ? void 0 : e.meta
|
|
3263
|
+
} : void 0;
|
|
3264
|
+
function ContentComponent(e) {
|
|
3265
|
+
var l, c, u, y, x, m, d;
|
|
3266
|
+
const [t, n] = useState(
|
|
3267
|
+
() => {
|
|
3268
|
+
var f, v;
|
|
3269
|
+
return getUpdateVariantVisibilityScript({
|
|
3270
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3271
|
+
variationId: (f = e.content) == null ? void 0 : f.testVariationId,
|
|
3272
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3273
|
+
contentId: (v = e.content) == null ? void 0 : v.id
|
|
3274
|
+
});
|
|
3275
|
+
}
|
|
3276
|
+
);
|
|
3277
|
+
function o(f) {
|
|
3278
|
+
s((v) => ({
|
|
3279
|
+
...v,
|
|
3280
|
+
rootState: f
|
|
3281
|
+
}));
|
|
3282
|
+
}
|
|
3283
|
+
const [i, a] = useState(
|
|
3284
|
+
() => [
|
|
3285
|
+
...getDefaultRegisteredComponents(),
|
|
3286
|
+
...e.customComponents || []
|
|
3287
|
+
].reduce(
|
|
3288
|
+
(f, { component: v, ...R }) => ({
|
|
3289
|
+
...f,
|
|
3290
|
+
[R.name]: {
|
|
3291
|
+
component: v,
|
|
3292
|
+
...serializeComponentInfo(R)
|
|
3293
|
+
}
|
|
3294
|
+
}),
|
|
3295
|
+
{}
|
|
3296
|
+
)
|
|
3297
|
+
), [r, s] = useState(() => ({
|
|
3298
|
+
content: getContentInitialValue({
|
|
3299
|
+
content: e.content,
|
|
3300
|
+
data: e.data
|
|
3301
|
+
}),
|
|
3302
|
+
localState: void 0,
|
|
3303
|
+
rootState: getRootStateInitialValue({
|
|
3304
|
+
content: e.content,
|
|
3305
|
+
data: e.data,
|
|
3306
|
+
locale: e.locale
|
|
3307
|
+
}),
|
|
3308
|
+
rootSetState: o,
|
|
3309
|
+
context: e.context || {},
|
|
3310
|
+
apiKey: e.apiKey,
|
|
3311
|
+
apiVersion: e.apiVersion,
|
|
3312
|
+
componentInfos: [
|
|
3313
|
+
...getDefaultRegisteredComponents(),
|
|
3314
|
+
...e.customComponents || []
|
|
3315
|
+
].reduce(
|
|
3316
|
+
(f, { component: v, ...R }) => ({
|
|
3317
|
+
...f,
|
|
3318
|
+
[R.name]: serializeComponentInfo(R)
|
|
3319
|
+
}),
|
|
3320
|
+
{}
|
|
3321
|
+
),
|
|
3322
|
+
inheritedStyles: {},
|
|
3323
|
+
BlocksWrapper: e.blocksWrapper || "div",
|
|
3324
|
+
BlocksWrapperProps: e.blocksWrapperProps || {}
|
|
3325
|
+
}));
|
|
3326
|
+
return /* @__PURE__ */ jsx(
|
|
3327
|
+
ComponentsContext.Provider,
|
|
3328
|
+
{
|
|
3329
|
+
value: {
|
|
3330
|
+
registeredComponents: i
|
|
3331
|
+
},
|
|
3332
|
+
children: /* @__PURE__ */ jsxs(
|
|
3333
|
+
EnableEditor,
|
|
3334
|
+
{
|
|
3335
|
+
content: e.content,
|
|
3336
|
+
data: e.data,
|
|
3337
|
+
model: e.model,
|
|
3338
|
+
context: e.context,
|
|
3339
|
+
apiKey: e.apiKey,
|
|
3340
|
+
canTrack: e.canTrack,
|
|
3341
|
+
locale: e.locale,
|
|
3342
|
+
enrich: e.enrich,
|
|
3343
|
+
showContent: e.showContent,
|
|
3344
|
+
builderContextSignal: r,
|
|
3345
|
+
contentWrapper: e.contentWrapper,
|
|
3346
|
+
contentWrapperProps: e.contentWrapperProps,
|
|
3347
|
+
linkComponent: e.linkComponent,
|
|
3348
|
+
trustedHosts: e.trustedHosts,
|
|
3349
|
+
setBuilderContextSignal: s,
|
|
3350
|
+
children: [
|
|
3351
|
+
e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
|
|
3352
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
3353
|
+
ContentStyles,
|
|
3354
|
+
{
|
|
3355
|
+
contentId: (l = r.content) == null ? void 0 : l.id,
|
|
3356
|
+
cssCode: (u = (c = r.content) == null ? void 0 : c.data) == null ? void 0 : u.cssCode,
|
|
3357
|
+
customFonts: (x = (y = r.content) == null ? void 0 : y.data) == null ? void 0 : x.customFonts
|
|
3358
|
+
}
|
|
3359
|
+
) }),
|
|
3360
|
+
/* @__PURE__ */ jsx(
|
|
3361
|
+
Blocks,
|
|
3362
|
+
{
|
|
3363
|
+
blocks: (d = (m = r.content) == null ? void 0 : m.data) == null ? void 0 : d.blocks,
|
|
3364
|
+
context: r,
|
|
3365
|
+
registeredComponents: i,
|
|
3366
|
+
linkComponent: e.linkComponent
|
|
3367
|
+
}
|
|
3368
|
+
)
|
|
3369
|
+
]
|
|
3370
|
+
}
|
|
3371
|
+
)
|
|
3372
|
+
}
|
|
3373
|
+
);
|
|
3374
|
+
}
|
|
3375
|
+
function ContentVariants(e) {
|
|
3376
|
+
var r, s;
|
|
3377
|
+
const [t, n] = useState(
|
|
3378
|
+
() => checkShouldRenderVariants({
|
|
3379
|
+
canTrack: getDefaultCanTrack(e.canTrack),
|
|
3380
|
+
content: e.content
|
|
3381
|
+
})
|
|
3382
|
+
);
|
|
3383
|
+
function o() {
|
|
3384
|
+
var l;
|
|
3385
|
+
return getUpdateCookieAndStylesScript(
|
|
3386
|
+
getVariants(e.content).map((c) => ({
|
|
3387
|
+
id: c.testVariationId,
|
|
3388
|
+
testRatio: c.testRatio
|
|
3389
|
+
})),
|
|
3390
|
+
((l = e.content) == null ? void 0 : l.id) || ""
|
|
3391
|
+
);
|
|
3392
|
+
}
|
|
3393
|
+
function i() {
|
|
3394
|
+
return getVariants(e.content).map((l) => `.variant-${l.testVariationId} { display: none; } `).join("");
|
|
3395
|
+
}
|
|
3396
|
+
function a() {
|
|
3397
|
+
var l;
|
|
3398
|
+
return t ? {
|
|
3399
|
+
...e.content,
|
|
3400
|
+
testVariationId: (l = e.content) == null ? void 0 : l.id
|
|
3401
|
+
} : handleABTestingSync({
|
|
3402
|
+
item: e.content,
|
|
3403
|
+
canTrack: getDefaultCanTrack(e.canTrack)
|
|
3404
|
+
});
|
|
3405
|
+
}
|
|
3406
|
+
return useEffect(() => {
|
|
3407
|
+
}, []), /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3408
|
+
!e.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: getScriptString() }) }) : null,
|
|
3409
|
+
t ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3410
|
+
/* @__PURE__ */ jsx(
|
|
3411
|
+
InlinedStyles,
|
|
3412
|
+
{
|
|
3413
|
+
id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
|
|
3414
|
+
styles: i()
|
|
3415
|
+
}
|
|
3416
|
+
),
|
|
3417
|
+
/* @__PURE__ */ jsx(InlinedScript, { scriptStr: o() }),
|
|
3418
|
+
(s = getVariants(e.content)) == null ? void 0 : s.map((l) => /* @__PURE__ */ jsx(
|
|
3419
|
+
ContentComponent,
|
|
3420
|
+
{
|
|
3421
|
+
content: l,
|
|
3422
|
+
showContent: !1,
|
|
3423
|
+
model: e.model,
|
|
3424
|
+
data: e.data,
|
|
3425
|
+
context: e.context,
|
|
3426
|
+
apiKey: e.apiKey,
|
|
3427
|
+
apiVersion: e.apiVersion,
|
|
3428
|
+
customComponents: e.customComponents,
|
|
3429
|
+
linkComponent: e.linkComponent,
|
|
3430
|
+
canTrack: e.canTrack,
|
|
3431
|
+
locale: e.locale,
|
|
3432
|
+
enrich: e.enrich,
|
|
3433
|
+
isSsrAbTest: t,
|
|
3434
|
+
blocksWrapper: e.blocksWrapper,
|
|
3435
|
+
blocksWrapperProps: e.blocksWrapperProps,
|
|
3436
|
+
contentWrapper: e.contentWrapper,
|
|
3437
|
+
contentWrapperProps: e.contentWrapperProps,
|
|
3438
|
+
trustedHosts: e.trustedHosts
|
|
3439
|
+
},
|
|
3440
|
+
l.testVariationId
|
|
3441
|
+
))
|
|
3442
|
+
] }) : null,
|
|
3443
|
+
/* @__PURE__ */ jsx(
|
|
3444
|
+
ContentComponent,
|
|
3445
|
+
{
|
|
3446
|
+
content: a(),
|
|
3447
|
+
showContent: !0,
|
|
3448
|
+
model: e.model,
|
|
3449
|
+
data: e.data,
|
|
3450
|
+
context: e.context,
|
|
3451
|
+
apiKey: e.apiKey,
|
|
3452
|
+
apiVersion: e.apiVersion,
|
|
3453
|
+
customComponents: e.customComponents,
|
|
3454
|
+
linkComponent: e.linkComponent,
|
|
3455
|
+
canTrack: e.canTrack,
|
|
3456
|
+
locale: e.locale,
|
|
3457
|
+
enrich: e.enrich,
|
|
3458
|
+
isSsrAbTest: t,
|
|
3459
|
+
blocksWrapper: e.blocksWrapper,
|
|
3460
|
+
blocksWrapperProps: e.blocksWrapperProps,
|
|
3461
|
+
contentWrapper: e.contentWrapper,
|
|
3462
|
+
contentWrapperProps: e.contentWrapperProps,
|
|
3463
|
+
trustedHosts: e.trustedHosts
|
|
3464
|
+
}
|
|
3465
|
+
)
|
|
3466
|
+
] });
|
|
3467
|
+
}
|
|
3468
|
+
const fetchSymbolContent = async ({
|
|
3469
|
+
builderContextValue: e,
|
|
3470
|
+
symbol: t
|
|
3471
|
+
}) => {
|
|
3472
|
+
if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
3473
|
+
(e != null && e.apiKey))
|
|
3474
|
+
return fetchOneEntry({
|
|
3475
|
+
model: t.model,
|
|
3476
|
+
apiKey: e.apiKey,
|
|
3477
|
+
apiVersion: e.apiVersion,
|
|
3478
|
+
...(t == null ? void 0 : t.entry) && {
|
|
3479
|
+
query: {
|
|
3480
|
+
id: t.entry
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
}).catch((n) => {
|
|
3484
|
+
logger.error("Could not fetch symbol content: ", n);
|
|
3485
|
+
});
|
|
3486
|
+
};
|
|
3487
|
+
function Symbol$1(e) {
|
|
3488
|
+
var a, r, s, l;
|
|
3489
|
+
function t() {
|
|
3490
|
+
var c, u;
|
|
3491
|
+
return [
|
|
3492
|
+
e.attributes[getClassPropName()],
|
|
3493
|
+
"builder-symbol",
|
|
3494
|
+
(c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
|
|
3495
|
+
(u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
3496
|
+
].filter(Boolean).join(" ");
|
|
3497
|
+
}
|
|
3498
|
+
const [n, o] = useState(() => {
|
|
3499
|
+
var c;
|
|
3500
|
+
return (c = e.symbol) == null ? void 0 : c.content;
|
|
3501
|
+
});
|
|
3502
|
+
function i() {
|
|
3503
|
+
n || fetchSymbolContent({
|
|
3504
|
+
symbol: e.symbol,
|
|
3505
|
+
builderContextValue: e.builderContext
|
|
3506
|
+
}).then((c) => {
|
|
3507
|
+
c && o(c);
|
|
3508
|
+
});
|
|
3509
|
+
}
|
|
3510
|
+
return useEffect(() => {
|
|
3511
|
+
}, []), useEffect(() => {
|
|
3512
|
+
i();
|
|
3513
|
+
}, [e.symbol]), /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
|
|
3514
|
+
ContentVariants,
|
|
3515
|
+
{
|
|
3516
|
+
__isNestedRender: !0,
|
|
3517
|
+
apiVersion: e.builderContext.apiVersion,
|
|
3518
|
+
apiKey: e.builderContext.apiKey,
|
|
3519
|
+
context: {
|
|
3520
|
+
...e.builderContext.context,
|
|
3521
|
+
symbolId: (a = e.builderBlock) == null ? void 0 : a.id
|
|
3522
|
+
},
|
|
3523
|
+
customComponents: Object.values(e.builderComponents),
|
|
3524
|
+
data: {
|
|
3525
|
+
...(r = e.symbol) == null ? void 0 : r.data,
|
|
3526
|
+
...e.builderContext.localState,
|
|
3527
|
+
...(s = n == null ? void 0 : n.data) == null ? void 0 : s.state
|
|
3528
|
+
},
|
|
3529
|
+
model: (l = e.symbol) == null ? void 0 : l.model,
|
|
3530
|
+
content: n,
|
|
3531
|
+
linkComponent: e.builderLinkComponent,
|
|
3532
|
+
blocksWrapper: "div",
|
|
3533
|
+
contentWrapper: "div"
|
|
3534
|
+
}
|
|
3535
|
+
) });
|
|
3536
|
+
}
|
|
3537
|
+
export {
|
|
3538
|
+
Blocks,
|
|
3539
|
+
Button,
|
|
3540
|
+
Columns,
|
|
3541
|
+
ContentVariants as Content,
|
|
3542
|
+
FragmentComponent as Fragment,
|
|
3543
|
+
Image,
|
|
3544
|
+
SectionComponent as Section,
|
|
3545
|
+
Symbol$1 as Symbol,
|
|
3546
|
+
Text,
|
|
3547
|
+
Video
|
|
3548
|
+
};
|