@builder.io/sdk-react 1.0.33 → 1.0.36

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 +21 -21
  2. package/lib/browser/blocks-exports.mjs +235 -178
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/init.cjs +6 -6
  6. package/lib/browser/init.mjs +29 -19
  7. package/lib/browser/{server-entry-4f020128.cjs → server-entry-4168b816.cjs} +1 -1
  8. package/lib/browser/{server-entry-08c4885b.js → server-entry-b8f6be3b.js} +1 -1
  9. package/lib/browser/server-entry.cjs +1 -1
  10. package/lib/browser/server-entry.mjs +1 -1
  11. package/lib/edge/{accordion-e8a4e00c.js → accordion-18fbb30e.js} +1 -1
  12. package/lib/edge/{accordion-117938d4.cjs → accordion-e40979bc.cjs} +1 -1
  13. package/lib/edge/{blocks-70c83f76.cjs → blocks-48a9ac8c.cjs} +1 -1
  14. package/lib/edge/{blocks-f8c6cd3a.js → blocks-9b142e90.js} +2 -2
  15. package/lib/edge/blocks-exports.cjs +1 -1
  16. package/lib/edge/blocks-exports.mjs +2 -2
  17. package/lib/edge/{button-9224e694.js → button-be9403e7.js} +2 -2
  18. package/lib/edge/{button-b84a0300.cjs → button-c2ff97e9.cjs} +1 -1
  19. package/lib/edge/{columns-bf1789b2.cjs → columns-118e1fc1.cjs} +1 -1
  20. package/lib/edge/{columns-05800a70.js → columns-920ca800.js} +3 -3
  21. package/lib/edge/content-variants-1eb4aebc.cjs +134 -0
  22. package/lib/edge/{content-variants-1af57e7c.js → content-variants-ed1f803b.js} +145 -103
  23. package/lib/edge/{form-4248a74f.cjs → form-a9271b51.cjs} +1 -1
  24. package/lib/edge/{form-ba414b86.js → form-cbcf22d5.js} +3 -3
  25. package/lib/edge/{get-class-prop-name-f1303c26.js → get-class-prop-name-90c8ac6c.js} +1 -1
  26. package/lib/edge/{get-class-prop-name-99284ed1.cjs → get-class-prop-name-af6b922f.cjs} +1 -1
  27. package/lib/edge/{img-3b5f766a.js → img-1f1b4871.js} +1 -1
  28. package/lib/edge/{img-f51fc48b.cjs → img-2deeb066.cjs} +1 -1
  29. package/lib/edge/index.cjs +1 -1
  30. package/lib/edge/index.mjs +1 -1
  31. package/lib/edge/init.cjs +6 -6
  32. package/lib/edge/init.mjs +29 -19
  33. package/lib/edge/{input-9d5bca5c.cjs → input-4b3e5f88.cjs} +1 -1
  34. package/lib/edge/{input-f86d1318.js → input-514915f8.js} +1 -1
  35. package/lib/edge/{select-a97e4cbf.js → select-3925e227.js} +5 -4
  36. package/lib/edge/select-82d8052d.cjs +1 -0
  37. package/lib/edge/{server-entry-62d41eae.js → server-entry-57fedeba.js} +1 -1
  38. package/lib/edge/{server-entry-13d68dab.cjs → server-entry-a00fcff8.cjs} +1 -1
  39. package/lib/edge/server-entry.cjs +1 -1
  40. package/lib/edge/server-entry.mjs +1 -1
  41. package/lib/edge/{slot-d4ca9e65.cjs → slot-21fe373f.cjs} +1 -1
  42. package/lib/edge/{slot-fdb4dd68.js → slot-aa7280f8.js} +3 -3
  43. package/lib/edge/{symbol-b620691d.cjs → symbol-a0ab57ea.cjs} +1 -1
  44. package/lib/edge/{symbol-c31603d4.js → symbol-ac48d2ec.js} +2 -2
  45. package/lib/edge/{tabs-c5bedc43.js → tabs-9b5261d0.js} +3 -3
  46. package/lib/edge/{tabs-b442e021.cjs → tabs-df436d1e.cjs} +1 -1
  47. package/lib/edge/textarea-56a875bc.cjs +1 -0
  48. package/lib/edge/textarea-d29025e9.js +17 -0
  49. package/lib/node/blocks-exports.cjs +21 -21
  50. package/lib/node/blocks-exports.mjs +209 -152
  51. package/lib/node/index.cjs +1 -1
  52. package/lib/node/index.mjs +2 -2
  53. package/lib/node/init.cjs +1 -1
  54. package/lib/node/init.mjs +2 -2
  55. package/lib/node/{node-runtime-51136426.js → node-runtime-1b85663b.js} +51 -41
  56. package/lib/node/node-runtime-d59eb154.cjs +48 -0
  57. package/lib/node/{server-entry-0b4ba9e5.js → server-entry-8081c6b9.js} +1 -1
  58. package/lib/node/{server-entry-84150423.cjs → server-entry-dc1afebd.cjs} +1 -1
  59. package/lib/node/server-entry.cjs +1 -1
  60. package/lib/node/server-entry.mjs +1 -1
  61. package/package.json +1 -2
  62. package/types/blocks/form/select/select.d.ts +1 -0
  63. package/types/blocks/form/textarea/component-info.d.ts +2 -0
  64. package/types/blocks/{textarea → form/textarea}/textarea.d.ts +1 -0
  65. package/types/constants/sdk-name.d.ts +1 -0
  66. package/types/constants/sdk-version.d.ts +1 -1
  67. package/types/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +2 -0
  68. package/types/functions/extract-css-var-default-value.d.ts +1 -0
  69. package/lib/edge/content-variants-33e7bcbf.cjs +0 -134
  70. package/lib/edge/select-02b2c006.cjs +0 -1
  71. package/lib/node/node-runtime-1f5f0f86.cjs +0 -48
  72. package/types/blocks/textarea/component-info.d.ts +0 -2
  73. /package/types/blocks/{textarea → form/textarea}/index.d.ts +0 -0
