@builder.io/sdk-react 0.7.0 → 0.7.1-1

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.
Files changed (37) hide show
  1. package/lib/browser/index.cjs +23 -23
  2. package/lib/browser/index.mjs +592 -560
  3. package/lib/browser/{server-entry-f341a184.mjs → server-entry-13b7e1e6.mjs} +200 -185
  4. package/lib/browser/server-entry-c98db16c.js +2 -0
  5. package/lib/browser/server-entry.cjs +1 -1
  6. package/lib/browser/server-entry.mjs +1 -1
  7. package/lib/edge/index.cjs +32 -32
  8. package/lib/edge/index.mjs +1122 -1062
  9. package/lib/{node/server-entry-f341a184.mjs → edge/server-entry-13b7e1e6.mjs} +200 -185
  10. package/lib/edge/server-entry-c98db16c.js +2 -0
  11. package/lib/edge/server-entry.cjs +1 -1
  12. package/lib/edge/server-entry.mjs +1 -1
  13. package/lib/index.cjs +14 -0
  14. package/lib/index.mjs +10 -0
  15. package/lib/node/index.cjs +68 -28
  16. package/lib/node/index.mjs +931 -802
  17. package/lib/{edge/server-entry-f341a184.mjs → node/server-entry-13b7e1e6.mjs} +200 -185
  18. package/lib/node/server-entry-c98db16c.js +2 -0
  19. package/lib/node/server-entry.cjs +1 -1
  20. package/lib/node/server-entry.mjs +1 -1
  21. package/package.json +4 -1
  22. package/types/blocks/image/image.d.ts +1 -1
  23. package/types/constants/sdk-version.d.ts +1 -1
  24. package/types/functions/evaluate/choose-eval.d.ts +6 -0
  25. package/types/functions/evaluate/evaluate.d.ts +1 -5
  26. package/types/functions/evaluate/helpers.d.ts +7 -1
  27. package/types/functions/evaluate/node-runtime/index.d.ts +1 -1
  28. package/types/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
  29. package/types/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +13 -0
  30. package/types/functions/get-content/types.d.ts +94 -3
  31. package/types/functions/is-node-runtime.d.ts +4 -0
  32. package/types/node-runtime/index.d.ts +1 -0
  33. package/types/node-runtime/node-runtime.d.ts +1 -0
  34. package/types/node-runtime.d.ts +1 -0
  35. package/lib/browser/server-entry-f668f903.js +0 -2
  36. package/lib/edge/server-entry-f668f903.js +0 -2
  37. package/lib/node/server-entry-f668f903.js +0 -2
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsxs as E, Fragment as f, jsx as l } from "react/jsx-runtime";
3
- import { createContext as be, useState as I, useContext as ie, createElement as Re, useRef as X, useEffect as P } from "react";
4
- import { j as Z, l as U, i as V, k as F, m as Ee, n as Y, T as M, r as $e, c as Pe, o as ae, p as _, a as Ae, b as xe, q as Be, u as oe, v as re, w as Ve } from "./server-entry-f341a184.mjs";
5
- import { _ as tn, h as nn, f as an, g as on, e as rn, d as ln, s as cn, t as sn } from "./server-entry-f341a184.mjs";
6
- function Fe(e) {
7
- return /* @__PURE__ */ E(f, { children: [
8
- e.link ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
2
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
+ import { createContext, useState, useContext, createElement, useRef, useEffect } from "react";
4
+ import { j as fastClone, i as isEditing, k as isBrowser, l as getUserAttributes, m as logger, n as checkIsDefined, T as TARGET, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-13b7e1e6.mjs";
5
+ import { _ as M, h as W, f as L, g as O, e as U, d as D, s as H, t as K } from "./server-entry-13b7e1e6.mjs";
6
+ function Button(e) {
7
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
8
+ e.link ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
9
9
  "a",
10
10
  {
11
11
  role: "button",
@@ -14,21 +14,21 @@ function Fe(e) {
14
14
  target: e.openLinkInNewTab ? "_blank" : void 0,
15
15
  children: e.text
16
16
  }
17
- ) }) : /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
17
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
18
18
  "button",
19
19
  {
20
20
  ...e.attributes,
21
21
  style: e.attributes.style,
22
- className: e.attributes.className + " button-3e7bc8b2",
22
+ className: e.attributes.className + " button-35669e6c",
23
23
  children: e.text
24
24
  }
25
25
  ) }),
26
- /* @__PURE__ */ l("style", { children: `.button-3e7bc8b2 {
26
+ /* @__PURE__ */ jsx("style", { children: `.button-35669e6c {
27
27
  all: unset;
28
28
  }` })
29
29
  ] });
30
30
  }
31
- const ye = {
31
+ const SIZES = {
32
32
  small: {
33
33
  min: 320,
34
34
  default: 321,
@@ -44,11 +44,11 @@ const ye = {
44
44
  default: 991,
45
45
  max: 1200
46
46
  }
47
- }, le = (e, t = ye) => `@media (max-width: ${t[e].max}px)`, Se = ({
47
+ }, getMaxWidthQueryForSize = (e, t = SIZES) => `@media (max-width: ${t[e].max}px)`, getSizesForBreakpoints = ({
48
48
  small: e,
49
49
  medium: t
50
50
  }) => {
51
- const n = Z(ye);
51
+ const n = fastClone(SIZES);
52
52
  if (!e || !t)
53
53
  return n;
54
54
  const i = Math.floor(e / 2);
@@ -57,20 +57,20 @@ const ye = {
57
57
  min: i,
58
58
  default: i + 1
59
59
  };
60
- const a = n.small.max + 1;
60
+ const o = n.small.max + 1;
61
61
  n.medium = {
62
62
  max: t,
63
- min: a,
64
- default: a + 1
63
+ min: o,
64
+ default: o + 1
65
65
  };
66
- const o = n.medium.max + 1;
66
+ const a = n.medium.max + 1;
67
67
  return n.large = {
68
68
  max: 2e3,
69
69
  // TODO: decide upper limit
70
- min: o,
71
- default: o + 1
70
+ min: a,
71
+ default: a + 1
72
72
  }, n;
73
- }, Ne = ({
73
+ }, getFunctionArguments = ({
74
74
  builder: e,
75
75
  context: t,
76
76
  event: n,
@@ -82,146 +82,248 @@ const ye = {
82
82
  builder: e,
83
83
  context: t,
84
84
  event: n
85
- }), We = ({
85
+ }), getBuilderGlobals = () => ({
86
+ isEditing: isEditing(),
87
+ isBrowser: isBrowser(),
88
+ isServer: !isBrowser(),
89
+ getUserAttributes: () => getUserAttributes()
90
+ }), parseCode = (e, {
91
+ isExpression: t = !0
92
+ }) => /* 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 = ({
86
93
  code: e,
87
94
  builder: t,
88
95
  context: n,
89
96
  event: i,
90
- localState: a,
91
- rootSetState: o,
97
+ localState: o,
98
+ rootSetState: a,
92
99
  rootState: r
93
100
  }) => {
94
- const d = Ne({
101
+ const l = getFunctionArguments({
95
102
  builder: t,
96
103
  context: n,
97
104
  event: i,
98
- state: je(r, a, o)
105
+ state: flattenState(r, o, a)
99
106
  });
100
- return new Function(...d.map(([c]) => c), e)(...d.map(([, c]) => c));
107
+ return new Function(...l.map(([s]) => s), e)(...l.map(([, s]) => s));
101
108
  };
102
- function je(e, t, n) {
109
+ function flattenState(e, t, n) {
103
110
  if (e === t)
104
111
  throw new Error("rootState === localState");
105
112
  return new Proxy(e, {
106
- get: (i, a) => t && a in t ? t[a] : e[a],
107
- set: (i, a, o) => {
108
- if (t && a in t)
113
+ get: (i, o) => t && o in t ? t[o] : e[o],
114
+ set: (i, o, a) => {
115
+ if (t && o in t)
109
116
  throw new Error("Writing to local state is not allowed as it is read-only.");
110
- return e[a] = o, n == null || n(e), !0;
117
+ return e[o] = a, n == null || n(e), !0;
111
118
  }
112
119
  });
113
120
  }
114
- function j({
121
+ const noop = () => null;
122
+ let safeDynamicRequire = noop;
123
+ try {
124
+ safeDynamicRequire = eval("require");
125
+ } catch (e) {
126
+ }
127
+ const set = (e, t, n) => {
128
+ if (Object(e) !== e)
129
+ return e;
130
+ const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
131
+ return i.slice(0, -1).reduce((o, a, r) => Object(o[a]) === o[a] ? o[a] : o[a] = Math.abs(Number(i[r + 1])) >> 0 === +i[r + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
132
+ }, ivm = safeDynamicRequire("isolated-vm"), getSyncValName = (e) => `bldr_${e}_sync`, BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE", INJECTED_IVM_GLOBAL = "BUILDER_IVM", REF_TO_PROXY_FN = `
133
+ var refToProxy = (obj) => {
134
+ if (typeof obj !== 'object' || obj === null) {
135
+ return obj;
136
+ }
137
+ return new Proxy({}, {
138
+ get(target, key) {
139
+ if (key === 'copySync') {
140
+ return () => obj.copySync();
141
+ }
142
+ const val = obj.getSync(key);
143
+ if (typeof val?.getSync === 'function') {
144
+ return refToProxy(val);
145
+ }
146
+ return val;
147
+ },
148
+ set(target, key, value) {
149
+ const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
150
+ obj.setSync(key, v);
151
+ ${BUILDER_SET_STATE_NAME}(key, value)
152
+ },
153
+ deleteProperty(target, key) {
154
+ obj.deleteSync(key);
155
+ }
156
+ })
157
+ }
158
+ `, processCode = ({
159
+ code: e,
160
+ args: t
161
+ }) => {
162
+ const n = t.map(([i]) => `var ${i} = refToProxy(${getSyncValName(i)}); `).join("");
163
+ return `
164
+ ${REF_TO_PROXY_FN}
165
+ ${n}
166
+ function theFunction() {
167
+ ${e}
168
+ }
169
+
170
+ let output = theFunction()
171
+
172
+ if (typeof output === 'object' && output !== null) {
173
+ output = JSON.stringify(output.copySync ? output.copySync() : output);
174
+ }
175
+
176
+ output;
177
+ `;
178
+ }, getIsolateContext = () => new ivm.Isolate({
179
+ memoryLimit: 128
180
+ }).createContextSync(), runInNode = ({
181
+ code: e,
182
+ builder: t,
183
+ context: n,
184
+ event: i,
185
+ localState: o,
186
+ rootSetState: a,
187
+ rootState: r
188
+ }) => {
189
+ const l = fastClone({
190
+ ...r,
191
+ ...o
192
+ }), s = getFunctionArguments({
193
+ builder: t,
194
+ context: n,
195
+ event: i,
196
+ state: l
197
+ }), c = getIsolateContext(), u = c.global;
198
+ u.setSync("global", u.derefInto()), u.setSync("log", function(...b) {
199
+ console.log(...b);
200
+ }), u.setSync(BUILDER_SET_STATE_NAME, function(b, d) {
201
+ set(r, b, d), a == null || a(r);
202
+ }), s.forEach(([b, d]) => {
203
+ const x = typeof d == "object" ? new ivm.Reference(
204
+ // workaround: methods with default values for arguments is not being cloned over
205
+ b === "builder" ? {
206
+ ...d,
207
+ getUserAttributes: () => d.getUserAttributes()
208
+ } : d
209
+ ) : null;
210
+ u.setSync(getSyncValName(b), x);
211
+ }), u.setSync(INJECTED_IVM_GLOBAL, ivm);
212
+ const f = processCode({
213
+ code: e,
214
+ args: s
215
+ }), h = c.evalSync(f);
216
+ try {
217
+ return JSON.parse(h);
218
+ } catch {
219
+ return h;
220
+ }
221
+ }, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
222
+ function evaluate({
115
223
  code: e,
116
224
  context: t,
117
225
  localState: n,
118
226
  rootState: i,
119
- rootSetState: a,
120
- event: o,
227
+ rootSetState: o,
228
+ event: a,
121
229
  isExpression: r = !0
122
230
  }) {
123
231
  if (e === "") {
124
- U.warn("Skipping evaluation of empty code block.");
232
+ logger.warn("Skipping evaluation of empty code block.");
125
233
  return;
126
234
  }
127
- const d = {
128
- isEditing: V(),
129
- isBrowser: F(),
130
- isServer: !F(),
131
- getUserAttributes: () => Ee()
132
- }, u = {
133
- code: /* we disable this for cases where we definitely don't want a return */ r && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e,
134
- builder: d,
235
+ const l = {
236
+ code: parseCode(e, {
237
+ isExpression: r
238
+ }),
239
+ builder: getBuilderGlobals(),
135
240
  context: t,
136
- event: o,
137
- rootSetState: a,
241
+ event: a,
242
+ rootSetState: o,
138
243
  rootState: i,
139
244
  localState: n
140
245
  };
141
246
  try {
142
- return We(u);
143
- } catch (m) {
144
- U.error("Failed code evaluation: " + m.message, {
247
+ return chooseBrowserOrServerEval(l);
248
+ } catch (s) {
249
+ logger.error("Failed code evaluation: " + s.message, {
145
250
  code: e
146
251
  });
147
252
  return;
148
253
  }
149
254
  }
150
- const Me = (e, t, n) => {
151
- if (Object(e) !== e)
152
- return e;
153
- const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
154
- return i.slice(0, -1).reduce((a, o, r) => Object(a[o]) === a[o] ? a[o] : a[o] = Math.abs(Number(i[r + 1])) >> 0 === +i[r + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
155
- };
156
- const Le = ({
255
+ function transformBlock(e) {
256
+ return e;
257
+ }
258
+ const evaluateBindings = ({
157
259
  block: e,
158
260
  context: t,
159
261
  localState: n,
160
262
  rootState: i,
161
- rootSetState: a
263
+ rootSetState: o
162
264
  }) => {
163
265
  if (!e.bindings)
164
266
  return e;
165
- const o = Z(e), r = {
166
- ...o,
267
+ const a = fastClone(e), r = {
268
+ ...a,
167
269
  properties: {
168
- ...o.properties
270
+ ...a.properties
169
271
  },
170
272
  actions: {
171
- ...o.actions
273
+ ...a.actions
172
274
  }
173
275
  };
174
- for (const d in e.bindings) {
175
- const c = e.bindings[d], s = j({
176
- code: c,
276
+ for (const l in e.bindings) {
277
+ const s = e.bindings[l], c = evaluate({
278
+ code: s,
177
279
  localState: n,
178
280
  rootState: i,
179
- rootSetState: a,
281
+ rootSetState: o,
180
282
  context: t
181
283
  });
182
- Me(r, d, s);
284
+ set(r, l, c);
183
285
  }
184
286
  return r;
185
287
  };
186
- function K({
288
+ function getProcessedBlock({
187
289
  block: e,
188
290
  context: t,
189
291
  shouldEvaluateBindings: n,
190
292
  localState: i,
191
- rootState: a,
192
- rootSetState: o
293
+ rootState: o,
294
+ rootSetState: a
193
295
  }) {
194
296
  const r = e;
195
- return n ? Le({
297
+ return n ? evaluateBindings({
196
298
  block: r,
197
299
  localState: i,
198
- rootState: a,
199
- rootSetState: o,
300
+ rootState: o,
301
+ rootSetState: a,
200
302
  context: t
201
303
  }) : r;
202
304
  }
203
- const Ue = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), ve = (e) => Object.entries(e).map(([n, i]) => {
305
+ const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, i]) => {
204
306
  if (typeof i == "string")
205
- return `${Ue(n)}: ${i};`;
206
- }).filter(Y), _e = (e) => ve(e).join(`
207
- `), q = ({
307
+ return `${camelToKebabCase(n)}: ${i};`;
308
+ }).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
309
+ `), createCssClass = ({
208
310
  mediaQuery: e,
209
311
  className: t,
210
312
  styles: n
211
313
  }) => {
212
314
  const i = `.${t} {
213
- ${_e(n)}
315
+ ${convertStyleMapToCSS(n)}
214
316
  }`;
215
317
  return e ? `${e} {
216
318
  ${i}
217
319
  }` : i;
218
320
  };
219
- function H(e) {
220
- return /* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
321
+ function InlinedStyles(e) {
322
+ return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
221
323
  }
222
- function ee(e) {
324
+ function BlockStyles(e) {
223
325
  function t() {
224
- const i = K({
326
+ const i = getProcessedBlock({
225
327
  block: e.block,
226
328
  localState: e.context.localState,
227
329
  rootState: e.context.rootState,
@@ -229,45 +331,45 @@ function ee(e) {
229
331
  context: e.context.context,
230
332
  shouldEvaluateBindings: !0
231
333
  });
232
- return Y(i.hide) ? !i.hide : Y(i.show) ? i.show : !0;
334
+ return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
233
335
  }
234
336
  function n() {
235
- var h;
236
- const i = K({
337
+ var d;
338
+ const i = getProcessedBlock({
237
339
  block: e.block,
238
340
  localState: e.context.localState,
239
341
  rootState: e.context.rootState,
240
342
  rootSetState: e.context.rootSetState,
241
343
  context: e.context.context,
242
344
  shouldEvaluateBindings: !0
243
- }), a = i.responsiveStyles, o = e.context.content, r = Se(
244
- ((h = o == null ? void 0 : o.meta) == null ? void 0 : h.breakpoints) || {}
245
- ), d = a == null ? void 0 : a.large, c = a == null ? void 0 : a.medium, s = a == null ? void 0 : a.small, u = i.id;
345
+ }), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
346
+ ((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
347
+ ), l = o == null ? void 0 : o.large, s = o == null ? void 0 : o.medium, c = o == null ? void 0 : o.small, u = i.id;
246
348
  if (!u)
247
349
  return "";
248
- const m = d ? q({
350
+ const f = l ? createCssClass({
249
351
  className: u,
250
- styles: d
251
- }) : "", y = c ? q({
352
+ styles: l
353
+ }) : "", h = s ? createCssClass({
252
354
  className: u,
253
- styles: c,
254
- mediaQuery: le(
355
+ styles: s,
356
+ mediaQuery: getMaxWidthQueryForSize(
255
357
  "medium",
256
358
  r
257
359
  )
258
- }) : "", k = s ? q({
360
+ }) : "", b = c ? createCssClass({
259
361
  className: u,
260
- styles: s,
261
- mediaQuery: le(
362
+ styles: c,
363
+ mediaQuery: getMaxWidthQueryForSize(
262
364
  "small",
263
365
  r
264
366
  )
265
367
  }) : "";
266
- return [m, y, k].join(" ");
368
+ return [f, h, b].join(" ");
267
369
  }
268
- return /* @__PURE__ */ l(f, { children: n() && t() ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(H, { styles: n() }) }) : null });
370
+ return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
269
371
  }
