@builder.io/sdk-react-nextjs 0.14.8 → 0.14.9

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