@builder.io/sdk-solid 0.6.4 → 0.7.1-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/node/dev.js CHANGED
@@ -1,4 +1,4 @@
1
- import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, memo, Dynamic, use } from 'solid-js/web';
1
+ import { createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, memo, Dynamic, use } from 'solid-js/web';
2
2
  import { createContext, Show, useContext, For, createSignal, onMount, createEffect, on } from 'solid-js';
3
3
  import { css } from 'solid-styled-components';
4
4
 
@@ -185,6 +185,19 @@ var getFunctionArguments = ({
185
185
  event
186
186
  });
187
187
  };
188
+ var getBuilderGlobals = () => ({
189
+ isEditing: isEditing(),
190
+ isBrowser: isBrowser(),
191
+ isServer: !isBrowser(),
192
+ getUserAttributes: () => getUserAttributes()
193
+ });
194
+ var parseCode = (code, {
195
+ isExpression = true
196
+ }) => {
197
+ const useReturn = isExpression && !(code.includes(";") || code.includes(" return ") || code.trim().startsWith("return "));
198
+ const useCode = useReturn ? `return (${code});` : code;
199
+ return useCode;
200
+ };
188
201
 
189
202
  // src/functions/evaluate/browser-runtime/browser.js
190
203
  var runInBrowser = ({
@@ -226,6 +239,156 @@ function flattenState(rootState, localState, rootSetState) {
226
239
  });
227
240
  }
228
241
 
242
+ // src/functions/evaluate/node-runtime/safeDynamicRequire.js
243
+ var noop = () => null;
244
+ var safeDynamicRequire = noop;
245
+ try {
246
+ safeDynamicRequire = eval("require");
247
+ } catch (error) {
248
+ }
249
+
250
+ // src/functions/set.js
251
+ var set = (obj, _path, value) => {
252
+ if (Object(obj) !== obj) {
253
+ return obj;
254
+ }
255
+ const path = Array.isArray(_path) ? _path : _path.toString().match(/[^.[\]]+/g);
256
+ path.slice(0, -1).reduce((a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {}, obj)[path[path.length - 1]] = value;
257
+ return obj;
258
+ };
259
+
260
+ // src/functions/evaluate/node-runtime/node-runtime.js
261
+ var __defProp = Object.defineProperty;
262
+ var __defProps = Object.defineProperties;
263
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
264
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
265
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
266
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
267
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
268
+ enumerable: true,
269
+ configurable: true,
270
+ writable: true,
271
+ value
272
+ }) : obj[key] = value;
273
+ var __spreadValues = (a, b) => {
274
+ for (var prop in b || (b = {}))
275
+ if (__hasOwnProp.call(b, prop))
276
+ __defNormalProp(a, prop, b[prop]);
277
+ if (__getOwnPropSymbols)
278
+ for (var prop of __getOwnPropSymbols(b)) {
279
+ if (__propIsEnum.call(b, prop))
280
+ __defNormalProp(a, prop, b[prop]);
281
+ }
282
+ return a;
283
+ };
284
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
285
+ var ivm = safeDynamicRequire("isolated-vm");
286
+ var getSyncValName = (key) => `bldr_${key}_sync`;
287
+ var BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE";
288
+ var INJECTED_IVM_GLOBAL = "BUILDER_IVM";
289
+ var REF_TO_PROXY_FN = `
290
+ var refToProxy = (obj) => {
291
+ if (typeof obj !== 'object' || obj === null) {
292
+ return obj;
293
+ }
294
+ return new Proxy({}, {
295
+ get(target, key) {
296
+ if (key === 'copySync') {
297
+ return () => obj.copySync();
298
+ }
299
+ const val = obj.getSync(key);
300
+ if (typeof val?.getSync === 'function') {
301
+ return refToProxy(val);
302
+ }
303
+ return val;
304
+ },
305
+ set(target, key, value) {
306
+ const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
307
+ obj.setSync(key, v);
308
+ ${BUILDER_SET_STATE_NAME}(key, value)
309
+ },
310
+ deleteProperty(target, key) {
311
+ obj.deleteSync(key);
312
+ }
313
+ })
314
+ }
315
+ `;
316
+ var processCode = ({
317
+ code,
318
+ args
319
+ }) => {
320
+ const fnArgs = args.map(([name]) => `var ${name} = refToProxy(${getSyncValName(name)}); `).join("");
321
+ return `
322
+ ${REF_TO_PROXY_FN}
323
+ ${fnArgs}
324
+ function theFunction() {
325
+ ${code}
326
+ }
327
+
328
+ let output = theFunction()
329
+
330
+ if (typeof output === 'object' && output !== null) {
331
+ output = JSON.stringify(output.copySync ? output.copySync() : output);
332
+ }
333
+
334
+ output;
335
+ `;
336
+ };
337
+ var getIsolateContext = () => {
338
+ const isolate = new ivm.Isolate({
339
+ memoryLimit: 128
340
+ });
341
+ return isolate.createContextSync();
342
+ };
343
+ var runInNode = ({
344
+ code,
345
+ builder,
346
+ context,
347
+ event,
348
+ localState,
349
+ rootSetState,
350
+ rootState
351
+ }) => {
352
+ const state = fastClone(__spreadValues(__spreadValues({}, rootState), localState));
353
+ const args = getFunctionArguments({
354
+ builder,
355
+ context,
356
+ event,
357
+ state
358
+ });
359
+ const isolateContext = getIsolateContext();
360
+ const jail = isolateContext.global;
361
+ jail.setSync("global", jail.derefInto());
362
+ jail.setSync("log", function(...logArgs) {
363
+ console.log(...logArgs);
364
+ });
365
+ jail.setSync(BUILDER_SET_STATE_NAME, function(key, value) {
366
+ set(rootState, key, value);
367
+ rootSetState == null ? void 0 : rootSetState(rootState);
368
+ });
369
+ args.forEach(([key, arg]) => {
370
+ const val = typeof arg === "object" ? new ivm.Reference(key === "builder" ? __spreadProps(__spreadValues({}, arg), {
371
+ getUserAttributes: () => arg.getUserAttributes()
372
+ }) : arg) : null;
373
+ jail.setSync(getSyncValName(key), val);
374
+ });
375
+ jail.setSync(INJECTED_IVM_GLOBAL, ivm);
376
+ const evalStr = processCode({
377
+ code,
378
+ args
379
+ });
380
+ const resultStr = isolateContext.evalSync(evalStr);
381
+ try {
382
+ const res = JSON.parse(resultStr);
383
+ return res;
384
+ } catch (_error) {
385
+ return resultStr;
386
+ }
387
+ };
388
+
389
+ // src/functions/evaluate/choose-eval.js
390
+ var chooseBrowserOrServerEval = (args) => isBrowser() ? runInBrowser(args) : runInNode(args);
391
+
229
392
  // src/functions/evaluate/evaluate.js
