@builder.io/sdk-qwik 0.16.1 → 0.16.3

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.
@@ -1612,6 +1612,7 @@ const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, sta
1612
1612
  return breakpointSizes[size].max;
1613
1613
  };
1614
1614
  const columnsStyles = function columnsStyles2(props, state) {
1615
+ const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
1615
1616
  return `
1616
1617
  @media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
1617
1618
  .${props.builderBlock.id}-breakpoints {
@@ -1619,7 +1620,7 @@ const columnsStyles = function columnsStyles2(props, state) {
1619
1620
  align-items: stretch;
1620
1621
  }
1621
1622
 
1622
- .${props.builderBlock.id}-breakpoints > .builder-column {
1623
+ ${childColumnDiv} {
1623
1624
  width: var(--column-width-tablet) !important;
1624
1625
  margin-left: var(--column-margin-left-tablet) !important;
1625
1626
  }
@@ -1631,7 +1632,7 @@ const columnsStyles = function columnsStyles2(props, state) {
1631
1632
  align-items: stretch;
1632
1633
  }
1633
1634
 
1634
- .${props.builderBlock.id}-breakpoints > .builder-column {
1635
+ ${childColumnDiv} {
1635
1636
  width: var(--column-width-mobile) !important;
1636
1637
  margin-left: var(--column-margin-left-mobile) !important;
1637
1638
  }
@@ -1798,6 +1799,8 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1798
1799
  // images, otherwise you can supply this prop manually
1799
1800
  !(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/)))
1800
1801
  return props2.srcset;
1802
+ if (props2.noWebp)
1803
+ return void 0;
1801
1804
  if (props2.srcset && ((_a2 = props2.image) == null ? void 0 : _a2.includes("builder.io/api/v1/image"))) {
1802
1805
  if (!props2.srcset.includes(props2.image.split("?")[0])) {
1803
1806
  console.debug("Removed given srcset");
@@ -4751,14 +4754,13 @@ const serializeFn = (fnValue) => {
4751
4754
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
4752
4755
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
4753
4756
  };
4754
- const serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
4755
- const serializeComponentInfo = ({ inputs, ...info }) => ({
4756
- ...fastClone(info),
4757
- inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
4758
- ...acc,
4759
- [key]: serializeValue(value)
4760
- }), {}))
4761
- });
4757
+ function serializeComponentInfo(info) {
4758
+ return JSON.parse(JSON.stringify(info, (key, value) => {
4759
+ if (typeof value === "function")
4760
+ return serializeFn(value);
4761
+ return value;
4762
+ }));
4763
+ }
4762
4764
  const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
4763
4765
  const UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
4764
4766
  const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
@@ -5201,7 +5203,7 @@ function isFromTrustedHost(trustedHosts, e) {
5201
5203
  const url = new URL(e.origin), hostname = url.hostname;
5202
5204
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
5203
5205
  }
5204
- const SDK_VERSION = "0.16.1";
5206
+ const SDK_VERSION = "0.16.3";
5205
5207
  const registry = {};
5206
5208
  function register(type, info) {
5207
5209
  let typeList = registry[type];
@@ -5887,7 +5889,7 @@ const getContentInitialValue = ({ content, data }) => {
5887
5889
  };
5888
5890
  };
5889
5891
  const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
5890
- var _a, _b;
5892
+ var _a, _b, _c, _d;
5891
5893
  qwik._jsxBranch();
5892
5894
  const state = qwik.useStore({
5893
5895
  builderContextSignal: {
@@ -5908,7 +5910,13 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
5908
5910
  apiVersion: props.apiVersion,
5909
5911
  componentInfos: [
5910
5912
  ...getDefaultRegisteredComponents(),
5911
- ...props.customComponents || []
5913
+ ...((_a = props.customComponents) == null ? void 0 : _a.filter(({ models }) => {
5914
+ if (!(models == null ? void 0 : models.length))
5915
+ return true;
5916
+ if (!props.model)
5917
+ return true;
5918
+ return models.includes(props.model);
5919
+ })) || []
5912
5920
  ].reduce((acc, { component: _, ...info }) => ({
5913
5921
  ...acc,
5914
5922
  [info.name]: serializeComponentInfo(info)
@@ -5920,7 +5928,13 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
5920
5928
  },
5921
5929
  registeredComponents: [
5922
5930
  ...getDefaultRegisteredComponents(),
5923
- ...props.customComponents || []
5931
+ ...((_b = props.customComponents) == null ? void 0 : _b.filter(({ models }) => {
5932
+ if (!(models == null ? void 0 : models.length))
5933
+ return true;
5934
+ if (!props.model)
5935
+ return true;
5936
+ return models.includes(props.model);
5937
+ })) || []
5924
5938
  ].reduce((acc, { component, ...info }) => ({
5925
5939
  ...acc,
5926
5940
  [info.name]: {
@@ -5930,9 +5944,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
5930
5944
  }), {}),
5931
5945
  scriptStr: getUpdateVariantVisibilityScript({
5932
5946
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
5933
- variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
5947
+ variationId: (_c = props.content) == null ? void 0 : _c.testVariationId,
5934
5948
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
5935
- contentId: (_b = props.content) == null ? void 0 : _b.id
5949
+ contentId: (_d = props.content) == null ? void 0 : _d.id
5936
5950
  })
5937
5951
  }, {
5938
5952
  deep: true
@@ -6165,8 +6179,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
6165
6179
  props,
6166
6180
  state
6167
6181
  ]));
6168
- qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
6169
- }, "ContentVariants_component_useTask_lSvynevU008"));
6170
6182
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
6171
6183
  children: [
6172
6184
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
@@ -1610,6 +1610,7 @@ const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, sta
1610
1610
  return breakpointSizes[size].max;
1611
1611
  };
1612
1612
  const columnsStyles = function columnsStyles2(props, state) {
1613
+ const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
1613
1614
  return `
1614
1615
  @media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
1615
1616
  .${props.builderBlock.id}-breakpoints {
@@ -1617,7 +1618,7 @@ const columnsStyles = function columnsStyles2(props, state) {
1617
1618
  align-items: stretch;
1618
1619
  }
1619
1620
 
1620
- .${props.builderBlock.id}-breakpoints > .builder-column {
1621
+ ${childColumnDiv} {
1621
1622
  width: var(--column-width-tablet) !important;
1622
1623
  margin-left: var(--column-margin-left-tablet) !important;
1623
1624
  }
@@ -1629,7 +1630,7 @@ const columnsStyles = function columnsStyles2(props, state) {
1629
1630
  align-items: stretch;
1630
1631
  }
1631
1632
 
1632
- .${props.builderBlock.id}-breakpoints > .builder-column {
1633
+ ${childColumnDiv} {
1633
1634
  width: var(--column-width-mobile) !important;
1634
1635
  margin-left: var(--column-margin-left-mobile) !important;
1635
1636
  }
@@ -1796,6 +1797,8 @@ const Image = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1796
1797
  // images, otherwise you can supply this prop manually
1797
1798
  !(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/)))
1798
1799
  return props2.srcset;
1800
+ if (props2.noWebp)
1801
+ return void 0;
1799
1802
  if (props2.srcset && ((_a2 = props2.image) == null ? void 0 : _a2.includes("builder.io/api/v1/image"))) {
1800
1803
  if (!props2.srcset.includes(props2.image.split("?")[0])) {
1801
1804
  console.debug("Removed given srcset");
@@ -4749,14 +4752,13 @@ const serializeFn = (fnValue) => {
4749
4752
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
4750
4753
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
4751
4754
  };
4752
- const serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
4753
- const serializeComponentInfo = ({ inputs, ...info }) => ({
4754
- ...fastClone(info),
4755
- inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
4756
- ...acc,
4757
- [key]: serializeValue(value)
4758
- }), {}))
4759
- });
4755
+ function serializeComponentInfo(info) {
4756
+ return JSON.parse(JSON.stringify(info, (key, value) => {
4757
+ if (typeof value === "function")
4758
+ return serializeFn(value);
4759
+ return value;
4760
+ }));
4761
+ }
4760
4762
  const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
