@builder.io/sdk-react 2.0.8 → 2.0.12

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 (73) hide show
  1. package/lib/browser/blocks-exports.cjs +28 -28
  2. package/lib/browser/blocks-exports.mjs +991 -966
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/init.cjs +3 -3
  6. package/lib/browser/init.mjs +3 -3
  7. package/lib/browser/server-entry-acf08871.cjs +2 -0
  8. package/lib/{node/server-entry-f6ee5d92.js → browser/server-entry-dc66de59.js} +346 -342
  9. package/lib/browser/server-entry.cjs +1 -1
  10. package/lib/browser/server-entry.mjs +1 -1
  11. package/lib/edge/{accordion-ef5e6161.js → accordion-37ff8319.js} +1 -1
  12. package/lib/edge/{accordion-88007399.cjs → accordion-b3b8c262.cjs} +1 -1
  13. package/lib/edge/blocks-793430a0.cjs +12 -0
  14. package/lib/edge/blocks-e0e60319.js +833 -0
  15. package/lib/edge/blocks-exports.cjs +1 -1
  16. package/lib/edge/blocks-exports.mjs +2 -2
  17. package/lib/edge/{button-8d307faf.js → button-15992755.js} +2 -2
  18. package/lib/edge/{button-228f448d.cjs → button-875ac10b.cjs} +1 -1
  19. package/lib/edge/{columns-3547be8c.cjs → columns-11ead988.cjs} +1 -1
  20. package/lib/edge/{columns-77b7011a.js → columns-cfe663b2.js} +4 -4
  21. package/lib/edge/{content-variants-4f7cad1a.js → content-variants-e780597b.js} +11 -11
  22. package/lib/edge/{content-variants-f0edf280.cjs → content-variants-f8ef104d.cjs} +4 -4
  23. package/lib/edge/{evaluate-384a03ed.js → evaluate-6408d64d.js} +87 -87
  24. package/lib/edge/{evaluate-39c2c786.cjs → evaluate-938a955e.cjs} +6 -6
  25. package/lib/edge/{form-c6da17f5.cjs → form-75a774bc.cjs} +1 -1
  26. package/lib/edge/{form-d40e9eca.js → form-7735178f.js} +4 -4
  27. package/lib/edge/{get-class-prop-name-767dbeb0.js → get-class-prop-name-d005a2bb.js} +1 -1
  28. package/lib/edge/{get-class-prop-name-4f8743e9.cjs → get-class-prop-name-e596650d.cjs} +1 -1
  29. package/lib/edge/{img-d650b796.js → img-045bb860.js} +1 -1
  30. package/lib/edge/{img-c50b3839.cjs → img-dd79e34b.cjs} +1 -1
  31. package/lib/edge/index.cjs +1 -1
  32. package/lib/edge/index.mjs +1 -1
  33. package/lib/edge/init.cjs +3 -3
  34. package/lib/edge/init.mjs +3 -3
  35. package/lib/edge/{input-aaba7df0.cjs → input-3bd0ac03.cjs} +1 -1
  36. package/lib/edge/{input-5646dcb2.js → input-adf80016.js} +1 -1
  37. package/lib/edge/{select-2e7bf7d0.cjs → select-882193d4.cjs} +1 -1
  38. package/lib/edge/{select-d3905dcd.js → select-90b076db.js} +1 -1
  39. package/lib/edge/{server-entry-29a170e3.js → server-entry-84c3cdd6.js} +59 -58
  40. package/lib/edge/server-entry-d5ae6221.cjs +2 -0
  41. package/lib/edge/server-entry.cjs +1 -1
  42. package/lib/edge/server-entry.mjs +1 -1
  43. package/lib/edge/{slot-82c0b340.js → slot-293114eb.js} +4 -4
  44. package/lib/edge/{slot-695259cf.cjs → slot-42b9b358.cjs} +1 -1
  45. package/lib/edge/{symbol-5a6a783f.cjs → symbol-3e0799b8.cjs} +1 -1
  46. package/lib/edge/{symbol-91897bd4.js → symbol-aed9cd2b.js} +2 -2
  47. package/lib/edge/{tabs-a191e7b1.js → tabs-0cf37bf4.js} +4 -4
  48. package/lib/edge/{tabs-4c4a6b19.cjs → tabs-f5c4f350.cjs} +1 -1
  49. package/lib/edge/{text-ca974245.js → text-9e2166c7.js} +2 -2
  50. package/lib/edge/{text-7a00e2f8.cjs → text-abb84188.cjs} +1 -1
  51. package/lib/node/blocks-exports.cjs +29 -29
  52. package/lib/node/blocks-exports.mjs +983 -958
  53. package/lib/node/index.cjs +1 -1
  54. package/lib/node/index.mjs +2 -2
  55. package/lib/node/init.cjs +1 -1
  56. package/lib/node/init.mjs +2 -2
  57. package/lib/node/{node-runtime-a6fb6ac7.cjs → node-runtime-11912803.cjs} +4 -4
  58. package/lib/node/{node-runtime-d8e6d827.js → node-runtime-49e4c6cb.js} +3 -3
  59. package/lib/node/server-entry-acf08871.cjs +2 -0
  60. package/lib/{browser/server-entry-f6ee5d92.js → node/server-entry-dc66de59.js} +346 -342
  61. package/lib/node/server-entry.cjs +1 -1
  62. package/lib/node/server-entry.mjs +1 -1
  63. package/package.json +3 -3
  64. package/types/components/block/block.helpers.d.ts +1 -2
  65. package/types/constants/sdk-version.d.ts +1 -1
  66. package/types/functions/evaluate/node-runtime/init.d.ts +1 -0
  67. package/types/functions/get-processed-block.d.ts +1 -0
  68. package/types/functions/register-component.d.ts +1 -1
  69. package/lib/browser/server-entry-ba3e0524.cjs +0 -2
  70. package/lib/edge/blocks-90fd2fd8.js +0 -808
  71. package/lib/edge/blocks-dc478c97.cjs +0 -12
  72. package/lib/edge/server-entry-b0e7430b.cjs +0 -2
  73. package/lib/node/server-entry-ba3e0524.cjs +0 -2