@@ -1,9 +1,9 @@
1
1
  import { jsx as f, jsxs as $, Fragment as z } from "react/jsx-runtime";
2
- import { lazy as T, useRef as le, useState as k, useEffect as S } from "react";
3
- import { isBrowser as H, TARGET as te, isEditing as F, registerInsertMenu as se, setupBrowserForEditing as de, createRegisterComponentMessage as ce, getDefaultCanTrack as A, _track as J, isPreviewing as ue, fetchOneEntry as me, logger as pe, createEditorListener as ge, fetch as fe, fastClone as he, serializeComponentInfo as Y, handleABTestingSync as be } from "./server-entry-62d41eae.js";
2
+ import { lazy as y, useRef as le, useState as k, useEffect as T } from "react";
3
+ import { isBrowser as H, TARGET as te, isEditing as F, registerInsertMenu as se, setupBrowserForEditing as de, createRegisterComponentMessage as ce, getDefaultCanTrack as A, _track as J, isPreviewing as ue, fetchOneEntry as me, logger as pe, createEditorListener as ge, fetch as fe, fastClone as he, serializeComponentInfo as Y, handleABTestingSync as be } from "./server-entry-57fedeba.js";
4
4
  import { Video as ye, Button as xe, Columns as ve, Fragment as Se, Image as Te, Section as Ie, Symbol as ke, Text as Ce, BuilderContext as we } from "./blocks-exports.mjs";
5
- import { triggerAnimation as Ve, evaluate as Q, InlinedStyles as ne, ComponentsContext as Re, Blocks as Ee } from "./blocks-f8c6cd3a.js";
6
- import "./get-class-prop-name-f1303c26.js";
5
+ import { triggerAnimation as Ve, evaluate as Q, InlinedStyles as ne, ComponentsContext as Re, Blocks as Ee } from "./blocks-9b142e90.js";
6
+ import "./get-class-prop-name-90c8ac6c.js";
7
7
  import "./dynamic-renderer-8b343325.js";
8
8
  const P = {
9
9
  "@type": "@builder.io/sdk:Element",
@@ -123,7 +123,7 @@ const P = {
123
123
  e.get("useChildrenForItems") === !0 && e.set("items", []);
124
124
  }
125
125
  }]
126
- }, We = T(() => import("./accordion-e8a4e00c.js")), Ae = {
126
+ }, We = y(() => import("./accordion-18fbb30e.js")), Ae = {
127
127
  name: "Core:Button",
128
128
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
129
129
  defaultStyles: {
@@ -378,7 +378,7 @@ const P = {
378
378
  name: "image",
379
379
  type: "file",
380
380
  bubble: !0,
381
- allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
381
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg", "webp"],
382
382
  required: !0,
383
383
  defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
384
384
  onChange: (e) => {
@@ -520,7 +520,7 @@ const P = {
520
520
  required: !0,
521
521
  defaultValue: "children"
522
522
  }]
523
- }, He = T(() => import("./slot-fdb4dd68.js")), Ne = {
523
+ }, He = y(() => import("./slot-aa7280f8.js")), Be = {
524
524
  name: "Symbol",
525
525
  noWrap: !0,
526
526
  static: !0,
@@ -591,7 +591,7 @@ const P = {
591
591
  text: "New tab content "
592
592
  }
593
593
  }
594
- }, Be = {
594
+ }, Ne = {
595
595
  name: "Builder: Tabs",
596
596
  inputs: [{
597
597
  name: "tabs",
@@ -688,7 +688,7 @@ const P = {
688
688
  value: "flex-end"
689
689
  }]
690
690
  }]
691
- }, je = T(() => import("./tabs-c5bedc43.js")), qe = {
691
+ }, qe = y(() => import("./tabs-9b5261d0.js")), je = {
692
692
  name: "Text",
693
693
  static: !0,
694
694
  isRSC: !0,
@@ -728,7 +728,7 @@ const P = {
728
728
  helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
729
729
  advanced: !0
730
730
  }]