270
- function Ke(e) {
372
+ function getBlockComponentOptions(e) {
271
373
  var t;
272
374
  return {
273
375
  ...(t = e.component) == null ? void 0 : t.options,
@@ -278,29 +380,29 @@ function Ke(e) {
278
380
  builderBlock: e
279
381
  };
280
382
  }
281
- const Oe = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], D = (e) => typeof e == "string" && Oe.includes(e.toLowerCase()), He = ({
383
+ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], isEmptyHtmlElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.includes(e.toLowerCase()), getComponent = ({
282
384
  block: e,
283
385
  context: t,
284
386
  registeredComponents: n
285
387
  }) => {
286
- var o;
287
- const i = (o = K({
388
+ var a;
389
+ const i = (a = getProcessedBlock({
288
390
  block: e,
289
391
  localState: t.localState,
290
392
  rootState: t.rootState,
291
393
  rootSetState: t.rootSetState,
292
394
  context: t.context,
293
395
  shouldEvaluateBindings: !1
294
- }).component) == null ? void 0 : o.name;
396
+ }).component) == null ? void 0 : a.name;
295
397
  if (!i)
296
398
  return null;
297
- const a = n[i];
298
- if (a)
299
- return a;
399
+ const o = n[i];
400
+ if (o)
401
+ return o;
300
402
  console.warn(`
301
403
  Could not find a registered component named "${i}".
302
404
  If you registered it, is the file that registered it imported by the file that needs to render it?`);
303
- }, ze = ({
405
+ }, getRepeatItemData = ({
304
406
  block: e,
305
407
  context: t
306
408
  }) => {
@@ -310,30 +412,30 @@ const Oe = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen"
310
412
  } = e;
311
413
  if (!(n != null && n.collection))
312
414
  return;
313
- const a = j({
415
+ const o = evaluate({
314
416
  code: n.collection,
315
417
  localState: t.localState,
316
418
  rootState: t.rootState,
317
419
  rootSetState: t.rootSetState,
318
420
  context: t.context
319
421
  });
320
- if (!Array.isArray(a))
422
+ if (!Array.isArray(o))
321
423
  return;
322
- const o = n.collection.split(".").pop(), r = n.itemName || (o ? o + "Item" : "item");
323
- return a.map((c, s) => ({
424
+ const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
425
+ return o.map((s, c) => ({
324
426
  context: {
325
427
  ...t,
326
428
  localState: {
327
429
  ...t.localState,
328
- $index: s,
329
- $item: c,
330
- [r]: c,
331
- [`$${r}Index`]: s
430
+ $index: c,
431
+ $item: s,
432
+ [r]: s,
433
+ [`$${r}Index`]: c
332
434
  }
333
435
  },
334
436
  block: i
335
437
  }));
336
- }, te = be({
438
+ }, builderContext = createContext({
337
439
  content: null,
338
440
  context: {},
339
441
  localState: void 0,
@@ -345,10 +447,10 @@ const Oe = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen"
345
447
  componentInfos: {},
346
448
  inheritedStyles: {}
347
449
  });
348
- function qe(e) {
349
- const [t, n] = I(() => e.repeatContext);
350
- return /* @__PURE__ */ l(te.Provider, { value: t, children: /* @__PURE__ */ l(
351
- z,
450
+ function RepeatedBlock(e) {
451
+ const [t, n] = useState(() => e.repeatContext);
452
+ return /* @__PURE__ */ jsx(builderContext.Provider, { value: t, children: /* @__PURE__ */ jsx(
453
+ Block,
352
454
  {
353
455
  block: e.block,
354
456
  context: t,
@@ -356,10 +458,10 @@ function qe(e) {
356
458
  }
357
459
  ) });
358
460
  }
359
- function De(e) {
461
+ function capitalizeFirstLetter(e) {
360
462
  return e.charAt(0).toUpperCase() + e.slice(1);
361
463
  }
362
- const Je = (e) => `on${De(e)}`, Ye = (e, t) => (n) => j({
464
+ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventHandler = (e, t) => (n) => evaluate({
363
465
  code: e,
364
466
  context: t.context,
365
467
  localState: t.localState,
@@ -368,54 +470,54 @@ const Je = (e) => `on${De(e)}`, Ye = (e, t) => (n) => j({
368
470
  event: n,
369
471
  isExpression: !1
370
472
  });
371
- function G(e) {
473
+ function getBlockActions(e) {
372
474
  const t = {}, n = e.block.actions ?? {};
373
475
  for (const i in n) {
374
476
  if (!n.hasOwnProperty(i))
375
477
  continue;
376
- const a = n[i];
377
- let o = Je(i);
478
+ const o = n[i];
479
+ let a = getEventHandlerName(i);
378
480
  if (e.stripPrefix)
379
- switch (M) {
481
+ switch (TARGET) {
380
482
  case "vue2":
381
483
  case "vue3":
382
- o = o.replace("v-on:", "");
484
+ a = a.replace("v-on:", "");
383
485
  break;
384
486
  case "svelte":
385
- o = o.replace("on:", "");
487
+ a = a.replace("on:", "");
386
488
  break;
387
489
  }
388
- t[o] = Ye(a, e);
490
+ t[a] = createEventHandler(o, e);
389
491
  }
390
492
  return t;
391
493
  }
392
- function Ge(e) {
494
+ function transformBlockProperties(e) {
393
495
  return e.className = e.class, delete e.class, e;
394
496
  }
395
- const Qe = (e) => ({
497
+ const extractRelevantRootBlockProperties = (e) => ({
396
498
  href: e.href
397
499
  });
398
- function O({
500
+ function getBlockProperties({
399
501
  block: e,
400
502
  context: t
401
503
  }) {
402
504
  var i;
403
505
  const n = {
404
- ...Qe(e),
506
+ ...extractRelevantRootBlockProperties(e),
405
507
  ...e.properties,
406
508
  "builder-id": e.id,
407
- style: e.style ? Xe(e.style) : void 0,
509
+ style: e.style ? getStyleAttribute(e.style) : void 0,
408
510
  class: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
409
511
  };
410
- return Ge(n);
512
+ return transformBlockProperties(n);
411
513
  }
412
- function Xe(e) {
413
- switch (M) {
514
+ function getStyleAttribute(e) {
515
+ switch (TARGET) {
414
516
  case "svelte":
415
517
  case "vue2":
416
518
  case "vue3":
417
519
  case "solid":
418
- return ve(e).join(" ");
520
+ return convertStyleMapToCSSArray(e).join(" ");
419
521
  case "qwik":
420
522
  case "reactNative":
421
523
  case "react":
@@ -423,17 +525,17 @@ function Xe(e) {
423
525
  return e;
424
526
  }
425
527
  }
426
- function Ze(e) {
427
- return /* @__PURE__ */ l(
528
+ function InteractiveElement(e) {
529
+ return /* @__PURE__ */ jsx(
428
530
  e.Wrapper,
429
531
  {
430
532
  ...e.wrapperProps,
431
533
  attributes: {
432
- ...O({
534
+ ...getBlockProperties({
433
535
  block: e.block,
434
536
  context: e.context
435
537
  }),
436
- ...G({
538
+ ...getBlockActions({
437
539
  block: e.block,
438
540
  rootState: e.context.rootState,
439
541
  rootSetState: e.context.rootSetState,
@@ -445,15 +547,15 @@ function Ze(e) {
445
547
  }
446
548
  );
447
549
  }
448
- const et = ({
550
+ const getWrapperProps = ({
449
551
  componentOptions: e,
450
552
  builderBlock: t,
451
553
  context: n,
452
554
  componentRef: i,
453
- includeBlockProps: a,
454
- isInteractive: o,
555
+ includeBlockProps: o,
556
+ isInteractive: a,
455
557
  contextValue: r
456
- }) => o ? {
558
+ }) => a ? {
457
559
  Wrapper: i,
458
560
  block: t,
459
561
  context: n,
@@ -464,22 +566,22 @@ const et = ({
464
566
  * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
465
567
  * component itself directly. Otherwise, they are provided to the wrapper element.
466
568
  */
467
- ...a ? {
468
- attributes: O({
569
+ ...o ? {
570
+ attributes: getBlockProperties({
469
571
  block: t,
470
572
  context: r
471
573
  })
472
574
  } : {}
473
575
  };
474
- function ce(e) {
475
- var i, a;
476
- const [t, n] = I(
477
- () => e.isInteractive ? Ze : e.componentRef
576
+ function ComponentRef(e) {
577
+ var i, o;
578
+ const [t, n] = useState(
579
+ () => e.isInteractive ? InteractiveElement : e.componentRef
478
580
  );
479
- return /* @__PURE__ */ l(f, { children: e.componentRef ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ E(
581
+ return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
480
582
  t,
481
583
  {
482
- ...et({
584
+ ...getWrapperProps({
483
585
  componentOptions: e.componentOptions,
484
586
  builderBlock: e.builderBlock,
485
587
  context: e.context,
@@ -489,38 +591,38 @@ function ce(e) {
489
591
  contextValue: e.context
490
592
  }),
491
593
  children: [
492
- (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */ l(
493
- z,
594
+ (i = e.blockChildren) == null ? void 0 : i.map((a) => /* @__PURE__ */ jsx(
595
+ Block,
494
596
  {
495
- block: o,
597
+ block: a,
496
598
  context: e.context,
497
599
  registeredComponents: e.registeredComponents
498
600
  },
499
- "block-" + o.id
601
+ "block-" + a.id
500
602
  )),
501
- (a = e.blockChildren) == null ? void 0 : a.map((o) => /* @__PURE__ */ l(
502
- ee,
603
+ (o = e.blockChildren) == null ? void 0 : o.map((a) => /* @__PURE__ */ jsx(
604
+ BlockStyles,
503
605
  {
504
- block: o,
606
+ block: a,
505
607
  context: e.context
506
608
  },
507
- "block-style-" + o.id
609
+ "block-style-" + a.id
508
610
  ))
509
611
  ]
510
612
  }
511
613
  ) }) : null });
512
614
  }
513
- function se(e) {
514
- return /* @__PURE__ */ E(f, { children: [
615
+ function BlockWrapper(e) {
616
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
515
617
  " ",
516
- e.hasChildren ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ E(
618
+ e.hasChildren ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
517
619
  e.Wrapper,
518
620
  {
519
- ...O({
621
+ ...getBlockProperties({
520
622
  block: e.block,
521
623
  context: e.context
522
624
  }),
523
- ...G({
625
+ ...getBlockActions({
524
626
  block: e.block,
525
627
  rootState: e.context.rootState,
526
628
  rootSetState: e.context.rootSetState,
@@ -534,14 +636,14 @@ function se(e) {
534
636
  " "
535
637
  ]
536
638
  }
537
- ) }) : /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
639
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
538
640
  e.Wrapper,
539
641
  {
540
- ...O({
642
+ ...getBlockProperties({
541
643
  block: e.block,
542
644
  context: e.context
543
645
  }),
544
- ...G({
646
+ ...getBlockActions({
545
647
  block: e.block,
546
648
  rootState: e.context.rootState,
547
649
  rootSetState: e.context.rootSetState,
@@ -554,23 +656,23 @@ function se(e) {
554
656
  " "
555
657
  ] });
556
658
  }
557
- function z(e) {
558
- var u, m, y, k;
659
+ function Block(e) {
660
+ var u, f, h, b;
559
661
  function t() {
560
- return He({
662
+ return getComponent({
561
663
  block: e.block,
562
664
  context: e.context,
563
665
  registeredComponents: e.registeredComponents
564
666
  });
565
667
  }
566
668
  function n() {
567
- return ze({
669
+ return getRepeatItemData({
568
670
  block: e.block,
569
671
  context: e.context
570
672
  });
571
673
  }
572
674
  function i() {
573
- return n() ? e.block : K({
675
+ return n() ? e.block : getProcessedBlock({
574
676
  block: e.block,
575
677
  localState: e.context.localState,
576
678
  rootState: e.context.rootState,
@@ -579,94 +681,94 @@ function z(e) {
579
681
  shouldEvaluateBindings: !0
580
682
  });
581
683
  }
582
- function a() {
684
+ function o() {
583
685
  return e.block.tagName || "div";
584
686
  }
585
- function o() {
687
+ function a() {
586
688
  return "hide" in i() ? !i().hide : "show" in i() ? i().show : !0;
587
689
  }
588
690
  function r() {
589
- var S;
590
- return !((S = t == null ? void 0 : t()) != null && S.component) && !n() ? i().children ?? [] : [];
691
+ var x;
692
+ return !((x = t == null ? void 0 : t()) != null && x.component) && !n() ? i().children ?? [] : [];
591
693
  }
592
- function d() {
593
- var h, S, p, C, g;
694
+ function l() {
695
+ var d, x, v, C, S;
594
696
  return {
595
697
  blockChildren: i().children ?? [],
596
- componentRef: (h = t == null ? void 0 : t()) == null ? void 0 : h.component,
698
+ componentRef: (d = t == null ? void 0 : t()) == null ? void 0 : d.component,
597
699
  componentOptions: {
598
- ...Ke(i()),
700
+ ...getBlockComponentOptions(i()),
599
701
  builderContext: e.context,
600
- ...((S = t == null ? void 0 : t()) == null ? void 0 : S.name) === "Symbol" || ((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Columns" ? {
702
+ ...((x = t == null ? void 0 : t()) == null ? void 0 : x.name) === "Symbol" || ((v = t == null ? void 0 : t()) == null ? void 0 : v.name) === "Columns" ? {
601
703
  builderComponents: e.registeredComponents
602
704
  } : {}
603
705
  },
604
- context: c,
706
+ context: s,
605
707
  registeredComponents: e.registeredComponents,
606
708
  builderBlock: i(),
607
709
  includeBlockProps: ((C = t == null ? void 0 : t()) == null ? void 0 : C.noWrap) === !0,
608
- isInteractive: !((g = t == null ? void 0 : t()) != null && g.isRSC)
710
+ isInteractive: !((S = t == null ? void 0 : t()) != null && S.isRSC)
609
711
  };
610
712
  }
611
- const [c, s] = I(() => e.context);
612
- return /* @__PURE__ */ l(f, { children: o() ? /* @__PURE__ */ l(f, { children: (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(ce, { ...d() }) }) : /* @__PURE__ */ E(f, { children: [
613
- D(a()) ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
614
- se,
713
+ const [s, c] = useState(() => e.context);
714
+ return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsx(Fragment, { children: (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ComponentRef, { ...l() }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
715
+ isEmptyHtmlElement(o()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
716
+ BlockWrapper,
615
717
  {
616
- Wrapper: a(),
718
+ Wrapper: o(),
617
719
  block: i(),
618
720
  context: e.context,
619
721
  hasChildren: !1
620
722
  }
621
723
  ) }) : null,
622
- !D(a()) && n() ? /* @__PURE__ */ l(f, { children: (m = n()) == null ? void 0 : m.map((h, S) => /* @__PURE__ */ l(
623
- qe,
724
+ !isEmptyHtmlElement(o()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (f = n()) == null ? void 0 : f.map((d, x) => /* @__PURE__ */ jsx(
725
+ RepeatedBlock,
624
726
  {
625
- repeatContext: h.context,
626
- block: h.block,
727
+ repeatContext: d.context,
728
+ block: d.block,
627
729
  registeredComponents: e.registeredComponents
628
730
  },
629
- S
731
+ x
630
732
  )) }) : null,
631
- !D(a()) && !n() ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ E(
632
- se,
733
+ !isEmptyHtmlElement(o()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
734
+ BlockWrapper,
633
735
  {
634
- Wrapper: a(),
736
+ Wrapper: o(),
635
737
  block: i(),
636
738
  context: e.context,
637
739
  hasChildren: !0,
638
740
  children: [
639
- /* @__PURE__ */ l(ce, { ...d() }),
640
- (y = r()) == null ? void 0 : y.map((h) => /* @__PURE__ */ l(
641
- z,
741
+ /* @__PURE__ */ jsx(ComponentRef, { ...l() }),
742
+ (h = r()) == null ? void 0 : h.map((d) => /* @__PURE__ */ jsx(
743
+ Block,
642
744
  {
643
- block: h,
644
- context: c,
745
+ block: d,
746
+ context: s,
645
747
  registeredComponents: e.registeredComponents
646
748
  },
647
- "block-" + h.id
749
+ "block-" + d.id
648
750
  )),
649
- (k = r()) == null ? void 0 : k.map((h) => /* @__PURE__ */ l(
650
- ee,
751
+ (b = r()) == null ? void 0 : b.map((d) => /* @__PURE__ */ jsx(
752
+ BlockStyles,
651
753
  {
652
- block: h,
653
- context: c
754
+ block: d,
755
+ context: s
654
756
  },
655
- "block-style-" + h.id
757
+ "block-style-" + d.id
656
758
  ))
657
759
  ]
658
760
  }
659
761
  ) }) : null
660
762
  ] }) }) : null });
661
763
  }
662
- function tt(e) {
764
+ function BlocksWrapper(e) {
663
765
  function t() {
664
- var a;
665
- return "builder-blocks" + ((a = e.blocks) != null && a.length ? "" : " no-blocks");
766
+ var o;
767
+ return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
666
768
  }
667
769
  function n() {
668
- var a, o;
669
- V() && !((a = e.blocks) != null && a.length) && ((o = window.parent) == null || o.postMessage(
770
+ var o, a;
771
+ isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
670
772
  {
671
773
  type: "builder.clickEmptyBlocks",
672
774
  data: {
@@ -678,8 +780,8 @@ function tt(e) {
678
780
  ));
679
781
  }
680
782
  function i() {
681
- var a, o;
682
- V() && !((a = e.blocks) != null && a.length) && ((o = window.parent) == null || o.postMessage(
783
+ var o, a;
784
+ isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
683
785
  {
684
786
  type: "builder.hoverEmptyBlocks",
685
787
  data: {
@@ -690,131 +792,131 @@ function tt(e) {
690
792
  "*"
691
793
  ));
692
794
  }
693
- return /* @__PURE__ */ E(f, { children: [
694
- /* @__PURE__ */ l(
795
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
796
+ /* @__PURE__ */ jsx(
695
797
  "div",
696
798
  {
697
- className: t() + " div-5821bd52",
799
+ className: t() + " div-02c7a115",
698
800
  "builder-path": e.path,
699
801
  "builder-parent-id": e.parent,
700
802
  style: e.styleProp,
701
- onClick: (a) => n(),
702
- onMouseEnter: (a) => i(),
703
- onKeyPress: (a) => n(),
803
+ onClick: (o) => n(),
804
+ onMouseEnter: (o) => i(),
805
+ onKeyPress: (o) => n(),
704
806
  children: e.children
705
807
  }
706
808
  ),
707
- /* @__PURE__ */ l("style", { children: `.div-5821bd52 {
809
+ /* @__PURE__ */ jsx("style", { children: `.div-02c7a115 {
708
810
  display: flex;
709
811
  flex-direction: column;
710
812
  align-items: stretch;
711
813
  }` })
712
814
  ] });
713
815
  }
714
- const ke = be({ registeredComponents: {} });
715
- function ne(e) {
716
- var i, a;
717
- const t = ie(te), n = ie(ke);
718
- return /* @__PURE__ */ E(
719
- tt,
816
+ const ComponentsContext = createContext({ registeredComponents: {} });
817
+ function Blocks(e) {
818
+ var i, o;
819
+ const t = useContext(builderContext), n = useContext(ComponentsContext);
820
+ return /* @__PURE__ */ jsxs(
821
+ BlocksWrapper,
720
822
  {
721
823
  blocks: e.blocks,
722
824
  parent: e.parent,
723
825
  path: e.path,
724
826
  styleProp: e.styleProp,
725
827
  children: [
726
- e.blocks ? /* @__PURE__ */ l(f, { children: (i = e.blocks) == null ? void 0 : i.map((o) => /* @__PURE__ */ l(
727
- z,
828
+ e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (i = e.blocks) == null ? void 0 : i.map((a) => /* @__PURE__ */ jsx(
829
+ Block,
728
830
  {
729
- block: o,
831
+ block: a,
730
832
  context: e.context || t,
731
833
  registeredComponents: e.registeredComponents || n.registeredComponents
732
834
  },
733
- "render-block-" + o.id
835
+ "render-block-" + a.id
734
836
  )) }) : null,
735
- e.blocks ? /* @__PURE__ */ l(f, { children: (a = e.blocks) == null ? void 0 : a.map((o) => /* @__PURE__ */ l(
736
- ee,
837
+ e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (o = e.blocks) == null ? void 0 : o.map((a) => /* @__PURE__ */ jsx(
838
+ BlockStyles,
737
839
  {
738
- block: o,
840
+ block: a,
739
841
  context: e.context || t
740
842
  },
741
- "block-style-" + o.id
843
+ "block-style-" + a.id
742
844
  )) }) : null
743
845
  ]
744
846
  }
745
847
  );
746
848
  }
747
- function nt(e) {
849
+ function Columns(e) {
748
850
  var C;
749
- const [t, n] = I(
851
+ const [t, n] = useState(
750
852
  () => typeof e.space == "number" ? e.space || 0 : 20
751
- ), [i, a] = I(() => e.columns || []), [o, r] = I(
853
+ ), [i, o] = useState(() => e.columns || []), [a, r] = useState(
752
854
  () => e.stackColumnsAt || "tablet"
753
855
  );
754
- function d(g) {
755
- var R;
756
- return ((R = i[g]) == null ? void 0 : R.width) || 100 / i.length;
856
+ function l(S) {
857
+ var E;
858
+ return ((E = i[S]) == null ? void 0 : E.width) || 100 / i.length;
757
859
  }
758
- function c(g) {
759
- const R = t * (i.length - 1) / i.length;
760
- return `calc(${d(g)}% - ${R}px)`;
860
+ function s(S) {
861
+ const E = t * (i.length - 1) / i.length;
862
+ return `calc(${l(S)}% - ${E}px)`;
761
863
  }
762
- function s({
763
- stackedStyle: g,
764
- desktopStyle: R
864
+ function c({
865
+ stackedStyle: S,
866
+ desktopStyle: E
765
867
  }) {
766
- return o === "tablet" ? g : R;
868
+ return a === "tablet" ? S : E;
767
869
  }
768
870
  function u({
769
- stackedStyle: g,
770
- desktopStyle: R
871
+ stackedStyle: S,
872
+ desktopStyle: E
771
873
  }) {
772
- return o === "never" ? R : g;
874
+ return a === "never" ? E : S;
773
875
  }
774
- const [m, y] = I(
876
+ const [f, h] = useState(
775
877
  () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
776
878
  );
777
- function k() {
879
+ function b() {
778
880
  return {
779
- "--flex-dir": m,
780
- "--flex-dir-tablet": s({
781
- stackedStyle: m,
881
+ "--flex-dir": f,
882
+ "--flex-dir-tablet": c({
883
+ stackedStyle: f,
782
884
  desktopStyle: "row"
783
885
  })
784
886
  };
785
887
  }
786
- function h(g) {
787
- const R = g === 0 ? 0 : t, A = c(g), B = `${R}px`, N = "100%", b = 0;
888
+ function d(S) {
889
+ const E = S === 0 ? 0 : t, I = s(S), T = `${E}px`, R = "100%", j = 0;
788
890
  return {
789
- width: A,
790
- ["marginLeft"]: B,
891
+ width: I,
892
+ ["marginLeft"]: T,
791
893
  "--column-width-mobile": u({
792
- stackedStyle: N,
793
- desktopStyle: A
894
+ stackedStyle: R,
895
+ desktopStyle: I
794
896
  }),
795
897
  "--column-margin-left-mobile": u({
796
- stackedStyle: b,
797
- desktopStyle: B
898
+ stackedStyle: j,
899
+ desktopStyle: T
798
900
  }),
799
- "--column-width-tablet": s({
800
- stackedStyle: N,
801
- desktopStyle: A
901
+ "--column-width-tablet": c({
902
+ stackedStyle: R,
903
+ desktopStyle: I
802
904
  }),
803
- "--column-margin-left-tablet": s({
804
- stackedStyle: b,
805
- desktopStyle: B
905
+ "--column-margin-left-tablet": c({
906
+ stackedStyle: j,
907
+ desktopStyle: T
806
908
  })
807
909
  };
808
910
  }
809
- function S(g) {
810
- var A, B;
811
- return Se(
812
- ((B = (A = e.builderContext.content) == null ? void 0 : A.meta) == null ? void 0 : B.breakpoints) || {}
813
- )[g].max;
911
+ function x(S) {
912
+ var I, T;
913
+ return getSizesForBreakpoints(
914
+ ((T = (I = e.builderContext.content) == null ? void 0 : I.meta) == null ? void 0 : T.breakpoints) || {}
915
+ )[S].max;
814
916
  }
815
- function p() {
917
+ function v() {
816
918
  return `
817
- @media (max-width: ${S("medium")}px) {
919
+ @media (max-width: ${x("medium")}px) {
818
920
  .${e.builderBlock.id}-breakpoints {
819
921
  flex-direction: var(--flex-dir-tablet);
820
922
  align-items: stretch;
@@ -826,7 +928,7 @@ function nt(e) {
826
928
  }
827
929
  }
828
930
 
829
- @media (max-width: ${S("small")}px) {
931
+ @media (max-width: ${x("small")}px) {
830
932
  .${e.builderBlock.id}-breakpoints {
831
933
  flex-direction: var(--flex-dir);
832
934
  align-items: stretch;
@@ -839,116 +941,116 @@ function nt(e) {
839
941
  },
840
942
  `;
841
943
  }
842
- return /* @__PURE__ */ E(f, { children: [
843
- /* @__PURE__ */ E(
944
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
945
+ /* @__PURE__ */ jsxs(
844
946
  "div",
845
947
  {
846
- className: `builder-columns ${e.builderBlock.id}-breakpoints div-d734ad62`,
847
- style: k(),
948
+ className: `builder-columns ${e.builderBlock.id}-breakpoints div-ac8f4142`,
949
+ style: b(),
848
950
  children: [
849
- /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(H, { styles: p() }) }),
850
- (C = e.columns) == null ? void 0 : C.map((g, R) => /* @__PURE__ */ Re(
951
+ /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: v() }) }),
952
+ (C = e.columns) == null ? void 0 : C.map((S, E) => /* @__PURE__ */ createElement(
851
953
  "div",
852
954
  {
853
- className: "builder-column div-d734ad62-2",
854
- style: h(R),
855
- key: R
955
+ className: "builder-column div-ac8f4142-2",
956
+ style: d(E),
957
+ key: E
856
958
  },
857
- /* @__PURE__ */ l(
858
- ne,
959
+ /* @__PURE__ */ jsx(
960
+ Blocks,
859
961
  {
860
- path: `component.options.columns.${R}.blocks`,
962
+ path: `component.options.columns.${E}.blocks`,
861
963
  parent: e.builderBlock.id,
862
964
  styleProp: {
863
965
  flexGrow: "1"
864
966
  },
865
967
  context: e.builderContext,
866
968
  registeredComponents: e.builderComponents,
867
- blocks: g.blocks
969
+ blocks: S.blocks
868
970
  }
869
971
  )
870
972
  ))
871
973
  ]
872
974
  }
873
975
  ),
874
- /* @__PURE__ */ l("style", { children: `.div-d734ad62 {
976
+ /* @__PURE__ */ jsx("style", { children: `.div-ac8f4142 {
875
977
  display: flex;
876
978
  line-height: normal;
877
- }.div-d734ad62-2 {
979
+ }.div-ac8f4142-2 {
878
980
  display: flex;
879
981
  flex-direction: column;
880
982
  align-items: stretch;
881
983
  }` })
882
984
  ] });
883
985
  }
884
- function it(e) {
885
- return /* @__PURE__ */ l("span", { children: e.children });
986
+ function FragmentComponent(e) {
987
+ return /* @__PURE__ */ jsx("span", { children: e.children });
886
988
  }
887
- function de(e) {
989
+ function removeProtocol(e) {
888
990
  return e.replace(/http(s)?:/, "");
889
991
  }
890
- function at(e = "", t, n) {
891
- const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), a = e.indexOf("?") !== -1 ? "&" : "?";
892
- return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + a + t + "=" + encodeURIComponent(n);
992
+ function updateQueryParam(e = "", t, n) {
993
+ const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
994
+ return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
893
995
  }
894
- function ot(e, t) {
996
+ function getShopifyImageUrl(e, t) {
895
997
  if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
896
998
  return e;
897
999
  if (t === "master")
898
- return de(e);
1000
+ return removeProtocol(e);
899
1001
  const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
900
1002
  if (n) {
901
- const i = e.split(n[0]), a = n[3], o = t.match("x") ? t : `${t}x`;
902
- return de(`${i[0]}_${o}${a}`);
1003
+ const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
1004
+ return removeProtocol(`${i[0]}_${a}${o}`);
903
1005
  }
904
1006
  return null;
905
1007
  }
906
- function J(e) {
1008
+ function getSrcSet(e) {
907
1009
  if (!e)
908
1010
  return e;
909
1011
  const t = [100, 200, 400, 800, 1200, 1600, 2e3];
910
1012
  if (e.match(/builder\.io/)) {
911
1013
  let n = e;
912
1014
  const i = Number(e.split("?width=")[1]);
913
- return isNaN(i) || (n = `${n} ${i}w`), t.filter((a) => a !== i).map((a) => `${at(e, "width", a)} ${a}w`).concat([n]).join(", ");
1015
+ return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${updateQueryParam(e, "width", o)} ${o}w`).concat([n]).join(", ");
914
1016
  }
915
- return e.match(/cdn\.shopify\.com/) ? t.map((n) => [ot(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
1017
+ return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
916
1018
  }
917
- function rt(e) {
918
- var a, o, r, d;
1019
+ function Image(e) {
1020
+ var o, a, r, l;
919
1021
  function t() {
920
1022
  var u;
921
- const s = e.image || e.src;
922
- if (!s || // We can auto add srcset for cdn.builder.io and shopify
1023
+ const c = e.image || e.src;
1024
+ if (!c || // We can auto add srcset for cdn.builder.io and shopify
923
1025
  // images, otherwise you can supply this prop manually
924
- !(s.match(/builder\.io/) || s.match(/cdn\.shopify\.com/)))
1026
+ !(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
925
1027
  return e.srcset;
926
1028
  if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
927
1029
  if (!e.srcset.includes(e.image.split("?")[0]))
928
- return console.debug("Removed given srcset"), J(s);
1030
+ return console.debug("Removed given srcset"), getSrcSet(c);
929
1031
  } else if (e.image && !e.srcset)
930
- return J(s);
931
- return J(s);
1032
+ return getSrcSet(c);
1033
+ return getSrcSet(c);
932
1034
  }
933
1035
  function n() {
934
- var c;
935
- return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1036
+ var s;
1037
+ return (s = t == null ? void 0 : t()) != null && s.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
936
1038
  }
937
1039
  function i() {
938
- const c = {
1040
+ const s = {
939
1041
  position: "absolute",
940
1042
  height: "100%",
941
1043
  width: "100%",
942
1044
  left: "0px",
943
1045
  top: "0px"
944
1046
  };
945
- return e.aspectRatio ? c : void 0;
1047
+ return e.aspectRatio ? s : void 0;
946
1048
  }
947
- return /* @__PURE__ */ E(f, { children: [
948
- /* @__PURE__ */ E(f, { children: [
949
- /* @__PURE__ */ E("picture", { children: [
950
- n() ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l("source", { type: "image/webp", srcSet: n() }) }) : null,
951
- /* @__PURE__ */ l(
1049
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1050
+ /* @__PURE__ */ jsxs(Fragment, { children: [
1051
+ /* @__PURE__ */ jsxs("picture", { children: [
1052
+ n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("source", { type: "image/webp", srcSet: n() }) }) : null,
1053
+ /* @__PURE__ */ jsx(
952
1054
  "img",
953
1055
  {
954
1056
  loading: "lazy",
@@ -959,33 +1061,33 @@ function rt(e) {
959
1061
  objectFit: e.backgroundSize || "cover",
960
1062
  ...i()
961
1063
  },
962
- className: "builder-image" + (e.className ? " " + e.className : "") + " img-ef11a6be",
1064
+ className: "builder-image" + (e.className ? " " + e.className : "") + " img-497e0136",
963
1065
  src: e.image,
964
1066
  srcSet: t(),
965
1067
  sizes: e.sizes
966
1068
  }
967
1069
  )
968
1070
  ] }),
969
- e.aspectRatio && !((o = (a = e.builderBlock) == null ? void 0 : a.children) != null && o.length && e.fitContent) ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
1071
+ e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
970
1072
  "div",
971
1073
  {
972
- className: "builder-image-sizer div-ef11a6be",
1074
+ className: "builder-image-sizer div-497e0136",
973
1075
  style: {
974
1076
  paddingTop: e.aspectRatio * 100 + "%"
975
1077
  }
976
1078
  }
977
1079
  ) }) : null,
978
- (d = (r = e.builderBlock) == null ? void 0 : r.children) != null && d.length && e.fitContent ? /* @__PURE__ */ l(f, { children: e.children }) : null,
979
- !e.fitContent && e.children ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l("div", { className: "div-ef11a6be-2", children: e.children }) }) : null
1080
+ (l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
1081
+ !e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-497e0136-2", children: e.children }) }) : null
980
1082
  ] }),
981
- /* @__PURE__ */ l("style", { children: `.img-ef11a6be {
1083
+ /* @__PURE__ */ jsx("style", { children: `.img-497e0136 {
982
1084
  opacity: 1;
983
1085
  transition: opacity 0.2s ease-in-out;
984
- }.div-ef11a6be {
1086
+ }.div-497e0136 {
985
1087
  width: 100%;
986
1088
  pointer-events: none;
987
1089
  font-size: 0;
988
- }.div-ef11a6be-2 {
1090
+ }.div-497e0136-2 {
989
1091
  display: flex;
990
1092
  flex-direction: column;
991
1093
  align-items: stretch;
@@ -997,8 +1099,8 @@ function rt(e) {
997
1099
  }` })
998
1100
  ] });
999
1101
  }
1000
- function lt(e) {
1001
- return /* @__PURE__ */ l(
1102
+ function SectionComponent(e) {
1103
+ return /* @__PURE__ */ jsx(
1002
1104
  "section",
1003
1105
  {
1004
1106
  ...e.attributes,
@@ -1018,98 +1120,98 @@ function lt(e) {
1018
1120
  }
1019
1121
  );
1020
1122
  }
1021
- const L = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1123
+ const getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1022
1124
  ...t,
1023
1125
  testVariationId: t.id,
1024
1126
  id: e == null ? void 0 : e.id
1025
- })), ct = ({
1127
+ })), checkShouldRunVariants = ({
1026
1128
  canTrack: e,
1027
1129
  content: t
1028
- }) => !(!(L(t).length > 0) || !e || F());
1029
- function st(e, t, n) {
1130
+ }) => !(!(getVariants(t).length > 0) || !e || isBrowser());
1131
+ function bldrAbTest(e, t, n) {
1030
1132
  var r;
1031
1133
  function i() {
1032
- function d(h, S, p) {
1134
+ function l(d, x, v) {
1033
1135
  let C = "";
1034
- if (p) {
1035
- const g = /* @__PURE__ */ new Date();
1036
- g.setTime(g.getTime() + p * 24 * 60 * 60 * 1e3), C = "; expires=" + g.toUTCString();
1136
+ if (v) {
1137
+ const S = /* @__PURE__ */ new Date();
1138
+ S.setTime(S.getTime() + v * 24 * 60 * 60 * 1e3), C = "; expires=" + S.toUTCString();
1037
1139
  }
1038
- document.cookie = h + "=" + (S || "") + C + "; path=/; Secure; SameSite=None";
1140
+ document.cookie = d + "=" + (x || "") + C + "; path=/; Secure; SameSite=None";
1039
1141
  }
1040
- function c(h) {
1041
- const S = h + "=", p = document.cookie.split(";");
1042
- for (let C = 0; C < p.length; C++) {
1043
- let g = p[C];
1044
- for (; g.charAt(0) === " "; )
1045
- g = g.substring(1, g.length);
1046
- if (g.indexOf(S) === 0)
1047
- return g.substring(S.length, g.length);
1142
+ function s(d) {
1143
+ const x = d + "=", v = document.cookie.split(";");
1144
+ for (let C = 0; C < v.length; C++) {
1145
+ let S = v[C];
1146
+ for (; S.charAt(0) === " "; )
1147
+ S = S.substring(1, S.length);
1148
+ if (S.indexOf(x) === 0)
1149
+ return S.substring(x.length, S.length);
1048
1150
  }
1049
1151
  return null;
1050
1152
  }
1051
- const s = `builder.tests.${e}`, u = c(s), m = t.map((h) => h.id).concat(e);
1052
- if (u && m.includes(u))
1153
+ const c = `builder.tests.${e}`, u = s(c), f = t.map((d) => d.id).concat(e);
1154
+ if (u && f.includes(u))
1053
1155
  return u;
1054
- let y = 0;
1055
- const k = Math.random();
1056
- for (let h = 0; h < t.length; h++) {
1057
- const S = t[h], p = S.testRatio;
1058
- if (y += p, k < y)
1059
- return d(s, S.id), S.id;
1156
+ let h = 0;
1157
+ const b = Math.random();
1158
+ for (let d = 0; d < t.length; d++) {
1159
+ const x = t[d], v = x.testRatio;
1160
+ if (h += v, b < h)
1161
+ return l(c, x.id), x.id;
1060
1162
  }
1061
- return d(s, e), e;
1163
+ return l(c, e), e;
1062
1164
  }
1063
- const a = i(), o = (r = document.currentScript) == null ? void 0 : r.previousElementSibling;
1165
+ const o = i(), a = (r = document.currentScript) == null ? void 0 : r.previousElementSibling;
1064
1166
  if (n) {
1065
- o.remove();
1066
- const d = document.currentScript;
1067
- d == null || d.remove();
1167
+ a.remove();
1168
+ const l = document.currentScript;
1169
+ l == null || l.remove();
1068
1170
  } else {
1069
- const d = t.concat({
1171
+ const l = t.concat({
1070
1172
  id: e
1071
- }).filter((c) => c.id !== a).map((c) => `.variant-${c.id} { display: none; }
1173
+ }).filter((s) => s.id !== o).map((s) => `.variant-${s.id} { display: none; }
1072
1174
  `).join("");
1073
- o.innerHTML = d;
1175
+ a.innerHTML = l;
1074
1176
  }
1075
1177
  }
1076
- function dt(e, t, n) {
1077
- var c;
1178
+ function bldrCntntScrpt(e, t, n) {
1179
+ var s;
1078
1180
  if (!navigator.cookieEnabled)
1079
1181
  return;
1080
- function i(s) {
1081
- const u = s + "=", m = document.cookie.split(";");
1082
- for (let y = 0; y < m.length; y++) {
1083
- let k = m[y];
1084
- for (; k.charAt(0) === " "; )
1085
- k = k.substring(1, k.length);
1086
- if (k.indexOf(u) === 0)
1087
- return k.substring(u.length, k.length);
1182
+ function i(c) {
1183
+ const u = c + "=", f = document.cookie.split(";");
1184
+ for (let h = 0; h < f.length; h++) {
1185
+ let b = f[h];
1186
+ for (; b.charAt(0) === " "; )
1187
+ b = b.substring(1, b.length);
1188
+ if (b.indexOf(u) === 0)
1189
+ return b.substring(u.length, b.length);
1088
1190
  }
1089
1191
  return null;
1090
1192
  }
1091
- const a = `builder.tests.${t}`, o = i(a), r = (c = document.currentScript) == null ? void 0 : c.parentElement, d = e === t;
1092
- if (o === e) {
1093
- if (d)
1193
+ const o = `builder.tests.${t}`, a = i(o), r = (s = document.currentScript) == null ? void 0 : s.parentElement, l = e === t;
1194
+ if (a === e) {
1195
+ if (l)
1094
1196
  return;
1095
1197
  r == null || r.removeAttribute("hidden"), r == null || r.removeAttribute("aria-hidden");
1096
1198
  } else {
1097
- d && (n ? r == null || r.remove() : (r == null || r.setAttribute("hidden", "true"), r == null || r.setAttribute("aria-hidden", "true")));
1199
+ l && (n ? r == null || r.remove() : (r == null || r.setAttribute("hidden", "true"), r == null || r.setAttribute("aria-hidden", "true")));
1098
1200
  return;
1099
1201
  }
1100
1202
  }
1101
- const ut = (e) => e === "react" || e === "reactNative", pe = ut(M), Ce = "builderIoAbTest", we = "builderIoRenderContent", mt = () => {
1102
- const e = st.toString().replace(/\s+/g, " "), t = dt.toString().replace(/\s+/g, " ");
1203
+ const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), AB_TEST_FN_NAME = "builderIoAbTest", CONTENT_FN_NAME = "builderIoRenderContent", getScriptString = () => {
1204
+ const e = bldrAbTest.toString().replace(/\s+/g, " "), t = bldrCntntScrpt.toString().replace(/\s+/g, " ");
1103
1205
  return `
1104
- window.${Ce} = ${e}
1105
- window.${we} = ${t}
1206
+ window.${AB_TEST_FN_NAME} = ${e}
1207
+ window.${CONTENT_FN_NAME} = ${t}
1106
1208
  `;
1107
- }, ft = (e, t) => `
1108
- window.${Ce}("${t}",${JSON.stringify(e)}, ${pe})`, ht = ({
1209
+ }, getVariantsScriptString = (e, t) => `
1210
+ window.${AB_TEST_FN_NAME}("${t}",${JSON.stringify(e)}, ${isHydrationTarget})`, getRenderContentScriptString = ({
1109
1211
  contentId: e,
1110
1212
  variationId: t
1111
1213
  }) => `
1112
- window.${we}("${t}", "${e}", ${pe})`, gt = {
1214
+ window.${CONTENT_FN_NAME}("${t}", "${e}", ${isHydrationTarget})`, componentInfo$a = {
1113
1215
  name: "Core:Button",
1114
1216
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1115
1217
  defaultStyles: {
@@ -1142,7 +1244,7 @@ const ut = (e) => e === "react" || e === "reactNative", pe = ut(M), Ce = "builde
1142
1244
  }],
1143
1245
  static: !0,
1144
1246
  noWrap: !0
1145
- }, bt = {
1247
+ }, componentInfo$9 = {
1146
1248
  // TODO: ways to statically preprocess JSON for references, functions, etc
1147
1249
  name: "Columns",
1148
1250
  isRSC: !0,
@@ -1321,7 +1423,7 @@ const ut = (e) => e === "react" || e === "reactNative", pe = ut(M), Ce = "builde
1321
1423
  });
1322
1424
  }
1323
1425
  const n = e.get("columns");
1324
- Array.isArray(n) && n.find((a) => a.get("width")) && (n.find((o) => !o.get("width")) || n.reduce((d, c) => d + c.get("width"), 0) !== 100) && t();
1426
+ Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((l, s) => l + s.get("width"), 0) !== 100) && t();
1325
1427
  }
1326
1428
  }, {
1327
1429
  name: "space",
@@ -1343,13 +1445,13 @@ const ut = (e) => e === "react" || e === "reactNative", pe = ut(M), Ce = "builde
1343
1445
  helperText: "When stacking columns for mobile devices, reverse the ordering",
1344
1446
  advanced: !0
1345
1447
  }]
1346
- }, xt = {
1448
+ }, componentInfo$8 = {
1347
1449
  name: "Fragment",
1348
1450
  static: !0,
1349
1451
  hidden: !0,
1350
1452
  canHaveChildren: !0,
1351
1453
  noWrap: !0
1352
- }, yt = {
1454
+ }, componentInfo$7 = {
1353
1455
  name: "Image",
1354
1456
  static: !0,
1355
1457
  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",
@@ -1369,29 +1471,29 @@ const ut = (e) => e === "react" || e === "reactNative", pe = ut(M), Ce = "builde
1369
1471
  defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1370
1472
  onChange: (e) => {
1371
1473
  e.delete("srcset"), e.delete("noWebp");
1372
- function n(r, d = 6e4) {
1373
- return new Promise((c, s) => {
1474
+ function n(r, l = 6e4) {
1475
+ return new Promise((s, c) => {
1374
1476
  const u = document.createElement("img");
1375
- let m = !1;
1477
+ let f = !1;
1376
1478
  u.onload = () => {
1377
- m = !0, c(u);
1378
- }, u.addEventListener("error", (y) => {
1379
- console.warn("Image load failed", y.error), s(y.error);
1479
+ f = !0, s(u);
1480
+ }, u.addEventListener("error", (h) => {
1481
+ console.warn("Image load failed", h.error), c(h.error);
1380
1482
  }), u.src = r, setTimeout(() => {
1381
- m || s(new Error("Image load timed out"));
1382
- }, d);
1483
+ f || c(new Error("Image load timed out"));
1484
+ }, l);
1383
1485
  });
1384
1486
  }
1385
1487
  function i(r) {
1386
1488
  return Math.round(r * 1e3) / 1e3;
1387
1489
  }
1388
- const a = e.get("image"), o = e.get("aspectRatio");
1389
- if (fetch(a).then((r) => r.blob()).then((r) => {
1490
+ const o = e.get("image"), a = e.get("aspectRatio");
1491
+ if (fetch(o).then((r) => r.blob()).then((r) => {
1390
1492
  r.type.includes("svg") && e.set("noWebp", !0);
1391
- }), a && (!o || o === 0.7041))
1392
- return n(a).then((r) => {
1393
- const d = e.get("aspectRatio");
1394
- e.get("image") === a && (!d || d === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
1493
+ }), o && (!a || a === 0.7041))
1494
+ return n(o).then((r) => {
1495
+ const l = e.get("aspectRatio");
1496
+ e.get("image") === o && (!l || l === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
1395
1497
  });
1396
1498
  }
1397
1499
  }, {
@@ -1449,7 +1551,7 @@ const ut = (e) => e === "react" || e === "reactNative", pe = ut(M), Ce = "builde
1449
1551
  advanced: !0,
1450
1552
  defaultValue: 0.7041
1451
1553
  }]
1452
- }, St = {
1554
+ }, componentInfo$6 = {
1453
1555
  name: "Core:Section",
1454
1556
  static: !0,
1455
1557
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -1488,7 +1590,7 @@ const ut = (e) => e === "react" || e === "reactNative", pe = ut(M), Ce = "builde
1488
1590
  }
1489
1591
  }
1490
1592
  }]
1491
- }, vt = {
1593
+ }, componentInfo$5 = {
1492
1594
  name: "Symbol",
1493
1595
  noWrap: !0,
1494
1596
  static: !0,
@@ -1521,7 +1623,7 @@ const ut = (e) => e === "react" || e === "reactNative", pe = ut(M), Ce = "builde
1521
1623
  hideFromUI: !0,
1522
1624
  type: "boolean"
1523
1625
  }]
1524
- }, kt = {
1626
+ }, componentInfo$4 = {
1525
1627
  name: "Text",
1526
1628
  static: !0,
1527
1629
  isRSC: !0,
@@ -1540,9 +1642,9 @@ const ut = (e) => e === "react" || e === "reactNative", pe = ut(M), Ce = "builde
1540
1642
  textAlign: "center"
1541
1643
  }
1542
1644
  };
1543
- function pt(e) {
1645
+ function Text(e) {
1544
1646
  var t;
1545
- return /* @__PURE__ */ l(
1647
+ return /* @__PURE__ */ jsx(
1546
1648
  "div",
1547
1649
  {
1548
1650
  className: "builder-text",
@@ -1553,7 +1655,7 @@ function pt(e) {
1553
1655
  }
1554
1656
  );
1555
1657
  }
1556
- const Ct = {
1658
+ const componentInfo$3 = {
1557
1659
  name: "Video",
1558
1660
  canHaveChildren: !0,
1559
1661
  defaultStyles: {
@@ -1635,7 +1737,7 @@ const Ct = {
1635
1737
  advanced: !0
1636
1738
  }]
1637
1739
  };
1638
- function wt(e) {
1740
+ function Video(e) {
1639
1741
  var i;
1640
1742
  function t() {
1641
1743
  return {
@@ -1662,7 +1764,7 @@ function wt(e) {
1662
1764
  ...t()
1663
1765
  };
1664
1766
  }
1665
- return /* @__PURE__ */ l(
1767
+ return /* @__PURE__ */ jsx(
1666
1768
  "video",
1667
1769
  {
1668
1770
  ...n(),
@@ -1682,7 +1784,7 @@ function wt(e) {
1682
1784
  }
1683
1785
  );
1684
1786
  }
1685
- const It = {
1787
+ const componentInfo$2 = {
1686
1788
  name: "Embed",
1687
1789
  static: !0,
1688
1790
  inputs: [{
@@ -1707,30 +1809,30 @@ const It = {
1707
1809
  defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1708
1810
  hideFromUI: !0
1709
1811
  }]
1710
- }, Tt = ["text/javascript", "application/javascript", "application/ecmascript"], Rt = (e) => Tt.includes(e.type);
1711
- function Et(e) {
1712
- const t = X(null), [n, i] = I(() => []), [a, o] = I(() => []), [r, d] = I(() => !1);
1713
- function c() {
1812
+ }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
1813
+ function Embed(e) {
1814
+ const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, l] = useState(() => !1);
1815
+ function s() {
1714
1816
  if (!t.current || !t.current.getElementsByTagName)
1715
1817
  return;
1716
- const s = t.current.getElementsByTagName("script");
1717
- for (let u = 0; u < s.length; u++) {
1718
- const m = s[u];
1719
- if (m.src && !n.includes(m.src)) {
1720
- n.push(m.src);
1721
- const y = document.createElement("script");
1722
- y.async = !0, y.src = m.src, document.head.appendChild(y);
1723
- } else if (Rt(m) && !a.includes(m.innerText))
1818
+ const c = t.current.getElementsByTagName("script");
1819
+ for (let u = 0; u < c.length; u++) {
1820
+ const f = c[u];
1821
+ if (f.src && !n.includes(f.src)) {
1822
+ n.push(f.src);
1823
+ const h = document.createElement("script");
1824
+ h.async = !0, h.src = f.src, document.head.appendChild(h);
1825
+ } else if (isJsScript(f) && !o.includes(f.innerText))
1724
1826
  try {
1725
- a.push(m.innerText), new Function(m.innerText)();
1726
- } catch (y) {
1727
- console.warn("`Embed`: Error running script:", y);
1827
+ o.push(f.innerText), new Function(f.innerText)();
1828
+ } catch (h) {
1829
+ console.warn("`Embed`: Error running script:", h);
1728
1830
  }
1729
1831
  }
1730
1832
  }
1731
- return P(() => {
1732
- t.current && !r && (d(!0), c());
1733
- }, [t.current, r]), /* @__PURE__ */ l(
1833
+ return useEffect(() => {
1834
+ t.current && !r && (l(!0), s());
1835
+ }, [t.current, r]), /* @__PURE__ */ jsx(
1734
1836
  "div",
1735
1837
  {
1736
1838
  className: "builder-embed",
@@ -1739,8 +1841,8 @@ function Et(e) {
1739
1841
  }
1740
1842
  );
1741
1843
  }
1742
- function $t(e) {
1743
- return /* @__PURE__ */ l(
1844
+ function ImgComponent(e) {
1845
+ return /* @__PURE__ */ jsx(
1744
1846
  "img",
1745
1847
  {
1746
1848
  style: {
@@ -1751,10 +1853,10 @@ function $t(e) {
1751
1853
  src: e.imgSrc || e.image,
1752
1854
  ...e.attributes
1753
1855
  },
1754
- V() && e.imgSrc || "default-key"
1856
+ isEditing() && e.imgSrc || "default-key"
1755
1857
  );
1756
1858
  }
1757
- const Pt = {
1859
+ const componentInfo$1 = {
1758
1860
  // friendlyName?
1759
1861
  name: "Raw:Img",
1760
1862
  hideFromInsertMenu: !0,
@@ -1769,38 +1871,36 @@ const Pt = {
1769
1871
  noWrap: !0,
1770
1872
  static: !0
1771
1873
  };
1772
- function At(e) {
1773
- const t = X(null), [n, i] = I(() => []), [a, o] = I(() => []);
1774
- function r() {
1775
- if (t.current && t.current.getElementsByTagName && typeof window < "u") {
1776
- const d = t.current.getElementsByTagName("script");
1777
- for (let c = 0; c < d.length; c++) {
1778
- const s = d[c];
1779
- if (s.src) {
1780
- if (n.includes(s.src))
1781
- continue;
1782
- n.push(s.src);
1783
- const u = document.createElement("script");
1784
- u.async = !0, u.src = s.src, document.head.appendChild(u);
1785
- } else if (!s.type || [
1786
- "text/javascript",
1787
- "application/javascript",
1788
- "application/ecmascript"
1789
- ].includes(s.type)) {
1790
- if (a.includes(s.innerText))
1791
- continue;
1792
- try {
1793
- a.push(s.innerText), new Function(s.innerText)();
1794
- } catch (u) {
1795
- console.warn("`CustomCode`: Error running script:", u);
1796
- }
1874
+ function CustomCode(e) {
1875
+ const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
1876
+ return useEffect(() => {
1877
+ var l;
1878
+ if (!((l = t.current) != null && l.getElementsByTagName) || typeof window > "u")
1879
+ return;
1880
+ const r = t.current.getElementsByTagName("script");
1881
+ for (let s = 0; s < r.length; s++) {
1882
+ const c = r[s];
1883
+ if (c.src) {
1884
+ if (n.includes(c.src))
1885
+ continue;
1886
+ n.push(c.src);
1887
+ const u = document.createElement("script");
1888
+ u.async = !0, u.src = c.src, document.head.appendChild(u);
1889
+ } else if (!c.type || [
1890
+ "text/javascript",
1891
+ "application/javascript",
1892
+ "application/ecmascript"
1893
+ ].includes(c.type)) {
1894
+ if (o.includes(c.innerText))
1895
+ continue;
1896
+ try {
1897
+ o.push(c.innerText), new Function(c.innerText)();
1898
+ } catch (u) {
1899
+ console.warn("`CustomCode`: Error running script:", u);
1797
1900
  }
1798
1901
  }
1799
1902
  }
1800
- }
1801
- return P(() => {
1802
- r();
1803
- }, []), /* @__PURE__ */ l(
1903
+ }, []), /* @__PURE__ */ jsx(
1804
1904
  "div",
1805
1905
  {
1806
1906
  ref: t,
@@ -1809,7 +1909,7 @@ function At(e) {
1809
1909
  }
1810
1910
  );
1811
1911
  }
1812
- const Bt = {
1912
+ const componentInfo = {
1813
1913
  name: "Custom Code",
1814
1914
  static: !0,
1815
1915
  requiredPermissions: ["editCode"],
@@ -1831,44 +1931,44 @@ const Bt = {
1831
1931
  helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1832
1932
  advanced: !0
1833
1933
  }]
1834
- }, ue = () => [{
1835
- component: Fe,
1836
- ...gt
1934
+ }, getDefaultRegisteredComponents = () => [{
1935
+ component: Button,
1936
+ ...componentInfo$a
1837
1937
  }, {
1838
- component: nt,
1839
- ...bt
1938
+ component: Columns,
1939
+ ...componentInfo$9
1840
1940
  }, {
1841
- component: At,
1842
- ...Bt
1941
+ component: CustomCode,
1942
+ ...componentInfo
1843
1943
  }, {
1844
- component: Et,
1845
- ...It
1944
+ component: Embed,
1945
+ ...componentInfo$2
1846
1946
  }, {
1847
- component: it,
1848
- ...xt
1947
+ component: FragmentComponent,
1948
+ ...componentInfo$8
1849
1949
  }, {
1850
- component: rt,
1851
- ...yt
1950
+ component: Image,
1951
+ ...componentInfo$7
1852
1952
  }, {
1853
- component: $t,
1854
- ...Pt
1953
+ component: ImgComponent,
1954
+ ...componentInfo$1
1855
1955
  }, {
1856
- component: lt,
1857
- ...St
1956
+ component: SectionComponent,
1957
+ ...componentInfo$6
1858
1958
  }, {
1859
- component: Dt,
1860
- ...vt
1959
+ component: Symbol$1,
1960
+ ...componentInfo$5
1861
1961
  }, {
1862
- component: pt,
1863
- ...kt
1962
+ component: Text,
1963
+ ...componentInfo$4
1864
1964
  }, {
1865
- component: wt,
1866
- ...Ct
1867
- }], Vt = (e) => {
1868
- var o;
1869
- const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = e.fileUrl ?? ((o = e == null ? void 0 : e.files) == null ? void 0 : o.regular);
1870
- let a = "";
1871
- if (i && t && n && (a += `
1965
+ component: Video,
1966
+ ...componentInfo$3
1967
+ }], getCssFromFont = (e) => {
1968
+ var a;
1969
+ const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = e.fileUrl ?? ((a = e == null ? void 0 : e.files) == null ? void 0 : a.regular);
1970
+ let o = "";
1971
+ if (i && t && n && (o += `
1872
1972
  @font-face {
1873
1973
  font-family: "${t}";
1874
1974
  src: local("${n}"), url('${i}') format('woff2');
@@ -1879,34 +1979,34 @@ font-weight: 400;
1879
1979
  for (const r in e.files) {
1880
1980
  if (!(String(Number(r)) === r))
1881
1981
  continue;
1882
- const c = e.files[r];
1883
- c && c !== i && (a += `
1982
+ const s = e.files[r];
1983
+ s && s !== i && (o += `
1884
1984
  @font-face {
1885
1985
  font-family: "${t}";
1886
- src: url('${c}') format('woff2');
1986
+ src: url('${s}') format('woff2');
1887
1987
  font-display: fallback;
1888
1988
  font-weight: ${r};
1889
1989
  }
1890
1990
  `.trim());
1891
1991
  }
1892
- return a;
1893
- }, Ft = ({
1992
+ return o;
1993
+ }, getFontCss = ({
1894
1994
  customFonts: e
1895
1995
  }) => {
1896
1996
  var t;
1897
- return ((t = e == null ? void 0 : e.map((n) => Vt(n))) == null ? void 0 : t.join(" ")) || "";
1898
- }, Nt = ({
1997
+ return ((t = e == null ? void 0 : e.map((n) => getCssFromFont(n))) == null ? void 0 : t.join(" ")) || "";
1998
+ }, getCss = ({
1899
1999
  cssCode: e,
1900
2000
  contentId: t
1901
2001
  }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
1902
- function Wt(e) {
1903
- const [t, n] = I(
2002
+ function ContentStyles(e) {
2003
+ const [t, n] = useState(
1904
2004
  () => `
1905
- ${Nt({
2005
+ ${getCss({
1906
2006
  cssCode: e.cssCode,
1907
2007
  contentId: e.contentId
1908
2008
  })}
1909
- ${Ft({
2009
+ ${getFontCss({
1910
2010
  customFonts: e.customFonts
1911
2011
  })}
1912
2012
 
@@ -1924,21 +2024,21 @@ ${Ft({
1924
2024
  }
1925
2025
  `.trim()
1926
2026
  );
1927
- return /* @__PURE__ */ l(H, { styles: t });
2027
+ return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
1928
2028
  }
1929
- const jt = ({
2029
+ const getContextStateInitialValue = ({
1930
2030
  content: e,
1931
2031
  data: t,
1932
2032
  locale: n
1933
2033
  }) => {
1934
- var o, r, d;
2034
+ var a, r, l;
1935
2035
  const i = {};
1936
- (r = (o = e == null ? void 0 : e.data) == null ? void 0 : o.inputs) == null || r.forEach((c) => {
1937
- var s;
1938
- c.name && c.defaultValue !== void 0 && ((s = e == null ? void 0 : e.data) != null && s.state) && e.data.state[c.name] === void 0 && (i[c.name] = c.defaultValue);
2036
+ (r = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || r.forEach((s) => {
2037
+ var c;
2038
+ s.name && s.defaultValue !== void 0 && ((c = e == null ? void 0 : e.data) != null && c.state) && e.data.state[s.name] === void 0 && (i[s.name] = s.defaultValue);
1939
2039
  });
1940
- const a = {
1941
- ...(d = e == null ? void 0 : e.data) == null ? void 0 : d.state,
2040
+ const o = {
2041
+ ...(l = e == null ? void 0 : e.data) == null ? void 0 : l.state,
1942
2042
  ...t,
1943
2043
  ...n ? {
1944
2044
  locale: n
@@ -1946,9 +2046,9 @@ const jt = ({
1946
2046
  };
1947
2047
  return {
1948
2048
  ...i,
1949
- ...a
2049
+ ...o
1950
2050
  };
1951
- }, Mt = ({
2051
+ }, getContentInitialValue = ({
1952
2052
  content: e,
1953
2053
  data: t
1954
2054
  }) => e ? {
@@ -1958,8 +2058,8 @@ const jt = ({
1958
2058
  ...t
1959
2059
  },
1960
2060
  meta: e == null ? void 0 : e.meta
1961
- } : void 0, Lt = "0.7.0", Ut = () => {
1962
- $e("insertMenu", {
2061
+ } : void 0, SDK_VERSION = "0.7.1-1", registerInsertMenu = () => {
2062
+ register("insertMenu", {
1963
2063
  name: "_default",
1964
2064
  default: !0,
1965
2065
  items: [{
@@ -1981,14 +2081,14 @@ const jt = ({
1981
2081
  }]
1982
2082
  });
1983
2083
  };
1984
- let me = !1;
1985
- const _t = (e = {}) => {
2084
+ let isSetupForEditing = !1;
2085
+ const setupBrowserForEditing = (e = {}) => {
1986
2086
  var t, n;
1987
- me || (me = !0, F() && ((t = window.parent) == null || t.postMessage({
2087
+ isSetupForEditing || (isSetupForEditing = !0, isBrowser() && ((t = window.parent) == null || t.postMessage({
1988
2088
  type: "builder.sdkInfo",
1989
2089
  data: {
1990
- target: M,
1991
- version: Lt,
2090
+ target: TARGET,
2091
+ version: SDK_VERSION,
1992
2092
  supportsPatchUpdates: !1,
1993
2093
  // Supports builder-model="..." attribute which is needed to
1994
2094
  // scope our '+ add block' button styling
@@ -2003,37 +2103,37 @@ const _t = (e = {}) => {
2003
2103
  }, "*"), window.addEventListener("message", ({
2004
2104
  data: i
2005
2105
  }) => {
2006
- var a, o;
2106
+ var o, a;
2007
2107
  if (i != null && i.type)
2008
2108
  switch (i.type) {
2009
2109
  case "builder.evaluate": {
2010
- const r = i.data.text, d = i.data.arguments || [], c = i.data.id, s = new Function(r);
2011
- let u, m = null;
2110
+ const r = i.data.text, l = i.data.arguments || [], s = i.data.id, c = new Function(r);
2111
+ let u, f = null;
2012
2112
  try {
2013
- u = s.apply(null, d);
2014
- } catch (y) {
2015
- m = y;
2113
+ u = c.apply(null, l);
2114
+ } catch (h) {
2115
+ f = h;
2016
2116
  }
2017
- m ? (a = window.parent) == null || a.postMessage({
2117
+ f ? (o = window.parent) == null || o.postMessage({
2018
2118
  type: "builder.evaluateError",
2019
2119
  data: {
2020
- id: c,
2021
- error: m.message
2120
+ id: s,
2121
+ error: f.message
2022
2122
  }
2023
- }, "*") : u && typeof u.then == "function" ? u.then((y) => {
2024
- var k;
2025
- (k = window.parent) == null || k.postMessage({
2123
+ }, "*") : u && typeof u.then == "function" ? u.then((h) => {
2124
+ var b;
2125
+ (b = window.parent) == null || b.postMessage({
2026
2126
  type: "builder.evaluateResult",
2027
2127
  data: {
2028
- id: c,
2029
- result: y
2128
+ id: s,
2129
+ result: h
2030
2130
  }
2031
2131
  }, "*");
2032
- }).catch(console.error) : (o = window.parent) == null || o.postMessage({
2132
+ }).catch(console.error) : (a = window.parent) == null || a.postMessage({
2033
2133
  type: "builder.evaluateResult",
2034
2134
  data: {
2035
2135
  result: u,
2036
- id: c
2136
+ id: s
2037
2137
  }
2038
2138
  }, "*");
2039
2139
  break;
@@ -2041,10 +2141,10 @@ const _t = (e = {}) => {
2041
2141
  }
2042
2142
  })));
2043
2143
  };
2044
- function fe(e) {
2144
+ function round(e) {
2045
2145
  return Math.round(e * 1e3) / 1e3;
2046
2146
  }
2047
- const Kt = (e, t, n = !0) => {
2147
+ const findParentElement = (e, t, n = !0) => {
2048
2148
  if (!(e instanceof HTMLElement))
2049
2149
  return null;
2050
2150
  let i = n ? e : e.parentElement;
@@ -2055,28 +2155,28 @@ const Kt = (e, t, n = !0) => {
2055
2155
  return i;
2056
2156
  } while (i = i.parentElement);
2057
2157
  return null;
2058
- }, Ot = (e) => Kt(e, (t) => {
2158
+ }, findBuilderParent = (e) => findParentElement(e, (t) => {
2059
2159
  const n = t.getAttribute("builder-id") || t.id;
2060
2160
  return (n == null ? void 0 : n.indexOf("builder-")) === 0;
2061
- }), he = ({
2161
+ }), computeOffset = ({
2062
2162
  event: e,
2063
2163
  target: t
2064
2164
  }) => {
2065
- const n = t.getBoundingClientRect(), i = e.clientX - n.left, a = e.clientY - n.top, o = fe(i / n.width), r = fe(a / n.height);
2165
+ const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = round(i / n.width), r = round(o / n.height);
2066
2166
  return {
2067
- x: o,
2167
+ x: a,
2068
2168
  y: r
2069
2169
  };
2070
- }, Ht = (e) => {
2071
- const t = e.target, n = t && Ot(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2170
+ }, getInteractionPropertiesForEvent = (e) => {
2171
+ const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2072
2172
  return {
2073
2173
  targetBuilderElement: i || void 0,
2074
2174
  metadata: {
2075
- targetOffset: t ? he({
2175
+ targetOffset: t ? computeOffset({
2076
2176
  event: e,
2077
2177
  target: t
2078
2178
  }) : void 0,
2079
- builderTargetOffset: n ? he({
2179
+ builderTargetOffset: n ? computeOffset({
2080
2180
  event: e,
2081
2181
  target: n
2082
2182
  }) : void 0,
@@ -2084,89 +2184,89 @@ const Kt = (e, t, n = !0) => {
2084
2184
  }
2085
2185
  };
2086
2186
  };
2087
- function zt(e) {
2088
- var g, R, A, B, N;
2089
- const t = X(null), [n, i] = I(() => 0);
2090
- function a(b) {
2091
- var x, v, T, $, W;
2092
- const w = {
2187
+ function EnableEditor(e) {
2188
+ var I, T, R, j, B;
2189
+ const t = useRef(null), [n, i] = useState(() => 0);
2190
+ function o(m) {
2191
+ var y, p, k, w, F;
2192
+ const g = {
2093
2193
  ...e.builderContextSignal.content,
2094
- ...b,
2194
+ ...m,
2095
2195
  data: {
2096
- ...(x = e.builderContextSignal.content) == null ? void 0 : x.data,
2097
- ...b == null ? void 0 : b.data
2196
+ ...(y = e.builderContextSignal.content) == null ? void 0 : y.data,
2197
+ ...m == null ? void 0 : m.data
2098
2198
  },
2099
2199
  meta: {
2100
- ...(v = e.builderContextSignal.content) == null ? void 0 : v.meta,
2101
- ...b == null ? void 0 : b.meta,
2102
- breakpoints: ((T = b == null ? void 0 : b.meta) == null ? void 0 : T.breakpoints) || ((W = ($ = e.builderContextSignal.content) == null ? void 0 : $.meta) == null ? void 0 : W.breakpoints)
2200
+ ...(p = e.builderContextSignal.content) == null ? void 0 : p.meta,
2201
+ ...m == null ? void 0 : m.meta,
2202
+ breakpoints: ((k = m == null ? void 0 : m.meta) == null ? void 0 : k.breakpoints) || ((F = (w = e.builderContextSignal.content) == null ? void 0 : w.meta) == null ? void 0 : F.breakpoints)
2103
2203
  }
2104
2204
  };
2105
- e.setBuilderContextSignal((Te) => ({
2106
- ...Te,
2107
- content: w
2205
+ e.setBuilderContextSignal((P) => ({
2206
+ ...P,
2207
+ content: g
2108
2208
  }));
2109
2209
  }
2110
- I(() => 0);
2111
- const [o, r] = I(
2210
+ useState(() => 0);
2211
+ const [a, r] = useState(
2112
2212
  () => !1
2113
2213
  );
2114
- function d(b) {
2115
- var x;
2116
- const { data: w } = b;
2117
- if (w)
2118
- switch (w.type) {
2214
+ function l(m) {
2215
+ var y;
2216
+ const { data: g } = m;
2217
+ if (g)
2218
+ switch (g.type) {
2119
2219
  case "builder.configureSdk": {
2120
- const v = w.data, { breakpoints: T, contentId: $ } = v;
2121
- if (!$ || $ !== ((x = e.builderContextSignal.content) == null ? void 0 : x.id))
2220
+ const p = g.data, { breakpoints: k, contentId: w } = p;
2221
+ if (!w || w !== ((y = e.builderContextSignal.content) == null ? void 0 : y.id))
2122
2222
  return;
2123
- T && a({
2223
+ k && o({
2124
2224
  meta: {
2125
- breakpoints: T
2225
+ breakpoints: k
2126
2226
  }
2127
2227
  }), i(n + 1);
2128
2228
  break;
2129
2229
  }
2130
2230
  case "builder.contentUpdate": {
2131
- const v = w.data, T = v.key || v.alias || v.entry || v.modelName, $ = v.data;
2132
- T === e.model && (a($), i(n + 1));
2231
+ const p = g.data, k = p.key || p.alias || p.entry || p.modelName, w = p.data;
2232
+ k === e.model && (o(w), i(n + 1));
2133
2233
  break;
2134
2234
  }
2135
2235
  }
2136
2236
  }
2137
- function c() {
2138
- var w, x;
2139
- const b = (x = (w = e.builderContextSignal.content) == null ? void 0 : w.data) == null ? void 0 : x.jsCode;
2140
- b && j({
2141
- code: b,
2237
+ function s() {
2238
+ var g, y;
2239
+ const m = (y = (g = e.builderContextSignal.content) == null ? void 0 : g.data) == null ? void 0 : y.jsCode;
2240
+ m && evaluate({
2241
+ code: m,
2142
2242
  context: e.context || {},
2143
2243
  localState: void 0,
2144
2244
  rootState: e.builderContextSignal.rootState,
2145
2245
  rootSetState: e.builderContextSignal.rootSetState
2146
2246
  });
2147
2247
  }
2148
- const [s, u] = I(() => ({})), [m, y] = I(() => !1);
2149
- function k(b) {
2150
- var w, x;
2248
+ const [c, u] = useState(() => ({})), [f, h] = useState(() => !1);
2249
+ function b(m) {
2250
+ var g, y;
2151
2251
  if (e.builderContextSignal.content) {
2152
- const v = (w = e.builderContextSignal.content) == null ? void 0 : w.testVariationId, T = (x = e.builderContextSignal.content) == null ? void 0 : x.id;
2153
- ae({
2252
+ const p = (g = e.builderContextSignal.content) == null ? void 0 : g.testVariationId, k = (y = e.builderContextSignal.content) == null ? void 0 : y.id;
2253
+ _track({
2154
2254
  type: "click",
2155
- canTrack: _(e.canTrack),
2156
- contentId: T,
2255
+ canTrack: getDefaultCanTrack(e.canTrack),
2256
+ contentId: k,
2157
2257
  apiKey: e.apiKey,
2158
- variationId: v !== T ? v : void 0,
2159
- ...Ht(b),
2160
- unique: !m
2258
+ variationId: p !== k ? p : void 0,
2259
+ ...getInteractionPropertiesForEvent(m),
2260
+ unique: !f
2161
2261
  });
2162
2262
  }
2163
- m || y(!0);
2263
+ f || h(!0);
2164
2264
  }
2165
- function h(b) {
2166
- return b.replace(
2265
+ function d(m) {
2266
+ return m.replace(
2167
2267
  /{{([^}]+)}}/g,
2168
- (w, x) => j({
2169
- code: x,
2268
+ (g, y) => evaluate({
2269
+ code: y,
2170
2270
  context: e.context || {},
2171
2271
  localState: void 0,
2172
2272
  rootState: e.builderContextSignal.rootState,
@@ -2174,38 +2274,38 @@ function zt(e) {
2174
2274
  })
2175
2275
  );
2176
2276
  }
2177
- function S({ url: b, key: w }) {
2178
- Be(b).then((x) => x.json()).then((x) => {
2179
- var T, $;
2180
- const v = {
2277
+ function x({ url: m, key: g }) {
2278
+ fetch$1(m).then((y) => y.json()).then((y) => {
2279
+ var k, w;
2280
+ const p = {
2181
2281
  ...e.builderContextSignal.rootState,
2182
- [w]: x
2282
+ [g]: y
2183
2283
  };
2184
- ($ = (T = e.builderContextSignal).rootSetState) == null || $.call(T, v), s[w] = !0;
2185
- }).catch((x) => {
2186
- console.error("error fetching dynamic data", b, x);
2284
+ (w = (k = e.builderContextSignal).rootSetState) == null || w.call(k, p), c[g] = !0;
2285
+ }).catch((y) => {
2286
+ console.error("error fetching dynamic data", m, y);
2187
2287
  });
2188
2288
  }
2189
- function p() {
2190
- var w, x;
2191
- const b = ((x = (w = e.builderContextSignal.content) == null ? void 0 : w.data) == null ? void 0 : x.httpRequests) ?? {};
2192
- Object.entries(b).forEach(([v, T]) => {
2193
- if (T && (!s[v] || V())) {
2194
- const $ = h(T);
2195
- S({
2196
- url: $,
2197
- key: v
2289
+ function v() {
2290
+ var g, y;
2291
+ const m = ((y = (g = e.builderContextSignal.content) == null ? void 0 : g.data) == null ? void 0 : y.httpRequests) ?? {};
2292
+ Object.entries(m).forEach(([p, k]) => {
2293
+ if (k && (!c[p] || isEditing())) {
2294
+ const w = d(k);
2295
+ x({
2296
+ url: w,
2297
+ key: p
2198
2298
  });
2199
2299
  }
2200
2300
  });
2201
2301
  }
2202
2302
  function C() {
2203
- V() && window.dispatchEvent(
2303
+ isEditing() && window.dispatchEvent(
2204
2304
  new CustomEvent(
2205
2305
  "builder:component:stateChange",
2206
2306
  {
2207
2307
  detail: {
2208
- state: Z(e.builderContextSignal.rootState),
2308
+ state: fastClone(e.builderContextSignal.rootState),
2209
2309
  ref: {
2210
2310
  name: e.model
2211
2311
  }
@@ -2214,90 +2314,119 @@ function zt(e) {
2214
2314
  )
2215
2315
  );
2216
2316
  }
2217
- return P(() => {
2218
- var b, w;
2219
- if (e.apiKey || U.error(
2220
- "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2221
- ), F()) {
2222
- if (V() && (i(n + 1), window.addEventListener("message", d), Ut(), _t({
2223
- ...e.locale ? {
2224
- locale: e.locale
2225
- } : {},
2226
- ...e.includeRefs ? {
2227
- includeRefs: e.includeRefs
2228
- } : {},
2229
- ...e.enrich ? {
2230
- enrich: e.enrich
2231
- } : {}
2232
- }), Object.values(
2233
- e.builderContextSignal.componentInfos
2234
- ).forEach((x) => {
2235
- var T;
2236
- const v = Pe(x);
2237
- (T = window.parent) == null || T.postMessage(v, "*");
2238
- }), window.addEventListener(
2239
- "builder:component:stateChangeListenerActivated",
2240
- C
2241
- )), e.builderContextSignal.content) {
2242
- const x = (b = e.builderContextSignal.content) == null ? void 0 : b.testVariationId, v = (w = e.builderContextSignal.content) == null ? void 0 : w.id;
2243
- ae({
2317
+ function S(m) {
2318
+ i(n + 1), window.addEventListener("message", l), registerInsertMenu(), setupBrowserForEditing({
2319
+ ...e.locale ? {
2320
+ locale: e.locale
2321
+ } : {},
2322
+ ...e.includeRefs ? {
2323
+ includeRefs: e.includeRefs
2324
+ } : {},
2325
+ ...e.enrich ? {
2326
+ enrich: e.enrich
2327
+ } : {}
2328
+ }), Object.values(
2329
+ e.builderContextSignal.componentInfos
2330
+ ).forEach((g) => {
2331
+ var p;
2332
+ const y = createRegisterComponentMessage(g);
2333
+ (p = window.parent) == null || p.postMessage(y, "*");
2334
+ }), window.addEventListener(
2335
+ "builder:component:stateChangeListenerActivated",
2336
+ C
2337
+ );
2338
+ }
2339
+ function E(m) {
2340
+ const g = new URL(location.href).searchParams, y = g.get("builder.preview"), p = g.get(
2341
+ `builder.preview.${y}`
2342
+ ), k = g.get("apiKey") || g.get("builder.space");
2343
+ y === e.model && k === e.apiKey && (!e.content || p === e.content.id) && fetchOneEntry({
2344
+ model: e.model,
2345
+ apiKey: e.apiKey,
2346
+ apiVersion: e.builderContextSignal.apiVersion
2347
+ }).then((w) => {
2348
+ w && o(w);
2349
+ });
2350
+ }
2351
+ return useEffect(() => {
2352
+ var m;
2353
+ return (m = t.current) == null || m.addEventListener(
2354
+ "initeditingbldr",
2355
+ S
2356
+ ), () => {
2357
+ var g;
2358
+ return (g = t.current) == null ? void 0 : g.removeEventListener(
2359
+ "initeditingbldr",
2360
+ S
2361
+ );
2362
+ };
2363
+ }, []), useEffect(() => {
2364
+ var m;
2365
+ return (m = t.current) == null || m.addEventListener(
2366
+ "initpreviewingbldr",
2367
+ E
2368
+ ), () => {
2369
+ var g;
2370
+ return (g = t.current) == null ? void 0 : g.removeEventListener(
2371
+ "initpreviewingbldr",
2372
+ E
2373
+ );
2374
+ };
2375
+ }, []), useEffect(() => {
2376
+ var m, g;
2377
+ if (isBrowser()) {
2378
+ if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
2379
+ const p = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, k = (g = e.builderContextSignal.content) == null ? void 0 : g.id, w = e.apiKey;
2380
+ _track({
2244
2381
  type: "impression",
2245
- canTrack: _(e.canTrack),
2246
- contentId: v,
2247
- apiKey: e.apiKey,
2248
- variationId: x !== v ? x : void 0
2249
- });
2250
- }
2251
- if (Ae()) {
2252
- const x = new URL(location.href).searchParams, v = x.get("builder.preview"), T = x.get(
2253
- `builder.preview.${v}`
2254
- ), $ = x.get("apiKey") || x.get("builder.space");
2255
- v === e.model && $ === e.apiKey && (!e.content || T === e.content.id) && xe({
2256
- model: e.model,
2257
- apiKey: e.apiKey,
2258
- apiVersion: e.builderContextSignal.apiVersion
2259
- }).then((W) => {
2260
- W && a(W);
2382
+ canTrack: !0,
2383
+ contentId: k,
2384
+ apiKey: w,
2385
+ variationId: p !== k ? p : void 0
2261
2386
  });
2262
2387
  }
2263
- c(), p(), C();
2388
+ isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
2264
2389
  }
2265
- }, []), P(() => {
2266
- e.content && a(e.content);
2267
- }, [e.content]), P(() => {
2268
- }, [o]), P(() => {
2269
- c();
2390
+ }, []), useEffect(() => {
2391
+ e.apiKey || logger.error(
2392
+ "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2393
+ ), s(), v(), C();
2394
+ }, []), useEffect(() => {
2395
+ e.content && o(e.content);
2396
+ }, [e.content]), useEffect(() => {
2397
+ }, [a]), useEffect(() => {
2398
+ s();
2270
2399
  }, [
2271
- (R = (g = e.builderContextSignal.content) == null ? void 0 : g.data) == null ? void 0 : R.jsCode,
2400
+ (T = (I = e.builderContextSignal.content) == null ? void 0 : I.data) == null ? void 0 : T.jsCode,
2272
2401
  e.builderContextSignal.rootState
2273
- ]), P(() => {
2274
- p();
2275
- }, [(B = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : B.httpRequests]), P(() => {
2402
+ ]), useEffect(() => {
2403
+ v();
2404
+ }, [(j = (R = e.builderContextSignal.content) == null ? void 0 : R.data) == null ? void 0 : j.httpRequests]), useEffect(() => {
2276
2405
  C();
2277
- }, [e.builderContextSignal.rootState]), P(() => () => {
2278
- F() && (window.removeEventListener("message", d), window.removeEventListener(
2406
+ }, [e.builderContextSignal.rootState]), useEffect(() => () => {
2407
+ isBrowser() && (window.removeEventListener("message", l), window.removeEventListener(
2279
2408
  "builder:component:stateChangeListenerActivated",
2280
2409
  C
2281
2410
  ));
2282
- }, []), /* @__PURE__ */ l(te.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
2411
+ }, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
2283
2412
  "div",
2284
2413
  {
2414
+ key: n,
2285
2415
  ref: t,
2286
- onClick: (b) => k(b),
2287
- "builder-content-id": (N = e.builderContextSignal.content) == null ? void 0 : N.id,
2416
+ onClick: (m) => b(m),
2417
+ "builder-content-id": (B = e.builderContextSignal.content) == null ? void 0 : B.id,
2288
2418
  "builder-model": e.model,
2289
2419
  ...e.showContent ? {} : {
2290
2420
  hidden: !0,
2291
2421
  "aria-hidden": !0
2292
2422
  },
2293
- className: e.classNameProp,
2294
- children: e.children
2423
+ className: e.classNameProp
2295
2424
  },
2296
- n
2425
+ e.children
2297
2426
  ) }) : null });
2298
2427
  }
2299
- function Q(e) {
2300
- return /* @__PURE__ */ l(
2428
+ function InlinedScript(e) {
2429
+ return /* @__PURE__ */ jsx(
2301
2430
  "script",
2302
2431
  {
2303
2432
  dangerouslySetInnerHTML: { __html: e.scriptStr },
@@ -2305,52 +2434,52 @@ function Q(e) {
2305
2434
  }
2306
2435
  );
2307
2436
  }
2308
- function ge(e) {
2309
- var c, s, u, m, y, k, h;
2310
- const [t, n] = I(
2437
+ function ContentComponent(e) {
2438
+ var s, c, u, f, h, b, d;
2439
+ const [t, n] = useState(
2311
2440
  () => {
2312
- var S, p;
2313
- return ht({
2441
+ var x, v;
2442
+ return getRenderContentScriptString({
2314
2443
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2315
- variationId: (S = e.content) == null ? void 0 : S.testVariationId,
2444
+ variationId: (x = e.content) == null ? void 0 : x.testVariationId,
2316
2445
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2317
- contentId: (p = e.content) == null ? void 0 : p.id
2446
+ contentId: (v = e.content) == null ? void 0 : v.id
2318
2447
  });
2319
2448
  }
2320
2449
  );
2321
- function i(S) {
2322
- d((p) => ({
2323
- ...p,
2324
- rootState: S
2450
+ function i(x) {
2451
+ l((v) => ({
2452
+ ...v,
2453
+ rootState: x
2325
2454
  }));
2326
2455
  }
2327
- const [a, o] = I(
2456
+ const [o, a] = useState(
2328
2457
  () => [
2329
- ...ue(),
2458
+ ...getDefaultRegisteredComponents(),
2330
2459
  // While this `components` object is deprecated, we must maintain support for it.
2331
2460
  // Since users are able to override our default components, we need to make sure that we do not break such
2332
2461
  // existing usage.
2333
2462
  // This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
2334
2463
  // which is the new standard way of providing custom components, and must therefore take precedence.
2335
- ...oe,
2464
+ ...components,
2336
2465
  ...e.customComponents || []
2337
2466
  ].reduce(
2338
- (S, { component: p, ...C }) => ({
2339
- ...S,
2467
+ (x, { component: v, ...C }) => ({
2468
+ ...x,
2340
2469
  [C.name]: {
2341
- component: p,
2342
- ...re(C)
2470
+ component: v,
2471
+ ...serializeComponentInfo(C)
2343
2472
  }
2344
2473
  }),
2345
2474
  {}
2346
2475
  )
2347
- ), [r, d] = I(() => ({
2348
- content: Mt({
2476
+ ), [r, l] = useState(() => ({
2477
+ content: getContentInitialValue({
2349
2478
  content: e.content,
2350
2479
  data: e.data
2351
2480
  }),
2352
2481
  localState: void 0,
2353
- rootState: jt({
2482
+ rootState: getContextStateInitialValue({
2354
2483
  content: e.content,
2355
2484
  data: e.data,
2356
2485
  locale: e.locale
@@ -2360,31 +2489,31 @@ function ge(e) {
2360
2489
  apiKey: e.apiKey,
2361
2490
  apiVersion: e.apiVersion,
2362
2491
  componentInfos: [
2363
- ...ue(),
2492
+ ...getDefaultRegisteredComponents(),
2364
2493
  // While this `components` object is deprecated, we must maintain support for it.
2365
2494
  // Since users are able to override our default components, we need to make sure that we do not break such
2366
2495
  // existing usage.
2367
2496
  // This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
2368
2497
  // which is the new standard way of providing custom components, and must therefore take precedence.
2369
- ...oe,
2498
+ ...components,
2370
2499
  ...e.customComponents || []
2371
2500
  ].reduce(
2372
- (S, { component: p, ...C }) => ({
2373
- ...S,
2374
- [C.name]: re(C)
2501
+ (x, { component: v, ...C }) => ({
2502
+ ...x,
2503
+ [C.name]: serializeComponentInfo(C)
2375
2504
  }),
2376
2505
  {}
2377
2506
  ),
2378
2507
  inheritedStyles: {}
2379
2508
  }));
2380
- return /* @__PURE__ */ l(
2381
- ke.Provider,
2509
+ return /* @__PURE__ */ jsx(
2510
+ ComponentsContext.Provider,
2382
2511
  {
2383
2512
  value: {
2384
- registeredComponents: a
2513
+ registeredComponents: o
2385
2514
  },
2386
- children: /* @__PURE__ */ E(
2387
- zt,
2515
+ children: /* @__PURE__ */ jsxs(
2516
+ EnableEditor,
2388
2517
  {
2389
2518
  content: e.content,
2390
2519
  model: e.model,
@@ -2397,23 +2526,23 @@ function ge(e) {
2397
2526
  classNameProp: e.classNameProp,
2398
2527
  showContent: e.showContent,
2399
2528
  builderContextSignal: r,
2400
- setBuilderContextSignal: d,
2529
+ setBuilderContextSignal: l,
2401
2530
  children: [
2402
- e.isSsrAbTest ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(Q, { scriptStr: t }) }) : null,
2403
- /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
2404
- Wt,
2531
+ e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
2532
+ /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2533
+ ContentStyles,
2405
2534
  {
2406
- contentId: (c = r.content) == null ? void 0 : c.id,
2407
- cssCode: (u = (s = r.content) == null ? void 0 : s.data) == null ? void 0 : u.cssCode,
2408
- customFonts: (y = (m = r.content) == null ? void 0 : m.data) == null ? void 0 : y.customFonts
2535
+ contentId: (s = r.content) == null ? void 0 : s.id,
2536
+ cssCode: (u = (c = r.content) == null ? void 0 : c.data) == null ? void 0 : u.cssCode,
2537
+ customFonts: (h = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : h.customFonts
2409
2538
  }
2410
2539
  ) }),
2411
- /* @__PURE__ */ l(
2412
- ne,
2540
+ /* @__PURE__ */ jsx(
2541
+ Blocks,
2413
2542
  {
2414
- blocks: (h = (k = r.content) == null ? void 0 : k.data) == null ? void 0 : h.blocks,
2543
+ blocks: (d = (b = r.content) == null ? void 0 : b.data) == null ? void 0 : d.blocks,
2415
2544
  context: r,
2416
- registeredComponents: a
2545
+ registeredComponents: o
2417
2546
  }
2418
2547
  )
2419
2548
  ]
@@ -2422,53 +2551,53 @@ function ge(e) {
2422
2551
  }
2423
2552
  );
2424
2553
  }
2425
- function Ie(e) {
2426
- var r, d, c;
2427
- const [t, n] = I(
2428
- () => ct({
2429
- canTrack: _(e.canTrack),
2554
+ function ContentVariants(e) {
2555
+ var r, l, s;
2556
+ const [t, n] = useState(
2557
+ () => checkShouldRunVariants({
2558
+ canTrack: getDefaultCanTrack(e.canTrack),
2430
2559
  content: e.content
2431
2560
  })
2432
2561
  );
2433
2562
  function i() {
2434
- var s;
2435
- return ft(
2436
- L(e.content).map((u) => ({
2563
+ var c;
2564
+ return getVariantsScriptString(
2565
+ getVariants(e.content).map((u) => ({
2437
2566
  id: u.testVariationId,
2438
2567
  testRatio: u.testRatio
2439
2568
  })),
2440
- ((s = e.content) == null ? void 0 : s.id) || ""
2569
+ ((c = e.content) == null ? void 0 : c.id) || ""
2441
2570
  );
2442
2571
  }
2443
- function a() {
2444
- return L(e.content).map((s) => `.variant-${s.testVariationId} { display: none; } `).join("");
2445
- }
2446
2572
  function o() {
2447
- var s;
2573
+ return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
2574
+ }
2575
+ function a() {
2576
+ var c;
2448
2577
  return t ? {
2449
2578
  ...e.content,
2450
- testVariationId: (s = e.content) == null ? void 0 : s.id
2451
- } : Ve({
2579
+ testVariationId: (c = e.content) == null ? void 0 : c.id
2580
+ } : handleABTestingSync({
2452
2581
  item: e.content,
2453
- canTrack: _(e.canTrack)
2582
+ canTrack: getDefaultCanTrack(e.canTrack)
2454
2583
  });
2455
2584
  }
2456
- return P(() => {
2457
- }, []), /* @__PURE__ */ E(f, { children: [
2458
- !e.__isNestedRender && M !== "reactNative" ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(Q, { scriptStr: mt() }) }) : null,
2459
- t ? /* @__PURE__ */ E(f, { children: [
2460
- /* @__PURE__ */ l(
2461
- H,
2585
+ return useEffect(() => {
2586
+ }, []), /* @__PURE__ */ jsxs(Fragment, { children: [
2587
+ !e.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: getScriptString() }) }) : null,
2588
+ t ? /* @__PURE__ */ jsxs(Fragment, { children: [
2589
+ /* @__PURE__ */ jsx(
2590
+ InlinedStyles,
2462
2591
  {
2463
2592
  id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
2464
- styles: a()
2593
+ styles: o()
2465
2594
  }
2466
2595
  ),
2467
- /* @__PURE__ */ l(Q, { scriptStr: i() }),
2468
- (d = L(e.content)) == null ? void 0 : d.map((s) => /* @__PURE__ */ l(
2469
- ge,
2596
+ /* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
2597
+ (l = getVariants(e.content)) == null ? void 0 : l.map((c) => /* @__PURE__ */ jsx(
2598
+ ContentComponent,
2470
2599
  {
2471
- content: s,
2600
+ content: c,
2472
2601
  showContent: !1,
2473
2602
  classNameProp: void 0,
2474
2603
  model: e.model,
@@ -2483,14 +2612,14 @@ function Ie(e) {
2483
2612
  enrich: e.enrich,
2484
2613
  isSsrAbTest: t
2485
2614
  },
2486
- s.testVariationId
2615
+ c.testVariationId
2487
2616
  ))
2488
2617
  ] }) : null,
2489
- /* @__PURE__ */ l(
2490
- ge,
2618
+ /* @__PURE__ */ jsx(
2619
+ ContentComponent,
2491
2620
  {
2492
- content: o(),
2493
- classNameProp: `variant-${(c = e.content) == null ? void 0 : c.id}`,
2621
+ content: a(),
2622
+ classNameProp: `variant-${(s = e.content) == null ? void 0 : s.id}`,
2494
2623
  showContent: !0,
2495
2624
  model: e.model,
2496
2625
  data: e.data,
@@ -2507,13 +2636,13 @@ function Ie(e) {
2507
2636
  )
2508
2637
  ] });
2509
2638
  }
2510
- const qt = async ({
2639
+ const fetchSymbolContent = async ({
2511
2640
  builderContextValue: e,
2512
2641
  symbol: t
2513
2642
  }) => {
2514
2643
  if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
2515
2644
  (e != null && e.apiKey))
2516
- return xe({
2645
+ return fetchOneEntry({
2517
2646
  model: t.model,
2518
2647
  apiKey: e.apiKey,
2519
2648
  apiVersion: e.apiVersion,
@@ -2523,38 +2652,38 @@ const qt = async ({
2523
2652
  }
2524
2653
  }
2525
2654
  }).catch((n) => {
2526
- U.error("Could not fetch symbol content: ", n);
2655
+ logger.error("Could not fetch symbol content: ", n);
2527
2656
  });
2528
2657
  };
2529
- function Dt(e) {
2530
- var o, r, d;
2658
+ function Symbol$1(e) {
2659
+ var a, r, l;
2531
2660
  function t() {
2532
- var c, s;
2661
+ var s, c;
2533
2662
  return [
2534
2663
  e.attributes.className,
2535
2664
  "builder-symbol",
2536
- (c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
2537
- (s = e.symbol) != null && s.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2665
+ (s = e.symbol) != null && s.inline ? "builder-inline-symbol" : void 0,
2666
+ (c = e.symbol) != null && c.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2538
2667
  ].filter(Boolean).join(" ");
2539
2668
  }
2540
- const [n, i] = I(() => {
2541
- var c;
2542
- return (c = e.symbol) == null ? void 0 : c.content;
2669
+ const [n, i] = useState(() => {
2670
+ var s;
2671
+ return (s = e.symbol) == null ? void 0 : s.content;
2543
2672
  });
2544
- function a() {
2545
- n || qt({
2673
+ function o() {
2674
+ n || fetchSymbolContent({
2546
2675
  symbol: e.symbol,
2547
2676
  builderContextValue: e.builderContext
2548
- }).then((c) => {
2549
- c && i(c);
2677
+ }).then((s) => {
2678
+ s && i(s);
2550
2679
  });
2551
2680
  }
2552
- return P(() => {
2553
- a();
2554
- }, []), P(() => {
2555
- a();
2556
- }, [e.symbol]), /* @__PURE__ */ l("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ l(
2557
- Ie,
2681
+ return useEffect(() => {
2682
+ o();
2683
+ }, []), useEffect(() => {
2684
+ o();
2685
+ }, [e.symbol]), /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
2686
+ ContentVariants,
2558
2687
  {
2559
2688
  __isNestedRender: !0,
2560
2689
  apiVersion: e.builderContext.apiVersion,
@@ -2562,40 +2691,40 @@ function Dt(e) {
2562
2691
  context: e.builderContext.context,
2563
2692
  customComponents: Object.values(e.builderComponents),
2564
2693
  data: {
2565
- ...(o = e.symbol) == null ? void 0 : o.data,
2694
+ ...(a = e.symbol) == null ? void 0 : a.data,
2566
2695
  ...e.builderContext.localState,
2567
2696
  ...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
2568
2697
  },
2569
- model: (d = e.symbol) == null ? void 0 : d.model,
2698
+ model: (l = e.symbol) == null ? void 0 : l.model,
2570
2699
  content: n
2571
2700
  }
2572
2701
  ) });
2573
2702
  }
2574
- const Qt = ne, Xt = Ie;
2703
+ const RenderBlocks = Blocks, RenderContent = ContentVariants;
2575
2704
  export {
2576
- ne as Blocks,
2577
- Fe as Button,
2578
- nt as Columns,
2579
- Ie as Content,
2580
- it as Fragment,
2581
- rt as Image,
2582
- Qt as RenderBlocks,
2583
- Xt as RenderContent,
2584
- lt as Section,
2585
- Dt as Symbol,
2586
- pt as Text,
2587
- wt as Video,
2588
- tn as _processContentResult,
2589
- Pe as createRegisterComponentMessage,
2590
- nn as fetchBuilderProps,
2591
- an as fetchEntries,
2592
- xe as fetchOneEntry,
2593
- on as getAllContent,
2594
- rn as getBuilderSearchParams,
2595
- ln as getContent,
2596
- V as isEditing,
2597
- Ae as isPreviewing,
2598
- $e as register,
2599
- cn as setEditorSettings,
2600
- sn as track
2705
+ Blocks,
2706
+ Button,
2707
+ Columns,
2708
+ ContentVariants as Content,
2709
+ FragmentComponent as Fragment,
2710
+ Image,
2711
+ RenderBlocks,
2712
+ RenderContent,
2713
+ SectionComponent as Section,
2714
+ Symbol$1 as Symbol,
2715
+ Text,
2716
+ Video,
2717
+ M as _processContentResult,
2718
+ createRegisterComponentMessage,
2719
+ W as fetchBuilderProps,
2720
+ L as fetchEntries,
2721
+ fetchOneEntry,
2722
+ O as getAllContent,
2723
+ U as getBuilderSearchParams,
2724
+ D as getContent,
2725
+ isEditing,
2726
+ isPreviewing,
2727
+ register,
2728
+ H as setEditorSettings,
2729
+ K as track
2601
2730
  };