@builder.io/sdk-react-nextjs 0.7.1-2 → 0.7.1-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/lib/browser/{USE_CLIENT_BUNDLE-11d41596.js → USE_CLIENT_BUNDLE-1cdce03b.cjs} +1 -1
  2. package/lib/{node/USE_CLIENT_BUNDLE-e041d92c.mjs → browser/USE_CLIENT_BUNDLE-2dd6963b.js} +2 -2
  3. package/lib/{edge/USE_SERVER_BUNDLE-66d4b8c4.mjs → browser/USE_SERVER_BUNDLE-97369f61.js} +1 -1
  4. package/lib/browser/USE_SERVER_BUNDLE-c110917b.cjs +1 -0
  5. package/lib/browser/{bundle-242ae8b5.mjs → bundle-31003427.js} +2 -2
  6. package/lib/browser/{bundle-05622db1.js → bundle-cbc690cf.cjs} +2 -2
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.d.cts +1066 -0
  9. package/lib/browser/index.d.mts +1066 -0
  10. package/lib/browser/index.mjs +3 -3
  11. package/lib/{node/USE_CLIENT_BUNDLE-8147b412.js → edge/USE_CLIENT_BUNDLE-ba263633.cjs} +1 -1
  12. package/lib/{browser/USE_CLIENT_BUNDLE-48d9356f.mjs → edge/USE_CLIENT_BUNDLE-ee929cd6.js} +2 -2
  13. package/lib/edge/USE_SERVER_BUNDLE-133fe486.cjs +1 -0
  14. package/lib/{node/USE_SERVER_BUNDLE-1634816a.mjs → edge/USE_SERVER_BUNDLE-2a1fc947.js} +1 -1
  15. package/lib/edge/{bundle-3d31ba5d.mjs → bundle-1c5ceddb.js} +2 -2
  16. package/lib/edge/{bundle-1b9b93c7.js → bundle-cfdeec4b.cjs} +2 -2
  17. package/lib/edge/index.cjs +1 -1
  18. package/lib/edge/index.d.cts +1066 -0
  19. package/lib/edge/index.d.mts +1066 -0
  20. package/lib/edge/index.mjs +3 -3
  21. package/lib/{edge/USE_CLIENT_BUNDLE-6eb1ee54.mjs → node/USE_CLIENT_BUNDLE-32bb8c8f.js} +2 -2
  22. package/lib/{edge/USE_CLIENT_BUNDLE-bba76732.js → node/USE_CLIENT_BUNDLE-7a982d7c.cjs} +1 -1
  23. package/lib/node/USE_SERVER_BUNDLE-25f4a46f.cjs +1 -0
  24. package/lib/{browser/USE_SERVER_BUNDLE-3875256b.mjs → node/USE_SERVER_BUNDLE-86e8b7c7.js} +1 -1
  25. package/lib/node/{bundle-7ebcd79e.mjs → bundle-844e3979.js} +2 -2
  26. package/lib/node/{bundle-4203318d.js → bundle-b13f5899.cjs} +2 -2
  27. package/lib/node/index.cjs +1 -1
  28. package/lib/node/index.d.cts +1066 -0
  29. package/lib/node/index.d.mts +1066 -0
  30. package/lib/node/index.mjs +3 -3
  31. package/package.json +8 -26
  32. package/lib/browser/USE_SERVER_BUNDLE-568694d9.js +0 -1
  33. package/lib/edge/USE_SERVER_BUNDLE-305bf94a.js +0 -1
  34. package/lib/node/USE_SERVER_BUNDLE-8c1ae1f0.js +0 -1
  35. package/types/blocks/button/button.d.ts +0 -11
  36. package/types/blocks/button/component-info.d.ts +0 -2
  37. package/types/blocks/columns/columns.d.ts +0 -17
  38. package/types/blocks/columns/component-info.d.ts +0 -2
  39. package/types/blocks/custom-code/component-info.d.ts +0 -2
  40. package/types/blocks/custom-code/custom-code.d.ts +0 -7
  41. package/types/blocks/embed/component-info.d.ts +0 -2
  42. package/types/blocks/embed/embed.d.ts +0 -6
  43. package/types/blocks/embed/helpers.d.ts +0 -1
  44. package/types/blocks/fragment/component-info.d.ts +0 -2
  45. package/types/blocks/fragment/fragment.d.ts +0 -8
  46. package/types/blocks/helpers.d.ts +0 -13
  47. package/types/blocks/image/component-info.d.ts +0 -2
  48. package/types/blocks/image/image.d.ts +0 -22
  49. package/types/blocks/image/image.helpers.d.ts +0 -1
  50. package/types/blocks/img/component-info.d.ts +0 -2
  51. package/types/blocks/img/img.d.ts +0 -13
  52. package/types/blocks/section/component-info.d.ts +0 -2
  53. package/types/blocks/section/section.d.ts +0 -11
  54. package/types/blocks/symbol/component-info.d.ts +0 -2
  55. package/types/blocks/symbol/symbol.d.ts +0 -24
  56. package/types/blocks/symbol/symbol.helpers.d.ts +0 -14
  57. package/types/blocks/text/component-info.d.ts +0 -2
  58. package/types/blocks/text/text.d.ts +0 -6
  59. package/types/blocks/video/component-info.d.ts +0 -2
  60. package/types/blocks/video/video.d.ts +0 -20
  61. package/types/components/block/block.d.ts +0 -10
  62. package/types/components/block/block.helpers.d.ts +0 -13
  63. package/types/components/block/components/block-styles.d.ts +0 -9
  64. package/types/components/block/components/block-wrapper.d.ts +0 -17
  65. package/types/components/block/components/component-ref/component-ref.d.ts +0 -4
  66. package/types/components/block/components/component-ref/component-ref.helpers.d.ts +0 -28
  67. package/types/components/block/components/interactive-element.d.ts +0 -12
  68. package/types/components/block/components/repeated-block.d.ts +0 -10
  69. package/types/components/block/types.d.ts +0 -6
  70. package/types/components/blocks/blocks-wrapper.d.ts +0 -11
  71. package/types/components/blocks/blocks.d.ts +0 -9
  72. package/types/components/content/components/enable-editor.d.ts +0 -10
  73. package/types/components/content/components/styles.d.ts +0 -9
  74. package/types/components/content/components/styles.helpers.d.ts +0 -15
  75. package/types/components/content/content.d.ts +0 -4
  76. package/types/components/content/content.helpers.d.ts +0 -7
  77. package/types/components/content/content.types.d.ts +0 -24
  78. package/types/components/content/wrap-component-ref.d.ts +0 -6
  79. package/types/components/content-variants/content-variants.d.ts +0 -10
  80. package/types/components/content-variants/content-variants.types.d.ts +0 -20
  81. package/types/components/content-variants/helpers.d.ts +0 -41
  82. package/types/components/inlined-script.d.ts +0 -7
  83. package/types/components/inlined-styles.d.ts +0 -7
  84. package/types/constants/builder-registered-components.d.ts +0 -6
  85. package/types/constants/device-sizes.d.ts +0 -13
  86. package/types/constants/sdk-version.d.ts +0 -1
  87. package/types/constants/target.d.ts +0 -2
  88. package/types/context/builder.context.d.ts +0 -3
  89. package/types/context/components.context.d.ts +0 -3
  90. package/types/context/types.d.ts +0 -35
  91. package/types/functions/camel-to-kebab-case.d.ts +0 -1
  92. package/types/functions/deopt.d.ts +0 -4
  93. package/types/functions/evaluate/browser-runtime/browser.d.ts +0 -4
  94. package/types/functions/evaluate/browser-runtime/index.d.ts +0 -1
  95. package/types/functions/evaluate/choose-eval.d.ts +0 -6
  96. package/types/functions/evaluate/evaluate.d.ts +0 -2
  97. package/types/functions/evaluate/helpers.d.ts +0 -24
  98. package/types/functions/evaluate/index.d.ts +0 -1
  99. package/types/functions/event-handler-name.d.ts +0 -1
  100. package/types/functions/extract-text-styles.d.ts +0 -4
  101. package/types/functions/fast-clone.d.ts +0 -4
  102. package/types/functions/fetch-builder-props.d.ts +0 -53
  103. package/types/functions/get-block-actions-handler.d.ts +0 -8
  104. package/types/functions/get-block-actions.d.ts +0 -10
  105. package/types/functions/get-block-component-options.d.ts +0 -2
  106. package/types/functions/get-block-properties.d.ts +0 -6
  107. package/types/functions/get-builder-search-params/index.d.ts +0 -12
  108. package/types/functions/get-content/generate-content-url.d.ts +0 -2
  109. package/types/functions/get-content/index.d.ts +0 -28
  110. package/types/functions/get-content/types.d.ts +0 -142
  111. package/types/functions/get-fetch.d.ts +0 -1
  112. package/types/functions/get-global-this.d.ts +0 -4
  113. package/types/functions/get-processed-block.d.ts +0 -10
  114. package/types/functions/get-react-native-block-styles.d.ts +0 -7
  115. package/types/functions/is-browser.d.ts +0 -1
  116. package/types/functions/is-editing.d.ts +0 -1
  117. package/types/functions/is-iframe.d.ts +0 -1
  118. package/types/functions/is-previewing.d.ts +0 -1
  119. package/types/functions/register-component.d.ts +0 -15
  120. package/types/functions/register.d.ts +0 -16
  121. package/types/functions/sanitize-react-native-block-styles.d.ts +0 -3
  122. package/types/functions/set-editor-settings.d.ts +0 -4
  123. package/types/functions/set.d.ts +0 -7
  124. package/types/functions/track/helpers.d.ts +0 -5
  125. package/types/functions/track/index.d.ts +0 -51
  126. package/types/functions/track/interaction.d.ts +0 -13
  127. package/types/functions/transform-block-properties.d.ts +0 -1
  128. package/types/functions/transform-block.d.ts +0 -2
  129. package/types/helpers/ab-tests.d.ts +0 -9
  130. package/types/helpers/canTrack.d.ts +0 -1
  131. package/types/helpers/cookie.d.ts +0 -19
  132. package/types/helpers/css.d.ts +0 -7
  133. package/types/helpers/flatten.d.ts +0 -6
  134. package/types/helpers/localStorage.d.ts +0 -9
  135. package/types/helpers/logger.d.ts +0 -6
  136. package/types/helpers/nullable.d.ts +0 -2
  137. package/types/helpers/preview-lru-cache/get.d.ts +0 -1
  138. package/types/helpers/preview-lru-cache/helpers.d.ts +0 -1
  139. package/types/helpers/preview-lru-cache/init.d.ts +0 -6
  140. package/types/helpers/preview-lru-cache/set.d.ts +0 -7
  141. package/types/helpers/preview-lru-cache/types.d.ts +0 -12
  142. package/types/helpers/sessionId.d.ts +0 -6
  143. package/types/helpers/url.d.ts +0 -6
  144. package/types/helpers/uuid.d.ts +0 -8
  145. package/types/helpers/visitorId.d.ts +0 -6
  146. package/types/index-helpers/blocks-exports.d.ts +0 -19
  147. package/types/index-helpers/top-of-file.d.ts +0 -1
  148. package/types/index.d.ts +0 -7
  149. package/types/scripts/init-editing.d.ts +0 -6
  150. package/types/server-index.d.ts +0 -15
  151. package/types/types/api-version.d.ts +0 -2
  152. package/types/types/builder-block.d.ts +0 -66
  153. package/types/types/builder-content.d.ts +0 -44
  154. package/types/types/builder-props.d.ts +0 -9
  155. package/types/types/can-track.d.ts +0 -3
  156. package/types/types/components.d.ts +0 -110
  157. package/types/types/deep-partial.d.ts +0 -3
  158. package/types/types/element.d.ts +0 -59
  159. package/types/types/enforced-partials.d.ts +0 -21
  160. package/types/types/input.d.ts +0 -121
  161. package/types/types/targets.d.ts +0 -1
  162. package/types/types/typescript.d.ts +0 -11
