@builder.io/sdk-vue 0.0.1-9 → 0.0.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 (161) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +44 -0
  3. package/dist/vue-2/block-styles.3f130795.js +67 -0
  4. package/dist/vue-2/block-styles.da610cf5.cjs +10 -0
  5. package/dist/vue-2/get-processed-block.2bcd0d2b.cjs +1 -0
  6. package/dist/vue-2/get-processed-block.c01e4ddc.js +44 -0
  7. package/dist/vue-2/index.0622ae10.js +1996 -0
  8. package/dist/vue-2/index.dcdf302c.cjs +4 -0
  9. package/dist/vue-2/render-block.bdaa8069.js +243 -0
  10. package/dist/vue-2/render-block.f41ce0b2.cjs +3 -0
  11. package/dist/vue-2/render-inlined-styles.7974da9f.js +31 -0
  12. package/dist/vue-2/render-inlined-styles.b3a06398.cjs +1 -0
  13. package/dist/vue-2/render-repeated-block.c2b982e3.js +45 -0
  14. package/dist/vue-2/render-repeated-block.f36a831f.cjs +1 -0
  15. package/dist/vue-2/render-styles.354823a4.js +65 -0
  16. package/dist/vue-2/render-styles.4b5b2368.cjs +17 -0
  17. package/dist/vue-2/sdk.cjs +1 -0
  18. package/dist/vue-2/sdk.js +27 -0
  19. package/dist/vue-2/style.css +1 -0
  20. package/dist/vue-3/block-styles.76754b24.js +64 -0
  21. package/dist/vue-3/block-styles.e17850cc.cjs +10 -0
  22. package/dist/vue-3/get-processed-block.2dd25223.cjs +1 -0
  23. package/dist/vue-3/get-processed-block.6eaca128.js +44 -0
  24. package/dist/vue-3/index.3e132178.js +78896 -0
  25. package/dist/vue-3/index.475f52c7.cjs +1 -0
  26. package/dist/vue-3/index.52915610.js +1969 -0
  27. package/dist/vue-3/index.91387fc2.cjs +4 -0
  28. package/dist/vue-3/render-block.369b7818.js +255 -0
  29. package/dist/vue-3/render-block.c9718d52.cjs +3 -0
  30. package/dist/vue-3/render-inlined-styles.2a3eeef4.cjs +1 -0
  31. package/dist/vue-3/render-inlined-styles.af201a11.js +30 -0
  32. package/dist/vue-3/render-repeated-block.4266e559.js +40 -0
  33. package/dist/vue-3/render-repeated-block.b4a6d591.cjs +1 -0
  34. package/dist/vue-3/render-styles.1744d2eb.js +59 -0
  35. package/dist/vue-3/render-styles.7d5898dd.cjs +17 -0
  36. package/dist/vue-3/sdk.cjs +1 -0
  37. package/dist/vue-3/sdk.js +28 -0
  38. package/dist/vue-3/style.css +1 -0
  39. package/nuxt.js +25 -0
  40. package/package.json +38 -5
  41. package/src/blocks/button.js +0 -31
  42. package/src/blocks/button.original.vue +0 -48
  43. package/src/blocks/button_script.js +0 -21
  44. package/src/blocks/button_styles.js +0 -0
  45. package/src/blocks/columns.js +0 -31
  46. package/src/blocks/columns.original.vue +0 -59
  47. package/src/blocks/columns_script.js +0 -58
  48. package/src/blocks/columns_styles.js +0 -14
  49. package/src/blocks/custom-code.js +0 -31
  50. package/src/blocks/custom-code.original.vue +0 -72
  51. package/src/blocks/custom-code_script.js +0 -63
  52. package/src/blocks/custom-code_styles.js +0 -0
  53. package/src/blocks/embed.js +0 -31
  54. package/src/blocks/embed.original.vue +0 -64
  55. package/src/blocks/embed_script.js +0 -53
  56. package/src/blocks/embed_styles.js +0 -0
  57. package/src/blocks/form.js +0 -31
  58. package/src/blocks/form.original.vue +0 -289
  59. package/src/blocks/form_script.js +0 -231
  60. package/src/blocks/form_styles.js +0 -12
  61. package/src/blocks/fragment.js +0 -31
  62. package/src/blocks/fragment.original.vue +0 -28
  63. package/src/blocks/fragment_script.js +0 -40
  64. package/src/blocks/fragment_styles.js +0 -0
  65. package/src/blocks/image.js +0 -31
  66. package/src/blocks/image.original.vue +0 -52
  67. package/src/blocks/image_script.js +0 -32
  68. package/src/blocks/image_styles.js +0 -13
  69. package/src/blocks/img.js +0 -31
  70. package/src/blocks/img.original.vue +0 -31
  71. package/src/blocks/img_script.js +0 -42
  72. package/src/blocks/img_styles.js +0 -0
  73. package/src/blocks/input.js +0 -31
  74. package/src/blocks/input.original.vue +0 -28
  75. package/src/blocks/input_script.js +0 -39
  76. package/src/blocks/input_styles.js +0 -0
  77. package/src/blocks/raw-text.js +0 -31
  78. package/src/blocks/raw-text.original.vue +0 -35
  79. package/src/blocks/raw-text_script.js +0 -32
  80. package/src/blocks/raw-text_styles.js +0 -0
  81. package/src/blocks/section.js +0 -31
  82. package/src/blocks/section.original.vue +0 -29
  83. package/src/blocks/section_script.js +0 -23
  84. package/src/blocks/section_styles.js +0 -0
  85. package/src/blocks/select.js +0 -31
  86. package/src/blocks/select.original.vue +0 -32
  87. package/src/blocks/select_script.js +0 -41
  88. package/src/blocks/select_styles.js +0 -0
  89. package/src/blocks/submit-button.js +0 -31
  90. package/src/blocks/submit-button.original.vue +0 -27
  91. package/src/blocks/submit-button_script.js +0 -21
  92. package/src/blocks/submit-button_styles.js +0 -0
  93. package/src/blocks/symbol.js +0 -29
  94. package/src/blocks/symbol.original.vue +0 -33
  95. package/src/blocks/symbol_script.js +0 -44
  96. package/src/blocks/symbol_styles.js +0 -0
  97. package/src/blocks/text.js +0 -31
  98. package/src/blocks/text.original.vue +0 -25
  99. package/src/blocks/text_script.js +0 -21
  100. package/src/blocks/text_styles.js +0 -0
  101. package/src/blocks/textarea.js +0 -31
  102. package/src/blocks/textarea.original.vue +0 -25
  103. package/src/blocks/textarea_script.js +0 -21
  104. package/src/blocks/textarea_styles.js +0 -0
  105. package/src/blocks/video.js +0 -31
  106. package/src/blocks/video.original.vue +0 -34
  107. package/src/blocks/video_script.js +0 -28
  108. package/src/blocks/video_styles.js +0 -0
  109. package/src/components/block-styles.js +0 -29
  110. package/src/components/block-styles.original.vue +0 -25
  111. package/src/components/block-styles.vue +0 -34
  112. package/src/components/block-styles_script.js +0 -20
  113. package/src/components/block-styles_styles.js +0 -0
  114. package/src/components/error-boundary.js +0 -29
  115. package/src/components/error-boundary.original.vue +0 -25
  116. package/src/components/error-boundary.vue +0 -15
  117. package/src/components/error-boundary_script.js +0 -20
  118. package/src/components/error-boundary_styles.js +0 -0
  119. package/src/components/render-block.js +0 -29
  120. package/src/components/render-block.original.vue +0 -119
  121. package/src/components/render-block_script.js +0 -91
  122. package/src/components/render-block_styles.js +0 -0
  123. package/src/components/render-blocks.js +0 -29
  124. package/src/components/render-blocks.original.vue +0 -75
  125. package/src/components/render-blocks_script.js +0 -76
  126. package/src/components/render-blocks_styles.js +0 -12
  127. package/src/components/render-content.js +0 -29
  128. package/src/components/render-content.original.vue +0 -95
  129. package/src/components/render-content_script.js +0 -92
  130. package/src/components/render-content_styles.js +0 -0
  131. package/src/constants/device-sizes.js +0 -46
  132. package/src/context/builder.context.js +0 -11
  133. package/src/functions/evaluate.js +0 -42
  134. package/src/functions/get-block-actions.js +0 -45
  135. package/src/functions/get-block-component-options.js +0 -14
  136. package/src/functions/get-block-properties.js +0 -46
  137. package/src/functions/get-block-styles.js +0 -13
  138. package/src/functions/get-block-tag.js +0 -13
  139. package/src/functions/get-content.js +0 -123
  140. package/src/functions/get-processed-block.js +0 -65
  141. package/src/functions/get-processed-block.test.js +0 -44
  142. package/src/functions/get-target.js +0 -13
  143. package/src/functions/if-target.js +0 -13
  144. package/src/functions/is-browser.js +0 -30
  145. package/src/functions/is-editing.js +0 -30
  146. package/src/functions/is-iframe.js +0 -30
  147. package/src/functions/is-react-native.js +0 -13
  148. package/src/functions/macro-eval.js +0 -12
  149. package/src/functions/on-change.js +0 -34
  150. package/src/functions/on-change.test.js +0 -38
  151. package/src/functions/register-component.js +0 -73
  152. package/src/functions/register.js +0 -52
  153. package/src/functions/set-editor-settings.js +0 -38
  154. package/src/functions/set.js +0 -18
  155. package/src/functions/set.test.js +0 -35
  156. package/src/functions/track.js +0 -41
  157. package/src/index.js +0 -51
  158. package/src/scripts/init-editing.js +0 -78
  159. package/src/types/builder-block.js +0 -3
  160. package/src/types/builder-content.js +0 -3
  161. package/src/types/deep-partial.js +0 -3
