@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/dev.jsx CHANGED
@@ -4646,8 +4646,9 @@ function BlocksWrapper(props) {
4646
4646
  if (!props.path) {
4647
4647
  return void 0;
4648
4648
  }
4649
+ const thisPrefix = "this.";
4649
4650
  const pathPrefix = "component.options.";
4650
- return props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
4651
+ return props.path.startsWith(thisPrefix) ? props.path.replace(thisPrefix, "") : props.path.startsWith(pathPrefix) ? props.path : `${pathPrefix}${props.path || ""}`;
4651
4652
  });
4652
4653
  function onClick() {
4653
4654
  if (isEditing() && !props.blocks?.length) {
@@ -4682,7 +4683,7 @@ function BlocksWrapper(props) {
4682
4683
  });
4683
4684
  return <>
4684
4685
  <Dynamic4
4685
- class={className() + " dynamic-3c4beb0c"}
4686
+ class={className() + " dynamic-3d7ff108"}
4686
4687
  ref={blocksWrapperRef}
4687
4688
  builder-path={dataPath()}
4688
4689
  builder-parent-id={props.parent}
@@ -4694,7 +4695,7 @@ function BlocksWrapper(props) {
4694
4695
  {...props.BlocksWrapperProps}
4695
4696
  component={props.BlocksWrapper}
4696
4697
  >{props.children}</Dynamic4>
4697
- <style>{`.dynamic-3c4beb0c {
4698
+ <style>{`.dynamic-3d7ff108 {
4698
4699
  display: flex;
4699
4700
  flex-direction: column;
4700
4701
  align-items: stretch;
@@ -4859,7 +4860,7 @@ function Columns(props) {
4859
4860
  }
4860
4861
  return <>
4861
4862
  <div
4862
- class={getColumnsClass(props.builderBlock?.id) + " div-3e5f33a4"}
4863
+ class={getColumnsClass(props.builderBlock?.id) + " div-6331dfc5"}
4863
4864
  style={columnsCssVars()}
4864
4865
  {...{}}
4865
4866
  >
@@ -4878,17 +4879,17 @@ function Columns(props) {
4878
4879
  ><Blocks_default
4879
4880
  path={`columns.${index}.blocks`}
4880
4881
  parent={props.builderBlock.id}
4881
- styleProp={{
4882
- flexGrow: "1"
4883
- }}
4884
4882
  context={props.builderContext}
4885
4883
  registeredComponents={props.builderComponents}
4886
4884
  linkComponent={props.builderLinkComponent}
4887
4885
  blocks={column.blocks}
4886
+ styleProp={{
4887
+ "flex-grow": "1"
4888
+ }}
4888
4889
  /></Dynamic_renderer_default>;
4889
4890
  }}</For4>
4890
4891
  </div>
4891
- <style>{`.div-3e5f33a4 {
4892
+ <style>{`.div-6331dfc5 {
4892
4893
  display: flex;
4893
4894
  line-height: normal;
4894
4895
  }`}</style>
@@ -4903,7 +4904,7 @@ function FragmentComponent(props) {
4903
4904
  var fragment_default = FragmentComponent;
4904
4905
 
4905
4906
  // src/blocks/image/image.tsx
4906
- import { Show as Show8, onMount as onMount4, createMemo as createMemo8 } from "solid-js";
4907
+ import { Show as Show8, createMemo as createMemo8 } from "solid-js";
4907
4908
 
4908
4909
  // src/blocks/image/image.helpers.ts
4909
4910
  function removeProtocol(path) {
@@ -4993,14 +4994,12 @@ function Image(props) {
4993
4994
  const out = props.aspectRatio ? aspectRatioStyles : void 0;
4994
4995
  return out;
4995
4996
  });
4996
- onMount4(() => {
4997
- });
4998
4997
  return <>
4999
4998
  <>
5000
4999
  <picture>
5001
5000
  <Show8 when={webpSrcSet()}><source type="image/webp" srcset={webpSrcSet()} /></Show8>
5002
5001
  <img
5003
- class={"builder-image" + (props.className ? " " + props.className : "") + " img-56e07140"}
5002
+ class={"builder-image" + (props.className ? " " + props.className : "") + " img-dc6700b4"}
5004
5003
  loading={props.highPriority ? "eager" : "lazy"}
5005
5004
  fetchpriority={props.highPriority ? "high" : "auto"}
5006
5005
  alt={props.altText}
@@ -5018,22 +5017,22 @@ function Image(props) {
5018
5017
  <Show8
5019
5018
  when={props.aspectRatio && !(props.builderBlock?.children?.length && props.fitContent)}
5020
5019
  ><div
5021
- class="builder-image-sizer div-56e07140"
5020
+ class="builder-image-sizer div-dc6700b4"
5022
5021
  style={{
5023
5022
  "padding-top": props.aspectRatio * 100 + "%"
5024
5023
  }}
5025
5024
  /></Show8>
5026
5025
  <Show8 when={props.builderBlock?.children?.length && props.fitContent}>{props.children}</Show8>
5027
- <Show8 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-56e07140-2">{props.children}</div></Show8>
5026
+ <Show8 when={!props.fitContent && props.builderBlock?.children?.length}><div class="div-dc6700b4-2">{props.children}</div></Show8>
5028
5027
  </>
5029
- <style>{`.img-56e07140 {
5028
+ <style>{`.img-dc6700b4 {
5030
5029
  opacity: 1;
5031
5030
  transition: opacity 0.2s ease-in-out;
5032
- }.div-56e07140 {
5031
+ }.div-dc6700b4 {
5033
5032
  width: 100%;
5034
5033
  pointer-events: none;
5035
5034
  font-size: 0;
5036
- }.div-56e07140-2 {
5035
+ }.div-dc6700b4-2 {
5037
5036
  display: flex;
5038
5037
  flex-direction: column;
5039
5038
  align-items: stretch;
@@ -5069,10 +5068,10 @@ function SectionComponent(props) {
5069
5068
  var section_default = SectionComponent;
5070
5069
 
5071
5070
  // src/blocks/symbol/symbol.tsx
5072
- import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo19, createSignal as createSignal19 } from "solid-js";
5071
+ import { onMount as onMount8, on as on4, createEffect as createEffect4, createMemo as createMemo20, createSignal as createSignal20 } from "solid-js";
5073
5072
 
5074
5073
  // src/components/content-variants/content-variants.tsx
5075
- import { Show as Show15, For as For9, onMount as onMount7, createSignal as createSignal18, createMemo as createMemo18 } from "solid-js";
5074
+ import { Show as Show16, For as For9, onMount as onMount7, createSignal as createSignal19, createMemo as createMemo19 } from "solid-js";
5076
5075
 
5077
5076
  // src/helpers/url.ts
5078
5077
  var getTopLevelDomain = (host) => {
@@ -5262,11 +5261,61 @@ var handleABTesting = async ({
5262
5261
  };
5263
5262
  };
5264
5263
 
5264
+ // src/helpers/user-attributes.ts
5265
+ var USER_ATTRIBUTES_COOKIE_NAME = "builder.userAttributes";
5266
+ function createUserAttributesService() {
5267
+ let canTrack = true;
5268
+ const subscribers = /* @__PURE__ */ new Set();
5269
+ return {
5270
+ setUserAttributes(newAttrs) {
5271
+ if (!isBrowser()) {
5272
+ return;
5273
+ }
5274
+ const userAttributes = {
5275
+ ...this.getUserAttributes(),
5276
+ ...newAttrs
5277
+ };
5278
+ setCookie({
5279
+ name: USER_ATTRIBUTES_COOKIE_NAME,
5280
+ value: JSON.stringify(userAttributes),
5281
+ canTrack
5282
+ });
5283
+ subscribers.forEach((callback) => callback(userAttributes));
5284
+ },
5285
+ getUserAttributes() {
5286
+ if (!isBrowser()) {
5287
+ return {};
5288
+ }
5289
+ return JSON.parse(getCookieSync({
5290
+ name: USER_ATTRIBUTES_COOKIE_NAME,
5291
+ canTrack
5292
+ }) || "{}");
5293
+ },
5294
+ subscribeOnUserAttributesChange(callback) {
5295
+ subscribers.add(callback);
5296
+ return () => {
5297
+ subscribers.delete(callback);
5298
+ };
5299
+ },
5300
+ setCanTrack(value) {
5301
+ canTrack = value;
5302
+ }
5303
+ };
5304
+ }
5305
+ var userAttributesService = createUserAttributesService();
5306
+ var setClientUserAttributes = (attributes) => {
5307
+ userAttributesService.setUserAttributes(attributes);
5308
+ };
5309
+
5265
5310
  // src/helpers/canTrack.ts
5266
- var getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
5311
+ var getDefaultCanTrack = (canTrack) => {
5312
+ const result = checkIsDefined(canTrack) ? canTrack : true;
5313
+ userAttributesService.setCanTrack(result);
5314
+ return result;
5315
+ };
5267
5316
 
5268
5317
  // src/components/content/content.tsx
5269
- import { Show as Show14, createSignal as createSignal17 } from "solid-js";
5318
+ import { Show as Show15, createSignal as createSignal18 } from "solid-js";
5270
5319
 
5271
5320
  // src/blocks/accordion/component-info.ts
5272
5321
  var defaultTitle = {
@@ -5961,8 +6010,388 @@ var componentInfo5 = {
5961
6010
  }
5962
6011
  };
5963
6012
 
5964
- // src/blocks/section/component-info.ts
6013
+ // src/blocks/personalization-container/component-info.ts
5965
6014
  var componentInfo6 = {
6015
+ name: "PersonalizationContainer",
6016
+ shouldReceiveBuilderProps: {
6017
+ builderBlock: true,
6018
+ builderContext: true
6019
+ },
6020
+ noWrap: true,
6021
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
6022
+ canHaveChildren: true,
6023
+ inputs: [{
6024
+ name: "variants",
6025
+ defaultValue: [],
6026
+ behavior: "personalizationVariantList",
6027
+ type: "list",
6028
+ subFields: [{
6029
+ name: "name",
6030
+ type: "text"
6031
+ }, {
6032
+ name: "query",
6033
+ friendlyName: "Targeting rules",
6034
+ type: "BuilderQuery",
6035
+ defaultValue: []
6036
+ }, {
6037
+ name: "startDate",
6038
+ type: "date"
6039
+ }, {
6040
+ name: "endDate",
6041
+ type: "date"
6042
+ }, {
6043
+ name: "blocks",
6044
+ type: "uiBlocks",
6045
+ hideFromUI: true,
6046
+ defaultValue: []
6047
+ }]
6048
+ }]
6049
+ };
6050
+
6051
+ // src/blocks/personalization-container/personalization-container.tsx
6052
+ import { Show as Show10, For as For6, onMount as onMount4, createSignal as createSignal10, createMemo as createMemo10 } from "solid-js";
6053
+
6054
+ // src/components/inlined-script.tsx
6055
+ function InlinedScript(props) {
6056
+ return <><script
6057
+ innerHTML={props.scriptStr}
6058
+ data-id={props.id}
6059
+ nonce={props.nonce || ""}
6060
+ /></>;
6061
+ }
6062
+ var Inlined_script_default = InlinedScript;
6063
+
6064
+ // src/functions/is-previewing.ts
6065
+ function isPreviewing(_search) {
6066
+ const search = _search || (isBrowser() ? window.location.search : void 0);
6067
+ if (!search) {
6068
+ return false;
6069
+ }
6070
+ const normalizedSearch = getSearchString(search);
6071
+ return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
6072
+ }
6073
+
6074
+ // src/blocks/personalization-container/helpers/inlined-fns.ts
6075
+ function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
6076
+ function isString(val) {
6077
+ return typeof val === "string";
6078
+ }
6079
+ function isNumber(val) {
6080
+ return typeof val === "number";
6081
+ }
6082
+ function objectMatchesQuery(userattr, query2) {
6083
+ const result = (() => {
6084
+ const property = query2.property;
6085
+ const operator = query2.operator;
6086
+ let testValue = query2.value;
6087
+ if (query2 && query2.property === "urlPath" && query2.value && typeof query2.value === "string" && query2.value !== "/" && query2.value.endsWith("/")) {
6088
+ testValue = query2.value.slice(0, -1);
6089
+ }
6090
+ if (!(property && operator)) {
6091
+ return true;
6092
+ }
6093
+ if (Array.isArray(testValue)) {
6094
+ if (operator === "isNot") {
6095
+ return testValue.every((val) => objectMatchesQuery(userattr, {
6096
+ property,
6097
+ operator,
6098
+ value: val
6099
+ }));
6100
+ }
6101
+ return !!testValue.find((val) => objectMatchesQuery(userattr, {
6102
+ property,
6103
+ operator,
6104
+ value: val
6105
+ }));
6106
+ }
6107
+ const value = userattr[property];
6108
+ if (Array.isArray(value)) {
6109
+ return value.includes(testValue);
6110
+ }
6111
+ switch (operator) {
6112
+ case "is":
6113
+ return value === testValue;
6114
+ case "isNot":
6115
+ return value !== testValue;
6116
+ case "contains":
6117
+ return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
6118
+ case "startsWith":
6119
+ return isString(value) && value.startsWith(String(testValue));
6120
+ case "endsWith":
6121
+ return isString(value) && value.endsWith(String(testValue));
6122
+ case "greaterThan":
6123
+ return isNumber(value) && isNumber(testValue) && value > testValue;
6124
+ case "lessThan":
6125
+ return isNumber(value) && isNumber(testValue) && value < testValue;
6126
+ case "greaterThanOrEqualTo":
6127
+ return isNumber(value) && isNumber(testValue) && value >= testValue;
6128
+ case "lessThanOrEqualTo":
6129
+ return isNumber(value) && isNumber(testValue) && value <= testValue;
6130
+ default:
6131
+ return false;
6132
+ }
6133
+ })();
6134
+ return result;
6135
+ }
6136
+ const item = {
6137
+ query,
6138
+ startDate,
6139
+ endDate
6140
+ };
6141
+ const now = userAttributes.date && new Date(userAttributes.date) || /* @__PURE__ */ new Date();
6142
+ if (item.startDate && new Date(item.startDate) > now) {
6143
+ return false;
6144
+ } else if (item.endDate && new Date(item.endDate) < now) {
6145
+ return false;
6146
+ }
6147
+ if (!item.query || !item.query.length) {
6148
+ return true;
6149
+ }
6150
+ return item.query.every((filter) => {
6151
+ return objectMatchesQuery(userAttributes, filter);
6152
+ });
6153
+ }
6154
+ var PERSONALIZATION_SCRIPT = `function getPersonalizedVariant(variants, blockId, locale) {
6155
+ if (!navigator.cookieEnabled) {
6156
+ return;
6157
+ }
6158
+ function getCookie(name) {
6159
+ const nameEQ = name + '=';
6160
+ const ca = document.cookie.split(';');
6161
+ for (let i = 0; i < ca.length; i++) {
6162
+ let c = ca[i];
6163
+ while (c.charAt(0) == ' ') c = c.substring(1, c.length);
6164
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
6165
+ }
6166
+ return null;
6167
+ }
6168
+ function removeVariants() {
6169
+ variants?.forEach(function (_, index) {
6170
+ document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
6171
+ });
6172
+ document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
6173
+ document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
6174
+ }
6175
+ const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
6176
+ if (locale) {
6177
+ attributes.locale = locale;
6178
+ }
6179
+ const winningVariantIndex = variants?.findIndex(function (variant) {
6180
+ return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
6181
+ });
6182
+ const isDebug = location.href.includes('builder.debug=true');
6183
+ if (isDebug) {
6184
+ console.debug('PersonalizationContainer', {
6185
+ attributes,
6186
+ variants,
6187
+ winningVariantIndex
6188
+ });
6189
+ }
6190
+ if (winningVariantIndex !== -1) {
6191
+ const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
6192
+ if (winningVariant) {
6193
+ const parentNode = winningVariant.parentNode;
6194
+ if (parentNode) {
6195
+ const newParent = parentNode.cloneNode(false);
6196
+ newParent.appendChild(winningVariant.content.firstChild);
6197
+ newParent.appendChild(winningVariant.content.lastChild);
6198
+ parentNode.parentNode?.replaceChild(newParent, parentNode);
6199
+ }
6200
+ if (isDebug) {
6201
+ console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
6202
+ }
6203
+ }
6204
+ } else if (variants && variants.length > 0) {
6205
+ removeVariants();
6206
+ }
6207
+ }`;
6208
+ 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}";
6209
+
6210
+ // src/blocks/personalization-container/helpers.ts
6211
+ function checkShouldRenderVariants(variants, canTrack) {
6212
+ const hasVariants = variants && variants.length > 0;
6213
+ if (TARGET === "reactNative")
6214
+ return false;
6215
+ if (!hasVariants)
6216
+ return false;
6217
+ if (!canTrack)
6218
+ return false;
6219
+ if (TARGET === "vue" || TARGET === "svelte")
6220
+ return true;
6221
+ if (isBrowser())
6222
+ return false;
6223
+ return true;
6224
+ }
6225
+ function getBlocksToRender({
6226
+ variants,
6227
+ previewingIndex,
6228
+ isHydrated,
6229
+ filteredVariants,
6230
+ fallbackBlocks
6231
+ }) {
6232
+ const fallback = {
6233
+ blocks: fallbackBlocks ?? [],
6234
+ path: "this.children"
6235
+ };
6236
+ if (isHydrated && isEditing()) {
6237
+ if (typeof previewingIndex === "number" && previewingIndex < (variants?.length ?? 0)) {
6238
+ const variant = variants[previewingIndex];
6239
+ return {
6240
+ blocks: variant.blocks,
6241
+ path: `component.options.variants.${previewingIndex}.blocks`
6242
+ };
6243
+ }
6244
+ return fallback;
6245
+ }
6246
+ if (isBrowser()) {
6247
+ const winningVariant = filteredVariants?.[0];
6248
+ if (winningVariant) {
6249
+ return {
6250
+ blocks: winningVariant.blocks,
6251
+ path: `component.options.variants.${variants?.indexOf(winningVariant)}.blocks`
6252
+ };
6253
+ }
6254
+ }
6255
+ return fallback;
6256
+ }
6257
+ var getPersonalizationScript = (variants, blockId, locale) => {
6258
+ return `
6259
+ (function() {
6260
+ ${FILTER_WITH_CUSTOM_TARGETING_SCRIPT}
6261
+ ${PERSONALIZATION_SCRIPT}
6262
+ getPersonalizedVariant(${JSON.stringify(variants)}, "${blockId}"${locale ? `, "${locale}"` : ""})
6263
+ })();
6264
+ `;
6265
+ };
6266
+
6267
+ // src/blocks/personalization-container/personalization-container.tsx
6268
+ function PersonalizationContainer(props) {
6269
+ const [userAttributes, setUserAttributes] = createSignal10(
6270
+ userAttributesService.getUserAttributes()
6271
+ );
6272
+ const [scriptStr, setScriptStr] = createSignal10(
6273
+ getPersonalizationScript(
6274
+ props.variants,
6275
+ props.builderBlock?.id || "none",
6276
+ props.builderContext?.rootState?.locale
6277
+ )
6278
+ );
6279
+ const [unsubscribers, setUnsubscribers] = createSignal10([]);
6280
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal10(
6281
+ checkShouldRenderVariants(
6282
+ props.variants,
6283
+ getDefaultCanTrack(props.builderContext?.canTrack)
6284
+ )
6285
+ );
6286
+ const [isHydrated, setIsHydrated] = createSignal10(false);
6287
+ const filteredVariants = createMemo10(() => {
6288
+ return (props.variants || []).filter((variant) => {
6289
+ return filterWithCustomTargeting(
6290
+ {
6291
+ ...props.builderContext?.rootState?.locale ? {
6292
+ locale: props.builderContext?.rootState?.locale
6293
+ } : {},
6294
+ ...userAttributes()
6295
+ },
6296
+ variant.query,
6297
+ variant.startDate,
6298
+ variant.endDate
6299
+ );
6300
+ });
6301
+ });
6302
+ const blocksToRender = createMemo10(() => {
6303
+ return getBlocksToRender({
6304
+ variants: props.variants,
6305
+ fallbackBlocks: props.builderBlock?.children,
6306
+ isHydrated: isHydrated(),
6307
+ filteredVariants: filteredVariants(),
6308
+ previewingIndex: props.previewingIndex
6309
+ });
6310
+ });
6311
+ const hideVariantsStyleString = createMemo10(() => {
6312
+ return (props.variants || []).map(
6313
+ (_, index) => `[data-variant-id="${props.builderBlock?.id}-${index}"] { display: none; } `
6314
+ ).join("");
6315
+ });
6316
+ let rootRef;
6317
+ onMount4(() => {
6318
+ setIsHydrated(true);
6319
+ const unsub = userAttributesService.subscribeOnUserAttributesChange(
6320
+ (attrs) => {
6321
+ setUserAttributes(attrs);
6322
+ }
6323
+ );
6324
+ if (!(isEditing() || isPreviewing())) {
6325
+ const variant = filteredVariants()[0];
6326
+ if (rootRef) {
6327
+ rootRef.dispatchEvent(
6328
+ new CustomEvent("builder.variantLoaded", {
6329
+ detail: {
6330
+ variant: variant || "default",
6331
+ content: props.builderContext?.content
6332
+ },
6333
+ bubbles: true
6334
+ })
6335
+ );
6336
+ const observer = new IntersectionObserver((entries) => {
6337
+ entries.forEach((entry) => {
6338
+ if (entry.isIntersecting && rootRef) {
6339
+ rootRef.dispatchEvent(
6340
+ new CustomEvent("builder.variantDisplayed", {
6341
+ detail: {
6342
+ variant: variant || "default",
6343
+ content: props.builderContext?.content
6344
+ },
6345
+ bubbles: true
6346
+ })
6347
+ );
6348
+ }
6349
+ });
6350
+ });
6351
+ observer.observe(rootRef);
6352
+ }
6353
+ }
6354
+ unsubscribers().push(unsub);
6355
+ });
6356
+ return <><div
6357
+ class={`builder-personalization-container ${props.attributes?.className || ""}`}
6358
+ ref={rootRef}
6359
+ {...props.attributes}
6360
+ >
6361
+ <Show10 when={shouldRenderVariants()}>
6362
+ <For6 each={props.variants}>{(variant, _index) => {
6363
+ const index = _index();
6364
+ return <template
6365
+ key={index}
6366
+ data-variant-id={`${props.builderBlock?.id}-${index}`}
6367
+ ><Blocks_default
6368
+ blocks={variant.blocks}
6369
+ parent={props.builderBlock?.id}
6370
+ path={`component.options.variants.${index}.blocks`}
6371
+ /></template>;
6372
+ }}</For6>
6373
+ <Inlined_styles_default
6374
+ nonce={props.builderContext?.nonce || ""}
6375
+ styles={hideVariantsStyleString()}
6376
+ id={`variants-styles-${props.builderBlock?.id}`}
6377
+ />
6378
+ <Inlined_script_default
6379
+ nonce={props.builderContext?.nonce || ""}
6380
+ scriptStr={scriptStr()}
6381
+ id={`variants-script-${props.builderBlock?.id}`}
6382
+ />
6383
+ </Show10>
6384
+ <Blocks_default
6385
+ blocks={blocksToRender().blocks}
6386
+ parent={props.builderBlock?.id}
6387
+ path={blocksToRender().path}
6388
+ />
6389
+ </div></>;
6390
+ }
6391
+ var personalization_container_default = PersonalizationContainer;
6392
+
6393
+ // src/blocks/section/component-info.ts
6394
+ var componentInfo7 = {
5966
6395
  name: "Core:Section",
5967
6396
  static: true,
5968
6397
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -6004,7 +6433,7 @@ var componentInfo6 = {
6004
6433
  };
6005
6434
 
6006
6435
  // src/blocks/slot/component-info.ts
6007
- var componentInfo7 = {
6436
+ var componentInfo8 = {
6008
6437
  name: "Slot",
6009
6438
  isRSC: true,
6010
6439
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -6043,7 +6472,7 @@ function Slot(props) {
6043
6472
  var slot_default = Slot;
6044
6473
 
6045
6474
  // src/blocks/symbol/component-info.ts
6046
- var componentInfo8 = {
6475
+ var componentInfo9 = {
6047
6476
  name: "Symbol",
6048
6477
  noWrap: true,
6049
6478
  static: true,
@@ -6125,7 +6554,7 @@ var defaultElement = {
6125
6554
  }
6126
6555
  }
6127
6556
  };
6128
- var componentInfo9 = {
6557
+ var componentInfo10 = {
6129
6558
  name: "Builder: Tabs",
6130
6559
  inputs: [{
6131
6560
  name: "tabs",
@@ -6231,9 +6660,9 @@ var componentInfo9 = {
6231
6660
  };
6232
6661
 
6233
6662
  // src/blocks/tabs/tabs.tsx
6234
- import { Show as Show10, For as For6, createSignal as createSignal10 } from "solid-js";
6663
+ import { Show as Show11, For as For7, createSignal as createSignal11 } from "solid-js";
6235
6664
  function Tabs(props) {
6236
- const [activeTab, setActiveTab] = createSignal10(
6665
+ const [activeTab, setActiveTab] = createSignal11(
6237
6666
  props.defaultActiveTab ? props.defaultActiveTab - 1 : 0
6238
6667
  );
6239
6668
  function activeTabContent(active) {
@@ -6255,7 +6684,7 @@ function Tabs(props) {
6255
6684
  "justify-content": props.tabHeaderLayout || "flex-start",
6256
6685
  overflow: "auto"
6257
6686
  }}
6258
- ><For6 each={props.tabs}>{(tab, _index) => {
6687
+ ><For7 each={props.tabs}>{(tab, _index) => {
6259
6688
  const index = _index();
6260
6689
  return <span
6261
6690
  class={`builder-tab-wrap ${activeTab() === index ? "builder-tab-active" : ""}`}
@@ -6272,21 +6701,21 @@ function Tabs(props) {
6272
6701
  registeredComponents={props.builderComponents}
6273
6702
  linkComponent={props.builderLinkComponent}
6274
6703
  /></span>;
6275
- }}</For6></div>
6276
- <Show10 when={activeTabContent(activeTab())}><div><Blocks_default
6704
+ }}</For7></div>
6705
+ <Show11 when={activeTabContent(activeTab())}><div><Blocks_default
6277
6706
  parent={props.builderBlock.id}
6278
6707
  path={`tabs.${activeTab()}.content`}
6279
6708
  blocks={activeTabContent(activeTab())}
6280
6709
  context={props.builderContext}
6281
6710
  registeredComponents={props.builderComponents}
6282
6711
  linkComponent={props.builderLinkComponent}
6283
- /></div></Show10>
6712
+ /></div></Show11>
6284
6713
  </div></>;
6285
6714
  }
6286
6715
  var tabs_default = Tabs;
6287
6716
 
6288
6717
  // src/blocks/text/component-info.ts
6289
- var componentInfo10 = {
6718
+ var componentInfo11 = {
6290
6719
  shouldReceiveBuilderProps: {
6291
6720
  builderBlock: TARGET === "reactNative" ? true : false,
6292
6721
  builderContext: true
@@ -6323,7 +6752,7 @@ function Text(props) {
6323
6752
  var text_default = Text;
6324
6753
 
6325
6754
  // src/blocks/custom-code/component-info.ts
6326
- var componentInfo11 = {
6755
+ var componentInfo12 = {
6327
6756
  name: "Custom Code",
6328
6757
  static: true,
6329
6758
  requiredPermissions: ["editCode"],
@@ -6348,10 +6777,10 @@ var componentInfo11 = {
6348
6777
  };
6349
6778
 
6350
6779
  // src/blocks/custom-code/custom-code.tsx
6351
- import { onMount as onMount5, createSignal as createSignal11 } from "solid-js";
6780
+ import { onMount as onMount5, createSignal as createSignal12 } from "solid-js";
6352
6781
  function CustomCode(props) {
6353
- const [scriptsInserted, setScriptsInserted] = createSignal11([]);
6354
- const [scriptsRun, setScriptsRun] = createSignal11([]);
6782
+ const [scriptsInserted, setScriptsInserted] = createSignal12([]);
6783
+ const [scriptsRun, setScriptsRun] = createSignal12([]);
6355
6784
  let elementRef;
6356
6785
  onMount5(() => {
6357
6786
  if (!elementRef?.getElementsByTagName || typeof window === "undefined") {
@@ -6395,7 +6824,7 @@ function CustomCode(props) {
6395
6824
  var custom_code_default = CustomCode;
6396
6825
 
6397
6826
  // src/blocks/embed/component-info.ts
6398
- var componentInfo12 = {
6827
+ var componentInfo13 = {
6399
6828
  name: "Embed",
6400
6829
  static: true,
6401
6830
  inputs: [{
@@ -6413,7 +6842,7 @@ var componentInfo12 = {
6413
6842
  };
6414
6843
 
6415
6844
  // src/blocks/embed/embed.tsx
6416
- import { on as on2, createEffect as createEffect2, createMemo as createMemo12, createSignal as createSignal12 } from "solid-js";
6845
+ import { on as on2, createEffect as createEffect2, createMemo as createMemo13, createSignal as createSignal13 } from "solid-js";
6417
6846
 
6418
6847
  // src/blocks/embed/helpers.ts
6419
6848
  var SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"];
@@ -6421,9 +6850,9 @@ var isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
6421
6850
 
6422
6851
  // src/blocks/embed/embed.tsx
6423
6852
  function Embed(props) {
6424
- const [scriptsInserted, setScriptsInserted] = createSignal12([]);
6425
- const [scriptsRun, setScriptsRun] = createSignal12([]);
6426
- const [ranInitFn, setRanInitFn] = createSignal12(false);
6853
+ const [scriptsInserted, setScriptsInserted] = createSignal13([]);
6854
+ const [scriptsRun, setScriptsRun] = createSignal13([]);
6855
+ const [ranInitFn, setRanInitFn] = createSignal13(false);
6427
6856
  function findAndRunScripts() {
6428
6857
  if (!elem || !elem.getElementsByTagName)
6429
6858
  return;
@@ -6447,8 +6876,8 @@ function Embed(props) {
6447
6876
  }
6448
6877
  }
6449
6878
  let elem;
6450
- const onUpdateFn_0_elem = createMemo12(() => elem);
6451
- const onUpdateFn_0_ranInitFn__ = createMemo12(() => ranInitFn());
6879
+ const onUpdateFn_0_elem = createMemo13(() => elem);
6880
+ const onUpdateFn_0_ranInitFn__ = createMemo13(() => ranInitFn());
6452
6881
  function onUpdateFn_0() {
6453
6882
  if (elem && !ranInitFn()) {
6454
6883
  setRanInitFn(true);
@@ -6463,7 +6892,7 @@ function Embed(props) {
6463
6892
  var embed_default = Embed;
6464
6893
 
6465
6894
  // src/blocks/form/form/component-info.ts
6466
- var componentInfo13 = {
6895
+ var componentInfo14 = {
6467
6896
  name: "Form:Form",
6468
6897
  // editableTags: ['builder-form-error']
6469
6898
  defaults: {
@@ -6703,7 +7132,7 @@ var componentInfo13 = {
6703
7132
  };
6704
7133
 
6705
7134
  // src/blocks/form/form/form.tsx
6706
- import { Show as Show11, For as For7, createSignal as createSignal13 } from "solid-js";
7135
+ import { Show as Show12, createSignal as createSignal14 } from "solid-js";
6707
7136
 
6708
7137
  // src/functions/get-env.ts
6709
7138
  var validEnvList = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"];
@@ -6723,9 +7152,9 @@ function logFetch(url) {
6723
7152
 
6724
7153
  // src/blocks/form/form/form.tsx
6725
7154
  function FormComponent(props) {
6726
- const [formState, setFormState] = createSignal13("unsubmitted");
6727
- const [responseData, setResponseData] = createSignal13(null);
6728
- const [formErrorMessage, setFormErrorMessage] = createSignal13("");
7155
+ const [formState, setFormState] = createSignal14("unsubmitted");
7156
+ const [responseData, setResponseData] = createSignal14(null);
7157
+ const [formErrorMessage, setFormErrorMessage] = createSignal14("");
6729
7158
  function mergeNewRootState(newData) {
6730
7159
  const combinedState = {
6731
7160
  ...props.builderContext.rootState,
@@ -6920,34 +7349,25 @@ function FormComponent(props) {
6920
7349
  {...{}}
6921
7350
  {...props.attributes}
6922
7351
  >
6923
- <Show11 when={props.builderBlock && props.builderBlock.children}><For7 each={props.builderBlock?.children}>{(block, _index) => {
6924
- const idx = _index();
6925
- return <Block_default
6926
- key={`form-block-${idx}`}
6927
- block={block}
6928
- context={props.builderContext}
6929
- registeredComponents={props.builderComponents}
6930
- linkComponent={props.builderLinkComponent}
6931
- />;
6932
- }}</For7></Show11>
6933
- <Show11 when={submissionState() === "error"}><Blocks_default
7352
+ {props.children}
7353
+ <Show12 when={submissionState() === "error"}><Blocks_default
6934
7354
  path="errorMessage"
6935
7355
  blocks={props.errorMessage}
6936
7356
  context={props.builderContext}
6937
- /></Show11>
6938
- <Show11 when={submissionState() === "sending"}><Blocks_default
7357
+ /></Show12>
7358
+ <Show12 when={submissionState() === "sending"}><Blocks_default
6939
7359
  path="sendingMessage"
6940
7360
  blocks={props.sendingMessage}
6941
7361
  context={props.builderContext}
6942
- /></Show11>
6943
- <Show11 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-27d18614">{JSON.stringify(responseData(), null, 2)}</pre></Show11>
6944
- <Show11 when={submissionState() === "success"}><Blocks_default
7362
+ /></Show12>
7363
+ <Show12 when={submissionState() === "error" && responseData()}><pre class="builder-form-error-text pre-04a43b72">{JSON.stringify(responseData(), null, 2)}</pre></Show12>
7364
+ <Show12 when={submissionState() === "success"}><Blocks_default
6945
7365
  path="successMessage"
6946
7366
  blocks={props.successMessage}
6947
7367
  context={props.builderContext}
6948
- /></Show11>
7368
+ /></Show12>
6949
7369
  </form>
6950
- <style>{`.pre-27d18614 {
7370
+ <style>{`.pre-04a43b72 {
6951
7371
  padding: 10px;
6952
7372
  color: red;
6953
7373
  text-align: center;
@@ -6957,7 +7377,7 @@ function FormComponent(props) {
6957
7377
  var form_default = FormComponent;
6958
7378
 
6959
7379
  // src/blocks/form/input/component-info.ts
6960
- var componentInfo14 = {
7380
+ var componentInfo15 = {
6961
7381
  name: "Form:Input",
6962
7382
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
6963
7383
  inputs: [
@@ -7027,7 +7447,7 @@ function FormInputComponent(props) {
7027
7447
  var input_default = FormInputComponent;
7028
7448
 
7029
7449
  // src/blocks/form/select/component-info.ts
7030
- var componentInfo15 = {
7450
+ var componentInfo16 = {
7031
7451
  name: "Form:Select",
7032
7452
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
7033
7453
  defaultStyles: {
@@ -7090,7 +7510,7 @@ function SelectComponent(props) {
7090
7510
  var select_default = SelectComponent;
7091
7511
 
7092
7512
  // src/blocks/form/submit-button/component-info.ts
7093
- var componentInfo16 = {
7513
+ var componentInfo17 = {
7094
7514
  name: "Form:SubmitButton",
7095
7515
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
7096
7516
  defaultStyles: {
@@ -7124,7 +7544,7 @@ function SubmitButton(props) {
7124
7544
  var submit_button_default = SubmitButton;
7125
7545
 
7126
7546
  // src/blocks/form/textarea/component-info.ts
7127
- var componentInfo17 = {
7547
+ var componentInfo18 = {
7128
7548
  name: "Form:TextArea",
7129
7549
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
7130
7550
  inputs: [{
@@ -7177,7 +7597,7 @@ function Textarea(props) {
7177
7597
  var textarea_default = Textarea;
7178
7598
 
7179
7599
  // src/blocks/img/component-info.ts
7180
- var componentInfo18 = {
7600
+ var componentInfo19 = {
7181
7601
  // friendlyName?
7182
7602
  name: "Raw:Img",
7183
7603
  hideFromInsertMenu: true,
@@ -7210,7 +7630,7 @@ function ImgComponent(props) {
7210
7630
  var img_default = ImgComponent;
7211
7631
 
7212
7632
  // src/blocks/video/component-info.ts
7213
- var componentInfo19 = {
7633
+ var componentInfo20 = {
7214
7634
  name: "Video",
7215
7635
  canHaveChildren: true,
7216
7636
  defaultStyles: {
@@ -7297,9 +7717,9 @@ var componentInfo19 = {
7297
7717
  };
7298
7718
 
7299
7719
  // src/blocks/video/video.tsx
7300
- import { Show as Show12, createMemo as createMemo14 } from "solid-js";
7720
+ import { Show as Show13, createMemo as createMemo15 } from "solid-js";
7301
7721
  function Video(props) {
7302
- const videoProps = createMemo14(() => {
7722
+ const videoProps = createMemo15(() => {
7303
7723
  return {
7304
7724
  ...props.autoPlay === true ? {
7305
7725
  autoPlay: true
@@ -7318,7 +7738,7 @@ function Video(props) {
7318
7738
  } : {}
7319
7739
  };
7320
7740
  });
7321
- const spreadProps = createMemo14(() => {
7741
+ const spreadProps = createMemo15(() => {
7322
7742
  return {
7323
7743
  ...videoProps()
7324
7744
  };
@@ -7340,7 +7760,6 @@ function Video(props) {
7340
7760
  "object-position": props.position,
7341
7761
  // Hack to get object fit to work as expected and
7342
7762
  // not have the video overflow
7343
- "z-index": 2,
7344
7763
  "border-radius": "1px",
7345
7764
  ...props.aspectRatio ? {
7346
7765
  position: "absolute"
@@ -7348,8 +7767,8 @@ function Video(props) {
7348
7767
  }}
7349
7768
  src={props.video || "no-src"}
7350
7769
  poster={props.posterImage}
7351
- ><Show12 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show12></video>
7352
- <Show12
7770
+ ><Show13 when={!props.lazyLoad}><source type="video/mp4" src={props.video} /></Show13></video>
7771
+ <Show13
7353
7772
  when={props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length)}
7354
7773
  ><div
7355
7774
  style={{
@@ -7358,15 +7777,15 @@ function Video(props) {
7358
7777
  "pointer-events": "none",
7359
7778
  "font-size": "0px"
7360
7779
  }}
7361
- /></Show12>
7362
- <Show12 when={props.builderBlock?.children?.length && props.fitContent}><div
7780
+ /></Show13>
7781
+ <Show13 when={props.builderBlock?.children?.length && props.fitContent}><div
7363
7782
  style={{
7364
7783
  display: "flex",
7365
7784
  "flex-direction": "column",
7366
7785
  "align-items": "stretch"
7367
7786
  }}
7368
- >{props.children}</div></Show12>
7369
- <Show12 when={props.builderBlock?.children?.length && !props.fitContent}><div
7787
+ >{props.children}</div></Show13>
7788
+ <Show13 when={props.builderBlock?.children?.length && !props.fitContent}><div
7370
7789
  style={{
7371
7790
  "pointer-events": "none",
7372
7791
  display: "flex",
@@ -7378,7 +7797,7 @@ function Video(props) {
7378
7797
  width: "100%",
7379
7798
  height: "100%"
7380
7799
  }}
7381
- >{props.children}</div></Show12>
7800
+ >{props.children}</div></Show13>
7382
7801
  </div></>;
7383
7802
  }
7384
7803
  var video_default = Video;
@@ -7386,31 +7805,31 @@ var video_default = Video;
7386
7805
  // src/constants/extra-components.ts
7387
7806
  var getExtraComponents = () => [{
7388
7807
  component: custom_code_default,
7389
- ...componentInfo11
7808
+ ...componentInfo12
7390
7809
  }, {
7391
7810
  component: embed_default,
7392
- ...componentInfo12
7811
+ ...componentInfo13
7393
7812
  }, ...TARGET === "rsc" ? [] : [{
7394
7813
  component: form_default,
7395
- ...componentInfo13
7814
+ ...componentInfo14
7396
7815
  }, {
7397
7816
  component: input_default,
7398
- ...componentInfo14
7817
+ ...componentInfo15
7399
7818
  }, {
7400
7819
  component: submit_button_default,
7401
- ...componentInfo16
7820
+ ...componentInfo17
7402
7821
  }, {
7403
7822
  component: select_default,
7404
- ...componentInfo15
7823
+ ...componentInfo16
7405
7824
  }, {
7406
7825
  component: textarea_default,
7407
- ...componentInfo17
7826
+ ...componentInfo18
7408
7827
  }], {
7409
7828
  component: img_default,
7410
- ...componentInfo18
7829
+ ...componentInfo19
7411
7830
  }, {
7412
7831
  component: video_default,
7413
- ...componentInfo19
7832
+ ...componentInfo20
7414
7833
  }];
7415
7834
 
7416
7835
  // src/constants/builder-registered-components.ts
@@ -7428,19 +7847,22 @@ var getDefaultRegisteredComponents = () => [{
7428
7847
  ...componentInfo5
7429
7848
  }, {
7430
7849
  component: section_default,
7431
- ...componentInfo6
7850
+ ...componentInfo7
7432
7851
  }, {
7433
7852
  component: slot_default,
7434
- ...componentInfo7
7853
+ ...componentInfo8
7435
7854
  }, {
7436
7855
  component: symbol_default,
7437
- ...componentInfo8
7856
+ ...componentInfo9
7438
7857
  }, {
7439
7858
  component: text_default,
7440
- ...componentInfo10
7441
- }, ...TARGET === "rsc" ? [] : [{
7859
+ ...componentInfo11
7860
+ }, ...TARGET === "react" ? [{
7861
+ component: personalization_container_default,
7862
+ ...componentInfo6
7863
+ }] : [], ...TARGET === "rsc" ? [] : [{
7442
7864
  component: tabs_default,
7443
- ...componentInfo9
7865
+ ...componentInfo10
7444
7866
  }, {
7445
7867
  component: accordion_default,
7446
7868
  ...componentInfo
@@ -7478,7 +7900,7 @@ var getVariants = (content) => Object.values(content?.variations || {}).map((var
7478
7900
  testVariationId: variant.id,
7479
7901
  id: content?.id
7480
7902
  }));
7481
- var checkShouldRenderVariants = ({
7903
+ var checkShouldRenderVariants2 = ({
7482
7904
  canTrack,
7483
7905
  content
7484
7906
  }) => {
@@ -7512,24 +7934,14 @@ var getUpdateVariantVisibilityScript = ({
7512
7934
  "${variationId}", "${contentId}", ${isHydrationTarget}
7513
7935
  )`;
7514
7936
 
7515
- // src/components/inlined-script.tsx
7516
- function InlinedScript(props) {
7517
- return <><script
7518
- innerHTML={props.scriptStr}
7519
- data-id={props.id}
7520
- nonce={props.nonce || ""}
7521
- /></>;
7522
- }
7523
- var Inlined_script_default = InlinedScript;
7524
-
7525
7937
  // src/components/content/components/enable-editor.tsx
7526
7938
  import {
7527
- Show as Show13,
7939
+ Show as Show14,
7528
7940
  onMount as onMount6,
7529
7941
  on as on3,
7530
7942
  createEffect as createEffect3,
7531
- createMemo as createMemo15,
7532
- createSignal as createSignal15
7943
+ createMemo as createMemo16,
7944
+ createSignal as createSignal16
7533
7945
  } from "solid-js";
7534
7946
  import { Dynamic as Dynamic5 } from "solid-js/web";
7535
7947
 
@@ -7539,7 +7951,7 @@ function getPreviewContent(_searchParams) {
7539
7951
  }
7540
7952
 
7541
7953
  // src/constants/sdk-version.ts
7542
- var SDK_VERSION = "3.0.3";
7954
+ var SDK_VERSION = "3.0.6";
7543
7955
 
7544
7956
  // src/helpers/sdk-headers.ts
7545
7957
  var getSdkHeaders = () => ({
@@ -7836,16 +8248,6 @@ async function fetchEntries(options) {
7836
8248
  return _processContentResult(options, content);
7837
8249
  }
7838
8250
 
7839
- // src/functions/is-previewing.ts
7840
- function isPreviewing(_search) {
7841
- const search = _search || (isBrowser() ? window.location.search : void 0);
7842
- if (!search) {
7843
- return false;
7844
- }
7845
- const normalizedSearch = getSearchString(search);
7846
- return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
7847
- }
7848
-
7849
8251
  // src/helpers/uuid.ts
7850
8252
  function uuidv4() {
7851
8253
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
@@ -8172,7 +8574,8 @@ var setupBrowserForEditing = (options = {}) => {
8172
8574
  // Supports builder-model="..." attribute which is needed to
8173
8575
  // scope our '+ add block' button styling
8174
8576
  supportsAddBlockScoping: true,
8175
- supportsCustomBreakpoints: true
8577
+ supportsCustomBreakpoints: true,
8578
+ blockLevelPersonalization: true
8176
8579
  }
8177
8580
  }, "*");
8178
8581
  window.parent?.postMessage({
@@ -8387,12 +8790,12 @@ var getWrapperClassName = (variationId) => {
8387
8790
 
8388
8791
  // src/components/content/components/enable-editor.tsx
8389
8792
  function EnableEditor(props) {
8390
- const [ContentWrapper, setContentWrapper] = createSignal15(
8793
+ const [ContentWrapper, setContentWrapper] = createSignal16(
8391
8794
  props.contentWrapper || "div"
8392
8795
  );
8393
- const [httpReqsData, setHttpReqsData] = createSignal15({});
8394
- const [httpReqsPending, setHttpReqsPending] = createSignal15({});
8395
- const [clicked, setClicked] = createSignal15(false);
8796
+ const [httpReqsData, setHttpReqsData] = createSignal16({});
8797
+ const [httpReqsPending, setHttpReqsPending] = createSignal16({});
8798
+ const [clicked, setClicked] = createSignal16(false);
8396
8799
  function mergeNewRootState(newData) {
8397
8800
  const combinedState = {
8398
8801
  ...props.builderContextSignal.rootState,
@@ -8426,7 +8829,7 @@ function EnableEditor(props) {
8426
8829
  content: newContentValue
8427
8830
  }));
8428
8831
  }
8429
- const showContentProps = createMemo15(() => {
8832
+ const showContentProps = createMemo16(() => {
8430
8833
  return props.showContent ? {} : {
8431
8834
  hidden: true,
8432
8835
  "aria-hidden": true
@@ -8602,14 +9005,14 @@ function EnableEditor(props) {
8602
9005
  }
8603
9006
  }
8604
9007
  });
8605
- const onUpdateFn_0_props_content = createMemo15(() => props.content);
9008
+ const onUpdateFn_0_props_content = createMemo16(() => props.content);
8606
9009
  function onUpdateFn_0() {
8607
9010
  if (props.content) {
8608
9011
  mergeNewContent(props.content);
8609
9012
  }
8610
9013
  }
8611
9014
  createEffect3(on3(() => [onUpdateFn_0_props_content()], onUpdateFn_0));
8612
- const onUpdateFn_1_props_builderContextSignal_rootState = createMemo15(
9015
+ const onUpdateFn_1_props_builderContextSignal_rootState = createMemo16(
8613
9016
  () => props.builderContextSignal.rootState
8614
9017
  );
8615
9018
  function onUpdateFn_1() {
@@ -8621,14 +9024,14 @@ function EnableEditor(props) {
8621
9024
  onUpdateFn_1
8622
9025
  )
8623
9026
  );
8624
- const onUpdateFn_2_props_data = createMemo15(() => props.data);
9027
+ const onUpdateFn_2_props_data = createMemo16(() => props.data);
8625
9028
  function onUpdateFn_2() {
8626
9029
  if (props.data) {
8627
9030
  mergeNewRootState(props.data);
8628
9031
  }
8629
9032
  }
8630
9033
  createEffect3(on3(() => [onUpdateFn_2_props_data()], onUpdateFn_2));
8631
- const onUpdateFn_3_props_locale = createMemo15(() => props.locale);
9034
+ const onUpdateFn_3_props_locale = createMemo16(() => props.locale);
8632
9035
  function onUpdateFn_3() {
8633
9036
  if (props.locale) {
8634
9037
  mergeNewRootState({
@@ -8637,7 +9040,7 @@ function EnableEditor(props) {
8637
9040
  }
8638
9041
  }
8639
9042
  createEffect3(on3(() => [onUpdateFn_3_props_locale()], onUpdateFn_3));
8640
- return <><builder_context_default.Provider value={props.builderContextSignal}><Show13
9043
+ return <><builder_context_default.Provider value={props.builderContextSignal}><Show14
8641
9044
  when={props.builderContextSignal.content || needsElementRefDivForEditing()}
8642
9045
  ><Dynamic5
8643
9046
  class={getWrapperClassName(
@@ -8655,14 +9058,14 @@ function EnableEditor(props) {
8655
9058
  {...showContentProps()}
8656
9059
  {...props.contentWrapperProps}
8657
9060
  component={ContentWrapper()}
8658
- >{props.children}</Dynamic5></Show13></builder_context_default.Provider></>;
9061
+ >{props.children}</Dynamic5></Show14></builder_context_default.Provider></>;
8659
9062
  }
8660
9063
  var Enable_editor_default = EnableEditor;
8661
9064
 
8662
9065
  // src/components/content/components/styles.tsx
8663
- import { createSignal as createSignal16 } from "solid-js";
9066
+ import { createSignal as createSignal17 } from "solid-js";
8664
9067
  function ContentStyles(props) {
8665
- const [injectedStyles, setInjectedStyles] = createSignal16(
9068
+ const [injectedStyles, setInjectedStyles] = createSignal17(
8666
9069
  `
8667
9070
  ${getCss({
8668
9071
  cssCode: props.cssCode,
@@ -8720,7 +9123,7 @@ var getContentInitialValue = ({
8720
9123
 
8721
9124
  // src/components/content/content.tsx
8722
9125
  function ContentComponent(props) {
8723
- const [scriptStr, setScriptStr] = createSignal17(
9126
+ const [scriptStr, setScriptStr] = createSignal18(
8724
9127
  getUpdateVariantVisibilityScript({
8725
9128
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
8726
9129
  variationId: props.content?.testVariationId,
@@ -8728,7 +9131,7 @@ function ContentComponent(props) {
8728
9131
  contentId: props.content?.id
8729
9132
  })
8730
9133
  );
8731
- const [registeredComponents, setRegisteredComponents] = createSignal17(
9134
+ const [registeredComponents, setRegisteredComponents] = createSignal18(
8732
9135
  [
8733
9136
  ...getDefaultRegisteredComponents(),
8734
9137
  ...props.customComponents || []
@@ -8743,7 +9146,7 @@ function ContentComponent(props) {
8743
9146
  {}
8744
9147
  )
8745
9148
  );
8746
- const [builderContextSignal, setBuilderContextSignal] = createSignal17({
9149
+ const [builderContextSignal, setBuilderContextSignal] = createSignal18({
8747
9150
  content: getContentInitialValue({
8748
9151
  content: props.content,
8749
9152
  data: props.data
@@ -8827,18 +9230,18 @@ function ContentComponent(props) {
8827
9230
  setBuilderContextSignal
8828
9231
  }}
8829
9232
  >
8830
- <Show14 when={props.isSsrAbTest}><Inlined_script_default
9233
+ <Show15 when={props.isSsrAbTest}><Inlined_script_default
8831
9234
  id="builderio-variant-visibility"
8832
9235
  scriptStr={scriptStr()}
8833
9236
  nonce={props.nonce || ""}
8834
- /></Show14>
8835
- <Show14 when={TARGET !== "reactNative"}><Styles_default
9237
+ /></Show15>
9238
+ <Show15 when={TARGET !== "reactNative"}><Styles_default
8836
9239
  nonce={props.nonce || ""}
8837
9240
  isNestedRender={props.isNestedRender}
8838
9241
  contentId={builderContextSignal().content?.id}
8839
9242
  cssCode={builderContextSignal().content?.data?.cssCode}
8840
9243
  customFonts={builderContextSignal().content?.data?.customFonts}
8841
- /></Show14>
9244
+ /></Show15>
8842
9245
  <Blocks_default
8843
9246
  blocks={builderContextSignal().content?.data?.blocks}
8844
9247
  context={builderContextSignal()}
@@ -8851,13 +9254,13 @@ var Content_default = ContentComponent;
8851
9254
 
8852
9255
  // src/components/content-variants/content-variants.tsx
8853
9256
  function ContentVariants(props) {
8854
- const [shouldRenderVariants, setShouldRenderVariants] = createSignal18(
8855
- checkShouldRenderVariants({
9257
+ const [shouldRenderVariants, setShouldRenderVariants] = createSignal19(
9258
+ checkShouldRenderVariants2({
8856
9259
  canTrack: getDefaultCanTrack(props.canTrack),
8857
9260
  content: props.content
8858
9261
  })
8859
9262
  );
8860
- const updateCookieAndStylesScriptStr = createMemo18(() => {
9263
+ const updateCookieAndStylesScriptStr = createMemo19(() => {
8861
9264
  return getUpdateCookieAndStylesScript(
8862
9265
  getVariants(props.content).map((value) => ({
8863
9266
  id: value.testVariationId,
@@ -8866,10 +9269,10 @@ function ContentVariants(props) {
8866
9269
  props.content?.id || ""
8867
9270
  );
8868
9271
  });
8869
- const hideVariantsStyleString = createMemo18(() => {
9272
+ const hideVariantsStyleString = createMemo19(() => {
8870
9273
  return getVariants(props.content).map((value) => `.variant-${value.testVariationId} { display: none; } `).join("");
8871
9274
  });
8872
- const defaultContent = createMemo18(() => {
9275
+ const defaultContent = createMemo19(() => {
8873
9276
  return shouldRenderVariants() ? {
8874
9277
  ...props.content,
8875
9278
  testVariationId: props.content?.id
@@ -8882,12 +9285,12 @@ function ContentVariants(props) {
8882
9285
  setShouldRenderVariants(false);
8883
9286
  });
8884
9287
  return <><>
8885
- <Show15 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
9288
+ <Show16 when={!props.isNestedRender && TARGET !== "reactNative"}><Inlined_script_default
8886
9289
  id="builderio-init-variants-fns"
8887
9290
  scriptStr={getInitVariantsFnsScriptString()}
8888
9291
  nonce={props.nonce || ""}
8889
- /></Show15>
8890
- <Show15 when={shouldRenderVariants()}>
9292
+ /></Show16>
9293
+ <Show16 when={shouldRenderVariants()}>
8891
9294
  <Inlined_styles_default
8892
9295
  id="builderio-variants"
8893
9296
  styles={hideVariantsStyleString()}
@@ -8926,7 +9329,7 @@ function ContentVariants(props) {
8926
9329
  {...{}}
8927
9330
  />;
8928
9331
  }}</For9>
8929
- </Show15>
9332
+ </Show16>
8930
9333
  <Content_default
8931
9334
  apiHost={props.apiHost}
8932
9335
  nonce={props.nonce}
@@ -8981,14 +9384,14 @@ var fetchSymbolContent = async ({
8981
9384
 
8982
9385
  // src/blocks/symbol/symbol.tsx
8983
9386
  function Symbol2(props) {
8984
- const [contentToUse, setContentToUse] = createSignal19(props.symbol?.content);
8985
- const blocksWrapper = createMemo19(() => {
9387
+ const [contentToUse, setContentToUse] = createSignal20(props.symbol?.content);
9388
+ const blocksWrapper = createMemo20(() => {
8986
9389
  return "div";
8987
9390
  });
8988
- const contentWrapper = createMemo19(() => {
9391
+ const contentWrapper = createMemo20(() => {
8989
9392
  return "div";
8990
9393
  });
8991
- const className = createMemo19(() => {
9394
+ const className = createMemo20(() => {
8992
9395
  return [
8993
9396
  ...[props.attributes[getClassPropName()]],
8994
9397
  "builder-symbol",
@@ -9010,7 +9413,7 @@ function Symbol2(props) {
9010
9413
  }
9011
9414
  onMount8(() => {
9012
9415
  });
9013
- const onUpdateFn_0_props_symbol = createMemo19(() => props.symbol);
9416
+ const onUpdateFn_0_props_symbol = createMemo20(() => props.symbol);
9014
9417
  function onUpdateFn_0() {
9015
9418
  setContent();
9016
9419
  }
@@ -9095,6 +9498,7 @@ export {
9095
9498
  isEditing,
9096
9499
  isPreviewing,
9097
9500
  register,
9501
+ setClientUserAttributes,
9098
9502
  setEditorSettings,
9099
9503
  subscribeToEditor,
9100
9504
  track