@builder.io/sdk-react-nextjs 0.14.28 → 0.14.30-0

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 (118) hide show
  1. package/lib/browser/blocks-exports.cjs +188 -0
  2. package/lib/browser/blocks-exports.mjs +2812 -0
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +25 -26
  5. package/lib/browser/init.cjs +8 -0
  6. package/lib/browser/init.mjs +60 -0
  7. package/lib/browser/server-entry-5cac64f5.js +720 -0
  8. package/lib/browser/server-entry-c9d4cfc0.cjs +2 -0
  9. package/lib/browser/server-entry.cjs +1 -0
  10. package/lib/browser/server-entry.mjs +16 -0
  11. package/lib/edge/blocks-exports.cjs +208 -0
  12. package/lib/edge/{bundle-c67d25d8.js → blocks-exports.mjs} +2388 -2405
  13. package/lib/edge/index.cjs +1 -1
  14. package/lib/edge/index.mjs +25 -26
  15. package/lib/edge/init.cjs +8 -0
  16. package/lib/edge/init.mjs +60 -0
  17. package/lib/edge/server-entry-5cac64f5.js +720 -0
  18. package/lib/edge/server-entry-c9d4cfc0.cjs +2 -0
  19. package/lib/edge/server-entry.cjs +1 -0
  20. package/lib/edge/server-entry.mjs +16 -0
  21. package/lib/node/blocks-exports.cjs +188 -0
  22. package/lib/node/blocks-exports.mjs +2788 -0
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +23 -23
  25. package/lib/node/init.cjs +1 -0
  26. package/lib/node/init.mjs +13 -0
  27. package/lib/node/node-runtime-591c4640.cjs +48 -0
  28. package/lib/node/node-runtime-8d503570.js +167 -0
  29. package/lib/node/server-entry-00baa89f.js +720 -0
  30. package/lib/node/server-entry-1c6e06e6.cjs +2 -0
  31. package/lib/node/server-entry.cjs +1 -0
  32. package/lib/node/server-entry.mjs +16 -0
  33. package/package.json +14 -9
  34. package/types/cjs/blocks/BaseText.d.ts +6 -0
  35. package/types/cjs/blocks/form/component-info.d.ts +2 -0
  36. package/types/cjs/blocks/form/form.d.ts +33 -0
  37. package/types/cjs/blocks/input/component-info.d.ts +2 -0
  38. package/types/cjs/blocks/input/input.d.ts +15 -0
  39. package/types/cjs/blocks/raw-text/component-info.d.ts +2 -0
  40. package/types/cjs/blocks/raw-text/index.d.ts +1 -0
  41. package/types/cjs/blocks/raw-text/raw-text.d.ts +7 -0
  42. package/types/cjs/blocks/submit-button/component-info.d.ts +2 -0
  43. package/types/cjs/blocks/submit-button/submit-button.d.ts +10 -0
  44. package/types/cjs/blocks/textarea/component-info.d.ts +2 -0
  45. package/types/cjs/blocks/textarea/index.d.ts +1 -0
  46. package/types/cjs/blocks/textarea/textarea.d.ts +13 -0
  47. package/types/cjs/components/content/index.d.ts +1 -0
  48. package/types/cjs/components/error-boundary.d.ts +11 -0
  49. package/types/cjs/constants/sdk-name.d.ts +1 -0
  50. package/types/cjs/constants/sdk-version.d.ts +1 -1
  51. package/types/cjs/functions/apply-patch-with-mutation.d.ts +10 -0
  52. package/types/cjs/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
  53. package/types/cjs/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
  54. package/types/cjs/functions/evaluate/edge-runtime/index.d.ts +1 -0
  55. package/types/cjs/functions/evaluate/node-runtime/index.d.ts +1 -0
  56. package/types/cjs/functions/evaluate/node-runtime/init.d.ts +13 -0
  57. package/types/cjs/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
  58. package/types/cjs/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
  59. package/types/cjs/functions/evaluate/placeholder-runtime.d.ts +2 -0
  60. package/types/cjs/functions/extract-css-var-default-value.d.ts +1 -0
  61. package/types/cjs/functions/get-react-native-block-styles.d.ts +15 -0
  62. package/types/cjs/functions/is-edge-runtime.d.ts +4 -0
  63. package/types/cjs/functions/on-change.d.ts +7 -0
  64. package/types/cjs/functions/sanitize-react-native-block-styles.d.ts +3 -0
  65. package/types/cjs/functions/sanitize-rn-allowed-css.d.ts +8 -0
  66. package/types/cjs/helpers/omit.d.ts +1 -0
  67. package/types/cjs/helpers/time.d.ts +1 -0
  68. package/types/esm/blocks/BaseText.d.ts +6 -0
  69. package/types/esm/blocks/form/component-info.d.ts +2 -0
  70. package/types/esm/blocks/form/form.d.ts +33 -0
  71. package/types/esm/blocks/input/component-info.d.ts +2 -0
  72. package/types/esm/blocks/input/input.d.ts +15 -0
  73. package/types/esm/blocks/raw-text/component-info.d.ts +2 -0
  74. package/types/esm/blocks/raw-text/index.d.ts +1 -0
  75. package/types/esm/blocks/raw-text/raw-text.d.ts +7 -0
  76. package/types/esm/blocks/submit-button/component-info.d.ts +2 -0
  77. package/types/esm/blocks/submit-button/submit-button.d.ts +10 -0
  78. package/types/esm/blocks/textarea/component-info.d.ts +2 -0
  79. package/types/esm/blocks/textarea/index.d.ts +1 -0
  80. package/types/esm/blocks/textarea/textarea.d.ts +13 -0
  81. package/types/esm/components/content/index.d.ts +1 -0
  82. package/types/esm/components/error-boundary.d.ts +11 -0
  83. package/types/esm/constants/sdk-name.d.ts +1 -0
  84. package/types/esm/constants/sdk-version.d.ts +1 -1
  85. package/types/esm/functions/apply-patch-with-mutation.d.ts +10 -0
  86. package/types/esm/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
  87. package/types/esm/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
  88. package/types/esm/functions/evaluate/edge-runtime/index.d.ts +1 -0
  89. package/types/esm/functions/evaluate/node-runtime/index.d.ts +1 -0
  90. package/types/esm/functions/evaluate/node-runtime/init.d.ts +13 -0
  91. package/types/esm/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
  92. package/types/esm/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
  93. package/types/esm/functions/evaluate/placeholder-runtime.d.ts +2 -0
  94. package/types/esm/functions/extract-css-var-default-value.d.ts +1 -0
  95. package/types/esm/functions/get-react-native-block-styles.d.ts +15 -0
  96. package/types/esm/functions/is-edge-runtime.d.ts +4 -0
  97. package/types/esm/functions/on-change.d.ts +7 -0
  98. package/types/esm/functions/sanitize-react-native-block-styles.d.ts +3 -0
  99. package/types/esm/functions/sanitize-rn-allowed-css.d.ts +8 -0
  100. package/types/esm/helpers/omit.d.ts +1 -0
  101. package/types/esm/helpers/time.d.ts +1 -0
  102. package/lib/browser/USE_CLIENT_BUNDLE-1c35fc0a.js +0 -703
  103. package/lib/browser/USE_CLIENT_BUNDLE-65950ed4.cjs +0 -21
  104. package/lib/browser/USE_SERVER_BUNDLE-3ea7f606.cjs +0 -1
  105. package/lib/browser/USE_SERVER_BUNDLE-812dfc95.js +0 -11
  106. package/lib/browser/bundle-763c7cf6.js +0 -2829
  107. package/lib/browser/bundle-aff841a2.cjs +0 -169
  108. package/lib/edge/USE_CLIENT_BUNDLE-cf0350f7.js +0 -703
  109. package/lib/edge/USE_CLIENT_BUNDLE-fc025b97.cjs +0 -21
  110. package/lib/edge/USE_SERVER_BUNDLE-8e198f44.cjs +0 -1
  111. package/lib/edge/USE_SERVER_BUNDLE-ded4dbdc.js +0 -11
  112. package/lib/edge/bundle-05000fd3.cjs +0 -189
  113. package/lib/node/USE_CLIENT_BUNDLE-0fda6fd8.js +0 -703
  114. package/lib/node/USE_CLIENT_BUNDLE-c57c9376.cjs +0 -21
  115. package/lib/node/USE_SERVER_BUNDLE-15a235fc.js +0 -11
  116. package/lib/node/USE_SERVER_BUNDLE-5472e997.cjs +0 -1
  117. package/lib/node/bundle-40b09581.js +0 -2950
  118. package/lib/node/bundle-acffe20a.cjs +0 -216