@@ -0,0 +1,1969 @@
1
+ import { defineAsyncComponent as v, resolveComponent as _, openBlock as d, createElementBlock as p, normalizeStyle as k, Fragment as j, renderList as E, createVNode as re, createElementVNode as O, createCommentVNode as y, normalizeClass as ae, renderSlot as C, mergeProps as x, toDisplayString as N, createBlock as S } from "vue";
2
+ const V = "vue3";
3
+ function f() {
4
+ return typeof window < "u" && typeof document < "u";
5
+ }
6
+ const B = {};
7
+ function Ce(e, n) {
8
+ let t = B[e];
9
+ if (t || (t = B[e] = []), t.push(n), f()) {
10
+ const o = {
11
+ type: "builder.register",
12
+ data: {
13
+ type: e,
14
+ info: n
15
+ }
16
+ };
17
+ try {
18
+ parent.postMessage(o, "*"), parent !== window && window.postMessage(o, "*");
19
+ } catch (r) {
20
+ console.debug("Could not postmessage", r);
21
+ }
22
+ }
23
+ }
24
+ const Se = () => {
25
+ Ce("insertMenu", {
26
+ name: "_default",
27
+ default: !0,
28
+ items: [
29
+ { name: "Box" },
30
+ { name: "Text" },
31
+ { name: "Image" },
32
+ { name: "Columns" },
33
+ { name: "Core:Section" },
34
+ { name: "Core:Button" },
35
+ { name: "Embed" },
36
+ { name: "Custom Code" }
37
+ ]
38
+ });
39
+ }, Ie = () => {
40
+ var e;
41
+ f() && ((e = window.parent) == null || e.postMessage({
42
+ type: "builder.sdkInfo",
43
+ data: {
44
+ target: V,
45
+ supportsPatchUpdates: !1
46
+ }
47
+ }, "*"), window.addEventListener("message", ({ data: n }) => {
48
+ var t, o;
49
+ if (n)
50
+ switch (n.type) {
51
+ case "builder.evaluate": {
52
+ const r = n.data.text, a = n.data.arguments || [], i = n.data.id, l = new Function(r);
53
+ let s, c = null;
54
+ try {
55
+ s = l.apply(null, a);
56
+ } catch (u) {
57
+ c = u;
58
+ }
59
+ c ? (t = window.parent) == null || t.postMessage({
60
+ type: "builder.evaluateError",
61
+ data: { id: i, error: c.message }
62
+ }, "*") : s && typeof s.then == "function" ? s.then((u) => {
63
+ var m;
64
+ (m = window.parent) == null || m.postMessage({
65
+ type: "builder.evaluateResult",
66
+ data: { id: i, result: u }
67
+ }, "*");
68
+ }).catch(console.error) : (o = window.parent) == null || o.postMessage({
69
+ type: "builder.evaluateResult",
70
+ data: { result: s, id: i }
71
+ }, "*");
72
+ break;
73
+ }
74
+ }
75
+ }));
76
+ };
77
+ function A(e) {
78
+ return e;
79
+ }
80
+ function Gn(e) {
81
+ return e;
82
+ }
83
+ const h = (e, n) => {
84
+ const t = e.__vccOpts || e;
85
+ for (const [o, r] of n)
86
+ t[o] = r;
87
+ return t;
88
+ }, Te = () => Promise.resolve().then(() => we).then((e) => e.default), Oe = {
89
+ name: "builder-columns",
90
+ components: { "render-blocks": v(Te) },
91
+ props: [
92
+ "space",
93
+ "columns",
94
+ "stackColumnsAt",
95
+ "reverseColumnsWhenStacked",
96
+ "builderBlock"
97
+ ],
98
+ data: () => ({ markMutable: A }),
99
+ computed: {
100
+ columnsCssVars() {
101
+ const e = this.stackColumnsAt === "never" ? "inherit" : this.reverseColumnsWhenStacked ? "column-reverse" : "column";
102
+ return {
103
+ "--flex-dir": e,
104
+ "--flex-dir-tablet": this.maybeApplyForTablet(e)
105
+ };
106
+ },
107
+ columnCssVars() {
108
+ const e = "100%", n = "0";
109
+ return {
110
+ "--column-width": e,
111
+ "--column-margin-left": n,
112
+ "--column-width-tablet": this.maybeApplyForTablet(e),
113
+ "--column-margin-left-tablet": this.maybeApplyForTablet(n)
114
+ };
115
+ }
116
+ },
117
+ methods: {
118
+ getGutterSize() {
119
+ return typeof this.space == "number" ? this.space || 0 : 20;
120
+ },
121
+ getColumns() {
122
+ return this.columns || [];
123
+ },
124
+ getWidth(e) {
125
+ var t;
126
+ const n = this.getColumns();
127
+ return ((t = n[e]) == null ? void 0 : t.width) || 100 / n.length;
128
+ },
129
+ getColumnCssWidth(e) {
130
+ const n = this.getColumns(), o = this.getGutterSize() * (n.length - 1) / n.length;
131
+ return `calc(${this.getWidth(e)}% - ${o}px)`;
132
+ },
133
+ maybeApplyForTablet(e) {
134
+ return (this.stackColumnsAt || "tablet") === "tablet" ? e : "inherit";
135
+ }
136
+ }
137
+ };
138
+ function Pe(e, n, t, o, r, a) {
139
+ const i = _("render-blocks");
140
+ return d(), p("div", {
141
+ class: "builder-columns div-1eih9th5ow6",
142
+ style: k(a.columnsCssVars)
143
+ }, [
144
+ (d(!0), p(j, null, E(t.columns, (l, s) => (d(), p("div", {
145
+ key: s,
146
+ class: "builder-column div-1eih9th5ow6-2",
147
+ style: k({
148
+ width: a.getColumnCssWidth(s),
149
+ marginLeft: `${s === 0 ? 0 : a.getGutterSize()}px`,
150
+ ...a.columnCssVars
151
+ })
152
+ }, [
153
+ re(i, {
154
+ blocks: e.markMutable(l.blocks),
155
+ path: `component.options.columns.${s}.blocks`,
156
+ parent: t.builderBlock.id
157
+ }, null, 8, ["blocks", "path", "parent"])
158
+ ], 4))), 128))
159
+ ], 4);
160
+ }
161
+ const Re = /* @__PURE__ */ h(Oe, [["render", Pe], ["__scopeId", "data-v-e51b00d3"]]);
162
+ function q(e) {
163
+ return e.replace(/http(s)?:/, "");
164
+ }
165
+ function je(e = "", n, t) {
166
+ const o = new RegExp("([?&])" + n + "=.*?(&|$)", "i"), r = e.indexOf("?") !== -1 ? "&" : "?";
167
+ return e.match(o) ? e.replace(o, "$1" + n + "=" + encodeURIComponent(t) + "$2") : e + r + n + "=" + encodeURIComponent(t);
168
+ }
169
+ function Ee(e, n) {
170
+ if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !n)
171
+ return e;
172
+ if (n === "master")
173
+ return q(e);
174
+ const t = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
175
+ if (t) {
176
+ const o = e.split(t[0]), r = t[3], a = n.match("x") ? n : `${n}x`;
177
+ return q(`${o[0]}_${a}${r}`);
178
+ }
179
+ return null;
180
+ }
181
+ function P(e) {
182
+ if (!e)
183
+ return e;
184
+ const n = [100, 200, 400, 800, 1200, 1600, 2e3];
185
+ if (e.match(/builder\.io/)) {
186
+ let t = e;
187
+ const o = Number(e.split("?width=")[1]);
188
+ return isNaN(o) || (t = `${t} ${o}w`), n.filter((r) => r !== o).map((r) => `${je(e, "width", r)} ${r}w`).concat([t]).join(", ");
189
+ }
190
+ return e.match(/cdn\.shopify\.com/) ? n.map((t) => [Ee(e, `${t}x${t}`), t]).filter(([t]) => !!t).map(([t, o]) => `${t} ${o}w`).concat([e]).join(", ") : e;
191
+ }
192
+ const $e = {
193
+ name: "builder-image",
194
+ props: [
195
+ "image",
196
+ "src",
197
+ "srcset",
198
+ "noWebp",
199
+ "altText",
200
+ "backgroundSize",
201
+ "className",
202
+ "sizes",
203
+ "aspectRatio",
204
+ "fitContent",
205
+ "builderBlock"
206
+ ],
207
+ computed: {
208
+ srcSetToUse() {
209
+ var t;
210
+ const n = this.image || this.src;
211
+ if (!n || !(n.match(/builder\.io/) || n.match(/cdn\.shopify\.com/)))
212
+ return this.srcset;
213
+ if (this.srcset && ((t = this.image) == null ? void 0 : t.includes("builder.io/api/v1/image"))) {
214
+ if (!this.srcset.includes(this.image.split("?")[0]))
215
+ return console.debug("Removed given srcset"), P(n);
216
+ } else if (this.image && !this.srcset)
217
+ return P(n);
218
+ return P(n);
219
+ },
220
+ webpSrcSet() {
221
+ var e;
222
+ return ((e = this.srcSetToUse) == null ? void 0 : e.match(/builder\.io/)) && !this.noWebp ? this.srcSetToUse.replace(/\?/g, "?format=webp&") : "";
223
+ }
224
+ },
225
+ methods: {
226
+ _classStringToObject(e) {
227
+ const n = {};
228
+ if (typeof e != "string")
229
+ return n;
230
+ const t = e.trim().split(/\s+/);
231
+ for (const o of t)
232
+ n[o] = !0;
233
+ return n;
234
+ }
235
+ }
236
+ }, Fe = { class: "div-2pqqf5a7788" }, Ue = ["srcset"], Ve = ["alt", "role", "src", "srcset", "sizes"], Ae = ["srcset"], We = {
237
+ key: 2,
238
+ class: "div-2pqqf5a7788-3"
239
+ };
240
+ function Le(e, n, t, o, r, a) {
241
+ var i, l, s, c;
242
+ return d(), p("div", Fe, [
243
+ O("picture", null, [
244
+ a.webpSrcSet ? (d(), p("source", {
245
+ key: 0,
246
+ type: "image/webp",
247
+ srcset: a.webpSrcSet
248
+ }, null, 8, Ue)) : y("", !0),
249
+ O("img", {
250
+ loading: "lazy",
251
+ alt: t.altText,
252
+ role: t.altText ? "presentation" : void 0,
253
+ style: k({
254
+ objectPosition: t.backgroundSize || "center",
255
+ objectFit: t.backgroundSize || "cover"
256
+ }),
257
+ class: ae(
258
+ a._classStringToObject(
259
+ "builder-image" + (t.className ? " " + t.className : "") + " img-2pqqf5a7788"
260
+ )
261
+ ),
262
+ src: t.image,
263
+ srcset: a.srcSetToUse,
264
+ sizes: t.sizes
265
+ }, null, 14, Ve),
266
+ O("source", { srcset: a.srcSetToUse }, null, 8, Ae)
267
+ ]),
268
+ t.aspectRatio && !(t.fitContent && ((l = (i = t.builderBlock) == null ? void 0 : i.children) == null ? void 0 : l.length)) ? (d(), p("div", {
269
+ key: 0,
270
+ class: "builder-image-sizer div-2pqqf5a7788-2",
271
+ style: k({
272
+ paddingTop: t.aspectRatio * 100 + "%"
273
+ })
274
+ }, null, 4)) : y("", !0),
275
+ ((c = (s = t.builderBlock) == null ? void 0 : s.children) == null ? void 0 : c.length) && t.fitContent ? C(e.$slots, "default", { key: 1 }, void 0, !0) : y("", !0),
276
+ t.fitContent ? y("", !0) : (d(), p("div", We, [
277
+ C(e.$slots, "default", {}, void 0, !0)
278
+ ]))
279
+ ]);
280
+ }
281
+ const Me = /* @__PURE__ */ h($e, [["render", Le], ["__scopeId", "data-v-acda3ece"]]), Ne = {
282
+ name: "builder-text",
283
+ props: ["text"]
284
+ }, Be = ["innerHTML"];
285
+ function qe(e, n, t, o, r, a) {
286
+ return d(), p("div", {
287
+ class: "builder-text",
288
+ innerHTML: t.text
289
+ }, null, 8, Be);
290
+ }
291
+ const De = /* @__PURE__ */ h(Ne, [["render", qe]]), ze = {
292
+ name: "builder-video",
293
+ props: [
294
+ "autoPlay",
295
+ "muted",
296
+ "controls",
297
+ "loop",
298
+ "playsInline",
299
+ "attributes",
300
+ "fit",
301
+ "position",
302
+ "video",
303
+ "posterImage"
304
+ ],
305
+ computed: {
306
+ videoProps() {
307
+ return {
308
+ ...this.autoPlay === !0 ? {
309
+ autoPlay: !0
310
+ } : {},
311
+ ...this.muted === !0 ? {
312
+ muted: !0
313
+ } : {},
314
+ ...this.controls === !0 ? {
315
+ controls: !0
316
+ } : {},
317
+ ...this.loop === !0 ? {
318
+ loop: !0
319
+ } : {},
320
+ ...this.playsInline === !0 ? {
321
+ playsInline: !0
322
+ } : {}
323
+ };
324
+ }
325
+ }
326
+ }, He = ["src", "poster"];
327
+ function Ke(e, n, t, o, r, a) {
328
+ var i;
329
+ return d(), p("video", x(a.videoProps, {
330
+ style: {
331
+ width: "100%",
332
+ height: "100%",
333
+ ...(i = t.attributes) == null ? void 0 : i.style,
334
+ objectFit: t.fit,
335
+ objectPosition: t.position,
336
+ borderRadius: 1
337
+ },
338
+ src: t.video || "no-src",
339
+ poster: t.posterImage
340
+ }), null, 16, He);
341
+ }
342
+ const Ge = /* @__PURE__ */ h(ze, [["render", Ke]]);
343
+ var Je = Object.defineProperty, Ye = Object.defineProperties, Xe = Object.getOwnPropertyDescriptors, D = Object.getOwnPropertySymbols, Qe = Object.prototype.hasOwnProperty, Ze = Object.prototype.propertyIsEnumerable, z = (e, n, t) => n in e ? Je(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, R = (e, n) => {
344
+ for (var t in n || (n = {}))
345
+ Qe.call(n, t) && z(e, t, n[t]);
346
+ if (D)
347
+ for (var t of D(n))
348
+ Ze.call(n, t) && z(e, t, n[t]);
349
+ return e;
350
+ }, et = (e, n) => Ye(e, Xe(n));
351
+ function $(e, n = null, t = ".") {
352
+ return Object.keys(e).reduce((o, r) => {
353
+ const a = e[r], i = [n, r].filter(Boolean).join(t);
354
+ return [
355
+ typeof a == "object",
356
+ a !== null,
357
+ !(Array.isArray(a) && a.length === 0)
358
+ ].every(Boolean) ? R(R({}, o), $(a, i, t)) : et(R({}, o), { [i]: a });
359
+ }, {});
360
+ }
361
+ const H = "builder.", se = (e) => {
362
+ const n = {};
363
+ return e.forEach((t, o) => {
364
+ n[o] = t;
365
+ }), n;
366
+ }, tt = (e) => {
367
+ const n = {};
368
+ return Object.keys(e).forEach((t) => {
369
+ if (t.startsWith(H)) {
370
+ const o = t.replace(H, "");
371
+ n[o] = e[t];
372
+ }
373
+ }), n;
374
+ }, nt = () => {
375
+ if (!f())
376
+ return {};
377
+ const e = new URLSearchParams(window.location.search);
378
+ return tt(se(e));
379
+ }, ot = (e) => e instanceof URLSearchParams ? se(e) : e;
380
+ function rt() {
381
+ return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : null;
382
+ }
383
+ var at = (e, n, t) => new Promise((o, r) => {
384
+ var a = (s) => {
385
+ try {
386
+ l(t.next(s));
387
+ } catch (c) {
388
+ r(c);
389
+ }
390
+ }, i = (s) => {
391
+ try {
392
+ l(t.throw(s));
393
+ } catch (c) {
394
+ r(c);
395
+ }
396
+ }, l = (s) => s.done ? o(s.value) : Promise.resolve(s.value).then(a, i);
397
+ l((t = t.apply(e, n)).next());
398
+ });
399
+ function ie() {
400
+ return at(this, null, function* () {
401
+ const e = rt().fetch;
402
+ if (typeof e > "u" && typeof global < "u") {
403
+ const n = import("./index.3e132178.js").then((t) => t.default);
404
+ return n.default || n;
405
+ }
406
+ return e.default || e;
407
+ });
408
+ }
409
+ const st = (e, n) => {
410
+ if (e.variations && Object.keys(e.variations).length) {
411
+ const t = e.id ? n[e.id] : void 0, o = t ? e.variations[t] : void 0;
412
+ if (t && o)
413
+ e.data = o.data, e.testVariationId = o.id, e.testVariationName = o.name;
414
+ else {
415
+ let r = 0;
416
+ const a = Math.random();
417
+ let i = !1;
418
+ for (const l in e.variations) {
419
+ const s = e.variations[l];
420
+ if (r += s.testRatio, a < r) {
421
+ const u = s.name || (s.id === e.id ? "Default variation" : "");
422
+ i = !0, Object.assign(e, {
423
+ data: s.data,
424
+ testVariationId: s.id,
425
+ testVariationName: u
426
+ });
427
+ }
428
+ }
429
+ i || Object.assign(e, {
430
+ testVariationId: e.id,
431
+ testVariationName: "Default"
432
+ });
433
+ }
434
+ }
435
+ };
436
+ var it = Object.defineProperty, lt = Object.defineProperties, ct = Object.getOwnPropertyDescriptors, K = Object.getOwnPropertySymbols, dt = Object.prototype.hasOwnProperty, ut = Object.prototype.propertyIsEnumerable, G = (e, n, t) => n in e ? it(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, F = (e, n) => {
437
+ for (var t in n || (n = {}))
438
+ dt.call(n, t) && G(e, t, n[t]);
439
+ if (K)
440
+ for (var t of K(n))
441
+ ut.call(n, t) && G(e, t, n[t]);
442
+ return e;
443
+ }, pt = (e, n) => lt(e, ct(n)), le = (e, n, t) => new Promise((o, r) => {
444
+ var a = (s) => {
445
+ try {
446
+ l(t.next(s));
447
+ } catch (c) {
448
+ r(c);
449
+ }
450
+ }, i = (s) => {
451
+ try {
452
+ l(t.throw(s));
453
+ } catch (c) {
454
+ r(c);
455
+ }
456
+ }, l = (s) => s.done ? o(s.value) : Promise.resolve(s.value).then(a, i);
457
+ l((t = t.apply(e, n)).next());
458
+ });
459
+ const mt = ie();
460
+ function ce(e) {
461
+ return le(this, null, function* () {
462
+ return (yield ht(pt(F({}, e), { limit: 1 }))).results[0] || null;
463
+ });
464
+ }
465
+ const ft = (e) => {
466
+ const {
467
+ limit: n = 30,
468
+ userAttributes: t,
469
+ query: o,
470
+ noTraverse: r = !1,
471
+ model: a,
472
+ apiKey: i
473
+ } = e, l = new URL(`https://cdn.builder.io/api/v2/content/${a}?apiKey=${i}&limit=${n}&noTraverse=${r}`), s = F(F({}, nt()), ot(e.options || {})), c = $(s);
474
+ for (const u in c)
475
+ l.searchParams.set(u, String(c[u]));
476
+ if (t && l.searchParams.set("userAttributes", JSON.stringify(t)), o) {
477
+ const u = $({ query: o });
478
+ for (const m in u)
479
+ l.searchParams.set(m, JSON.stringify(u[m]));
480
+ }
481
+ return l;
482
+ };
483
+ function ht(e) {
484
+ return le(this, null, function* () {
485
+ const n = ft(e), o = yield (yield mt)(n.href).then((r) => r.json());
486
+ if (e.testGroups)
487
+ for (const r of o.results)
488
+ st(r, e.testGroups);
489
+ return o;
490
+ });
491
+ }
492
+ const gt = () => Promise.resolve().then(() => Mn).then(
493
+ (e) => e.default
494
+ ), bt = {
495
+ name: "builder-symbol",
496
+ components: { "render-content": v(gt) },
497
+ props: ["symbol", "attributes"],
498
+ data: () => ({ className: "builder-symbol", content: null, markMutable: A }),
499
+ inject: {
500
+ builderContext: "BuilderContext"
501
+ },
502
+ mounted() {
503
+ var e;
504
+ this.content = (e = this.symbol) == null ? void 0 : e.content;
505
+ },
506
+ watch: {
507
+ onUpdateHook0() {
508
+ const e = this.symbol;
509
+ e && !e.content && !this.content && e.model && ce({
510
+ model: e.model,
511
+ apiKey: this.builderContext.apiKey,
512
+ query: {
513
+ id: e.entry
514
+ }
515
+ }).then((n) => {
516
+ this.content = n;
517
+ });
518
+ }
519
+ },
520
+ computed: {
521
+ onUpdateHook0() {
522
+ return {
523
+ 0: this.symbol,
524
+ 1: this.content
525
+ };
526
+ }
527
+ },
528
+ methods: {
529
+ _classStringToObject(e) {
530
+ const n = {};
531
+ if (typeof e != "string")
532
+ return n;
533
+ const t = e.trim().split(/\s+/);
534
+ for (const o of t)
535
+ n[o] = !0;
536
+ return n;
537
+ }
538
+ }
539
+ }, yt = ["dataSet"];
540
+ function vt(e, n, t, o, r, a) {
541
+ var l, s, c, u, m;
542
+ const i = _("render-content");
543
+ return d(), p("div", x(t.attributes, {
544
+ dataSet: {
545
+ class: e.className
546
+ },
547
+ class: a._classStringToObject(e.className)
548
+ }), [
549
+ re(i, {
550
+ apiKey: a.builderContext.apiKey,
551
+ context: a.builderContext.context,
552
+ customComponents: e.markMutable(Object.values(a.builderContext.registeredComponents)),
553
+ data: e.markMutable({
554
+ ...(l = t.symbol) == null ? void 0 : l.data,
555
+ ...a.builderContext.state,
556
+ ...(u = (c = (s = t.symbol) == null ? void 0 : s.content) == null ? void 0 : c.data) == null ? void 0 : u.state
557
+ }),
558
+ model: (m = t.symbol) == null ? void 0 : m.model,
559
+ content: e.markMutable(e.content)
560
+ }, null, 8, ["apiKey", "context", "customComponents", "data", "model", "content"])
561
+ ], 16, yt);
562
+ }
563
+ const _t = /* @__PURE__ */ h(bt, [["render", vt]]);
564
+ const xt = {
565
+ name: "builder-button",
566
+ props: ["attributes", "text", "link", "openLinkInNewTab"]
567
+ }, wt = ["href", "target"];
568
+ function kt(e, n, t, o, r, a) {
569
+ return t.link ? (d(), p("a", x({ key: 0 }, t.attributes, {
570
+ role: "button",
571
+ href: t.link,
572
+ target: t.openLinkInNewTab ? "_blank" : void 0
573
+ }), N(t.text), 17, wt)) : (d(), p("button", x({ key: 1 }, t.attributes, { class: "button-361b1o6wv2k" }), N(t.text), 17));
574
+ }
575
+ const Ct = /* @__PURE__ */ h(xt, [["render", kt], ["__scopeId", "data-v-9b7358fe"]]), St = {
576
+ name: "builder-section-component",
577
+ props: ["attributes", "maxWidth"]
578
+ };
579
+ function It(e, n, t, o, r, a) {
580
+ return d(), p("section", x(t.attributes, {
581
+ style: t.maxWidth && typeof t.maxWidth == "number" ? {
582
+ maxWidth: t.maxWidth
583
+ } : void 0
584
+ }), [
585
+ C(e.$slots, "default")
586
+ ], 16);
587
+ }
588
+ const Tt = /* @__PURE__ */ h(St, [["render", It]]), Ot = {
589
+ name: "builder-fragment-component",
590
+ props: []
591
+ };
592
+ function Pt(e, n, t, o, r, a) {
593
+ return d(), p("span", null, [
594
+ C(e.$slots, "default")
595
+ ]);
596
+ }
597
+ const Rt = /* @__PURE__ */ h(Ot, [["render", Pt]]), jt = {
598
+ name: "Core:Button",
599
+ builtIn: !0,
600
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
601
+ defaultStyles: {
602
+ appearance: "none",
603
+ paddingTop: "15px",
604
+ paddingBottom: "15px",
605
+ paddingLeft: "25px",
606
+ paddingRight: "25px",
607
+ backgroundColor: "#000000",
608
+ color: "white",
609
+ borderRadius: "4px",
610
+ textAlign: "center",
611
+ cursor: "pointer"
612
+ },
613
+ inputs: [
614
+ {
615
+ name: "text",
616
+ type: "text",
617
+ defaultValue: "Click me!",
618
+ bubble: !0
619
+ },
620
+ {
621
+ name: "link",
622
+ type: "url",
623
+ bubble: !0
624
+ },
625
+ {
626
+ name: "openLinkInNewTab",
627
+ type: "boolean",
628
+ defaultValue: !1,
629
+ friendlyName: "Open link in new tab"
630
+ }
631
+ ],
632
+ static: !0,
633
+ noWrap: !0
634
+ };
635
+ function W(e) {
636
+ return e.__qwik_serializable__ = !0, e;
637
+ }
638
+ const Et = {
639
+ name: "Columns",
640
+ builtIn: !0,
641
+ inputs: [
642
+ {
643
+ name: "columns",
644
+ type: "array",
645
+ broadcast: !0,
646
+ subFields: [
647
+ {
648
+ name: "blocks",
649
+ type: "array",
650
+ hideFromUI: !0,
651
+ defaultValue: [
652
+ {
653
+ "@type": "@builder.io/sdk:Element",
654
+ responsiveStyles: {
655
+ large: {
656
+ display: "flex",
657
+ flexDirection: "column",
658
+ alignItems: "stretch",
659
+ flexShrink: "0",
660
+ position: "relative",
661
+ marginTop: "30px",
662
+ textAlign: "center",
663
+ lineHeight: "normal",
664
+ height: "auto",
665
+ minHeight: "20px",
666
+ minWidth: "20px",
667
+ overflow: "hidden"
668
+ }
669
+ },
670
+ component: {
671
+ name: "Image",
672
+ options: {
673
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
674
+ backgroundPosition: "center",
675
+ backgroundSize: "cover",
676
+ aspectRatio: 0.7004048582995948
677
+ }
678
+ }
679
+ },
680
+ {
681
+ "@type": "@builder.io/sdk:Element",
682
+ responsiveStyles: {
683
+ large: {
684
+ display: "flex",
685
+ flexDirection: "column",
686
+ alignItems: "stretch",
687
+ flexShrink: "0",
688
+ position: "relative",
689
+ marginTop: "30px",
690
+ textAlign: "center",
691
+ lineHeight: "normal",
692
+ height: "auto"
693
+ }
694
+ },
695
+ component: {
696
+ name: "Text",
697
+ options: {
698
+ text: "<p>Enter some text...</p>"
699
+ }
700
+ }
701
+ }
702
+ ]
703
+ },
704
+ {
705
+ name: "width",
706
+ type: "number",
707
+ hideFromUI: !0,
708
+ helperText: "Width %, e.g. set to 50 to fill half of the space"
709
+ },
710
+ {
711
+ name: "link",
712
+ type: "url",
713
+ helperText: "Optionally set a url that clicking this column will link to"
714
+ }
715
+ ],
716
+ defaultValue: [
717
+ {
718
+ blocks: [
719
+ {
720
+ "@type": "@builder.io/sdk:Element",
721
+ responsiveStyles: {
722
+ large: {
723
+ display: "flex",
724
+ flexDirection: "column",
725
+ alignItems: "stretch",
726
+ flexShrink: "0",
727
+ position: "relative",
728
+ marginTop: "30px",
729
+ textAlign: "center",
730
+ lineHeight: "normal",
731
+ height: "auto",
732
+ minHeight: "20px",
733
+ minWidth: "20px",
734
+ overflow: "hidden"
735
+ }
736
+ },
737
+ component: {
738
+ name: "Image",
739
+ options: {
740
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
741
+ backgroundPosition: "center",
742
+ backgroundSize: "cover",
743
+ aspectRatio: 0.7004048582995948
744
+ }
745
+ }
746
+ },
747
+ {
748
+ "@type": "@builder.io/sdk:Element",
749
+ responsiveStyles: {
750
+ large: {
751
+ display: "flex",
752
+ flexDirection: "column",
753
+ alignItems: "stretch",
754
+ flexShrink: "0",
755
+ position: "relative",
756
+ marginTop: "30px",
757
+ textAlign: "center",
758
+ lineHeight: "normal",
759
+ height: "auto"
760
+ }
761
+ },
762
+ component: {
763
+ name: "Text",
764
+ options: {
765
+ text: "<p>Enter some text...</p>"
766
+ }
767
+ }
768
+ }
769
+ ]
770
+ },
771
+ {
772
+ blocks: [
773
+ {
774
+ "@type": "@builder.io/sdk:Element",
775
+ responsiveStyles: {
776
+ large: {
777
+ display: "flex",
778
+ flexDirection: "column",
779
+ alignItems: "stretch",
780
+ flexShrink: "0",
781
+ position: "relative",
782
+ marginTop: "30px",
783
+ textAlign: "center",
784
+ lineHeight: "normal",
785
+ height: "auto",
786
+ minHeight: "20px",
787
+ minWidth: "20px",
788
+ overflow: "hidden"
789
+ }
790
+ },
791
+ component: {
792
+ name: "Image",
793
+ options: {
794
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
795
+ backgroundPosition: "center",
796
+ backgroundSize: "cover",
797
+ aspectRatio: 0.7004048582995948
798
+ }
799
+ }
800
+ },
801
+ {
802
+ "@type": "@builder.io/sdk:Element",
803
+ responsiveStyles: {
804
+ large: {
805
+ display: "flex",
806
+ flexDirection: "column",
807
+ alignItems: "stretch",
808
+ flexShrink: "0",
809
+ position: "relative",
810
+ marginTop: "30px",
811
+ textAlign: "center",
812
+ lineHeight: "normal",
813
+ height: "auto"
814
+ }
815
+ },
816
+ component: {
817
+ name: "Text",
818
+ options: {
819
+ text: "<p>Enter some text...</p>"
820
+ }
821
+ }
822
+ }
823
+ ]
824
+ }
825
+ ],
826
+ onChange: W((e) => {
827
+ function n() {
828
+ t.forEach((o) => {
829
+ o.delete("width");
830
+ });
831
+ }
832
+ const t = e.get("columns");
833
+ Array.isArray(t) && !!t.find((r) => r.get("width")) && (!!t.find((a) => !a.get("width")) || t.reduce((l, s) => l + s.get("width"), 0) !== 100) && n();
834
+ })
835
+ },
836
+ {
837
+ name: "space",
838
+ type: "number",
839
+ defaultValue: 20,
840
+ helperText: "Size of gap between columns",
841
+ advanced: !0
842
+ },
843
+ {
844
+ name: "stackColumnsAt",
845
+ type: "string",
846
+ defaultValue: "tablet",
847
+ helperText: "Convert horizontal columns to vertical at what device size",
848
+ enum: ["tablet", "mobile", "never"],
849
+ advanced: !0
850
+ },
851
+ {
852
+ name: "reverseColumnsWhenStacked",
853
+ type: "boolean",
854
+ defaultValue: !1,
855
+ helperText: "When stacking columns for mobile devices, reverse the ordering",
856
+ advanced: !0
857
+ }
858
+ ]
859
+ }, $t = {
860
+ name: "Fragment",
861
+ static: !0,
862
+ hidden: !0,
863
+ builtIn: !0,
864
+ canHaveChildren: !0,
865
+ noWrap: !0
866
+ }, Ft = {
867
+ name: "Image",
868
+ static: !0,
869
+ builtIn: !0,
870
+ 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",
871
+ defaultStyles: {
872
+ position: "relative",
873
+ minHeight: "20px",
874
+ minWidth: "20px",
875
+ overflow: "hidden"
876
+ },
877
+ canHaveChildren: !0,
878
+ inputs: [
879
+ {
880
+ name: "image",
881
+ type: "file",
882
+ bubble: !0,
883
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
884
+ required: !0,
885
+ defaultValue: "https://cdn.builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
886
+ onChange: W((e) => {
887
+ e.delete("srcset"), e.delete("noWebp");
888
+ function t(i, l = 6e4) {
889
+ return new Promise((s, c) => {
890
+ const u = document.createElement("img");
891
+ let m = !1;
892
+ u.onload = () => {
893
+ m = !0, s(u);
894
+ }, u.addEventListener("error", (w) => {
895
+ console.warn("Image load failed", w.error), c(w.error);
896
+ }), u.src = i, setTimeout(() => {
897
+ m || c(new Error("Image load timed out"));
898
+ }, l);
899
+ });
900
+ }
901
+ function o(i) {
902
+ return Math.round(i * 1e3) / 1e3;
903
+ }
904
+ const r = e.get("image"), a = e.get("aspectRatio");
905
+ if (fetch(r).then((i) => i.blob()).then((i) => {
906
+ i.type.includes("svg") && e.set("noWebp", !0);
907
+ }), r && (!a || a === 0.7041))
908
+ return t(r).then((i) => {
909
+ const l = e.get("aspectRatio");
910
+ e.get("image") === r && (!l || l === 0.7041) && i.width && i.height && (e.set("aspectRatio", o(i.height / i.width)), e.set("height", i.height), e.set("width", i.width));
911
+ });
912
+ })
913
+ },
914
+ {
915
+ name: "backgroundSize",
916
+ type: "text",
917
+ defaultValue: "cover",
918
+ enum: [
919
+ {
920
+ label: "contain",
921
+ value: "contain",
922
+ helperText: "The image should never get cropped"
923
+ },
924
+ {
925
+ label: "cover",
926
+ value: "cover",
927
+ helperText: "The image should fill it's box, cropping when needed"
928
+ }
929
+ ]
930
+ },
931
+ {
932
+ name: "backgroundPosition",
933
+ type: "text",
934
+ defaultValue: "center",
935
+ enum: [
936
+ "center",
937
+ "top",
938
+ "left",
939
+ "right",
940
+ "bottom",
941
+ "top left",
942
+ "top right",
943
+ "bottom left",
944
+ "bottom right"
945
+ ]
946
+ },
947
+ {
948
+ name: "altText",
949
+ type: "string",
950
+ helperText: "Text to display when the user has images off"
951
+ },
952
+ {
953
+ name: "height",
954
+ type: "number",
955
+ hideFromUI: !0
956
+ },
957
+ {
958
+ name: "width",
959
+ type: "number",
960
+ hideFromUI: !0
961
+ },
962
+ {
963
+ name: "sizes",
964
+ type: "string",
965
+ hideFromUI: !0
966
+ },
967
+ {
968
+ name: "srcset",
969
+ type: "string",
970
+ hideFromUI: !0
971
+ },
972
+ {
973
+ name: "lazy",
974
+ type: "boolean",
975
+ defaultValue: !0,
976
+ hideFromUI: !0
977
+ },
978
+ {
979
+ name: "fitContent",
980
+ type: "boolean",
981
+ helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
982
+ defaultValue: !0
983
+ },
984
+ {
985
+ name: "aspectRatio",
986
+ type: "number",
987
+ helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
988
+ advanced: !0,
989
+ defaultValue: 0.7041
990
+ }
991
+ ]
992
+ }, Ut = {
993
+ name: "Core:Section",
994
+ static: !0,
995
+ builtIn: !0,
996
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
997
+ inputs: [
998
+ {
999
+ name: "maxWidth",
1000
+ type: "number",
1001
+ defaultValue: 1200
1002
+ },
1003
+ {
1004
+ name: "lazyLoad",
1005
+ type: "boolean",
1006
+ defaultValue: !1,
1007
+ advanced: !0,
1008
+ description: "Only render this section when in view"
1009
+ }
1010
+ ],
1011
+ defaultStyles: {
1012
+ paddingLeft: "20px",
1013
+ paddingRight: "20px",
1014
+ paddingTop: "50px",
1015
+ paddingBottom: "50px",
1016
+ marginTop: "0px",
1017
+ width: "100vw",
1018
+ marginLeft: "calc(50% - 50vw)"
1019
+ },
1020
+ canHaveChildren: !0,
1021
+ defaultChildren: [
1022
+ {
1023
+ "@type": "@builder.io/sdk:Element",
1024
+ responsiveStyles: {
1025
+ large: {
1026
+ textAlign: "center"
1027
+ }
1028
+ },
1029
+ component: {
1030
+ name: "Text",
1031
+ options: {
1032
+ text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
1033
+ }
1034
+ }
1035
+ }
1036
+ ]
1037
+ }, Vt = {
1038
+ name: "Symbol",
1039
+ noWrap: !0,
1040
+ static: !0,
1041
+ builtIn: !0,
1042
+ inputs: [
1043
+ {
1044
+ name: "symbol",
1045
+ type: "uiSymbol"
1046
+ },
1047
+ {
1048
+ name: "dataOnly",
1049
+ helperText: "Make this a data symbol that doesn't display any UI",
1050
+ type: "boolean",
1051
+ defaultValue: !1,
1052
+ advanced: !0,
1053
+ hideFromUI: !0
1054
+ },
1055
+ {
1056
+ name: "inheritState",
1057
+ helperText: "Inherit the parent component state and data",
1058
+ type: "boolean",
1059
+ defaultValue: !1,
1060
+ advanced: !0
1061
+ },
1062
+ {
1063
+ name: "renderToLiquid",
1064
+ helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1065
+ type: "boolean",
1066
+ defaultValue: !1,
1067
+ advanced: !0,
1068
+ hideFromUI: !0
1069
+ },
1070
+ {
1071
+ name: "useChildren",
1072
+ hideFromUI: !0,
1073
+ type: "boolean"
1074
+ }
1075
+ ]
1076
+ }, At = {
1077
+ name: "Text",
1078
+ static: !0,
1079
+ builtIn: !0,
1080
+ 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",
1081
+ inputs: [
1082
+ {
1083
+ name: "text",
1084
+ type: "html",
1085
+ required: !0,
1086
+ autoFocus: !0,
1087
+ bubble: !0,
1088
+ defaultValue: "Enter some text..."
1089
+ }
1090
+ ],
1091
+ defaultStyles: {
1092
+ lineHeight: "normal",
1093
+ height: "auto",
1094
+ textAlign: "center"
1095
+ }
1096
+ }, Wt = {
1097
+ name: "Video",
1098
+ canHaveChildren: !0,
1099
+ builtIn: !0,
1100
+ defaultStyles: {
1101
+ minHeight: "20px",
1102
+ minWidth: "20px"
1103
+ },
1104
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",
1105
+ inputs: [
1106
+ {
1107
+ name: "video",
1108
+ type: "file",
1109
+ allowedFileTypes: ["mp4"],
1110
+ bubble: !0,
1111
+ defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
1112
+ required: !0
1113
+ },
1114
+ {
1115
+ name: "posterImage",
1116
+ type: "file",
1117
+ allowedFileTypes: ["jpeg", "png"],
1118
+ helperText: "Image to show before the video plays"
1119
+ },
1120
+ {
1121
+ name: "autoPlay",
1122
+ type: "boolean",
1123
+ defaultValue: !0
1124
+ },
1125
+ {
1126
+ name: "controls",
1127
+ type: "boolean",
1128
+ defaultValue: !1
1129
+ },
1130
+ {
1131
+ name: "muted",
1132
+ type: "boolean",
1133
+ defaultValue: !0
1134
+ },
1135
+ {
1136
+ name: "loop",
1137
+ type: "boolean",
1138
+ defaultValue: !0
1139
+ },
1140
+ {
1141
+ name: "playsInline",
1142
+ type: "boolean",
1143
+ defaultValue: !0
1144
+ },
1145
+ {
1146
+ name: "fit",
1147
+ type: "text",
1148
+ defaultValue: "cover",
1149
+ enum: ["contain", "cover", "fill", "auto"]
1150
+ },
1151
+ {
1152
+ name: "fitContent",
1153
+ type: "boolean",
1154
+ helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
1155
+ defaultValue: !0,
1156
+ advanced: !0
1157
+ },
1158
+ {
1159
+ name: "position",
1160
+ type: "text",
1161
+ defaultValue: "center",
1162
+ enum: [
1163
+ "center",
1164
+ "top",
1165
+ "left",
1166
+ "right",
1167
+ "bottom",
1168
+ "top left",
1169
+ "top right",
1170
+ "bottom left",
1171
+ "bottom right"
1172
+ ]
1173
+ },
1174
+ {
1175
+ name: "height",
1176
+ type: "number",
1177
+ advanced: !0
1178
+ },
1179
+ {
1180
+ name: "width",
1181
+ type: "number",
1182
+ advanced: !0
1183
+ },
1184
+ {
1185
+ name: "aspectRatio",
1186
+ type: "number",
1187
+ advanced: !0,
1188
+ defaultValue: 0.7004048582995948
1189
+ },
1190
+ {
1191
+ name: "lazyLoad",
1192
+ type: "boolean",
1193
+ helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
1194
+ defaultValue: !0,
1195
+ advanced: !0
1196
+ }
1197
+ ]
1198
+ }, Lt = {
1199
+ name: "Embed",
1200
+ static: !0,
1201
+ builtIn: !0,
1202
+ inputs: [
1203
+ {
1204
+ name: "url",
1205
+ type: "url",
1206
+ required: !0,
1207
+ defaultValue: "",
1208
+ helperText: "e.g. enter a youtube url, google map, etc",
1209
+ onChange: W((e) => {
1210
+ const n = e.get("url");
1211
+ if (n)
1212
+ return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${n}&api_key=ae0e60e78201a3f2b0de4b`).then((o) => o.json()).then((o) => {
1213
+ e.get("url") === n && (o.html ? e.set("content", o.html) : e.set("content", "Invalid url, please try another"));
1214
+ }).catch((o) => {
1215
+ e.set("content", "There was an error embedding this URL, please try again or another URL");
1216
+ });
1217
+ e.delete("content");
1218
+ })
1219
+ },
1220
+ {
1221
+ name: "content",
1222
+ type: "html",
1223
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1224
+ hideFromUI: !0
1225
+ }
1226
+ ]
1227
+ }, Mt = [
1228
+ "text/javascript",
1229
+ "application/javascript",
1230
+ "application/ecmascript"
1231
+ ], Nt = (e) => Mt.includes(e.type), Bt = {
1232
+ name: "builder-embed",
1233
+ props: ["content"],
1234
+ data: () => ({ scriptsInserted: [], scriptsRun: [], ranInitFn: !1 }),
1235
+ watch: {
1236
+ onUpdateHook0() {
1237
+ this.$refs.elem && !this.ranInitFn && (this.ranInitFn = !0, this.findAndRunScripts());
1238
+ }
1239
+ },
1240
+ computed: {
1241
+ onUpdateHook0() {
1242
+ return {
1243
+ 0: this.$refs.elem,
1244
+ 1: this.ranInitFn
1245
+ };
1246
+ }
1247
+ },
1248
+ methods: {
1249
+ findAndRunScripts() {
1250
+ const e = this.$refs.elem.getElementsByTagName("script");
1251
+ for (let n = 0; n < e.length; n++) {
1252
+ const t = e[n];
1253
+ if (t.src && !this.scriptsInserted.includes(t.src)) {
1254
+ this.scriptsInserted.push(t.src);
1255
+ const o = document.createElement("script");
1256
+ o.async = !0, o.src = t.src, document.head.appendChild(o);
1257
+ } else if (Nt(t) && !this.scriptsRun.includes(t.innerText))
1258
+ try {
1259
+ this.scriptsRun.push(t.innerText), new Function(t.innerText)();
1260
+ } catch (o) {
1261
+ console.warn("`Embed`: Error running script:", o);
1262
+ }
1263
+ }
1264
+ }
1265
+ }
1266
+ }, qt = ["innerHTML"];
1267
+ function Dt(e, n, t, o, r, a) {
1268
+ return d(), p("div", {
1269
+ class: "builder-embed",
1270
+ ref: "elem",
1271
+ innerHTML: t.content
1272
+ }, null, 8, qt);
1273
+ }
1274
+ const zt = /* @__PURE__ */ h(Bt, [["render", Dt]]);
1275
+ function Ht() {
1276
+ return f() && window.self !== window.top;
1277
+ }
1278
+ function b() {
1279
+ return Ht() && window.location.search.indexOf("builder.frameEditing=") !== -1;
1280
+ }
1281
+ const Kt = {
1282
+ name: "builder-img-component",
1283
+ props: [
1284
+ "backgroundSize",
1285
+ "backgroundPosition",
1286
+ "imgSrc",
1287
+ "altText",
1288
+ "image",
1289
+ "attributes"
1290
+ ],
1291
+ data: () => ({ isEditing: b })
1292
+ }, Gt = ["alt", "src"];
1293
+ function Jt(e, n, t, o, r, a) {
1294
+ return d(), p("img", x(t.attributes, {
1295
+ style: {
1296
+ objectFit: t.backgroundSize || "cover",
1297
+ objectPosition: t.backgroundPosition || "center"
1298
+ },
1299
+ key: e.isEditing() && t.imgSrc || "default-key",
1300
+ alt: t.altText,
1301
+ src: t.imgSrc || t.image
1302
+ }), null, 16, Gt);
1303
+ }
1304
+ const Yt = /* @__PURE__ */ h(Kt, [["render", Jt]]), Xt = {
1305
+ name: "Raw:Img",
1306
+ hideFromInsertMenu: !0,
1307
+ builtIn: !0,
1308
+ 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",
1309
+ inputs: [
1310
+ {
1311
+ name: "image",
1312
+ bubble: !0,
1313
+ type: "file",
1314
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
1315
+ required: !0
1316
+ }
1317
+ ],
1318
+ noWrap: !0,
1319
+ static: !0
1320
+ };
1321
+ var Qt = Object.defineProperty, J = Object.getOwnPropertySymbols, Zt = Object.prototype.hasOwnProperty, en = Object.prototype.propertyIsEnumerable, Y = (e, n, t) => n in e ? Qt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, g = (e, n) => {
1322
+ for (var t in n || (n = {}))
1323
+ Zt.call(n, t) && Y(e, t, n[t]);
1324
+ if (J)
1325
+ for (var t of J(n))
1326
+ en.call(n, t) && Y(e, t, n[t]);
1327
+ return e;
1328
+ };
1329
+ const tn = () => [
1330
+ g({ component: Re }, Et),
1331
+ g({ component: Me }, Ft),
1332
+ g({ component: Yt }, Xt),
1333
+ g({ component: De }, At),
1334
+ g({ component: Ge }, Wt),
1335
+ g({ component: _t }, Vt),
1336
+ g({ component: Ct }, jt),
1337
+ g({ component: Tt }, Ut),
1338
+ g({ component: Rt }, $t),
1339
+ g({ component: zt }, Lt)
1340
+ ];
1341
+ function X({
1342
+ code: e,
1343
+ context: n,
1344
+ state: t,
1345
+ event: o
1346
+ }) {
1347
+ if (e === "") {
1348
+ console.warn("Skipping evaluation of empty code block.");
1349
+ return;
1350
+ }
1351
+ const r = {
1352
+ isEditing: b(),
1353
+ isBrowser: f(),
1354
+ isServer: !f()
1355
+ }, i = !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e;
1356
+ try {
1357
+ return new Function("builder", "Builder", "state", "context", "event", i)(r, r, t, n, o);
1358
+ } catch (l) {
1359
+ console.warn(`Builder custom code error:
1360
+ While Evaluating:
1361
+ `, i, `
1362
+ `, l.message || l);
1363
+ }
1364
+ }
1365
+ function nn() {
1366
+ return !f() || b() ? !1 : Boolean(location.search.indexOf("builder.preview=") !== -1);
1367
+ }
1368
+ var on = Object.defineProperty, rn = Object.defineProperties, an = Object.getOwnPropertyDescriptors, I = Object.getOwnPropertySymbols, de = Object.prototype.hasOwnProperty, ue = Object.prototype.propertyIsEnumerable, Q = (e, n, t) => n in e ? on(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, U = (e, n) => {
1369
+ for (var t in n || (n = {}))
1370
+ de.call(n, t) && Q(e, t, n[t]);
1371
+ if (I)
1372
+ for (var t of I(n))
1373
+ ue.call(n, t) && Q(e, t, n[t]);
1374
+ return e;
1375
+ }, Z = (e, n) => rn(e, an(n)), pe = (e, n) => {
1376
+ var t = {};
1377
+ for (var o in e)
1378
+ de.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
1379
+ if (e != null && I)
1380
+ for (var o of I(e))
1381
+ n.indexOf(o) < 0 && ue.call(e, o) && (t[o] = e[o]);
1382
+ return t;
1383
+ };
1384
+ const me = [];
1385
+ function Jn(e, n) {
1386
+ return me.push(U({ component: e }, n)), console.warn("registerComponent is deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK."), e;
1387
+ }
1388
+ const sn = (e) => {
1389
+ var n = e, t = pe(n, [
1390
+ "component"
1391
+ ]);
1392
+ return {
1393
+ type: "builder.registerComponent",
1394
+ data: dn(t)
1395
+ };
1396
+ }, fe = (e) => JSON.parse(JSON.stringify(e)), ln = (e) => typeof e == "function" ? cn(e) : fe(e), cn = (e) => {
1397
+ const n = e.toString().trim();
1398
+ return `return (${!n.startsWith("function") && !n.startsWith("(") ? "function " : ""}${n}).apply(this, arguments)`;
1399
+ }, dn = (e) => {
1400
+ var n = e, {
1401
+ inputs: t
1402
+ } = n, o = pe(n, [
1403
+ "inputs"
1404
+ ]);
1405
+ return Z(U({}, fe(o)), {
1406
+ inputs: t == null ? void 0 : t.map((r) => Object.entries(r).reduce((a, [i, l]) => Z(U({}, a), {
1407
+ [i]: ln(l)
1408
+ }), {}))
1409
+ });
1410
+ }, un = (e) => {
1411
+ const n = e.split(".");
1412
+ return n.length > 2 ? n.slice(1).join(".") : e;
1413
+ }, pn = ({
1414
+ name: e,
1415
+ canTrack: n
1416
+ }) => {
1417
+ var t;
1418
+ try {
1419
+ return n ? (t = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : t.split("=")[1] : void 0;
1420
+ } catch (o) {
1421
+ console.debug("[COOKIE] GET error: ", o);
1422
+ }
1423
+ }, mn = (e) => e.map(([n, t]) => t ? `${n}=${t}` : n).join("; "), fn = [
1424
+ ["secure", ""],
1425
+ ["SameSite", "None"]
1426
+ ], hn = ({
1427
+ name: e,
1428
+ value: n,
1429
+ expires: t
1430
+ }) => {
1431
+ const r = (f() ? location.protocol === "https:" : !0) ? fn : [[]], a = t ? [["expires", t.toUTCString()]] : [[]], i = [
1432
+ [e, n],
1433
+ ...a,
1434
+ ["path", "/"],
1435
+ ["domain", un(window.location.hostname)],
1436
+ ...r
1437
+ ];
1438
+ return mn(i);
1439
+ }, gn = ({
1440
+ name: e,
1441
+ value: n,
1442
+ expires: t,
1443
+ canTrack: o
1444
+ }) => {
1445
+ try {
1446
+ if (!o)
1447
+ return;
1448
+ const r = hn({ name: e, value: n, expires: t });
1449
+ document.cookie = r;
1450
+ } catch (r) {
1451
+ console.warn("[COOKIE] SET error: ", r);
1452
+ }
1453
+ }, he = (e) => e != null;
1454
+ function bn() {
1455
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
1456
+ const n = Math.random() * 16 | 0;
1457
+ return (e == "x" ? n : n & 3 | 8).toString(16);
1458
+ });
1459
+ }
1460
+ function ge() {
1461
+ return bn().replace(/-/g, "");
1462
+ }
1463
+ const be = "builderSessionId", yn = ({ canTrack: e }) => {
1464
+ if (!e)
1465
+ return;
1466
+ const n = pn({ name: be, canTrack: e });
1467
+ if (he(n))
1468
+ return n;
1469
+ {
1470
+ const t = vn();
1471
+ _n({ id: t, canTrack: e });
1472
+ }
1473
+ }, vn = () => ge(), _n = ({
1474
+ id: e,
1475
+ canTrack: n
1476
+ }) => gn({ name: be, value: e, canTrack: n }), ye = () => f() && typeof localStorage < "u" ? localStorage : void 0, xn = ({
1477
+ key: e,
1478
+ canTrack: n
1479
+ }) => {
1480
+ var t;
1481
+ try {
1482
+ return n ? (t = ye()) == null ? void 0 : t.getItem(e) : void 0;
1483
+ } catch (o) {
1484
+ console.debug("[LocalStorage] GET error: ", o);
1485
+ }
1486
+ }, wn = ({
1487
+ key: e,
1488
+ canTrack: n,
1489
+ value: t
1490
+ }) => {
1491
+ var o;
1492
+ try {
1493
+ n && ((o = ye()) == null || o.setItem(e, t));
1494
+ } catch (r) {
1495
+ console.debug("[LocalStorage] SET error: ", r);
1496
+ }
1497
+ }, ve = "builderVisitorId", kn = ({ canTrack: e }) => {
1498
+ if (!e)
1499
+ return;
1500
+ const n = xn({
1501
+ key: ve,
1502
+ canTrack: e
1503
+ });
1504
+ if (he(n))
1505
+ return n;
1506
+ {
1507
+ const t = Cn();
1508
+ Sn({ id: t, canTrack: e });
1509
+ }
1510
+ }, Cn = () => ge(), Sn = ({
1511
+ id: e,
1512
+ canTrack: n
1513
+ }) => wn({
1514
+ key: ve,
1515
+ value: e,
1516
+ canTrack: n
1517
+ });
1518
+ var In = Object.defineProperty, Tn = Object.defineProperties, On = Object.getOwnPropertyDescriptors, T = Object.getOwnPropertySymbols, _e = Object.prototype.hasOwnProperty, xe = Object.prototype.propertyIsEnumerable, ee = (e, n, t) => n in e ? In(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, te = (e, n) => {
1519
+ for (var t in n || (n = {}))
1520
+ _e.call(n, t) && ee(e, t, n[t]);
1521
+ if (T)
1522
+ for (var t of T(n))
1523
+ xe.call(n, t) && ee(e, t, n[t]);
1524
+ return e;
1525
+ }, Pn = (e, n) => Tn(e, On(n)), Rn = (e, n) => {
1526
+ var t = {};
1527
+ for (var o in e)
1528
+ _e.call(e, o) && n.indexOf(o) < 0 && (t[o] = e[o]);
1529
+ if (e != null && T)
1530
+ for (var o of T(e))
1531
+ n.indexOf(o) < 0 && xe.call(e, o) && (t[o] = e[o]);
1532
+ return t;
1533
+ }, jn = (e, n, t) => new Promise((o, r) => {
1534
+ var a = (s) => {
1535
+ try {
1536
+ l(t.next(s));
1537
+ } catch (c) {
1538
+ r(c);
1539
+ }
1540
+ }, i = (s) => {
1541
+ try {
1542
+ l(t.throw(s));
1543
+ } catch (c) {
1544
+ r(c);
1545
+ }
1546
+ }, l = (s) => s.done ? o(s.value) : Promise.resolve(s.value).then(a, i);
1547
+ l((t = t.apply(e, n)).next());
1548
+ });
1549
+ const En = ({ canTrack: e }) => {
1550
+ if (!e)
1551
+ return { visitorId: void 0, sessionId: void 0 };
1552
+ const n = yn({ canTrack: e }), t = kn({ canTrack: e });
1553
+ return {
1554
+ sessionId: n,
1555
+ visitorId: t
1556
+ };
1557
+ }, $n = (e) => {
1558
+ var n = e, {
1559
+ type: t,
1560
+ canTrack: o,
1561
+ orgId: r,
1562
+ contentId: a
1563
+ } = n, i = Rn(n, [
1564
+ "type",
1565
+ "canTrack",
1566
+ "orgId",
1567
+ "contentId"
1568
+ ]);
1569
+ return {
1570
+ type: t,
1571
+ data: Pn(te(te({}, i), En({ canTrack: o })), {
1572
+ ownerId: r,
1573
+ contentId: a
1574
+ })
1575
+ };
1576
+ };
1577
+ function ne(e) {
1578
+ return jn(this, null, function* () {
1579
+ if (!!e.canTrack && !b() && !!(f() || V === "reactNative"))
1580
+ return fetch("https://builder.io/api/v1/track", {
1581
+ method: "POST",
1582
+ body: JSON.stringify({
1583
+ events: [$n(e)]
1584
+ }),
1585
+ headers: {
1586
+ "content-type": "application/json"
1587
+ },
1588
+ mode: "cors"
1589
+ }).catch((n) => {
1590
+ console.error("Failed to track: ", n);
1591
+ });
1592
+ });
1593
+ }
1594
+ const Fn = () => Promise.resolve().then(() => we).then((e) => e.default), Un = () => import("./render-styles.1744d2eb.js").then((e) => e.default), Vn = {
1595
+ name: "render-content",
1596
+ components: {
1597
+ "render-content-styles": v(Un),
1598
+ "render-blocks": v(Fn)
1599
+ },
1600
+ props: [
1601
+ "content",
1602
+ "data",
1603
+ "canTrack",
1604
+ "context",
1605
+ "customComponents",
1606
+ "model",
1607
+ "apiKey"
1608
+ ],
1609
+ data: () => ({
1610
+ forceReRenderCount: 0,
1611
+ overrideContent: null,
1612
+ update: 0,
1613
+ overrideState: {},
1614
+ markMutable: A
1615
+ }),
1616
+ provide() {
1617
+ const e = this;
1618
+ return {
1619
+ BuilderContext: {
1620
+ get content() {
1621
+ return e.useContent;
1622
+ },
1623
+ get state() {
1624
+ return e.contentState;
1625
+ },
1626
+ get context() {
1627
+ return e.contextContext;
1628
+ },
1629
+ get apiKey() {
1630
+ return e.apiKey;
1631
+ },
1632
+ get registeredComponents() {
1633
+ return e.allRegisteredComponents;
1634
+ }
1635
+ }
1636
+ };
1637
+ },
1638
+ mounted() {
1639
+ if (f()) {
1640
+ if (b() && (this.forceReRenderCount = this.forceReRenderCount + 1, Se(), Ie(), Object.values(this.allRegisteredComponents).forEach(
1641
+ (e) => {
1642
+ var t;
1643
+ const n = sn(e);
1644
+ (t = window.parent) == null || t.postMessage(n, "*");
1645
+ }
1646
+ ), window.addEventListener("message", this.processMessage), window.addEventListener(
1647
+ "builder:component:stateChangeListenerActivated",
1648
+ this.emitStateUpdate
1649
+ )), this.useContent && ne({
1650
+ type: "impression",
1651
+ canTrack: this.canTrackToUse,
1652
+ contentId: this.useContent.id,
1653
+ orgId: this.apiKey
1654
+ }), nn()) {
1655
+ const e = new URL(location.href).searchParams;
1656
+ if (this.model && e.get("builder.preview") === this.model) {
1657
+ const n = e.get("apiKey") || e.get("builder.space");
1658
+ n && ce({
1659
+ model: this.model,
1660
+ apiKey: n
1661
+ }).then((t) => {
1662
+ t && (this.overrideContent = t);
1663
+ });
1664
+ }
1665
+ }
1666
+ this.evaluateJsCode(), this.runHttpRequests(), this.emitStateUpdate();
1667
+ }
1668
+ },
1669
+ watch: {
1670
+ onUpdateHook0() {
1671
+ this.evaluateJsCode();
1672
+ },
1673
+ onUpdateHook1() {
1674
+ this.runHttpRequests();
1675
+ },
1676
+ onUpdateHook2() {
1677
+ this.emitStateUpdate();
1678
+ }
1679
+ },
1680
+ unmounted() {
1681
+ f() && (window.removeEventListener("message", this.processMessage), window.removeEventListener(
1682
+ "builder:component:stateChangeListenerActivated",
1683
+ this.emitStateUpdate
1684
+ ));
1685
+ },
1686
+ computed: {
1687
+ useContent() {
1688
+ var n, t;
1689
+ return {
1690
+ ...this.content,
1691
+ ...this.overrideContent,
1692
+ data: {
1693
+ ...(n = this.content) == null ? void 0 : n.data,
1694
+ ...this.data,
1695
+ ...(t = this.overrideContent) == null ? void 0 : t.data
1696
+ }
1697
+ };
1698
+ },
1699
+ canTrackToUse() {
1700
+ return this.canTrack || !0;
1701
+ },
1702
+ contentState() {
1703
+ var e, n;
1704
+ return {
1705
+ ...(n = (e = this.content) == null ? void 0 : e.data) == null ? void 0 : n.state,
1706
+ ...this.data,
1707
+ ...this.overrideState
1708
+ };
1709
+ },
1710
+ contextContext() {
1711
+ return this.context || {};
1712
+ },
1713
+ allRegisteredComponents() {
1714
+ return [
1715
+ ...tn(),
1716
+ ...me,
1717
+ ...this.customComponents || []
1718
+ ].reduce(
1719
+ (t, o) => ({ ...t, [o.name]: o }),
1720
+ {}
1721
+ );
1722
+ },
1723
+ httpReqsData() {
1724
+ return {};
1725
+ },
1726
+ shouldRenderContentStyles() {
1727
+ var e, n, t, o, r;
1728
+ return Boolean(
1729
+ (((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)) && V !== "reactNative"
1730
+ );
1731
+ },
1732
+ onUpdateHook0() {
1733
+ var e, n;
1734
+ return {
1735
+ 0: (n = (e = this.useContent) == null ? void 0 : e.data) == null ? void 0 : n.jsCode
1736
+ };
1737
+ },
1738
+ onUpdateHook1() {
1739
+ var e, n;
1740
+ return {
1741
+ 0: (n = (e = this.useContent) == null ? void 0 : e.data) == null ? void 0 : n.httpRequests
1742
+ };
1743
+ },
1744
+ onUpdateHook2() {
1745
+ return {
1746
+ 0: this.contentState
1747
+ };
1748
+ }
1749
+ },
1750
+ methods: {
1751
+ processMessage(e) {
1752
+ const { data: n } = e;
1753
+ if (n)
1754
+ switch (n.type) {
1755
+ case "builder.contentUpdate": {
1756
+ const t = n.data, o = t.key || t.alias || t.entry || t.modelName, r = t.data;
1757
+ o === this.model && (this.overrideContent = r, this.forceReRenderCount = this.forceReRenderCount + 1);
1758
+ break;
1759
+ }
1760
+ }
1761
+ },
1762
+ evaluateJsCode() {
1763
+ var n, t;
1764
+ const e = (t = (n = this.useContent) == null ? void 0 : n.data) == null ? void 0 : t.jsCode;
1765
+ e && X({
1766
+ code: e,
1767
+ context: this.contextContext,
1768
+ state: this.contentState
1769
+ });
1770
+ },
1771
+ onClick(e) {
1772
+ this.useContent && ne({
1773
+ type: "click",
1774
+ canTrack: this.canTrackToUse,
1775
+ contentId: this.useContent.id,
1776
+ orgId: this.apiKey
1777
+ });
1778
+ },
1779
+ evalExpression(e) {
1780
+ return e.replace(
1781
+ /{{([^}]+)}}/g,
1782
+ (n, t) => X({
1783
+ code: t,
1784
+ context: this.contextContext,
1785
+ state: this.contentState
1786
+ })
1787
+ );
1788
+ },
1789
+ handleRequest({ url: e, key: n }) {
1790
+ ie().then((t) => t(e)).then((t) => t.json()).then((t) => {
1791
+ const o = { ...this.overrideState, [n]: t };
1792
+ this.overrideState = o;
1793
+ }).catch((t) => {
1794
+ console.log("error fetching dynamic data", e, t);
1795
+ });
1796
+ },
1797
+ runHttpRequests() {
1798
+ var n, t, o;
1799
+ const e = (o = (t = (n = this.useContent) == null ? void 0 : n.data) == null ? void 0 : t.httpRequests) != null ? o : {};
1800
+ Object.entries(e).forEach(([r, a]) => {
1801
+ if (a && (!this.httpReqsData[r] || b())) {
1802
+ const i = this.evalExpression(a);
1803
+ this.handleRequest({
1804
+ url: i,
1805
+ key: r
1806
+ });
1807
+ }
1808
+ });
1809
+ },
1810
+ emitStateUpdate() {
1811
+ b() && window.dispatchEvent(
1812
+ new CustomEvent("builder:component:stateChange", {
1813
+ detail: {
1814
+ state: this.contentState,
1815
+ ref: {
1816
+ name: this.model
1817
+ }
1818
+ }
1819
+ })
1820
+ );
1821
+ }
1822
+ }
1823
+ }, An = ["builder-content-id"];
1824
+ function Wn(e, n, t, o, r, a) {
1825
+ var s, c, u, m, w, L, M;
1826
+ const i = _("render-content-styles"), l = _("render-blocks");
1827
+ return a.useContent ? (d(), p("div", {
1828
+ key: 0,
1829
+ ref: "elementRef",
1830
+ onClick: n[0] || (n[0] = (ke) => a.onClick(ke)),
1831
+ "builder-content-id": (s = a.useContent) == null ? void 0 : s.id
1832
+ }, [
1833
+ a.shouldRenderContentStyles ? (d(), S(i, {
1834
+ key: 0,
1835
+ cssCode: (u = (c = a.useContent) == null ? void 0 : c.data) == null ? void 0 : u.cssCode,
1836
+ customFonts: (w = (m = a.useContent) == null ? void 0 : m.data) == null ? void 0 : w.customFonts
1837
+ }, null, 8, ["cssCode", "customFonts"])) : y("", !0),
1838
+ (d(), S(l, {
1839
+ blocks: e.markMutable((M = (L = a.useContent) == null ? void 0 : L.data) == null ? void 0 : M.blocks),
1840
+ key: e.forceReRenderCount
1841
+ }, null, 8, ["blocks"]))
1842
+ ], 8, An)) : y("", !0);
1843
+ }
1844
+ const Ln = /* @__PURE__ */ h(Vn, [["render", Wn]]), Mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1845
+ __proto__: null,
1846
+ default: Ln
1847
+ }, Symbol.toStringTag, { value: "Module" }));
1848
+ const Nn = () => import("./block-styles.76754b24.js").then((e) => e.default), Bn = () => import("./render-block.369b7818.js").then((e) => e.default), qn = {
1849
+ name: "render-blocks",
1850
+ components: {
1851
+ "render-block": v(Bn),
1852
+ "block-styles": v(Nn)
1853
+ },
1854
+ props: ["blocks", "parent", "path"],
1855
+ inject: {
1856
+ builderContext: "BuilderContext"
1857
+ },
1858
+ computed: {
1859
+ className() {
1860
+ var e;
1861
+ return "builder-blocks" + ((e = this.blocks) != null && e.length ? "" : " no-blocks");
1862
+ }
1863
+ },
1864
+ methods: {
1865
+ onClick() {
1866
+ var e, n;
1867
+ b() && !((e = this.blocks) != null && e.length) && ((n = window.parent) == null || n.postMessage(
1868
+ {
1869
+ type: "builder.clickEmptyBlocks",
1870
+ data: {
1871
+ parentElementId: this.parent,
1872
+ dataPath: this.path
1873
+ }
1874
+ },
1875
+ "*"
1876
+ ));
1877
+ },
1878
+ onMouseEnter() {
1879
+ var e, n;
1880
+ b() && !((e = this.blocks) != null && e.length) && ((n = window.parent) == null || n.postMessage(
1881
+ {
1882
+ type: "builder.hoverEmptyBlocks",
1883
+ data: {
1884
+ parentElementId: this.parent,
1885
+ dataPath: this.path
1886
+ }
1887
+ },
1888
+ "*"
1889
+ ));
1890
+ },
1891
+ _classStringToObject(e) {
1892
+ const n = {};
1893
+ if (typeof e != "string")
1894
+ return n;
1895
+ const t = e.trim().split(/\s+/);
1896
+ for (const o of t)
1897
+ n[o] = !0;
1898
+ return n;
1899
+ }
1900
+ }
1901
+ }, Dn = ["builder-path", "builder-parent-id", "dataSet"];
1902
+ function zn(e, n, t, o, r, a) {
1903
+ const i = _("render-block"), l = _("block-styles");
1904
+ return d(), p("div", {
1905
+ class: ae(a._classStringToObject(a.className + " div-1hjwvu3r5mj")),
1906
+ "builder-path": t.path,
1907
+ "builder-parent-id": t.parent,
1908
+ dataSet: {
1909
+ class: a.className
1910
+ },
1911
+ onClick: n[0] || (n[0] = (s) => a.onClick()),
1912
+ onMouseenter: n[1] || (n[1] = (s) => a.onMouseEnter())
1913
+ }, [
1914
+ t.blocks ? (d(!0), p(j, { key: 0 }, E(t.blocks, (s, c) => (d(), S(i, {
1915
+ key: "render-block-" + s.id,
1916
+ block: s,
1917
+ context: a.builderContext
1918
+ }, null, 8, ["block", "context"]))), 128)) : y("", !0),
1919
+ t.blocks ? (d(!0), p(j, { key: 1 }, E(t.blocks, (s, c) => (d(), S(l, {
1920
+ key: "block-style-" + s.id,
1921
+ block: s,
1922
+ context: a.builderContext
1923
+ }, null, 8, ["block", "context"]))), 128)) : y("", !0)
1924
+ ], 42, Dn);
1925
+ }
1926
+ const Hn = /* @__PURE__ */ h(qn, [["render", zn], ["__scopeId", "data-v-50f203f2"]]), we = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1927
+ __proto__: null,
1928
+ default: Hn
1929
+ }, Symbol.toStringTag, { value: "Module" })), oe = {};
1930
+ function Yn(e) {
1931
+ if (f()) {
1932
+ Object.assign(oe, e);
1933
+ const n = {
1934
+ type: "builder.settingsChange",
1935
+ data: oe
1936
+ };
1937
+ parent.postMessage(n, "*");
1938
+ }
1939
+ }
1940
+ export {
1941
+ Ct as B,
1942
+ Re as C,
1943
+ Rt as F,
1944
+ Me as I,
1945
+ Tt as S,
1946
+ V as T,
1947
+ Ge as V,
1948
+ h as _,
1949
+ Ln as a,
1950
+ _t as b,
1951
+ De as c,
1952
+ nn as d,
1953
+ X as e,
1954
+ me as f,
1955
+ sn as g,
1956
+ Jn as h,
1957
+ b as i,
1958
+ Ce as j,
1959
+ ft as k,
1960
+ ht as l,
1961
+ Gn as m,
1962
+ ce as n,
1963
+ se as o,
1964
+ tt as p,
1965
+ nt as q,
1966
+ Hn as r,
1967
+ Yn as s,
1968
+ ot as t
1969
+ };