230
393
  function evaluate({
231
394
  code,
@@ -240,17 +403,11 @@ function evaluate({
240
403
  logger.warn("Skipping evaluation of empty code block.");
241
404
  return;
242
405
  }
243
- const builder = {
244
- isEditing: isEditing(),
245
- isBrowser: isBrowser(),
246
- isServer: !isBrowser(),
247
- getUserAttributes: () => getUserAttributes()
248
- };
249
- const useReturn = isExpression && !(code.includes(";") || code.includes(" return ") || code.trim().startsWith("return "));
250
- const useCode = useReturn ? `return (${code});` : code;
251
406
  const args = {
252
- code: useCode,
253
- builder,
407
+ code: parseCode(code, {
408
+ isExpression
409
+ }),
410
+ builder: getBuilderGlobals(),
254
411
  context,
255
412
  event,
256
413
  rootSetState,
@@ -258,7 +415,7 @@ function evaluate({
258
415
  localState
259
416
  };
260
417
  try {
261
- return runInBrowser(args);
418
+ return chooseBrowserOrServerEval(args);
262
419
  } catch (e) {
263
420
  logger.error("Failed code evaluation: " + e.message, {
264
421
  code
@@ -267,46 +424,36 @@ function evaluate({
267
424
  }
268
425
  }
269
426
 
270
- // src/functions/set.js
271
- var set = (obj, _path, value) => {
272
- if (Object(obj) !== obj) {
273
- return obj;
274
- }
275
- const path = Array.isArray(_path) ? _path : _path.toString().match(/[^.[\]]+/g);
276
- path.slice(0, -1).reduce((a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {}, obj)[path[path.length - 1]] = value;
277
- return obj;
278
- };
279
-
280
427
  // src/functions/transform-block.js
281
428
  function transformBlock(block) {
282
429
  return block;
283
430
  }
284
431
 
285
432
  // src/functions/get-processed-block.js
286
- var __defProp = Object.defineProperty;
287
- var __defProps = Object.defineProperties;
288
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
289
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
290
- var __hasOwnProp = Object.prototype.hasOwnProperty;
291
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
292
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
433
+ var __defProp2 = Object.defineProperty;
434
+ var __defProps2 = Object.defineProperties;
435
+ var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
436
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
437
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
438
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
439
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, {
293
440
  enumerable: true,
294
441
  configurable: true,
295
442
  writable: true,
296
443
  value
297
444
  }) : obj[key] = value;
298
- var __spreadValues = (a, b) => {
445
+ var __spreadValues2 = (a, b) => {
299
446
  for (var prop in b || (b = {}))
300
- if (__hasOwnProp.call(b, prop))
301
- __defNormalProp(a, prop, b[prop]);
302
- if (__getOwnPropSymbols)
303
- for (var prop of __getOwnPropSymbols(b)) {
304
- if (__propIsEnum.call(b, prop))
305
- __defNormalProp(a, prop, b[prop]);
447
+ if (__hasOwnProp2.call(b, prop))
448
+ __defNormalProp2(a, prop, b[prop]);
449
+ if (__getOwnPropSymbols2)
450
+ for (var prop of __getOwnPropSymbols2(b)) {
451
+ if (__propIsEnum2.call(b, prop))
452
+ __defNormalProp2(a, prop, b[prop]);
306
453
  }
307
454
  return a;
308
455
  };
309
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
456
+ var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
310
457
  var evaluateBindings = ({
311
458
  block,
312
459
  context,
@@ -318,9 +465,9 @@ var evaluateBindings = ({
318
465
  return block;
319
466
  }
320
467
  const copy = fastClone(block);
321
- const copied = __spreadProps(__spreadValues({}, copy), {
322
- properties: __spreadValues({}, copy.properties),
323
- actions: __spreadValues({}, copy.actions)
468
+ const copied = __spreadProps2(__spreadValues2({}, copy), {
469
+ properties: __spreadValues2({}, copy.properties),
470
+ actions: __spreadValues2({}, copy.actions)
324
471
  });
325
472
  for (const binding in block.bindings) {
326
473
  const expression = block.bindings[binding];
@@ -479,62 +626,62 @@ function BlockStyles(props) {
479
626
  var block_styles_default = BlockStyles;
480
627
 
481
628
  // src/functions/get-block-component-options.js
482
- var __defProp2 = Object.defineProperty;
483
- var __defProps2 = Object.defineProperties;
484
- var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
485
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
486
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
487
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
488
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, {
629
+ var __defProp3 = Object.defineProperty;
630
+ var __defProps3 = Object.defineProperties;
631
+ var __getOwnPropDescs3 = Object.getOwnPropertyDescriptors;
632
+ var __getOwnPropSymbols3 = Object.getOwnPropertySymbols;
633
+ var __hasOwnProp3 = Object.prototype.hasOwnProperty;
634
+ var __propIsEnum3 = Object.prototype.propertyIsEnumerable;
635
+ var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, {
489
636
  enumerable: true,
490
637
  configurable: true,
491
638
  writable: true,
492
639
  value
493
640
  }) : obj[key] = value;
494
- var __spreadValues2 = (a, b) => {
641
+ var __spreadValues3 = (a, b) => {
495
642
  for (var prop in b || (b = {}))
496
- if (__hasOwnProp2.call(b, prop))
497
- __defNormalProp2(a, prop, b[prop]);
498
- if (__getOwnPropSymbols2)
499
- for (var prop of __getOwnPropSymbols2(b)) {
500
- if (__propIsEnum2.call(b, prop))
501
- __defNormalProp2(a, prop, b[prop]);
643
+ if (__hasOwnProp3.call(b, prop))
644
+ __defNormalProp3(a, prop, b[prop]);
645
+ if (__getOwnPropSymbols3)
646
+ for (var prop of __getOwnPropSymbols3(b)) {
647
+ if (__propIsEnum3.call(b, prop))
648
+ __defNormalProp3(a, prop, b[prop]);
502
649
  }
503
650
  return a;
504
651
  };
505
- var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
652
+ var __spreadProps3 = (a, b) => __defProps3(a, __getOwnPropDescs3(b));
506
653
  function getBlockComponentOptions(block) {
507
654
  var _a;
508
- return __spreadProps2(__spreadValues2(__spreadValues2({}, (_a = block.component) == null ? void 0 : _a.options), block.options), {
655
+ return __spreadProps3(__spreadValues3(__spreadValues3({}, (_a = block.component) == null ? void 0 : _a.options), block.options), {
509
656
  builderBlock: block
510
657
  });
511
658
  }
512
659
 
513
660
  // src/functions/sanitize-react-native-block-styles.js
514
- var __defProp3 = Object.defineProperty;
515
- var __defProps3 = Object.defineProperties;
516
- var __getOwnPropDescs3 = Object.getOwnPropertyDescriptors;
517
- var __getOwnPropSymbols3 = Object.getOwnPropertySymbols;
518
- var __hasOwnProp3 = Object.prototype.hasOwnProperty;
519
- var __propIsEnum3 = Object.prototype.propertyIsEnumerable;
520
- var __defNormalProp3 = (obj, key, value) => key in obj ? __defProp3(obj, key, {
661
+ var __defProp4 = Object.defineProperty;
662
+ var __defProps4 = Object.defineProperties;
663
+ var __getOwnPropDescs4 = Object.getOwnPropertyDescriptors;
664
+ var __getOwnPropSymbols4 = Object.getOwnPropertySymbols;
665
+ var __hasOwnProp4 = Object.prototype.hasOwnProperty;
666
+ var __propIsEnum4 = Object.prototype.propertyIsEnumerable;
667
+ var __defNormalProp4 = (obj, key, value) => key in obj ? __defProp4(obj, key, {
521
668
  enumerable: true,
522
669
  configurable: true,
523
670
  writable: true,
524
671
  value
525
672
  }) : obj[key] = value;
526
- var __spreadValues3 = (a, b) => {
673
+ var __spreadValues4 = (a, b) => {
527
674
  for (var prop in b || (b = {}))
528
- if (__hasOwnProp3.call(b, prop))
529
- __defNormalProp3(a, prop, b[prop]);
530
- if (__getOwnPropSymbols3)
531
- for (var prop of __getOwnPropSymbols3(b)) {
532
- if (__propIsEnum3.call(b, prop))
533
- __defNormalProp3(a, prop, b[prop]);
675
+ if (__hasOwnProp4.call(b, prop))
676
+ __defNormalProp4(a, prop, b[prop]);
677
+ if (__getOwnPropSymbols4)
678
+ for (var prop of __getOwnPropSymbols4(b)) {
679
+ if (__propIsEnum4.call(b, prop))
680
+ __defNormalProp4(a, prop, b[prop]);
534
681
  }
535
682
  return a;
536
683
  };
537
- var __spreadProps3 = (a, b) => __defProps3(a, __getOwnPropDescs3(b));
684
+ var __spreadProps4 = (a, b) => __defProps4(a, __getOwnPropDescs4(b));
538
685
  var propertiesThatMustBeNumber = /* @__PURE__ */ new Set(["lineHeight"]);
539
686
  var displayValues = /* @__PURE__ */ new Set(["flex", "none"]);
540
687
  var SHOW_WARNINGS = false;
@@ -568,43 +715,43 @@ var sanitizeReactNativeBlockStyles = (styles) => {
568
715
  const newValue = parseFloat(propertyValue);
569
716
  const normalizedValue = normalizeNumber(newValue);
570
717
  if (normalizedValue) {
571
- return __spreadProps3(__spreadValues3({}, acc), {
718
+ return __spreadProps4(__spreadValues4({}, acc), {
572
719
  [key]: normalizedValue
573
720
  });
574
721
  } else {
575
722
  return acc;
576
723
  }
577
724
  } else if (propertyValue === "0") {
578
- return __spreadProps3(__spreadValues3({}, acc), {
725
+ return __spreadProps4(__spreadValues4({}, acc), {
579
726
  [key]: 0
580
727
  });
581
728
  }
582
729
  }
583
- return __spreadProps3(__spreadValues3({}, acc), {
730
+ return __spreadProps4(__spreadValues4({}, acc), {
584
731
  [key]: propertyValue
585
732
  });
586
733
  }, {});
587
734
  };
588
735
 
589
736
  // src/functions/get-react-native-block-styles.js
590
- var __defProp4 = Object.defineProperty;
591
- var __getOwnPropSymbols4 = Object.getOwnPropertySymbols;
592
- var __hasOwnProp4 = Object.prototype.hasOwnProperty;
593
- var __propIsEnum4 = Object.prototype.propertyIsEnumerable;
594
- var __defNormalProp4 = (obj, key, value) => key in obj ? __defProp4(obj, key, {
737
+ var __defProp5 = Object.defineProperty;
738
+ var __getOwnPropSymbols5 = Object.getOwnPropertySymbols;
739
+ var __hasOwnProp5 = Object.prototype.hasOwnProperty;
740
+ var __propIsEnum5 = Object.prototype.propertyIsEnumerable;
741
+ var __defNormalProp5 = (obj, key, value) => key in obj ? __defProp5(obj, key, {
595
742
  enumerable: true,
596
743
  configurable: true,
597
744
  writable: true,
598
745
  value
599
746
  }) : obj[key] = value;
600
- var __spreadValues4 = (a, b) => {
747
+ var __spreadValues5 = (a, b) => {
601
748
  for (var prop in b || (b = {}))
602
- if (__hasOwnProp4.call(b, prop))
603
- __defNormalProp4(a, prop, b[prop]);
604
- if (__getOwnPropSymbols4)
605
- for (var prop of __getOwnPropSymbols4(b)) {
606
- if (__propIsEnum4.call(b, prop))
607
- __defNormalProp4(a, prop, b[prop]);
749
+ if (__hasOwnProp5.call(b, prop))
750
+ __defNormalProp5(a, prop, b[prop]);
751
+ if (__getOwnPropSymbols5)
752
+ for (var prop of __getOwnPropSymbols5(b)) {
753
+ if (__propIsEnum5.call(b, prop))
754
+ __defNormalProp5(a, prop, b[prop]);
608
755
  }
609
756
  return a;
610
757
  };
@@ -617,7 +764,7 @@ function getReactNativeBlockStyles({
617
764
  if (!responsiveStyles) {
618
765
  return {};
619
766
  }
620
- const styles = __spreadValues4(__spreadValues4(__spreadValues4(__spreadValues4(__spreadValues4({}, context.inheritedStyles), responsiveStyles.large || {}), responsiveStyles.medium || {}), responsiveStyles.small || {}), blockStyles);
767
+ const styles = __spreadValues5(__spreadValues5(__spreadValues5(__spreadValues5(__spreadValues5({}, context.inheritedStyles), responsiveStyles.large || {}), responsiveStyles.medium || {}), responsiveStyles.small || {}), blockStyles);
621
768
  const newStyles = sanitizeReactNativeBlockStyles(styles);
622
769
  return newStyles;
623
770
  }
@@ -628,30 +775,30 @@ function transformBlockProperties(properties) {
628
775
  }
629
776
 
630
777
  // src/functions/get-block-properties.js
631
- var __defProp5 = Object.defineProperty;
632
- var __defProps4 = Object.defineProperties;
633
- var __getOwnPropDescs4 = Object.getOwnPropertyDescriptors;
634
- var __getOwnPropSymbols5 = Object.getOwnPropertySymbols;
635
- var __hasOwnProp5 = Object.prototype.hasOwnProperty;
636
- var __propIsEnum5 = Object.prototype.propertyIsEnumerable;
637
- var __defNormalProp5 = (obj, key, value) => key in obj ? __defProp5(obj, key, {
778
+ var __defProp6 = Object.defineProperty;
779
+ var __defProps5 = Object.defineProperties;
780
+ var __getOwnPropDescs5 = Object.getOwnPropertyDescriptors;
781
+ var __getOwnPropSymbols6 = Object.getOwnPropertySymbols;
782
+ var __hasOwnProp6 = Object.prototype.hasOwnProperty;
783
+ var __propIsEnum6 = Object.prototype.propertyIsEnumerable;
784
+ var __defNormalProp6 = (obj, key, value) => key in obj ? __defProp6(obj, key, {
638
785
  enumerable: true,
639
786
  configurable: true,
640
787
  writable: true,
641
788
  value
642
789
  }) : obj[key] = value;
643
- var __spreadValues5 = (a, b) => {
790
+ var __spreadValues6 = (a, b) => {
644
791
  for (var prop in b || (b = {}))
645
- if (__hasOwnProp5.call(b, prop))
646
- __defNormalProp5(a, prop, b[prop]);
647
- if (__getOwnPropSymbols5)
648
- for (var prop of __getOwnPropSymbols5(b)) {
649
- if (__propIsEnum5.call(b, prop))
650
- __defNormalProp5(a, prop, b[prop]);
792
+ if (__hasOwnProp6.call(b, prop))
793
+ __defNormalProp6(a, prop, b[prop]);
794
+ if (__getOwnPropSymbols6)
795
+ for (var prop of __getOwnPropSymbols6(b)) {
796
+ if (__propIsEnum6.call(b, prop))
797
+ __defNormalProp6(a, prop, b[prop]);
651
798
  }
652
799
  return a;
653
800
  };
654
- var __spreadProps4 = (a, b) => __defProps4(a, __getOwnPropDescs4(b));
801
+ var __spreadProps5 = (a, b) => __defProps5(a, __getOwnPropDescs5(b));
655
802
  var extractRelevantRootBlockProperties = (block) => {
656
803
  return {
657
804
  href: block.href
@@ -662,7 +809,7 @@ function getBlockProperties({
662
809
  context
663
810
  }) {
664
811
  var _a;
665
- const properties = __spreadProps4(__spreadValues5(__spreadValues5({}, extractRelevantRootBlockProperties(block)), block.properties), {
812
+ const properties = __spreadProps5(__spreadValues6(__spreadValues6({}, extractRelevantRootBlockProperties(block)), block.properties), {
666
813
  "builder-id": block.id,
667
814
  style: block.style ? getStyleAttribute(block.style) : void 0,
668
815
  class: [block.id, "builder-block", block.class, (_a = block.properties) == null ? void 0 : _a.class].filter(Boolean).join(" ")
@@ -692,38 +839,38 @@ function getStyleAttribute(style) {
692
839
  }
693
840
 
694
841
  // src/components/block/block.helpers.js
695
- var __defProp6 = Object.defineProperty;
696
- var __defProps5 = Object.defineProperties;
697
- var __getOwnPropDescs5 = Object.getOwnPropertyDescriptors;
698
- var __getOwnPropSymbols6 = Object.getOwnPropertySymbols;
699
- var __hasOwnProp6 = Object.prototype.hasOwnProperty;
700
- var __propIsEnum6 = Object.prototype.propertyIsEnumerable;
701
- var __defNormalProp6 = (obj, key, value) => key in obj ? __defProp6(obj, key, {
842
+ var __defProp7 = Object.defineProperty;
843
+ var __defProps6 = Object.defineProperties;
844
+ var __getOwnPropDescs6 = Object.getOwnPropertyDescriptors;
845
+ var __getOwnPropSymbols7 = Object.getOwnPropertySymbols;
846
+ var __hasOwnProp7 = Object.prototype.hasOwnProperty;
847
+ var __propIsEnum7 = Object.prototype.propertyIsEnumerable;
848
+ var __defNormalProp7 = (obj, key, value) => key in obj ? __defProp7(obj, key, {
702
849
  enumerable: true,
703
850
  configurable: true,
704
851
  writable: true,
705
852
  value
706
853
  }) : obj[key] = value;
707
- var __spreadValues6 = (a, b) => {
854
+ var __spreadValues7 = (a, b) => {
708
855
  for (var prop in b || (b = {}))
709
- if (__hasOwnProp6.call(b, prop))
710
- __defNormalProp6(a, prop, b[prop]);
711
- if (__getOwnPropSymbols6)
712
- for (var prop of __getOwnPropSymbols6(b)) {
713
- if (__propIsEnum6.call(b, prop))
714
- __defNormalProp6(a, prop, b[prop]);
856
+ if (__hasOwnProp7.call(b, prop))
857
+ __defNormalProp7(a, prop, b[prop]);
858
+ if (__getOwnPropSymbols7)
859
+ for (var prop of __getOwnPropSymbols7(b)) {
860
+ if (__propIsEnum7.call(b, prop))
861
+ __defNormalProp7(a, prop, b[prop]);
715
862
  }
716
863
  return a;
717
864
  };
718
- var __spreadProps5 = (a, b) => __defProps5(a, __getOwnPropDescs5(b));
865
+ var __spreadProps6 = (a, b) => __defProps6(a, __getOwnPropDescs6(b));
719
866
  var __objRest = (source, exclude) => {
720
867
  var target = {};
721
868
  for (var prop in source)
722
- if (__hasOwnProp6.call(source, prop) && exclude.indexOf(prop) < 0)
869
+ if (__hasOwnProp7.call(source, prop) && exclude.indexOf(prop) < 0)
723
870
  target[prop] = source[prop];
724
- if (source != null && __getOwnPropSymbols6)
725
- for (var prop of __getOwnPropSymbols6(source)) {
726
- if (exclude.indexOf(prop) < 0 && __propIsEnum6.call(source, prop))
871
+ if (source != null && __getOwnPropSymbols7)
872
+ for (var prop of __getOwnPropSymbols7(source)) {
873
+ if (exclude.indexOf(prop) < 0 && __propIsEnum7.call(source, prop))
727
874
  target[prop] = source[prop];
728
875
  }
729
876
  return target;
@@ -782,8 +929,8 @@ var getRepeatItemData = ({
782
929
  const collectionName = repeat.collection.split(".").pop();
783
930
  const itemNameToUse = repeat.itemName || (collectionName ? collectionName + "Item" : "item");
784
931
  const repeatArray = itemsArray.map((item, index) => ({
785
- context: __spreadProps5(__spreadValues6({}, context), {
786
- localState: __spreadProps5(__spreadValues6({}, context.localState), {
932
+ context: __spreadProps6(__spreadValues7({}, context), {
933
+ localState: __spreadProps6(__spreadValues7({}, context.localState), {
787
934
  $index: index,
788
935
  $item: item,
789
936
  [itemNameToUse]: item,
@@ -904,24 +1051,24 @@ function InteractiveElement(props) {
904
1051
  var interactive_element_default = InteractiveElement;
905
1052
 
906
1053
  // src/components/block/components/component-ref/component-ref.helpers.js
907
- var __defProp7 = Object.defineProperty;
908
- var __getOwnPropSymbols7 = Object.getOwnPropertySymbols;
909
- var __hasOwnProp7 = Object.prototype.hasOwnProperty;
910
- var __propIsEnum7 = Object.prototype.propertyIsEnumerable;
911
- var __defNormalProp7 = (obj, key, value) => key in obj ? __defProp7(obj, key, {
1054
+ var __defProp8 = Object.defineProperty;
1055
+ var __getOwnPropSymbols8 = Object.getOwnPropertySymbols;
1056
+ var __hasOwnProp8 = Object.prototype.hasOwnProperty;
1057
+ var __propIsEnum8 = Object.prototype.propertyIsEnumerable;
1058
+ var __defNormalProp8 = (obj, key, value) => key in obj ? __defProp8(obj, key, {
912
1059
  enumerable: true,
913
1060
  configurable: true,
914
1061
  writable: true,
915
1062
  value
916
1063
  }) : obj[key] = value;
917
- var __spreadValues7 = (a, b) => {
1064
+ var __spreadValues8 = (a, b) => {
918
1065
  for (var prop in b || (b = {}))
919
- if (__hasOwnProp7.call(b, prop))
920
- __defNormalProp7(a, prop, b[prop]);
921
- if (__getOwnPropSymbols7)
922
- for (var prop of __getOwnPropSymbols7(b)) {
923
- if (__propIsEnum7.call(b, prop))
924
- __defNormalProp7(a, prop, b[prop]);
1066
+ if (__hasOwnProp8.call(b, prop))
1067
+ __defNormalProp8(a, prop, b[prop]);
1068
+ if (__getOwnPropSymbols8)
1069
+ for (var prop of __getOwnPropSymbols8(b)) {
1070
+ if (__propIsEnum8.call(b, prop))
1071
+ __defNormalProp8(a, prop, b[prop]);
925
1072
  }
926
1073
  return a;
927
1074
  };
@@ -940,7 +1087,7 @@ var getWrapperProps = ({
940
1087
  context,
941
1088
  wrapperProps: componentOptions
942
1089
  };
943
- return isInteractive ? interactiveElementProps : __spreadValues7(__spreadValues7({}, componentOptions), includeBlockProps ? {
1090
+ return isInteractive ? interactiveElementProps : __spreadValues8(__spreadValues8({}, componentOptions), includeBlockProps ? {
944
1091
  attributes: getBlockProperties({
945
1092
  block: builderBlock,
946
1093
  context: contextValue
@@ -1747,31 +1894,31 @@ function SectionComponent(props) {
1747
1894
  var section_default = SectionComponent;
1748
1895
 
1749
1896
  // src/components/content-variants/helpers.js
1750
- var __defProp8 = Object.defineProperty;
1751
- var __defProps6 = Object.defineProperties;
1752
- var __getOwnPropDescs6 = Object.getOwnPropertyDescriptors;
1753
- var __getOwnPropSymbols8 = Object.getOwnPropertySymbols;
1754
- var __hasOwnProp8 = Object.prototype.hasOwnProperty;
1755
- var __propIsEnum8 = Object.prototype.propertyIsEnumerable;
1756
- var __defNormalProp8 = (obj, key, value) => key in obj ? __defProp8(obj, key, {
1897
+ var __defProp9 = Object.defineProperty;
1898
+ var __defProps7 = Object.defineProperties;
1899
+ var __getOwnPropDescs7 = Object.getOwnPropertyDescriptors;
1900
+ var __getOwnPropSymbols9 = Object.getOwnPropertySymbols;
1901
+ var __hasOwnProp9 = Object.prototype.hasOwnProperty;
1902
+ var __propIsEnum9 = Object.prototype.propertyIsEnumerable;
1903
+ var __defNormalProp9 = (obj, key, value) => key in obj ? __defProp9(obj, key, {
1757
1904
  enumerable: true,
1758
1905
  configurable: true,
1759
1906
  writable: true,
1760
1907
  value
1761
1908
  }) : obj[key] = value;
1762
- var __spreadValues8 = (a, b) => {
1909
+ var __spreadValues9 = (a, b) => {
1763
1910
  for (var prop in b || (b = {}))
1764
- if (__hasOwnProp8.call(b, prop))
1765
- __defNormalProp8(a, prop, b[prop]);
1766
- if (__getOwnPropSymbols8)
1767
- for (var prop of __getOwnPropSymbols8(b)) {
1768
- if (__propIsEnum8.call(b, prop))
1769
- __defNormalProp8(a, prop, b[prop]);
1911
+ if (__hasOwnProp9.call(b, prop))
1912
+ __defNormalProp9(a, prop, b[prop]);
1913
+ if (__getOwnPropSymbols9)
1914
+ for (var prop of __getOwnPropSymbols9(b)) {
1915
+ if (__propIsEnum9.call(b, prop))
1916
+ __defNormalProp9(a, prop, b[prop]);
1770
1917
  }
1771
1918
  return a;
1772
1919
  };
1773
- var __spreadProps6 = (a, b) => __defProps6(a, __getOwnPropDescs6(b));
1774
- var getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => __spreadProps6(__spreadValues8({}, variant), {
1920
+ var __spreadProps7 = (a, b) => __defProps7(a, __getOwnPropDescs7(b));
1921
+ var getVariants = (content) => Object.values((content == null ? void 0 : content.variations) || {}).map((variant) => __spreadProps7(__spreadValues9({}, variant), {
1775
1922
  testVariationId: variant.id,
1776
1923
  id: content == null ? void 0 : content.id
1777
1924
  }));
@@ -2683,42 +2830,40 @@ var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
2683
2830
  function CustomCode(props) {
2684
2831
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
2685
2832
  const [scriptsRun, setScriptsRun] = createSignal([]);
2686
- function findAndRunScripts() {
2687
- if (elem && elem.getElementsByTagName && typeof window !== "undefined") {
2688
- const scripts = elem.getElementsByTagName("script");
2689
- for (let i = 0; i < scripts.length; i++) {
2690
- const script = scripts[i];
2691
- if (script.src) {
2692
- if (scriptsInserted().includes(script.src)) {
2693
- continue;
2694
- }
2695
- scriptsInserted().push(script.src);
2696
- const newScript = document.createElement("script");
2697
- newScript.async = true;
2698
- newScript.src = script.src;
2699
- document.head.appendChild(newScript);
2700
- } else if (!script.type || ["text/javascript", "application/javascript", "application/ecmascript"].includes(script.type)) {
2701
- if (scriptsRun().includes(script.innerText)) {
2702
- continue;
2703
- }
2704
- try {
2705
- scriptsRun().push(script.innerText);
2706
- new Function(script.innerText)();
2707
- } catch (error) {
2708
- console.warn("`CustomCode`: Error running script:", error);
2709
- }
2833
+ let elementRef;
2834
+ onMount(() => {
2835
+ if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
2836
+ return;
2837
+ }
2838
+ const scripts = elementRef.getElementsByTagName("script");
2839
+ for (let i = 0; i < scripts.length; i++) {
2840
+ const script = scripts[i];
2841
+ if (script.src) {
2842
+ if (scriptsInserted().includes(script.src)) {
2843
+ continue;
2844
+ }
2845
+ scriptsInserted().push(script.src);
2846
+ const newScript = document.createElement("script");
2847
+ newScript.async = true;
2848
+ newScript.src = script.src;
2849
+ document.head.appendChild(newScript);
2850
+ } else if (!script.type || ["text/javascript", "application/javascript", "application/ecmascript"].includes(script.type)) {
2851
+ if (scriptsRun().includes(script.innerText)) {
2852
+ continue;
2853
+ }
2854
+ try {
2855
+ scriptsRun().push(script.innerText);
2856
+ new Function(script.innerText)();
2857
+ } catch (error) {
2858
+ console.warn("`CustomCode`: Error running script:", error);
2710
2859
  }
2711
2860
  }
2712
2861
  }
2713
- }
2714
- let elem;
2715
- onMount(() => {
2716
- findAndRunScripts();
2717
2862
  });
2718
2863
  return (() => {
2719
2864
  const _el$ = _tmpl$13();
2720
- const _ref$ = elem;
2721
- typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
2865
+ const _ref$ = elementRef;
2866
+ typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
2722
2867
  effect((_p$) => {
2723
2868
  const _v$ = "builder-custom-code" + (props.replaceNodes ? " replace-nodes" : ""), _v$2 = props.code;
2724
2869
  _v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
@@ -2759,84 +2904,84 @@ var componentInfo11 = {
2759
2904
  };
2760
2905
 
2761
2906
  // src/constants/builder-registered-components.js
2762
- var __defProp9 = Object.defineProperty;
2763
- var __getOwnPropSymbols9 = Object.getOwnPropertySymbols;
2764
- var __hasOwnProp9 = Object.prototype.hasOwnProperty;
2765
- var __propIsEnum9 = Object.prototype.propertyIsEnumerable;
2766
- var __defNormalProp9 = (obj, key, value) => key in obj ? __defProp9(obj, key, {
2907
+ var __defProp10 = Object.defineProperty;
2908
+ var __getOwnPropSymbols10 = Object.getOwnPropertySymbols;
2909
+ var __hasOwnProp10 = Object.prototype.hasOwnProperty;
2910
+ var __propIsEnum10 = Object.prototype.propertyIsEnumerable;
2911
+ var __defNormalProp10 = (obj, key, value) => key in obj ? __defProp10(obj, key, {
2767
2912
  enumerable: true,
2768
2913
  configurable: true,
2769
2914
  writable: true,
2770
2915
  value
2771
2916
  }) : obj[key] = value;
2772
- var __spreadValues9 = (a, b) => {
2917
+ var __spreadValues10 = (a, b) => {
2773
2918
  for (var prop in b || (b = {}))
2774
- if (__hasOwnProp9.call(b, prop))
2775
- __defNormalProp9(a, prop, b[prop]);
2776
- if (__getOwnPropSymbols9)
2777
- for (var prop of __getOwnPropSymbols9(b)) {
2778
- if (__propIsEnum9.call(b, prop))
2779
- __defNormalProp9(a, prop, b[prop]);
2919
+ if (__hasOwnProp10.call(b, prop))
2920
+ __defNormalProp10(a, prop, b[prop]);
2921
+ if (__getOwnPropSymbols10)
2922
+ for (var prop of __getOwnPropSymbols10(b)) {
2923
+ if (__propIsEnum10.call(b, prop))
2924
+ __defNormalProp10(a, prop, b[prop]);
2780
2925
  }
2781
2926
  return a;
2782
2927
  };
2783
- var getDefaultRegisteredComponents = () => [__spreadValues9({
2928
+ var getDefaultRegisteredComponents = () => [__spreadValues10({
2784
2929
  component: button_default
2785
- }, componentInfo), __spreadValues9({
2930
+ }, componentInfo), __spreadValues10({
2786
2931
  component: columns_default
2787
- }, componentInfo2), __spreadValues9({
2932
+ }, componentInfo2), __spreadValues10({
2788
2933
  component: custom_code_default
2789
- }, componentInfo11), __spreadValues9({
2934
+ }, componentInfo11), __spreadValues10({
2790
2935
  component: embed_default
2791
- }, componentInfo9), __spreadValues9({
2936
+ }, componentInfo9), __spreadValues10({
2792
2937
  component: fragment_default
2793
- }, componentInfo3), __spreadValues9({
2938
+ }, componentInfo3), __spreadValues10({
2794
2939
  component: image_default
2795
- }, componentInfo4), __spreadValues9({
2940
+ }, componentInfo4), __spreadValues10({
2796
2941
  component: img_default
2797
- }, componentInfo10), __spreadValues9({
2942
+ }, componentInfo10), __spreadValues10({
2798
2943
  component: section_default
2799
- }, componentInfo5), __spreadValues9({
2944
+ }, componentInfo5), __spreadValues10({
2800
2945
  component: symbol_default
2801
- }, componentInfo6), __spreadValues9({
2946
+ }, componentInfo6), __spreadValues10({
2802
2947
  component: text_default
2803
- }, componentInfo7), __spreadValues9({
2948
+ }, componentInfo7), __spreadValues10({
2804
2949
  component: video_default
2805
2950
  }, componentInfo8)];
2806
2951
 
2807
2952
  // src/functions/register-component.js
2808
- var __defProp10 = Object.defineProperty;
2809
- var __defProps7 = Object.defineProperties;
2810
- var __getOwnPropDescs7 = Object.getOwnPropertyDescriptors;
2811
- var __getOwnPropSymbols10 = Object.getOwnPropertySymbols;
2812
- var __hasOwnProp10 = Object.prototype.hasOwnProperty;
2813
- var __propIsEnum10 = Object.prototype.propertyIsEnumerable;
2814
- var __defNormalProp10 = (obj, key, value) => key in obj ? __defProp10(obj, key, {
2953
+ var __defProp11 = Object.defineProperty;
2954
+ var __defProps8 = Object.defineProperties;
2955
+ var __getOwnPropDescs8 = Object.getOwnPropertyDescriptors;
2956
+ var __getOwnPropSymbols11 = Object.getOwnPropertySymbols;
2957
+ var __hasOwnProp11 = Object.prototype.hasOwnProperty;
2958
+ var __propIsEnum11 = Object.prototype.propertyIsEnumerable;
2959
+ var __defNormalProp11 = (obj, key, value) => key in obj ? __defProp11(obj, key, {
2815
2960
  enumerable: true,
2816
2961
  configurable: true,
2817
2962
  writable: true,
2818
2963
  value
2819
2964
  }) : obj[key] = value;
2820
- var __spreadValues10 = (a, b) => {
2965
+ var __spreadValues11 = (a, b) => {
2821
2966
  for (var prop in b || (b = {}))
2822
- if (__hasOwnProp10.call(b, prop))
2823
- __defNormalProp10(a, prop, b[prop]);
2824
- if (__getOwnPropSymbols10)
2825
- for (var prop of __getOwnPropSymbols10(b)) {
2826
- if (__propIsEnum10.call(b, prop))
2827
- __defNormalProp10(a, prop, b[prop]);
2967
+ if (__hasOwnProp11.call(b, prop))
2968
+ __defNormalProp11(a, prop, b[prop]);
2969
+ if (__getOwnPropSymbols11)
2970
+ for (var prop of __getOwnPropSymbols11(b)) {
2971
+ if (__propIsEnum11.call(b, prop))
2972
+ __defNormalProp11(a, prop, b[prop]);
2828
2973
  }
2829
2974
  return a;
2830
2975
  };
2831
- var __spreadProps7 = (a, b) => __defProps7(a, __getOwnPropDescs7(b));
2976
+ var __spreadProps8 = (a, b) => __defProps8(a, __getOwnPropDescs8(b));
2832
2977
  var __objRest2 = (source, exclude) => {
2833
2978
  var target = {};
2834
2979
  for (var prop in source)
2835
- if (__hasOwnProp10.call(source, prop) && exclude.indexOf(prop) < 0)
2980
+ if (__hasOwnProp11.call(source, prop) && exclude.indexOf(prop) < 0)
2836
2981
  target[prop] = source[prop];
2837
- if (source != null && __getOwnPropSymbols10)
2838
- for (var prop of __getOwnPropSymbols10(source)) {
2839
- if (exclude.indexOf(prop) < 0 && __propIsEnum10.call(source, prop))
2982
+ if (source != null && __getOwnPropSymbols11)
2983
+ for (var prop of __getOwnPropSymbols11(source)) {
2984
+ if (exclude.indexOf(prop) < 0 && __propIsEnum11.call(source, prop))
2840
2985
  target[prop] = source[prop];
2841
2986
  }
2842
2987
  return target;
@@ -2856,8 +3001,8 @@ var serializeComponentInfo = (_a) => {
2856
3001
  var _b = _a, {
2857
3002
  inputs
2858
3003
  } = _b, info = __objRest2(_b, ["inputs"]);
2859
- return __spreadProps7(__spreadValues10({}, fastClone(info)), {
2860
- inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => __spreadProps7(__spreadValues10({}, acc), {
3004
+ return __spreadProps8(__spreadValues11({}, fastClone(info)), {
3005
+ inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => __spreadProps8(__spreadValues11({}, acc), {
2861
3006
  [key]: serializeValue(value)
2862
3007
  }), {}))
2863
3008
  });
@@ -2953,30 +3098,30 @@ ${getFontCss({
2953
3098
  var styles_default = ContentStyles;
2954
3099
 
2955
3100
  // src/components/content/content.helpers.js
2956
- var __defProp11 = Object.defineProperty;
2957
- var __defProps8 = Object.defineProperties;
2958
- var __getOwnPropDescs8 = Object.getOwnPropertyDescriptors;
2959
- var __getOwnPropSymbols11 = Object.getOwnPropertySymbols;
2960
- var __hasOwnProp11 = Object.prototype.hasOwnProperty;
2961
- var __propIsEnum11 = Object.prototype.propertyIsEnumerable;
2962
- var __defNormalProp11 = (obj, key, value) => key in obj ? __defProp11(obj, key, {
3101
+ var __defProp12 = Object.defineProperty;
3102
+ var __defProps9 = Object.defineProperties;
3103
+ var __getOwnPropDescs9 = Object.getOwnPropertyDescriptors;
3104
+ var __getOwnPropSymbols12 = Object.getOwnPropertySymbols;
3105
+ var __hasOwnProp12 = Object.prototype.hasOwnProperty;
3106
+ var __propIsEnum12 = Object.prototype.propertyIsEnumerable;
3107
+ var __defNormalProp12 = (obj, key, value) => key in obj ? __defProp12(obj, key, {
2963
3108
  enumerable: true,
2964
3109
  configurable: true,
2965
3110
  writable: true,
2966
3111
  value
2967
3112
  }) : obj[key] = value;
2968
- var __spreadValues11 = (a, b) => {
3113
+ var __spreadValues12 = (a, b) => {
2969
3114
  for (var prop in b || (b = {}))
2970
- if (__hasOwnProp11.call(b, prop))
2971
- __defNormalProp11(a, prop, b[prop]);
2972
- if (__getOwnPropSymbols11)
2973
- for (var prop of __getOwnPropSymbols11(b)) {
2974
- if (__propIsEnum11.call(b, prop))
2975
- __defNormalProp11(a, prop, b[prop]);
3115
+ if (__hasOwnProp12.call(b, prop))
3116
+ __defNormalProp12(a, prop, b[prop]);
3117
+ if (__getOwnPropSymbols12)
3118
+ for (var prop of __getOwnPropSymbols12(b)) {
3119
+ if (__propIsEnum12.call(b, prop))
3120
+ __defNormalProp12(a, prop, b[prop]);
2976
3121
  }
2977
3122
  return a;
2978
3123
  };
2979
- var __spreadProps8 = (a, b) => __defProps8(a, __getOwnPropDescs8(b));
3124
+ var __spreadProps9 = (a, b) => __defProps9(a, __getOwnPropDescs9(b));
2980
3125
  var getContextStateInitialValue = ({
2981
3126
  content,
2982
3127
  data,
@@ -2990,17 +3135,17 @@ var getContextStateInitialValue = ({
2990
3135
  defaultValues[input.name] = input.defaultValue;
2991
3136
  }
2992
3137
  });
2993
- const stateToUse = __spreadValues11(__spreadValues11(__spreadValues11({}, (_c = content == null ? void 0 : content.data) == null ? void 0 : _c.state), data), locale ? {
3138
+ const stateToUse = __spreadValues12(__spreadValues12(__spreadValues12({}, (_c = content == null ? void 0 : content.data) == null ? void 0 : _c.state), data), locale ? {
2994
3139
  locale
2995
3140
  } : {});
2996
- return __spreadValues11(__spreadValues11({}, defaultValues), stateToUse);
3141
+ return __spreadValues12(__spreadValues12({}, defaultValues), stateToUse);
2997
3142
  };
2998
3143
  var getContentInitialValue = ({
2999
3144
  content,
3000
3145
  data
3001
3146
  }) => {
3002
- return !content ? void 0 : __spreadProps8(__spreadValues11({}, content), {
3003
- data: __spreadValues11(__spreadValues11({}, content == null ? void 0 : content.data), data),
3147
+ return !content ? void 0 : __spreadProps9(__spreadValues12({}, content), {
3148
+ data: __spreadValues12(__spreadValues12({}, content == null ? void 0 : content.data), data),
3004
3149
  meta: content == null ? void 0 : content.meta
3005
3150
  });
3006
3151
  };
@@ -3250,38 +3395,38 @@ var setVisitorId = ({
3250
3395
  });
3251
3396
 
3252
3397
  // src/functions/track/index.js
3253
- var __defProp12 = Object.defineProperty;
3254
- var __defProps9 = Object.defineProperties;
3255
- var __getOwnPropDescs9 = Object.getOwnPropertyDescriptors;
3256
- var __getOwnPropSymbols12 = Object.getOwnPropertySymbols;
3257
- var __hasOwnProp12 = Object.prototype.hasOwnProperty;
3258
- var __propIsEnum12 = Object.prototype.propertyIsEnumerable;
3259
- var __defNormalProp12 = (obj, key, value) => key in obj ? __defProp12(obj, key, {
3398
+ var __defProp13 = Object.defineProperty;
3399
+ var __defProps10 = Object.defineProperties;
3400
+ var __getOwnPropDescs10 = Object.getOwnPropertyDescriptors;
3401
+ var __getOwnPropSymbols13 = Object.getOwnPropertySymbols;
3402
+ var __hasOwnProp13 = Object.prototype.hasOwnProperty;
3403
+ var __propIsEnum13 = Object.prototype.propertyIsEnumerable;
3404
+ var __defNormalProp13 = (obj, key, value) => key in obj ? __defProp13(obj, key, {
3260
3405
  enumerable: true,
3261
3406
  configurable: true,
3262
3407
  writable: true,
3263
3408
  value
3264
3409
  }) : obj[key] = value;
3265
- var __spreadValues12 = (a, b) => {
3410
+ var __spreadValues13 = (a, b) => {
3266
3411
  for (var prop in b || (b = {}))
3267
- if (__hasOwnProp12.call(b, prop))
3268
- __defNormalProp12(a, prop, b[prop]);
3269
- if (__getOwnPropSymbols12)
3270
- for (var prop of __getOwnPropSymbols12(b)) {
3271
- if (__propIsEnum12.call(b, prop))
3272
- __defNormalProp12(a, prop, b[prop]);
3412
+ if (__hasOwnProp13.call(b, prop))
3413
+ __defNormalProp13(a, prop, b[prop]);
3414
+ if (__getOwnPropSymbols13)
3415
+ for (var prop of __getOwnPropSymbols13(b)) {
3416
+ if (__propIsEnum13.call(b, prop))
3417
+ __defNormalProp13(a, prop, b[prop]);
3273
3418
  }
3274
3419
  return a;
3275
3420
  };
3276
- var __spreadProps9 = (a, b) => __defProps9(a, __getOwnPropDescs9(b));
3421
+ var __spreadProps10 = (a, b) => __defProps10(a, __getOwnPropDescs10(b));
3277
3422
  var __objRest3 = (source, exclude) => {
3278
3423
  var target = {};
3279
3424
  for (var prop in source)
3280
- if (__hasOwnProp12.call(source, prop) && exclude.indexOf(prop) < 0)
3425
+ if (__hasOwnProp13.call(source, prop) && exclude.indexOf(prop) < 0)
3281
3426
  target[prop] = source[prop];
3282
- if (source != null && __getOwnPropSymbols12)
3283
- for (var prop of __getOwnPropSymbols12(source)) {
3284
- if (exclude.indexOf(prop) < 0 && __propIsEnum12.call(source, prop))
3427
+ if (source != null && __getOwnPropSymbols13)
3428
+ for (var prop of __getOwnPropSymbols13(source)) {
3429
+ if (exclude.indexOf(prop) < 0 && __propIsEnum13.call(source, prop))
3285
3430
  target[prop] = source[prop];
3286
3431
  }
3287
3432
  return target;
@@ -3335,8 +3480,8 @@ var createEvent = (_a) => __async3(void 0, null, function* () {
3335
3480
  } = _b, properties = __objRest3(_b, ["type", "canTrack", "apiKey", "metadata"]);
3336
3481
  return {
3337
3482
  type: eventType,
3338
- data: __spreadProps9(__spreadValues12(__spreadProps9(__spreadValues12({}, properties), {
3339
- metadata: __spreadValues12({
3483
+ data: __spreadProps10(__spreadValues13(__spreadProps10(__spreadValues13({}, properties), {
3484
+ metadata: __spreadValues13({
3340
3485
  url: location.href
3341
3486
  }, metadata)
3342
3487
  }), yield getTrackingEventData({
@@ -3376,12 +3521,12 @@ function _track(eventProps) {
3376
3521
  });
3377
3522
  });
3378
3523
  }
3379
- var track = (args) => _track(__spreadProps9(__spreadValues12({}, args), {
3524
+ var track = (args) => _track(__spreadProps10(__spreadValues13({}, args), {
3380
3525
  canTrack: true
3381
3526
  }));
3382
3527
 
3383
3528
  // src/constants/sdk-version.js
3384
- var SDK_VERSION = "0.6.4";
3529
+ var SDK_VERSION = "0.7.1-0";
3385
3530
 
3386
3531
  // src/functions/register.js
3387
3532
  var registry = {};
@@ -3574,24 +3719,24 @@ var getInteractionPropertiesForEvent = (event) => {
3574
3719
  };
3575
3720
 
3576
3721
  // src/helpers/ab-tests.js
3577
- var __defProp13 = Object.defineProperty;
3578
- var __getOwnPropSymbols13 = Object.getOwnPropertySymbols;
3579
- var __hasOwnProp13 = Object.prototype.hasOwnProperty;
3580
- var __propIsEnum13 = Object.prototype.propertyIsEnumerable;
3581
- var __defNormalProp13 = (obj, key, value) => key in obj ? __defProp13(obj, key, {
3722
+ var __defProp14 = Object.defineProperty;
3723
+ var __getOwnPropSymbols14 = Object.getOwnPropertySymbols;
3724
+ var __hasOwnProp14 = Object.prototype.hasOwnProperty;
3725
+ var __propIsEnum14 = Object.prototype.propertyIsEnumerable;
3726
+ var __defNormalProp14 = (obj, key, value) => key in obj ? __defProp14(obj, key, {
3582
3727
  enumerable: true,
3583
3728
  configurable: true,
3584
3729
  writable: true,
3585
3730
  value
3586
3731
  }) : obj[key] = value;
3587
- var __spreadValues13 = (a, b) => {
3732
+ var __spreadValues14 = (a, b) => {
3588
3733
  for (var prop in b || (b = {}))
3589
- if (__hasOwnProp13.call(b, prop))
3590
- __defNormalProp13(a, prop, b[prop]);
3591
- if (__getOwnPropSymbols13)
3592
- for (var prop of __getOwnPropSymbols13(b)) {
3593
- if (__propIsEnum13.call(b, prop))
3594
- __defNormalProp13(a, prop, b[prop]);
3734
+ if (__hasOwnProp14.call(b, prop))
3735
+ __defNormalProp14(a, prop, b[prop]);
3736
+ if (__getOwnPropSymbols14)
3737
+ for (var prop of __getOwnPropSymbols14(b)) {
3738
+ if (__propIsEnum14.call(b, prop))
3739
+ __defNormalProp14(a, prop, b[prop]);
3595
3740
  }
3596
3741
  return a;
3597
3742
  };
@@ -3707,7 +3852,7 @@ var handleABTestingSync = ({
3707
3852
  item,
3708
3853
  testGroupId
3709
3854
  });
3710
- return __spreadValues13(__spreadValues13({}, item), variationValue);
3855
+ return __spreadValues14(__spreadValues14({}, item), variationValue);
3711
3856
  };
3712
3857
  var handleABTesting = (_0) => __async4(void 0, [_0], function* ({
3713
3858
  item,
@@ -3730,7 +3875,7 @@ var handleABTesting = (_0) => __async4(void 0, [_0], function* ({
3730
3875
  item,
3731
3876
  testGroupId
3732
3877
  });
3733
- return __spreadValues13(__spreadValues13({}, item), variationValue);
3878
+ return __spreadValues14(__spreadValues14({}, item), variationValue);
3734
3879
  });
3735
3880
 
3736
3881
  // src/helpers/canTrack.js
@@ -3742,36 +3887,36 @@ function getPreviewContent(_searchParams) {
3742
3887
  }
3743
3888
 
3744
3889
  // src/helpers/flatten.js
3745
- var __defProp14 = Object.defineProperty;
3746
- var __defProps10 = Object.defineProperties;
3747
- var __getOwnPropDescs10 = Object.getOwnPropertyDescriptors;
3748
- var __getOwnPropSymbols14 = Object.getOwnPropertySymbols;
3749
- var __hasOwnProp14 = Object.prototype.hasOwnProperty;
3750
- var __propIsEnum14 = Object.prototype.propertyIsEnumerable;
3751
- var __defNormalProp14 = (obj, key, value) => key in obj ? __defProp14(obj, key, {
3890
+ var __defProp15 = Object.defineProperty;
3891
+ var __defProps11 = Object.defineProperties;
3892
+ var __getOwnPropDescs11 = Object.getOwnPropertyDescriptors;
3893
+ var __getOwnPropSymbols15 = Object.getOwnPropertySymbols;
3894
+ var __hasOwnProp15 = Object.prototype.hasOwnProperty;
3895
+ var __propIsEnum15 = Object.prototype.propertyIsEnumerable;
3896
+ var __defNormalProp15 = (obj, key, value) => key in obj ? __defProp15(obj, key, {
3752
3897
  enumerable: true,
3753
3898
  configurable: true,
3754
3899
  writable: true,
3755
3900
  value
3756
3901
  }) : obj[key] = value;
3757
- var __spreadValues14 = (a, b) => {
3902
+ var __spreadValues15 = (a, b) => {
3758
3903
  for (var prop in b || (b = {}))
3759
- if (__hasOwnProp14.call(b, prop))
3760
- __defNormalProp14(a, prop, b[prop]);
3761
- if (__getOwnPropSymbols14)
3762
- for (var prop of __getOwnPropSymbols14(b)) {
3763
- if (__propIsEnum14.call(b, prop))
3764
- __defNormalProp14(a, prop, b[prop]);
3904
+ if (__hasOwnProp15.call(b, prop))
3905
+ __defNormalProp15(a, prop, b[prop]);
3906
+ if (__getOwnPropSymbols15)
3907
+ for (var prop of __getOwnPropSymbols15(b)) {
3908
+ if (__propIsEnum15.call(b, prop))
3909
+ __defNormalProp15(a, prop, b[prop]);
3765
3910
  }
3766
3911
  return a;
3767
3912
  };
3768
- var __spreadProps10 = (a, b) => __defProps10(a, __getOwnPropDescs10(b));
3913
+ var __spreadProps11 = (a, b) => __defProps11(a, __getOwnPropDescs11(b));
3769
3914
  function flatten(object, path = null, separator = ".") {
3770
3915
  return Object.keys(object).reduce((acc, key) => {
3771
3916
  const value = object[key];
3772
3917
  const newPath = [path, key].filter(Boolean).join(separator);
3773
3918
  const isObject = [typeof value === "object", value !== null, !(Array.isArray(value) && value.length === 0)].every(Boolean);
3774
- return isObject ? __spreadValues14(__spreadValues14({}, acc), flatten(value, newPath, separator)) : __spreadProps10(__spreadValues14({}, acc), {
3919
+ return isObject ? __spreadValues15(__spreadValues15({}, acc), flatten(value, newPath, separator)) : __spreadProps11(__spreadValues15({}, acc), {
3775
3920
  [newPath]: value
3776
3921
  });
3777
3922
  }, {});
@@ -3814,39 +3959,49 @@ var normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchP
3814
3959
  var DEFAULT_API_VERSION = "v3";
3815
3960
 
3816
3961
  // src/functions/get-content/generate-content-url.js
3817
- var __defProp15 = Object.defineProperty;
3818
- var __getOwnPropSymbols15 = Object.getOwnPropertySymbols;
3819
- var __hasOwnProp15 = Object.prototype.hasOwnProperty;
3820
- var __propIsEnum15 = Object.prototype.propertyIsEnumerable;
3821
- var __defNormalProp15 = (obj, key, value) => key in obj ? __defProp15(obj, key, {
3962
+ var __defProp16 = Object.defineProperty;
3963
+ var __getOwnPropSymbols16 = Object.getOwnPropertySymbols;
3964
+ var __hasOwnProp16 = Object.prototype.hasOwnProperty;
3965
+ var __propIsEnum16 = Object.prototype.propertyIsEnumerable;
3966
+ var __defNormalProp16 = (obj, key, value) => key in obj ? __defProp16(obj, key, {
3822
3967
  enumerable: true,
3823
3968
  configurable: true,
3824
3969
  writable: true,
3825
3970
  value
3826
3971
  }) : obj[key] = value;
3827
- var __spreadValues15 = (a, b) => {
3972
+ var __spreadValues16 = (a, b) => {
3828
3973
  for (var prop in b || (b = {}))
3829
- if (__hasOwnProp15.call(b, prop))
3830
- __defNormalProp15(a, prop, b[prop]);
3831
- if (__getOwnPropSymbols15)
3832
- for (var prop of __getOwnPropSymbols15(b)) {
3833
- if (__propIsEnum15.call(b, prop))
3834
- __defNormalProp15(a, prop, b[prop]);
3974
+ if (__hasOwnProp16.call(b, prop))
3975
+ __defNormalProp16(a, prop, b[prop]);
3976
+ if (__getOwnPropSymbols16)
3977
+ for (var prop of __getOwnPropSymbols16(b)) {
3978
+ if (__propIsEnum16.call(b, prop))
3979
+ __defNormalProp16(a, prop, b[prop]);
3835
3980
  }
3836
3981
  return a;
3837
3982
  };
3983
+ var isPositiveNumber = (thing) => typeof thing === "number" && !isNaN(thing) && thing >= 0;
3838
3984
  var generateContentUrl = (options) => {
3985
+ let {
3986
+ noTraverse = false
3987
+ } = options;
3839
3988
  const {
3840
3989
  limit = 30,
3841
3990
  userAttributes,
3842
3991
  query,
3843
- noTraverse = false,
3844
3992
  model,
3845
3993
  apiKey,
3846
3994
  includeRefs = true,
3847
3995
  enrich,
3848
3996
  locale,
3849
- apiVersion = DEFAULT_API_VERSION
3997
+ apiVersion = DEFAULT_API_VERSION,
3998
+ fields,
3999
+ omit,
4000
+ offset,
4001
+ cacheSeconds,
4002
+ staleCacheSeconds,
4003
+ sort,
4004
+ includeUnpublished
3850
4005
  } = options;
3851
4006
  if (!apiKey) {
3852
4007
  throw new Error("Missing API key");
@@ -3854,8 +4009,35 @@ var generateContentUrl = (options) => {
3854
4009
  if (!["v2", "v3"].includes(apiVersion)) {
3855
4010
  throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${apiVersion}'`);
3856
4011
  }
4012
+ if ((options.limit === void 0 || options.limit > 1) && !("noTraverse" in options)) {
4013
+ noTraverse = true;
4014
+ }
3857
4015
  const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}&includeRefs=${includeRefs}${locale ? `&locale=${locale}` : ""}${enrich ? `&enrich=${enrich}` : ""}`);
3858
- const queryOptions = __spreadValues15(__spreadValues15({}, getBuilderSearchParamsFromWindow()), normalizeSearchParams(options.options || {}));
4016
+ url.searchParams.set("omit", omit || "meta.componentsUsed");
4017
+ if (fields) {
4018
+ url.searchParams.set("fields", fields);
4019
+ }
4020
+ if (Number.isFinite(offset) && offset > -1) {
4021
+ url.searchParams.set("offset", String(Math.floor(offset)));
4022
+ }
4023
+ if (typeof includeUnpublished === "boolean") {
4024
+ url.searchParams.set("includeUnpublished", String(includeUnpublished));
4025
+ }
4026
+ if (cacheSeconds && isPositiveNumber(cacheSeconds)) {
4027
+ url.searchParams.set("cacheSeconds", String(cacheSeconds));
4028
+ }
4029
+ if (staleCacheSeconds && isPositiveNumber(staleCacheSeconds)) {
4030
+ url.searchParams.set("staleCacheSeconds", String(staleCacheSeconds));
4031
+ }
4032
+ if (sort) {
4033
+ const flattened2 = flatten({
4034
+ sort
4035
+ });
4036
+ for (const key in flattened2) {
4037
+ url.searchParams.set(key, JSON.stringify(flattened2[key]));
4038
+ }
4039
+ }
4040
+ const queryOptions = __spreadValues16(__spreadValues16({}, getBuilderSearchParamsFromWindow()), normalizeSearchParams(options.options || {}));
3859
4041
  const flattened = flatten(queryOptions);
3860
4042
  for (const key in flattened) {
3861
4043
  url.searchParams.set(key, String(flattened[key]));
@@ -3875,30 +4057,30 @@ var generateContentUrl = (options) => {
3875
4057
  };
3876
4058
 
3877
4059
  // src/functions/get-content/index.js
3878
- var __defProp16 = Object.defineProperty;
3879
- var __defProps11 = Object.defineProperties;
3880
- var __getOwnPropDescs11 = Object.getOwnPropertyDescriptors;
3881
- var __getOwnPropSymbols16 = Object.getOwnPropertySymbols;
3882
- var __hasOwnProp16 = Object.prototype.hasOwnProperty;
3883
- var __propIsEnum16 = Object.prototype.propertyIsEnumerable;
3884
- var __defNormalProp16 = (obj, key, value) => key in obj ? __defProp16(obj, key, {
4060
+ var __defProp17 = Object.defineProperty;
4061
+ var __defProps12 = Object.defineProperties;
4062
+ var __getOwnPropDescs12 = Object.getOwnPropertyDescriptors;
4063
+ var __getOwnPropSymbols17 = Object.getOwnPropertySymbols;
4064
+ var __hasOwnProp17 = Object.prototype.hasOwnProperty;
4065
+ var __propIsEnum17 = Object.prototype.propertyIsEnumerable;
4066
+ var __defNormalProp17 = (obj, key, value) => key in obj ? __defProp17(obj, key, {
3885
4067
  enumerable: true,
3886
4068
  configurable: true,
3887
4069
  writable: true,
3888
4070
  value
3889
4071
  }) : obj[key] = value;
3890
- var __spreadValues16 = (a, b) => {
4072
+ var __spreadValues17 = (a, b) => {
3891
4073
  for (var prop in b || (b = {}))
3892
- if (__hasOwnProp16.call(b, prop))
3893
- __defNormalProp16(a, prop, b[prop]);
3894
- if (__getOwnPropSymbols16)
3895
- for (var prop of __getOwnPropSymbols16(b)) {
3896
- if (__propIsEnum16.call(b, prop))
3897
- __defNormalProp16(a, prop, b[prop]);
4074
+ if (__hasOwnProp17.call(b, prop))
4075
+ __defNormalProp17(a, prop, b[prop]);
4076
+ if (__getOwnPropSymbols17)
4077
+ for (var prop of __getOwnPropSymbols17(b)) {
4078
+ if (__propIsEnum17.call(b, prop))
4079
+ __defNormalProp17(a, prop, b[prop]);
3898
4080
  }
3899
4081
  return a;
3900
4082
  };
3901
- var __spreadProps11 = (a, b) => __defProps11(a, __getOwnPropDescs11(b));
4083
+ var __spreadProps12 = (a, b) => __defProps12(a, __getOwnPropDescs12(b));
3902
4084
  var __async5 = (__this, __arguments, generator) => {
3903
4085
  return new Promise((resolve, reject) => {
3904
4086
  var fulfilled = (value) => {
@@ -3922,7 +4104,7 @@ var __async5 = (__this, __arguments, generator) => {
3922
4104
  var checkContentHasResults = (content) => "results" in content;
3923
4105
  function fetchOneEntry(options) {
3924
4106
  return __async5(this, null, function* () {
3925
- const allContent = yield fetchEntries(__spreadProps11(__spreadValues16({}, options), {
4107
+ const allContent = yield fetchEntries(__spreadProps12(__spreadValues17({}, options), {
3926
4108
  limit: 1
3927
4109
  }));
3928
4110
  if (allContent) {
@@ -4003,7 +4185,6 @@ function isPreviewing() {
4003
4185
  // src/components/content/components/enable-editor.jsx
4004
4186
  var _tmpl$14 = /* @__PURE__ */ template(`<div>`);
4005
4187
  function EnableEditor(props) {
4006
- const [canTrackToUse, setCanTrackToUse] = createSignal(checkIsDefined(props.canTrack) ? props.canTrack : true);
4007
4188
  const [forceReRenderCount, setForceReRenderCount] = createSignal(0);
4008
4189
  createSignal(0);
4009
4190
  const [shouldSendResetCookie, setShouldSendResetCookie] = createSignal(false);
@@ -4084,7 +4265,7 @@ function EnableEditor(props) {
4084
4265
  const contentId = props.builderContextSignal.content?.id;
4085
4266
  _track({
4086
4267
  type: "click",
4087
- canTrack: canTrackToUse(),
4268
+ canTrack: getDefaultCanTrack(props.canTrack),
4088
4269
  contentId,
4089
4270
  apiKey: props.apiKey,
4090
4271
  variationId: variationId !== contentId ? variationId : void 0,
@@ -4146,11 +4327,8 @@ function EnableEditor(props) {
4146
4327
  }
4147
4328
  let elementRef;
4148
4329
  onMount(() => {
4149
- if (!props.apiKey) {
4150
- logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
4151
- }
4152
4330
  if (isBrowser()) {
4153
- if (isEditing()) {
4331
+ if (isEditing() && true) {
4154
4332
  setForceReRenderCount(forceReRenderCount() + 1);
4155
4333
  window.addEventListener("message", processMessage);
4156
4334
  registerInsertMenu();
@@ -4171,18 +4349,20 @@ function EnableEditor(props) {
4171
4349
  });
4172
4350
  window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate);
4173
4351
  }
4174
- if (props.builderContextSignal.content) {
4352
+ const shouldTrackImpression = props.builderContextSignal.content && getDefaultCanTrack(props.canTrack);
4353
+ if (shouldTrackImpression) {
4175
4354
  const variationId = props.builderContextSignal.content?.testVariationId;
4176
4355
  const contentId = props.builderContextSignal.content?.id;
4356
+ const apiKeyProp = props.apiKey;
4177
4357
  _track({
4178
4358
  type: "impression",
4179
- canTrack: canTrackToUse(),
4359
+ canTrack: true,
4180
4360
  contentId,
4181
- apiKey: props.apiKey,
4361
+ apiKey: apiKeyProp,
4182
4362
  variationId: variationId !== contentId ? variationId : void 0
4183
4363
  });
4184
4364
  }
4185
- if (isPreviewing()) {
4365
+ if (isPreviewing() && true) {
4186
4366
  const searchParams = new URL(location.href).searchParams;
4187
4367
  const searchParamPreviewModel = searchParams.get("builder.preview");
4188
4368
  const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
@@ -4199,11 +4379,16 @@ function EnableEditor(props) {
4199
4379
  });
4200
4380
  }
4201
4381
  }
4202
- evaluateJsCode();
4203
- runHttpRequests();
4204
- emitStateUpdate();
4205
4382
  }
4206
4383
  });
4384
+ onMount(() => {
4385
+ if (!props.apiKey) {
4386
+ logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
4387
+ }
4388
+ evaluateJsCode();
4389
+ runHttpRequests();
4390
+ emitStateUpdate();
4391
+ });
4207
4392
  function onUpdateFn_0() {
4208
4393
  if (props.content) {
4209
4394
  mergeNewContent(props.content);
@@ -4236,16 +4421,17 @@ function EnableEditor(props) {
4236
4421
  },
4237
4422
  get children() {
4238
4423
  const _el$ = _tmpl$14();
4239
- _el$.$$click = (event) => onClick(event);
4240
4424
  const _ref$ = elementRef;
4241
4425
  typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
4242
4426
  spread(_el$, mergeProps({
4243
4427
  get ["class"]() {
4244
4428
  return props.classNameProp;
4245
- },
4429
+ }
4430
+ }, {}, {
4246
4431
  get key() {
4247
4432
  return forceReRenderCount();
4248
4433
  },
4434
+ "onClick": (event) => onClick(event),
4249
4435
  get ["builder-content-id"]() {
4250
4436
  return props.builderContextSignal.content?.id;
4251
4437
  },
@@ -4264,7 +4450,6 @@ function EnableEditor(props) {
4264
4450
  });
4265
4451
  }
4266
4452
  var enable_editor_default = EnableEditor;
4267
- delegateEvents(["click"]);
4268
4453
  var _tmpl$15 = /* @__PURE__ */ template(`<script>`);
4269
4454
  function InlinedScript(props) {
4270
4455
  return (() => {
@@ -4587,24 +4772,24 @@ function ContentVariants(props) {
4587
4772
  var content_variants_default = ContentVariants;
4588
4773
 
4589
4774
  // src/blocks/symbol/symbol.helpers.js
4590
- var __defProp17 = Object.defineProperty;
4591
- var __getOwnPropSymbols17 = Object.getOwnPropertySymbols;
4592
- var __hasOwnProp17 = Object.prototype.hasOwnProperty;
4593
- var __propIsEnum17 = Object.prototype.propertyIsEnumerable;
4594
- var __defNormalProp17 = (obj, key, value) => key in obj ? __defProp17(obj, key, {
4775
+ var __defProp18 = Object.defineProperty;
4776
+ var __getOwnPropSymbols18 = Object.getOwnPropertySymbols;
4777
+ var __hasOwnProp18 = Object.prototype.hasOwnProperty;
4778
+ var __propIsEnum18 = Object.prototype.propertyIsEnumerable;
4779
+ var __defNormalProp18 = (obj, key, value) => key in obj ? __defProp18(obj, key, {
4595
4780
  enumerable: true,
4596
4781
  configurable: true,
4597
4782
  writable: true,
4598
4783
  value
4599
4784
  }) : obj[key] = value;
4600
- var __spreadValues17 = (a, b) => {
4785
+ var __spreadValues18 = (a, b) => {
4601
4786
  for (var prop in b || (b = {}))
4602
- if (__hasOwnProp17.call(b, prop))
4603
- __defNormalProp17(a, prop, b[prop]);
4604
- if (__getOwnPropSymbols17)
4605
- for (var prop of __getOwnPropSymbols17(b)) {
4606
- if (__propIsEnum17.call(b, prop))
4607
- __defNormalProp17(a, prop, b[prop]);
4787
+ if (__hasOwnProp18.call(b, prop))
4788
+ __defNormalProp18(a, prop, b[prop]);
4789
+ if (__getOwnPropSymbols18)
4790
+ for (var prop of __getOwnPropSymbols18(b)) {
4791
+ if (__propIsEnum18.call(b, prop))
4792
+ __defNormalProp18(a, prop, b[prop]);
4608
4793
  }
4609
4794
  return a;
4610
4795
  };
@@ -4633,7 +4818,7 @@ var fetchSymbolContent = (_0) => __async6(void 0, [_0], function* ({
4633
4818
  symbol
4634
4819
  }) {
4635
4820
  if ((symbol == null ? void 0 : symbol.model) && (builderContextValue == null ? void 0 : builderContextValue.apiKey)) {
4636
- return fetchOneEntry(__spreadValues17({
4821
+ return fetchOneEntry(__spreadValues18({
4637
4822
  model: symbol.model,
4638
4823
  apiKey: builderContextValue.apiKey,
4639
4824
  apiVersion: builderContextValue.apiVersion
@@ -4733,30 +4918,30 @@ function setEditorSettings(newSettings) {
4733
4918
  }
4734
4919
 
4735
4920
  // src/functions/fetch-builder-props.js
4736
- var __defProp18 = Object.defineProperty;
4737
- var __defProps12 = Object.defineProperties;
4738
- var __getOwnPropDescs12 = Object.getOwnPropertyDescriptors;
4739
- var __getOwnPropSymbols18 = Object.getOwnPropertySymbols;
4740
- var __hasOwnProp18 = Object.prototype.hasOwnProperty;
4741
- var __propIsEnum18 = Object.prototype.propertyIsEnumerable;
4742
- var __defNormalProp18 = (obj, key, value) => key in obj ? __defProp18(obj, key, {
4921
+ var __defProp19 = Object.defineProperty;
4922
+ var __defProps13 = Object.defineProperties;
4923
+ var __getOwnPropDescs13 = Object.getOwnPropertyDescriptors;
4924
+ var __getOwnPropSymbols19 = Object.getOwnPropertySymbols;
4925
+ var __hasOwnProp19 = Object.prototype.hasOwnProperty;
4926
+ var __propIsEnum19 = Object.prototype.propertyIsEnumerable;
4927
+ var __defNormalProp19 = (obj, key, value) => key in obj ? __defProp19(obj, key, {
4743
4928
  enumerable: true,
4744
4929
  configurable: true,
4745
4930
  writable: true,
4746
4931
  value
4747
4932
  }) : obj[key] = value;
4748
- var __spreadValues18 = (a, b) => {
4933
+ var __spreadValues19 = (a, b) => {
4749
4934
  for (var prop in b || (b = {}))
4750
- if (__hasOwnProp18.call(b, prop))
4751
- __defNormalProp18(a, prop, b[prop]);
4752
- if (__getOwnPropSymbols18)
4753
- for (var prop of __getOwnPropSymbols18(b)) {
4754
- if (__propIsEnum18.call(b, prop))
4755
- __defNormalProp18(a, prop, b[prop]);
4935
+ if (__hasOwnProp19.call(b, prop))
4936
+ __defNormalProp19(a, prop, b[prop]);
4937
+ if (__getOwnPropSymbols19)
4938
+ for (var prop of __getOwnPropSymbols19(b)) {
4939
+ if (__propIsEnum19.call(b, prop))
4940
+ __defNormalProp19(a, prop, b[prop]);
4756
4941
  }
4757
4942
  return a;
4758
4943
  };
4759
- var __spreadProps12 = (a, b) => __defProps12(a, __getOwnPropDescs12(b));
4944
+ var __spreadProps13 = (a, b) => __defProps13(a, __getOwnPropDescs13(b));
4760
4945
  var __async7 = (__this, __arguments, generator) => {
4761
4946
  return new Promise((resolve, reject) => {
4762
4947
  var fulfilled = (value) => {
@@ -4780,10 +4965,10 @@ var __async7 = (__this, __arguments, generator) => {
4780
4965
  var fetchBuilderProps = (_args) => __async7(void 0, null, function* () {
4781
4966
  var _a, _b, _c;
4782
4967
  const urlPath = _args.path || ((_a = _args.url) == null ? void 0 : _a.pathname) || ((_b = _args.userAttributes) == null ? void 0 : _b.urlPath);
4783
- const getContentArgs = __spreadProps12(__spreadValues18({}, _args), {
4968
+ const getContentArgs = __spreadProps13(__spreadValues19({}, _args), {
4784
4969
  apiKey: _args.apiKey,
4785
4970
  model: _args.model || "page",
4786
- userAttributes: __spreadValues18(__spreadValues18({}, _args.userAttributes), urlPath ? {
4971
+ userAttributes: __spreadValues19(__spreadValues19({}, _args.userAttributes), urlPath ? {
4787
4972
  urlPath
4788
4973
  } : {}),
4789
4974
  options: getBuilderSearchParams(_args.searchParams || ((_c = _args.url) == null ? void 0 : _c.searchParams) || _args.options)