4761
4763
  const UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
4762
4764
  const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
@@ -5199,7 +5201,7 @@ function isFromTrustedHost(trustedHosts, e) {
5199
5201
  const url = new URL(e.origin), hostname = url.hostname;
5200
5202
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
5201
5203
  }
5202
- const SDK_VERSION = "0.16.1";
5204
+ const SDK_VERSION = "0.16.3";
5203
5205
  const registry = {};
5204
5206
  function register(type, info) {
5205
5207
  let typeList = registry[type];
@@ -5885,7 +5887,7 @@ const getContentInitialValue = ({ content, data }) => {
5885
5887
  };
5886
5888
  };
5887
5889
  const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
5888
- var _a, _b;
5890
+ var _a, _b, _c, _d;
5889
5891
  _jsxBranch();
5890
5892
  const state = useStore({
5891
5893
  builderContextSignal: {
@@ -5906,7 +5908,13 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
5906
5908
  apiVersion: props.apiVersion,
5907
5909
  componentInfos: [
5908
5910
  ...getDefaultRegisteredComponents(),
5909
- ...props.customComponents || []
5911
+ ...((_a = props.customComponents) == null ? void 0 : _a.filter(({ models }) => {
5912
+ if (!(models == null ? void 0 : models.length))
5913
+ return true;
5914
+ if (!props.model)
5915
+ return true;
5916
+ return models.includes(props.model);
5917
+ })) || []
5910
5918
  ].reduce((acc, { component: _, ...info }) => ({
5911
5919
  ...acc,
5912
5920
  [info.name]: serializeComponentInfo(info)
@@ -5918,7 +5926,13 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
5918
5926
  },
5919
5927
  registeredComponents: [
5920
5928
  ...getDefaultRegisteredComponents(),
5921
- ...props.customComponents || []
5929
+ ...((_b = props.customComponents) == null ? void 0 : _b.filter(({ models }) => {
5930
+ if (!(models == null ? void 0 : models.length))
5931
+ return true;
5932
+ if (!props.model)
5933
+ return true;
5934
+ return models.includes(props.model);
5935
+ })) || []
5922
5936
  ].reduce((acc, { component, ...info }) => ({
5923
5937
  ...acc,
5924
5938
  [info.name]: {
@@ -5928,9 +5942,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
5928
5942
  }), {}),
5929
5943
  scriptStr: getUpdateVariantVisibilityScript({
5930
5944
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
5931
- variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
5945
+ variationId: (_c = props.content) == null ? void 0 : _c.testVariationId,
5932
5946
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
5933
- contentId: (_b = props.content) == null ? void 0 : _b.id
5947
+ contentId: (_d = props.content) == null ? void 0 : _d.id
5934
5948
  })
5935
5949
  }, {
5936
5950
  deep: true
@@ -6163,8 +6177,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
6163
6177
  props,
6164
6178
  state
6165
6179
  ]));
6166
- useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
6167
- }, "ContentVariants_component_useTask_lSvynevU008"));
6168
6180
  return /* @__PURE__ */ _jsxC(Fragment$1, {
6169
6181
  children: [
6170
6182
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(InlinedScript, {
@@ -4836,6 +4836,7 @@ const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, sta
4836
4836
  return breakpointSizes[size].max;
4837
4837
  };
4838
4838
  const columnsStyles = function columnsStyles2(props, state) {
4839
+ const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
4839
4840
  return `
4840
4841
  @media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
4841
4842
  .${props.builderBlock.id}-breakpoints {
@@ -4843,7 +4844,7 @@ const columnsStyles = function columnsStyles2(props, state) {
4843
4844
  align-items: stretch;
4844
4845
  }
4845
4846
 
4846
- .${props.builderBlock.id}-breakpoints > .builder-column {
4847
+ ${childColumnDiv} {
4847
4848
  width: var(--column-width-tablet) !important;
4848
4849
  margin-left: var(--column-margin-left-tablet) !important;
4849
4850
  }
@@ -4855,7 +4856,7 @@ const columnsStyles = function columnsStyles2(props, state) {
4855
4856
  align-items: stretch;
4856
4857
  }
4857
4858
 
4858
- .${props.builderBlock.id}-breakpoints > .builder-column {
4859
+ ${childColumnDiv} {
4859
4860
  width: var(--column-width-mobile) !important;
4860
4861
  margin-left: var(--column-margin-left-mobile) !important;
4861
4862
  }
@@ -5022,6 +5023,8 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
5022
5023
  // images, otherwise you can supply this prop manually
5023
5024
  !(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/)))
5024
5025
  return props2.srcset;
5026
+ if (props2.noWebp)
5027
+ return void 0;
5025
5028
  if (props2.srcset && ((_a2 = props2.image) == null ? void 0 : _a2.includes("builder.io/api/v1/image"))) {
5026
5029
  if (!props2.srcset.includes(props2.image.split("?")[0])) {
5027
5030
  console.debug("Removed given srcset");
@@ -7975,14 +7978,13 @@ const serializeFn = (fnValue) => {
7975
7978
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
7976
7979
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
7977
7980
  };
7978
- const serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
7979
- const serializeComponentInfo = ({ inputs, ...info }) => ({
7980
- ...fastClone(info),
7981
- inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
7982
- ...acc,
7983
- [key]: serializeValue(value)
7984
- }), {}))
7985
- });
7981
+ function serializeComponentInfo(info) {
7982
+ return JSON.parse(JSON.stringify(info, (key, value) => {
7983
+ if (typeof value === "function")
7984
+ return serializeFn(value);
7985
+ return value;
7986
+ }));
7987
+ }
7986
7988
  const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
7987
7989
  const UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
7988
7990
  const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
@@ -8425,7 +8427,7 @@ function isFromTrustedHost(trustedHosts, e) {
8425
8427
  const url = new URL(e.origin), hostname = url.hostname;
8426
8428
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
8427
8429
  }
8428
- const SDK_VERSION = "0.16.1";
8430
+ const SDK_VERSION = "0.16.3";
8429
8431
  const registry = {};
8430
8432
  function register(type, info) {
8431
8433
  let typeList = registry[type];
@@ -9111,7 +9113,7 @@ const getContentInitialValue = ({ content, data }) => {
9111
9113
  };
9112
9114
  };
9113
9115
  const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
9114
- var _a, _b;
9116
+ var _a, _b, _c, _d;
9115
9117
  qwik._jsxBranch();
9116
9118
  const state = qwik.useStore({
9117
9119
  builderContextSignal: {
@@ -9132,7 +9134,13 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
9132
9134
  apiVersion: props.apiVersion,
9133
9135
  componentInfos: [
9134
9136
  ...getDefaultRegisteredComponents(),
9135
- ...props.customComponents || []
9137
+ ...((_a = props.customComponents) == null ? void 0 : _a.filter(({ models }) => {
9138
+ if (!(models == null ? void 0 : models.length))
9139
+ return true;
9140
+ if (!props.model)
9141
+ return true;
9142
+ return models.includes(props.model);
9143
+ })) || []
9136
9144
  ].reduce((acc, { component: _, ...info }) => ({
9137
9145
  ...acc,
9138
9146
  [info.name]: serializeComponentInfo(info)
@@ -9144,7 +9152,13 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
9144
9152
  },
9145
9153
  registeredComponents: [
9146
9154
  ...getDefaultRegisteredComponents(),
9147
- ...props.customComponents || []
9155
+ ...((_b = props.customComponents) == null ? void 0 : _b.filter(({ models }) => {
9156
+ if (!(models == null ? void 0 : models.length))
9157
+ return true;
9158
+ if (!props.model)
9159
+ return true;
9160
+ return models.includes(props.model);
9161
+ })) || []
9148
9162
  ].reduce((acc, { component, ...info }) => ({
9149
9163
  ...acc,
9150
9164
  [info.name]: {
@@ -9154,9 +9168,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
9154
9168
  }), {}),
9155
9169
  scriptStr: getUpdateVariantVisibilityScript({
9156
9170
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
9157
- variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
9171
+ variationId: (_c = props.content) == null ? void 0 : _c.testVariationId,
9158
9172
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
9159
- contentId: (_b = props.content) == null ? void 0 : _b.id
9173
+ contentId: (_d = props.content) == null ? void 0 : _d.id
9160
9174
  })
9161
9175
  }, {
9162
9176
  deep: true
@@ -9389,8 +9403,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
9389
9403
  props,
9390
9404
  state
9391
9405
  ]));
9392
- qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
9393
- }, "ContentVariants_component_useTask_lSvynevU008"));
9394
9406
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
9395
9407
  children: [
9396
9408
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
@@ -4834,6 +4834,7 @@ const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, sta
4834
4834
  return breakpointSizes[size].max;
4835
4835
  };
4836
4836
  const columnsStyles = function columnsStyles2(props, state) {
4837
+ const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
4837
4838
  return `
4838
4839
  @media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
4839
4840
  .${props.builderBlock.id}-breakpoints {
@@ -4841,7 +4842,7 @@ const columnsStyles = function columnsStyles2(props, state) {
4841
4842
  align-items: stretch;
4842
4843
  }
4843
4844
 
4844
- .${props.builderBlock.id}-breakpoints > .builder-column {
4845
+ ${childColumnDiv} {
4845
4846
  width: var(--column-width-tablet) !important;
4846
4847
  margin-left: var(--column-margin-left-tablet) !important;
4847
4848
  }
@@ -4853,7 +4854,7 @@ const columnsStyles = function columnsStyles2(props, state) {
4853
4854
  align-items: stretch;
4854
4855
  }
4855
4856
 
4856
- .${props.builderBlock.id}-breakpoints > .builder-column {
4857
+ ${childColumnDiv} {
4857
4858
  width: var(--column-width-mobile) !important;
4858
4859
  margin-left: var(--column-margin-left-mobile) !important;
4859
4860
  }
@@ -5020,6 +5021,8 @@ const Image = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
5020
5021
  // images, otherwise you can supply this prop manually
5021
5022
  !(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/)))
5022
5023
  return props2.srcset;
5024
+ if (props2.noWebp)
5025
+ return void 0;
5023
5026
  if (props2.srcset && ((_a2 = props2.image) == null ? void 0 : _a2.includes("builder.io/api/v1/image"))) {
5024
5027
  if (!props2.srcset.includes(props2.image.split("?")[0])) {
5025
5028
  console.debug("Removed given srcset");
@@ -7973,14 +7976,13 @@ const serializeFn = (fnValue) => {
7973
7976
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
7974
7977
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
7975
7978
  };
7976
- const serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
7977
- const serializeComponentInfo = ({ inputs, ...info }) => ({
7978
- ...fastClone(info),
7979
- inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
7980
- ...acc,
7981
- [key]: serializeValue(value)
7982
- }), {}))
7983
- });
7979
+ function serializeComponentInfo(info) {
7980
+ return JSON.parse(JSON.stringify(info, (key, value) => {
7981
+ if (typeof value === "function")
7982
+ return serializeFn(value);
7983
+ return value;
7984
+ }));
7985
+ }
7984
7986
  const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
7985
7987
  const UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
7986
7988
  const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
@@ -8423,7 +8425,7 @@ function isFromTrustedHost(trustedHosts, e) {
8423
8425
  const url = new URL(e.origin), hostname = url.hostname;
8424
8426
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
8425
8427
  }
8426
- const SDK_VERSION = "0.16.1";
8428
+ const SDK_VERSION = "0.16.3";
8427
8429
  const registry = {};
8428
8430
  function register(type, info) {
8429
8431
  let typeList = registry[type];
@@ -9109,7 +9111,7 @@ const getContentInitialValue = ({ content, data }) => {
9109
9111
  };
9110
9112
  };
9111
9113
  const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
9112
- var _a, _b;
9114
+ var _a, _b, _c, _d;
9113
9115
  _jsxBranch();
9114
9116
  const state = useStore({
9115
9117
  builderContextSignal: {
@@ -9130,7 +9132,13 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
9130
9132
  apiVersion: props.apiVersion,
9131
9133
  componentInfos: [
9132
9134
  ...getDefaultRegisteredComponents(),
9133
- ...props.customComponents || []
9135
+ ...((_a = props.customComponents) == null ? void 0 : _a.filter(({ models }) => {
9136
+ if (!(models == null ? void 0 : models.length))
9137
+ return true;
9138
+ if (!props.model)
9139
+ return true;
9140
+ return models.includes(props.model);
9141
+ })) || []
9134
9142
  ].reduce((acc, { component: _, ...info }) => ({
9135
9143
  ...acc,
9136
9144
  [info.name]: serializeComponentInfo(info)
@@ -9142,7 +9150,13 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
9142
9150
  },
9143
9151
  registeredComponents: [
9144
9152
  ...getDefaultRegisteredComponents(),
9145
- ...props.customComponents || []
9153
+ ...((_b = props.customComponents) == null ? void 0 : _b.filter(({ models }) => {
9154
+ if (!(models == null ? void 0 : models.length))
9155
+ return true;
9156
+ if (!props.model)
9157
+ return true;
9158
+ return models.includes(props.model);
9159
+ })) || []
9146
9160
  ].reduce((acc, { component, ...info }) => ({
9147
9161
  ...acc,
9148
9162
  [info.name]: {
@@ -9152,9 +9166,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
9152
9166
  }), {}),
9153
9167
  scriptStr: getUpdateVariantVisibilityScript({
9154
9168
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
9155
- variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
9169
+ variationId: (_c = props.content) == null ? void 0 : _c.testVariationId,
9156
9170
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
9157
- contentId: (_b = props.content) == null ? void 0 : _b.id
9171
+ contentId: (_d = props.content) == null ? void 0 : _d.id
9158
9172
  })
9159
9173
  }, {
9160
9174
  deep: true
@@ -9387,8 +9401,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
9387
9401
  props,
9388
9402
  state
9389
9403
  ]));
9390
- useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
9391
- }, "ContentVariants_component_useTask_lSvynevU008"));
9392
9404
  return /* @__PURE__ */ _jsxC(Fragment$1, {
9393
9405
  children: [
9394
9406
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(InlinedScript, {
@@ -1757,6 +1757,7 @@ const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, sta
1757
1757
  return breakpointSizes[size].max;
1758
1758
  };
1759
1759
  const columnsStyles = function columnsStyles2(props, state) {
1760
+ const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
1760
1761
  return `
1761
1762
  @media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
1762
1763
  .${props.builderBlock.id}-breakpoints {
@@ -1764,7 +1765,7 @@ const columnsStyles = function columnsStyles2(props, state) {
1764
1765
  align-items: stretch;
1765
1766
  }
1766
1767
 
1767
- .${props.builderBlock.id}-breakpoints > .builder-column {
1768
+ ${childColumnDiv} {
1768
1769
  width: var(--column-width-tablet) !important;
1769
1770
  margin-left: var(--column-margin-left-tablet) !important;
1770
1771
  }
@@ -1776,7 +1777,7 @@ const columnsStyles = function columnsStyles2(props, state) {
1776
1777
  align-items: stretch;
1777
1778
  }
1778
1779
 
1779
- .${props.builderBlock.id}-breakpoints > .builder-column {
1780
+ ${childColumnDiv} {
1780
1781
  width: var(--column-width-mobile) !important;
1781
1782
  margin-left: var(--column-margin-left-mobile) !important;
1782
1783
  }
@@ -1943,6 +1944,8 @@ const Image = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl(
1943
1944
  // images, otherwise you can supply this prop manually
1944
1945
  !(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/)))
1945
1946
  return props2.srcset;
1947
+ if (props2.noWebp)
1948
+ return void 0;
1946
1949
  if (props2.srcset && ((_a2 = props2.image) == null ? void 0 : _a2.includes("builder.io/api/v1/image"))) {
1947
1950
  if (!props2.srcset.includes(props2.image.split("?")[0])) {
1948
1951
  console.debug("Removed given srcset");
@@ -4896,14 +4899,13 @@ const serializeFn = (fnValue) => {
4896
4899
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
4897
4900
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
4898
4901
  };
4899
- const serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
4900
- const serializeComponentInfo = ({ inputs, ...info }) => ({
4901
- ...fastClone(info),
4902
- inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
4903
- ...acc,
4904
- [key]: serializeValue(value)
4905
- }), {}))
4906
- });
4902
+ function serializeComponentInfo(info) {
4903
+ return JSON.parse(JSON.stringify(info, (key, value) => {
4904
+ if (typeof value === "function")
4905
+ return serializeFn(value);
4906
+ return value;
4907
+ }));
4908
+ }
4907
4909
  const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
4908
4910
  const UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
4909
4911
  const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
@@ -5346,7 +5348,7 @@ function isFromTrustedHost(trustedHosts, e) {
5346
5348
  const url = new URL(e.origin), hostname = url.hostname;
5347
5349
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
5348
5350
  }
5349
- const SDK_VERSION = "0.16.1";
5351
+ const SDK_VERSION = "0.16.3";
5350
5352
  const registry = {};
5351
5353
  function register(type, info) {
5352
5354
  let typeList = registry[type];
@@ -6032,7 +6034,7 @@ const getContentInitialValue = ({ content, data }) => {
6032
6034
  };
6033
6035
  };
6034
6036
  const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
6035
- var _a, _b;
6037
+ var _a, _b, _c, _d;
6036
6038
  qwik._jsxBranch();
6037
6039
  const state = qwik.useStore({
6038
6040
  builderContextSignal: {
@@ -6053,7 +6055,13 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
6053
6055
  apiVersion: props.apiVersion,
6054
6056
  componentInfos: [
6055
6057
  ...getDefaultRegisteredComponents(),
6056
- ...props.customComponents || []
6058
+ ...((_a = props.customComponents) == null ? void 0 : _a.filter(({ models }) => {
6059
+ if (!(models == null ? void 0 : models.length))
6060
+ return true;
6061
+ if (!props.model)
6062
+ return true;
6063
+ return models.includes(props.model);
6064
+ })) || []
6057
6065
  ].reduce((acc, { component: _, ...info }) => ({
6058
6066
  ...acc,
6059
6067
  [info.name]: serializeComponentInfo(info)
@@ -6065,7 +6073,13 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
6065
6073
  },
6066
6074
  registeredComponents: [
6067
6075
  ...getDefaultRegisteredComponents(),
6068
- ...props.customComponents || []
6076
+ ...((_b = props.customComponents) == null ? void 0 : _b.filter(({ models }) => {
6077
+ if (!(models == null ? void 0 : models.length))
6078
+ return true;
6079
+ if (!props.model)
6080
+ return true;
6081
+ return models.includes(props.model);
6082
+ })) || []
6069
6083
  ].reduce((acc, { component, ...info }) => ({
6070
6084
  ...acc,
6071
6085
  [info.name]: {
@@ -6075,9 +6089,9 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
6075
6089
  }), {}),
6076
6090
  scriptStr: getUpdateVariantVisibilityScript({
6077
6091
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
6078
- variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
6092
+ variationId: (_c = props.content) == null ? void 0 : _c.testVariationId,
6079
6093
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
6080
- contentId: (_b = props.content) == null ? void 0 : _b.id
6094
+ contentId: (_d = props.content) == null ? void 0 : _d.id
6081
6095
  })
6082
6096
  }, {
6083
6097
  deep: true
@@ -6310,8 +6324,6 @@ const ContentVariants = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.i
6310
6324
  props,
6311
6325
  state
6312
6326
  ]));
6313
- qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
6314
- }, "ContentVariants_component_useTask_lSvynevU008"));
6315
6327
  return /* @__PURE__ */ qwik._jsxC(qwik.Fragment, {
6316
6328
  children: [
6317
6329
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ qwik._jsxC(InlinedScript, {
@@ -1755,6 +1755,7 @@ const getWidthForBreakpointSize = function getWidthForBreakpointSize2(props, sta
1755
1755
  return breakpointSizes[size].max;
1756
1756
  };
1757
1757
  const columnsStyles = function columnsStyles2(props, state) {
1758
+ const childColumnDiv = `.${props.builderBlock.id}-breakpoints > .builder-column`;
1758
1759
  return `
1759
1760
  @media (max-width: ${getWidthForBreakpointSize(props, state, "medium")}px) {
1760
1761
  .${props.builderBlock.id}-breakpoints {
@@ -1762,7 +1763,7 @@ const columnsStyles = function columnsStyles2(props, state) {
1762
1763
  align-items: stretch;
1763
1764
  }
1764
1765
 
1765
- .${props.builderBlock.id}-breakpoints > .builder-column {
1766
+ ${childColumnDiv} {
1766
1767
  width: var(--column-width-tablet) !important;
1767
1768
  margin-left: var(--column-margin-left-tablet) !important;
1768
1769
  }
@@ -1774,7 +1775,7 @@ const columnsStyles = function columnsStyles2(props, state) {
1774
1775
  align-items: stretch;
1775
1776
  }
1776
1777
 
1777
- .${props.builderBlock.id}-breakpoints > .builder-column {
1778
+ ${childColumnDiv} {
1778
1779
  width: var(--column-width-mobile) !important;
1779
1780
  margin-left: var(--column-margin-left-mobile) !important;
1780
1781
  }
@@ -1941,6 +1942,8 @@ const Image = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
1941
1942
  // images, otherwise you can supply this prop manually
1942
1943
  !(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/)))
1943
1944
  return props2.srcset;
1945
+ if (props2.noWebp)
1946
+ return void 0;
1944
1947
  if (props2.srcset && ((_a2 = props2.image) == null ? void 0 : _a2.includes("builder.io/api/v1/image"))) {
1945
1948
  if (!props2.srcset.includes(props2.image.split("?")[0])) {
1946
1949
  console.debug("Removed given srcset");
@@ -4894,14 +4897,13 @@ const serializeFn = (fnValue) => {
4894
4897
  const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
4895
4898
  return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
4896
4899
  };
4897
- const serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
4898
- const serializeComponentInfo = ({ inputs, ...info }) => ({
4899
- ...fastClone(info),
4900
- inputs: inputs == null ? void 0 : inputs.map((input) => Object.entries(input).reduce((acc, [key, value]) => ({
4901
- ...acc,
4902
- [key]: serializeValue(value)
4903
- }), {}))
4904
- });
4900
+ function serializeComponentInfo(info) {
4901
+ return JSON.parse(JSON.stringify(info, (key, value) => {
4902
+ if (typeof value === "function")
4903
+ return serializeFn(value);
4904
+ return value;
4905
+ }));
4906
+ }
4905
4907
  const UPDATE_COOKIES_AND_STYLES_SCRIPT = "function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {\n function getAndSetVariantId() {\n function setCookie(name, value, days) {\n let expires = '';\n if (days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n expires = '; expires=' + date.toUTCString();\n }\n document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${contentId}`;\n const variantInCookie = getCookie(cookieName);\n const availableIDs = variants.map(vr => vr.id).concat(contentId);\n if (variantInCookie && availableIDs.includes(variantInCookie)) {\n return variantInCookie;\n }\n let n = 0;\n const random = Math.random();\n for (let i = 0; i < variants.length; i++) {\n const variant = variants[i];\n const testRatio = variant.testRatio;\n n += testRatio;\n if (random < n) {\n setCookie(cookieName, variant.id);\n return variant.id;\n }\n }\n setCookie(cookieName, contentId);\n return contentId;\n }\n const winningVariantId = getAndSetVariantId();\n const styleEl = document.currentScript?.previousElementSibling;\n if (isHydrationTarget) {\n styleEl.remove();\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n } else {\n const newStyleStr = variants.concat({\n id: contentId\n }).filter(variant => variant.id !== winningVariantId).map(value => {\n return `.variant-${value.id} { display: none; }\n `;\n }).join('');\n styleEl.innerHTML = newStyleStr;\n }\n}";
4906
4908
  const UPDATE_VARIANT_VISIBILITY_SCRIPT = "function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {\n if (!navigator.cookieEnabled) {\n return;\n }\n function getCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n return null;\n }\n const cookieName = `builder.tests.${defaultContentId}`;\n const winningVariant = getCookie(cookieName);\n const parentDiv = document.currentScript?.parentElement;\n const isDefaultContent = variantContentId === defaultContentId;\n const isWinningVariant = winningVariant === variantContentId;\n if (isWinningVariant && !isDefaultContent) {\n parentDiv?.removeAttribute('hidden');\n parentDiv?.removeAttribute('aria-hidden');\n } else if (!isWinningVariant && isDefaultContent) {\n parentDiv?.setAttribute('hidden', 'true');\n parentDiv?.setAttribute('aria-hidden', 'true');\n }\n if (isHydrationTarget) {\n if (!isWinningVariant) {\n parentDiv?.remove();\n }\n const thisScriptEl = document.currentScript;\n thisScriptEl?.remove();\n }\n return;\n}";
4907
4909
  const UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest";
@@ -5344,7 +5346,7 @@ function isFromTrustedHost(trustedHosts, e) {
5344
5346
  const url = new URL(e.origin), hostname = url.hostname;
5345
5347
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
5346
5348
  }
5347
- const SDK_VERSION = "0.16.1";
5349
+ const SDK_VERSION = "0.16.3";
5348
5350
  const registry = {};
5349
5351
  function register(type, info) {
5350
5352
  let typeList = registry[type];
@@ -6030,7 +6032,7 @@ const getContentInitialValue = ({ content, data }) => {
6030
6032
  };
6031
6033
  };
6032
6034
  const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
6033
- var _a, _b;
6035
+ var _a, _b, _c, _d;
6034
6036
  _jsxBranch();
6035
6037
  const state = useStore({
6036
6038
  builderContextSignal: {
@@ -6051,7 +6053,13 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
6051
6053
  apiVersion: props.apiVersion,
6052
6054
  componentInfos: [
6053
6055
  ...getDefaultRegisteredComponents(),
6054
- ...props.customComponents || []
6056
+ ...((_a = props.customComponents) == null ? void 0 : _a.filter(({ models }) => {
6057
+ if (!(models == null ? void 0 : models.length))
6058
+ return true;
6059
+ if (!props.model)
6060
+ return true;
6061
+ return models.includes(props.model);
6062
+ })) || []
6055
6063
  ].reduce((acc, { component: _, ...info }) => ({
6056
6064
  ...acc,
6057
6065
  [info.name]: serializeComponentInfo(info)
@@ -6063,7 +6071,13 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
6063
6071
  },
6064
6072
  registeredComponents: [
6065
6073
  ...getDefaultRegisteredComponents(),
6066
- ...props.customComponents || []
6074
+ ...((_b = props.customComponents) == null ? void 0 : _b.filter(({ models }) => {
6075
+ if (!(models == null ? void 0 : models.length))
6076
+ return true;
6077
+ if (!props.model)
6078
+ return true;
6079
+ return models.includes(props.model);
6080
+ })) || []
6067
6081
  ].reduce((acc, { component, ...info }) => ({
6068
6082
  ...acc,
6069
6083
  [info.name]: {
@@ -6073,9 +6087,9 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
6073
6087
  }), {}),
6074
6088
  scriptStr: getUpdateVariantVisibilityScript({
6075
6089
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
6076
- variationId: (_a = props.content) == null ? void 0 : _a.testVariationId,
6090
+ variationId: (_c = props.content) == null ? void 0 : _c.testVariationId,
6077
6091
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
6078
- contentId: (_b = props.content) == null ? void 0 : _b.id
6092
+ contentId: (_d = props.content) == null ? void 0 : _d.id
6079
6093
  })
6080
6094
  }, {
6081
6095
  deep: true
@@ -6308,8 +6322,6 @@ const ContentVariants = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl(
6308
6322
  props,
6309
6323
  state
6310
6324
  ]));
6311
- useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
6312
- }, "ContentVariants_component_useTask_lSvynevU008"));
6313
6325
  return /* @__PURE__ */ _jsxC(Fragment$1, {
6314
6326
  children: [
6315
6327
  !props.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ _jsxC(InlinedScript, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/qwik",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.16.1";
1
+ export declare const SDK_VERSION = "0.16.3";
@@ -1,6 +1,6 @@
1
1
  import type { ComponentInfo } from '../types/components';
2
2
  export declare const createRegisterComponentMessage: (info: ComponentInfo) => {
3
3
  type: string;
4
- data: ComponentInfo;
4
+ data: any;
5
5
  };
6
- export declare const serializeComponentInfo: ({ inputs, ...info }: ComponentInfo) => ComponentInfo;
6
+ export declare function serializeComponentInfo(info: ComponentInfo): any;