@builder.io/sdk-react-nextjs 0.14.11 → 0.14.13

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 (34) hide show
  1. package/lib/browser/{USE_CLIENT_BUNDLE-3b942ae2.js → USE_CLIENT_BUNDLE-6ac6c863.js} +203 -211
  2. package/lib/browser/USE_CLIENT_BUNDLE-c6228734.cjs +21 -0
  3. package/lib/{edge/USE_SERVER_BUNDLE-ef053564.js → browser/USE_SERVER_BUNDLE-1de84180.js} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-812e699d.cjs → browser/USE_SERVER_BUNDLE-8d870a7d.cjs} +1 -1
  5. package/lib/browser/{bundle-260ced55.cjs → bundle-f15c021e.cjs} +2 -2
  6. package/lib/browser/{bundle-76453d46.js → bundle-f830d2ad.js} +21 -21
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +24 -23
  9. package/lib/{node/USE_CLIENT_BUNDLE-64c45aac.js → edge/USE_CLIENT_BUNDLE-20aebe3e.js} +203 -211
  10. package/lib/edge/USE_CLIENT_BUNDLE-714c22c7.cjs +21 -0
  11. package/lib/{node/USE_SERVER_BUNDLE-ed1c8346.js → edge/USE_SERVER_BUNDLE-87b221af.js} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-299ebfe7.cjs → edge/USE_SERVER_BUNDLE-dfe3d2e3.cjs} +1 -1
  13. package/lib/edge/{bundle-c186261f.cjs → bundle-5a4040f8.cjs} +2 -2
  14. package/lib/edge/{bundle-19c1b23d.js → bundle-d7a3ce0a.js} +21 -21
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +24 -23
  17. package/lib/node/USE_CLIENT_BUNDLE-9fbb2664.cjs +21 -0
  18. package/lib/{edge/USE_CLIENT_BUNDLE-42619af6.js → node/USE_CLIENT_BUNDLE-e6e77d7b.js} +203 -211
  19. package/lib/{browser/USE_SERVER_BUNDLE-ec83933e.cjs → node/USE_SERVER_BUNDLE-44095c01.cjs} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-0fe135ea.js → node/USE_SERVER_BUNDLE-c4348bf9.js} +1 -1
  21. package/lib/node/{bundle-b5555d47.cjs → bundle-3f8cf8a2.cjs} +2 -2
  22. package/lib/node/{bundle-1a5c4f3c.js → bundle-b1907ae3.js} +6 -6
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +24 -23
  25. package/package.json +1 -1
  26. package/types/cjs/constants/sdk-version.d.ts +1 -1
  27. package/types/cjs/context/index.d.ts +1 -0
  28. package/types/cjs/index-helpers/blocks-exports.d.ts +4 -0
  29. package/types/esm/constants/sdk-version.d.ts +1 -1
  30. package/types/esm/context/index.d.ts +1 -0
  31. package/types/esm/index-helpers/blocks-exports.d.ts +4 -0
  32. package/lib/browser/USE_CLIENT_BUNDLE-4cb813ce.cjs +0 -21
  33. package/lib/edge/USE_CLIENT_BUNDLE-dfe5c354.cjs +0 -21
  34. package/lib/node/USE_CLIENT_BUNDLE-7dfe38c5.cjs +0 -21
@@ -1,19 +1,19 @@
1
1
  "use client";