@@ -0,0 +1,833 @@
1
+ import { jsx as a, Fragment as h, jsxs as P } from "react/jsx-runtime";
2
+ import { createContext as F, useState as O, useEffect as w, useRef as V, useContext as N } from "react";
3
+ import { BuilderContext as M } from "./blocks-exports.mjs";
4
+ import { TARGET as x, checkIsDefined as R, isPreviewing as Z, isEditing as T } from "./server-entry-84c3cdd6.js";
5
+ import { evaluate as A, set as q } from "./evaluate-6408d64d.js";
6
+ import { getClassPropName as J } from "./get-class-prop-name-d005a2bb.js";
7
+ import { DynamicRenderer as Q } from "./dynamic-renderer-8b343325.js";
8
+ const L = (e) => JSON.parse(JSON.stringify(e)), G = F({ registeredComponents: {} });
9
+ function X(e) {
10
+ var n;
11
+ return {
12
+ ...(n = e.component) == null ? void 0 : n.options,
13
+ ...e.options
14
+ };
15
+ }
16
+ function Y(e, ...n) {
17
+ const t = Object.assign({}, e);
18
+ for (const r of n)
19
+ delete t[r];
20
+ return t;
21
+ }
22
+ function I(e) {
23
+ if (e === null || typeof e != "object")
24
+ return e;
25
+ if (Array.isArray(e))
26
+ return e.map((t) => I(t));
27
+ if (e["@type"] === "@builder.io/sdk:Element")
28
+ return e;
29
+ const n = {};
30
+ for (const t in e)
31
+ t !== "meta" && Object.prototype.hasOwnProperty.call(e, t) && (n[t] = I(e[t]));
32
+ return n;
33
+ }
34
+ const ee = ["svelte", "vue", "angular", "qwik", "solid"].includes(x), te = (e) => {
35
+ if (ee) {
36
+ const n = L(e);
37
+ return {
38
+ ...n,
39
+ properties: {
40
+ ...n.properties
41
+ },
42
+ actions: {
43
+ ...n.actions
44
+ }
45
+ };
46
+ } else {
47
+ const n = I(Y(e, "children", "meta"));
48
+ return {
49
+ ...n,
50
+ properties: {
51
+ ...n.properties
52
+ },
53
+ actions: {
54
+ ...n.actions
55
+ },
56
+ children: e.children,
57
+ meta: e.meta
58
+ };
59
+ }
60
+ }, ne = ({
61
+ block: e,
62
+ context: n,
63
+ localState: t,
64
+ rootState: r,
65
+ rootSetState: o
66
+ }) => {
67
+ if (!e.bindings)
68
+ return e;
69
+ const s = te(e);
70
+ for (const l in e.bindings) {
71
+ const u = e.bindings[l], f = A({
72
+ code: u,
73
+ localState: t,
74
+ rootState: r,
75
+ rootSetState: o,
76
+ context: n,
77
+ enableCache: !0
78
+ });
79
+ q(s, l, f);
80
+ }
81
+ return s;
82
+ };
83
+ function oe({
84
+ block: e,
85
+ context: n,
86
+ shouldEvaluateBindings: t,
87
+ localState: r,
88
+ rootState: o,
89
+ rootSetState: s
90
+ }) {
91
+ const l = e;
92
+ return t ? ne({
93
+ block: l,
94
+ localState: r,
95
+ rootState: o,
96
+ rootSetState: s,
97
+ context: n
98
+ }) : l;
99
+ }
100
+ const b = (e) => e ? e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "";
101
+ function re(e, n, t = {}) {
102
+ let r, o, s, l = null, u = 0;
103
+ const f = function() {
104
+ u = t.leading === !1 ? 0 : Date.now(), l = null, s = e.apply(r, o), l || (r = o = null);
105
+ };
106
+ return function() {
107
+ const c = Date.now();
108
+ !u && t.leading === !1 && (u = c);
109
+ const m = n - (c - u);
110
+ return r = this, o = arguments, m <= 0 || m > n ? (l && (clearTimeout(l), l = null), u = c, s = e.apply(r, o), l || (r = o = null)) : !l && t.trailing !== !1 && (l = setTimeout(f, m)), s;
111
+ };
112
+ }
113
+ function S(e, ...n) {
114
+ const t = Object(e);
115
+ for (let r = 1; r < arguments.length; r++) {
116
+ const o = arguments[r];
117
+ if (o != null)
118
+ for (const s in o)
119
+ Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
120
+ }
121
+ return t;
122
+ }
123
+ function se(e) {
124
+ for (const n of e)
125
+ switch (n.trigger) {
126
+ case "pageLoad":
127
+ ce(n);
128
+ break;
129
+ case "scrollInView":
130
+ ie(n);
131
+ break;
132
+ }
133
+ }
134
+ function j(e) {
135
+ console.warn(`Cannot animate element: element with ID ${e} not found!`);
136
+ }
137
+ function H(e, n) {
138
+ const t = le(e), r = getComputedStyle(n), o = e.steps[0].styles, s = e.steps[e.steps.length - 1].styles, l = [o, s];
139
+ for (const u of l)
140
+ for (const f of t)
141
+ f in u || (u[f] = r[f]);
142
+ }
143
+ function le(e) {
144
+ const n = [];
145
+ for (const t of e.steps)
146
+ for (const r in t.styles)
147
+ n.indexOf(r) === -1 && n.push(r);
148
+ return n;
149
+ }
150
+ function ce(e) {
151
+ const n = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
152
+ if (!n.length) {
153
+ j(e.elementId || e.id || "");
154
+ return;
155
+ }
156
+ Array.from(n).forEach((t) => {
157
+ H(e, t), t.style.transition = "none", t.style.transitionDelay = "0", S(t.style, e.steps[0].styles), setTimeout(() => {
158
+ t.style.transition = `all ${e.duration}s ${b(e.easing)}`, e.delay && (t.style.transitionDelay = e.delay + "s"), S(t.style, e.steps[1].styles), setTimeout(() => {
159
+ t.style.transition = "", t.style.transitionDelay = "";
160
+ }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
161
+ });
162
+ });
163
+ }
164
+ function ie(e) {
165
+ const n = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
166
+ if (!n.length) {
167
+ j(e.elementId || e.id || "");
168
+ return;
169
+ }
170
+ Array.from(n).forEach((t) => {
171
+ H(e, t);
172
+ let r = !1, o = !1;
173
+ function s() {
174
+ !r && u(t) ? (r = !0, o = !0, setTimeout(() => {
175
+ S(t.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", l), setTimeout(() => {
176
+ o = !1, e.repeat || (t.style.transition = "", t.style.transitionDelay = "");
177
+ }, (e.duration + (e.delay || 0)) * 1e3 + 100);
178
+ })) : e.repeat && r && !o && !u(t) && (r = !1, S(t.style, e.steps[0].styles));
179
+ }
180
+ const l = re(s, 200, {
181
+ leading: !1
182
+ });
183
+ function u(m) {
184
+ const g = m.getBoundingClientRect(), k = window.innerHeight, i = (e.thresholdPercent || 0) / 100 * k;
185
+ return g.bottom > i && g.top < k - i;
186
+ }
187
+ const f = e.steps[0].styles;
188
+ function c() {
189
+ S(t.style, f);
190
+ }
191
+ c(), setTimeout(() => {
192
+ t.style.transition = `all ${e.duration}s ${b(e.easing)}`, e.delay && (t.style.transitionDelay = e.delay + "s");
193
+ }), document.addEventListener("scroll", l, {
194
+ capture: !0,
195
+ passive: !0
196
+ }), s();
197
+ });
198
+ }
199
+ const U = (e) => Object.entries(e).map(([t, r]) => {
200
+ if (typeof r == "string")
201
+ return `${b(t)}: ${r};`;
202
+ }).filter(R), ae = (e) => U(e).join(`
203
+ `), C = ({
204
+ mediaQuery: e,
205
+ className: n,
206
+ styles: t
207
+ }) => {
208
+ const r = `.${n} {
209
+ ${ae(t)}
210
+ }`;
211
+ return e ? `${e} {
212
+ ${r}
213
+ }` : r;
214
+ };
215
+ function ue({
216
+ style: e
217
+ }) {
218
+ return e;
219
+ }
220
+ const de = ({
221
+ block: e,
222
+ context: n
223
+ }) => fe(ue({
224
+ style: e.style || {},
225
+ context: n,
226
+ block: e
227
+ }));
228
+ function fe(e) {
229
+ switch (x) {
230
+ case "svelte":
231
+ case "vue":
232
+ case "solid":
233
+ case "angular":
234
+ return U(e).join(" ");
235
+ case "qwik":
236
+ case "reactNative":
237
+ case "react":
238
+ case "rsc":
239
+ return e;
240
+ }
241
+ }
242
+ const me = ({
243
+ block: e,
244
+ registeredComponents: n
245
+ }) => {
246
+ var o;
247
+ const t = (o = e.component) == null ? void 0 : o.name;
248
+ if (!t)
249
+ return null;
250
+ const r = n[t];
251
+ if (r)
252
+ return r;
253
+ console.warn(`
254
+ Could not find a registered component named "${t}".
255
+ If you registered it, is the file that registered it imported by the file that needs to render it?`);
256
+ }, pe = ({
257
+ block: e,
258
+ context: n
259
+ }) => {
260
+ const {
261
+ repeat: t,
262
+ ...r
263
+ } = e;
264
+ if (!(t != null && t.collection))
265
+ return;
266
+ const o = A({
267
+ code: t.collection,
268
+ localState: n.localState,
269
+ rootState: n.rootState,
270
+ rootSetState: n.rootSetState,
271
+ context: n.context,
272
+ enableCache: !0
273
+ });
274
+ if (!Array.isArray(o))
275
+ return;
276
+ const s = t.collection.split(".").pop(), l = t.itemName || (s ? s + "Item" : "item");
277
+ return o.map((f, c) => ({
278
+ context: {
279
+ ...n,
280
+ localState: {
281
+ ...n.localState,
282
+ $index: c,
283
+ $item: f,
284
+ [l]: f,
285
+ [`$${l}Index`]: c
286
+ }
287
+ },
288
+ block: r
289
+ }));
290
+ }, he = (e, n) => {
291
+ var t;
292
+ return (t = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && t.builderLinkComponent ? {
293
+ builderLinkComponent: n
294
+ } : {};
295
+ }, ye = (e, n) => {
296
+ var t;
297
+ return (t = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && t.builderComponents ? {
298
+ builderComponents: n
299
+ } : {};
300
+ }, ge = (e, n) => {
301
+ var t;
302
+ return (t = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && t.builderBlock ? {
303
+ builderBlock: n
304
+ } : {};
305
+ }, ke = (e, n) => {
306
+ var t;
307
+ return (t = e == null ? void 0 : e.shouldReceiveBuilderProps) != null && t.builderContext ? {
308
+ builderContext: n
309
+ } : {};
310
+ }, z = {
311
+ small: {
312
+ min: 320,
313
+ default: 321,
314
+ max: 640
315
+ },
316
+ medium: {
317
+ min: 641,
318
+ default: 642,
319
+ max: 991
320
+ },
321
+ large: {
322
+ min: 990,
323
+ default: 991,
324
+ max: 1200
325
+ }
326
+ }, D = (e, n = z) => `@media (max-width: ${n[e].max}px)`, Se = ({
327
+ small: e,
328
+ medium: n
329
+ }) => {
330
+ const t = L(z);
331
+ if (!e || !n)
332
+ return t;
333
+ const r = Math.floor(e / 2);
334
+ t.small = {
335
+ max: e,
336
+ min: r,
337
+ default: r + 1
338
+ };
339
+ const o = t.small.max + 1;
340
+ t.medium = {
341
+ max: n,
342
+ min: o,
343
+ default: o + 1
344
+ };
345
+ const s = t.medium.max + 1;
346
+ return t.large = {
347
+ max: 2e3,
348
+ // TODO: decide upper limit
349
+ min: s,
350
+ default: s + 1
351
+ }, t;
352
+ };
353
+ function Ce(e) {
354
+ return /* @__PURE__ */ a(
355
+ "style",
356
+ {
357
+ dangerouslySetInnerHTML: { __html: e.styles },
358
+ "data-id": e.id,
359
+ nonce: e.nonce
360
+ }
361
+ );
362
+ }
363
+ function xe(e) {
364
+ function n() {
365
+ const r = e.block;
366
+ return R(r.hide) ? !r.hide : R(r.show) ? r.show : !0;
367
+ }
368
+ function t() {
369
+ var y, W, $;
370
+ const r = e.block, o = r.responsiveStyles, s = e.context.content, l = Se(
371
+ ((y = s == null ? void 0 : s.meta) == null ? void 0 : y.breakpoints) || {}
372
+ ), u = o == null ? void 0 : o.large, f = o == null ? void 0 : o.medium, c = o == null ? void 0 : o.small, m = r.id;
373
+ if (!m)
374
+ return "";
375
+ const g = u ? C({
376
+ className: m,
377
+ styles: u
378
+ }) : "", k = f ? C({
379
+ className: m,
380
+ styles: f,
381
+ mediaQuery: D(
382
+ "medium",
383
+ l
384
+ )
385
+ }) : "", d = c ? C({
386
+ className: m,
387
+ styles: c,
388
+ mediaQuery: D(
389
+ "small",
390
+ l
391
+ )
392
+ }) : "", i = r.animations && r.animations.find((B) => B.trigger === "hover");
393
+ let p = "";
394
+ if (i) {
395
+ const B = (($ = (W = i.steps) == null ? void 0 : W[1]) == null ? void 0 : $.styles) || {};
396
+ p = C({
397
+ className: `${m}:hover`,
398
+ styles: {
399
+ ...B,
400
+ transition: `all ${i.duration}s ${b(
401
+ i.easing
402
+ )}`,
403
+ transitionDelay: i.delay ? `${i.delay}s` : "0s"
404
+ }
405
+ }) || "";
406
+ }
407
+ return [
408
+ g,
409
+ k,
410
+ d,
411
+ p
412
+ ].join(" ");
413
+ }
414
+ return /* @__PURE__ */ a(h, { children: t() && n() ? /* @__PURE__ */ a(h, { children: /* @__PURE__ */ a(
415
+ Ce,
416
+ {
417
+ id: "builderio-block",
418
+ styles: t(),
419
+ nonce: e.context.nonce
420
+ }
421
+ ) }) : null });
422
+ }
423
+ function be(e) {
424
+ return e.charAt(0).toUpperCase() + e.slice(1);
425
+ }
426
+ const ve = (e) => `on${be(e)}`, Be = (e, n) => (t) => A({
427
+ code: e,
428
+ context: n.context,
429
+ localState: n.localState,
430
+ rootState: n.rootState,
431
+ rootSetState: n.rootSetState,
432
+ event: t,
433
+ isExpression: !1,
434
+ enableCache: !0
435
+ });
436
+ function K(e) {
437
+ var r;
438
+ const n = {}, t = (r = e.block.actions) != null ? r : {};
439
+ for (const o in t) {
440
+ if (!t.hasOwnProperty(o))
441
+ continue;
442
+ const s = t[o];
443
+ let l = ve(o);
444
+ if (e.stripPrefix)
445
+ switch (x) {
446
+ case "vue":
447
+ l = l.replace("v-on:", "");
448
+ break;
449
+ case "svelte":
450
+ l = l.replace("on:", "");
451
+ break;
452
+ }
453
+ n[l] = Be(s, e);
454
+ }
455
+ return n;
456
+ }
457
+ function Pe({
458
+ properties: e
459
+ }) {
460
+ return e;
461
+ }
462
+ const we = (e) => ({
463
+ href: e.href
464
+ });
465
+ function E({
466
+ block: e,
467
+ context: n
468
+ }) {
469
+ var r;
470
+ const t = {
471
+ ...we(e),
472
+ ...e.properties,
473
+ "builder-id": e.id,
474
+ style: de({
475
+ block: e,
476
+ context: n
477
+ }),
478
+ [J()]: [e.id, "builder-block", e.class, (r = e.properties) == null ? void 0 : r.class].filter(Boolean).join(" ")
479
+ };
480
+ return Pe({
481
+ properties: t,
482
+ context: n,
483
+ block: e
484
+ });
485
+ }
486
+ function Re(e) {
487
+ return /* @__PURE__ */ a(
488
+ Q,
489
+ {
490
+ TagName: e.Wrapper,
491
+ attributes: E({
492
+ block: e.block,
493
+ context: e.context
494
+ }),
495
+ actionAttributes: K({
496
+ block: e.block,
497
+ rootState: e.context.rootState,
498
+ rootSetState: e.context.rootSetState,
499
+ localState: e.context.localState,
500
+ context: e.context.context,
501
+ stripPrefix: !0
502
+ }),
503
+ children: e.children
504
+ }
505
+ );
506
+ }
507
+ function Ie(e) {
508
+ function n() {
509
+ return e.includeBlockProps ? {
510
+ ...E({
511
+ block: e.block,
512
+ context: e.context
513
+ }),
514
+ ...K({
515
+ block: e.block,
516
+ rootState: e.context.rootState,
517
+ rootSetState: e.context.rootSetState,
518
+ localState: e.context.localState,
519
+ context: e.context.context
520
+ })
521
+ } : {};
522
+ }
523
+ return /* @__PURE__ */ a(e.Wrapper, { ...e.wrapperProps, attributes: n(), children: e.children });
524
+ }
525
+ const Oe = ({
526
+ componentOptions: e,
527
+ builderBlock: n,
528
+ context: t,
529
+ componentRef: r,
530
+ includeBlockProps: o,
531
+ isInteractive: s,
532
+ contextValue: l
533
+ }) => {
534
+ const u = {
535
+ ...e,
536
+ /**
537
+ * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
538
+ * component itself directly. Otherwise, they are provided to the wrapper element.
539
+ */
540
+ ...o ? {
541
+ attributes: E({
542
+ block: n,
543
+ context: l
544
+ })
545
+ } : {}
546
+ };
547
+ return s ? {
548
+ Wrapper: r,
549
+ block: n,
550
+ context: t,
551
+ wrapperProps: e,
552
+ includeBlockProps: o
553
+ } : u;
554
+ };
555
+ function _(e) {
556
+ var r;
557
+ const [n, t] = O(
558
+ () => e.isInteractive ? Ie : e.componentRef
559
+ );
560
+ return /* @__PURE__ */ a(h, { children: e.componentRef ? /* @__PURE__ */ a(h, { children: /* @__PURE__ */ a(
561
+ n,
562
+ {
563
+ ...Oe({
564
+ componentOptions: e.componentOptions,
565
+ builderBlock: e.builderBlock,
566
+ context: e.context,
567
+ componentRef: e.componentRef,
568
+ linkComponent: e.linkComponent,
569
+ includeBlockProps: e.includeBlockProps,
570
+ isInteractive: e.isInteractive,
571
+ contextValue: e.context
572
+ }),
573
+ children: (r = e.blockChildren) == null ? void 0 : r.map((o) => /* @__PURE__ */ a(
574
+ v,
575
+ {
576
+ block: o,
577
+ context: e.context,
578
+ registeredComponents: e.registeredComponents,
579
+ linkComponent: e.linkComponent
580
+ },
581
+ o.id
582
+ ))
583
+ }
584
+ ) }) : null });
585
+ }
586
+ function Ae(e) {
587
+ const [n, t] = O(() => e.repeatContext);
588
+ return /* @__PURE__ */ a(M.Provider, { value: n, children: /* @__PURE__ */ a(
589
+ v,
590
+ {
591
+ block: e.block,
592
+ context: n,
593
+ registeredComponents: e.registeredComponents,
594
+ linkComponent: e.linkComponent
595
+ }
596
+ ) });
597
+ }
598
+ function v(e) {
599
+ var m, g, k;
600
+ function n() {
601
+ return pe({
602
+ block: e.block,
603
+ context: e.context
604
+ });
605
+ }
606
+ const [t, r] = O(() => ({
607
+ value: null,
608
+ update: !1
609
+ }));
610
+ function o() {
611
+ var i;
612
+ if (t.value && !t.update && !Z())
613
+ return t.value;
614
+ const d = (i = e.block.repeat) != null && i.collection ? e.block : oe({
615
+ block: e.block,
616
+ localState: e.context.localState,
617
+ rootState: e.context.rootState,
618
+ rootSetState: e.context.rootSetState,
619
+ context: e.context.context,
620
+ shouldEvaluateBindings: !0
621
+ });
622
+ return t.value = d, t.update = !1, d;
623
+ }
624
+ function s() {
625
+ return me({
626
+ block: o(),
627
+ registeredComponents: e.registeredComponents
628
+ });
629
+ }
630
+ function l() {
631
+ var i;
632
+ return e.block.tagName === "a" || ((i = o().properties) == null ? void 0 : i.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
633
+ }
634
+ function u() {
635
+ var p, y;
636
+ if ((p = e.block.repeat) != null && p.collection)
637
+ return !!((y = n == null ? void 0 : n()) != null && y.length);
638
+ const d = "hide" in o() ? o().hide : !1;
639
+ return ("show" in o() ? o().show : !0) && !d;
640
+ }
641
+ function f() {
642
+ var i, p;
643
+ return !((i = s == null ? void 0 : s()) != null && i.component) && !n() ? (p = o().children) != null ? p : [] : [];
644
+ }
645
+ function c() {
646
+ var d, i, p, y;
647
+ return {
648
+ blockChildren: (d = o().children) != null ? d : [],
649
+ componentRef: (i = s == null ? void 0 : s()) == null ? void 0 : i.component,
650
+ componentOptions: {
651
+ ...X(o()),
652
+ ...ge(s(), o()),
653
+ ...ke(s(), e.context),
654
+ ...he(s(), e.linkComponent),
655
+ ...ye(
656
+ s(),
657
+ e.registeredComponents
658
+ )
659
+ },
660
+ context: e.context,
661
+ linkComponent: e.linkComponent,
662
+ registeredComponents: e.registeredComponents,
663
+ builderBlock: o(),
664
+ includeBlockProps: ((p = s == null ? void 0 : s()) == null ? void 0 : p.noWrap) === !0,
665
+ isInteractive: !((y = s == null ? void 0 : s()) != null && y.isRSC && x === "rsc")
666
+ };
667
+ }
668
+ return w(() => {
669
+ const d = o().id, i = o().animations;
670
+ i && d && se(
671
+ i.map((p) => ({
672
+ ...p,
673
+ elementId: d
674
+ }))
675
+ );
676
+ }, []), w(() => {
677
+ t.update = !0;
678
+ }), /* @__PURE__ */ a(h, { children: u() ? /* @__PURE__ */ P(h, { children: [
679
+ /* @__PURE__ */ a(xe, { block: o(), context: e.context }),
680
+ (m = s == null ? void 0 : s()) != null && m.noWrap ? /* @__PURE__ */ a(h, { children: /* @__PURE__ */ a(
681
+ _,
682
+ {
683
+ componentRef: c().componentRef,
684
+ componentOptions: c().componentOptions,
685
+ blockChildren: c().blockChildren,
686
+ context: c().context,
687
+ registeredComponents: c().registeredComponents,
688
+ linkComponent: c().linkComponent,
689
+ builderBlock: c().builderBlock,
690
+ includeBlockProps: c().includeBlockProps,
691
+ isInteractive: c().isInteractive
692
+ }
693
+ ) }) : /* @__PURE__ */ a(h, { children: n() ? /* @__PURE__ */ a(h, { children: (k = n()) == null ? void 0 : k.map((d, i) => /* @__PURE__ */ a(
694
+ Ae,
695
+ {
696
+ repeatContext: d.context,
697
+ block: d.block,
698
+ registeredComponents: e.registeredComponents,
699
+ linkComponent: e.linkComponent
700
+ },
701
+ i
702
+ )) }) : /* @__PURE__ */ P(
703
+ Re,
704
+ {
705
+ Wrapper: l(),
706
+ block: o(),
707
+ context: e.context,
708
+ children: [
709
+ /* @__PURE__ */ a(
710
+ _,
711
+ {
712
+ componentRef: c().componentRef,
713
+ componentOptions: c().componentOptions,
714
+ blockChildren: c().blockChildren,
715
+ context: c().context,
716
+ registeredComponents: c().registeredComponents,
717
+ linkComponent: c().linkComponent,
718
+ builderBlock: c().builderBlock,
719
+ includeBlockProps: c().includeBlockProps,
720
+ isInteractive: c().isInteractive
721
+ }
722
+ ),
723
+ (g = f()) == null ? void 0 : g.map((d) => /* @__PURE__ */ a(
724
+ v,
725
+ {
726
+ block: d,
727
+ registeredComponents: e.registeredComponents,
728
+ linkComponent: e.linkComponent,
729
+ context: e.context
730
+ },
731
+ d.id
732
+ ))
733
+ ]
734
+ }
735
+ ) })
736
+ ] }) : null });
737
+ }
738
+ function Ee(e) {
739
+ const n = V(null);
740
+ function t() {
741
+ var s;
742
+ return "builder-blocks" + ((s = e.blocks) != null && s.length ? "" : " no-blocks");
743
+ }
744
+ function r() {
745
+ var s, l;
746
+ T() && !((s = e.blocks) != null && s.length) && ((l = window.parent) == null || l.postMessage(
747
+ {
748
+ type: "builder.clickEmptyBlocks",
749
+ data: {
750
+ parentElementId: e.parent,
751
+ dataPath: e.path
752
+ }
753
+ },
754
+ "*"
755
+ ));
756
+ }
757
+ function o() {
758
+ var s, l;
759
+ T() && !((s = e.blocks) != null && s.length) && ((l = window.parent) == null || l.postMessage(
760
+ {
761
+ type: "builder.hoverEmptyBlocks",
762
+ data: {
763
+ parentElementId: e.parent,
764
+ dataPath: e.path
765
+ }
766
+ },
767
+ "*"
768
+ ));
769
+ }
770
+ return w(() => {
771
+ }, []), /* @__PURE__ */ P(h, { children: [
772
+ /* @__PURE__ */ a(
773
+ e.BlocksWrapper,
774
+ {
775
+ ref: n,
776
+ className: t() + " props-blocks-wrapper-51ef31b4",
777
+ "builder-path": e.path,
778
+ "builder-parent-id": e.parent,
779
+ style: e.styleProp,
780
+ onClick: (s) => r(),
781
+ onMouseEnter: (s) => o(),
782
+ onKeyPress: (s) => r(),
783
+ ...e.BlocksWrapperProps,
784
+ children: e.children
785
+ }
786
+ ),
787
+ /* @__PURE__ */ a("style", { children: `.props-blocks-wrapper-51ef31b4 {
788
+ display: flex;
789
+ flex-direction: column;
790
+ align-items: stretch;
791
+ }` })
792
+ ] });
793
+ }
794
+ function We(e) {
795
+ var r, o, s;
796
+ const n = N(M), t = N(G);
797
+ return /* @__PURE__ */ a(
798
+ Ee,
799
+ {
800
+ blocks: e.blocks,
801
+ parent: e.parent,
802
+ path: e.path,
803
+ styleProp: e.styleProp,
804
+ BlocksWrapper: ((r = e.context) == null ? void 0 : r.BlocksWrapper) || n.BlocksWrapper,
805
+ BlocksWrapperProps: ((o = e.context) == null ? void 0 : o.BlocksWrapperProps) || n.BlocksWrapperProps,
806
+ children: e.blocks ? /* @__PURE__ */ a(h, { children: (s = e.blocks) == null ? void 0 : s.map((l) => /* @__PURE__ */ a(
807
+ v,
808
+ {
809
+ block: l,
810
+ linkComponent: e.linkComponent,
811
+ context: e.context || n,
812
+ registeredComponents: e.registeredComponents || t.registeredComponents
813
+ },
814
+ l.id
815
+ )) }) : null
816
+ }
817
+ );
818
+ }
819
+ const je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
820
+ __proto__: null,
821
+ default: We
822
+ }, Symbol.toStringTag, { value: "Module" }));
823
+ export {
824
+ v as Block,
825
+ We as Blocks,
826
+ G as ComponentsContext,
827
+ Ce as InlinedStyles,
828
+ je as blocks,
829
+ L as fastClone,
830
+ Se as getSizesForBreakpoints,
831
+ fe as mapStyleObjToStrIfNeeded,
832
+ ce as triggerAnimation
833
+ };