@builder.io/sdk-vue 0.1.4 → 0.1.6

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 (83) hide show
  1. package/package.json +1 -1
  2. package/packages/_vue2/dist/{block-styles.c799c71a.cjs → block-styles.9b0be456.cjs} +1 -1
  3. package/packages/_vue2/dist/{block-styles.062b71eb.js → block-styles.d0435c8f.js} +3 -3
  4. package/packages/{_vue3/dist/get-processed-block.b0588cd8.cjs → _vue2/dist/get-processed-block.531fd2fb.cjs} +1 -1
  5. package/packages/{_vue3/dist/get-processed-block.ab2d823c.js → _vue2/dist/get-processed-block.aa4c9919.js} +1 -1
  6. package/packages/_vue2/dist/index.b431861b.cjs +30 -0
  7. package/packages/_vue2/dist/{index.b2edb9b2.js → index.da42f753.js} +899 -828
  8. package/packages/_vue2/dist/{render-block.74bfd4ea.js → render-block.49244064.js} +40 -29
  9. package/packages/_vue2/dist/render-block.5d240071.cjs +3 -0
  10. package/packages/_vue2/dist/{render-component.e59489c1.cjs → render-component.3117c1fd.cjs} +1 -1
  11. package/packages/_vue2/dist/{render-component.b325feac.js → render-component.42e82bc4.js} +3 -3
  12. package/packages/_vue2/dist/{render-inlined-styles.734fe2c9.js → render-inlined-styles.5d055b0c.js} +1 -1
  13. package/packages/_vue2/dist/{render-inlined-styles.14b606a5.cjs → render-inlined-styles.d7530652.cjs} +1 -1
  14. package/packages/_vue2/dist/render-repeated-block.b4a9163a.cjs +1 -0
  15. package/packages/_vue2/dist/{render-repeated-block.e1d94c10.js → render-repeated-block.bceba726.js} +3 -2
  16. package/packages/_vue2/dist/render-styles.0451ee0a.js +73 -0
  17. package/packages/_vue2/dist/render-styles.144e8a3e.cjs +18 -0
  18. package/packages/_vue2/dist/sdk.cjs +1 -1
  19. package/packages/_vue2/dist/sdk.js +1 -1
  20. package/packages/_vue2/dist/src/blocks/button/button.vue.d.ts +3 -0
  21. package/packages/_vue2/dist/src/blocks/columns/columns.vue.d.ts +1 -0
  22. package/packages/_vue2/dist/src/blocks/img/img.vue.d.ts +3 -0
  23. package/packages/_vue2/dist/src/blocks/section/section.vue.d.ts +3 -0
  24. package/packages/_vue2/dist/src/blocks/symbol/symbol.vue.d.ts +13 -17
  25. package/packages/_vue2/dist/src/components/render-block/render-block.vue.d.ts +1 -0
  26. package/packages/_vue2/dist/src/components/render-block/render-component.vue.d.ts +9 -1
  27. package/packages/_vue2/dist/src/components/render-block/render-repeated-block.vue.d.ts +1 -0
  28. package/packages/_vue2/dist/src/components/render-blocks.vue.d.ts +1 -0
  29. package/packages/_vue2/dist/src/components/render-content/components/render-styles.helpers.d.ts +15 -0
  30. package/packages/_vue2/dist/src/components/render-content/components/render-styles.vue.d.ts +1 -9
  31. package/packages/_vue2/dist/src/components/render-content/render-content.helpers.d.ts +7 -0
  32. package/packages/_vue2/dist/src/components/render-content/render-content.types.d.ts +27 -0
  33. package/packages/_vue2/dist/src/components/render-content/render-content.vue.d.ts +11 -31
  34. package/packages/_vue2/dist/src/context/builder.context.d.ts +1 -0
  35. package/packages/_vue2/dist/src/context/types.d.ts +1 -0
  36. package/packages/_vue2/dist/src/index-helpers/blocks-exports.d.ts +6 -6
  37. package/packages/_vue2/dist/src/types/builder-content.d.ts +1 -2
  38. package/packages/_vue2/dist/src/types/components.d.ts +0 -1
  39. package/packages/_vue2/dist/style.css +1 -1
  40. package/packages/_vue3/dist/{block-styles.6e935df7.cjs → block-styles.05a01a8e.cjs} +1 -1
  41. package/packages/_vue3/dist/{block-styles.413a68e9.js → block-styles.5fb6e927.js} +3 -3
  42. package/packages/{_vue2/dist/get-processed-block.44306844.js → _vue3/dist/get-processed-block.48c68f6b.js} +1 -1
  43. package/packages/{_vue2/dist/get-processed-block.837e0313.cjs → _vue3/dist/get-processed-block.e6e75aca.cjs} +1 -1
  44. package/packages/_vue3/dist/index.6275edf0.cjs +30 -0
  45. package/packages/_vue3/dist/{index.7db5ef7e.js → index.8392057e.js} +914 -843
  46. package/packages/_vue3/dist/{render-block.a53e9af1.js → render-block.017ccb02.js} +42 -31
  47. package/packages/_vue3/dist/render-block.f6f263a8.cjs +3 -0
  48. package/packages/_vue3/dist/{render-component.41330655.js → render-component.5b79b1a2.js} +3 -3
  49. package/packages/_vue3/dist/{render-component.adae07fa.cjs → render-component.626cb9a2.cjs} +1 -1
  50. package/packages/_vue3/dist/{render-inlined-styles.47114c43.js → render-inlined-styles.0773feb1.js} +1 -1
  51. package/packages/_vue3/dist/{render-inlined-styles.c80dee1c.cjs → render-inlined-styles.ab30b262.cjs} +1 -1
  52. package/packages/_vue3/dist/{render-repeated-block.648adc14.js → render-repeated-block.09b2f47e.js} +3 -2
  53. package/packages/_vue3/dist/render-repeated-block.802c4a21.cjs +1 -0
  54. package/packages/_vue3/dist/render-styles.7e2d3639.cjs +18 -0
  55. package/packages/_vue3/dist/render-styles.c79197c2.js +67 -0
  56. package/packages/_vue3/dist/sdk.cjs +1 -1
  57. package/packages/_vue3/dist/sdk.js +1 -1
  58. package/packages/_vue3/dist/src/blocks/button/button.vue.d.ts +3 -0
  59. package/packages/_vue3/dist/src/blocks/img/img.vue.d.ts +3 -0
  60. package/packages/_vue3/dist/src/blocks/section/section.vue.d.ts +3 -0
  61. package/packages/_vue3/dist/src/blocks/symbol/symbol.vue.d.ts +12 -17
  62. package/packages/_vue3/dist/src/components/render-block/render-component.vue.d.ts +8 -1
  63. package/packages/_vue3/dist/src/components/render-content/components/render-styles.helpers.d.ts +15 -0
  64. package/packages/_vue3/dist/src/components/render-content/components/render-styles.vue.d.ts +1 -9
  65. package/packages/_vue3/dist/src/components/render-content/render-content.helpers.d.ts +7 -0
  66. package/packages/_vue3/dist/src/components/render-content/render-content.types.d.ts +27 -0
  67. package/packages/_vue3/dist/src/components/render-content/render-content.vue.d.ts +10 -31
  68. package/packages/_vue3/dist/src/context/builder.context.d.ts +1 -0
  69. package/packages/_vue3/dist/src/context/types.d.ts +1 -0
  70. package/packages/_vue3/dist/src/index-helpers/blocks-exports.d.ts +6 -6
  71. package/packages/_vue3/dist/src/types/builder-content.d.ts +1 -2
  72. package/packages/_vue3/dist/src/types/components.d.ts +0 -1
  73. package/packages/_vue3/dist/style.css +1 -1
  74. package/packages/_vue2/dist/index.59a0624f.cjs +0 -30
  75. package/packages/_vue2/dist/render-block.b97311ac.cjs +0 -3
  76. package/packages/_vue2/dist/render-repeated-block.bbbfafcc.cjs +0 -1
  77. package/packages/_vue2/dist/render-styles.0b296b86.js +0 -70
  78. package/packages/_vue2/dist/render-styles.6732290e.cjs +0 -17
  79. package/packages/_vue3/dist/index.218c45a5.cjs +0 -30
  80. package/packages/_vue3/dist/render-block.a9195cb6.cjs +0 -3
  81. package/packages/_vue3/dist/render-repeated-block.5b77dd2a.cjs +0 -1
  82. package/packages/_vue3/dist/render-styles.8780951f.js +0 -64
  83. package/packages/_vue3/dist/render-styles.9f30e56b.cjs +0 -17
@@ -1,12 +1,12 @@
1
- import { defineAsyncComponent as x, resolveComponent as k, openBlock as l, createElementBlock as u, normalizeClass as j, normalizeStyle as w, createBlock as I, createCommentVNode as b, Fragment as R, renderList as O, createVNode as X, createElementVNode as L, renderSlot as E, mergeProps as S, toDisplayString as W } from "vue";
2
- const T = "vue3";
1
+ import { openBlock as d, createElementBlock as u, mergeProps as _, toHandlers as w, toDisplayString as M, defineAsyncComponent as x, resolveComponent as k, normalizeClass as j, normalizeStyle as I, createBlock as T, createCommentVNode as b, Fragment as E, renderList as F, createVNode as Q, renderSlot as A, createElementVNode as $ } from "vue";
2
+ const R = "vue3";
3
3
  function f() {
4
4
  return typeof window < "u" && typeof document < "u";
5
5
  }