2
- import { jsx as a, Fragment as C, jsxs as w } from "react/jsx-runtime";
3
- import { i as X, g as _, a as U, b as $, c as E, d as P, e as Y, f as q, h as H, _ as V, j as Z, l as p, k as ee, t as te, m as D, n as ne, o as ie, r as ae, s as ce, p as re, q as le, u as oe } from "./bundle-76453d46.js";
4
- import { useRef as R, useState as y, useEffect as f, createContext as de } from "react";
5
- import { p as se } from "./USE_SERVER_BUNDLE-0fe135ea.js";
6
- import { useRouter as ue } from "next/navigation";
2
+ import { jsx as i, Fragment as E, jsxs as I } from "react/jsx-runtime";
3
+ import { i as Y, g as q, a as U, b as $, c as w, d as R, e as Z, f as H, h as _, _ as V, j as p, l as ee, k as te, t as ne, m as D, n as ie, o as ae, p as ce, r as re, s as le, q as oe, u as de } from "./bundle-f830d2ad.js";
4
+ import { useRef as T, useState as k, useEffect as f, createContext as se } from "react";
5
+ import { p as ue } from "./USE_SERVER_BUNDLE-1de84180.js";
6
+ import { useRouter as me } from "next/navigation";
7
7
  function O(e) {
8
- return /* @__PURE__ */ a(C, { children: X(e.TagName) ? /* @__PURE__ */ a(C, { children: /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ a(C, { children: typeof e.TagName == "string" ? /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
8
+ return /* @__PURE__ */ i(E, { children: Y(e.TagName) ? /* @__PURE__ */ i(E, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(E, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
9
9
  }
10
- function ve(e) {
11
- return /* @__PURE__ */ a(
10
+ function xe(e) {
11
+ return /* @__PURE__ */ i(
12
12
  O,
13
13
  {
14
14
  attributes: {
15
15
  ...e.attributes,
16
- [_()]: `${e.link ? "" : "builder-button"} ${e.attributes[_()] || ""}`,
16
+ [q()]: `${e.link ? "" : "builder-button"} ${e.attributes[q()] || ""}`,
17
17
  ...e.link ? {
18
18
  href: e.link,
19
19
  target: e.openLinkInNewTab ? "_blank" : void 0,
@@ -28,8 +28,8 @@ function ve(e) {
28
28
  }
29
29
  );
30
30
  }
31
- function xe(e) {
32
- return /* @__PURE__ */ a(
31
+ function ye(e) {
32
+ return /* @__PURE__ */ i(
33
33
  O,
34
34
  {
35
35
  TagName: e.Wrapper,
@@ -49,8 +49,8 @@ function xe(e) {
49
49
  }
50
50
  );
51
51
  }
52
- function ye(e) {
53
- return /* @__PURE__ */ a(
52
+ function ke(e) {
53
+ return /* @__PURE__ */ i(
54
54
  e.Wrapper,
55
55
  {
56
56
  ...e.wrapperProps,
@@ -71,14 +71,14 @@ function ye(e) {
71
71
  }
72
72
  );
73
73
  }
74
- function ke(e) {
75
- function c() {
74
+ function Ce(e) {
75
+ function a() {
76
76
  var r;
77
77
  return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
78
78
  }
79
- function u() {
79
+ function d() {
80
80
  var r, g;
81
- E() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
81
+ w() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
82
82
  {
83
83
  type: "builder.clickEmptyBlocks",
84
84
  data: {
@@ -91,7 +91,7 @@ function ke(e) {
91
91
  }
92
92
  function S() {
93
93
  var r, g;
94
- E() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
94
+ w() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
95
95
  {
96
96
  type: "builder.hoverEmptyBlocks",
97
97
  data: {
@@ -102,34 +102,34 @@ function ke(e) {
102
102
  "*"
103
103
  ));
104
104
  }
105
- return /* @__PURE__ */ w(C, { children: [
106
- /* @__PURE__ */ a(
105
+ return /* @__PURE__ */ I(E, { children: [
106
+ /* @__PURE__ */ i(
107
107
  e.BlocksWrapper,
108
108
  {
109
- className: c() + " props-blocks-wrapper-7cd1560e",
109
+ className: a() + " props-blocks-wrapper-7cd1560e",
110
110
  "builder-path": e.path,
111
111
  "builder-parent-id": e.parent,
112
112
  style: e.styleProp,
113
- onClick: (r) => u(),
113
+ onClick: (r) => d(),
114
114
  onMouseEnter: (r) => S(),
115
- onKeyPress: (r) => u(),
115
+ onKeyPress: (r) => d(),
116
116
  ...e.BlocksWrapperProps,
117
117
  children: e.children
118
118
  }
119
119
  ),
120
- /* @__PURE__ */ a("style", { children: `.props-blocks-wrapper-7cd1560e {
120
+ /* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-7cd1560e {
121
121
  display: flex;
122
122
  flex-direction: column;
123
123
  align-items: stretch;
124
124
  }` })
125
125
  ] });
126
126
  }
127
- function Ce(e) {
128
- return /* @__PURE__ */ a("span", { children: e.children });
129
- }
130
127
  function Ee(e) {
128
+ return /* @__PURE__ */ i("span", { children: e.children });
129
+ }
130
+ function we(e) {
131
131
  var r, g, b, h;
132
- function c() {
132
+ function a() {
133
133
  var m;
134
134
  const l = e.image || e.src;
135
135
  if (!l || // We can auto add srcset for cdn.builder.io and shopify
@@ -138,14 +138,14 @@ function Ee(e) {
138
138
  return e.srcset;
139
139
  if (e.srcset && ((m = e.image) != null && m.includes("builder.io/api/v1/image"))) {
140
140
  if (!e.srcset.includes(e.image.split("?")[0]))
141
- return console.debug("Removed given srcset"), P(l);
141
+ return console.debug("Removed given srcset"), R(l);
142
142
  } else if (e.image && !e.srcset)
143
- return P(l);
144
- return P(l);
143
+ return R(l);
144
+ return R(l);
145
145
  }
146
- function u() {
146
+ function d() {
147
147
  var s;
148
- return (s = c == null ? void 0 : c()) != null && s.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
148
+ return (s = a == null ? void 0 : a()) != null && s.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
149
149
  }
150
150
  function S() {
151
151
  const s = {
@@ -157,11 +157,11 @@ function Ee(e) {
157
157
  };
158
158
  return e.aspectRatio ? s : void 0;
159
159
  }
160
- return /* @__PURE__ */ w(C, { children: [
161
- /* @__PURE__ */ w(C, { children: [
162
- /* @__PURE__ */ w("picture", { children: [
163
- u() ? /* @__PURE__ */ a("source", { type: "image/webp", srcSet: u() }) : null,
164
- /* @__PURE__ */ a(
160
+ return /* @__PURE__ */ I(E, { children: [
161
+ /* @__PURE__ */ I(E, { children: [
162
+ /* @__PURE__ */ I("picture", { children: [
163
+ d() ? /* @__PURE__ */ i("source", { type: "image/webp", srcSet: d() }) : null,
164
+ /* @__PURE__ */ i(
165
165
  "img",
166
166
  {
167
167
  loading: "lazy",
@@ -174,12 +174,12 @@ function Ee(e) {
174
174
  },
175
175
  className: "builder-image" + (e.className ? " " + e.className : "") + " img-a0c95e8c",
176
176
  src: e.image,
177
- srcSet: c(),
177
+ srcSet: a(),
178
178
  sizes: e.sizes
179
179
  }
180
180
  )
181
181
  ] }),
182
- e.aspectRatio && !((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length && e.fitContent) ? /* @__PURE__ */ a(
182
+ e.aspectRatio && !((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length && e.fitContent) ? /* @__PURE__ */ i(
183
183
  "div",
184
184
  {
185
185
  className: "builder-image-sizer div-a0c95e8c",
@@ -188,10 +188,10 @@ function Ee(e) {
188
188
  }
189
189
  }
190
190
  ) : null,
191
- (h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ a(C, { children: e.children }) : null,
192
- !e.fitContent && e.children ? /* @__PURE__ */ a("div", { className: "div-a0c95e8c-2", children: e.children }) : null
191
+ (h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ i(E, { children: e.children }) : null,
192
+ !e.fitContent && e.children ? /* @__PURE__ */ i("div", { className: "div-a0c95e8c-2", children: e.children }) : null
193
193
  ] }),
194
- /* @__PURE__ */ a("style", { children: `.img-a0c95e8c {
194
+ /* @__PURE__ */ i("style", { children: `.img-a0c95e8c {
195
195
  opacity: 1;
196
196
  transition: opacity 0.2s ease-in-out;
197
197
  }.div-a0c95e8c {
@@ -210,8 +210,8 @@ function Ee(e) {
210
210
  }` })
211
211
  ] });
212
212
  }
213
- function we(e) {
214
- return /* @__PURE__ */ a(
213
+ function Ie(e) {
214
+ return /* @__PURE__ */ i(
215
215
  "section",
216
216
  {
217
217
  ...e.attributes,
@@ -231,19 +231,19 @@ function we(e) {
231
231
  }
232
232
  );
233
233
  }
234
- function Ie(e) {
235
- const c = R(null), [u, S] = y(() => []), [r, g] = y(() => []);
234
+ function Pe(e) {
235
+ const a = T(null), [d, S] = k(() => []), [r, g] = k(() => []);
236
236
  return f(() => {
237
237
  var h;
238
- if (!((h = c.current) != null && h.getElementsByTagName) || typeof window > "u")
238
+ if (!((h = a.current) != null && h.getElementsByTagName) || typeof window > "u")
239
239
  return;
240
- const b = c.current.getElementsByTagName("script");
240
+ const b = a.current.getElementsByTagName("script");
241
241
  for (let s = 0; s < b.length; s++) {
242
242
  const l = b[s];
243
243
  if (l.src) {
244
- if (u.includes(l.src))
244
+ if (d.includes(l.src))
245
245
  continue;
246
- u.push(l.src);
246
+ d.push(l.src);
247
247
  const m = document.createElement("script");
248
248
  m.async = !0, m.src = l.src, document.head.appendChild(m);
249
249
  } else if (!l.type || [
@@ -260,48 +260,48 @@ function Ie(e) {
260
260
  }
261
261
  }
262
262
  }
263
- }, []), /* @__PURE__ */ a(
263
+ }, []), /* @__PURE__ */ i(
264
264
  "div",
265
265
  {
266
- ref: c,
266
+ ref: a,
267
267
  className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
268
268
  dangerouslySetInnerHTML: { __html: e.code }
269
269
  }
270
270
  );
271
271
  }
272
- function Pe(e) {
273
- const c = R(null), [u, S] = y(() => []), [r, g] = y(() => []), [b, h] = y(() => !1);
272
+ function Re(e) {
273
+ const a = T(null), [d, S] = k(() => []), [r, g] = k(() => []), [b, h] = k(() => !1);
274
274
  function s() {
275
- if (!c.current || !c.current.getElementsByTagName)
275
+ if (!a.current || !a.current.getElementsByTagName)
276
276
  return;
277
- const l = c.current.getElementsByTagName("script");
277
+ const l = a.current.getElementsByTagName("script");
278
278
  for (let m = 0; m < l.length; m++) {
279
- const x = l[m];
280
- if (x.src && !u.includes(x.src)) {
281
- u.push(x.src);
282
- const k = document.createElement("script");
283
- k.async = !0, k.src = x.src, document.head.appendChild(k);
284
- } else if (Y(x) && !r.includes(x.innerText))
279
+ const v = l[m];
280
+ if (v.src && !d.includes(v.src)) {
281
+ d.push(v.src);
282
+ const C = document.createElement("script");
283
+ C.async = !0, C.src = v.src, document.head.appendChild(C);
284
+ } else if (Z(v) && !r.includes(v.innerText))
285
285
  try {
286
- r.push(x.innerText), new Function(x.innerText)();
287
- } catch (k) {
288
- console.warn("`Embed`: Error running script:", k);
286
+ r.push(v.innerText), new Function(v.innerText)();
287
+ } catch (C) {
288
+ console.warn("`Embed`: Error running script:", C);
289
289
  }
290
290
  }
291
291
  }
292
292
  return f(() => {
293
- c.current && !b && (h(!0), s());
294
- }, [c.current, b]), /* @__PURE__ */ a(
293
+ a.current && !b && (h(!0), s());
294
+ }, [a.current, b]), /* @__PURE__ */ i(
295
295
  "div",
296
296
  {
297
297
  className: "builder-embed",
298
- ref: c,
298
+ ref: a,
299
299
  dangerouslySetInnerHTML: { __html: e.content }
300
300
  }
301
301
  );
302
302
  }
303
- function Re(e) {
304
- return /* @__PURE__ */ a(
303
+ function Te(e) {
304
+ return /* @__PURE__ */ i(
305
305
  "img",
306
306
  {
307
307
  style: {
@@ -312,12 +312,12 @@ function Re(e) {
312
312
  src: e.imgSrc || e.image,
313
313
  ...e.attributes
314
314
  },
315
- E() && e.imgSrc || "default-key"
315
+ w() && e.imgSrc || "default-key"
316
316
  );
317
317
  }
318
- function Te(e) {
318
+ function Ne(e) {
319
319
  var S, r, g, b, h, s, l;
320
- function c() {
320
+ function a() {
321
321
  return {
322
322
  ...e.autoPlay === !0 ? {
323
323
  autoPlay: !0
@@ -336,23 +336,23 @@ function Te(e) {
336
336
  } : {}
337
337
  };
338
338
  }
339
- function u() {
339
+ function d() {
340
340
  return {
341
- ...c()
341
+ ...a()
342
342
  };
343
343
  }
344
- return /* @__PURE__ */ w(
344
+ return /* @__PURE__ */ I(
345
345
  "div",
346
346
  {
347
347
  style: {
348
348
  position: "relative"
349
349
  },
350
350
  children: [
351
- /* @__PURE__ */ a(
351
+ /* @__PURE__ */ i(
352
352
  "video",
353
353
  {
354
354
  className: "builder-video",
355
- ...u(),
355
+ ...d(),
356
356
  preload: e.preload || "metadata",
357
357
  style: {
358
358
  width: "100%",
@@ -370,10 +370,10 @@ function Te(e) {
370
370
  },
371
371
  src: e.video || "no-src",
372
372
  poster: e.posterImage,
373
- children: e.lazyLoad ? null : /* @__PURE__ */ a("source", { type: "video/mp4", src: e.video })
373
+ children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
374
374
  }
375
375
  ),
376
- e.aspectRatio && !(e.fitContent && ((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length)) ? /* @__PURE__ */ a(
376
+ e.aspectRatio && !(e.fitContent && ((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length)) ? /* @__PURE__ */ i(
377
377
  "div",
378
378
  {
379
379
  style: {
@@ -384,7 +384,7 @@ function Te(e) {
384
384
  }
385
385
  }
386
386
  ) : null,
387
- (h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ a(
387
+ (h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ i(
388
388
  "div",
389
389
  {
390
390
  style: {
@@ -395,7 +395,7 @@ function Te(e) {
395
395
  children: e.children
396
396
  }
397
397
  ) : null,
398
- (l = (s = e.builderBlock) == null ? void 0 : s.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ a(
398
+ (l = (s = e.builderBlock) == null ? void 0 : s.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ i(
399
399
  "div",
400
400
  {
401
401
  style: {
@@ -416,7 +416,7 @@ function Te(e) {
416
416
  }
417
417
  );
418
418
  }
419
- const me = de({
419
+ const ge = se({
420
420
  content: null,
421
421
  context: {},
422
422
  localState: void 0,
@@ -430,58 +430,58 @@ const me = de({
430
430
  BlocksWrapper: "div",
431
431
  BlocksWrapperProps: {}
432
432
  });
433
- function Ne(e) {
434
- var L, j, W, K, A, F, z;
435
- const c = R(null);
436
- function u(n) {
437
- var i, o;
433
+ function Be(e) {
434
+ var j, W, K, A, F, z, M;
435
+ const a = T(null);
436
+ function d(n) {
437
+ var o, c;
438
438
  const t = {
439
439
  ...e.builderContextSignal.rootState,
440
440
  ...n
441
441
  };
442
- e.builderContextSignal.rootSetState ? (o = (i = e.builderContextSignal).rootSetState) == null || o.call(i, t) : e.builderContextSignal.rootState = t;
442
+ e.builderContextSignal.rootSetState ? (c = (o = e.builderContextSignal).rootSetState) == null || c.call(o, t) : e.builderContextSignal.rootState = t;
443
443
  }
444
444
  function S(n) {
445
- var i, o, d, v, M;
445
+ var o, c, u, x, y;
446
446
  const t = {
447
447
  ...e.builderContextSignal.content,
448
448
  ...n,
449
449
  data: {
450
- ...(i = e.builderContextSignal.content) == null ? void 0 : i.data,
450
+ ...(o = e.builderContextSignal.content) == null ? void 0 : o.data,
451
451
  ...n == null ? void 0 : n.data
452
452
  },
453
453
  meta: {
454
- ...(o = e.builderContextSignal.content) == null ? void 0 : o.meta,
454
+ ...(c = e.builderContextSignal.content) == null ? void 0 : c.meta,
455
455
  ...n == null ? void 0 : n.meta,
456
- breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((M = (v = e.builderContextSignal.content) == null ? void 0 : v.meta) == null ? void 0 : M.breakpoints)
456
+ breakpoints: ((u = n == null ? void 0 : n.meta) == null ? void 0 : u.breakpoints) || ((y = (x = e.builderContextSignal.content) == null ? void 0 : x.meta) == null ? void 0 : y.breakpoints)
457
457
  }
458
458
  };
459
- se({
459
+ ue({
460
460
  value: t,
461
461
  key: t.id
462
462
  }).then(() => {
463
463
  Q.refresh();
464
464
  });
465
465
  }
466
- const [r, g] = y(
466
+ const [r, g] = k(
467
467
  () => e.contentWrapper || "div"
468
468
  );
469
469
  function b(n) {
470
- return ee({
470
+ return te({
471
471
  model: e.model,
472
472
  trustedHosts: e.trustedHosts,
473
473
  callbacks: {
474
474
  configureSdk: (t) => {
475
- var d;
476
- const { breakpoints: i, contentId: o } = t;
477
- !o || o !== ((d = e.builderContextSignal.content) == null ? void 0 : d.id) || i && S({
475
+ var u;
476
+ const { breakpoints: o, contentId: c } = t;
477
+ !c || c !== ((u = e.builderContextSignal.content) == null ? void 0 : u.id) || o && S({
478
478
  meta: {
479
- breakpoints: i
479
+ breakpoints: o
480
480
  }
481
481
  });
482
482
  },
483
483
  animation: (t) => {
484
- te(t);
484
+ ne(t);
485
485
  },
486
486
  contentUpdate: (t) => {
487
487
  S(t);
@@ -490,8 +490,8 @@ function Ne(e) {
490
490
  })(n);
491
491
  }
492
492
  function h() {
493
- var t, i;
494
- const n = (i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.jsCode;
493
+ var t, o;
494
+ const n = (o = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : o.jsCode;
495
495
  n && D({
496
496
  code: n,
497
497
  context: e.context || {},
@@ -504,70 +504,61 @@ function Ne(e) {
504
504
  enableCache: !1
505
505
  });
506
506
  }
507
- const [s, l] = y(() => ({})), [m, x] = y(() => !1);
508
- function k(n) {
509
- var t, i;
507
+ const [s, l] = k(() => ({})), [m, v] = k(() => ({})), [C, J] = k(() => !1);
508
+ function G(n) {
509
+ var t, o;
510
510
  if (e.builderContextSignal.content) {
511
- const o = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
511
+ const c = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, u = (o = e.builderContextSignal.content) == null ? void 0 : o.id;
512
512
  V({
513
513
  type: "click",
514
- canTrack: H(e.canTrack),
515
- contentId: d,
514
+ canTrack: _(e.canTrack),
515
+ contentId: u,
516
516
  apiKey: e.apiKey,
517
- variationId: o !== d ? o : void 0,
518
- ...ne(n),
519
- unique: !m
517
+ variationId: c !== u ? c : void 0,
518
+ ...ie(n),
519
+ unique: !C
520
520
  });
521
521
  }
522
- m || x(!0);
523
- }
524
- function J(n) {
525
- return n.replace(
526
- /{{([^}]+)}}/g,
527
- (t, i) => String(
528
- D({
529
- code: i,
530
- context: e.context || {},
531
- localState: void 0,
532
- rootState: e.builderContextSignal.rootState,
533
- rootSetState: e.builderContextSignal.rootSetState,
534
- enableCache: !0
535
- })
536
- )
537
- );
538
- }
539
- function G({ url: n, key: t }) {
540
- oe(n).then((i) => i.json()).then((i) => {
541
- var d, v;
542
- const o = {
543
- ...e.builderContextSignal.rootState,
544
- [t]: i
545
- };
546
- (v = (d = e.builderContextSignal).rootSetState) == null || v.call(d, o), s[t] = !0;
547
- }).catch((i) => {
548
- console.error("error fetching dynamic data", n, i);
549
- });
522
+ C || J(!0);
550
523
  }
551
- function T() {
552
- var t, i;
553
- const n = ((i = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : i.httpRequests) ?? {};
554
- Object.entries(n).forEach(([o, d]) => {
555
- if (d && (!s[o] || E())) {
556
- const v = J(d);
557
- G({
558
- url: v,
559
- key: o
560
- });
561
- }
524
+ function N() {
525
+ var t, o;
526
+ const n = ((o = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : o.httpRequests) ?? {};
527
+ Object.entries(n).forEach(([c, u]) => {
528
+ if (!u || m[c] || s[c] && !w())
529
+ return;
530
+ m[c] = !0;
531
+ const x = u.replace(
532
+ /{{([^}]+)}}/g,
533
+ (y, X) => String(
534
+ D({
535
+ code: X,
536
+ context: e.context || {},
537
+ localState: void 0,
538
+ rootState: e.builderContextSignal.rootState,
539
+ rootSetState: e.builderContextSignal.rootSetState,
540
+ enableCache: !0
541
+ })
542
+ )
543
+ );
544
+ ae(x).then((y) => y.json()).then((y) => {
545
+ d({
546
+ [c]: y
547
+ }), s[c] = !0;
548
+ }).catch((y) => {
549
+ console.error("error fetching dynamic data", u, y);
550
+ }).finally(() => {
551
+ m[c] = !1;
552
+ });
562
553
  });
563
554
  }
564
- function I() {
565
- E() && window.dispatchEvent(
555
+ function P() {
556
+ w() && window.dispatchEvent(
566
557
  new CustomEvent(
567
558
  "builder:component:stateChange",
568
559
  {
569
560
  detail: {
570
- state: ie(e.builderContextSignal.rootState),
561
+ state: ce(e.builderContextSignal.rootState),
571
562
  ref: {
572
563
  name: e.model
573
564
  }
@@ -576,8 +567,8 @@ function Ne(e) {
576
567
  )
577
568
  );
578
569
  }
579
- function N(n) {
580
- window.addEventListener("message", b), ae(), ce({
570
+ function B(n) {
571
+ window.addEventListener("message", b), re(), le({
581
572
  ...e.locale ? {
582
573
  locale: e.locale
583
574
  } : {},
@@ -590,117 +581,118 @@ function Ne(e) {
590
581
  }), Object.values(
591
582
  e.builderContextSignal.componentInfos
592
583
  ).forEach((t) => {
593
- var o;
594
- const i = re(t);
595
- (o = window.parent) == null || o.postMessage(i, "*");
584
+ var c;
585
+ const o = oe(t);
586
+ (c = window.parent) == null || c.postMessage(o, "*");
596
587
  }), window.addEventListener(
597
588
  "builder:component:stateChangeListenerActivated",
598
- I
589
+ P
599
590
  );
600
591
  }
601
- function B(n) {
602
- const t = new URL(location.href).searchParams, i = t.get("builder.preview"), o = t.get(
603
- `builder.preview.${i}`
604
- ), d = t.get("apiKey") || t.get("builder.space");
605
- i === e.model && d === e.apiKey && (!e.content || o === e.content.id) && le({
592
+ function L(n) {
593
+ const t = new URL(location.href).searchParams, o = t.get("builder.preview"), c = t.get(
594
+ `builder.preview.${o}`
595
+ ), u = t.get("apiKey") || t.get("builder.space");
596
+ o === e.model && u === e.apiKey && (!e.content || c === e.content.id) && de({
606
597
  model: e.model,
607
598
  apiKey: e.apiKey,
608
599
  apiVersion: e.builderContextSignal.apiVersion
609
- }).then((v) => {
610
- v && S(v);
600
+ }).then((x) => {
601
+ x && S(x);
611
602
  });
612
603
  }
613
- const Q = ue();
604
+ const Q = me();
614
605
  return f(() => {
615
606
  var n;
616
- return (n = c.current) == null || n.addEventListener(
607
+ return (n = a.current) == null || n.addEventListener(
617
608
  "initeditingbldr",
618
- N
609
+ B
619
610
  ), () => {
620
611
  var t;
621
- return (t = c.current) == null ? void 0 : t.removeEventListener(
612
+ return (t = a.current) == null ? void 0 : t.removeEventListener(
622
613
  "initeditingbldr",
623
- N
614
+ B
624
615
  );
625
616
  };
626
617
  }, []), f(() => {
627
618
  var n;
628
- return (n = c.current) == null || n.addEventListener(
619
+ return (n = a.current) == null || n.addEventListener(
629
620
  "initpreviewingbldr",
630
- B
621
+ L
631
622
  ), () => {
632
623
  var t;
633
- return (t = c.current) == null ? void 0 : t.removeEventListener(
624
+ return (t = a.current) == null ? void 0 : t.removeEventListener(
634
625
  "initpreviewingbldr",
635
- B
626
+ L
636
627
  );
637
628
  };
638
629
  }, []), f(() => {
639
630
  var n, t;
640
- if (q()) {
641
- if (E() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && H(e.canTrack)) {
642
- const o = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (t = e.builderContextSignal.content) == null ? void 0 : t.id, v = e.apiKey;
631
+ if (H()) {
632
+ if (w() && a.current && a.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && _(e.canTrack)) {
633
+ const c = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, u = (t = e.builderContextSignal.content) == null ? void 0 : t.id, x = e.apiKey;
643
634
  V({
644
635
  type: "impression",
645
636
  canTrack: !0,
646
- contentId: d,
647
- apiKey: v,
648
- variationId: o !== d ? o : void 0
637
+ contentId: u,
638
+ apiKey: x,
639
+ variationId: c !== u ? c : void 0
649
640
  });
650
641
  }
651
- Z();
642
+ p();
652
643
  }
653
644
  }, []), f(() => {
654
- e.apiKey || p.error(
645
+ e.apiKey || ee.error(
655
646
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
656
- ), h(), T(), I();
647
+ ), h(), N(), P();
657
648
  }, []), f(() => {
658
649
  }, [e.content]), f(() => {
659
650
  h();
660
- }, [(j = (L = e.builderContextSignal.content) == null ? void 0 : L.data) == null ? void 0 : j.jsCode]), f(() => {
661
- T();
662
- }, [(K = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : K.httpRequests]), f(() => {
663
- I();
651
+ }, [(W = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : W.jsCode]), f(() => {
652
+ N();
653
+ }, [(A = (K = e.builderContextSignal.content) == null ? void 0 : K.data) == null ? void 0 : A.httpRequests]), f(() => {
654
+ P();
664
655
  }, [e.builderContextSignal.rootState]), f(() => {
665
- e.data && u(e.data);
656
+ e.data && d(e.data);
666
657
  }, [e.data]), f(() => {
667
- e.locale && u({
658
+ e.locale && d({
668
659
  locale: e.locale
669
660
  });
670
661
  }, [e.locale]), f(() => () => {
671
- q() && (window.removeEventListener("message", b), window.removeEventListener(
662
+ H() && (window.removeEventListener("message", b), window.removeEventListener(
672
663
  "builder:component:stateChangeListenerActivated",
673
- I
664
+ P
674
665
  ));
675
- }, []), /* @__PURE__ */ a(me.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ a(
666
+ }, []), /* @__PURE__ */ i(ge.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(
676
667
  r,
677
668
  {
678
- ref: c,
679
- onClick: (n) => k(n),
680
- "builder-content-id": (A = e.builderContextSignal.content) == null ? void 0 : A.id,
669
+ ref: a,
670
+ onClick: (n) => G(n),
671
+ "builder-content-id": (F = e.builderContextSignal.content) == null ? void 0 : F.id,
681
672
  "builder-model": e.model,
682
673
  ...e.showContent ? {} : {
683
674
  hidden: !0,
684
675
  "aria-hidden": !0
685
676
  },
686
677
  ...e.contentWrapperProps,
687
- className: `variant-${((F = e.content) == null ? void 0 : F.testVariationId) || ((z = e.content) == null ? void 0 : z.id)}`,
678
+ className: `variant-${((z = e.content) == null ? void 0 : z.testVariationId) || ((M = e.content) == null ? void 0 : M.id)}`,
688
679
  children: e.children
689
680
  }
690
681
  ) : null });
691
682
  }
692
683
  export {
693
- xe as B,
694
- Ie as C,
684
+ ye as B,
685
+ Pe as C,
695
686
  O as D,
696
- Pe as E,
697
- Ce as F,
698
- ye as I,
699
- we as S,
700
- Te as V,
701
- ke as a,
702
- Re as b,
703
- ve as c,
704
- Ee as d,
705
- Ne as e
687
+ Re as E,
688
+ Ee as F,
689
+ ke as I,
690
+ Ie as S,
691
+ Ne as V,
692
+ Ce as a,
693
+ Te as b,
694
+ xe as c,
695
+ we as d,
696
+ Be as e,
697
+ ge as f
706
698
  };