731
- }, Me = T(() => import("./custom-code-7786788e.js")), Oe = {
731
+ }, Me = y(() => import("./custom-code-7786788e.js")), _e = {
732
732
  name: "Embed",
733
733
  static: !0,
734
734
  inputs: [{
@@ -739,13 +739,16 @@ const P = {
739
739
  helperText: "e.g. enter a youtube url, google map, etc",
740
740
  onChange: (e) => {
741
741
  const t = e.get("url");
742
- if (t)
743
- return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((a) => a.json()).then((a) => {
742
+ if (t) {
743
+ e.set("content", "Loading...");
744
+ const n = _iframelyApiKey;
745
+ return fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=${n}`).then((a) => a.json()).then((a) => {
744
746
  e.get("url") === t && (a.html ? e.set("content", a.html) : e.set("content", "Invalid url, please try another"));
745
747
  }).catch((a) => {
746
748
  e.set("content", "There was an error embedding this URL, please try again or another URL");
747
749
  });
748
- e.delete("content");
750
+ } else
751
+ e.delete("content");
749
752
  }
750
753
  }, {
751
754
  name: "content",
@@ -753,7 +756,7 @@ const P = {
753
756
  defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
754
757
  hideFromUI: !0
755
758
  }]
756
- }, _e = T(() => import("./embed-5c1bbe12.js")), ze = {
759
+ }, Oe = y(() => import("./embed-5c1bbe12.js")), ze = {
757
760
  name: "Form:Form",
758
761
  // editableTags: ['builder-form-error']
759
762
  defaults: {
@@ -984,7 +987,7 @@ const P = {
984
987
  }
985
988
  }
986
989
  }]
987
- }, Je = T(() => import("./form-ba414b86.js")), Ye = {
990
+ }, Je = y(() => import("./form-cbcf22d5.js")), Ye = {
988
991
  name: "Form:Input",
989
992
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
990
993
  inputs: [
@@ -1035,7 +1038,7 @@ const P = {
1035
1038
  borderStyle: "solid",
1036
1039
  borderColor: "#ccc"
1037
1040
  }
1038
- }, Qe = T(() => import("./input-f86d1318.js")), Ge = {
1041
+ }, Qe = y(() => import("./input-514915f8.js")), Ge = {
1039
1042
  name: "Form:Select",
1040
1043
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
1041
1044
  defaultStyles: {
@@ -1077,7 +1080,7 @@ const P = {
1077
1080
  }],
1078
1081
  static: !0,
1079
1082
  noWrap: !0
1080
- }, Xe = T(() => import("./select-a97e4cbf.js")), Ze = {
1083
+ }, Xe = y(() => import("./select-3925e227.js")), Ze = {
1081
1084
  name: "Form:SubmitButton",
1082
1085
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
1083
1086
  defaultStyles: {
@@ -1102,7 +1105,43 @@ const P = {
1102
1105
  // that only shows if advanced setting is flipped
1103
1106
  // TODO: defaultChildren
1104
1107
  // canHaveChildren: true,
1105
- }, et = T(() => import("./submit-button-b48361a7.js")), tt = {
1108
+ }, et = y(() => import("./submit-button-b48361a7.js")), tt = {
1109
+ name: "Form:TextArea",
1110
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
1111
+ inputs: [{
1112
+ advanced: !0,
1113
+ name: "value",
1114
+ type: "string"
1115
+ }, {
1116
+ name: "name",
1117
+ type: "string",
1118
+ required: !0,
1119
+ helperText: 'Every input in a form needs a unique name describing what it gets, e.g. "email"'
1120
+ }, {
1121
+ name: "defaultValue",
1122
+ type: "string"
1123
+ }, {
1124
+ name: "placeholder",
1125
+ type: "string",
1126
+ defaultValue: "Hello there"
1127
+ }, {
1128
+ name: "required",
1129
+ type: "boolean",
1130
+ defaultValue: !1
1131
+ }],
1132
+ defaultStyles: {
1133
+ paddingTop: "10px",
1134
+ paddingBottom: "10px",
1135
+ paddingLeft: "10px",
1136
+ paddingRight: "10px",
1137
+ borderRadius: "3px",
1138
+ borderWidth: "1px",
1139
+ borderStyle: "solid",
1140
+ borderColor: "#ccc"
1141
+ },
1142
+ static: !0,
1143
+ noWrap: !0
1144
+ }, nt = y(() => import("./textarea-d29025e9.js")), at = {
1106
1145
  // friendlyName?
1107
1146
  name: "Raw:Img",
1108
1147
  hideFromInsertMenu: !0,
@@ -1116,7 +1155,7 @@ const P = {
1116
1155
  }],
1117
1156
  noWrap: !0,
1118
1157
  static: !0
1119
- }, nt = T(() => import("./img-3b5f766a.js")), at = {
1158
+ }, it = y(() => import("./img-1f1b4871.js")), ot = {
1120
1159
  name: "Video",
1121
1160
  canHaveChildren: !0,
1122
1161
  defaultStyles: {
@@ -1197,12 +1236,12 @@ const P = {
1197
1236
  defaultValue: !0,
1198
1237
  advanced: !0
1199
1238
  }]
1200
- }, it = () => [{
1239
+ }, rt = () => [{
1201
1240
  component: Me,
1202
1241
  ...Ke
1203
1242
  }, {
1204
- component: _e,
1205
- ...Oe
1243
+ component: Oe,
1244
+ ..._e
1206
1245
  }, {
1207
1246
  component: Je,
1208
1247
  ...ze
@@ -1219,8 +1258,11 @@ const P = {
1219
1258
  component: nt,
1220
1259
  ...tt
1221
1260
  }, {
1222
- component: ye,
1261
+ component: it,
1223
1262
  ...at
1263
+ }, {
1264
+ component: ye,
1265
+ ...ot
1224
1266
  }], G = () => [{
1225
1267
  component: xe,
1226
1268
  ...Ae
@@ -1241,17 +1283,17 @@ const P = {
1241
1283
  ...$e
1242
1284
  }, {
1243
1285
  component: ke,
1244
- ...Ne
1286
+ ...Be
1245
1287
  }, {
1246
1288
  component: Ce,
1247
- ...qe
1289
+ ...je
1248
1290
  }, {
1249
- component: je,
1250
- ...Be
1291
+ component: qe,
1292
+ ...Ne
1251
1293
  }, {
1252
1294
  component: We,
1253
1295
  ...Fe
1254
- }, ...it()], ot = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1296
+ }, ...rt()], lt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1255
1297
  function getAndSetVariantId() {
1256
1298
  function setCookie(name, value, days) {
1257
1299
  let expires = '';
@@ -1307,7 +1349,7 @@ const P = {
1307
1349
  }).join('');
1308
1350
  styleEl.innerHTML = newStyleStr;
1309
1351
  }
1310
- }`, rt = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
1352
+ }`, st = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
1311
1353
  if (!navigator.cookieEnabled) {
1312
1354
  return;
1313
1355
  }
@@ -1345,22 +1387,22 @@ const P = {
1345
1387
  ...t,
1346
1388
  testVariationId: t.id,
1347
1389
  id: e == null ? void 0 : e.id
1348
- })), lt = ({
1390
+ })), dt = ({
1349
1391
  canTrack: e,
1350
1392
  content: t
1351
- }) => !(!(W(t).length > 0) || !e || H()), st = (e) => e === "react" || e === "reactNative", oe = st(te), dt = () => `
1352
- window.${ae} = ${ot}
1353
- window.${ie} = ${rt}
1354
- `, ct = (e, t) => `
1393
+ }) => !(!(W(t).length > 0) || !e || H()), ct = (e) => e === "react" || e === "reactNative", oe = ct(te), ut = () => `
1394
+ window.${ae} = ${lt}
1395
+ window.${ie} = ${st}
1396
+ `, mt = (e, t) => `
1355
1397
  window.${ae}(
1356
1398
  "${t}",${JSON.stringify(e)}, ${oe}
1357
- )`, ut = ({
1399
+ )`, pt = ({
1358
1400
  contentId: e,
1359
1401
  variationId: t
1360
1402
  }) => `window.${ie}(
1361
1403
  "${t}", "${e}", ${oe}
1362
1404
  )`;
1363
- function N(e) {
1405
+ function B(e) {
1364
1406
  return /* @__PURE__ */ f(
1365
1407
  "script",
1366
1408
  {
@@ -1372,7 +1414,7 @@ function N(e) {
1372
1414
  function X(e) {
1373
1415
  return Math.round(e * 1e3) / 1e3;
1374
1416
  }
1375
- const mt = (e, t, n = !0) => {
1417
+ const gt = (e, t, n = !0) => {
1376
1418
  if (!(e instanceof HTMLElement))
1377
1419
  return null;
1378
1420
  let a = n ? e : e.parentElement;
@@ -1383,7 +1425,7 @@ const mt = (e, t, n = !0) => {
1383
1425
  return a;
1384
1426
  } while (a = a.parentElement);
1385
1427
  return null;
1386
- }, pt = (e) => mt(e, (t) => {
1428
+ }, ft = (e) => gt(e, (t) => {
1387
1429
  const n = t.getAttribute("builder-id") || t.id;
1388
1430
  return (n == null ? void 0 : n.indexOf("builder-")) === 0;
1389
1431
  }), Z = ({
@@ -1395,8 +1437,8 @@ const mt = (e, t, n = !0) => {
1395
1437
  x: u,
1396
1438
  y: i
1397
1439
  };
1398
- }, gt = (e) => {
1399
- const t = e.target, n = t && pt(t), a = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
1440
+ }, ht = (e) => {
1441
+ const t = e.target, n = t && ft(t), a = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
1400
1442
  return {
1401
1443
  targetBuilderElement: a || void 0,
1402
1444
  metadata: {
@@ -1411,7 +1453,7 @@ const mt = (e, t, n = !0) => {
1411
1453
  builderElementIndex: n && a ? [].slice.call(document.getElementsByClassName(a)).indexOf(n) : void 0
1412
1454
  }
1413
1455
  };
1414
- }, ft = (e) => {
1456
+ }, bt = (e) => {
1415
1457
  var u, i;
1416
1458
  const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], a = (i = e.fileUrl) != null ? i : (u = e == null ? void 0 : e.files) == null ? void 0 : u.regular;
1417
1459
  let d = "";
@@ -1437,15 +1479,15 @@ font-weight: ${o};
1437
1479
  `.trim());
1438
1480
  }
1439
1481
  return d;
1440
- }, ht = ({
1482
+ }, yt = ({
1441
1483
  customFonts: e
1442
1484
  }) => {
1443
1485
  var t;
1444
- return ((t = e == null ? void 0 : e.map((n) => ft(n))) == null ? void 0 : t.join(" ")) || "";
1445
- }, bt = ({
1486
+ return ((t = e == null ? void 0 : e.map((n) => bt(n))) == null ? void 0 : t.join(" ")) || "";
1487
+ }, xt = ({
1446
1488
  cssCode: e,
1447
1489
  contentId: t
1448
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", yt = `
1490
+ }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", vt = `
1449
1491
  .builder-button {
1450
1492
  all: unset;
1451
1493
  }
@@ -1462,9 +1504,9 @@ font-weight: ${o};
1462
1504
  text-align: inherit;
1463
1505
  font-family: inherit;
1464
1506
  }
1465
- `, xt = (e) => e ? "" : yt, vt = (e) => `variant-${e}`;
1466
- function St(e) {
1467
- var B, j, q, K, M, O, _;
1507
+ `, St = (e) => e ? "" : vt, Tt = (e) => `variant-${e}`;
1508
+ function It(e) {
1509
+ var N, q, j, K, M, _, O;
1468
1510
  const t = le(null);
1469
1511
  function n(r) {
1470
1512
  var p, s;
@@ -1545,7 +1587,7 @@ function St(e) {
1545
1587
  });
1546
1588
  }
1547
1589
  const [h, C] = k(() => ({})), [I, w] = k(() => ({})), [R, E] = k(() => !1);
1548
- function y(r) {
1590
+ function x(r) {
1549
1591
  var c, p;
1550
1592
  if (e.builderContextSignal.content) {
1551
1593
  const s = (c = e.builderContextSignal.content) == null ? void 0 : c.testVariationId, l = (p = e.builderContextSignal.content) == null ? void 0 : p.id;
@@ -1555,13 +1597,13 @@ function St(e) {
1555
1597
  contentId: l,
1556
1598
  apiKey: e.apiKey,
1557
1599
  variationId: s !== l ? s : void 0,
1558
- ...gt(r),
1600
+ ...ht(r),
1559
1601
  unique: !R
1560
1602
  });
1561
1603
  }
1562
1604
  R || E(!0);
1563
1605
  }
1564
- function x() {
1606
+ function v() {
1565
1607
  var c, p, s;
1566
1608
  const r = (s = (p = (c = e.builderContextSignal.content) == null ? void 0 : c.data) == null ? void 0 : p.httpRequests) != null ? s : {};
1567
1609
  Object.entries(r).forEach(([l, g]) => {
@@ -1592,7 +1634,7 @@ function St(e) {
1592
1634
  });
1593
1635
  });
1594
1636
  }
1595
- function v() {
1637
+ function S() {
1596
1638
  F() && window.dispatchEvent(
1597
1639
  new CustomEvent(
1598
1640
  "builder:component:stateChange",
@@ -1607,7 +1649,7 @@ function St(e) {
1607
1649
  )
1608
1650
  );
1609
1651
  }
1610
- return S(() => {
1652
+ return T(() => {
1611
1653
  var r, c;
1612
1654
  if (H()) {
1613
1655
  if (F() && (window.addEventListener("message", o), se(), de({
@@ -1628,7 +1670,7 @@ function St(e) {
1628
1670
  (g = window.parent) == null || g.postMessage(l, "*");
1629
1671
  }), window.addEventListener(
1630
1672
  "builder:component:stateChangeListenerActivated",
1631
- v
1673
+ S
1632
1674
  )), e.builderContextSignal.content && A(e.canTrack)) {
1633
1675
  const s = (r = e.builderContextSignal.content) == null ? void 0 : r.testVariationId, l = (c = e.builderContextSignal.content) == null ? void 0 : c.id, g = e.apiKey;
1634
1676
  J({
@@ -1652,61 +1694,61 @@ function St(e) {
1652
1694
  });
1653
1695
  }
1654
1696
  }
1655
- }, []), S(() => {
1697
+ }, []), T(() => {
1656
1698
  e.apiKey || pe.error(
1657
1699
  "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
1658
- ), m(), x(), v();
1659
- }, []), S(() => {
1700
+ ), m(), v(), S();
1701
+ }, []), T(() => {
1660
1702
  e.content && a(e.content);
1661
- }, [e.content]), S(() => {
1703
+ }, [e.content]), T(() => {
1662
1704
  m();
1663
- }, [(j = (B = e.builderContextSignal.content) == null ? void 0 : B.data) == null ? void 0 : j.jsCode]), S(() => {
1664
- x();
1665
- }, [(K = (q = e.builderContextSignal.content) == null ? void 0 : q.data) == null ? void 0 : K.httpRequests]), S(() => {
1705
+ }, [(q = (N = e.builderContextSignal.content) == null ? void 0 : N.data) == null ? void 0 : q.jsCode]), T(() => {
1666
1706
  v();
1667
- }, [e.builderContextSignal.rootState]), S(() => {
1707
+ }, [(K = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : K.httpRequests]), T(() => {
1708
+ S();
1709
+ }, [e.builderContextSignal.rootState]), T(() => {
1668
1710
  e.data && n(e.data);
1669
- }, [e.data]), S(() => {
1711
+ }, [e.data]), T(() => {
1670
1712
  e.locale && n({
1671
1713
  locale: e.locale
1672
1714
  });
1673
- }, [e.locale]), S(() => () => {
1715
+ }, [e.locale]), T(() => () => {
1674
1716
  H() && (window.removeEventListener("message", o), window.removeEventListener(
1675
1717
  "builder:component:stateChangeListenerActivated",
1676
- v
1718
+ S
1677
1719
  ));
1678
1720
  }, []), /* @__PURE__ */ f(we.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ f(
1679
1721
  u,
1680
1722
  {
1681
1723
  ref: t,
1682
- onClick: (r) => y(r),
1724
+ onClick: (r) => x(r),
1683
1725
  "builder-content-id": (M = e.builderContextSignal.content) == null ? void 0 : M.id,
1684
1726
  "builder-model": e.model,
1685
1727
  ...d(),
1686
1728
  ...e.contentWrapperProps,
1687
- className: vt(
1688
- ((O = e.content) == null ? void 0 : O.testVariationId) || ((_ = e.content) == null ? void 0 : _.id)
1729
+ className: Tt(
1730
+ ((_ = e.content) == null ? void 0 : _.testVariationId) || ((O = e.content) == null ? void 0 : O.id)
1689
1731
  ),
1690
1732
  children: e.children
1691
1733
  }
1692
1734
  ) : null });
1693
1735
  }
1694
- function Tt(e) {
1736
+ function kt(e) {
1695
1737
  const [t, n] = k(
1696
1738
  () => `
1697
- ${bt({
1739
+ ${xt({
1698
1740
  cssCode: e.cssCode,
1699
1741
  contentId: e.contentId
1700
1742
  })}
1701
- ${ht({
1743
+ ${yt({
1702
1744
  customFonts: e.customFonts
1703
1745
  })}
1704
- ${xt(e.isNestedRender)}
1746
+ ${St(e.isNestedRender)}
1705
1747
  `.trim()
1706
1748
  );
1707
1749
  return /* @__PURE__ */ f(ne, { id: "builderio-content", styles: t });
1708
1750
  }
1709
- const It = ({
1751
+ const Ct = ({
1710
1752
  content: e,
1711
1753
  data: t,
1712
1754
  locale: n
@@ -1723,7 +1765,7 @@ const It = ({
1723
1765
  locale: n
1724
1766
  } : {}
1725
1767
  };
1726
- }, kt = ({
1768
+ }, wt = ({
1727
1769
  content: e,
1728
1770
  data: t
1729
1771
  }) => e ? {
@@ -1738,19 +1780,19 @@ function ee(e) {
1738
1780
  var m, h, C, I, w, R, E;
1739
1781
  const [t, n] = k(
1740
1782
  () => {
1741
- var y, x;
1742
- return ut({
1783
+ var x, v;
1784
+ return pt({
1743
1785
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
1744
- variationId: (y = e.content) == null ? void 0 : y.testVariationId,
1786
+ variationId: (x = e.content) == null ? void 0 : x.testVariationId,
1745
1787
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
1746
- contentId: (x = e.content) == null ? void 0 : x.id
1788
+ contentId: (v = e.content) == null ? void 0 : v.id
1747
1789
  });
1748
1790
  }
1749
1791
  );
1750
- function a(y) {
1751
- o((x) => ({
1752
- ...x,
1753
- rootState: y
1792
+ function a(x) {
1793
+ o((v) => ({
1794
+ ...v,
1795
+ rootState: x
1754
1796
  }));
1755
1797
  }
1756
1798
  const [d, u] = k(
@@ -1758,22 +1800,22 @@ function ee(e) {
1758
1800
  ...G(),
1759
1801
  ...e.customComponents || []
1760
1802
  ].reduce(
1761
- (y, { component: x, ...v }) => ({
1762
- ...y,
1763
- [v.name]: {
1764
- component: x,
1765
- ...Y(v)
1803
+ (x, { component: v, ...S }) => ({
1804
+ ...x,
1805
+ [S.name]: {
1806
+ component: v,
1807
+ ...Y(S)
1766
1808
  }
1767
1809
  }),
1768
1810
  {}
1769
1811
  )
1770
1812
  ), [i, o] = k(() => ({
1771
- content: kt({
1813
+ content: wt({
1772
1814
  content: e.content,
1773
1815
  data: e.data
1774
1816
  }),
1775
1817
  localState: void 0,
1776
- rootState: It({
1818
+ rootState: Ct({
1777
1819
  content: e.content,
1778
1820
  data: e.data,
1779
1821
  locale: e.locale
@@ -1787,9 +1829,9 @@ function ee(e) {
1787
1829
  ...G(),
1788
1830
  ...e.customComponents || []
1789
1831
  ].reduce(
1790
- (y, { component: x, ...v }) => ({
1791
- ...y,
1792
- [v.name]: Y(v)
1832
+ (x, { component: v, ...S }) => ({
1833
+ ...x,
1834
+ [S.name]: Y(S)
1793
1835
  }),
1794
1836
  {}
1795
1837
  ),
@@ -1804,7 +1846,7 @@ function ee(e) {
1804
1846
  registeredComponents: d
1805
1847
  },
1806
1848
  children: /* @__PURE__ */ $(
1807
- St,
1849
+ It,
1808
1850
  {
1809
1851
  content: e.content,
1810
1852
  data: e.data,
@@ -1822,14 +1864,14 @@ function ee(e) {
1822
1864
  setBuilderContextSignal: o,
1823
1865
  children: [
1824
1866
  e.isSsrAbTest ? /* @__PURE__ */ f(
1825
- N,
1867
+ B,
1826
1868
  {
1827
1869
  id: "builderio-variant-visibility",
1828
1870
  scriptStr: t
1829
1871
  }
1830
1872
  ) : null,
1831
1873
  /* @__PURE__ */ f(
1832
- Tt,
1874
+ kt,
1833
1875
  {
1834
1876
  isNestedRender: e.isNestedRender,
1835
1877
  contentId: (m = i.content) == null ? void 0 : m.id,
@@ -1852,17 +1894,17 @@ function ee(e) {
1852
1894
  }
1853
1895
  );
1854
1896
  }
1855
- function At(e) {
1897
+ function Dt(e) {
1856
1898
  var i;
1857
1899
  const [t, n] = k(
1858
- () => lt({
1900
+ () => dt({
1859
1901
  canTrack: A(e.canTrack),
1860
1902
  content: e.content
1861
1903
  })
1862
1904
  );
1863
1905
  function a() {
1864
1906
  var o;
1865
- return ct(
1907
+ return mt(
1866
1908
  W(e.content).map((m) => ({
1867
1909
  id: m.testVariationId,
1868
1910
  testRatio: m.testRatio
@@ -1883,13 +1925,13 @@ function At(e) {
1883
1925
  canTrack: A(e.canTrack)
1884
1926
  });
1885
1927
  }
1886
- return S(() => {
1928
+ return T(() => {
1887
1929
  }, []), /* @__PURE__ */ $(z, { children: [
1888
1930
  !e.isNestedRender && te !== "reactNative" ? /* @__PURE__ */ f(
1889
- N,
1931
+ B,
1890
1932
  {
1891
1933
  id: "builderio-init-variants-fns",
1892
- scriptStr: dt()
1934
+ scriptStr: ut()
1893
1935
  }
1894
1936
  ) : null,
1895
1937
  t ? /* @__PURE__ */ $(z, { children: [
@@ -1901,7 +1943,7 @@ function At(e) {
1901
1943
  }
1902
1944
  ),
1903
1945
  /* @__PURE__ */ f(
1904
- N,
1946
+ B,
1905
1947
  {
1906
1948
  id: "builderio-variants-visibility",
1907
1949
  scriptStr: a()
@@ -1960,5 +2002,5 @@ function At(e) {
1960
2002
  ] });
1961
2003
  }
1962
2004
  export {
1963
- At as default
2005
+ Dt as default
1964
2006
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),y=require("react"),b=require("./blocks-70c83f76.cjs"),P=require("./server-entry-13d68dab.cjs");require("./blocks-exports.cjs");require("./get-class-prop-name-99284ed1.cjs");require("./dynamic-renderer-b29b45ca.cjs");const B=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],D=()=>{const e=process.env.NODE_ENV||"production";return B.includes(e)?e:"production"},A=(e,i,S)=>{const a=String.prototype.split.call(i,/[,[\].]+?/).filter(Boolean).reduce((c,h)=>c!=null?c[h]:c,e);return a===void 0||a===e?S:a};function O(e){var x,E;const i=y.useRef(null),[S,a]=y.useState(()=>"unsubmitted"),[c,h]=y.useState(()=>null),[J,T]=y.useState(()=>"");function q(s){var f,m;const u={...e.builderContext.rootState,...s};e.builderContext.rootSetState?(m=(f=e.builderContext).rootSetState)==null||m.call(f,u):e.builderContext.rootState=u}function g(){return P.isEditing()&&e.previewState||S}function F(s){var f;const u=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")s.preventDefault();else if(u){if(!(e.action||e.sendSubmissionsTo==="email")){s.preventDefault();return}s.preventDefault();const m=s.currentTarget||s.target,k=e.customHeaders||{};let v;const N=new FormData(m),C=Array.from(m.querySelectorAll("input,select,textarea")).filter(t=>!!t.name).map(t=>{let n;const l=t.name;if(t instanceof HTMLInputElement)if(t.type==="radio"){if(t.checked)return n=t.name,{key:l,value:n}}else if(t.type==="checkbox")n=t.checked;else if(t.type==="number"||t.type==="range"){const r=t.valueAsNumber;isNaN(r)||(n=r)}else t.type==="file"?n=t.files:n=t.value;else n=t.value;return{key:l,value:n}});let d=e.contentType;if(e.sendSubmissionsTo==="email"&&(d="multipart/form-data"),Array.from(C).forEach(({value:t})=>{(t instanceof File||Array.isArray(t)&&t[0]instanceof File||t instanceof FileList)&&(d="multipart/form-data")}),d!=="application/json")v=N;else{const t={};Array.from(C).forEach(({value:n,key:l})=>{b.set(t,l,n)}),v=JSON.stringify(t)}d&&d!=="multipart/form-data"&&(u&&((f=e.action)!=null&&f.includes("zapier.com"))||(k["content-type"]=d));const j=new CustomEvent("presubmit",{detail:{body:v}});if(i.current&&(i.current.dispatchEvent(j),j.defaultPrevented))return;a("sending");const w=`${D()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?w:e.action,{body:v,headers:k,method:e.method||"post"}).then(async t=>{let n;const l=t.headers.get("content-type");if(l&&l.indexOf("application/json")!==-1?n=await t.json():n=await t.text(),!t.ok&&e.errorMessagePath){let r=A(n,e.errorMessagePath);r&&(typeof r!="string"&&(r=JSON.stringify(r)),T(r),q({formErrorMessage:r}))}if(h(n),a(t.ok?"success":"error"),t.ok){const r=new CustomEvent("submit:success",{detail:{res:t,body:n}});if(i.current){if(i.current.dispatchEvent(r),r.defaultPrevented)return;e.resetFormOnSubmit!==!1&&i.current.reset()}if(e.successUrl)if(i.current){const M=new CustomEvent("route",{detail:{url:e.successUrl}});i.current.dispatchEvent(M),M.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},t=>{const n=new CustomEvent("submit:error",{detail:{error:t}});i.current&&(i.current.dispatchEvent(n),n.defaultPrevented)||(h(t),a("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsxs("form",{validate:e.validate,ref:i,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:s=>F(s),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?o.jsx(o.Fragment,{children:(E=(x=e.builderBlock)==null?void 0:x.children)==null?void 0:E.map((s,u)=>o.jsx(b.Block,{block:s,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${u}`))}):null,g()==="error"?o.jsx(b.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,g()==="sending"?o.jsx(b.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,g()==="error"&&c?o.jsx("pre",{className:"builder-form-error-text pre-3a20f614",children:JSON.stringify(c,null,2)}):null,g()==="success"?o.jsx(b.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",o.jsx("style",{children:".pre-3a20f614 { padding: 10px; color: red; text-align: center; }"})," "]})}exports.default=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),y=require("react"),b=require("./blocks-48a9ac8c.cjs"),P=require("./server-entry-a00fcff8.cjs");require("./blocks-exports.cjs");require("./get-class-prop-name-af6b922f.cjs");require("./dynamic-renderer-b29b45ca.cjs");const B=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],D=()=>{const e=process.env.NODE_ENV||"production";return B.includes(e)?e:"production"},A=(e,i,S)=>{const a=String.prototype.split.call(i,/[,[\].]+?/).filter(Boolean).reduce((c,h)=>c!=null?c[h]:c,e);return a===void 0||a===e?S:a};function O(e){var x,E;const i=y.useRef(null),[S,a]=y.useState(()=>"unsubmitted"),[c,h]=y.useState(()=>null),[J,T]=y.useState(()=>"");function q(s){var f,m;const u={...e.builderContext.rootState,...s};e.builderContext.rootSetState?(m=(f=e.builderContext).rootSetState)==null||m.call(f,u):e.builderContext.rootState=u}function g(){return P.isEditing()&&e.previewState||S}function F(s){var f;const u=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")s.preventDefault();else if(u){if(!(e.action||e.sendSubmissionsTo==="email")){s.preventDefault();return}s.preventDefault();const m=s.currentTarget||s.target,k=e.customHeaders||{};let v;const N=new FormData(m),C=Array.from(m.querySelectorAll("input,select,textarea")).filter(t=>!!t.name).map(t=>{let n;const l=t.name;if(t instanceof HTMLInputElement)if(t.type==="radio"){if(t.checked)return n=t.name,{key:l,value:n}}else if(t.type==="checkbox")n=t.checked;else if(t.type==="number"||t.type==="range"){const r=t.valueAsNumber;isNaN(r)||(n=r)}else t.type==="file"?n=t.files:n=t.value;else n=t.value;return{key:l,value:n}});let d=e.contentType;if(e.sendSubmissionsTo==="email"&&(d="multipart/form-data"),Array.from(C).forEach(({value:t})=>{(t instanceof File||Array.isArray(t)&&t[0]instanceof File||t instanceof FileList)&&(d="multipart/form-data")}),d!=="application/json")v=N;else{const t={};Array.from(C).forEach(({value:n,key:l})=>{b.set(t,l,n)}),v=JSON.stringify(t)}d&&d!=="multipart/form-data"&&(u&&((f=e.action)!=null&&f.includes("zapier.com"))||(k["content-type"]=d));const j=new CustomEvent("presubmit",{detail:{body:v}});if(i.current&&(i.current.dispatchEvent(j),j.defaultPrevented))return;a("sending");const w=`${D()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?w:e.action,{body:v,headers:k,method:e.method||"post"}).then(async t=>{let n;const l=t.headers.get("content-type");if(l&&l.indexOf("application/json")!==-1?n=await t.json():n=await t.text(),!t.ok&&e.errorMessagePath){let r=A(n,e.errorMessagePath);r&&(typeof r!="string"&&(r=JSON.stringify(r)),T(r),q({formErrorMessage:r}))}if(h(n),a(t.ok?"success":"error"),t.ok){const r=new CustomEvent("submit:success",{detail:{res:t,body:n}});if(i.current){if(i.current.dispatchEvent(r),r.defaultPrevented)return;e.resetFormOnSubmit!==!1&&i.current.reset()}if(e.successUrl)if(i.current){const M=new CustomEvent("route",{detail:{url:e.successUrl}});i.current.dispatchEvent(M),M.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},t=>{const n=new CustomEvent("submit:error",{detail:{error:t}});i.current&&(i.current.dispatchEvent(n),n.defaultPrevented)||(h(t),a("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsxs("form",{validate:e.validate,ref:i,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:s=>F(s),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?o.jsx(o.Fragment,{children:(E=(x=e.builderBlock)==null?void 0:x.children)==null?void 0:E.map((s,u)=>o.jsx(b.Block,{block:s,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${u}`))}):null,g()==="error"?o.jsx(b.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,g()==="sending"?o.jsx(b.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,g()==="error"&&c?o.jsx("pre",{className:"builder-form-error-text pre-3a20f614",children:JSON.stringify(c,null,2)}):null,g()==="success"?o.jsx(b.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",o.jsx("style",{children:".pre-3a20f614 { padding: 10px; color: red; text-align: center; }"})," "]})}exports.default=O;
@@ -1,9 +1,9 @@
1
1
  import { jsxs as N, Fragment as w, jsx as u } from "react/jsx-runtime";
2
2
  import { useRef as J, useState as y } from "react";
3
- import { Block as O, Blocks as S, set as U } from "./blocks-f8c6cd3a.js";
4
- import { isEditing as j } from "./server-entry-62d41eae.js";
3
+ import { Block as O, Blocks as S, set as U } from "./blocks-9b142e90.js";
4
+ import { isEditing as j } from "./server-entry-57fedeba.js";
5
5
  import "./blocks-exports.mjs";
6
- import "./get-class-prop-name-f1303c26.js";
6
+ import "./get-class-prop-name-90c8ac6c.js";
7
7
  import "./dynamic-renderer-8b343325.js";
8
8
  const R = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], $ = () => {
9
9
  const e = process.env.NODE_ENV || "production";
@@ -1,4 +1,4 @@
1
- import { TARGET as e } from "./server-entry-62d41eae.js";
1
+ import { TARGET as e } from "./server-entry-57fedeba.js";
2
2
  const a = () => {
3
3
  switch (e) {
4
4
  case "react":
@@ -1 +1 @@
1
- "use strict";const e=require("./server-entry-13d68dab.cjs"),s=()=>{switch(e.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};exports.getClassPropName=s;
1
+ "use strict";const e=require("./server-entry-a00fcff8.cjs"),s=()=>{switch(e.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};exports.getClassPropName=s;