6
- const M = {};
7
- function ue(e, n) {
8
- let t = M[e];
9
- if (t || (t = M[e] = []), t.push(n), f()) {
6
+ const z = {};
7
+ function pe(e, n) {
8
+ let t = z[e];
9
+ if (t || (t = z[e] = []), t.push(n), f()) {
10
10
  const o = {
11
11
  type: "builder.register",
12
12
  data: {
@@ -21,8 +21,8 @@ function ue(e, n) {
21
21
  }
22
22
  }
23
23
  }
24
- const me = () => {
25
- ue("insertMenu", {
24
+ const he = () => {
25
+ pe("insertMenu", {
26
26
  name: "_default",
27
27
  default: !0,
28
28
  items: [
@@ -37,14 +37,14 @@ const me = () => {
37
37
  ]
38
38
  });
39
39
  };
40
- let N = !1;
41
- const pe = (e = {}) => {
40
+ let K = !1;
41
+ const fe = (e = {}) => {
42
42
  var n, t;
43
- N || (N = !0, f() && ((n = window.parent) == null || n.postMessage(
43
+ K || (K = !0, f() && ((n = window.parent) == null || n.postMessage(
44
44
  {
45
45
  type: "builder.sdkInfo",
46
46
  data: {
47
- target: T,
47
+ target: R,
48
48
  supportsPatchUpdates: !1,
49
49
  supportsAddBlockScoping: !0,
50
50
  supportsCustomBreakpoints: !0
@@ -64,17 +64,17 @@ const pe = (e = {}) => {
64
64
  if (!!(o != null && o.type))
65
65
  switch (o.type) {
66
66
  case "builder.evaluate": {
67
- const i = o.data.text, c = o.data.arguments || [], a = o.data.id, d = new Function(i);
67
+ const a = o.data.text, i = o.data.arguments || [], c = o.data.id, l = new Function(a);
68
68
  let m, p = null;
69
69
  try {
70
- m = d.apply(null, c);
70
+ m = l.apply(null, i);
71
71
  } catch (h) {
72
72
  p = h;
73
73
  }
74
74
  p ? (r = window.parent) == null || r.postMessage(
75
75
  {
76
76
  type: "builder.evaluateError",
77
- data: { id: a, error: p.message }
77
+ data: { id: c, error: p.message }
78
78
  },
79
79
  "*"
80
80
  ) : m && typeof m.then == "function" ? m.then((h) => {
@@ -82,14 +82,14 @@ const pe = (e = {}) => {
82
82
  (v = window.parent) == null || v.postMessage(
83
83
  {
84
84
  type: "builder.evaluateResult",
85
- data: { id: a, result: h }
85
+ data: { id: c, result: h }
86
86
  },
87
87
  "*"
88
88
  );
89
89
  }).catch(console.error) : (s = window.parent) == null || s.postMessage(
90
90
  {
91
91
  type: "builder.evaluateResult",
92
- data: { result: m, id: a }
92
+ data: { result: m, id: c }
93
93
  },
94
94
  "*"
95
95
  );
@@ -97,7 +97,40 @@ const pe = (e = {}) => {
97
97
  }
98
98
  }
99
99
  })));
100
- }, U = (e) => JSON.parse(JSON.stringify(e)), Y = {
100
+ }, ge = {
101
+ name: "builder-button",
102
+ props: ["attributes", "text", "link", "openLinkInNewTab"],
103
+ methods: {
104
+ filterAttrs: function(n = {}, t) {
105
+ const o = "v-on:", r = (i) => i.startsWith(o), s = (i) => !i.startsWith(o), a = (i) => i.replace(o, "");
106
+ return Object.keys(n).filter(t ? r : s).reduce(
107
+ (i, c) => ({
108
+ ...i,
109
+ [a(c)]: n[c]
110
+ }),
111
+ {}
112
+ );
113
+ }
114
+ }
115
+ };
116
+ const g = (e, n) => {
117
+ const t = e.__vccOpts || e;
118
+ for (const [o, r] of n)
119
+ t[o] = r;
120
+ return t;
121
+ }, be = ["href", "target"];
122
+ function ye(e, n, t, o, r, s) {
123
+ return t.link ? (d(), u("a", _({
124
+ key: 0,
125
+ role: "button",
126
+ href: t.link,
127
+ target: t.openLinkInNewTab ? "_blank" : void 0
128
+ }, s.filterAttrs(t.attributes, !1), w(s.filterAttrs(t.attributes, !0), !0)), M(t.text), 17, be)) : (d(), u("button", _({
129
+ key: 1,
130
+ class: "button-7fq9d0i380"
131
+ }, s.filterAttrs(t.attributes, !1), w(s.filterAttrs(t.attributes, !0), !0)), M(t.text), 17));
132
+ }
133
+ const ve = /* @__PURE__ */ g(ge, [["render", ye], ["__scopeId", "data-v-465ad941"]]), V = (e) => JSON.parse(JSON.stringify(e)), Z = {
101
134
  small: {
102
135
  min: 320,
103
136
  default: 321,
@@ -113,8 +146,8 @@ const pe = (e = {}) => {
113
146
  default: 991,
114
147
  max: 1200
115
148
  }
116
- }, Rn = (e, n = Y) => `@media (max-width: ${n[e].max}px)`, he = ({ small: e, medium: n }) => {
117
- const t = U(Y);
149
+ }, Pn = (e, n = Z) => `@media (max-width: ${n[e].max}px)`, xe = ({ small: e, medium: n }) => {
150
+ const t = V(Z);
118
151
  if (!e || !n)
119
152
  return t;
120
153
  const o = Math.floor(e / 2);
@@ -135,36 +168,36 @@ const pe = (e = {}) => {
135
168
  min: s,
136
169
  default: s + 1
137
170
  }, t;
138
- }, fe = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), C = (e) => e != null, ge = (e) => Object.entries(e).map(([t, o]) => {
171
+ }, ke = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), S = (e) => e != null, Se = (e) => Object.entries(e).map(([t, o]) => {
139
172
  if (typeof o == "string")
140
- return `${fe(t)}: ${o};`;
141
- }).filter(C), _ = (e) => ge(e).join(`
142
- `), En = ({
173
+ return `${ke(t)}: ${o};`;
174
+ }).filter(S), C = (e) => Se(e).join(`
175
+ `), On = ({
143
176
  mediaQuery: e,
144
177
  className: n,
145
178
  styles: t
146
179
  }) => {
147
180
  const o = `.${n} {
148
- ${_(t)}
181
+ ${C(t)}
149
182
  }`;
150
183
  return e ? `${e} {
151
184
  ${o}
152
185
  }` : o;
153
- }, be = () => Promise.resolve().then(() => le).then((e) => e.default).catch((e) => {
186
+ }, _e = () => Promise.resolve().then(() => ee).then((e) => e.default).catch((e) => {
154
187
  throw console.error(
155
188
  "Error while attempting to dynamically import component RenderBlocks at ../../components/render-blocks.vue",
156
189
  e
157
190
  ), e;
158
- }), ye = () => import("./render-inlined-styles.47114c43.js").then((e) => e.default).catch((e) => {
191
+ }), Ce = () => import("./render-inlined-styles.0773feb1.js").then((e) => e.default).catch((e) => {
159
192
  throw console.error(
160
193
  "Error while attempting to dynamically import component RenderInlinedStyles at ../../components/render-inlined-styles.vue",
161
194
  e
162
195
  ), e;
163
- }), ve = {
196
+ }), we = {
164
197
  name: "builder-columns",
165
198
  components: {
166
- RenderInlinedStyles: x(ye),
167
- RenderBlocks: x(be)
199
+ RenderInlinedStyles: x(Ce),
200
+ RenderBlocks: x(_e)
168
201
  },
169
202
  props: [
170
203
  "space",
@@ -175,7 +208,7 @@ const pe = (e = {}) => {
175
208
  "builderBlock"
176
209
  ],
177
210
  data() {
178
- return { TARGET: T };
211
+ return { TARGET: R };
179
212
  },
180
213
  computed: {
181
214
  columnsCssVars() {
@@ -222,21 +255,21 @@ const pe = (e = {}) => {
222
255
  return `
223
256
  @media (max-width: ${this.getWidthForBreakpointSize("medium")}px) {
224
257
  .${this.builderBlock.id}-breakpoints {
225
- ${_(this.columnStyleObjects.columns.medium)}
258
+ ${C(this.columnStyleObjects.columns.medium)}
226
259
  }
227
260
 
228
261
  .${this.builderBlock.id}-breakpoints > .builder-column {
229
- ${_(this.columnStyleObjects.column.medium)}
262
+ ${C(this.columnStyleObjects.column.medium)}
230
263
  }
231
264
  }
232
265
 
233
266
  @media (max-width: ${this.getWidthForBreakpointSize("small")}px) {
234
267
  .${this.builderBlock.id}-breakpoints {
235
- ${_(this.columnStyleObjects.columns.small)}
268
+ ${C(this.columnStyleObjects.columns.small)}
236
269
  }
237
270
 
238
271
  .${this.builderBlock.id}-breakpoints > .builder-column {
239
- ${_(this.columnStyleObjects.column.small)}
272
+ ${C(this.columnStyleObjects.column.small)}
240
273
  }
241
274
  },
242
275
  `;
@@ -268,7 +301,7 @@ const pe = (e = {}) => {
268
301
  return (this.stackColumnsAt || "tablet") === "tablet" ? e : "inherit";
269
302
  },
270
303
  getWidthForBreakpointSize(e) {
271
- return he(
304
+ return xe(
272
305
  this.customBreakpoints || {}
273
306
  )[e].max;
274
307
  },
@@ -283,42 +316,36 @@ const pe = (e = {}) => {
283
316
  }
284
317
  }
285
318
  };
286
- const g = (e, n) => {
287
- const t = e.__vccOpts || e;
288
- for (const [o, r] of n)
289
- t[o] = r;
290
- return t;
291
- };
292
- function xe(e, n, t, o, r, s) {
293
- const i = k("render-inlined-styles"), c = k("render-blocks");
294
- return l(), u("div", {
319
+ function Ie(e, n, t, o, r, s) {
320
+ const a = k("render-inlined-styles"), i = k("render-blocks");
321
+ return d(), u("div", {
295
322
  class: j(
296
323
  s._classStringToObject(
297
- `builder-columns ${t.builderBlock.id}-breakpoints div-7fq9d0i380`
324
+ `builder-columns ${t.builderBlock.id}-breakpoints div-1eih9th5ow6`
298
325
  )
299
326
  ),
300
- style: w({
327
+ style: I({
301
328
  ...r.TARGET === "reactNative" ? s.reactNativeColumnsStyles : {},
302
329
  ...s.columnsCssVars
303
330
  })
304
331
  }, [
305
- r.TARGET !== "reactNative" ? (l(), I(i, {
332
+ r.TARGET !== "reactNative" ? (d(), T(a, {
306
333
  key: 0,
307
334
  styles: s.columnsStyles
308
335
  }, null, 8, ["styles"])) : b("", !0),
309
- (l(!0), u(R, null, O(t.columns, (a, d) => (l(), u("div", {
310
- key: d,
311
- class: "builder-column div-7fq9d0i380-2",
312
- style: w({
313
- width: s.getColumnCssWidth(d),
314
- marginLeft: `${d === 0 ? 0 : s.getGutterSize()}px`,
336
+ (d(!0), u(E, null, F(t.columns, (c, l) => (d(), u("div", {
337
+ key: l,
338
+ class: "builder-column div-1eih9th5ow6-2",
339
+ style: I({
340
+ width: s.getColumnCssWidth(l),
341
+ marginLeft: `${l === 0 ? 0 : s.getGutterSize()}px`,
315
342
  ...r.TARGET === "reactNative" ? s.reactNativeColumnStyles : {},
316
343
  ...s.columnCssVars
317
344
  })
318
345
  }, [
319
- X(c, {
320
- blocks: a.blocks,
321
- path: `component.options.columns.${d}.blocks`,
346
+ Q(i, {
347
+ blocks: c.blocks,
348
+ path: `component.options.columns.${l}.blocks`,
322
349
  parent: t.builderBlock.id,
323
350
  styleProp: {
324
351
  flexGrow: "1"
@@ -327,40 +354,49 @@ function xe(e, n, t, o, r, s) {
327
354
  ], 4))), 128))
328
355
  ], 6);
329
356
  }
330
- const ke = /* @__PURE__ */ g(ve, [["render", xe], ["__scopeId", "data-v-1c640f4f"]]);
331
- function z(e) {
357
+ const Te = /* @__PURE__ */ g(we, [["render", Ie], ["__scopeId", "data-v-8bc87868"]]), Re = {
358
+ name: "builder-fragment-component",
359
+ props: []
360
+ };
361
+ function Ee(e, n, t, o, r, s) {
362
+ return d(), u("span", null, [
363
+ A(e.$slots, "default")
364
+ ]);
365
+ }
366
+ const Ae = /* @__PURE__ */ g(Re, [["render", Ee]]);
367
+ function H(e) {
332
368
  return e.replace(/http(s)?:/, "");
333
369
  }
334
- function Ce(e = "", n, t) {
370
+ function je(e = "", n, t) {
335
371
  const o = new RegExp("([?&])" + n + "=.*?(&|$)", "i"), r = e.indexOf("?") !== -1 ? "&" : "?";
336
372
  return e.match(o) ? e.replace(o, "$1" + n + "=" + encodeURIComponent(t) + "$2") : e + r + n + "=" + encodeURIComponent(t);
337
373
  }
338
- function Se(e, n) {
374
+ function Pe(e, n) {
339
375
  if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !n)
340
376
  return e;
341
377
  if (n === "master")
342
- return z(e);
378
+ return H(e);
343
379
  const t = e.match(
344
380
  /(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i
345
381
  );
346
382
  if (t) {
347
383
  const o = e.split(t[0]), r = t[3], s = n.match("x") ? n : `${n}x`;
348
- return z(`${o[0]}_${s}${r}`);
384
+ return H(`${o[0]}_${s}${r}`);
349
385
  }
350
386
  return null;
351
387
  }
352
- function F(e) {
388
+ function O(e) {
353
389
  if (!e)
354
390
  return e;
355
391
  const n = [100, 200, 400, 800, 1200, 1600, 2e3];
356
392
  if (e.match(/builder\.io/)) {
357
393
  let t = e;
358
394
  const o = Number(e.split("?width=")[1]);
359
- return isNaN(o) || (t = `${t} ${o}w`), n.filter((r) => r !== o).map((r) => `${Ce(e, "width", r)} ${r}w`).concat([t]).join(", ");
395
+ return isNaN(o) || (t = `${t} ${o}w`), n.filter((r) => r !== o).map((r) => `${je(e, "width", r)} ${r}w`).concat([t]).join(", ");
360
396
  }
361
- return e.match(/cdn\.shopify\.com/) ? n.map((t) => [Se(e, `${t}x${t}`), t]).filter(([t]) => !!t).map(([t, o]) => `${t} ${o}w`).concat([e]).join(", ") : e;
397
+ return e.match(/cdn\.shopify\.com/) ? n.map((t) => [Pe(e, `${t}x${t}`), t]).filter(([t]) => !!t).map(([t, o]) => `${t} ${o}w`).concat([e]).join(", ") : e;
362
398
  }
363
- const _e = {
399
+ const Oe = {
364
400
  name: "builder-image",
365
401
  props: [
366
402
  "image",
@@ -384,10 +420,10 @@ const _e = {
384
420
  return this.srcset;
385
421
  if (this.srcset && ((t = this.image) == null ? void 0 : t.includes("builder.io/api/v1/image"))) {
386
422
  if (!this.srcset.includes(this.image.split("?")[0]))
387
- return console.debug("Removed given srcset"), F(n);
423
+ return console.debug("Removed given srcset"), O(n);
388
424
  } else if (this.image && !this.srcset)
389
- return F(n);
390
- return F(n);
425
+ return O(n);
426
+ return O(n);
391
427
  },
392
428
  webpSrcSet() {
393
429
  var e;
@@ -416,457 +452,165 @@ const _e = {
416
452
  }
417
453
  }
418
454
  };
419
- const we = ["srcset"], Ie = ["alt", "role", "src", "srcset", "sizes"], Te = {
455
+ const Fe = ["srcset"], Be = ["alt", "role", "src", "srcset", "sizes"], Ue = {
420
456
  key: 2,
421
- class: "div-2pqqf5a7788-2"
457
+ class: "div-2btisl9m7v3-2"
422
458
  };
423
- function Re(e, n, t, o, r, s) {
424
- var i, c, a, d;
425
- return l(), u(R, null, [
426
- L("picture", null, [
427
- s.webpSrcSet ? (l(), u("source", {
459
+ function Ve(e, n, t, o, r, s) {
460
+ var a, i, c, l;
461
+ return d(), u(E, null, [
462
+ $("picture", null, [
463
+ s.webpSrcSet ? (d(), u("source", {
428
464
  key: 0,
429
465
  type: "image/webp",
430
466
  srcset: s.webpSrcSet
431
- }, null, 8, we)) : b("", !0),
432
- L("img", {
467
+ }, null, 8, Fe)) : b("", !0),
468
+ $("img", {
433
469
  loading: "lazy",
434
470
  alt: t.altText,
435
471
  role: t.altText ? "presentation" : void 0,
436
- style: w({
472
+ style: I({
437
473
  objectPosition: t.backgroundPosition || "center",
438
474
  objectFit: t.backgroundSize || "cover",
439
475
  ...s.aspectRatioCss
440
476
  }),
441
477
  class: j(
442
478
  s._classStringToObject(
443
- "builder-image" + (t.className ? " " + t.className : "") + " img-2pqqf5a7788"
479
+ "builder-image" + (t.className ? " " + t.className : "") + " img-2btisl9m7v3"
444
480
  )
445
481
  ),
446
482
  src: t.image,
447
483
  srcset: s.srcSetToUse,
448
484
  sizes: t.sizes
449
- }, null, 14, Ie)
485
+ }, null, 14, Be)
450
486
  ]),
451
- t.aspectRatio && !(((c = (i = t.builderBlock) == null ? void 0 : i.children) == null ? void 0 : c.length) && t.fitContent) ? (l(), u("div", {
487
+ t.aspectRatio && !(((i = (a = t.builderBlock) == null ? void 0 : a.children) == null ? void 0 : i.length) && t.fitContent) ? (d(), u("div", {
452
488
  key: 0,
453
- class: "builder-image-sizer div-2pqqf5a7788",
454
- style: w({
489
+ class: "builder-image-sizer div-2btisl9m7v3",
490
+ style: I({
455
491
  paddingTop: t.aspectRatio * 100 + "%"
456
492
  })
457
493
  }, null, 4)) : b("", !0),
458
- ((d = (a = t.builderBlock) == null ? void 0 : a.children) == null ? void 0 : d.length) && t.fitContent ? E(e.$slots, "default", { key: 1 }, void 0, !0) : b("", !0),
459
- !t.fitContent && e.children ? (l(), u("div", Te, [
460
- E(e.$slots, "default", {}, void 0, !0)
494
+ ((l = (c = t.builderBlock) == null ? void 0 : c.children) == null ? void 0 : l.length) && t.fitContent ? A(e.$slots, "default", { key: 1 }, void 0, !0) : b("", !0),
495
+ !t.fitContent && e.children ? (d(), u("div", Ue, [
496
+ A(e.$slots, "default", {}, void 0, !0)
461
497
  ])) : b("", !0)
462
498
  ], 64);
463
499
  }
464
- const Ee = /* @__PURE__ */ g(_e, [["render", Re], ["__scopeId", "data-v-50c3283d"]]), je = {
465
- name: "builder-text",
466
- props: ["text"]
467
- }, Be = ["innerHTML"];
468
- function Fe(e, n, t, o, r, s) {
469
- return l(), u("span", {
470
- class: "builder-text",
471
- innerHTML: t.text
472
- }, null, 8, Be);
473
- }
474
- const Oe = /* @__PURE__ */ g(je, [["render", Fe]]), Ae = {
475
- name: "builder-video",
476
- props: [
477
- "autoPlay",
478
- "muted",
479
- "controls",
480
- "loop",
481
- "playsInline",
482
- "attributes",
483
- "fit",
484
- "position",
485
- "video",
486
- "posterImage"
487
- ],
488
- computed: {
489
- videoProps() {
490
- return {
491
- ...this.autoPlay === !0 ? {
492
- autoPlay: !0
493
- } : {},
494
- ...this.muted === !0 ? {
495
- muted: !0
496
- } : {},
497
- ...this.controls === !0 ? {
498
- controls: !0
499
- } : {},
500
- ...this.loop === !0 ? {
501
- loop: !0
502
- } : {},
503
- ...this.playsInline === !0 ? {
504
- playsInline: !0
505
- } : {}
506
- };
507
- },
508
- spreadProps() {
509
- return {
510
- ...this.attributes,
511
- ...this.videoProps
512
- };
513
- }
514
- }
515
- }, Pe = ["src", "poster"];
516
- function Ue(e, n, t, o, r, s) {
517
- var i;
518
- return l(), u("video", S({
519
- style: {
520
- width: "100%",
521
- height: "100%",
522
- ...(i = t.attributes) == null ? void 0 : i.style,
523
- objectFit: t.fit,
524
- objectPosition: t.position,
525
- borderRadius: 1
526
- },
527
- src: t.video || "no-src",
528
- poster: t.posterImage
529
- }, s.spreadProps), null, 16, Pe);
530
- }
531
- const $e = /* @__PURE__ */ g(Ae, [["render", Ue]]), Ve = Symbol(), $ = {
500
+ const We = /* @__PURE__ */ g(Oe, [["render", Ve], ["__scopeId", "data-v-44c710e2"]]), Ne = Symbol(), W = {
532
501
  Builder: {
533
502
  content: null,
534
503
  context: {},
535
504
  state: {},
505
+ setState() {
506
+ },
536
507
  apiKey: null,
537
508
  registeredComponents: {},
538
509
  inheritedStyles: {}
539
510
  },
540
- key: Ve
511
+ key: Ne
541
512
  };
542
513
  function Le() {
543
- return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
544
- }
545
- function We() {
546
- const e = Le().fetch;
547
- if (typeof e > "u")
548
- throw console.warn(
549
- `Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
550
- For more information, read https://github.com/BuilderIO/this-package-uses-fetch`
551
- ), new Error("Builder SDK could not find a global `fetch` function");
552
- return e;
553
- }
554
- const Q = We(), Me = (e) => {
555
- if (e === "localhost" || e === "127.0.0.1")
556
- return e;
557
- const n = e.split(".");
558
- return n.length > 2 ? n.slice(1).join(".") : e;
559
- }, Z = async ({
560
- name: e,
561
- canTrack: n
562
- }) => {
563
- var t;
564
- try {
565
- return n ? (t = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : t.split("=")[1] : void 0;
566
- } catch (o) {
567
- console.debug("[COOKIE] GET error: ", o);
568
- return;
569
- }
570
- }, Ne = (e) => e.map(([n, t]) => t ? `${n}=${t}` : n).filter(C).join("; "), ze = [
571
- ["secure", ""],
572
- ["SameSite", "None"]
573
- ], Ke = ({
574
- name: e,
575
- value: n,
576
- expires: t
577
- }) => {
578
- const r = (f() ? location.protocol === "https:" : !0) ? ze : [[]], s = t ? [["expires", t.toUTCString()]] : [[]], i = [
579
- [e, n],
580
- ...s,
581
- ["path", "/"],
582
- ["domain", Me(window.location.hostname)],
583
- ...r
584
- ];
585
- return Ne(i);
586
- }, ee = async ({
587
- name: e,
588
- value: n,
589
- expires: t,
590
- canTrack: o
591
- }) => {
592
- try {
593
- if (!o)
594
- return;
595
- const r = Ke({ name: e, value: n, expires: t });
596
- document.cookie = r;
597
- } catch (r) {
598
- console.warn("[COOKIE] SET error: ", r);
599
- }
600
- }, He = "builderio.variations", te = (e) => `${He}.${e}`, qe = ({
601
- contentId: e,
602
- canTrack: n
603
- }) => Z({ name: te(e), canTrack: n }), De = ({
604
- contentId: e,
605
- canTrack: n,
606
- value: t
607
- }) => ee({ name: te(e), value: t, canTrack: n }), Ge = (e) => C(e.id) && C(e.variations) && Object.keys(e.variations).length > 0, Je = ({
608
- id: e,
609
- variations: n
610
- }) => {
611
- var r;
612
- let t = 0;
613
- const o = Math.random();
614
- for (const s in n)
615
- if (t += (r = n[s]) == null ? void 0 : r.testRatio, o < t)
616
- return s;
617
- return e;
618
- }, K = ({
619
- item: e,
620
- testGroupId: n
621
- }) => {
622
- const t = e.variations[n];
623
- return n === e.id || !t ? {
624
- testVariationId: e.id,
625
- testVariationName: "Default"
626
- } : {
627
- data: t.data,
628
- testVariationId: t.id,
629
- testVariationName: t.name || (t.id === e.id ? "Default" : "")
630
- };
631
- }, Xe = async ({
632
- item: e,
633
- canTrack: n
634
- }) => {
635
- const t = await qe({
636
- canTrack: n,
637
- contentId: e.id
638
- }), o = t ? K({ item: e, testGroupId: t }) : void 0;
639
- if (o)
640
- return o;
641
- {
642
- const r = Je({
643
- variations: e.variations,
644
- id: e.id
645
- });
646
- return De({
647
- contentId: e.id,
648
- value: r,
649
- canTrack: n
650
- }).catch((s) => {
651
- console.error("could not store A/B test variation: ", s);
652
- }), K({ item: e, testGroupId: r });
653
- }
654
- }, Ye = async ({
655
- item: e,
656
- canTrack: n
657
- }) => {
658
- if (!Ge(e))
659
- return;
660
- const t = await Xe({ item: e, canTrack: n });
661
- Object.assign(e, t);
662
- };
663
- function A(e, n = null, t = ".") {
664
- return Object.keys(e).reduce((o, r) => {
665
- const s = e[r], i = [n, r].filter(Boolean).join(t);
666
- return [
667
- typeof s == "object",
668
- s !== null,
669
- !(Array.isArray(s) && s.length === 0)
670
- ].every(Boolean) ? { ...o, ...A(s, i, t) } : { ...o, [i]: s };
671
- }, {});
672
- }
673
- const H = "builder.", Qe = "options.", Ze = (e) => {
674
- const n = {};
675
- return e.forEach((t, o) => {
676
- n[o] = t;
677
- }), n;
678
- }, et = (e) => {
679
- if (!e)
680
- return {};
681
- const n = ne(e), t = {};
682
- return Object.keys(n).forEach((o) => {
683
- if (o.startsWith(H)) {
684
- const r = o.replace(H, "").replace(Qe, "");
685
- t[r] = n[o];
686
- }
687
- }), t;
688
- }, tt = () => {
689
- if (!f())
690
- return {};
691
- const e = new URLSearchParams(window.location.search);
692
- return et(e);
693
- }, ne = (e) => e instanceof URLSearchParams ? Ze(e) : e, nt = (e) => {
694
- const {
695
- limit: n = 30,
696
- userAttributes: t,
697
- query: o,
698
- noTraverse: r = !1,
699
- model: s,
700
- apiKey: i,
701
- includeRefs: c = !0,
702
- locale: a
703
- } = e;
704
- if (!i)
705
- throw new Error("Missing API key");
706
- const d = new URL(
707
- `https://cdn.builder.io/api/v2/content/${s}?apiKey=${i}&limit=${n}&noTraverse=${r}&includeRefs=${c}${a ? `&locale=${a}` : ""}`
708
- ), m = {
709
- ...tt(),
710
- ...ne(e.options || {})
711
- }, p = A(m);
712
- for (const h in p)
713
- d.searchParams.set(h, String(p[h]));
714
- if (t && d.searchParams.set("userAttributes", JSON.stringify(t)), o) {
715
- const h = A({ query: o });
716
- for (const v in h)
717
- d.searchParams.set(v, JSON.stringify(h[v]));
718
- }
719
- return d;
720
- };
721
- async function oe(e) {
722
- return (await ot({ ...e, limit: 1 })).results[0] || null;
514
+ return f() && window.self !== window.top;
723
515
  }
724
- async function ot(e) {
725
- const n = nt(e), o = await (await Q(n.href)).json(), r = e.canTrack !== !1;
726
- if (r && Array.isArray(o.results))
727
- for (const s of o.results)
728
- await Ye({ item: s, canTrack: r });
729
- return o;
516
+ function y() {
517
+ return Le() && window.location.search.indexOf("builder.frameEditing=") !== -1;
730
518
  }
731
- const st = () => Promise.resolve().then(() => xn).then((e) => e.default).catch((e) => {
519
+ const Me = () => import("./block-styles.5fb6e927.js").then((e) => e.default).catch((e) => {
732
520
  throw console.error(
733
- "Error while attempting to dynamically import component RenderContent at ../../components/render-content/render-content.vue",
521
+ "Error while attempting to dynamically import component BlockStyles at ./render-block/block-styles.vue",
734
522
  e
735
523
  ), e;
736
- }), rt = {
737
- name: "builder-symbol",
738
- components: { RenderContent: x(st) },
739
- props: ["attributes", "symbol", "dynamic"],
740
- data() {
741
- return { fetchedContent: null };
524
+ }), $e = () => import("./render-block.017ccb02.js").then((e) => e.default).catch((e) => {
525
+ throw console.error(
526
+ "Error while attempting to dynamically import component RenderBlock at ./render-block/render-block.vue",
527
+ e
528
+ ), e;
529
+ }), ze = {
530
+ name: "render-blocks",
531
+ components: {
532
+ RenderBlock: x($e),
533
+ BlockStyles: x(Me)
742
534
  },
535
+ props: ["blocks", "parent", "path", "styleProp"],
743
536
  inject: {
744
- builderContext: $.key
745
- },
746
- watch: {
747
- onUpdateHook0: {
748
- handler() {
749
- var n;
750
- const e = this.symbol;
751
- e && !e.content && !this.fetchedContent && e.model && ((n = this.builderContext) == null ? void 0 : n.apiKey) && oe({
752
- model: e.model,
753
- apiKey: this.builderContext.apiKey,
754
- query: {
755
- id: e.entry
756
- }
757
- }).then((t) => {
758
- this.fetchedContent = t;
759
- });
760
- },
761
- immediate: !0
762
- }
537
+ builderContext: W.key
763
538
  },
764
539
  computed: {
765
540
  className() {
766
- var e, n;
767
- return [
768
- ...Object.keys(this.attributes.class),
769
- "builder-symbol",
770
- (e = this.symbol) != null && e.inline ? "builder-inline-symbol" : void 0,
771
- ((n = this.symbol) == null ? void 0 : n.dynamic) || this.dynamic ? "builder-dynamic-symbol" : void 0
772
- ].filter(Boolean).join(" ");
773
- },
774
- contentToUse() {
775
541
  var e;
776
- return ((e = this.symbol) == null ? void 0 : e.content) || this.fetchedContent;
777
- },
778
- onUpdateHook0() {
779
- return {
780
- 0: this.symbol,
781
- 1: this.fetchedContent
782
- };
542
+ return "builder-blocks" + ((e = this.blocks) != null && e.length ? "" : " no-blocks");
783
543
  }
784
544
  },
785
545
  methods: {
786
- _classStringToObject(e) {
787
- const n = {};
788
- if (typeof e != "string")
789
- return n;
790
- const t = e.trim().split(/\s+/);
791
- for (const o of t)
792
- n[o] = !0;
793
- return n;
794
- }
795
- }
796
- }, it = ["dataSet"];
797
- function at(e, n, t, o, r, s) {
798
- var c, a, d, m, p;
799
- const i = k("render-content");
800
- return l(), u("div", S({
801
- dataSet: {
802
- class: s.className
803
- },
804
- class: s._classStringToObject(s.className)
805
- }, t.attributes), [
806
- X(i, {
807
- apiKey: s.builderContext.apiKey,
808
- context: s.builderContext.context,
809
- customComponents: Object.values(s.builderContext.registeredComponents),
810
- data: {
811
- ...(c = t.symbol) == null ? void 0 : c.data,
812
- ...s.builderContext.state,
813
- ...(m = (d = (a = t.symbol) == null ? void 0 : a.content) == null ? void 0 : d.data) == null ? void 0 : m.state
814
- },
815
- model: (p = t.symbol) == null ? void 0 : p.model,
816
- content: s.contentToUse
817
- }, null, 8, ["apiKey", "context", "customComponents", "data", "model", "content"])
818
- ], 16, it);
819
- }
820
- const ct = /* @__PURE__ */ g(rt, [["render", at]]), lt = {
821
- name: "builder-button",
822
- props: ["attributes", "text", "link", "openLinkInNewTab"]
823
- };
824
- const dt = ["href", "target"];
825
- function ut(e, n, t, o, r, s) {
826
- return t.link ? (l(), u("a", S({
827
- key: 0,
828
- role: "button",
829
- href: t.link,
830
- target: t.openLinkInNewTab ? "_blank" : void 0
831
- }, t.attributes), W(t.text), 17, dt)) : (l(), u("button", S({
832
- key: 1,
833
- class: "button-4o9pb21oca6"
834
- }, t.attributes), W(t.text), 17));
835
- }
836
- const mt = /* @__PURE__ */ g(lt, [["render", ut], ["__scopeId", "data-v-f9067262"]]), pt = {
837
- name: "builder-section-component",
838
- props: ["attributes", "maxWidth"]
839
- };
840
- function ht(e, n, t, o, r, s) {
841
- return l(), u("section", S({
842
- style: {
843
- width: "100%",
844
- alignSelf: "stretch",
845
- flexGrow: "1",
846
- boxSizing: "border-box",
847
- maxWidth: `${t.maxWidth && typeof t.maxWidth == "number" ? t.maxWidth : 1200}px`,
848
- display: "flex",
849
- flexDirection: "column",
850
- alignItems: "stretch",
851
- marginLeft: "auto",
852
- marginRight: "auto"
546
+ onClick() {
547
+ var e, n;
548
+ y() && !((e = this.blocks) != null && e.length) && ((n = window.parent) == null || n.postMessage(
549
+ {
550
+ type: "builder.clickEmptyBlocks",
551
+ data: {
552
+ parentElementId: this.parent,
553
+ dataPath: this.path
554
+ }
555
+ },
556
+ "*"
557
+ ));
558
+ },
559
+ onMouseEnter() {
560
+ var e, n;
561
+ y() && !((e = this.blocks) != null && e.length) && ((n = window.parent) == null || n.postMessage(
562
+ {
563
+ type: "builder.hoverEmptyBlocks",
564
+ data: {
565
+ parentElementId: this.parent,
566
+ dataPath: this.path
567
+ }
568
+ },
569
+ "*"
570
+ ));
571
+ },
572
+ _classStringToObject(e) {
573
+ const n = {};
574
+ if (typeof e != "string")
575
+ return n;
576
+ const t = e.trim().split(/\s+/);
577
+ for (const o of t)
578
+ n[o] = !0;
579
+ return n;
853
580
  }
854
- }, t.attributes), [
855
- E(e.$slots, "default")
856
- ], 16);
857
- }
858
- const ft = /* @__PURE__ */ g(pt, [["render", ht]]), gt = {
859
- name: "builder-fragment-component",
860
- props: []
581
+ }
861
582
  };
862
- function bt(e, n, t, o, r, s) {
863
- return l(), u("span", null, [
864
- E(e.$slots, "default")
865
- ]);
583
+ const Ke = ["builder-path", "builder-parent-id", "dataSet"];
584
+ function He(e, n, t, o, r, s) {
585
+ const a = k("render-block"), i = k("block-styles");
586
+ return d(), u("div", {
587
+ class: j(s._classStringToObject(s.className + " div-20vehov4ay6")),
588
+ "builder-path": t.path,
589
+ "builder-parent-id": t.parent,
590
+ dataSet: {
591
+ class: s.className
592
+ },
593
+ style: I(t.styleProp),
594
+ onClick: n[0] || (n[0] = (c) => s.onClick()),
595
+ onMouseenter: n[1] || (n[1] = (c) => s.onMouseEnter())
596
+ }, [
597
+ t.blocks ? (d(!0), u(E, { key: 0 }, F(t.blocks, (c, l) => (d(), T(a, {
598
+ key: "render-block-" + c.id,
599
+ block: c,
600
+ context: s.builderContext
601
+ }, null, 8, ["block", "context"]))), 128)) : b("", !0),
602
+ t.blocks ? (d(!0), u(E, { key: 1 }, F(t.blocks, (c, l) => (d(), T(i, {
603
+ key: "block-style-" + c.id,
604
+ block: c,
605
+ context: s.builderContext
606
+ }, null, 8, ["block", "context"]))), 128)) : b("", !0)
607
+ ], 46, Ke);
866
608
  }
867
- const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
609
+ const De = /* @__PURE__ */ g(ze, [["render", He], ["__scopeId", "data-v-b5395d79"]]), ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
610
+ __proto__: null,
611
+ default: De
612
+ }, Symbol.toStringTag, { value: "Module" })), qe = {
868
613
  name: "Core:Button",
869
- builtIn: !0,
870
614
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
871
615
  defaultStyles: {
872
616
  appearance: "none",
@@ -901,12 +645,11 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
901
645
  ],
902
646
  static: !0,
903
647
  noWrap: !0
904
- }, B = (e) => {
648
+ }, P = (e) => {
905
649
  const n = e.toString().trim();
906
650
  return `return (${!n.startsWith("function") && !n.startsWith("(") ? "function " : ""}${n}).apply(this, arguments)`;
907
- }, xt = {
651
+ }, Ge = {
908
652
  name: "Columns",
909
- builtIn: !0,
910
653
  inputs: [
911
654
  {
912
655
  name: "columns",
@@ -1092,7 +835,7 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1092
835
  ]
1093
836
  }
1094
837
  ],
1095
- onChange: B((e) => {
838
+ onChange: P((e) => {
1096
839
  function n() {
1097
840
  t.forEach((o) => {
1098
841
  o.delete("width");
@@ -1103,7 +846,7 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1103
846
  (r) => r.get("width")
1104
847
  ) && (!!t.find(
1105
848
  (s) => !s.get("width")
1106
- ) || t.reduce((c, a) => c + a.get("width"), 0) !== 100) && n();
849
+ ) || t.reduce((i, c) => i + c.get("width"), 0) !== 100) && n();
1107
850
  })
1108
851
  },
1109
852
  {
@@ -1129,17 +872,15 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1129
872
  advanced: !0
1130
873
  }
1131
874
  ]
1132
- }, kt = {
875
+ }, Je = {
1133
876
  name: "Fragment",
1134
877
  static: !0,
1135
878
  hidden: !0,
1136
- builtIn: !0,
1137
879
  canHaveChildren: !0,
1138
880
  noWrap: !0
1139
- }, Ct = {
881
+ }, Xe = {
1140
882
  name: "Image",
1141
883
  static: !0,
1142
- builtIn: !0,
1143
884
  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",
1144
885
  defaultStyles: {
1145
886
  position: "relative",
@@ -1156,32 +897,32 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1156
897
  allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
1157
898
  required: !0,
1158
899
  defaultValue: "https://cdn.builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1159
- onChange: B(
900
+ onChange: P(
1160
901
  (e) => {
1161
902
  e.delete("srcset"), e.delete("noWebp");
1162
- function t(i, c = 6e4) {
1163
- return new Promise((a, d) => {
903
+ function t(a, i = 6e4) {
904
+ return new Promise((c, l) => {
1164
905
  const m = document.createElement("img");
1165
906
  let p = !1;
1166
907
  m.onload = () => {
1167
- p = !0, a(m);
908
+ p = !0, c(m);
1168
909
  }, m.addEventListener("error", (h) => {
1169
- console.warn("Image load failed", h.error), d(h.error);
1170
- }), m.src = i, setTimeout(() => {
1171
- p || d(new Error("Image load timed out"));
1172
- }, c);
910
+ console.warn("Image load failed", h.error), l(h.error);
911
+ }), m.src = a, setTimeout(() => {
912
+ p || l(new Error("Image load timed out"));
913
+ }, i);
1173
914
  });
1174
915
  }
1175
- function o(i) {
1176
- return Math.round(i * 1e3) / 1e3;
916
+ function o(a) {
917
+ return Math.round(a * 1e3) / 1e3;
1177
918
  }
1178
919
  const r = e.get("image"), s = e.get("aspectRatio");
1179
- if (fetch(r).then((i) => i.blob()).then((i) => {
1180
- i.type.includes("svg") && e.set("noWebp", !0);
920
+ if (fetch(r).then((a) => a.blob()).then((a) => {
921
+ a.type.includes("svg") && e.set("noWebp", !0);
1181
922
  }), r && (!s || s === 0.7041))
1182
- return t(r).then((i) => {
1183
- const c = e.get("aspectRatio");
1184
- e.get("image") === r && (!c || c === 0.7041) && i.width && i.height && (e.set("aspectRatio", o(i.height / i.width)), e.set("height", i.height), e.set("width", i.width));
923
+ return t(r).then((a) => {
924
+ const i = e.get("aspectRatio");
925
+ e.get("image") === r && (!i || i === 0.7041) && a.width && a.height && (e.set("aspectRatio", o(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
1185
926
  });
1186
927
  }
1187
928
  )
@@ -1264,10 +1005,9 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1264
1005
  defaultValue: 0.7041
1265
1006
  }
1266
1007
  ]
1267
- }, St = {
1008
+ }, Ye = {
1268
1009
  name: "Core:Section",
1269
1010
  static: !0,
1270
- builtIn: !0,
1271
1011
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
1272
1012
  inputs: [
1273
1013
  {
@@ -1308,50 +1048,371 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1308
1048
  }
1309
1049
  }
1310
1050
  }
1311
- ]
1312
- }, _t = {
1313
- name: "Symbol",
1314
- noWrap: !0,
1315
- static: !0,
1316
- builtIn: !0,
1317
- inputs: [
1318
- {
1319
- name: "symbol",
1320
- type: "uiSymbol"
1321
- },
1322
- {
1323
- name: "dataOnly",
1324
- helperText: "Make this a data symbol that doesn't display any UI",
1325
- type: "boolean",
1326
- defaultValue: !1,
1327
- advanced: !0,
1328
- hideFromUI: !0
1051
+ ]
1052
+ }, Qe = {
1053
+ name: "builder-section-component",
1054
+ props: ["maxWidth", "attributes"],
1055
+ methods: {
1056
+ filterAttrs: function(n = {}, t) {
1057
+ const o = "v-on:", r = (i) => i.startsWith(o), s = (i) => !i.startsWith(o), a = (i) => i.replace(o, "");
1058
+ return Object.keys(n).filter(t ? r : s).reduce(
1059
+ (i, c) => ({
1060
+ ...i,
1061
+ [a(c)]: n[c]
1062
+ }),
1063
+ {}
1064
+ );
1065
+ }
1066
+ }
1067
+ };
1068
+ function Ze(e, n, t, o, r, s) {
1069
+ return d(), u("section", _({
1070
+ style: {
1071
+ width: "100%",
1072
+ alignSelf: "stretch",
1073
+ flexGrow: "1",
1074
+ boxSizing: "border-box",
1075
+ maxWidth: `${t.maxWidth && typeof t.maxWidth == "number" ? t.maxWidth : 1200}px`,
1076
+ display: "flex",
1077
+ flexDirection: "column",
1078
+ alignItems: "stretch",
1079
+ marginLeft: "auto",
1080
+ marginRight: "auto"
1081
+ }
1082
+ }, s.filterAttrs(t.attributes, !1), w(s.filterAttrs(t.attributes, !0), !0)), [
1083
+ A(e.$slots, "default")
1084
+ ], 16);
1085
+ }
1086
+ const et = /* @__PURE__ */ g(Qe, [["render", Ze]]), tt = {
1087
+ name: "Symbol",
1088
+ noWrap: !0,
1089
+ static: !0,
1090
+ inputs: [
1091
+ {
1092
+ name: "symbol",
1093
+ type: "uiSymbol"
1094
+ },
1095
+ {
1096
+ name: "dataOnly",
1097
+ helperText: "Make this a data symbol that doesn't display any UI",
1098
+ type: "boolean",
1099
+ defaultValue: !1,
1100
+ advanced: !0,
1101
+ hideFromUI: !0
1102
+ },
1103
+ {
1104
+ name: "inheritState",
1105
+ helperText: "Inherit the parent component state and data",
1106
+ type: "boolean",
1107
+ defaultValue: !1,
1108
+ advanced: !0
1109
+ },
1110
+ {
1111
+ name: "renderToLiquid",
1112
+ helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1113
+ type: "boolean",
1114
+ defaultValue: !1,
1115
+ advanced: !0,
1116
+ hideFromUI: !0
1117
+ },
1118
+ {
1119
+ name: "useChildren",
1120
+ hideFromUI: !0,
1121
+ type: "boolean"
1122
+ }
1123
+ ]
1124
+ };
1125
+ function nt() {
1126
+ return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
1127
+ }
1128
+ function ot() {
1129
+ const e = nt().fetch;
1130
+ if (typeof e > "u")
1131
+ throw console.warn(
1132
+ `Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
1133
+ For more information, read https://github.com/BuilderIO/this-package-uses-fetch`
1134
+ ), new Error("Builder SDK could not find a global `fetch` function");
1135
+ return e;
1136
+ }
1137
+ const te = ot(), st = (e) => {
1138
+ if (e === "localhost" || e === "127.0.0.1")
1139
+ return e;
1140
+ const n = e.split(".");
1141
+ return n.length > 2 ? n.slice(1).join(".") : e;
1142
+ }, ne = async ({
1143
+ name: e,
1144
+ canTrack: n
1145
+ }) => {
1146
+ var t;
1147
+ try {
1148
+ return n ? (t = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : t.split("=")[1] : void 0;
1149
+ } catch (o) {
1150
+ console.debug("[COOKIE] GET error: ", o);
1151
+ return;
1152
+ }
1153
+ }, rt = (e) => e.map(([n, t]) => t ? `${n}=${t}` : n).filter(S).join("; "), it = [
1154
+ ["secure", ""],
1155
+ ["SameSite", "None"]
1156
+ ], at = ({
1157
+ name: e,
1158
+ value: n,
1159
+ expires: t
1160
+ }) => {
1161
+ const r = (f() ? location.protocol === "https:" : !0) ? it : [[]], s = t ? [["expires", t.toUTCString()]] : [[]], a = [
1162
+ [e, n],
1163
+ ...s,
1164
+ ["path", "/"],
1165
+ ["domain", st(window.location.hostname)],
1166
+ ...r
1167
+ ];
1168
+ return rt(a);
1169
+ }, oe = async ({
1170
+ name: e,
1171
+ value: n,
1172
+ expires: t,
1173
+ canTrack: o
1174
+ }) => {
1175
+ try {
1176
+ if (!o)
1177
+ return;
1178
+ const r = at({ name: e, value: n, expires: t });
1179
+ document.cookie = r;
1180
+ } catch (r) {
1181
+ console.warn("[COOKIE] SET error: ", r);
1182
+ }
1183
+ }, ct = "builderio.variations", se = (e) => `${ct}.${e}`, lt = ({
1184
+ contentId: e,
1185
+ canTrack: n
1186
+ }) => ne({ name: se(e), canTrack: n }), dt = ({
1187
+ contentId: e,
1188
+ canTrack: n,
1189
+ value: t
1190
+ }) => oe({ name: se(e), value: t, canTrack: n }), ut = (e) => S(e.id) && S(e.variations) && Object.keys(e.variations).length > 0, mt = ({
1191
+ id: e,
1192
+ variations: n
1193
+ }) => {
1194
+ var r;
1195
+ let t = 0;
1196
+ const o = Math.random();
1197
+ for (const s in n)
1198
+ if (t += (r = n[s]) == null ? void 0 : r.testRatio, o < t)
1199
+ return s;
1200
+ return e;
1201
+ }, D = ({
1202
+ item: e,
1203
+ testGroupId: n
1204
+ }) => {
1205
+ const t = e.variations[n];
1206
+ return n === e.id || !t ? {
1207
+ testVariationId: e.id,
1208
+ testVariationName: "Default"
1209
+ } : {
1210
+ data: t.data,
1211
+ testVariationId: t.id,
1212
+ testVariationName: t.name || (t.id === e.id ? "Default" : "")
1213
+ };
1214
+ }, pt = async ({
1215
+ item: e,
1216
+ canTrack: n
1217
+ }) => {
1218
+ const t = await lt({
1219
+ canTrack: n,
1220
+ contentId: e.id
1221
+ }), o = t ? D({ item: e, testGroupId: t }) : void 0;
1222
+ if (o)
1223
+ return o;
1224
+ {
1225
+ const r = mt({
1226
+ variations: e.variations,
1227
+ id: e.id
1228
+ });
1229
+ return dt({
1230
+ contentId: e.id,
1231
+ value: r,
1232
+ canTrack: n
1233
+ }).catch((s) => {
1234
+ console.error("could not store A/B test variation: ", s);
1235
+ }), D({ item: e, testGroupId: r });
1236
+ }
1237
+ }, ht = async ({
1238
+ item: e,
1239
+ canTrack: n
1240
+ }) => {
1241
+ if (!ut(e))
1242
+ return;
1243
+ const t = await pt({ item: e, canTrack: n });
1244
+ Object.assign(e, t);
1245
+ };
1246
+ function B(e, n = null, t = ".") {
1247
+ return Object.keys(e).reduce((o, r) => {
1248
+ const s = e[r], a = [n, r].filter(Boolean).join(t);
1249
+ return [
1250
+ typeof s == "object",
1251
+ s !== null,
1252
+ !(Array.isArray(s) && s.length === 0)
1253
+ ].every(Boolean) ? { ...o, ...B(s, a, t) } : { ...o, [a]: s };
1254
+ }, {});
1255
+ }
1256
+ const q = "builder.", ft = "options.", gt = (e) => {
1257
+ const n = {};
1258
+ return e.forEach((t, o) => {
1259
+ n[o] = t;
1260
+ }), n;
1261
+ }, bt = (e) => {
1262
+ if (!e)
1263
+ return {};
1264
+ const n = re(e), t = {};
1265
+ return Object.keys(n).forEach((o) => {
1266
+ if (o.startsWith(q)) {
1267
+ const r = o.replace(q, "").replace(ft, "");
1268
+ t[r] = n[o];
1269
+ }
1270
+ }), t;
1271
+ }, yt = () => {
1272
+ if (!f())
1273
+ return {};
1274
+ const e = new URLSearchParams(window.location.search);
1275
+ return bt(e);
1276
+ }, re = (e) => e instanceof URLSearchParams ? gt(e) : e, vt = (e) => {
1277
+ const {
1278
+ limit: n = 30,
1279
+ userAttributes: t,
1280
+ query: o,
1281
+ noTraverse: r = !1,
1282
+ model: s,
1283
+ apiKey: a,
1284
+ includeRefs: i = !0,
1285
+ locale: c
1286
+ } = e;
1287
+ if (!a)
1288
+ throw new Error("Missing API key");
1289
+ const l = new URL(
1290
+ `https://cdn.builder.io/api/v2/content/${s}?apiKey=${a}&limit=${n}&noTraverse=${r}&includeRefs=${i}${c ? `&locale=${c}` : ""}`
1291
+ ), m = {
1292
+ ...yt(),
1293
+ ...re(e.options || {})
1294
+ }, p = B(m);
1295
+ for (const h in p)
1296
+ l.searchParams.set(h, String(p[h]));
1297
+ if (t && l.searchParams.set("userAttributes", JSON.stringify(t)), o) {
1298
+ const h = B({ query: o });
1299
+ for (const v in h)
1300
+ l.searchParams.set(v, JSON.stringify(h[v]));
1301
+ }
1302
+ return l;
1303
+ };
1304
+ async function ie(e) {
1305
+ return (await xt({ ...e, limit: 1 })).results[0] || null;
1306
+ }
1307
+ async function xt(e) {
1308
+ const n = vt(e), o = await (await te(n.href)).json(), r = e.canTrack !== !1;
1309
+ if (r && Array.isArray(o.results))
1310
+ for (const s of o.results)
1311
+ await ht({ item: s, canTrack: r });
1312
+ return o;
1313
+ }
1314
+ const kt = () => Promise.resolve().then(() => An).then((e) => e.default).catch((e) => {
1315
+ throw console.error(
1316
+ "Error while attempting to dynamically import component RenderContent at ../../components/render-content/render-content.vue",
1317
+ e
1318
+ ), e;
1319
+ }), St = {
1320
+ name: "builder-symbol",
1321
+ components: { RenderContent: x(kt) },
1322
+ props: ["attributes", "symbol", "dynamic"],
1323
+ data() {
1324
+ return { fetchedContent: null };
1325
+ },
1326
+ inject: {
1327
+ builderContext: W.key
1328
+ },
1329
+ watch: {
1330
+ onUpdateHook0: {
1331
+ handler() {
1332
+ var n;
1333
+ const e = this.symbol;
1334
+ e && !e.content && !this.fetchedContent && e.model && ((n = this.builderContext) == null ? void 0 : n.apiKey) && ie({
1335
+ model: e.model,
1336
+ apiKey: this.builderContext.apiKey,
1337
+ query: {
1338
+ id: e.entry
1339
+ }
1340
+ }).then((t) => {
1341
+ this.fetchedContent = t;
1342
+ });
1343
+ },
1344
+ immediate: !0
1345
+ }
1346
+ },
1347
+ computed: {
1348
+ className() {
1349
+ var e, n;
1350
+ return [
1351
+ ...Object.keys(this.attributes.class),
1352
+ "builder-symbol",
1353
+ (e = this.symbol) != null && e.inline ? "builder-inline-symbol" : void 0,
1354
+ ((n = this.symbol) == null ? void 0 : n.dynamic) || this.dynamic ? "builder-dynamic-symbol" : void 0
1355
+ ].filter(Boolean).join(" ");
1329
1356
  },
1330
- {
1331
- name: "inheritState",
1332
- helperText: "Inherit the parent component state and data",
1333
- type: "boolean",
1334
- defaultValue: !1,
1335
- advanced: !0
1357
+ contentToUse() {
1358
+ var e;
1359
+ return ((e = this.symbol) == null ? void 0 : e.content) || this.fetchedContent;
1336
1360
  },
1337
- {
1338
- name: "renderToLiquid",
1339
- helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1340
- type: "boolean",
1341
- defaultValue: !1,
1342
- advanced: !0,
1343
- hideFromUI: !0
1361
+ onUpdateHook0() {
1362
+ return {
1363
+ 0: this.symbol,
1364
+ 1: this.fetchedContent
1365
+ };
1366
+ }
1367
+ },
1368
+ methods: {
1369
+ filterAttrs: function(n = {}, t) {
1370
+ const o = "v-on:", r = (i) => i.startsWith(o), s = (i) => !i.startsWith(o), a = (i) => i.replace(o, "");
1371
+ return Object.keys(n).filter(t ? r : s).reduce(
1372
+ (i, c) => ({
1373
+ ...i,
1374
+ [a(c)]: n[c]
1375
+ }),
1376
+ {}
1377
+ );
1344
1378
  },
1345
- {
1346
- name: "useChildren",
1347
- hideFromUI: !0,
1348
- type: "boolean"
1379
+ _classStringToObject(e) {
1380
+ const n = {};
1381
+ if (typeof e != "string")
1382
+ return n;
1383
+ const t = e.trim().split(/\s+/);
1384
+ for (const o of t)
1385
+ n[o] = !0;
1386
+ return n;
1349
1387
  }
1350
- ]
1351
- }, wt = {
1388
+ }
1389
+ }, _t = ["dataSet"];
1390
+ function Ct(e, n, t, o, r, s) {
1391
+ var i, c, l, m, p;
1392
+ const a = k("render-content");
1393
+ return d(), u("div", _({
1394
+ dataSet: {
1395
+ class: s.className
1396
+ },
1397
+ class: s._classStringToObject(s.className)
1398
+ }, s.filterAttrs(t.attributes, !1), w(s.filterAttrs(t.attributes, !0), !0)), [
1399
+ Q(a, {
1400
+ apiKey: s.builderContext.apiKey,
1401
+ context: s.builderContext.context,
1402
+ customComponents: Object.values(s.builderContext.registeredComponents),
1403
+ data: {
1404
+ ...(i = t.symbol) == null ? void 0 : i.data,
1405
+ ...s.builderContext.state,
1406
+ ...(m = (l = (c = t.symbol) == null ? void 0 : c.content) == null ? void 0 : l.data) == null ? void 0 : m.state
1407
+ },
1408
+ model: (p = t.symbol) == null ? void 0 : p.model,
1409
+ content: s.contentToUse
1410
+ }, null, 8, ["apiKey", "context", "customComponents", "data", "model", "content"])
1411
+ ], 16, _t);
1412
+ }
1413
+ const wt = /* @__PURE__ */ g(St, [["render", Ct]]), It = {
1352
1414
  name: "Text",
1353
1415
  static: !0,
1354
- builtIn: !0,
1355
1416
  image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
1356
1417
  inputs: [
1357
1418
  {
@@ -1368,10 +1429,19 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1368
1429
  height: "auto",
1369
1430
  textAlign: "center"
1370
1431
  }
1371
- }, It = {
1432
+ }, Tt = {
1433
+ name: "builder-text",
1434
+ props: ["text"]
1435
+ }, Rt = ["innerHTML"];
1436
+ function Et(e, n, t, o, r, s) {
1437
+ return d(), u("span", {
1438
+ class: "builder-text",
1439
+ innerHTML: t.text
1440
+ }, null, 8, Rt);
1441
+ }
1442
+ const At = /* @__PURE__ */ g(Tt, [["render", Et]]), jt = {
1372
1443
  name: "Video",
1373
1444
  canHaveChildren: !0,
1374
- builtIn: !0,
1375
1445
  defaultStyles: {
1376
1446
  minHeight: "20px",
1377
1447
  minWidth: "20px"
@@ -1470,10 +1540,66 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1470
1540
  advanced: !0
1471
1541
  }
1472
1542
  ]
1473
- }, Tt = {
1543
+ }, Pt = {
1544
+ name: "builder-video",
1545
+ props: [
1546
+ "autoPlay",
1547
+ "muted",
1548
+ "controls",
1549
+ "loop",
1550
+ "playsInline",
1551
+ "attributes",
1552
+ "fit",
1553
+ "position",
1554
+ "video",
1555
+ "posterImage"
1556
+ ],
1557
+ computed: {
1558
+ videoProps() {
1559
+ return {
1560
+ ...this.autoPlay === !0 ? {
1561
+ autoPlay: !0
1562
+ } : {},
1563
+ ...this.muted === !0 ? {
1564
+ muted: !0
1565
+ } : {},
1566
+ ...this.controls === !0 ? {
1567
+ controls: !0
1568
+ } : {},
1569
+ ...this.loop === !0 ? {
1570
+ loop: !0
1571
+ } : {},
1572
+ ...this.playsInline === !0 ? {
1573
+ playsInline: !0
1574
+ } : {}
1575
+ };
1576
+ },
1577
+ spreadProps() {
1578
+ return {
1579
+ ...this.attributes,
1580
+ ...this.videoProps
1581
+ };
1582
+ }
1583
+ }
1584
+ }, Ot = ["src", "poster"];
1585
+ function Ft(e, n, t, o, r, s) {
1586
+ var a;
1587
+ return d(), u("video", _({
1588
+ style: {
1589
+ width: "100%",
1590
+ height: "100%",
1591
+ ...(a = t.attributes) == null ? void 0 : a.style,
1592
+ objectFit: t.fit,
1593
+ objectPosition: t.position,
1594
+ borderRadius: 1
1595
+ },
1596
+ src: t.video || "no-src",
1597
+ poster: t.posterImage
1598
+ }, s.spreadProps), null, 16, Ot);
1599
+ }
1600
+ const Bt = /* @__PURE__ */ g(Pt, [["render", Ft]]), Ut = {
1474
1601
  name: "Embed",
1475
1602
  static: !0,
1476
- builtIn: !0,
1477
1603
  inputs: [
1478
1604
  {
1479
1605
  name: "url",
@@ -1481,7 +1607,7 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1481
1607
  required: !0,
1482
1608
  defaultValue: "",
1483
1609
  helperText: "e.g. enter a youtube url, google map, etc",
1484
- onChange: B(
1610
+ onChange: P(
1485
1611
  (e) => {
1486
1612
  const n = e.get("url");
1487
1613
  if (n)
@@ -1506,11 +1632,11 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1506
1632
  hideFromUI: !0
1507
1633
  }
1508
1634
  ]
1509
- }, Rt = [
1635
+ }, Vt = [
1510
1636
  "text/javascript",
1511
1637
  "application/javascript",
1512
1638
  "application/ecmascript"
1513
- ], Et = (e) => Rt.includes(e.type), jt = {
1639
+ ], Wt = (e) => Vt.includes(e.type), Nt = {
1514
1640
  name: "builder-embed",
1515
1641
  props: ["content"],
1516
1642
  data() {
@@ -1543,7 +1669,7 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1543
1669
  this.scriptsInserted.push(t.src);
1544
1670
  const o = document.createElement("script");
1545
1671
  o.async = !0, o.src = t.src, document.head.appendChild(o);
1546
- } else if (Et(t) && !this.scriptsRun.includes(t.innerText))
1672
+ } else if (Wt(t) && !this.scriptsRun.includes(t.innerText))
1547
1673
  try {
1548
1674
  this.scriptsRun.push(t.innerText), new Function(t.innerText)();
1549
1675
  } catch (o) {
@@ -1552,22 +1678,15 @@ const yt = /* @__PURE__ */ g(gt, [["render", bt]]), vt = {
1552
1678
  }
1553
1679
  }
1554
1680
  }
1555
- }, Bt = ["innerHTML"];
1556
- function Ft(e, n, t, o, r, s) {
1557
- return l(), u("div", {
1681
+ }, Lt = ["innerHTML"];
1682
+ function Mt(e, n, t, o, r, s) {
1683
+ return d(), u("div", {
1558
1684
  class: "builder-embed",
1559
1685
  ref: "elem",
1560
1686
  innerHTML: t.content
1561
- }, null, 8, Bt);
1562
- }
1563
- const Ot = /* @__PURE__ */ g(jt, [["render", Ft]]);
1564
- function At() {
1565
- return f() && window.self !== window.top;
1566
- }
1567
- function y() {
1568
- return At() && window.location.search.indexOf("builder.frameEditing=") !== -1;
1687
+ }, null, 8, Lt);
1569
1688
  }
1570
- const Pt = {
1689
+ const $t = /* @__PURE__ */ g(Nt, [["render", Mt]]), zt = {
1571
1690
  name: "builder-img-component",
1572
1691
  props: [
1573
1692
  "backgroundSize",
@@ -1579,10 +1698,22 @@ const Pt = {
1579
1698
  ],
1580
1699
  data() {
1581
1700
  return { isEditing: y };
1701
+ },
1702
+ methods: {
1703
+ filterAttrs: function(n = {}, t) {
1704
+ const o = "v-on:", r = (i) => i.startsWith(o), s = (i) => !i.startsWith(o), a = (i) => i.replace(o, "");
1705
+ return Object.keys(n).filter(t ? r : s).reduce(
1706
+ (i, c) => ({
1707
+ ...i,
1708
+ [a(c)]: n[c]
1709
+ }),
1710
+ {}
1711
+ );
1712
+ }
1582
1713
  }
1583
- }, Ut = ["alt", "src"];
1584
- function $t(e, n, t, o, r, s) {
1585
- return l(), u("img", S({
1714
+ }, Kt = ["alt", "src"];
1715
+ function Ht(e, n, t, o, r, s) {
1716
+ return d(), u("img", _({
1586
1717
  style: {
1587
1718
  objectFit: t.backgroundSize || "cover",
1588
1719
  objectPosition: t.backgroundPosition || "center"
@@ -1590,12 +1721,11 @@ function $t(e, n, t, o, r, s) {
1590
1721
  key: r.isEditing() && t.imgSrc || "default-key",
1591
1722
  alt: t.altText,
1592
1723
  src: t.imgSrc || t.image
1593
- }, t.attributes), null, 16, Ut);
1724
+ }, s.filterAttrs(t.attributes, !1), w(s.filterAttrs(t.attributes, !0), !0)), null, 16, Kt);
1594
1725
  }
1595
- const Vt = /* @__PURE__ */ g(Pt, [["render", $t]]), Lt = {
1726
+ const Dt = /* @__PURE__ */ g(zt, [["render", Ht]]), qt = {
1596
1727
  name: "Raw:Img",
1597
1728
  hideFromInsertMenu: !0,
1598
- builtIn: !0,
1599
1729
  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",
1600
1730
  inputs: [
1601
1731
  {
@@ -1608,7 +1738,7 @@ const Vt = /* @__PURE__ */ g(Pt, [["render", $t]]), Lt = {
1608
1738
  ],
1609
1739
  noWrap: !0,
1610
1740
  static: !0
1611
- }, Wt = {
1741
+ }, Gt = {
1612
1742
  name: "builder-custom-code",
1613
1743
  props: ["replaceNodes", "code"],
1614
1744
  data() {
@@ -1655,9 +1785,9 @@ const Vt = /* @__PURE__ */ g(Pt, [["render", $t]]), Lt = {
1655
1785
  return n;
1656
1786
  }
1657
1787
  }
1658
- }, Mt = ["innerHTML"];
1659
- function Nt(e, n, t, o, r, s) {
1660
- return l(), u("div", {
1788
+ }, Jt = ["innerHTML"];
1789
+ function Xt(e, n, t, o, r, s) {
1790
+ return d(), u("div", {
1661
1791
  ref: "elem",
1662
1792
  class: j(
1663
1793
  s._classStringToObject(
@@ -1665,12 +1795,11 @@ function Nt(e, n, t, o, r, s) {
1665
1795
  )
1666
1796
  ),
1667
1797
  innerHTML: t.code
1668
- }, null, 10, Mt);
1798
+ }, null, 10, Jt);
1669
1799
  }
1670
- const zt = /* @__PURE__ */ g(Wt, [["render", Nt]]), Kt = {
1800
+ const Yt = /* @__PURE__ */ g(Gt, [["render", Xt]]), Qt = {
1671
1801
  name: "Custom Code",
1672
1802
  static: !0,
1673
- builtIn: !0,
1674
1803
  requiredPermissions: ["editCode"],
1675
1804
  inputs: [
1676
1805
  {
@@ -1694,20 +1823,20 @@ const zt = /* @__PURE__ */ g(Wt, [["render", Nt]]), Kt = {
1694
1823
  advanced: !0
1695
1824
  }
1696
1825
  ]
1697
- }, Ht = () => [
1698
- { component: ke, ...xt },
1699
- { component: Ee, ...Ct },
1700
- { component: Vt, ...Lt },
1701
- { component: Oe, ...wt },
1702
- { component: $e, ...It },
1703
- { component: ct, ..._t },
1704
- { component: mt, ...vt },
1705
- { component: ft, ...St },
1706
- { component: yt, ...kt },
1707
- { component: Ot, ...Tt },
1708
- { component: zt, ...Kt }
1826
+ }, Zt = () => [
1827
+ { component: ve, ...qe },
1828
+ { component: Te, ...Ge },
1829
+ { component: Yt, ...Qt },
1830
+ { component: $t, ...Ut },
1831
+ { component: Ae, ...Je },
1832
+ { component: We, ...Xe },
1833
+ { component: Dt, ...qt },
1834
+ { component: et, ...Ye },
1835
+ { component: wt, ...tt },
1836
+ { component: At, ...It },
1837
+ { component: Bt, ...jt }
1709
1838
  ];
1710
- function q({
1839
+ function G({
1711
1840
  code: e,
1712
1841
  context: n,
1713
1842
  state: t,
@@ -1722,7 +1851,7 @@ function q({
1722
1851
  isEditing: y(),
1723
1852
  isBrowser: f(),
1724
1853
  isServer: !f()
1725
- }, c = r && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e;
1854
+ }, i = r && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e;
1726
1855
  try {
1727
1856
  return new Function(
1728
1857
  "builder",
@@ -1730,127 +1859,127 @@ function q({
1730
1859
  "state",
1731
1860
  "context",
1732
1861
  "event",
1733
- c
1862
+ i
1734
1863
  )(s, s, t, n, o);
1735
- } catch (a) {
1864
+ } catch (c) {
1736
1865
  console.warn(
1737
1866
  `Builder custom code error:
1738
1867
  While Evaluating:
1739
1868
  `,
1740
- c,
1869
+ i,
1741
1870
  `
1742
1871
  `,
1743
- a
1872
+ c
1744
1873
  );
1745
1874
  }
1746
1875
  }
1747
- function qt() {
1876
+ function en() {
1748
1877
  return !f() || y() ? !1 : Boolean(location.search.indexOf("builder.preview=") !== -1);
1749
1878
  }
1750
- const se = [];
1751
- function jn(e, n) {
1752
- return se.push({ component: e, ...n }), console.warn(
1879
+ const ae = [];
1880
+ function Fn(e, n) {
1881
+ return ae.push({ component: e, ...n }), console.warn(
1753
1882
  "registerComponent is deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK."
1754
1883
  ), e;
1755
1884
  }
1756
- const Dt = ({
1885
+ const tn = ({
1757
1886
  component: e,
1758
1887
  ...n
1759
1888
  }) => ({
1760
1889
  type: "builder.registerComponent",
1761
- data: Jt(n)
1762
- }), Gt = (e) => typeof e == "function" ? B(e) : U(e), Jt = ({
1890
+ data: on(n)
1891
+ }), nn = (e) => typeof e == "function" ? P(e) : V(e), on = ({
1763
1892
  inputs: e,
1764
1893
  ...n
1765
1894
  }) => ({
1766
- ...U(n),
1895
+ ...V(n),
1767
1896
  inputs: e == null ? void 0 : e.map(
1768
1897
  (t) => Object.entries(t).reduce(
1769
1898
  (o, [r, s]) => ({
1770
1899
  ...o,
1771
- [r]: Gt(s)
1900
+ [r]: nn(s)
1772
1901
  }),
1773
1902
  {}
1774
1903
  )
1775
1904
  )
1776
1905
  });
1777
- function Xt() {
1906
+ function sn() {
1778
1907
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
1779
1908
  const n = Math.random() * 16 | 0;
1780
1909
  return (e == "x" ? n : n & 3 | 8).toString(16);
1781
1910
  });
1782
1911
  }
1783
- function re() {
1784
- return Xt().replace(/-/g, "");
1912
+ function ce() {
1913
+ return sn().replace(/-/g, "");
1785
1914
  }
1786
- const ie = "builderSessionId", Yt = async ({
1915
+ const le = "builderSessionId", rn = async ({
1787
1916
  canTrack: e
1788
1917
  }) => {
1789
1918
  if (!e)
1790
1919
  return;
1791
- const n = await Z({
1792
- name: ie,
1920
+ const n = await ne({
1921
+ name: le,
1793
1922
  canTrack: e
1794
1923
  });
1795
- if (C(n))
1924
+ if (S(n))
1796
1925
  return n;
1797
1926
  {
1798
- const t = Qt();
1799
- return Zt({ id: t, canTrack: e }), t;
1927
+ const t = an();
1928
+ return cn({ id: t, canTrack: e }), t;
1800
1929
  }
1801
- }, Qt = () => re(), Zt = ({
1930
+ }, an = () => ce(), cn = ({
1802
1931
  id: e,
1803
1932
  canTrack: n
1804
- }) => ee({ name: ie, value: e, canTrack: n }), ae = () => f() && typeof localStorage < "u" ? localStorage : void 0, en = ({
1933
+ }) => oe({ name: le, value: e, canTrack: n }), de = () => f() && typeof localStorage < "u" ? localStorage : void 0, ln = ({
1805
1934
  key: e,
1806
1935
  canTrack: n
1807
1936
  }) => {
1808
1937
  var t;
1809
1938
  try {
1810
- return n ? (t = ae()) == null ? void 0 : t.getItem(e) : void 0;
1939
+ return n ? (t = de()) == null ? void 0 : t.getItem(e) : void 0;
1811
1940
  } catch (o) {
1812
1941
  console.debug("[LocalStorage] GET error: ", o);
1813
1942
  return;
1814
1943
  }
1815
- }, tn = ({
1944
+ }, dn = ({
1816
1945
  key: e,
1817
1946
  canTrack: n,
1818
1947
  value: t
1819
1948
  }) => {
1820
1949
  var o;
1821
1950
  try {
1822
- n && ((o = ae()) == null || o.setItem(e, t));
1951
+ n && ((o = de()) == null || o.setItem(e, t));
1823
1952
  } catch (r) {
1824
1953
  console.debug("[LocalStorage] SET error: ", r);
1825
1954
  }
1826
- }, ce = "builderVisitorId", nn = ({ canTrack: e }) => {
1955
+ }, ue = "builderVisitorId", un = ({ canTrack: e }) => {
1827
1956
  if (!e)
1828
1957
  return;
1829
- const n = en({
1830
- key: ce,
1958
+ const n = ln({
1959
+ key: ue,
1831
1960
  canTrack: e
1832
1961
  });
1833
- if (C(n))
1962
+ if (S(n))
1834
1963
  return n;
1835
1964
  {
1836
- const t = on();
1837
- return sn({ id: t, canTrack: e }), t;
1965
+ const t = mn();
1966
+ return pn({ id: t, canTrack: e }), t;
1838
1967
  }
1839
- }, on = () => re(), sn = ({
1968
+ }, mn = () => ce(), pn = ({
1840
1969
  id: e,
1841
1970
  canTrack: n
1842
- }) => tn({
1843
- key: ce,
1971
+ }) => dn({
1972
+ key: ue,
1844
1973
  value: e,
1845
1974
  canTrack: n
1846
- }), rn = () => {
1975
+ }), hn = () => {
1847
1976
  if (f()) {
1848
1977
  const e = new URL(location.href);
1849
1978
  return e.pathname === "" && (e.pathname = "/"), e;
1850
1979
  } else
1851
1980
  return console.warn("Cannot get location for tracking in non-browser environment"), null;
1852
- }, an = () => typeof navigator == "object" && navigator.userAgent || "", cn = () => {
1853
- const e = an(), n = {
1981
+ }, fn = () => typeof navigator == "object" && navigator.userAgent || "", gn = () => {
1982
+ const e = fn(), n = {
1854
1983
  Android() {
1855
1984
  return e.match(/Android/i);
1856
1985
  },
@@ -1867,25 +1996,25 @@ const ie = "builderSessionId", Yt = async ({
1867
1996
  return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
1868
1997
  },
1869
1998
  any() {
1870
- return n.Android() || n.BlackBerry() || n.iOS() || n.Opera() || n.Windows() || T === "reactNative";
1999
+ return n.Android() || n.BlackBerry() || n.iOS() || n.Opera() || n.Windows() || R === "reactNative";
1871
2000
  }
1872
- }, t = e.match(/Tablet|iPad/i), o = rn();
2001
+ }, t = e.match(/Tablet|iPad/i), o = hn();
1873
2002
  return {
1874
2003
  urlPath: o == null ? void 0 : o.pathname,
1875
2004
  host: (o == null ? void 0 : o.host) || (o == null ? void 0 : o.hostname),
1876
2005
  device: t ? "tablet" : n.any() ? "mobile" : "desktop"
1877
2006
  };
1878
- }, ln = async ({
2007
+ }, bn = async ({
1879
2008
  canTrack: e
1880
2009
  }) => {
1881
2010
  if (!e)
1882
2011
  return { visitorId: void 0, sessionId: void 0 };
1883
- const n = await Yt({ canTrack: e }), t = nn({ canTrack: e });
2012
+ const n = await rn({ canTrack: e }), t = un({ canTrack: e });
1884
2013
  return {
1885
2014
  sessionId: n,
1886
2015
  visitorId: t
1887
2016
  };
1888
- }, dn = async ({
2017
+ }, yn = async ({
1889
2018
  type: e,
1890
2019
  canTrack: n,
1891
2020
  apiKey: t,
@@ -1899,23 +2028,23 @@ const ie = "builderSessionId", Yt = async ({
1899
2028
  url: location.href,
1900
2029
  ...o
1901
2030
  },
1902
- ...await ln({ canTrack: n }),
1903
- userAttributes: cn(),
2031
+ ...await bn({ canTrack: n }),
2032
+ userAttributes: gn(),
1904
2033
  ownerId: t
1905
2034
  }
1906
2035
  });
1907
- async function P(e) {
2036
+ async function U(e) {
1908
2037
  if (!e.apiKey) {
1909
2038
  console.error(
1910
2039
  "[Builder.io]: Missing API key for track call. Please provide your API key."
1911
2040
  );
1912
2041
  return;
1913
2042
  }
1914
- if (!!e.canTrack && !y() && !!(f() || T === "reactNative"))
2043
+ if (!!e.canTrack && !y() && !!(f() || R === "reactNative"))
1915
2044
  return fetch("https://builder.io/api/v1/track", {
1916
2045
  method: "POST",
1917
2046
  body: JSON.stringify({
1918
- events: [await dn(e)]
2047
+ events: [await yn(e)]
1919
2048
  }),
1920
2049
  headers: {
1921
2050
  "content-type": "application/json"
@@ -1925,11 +2054,11 @@ async function P(e) {
1925
2054
  console.error("Failed to track: ", n);
1926
2055
  });
1927
2056
  }
1928
- const Bn = (e) => P({ ...e, canTrack: !0 });
1929
- function D(e) {
2057
+ const Bn = (e) => U({ ...e, canTrack: !0 });
2058
+ function J(e) {
1930
2059
  return Math.round(e * 1e3) / 1e3;
1931
2060
  }
1932
- const un = (e, n, t = !0) => {
2061
+ const vn = (e, n, t = !0) => {
1933
2062
  if (!(e instanceof HTMLElement))
1934
2063
  return null;
1935
2064
  let o = t ? e : e.parentElement;
@@ -1940,52 +2069,79 @@ const un = (e, n, t = !0) => {
1940
2069
  return o;
1941
2070
  } while (o = o.parentElement);
1942
2071
  return null;
1943
- }, mn = (e) => un(e, (n) => {
2072
+ }, xn = (e) => vn(e, (n) => {
1944
2073
  const t = n.getAttribute("builder-id") || n.id;
1945
2074
  return Boolean((t == null ? void 0 : t.indexOf("builder-")) === 0);
1946
- }), G = ({
2075
+ }), X = ({
1947
2076
  event: e,
1948
2077
  target: n
1949
2078
  }) => {
1950
- const t = n.getBoundingClientRect(), o = e.clientX - t.left, r = e.clientY - t.top, s = D(o / t.width), i = D(r / t.height);
2079
+ const t = n.getBoundingClientRect(), o = e.clientX - t.left, r = e.clientY - t.top, s = J(o / t.width), a = J(r / t.height);
1951
2080
  return {
1952
2081
  x: s,
1953
- y: i
2082
+ y: a
1954
2083
  };
1955
- }, pn = (e) => {
1956
- const n = e.target, t = n && mn(n), o = (t == null ? void 0 : t.getAttribute("builder-id")) || (t == null ? void 0 : t.id);
2084
+ }, kn = (e) => {
2085
+ const n = e.target, t = n && xn(n), o = (t == null ? void 0 : t.getAttribute("builder-id")) || (t == null ? void 0 : t.id);
1957
2086
  return {
1958
2087
  targetBuilderElement: o || void 0,
1959
2088
  metadata: {
1960
- targetOffset: n ? G({ event: e, target: n }) : void 0,
1961
- builderTargetOffset: t ? G({ event: e, target: t }) : void 0,
2089
+ targetOffset: n ? X({ event: e, target: n }) : void 0,
2090
+ builderTargetOffset: t ? X({ event: e, target: t }) : void 0,
1962
2091
  builderElementIndex: t && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(t) : void 0
1963
2092
  }
1964
2093
  };
1965
- }, hn = () => Promise.resolve().then(() => le).then((e) => e.default).catch((e) => {
2094
+ }, Sn = ({
2095
+ content: e,
2096
+ data: n,
2097
+ locale: t
2098
+ }) => {
2099
+ var s, a, i;
2100
+ const o = {};
2101
+ (a = (s = e == null ? void 0 : e.data) == null ? void 0 : s.inputs) == null || a.forEach((c) => {
2102
+ var l;
2103
+ c.name && c.defaultValue !== void 0 && ((l = e == null ? void 0 : e.data) == null ? void 0 : l.state) && e.data.state[c.name] === void 0 && (o[c.name] = c.defaultValue);
2104
+ });
2105
+ const r = {
2106
+ ...(i = e == null ? void 0 : e.data) == null ? void 0 : i.state,
2107
+ ...n,
2108
+ ...t ? { locale: t } : {}
2109
+ };
2110
+ return { ...o, ...r };
2111
+ }, _n = ({
2112
+ content: e,
2113
+ data: n
2114
+ }) => e ? {
2115
+ ...e,
2116
+ data: {
2117
+ ...e == null ? void 0 : e.data,
2118
+ ...n
2119
+ },
2120
+ meta: e == null ? void 0 : e.meta
2121
+ } : void 0, Cn = () => Promise.resolve().then(() => ee).then((e) => e.default).catch((e) => {
1966
2122
  throw console.error(
1967
2123
  "Error while attempting to dynamically import component RenderBlocks at ../render-blocks.vue",
1968
2124
  e
1969
2125
  ), e;
1970
- }), fn = () => import("./render-styles.8780951f.js").then((e) => e.default).catch((e) => {
2126
+ }), wn = () => import("./render-styles.c79197c2.js").then((e) => e.default).catch((e) => {
1971
2127
  throw console.error(
1972
2128
  "Error while attempting to dynamically import component RenderContentStyles at ./components/render-styles.vue",
1973
2129
  e
1974
2130
  ), e;
1975
- }), gn = {
2131
+ }), In = {
1976
2132
  name: "render-content",
1977
2133
  components: {
1978
- RenderContentStyles: x(fn),
1979
- RenderBlocks: x(hn)
2134
+ RenderContentStyles: x(wn),
2135
+ RenderBlocks: x(Cn)
1980
2136
  },
1981
2137
  props: [
1982
2138
  "content",
1983
2139
  "data",
1984
2140
  "canTrack",
1985
2141
  "locale",
1986
- "context",
1987
2142
  "customComponents",
1988
2143
  "model",
2144
+ "context",
1989
2145
  "apiKey",
1990
2146
  "includeRefs"
1991
2147
  ],
@@ -1993,14 +2149,20 @@ const un = (e, n, t = !0) => {
1993
2149
  return {
1994
2150
  forceReRenderCount: 0,
1995
2151
  overrideContent: null,
2152
+ useContent: _n({
2153
+ content: this.content,
2154
+ data: this.data
2155
+ }),
1996
2156
  update: 0,
1997
- useBreakpoints: null,
1998
- canTrackToUse: C(this.canTrack) ? this.canTrack : !0,
1999
- overrideState: {},
2000
- contextContext: this.context || {},
2157
+ canTrackToUse: S(this.canTrack) ? this.canTrack : !0,
2158
+ contentState: Sn({
2159
+ content: this.content,
2160
+ data: this.data,
2161
+ locale: this.locale
2162
+ }),
2001
2163
  allRegisteredComponents: [
2002
- ...Ht(),
2003
- ...se,
2164
+ ...Zt(),
2165
+ ...ae,
2004
2166
  ...this.customComponents || []
2005
2167
  ].reduce(
2006
2168
  (e, n) => ({
@@ -2016,10 +2178,11 @@ const un = (e, n, t = !0) => {
2016
2178
  provide() {
2017
2179
  const e = this;
2018
2180
  return {
2019
- [$.key]: {
2181
+ [W.key]: {
2020
2182
  content: e.useContent,
2021
2183
  state: e.contentState,
2022
- context: e.contextContext,
2184
+ setState: e.setContextState,
2185
+ context: e.context || {},
2023
2186
  apiKey: e.apiKey,
2024
2187
  registeredComponents: e.allRegisteredComponents
2025
2188
  }
@@ -2030,7 +2193,7 @@ const un = (e, n, t = !0) => {
2030
2193
  if (this.apiKey || console.error(
2031
2194
  "[Builder.io]: No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2032
2195
  ), f()) {
2033
- if (y() && (this.forceReRenderCount = this.forceReRenderCount + 1, me(), pe({
2196
+ if (y() && (this.forceReRenderCount = this.forceReRenderCount + 1, he(), fe({
2034
2197
  ...this.locale ? {
2035
2198
  locale: this.locale
2036
2199
  } : {},
@@ -2040,7 +2203,7 @@ const un = (e, n, t = !0) => {
2040
2203
  }), Object.values(this.allRegisteredComponents).forEach(
2041
2204
  (t) => {
2042
2205
  var r;
2043
- const o = Dt(t);
2206
+ const o = tn(t);
2044
2207
  (r = window.parent) == null || r.postMessage(o, "*");
2045
2208
  }
2046
2209
  ), window.addEventListener("message", this.processMessage), window.addEventListener(
@@ -2048,7 +2211,7 @@ const un = (e, n, t = !0) => {
2048
2211
  this.emitStateUpdate
2049
2212
  )), this.useContent) {
2050
2213
  const t = (e = this.useContent) == null ? void 0 : e.testVariationId, o = (n = this.useContent) == null ? void 0 : n.id;
2051
- P({
2214
+ U({
2052
2215
  type: "impression",
2053
2216
  canTrack: this.canTrackToUse,
2054
2217
  contentId: o,
@@ -2056,13 +2219,13 @@ const un = (e, n, t = !0) => {
2056
2219
  variationId: t !== o ? t : void 0
2057
2220
  });
2058
2221
  }
2059
- if (qt()) {
2222
+ if (en()) {
2060
2223
  const t = new URL(location.href).searchParams, o = t.get("builder.preview"), r = t.get("apiKey") || t.get("builder.space");
2061
- o === this.model && r === this.apiKey && oe({
2224
+ o === this.model && r === this.apiKey && ie({
2062
2225
  model: this.model,
2063
2226
  apiKey: this.apiKey
2064
2227
  }).then((s) => {
2065
- s && (this.overrideContent = s);
2228
+ s && this.mergeNewContent(s);
2066
2229
  });
2067
2230
  }
2068
2231
  this.evaluateJsCode(), this.runHttpRequests(), this.emitStateUpdate();
@@ -2095,39 +2258,10 @@ const un = (e, n, t = !0) => {
2095
2258
  ));
2096
2259
  },
2097
2260
  computed: {
2098
- useContent() {
2099
- var e, n, t, o, r, s, i, c;
2100
- if (!(!this.content && !this.overrideContent))
2101
- return {
2102
- ...this.content,
2103
- ...this.overrideContent,
2104
- data: {
2105
- ...(e = this.content) == null ? void 0 : e.data,
2106
- ...this.data,
2107
- ...(n = this.overrideContent) == null ? void 0 : n.data
2108
- },
2109
- meta: {
2110
- ...(t = this.content) == null ? void 0 : t.meta,
2111
- ...(o = this.overrideContent) == null ? void 0 : o.meta,
2112
- breakpoints: this.useBreakpoints || ((s = (r = this.overrideContent) == null ? void 0 : r.meta) == null ? void 0 : s.breakpoints) || ((c = (i = this.content) == null ? void 0 : i.meta) == null ? void 0 : c.breakpoints)
2113
- }
2114
- };
2115
- },
2116
- contentState() {
2117
- var e, n;
2118
- return {
2119
- ...(n = (e = this.content) == null ? void 0 : e.data) == null ? void 0 : n.state,
2120
- ...this.data,
2121
- ...this.locale ? {
2122
- locale: this.locale
2123
- } : {},
2124
- ...this.overrideState
2125
- };
2126
- },
2127
2261
  shouldRenderContentStyles() {
2128
2262
  var e, n, t, o, r;
2129
2263
  return Boolean(
2130
- (((n = (e = this.useContent) == null ? void 0 : e.data) == null ? void 0 : n.cssCode) || ((r = (o = (t = this.useContent) == null ? void 0 : t.data) == null ? void 0 : o.customFonts) == null ? void 0 : r.length)) && T !== "reactNative"
2264
+ (((n = (e = this.useContent) == null ? void 0 : e.data) == null ? void 0 : n.cssCode) || ((r = (o = (t = this.useContent) == null ? void 0 : t.data) == null ? void 0 : o.customFonts) == null ? void 0 : r.length)) && R !== "reactNative"
2131
2265
  );
2132
2266
  },
2133
2267
  onUpdateHook0() {
@@ -2150,6 +2284,35 @@ const un = (e, n, t = !0) => {
2150
2284
  }
2151
2285
  },
2152
2286
  methods: {
2287
+ mergeNewContent(e) {
2288
+ var n, t, o, r, s;
2289
+ this.useContent = {
2290
+ ...this.useContent,
2291
+ ...e,
2292
+ data: {
2293
+ ...(n = this.useContent) == null ? void 0 : n.data,
2294
+ ...e == null ? void 0 : e.data
2295
+ },
2296
+ meta: {
2297
+ ...(t = this.useContent) == null ? void 0 : t.meta,
2298
+ ...e == null ? void 0 : e.meta,
2299
+ breakpoints: ((o = e == null ? void 0 : e.meta) == null ? void 0 : o.breakpoints) || ((s = (r = this.useContent) == null ? void 0 : r.meta) == null ? void 0 : s.breakpoints)
2300
+ }
2301
+ };
2302
+ },
2303
+ setBreakpoints(e) {
2304
+ var n;
2305
+ this.useContent = {
2306
+ ...this.useContent,
2307
+ meta: {
2308
+ ...(n = this.useContent) == null ? void 0 : n.meta,
2309
+ breakpoints: e
2310
+ }
2311
+ };
2312
+ },
2313
+ setContextState(e) {
2314
+ this.contentState = e;
2315
+ },
2153
2316
  processMessage(e) {
2154
2317
  var t;
2155
2318
  const { data: n } = e;
@@ -2159,12 +2322,12 @@ const un = (e, n, t = !0) => {
2159
2322
  const o = n.data, { breakpoints: r, contentId: s } = o;
2160
2323
  if (!s || s !== ((t = this.useContent) == null ? void 0 : t.id))
2161
2324
  return;
2162
- this.useBreakpoints = r, this.forceReRenderCount = this.forceReRenderCount + 1;
2325
+ r && this.setBreakpoints(r), this.forceReRenderCount = this.forceReRenderCount + 1;
2163
2326
  break;
2164
2327
  }
2165
2328
  case "builder.contentUpdate": {
2166
2329
  const o = n.data, r = o.key || o.alias || o.entry || o.modelName, s = o.data;
2167
- r === this.model && (this.overrideContent = s, this.forceReRenderCount = this.forceReRenderCount + 1);
2330
+ r === this.model && (this.mergeNewContent(s), this.forceReRenderCount = this.forceReRenderCount + 1);
2168
2331
  break;
2169
2332
  }
2170
2333
  }
@@ -2172,9 +2335,9 @@ const un = (e, n, t = !0) => {
2172
2335
  evaluateJsCode() {
2173
2336
  var n, t;
2174
2337
  const e = (t = (n = this.useContent) == null ? void 0 : n.data) == null ? void 0 : t.jsCode;
2175
- e && q({
2338
+ e && G({
2176
2339
  code: e,
2177
- context: this.contextContext,
2340
+ context: this.context || {},
2178
2341
  state: this.contentState
2179
2342
  });
2180
2343
  },
@@ -2182,13 +2345,13 @@ const un = (e, n, t = !0) => {
2182
2345
  var n, t;
2183
2346
  if (this.useContent) {
2184
2347
  const o = (n = this.useContent) == null ? void 0 : n.testVariationId, r = (t = this.useContent) == null ? void 0 : t.id;
2185
- P({
2348
+ U({
2186
2349
  type: "click",
2187
2350
  canTrack: this.canTrackToUse,
2188
2351
  contentId: r,
2189
2352
  apiKey: this.apiKey,
2190
2353
  variationId: o !== r ? o : void 0,
2191
- ...pn(e),
2354
+ ...kn(e),
2192
2355
  unique: !this.clicked
2193
2356
  });
2194
2357
  }
@@ -2197,20 +2360,20 @@ const un = (e, n, t = !0) => {
2197
2360
  evalExpression(e) {
2198
2361
  return e.replace(
2199
2362
  /{{([^}]+)}}/g,
2200
- (n, t) => q({
2363
+ (n, t) => G({
2201
2364
  code: t,
2202
- context: this.contextContext,
2365
+ context: this.context || {},
2203
2366
  state: this.contentState
2204
2367
  })
2205
2368
  );
2206
2369
  },
2207
2370
  handleRequest({ url: e, key: n }) {
2208
- Q(e).then((t) => t.json()).then((t) => {
2371
+ te(e).then((t) => t.json()).then((t) => {
2209
2372
  const o = {
2210
- ...this.overrideState,
2373
+ ...this.contentState,
2211
2374
  [n]: t
2212
2375
  };
2213
- this.overrideState = o;
2376
+ this.setContextState(o);
2214
2377
  }).catch((t) => {
2215
2378
  console.log("error fetching dynamic data", e, t);
2216
2379
  });
@@ -2220,9 +2383,9 @@ const un = (e, n, t = !0) => {
2220
2383
  const e = (o = (t = (n = this.useContent) == null ? void 0 : n.data) == null ? void 0 : t.httpRequests) != null ? o : {};
2221
2384
  Object.entries(e).forEach(([r, s]) => {
2222
2385
  if (s && (!this.httpReqsData[r] || y())) {
2223
- const i = this.evalExpression(s);
2386
+ const a = this.evalExpression(s);
2224
2387
  this.handleRequest({
2225
- url: i,
2388
+ url: a,
2226
2389
  key: r
2227
2390
  });
2228
2391
  }
@@ -2241,167 +2404,75 @@ const un = (e, n, t = !0) => {
2241
2404
  );
2242
2405
  }
2243
2406
  }
2244
- }, bn = ["builder-content-id", "builder-model"];
2245
- function yn(e, n, t, o, r, s) {
2246
- var a, d, m, p, h, v, V;
2247
- const i = k("render-content-styles"), c = k("render-blocks");
2248
- return s.useContent ? (l(), u("div", {
2407
+ }, Tn = ["builder-content-id", "builder-model"];
2408
+ function Rn(e, n, t, o, r, s) {
2409
+ var c, l, m, p, h, v, N, L;
2410
+ const a = k("render-content-styles"), i = k("render-blocks");
2411
+ return r.useContent ? (d(), u("div", {
2249
2412
  key: 0,
2250
2413
  ref: "elementRef",
2251
- onClick: n[0] || (n[0] = (de) => s.onClick(de)),
2252
- "builder-content-id": (a = s.useContent) == null ? void 0 : a.id,
2414
+ onClick: n[0] || (n[0] = (me) => s.onClick(me)),
2415
+ "builder-content-id": (c = r.useContent) == null ? void 0 : c.id,
2253
2416
  "builder-model": t.model
2254
2417
  }, [
2255
- s.shouldRenderContentStyles ? (l(), I(i, {
2418
+ s.shouldRenderContentStyles ? (d(), T(a, {
2256
2419
  key: 0,
2257
- cssCode: (m = (d = s.useContent) == null ? void 0 : d.data) == null ? void 0 : m.cssCode,
2258
- customFonts: (h = (p = s.useContent) == null ? void 0 : p.data) == null ? void 0 : h.customFonts
2259
- }, null, 8, ["cssCode", "customFonts"])) : b("", !0),
2260
- (l(), I(c, {
2261
- blocks: (V = (v = s.useContent) == null ? void 0 : v.data) == null ? void 0 : V.blocks,
2420
+ contentId: (l = r.useContent) == null ? void 0 : l.id,
2421
+ cssCode: (p = (m = r.useContent) == null ? void 0 : m.data) == null ? void 0 : p.cssCode,
2422
+ customFonts: (v = (h = r.useContent) == null ? void 0 : h.data) == null ? void 0 : v.customFonts
2423
+ }, null, 8, ["contentId", "cssCode", "customFonts"])) : b("", !0),
2424
+ (d(), T(i, {
2425
+ blocks: (L = (N = r.useContent) == null ? void 0 : N.data) == null ? void 0 : L.blocks,
2262
2426
  key: r.forceReRenderCount
2263
2427
  }, null, 8, ["blocks"]))
2264
- ], 8, bn)) : b("", !0);
2265
- }
2266
- const vn = /* @__PURE__ */ g(gn, [["render", yn]]), xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2267
- __proto__: null,
2268
- default: vn
2269
- }, Symbol.toStringTag, { value: "Module" })), kn = () => import("./block-styles.413a68e9.js").then((e) => e.default).catch((e) => {
2270
- throw console.error(
2271
- "Error while attempting to dynamically import component BlockStyles at ./render-block/block-styles.vue",
2272
- e
2273
- ), e;
2274
- }), Cn = () => import("./render-block.a53e9af1.js").then((e) => e.default).catch((e) => {
2275
- throw console.error(
2276
- "Error while attempting to dynamically import component RenderBlock at ./render-block/render-block.vue",
2277
- e
2278
- ), e;
2279
- }), Sn = {
2280
- name: "render-blocks",
2281
- components: {
2282
- RenderBlock: x(Cn),
2283
- BlockStyles: x(kn)
2284
- },
2285
- props: ["blocks", "parent", "path", "styleProp"],
2286
- inject: {
2287
- builderContext: $.key
2288
- },
2289
- computed: {
2290
- className() {
2291
- var e;
2292
- return "builder-blocks" + ((e = this.blocks) != null && e.length ? "" : " no-blocks");
2293
- }
2294
- },
2295
- methods: {
2296
- onClick() {
2297
- var e, n;
2298
- y() && !((e = this.blocks) != null && e.length) && ((n = window.parent) == null || n.postMessage(
2299
- {
2300
- type: "builder.clickEmptyBlocks",
2301
- data: {
2302
- parentElementId: this.parent,
2303
- dataPath: this.path
2304
- }
2305
- },
2306
- "*"
2307
- ));
2308
- },
2309
- onMouseEnter() {
2310
- var e, n;
2311
- y() && !((e = this.blocks) != null && e.length) && ((n = window.parent) == null || n.postMessage(
2312
- {
2313
- type: "builder.hoverEmptyBlocks",
2314
- data: {
2315
- parentElementId: this.parent,
2316
- dataPath: this.path
2317
- }
2318
- },
2319
- "*"
2320
- ));
2321
- },
2322
- _classStringToObject(e) {
2323
- const n = {};
2324
- if (typeof e != "string")
2325
- return n;
2326
- const t = e.trim().split(/\s+/);
2327
- for (const o of t)
2328
- n[o] = !0;
2329
- return n;
2330
- }
2331
- }
2332
- };
2333
- const _n = ["builder-path", "builder-parent-id", "dataSet"];
2334
- function wn(e, n, t, o, r, s) {
2335
- const i = k("render-block"), c = k("block-styles");
2336
- return l(), u("div", {
2337
- class: j(s._classStringToObject(s.className + " div-361b1o6wv2k")),
2338
- "builder-path": t.path,
2339
- "builder-parent-id": t.parent,
2340
- dataSet: {
2341
- class: s.className
2342
- },
2343
- style: w(t.styleProp),
2344
- onClick: n[0] || (n[0] = (a) => s.onClick()),
2345
- onMouseenter: n[1] || (n[1] = (a) => s.onMouseEnter())
2346
- }, [
2347
- t.blocks ? (l(!0), u(R, { key: 0 }, O(t.blocks, (a, d) => (l(), I(i, {
2348
- key: "render-block-" + a.id,
2349
- block: a,
2350
- context: s.builderContext
2351
- }, null, 8, ["block", "context"]))), 128)) : b("", !0),
2352
- t.blocks ? (l(!0), u(R, { key: 1 }, O(t.blocks, (a, d) => (l(), I(c, {
2353
- key: "block-style-" + a.id,
2354
- block: a,
2355
- context: s.builderContext
2356
- }, null, 8, ["block", "context"]))), 128)) : b("", !0)
2357
- ], 46, _n);
2428
+ ], 8, Tn)) : b("", !0);
2358
2429
  }
2359
- const In = /* @__PURE__ */ g(Sn, [["render", wn], ["__scopeId", "data-v-69d4cd84"]]), le = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2430
+ const En = /* @__PURE__ */ g(In, [["render", Rn]]), An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2360
2431
  __proto__: null,
2361
- default: In
2362
- }, Symbol.toStringTag, { value: "Module" })), J = {};
2363
- function Fn(e) {
2432
+ default: En
2433
+ }, Symbol.toStringTag, { value: "Module" })), Y = {};
2434
+ function Un(e) {
2364
2435
  if (f()) {
2365
- Object.assign(J, e);
2436
+ Object.assign(Y, e);
2366
2437
  const n = {
2367
2438
  type: "builder.settingsChange",
2368
- data: J
2439
+ data: Y
2369
2440
  };
2370
2441
  parent.postMessage(n, "*");
2371
2442
  }
2372
2443
  }
2373
2444
  export {
2374
- $ as B,
2375
- ke as C,
2376
- yt as F,
2377
- Ee as I,
2378
- ct as S,
2379
- T,
2380
- $e as V,
2445
+ W as B,
2446
+ Te as C,
2447
+ Ae as F,
2448
+ We as I,
2449
+ et as S,
2450
+ R as T,
2451
+ Bt as V,
2381
2452
  g as _,
2382
- Rn as a,
2383
- ge as b,
2384
- En as c,
2385
- Oe as d,
2386
- q as e,
2387
- U as f,
2388
- he as g,
2389
- mt as h,
2390
- ft as i,
2391
- In as j,
2453
+ Pn as a,
2454
+ Se as b,
2455
+ On as c,
2456
+ ve as d,
2457
+ G as e,
2458
+ V as f,
2459
+ xe as g,
2460
+ En as h,
2461
+ wt as i,
2462
+ At as j,
2392
2463
  y as k,
2393
- qt as l,
2394
- se as m,
2395
- jn as n,
2396
- Dt as o,
2397
- ue as p,
2398
- oe as q,
2399
- vn as r,
2400
- Fn as s,
2464
+ en as l,
2465
+ ae as m,
2466
+ Fn as n,
2467
+ tn as o,
2468
+ pe as p,
2469
+ ie as q,
2470
+ De as r,
2471
+ Un as s,
2401
2472
  Bn as t,
2402
- ot as u,
2403
- Ze as v,
2404
- et as w,
2405
- tt as x,
2406
- ne as y
2473
+ xt as u,
2474
+ gt as v,
2475
+ bt as w,
2476
+ yt as x,
2477
+ re as y
2407
2478
  };