@builder.io/sdk-solid 3.0.3 → 3.0.6

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/edge/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { delegateEvents, createComponent, spread, mergeProps, insert, effect, setAttribute, className, style, template, Dynamic, memo, use } from 'solid-js/web';
2
- import { createContext, useContext, Show, For, createMemo, onMount, createSignal, createEffect, on } from 'solid-js';
2
+ import { createContext, useContext, Show, For, createMemo, createSignal, onMount, createEffect, on } from 'solid-js';
3
3
 
4
4
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
5
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
@@ -4788,7 +4788,7 @@ function Block(props) {
4788
4788
  });
4789
4789
  }
4790
4790
  var block_default = Block;
4791
- var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-3c4beb0c {
4791
+ var _tmpl$2 = /* @__PURE__ */ template(`<style>.dynamic-3d7ff108 {
4792
4792
  display: flex;
4793
4793
  flex-direction: column;
4794
4794
  align-items: stretch;
@@ -4801,8 +4801,9 @@ function BlocksWrapper(props) {
4801
4801
  if (!props.path) {
4802
4802
  return void 0;
4803
4803
  }
4804
+ const thisPrefix = "this.";
4804
4805
  const pathPrefix = "component.options.";
4805
- return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
4806
+ return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
4806
4807
  });
4807
4808
  function onClick() {
4808
4809
  if (isEditing() && !props.blocks?.length) {
@@ -4831,7 +4832,7 @@ function BlocksWrapper(props) {
4831
4832
  });
4832
4833
  return [createComponent(Dynamic, mergeProps({
4833
4834
  get ["class"]() {
4834
- return className() + " dynamic-3c4beb0c";
4835
+ return className() + " dynamic-3d7ff108";
4835
4836
  },
4836
4837
  ref(r$) {
4837
4838
  const _ref$ = blocksWrapperRef;
@@ -4930,7 +4931,7 @@ var getColumnsClass = (id2) => {
4930
4931
 
4931
4932
  // src/blocks/columns/columns.tsx
4932
4933
  var _tmpl$3 = /* @__PURE__ */ template(`<div>`);
4933
- var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-3e5f33a4 {
4934
+ var _tmpl$22 = /* @__PURE__ */ template(`<style>.div-6331dfc5 {
4934
4935
  display: flex;
4935
4936
  line-height: normal;
4936
4937
  }`);
@@ -5059,7 +5060,7 @@ function Columns(props) {
5059
5060
  const _el$ = _tmpl$3();
5060
5061
  spread(_el$, mergeProps({
5061
5062
  get ["class"]() {
5062
- return getColumnsClass(props.builderBlock?.id) + " div-3e5f33a4";
5063
+ return getColumnsClass(props.builderBlock?.id) + " div-6331dfc5";
5063
5064
  },
5064
5065
  get style() {
5065
5066
  return columnsCssVars();
@@ -5100,9 +5101,6 @@ function Columns(props) {
5100
5101
  get parent() {
5101
5102
  return props.builderBlock.id;
5102
5103
  },
5103
- styleProp: {
5104
- flexGrow: "1"
5105
- },
5106
5104
  get context() {
5107
5105
  return props.builderContext;
5108
5106
  },
@@ -5114,6 +5112,9 @@ function Columns(props) {
5114
5112
  },
5115
5113
  get blocks() {
5116
5114
  return column.blocks;
5115
+ },
5116
+ styleProp: {
5117
+ "flex-grow": "1"
5117
5118
  }
5118
5119
  });
5119
5120
  }
@@ -5184,16 +5185,16 @@ function getSrcSet(url) {
5184
5185
  // src/blocks/image/image.tsx
5185
5186
  var _tmpl$5 = /* @__PURE__ */ template(`<source type=image/webp>`);
5186
5187
  var _tmpl$23 = /* @__PURE__ */ template(`<picture><img>`);
5187
- var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-56e07140">`);
5188
- var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-56e07140-2>`);
5189
- var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-56e07140 {
5188
+ var _tmpl$32 = /* @__PURE__ */ template(`<div class="builder-image-sizer div-dc6700b4">`);
5189
+ var _tmpl$42 = /* @__PURE__ */ template(`<div class=div-dc6700b4-2>`);
5190
+ var _tmpl$52 = /* @__PURE__ */ template(`<style>.img-dc6700b4 {
5190
5191
  opacity: 1;
5191
5192
  transition: opacity 0.2s ease-in-out;
5192
- }.div-56e07140 {
5193
+ }.div-dc6700b4 {
5193
5194
  width: 100%;
5194
5195
  pointer-events: none;
5195
5196
  font-size: 0;
5196
- }.div-56e07140-2 {
5197
+ }.div-dc6700b4-2 {
5197
5198
  display: flex;
5198
5199
  flex-direction: column;
5199
5200
  align-items: stretch;
@@ -5242,8 +5243,6 @@ function Image(props) {
5242
5243
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
5243
5244
  return out;
5244
5245
  });
5245
- onMount(() => {
5246
- });
5247
5246
  return [[(() => {
5248
5247
  const _el$ = _tmpl$23(), _el$3 = _el$.firstChild;
5249
5248
  insert(_el$, createComponent(Show, {
@@ -5257,7 +5256,7 @@ function Image(props) {
5257
5256
  }
5258
5257
  }), _el$3);
5259
5258
  effect((_p$) => {
5260
- const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-56e07140", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
5259
+ const _v$ = "builder-image" + (props.className ? " " + props.className : "") + " img-dc6700b4", _v$2 = props.highPriority ? "eager" : "lazy", _v$3 = props.highPriority ? "high" : "auto", _v$4 = props.altText, _v$5 = props.altText ? void 0 : "presentation", _v$6 = {
5261
5260
  "object-position": props.backgroundPosition || "center",
5262
5261
  "object-fit": props.backgroundSize || "cover",
5263
5262
  ...aspectRatioCss()
@@ -5526,8 +5525,58 @@ var handleABTesting = async ({
5526
5525
  };
5527
5526
  };
5528
5527
 
5528
+ // src/helpers/user-attributes.ts
5529
+ var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
5530
+ function createUserAttributesService() {
5531
+ let canTrack = true;
5532
+ const subscribers = /* @__PURE__ */ new Set();
5533
+ return {
5534
+ setUserAttributes(newAttrs) {
5535
+ if (!isBrowser()) {
5536
+ return;
5537
+ }
5538
+ const userAttributes = {
5539
+ ...this.getUserAttributes(),
5540
+ ...newAttrs
5541
+ };
5542
+ setCookie({
5543
+ name: USER_ATTRIBUTES_COOKIE_NAME,
5544
+ value: JSON.stringify(userAttributes),
5545
+ canTrack
5546
+ });
5547
+ subscribers.forEach((callback) => callback(userAttributes));
5548
+ },
5549
+ getUserAttributes() {
5550
+ if (!isBrowser()) {
5551
+ return {};
5552
+ }
5553
+ return JSON.parse(getCookieSync({
5554
+ name: USER_ATTRIBUTES_COOKIE_NAME,
5555
+ canTrack
5556
+ }) || "{}");
5557
+ },
5558
+ subscribeOnUserAttributesChange(callback) {
5559
+ subscribers.add(callback);
5560
+ return () => {
5561
+ subscribers.delete(callback);
5562
+ };
5563
+ },
5564
+ setCanTrack(value) {
5565
+ canTrack = value;
5566
+ }
5567
+ };
5568
+ }
5569
+ var userAttributesService = createUserAttributesService();
5570
+ var setClientUserAttributes = (attributes) => {
5571
+ userAttributesService.setUserAttributes(attributes);
5572
+ };
5573
+
5529
5574
  // src/helpers/canTrack.ts
5530
- var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
5575
+ var getDefaultCanTrack = (canTrack) => {
5576
+ const result = checkIsDefined(canTrack) ? canTrack : true;
5577
+ userAttributesService.setCanTrack(result);
5578
+ return result;
5579
+ };
5531
5580
 
5532
5581
  // src/blocks/accordion/component-info.ts
5533
5582
  var defaultTitle = {
@@ -6257,8 +6306,408 @@ var componentInfo5 = {
6257
6306
  }
6258
6307
  };
6259
6308
 
6260
- // src/blocks/section/component-info.ts
6309
+ // src/blocks/personalization-container/component-info.ts
6261
6310
  var componentInfo6 = {
6311
+ name: "PersonalizationContainer",
6312
+ shouldReceiveBuilderProps: {
6313
+ builderBlock: true,
6314
+ builderContext: true
6315
+ },
6316
+ noWrap: true,
6317
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
6318
+ canHaveChildren: true,
6319
+ inputs: [{
6320
+ name: "variants",
6321
+ defaultValue: [],
6322
+ behavior: "personalizationVariantList",
6323
+ type: "list",
6324
+ subFields: [{
6325
+ name: "name",
6326
+ type: "text"
6327
+ }, {
6328
+ name: "query",
6329
+ friendlyName: "Targeting rules",
6330
+ type: "BuilderQuery",
6331
+ defaultValue: []
6332
+ }, {
6333
+ name: "startDate",
6334
+ type: "date"
6335
+ }, {
6336
+ name: "endDate",
6337
+ type: "date"
6338
+ }, {
6339
+ name: "blocks",
6340
+ type: "uiBlocks",
6341
+ hideFromUI: true,
6342
+ defaultValue: []
6343
+ }]
6344
+ }]
6345
+ };
6346
+ var _tmpl$8 = /* @__PURE__ */ template(`<script>`);
6347
+ function InlinedScript(props) {
6348
+ return (() => {
6349
+ const _el$ = _tmpl$8();
6350
+ effect((_p$) => {
6351
+ const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
6352
+ _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
6353
+ _v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
6354
+ _v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
6355
+ return _p$;
6356
+ }, {
6357
+ _v$: void 0,
6358
+ _v$2: void 0,
6359
+ _v$3: void 0
6360
+ });
6361
+ return _el$;
6362
+ })();
6363
+ }
6364
+ var inlined_script_default = InlinedScript;
6365
+
6366
+ // src/functions/is-previewing.ts
6367
+ function isPreviewing(_search) {
6368
+ const search = _search || (isBrowser() ? window.location.search : void 0);
6369
+ if (!search) {
6370
+ return false;
6371
+ }
6372
+ const normalizedSearch = getSearchString(search);
6373
+ return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
6374
+ }
6375
+
6376
+ // src/blocks/personalization-container/helpers/inlined-fns.ts
6377
+ function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
6378
+ function isString(val) {
6379
+ return typeof val === "string";
6380
+ }
6381
+ function isNumber(val) {
6382
+ return typeof val === "number";
6383
+ }
6384
+ function objectMatchesQuery(userattr, query2) {
6385
+ const result = (() => {
6386
+ const property = query2.property;
6387
+ const operator = query2.operator;
6388
+ let testValue = query2.value;
6389
+ if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
6390
+ testValue = query2.value.slice(0, -1);
6391
+ }
6392
+ if (!(property && operator)) {
6393
+ return true;
6394
+ }
6395
+ if (Array.isArray(testValue)) {
6396
+ if (operator === "isNot") {
6397
+ return testValue.every((val) => objectMatchesQuery(userattr, {
6398
+ property,
6399
+ operator,
6400
+ value: val
6401
+ }));
6402
+ }
6403
+ return !!testValue.find((val) => objectMatchesQuery(userattr, {
6404
+ property,
6405
+ operator,
6406
+ value: val
6407
+ }));
6408
+ }
6409
+ const value = userattr[property];
6410
+ if (Array.isArray(value)) {
6411
+ return value.includes(testValue);
6412
+ }
6413
+ switch (operator) {
6414
+ case "is":
6415
+ return value === testValue;
6416
+ case "isNot":
6417
+ return value !== testValue;
6418
+ case "contains":
6419
+ return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
6420
+ case "startsWith":
6421
+ return isString(value) && value.startsWith(String(testValue));
6422
+ case "endsWith":
6423
+ return isString(value) && value.endsWith(String(testValue));
6424
+ case "greaterThan":
6425
+ return isNumber(value) && isNumber(testValue) && value > testValue;
6426
+ case "lessThan":
6427
+ return isNumber(value) && isNumber(testValue) && value < testValue;
6428
+ case "greaterThanOrEqualTo":
6429
+ return isNumber(value) && isNumber(testValue) && value >= testValue;
6430
+ case "lessThanOrEqualTo":
6431
+ return isNumber(value) && isNumber(testValue) && value <= testValue;
6432
+ default:
6433
+ return false;
6434
+ }
6435
+ })();
6436
+ return result;
6437
+ }
6438
+ const item = {
6439
+ query,
6440
+ startDate,
6441
+ endDate
6442
+ };
6443
+ const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
6444
+ if (item.startDate && new Date(item.startDate) > now) {
6445
+ return false;
6446
+ } else if (item.endDate && new Date(item.endDate) < now) {
6447
+ return false;
6448
+ }
6449
+ if (!item.query || !item.query.length) {
6450
+ return true;
6451
+ }
6452
+ return item.query.every((filter) => {
6453
+ return objectMatchesQuery(userAttributes, filter);
6454
+ });
6455
+ }
6456
+ var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
6457
+ if (!navigator.cookieEnabled) {
6458
+ return;
6459
+ }
6460
+ function getCookie(name) {
6461
+ const nameEQ = name + '=';
6462
+ const ca = document.cookie.split(';');
6463
+ for (let i = 0; i < ca.length; i++) {
6464
+ let c = ca[i];
6465
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
6466
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
6467
+ }
6468
+ return null;
6469
+ }
6470
+ function removeVariants() {
6471
+ variants?.forEach(function (_, index) {
6472
+ document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
6473
+ });
6474
+ document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
6475
+ document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
6476
+ }
6477
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
6478
+ if (locale) {
6479
+ attributes.locale = locale;
6480
+ }
6481
+ const winningVariantIndex = variants?.findIndex(function (variant) {
6482
+ return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
6483
+ });
6484
+ const isDebug = location.href.includes('builder.debug=true');
6485
+ if (isDebug) {
6486
+ console.debug('PersonalizationContainer', {
6487
+ attributes,
6488
+ variants,
6489
+ winningVariantIndex
6490
+ });
6491
+ }
6492
+ if (winningVariantIndex !== -1) {
6493
+ const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
6494
+ if (winningVariant) {
6495
+ const parentNode = winningVariant.parentNode;
6496
+ if (parentNode) {
6497
+ const newParent = parentNode.cloneNode(false);
6498
+ newParent.appendChild(winningVariant.content.firstChild);
6499
+ newParent.appendChild(winningVariant.content.lastChild);
6500
+ parentNode.parentNode?.replaceChild(newParent, parentNode);
6501
+ }
6502
+ if (isDebug) {
6503
+ console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
6504
+ }
6505
+ }
6506
+ } else if (variants && variants.length > 0) {
6507
+ removeVariants();
6508
+ }
6509
+ }`;
6510
+ var FILTER_WITH_CUSTOM_TARGETING_SCRIPT = "function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {\n function isString(val) {\n return typeof val === 'string';\n }\n function isNumber(val) {\n return typeof val === 'number';\n }\n function objectMatchesQuery(userattr, query) {\n const result = (() => {\n const property = query.property;\n const operator = query.operator;\n let testValue = query.value;\n if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {\n testValue = query.value.slice(0, -1);\n }\n if (!(property && operator)) {\n return true;\n }\n if (Array.isArray(testValue)) {\n if (operator === 'isNot') {\n return testValue.every(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n return !!testValue.find(val => objectMatchesQuery(userattr, {\n property,\n operator,\n value: val\n }));\n }\n const value = userattr[property];\n if (Array.isArray(value)) {\n return value.includes(testValue);\n }\n switch (operator) {\n case 'is':\n return value === testValue;\n case 'isNot':\n return value !== testValue;\n case 'contains':\n return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));\n case 'startsWith':\n return isString(value) && value.startsWith(String(testValue));\n case 'endsWith':\n return isString(value) && value.endsWith(String(testValue));\n case 'greaterThan':\n return isNumber(value) && isNumber(testValue) && value > testValue;\n case 'lessThan':\n return isNumber(value) && isNumber(testValue) && value < testValue;\n case 'greaterThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value >= testValue;\n case 'lessThanOrEqualTo':\n return isNumber(value) && isNumber(testValue) && value <= testValue;\n default:\n return false;\n }\n })();\n return result;\n }\n const item = {\n query,\n startDate,\n endDate\n };\n const now = userAttributes.date && new Date(userAttributes.date) || new Date();\n if (item.startDate && new Date(item.startDate) > now) {\n return false;\n } else if (item.endDate && new Date(item.endDate) < now) {\n return false;\n }\n if (!item.query || !item.query.length) {\n return true;\n }\n return item.query.every(filter => {\n return objectMatchesQuery(userAttributes, filter);\n });\n}";
6511
+
6512
+ // src/blocks/personalization-container/helpers.ts
6513
+ function checkShouldRenderVariants(variants, canTrack) {
6514
+ const hasVariants = variants && variants.length > 0;
6515
+ if (TARGET === "reactNative")
6516
+ return false;
6517
+ if (!hasVariants)
6518
+ return false;
6519
+ if (!canTrack)
6520
+ return false;
6521
+ if (TARGET === "vue" || TARGET === "svelte")
6522
+ return true;
6523
+ if (isBrowser())
6524
+ return false;
6525
+ return true;
6526
+ }
6527
+ function getBlocksToRender({
6528
+ variants,
6529
+ previewingIndex,
6530
+ isHydrated,
6531
+ filteredVariants,
6532
+ fallbackBlocks
6533
+ }) {
6534
+ const fallback = {
6535
+ blocks: fallbackBlocks ?? [],
6536
+ path: "this.children"
6537
+ };
6538
+ if (isHydrated && isEditing()) {
6539
+ if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
6540
+ const variant = variants[previewingIndex];
6541
+ return {
6542
+ blocks: variant.blocks,
6543
+ path: `component.options.variants.${previewingIndex}.blocks`
6544
+ };
6545
+ }
6546
+ return fallback;
6547
+ }
6548
+ if (isBrowser()) {
6549
+ const winningVariant = filteredVariants?.[0];
6550
+ if (winningVariant) {
6551
+ return {
6552
+ blocks: winningVariant.blocks,
6553
+ path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
6554
+ };
6555
+ }
6556
+ }
6557
+ return fallback;
6558
+ }
6559
+ var getPersonalizationScript = (variants, blockId, locale) => {
6560
+ return `
6561
+ (function() {
6562
+ ${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
6563
+ ${PERSONALIZATION_SCRIPT}
6564
+ getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
6565
+ })();
6566
+ `;
6567
+ };
6568
+
6569
+ // src/blocks/personalization-container/personalization-container.tsx
6570
+ var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
6571
+ var _tmpl$25 = /* @__PURE__ */ template(`<template>`);
6572
+ function PersonalizationContainer(props) {
6573
+ const [userAttributes, setUserAttributes] = createSignal(userAttributesService.getUserAttributes());
6574
+ const [scriptStr, setScriptStr] = createSignal(getPersonalizationScript(props.variants, props.builderBlock?.id || "none", props.builderContext?.rootState?.locale));
6575
+ const [unsubscribers, setUnsubscribers] = createSignal([]);
6576
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants(props.variants, getDefaultCanTrack(props.builderContext?.canTrack)));
6577
+ const [isHydrated, setIsHydrated] = createSignal(false);
6578
+ const filteredVariants = createMemo(() => {
6579
+ return (props.variants || []).filter((variant) => {
6580
+ return filterWithCustomTargeting({
6581
+ ...props.builderContext?.rootState?.locale ? {
6582
+ locale: props.builderContext?.rootState?.locale
6583
+ } : {},
6584
+ ...userAttributes()
6585
+ }, variant.query, variant.startDate, variant.endDate);
6586
+ });
6587
+ });
6588
+ const blocksToRender = createMemo(() => {
6589
+ return getBlocksToRender({
6590
+ variants: props.variants,
6591
+ fallbackBlocks: props.builderBlock?.children,
6592
+ isHydrated: isHydrated(),
6593
+ filteredVariants: filteredVariants(),
6594
+ previewingIndex: props.previewingIndex
6595
+ });
6596
+ });
6597
+ const hideVariantsStyleString = createMemo(() => {
6598
+ return (props.variants || []).map((_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `).join("");
6599
+ });
6600
+ let rootRef;
6601
+ onMount(() => {
6602
+ setIsHydrated(true);
6603
+ const unsub = userAttributesService.subscribeOnUserAttributesChange((attrs) => {
6604
+ setUserAttributes(attrs);
6605
+ });
6606
+ if (!(isEditing() || isPreviewing())) {
6607
+ const variant = filteredVariants()[0];
6608
+ if (rootRef) {
6609
+ rootRef.dispatchEvent(new CustomEvent("builder.variantLoaded", {
6610
+ detail: {
6611
+ variant: variant || "default",
6612
+ content: props.builderContext?.content
6613
+ },
6614
+ bubbles: true
6615
+ }));
6616
+ const observer = new IntersectionObserver((entries) => {
6617
+ entries.forEach((entry) => {
6618
+ if (entry.isIntersecting && rootRef) {
6619
+ rootRef.dispatchEvent(new CustomEvent("builder.variantDisplayed", {
6620
+ detail: {
6621
+ variant: variant || "default",
6622
+ content: props.builderContext?.content
6623
+ },
6624
+ bubbles: true
6625
+ }));
6626
+ }
6627
+ });
6628
+ });
6629
+ observer.observe(rootRef);
6630
+ }
6631
+ }
6632
+ unsubscribers().push(unsub);
6633
+ });
6634
+ return (() => {
6635
+ const _el$ = _tmpl$9();
6636
+ const _ref$ = rootRef;
6637
+ typeof _ref$ === "function" ? use(_ref$, _el$) : rootRef = _el$;
6638
+ spread(_el$, mergeProps({
6639
+ get ["class"]() {
6640
+ return `builder-personalization-container ${props.attributes?.className || ""}`;
6641
+ }
6642
+ }, () => props.attributes), false, true);
6643
+ insert(_el$, createComponent(Show, {
6644
+ get when() {
6645
+ return shouldRenderVariants();
6646
+ },
6647
+ get children() {
6648
+ return [createComponent(For, {
6649
+ get each() {
6650
+ return props.variants;
6651
+ },
6652
+ children: (variant, _index) => {
6653
+ const index = _index();
6654
+ return (() => {
6655
+ const _el$2 = _tmpl$25();
6656
+ setAttribute(_el$2, "key", index);
6657
+ insert(_el$2, createComponent(blocks_default, {
6658
+ get blocks() {
6659
+ return variant.blocks;
6660
+ },
6661
+ get parent() {
6662
+ return props.builderBlock?.id;
6663
+ },
6664
+ path: `component.options.variants.${index}.blocks`
6665
+ }));
6666
+ effect(() => setAttribute(_el$2, "data-variant-id", `${props.builderBlock?.id}-${index}`));
6667
+ return _el$2;
6668
+ })();
6669
+ }
6670
+ }), createComponent(inlined_styles_default, {
6671
+ get nonce() {
6672
+ return props.builderContext?.nonce || "";
6673
+ },
6674
+ get styles() {
6675
+ return hideVariantsStyleString();
6676
+ },
6677
+ get id() {
6678
+ return `variants-styles-${props.builderBlock?.id}`;
6679
+ }
6680
+ }), createComponent(inlined_script_default, {
6681
+ get nonce() {
6682
+ return props.builderContext?.nonce || "";
6683
+ },
6684
+ get scriptStr() {
6685
+ return scriptStr();
6686
+ },
6687
+ get id() {
6688
+ return `variants-script-${props.builderBlock?.id}`;
6689
+ }
6690
+ })];
6691
+ }
6692
+ }), null);
6693
+ insert(_el$, createComponent(blocks_default, {
6694
+ get blocks() {
6695
+ return blocksToRender().blocks;
6696
+ },
6697
+ get parent() {
6698
+ return props.builderBlock?.id;
6699
+ },
6700
+ get path() {
6701
+ return blocksToRender().path;
6702
+ }
6703
+ }), null);
6704
+ return _el$;
6705
+ })();
6706
+ }
6707
+ var personalization_container_default = PersonalizationContainer;
6708
+
6709
+ // src/blocks/section/component-info.ts
6710
+ var componentInfo7 = {
6262
6711
  name: "Core:Section",
6263
6712
  static: true,
6264
6713
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -6300,7 +6749,7 @@ var componentInfo6 = {
6300
6749
  };
6301
6750
 
6302
6751
  // src/blocks/slot/component-info.ts
6303
- var componentInfo7 = {
6752
+ var componentInfo8 = {
6304
6753
  name: "Slot",
6305
6754
  isRSC: true,
6306
6755
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -6318,10 +6767,10 @@ var componentInfo7 = {
6318
6767
  builderComponents: true
6319
6768
  }
6320
6769
  };
6321
- var _tmpl$8 = /* @__PURE__ */ template(`<div>`);
6770
+ var _tmpl$10 = /* @__PURE__ */ template(`<div>`);
6322
6771
  function Slot(props) {
6323
6772
  return (() => {
6324
- const _el$ = _tmpl$8();
6773
+ const _el$ = _tmpl$10();
6325
6774
  _el$.style.setProperty("pointer-events", "auto");
6326
6775
  spread(_el$, mergeProps(() => !props.builderContext.context?.symbolId && {
6327
6776
  "builder-slot": props.name
@@ -6349,7 +6798,7 @@ function Slot(props) {
6349
6798
  var slot_default = Slot;
6350
6799
 
6351
6800
  // src/blocks/symbol/component-info.ts
6352
- var componentInfo8 = {
6801
+ var componentInfo9 = {
6353
6802
  name: "Symbol",
6354
6803
  noWrap: true,
6355
6804
  static: true,
@@ -6431,7 +6880,7 @@ var defaultElement = {
6431
6880
  }
6432
6881
  }
6433
6882
  };
6434
- var componentInfo9 = {
6883
+ var componentInfo10 = {
6435
6884
  name: "Builder: Tabs",
6436
6885
  inputs: [{
6437
6886
  name: "tabs",
@@ -6535,8 +6984,8 @@ var componentInfo9 = {
6535
6984
  builderLinkComponent: true
6536
6985
  }
6537
6986
  };
6538
- var _tmpl$9 = /* @__PURE__ */ template(`<div>`);
6539
- var _tmpl$25 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
6987
+ var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
6988
+ var _tmpl$26 = /* @__PURE__ */ template(`<div><div class=builder-tabs-wrap>`);
6540
6989
  var _tmpl$33 = /* @__PURE__ */ template(`<span>`);
6541
6990
  function Tabs(props) {
6542
6991
  const [activeTab, setActiveTab] = createSignal(props.defaultActiveTab ? props.defaultActiveTab - 1 : 0);
@@ -6551,7 +7000,7 @@ function Tabs(props) {
6551
7000
  }
6552
7001
  }
6553
7002
  return (() => {
6554
- const _el$ = _tmpl$25(), _el$2 = _el$.firstChild;
7003
+ const _el$ = _tmpl$26(), _el$2 = _el$.firstChild;
6555
7004
  _el$2.style.setProperty("display", "flex");
6556
7005
  _el$2.style.setProperty("flex-direction", "row");
6557
7006
  _el$2.style.setProperty("overflow", "auto");
@@ -6603,7 +7052,7 @@ function Tabs(props) {
6603
7052
  return activeTabContent(activeTab());
6604
7053
  },
6605
7054
  get children() {
6606
- const _el$3 = _tmpl$9();
7055
+ const _el$3 = _tmpl$11();
6607
7056
  insert(_el$3, createComponent(blocks_default, {
6608
7057
  get parent() {
6609
7058
  return props.builderBlock.id;
@@ -6635,7 +7084,7 @@ var tabs_default = Tabs;
6635
7084
  delegateEvents(["click"]);
6636
7085
 
6637
7086
  // src/blocks/text/component-info.ts
6638
- var componentInfo10 = {
7087
+ var componentInfo11 = {
6639
7088
  shouldReceiveBuilderProps: {
6640
7089
  builderBlock: TARGET === "reactNative" ? true : false,
6641
7090
  builderContext: true
@@ -6658,10 +7107,10 @@ var componentInfo10 = {
6658
7107
  textAlign: "center"
6659
7108
  }
6660
7109
  };
6661
- var _tmpl$10 = /* @__PURE__ */ template(`<div class=builder-text>`);
7110
+ var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-text>`);
6662
7111
  function Text(props) {
6663
7112
  return (() => {
6664
- const _el$ = _tmpl$10();
7113
+ const _el$ = _tmpl$12();
6665
7114
  _el$.style.setProperty("outline", "none");
6666
7115
  effect(() => _el$.innerHTML = props.text?.toString() || "");
6667
7116
  return _el$;
@@ -6670,7 +7119,7 @@ function Text(props) {
6670
7119
  var text_default = Text;
6671
7120
 
6672
7121
  // src/blocks/custom-code/component-info.ts
6673
- var componentInfo11 = {
7122
+ var componentInfo12 = {
6674
7123
  name: "Custom Code",
6675
7124
  static: true,
6676
7125
  requiredPermissions: ["editCode"],
@@ -6693,7 +7142,7 @@ var componentInfo11 = {
6693
7142
  advanced: true
6694
7143
  }]
6695
7144
  };
6696
- var _tmpl$11 = /* @__PURE__ */ template(`<div>`);
7145
+ var _tmpl$13 = /* @__PURE__ */ template(`<div>`);
6697
7146
  function CustomCode(props) {
6698
7147
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
6699
7148
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -6727,7 +7176,7 @@ function CustomCode(props) {
6727
7176
  }
6728
7177
  });
6729
7178
  return (() => {
6730
- const _el$ = _tmpl$11();
7179
+ const _el$ = _tmpl$13();
6731
7180
  const _ref$ = elementRef;
6732
7181
  typeof _ref$ === "function" ? use(_ref$, _el$) : elementRef = _el$;
6733
7182
  effect((_p$) => {
@@ -6745,7 +7194,7 @@ function CustomCode(props) {
6745
7194
  var custom_code_default = CustomCode;
6746
7195
 
6747
7196
  // src/blocks/embed/component-info.ts
6748
- var componentInfo12 = {
7197
+ var componentInfo13 = {
6749
7198
  name: "Embed",
6750
7199
  static: true,
6751
7200
  inputs: [{
@@ -6767,7 +7216,7 @@ var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "applicati
6767
7216
  var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
6768
7217
 
6769
7218
  // src/blocks/embed/embed.tsx
6770
- var _tmpl$12 = /* @__PURE__ */ template(`<div class=builder-embed>`);
7219
+ var _tmpl$14 = /* @__PURE__ */ template(`<div class=builder-embed>`);
6771
7220
  function Embed(props) {
6772
7221
  const [scriptsInserted, setScriptsInserted] = createSignal([]);
6773
7222
  const [scriptsRun, setScriptsRun] = createSignal([]);
@@ -6804,7 +7253,7 @@ function Embed(props) {
6804
7253
  }
6805
7254
  createEffect(on(() => [onUpdateFn_0_elem(), onUpdateFn_0_ranInitFn__()], onUpdateFn_0));
6806
7255
  return (() => {
6807
- const _el$ = _tmpl$12();
7256
+ const _el$ = _tmpl$14();
6808
7257
  const _ref$ = elem;
6809
7258
  typeof _ref$ === "function" ? use(_ref$, _el$) : elem = _el$;
6810
7259
  effect(() => _el$.innerHTML = props.content);
@@ -6814,7 +7263,7 @@ function Embed(props) {
6814
7263
  var embed_default = Embed;
6815
7264
 
6816
7265
  // src/blocks/form/form/component-info.ts
6817
- var componentInfo13 = {
7266
+ var componentInfo14 = {
6818
7267
  name: "Form:Form",
6819
7268
  // editableTags: ['builder-form-error']
6820
7269
  defaults: {
@@ -7070,9 +7519,9 @@ function logFetch(url) {
7070
7519
  }
7071
7520
 
7072
7521
  // src/blocks/form/form/form.tsx
7073
- var _tmpl$13 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-27d18614">`);
7074
- var _tmpl$26 = /* @__PURE__ */ template(`<form>`);
7075
- var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-27d18614 {
7522
+ var _tmpl$15 = /* @__PURE__ */ template(`<pre class="builder-form-error-text pre-04a43b72">`);
7523
+ var _tmpl$27 = /* @__PURE__ */ template(`<form>`);
7524
+ var _tmpl$34 = /* @__PURE__ */ template(`<style>.pre-04a43b72 {
7076
7525
  padding: 10px;
7077
7526
  color: red;
7078
7527
  text-align: center;
@@ -7264,7 +7713,7 @@ function FormComponent(props) {
7264
7713
  }
7265
7714
  let formRef;
7266
7715
  return [(() => {
7267
- const _el$ = _tmpl$26();
7716
+ const _el$ = _tmpl$27();
7268
7717
  _el$.addEventListener("submit", (event) => onSubmit(event));
7269
7718
  const _ref$ = formRef;
7270
7719
  typeof _ref$ === "function" ? use(_ref$, _el$) : formRef = _el$;
@@ -7282,34 +7731,7 @@ function FormComponent(props) {
7282
7731
  return props.name;
7283
7732
  }
7284
7733
  }, {}, {}, () => props.attributes), false, true);
7285
- insert(_el$, createComponent(Show, {
7286
- get when() {
7287
- return props.builderBlock && props.builderBlock.children;
7288
- },
7289
- get children() {
7290
- return createComponent(For, {
7291
- get each() {
7292
- return props.builderBlock?.children;
7293
- },
7294
- children: (block, _index) => {
7295
- const idx = _index();
7296
- return createComponent(block_default, {
7297
- key: `form-block-${idx}`,
7298
- block,
7299
- get context() {
7300
- return props.builderContext;
7301
- },
7302
- get registeredComponents() {
7303
- return props.builderComponents;
7304
- },
7305
- get linkComponent() {
7306
- return props.builderLinkComponent;
7307
- }
7308
- });
7309
- }
7310
- });
7311
- }
7312
- }), null);
7734
+ insert(_el$, () => props.children, null);
7313
7735
  insert(_el$, createComponent(Show, {
7314
7736
  get when() {
7315
7737
  return submissionState() === "error";
@@ -7347,7 +7769,7 @@ function FormComponent(props) {
7347
7769
  return memo(() => submissionState() === "error")() && responseData();
7348
7770
  },
7349
7771
  get children() {
7350
- const _el$2 = _tmpl$13();
7772
+ const _el$2 = _tmpl$15();
7351
7773
  insert(_el$2, () => JSON.stringify(responseData(), null, 2));
7352
7774
  return _el$2;
7353
7775
  }
@@ -7374,7 +7796,7 @@ function FormComponent(props) {
7374
7796
  var form_default = FormComponent;
7375
7797
 
7376
7798
  // src/blocks/form/input/component-info.ts
7377
- var componentInfo14 = {
7799
+ var componentInfo15 = {
7378
7800
  name: "Form:Input",
7379
7801
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
7380
7802
  inputs: [
@@ -7426,10 +7848,10 @@ var componentInfo14 = {
7426
7848
  borderColor: "#ccc"
7427
7849
  }
7428
7850
  };
7429
- var _tmpl$14 = /* @__PURE__ */ template(`<input>`);
7851
+ var _tmpl$16 = /* @__PURE__ */ template(`<input>`);
7430
7852
  function FormInputComponent(props) {
7431
7853
  return (() => {
7432
- const _el$ = _tmpl$14();
7854
+ const _el$ = _tmpl$16();
7433
7855
  spread(_el$, mergeProps({}, () => props.attributes, {
7434
7856
  get key() {
7435
7857
  return isEditing() && props.defaultValue ? props.defaultValue : "default-key";
@@ -7459,7 +7881,7 @@ function FormInputComponent(props) {
7459
7881
  var input_default = FormInputComponent;
7460
7882
 
7461
7883
  // src/blocks/form/select/component-info.ts
7462
- var componentInfo15 = {
7884
+ var componentInfo16 = {
7463
7885
  name: "Form:Select",
7464
7886
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
7465
7887
  defaultStyles: {
@@ -7502,11 +7924,11 @@ var componentInfo15 = {
7502
7924
  static: true,
7503
7925
  noWrap: true
7504
7926
  };
7505
- var _tmpl$15 = /* @__PURE__ */ template(`<select>`);
7506
- var _tmpl$27 = /* @__PURE__ */ template(`<option>`);
7927
+ var _tmpl$17 = /* @__PURE__ */ template(`<select>`);
7928
+ var _tmpl$28 = /* @__PURE__ */ template(`<option>`);
7507
7929
  function SelectComponent(props) {
7508
7930
  return (() => {
7509
- const _el$ = _tmpl$15();
7931
+ const _el$ = _tmpl$17();
7510
7932
  spread(_el$, mergeProps({}, () => props.attributes, {
7511
7933
  get value() {
7512
7934
  return props.value;
@@ -7531,7 +7953,7 @@ function SelectComponent(props) {
7531
7953
  children: (option, _index) => {
7532
7954
  const index = _index();
7533
7955
  return (() => {
7534
- const _el$2 = _tmpl$27();
7956
+ const _el$2 = _tmpl$28();
7535
7957
  insert(_el$2, () => option.name || option.value);
7536
7958
  effect(() => setAttribute(_el$2, "key", `${option.name}-${index}`));
7537
7959
  effect(() => _el$2.value = option.value);
@@ -7545,7 +7967,7 @@ function SelectComponent(props) {
7545
7967
  var select_default = SelectComponent;
7546
7968
 
7547
7969
  // src/blocks/form/submit-button/component-info.ts
7548
- var componentInfo16 = {
7970
+ var componentInfo17 = {
7549
7971
  name: "Form:SubmitButton",
7550
7972
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
7551
7973
  defaultStyles: {
@@ -7571,10 +7993,10 @@ var componentInfo16 = {
7571
7993
  // TODO: defaultChildren
7572
7994
  // canHaveChildren: true,
7573
7995
  };
7574
- var _tmpl$16 = /* @__PURE__ */ template(`<button type=submit>`);
7996
+ var _tmpl$18 = /* @__PURE__ */ template(`<button type=submit>`);
7575
7997
  function SubmitButton(props) {
7576
7998
  return (() => {
7577
- const _el$ = _tmpl$16();
7999
+ const _el$ = _tmpl$18();
7578
8000
  spread(_el$, mergeProps({}, () => props.attributes), false, true);
7579
8001
  insert(_el$, () => props.text);
7580
8002
  return _el$;
@@ -7583,7 +8005,7 @@ function SubmitButton(props) {
7583
8005
  var submit_button_default = SubmitButton;
7584
8006
 
7585
8007
  // src/blocks/form/textarea/component-info.ts
7586
- var componentInfo17 = {
8008
+ var componentInfo18 = {
7587
8009
  name: "Form:TextArea",
7588
8010
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
7589
8011
  inputs: [{
@@ -7620,10 +8042,10 @@ var componentInfo17 = {
7620
8042
  static: true,
7621
8043
  noWrap: true
7622
8044
  };
7623
- var _tmpl$17 = /* @__PURE__ */ template(`<textarea>`);
8045
+ var _tmpl$19 = /* @__PURE__ */ template(`<textarea>`);
7624
8046
  function Textarea(props) {
7625
8047
  return (() => {
7626
- const _el$ = _tmpl$17();
8048
+ const _el$ = _tmpl$19();
7627
8049
  spread(_el$, mergeProps({}, () => props.attributes, {
7628
8050
  get placeholder() {
7629
8051
  return props.placeholder;
@@ -7647,7 +8069,7 @@ function Textarea(props) {
7647
8069
  var textarea_default = Textarea;
7648
8070
 
7649
8071
  // src/blocks/img/component-info.ts
7650
- var componentInfo18 = {
8072
+ var componentInfo19 = {
7651
8073
  // friendlyName?
7652
8074
  name: "Raw:Img",
7653
8075
  hideFromInsertMenu: true,
@@ -7662,10 +8084,10 @@ var componentInfo18 = {
7662
8084
  noWrap: true,
7663
8085
  static: true
7664
8086
  };
7665
- var _tmpl$18 = /* @__PURE__ */ template(`<img>`);
8087
+ var _tmpl$20 = /* @__PURE__ */ template(`<img>`);
7666
8088
  function ImgComponent(props) {
7667
8089
  return (() => {
7668
- const _el$ = _tmpl$18();
8090
+ const _el$ = _tmpl$20();
7669
8091
  spread(_el$, mergeProps({
7670
8092
  get style() {
7671
8093
  return {
@@ -7689,7 +8111,7 @@ function ImgComponent(props) {
7689
8111
  var img_default = ImgComponent;
7690
8112
 
7691
8113
  // src/blocks/video/component-info.ts
7692
- var componentInfo19 = {
8114
+ var componentInfo20 = {
7693
8115
  name: "Video",
7694
8116
  canHaveChildren: true,
7695
8117
  defaultStyles: {
@@ -7774,8 +8196,8 @@ var componentInfo19 = {
7774
8196
  builderBlock: true
7775
8197
  }
7776
8198
  };
7777
- var _tmpl$19 = /* @__PURE__ */ template(`<source type=video/mp4>`);
7778
- var _tmpl$28 = /* @__PURE__ */ template(`<div>`);
8199
+ var _tmpl$21 = /* @__PURE__ */ template(`<source type=video/mp4>`);
8200
+ var _tmpl$29 = /* @__PURE__ */ template(`<div>`);
7779
8201
  var _tmpl$35 = /* @__PURE__ */ template(`<div><video class=builder-video>`);
7780
8202
  function Video(props) {
7781
8203
  const videoProps = createMemo(() => {
@@ -7818,7 +8240,6 @@ function Video(props) {
7818
8240
  "object-position": props.position,
7819
8241
  // Hack to get object fit to work as expected and
7820
8242
  // not have the video overflow
7821
- "z-index": 2,
7822
8243
  "border-radius": "1px",
7823
8244
  ...props.aspectRatio ? {
7824
8245
  position: "absolute"
@@ -7837,7 +8258,7 @@ function Video(props) {
7837
8258
  return !props.lazyLoad;
7838
8259
  },
7839
8260
  get children() {
7840
- const _el$3 = _tmpl$19();
8261
+ const _el$3 = _tmpl$21();
7841
8262
  effect(() => setAttribute(_el$3, "src", props.video));
7842
8263
  return _el$3;
7843
8264
  }
@@ -7847,7 +8268,7 @@ function Video(props) {
7847
8268
  return props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length);
7848
8269
  },
7849
8270
  get children() {
7850
- const _el$4 = _tmpl$28();
8271
+ const _el$4 = _tmpl$29();
7851
8272
  _el$4.style.setProperty("width", "100%");
7852
8273
  _el$4.style.setProperty("pointer-events", "none");
7853
8274
  _el$4.style.setProperty("font-size", "0px");
@@ -7860,7 +8281,7 @@ function Video(props) {
7860
8281
  return props.builderBlock?.children?.length && props.fitContent;
7861
8282
  },
7862
8283
  get children() {
7863
- const _el$5 = _tmpl$28();
8284
+ const _el$5 = _tmpl$29();
7864
8285
  _el$5.style.setProperty("display", "flex");
7865
8286
  _el$5.style.setProperty("flex-direction", "column");
7866
8287
  _el$5.style.setProperty("align-items", "stretch");
@@ -7873,7 +8294,7 @@ function Video(props) {
7873
8294
  return props.builderBlock?.children?.length && !props.fitContent;
7874
8295
  },
7875
8296
  get children() {
7876
- const _el$6 = _tmpl$28();
8297
+ const _el$6 = _tmpl$29();
7877
8298
  _el$6.style.setProperty("pointer-events", "none");
7878
8299
  _el$6.style.setProperty("display", "flex");
7879
8300
  _el$6.style.setProperty("flex-direction", "column");
@@ -7895,31 +8316,31 @@ var video_default = Video;
7895
8316
  // src/constants/extra-components.ts
7896
8317
  var getExtraComponents = () => [{
7897
8318
  component: custom_code_default,
7898
- ...componentInfo11
8319
+ ...componentInfo12
7899
8320
  }, {
7900
8321
  component: embed_default,
7901
- ...componentInfo12
8322
+ ...componentInfo13
7902
8323
  }, ...TARGET === "rsc" ? [] : [{
7903
8324
  component: form_default,
7904
- ...componentInfo13
8325
+ ...componentInfo14
7905
8326
  }, {
7906
8327
  component: input_default,
7907
- ...componentInfo14
8328
+ ...componentInfo15
7908
8329
  }, {
7909
8330
  component: submit_button_default,
7910
- ...componentInfo16
8331
+ ...componentInfo17
7911
8332
  }, {
7912
8333
  component: select_default,
7913
- ...componentInfo15
8334
+ ...componentInfo16
7914
8335
  }, {
7915
8336
  component: textarea_default,
7916
- ...componentInfo17
8337
+ ...componentInfo18
7917
8338
  }], {
7918
8339
  component: img_default,
7919
- ...componentInfo18
8340
+ ...componentInfo19
7920
8341
  }, {
7921
8342
  component: video_default,
7922
- ...componentInfo19
8343
+ ...componentInfo20
7923
8344
  }];
7924
8345
 
7925
8346
  // src/constants/builder-registered-components.ts
@@ -7937,19 +8358,22 @@ var getDefaultRegisteredComponents = () => [{
7937
8358
  ...componentInfo5
7938
8359
  }, {
7939
8360
  component: section_default,
7940
- ...componentInfo6
8361
+ ...componentInfo7
7941
8362
  }, {
7942
8363
  component: slot_default,
7943
- ...componentInfo7
8364
+ ...componentInfo8
7944
8365
  }, {
7945
8366
  component: symbol_default,
7946
- ...componentInfo8
8367
+ ...componentInfo9
7947
8368
  }, {
7948
8369
  component: text_default,
7949
- ...componentInfo10
7950
- }, ...TARGET === "rsc" ? [] : [{
8370
+ ...componentInfo11
8371
+ }, ...TARGET === "react" ? [{
8372
+ component: personalization_container_default,
8373
+ ...componentInfo6
8374
+ }] : [], ...TARGET === "rsc" ? [] : [{
7951
8375
  component: tabs_default,
7952
- ...componentInfo9
8376
+ ...componentInfo10
7953
8377
  }, {
7954
8378
  component: accordion_default,
7955
8379
  ...componentInfo
@@ -7987,7 +8411,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
7987
8411
  testVariationId: variant.id,
7988
8412
  id: content?.id
7989
8413
  }));
7990
- var checkShouldRenderVariants = ({
8414
+ var checkShouldRenderVariants2 = ({
7991
8415
  canTrack,
7992
8416
  content
7993
8417
  }) => {
@@ -8020,25 +8444,6 @@ var getUpdateVariantVisibilityScript = ({
8020
8444
  }) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
8021
8445
  "${variationId}", "${contentId}", ${isHydrationTarget}
8022
8446
  )`;
8023
- var _tmpl$20 = /* @__PURE__ */ template(`<script>`);
8024
- function InlinedScript(props) {
8025
- return (() => {
8026
- const _el$ = _tmpl$20();
8027
- effect((_p$) => {
8028
- const _v$ = props.scriptStr, _v$2 = props.id, _v$3 = props.nonce || "";
8029
- _v$ !== _p$._v$ && (_el$.innerHTML = _p$._v$ = _v$);
8030
- _v$2 !== _p$._v$2 && setAttribute(_el$, "data-id", _p$._v$2 = _v$2);
8031
- _v$3 !== _p$._v$3 && setAttribute(_el$, "nonce", _p$._v$3 = _v$3);
8032
- return _p$;
8033
- }, {
8034
- _v$: void 0,
8035
- _v$2: void 0,
8036
- _v$3: void 0
8037
- });
8038
- return _el$;
8039
- })();
8040
- }
8041
- var inlined_script_default = InlinedScript;
8042
8447
 
8043
8448
  // src/helpers/preview-lru-cache/get.ts
8044
8449
  function getPreviewContent(_searchParams) {
@@ -8046,7 +8451,7 @@ function getPreviewContent(_searchParams) {
8046
8451
  }
8047
8452
 
8048
8453
  // src/constants/sdk-version.ts
8049
- var SDK_VERSION = "3.0.3";
8454
+ var SDK_VERSION = "3.0.6";
8050
8455
 
8051
8456
  // src/helpers/sdk-headers.ts
8052
8457
  var getSdkHeaders = () => ({
@@ -8341,16 +8746,6 @@ async function fetchEntries(options) {
8341
8746
  return _processContentResult(options, content);
8342
8747
  }
8343
8748
 
8344
- // src/functions/is-previewing.ts
8345
- function isPreviewing(_search) {
8346
- const search = _search || (isBrowser() ? window.location.search : void 0);
8347
- if (!search) {
8348
- return false;
8349
- }
8350
- const normalizedSearch = getSearchString(search);
8351
- return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
8352
- }
8353
-
8354
8749
  // src/helpers/uuid.ts
8355
8750
  function uuidv4() {
8356
8751
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
@@ -8673,7 +9068,8 @@ var setupBrowserForEditing = (options = {}) => {
8673
9068
  // Supports builder-model="..." attribute which is needed to
8674
9069
  // scope our '+ add block' button styling
8675
9070
  supportsAddBlockScoping: true,
8676
- supportsCustomBreakpoints: true
9071
+ supportsCustomBreakpoints: true,
9072
+ blockLevelPersonalization: true
8677
9073
  }
8678
9074
  }, "*");
8679
9075
  window.parent?.postMessage({
@@ -9409,7 +9805,7 @@ var content_default = ContentComponent;
9409
9805
 
9410
9806
  // src/components/content-variants/content-variants.tsx
9411
9807
  function ContentVariants(props) {
9412
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants({
9808
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal(checkShouldRenderVariants2({
9413
9809
  canTrack: getDefaultCanTrack(props.canTrack),
9414
9810
  content: props.content
9415
9811
  }));
@@ -9635,7 +10031,7 @@ var fetchSymbolContent = async ({
9635
10031
  };
9636
10032
 
9637
10033
  // src/blocks/symbol/symbol.tsx
9638
- var _tmpl$21 = /* @__PURE__ */ template(`<div>`);
10034
+ var _tmpl$30 = /* @__PURE__ */ template(`<div>`);
9639
10035
  function Symbol2(props) {
9640
10036
  const [contentToUse, setContentToUse] = createSignal(props.symbol?.content);
9641
10037
  const blocksWrapper = createMemo(() => {
@@ -9667,7 +10063,7 @@ function Symbol2(props) {
9667
10063
  }
9668
10064
  createEffect(on(() => [onUpdateFn_0_props_symbol()], onUpdateFn_0));
9669
10065
  return (() => {
9670
- const _el$ = _tmpl$21();
10066
+ const _el$ = _tmpl$30();
9671
10067
  spread(_el$, mergeProps({
9672
10068
  get ["class"]() {
9673
10069
  return className();
@@ -9759,4 +10155,4 @@ var fetchBuilderProps = async (_args) => {
9759
10155
  };
9760
10156
  };
9761
10157
 
9762
- export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setEditorSettings, subscribeToEditor, track };
10158
+ export { blocks_default as Blocks, builder_context_default as BuilderContext, button_default as Button, columns_default as Columns, content_variants_default as Content, fragment_default as Fragment, image_default as Image, section_default as Section, symbol_default as Symbol, text_default as Text, video_default as Video, _processContentResult, createRegisterComponentMessage, fetchBuilderProps, fetchEntries, fetchOneEntry, getBuilderSearchParams, isEditing, isPreviewing, register, setClientUserAttributes, setEditorSettings, subscribeToEditor, track };