@@ -1,2829 +0,0 @@
1
- import { jsx as l, Fragment as C, jsxs as R } from "react/jsx-runtime";
2
- import "react";
3
- import { LRUCache as Fe } from "lru-cache";
4
- import { I as Le, B as Ue, a as De, D as _e, C as Me, E as je, b as He, V as Ke, c as ze, F as qe, d as Ye, S as Ge, e as Je } from "./USE_CLIENT_BUNDLE-1c35fc0a.js";
5
- import "next/navigation";
6
- const Qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), go = (e) => typeof e == "string" && Qe.has(e.toLowerCase()), x = "rsc", M = () => {
7
- switch (x) {
8
- case "react":
9
- case "reactNative":
10
- case "rsc":
11
- return "className";
12
- case "svelte":
13
- case "vue":
14
- case "solid":
15
- case "qwik":
16
- case "angular":
17
- return "class";
18
- }
19
- };
20
- function Xe(e) {
21
- var t;
22
- return {
23
- ...(t = e.component) == null ? void 0 : t.options,
24
- ...e.options
25
- };
26
- }
27
- const P = "[Builder.io]: ", I = {
28
- log: (...e) => console.log(P, ...e),
29
- error: (...e) => console.error(P, ...e),
30
- warn: (...e) => console.warn(P, ...e),
31
- debug: (...e) => console.debug(P, ...e)
32
- };
33
- function k() {
34
- return typeof window < "u" && typeof document < "u";
35
- }
36
- const Ze = (e) => {
37
- const t = {};
38
- return e.forEach((n, o) => {
39
- t[o] = n;
40
- }), t;
41
- }, ue = (e) => e instanceof URLSearchParams ? Ze(e) : e, me = (e) => typeof e == "string" ? e : e instanceof URLSearchParams ? e.toString() : new URLSearchParams(e).toString();
42
- function et() {
43
- return k() && window.self !== window.top;
44
- }
45
- function fe(e) {
46
- return et() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
47
- me(e || window.location.search).indexOf("builder.frameEditing=") !== -1;
48
- }
49
- const tt = () => {
50
- if (k()) {
51
- const e = new URL(location.href);
52
- return e.pathname === "" && (e.pathname = "/"), e;
53
- } else
54
- return console.warn("Cannot get location for tracking in non-browser environment"), null;
55
- }, nt = () => typeof navigator == "object" && navigator.userAgent || "", he = () => {
56
- const e = nt(), t = {
57
- Android() {
58
- return e.match(/Android/i);
59
- },
60
- BlackBerry() {
61
- return e.match(/BlackBerry/i);
62
- },
63
- iOS() {
64
- return e.match(/iPhone|iPod/i);
65
- },
66
- Opera() {
67
- return e.match(/Opera Mini/i);
68
- },
69
- Windows() {
70
- return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
71
- },
72
- any() {
73
- return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || x === "reactNative";
74
- }
75
- }, n = e.match(/Tablet|iPad/i), o = tt();
76
- return {
77
- urlPath: o == null ? void 0 : o.pathname,
78
- host: (o == null ? void 0 : o.host) || (o == null ? void 0 : o.hostname),
79
- device: n ? "tablet" : t.any() ? "mobile" : "desktop"
80
- };
81
- }, ot = ({
82
- builder: e,
83
- context: t,
84
- event: n,
85
- state: o
86
- }) => Object.entries({
87
- state: o,
88
- Builder: e,
89
- // legacy
90
- builder: e,
91
- context: t,
92
- event: n
93
- }), it = () => ({
94
- isEditing: fe(),
95
- isBrowser: k(),
96
- isServer: !k(),
97
- getUserAttributes: () => he()
98
- }), rt = (e, {
99
- isExpression: t = !0
100
- }) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, Q = ({
101
- code: e,
102
- builder: t,
103
- context: n,
104
- event: o,
105
- localState: i,
106
- rootSetState: r,
107
- rootState: a
108
- }) => {
109
- const s = ot({
110
- builder: t,
111
- context: n,
112
- event: o,
113
- state: pe({
114
- rootState: a,
115
- localState: i,
116
- rootSetState: r
117
- })
118
- });
119
- return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
120
- };
121
- function pe({
122
- rootState: e,
123
- localState: t,
124
- rootSetState: n
125
- }) {
126
- return new Proxy(e, {
127
- get: (o, i) => {
128
- if (t && i in t)
129
- return t[i];
130
- const r = o[i];
131
- return typeof r == "object" && r !== null ? pe({
132
- rootState: r,
133
- localState: void 0,
134
- rootSetState: n ? (a) => {
135
- o[i] = a, n(o);
136
- } : void 0
137
- }) : r;
138
- },
139
- set: (o, i, r) => {
140
- if (t && i in t)
141
- throw new Error("Writing to local state is not allowed as it is read-only.");
142
- return o[i] = r, n == null || n(o), !0;
143
- }
144
- });
145
- }
146
- const T = (e) => e != null;
147
- function at() {
148
- var e;
149
- return typeof process < "u" && T((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
150
- }
151
- const st = () => {
152
- var o;
153
- if (!at())
154
- return !1;
155
- const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
156
- return e && t && !n ? (I.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
157
- }, ct = (e) => (k() || st(), Q(e)), j = class A {
158
- static getCacheKey(t) {
159
- return JSON.stringify({
160
- ...t,
161
- // replace the event with a random number to break cache
162
- // thats because we can't serialize the event object due to circular refs in DOM node refs.
163
- event: t.event ? Math.random() : void 0
164
- });
165
- }
166
- static getCachedValue(t) {
167
- return A.cache.get(t);
168
- }
169
- static setCachedValue(t, n) {
170
- A.cache.size > 20 && A.cache.delete(A.cache.keys().next().value), A.cache.set(t, {
171
- value: n
172
- });
173
- }
174
- };
175
- j.cacheLimit = 20;
176
- j.cache = /* @__PURE__ */ new Map();
177
- let B = j;
178
- function H({
179
- code: e,
180
- context: t,
181
- localState: n,
182
- rootState: o,
183
- rootSetState: i,
184
- event: r,
185
- isExpression: a = !0,
186
- enableCache: s
187
- }) {
188
- if (e === "")
189
- return;
190
- const c = {
191
- code: rt(e, {
192
- isExpression: a
193
- }),
194
- builder: it(),
195
- context: t,
196
- event: r,
197
- rootSetState: i,
198
- rootState: o,
199
- localState: n
200
- };
201
- if (s) {
202
- const u = B.getCacheKey(c), h = B.getCachedValue(u);
203
- if (h)
204
- return h.value;
205
- }
206
- try {
207
- const u = ct(c);
208
- if (s) {
209
- const h = B.getCacheKey(c);
210
- B.setCachedValue(h, u);
211
- }
212
- return u;
213
- } catch (u) {
214
- I.error("Failed code evaluation: " + u.message, {
215
- code: e
216
- });
217
- return;
218
- }
219
- }
220
- const O = (e) => JSON.parse(JSON.stringify(e)), lt = (e, t, n) => {
221
- if (Object(e) !== e)
222
- return e;
223
- const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
224
- return o.slice(0, -1).reduce((i, r, a) => Object(i[r]) === i[r] ? i[r] : i[r] = Math.abs(Number(o[a + 1])) >> 0 === +o[a + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
225
- };
226
- const dt = ({
227
- block: e,
228
- context: t,
229
- localState: n,
230
- rootState: o,
231
- rootSetState: i
232
- }) => {
233
- if (!e.bindings)
234
- return e;
235
- const r = O(e), a = {
236
- ...r,
237
- properties: {
238
- ...r.properties
239
- },
240
- actions: {
241
- ...r.actions
242
- }
243
- };
244
- for (const s in e.bindings) {
245
- const c = e.bindings[s], u = H({
246
- code: c,
247
- localState: n,
248
- rootState: o,
249
- rootSetState: i,
250
- context: t,
251
- enableCache: !0
252
- });
253
- lt(a, s, u);
254
- }
255
- return a;
256
- };
257
- function N({
258
- block: e,
259
- context: t,
260
- shouldEvaluateBindings: n,
261
- localState: o,
262
- rootState: i,
263
- rootSetState: r
264
- }) {
265
- const a = e;
266
- return n ? dt({
267
- block: a,
268
- localState: o,
269
- rootState: i,
270
- rootSetState: r,
271
- context: t
272
- }) : a;
273
- }
274
- const K = (e) => e ? e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "", ge = (e) => Object.entries(e).map(([n, o]) => {
275
- if (typeof o == "string")
276
- return `${K(n)}: ${o};`;
277
- }).filter(T), ut = (e) => ge(e).join(`
278
- `), V = ({
279
- mediaQuery: e,
280
- className: t,
281
- styles: n
282
- }) => {
283
- const o = `.${t} {
284
- ${ut(n)}
285
- }`;
286
- return e ? `${e} {
287
- ${o}
288
- }` : o;
289
- };
290
- function mt({
291
- style: e
292
- }) {
293
- return e;
294
- }
295
- const ft = ({
296
- block: e,
297
- context: t
298
- }) => be(mt({
299
- style: e.style || {},
300
- context: t,
301
- block: e
302
- }));
303
- function be(e) {
304
- switch (x) {
305
- case "svelte":
306
- case "vue":
307
- case "solid":
308
- case "angular":
309
- return ge(e).join(" ");
310
- case "qwik":
311
- case "reactNative":
312
- case "react":
313
- case "rsc":
314
- return e;
315
- }
316
- }
317
- const ht = ({
318
- block: e,
319
- context: t,
320
- registeredComponents: n
321
- }) => {
322
- var r;
323
- const o = (r = N({
324
- block: e,
325
- localState: t.localState,
326
- rootState: t.rootState,
327
- rootSetState: t.rootSetState,
328
- context: t.context,
329
- shouldEvaluateBindings: !1
330
- }).component) == null ? void 0 : r.name;
331
- if (!o)
332
- return null;
333
- const i = n[o];
334
- if (i)
335
- return i;
336
- console.warn(`
337
- Could not find a registered component named "${o}".
338
- If you registered it, is the file that registered it imported by the file that needs to render it?`);
339
- }, pt = ({
340
- block: e,
341
- context: t
342
- }) => {
343
- const {
344
- repeat: n,
345
- ...o
346
- } = e;
347
- if (!(n != null && n.collection))
348
- return;
349
- const i = H({
350
- code: n.collection,
351
- localState: t.localState,
352
- rootState: t.rootState,
353
- rootSetState: t.rootSetState,
354
- context: t.context,
355
- enableCache: !0
356
- });
357
- if (!Array.isArray(i))
358
- return;
359
- const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
360
- return i.map((c, u) => ({
361
- context: {
362
- ...t,
363
- localState: {
364
- ...t.localState,
365
- $index: u,
366
- $item: c,
367
- [a]: c,
368
- [`$${a}Index`]: u
369
- }
370
- },
371
- block: o
372
- }));
373
- }, gt = (e, t) => e && (e.isRSC && x === "rsc" || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)) ? {
374
- builderLinkComponent: t
375
- } : {}, bt = (e, t) => e && (e.isRSC && x === "rsc" || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)) ? {
376
- builderComponents: t
377
- } : {}, yt = (e, t) => e && (e.isRSC && x === "rsc" || x === "reactNative" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Image", "Video"].includes(e.name)) ? {
378
- builderBlock: t
379
- } : {}, St = (e, t) => e && (e.isRSC && x === "rsc" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Slot"].includes(e.name)) ? {
380
- builderContext: t
381
- } : {}, ye = {
382
- small: {
383
- min: 320,
384
- default: 321,
385
- max: 640
386
- },
387
- medium: {
388
- min: 641,
389
- default: 642,
390
- max: 991
391
- },
392
- large: {
393
- min: 990,
394
- default: 991,
395
- max: 1200
396
- }
397
- }, X = (e, t = ye) => `@media (max-width: ${t[e].max}px)`, Se = ({
398
- small: e,
399
- medium: t
400
- }) => {
401
- const n = O(ye);
402
- if (!e || !t)
403
- return n;
404
- const o = Math.floor(e / 2);
405
- n.small = {
406
- max: e,
407
- min: o,
408
- default: o + 1
409
- };
410
- const i = n.small.max + 1;
411
- n.medium = {
412
- max: t,
413
- min: i,
414
- default: i + 1
415
- };
416
- const r = n.medium.max + 1;
417
- return n.large = {
418
- max: 2e3,
419
- // TODO: decide upper limit
420
- min: r,
421
- default: r + 1
422
- }, n;
423
- };
424
- function $(e) {
425
- return /* @__PURE__ */ l(
426
- "style",
427
- {
428
- dangerouslySetInnerHTML: { __html: e.styles },
429
- "data-id": e.id
430
- }
431
- );
432
- }
433
- function vt(e) {
434
- const t = function() {
435
- const i = N({
436
- block: e.block,
437
- localState: e.context.localState,
438
- rootState: e.context.rootState,
439
- rootSetState: e.context.rootSetState,
440
- context: e.context.context,
441
- shouldEvaluateBindings: !0
442
- });
443
- return T(i.hide) ? !i.hide : T(i.show) ? i.show : !0;
444
- }, n = function() {
445
- var m, p, y;
446
- const i = N({
447
- block: e.block,
448
- localState: e.context.localState,
449
- rootState: e.context.rootState,
450
- rootSetState: e.context.rootSetState,
451
- context: e.context.context,
452
- shouldEvaluateBindings: !0
453
- }), r = i.responsiveStyles, a = e.context.content, s = Se(
454
- ((m = a == null ? void 0 : a.meta) == null ? void 0 : m.breakpoints) || {}
455
- ), c = r == null ? void 0 : r.large, u = r == null ? void 0 : r.medium, h = r == null ? void 0 : r.small, d = i.id;
456
- if (!d)
457
- return "";
458
- const f = c ? V({
459
- className: d,
460
- styles: c
461
- }) : "", g = u ? V({
462
- className: d,
463
- styles: u,
464
- mediaQuery: X(
465
- "medium",
466
- s
467
- )
468
- }) : "", v = h ? V({
469
- className: d,
470
- styles: h,
471
- mediaQuery: X(
472
- "small",
473
- s
474
- )
475
- }) : "", b = i.animations && i.animations.find((S) => S.trigger === "hover");
476
- let E = "";
477
- if (b) {
478
- const S = ((y = (p = b.steps) == null ? void 0 : p[1]) == null ? void 0 : y.styles) || {};
479
- E = V({
480
- className: `${d}:hover`,
481
- styles: {
482
- ...S,
483
- transition: `all ${b.duration}s ${K(
484
- b.easing
485
- )}`,
486
- transitionDelay: b.delay ? `${b.delay}s` : "0s"
487
- }
488
- }) || "";
489
- }
490
- return [
491
- f,
492
- g,
493
- v,
494
- E
495
- ].join(" ");
496
- };
497
- return /* @__PURE__ */ l(C, { children: n() && t() ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l($, { id: "builderio-block", styles: n() }) }) : null });
498
- }
499
- function kt(e) {
500
- return e.charAt(0).toUpperCase() + e.slice(1);
501
- }
502
- const xt = (e) => `on${kt(e)}`, Ct = (e, t) => (n) => H({
503
- code: e,
504
- context: t.context,
505
- localState: t.localState,
506
- rootState: t.rootState,
507
- rootSetState: t.rootSetState,
508
- event: n,
509
- isExpression: !1,
510
- enableCache: !0
511
- });
512
- function bo(e) {
513
- const t = {}, n = e.block.actions ?? {};
514
- for (const o in n) {
515
- if (!n.hasOwnProperty(o))
516
- continue;
517
- const i = n[o];
518
- let r = xt(o);
519
- if (e.stripPrefix)
520
- switch (x) {
521
- case "vue":
522
- r = r.replace("v-on:", "");
523
- break;
524
- case "svelte":
525
- r = r.replace("on:", "");
526
- break;
527
- }
528
- t[r] = Ct(i, e);
529
- }
530
- return t;
531
- }
532
- function wt({
533
- properties: e
534
- }) {
535
- return e;
536
- }
537
- const It = (e) => ({
538
- href: e.href
539
- });
540
- function Tt({
541
- block: e,
542
- context: t
543
- }) {
544
- var o;
545
- const n = {
546
- ...It(e),
547
- ...e.properties,
548
- "builder-id": e.id,
549
- style: ft({
550
- block: e,
551
- context: t
552
- }),
553
- [M()]: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
554
- };
555
- return wt({
556
- properties: n,
557
- context: t,
558
- block: e
559
- });
560
- }
561
- const Et = ({
562
- componentOptions: e,
563
- builderBlock: t,
564
- context: n,
565
- componentRef: o,
566
- includeBlockProps: i,
567
- isInteractive: r,
568
- contextValue: a
569
- }) => {
570
- const s = {
571
- ...e,
572
- /**
573
- * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
574
- * component itself directly. Otherwise, they are provided to the wrapper element.
575
- */
576
- ...i ? {
577
- attributes: Tt({
578
- block: t,
579
- context: a
580
- })
581
- } : {}
582
- };
583
- return r ? {
584
- Wrapper: o,
585
- block: t,
586
- context: n,
587
- wrapperProps: e,
588
- includeBlockProps: i
589
- } : s;
590
- };
591
- function Z(e) {
592
- var n;
593
- const t = e.isInteractive ? Le : e.componentRef;
594
- return /* @__PURE__ */ l(C, { children: e.componentRef ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(
595
- t,
596
- {
597
- ...Et({
598
- componentOptions: e.componentOptions,
599
- builderBlock: e.builderBlock,
600
- context: e.context,
601
- componentRef: e.componentRef,
602
- linkComponent: e.linkComponent,
603
- includeBlockProps: e.includeBlockProps,
604
- isInteractive: e.isInteractive,
605
- contextValue: e.context
606
- }),
607
- children: (n = e.blockChildren) == null ? void 0 : n.map((o) => /* @__PURE__ */ l(
608
- F,
609
- {
610
- block: o,
611
- context: e.context,
612
- registeredComponents: e.registeredComponents,
613
- linkComponent: e.linkComponent
614
- },
615
- o.id
616
- ))
617
- }
618
- ) }) : null });
619
- }
620
- function Rt(e) {
621
- const t = e.repeatContext;
622
- return /* @__PURE__ */ l(
623
- F,
624
- {
625
- block: e.block,
626
- context: t,
627
- registeredComponents: e.registeredComponents,
628
- linkComponent: e.linkComponent
629
- }
630
- );
631
- }
632
- function F(e) {
633
- var c, u, h;
634
- const t = function() {
635
- return ht({
636
- block: e.block,
637
- context: e.context,
638
- registeredComponents: e.registeredComponents
639
- });
640
- }, n = function() {
641
- return pt({
642
- block: e.block,
643
- context: e.context
644
- });
645
- }, o = function() {
646
- var f;
647
- return (f = e.block.repeat) != null && f.collection ? e.block : N({
648
- block: e.block,
649
- localState: e.context.localState,
650
- rootState: e.context.rootState,
651
- rootSetState: e.context.rootSetState,
652
- context: e.context.context,
653
- shouldEvaluateBindings: !0
654
- });
655
- }, i = function() {
656
- var g;
657
- return e.block.tagName === "a" || ((g = o().properties) == null ? void 0 : g.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
658
- }, r = function() {
659
- var v, b;
660
- if ((v = e.block.repeat) != null && v.collection)
661
- return !!((b = n()) != null && b.length);
662
- const f = "hide" in o() ? o().hide : !1;
663
- return ("show" in o() ? o().show : !0) && !f;
664
- }, a = function() {
665
- var g;
666
- return !((g = t()) != null && g.component) && !n() ? o().children ?? [] : [];
667
- }, s = function() {
668
- var f, g, v;
669
- return {
670
- blockChildren: o().children ?? [],
671
- componentRef: (f = t()) == null ? void 0 : f.component,
672
- componentOptions: {
673
- ...Xe(o()),
674
- ...yt(t(), o()),
675
- ...St(t(), e.context),
676
- ...gt(t(), e.linkComponent),
677
- ...bt(
678
- t(),
679
- e.registeredComponents
680
- )
681
- },
682
- context: e.context,
683
- linkComponent: e.linkComponent,
684
- registeredComponents: e.registeredComponents,
685
- builderBlock: o(),
686
- includeBlockProps: ((g = t()) == null ? void 0 : g.noWrap) === !0,
687
- isInteractive: !((v = t()) != null && v.isRSC)
688
- };
689
- };
690
- return /* @__PURE__ */ l(C, { children: r() ? /* @__PURE__ */ R(C, { children: [
691
- /* @__PURE__ */ l(vt, { block: e.block, context: e.context }),
692
- (c = t()) != null && c.noWrap ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(
693
- Z,
694
- {
695
- componentRef: s().componentRef,
696
- componentOptions: s().componentOptions,
697
- blockChildren: s().blockChildren,
698
- context: s().context,
699
- registeredComponents: s().registeredComponents,
700
- linkComponent: s().linkComponent,
701
- builderBlock: s().builderBlock,
702
- includeBlockProps: s().includeBlockProps,
703
- isInteractive: s().isInteractive
704
- }
705
- ) }) : /* @__PURE__ */ l(C, { children: n() ? /* @__PURE__ */ l(C, { children: (h = n()) == null ? void 0 : h.map((d, f) => /* @__PURE__ */ l(
706
- Rt,
707
- {
708
- repeatContext: d.context,
709
- block: d.block,
710
- registeredComponents: e.registeredComponents,
711
- linkComponent: e.linkComponent
712
- },
713
- f
714
- )) }) : /* @__PURE__ */ R(
715
- Ue,
716
- {
717
- Wrapper: i(),
718
- block: o(),
719
- context: e.context,
720
- children: [
721
- /* @__PURE__ */ l(
722
- Z,
723
- {
724
- componentRef: s().componentRef,
725
- componentOptions: s().componentOptions,
726
- blockChildren: s().blockChildren,
727
- context: s().context,
728
- registeredComponents: s().registeredComponents,
729
- linkComponent: s().linkComponent,
730
- builderBlock: s().builderBlock,
731
- includeBlockProps: s().includeBlockProps,
732
- isInteractive: s().isInteractive
733
- }
734
- ),
735
- (u = a()) == null ? void 0 : u.map((d) => /* @__PURE__ */ l(
736
- F,
737
- {
738
- block: d,
739
- registeredComponents: e.registeredComponents,
740
- linkComponent: e.linkComponent,
741
- context: e.context
742
- },
743
- d.id
744
- ))
745
- ]
746
- }
747
- ) })
748
- ] }) : null });
749
- }
750
- function z(e) {
751
- var t, n, o;
752
- return /* @__PURE__ */ l(
753
- De,
754
- {
755
- blocks: e.blocks,
756
- parent: e.parent,
757
- path: e.path,
758
- styleProp: e.styleProp,
759
- BlocksWrapper: (t = e.context) == null ? void 0 : t.BlocksWrapper,
760
- BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
761
- children: e.blocks ? /* @__PURE__ */ l(C, { children: (o = e.blocks) == null ? void 0 : o.map((i) => /* @__PURE__ */ l(
762
- F,
763
- {
764
- block: i,
765
- linkComponent: e.linkComponent,
766
- context: e.context,
767
- registeredComponents: e.registeredComponents
768
- },
769
- i.id
770
- )) }) : null
771
- }
772
- );
773
- }
774
- const At = (e) => `builder-columns ${e}-breakpoints`;
775
- function Pt(e) {
776
- var b, E;
777
- const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", i = function(p) {
778
- return p.link ? e.builderLinkComponent || "a" : "div";
779
- }, r = function(p) {
780
- var y;
781
- return ((y = n[p]) == null ? void 0 : y.width) || 100 / n.length;
782
- }, a = function(p) {
783
- const y = t * (n.length - 1) / n.length;
784
- return `calc(${r(p)}% - ${y}px)`;
785
- }, s = function({
786
- stackedStyle: p,
787
- desktopStyle: y
788
- }) {
789
- return o === "tablet" ? p : y;
790
- }, c = function({
791
- stackedStyle: p,
792
- desktopStyle: y
793
- }) {
794
- return o === "never" ? y : p;
795
- }, u = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", h = function() {
796
- return {
797
- "--flex-dir": u,
798
- "--flex-dir-tablet": s({
799
- stackedStyle: u,
800
- desktopStyle: "row"
801
- })
802
- };
803
- }, d = function(p) {
804
- const y = p === 0 ? 0 : t, S = a(p), w = `${y}px`, G = "100%", J = 0;
805
- return {
806
- ...{
807
- display: "flex",
808
- flexDirection: "column",
809
- alignItems: "stretch"
810
- },
811
- width: S,
812
- ["marginLeft"]: w,
813
- "--column-width-mobile": c({
814
- stackedStyle: G,
815
- desktopStyle: S
816
- }),
817
- "--column-margin-left-mobile": c({
818
- stackedStyle: J,
819
- desktopStyle: w
820
- }),
821
- "--column-width-tablet": s({
822
- stackedStyle: G,
823
- desktopStyle: S
824
- }),
825
- "--column-margin-left-tablet": s({
826
- stackedStyle: J,
827
- desktopStyle: w
828
- })
829
- };
830
- }, f = function(p) {
831
- var S, w;
832
- return Se(
833
- ((w = (S = e.builderContext.content) == null ? void 0 : S.meta) == null ? void 0 : w.breakpoints) || {}
834
- )[p].max;
835
- }, g = function() {
836
- return `
837
- @media (max-width: ${f("medium")}px) {
838
- .${e.builderBlock.id}-breakpoints {
839
- flex-direction: var(--flex-dir-tablet);
840
- align-items: stretch;
841
- }
842
-
843
- .${e.builderBlock.id}-breakpoints > .builder-column {
844
- width: var(--column-width-tablet) !important;
845
- margin-left: var(--column-margin-left-tablet) !important;
846
- }
847
- }
848
-
849
- @media (max-width: ${f("small")}px) {
850
- .${e.builderBlock.id}-breakpoints {
851
- flex-direction: var(--flex-dir);
852
- align-items: stretch;
853
- }
854
-
855
- .${e.builderBlock.id}-breakpoints > .builder-column {
856
- width: var(--column-width-mobile) !important;
857
- margin-left: var(--column-margin-left-mobile) !important;
858
- }
859
- },
860
- `;
861
- }, v = function(p, y) {
862
- return {
863
- ...p.link ? {
864
- href: p.link
865
- } : {},
866
- [M()]: "builder-column",
867
- style: be(d(y))
868
- };
869
- };
870
- return /* @__PURE__ */ R(C, { children: [
871
- /* @__PURE__ */ R(
872
- "div",
873
- {
874
- className: At((b = e.builderBlock) == null ? void 0 : b.id) + " div-eeca3604",
875
- style: h(),
876
- children: [
877
- /* @__PURE__ */ l($, { id: "builderio-columns", styles: g() }),
878
- (E = e.columns) == null ? void 0 : E.map((m, p) => /* @__PURE__ */ l(
879
- _e,
880
- {
881
- TagName: i(m),
882
- actionAttributes: {},
883
- attributes: v(m, p),
884
- children: /* @__PURE__ */ l(
885
- z,
886
- {
887
- path: `component.options.columns.${p}.blocks`,
888
- parent: e.builderBlock.id,
889
- styleProp: {
890
- flexGrow: "1"
891
- },
892
- context: e.builderContext,
893
- registeredComponents: e.builderComponents,
894
- linkComponent: e.builderLinkComponent,
895
- blocks: m.blocks
896
- }
897
- )
898
- },
899
- p
900
- ))
901
- ]
902
- }
903
- ),
904
- /* @__PURE__ */ l("style", { children: `.div-eeca3604 {
905
- display: flex;
906
- line-height: normal;
907
- }` })
908
- ] });
909
- }
910
- function ee(e) {
911
- return e.replace(/http(s)?:/, "");
912
- }
913
- function Bt(e = "", t, n) {
914
- const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
915
- return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
916
- }
917
- function Vt(e, t) {
918
- if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
919
- return e;
920
- if (t === "master")
921
- return ee(e);
922
- const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
923
- if (n) {
924
- const o = e.split(n[0]), i = n[3], r = t.match("x") ? t : `${t}x`;
925
- return ee(`${o[0]}_${r}${i}`);
926
- }
927
- return null;
928
- }
929
- function yo(e) {
930
- if (!e)
931
- return e;
932
- const t = [100, 200, 400, 800, 1200, 1600, 2e3];
933
- if (e.match(/builder\.io/)) {
934
- let n = e;
935
- const o = Number(e.split("?width=")[1]);
936
- return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${Bt(e, "width", i)} ${i}w`).concat([n]).join(", ");
937
- }
938
- return e.match(/cdn\.shopify\.com/) ? t.map((n) => [Vt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
939
- }
940
- const Wt = (e) => {
941
- if (e === "localhost" || e === "127.0.0.1")
942
- return e;
943
- const t = e.split(".");
944
- return t.length > 2 ? t.slice(1).join(".") : e;
945
- }, ve = ({
946
- name: e,
947
- canTrack: t
948
- }) => {
949
- var n;
950
- try {
951
- return t ? (n = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : n.split("=")[1] : void 0;
952
- } catch (o) {
953
- I.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
954
- return;
955
- }
956
- }, ke = async (e) => ve(e), Nt = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(T).join("; "), Ot = [["secure", ""], ["SameSite", "None"]], $t = ({
957
- name: e,
958
- value: t,
959
- expires: n
960
- }) => {
961
- const i = (k() ? location.protocol === "https:" : !0) ? Ot : [[]], r = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...r, ["path", "/"], ["domain", Wt(window.location.hostname)], ...i];
962
- return Nt(a);
963
- }, xe = async ({
964
- name: e,
965
- value: t,
966
- expires: n,
967
- canTrack: o
968
- }) => {
969
- try {
970
- if (!o)
971
- return;
972
- const i = $t({
973
- name: e,
974
- value: t,
975
- expires: n
976
- });
977
- document.cookie = i;
978
- } catch (i) {
979
- I.warn("[COOKIE] SET error: ", (i == null ? void 0 : i.message) || i);
980
- }
981
- }, Ft = "builder.tests", q = (e) => `${Ft}.${e}`, Lt = ({
982
- contentId: e
983
- }) => ke({
984
- name: q(e),
985
- canTrack: !0
986
- }), Ut = ({
987
- contentId: e
988
- }) => ve({
989
- name: q(e),
990
- canTrack: !0
991
- }), Dt = ({
992
- contentId: e,
993
- value: t
994
- }) => xe({
995
- name: q(e),
996
- value: t,
997
- canTrack: !0
998
- }), Ce = (e) => T(e.id) && T(e.variations) && Object.keys(e.variations).length > 0, _t = ({
999
- id: e,
1000
- variations: t
1001
- }) => {
1002
- var i;
1003
- let n = 0;
1004
- const o = Math.random();
1005
- for (const r in t) {
1006
- const a = (i = t[r]) == null ? void 0 : i.testRatio;
1007
- if (n += a, o < n)
1008
- return r;
1009
- }
1010
- return e;
1011
- }, we = (e) => {
1012
- const t = _t(e);
1013
- return Dt({
1014
- contentId: e.id,
1015
- value: t
1016
- }).catch((n) => {
1017
- I.error("could not store A/B test variation: ", n);
1018
- }), t;
1019
- }, Ie = ({
1020
- item: e,
1021
- testGroupId: t
1022
- }) => {
1023
- const n = e.variations[t];
1024
- return t === e.id || // handle edge-case where `testGroupId` points to non-existing variation
1025
- !n ? {
1026
- testVariationId: e.id,
1027
- testVariationName: "Default"
1028
- } : {
1029
- data: n.data,
1030
- testVariationId: n.id,
1031
- testVariationName: n.name || (n.id === e.id ? "Default" : "")
1032
- };
1033
- }, Mt = ({
1034
- item: e,
1035
- canTrack: t
1036
- }) => {
1037
- if (!t)
1038
- return e;
1039
- if (!e)
1040
- return;
1041
- if (!Ce(e))
1042
- return e;
1043
- const n = Ut({
1044
- contentId: e.id
1045
- }) || we({
1046
- variations: e.variations,
1047
- id: e.id
1048
- }), o = Ie({
1049
- item: e,
1050
- testGroupId: n
1051
- });
1052
- return {
1053
- ...e,
1054
- ...o
1055
- };
1056
- }, jt = async ({
1057
- item: e,
1058
- canTrack: t
1059
- }) => {
1060
- if (!t || !Ce(e))
1061
- return e;
1062
- const o = await Lt({
1063
- contentId: e.id
1064
- }) || we({
1065
- variations: e.variations,
1066
- id: e.id
1067
- }), i = Ie({
1068
- item: e,
1069
- testGroupId: o
1070
- });
1071
- return {
1072
- ...e,
1073
- ...i
1074
- };
1075
- }, L = (e) => T(e) ? e : !0, Ht = {
1076
- name: "Core:Button",
1077
- image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1078
- defaultStyles: {
1079
- // TODO: make min width more intuitive and set one
1080
- appearance: "none",
1081
- paddingTop: "15px",
1082
- paddingBottom: "15px",
1083
- paddingLeft: "25px",
1084
- paddingRight: "25px",
1085
- backgroundColor: "#000000",
1086
- color: "white",
1087
- borderRadius: "4px",
1088
- textAlign: "center",
1089
- cursor: "pointer"
1090
- },
1091
- inputs: [{
1092
- name: "text",
1093
- type: "text",
1094
- defaultValue: "Click me!",
1095
- bubble: !0
1096
- }, {
1097
- name: "link",
1098
- type: "url",
1099
- bubble: !0
1100
- }, {
1101
- name: "openLinkInNewTab",
1102
- type: "boolean",
1103
- defaultValue: !1,
1104
- friendlyName: "Open link in new tab"
1105
- }],
1106
- static: !0,
1107
- noWrap: !0
1108
- }, Kt = {
1109
- // TODO: ways to statically preprocess JSON for references, functions, etc
1110
- name: "Columns",
1111
- isRSC: !0,
1112
- inputs: [{
1113
- name: "columns",
1114
- type: "array",
1115
- broadcast: !0,
1116
- subFields: [{
1117
- name: "blocks",
1118
- type: "array",
1119
- hideFromUI: !0,
1120
- defaultValue: [{
1121
- "@type": "@builder.io/sdk:Element",
1122
- responsiveStyles: {
1123
- large: {
1124
- display: "flex",
1125
- flexDirection: "column",
1126
- alignItems: "stretch",
1127
- flexShrink: "0",
1128
- position: "relative",
1129
- marginTop: "30px",
1130
- textAlign: "center",
1131
- lineHeight: "normal",
1132
- height: "auto",
1133
- minHeight: "20px",
1134
- minWidth: "20px",
1135
- overflow: "hidden"
1136
- }
1137
- },
1138
- component: {
1139
- name: "Image",
1140
- options: {
1141
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1142
- backgroundPosition: "center",
1143
- backgroundSize: "cover",
1144
- aspectRatio: 0.7004048582995948
1145
- }
1146
- }
1147
- }, {
1148
- "@type": "@builder.io/sdk:Element",
1149
- responsiveStyles: {
1150
- large: {
1151
- display: "flex",
1152
- flexDirection: "column",
1153
- alignItems: "stretch",
1154
- flexShrink: "0",
1155
- position: "relative",
1156
- marginTop: "30px",
1157
- textAlign: "center",
1158
- lineHeight: "normal",
1159
- height: "auto"
1160
- }
1161
- },
1162
- component: {
1163
- name: "Text",
1164
- options: {
1165
- text: "<p>Enter some text...</p>"
1166
- }
1167
- }
1168
- }]
1169
- }, {
1170
- name: "width",
1171
- type: "number",
1172
- hideFromUI: !0,
1173
- helperText: "Width %, e.g. set to 50 to fill half of the space"
1174
- }, {
1175
- name: "link",
1176
- type: "url",
1177
- helperText: "Optionally set a url that clicking this column will link to"
1178
- }],
1179
- defaultValue: [{
1180
- blocks: [{
1181
- "@type": "@builder.io/sdk:Element",
1182
- responsiveStyles: {
1183
- large: {
1184
- display: "flex",
1185
- flexDirection: "column",
1186
- alignItems: "stretch",
1187
- flexShrink: "0",
1188
- position: "relative",
1189
- marginTop: "30px",
1190
- textAlign: "center",
1191
- lineHeight: "normal",
1192
- height: "auto",
1193
- minHeight: "20px",
1194
- minWidth: "20px",
1195
- overflow: "hidden"
1196
- }
1197
- },
1198
- component: {
1199
- name: "Image",
1200
- options: {
1201
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1202
- backgroundPosition: "center",
1203
- backgroundSize: "cover",
1204
- aspectRatio: 0.7004048582995948
1205
- }
1206
- }
1207
- }, {
1208
- "@type": "@builder.io/sdk:Element",
1209
- responsiveStyles: {
1210
- large: {
1211
- display: "flex",
1212
- flexDirection: "column",
1213
- alignItems: "stretch",
1214
- flexShrink: "0",
1215
- position: "relative",
1216
- marginTop: "30px",
1217
- textAlign: "center",
1218
- lineHeight: "normal",
1219
- height: "auto"
1220
- }
1221
- },
1222
- component: {
1223
- name: "Text",
1224
- options: {
1225
- text: "<p>Enter some text...</p>"
1226
- }
1227
- }
1228
- }]
1229
- }, {
1230
- blocks: [{
1231
- "@type": "@builder.io/sdk:Element",
1232
- responsiveStyles: {
1233
- large: {
1234
- display: "flex",
1235
- flexDirection: "column",
1236
- alignItems: "stretch",
1237
- flexShrink: "0",
1238
- position: "relative",
1239
- marginTop: "30px",
1240
- textAlign: "center",
1241
- lineHeight: "normal",
1242
- height: "auto",
1243
- minHeight: "20px",
1244
- minWidth: "20px",
1245
- overflow: "hidden"
1246
- }
1247
- },
1248
- component: {
1249
- name: "Image",
1250
- options: {
1251
- image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1252
- backgroundPosition: "center",
1253
- backgroundSize: "cover",
1254
- aspectRatio: 0.7004048582995948
1255
- }
1256
- }
1257
- }, {
1258
- "@type": "@builder.io/sdk:Element",
1259
- responsiveStyles: {
1260
- large: {
1261
- display: "flex",
1262
- flexDirection: "column",
1263
- alignItems: "stretch",
1264
- flexShrink: "0",
1265
- position: "relative",
1266
- marginTop: "30px",
1267
- textAlign: "center",
1268
- lineHeight: "normal",
1269
- height: "auto"
1270
- }
1271
- },
1272
- component: {
1273
- name: "Text",
1274
- options: {
1275
- text: "<p>Enter some text...</p>"
1276
- }
1277
- }
1278
- }]
1279
- }],
1280
- onChange: (e) => {
1281
- function t() {
1282
- n.forEach((o) => {
1283
- o.delete("width");
1284
- });
1285
- }
1286
- const n = e.get("columns");
1287
- Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((s, c) => s + c.get("width"), 0) !== 100) && t();
1288
- }
1289
- }, {
1290
- name: "space",
1291
- type: "number",
1292
- defaultValue: 20,
1293
- helperText: "Size of gap between columns",
1294
- advanced: !0
1295
- }, {
1296
- name: "stackColumnsAt",
1297
- type: "string",
1298
- defaultValue: "tablet",
1299
- helperText: "Convert horizontal columns to vertical at what device size",
1300
- enum: ["tablet", "mobile", "never"],
1301
- advanced: !0
1302
- }, {
1303
- name: "reverseColumnsWhenStacked",
1304
- type: "boolean",
1305
- defaultValue: !1,
1306
- helperText: "When stacking columns for mobile devices, reverse the ordering",
1307
- advanced: !0
1308
- }]
1309
- }, zt = {
1310
- name: "Fragment",
1311
- static: !0,
1312
- hidden: !0,
1313
- canHaveChildren: !0,
1314
- noWrap: !0
1315
- }, qt = {
1316
- name: "Image",
1317
- static: !0,
1318
- 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",
1319
- defaultStyles: {
1320
- position: "relative",
1321
- minHeight: "20px",
1322
- minWidth: "20px",
1323
- overflow: "hidden"
1324
- },
1325
- canHaveChildren: !0,
1326
- inputs: [{
1327
- name: "image",
1328
- type: "file",
1329
- bubble: !0,
1330
- allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
1331
- required: !0,
1332
- defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1333
- onChange: (e) => {
1334
- e.delete("srcset"), e.delete("noWebp");
1335
- function n(a, s = 6e4) {
1336
- return new Promise((c, u) => {
1337
- const h = document.createElement("img");
1338
- let d = !1;
1339
- h.onload = () => {
1340
- d = !0, c(h);
1341
- }, h.addEventListener("error", (f) => {
1342
- console.warn("Image load failed", f.error), u(f.error);
1343
- }), h.src = a, setTimeout(() => {
1344
- d || u(new Error("Image load timed out"));
1345
- }, s);
1346
- });
1347
- }
1348
- function o(a) {
1349
- return Math.round(a * 1e3) / 1e3;
1350
- }
1351
- const i = e.get("image"), r = e.get("aspectRatio");
1352
- if (fetch(i).then((a) => a.blob()).then((a) => {
1353
- a.type.includes("svg") && e.set("noWebp", !0);
1354
- }), i && (!r || r === 0.7041))
1355
- return n(i).then((a) => {
1356
- const s = e.get("aspectRatio");
1357
- e.get("image") === i && (!s || s === 0.7041) && a.width && a.height && (e.set("aspectRatio", o(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
1358
- });
1359
- }
1360
- }, {
1361
- name: "backgroundSize",
1362
- type: "text",
1363
- defaultValue: "cover",
1364
- enum: [{
1365
- label: "contain",
1366
- value: "contain",
1367
- helperText: "The image should never get cropped"
1368
- }, {
1369
- label: "cover",
1370
- value: "cover",
1371
- helperText: "The image should fill it's box, cropping when needed"
1372
- }]
1373
- }, {
1374
- name: "backgroundPosition",
1375
- type: "text",
1376
- defaultValue: "center",
1377
- enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
1378
- }, {
1379
- name: "altText",
1380
- type: "string",
1381
- helperText: "Text to display when the user has images off"
1382
- }, {
1383
- name: "height",
1384
- type: "number",
1385
- hideFromUI: !0
1386
- }, {
1387
- name: "width",
1388
- type: "number",
1389
- hideFromUI: !0
1390
- }, {
1391
- name: "sizes",
1392
- type: "string",
1393
- hideFromUI: !0
1394
- }, {
1395
- name: "srcset",
1396
- type: "string",
1397
- hideFromUI: !0
1398
- }, {
1399
- name: "lazy",
1400
- type: "boolean",
1401
- defaultValue: !0,
1402
- hideFromUI: !0
1403
- }, {
1404
- name: "fitContent",
1405
- type: "boolean",
1406
- helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
1407
- defaultValue: !0
1408
- }, {
1409
- name: "highPriority",
1410
- type: "boolean",
1411
- advanced: !0,
1412
- helperText: "Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."
1413
- }, {
1414
- name: "aspectRatio",
1415
- type: "number",
1416
- 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",
1417
- advanced: !0,
1418
- defaultValue: 0.7041
1419
- }]
1420
- }, Yt = {
1421
- name: "Core:Section",
1422
- static: !0,
1423
- image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
1424
- inputs: [{
1425
- name: "maxWidth",
1426
- type: "number",
1427
- defaultValue: 1200
1428
- }, {
1429
- name: "lazyLoad",
1430
- type: "boolean",
1431
- defaultValue: !1,
1432
- advanced: !0,
1433
- description: "Only render this section when in view"
1434
- }],
1435
- defaultStyles: {
1436
- paddingLeft: "20px",
1437
- paddingRight: "20px",
1438
- paddingTop: "50px",
1439
- paddingBottom: "50px",
1440
- marginTop: "0px",
1441
- width: "100vw",
1442
- marginLeft: "calc(50% - 50vw)"
1443
- },
1444
- canHaveChildren: !0,
1445
- defaultChildren: [{
1446
- "@type": "@builder.io/sdk:Element",
1447
- responsiveStyles: {
1448
- large: {
1449
- textAlign: "center"
1450
- }
1451
- },
1452
- component: {
1453
- name: "Text",
1454
- options: {
1455
- 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>"
1456
- }
1457
- }
1458
- }]
1459
- }, Gt = {
1460
- name: "Slot",
1461
- isRSC: !0,
1462
- description: "Allow child blocks to be inserted into this content when used as a Symbol",
1463
- docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
1464
- image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
1465
- // Maybe wrap this for canHaveChildren so bind children to this hm
1466
- inputs: [{
1467
- name: "name",
1468
- type: "string",
1469
- required: !0,
1470
- defaultValue: "children"
1471
- }]
1472
- };
1473
- function Jt(e) {
1474
- var t, n, o;
1475
- return /* @__PURE__ */ l(
1476
- "div",
1477
- {
1478
- style: {
1479
- pointerEvents: "auto"
1480
- },
1481
- ...!((t = e.builderContext.context) != null && t.symbolId) && {
1482
- "builder-slot": e.name
1483
- },
1484
- children: /* @__PURE__ */ l(
1485
- z,
1486
- {
1487
- parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
1488
- path: `symbol.data.${e.name}`,
1489
- context: e.builderContext,
1490
- blocks: (o = e.builderContext.rootState) == null ? void 0 : o[e.name]
1491
- }
1492
- )
1493
- }
1494
- );
1495
- }
1496
- const Qt = {
1497
- name: "Symbol",
1498
- noWrap: !0,
1499
- static: !0,
1500
- isRSC: !0,
1501
- inputs: [{
1502
- name: "symbol",
1503
- type: "uiSymbol"
1504
- }, {
1505
- name: "dataOnly",
1506
- helperText: "Make this a data symbol that doesn't display any UI",
1507
- type: "boolean",
1508
- defaultValue: !1,
1509
- advanced: !0,
1510
- hideFromUI: !0
1511
- }, {
1512
- name: "inheritState",
1513
- helperText: "Inherit the parent component state and data",
1514
- type: "boolean",
1515
- defaultValue: !1,
1516
- advanced: !0
1517
- }, {
1518
- name: "renderToLiquid",
1519
- helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1520
- type: "boolean",
1521
- defaultValue: !1,
1522
- advanced: !0,
1523
- hideFromUI: !0
1524
- }, {
1525
- name: "useChildren",
1526
- hideFromUI: !0,
1527
- type: "boolean"
1528
- }]
1529
- }, Xt = {
1530
- name: "Text",
1531
- static: !0,
1532
- isRSC: !0,
1533
- 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",
1534
- inputs: [{
1535
- name: "text",
1536
- type: "html",
1537
- required: !0,
1538
- autoFocus: !0,
1539
- bubble: !0,
1540
- defaultValue: "Enter some text..."
1541
- }],
1542
- defaultStyles: {
1543
- lineHeight: "normal",
1544
- height: "auto",
1545
- textAlign: "center"
1546
- }
1547
- };
1548
- function Zt(e) {
1549
- var t;
1550
- return /* @__PURE__ */ l(
1551
- "div",
1552
- {
1553
- className: "builder-text",
1554
- dangerouslySetInnerHTML: { __html: ((t = e.text) == null ? void 0 : t.toString()) || "" },
1555
- style: {
1556
- outline: "none"
1557
- }
1558
- }
1559
- );
1560
- }
1561
- const en = {
1562
- name: "Custom Code",
1563
- static: !0,
1564
- requiredPermissions: ["editCode"],
1565
- inputs: [{
1566
- name: "code",
1567
- type: "html",
1568
- required: !0,
1569
- defaultValue: "<p>Hello there, I am custom HTML code!</p>",
1570
- code: !0
1571
- }, {
1572
- name: "replaceNodes",
1573
- type: "boolean",
1574
- helperText: "Preserve server rendered dom nodes",
1575
- advanced: !0
1576
- }, {
1577
- name: "scriptsClientOnly",
1578
- type: "boolean",
1579
- defaultValue: !1,
1580
- helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1581
- advanced: !0
1582
- }]
1583
- }, tn = {
1584
- name: "Embed",
1585
- static: !0,
1586
- inputs: [{
1587
- name: "url",
1588
- type: "url",
1589
- required: !0,
1590
- defaultValue: "",
1591
- helperText: "e.g. enter a youtube url, google map, etc",
1592
- onChange: (e) => {
1593
- const t = e.get("url");
1594
- if (t)
1595
- return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((o) => o.json()).then((o) => {
1596
- e.get("url") === t && (o.html ? e.set("content", o.html) : e.set("content", "Invalid url, please try another"));
1597
- }).catch((o) => {
1598
- e.set("content", "There was an error embedding this URL, please try again or another URL");
1599
- });
1600
- e.delete("content");
1601
- }
1602
- }, {
1603
- name: "content",
1604
- type: "html",
1605
- defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1606
- hideFromUI: !0
1607
- }]
1608
- }, nn = ["text/javascript", "application/javascript", "application/ecmascript"], So = (e) => nn.includes(e.type), on = {
1609
- // friendlyName?
1610
- name: "Raw:Img",
1611
- hideFromInsertMenu: !0,
1612
- 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",
1613
- inputs: [{
1614
- name: "image",
1615
- bubble: !0,
1616
- type: "file",
1617
- allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
1618
- required: !0
1619
- }],
1620
- noWrap: !0,
1621
- static: !0
1622
- }, rn = {
1623
- name: "Video",
1624
- canHaveChildren: !0,
1625
- defaultStyles: {
1626
- minHeight: "20px",
1627
- minWidth: "20px"
1628
- },
1629
- 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",
1630
- inputs: [{
1631
- name: "video",
1632
- type: "file",
1633
- allowedFileTypes: ["mp4"],
1634
- bubble: !0,
1635
- defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
1636
- required: !0
1637
- }, {
1638
- name: "posterImage",
1639
- type: "file",
1640
- allowedFileTypes: ["jpeg", "png"],
1641
- helperText: "Image to show before the video plays"
1642
- }, {
1643
- name: "autoPlay",
1644
- type: "boolean",
1645
- defaultValue: !0
1646
- }, {
1647
- name: "controls",
1648
- type: "boolean",
1649
- defaultValue: !1
1650
- }, {
1651
- name: "muted",
1652
- type: "boolean",
1653
- defaultValue: !0
1654
- }, {
1655
- name: "loop",
1656
- type: "boolean",
1657
- defaultValue: !0
1658
- }, {
1659
- name: "playsInline",
1660
- type: "boolean",
1661
- defaultValue: !0
1662
- }, {
1663
- name: "fit",
1664
- type: "text",
1665
- defaultValue: "cover",
1666
- enum: ["contain", "cover", "fill", "auto"]
1667
- }, {
1668
- name: "preload",
1669
- type: "text",
1670
- defaultValue: "metadata",
1671
- enum: ["auto", "metadata", "none"]
1672
- }, {
1673
- name: "fitContent",
1674
- type: "boolean",
1675
- helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
1676
- defaultValue: !0,
1677
- advanced: !0
1678
- }, {
1679
- name: "position",
1680
- type: "text",
1681
- defaultValue: "center",
1682
- enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
1683
- }, {
1684
- name: "height",
1685
- type: "number",
1686
- advanced: !0
1687
- }, {
1688
- name: "width",
1689
- type: "number",
1690
- advanced: !0
1691
- }, {
1692
- name: "aspectRatio",
1693
- type: "number",
1694
- advanced: !0,
1695
- defaultValue: 0.7004048582995948
1696
- }, {
1697
- name: "lazyLoad",
1698
- type: "boolean",
1699
- helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
1700
- defaultValue: !0,
1701
- advanced: !0
1702
- }]
1703
- }, an = () => [{
1704
- component: Me,
1705
- ...en
1706
- }, {
1707
- component: je,
1708
- ...tn
1709
- }, {
1710
- component: He,
1711
- ...on
1712
- }, {
1713
- component: Ke,
1714
- ...rn
1715
- }], te = () => [{
1716
- component: ze,
1717
- ...Ht
1718
- }, {
1719
- component: Pt,
1720
- ...Kt
1721
- }, {
1722
- component: qe,
1723
- ...zt
1724
- }, {
1725
- component: Ye,
1726
- ...qt
1727
- }, {
1728
- component: Ge,
1729
- ...Yt
1730
- }, {
1731
- component: Jt,
1732
- ...Gt
1733
- }, {
1734
- component: so,
1735
- ...Qt
1736
- }, {
1737
- component: Zt,
1738
- ...Xt
1739
- }, ...an()], vo = (e) => ({
1740
- type: "builder.registerComponent",
1741
- data: U(e)
1742
- }), sn = (e) => {
1743
- const t = e.toString().trim();
1744
- return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
1745
- }, cn = (e) => typeof e == "function" ? sn(e) : O(e), U = ({
1746
- inputs: e,
1747
- ...t
1748
- }) => ({
1749
- ...O(t),
1750
- inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [i, r]) => ({
1751
- ...o,
1752
- [i]: cn(r)
1753
- }), {}))
1754
- }), ln = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1755
- function getAndSetVariantId() {
1756
- function setCookie(name, value, days) {
1757
- let expires = '';
1758
- if (days) {
1759
- const date = new Date();
1760
- date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
1761
- expires = '; expires=' + date.toUTCString();
1762
- }
1763
- document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
1764
- }
1765
- function getCookie(name) {
1766
- const nameEQ = name + '=';
1767
- const ca = document.cookie.split(';');
1768
- for (let i = 0; i < ca.length; i++) {
1769
- let c = ca[i];
1770
- while (c.charAt(0) === ' ') c = c.substring(1, c.length);
1771
- if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
1772
- }
1773
- return null;
1774
- }
1775
- const cookieName = \`builder.tests.\${contentId}\`;
1776
- const variantInCookie = getCookie(cookieName);
1777
- const availableIDs = variants.map(vr => vr.id).concat(contentId);
1778
- if (variantInCookie && availableIDs.includes(variantInCookie)) {
1779
- return variantInCookie;
1780
- }
1781
- let n = 0;
1782
- const random = Math.random();
1783
- for (let i = 0; i < variants.length; i++) {
1784
- const variant = variants[i];
1785
- const testRatio = variant.testRatio;
1786
- n += testRatio;
1787
- if (random < n) {
1788
- setCookie(cookieName, variant.id);
1789
- return variant.id;
1790
- }
1791
- }
1792
- setCookie(cookieName, contentId);
1793
- return contentId;
1794
- }
1795
- const winningVariantId = getAndSetVariantId();
1796
- const styleEl = document.currentScript?.previousElementSibling;
1797
- if (isHydrationTarget) {
1798
- styleEl.remove();
1799
- const thisScriptEl = document.currentScript;
1800
- thisScriptEl?.remove();
1801
- } else {
1802
- const newStyleStr = variants.concat({
1803
- id: contentId
1804
- }).filter(variant => variant.id !== winningVariantId).map(value => {
1805
- return \`.variant-\${value.id} { display: none; }
1806
- \`;
1807
- }).join('');
1808
- styleEl.innerHTML = newStyleStr;
1809
- }
1810
- }`, dn = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
1811
- if (!navigator.cookieEnabled) {
1812
- return;
1813
- }
1814
- function getCookie(name) {
1815
- const nameEQ = name + '=';
1816
- const ca = document.cookie.split(';');
1817
- for (let i = 0; i < ca.length; i++) {
1818
- let c = ca[i];
1819
- while (c.charAt(0) === ' ') c = c.substring(1, c.length);
1820
- if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
1821
- }
1822
- return null;
1823
- }
1824
- const cookieName = \`builder.tests.\${defaultContentId}\`;
1825
- const winningVariant = getCookie(cookieName);
1826
- const parentDiv = document.currentScript?.parentElement;
1827
- const isDefaultContent = variantContentId === defaultContentId;
1828
- const isWinningVariant = winningVariant === variantContentId;
1829
- if (isWinningVariant && !isDefaultContent) {
1830
- parentDiv?.removeAttribute('hidden');
1831
- parentDiv?.removeAttribute('aria-hidden');
1832
- } else if (!isWinningVariant && isDefaultContent) {
1833
- parentDiv?.setAttribute('hidden', 'true');
1834
- parentDiv?.setAttribute('aria-hidden', 'true');
1835
- }
1836
- if (isHydrationTarget) {
1837
- if (!isWinningVariant) {
1838
- parentDiv?.remove();
1839
- }
1840
- const thisScriptEl = document.currentScript;
1841
- thisScriptEl?.remove();
1842
- }
1843
- return;
1844
- }`, Te = "builderIoAbTest", Ee = "builderIoRenderContent", W = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1845
- ...t,
1846
- testVariationId: t.id,
1847
- id: e == null ? void 0 : e.id
1848
- })), un = ({
1849
- canTrack: e,
1850
- content: t
1851
- }) => !(!(W(t).length > 0) || !e || k()), mn = (e) => e === "react" || e === "reactNative", Re = mn(x), fn = () => `
1852
- window.${Te} = ${ln}
1853
- window.${Ee} = ${dn}
1854
- `, hn = (e, t) => `
1855
- window.${Te}(
1856
- "${t}",${JSON.stringify(e)}, ${Re}
1857
- )`, pn = ({
1858
- contentId: e,
1859
- variationId: t
1860
- }) => `window.${Ee}(
1861
- "${t}", "${e}", ${Re}
1862
- )`;
1863
- function D(e) {
1864
- return /* @__PURE__ */ l(
1865
- "script",
1866
- {
1867
- dangerouslySetInnerHTML: { __html: e.scriptStr },
1868
- "data-id": e.id
1869
- }
1870
- );
1871
- }
1872
- const gn = (e) => {
1873
- const t = e.get("preview"), n = e.get("overrides." + t);
1874
- return n || I.warn("No previewed ID found in search params."), n;
1875
- };
1876
- function bn() {
1877
- globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new Fe({
1878
- max: 500,
1879
- // how long to live in ms
1880
- ttl: 1e3 * 60 * 5
1881
- }));
1882
- }
1883
- function yn(e) {
1884
- bn();
1885
- const t = gn(e);
1886
- return typeof t == "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t) : void 0;
1887
- }
1888
- function Sn() {
1889
- return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
1890
- }
1891
- function vn() {
1892
- const e = Sn().fetch;
1893
- if (typeof e > "u")
1894
- throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
1895
- For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
1896
- return e;
1897
- }
1898
- const kn = vn();
1899
- function _(e, t = null, n = ".") {
1900
- return Object.keys(e).reduce((o, i) => {
1901
- const r = e[i], a = [t, i].filter(Boolean).join(n);
1902
- return [typeof r == "object", r !== null, !(Array.isArray(r) && r.length === 0)].every(Boolean) ? {
1903
- ...o,
1904
- ..._(r, a, n)
1905
- } : {
1906
- ...o,
1907
- [a]: r
1908
- };
1909
- }, {});
1910
- }
1911
- function Ae(e, t, n = {}) {
1912
- for (const o in e) {
1913
- const i = e[o], r = t ? t + "." + o : o;
1914
- i && typeof i == "object" && !Array.isArray(i) && !Object.keys(i).find((a) => a.startsWith("$")) ? Ae(i, r, n) : n[r] = i;
1915
- }
1916
- return n;
1917
- }
1918
- const xn = "v3", ne = "builder.", Cn = "options.", Pe = (e) => {
1919
- if (!e)
1920
- return {};
1921
- const t = ue(e), n = {};
1922
- return Object.keys(t).forEach((o) => {
1923
- if (o.startsWith(ne)) {
1924
- const i = o.replace(ne, "").replace(Cn, "");
1925
- n[i] = t[o];
1926
- }
1927
- }), n;
1928
- }, wn = () => {
1929
- if (!k())
1930
- return {};
1931
- const e = new URLSearchParams(window.location.search);
1932
- return Pe(e);
1933
- }, oe = (e) => typeof e == "number" && !isNaN(e) && e >= 0, Y = (e) => {
1934
- const {
1935
- limit: t = 30,
1936
- userAttributes: n,
1937
- query: o,
1938
- model: i,
1939
- apiKey: r,
1940
- enrich: a,
1941
- locale: s,
1942
- apiVersion: c = xn,
1943
- fields: u,
1944
- omit: h,
1945
- offset: d,
1946
- cacheSeconds: f,
1947
- staleCacheSeconds: g,
1948
- sort: v,
1949
- includeUnpublished: b
1950
- } = e;
1951
- if (!r)
1952
- throw new Error("Missing API key");
1953
- if (!["v3"].includes(c))
1954
- throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);
1955
- const E = t !== 1, m = new URL(`https://cdn.builder.io/api/${c}/content/${i}`);
1956
- if (m.searchParams.set("apiKey", r), m.searchParams.set("limit", String(t)), m.searchParams.set("noTraverse", String(E)), m.searchParams.set("includeRefs", String(!0)), s && m.searchParams.set("locale", s), a && m.searchParams.set("enrich", String(a)), m.searchParams.set("omit", h || "meta.componentsUsed"), u && m.searchParams.set("fields", u), Number.isFinite(d) && d > -1 && m.searchParams.set("offset", String(Math.floor(d))), typeof b == "boolean" && m.searchParams.set("includeUnpublished", String(b)), f && oe(f) && m.searchParams.set("cacheSeconds", String(f)), g && oe(g) && m.searchParams.set("staleCacheSeconds", String(g)), v) {
1957
- const S = _({
1958
- sort: v
1959
- });
1960
- for (const w in S)
1961
- m.searchParams.set(w, JSON.stringify(S[w]));
1962
- }
1963
- const p = {
1964
- ...wn(),
1965
- ...ue(e.options || {})
1966
- }, y = _(p);
1967
- for (const S in y)
1968
- m.searchParams.set(S, String(y[S]));
1969
- if (n && m.searchParams.set("userAttributes", JSON.stringify(n)), o) {
1970
- const S = Ae({
1971
- query: o
1972
- });
1973
- for (const w in S)
1974
- m.searchParams.set(w, JSON.stringify(S[w]));
1975
- }
1976
- return m;
1977
- }, In = (e) => "results" in e;
1978
- async function Be(e) {
1979
- const t = await Rn({
1980
- ...e,
1981
- limit: 1
1982
- });
1983
- return t && t[0] || null;
1984
- }
1985
- const Tn = async (e) => {
1986
- const t = Y(e);
1987
- return await (await (e.fetch ?? kn)(t.href, e.fetchOptions)).json();
1988
- }, En = async (e, t, n = Y(e)) => {
1989
- const o = L(e.canTrack);
1990
- if (n.search.includes("preview=")) {
1991
- const r = [];
1992
- for (const a of t.results) {
1993
- const s = yn(n.searchParams);
1994
- r.push(s || a);
1995
- }
1996
- t.results = r;
1997
- }
1998
- if (!o || !(k() || x === "reactNative"))
1999
- return t.results;
2000
- try {
2001
- const r = [];
2002
- for (const a of t.results)
2003
- r.push(await jt({
2004
- item: a,
2005
- canTrack: o
2006
- }));
2007
- t.results = r;
2008
- } catch (r) {
2009
- I.error("Could not process A/B tests. ", r);
2010
- }
2011
- return t.results;
2012
- };
2013
- async function Rn(e) {
2014
- try {
2015
- const t = Y(e), n = await Tn(e);
2016
- return In(n) ? En(e, n) : (I.error("Error fetching data. ", {
2017
- url: t,
2018
- content: n,
2019
- options: e
2020
- }), null);
2021
- } catch (t) {
2022
- return I.error("Error fetching data. ", t), null;
2023
- }
2024
- }
2025
- function ko(e) {
2026
- const t = e || (k() ? window.location.search : void 0);
2027
- return t ? me(t).indexOf("builder.preview=") !== -1 : !1;
2028
- }
2029
- function An() {
2030
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
2031
- const t = Math.random() * 16 | 0;
2032
- return (e == "x" ? t : t & 3 | 8).toString(16);
2033
- });
2034
- }
2035
- function Ve() {
2036
- return An().replace(/-/g, "");
2037
- }
2038
- const We = "builderSessionId", Pn = async ({
2039
- canTrack: e
2040
- }) => {
2041
- if (!e)
2042
- return;
2043
- const t = await ke({
2044
- name: We,
2045
- canTrack: e
2046
- });
2047
- if (T(t))
2048
- return t;
2049
- {
2050
- const n = Bn();
2051
- return Vn({
2052
- id: n,
2053
- canTrack: e
2054
- }), n;
2055
- }
2056
- }, Bn = () => Ve(), Vn = ({
2057
- id: e,
2058
- canTrack: t
2059
- }) => xe({
2060
- name: We,
2061
- value: e,
2062
- canTrack: t
2063
- }), Ne = () => k() && typeof localStorage < "u" ? localStorage : void 0, Wn = ({
2064
- key: e,
2065
- canTrack: t
2066
- }) => {
2067
- var n;
2068
- try {
2069
- return t ? (n = Ne()) == null ? void 0 : n.getItem(e) : void 0;
2070
- } catch (o) {
2071
- console.debug("[LocalStorage] GET error: ", o);
2072
- return;
2073
- }
2074
- }, Nn = ({
2075
- key: e,
2076
- canTrack: t,
2077
- value: n
2078
- }) => {
2079
- var o;
2080
- try {
2081
- t && ((o = Ne()) == null || o.setItem(e, n));
2082
- } catch (i) {
2083
- console.debug("[LocalStorage] SET error: ", i);
2084
- }
2085
- }, Oe = "builderVisitorId", On = ({
2086
- canTrack: e
2087
- }) => {
2088
- if (!e)
2089
- return;
2090
- const t = Wn({
2091
- key: Oe,
2092
- canTrack: e
2093
- });
2094
- if (T(t))
2095
- return t;
2096
- {
2097
- const n = $n();
2098
- return Fn({
2099
- id: n,
2100
- canTrack: e
2101
- }), n;
2102
- }
2103
- }, $n = () => Ve(), Fn = ({
2104
- id: e,
2105
- canTrack: t
2106
- }) => Nn({
2107
- key: Oe,
2108
- value: e,
2109
- canTrack: t
2110
- }), Ln = async ({
2111
- canTrack: e
2112
- }) => {
2113
- if (!e)
2114
- return {
2115
- visitorId: void 0,
2116
- sessionId: void 0
2117
- };
2118
- const t = await Pn({
2119
- canTrack: e
2120
- }), n = On({
2121
- canTrack: e
2122
- });
2123
- return {
2124
- sessionId: t,
2125
- visitorId: n
2126
- };
2127
- }, Un = async ({
2128
- type: e,
2129
- canTrack: t,
2130
- apiKey: n,
2131
- metadata: o,
2132
- ...i
2133
- }) => ({
2134
- type: e,
2135
- data: {
2136
- ...i,
2137
- metadata: {
2138
- url: location.href,
2139
- ...o
2140
- },
2141
- ...await Ln({
2142
- canTrack: t
2143
- }),
2144
- userAttributes: he(),
2145
- ownerId: n
2146
- }
2147
- });
2148
- async function Dn(e) {
2149
- if (!e.apiKey) {
2150
- I.error("Missing API key for track call. Please provide your API key.");
2151
- return;
2152
- }
2153
- if (e.canTrack && !fe() && (k() || x === "reactNative"))
2154
- return fetch("https://cdn.builder.io/api/v1/track", {
2155
- method: "POST",
2156
- body: JSON.stringify({
2157
- events: [await Un(e)]
2158
- }),
2159
- headers: {
2160
- "content-type": "application/json"
2161
- },
2162
- mode: "cors"
2163
- }).catch((t) => {
2164
- console.error("Failed to track: ", t);
2165
- });
2166
- }
2167
- const xo = (e) => Dn({
2168
- ...e,
2169
- canTrack: !0
2170
- });
2171
- function ie(e) {
2172
- return Math.round(e * 1e3) / 1e3;
2173
- }
2174
- const _n = (e, t, n = !0) => {
2175
- if (!(e instanceof HTMLElement))
2176
- return null;
2177
- let o = n ? e : e.parentElement;
2178
- do {
2179
- if (!o)
2180
- return null;
2181
- if (t(o))
2182
- return o;
2183
- } while (o = o.parentElement);
2184
- return null;
2185
- }, Mn = (e) => _n(e, (t) => {
2186
- const n = t.getAttribute("builder-id") || t.id;
2187
- return (n == null ? void 0 : n.indexOf("builder-")) === 0;
2188
- }), re = ({
2189
- event: e,
2190
- target: t
2191
- }) => {
2192
- const n = t.getBoundingClientRect(), o = e.clientX - n.left, i = e.clientY - n.top, r = ie(o / n.width), a = ie(i / n.height);
2193
- return {
2194
- x: r,
2195
- y: a
2196
- };
2197
- }, Co = (e) => {
2198
- const t = e.target, n = t && Mn(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2199
- return {
2200
- targetBuilderElement: o || void 0,
2201
- metadata: {
2202
- targetOffset: t ? re({
2203
- event: e,
2204
- target: t
2205
- }) : void 0,
2206
- builderTargetOffset: n ? re({
2207
- event: e,
2208
- target: n
2209
- }) : void 0,
2210
- builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
2211
- }
2212
- };
2213
- }, jn = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
2214
- function $e(e, t) {
2215
- if (!t.origin.startsWith("http") && !t.origin.startsWith("https"))
2216
- return !1;
2217
- const n = new URL(t.origin), o = n.hostname;
2218
- return (e || jn).findIndex((i) => i.startsWith("*.") ? o.endsWith(i.slice(1)) : i === o) > -1;
2219
- }
2220
- const Hn = "0.14.28", ae = {};
2221
- function Kn(e, t) {
2222
- let n = ae[e];
2223
- if (n || (n = ae[e] = []), n.push(t), k()) {
2224
- const o = {
2225
- type: "builder.register",
2226
- data: {
2227
- type: e,
2228
- info: t
2229
- }
2230
- };
2231
- try {
2232
- parent.postMessage(o, "*"), parent !== window && window.postMessage(o, "*");
2233
- } catch (i) {
2234
- console.debug("Could not postmessage", i);
2235
- }
2236
- }
2237
- }
2238
- const wo = () => {
2239
- Kn("insertMenu", {
2240
- name: "_default",
2241
- default: !0,
2242
- items: [{
2243
- name: "Box"
2244
- }, {
2245
- name: "Text"
2246
- }, {
2247
- name: "Image"
2248
- }, {
2249
- name: "Columns"
2250
- }, {
2251
- name: "Core:Section"
2252
- }, {
2253
- name: "Core:Button"
2254
- }, {
2255
- name: "Embed"
2256
- }, {
2257
- name: "Custom Code"
2258
- }]
2259
- });
2260
- };
2261
- let se = !1;
2262
- const zn = (e = {}) => {
2263
- var t, n;
2264
- se || (se = !0, k() && ((t = window.parent) == null || t.postMessage({
2265
- type: "builder.sdkInfo",
2266
- data: {
2267
- target: x,
2268
- version: Hn,
2269
- supportsPatchUpdates: !1,
2270
- // Supports builder-model="..." attribute which is needed to
2271
- // scope our '+ add block' button styling
2272
- supportsAddBlockScoping: !0,
2273
- supportsCustomBreakpoints: !0
2274
- }
2275
- }, "*"), (n = window.parent) == null || n.postMessage({
2276
- type: "builder.updateContent",
2277
- data: {
2278
- options: e
2279
- }
2280
- }, "*"), window.addEventListener("message", (o) => {
2281
- var r, a;
2282
- if (!$e(e.trustedHosts, o))
2283
- return;
2284
- const {
2285
- data: i
2286
- } = o;
2287
- if (i != null && i.type)
2288
- switch (i.type) {
2289
- case "builder.evaluate": {
2290
- const s = i.data.text, c = i.data.arguments || [], u = i.data.id, h = new Function(s);
2291
- let d, f = null;
2292
- try {
2293
- d = h.apply(null, c);
2294
- } catch (g) {
2295
- f = g;
2296
- }
2297
- f ? (r = window.parent) == null || r.postMessage({
2298
- type: "builder.evaluateError",
2299
- data: {
2300
- id: u,
2301
- error: f.message
2302
- }
2303
- }, "*") : d && typeof d.then == "function" ? d.then((g) => {
2304
- var v;
2305
- (v = window.parent) == null || v.postMessage({
2306
- type: "builder.evaluateResult",
2307
- data: {
2308
- id: u,
2309
- result: g
2310
- }
2311
- }, "*");
2312
- }).catch(console.error) : (a = window.parent) == null || a.postMessage({
2313
- type: "builder.evaluateResult",
2314
- data: {
2315
- result: d,
2316
- id: u
2317
- }
2318
- }, "*");
2319
- break;
2320
- }
2321
- }
2322
- })));
2323
- }, qn = ({
2324
- model: e,
2325
- trustedHosts: t,
2326
- callbacks: n
2327
- }) => (o) => {
2328
- if (!$e(t, o))
2329
- return;
2330
- const {
2331
- data: i
2332
- } = o;
2333
- if (i)
2334
- switch (i.type) {
2335
- case "builder.configureSdk": {
2336
- n.configureSdk(i.data);
2337
- break;
2338
- }
2339
- case "builder.triggerAnimation": {
2340
- n.animation(i.data);
2341
- break;
2342
- }
2343
- case "builder.contentUpdate": {
2344
- const r = i.data, a = r.key || r.alias || r.entry || r.modelName, s = r.data;
2345
- a === e && n.contentUpdate(s);
2346
- break;
2347
- }
2348
- }
2349
- }, Io = (e, t, n) => {
2350
- if (!k)
2351
- return I.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
2352
- };
2353
- zn();
2354
- const o = qn({
2355
- callbacks: {
2356
- contentUpdate: t,
2357
- animation: () => {
2358
- },
2359
- configureSdk: () => {
2360
- }
2361
- },
2362
- model: e,
2363
- trustedHosts: n == null ? void 0 : n.trustedHosts
2364
- });
2365
- return window.addEventListener("message", o), () => {
2366
- window.removeEventListener("message", o);
2367
- };
2368
- };
2369
- function ce(e, ...t) {
2370
- const n = Object(e);
2371
- for (let o = 1; o < arguments.length; o++) {
2372
- const i = arguments[o];
2373
- if (i != null)
2374
- for (const r in i)
2375
- Object.prototype.hasOwnProperty.call(i, r) && (n[r] = i[r]);
2376
- }
2377
- return n;
2378
- }
2379
- function Yn(e) {
2380
- console.warn(`Cannot animate element: element with ID ${e} not found!`);
2381
- }
2382
- function Gn(e, t) {
2383
- const n = Jn(e), o = getComputedStyle(t), i = e.steps[0].styles, r = e.steps[e.steps.length - 1].styles, a = [i, r];
2384
- for (const s of a)
2385
- for (const c of n)
2386
- c in s || (s[c] = o[c]);
2387
- }
2388
- function Jn(e) {
2389
- const t = [];
2390
- for (const n of e.steps)
2391
- for (const o in n.styles)
2392
- t.indexOf(o) === -1 && t.push(o);
2393
- return t;
2394
- }
2395
- function To(e) {
2396
- const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
2397
- if (!t.length) {
2398
- Yn(e.elementId || e.id || "");
2399
- return;
2400
- }
2401
- Array.from(t).forEach((n) => {
2402
- Gn(e, n), n.style.transition = "none", n.style.transitionDelay = "0", ce(n.style, e.steps[0].styles), setTimeout(() => {
2403
- n.style.transition = `all ${e.duration}s ${K(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), ce(n.style, e.steps[1].styles), setTimeout(() => {
2404
- n.style.transition = "", n.style.transitionDelay = "";
2405
- }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
2406
- });
2407
- });
2408
- }
2409
- const Qn = (e) => {
2410
- var r;
2411
- const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((r = e == null ? void 0 : e.files) == null ? void 0 : r.regular);
2412
- let i = "";
2413
- if (o && t && n && (i += `
2414
- @font-face {
2415
- font-family: "${t}";
2416
- src: local("${n}"), url('${o}') format('woff2');
2417
- font-display: fallback;
2418
- font-weight: 400;
2419
- }
2420
- `.trim()), e.files)
2421
- for (const a in e.files) {
2422
- if (!(String(Number(a)) === a))
2423
- continue;
2424
- const c = e.files[a];
2425
- c && c !== o && (i += `
2426
- @font-face {
2427
- font-family: "${t}";
2428
- src: url('${c}') format('woff2');
2429
- font-display: fallback;
2430
- font-weight: ${a};
2431
- }
2432
- `.trim());
2433
- }
2434
- return i;
2435
- }, Xn = ({
2436
- customFonts: e
2437
- }) => {
2438
- var t;
2439
- return ((t = e == null ? void 0 : e.map((n) => Qn(n))) == null ? void 0 : t.join(" ")) || "";
2440
- }, Zn = ({
2441
- cssCode: e,
2442
- contentId: t
2443
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", eo = `
2444
- .builder-button {
2445
- all: unset;
2446
- }
2447
-
2448
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
2449
- margin: 0;
2450
- }
2451
- .builder-text > p, .builder-text > .builder-paragraph {
2452
- color: inherit;
2453
- line-height: inherit;
2454
- letter-spacing: inherit;
2455
- font-weight: inherit;
2456
- font-size: inherit;
2457
- text-align: inherit;
2458
- font-family: inherit;
2459
- }
2460
- `, to = (e) => e ? "" : eo, Eo = (e) => `variant-${e}`;
2461
- function no(e) {
2462
- const t = `
2463
- ${Zn({
2464
- cssCode: e.cssCode,
2465
- contentId: e.contentId
2466
- })}
2467
- ${Xn({
2468
- customFonts: e.customFonts
2469
- })}
2470
- ${to(e.isNestedRender)}
2471
- `.trim();
2472
- return /* @__PURE__ */ l($, { id: "builderio-content", styles: t });
2473
- }
2474
- const oo = ({
2475
- content: e,
2476
- data: t,
2477
- locale: n
2478
- }) => {
2479
- var r, a, s;
2480
- const o = {}, i = ((r = e == null ? void 0 : e.data) == null ? void 0 : r.state) || {};
2481
- return (s = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || s.forEach((c) => {
2482
- c.name && c.defaultValue !== void 0 && (o[c.name] = c.defaultValue);
2483
- }), {
2484
- ...o,
2485
- ...i,
2486
- ...t,
2487
- ...n ? {
2488
- locale: n
2489
- } : {}
2490
- };
2491
- }, io = ({
2492
- content: e,
2493
- data: t
2494
- }) => e ? {
2495
- ...e,
2496
- data: {
2497
- ...e == null ? void 0 : e.data,
2498
- ...t
2499
- },
2500
- meta: e == null ? void 0 : e.meta
2501
- } : void 0;
2502
- function le(e) {
2503
- var i, r, a, s, c, u, h, d, f;
2504
- const t = pn({
2505
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2506
- variationId: (i = e.content) == null ? void 0 : i.testVariationId,
2507
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2508
- contentId: (r = e.content) == null ? void 0 : r.id
2509
- }), n = [
2510
- ...te(),
2511
- ...e.customComponents || []
2512
- ].reduce(
2513
- (g, { component: v, ...b }) => ({
2514
- ...g,
2515
- [b.name]: {
2516
- component: v,
2517
- ...U(b)
2518
- }
2519
- }),
2520
- {}
2521
- ), o = {
2522
- content: io({
2523
- content: e.content,
2524
- data: e.data
2525
- }),
2526
- localState: void 0,
2527
- rootState: oo({
2528
- content: e.content,
2529
- data: e.data,
2530
- locale: e.locale
2531
- }),
2532
- rootSetState: void 0,
2533
- context: e.context || {},
2534
- canTrack: e.canTrack,
2535
- apiKey: e.apiKey,
2536
- apiVersion: e.apiVersion,
2537
- componentInfos: [
2538
- ...te(),
2539
- ...e.customComponents || []
2540
- ].reduce(
2541
- (g, { component: v, ...b }) => ({
2542
- ...g,
2543
- [b.name]: U(b)
2544
- }),
2545
- {}
2546
- ),
2547
- inheritedStyles: {},
2548
- BlocksWrapper: e.blocksWrapper || "div",
2549
- BlocksWrapperProps: e.blocksWrapperProps || {}
2550
- };
2551
- return /* @__PURE__ */ R(
2552
- Je,
2553
- {
2554
- content: e.content,
2555
- data: e.data,
2556
- model: e.model,
2557
- context: e.context,
2558
- apiKey: e.apiKey,
2559
- canTrack: e.canTrack,
2560
- locale: e.locale,
2561
- enrich: e.enrich,
2562
- showContent: e.showContent,
2563
- builderContextSignal: o,
2564
- contentWrapper: e.contentWrapper,
2565
- contentWrapperProps: e.contentWrapperProps,
2566
- trustedHosts: e.trustedHosts,
2567
- children: [
2568
- e.isSsrAbTest ? /* @__PURE__ */ l(
2569
- D,
2570
- {
2571
- id: "builderio-variant-visibility",
2572
- scriptStr: t
2573
- }
2574
- ) : null,
2575
- /* @__PURE__ */ l(
2576
- no,
2577
- {
2578
- isNestedRender: e.isNestedRender,
2579
- contentId: (a = o.content) == null ? void 0 : a.id,
2580
- cssCode: (c = (s = o.content) == null ? void 0 : s.data) == null ? void 0 : c.cssCode,
2581
- customFonts: (h = (u = o.content) == null ? void 0 : u.data) == null ? void 0 : h.customFonts
2582
- }
2583
- ),
2584
- /* @__PURE__ */ l(
2585
- z,
2586
- {
2587
- blocks: (f = (d = o.content) == null ? void 0 : d.data) == null ? void 0 : f.blocks,
2588
- context: o,
2589
- registeredComponents: n,
2590
- linkComponent: e.linkComponent
2591
- }
2592
- )
2593
- ]
2594
- }
2595
- );
2596
- }
2597
- function ro(e) {
2598
- var r;
2599
- const t = un({
2600
- canTrack: L(e.canTrack),
2601
- content: e.content
2602
- }), n = function() {
2603
- var s;
2604
- return hn(
2605
- W(e.content).map((c) => ({
2606
- id: c.testVariationId,
2607
- testRatio: c.testRatio
2608
- })),
2609
- ((s = e.content) == null ? void 0 : s.id) || ""
2610
- );
2611
- }, o = function() {
2612
- return W(e.content).map((s) => `.variant-${s.testVariationId} { display: none; } `).join("");
2613
- }, i = function() {
2614
- var s;
2615
- return t ? {
2616
- ...e.content,
2617
- testVariationId: (s = e.content) == null ? void 0 : s.id
2618
- } : Mt({
2619
- item: e.content,
2620
- canTrack: L(e.canTrack)
2621
- });
2622
- };
2623
- return /* @__PURE__ */ R(C, { children: [
2624
- !e.isNestedRender && x !== "reactNative" ? /* @__PURE__ */ l(
2625
- D,
2626
- {
2627
- id: "builderio-init-variants-fns",
2628
- scriptStr: fn()
2629
- }
2630
- ) : null,
2631
- t ? /* @__PURE__ */ R(C, { children: [
2632
- /* @__PURE__ */ l(
2633
- $,
2634
- {
2635
- id: "builderio-variants",
2636
- styles: o()
2637
- }
2638
- ),
2639
- /* @__PURE__ */ l(
2640
- D,
2641
- {
2642
- id: "builderio-variants-visibility",
2643
- scriptStr: n()
2644
- }
2645
- ),
2646
- (r = W(e.content)) == null ? void 0 : r.map((a) => /* @__PURE__ */ l(
2647
- le,
2648
- {
2649
- isNestedRender: e.isNestedRender,
2650
- content: a,
2651
- showContent: !1,
2652
- model: e.model,
2653
- data: e.data,
2654
- context: e.context,
2655
- apiKey: e.apiKey,
2656
- apiVersion: e.apiVersion,
2657
- customComponents: e.customComponents,
2658
- linkComponent: e.linkComponent,
2659
- canTrack: e.canTrack,
2660
- locale: e.locale,
2661
- enrich: e.enrich,
2662
- isSsrAbTest: t,
2663
- blocksWrapper: e.blocksWrapper,
2664
- blocksWrapperProps: e.blocksWrapperProps,
2665
- contentWrapper: e.contentWrapper,
2666
- contentWrapperProps: e.contentWrapperProps,
2667
- trustedHosts: e.trustedHosts
2668
- },
2669
- a.testVariationId
2670
- ))
2671
- ] }) : null,
2672
- /* @__PURE__ */ l(
2673
- le,
2674
- {
2675
- isNestedRender: e.isNestedRender,
2676
- content: i(),
2677
- showContent: !0,
2678
- model: e.model,
2679
- data: e.data,
2680
- context: e.context,
2681
- apiKey: e.apiKey,
2682
- apiVersion: e.apiVersion,
2683
- customComponents: e.customComponents,
2684
- linkComponent: e.linkComponent,
2685
- canTrack: e.canTrack,
2686
- locale: e.locale,
2687
- enrich: e.enrich,
2688
- isSsrAbTest: t,
2689
- blocksWrapper: e.blocksWrapper,
2690
- blocksWrapperProps: e.blocksWrapperProps,
2691
- contentWrapper: e.contentWrapper,
2692
- contentWrapperProps: e.contentWrapperProps,
2693
- trustedHosts: e.trustedHosts
2694
- }
2695
- )
2696
- ] });
2697
- }
2698
- const ao = async ({
2699
- builderContextValue: e,
2700
- symbol: t
2701
- }) => {
2702
- if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
2703
- (e != null && e.apiKey))
2704
- return Be({
2705
- model: t.model,
2706
- apiKey: e.apiKey,
2707
- apiVersion: e.apiVersion,
2708
- ...(t == null ? void 0 : t.entry) && {
2709
- query: {
2710
- id: t.entry
2711
- }
2712
- }
2713
- }).catch((n) => {
2714
- I.error("Could not fetch symbol content: ", n);
2715
- });
2716
- };
2717
- async function so(e) {
2718
- var r, a, s, c, u;
2719
- const t = function() {
2720
- return "div";
2721
- }, n = function() {
2722
- return "div";
2723
- }, o = function() {
2724
- var d, f;
2725
- return [
2726
- e.attributes[M()],
2727
- "builder-symbol",
2728
- (d = e.symbol) != null && d.inline ? "builder-inline-symbol" : void 0,
2729
- (f = e.symbol) != null && f.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2730
- ].filter(Boolean).join(" ");
2731
- }, i = ((r = e.symbol) == null ? void 0 : r.content) || await ao({
2732
- symbol: e.symbol,
2733
- builderContextValue: e.builderContext
2734
- });
2735
- return /* @__PURE__ */ l("div", { ...e.attributes, className: o(), children: /* @__PURE__ */ l(
2736
- ro,
2737
- {
2738
- isNestedRender: !0,
2739
- apiVersion: e.builderContext.apiVersion,
2740
- apiKey: e.builderContext.apiKey,
2741
- context: {
2742
- ...e.builderContext.context,
2743
- symbolId: (a = e.builderBlock) == null ? void 0 : a.id
2744
- },
2745
- customComponents: Object.values(e.builderComponents),
2746
- data: {
2747
- ...(s = e.symbol) == null ? void 0 : s.data,
2748
- ...e.builderContext.localState,
2749
- ...(c = i == null ? void 0 : i.data) == null ? void 0 : c.state
2750
- },
2751
- canTrack: e.builderContext.canTrack,
2752
- model: (u = e.symbol) == null ? void 0 : u.model,
2753
- content: i,
2754
- linkComponent: e.builderLinkComponent,
2755
- blocksWrapper: t(),
2756
- contentWrapper: n()
2757
- }
2758
- ) });
2759
- }
2760
- const de = {};
2761
- function Ro(e) {
2762
- if (k()) {
2763
- Object.assign(de, e);
2764
- const t = {
2765
- type: "builder.settingsChange",
2766
- data: de
2767
- };
2768
- parent.postMessage(t, "*");
2769
- }
2770
- }
2771
- const Ao = async (e) => {
2772
- var o, i, r;
2773
- const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((i = e.userAttributes) == null ? void 0 : i.urlPath), n = {
2774
- ...e,
2775
- apiKey: e.apiKey,
2776
- model: e.model || "page",
2777
- userAttributes: {
2778
- ...e.userAttributes,
2779
- ...t ? {
2780
- urlPath: t
2781
- } : {}
2782
- },
2783
- options: Pe(e.searchParams || ((r = e.url) == null ? void 0 : r.searchParams) || e.options)
2784
- };
2785
- return {
2786
- apiKey: n.apiKey,
2787
- model: n.model,
2788
- content: await Be(n)
2789
- };
2790
- };
2791
- export {
2792
- Pe as A,
2793
- z as B,
2794
- Pt as C,
2795
- xo as D,
2796
- Io as E,
2797
- Ao as F,
2798
- En as G,
2799
- Rn as H,
2800
- so as S,
2801
- Zt as T,
2802
- Dn as _,
2803
- Tt as a,
2804
- bo as b,
2805
- fe as c,
2806
- yo as d,
2807
- So as e,
2808
- k as f,
2809
- M as g,
2810
- L as h,
2811
- go as i,
2812
- ko as j,
2813
- Eo as k,
2814
- I as l,
2815
- qn as m,
2816
- H as n,
2817
- Co as o,
2818
- kn as p,
2819
- O as q,
2820
- wo as r,
2821
- zn as s,
2822
- To as t,
2823
- vo as u,
2824
- Be as v,
2825
- bn as w,
2826
- ro as x,
2827
- Kn as y,
2828
- Ro as z
2829
- };