@@ -1,4 +1,4 @@
1
- "use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-05622db1.js"),o=require("react"),_=require("./USE_SERVER_BUNDLE-568694d9.js"),M=require("next/navigation");function W(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{role:"button",...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-35669e6c",children:e.text})}),t.jsx("style",{children:`.button-35669e6c {
1
+ "use client";"use strict";const t=require("react/jsx-runtime"),c=require("./bundle-cbc690cf.cjs"),o=require("react"),_=require("./USE_SERVER_BUNDLE-c110917b.cjs"),M=require("next/navigation");function W(e){return t.jsxs(t.Fragment,{children:[e.link?t.jsx(t.Fragment,{children:t.jsx("a",{role:"button",...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,children:e.text})}):t.jsx(t.Fragment,{children:t.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-35669e6c",children:e.text})}),t.jsx("style",{children:`.button-35669e6c {
2
2
  all: unset;
3
3
  }`})]})}function A(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})},children:e.children})}function V(e){return t.jsxs(t.Fragment,{children:[" ",e.hasChildren?t.jsx(t.Fragment,{children:t.jsxs(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):t.jsx(t.Fragment,{children:t.jsx(e.Wrapper,{...c.getBlockProperties({block:e.block,context:e.context}),...c.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function z(e){function a(){var s;return"builder-blocks"+((s=e.blocks)!=null&&s.length?"":" no-blocks")}function g(){var s,x;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((x=window.parent)==null||x.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function h(){var s,x;c.isEditing()&&!((s=e.blocks)!=null&&s.length)&&((x=window.parent)==null||x.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:a()+" div-02c7a115","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:s=>g(),onMouseEnter:s=>h(),onKeyPress:s=>g(),children:e.children}),t.jsx("style",{children:`.div-02c7a115 {
4
4
  display: flex;
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsxs as w, Fragment as g, jsx as c } from "react/jsx-runtime";
3
- import { g as T, a as N, i as E, b as R, c as G, d as P, e as W, _ as A, f as $, l as Q, h as D, j as X, k as Y, r as Z, s as p, m as ee, n as te, o as ne } from "./bundle-7ebcd79e.mjs";
3
+ import { g as T, a as N, i as E, b as R, c as G, d as P, e as W, _ as A, f as $, l as Q, h as D, j as X, k as Y, r as Z, s as p, m as ee, n as te, o as ne } from "./bundle-31003427.js";
4
4
  import { useRef as j, useState as y, useEffect as x, createContext as ie, createElement as ae } from "react";
5
- import { p as ce } from "./USE_SERVER_BUNDLE-1634816a.mjs";
5
+ import { p as ce } from "./USE_SERVER_BUNDLE-97369f61.js";
6
6
  import { useRouter as re } from "next/navigation";
7
7
  function ge(e) {
8
8
  return /* @__PURE__ */ w(g, { children: [
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { p as s } from "./bundle-3d31ba5d.mjs";
2
+ import { p as s } from "./bundle-31003427.js";
3
3
  async function n({
4
4
  key: t,
5
5
  value: r
@@ -0,0 +1 @@
1
+ "use server";"use strict";const n=require("./bundle-cbc690cf.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
@@ -1,7 +1,7 @@
1
1
  import { LRUCache as $e } from "lru-cache";
2
2
  import { jsx as l, Fragment as x, jsxs as C } from "react/jsx-runtime";
3
3
  import { createElement as Pe } from "react";
4
- import { I as Be, B as J, a as Fe, b as Oe, C as Ne, E as We, F as Le, c as Ue, d as Me, S as _e, V as je, e as Ke } from "./USE_CLIENT_BUNDLE-48d9356f.mjs";
4
+ import { I as Be, B as J, a as Fe, b as Oe, C as Ne, E as We, F as Le, c as Ue, d as Me, S as _e, V as je, e as Ke } from "./USE_CLIENT_BUNDLE-2dd6963b.js";
5
5
  import "next/navigation";
6
6
  const F = (e) => JSON.parse(JSON.stringify(e)), ue = {
7
7
  small: {
@@ -1793,7 +1793,7 @@ async function dn(e) {
1793
1793
  const Hn = (e) => dn({
1794
1794
  ...e,
1795
1795
  canTrack: !0
1796
- }), mn = "0.7.1-2", ne = {};
1796
+ }), mn = "0.7.1-4", ne = {};
1797
1797
  function fn(e, t) {
1798
1798
  let n = ne[e];
1799
1799
  if (n || (n = ne[e] = []), n.push(t), v()) {
@@ -1,4 +1,4 @@
1
- "use strict";const We=require("lru-cache"),s=require("react/jsx-runtime"),Le=require("react"),v=require("./USE_CLIENT_BUNDLE-11d41596.js");require("next/navigation");const R=e=>JSON.parse(JSON.stringify(e)),de={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},X=(e,t=de)=>`@media (max-width: ${t[e].max}px)`,me=({small:e,medium:t})=>{const n=R(de);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const r=n.small.max+1;n.medium={max:t,min:r,default:r+1};const i=n.medium.max+1;return n.large={max:2e3,min:i,default:i+1},n},I="rsc",A="[Builder.io]: ",k={log:(...e)=>console.log(A,...e),error:(...e)=>console.error(A,...e),warn:(...e)=>console.warn(A,...e),debug:(...e)=>console.debug(A,...e)};function S(){return typeof window<"u"&&typeof document<"u"}function Ue(){return S()&&window.self!==window.top}function F(){return Ue()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const Me=()=>{if(S()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},_e=()=>typeof navigator=="object"&&navigator.userAgent||"",fe=()=>{const e=_e(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),o=Me();return{urlPath:o==null?void 0:o.pathname,host:(o==null?void 0:o.host)||(o==null?void 0:o.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},Ke=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),He=()=>({isEditing:F(),isBrowser:S(),isServer:!S(),getUserAttributes:()=>fe()}),De=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,Q=({code:e,builder:t,context:n,event:o,localState:r,rootSetState:i,rootState:a})=>{const l=Ke({builder:t,context:n,event:o,state:ze(a,r,i)});return new Function(...l.map(([c])=>c),e)(...l.map(([,c])=>c))};function ze(e,t,n){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(o,r)=>t&&r in t?t[r]:e[r],set:(o,r,i)=>{if(t&&r in t)throw new Error("Writing to local state is not allowed as it is read-only.");return e[r]=i,n==null||n(e),!0}})}const qe=e=>(S(),Q(e));function O({code:e,context:t,localState:n,rootState:o,rootSetState:r,event:i,isExpression:a=!0}){if(e===""){k.warn("Skipping evaluation of empty code block.");return}const l={code:De(e,{isExpression:a}),builder:He(),context:t,event:i,rootSetState:r,rootState:o,localState:n};try{return qe(l)}catch(c){k.error("Failed code evaluation: "+c.message,{code:e});return}}const Ge=(e,t,n)=>{if(Object(e)!==e)return e;const o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return o.slice(0,-1).reduce((r,i,a)=>Object(r[i])===r[i]?r[i]:r[i]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e};const Je=({block:e,context:t,localState:n,rootState:o,rootSetState:r})=>{if(!e.bindings)return e;const i=R(e),a={...i,properties:{...i.properties},actions:{...i.actions}};for(const l in e.bindings){const c=e.bindings[l],d=O({code:c,localState:n,rootState:o,rootSetState:r,context:t});Ge(a,l,d)}return a};function V({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:r,rootSetState:i}){const a=e;return n?Je({block:a,localState:o,rootState:r,rootSetState:i,context:t}):a}const Ye=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),C=e=>e!=null,he=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${Ye(n)}: ${o};`}).filter(C),Xe=e=>he(e).join(`
1
+ "use strict";const We=require("lru-cache"),s=require("react/jsx-runtime"),Le=require("react"),v=require("./USE_CLIENT_BUNDLE-1cdce03b.cjs");require("next/navigation");const R=e=>JSON.parse(JSON.stringify(e)),de={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},X=(e,t=de)=>`@media (max-width: ${t[e].max}px)`,me=({small:e,medium:t})=>{const n=R(de);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const r=n.small.max+1;n.medium={max:t,min:r,default:r+1};const i=n.medium.max+1;return n.large={max:2e3,min:i,default:i+1},n},I="rsc",A="[Builder.io]: ",k={log:(...e)=>console.log(A,...e),error:(...e)=>console.error(A,...e),warn:(...e)=>console.warn(A,...e),debug:(...e)=>console.debug(A,...e)};function S(){return typeof window<"u"&&typeof document<"u"}function Ue(){return S()&&window.self!==window.top}function F(){return Ue()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const Me=()=>{if(S()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},_e=()=>typeof navigator=="object"&&navigator.userAgent||"",fe=()=>{const e=_e(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),o=Me();return{urlPath:o==null?void 0:o.pathname,host:(o==null?void 0:o.host)||(o==null?void 0:o.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},Ke=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),He=()=>({isEditing:F(),isBrowser:S(),isServer:!S(),getUserAttributes:()=>fe()}),De=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,Q=({code:e,builder:t,context:n,event:o,localState:r,rootSetState:i,rootState:a})=>{const l=Ke({builder:t,context:n,event:o,state:ze(a,r,i)});return new Function(...l.map(([c])=>c),e)(...l.map(([,c])=>c))};function ze(e,t,n){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(o,r)=>t&&r in t?t[r]:e[r],set:(o,r,i)=>{if(t&&r in t)throw new Error("Writing to local state is not allowed as it is read-only.");return e[r]=i,n==null||n(e),!0}})}const qe=e=>(S(),Q(e));function O({code:e,context:t,localState:n,rootState:o,rootSetState:r,event:i,isExpression:a=!0}){if(e===""){k.warn("Skipping evaluation of empty code block.");return}const l={code:De(e,{isExpression:a}),builder:He(),context:t,event:i,rootSetState:r,rootState:o,localState:n};try{return qe(l)}catch(c){k.error("Failed code evaluation: "+c.message,{code:e});return}}const Ge=(e,t,n)=>{if(Object(e)!==e)return e;const o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return o.slice(0,-1).reduce((r,i,a)=>Object(r[i])===r[i]?r[i]:r[i]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e};const Je=({block:e,context:t,localState:n,rootState:o,rootSetState:r})=>{if(!e.bindings)return e;const i=R(e),a={...i,properties:{...i.properties},actions:{...i.actions}};for(const l in e.bindings){const c=e.bindings[l],d=O({code:c,localState:n,rootState:o,rootSetState:r,context:t});Ge(a,l,d)}return a};function V({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:r,rootSetState:i}){const a=e;return n?Je({block:a,localState:o,rootState:r,rootSetState:i,context:t}):a}const Ye=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),C=e=>e!=null,he=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${Ye(n)}: ${o};`}).filter(C),Xe=e=>he(e).join(`
2
2
  `),M=({mediaQuery:e,className:t,styles:n})=>{const o=`.${t} {
3
3
  ${Xe(n)}
4
4
  }`;return e?`${e} {
@@ -73,4 +73,4 @@ ${Wt({customFonts:e.customFonts})}
73
73
  font-family: inherit;
74
74
  }
75
75
  `.trim();return s.jsx(N,{styles:t})}const Mt=({content:e,data:t,locale:n})=>{var i,a,l;const o={};(a=(i=e==null?void 0:e.data)==null?void 0:i.inputs)==null||a.forEach(c=>{var d;c.name&&c.defaultValue!==void 0&&((d=e==null?void 0:e.data)!=null&&d.state)&&e.data.state[c.name]===void 0&&(o[c.name]=c.defaultValue)});const r={...(l=e==null?void 0:e.data)==null?void 0:l.state,...t,...n?{locale:n}:{}};return{...o,...r}},_t=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function Kt(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function Ht(){const e=Kt().fetch;if(typeof e>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
76
- For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const ve=Ht(),Dt=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},ke=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(o=>o.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(o){k.warn("[COOKIE] GET error: ",(o==null?void 0:o.message)||o);return}},we=async e=>ke(e),zt=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(C).join("; "),qt=[["secure",""],["SameSite","None"]],Gt=({name:e,value:t,expires:n})=>{const r=(S()?location.protocol==="https:":!0)?qt:[[]],i=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...i,["path","/"],["domain",Dt(window.location.hostname)],...r];return zt(a)},Ce=async({name:e,value:t,expires:n,canTrack:o})=>{try{if(!o)return;const r=Gt({name:e,value:t,expires:n});document.cookie=r}catch(r){k.warn("[COOKIE] SET error: ",(r==null?void 0:r.message)||r)}};function Jt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Ie(){return Jt().replace(/-/g,"")}const Te="builderSessionId",Yt=async({canTrack:e})=>{if(!e)return;const t=await we({name:Te,canTrack:e});if(C(t))return t;{const n=Xt();return Qt({id:n,canTrack:e}),n}},Xt=()=>Ie(),Qt=({id:e,canTrack:t})=>Ce({name:Te,value:e,canTrack:t}),Ee=()=>S()&&typeof localStorage<"u"?localStorage:void 0,Zt=({key:e,canTrack:t})=>{var n;try{return t?(n=Ee())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},en=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Ee())==null||o.setItem(e,n))}catch(r){console.debug("[LocalStorage] SET error: ",r)}},Re="builderVisitorId",tn=({canTrack:e})=>{if(!e)return;const t=Zt({key:Re,canTrack:e});if(C(t))return t;{const n=nn();return on({id:n,canTrack:e}),n}},nn=()=>Ie(),on=({id:e,canTrack:t})=>en({key:Re,value:e,canTrack:t}),rn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Yt({canTrack:e}),n=tn({canTrack:e});return{sessionId:t,visitorId:n}},an=async({type:e,canTrack:t,apiKey:n,metadata:o,...r})=>({type:e,data:{...r,metadata:{url:location.href,...o},...await rn({canTrack:t}),userAttributes:fe(),ownerId:n}});async function je(e){if(!e.apiKey){k.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!F()&&(S()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await an(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const sn=e=>je({...e,canTrack:!0}),cn="0.7.1-2",oe={};function Ae(e,t){let n=oe[e];if(n||(n=oe[e]=[]),n.push(t),S()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(r){console.debug("Could not postmessage",r)}}}const ln=()=>{Ae("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let re=!1;const un=(e={})=>{var t,n;re||(re=!0,S()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:I,version:cn,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:o})=>{var r,i;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const a=o.data.text,l=o.data.arguments||[],c=o.data.id,d=new Function(a);let f,p=null;try{f=d.apply(null,l)}catch(b){p=b}p?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:c,error:p.message}},"*"):f&&typeof f.then=="function"?f.then(b=>{var m;(m=window.parent)==null||m.postMessage({type:"builder.evaluateResult",data:{id:c,result:b}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:f,id:c}},"*");break}}})))};function ie(e){return Math.round(e*1e3)/1e3}const dn=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},mn=e=>dn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ae=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,i=ie(o/n.width),a=ie(r/n.height);return{x:i,y:a}},fn=e=>{const t=e.target,n=t&&mn(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?ae({event:e,target:t}):void 0,builderTargetOffset:n?ae({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},hn="builder.tests",z=e=>`${hn}.${e}`,gn=({contentId:e})=>we({name:z(e),canTrack:!0}),pn=({contentId:e})=>ke({name:z(e),canTrack:!0}),bn=({contentId:e,value:t})=>Ce({name:z(e),value:t,canTrack:!0}),Be=e=>C(e.id)&&C(e.variations)&&Object.keys(e.variations).length>0,yn=({id:e,variations:t})=>{var r;let n=0;const o=Math.random();for(const i in t){const a=(r=t[i])==null?void 0:r.testRatio;if(n+=a,o<n)return i}return e},Pe=e=>{const t=yn(e);return bn({contentId:e.id,value:t}).catch(n=>{k.error("could not store A/B test variation: ",n)}),t},Ve=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},xn=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!Be(e))return e;const n=pn({contentId:e.id})||Pe({variations:e.variations,id:e.id}),o=Ve({item:e,testGroupId:n});return{...e,...o}},Sn=async({item:e,canTrack:t})=>{if(!t||!Be(e))return e;const o=await gn({contentId:e.id})||Pe({variations:e.variations,id:e.id}),r=Ve({item:e,testGroupId:o});return{...e,...r}},$=e=>C(e)?e:!0,vn=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||k.warn("No previewed ID found in search params."),n};function $e(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new We.LRUCache({max:500,ttl:1e3*60*5}))}function kn(e){$e();const t=vn(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function P(e,t=null,n="."){return Object.keys(e).reduce((o,r)=>{const i=e[r],a=[t,r].filter(Boolean).join(n);return[typeof i=="object",i!==null,!(Array.isArray(i)&&i.length===0)].every(Boolean)?{...o,...P(i,a,n)}:{...o,[a]:i}},{})}const se="builder.",wn="options.",Cn=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},q=e=>{if(!e)return{};const t=Fe(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(se)){const r=o.replace(se,"").replace(wn,"");n[r]=t[o]}}),n},In=()=>{if(!S())return{};const e=new URLSearchParams(window.location.search);return q(e)},Fe=e=>e instanceof URLSearchParams?Cn(e):e,Tn="v3",ce=e=>typeof e=="number"&&!isNaN(e)&&e>=0,G=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:o,query:r,model:i,apiKey:a,includeRefs:l=!0,enrich:c,locale:d,apiVersion:f=Tn,fields:p,omit:b,offset:m,cacheSeconds:h,staleCacheSeconds:u,sort:y,includeUnpublished:x}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(f))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const g=new URL(`https://cdn.builder.io/api/${f}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${l}${d?`&locale=${d}`:""}${c?`&enrich=${c}`:""}`);if(g.searchParams.set("omit",b||"meta.componentsUsed"),p&&g.searchParams.set("fields",p),Number.isFinite(m)&&m>-1&&g.searchParams.set("offset",String(Math.floor(m))),typeof x=="boolean"&&g.searchParams.set("includeUnpublished",String(x)),h&&ce(h)&&g.searchParams.set("cacheSeconds",String(h)),u&&ce(u)&&g.searchParams.set("staleCacheSeconds",String(u)),y){const w=P({sort:y});for(const E in w)g.searchParams.set(E,JSON.stringify(w[E]))}const j={...In(),...Fe(e.options||{})},T=P(j);for(const w in T)g.searchParams.set(w,String(T[w]));if(o&&g.searchParams.set("userAttributes",JSON.stringify(o)),r){const w=P({query:r});for(const E in w)g.searchParams.set(E,JSON.stringify(w[E]))}return g},En=e=>"results"in e;async function U(e){const t=await J({...e,limit:1});return t&&t.results[0]||null}const Rn=U,jn=async e=>{const t=G(e);return await(await ve(t.href)).json()},Oe=async(e,t,n=G(e))=>{const o=$(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const a of t.results){const l=kn(n.searchParams);i.push(l||a)}t.results=i}if(!o||!(S()||I==="reactNative"))return t;try{const i=[];for(const a of t.results)i.push(await Sn({item:a,canTrack:o}));t.results=i}catch(i){k.error("Could not process A/B tests. ",i)}return t};async function J(e){try{const t=G(e),n=await jn(e);return En(n)?Oe(e,n):(k.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return k.error("Error fetching data. ",t),null}}const An=J;function Bn(){return!S()||F()?!1:location.search.indexOf("builder.preview=")!==-1}function H(e){return s.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id})}function le(e){var r,i,a,l,c,d,f,p,b;const t=St({variationId:(r=e.content)==null?void 0:r.testVariationId,contentId:(i=e.content)==null?void 0:i.id}),n=[...te(),...ne,...e.customComponents||[]].reduce((m,{component:h,...u})=>({...m,[u.name]:{component:h,...K(u)}}),{}),o={content:_t({content:e.content,data:e.data}),localState:void 0,rootState:Mt({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...te(),...ne,...e.customComponents||[]].reduce((m,{component:h,...u})=>({...m,[u.name]:K(u)}),{}),inheritedStyles:{}};return s.jsxs(v.EnableEditor,{content:e.content,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,classNameProp:e.classNameProp,showContent:e.showContent,builderContextSignal:o,children:[e.isSsrAbTest?s.jsx(s.Fragment,{children:s.jsx(H,{scriptStr:t})}):null,s.jsx(s.Fragment,{children:s.jsx(Ut,{contentId:(a=o.content)==null?void 0:a.id,cssCode:(c=(l=o.content)==null?void 0:l.data)==null?void 0:c.cssCode,customFonts:(f=(d=o.content)==null?void 0:d.data)==null?void 0:f.customFonts})}),s.jsx(L,{blocks:(b=(p=o.content)==null?void 0:p.data)==null?void 0:b.blocks,context:o,registeredComponents:n})]})}function Y(e){var i,a,l;const t=ht({canTrack:$(e.canTrack),content:e.content}),n=function(){var d;return xt(B(e.content).map(f=>({id:f.testVariationId,testRatio:f.testRatio})),((d=e.content)==null?void 0:d.id)||"")},o=function(){return B(e.content).map(d=>`.variant-${d.testVariationId} { display: none; } `).join("")},r=function(){var d;return t?{...e.content,testVariationId:(d=e.content)==null?void 0:d.id}:xn({item:e.content,canTrack:$(e.canTrack)})};return s.jsxs(s.Fragment,{children:[!e.__isNestedRender&&I!=="reactNative"?s.jsx(s.Fragment,{children:s.jsx(H,{scriptStr:yt()})}):null,t?s.jsxs(s.Fragment,{children:[s.jsx(N,{id:`variants-styles-${(i=e.content)==null?void 0:i.id}`,styles:o()}),s.jsx(H,{scriptStr:n()}),(a=B(e.content))==null?void 0:a.map(c=>s.jsx(le,{content:c,showContent:!1,classNameProp:void 0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t},c.testVariationId))]}):null,s.jsx(le,{content:r(),classNameProp:`variant-${(l=e.content)==null?void 0:l.id}`,showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t})]})}const Pn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return U({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{k.error("Could not fetch symbol content: ",n)})};async function Ne(e){var o,r,i,a;const t=function(){var c,d;return[e.attributes.className,"builder-symbol",(c=e.symbol)!=null&&c.inline?"builder-inline-symbol":void 0,(d=e.symbol)!=null&&d.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await Pn({symbol:e.symbol,builderContextValue:e.builderContext});return s.jsx("div",{...e.attributes,className:t(),children:s.jsx(Y,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(i=n==null?void 0:n.data)==null?void 0:i.state},model:(a=e.symbol)==null?void 0:a.model,content:n})})}const Vn=L,$n=Y,ue={};function Fn(e){if(S()){Object.assign(ue,e);const t={type:"builder.settingsChange",data:ue};parent.postMessage(t,"*")}}const On=async e=>{var o,r,i;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((r=e.userAttributes)==null?void 0:r.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:q(e.searchParams||((i=e.url)==null?void 0:i.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await U(n)}};exports.Blocks=L;exports.Columns=pe;exports.ContentVariants=Y;exports.RenderBlocks=Vn;exports.RenderContent=$n;exports.Symbol=Ne;exports.Text=Se;exports._processContentResult=Oe;exports._track=je;exports.createRegisterComponentMessage=$t;exports.evaluate=O;exports.fastClone=R;exports.fetch=ve;exports.fetchBuilderProps=On;exports.fetchEntries=J;exports.fetchOneEntry=U;exports.getAllContent=An;exports.getBlockActions=at;exports.getBlockProperties=ge;exports.getBuilderSearchParams=q;exports.getContent=Rn;exports.getDefaultCanTrack=$;exports.getInteractionPropertiesForEvent=fn;exports.getSrcSet=ft;exports.init=$e;exports.isBrowser=S;exports.isEditing=F;exports.isJsScript=Bt;exports.isPreviewing=Bn;exports.logger=k;exports.register=Ae;exports.registerInsertMenu=ln;exports.setEditorSettings=Fn;exports.setupBrowserForEditing=un;exports.track=sn;
76
+ For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const ve=Ht(),Dt=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},ke=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(o=>o.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(o){k.warn("[COOKIE] GET error: ",(o==null?void 0:o.message)||o);return}},we=async e=>ke(e),zt=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(C).join("; "),qt=[["secure",""],["SameSite","None"]],Gt=({name:e,value:t,expires:n})=>{const r=(S()?location.protocol==="https:":!0)?qt:[[]],i=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...i,["path","/"],["domain",Dt(window.location.hostname)],...r];return zt(a)},Ce=async({name:e,value:t,expires:n,canTrack:o})=>{try{if(!o)return;const r=Gt({name:e,value:t,expires:n});document.cookie=r}catch(r){k.warn("[COOKIE] SET error: ",(r==null?void 0:r.message)||r)}};function Jt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function Ie(){return Jt().replace(/-/g,"")}const Te="builderSessionId",Yt=async({canTrack:e})=>{if(!e)return;const t=await we({name:Te,canTrack:e});if(C(t))return t;{const n=Xt();return Qt({id:n,canTrack:e}),n}},Xt=()=>Ie(),Qt=({id:e,canTrack:t})=>Ce({name:Te,value:e,canTrack:t}),Ee=()=>S()&&typeof localStorage<"u"?localStorage:void 0,Zt=({key:e,canTrack:t})=>{var n;try{return t?(n=Ee())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},en=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Ee())==null||o.setItem(e,n))}catch(r){console.debug("[LocalStorage] SET error: ",r)}},Re="builderVisitorId",tn=({canTrack:e})=>{if(!e)return;const t=Zt({key:Re,canTrack:e});if(C(t))return t;{const n=nn();return on({id:n,canTrack:e}),n}},nn=()=>Ie(),on=({id:e,canTrack:t})=>en({key:Re,value:e,canTrack:t}),rn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Yt({canTrack:e}),n=tn({canTrack:e});return{sessionId:t,visitorId:n}},an=async({type:e,canTrack:t,apiKey:n,metadata:o,...r})=>({type:e,data:{...r,metadata:{url:location.href,...o},...await rn({canTrack:t}),userAttributes:fe(),ownerId:n}});async function je(e){if(!e.apiKey){k.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!F()&&(S()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await an(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const sn=e=>je({...e,canTrack:!0}),cn="0.7.1-4",oe={};function Ae(e,t){let n=oe[e];if(n||(n=oe[e]=[]),n.push(t),S()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(r){console.debug("Could not postmessage",r)}}}const ln=()=>{Ae("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let re=!1;const un=(e={})=>{var t,n;re||(re=!0,S()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:I,version:cn,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:o})=>{var r,i;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const a=o.data.text,l=o.data.arguments||[],c=o.data.id,d=new Function(a);let f,p=null;try{f=d.apply(null,l)}catch(b){p=b}p?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:c,error:p.message}},"*"):f&&typeof f.then=="function"?f.then(b=>{var m;(m=window.parent)==null||m.postMessage({type:"builder.evaluateResult",data:{id:c,result:b}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:f,id:c}},"*");break}}})))};function ie(e){return Math.round(e*1e3)/1e3}const dn=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},mn=e=>dn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ae=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,i=ie(o/n.width),a=ie(r/n.height);return{x:i,y:a}},fn=e=>{const t=e.target,n=t&&mn(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?ae({event:e,target:t}):void 0,builderTargetOffset:n?ae({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},hn="builder.tests",z=e=>`${hn}.${e}`,gn=({contentId:e})=>we({name:z(e),canTrack:!0}),pn=({contentId:e})=>ke({name:z(e),canTrack:!0}),bn=({contentId:e,value:t})=>Ce({name:z(e),value:t,canTrack:!0}),Be=e=>C(e.id)&&C(e.variations)&&Object.keys(e.variations).length>0,yn=({id:e,variations:t})=>{var r;let n=0;const o=Math.random();for(const i in t){const a=(r=t[i])==null?void 0:r.testRatio;if(n+=a,o<n)return i}return e},Pe=e=>{const t=yn(e);return bn({contentId:e.id,value:t}).catch(n=>{k.error("could not store A/B test variation: ",n)}),t},Ve=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},xn=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!Be(e))return e;const n=pn({contentId:e.id})||Pe({variations:e.variations,id:e.id}),o=Ve({item:e,testGroupId:n});return{...e,...o}},Sn=async({item:e,canTrack:t})=>{if(!t||!Be(e))return e;const o=await gn({contentId:e.id})||Pe({variations:e.variations,id:e.id}),r=Ve({item:e,testGroupId:o});return{...e,...r}},$=e=>C(e)?e:!0,vn=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||k.warn("No previewed ID found in search params."),n};function $e(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new We.LRUCache({max:500,ttl:1e3*60*5}))}function kn(e){$e();const t=vn(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function P(e,t=null,n="."){return Object.keys(e).reduce((o,r)=>{const i=e[r],a=[t,r].filter(Boolean).join(n);return[typeof i=="object",i!==null,!(Array.isArray(i)&&i.length===0)].every(Boolean)?{...o,...P(i,a,n)}:{...o,[a]:i}},{})}const se="builder.",wn="options.",Cn=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},q=e=>{if(!e)return{};const t=Fe(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(se)){const r=o.replace(se,"").replace(wn,"");n[r]=t[o]}}),n},In=()=>{if(!S())return{};const e=new URLSearchParams(window.location.search);return q(e)},Fe=e=>e instanceof URLSearchParams?Cn(e):e,Tn="v3",ce=e=>typeof e=="number"&&!isNaN(e)&&e>=0,G=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:o,query:r,model:i,apiKey:a,includeRefs:l=!0,enrich:c,locale:d,apiVersion:f=Tn,fields:p,omit:b,offset:m,cacheSeconds:h,staleCacheSeconds:u,sort:y,includeUnpublished:x}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(f))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const g=new URL(`https://cdn.builder.io/api/${f}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${l}${d?`&locale=${d}`:""}${c?`&enrich=${c}`:""}`);if(g.searchParams.set("omit",b||"meta.componentsUsed"),p&&g.searchParams.set("fields",p),Number.isFinite(m)&&m>-1&&g.searchParams.set("offset",String(Math.floor(m))),typeof x=="boolean"&&g.searchParams.set("includeUnpublished",String(x)),h&&ce(h)&&g.searchParams.set("cacheSeconds",String(h)),u&&ce(u)&&g.searchParams.set("staleCacheSeconds",String(u)),y){const w=P({sort:y});for(const E in w)g.searchParams.set(E,JSON.stringify(w[E]))}const j={...In(),...Fe(e.options||{})},T=P(j);for(const w in T)g.searchParams.set(w,String(T[w]));if(o&&g.searchParams.set("userAttributes",JSON.stringify(o)),r){const w=P({query:r});for(const E in w)g.searchParams.set(E,JSON.stringify(w[E]))}return g},En=e=>"results"in e;async function U(e){const t=await J({...e,limit:1});return t&&t.results[0]||null}const Rn=U,jn=async e=>{const t=G(e);return await(await ve(t.href)).json()},Oe=async(e,t,n=G(e))=>{const o=$(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const a of t.results){const l=kn(n.searchParams);i.push(l||a)}t.results=i}if(!o||!(S()||I==="reactNative"))return t;try{const i=[];for(const a of t.results)i.push(await Sn({item:a,canTrack:o}));t.results=i}catch(i){k.error("Could not process A/B tests. ",i)}return t};async function J(e){try{const t=G(e),n=await jn(e);return En(n)?Oe(e,n):(k.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return k.error("Error fetching data. ",t),null}}const An=J;function Bn(){return!S()||F()?!1:location.search.indexOf("builder.preview=")!==-1}function H(e){return s.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id})}function le(e){var r,i,a,l,c,d,f,p,b;const t=St({variationId:(r=e.content)==null?void 0:r.testVariationId,contentId:(i=e.content)==null?void 0:i.id}),n=[...te(),...ne,...e.customComponents||[]].reduce((m,{component:h,...u})=>({...m,[u.name]:{component:h,...K(u)}}),{}),o={content:_t({content:e.content,data:e.data}),localState:void 0,rootState:Mt({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...te(),...ne,...e.customComponents||[]].reduce((m,{component:h,...u})=>({...m,[u.name]:K(u)}),{}),inheritedStyles:{}};return s.jsxs(v.EnableEditor,{content:e.content,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,classNameProp:e.classNameProp,showContent:e.showContent,builderContextSignal:o,children:[e.isSsrAbTest?s.jsx(s.Fragment,{children:s.jsx(H,{scriptStr:t})}):null,s.jsx(s.Fragment,{children:s.jsx(Ut,{contentId:(a=o.content)==null?void 0:a.id,cssCode:(c=(l=o.content)==null?void 0:l.data)==null?void 0:c.cssCode,customFonts:(f=(d=o.content)==null?void 0:d.data)==null?void 0:f.customFonts})}),s.jsx(L,{blocks:(b=(p=o.content)==null?void 0:p.data)==null?void 0:b.blocks,context:o,registeredComponents:n})]})}function Y(e){var i,a,l;const t=ht({canTrack:$(e.canTrack),content:e.content}),n=function(){var d;return xt(B(e.content).map(f=>({id:f.testVariationId,testRatio:f.testRatio})),((d=e.content)==null?void 0:d.id)||"")},o=function(){return B(e.content).map(d=>`.variant-${d.testVariationId} { display: none; } `).join("")},r=function(){var d;return t?{...e.content,testVariationId:(d=e.content)==null?void 0:d.id}:xn({item:e.content,canTrack:$(e.canTrack)})};return s.jsxs(s.Fragment,{children:[!e.__isNestedRender&&I!=="reactNative"?s.jsx(s.Fragment,{children:s.jsx(H,{scriptStr:yt()})}):null,t?s.jsxs(s.Fragment,{children:[s.jsx(N,{id:`variants-styles-${(i=e.content)==null?void 0:i.id}`,styles:o()}),s.jsx(H,{scriptStr:n()}),(a=B(e.content))==null?void 0:a.map(c=>s.jsx(le,{content:c,showContent:!1,classNameProp:void 0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t},c.testVariationId))]}):null,s.jsx(le,{content:r(),classNameProp:`variant-${(l=e.content)==null?void 0:l.id}`,showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t})]})}const Pn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return U({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{k.error("Could not fetch symbol content: ",n)})};async function Ne(e){var o,r,i,a;const t=function(){var c,d;return[e.attributes.className,"builder-symbol",(c=e.symbol)!=null&&c.inline?"builder-inline-symbol":void 0,(d=e.symbol)!=null&&d.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await Pn({symbol:e.symbol,builderContextValue:e.builderContext});return s.jsx("div",{...e.attributes,className:t(),children:s.jsx(Y,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(i=n==null?void 0:n.data)==null?void 0:i.state},model:(a=e.symbol)==null?void 0:a.model,content:n})})}const Vn=L,$n=Y,ue={};function Fn(e){if(S()){Object.assign(ue,e);const t={type:"builder.settingsChange",data:ue};parent.postMessage(t,"*")}}const On=async e=>{var o,r,i;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((r=e.userAttributes)==null?void 0:r.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:q(e.searchParams||((i=e.url)==null?void 0:i.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await U(n)}};exports.Blocks=L;exports.Columns=pe;exports.ContentVariants=Y;exports.RenderBlocks=Vn;exports.RenderContent=$n;exports.Symbol=Ne;exports.Text=Se;exports._processContentResult=Oe;exports._track=je;exports.createRegisterComponentMessage=$t;exports.evaluate=O;exports.fastClone=R;exports.fetch=ve;exports.fetchBuilderProps=On;exports.fetchEntries=J;exports.fetchOneEntry=U;exports.getAllContent=An;exports.getBlockActions=at;exports.getBlockProperties=ge;exports.getBuilderSearchParams=q;exports.getContent=Rn;exports.getDefaultCanTrack=$;exports.getInteractionPropertiesForEvent=fn;exports.getSrcSet=ft;exports.init=$e;exports.isBrowser=S;exports.isEditing=F;exports.isJsScript=Bt;exports.isPreviewing=Bn;exports.logger=k;exports.register=Ae;exports.registerInsertMenu=ln;exports.setEditorSettings=Fn;exports.setupBrowserForEditing=un;exports.track=sn;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-05622db1.js"),t=require("./USE_CLIENT_BUNDLE-11d41596.js");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-568694d9.js");exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.RenderBlocks=e.RenderBlocks;exports.RenderContent=e.RenderContent;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-cbc690cf.cjs"),t=require("./USE_CLIENT_BUNDLE-1cdce03b.cjs");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-c110917b.cjs");exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.RenderBlocks=e.RenderBlocks;exports.RenderContent=e.RenderContent;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;