@builder.io/sdk-react-nextjs 0.14.8 → 0.14.9

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 (30) hide show
  1. package/lib/{node/USE_CLIENT_BUNDLE-690f58c3.js → browser/USE_CLIENT_BUNDLE-07d1ba4b.js} +205 -212
  2. package/lib/browser/USE_CLIENT_BUNDLE-5b3511d0.cjs +21 -0
  3. package/lib/{edge/USE_SERVER_BUNDLE-2cb317bc.js → browser/USE_SERVER_BUNDLE-059335ee.js} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-7cb08770.cjs → browser/USE_SERVER_BUNDLE-4e489369.cjs} +1 -1
  5. package/lib/browser/{bundle-d78727c9.js → bundle-53a4ab4a.js} +2 -2
  6. package/lib/browser/{bundle-eca4b0ba.cjs → bundle-9d3cdb5c.cjs} +2 -2
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +3 -3
  9. package/lib/edge/USE_CLIENT_BUNDLE-0d437014.cjs +21 -0
  10. package/lib/{browser/USE_CLIENT_BUNDLE-78517750.js → edge/USE_CLIENT_BUNDLE-99299aaa.js} +205 -212
  11. package/lib/{node/USE_SERVER_BUNDLE-649f2942.js → edge/USE_SERVER_BUNDLE-2d91be32.js} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-e8d80664.cjs → edge/USE_SERVER_BUNDLE-37a2c2d3.cjs} +1 -1
  13. package/lib/edge/{bundle-7da386a2.js → bundle-d76be364.js} +2 -2
  14. package/lib/edge/{bundle-07c68bbe.cjs → bundle-da19475d.cjs} +2 -2
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +3 -3
  17. package/lib/node/USE_CLIENT_BUNDLE-94a936b5.cjs +21 -0
  18. package/lib/{edge/USE_CLIENT_BUNDLE-01cf3cc1.js → node/USE_CLIENT_BUNDLE-aa4a4eb2.js} +205 -212
  19. package/lib/{browser/USE_SERVER_BUNDLE-29f23050.js → node/USE_SERVER_BUNDLE-91781c1b.js} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-d3d0c3a5.cjs → node/USE_SERVER_BUNDLE-d58e151a.cjs} +1 -1
  21. package/lib/node/{bundle-001f0cdc.js → bundle-49817803.js} +2 -2
  22. package/lib/node/{bundle-77f045ce.cjs → bundle-955ea489.cjs} +2 -2
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +3 -3
  25. package/package.json +1 -1
  26. package/types/cjs/constants/sdk-version.d.ts +1 -1
  27. package/types/esm/constants/sdk-version.d.ts +1 -1
  28. package/lib/browser/USE_CLIENT_BUNDLE-2046b4f7.cjs +0 -21
  29. package/lib/edge/USE_CLIENT_BUNDLE-23418377.cjs +0 -21
  30. package/lib/node/USE_CLIENT_BUNDLE-f9317c5f.cjs +0 -21
@@ -0,0 +1,21 @@
1
+ "use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-9d3cdb5c.cjs"),o=require("react"),_=require("./USE_SERVER_BUNDLE-4e489369.cjs"),z=require("next/navigation");function E(e){return t.jsx(t.Fragment,{children:a.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function M(e){return t.jsx(E,{attributes:{...e.attributes,[a.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[a.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function D(e){return t.jsx(E,{TagName:e.Wrapper,attributes:a.getBlockProperties({block:e.block,context:e.context}),actionAttributes:a.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})}function V(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...a.getBlockProperties({block:e.block,context:e.context}),...a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function H(e){function r(){var l;return"builder-blocks"+((l=e.blocks)!=null&&l.length?"":" no-blocks")}function m(){var l,b;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((b=window.parent)==null||b.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var l,b;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((b=window.parent)==null||b.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:r()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:l=>m(),onMouseEnter:l=>S(),onKeyPress:l=>m(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: stretch;
5
+ }`})]})}function U(e){return t.jsx("span",{children:e.children})}function $(e){var l,b,h,x;function r(){var f;const d=e.image||e.src;if(!d||!(d.match(/builder\.io/)||d.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),a.getSrcSet(d)}else if(e.image&&!e.srcset)return a.getSrcSet(d);return a.getSrcSet(d)}function m(){var g;return(g=r==null?void 0:r())!=null&&g.match(/builder\.io/)&&!e.noWebp?r().replace(/\?/g,"?format=webp&"):""}function S(){const g={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?g:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[m()?t.jsx("source",{type:"image/webp",srcSet:m()}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-a0c95e8c",src:e.image,srcSet:r(),sizes:e.sizes})]}),e.aspectRatio&&!((b=(l=e.builderBlock)==null?void 0:l.children)!=null&&b.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-a0c95e8c",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(x=(h=e.builderBlock)==null?void 0:h.children)!=null&&x.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx("div",{className:"div-a0c95e8c-2",children:e.children}):null]}),t.jsx("style",{children:`.img-a0c95e8c {
6
+ opacity: 1;
7
+ transition: opacity 0.2s ease-in-out;
8
+ }.div-a0c95e8c {
9
+ width: 100%;
10
+ pointer-events: none;
11
+ font-size: 0;
12
+ }.div-a0c95e8c-2 {
13
+ display: flex;
14
+ flex-direction: column;
15
+ align-items: stretch;
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 100%;
20
+ height: 100%;
21
+ }`})]})}function O(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function J(e){const r=o.useRef(null),[m,S]=o.useState(()=>[]),[l,b]=o.useState(()=>[]);return o.useEffect(()=>{var x;if(!((x=r.current)!=null&&x.getElementsByTagName)||typeof window>"u")return;const h=r.current.getElementsByTagName("script");for(let g=0;g<h.length;g++){const d=h[g];if(d.src){if(m.includes(d.src))continue;m.push(d.src);const f=document.createElement("script");f.async=!0,f.src=d.src,document.head.appendChild(f)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(l.includes(d.innerText))continue;try{l.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:r,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function G(e){const r=o.useRef(null),[m,S]=o.useState(()=>[]),[l,b]=o.useState(()=>[]),[h,x]=o.useState(()=>!1);function g(){if(!r.current||!r.current.getElementsByTagName)return;const d=r.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const k=d[f];if(k.src&&!m.includes(k.src)){m.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!l.includes(k.innerText))try{l.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return o.useEffect(()=>{r.current&&!h&&(x(!0),g())},[r.current,h]),t.jsx("div",{className:"builder-embed",ref:r,dangerouslySetInnerHTML:{__html:e.content}})}function Q(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},a.isEditing()&&e.imgSrc||"default-key")}function X(e){var S,l,b,h,x,g,d;function r(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function m(){return{...r()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...m(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((b=(l=e.builderBlock)==null?void 0:l.children)!=null&&b.length))?t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(x=(h=e.builderBlock)==null?void 0:h.children)!=null&&x.length&&e.fitContent?t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(d=(g=e.builderBlock)==null?void 0:g.children)!=null&&d.length&&!e.fitContent?t.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const Y=o.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function Z(e){var R,P,T,B,N,L,F;const r=o.useRef(null);function m(i){var c,s;const n={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(s=(c=e.builderContextSignal).rootSetState)==null||s.call(c,n):e.builderContextSignal.rootState=n}function S(i){var c,s,u,v,W;const n={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(s=e.builderContextSignal.content)==null?void 0:s.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((W=(v=e.builderContextSignal.content)==null?void 0:v.meta)==null?void 0:W.breakpoints)}};_.postPreviewContent({value:n,key:n.id}).then(()=>{q.refresh()})}const[l,b]=o.useState(()=>e.contentWrapper||"div");function h(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:n=>{var u;const{breakpoints:c,contentId:s}=n;!s||s!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&S({meta:{breakpoints:c}})},animation:n=>{a.triggerAnimation(n)},contentUpdate:n=>{S(n)}}})(i)}function x(){var n,c;const i=(c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.jsCode;i&&a.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[g,d]=o.useState(()=>({})),[f,k]=o.useState(()=>!1);function y(i){var n,c;if(e.builderContextSignal.content){const s=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:s!==u?s:void 0,...a.getInteractionPropertiesForEvent(i),unique:!f})}f||k(!0)}function A(i){return i.replace(/{{([^}]+)}}/g,(n,c)=>String(a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})))}function K({url:i,key:n}){a.fetch(i).then(c=>c.json()).then(c=>{var u,v;const s={...e.builderContextSignal.rootState,[n]:c};(v=(u=e.builderContextSignal).rootSetState)==null||v.call(u,s),g[n]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function j(){var n,c;const i=((c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([s,u])=>{if(u&&(!g[s]||a.isEditing())){const v=A(u);K({url:v,key:s})}})}function C(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function w(i){window.addEventListener("message",h),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(n=>{var s;const c=a.createRegisterComponentMessage(n);(s=window.parent)==null||s.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function I(i){const n=new URL(location.href).searchParams,c=n.get("builder.preview"),s=n.get(`builder.preview.${c}`),u=n.get("apiKey")||n.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||s===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(v=>{v&&S(v)})}const q=z.useRouter();return o.useEffect(()=>{var i;return(i=r.current)==null||i.addEventListener("initeditingbldr",w),()=>{var n;return(n=r.current)==null?void 0:n.removeEventListener("initeditingbldr",w)}},[]),o.useEffect(()=>{var i;return(i=r.current)==null||i.addEventListener("initpreviewingbldr",I),()=>{var n;return(n=r.current)==null?void 0:n.removeEventListener("initpreviewingbldr",I)}},[]),o.useEffect(()=>{var i,n;if(a.isBrowser()){if(a.isEditing()&&r.current&&r.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const s=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(n=e.builderContextSignal.content)==null?void 0:n.id,v=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:v,variationId:s!==u?s:void 0})}a.isPreviewing()}},[]),o.useEffect(()=>{e.apiKey||a.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),x(),j(),C()},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{x()},[(P=(R=e.builderContextSignal.content)==null?void 0:R.data)==null?void 0:P.jsCode]),o.useEffect(()=>{j()},[(B=(T=e.builderContextSignal.content)==null?void 0:T.data)==null?void 0:B.httpRequests]),o.useEffect(()=>{C()},[e.builderContextSignal.rootState]),o.useEffect(()=>{e.data&&m(e.data)},[e.data]),o.useEffect(()=>{e.locale&&m({locale:e.locale})},[e.locale]),o.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",h),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),t.jsx(Y.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(l,{ref:r,onClick:i=>y(i),"builder-content-id":(N=e.builderContextSignal.content)==null?void 0:N.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((L=e.content)==null?void 0:L.testVariationId)||((F=e.content)==null?void 0:F.id)}`,children:e.children}):null})}exports.BlockWrapper=D;exports.BlocksWrapper=H;exports.Button=M;exports.CustomCode=J;exports.DynamicRenderer=E;exports.Embed=G;exports.EnableEditor=Z;exports.FragmentComponent=U;exports.Image=$;exports.ImgComponent=Q;exports.InteractiveElement=V;exports.SectionComponent=O;exports.Video=X;
@@ -1,5 +1,5 @@
1
1
  "use server";
2
- import { v as s } from "./bundle-7da386a2.js";
2
+ import { v as s } from "./bundle-53a4ab4a.js";
3
3
  async function n({
4
4
  key: t,
5
5
  value: r
@@ -1 +1 @@
1
- "use server";"use strict";const n=require("./bundle-07c68bbe.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
+ "use server";"use strict";const n=require("./bundle-9d3cdb5c.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 { jsx as l, Fragment as v, jsxs as R } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { LRUCache as We } from "lru-cache";
4
- import { I as Oe, B as $e, a as Ne, D as Fe, C as Le, E as Ue, b as De, V as _e, c as Me, F as je, d as He, S as Ke, e as ze } from "./USE_CLIENT_BUNDLE-78517750.js";
4
+ import { I as Oe, B as $e, a as Ne, D as Fe, C as Le, E as Ue, b as De, V as _e, c as Me, F as je, d as He, S as Ke, e as ze } from "./USE_CLIENT_BUNDLE-07d1ba4b.js";
5
5
  import "next/navigation";
6
6
  const qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), so = (e) => typeof e == "string" && qe.has(e.toLowerCase()), T = "rsc", M = () => {
7
7
  switch (T) {
@@ -2171,7 +2171,7 @@ function Be(e, t) {
2171
2171
  const n = new URL(t.origin), o = n.hostname;
2172
2172
  return (e || $n).findIndex((i) => i.startsWith("*.") ? o.endsWith(i.slice(1)) : i === o) > -1;
2173
2173
  }
2174
- const Nn = "0.14.8", ie = {};
2174
+ const Nn = "0.14.9", ie = {};
2175
2175
  function Fn(e, t) {
2176
2176
  let n = ie[e];
2177
2177
  if (n || (n = ie[e] = []), n.push(t), S()) {
@@ -1,4 +1,4 @@
1
- "use strict";const c=require("react/jsx-runtime");require("react");const Ke=require("lru-cache"),v=require("./USE_CLIENT_BUNDLE-2046b4f7.cjs");require("next/navigation");const ze=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),qe=e=>typeof e=="string"&&ze.has(e.toLowerCase()),E="rsc",O=()=>{switch(E){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function Je(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const 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 y(){return typeof window<"u"&&typeof document<"u"}const Ye=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},de=e=>e instanceof URLSearchParams?Ye(e):e,ue=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function Ge(){return y()&&window.self!==window.top}function N(e){return Ge()&&ue(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const Qe=()=>{if(y()){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},Xe=()=>typeof navigator=="object"&&navigator.userAgent||"",me=()=>{const e=Xe(),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()||E==="reactNative"}},n=e.match(/Tablet|iPad/i),o=Qe();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"}},Ze=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),et=()=>({isEditing:N(),isBrowser:y(),isServer:!y(),getUserAttributes:()=>me()}),tt=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,G=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const s=Ze({builder:t,context:n,event:o,state:fe({rootState:a,localState:i,rootSetState:r})});return new Function(...s.map(([l])=>l),e)(...s.map(([,l])=>l))};function fe({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(o,i)=>{if(t&&i in t)return t[i];const r=o[i];return typeof r=="object"&&r!==null?fe({rootState:r,localState:void 0,rootSetState:n?a=>{o[i]=a,n(o)}:void 0}):r},set:(o,i,r)=>{if(t&&i in t)throw new Error("Writing to local state is not allowed as it is read-only.");return o[i]=r,n==null||n(o),!0}})}const w=e=>e!=null;function nt(){var e;return typeof process<"u"&&w((e=process==null?void 0:process.versions)==null?void 0:e.node)}const ot=()=>{var o;if(!nt())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return e&&t&&!n?(k.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},it=e=>(y()||ot(),G(e)),K=class R{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return R.cache.get(t)}static setCachedValue(t,n){R.cache.size>20&&R.cache.delete(R.cache.keys().next().value),R.cache.set(t,{value:n})}};K.cacheLimit=20;K.cache=new Map;let B=K;function $({code:e,context:t,localState:n,rootState:o,rootSetState:i,event:r,isExpression:a=!0,enableCache:s}){if(e===""){k.warn("Skipping evaluation of empty code block.");return}const l={code:tt(e,{isExpression:a}),builder:et(),context:t,event:r,rootSetState:i,rootState:o,localState:n};if(s){const d=B.getCacheKey(l),p=B.getCachedValue(d);if(p)return p.value}try{const d=it(l);if(s){const p=B.getCacheKey(l);B.setCachedValue(p,d)}return d}catch(d){k.error("Failed code evaluation: "+d.message,{code:e});return}}const P=e=>JSON.parse(JSON.stringify(e)),rt=(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((i,r,a)=>Object(i[r])===i[r]?i[r]:i[r]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e};const at=({block:e,context:t,localState:n,rootState:o,rootSetState:i})=>{if(!e.bindings)return e;const r=P(e),a={...r,properties:{...r.properties},actions:{...r.actions}};for(const s in e.bindings){const l=e.bindings[s],d=$({code:l,localState:n,rootState:o,rootSetState:i,context:t,enableCache:!0});rt(a,s,d)}return a};function W({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:i,rootSetState:r}){const a=e;return n?at({block:a,localState:o,rootState:i,rootSetState:r,context:t}):a}const st=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),he=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${st(n)}: ${o};`}).filter(w),ct=e=>he(e).join(`
1
+ "use strict";const c=require("react/jsx-runtime");require("react");const Ke=require("lru-cache"),v=require("./USE_CLIENT_BUNDLE-5b3511d0.cjs");require("next/navigation");const ze=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),qe=e=>typeof e=="string"&&ze.has(e.toLowerCase()),E="rsc",O=()=>{switch(E){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function Je(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const 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 y(){return typeof window<"u"&&typeof document<"u"}const Ye=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},de=e=>e instanceof URLSearchParams?Ye(e):e,ue=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function Ge(){return y()&&window.self!==window.top}function N(e){return Ge()&&ue(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const Qe=()=>{if(y()){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},Xe=()=>typeof navigator=="object"&&navigator.userAgent||"",me=()=>{const e=Xe(),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()||E==="reactNative"}},n=e.match(/Tablet|iPad/i),o=Qe();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"}},Ze=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),et=()=>({isEditing:N(),isBrowser:y(),isServer:!y(),getUserAttributes:()=>me()}),tt=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,G=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const s=Ze({builder:t,context:n,event:o,state:fe({rootState:a,localState:i,rootSetState:r})});return new Function(...s.map(([l])=>l),e)(...s.map(([,l])=>l))};function fe({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(o,i)=>{if(t&&i in t)return t[i];const r=o[i];return typeof r=="object"&&r!==null?fe({rootState:r,localState:void 0,rootSetState:n?a=>{o[i]=a,n(o)}:void 0}):r},set:(o,i,r)=>{if(t&&i in t)throw new Error("Writing to local state is not allowed as it is read-only.");return o[i]=r,n==null||n(o),!0}})}const w=e=>e!=null;function nt(){var e;return typeof process<"u"&&w((e=process==null?void 0:process.versions)==null?void 0:e.node)}const ot=()=>{var o;if(!nt())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return e&&t&&!n?(k.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},it=e=>(y()||ot(),G(e)),K=class R{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return R.cache.get(t)}static setCachedValue(t,n){R.cache.size>20&&R.cache.delete(R.cache.keys().next().value),R.cache.set(t,{value:n})}};K.cacheLimit=20;K.cache=new Map;let B=K;function $({code:e,context:t,localState:n,rootState:o,rootSetState:i,event:r,isExpression:a=!0,enableCache:s}){if(e===""){k.warn("Skipping evaluation of empty code block.");return}const l={code:tt(e,{isExpression:a}),builder:et(),context:t,event:r,rootSetState:i,rootState:o,localState:n};if(s){const d=B.getCacheKey(l),p=B.getCachedValue(d);if(p)return p.value}try{const d=it(l);if(s){const p=B.getCacheKey(l);B.setCachedValue(p,d)}return d}catch(d){k.error("Failed code evaluation: "+d.message,{code:e});return}}const P=e=>JSON.parse(JSON.stringify(e)),rt=(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((i,r,a)=>Object(i[r])===i[r]?i[r]:i[r]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e};const at=({block:e,context:t,localState:n,rootState:o,rootSetState:i})=>{if(!e.bindings)return e;const r=P(e),a={...r,properties:{...r.properties},actions:{...r.actions}};for(const s in e.bindings){const l=e.bindings[s],d=$({code:l,localState:n,rootState:o,rootSetState:i,context:t,enableCache:!0});rt(a,s,d)}return a};function W({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:i,rootSetState:r}){const a=e;return n?at({block:a,localState:o,rootState:i,rootSetState:r,context:t}):a}const st=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),he=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${st(n)}: ${o};`}).filter(w),ct=e=>he(e).join(`
2
2
  `),_=({mediaQuery:e,className:t,styles:n})=>{const o=`.${t} {
3
3
  ${ct(n)}
4
4
  }`;return e?`${e} {
@@ -131,7 +131,7 @@
131
131
  )`,cn=({contentId:e,variationId:t})=>`window.${Re}(
132
132
  "${t}", "${e}", ${Pe}
133
133
  )`;function H(e){return c.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id||""})}const ln=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||k.warn("No previewed ID found in search params."),n};function Ae(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new Ke.LRUCache({max:500,ttl:1e3*60*5}))}function dn(e){Ae();const t=ln(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function un(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function mn(){const e=un().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.
134
- 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 Be=mn();function j(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...j(r,a,n)}:{...o,[a]:r}},{})}const fn="v3",te="builder.",hn="options.",q=e=>{if(!e)return{};const t=de(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(te)){const i=o.replace(te,"").replace(hn,"");n[i]=t[o]}}),n},pn=()=>{if(!y())return{};const e=new URLSearchParams(window.location.search);return q(e)},ne=e=>typeof e=="number"&&!isNaN(e)&&e>=0,J=e=>{const{limit:t=30,userAttributes:n,query:o,model:i,apiKey:r,enrich:a,locale:s,apiVersion:l=fn,fields:d,omit:p,offset:u,cacheSeconds:f,staleCacheSeconds:b,sort:h,includeUnpublished:m}=e;if(!r)throw new Error("Missing API key");if(!["v3"].includes(l))throw new Error(`Invalid apiVersion: expected 'v3', received '${l}'`);const S=t!==1,g=new URL(`https://cdn.builder.io/api/${l}/content/${i}`);if(g.searchParams.set("apiKey",r),g.searchParams.set("limit",String(t)),g.searchParams.set("noTraverse",String(S)),g.searchParams.set("includeRefs",String(!0)),s&&g.searchParams.set("locale",s),a&&g.searchParams.set("enrich",String(a)),g.searchParams.set("omit",p||"meta.componentsUsed"),d&&g.searchParams.set("fields",d),Number.isFinite(u)&&u>-1&&g.searchParams.set("offset",String(Math.floor(u))),typeof m=="boolean"&&g.searchParams.set("includeUnpublished",String(m)),f&&ne(f)&&g.searchParams.set("cacheSeconds",String(f)),b&&ne(b)&&g.searchParams.set("staleCacheSeconds",String(b)),h){const x=j({sort:h});for(const I in x)g.searchParams.set(I,JSON.stringify(x[I]))}const C={...pn(),...de(e.options||{})},T=j(C);for(const x in T)g.searchParams.set(x,String(T[x]));if(n&&g.searchParams.set("userAttributes",JSON.stringify(n)),o){const x=j({query:o});for(const I in x)g.searchParams.set(I,JSON.stringify(x[I]))}return g},gn=e=>"results"in e;async function Y(e){const t=await je({...e,limit:1});return t&&t[0]||null}const bn=async e=>{const t=J(e);return await(await Be(t.href)).json()},Ve=async(e,t,n=J(e))=>{const o=F(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const s=dn(n.searchParams);r.push(s||a)}t.results=r}if(!o||!(y()||E==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await Ft({item:a,canTrack:o}));t.results=r}catch(r){k.error("Could not process A/B tests. ",r)}return t.results};async function je(e){try{const t=J(e),n=await bn(e);return gn(n)?Ve(e,n):(k.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return k.error("Error fetching data. ",t),null}}function yn(e){if(!y())return!1;const t=ue(e||window.location.search);return N(t)?!1:t.indexOf("builder.preview=")!==-1}function Sn(){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 We(){return Sn().replace(/-/g,"")}const Fe="builderSessionId",xn=async({canTrack:e})=>{if(!e)return;const t=await ke({name:Fe,canTrack:e});if(w(t))return t;{const n=kn();return vn({id:n,canTrack:e}),n}},kn=()=>We(),vn=({id:e,canTrack:t})=>ve({name:Fe,value:e,canTrack:t}),Oe=()=>y()&&typeof localStorage<"u"?localStorage:void 0,Cn=({key:e,canTrack:t})=>{var n;try{return t?(n=Oe())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},wn=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Oe())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},Ne="builderVisitorId",In=({canTrack:e})=>{if(!e)return;const t=Cn({key:Ne,canTrack:e});if(w(t))return t;{const n=En();return Tn({id:n,canTrack:e}),n}},En=()=>We(),Tn=({id:e,canTrack:t})=>wn({key:Ne,value:e,canTrack:t}),Rn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await xn({canTrack:e}),n=In({canTrack:e});return{sessionId:t,visitorId:n}},Pn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await Rn({canTrack:t}),userAttributes:me(),ownerId:n}});async function $e(e){if(!e.apiKey){k.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!N()&&(y()||E==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Pn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const An=e=>$e({...e,canTrack:!0});function oe(e){return Math.round(e*1e3)/1e3}const Bn=(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},Vn=e=>Bn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ie=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=oe(o/n.width),a=oe(i/n.height);return{x:r,y:a}},jn=e=>{const t=e.target,n=t&&Vn(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?ie({event:e,target:t}):void 0,builderTargetOffset:n?ie({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Wn=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function Le(e,t){const n=new URL(t.origin),o=n.hostname;return(e||Wn).findIndex(i=>i.startsWith("*.")?o.endsWith(i.slice(1)):i===o)>-1}const Fn="0.14.8",re={};function Ue(e,t){let n=re[e];if(n||(n=re[e]=[]),n.push(t),y()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(i){console.debug("Could not postmessage",i)}}}const On=()=>{Ue("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 ae=!1;const De=(e={})=>{var t,n;ae||(ae=!0,y()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:E,version:Fn,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var r,a;if(!Le(e.trustedHosts,o))return;const{data:i}=o;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const s=i.data.text,l=i.data.arguments||[],d=i.data.id,p=new Function(s);let u,f=null;try{u=p.apply(null,l)}catch(b){f=b}f?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:d,error:f.message}},"*"):u&&typeof u.then=="function"?u.then(b=>{var h;(h=window.parent)==null||h.postMessage({type:"builder.evaluateResult",data:{id:d,result:b}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:u,id:d}},"*");break}}})))},_e=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!Le(t,o))return;const{data:i}=o;if(i)switch(i.type){case"builder.configureSdk":{n.configureSdk(i.data);break}case"builder.triggerAnimation":{n.animation(i.data);break}case"builder.contentUpdate":{const r=i.data,a=r.key||r.alias||r.entry||r.modelName,s=r.data;a===e&&n.contentUpdate(s);break}}},Nn=(e,t,n)=>{if(!y)return k.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};De();const o=_e({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function se(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const i=arguments[o];if(i!=null)for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n}const $n=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function Ln(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function Un(e,t){const n=Dn(e),o=getComputedStyle(t),i=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,a=[i,r];for(const s of a)for(const l of n)l in s||(s[l]=o[l])}function Dn(e){const t=[];for(const n of e.steps)for(const o in n.styles)t.indexOf(o)===-1&&t.push(o);return t}function _n(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Ln(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Un(e,n),n.style.transition="none",n.style.transitionDelay="0",se(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${$n(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),se(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const Mn=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let i="";if(o&&t&&n&&(i+=`
134
+ 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 Be=mn();function j(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...j(r,a,n)}:{...o,[a]:r}},{})}const fn="v3",te="builder.",hn="options.",q=e=>{if(!e)return{};const t=de(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(te)){const i=o.replace(te,"").replace(hn,"");n[i]=t[o]}}),n},pn=()=>{if(!y())return{};const e=new URLSearchParams(window.location.search);return q(e)},ne=e=>typeof e=="number"&&!isNaN(e)&&e>=0,J=e=>{const{limit:t=30,userAttributes:n,query:o,model:i,apiKey:r,enrich:a,locale:s,apiVersion:l=fn,fields:d,omit:p,offset:u,cacheSeconds:f,staleCacheSeconds:b,sort:h,includeUnpublished:m}=e;if(!r)throw new Error("Missing API key");if(!["v3"].includes(l))throw new Error(`Invalid apiVersion: expected 'v3', received '${l}'`);const S=t!==1,g=new URL(`https://cdn.builder.io/api/${l}/content/${i}`);if(g.searchParams.set("apiKey",r),g.searchParams.set("limit",String(t)),g.searchParams.set("noTraverse",String(S)),g.searchParams.set("includeRefs",String(!0)),s&&g.searchParams.set("locale",s),a&&g.searchParams.set("enrich",String(a)),g.searchParams.set("omit",p||"meta.componentsUsed"),d&&g.searchParams.set("fields",d),Number.isFinite(u)&&u>-1&&g.searchParams.set("offset",String(Math.floor(u))),typeof m=="boolean"&&g.searchParams.set("includeUnpublished",String(m)),f&&ne(f)&&g.searchParams.set("cacheSeconds",String(f)),b&&ne(b)&&g.searchParams.set("staleCacheSeconds",String(b)),h){const x=j({sort:h});for(const I in x)g.searchParams.set(I,JSON.stringify(x[I]))}const C={...pn(),...de(e.options||{})},T=j(C);for(const x in T)g.searchParams.set(x,String(T[x]));if(n&&g.searchParams.set("userAttributes",JSON.stringify(n)),o){const x=j({query:o});for(const I in x)g.searchParams.set(I,JSON.stringify(x[I]))}return g},gn=e=>"results"in e;async function Y(e){const t=await je({...e,limit:1});return t&&t[0]||null}const bn=async e=>{const t=J(e);return await(await Be(t.href)).json()},Ve=async(e,t,n=J(e))=>{const o=F(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const s=dn(n.searchParams);r.push(s||a)}t.results=r}if(!o||!(y()||E==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await Ft({item:a,canTrack:o}));t.results=r}catch(r){k.error("Could not process A/B tests. ",r)}return t.results};async function je(e){try{const t=J(e),n=await bn(e);return gn(n)?Ve(e,n):(k.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return k.error("Error fetching data. ",t),null}}function yn(e){if(!y())return!1;const t=ue(e||window.location.search);return N(t)?!1:t.indexOf("builder.preview=")!==-1}function Sn(){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 We(){return Sn().replace(/-/g,"")}const Fe="builderSessionId",xn=async({canTrack:e})=>{if(!e)return;const t=await ke({name:Fe,canTrack:e});if(w(t))return t;{const n=kn();return vn({id:n,canTrack:e}),n}},kn=()=>We(),vn=({id:e,canTrack:t})=>ve({name:Fe,value:e,canTrack:t}),Oe=()=>y()&&typeof localStorage<"u"?localStorage:void 0,Cn=({key:e,canTrack:t})=>{var n;try{return t?(n=Oe())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},wn=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Oe())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},Ne="builderVisitorId",In=({canTrack:e})=>{if(!e)return;const t=Cn({key:Ne,canTrack:e});if(w(t))return t;{const n=En();return Tn({id:n,canTrack:e}),n}},En=()=>We(),Tn=({id:e,canTrack:t})=>wn({key:Ne,value:e,canTrack:t}),Rn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await xn({canTrack:e}),n=In({canTrack:e});return{sessionId:t,visitorId:n}},Pn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await Rn({canTrack:t}),userAttributes:me(),ownerId:n}});async function $e(e){if(!e.apiKey){k.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!N()&&(y()||E==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Pn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const An=e=>$e({...e,canTrack:!0});function oe(e){return Math.round(e*1e3)/1e3}const Bn=(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},Vn=e=>Bn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ie=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=oe(o/n.width),a=oe(i/n.height);return{x:r,y:a}},jn=e=>{const t=e.target,n=t&&Vn(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?ie({event:e,target:t}):void 0,builderTargetOffset:n?ie({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Wn=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function Le(e,t){const n=new URL(t.origin),o=n.hostname;return(e||Wn).findIndex(i=>i.startsWith("*.")?o.endsWith(i.slice(1)):i===o)>-1}const Fn="0.14.9",re={};function Ue(e,t){let n=re[e];if(n||(n=re[e]=[]),n.push(t),y()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(i){console.debug("Could not postmessage",i)}}}const On=()=>{Ue("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 ae=!1;const De=(e={})=>{var t,n;ae||(ae=!0,y()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:E,version:Fn,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var r,a;if(!Le(e.trustedHosts,o))return;const{data:i}=o;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const s=i.data.text,l=i.data.arguments||[],d=i.data.id,p=new Function(s);let u,f=null;try{u=p.apply(null,l)}catch(b){f=b}f?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:d,error:f.message}},"*"):u&&typeof u.then=="function"?u.then(b=>{var h;(h=window.parent)==null||h.postMessage({type:"builder.evaluateResult",data:{id:d,result:b}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:u,id:d}},"*");break}}})))},_e=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!Le(t,o))return;const{data:i}=o;if(i)switch(i.type){case"builder.configureSdk":{n.configureSdk(i.data);break}case"builder.triggerAnimation":{n.animation(i.data);break}case"builder.contentUpdate":{const r=i.data,a=r.key||r.alias||r.entry||r.modelName,s=r.data;a===e&&n.contentUpdate(s);break}}},Nn=(e,t,n)=>{if(!y)return k.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};De();const o=_e({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function se(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const i=arguments[o];if(i!=null)for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n}const $n=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function Ln(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function Un(e,t){const n=Dn(e),o=getComputedStyle(t),i=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,a=[i,r];for(const s of a)for(const l of n)l in s||(s[l]=o[l])}function Dn(e){const t=[];for(const n of e.steps)for(const o in n.styles)t.indexOf(o)===-1&&t.push(o);return t}function _n(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Ln(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Un(e,n),n.style.transition="none",n.style.transitionDelay="0",se(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${$n(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),se(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const Mn=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let i="";if(o&&t&&n&&(i+=`
135
135
  @font-face {
136
136
  font-family: "${t}";
137
137
  src: local("${n}"), url('${o}') format('woff2');
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-2046b4f7.cjs"),e=require("./bundle-eca4b0ba.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-d3d0c3a5.cjs");require("next/navigation");require("lru-cache");exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;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.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-5b3511d0.cjs"),e=require("./bundle-9d3cdb5c.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-4e489369.cjs");require("next/navigation");require("lru-cache");exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;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.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
@@ -1,8 +1,8 @@
1
- import { c as n, F as m, d as c, S as p, V as g } from "./USE_CLIENT_BUNDLE-78517750.js";
2
- import { B as l, C as u, w as E, S, T as f, F as B, p as C, E as h, G as x, q as b, z as y, c as F, j as P, x as T, y as k, D as w, A as R } from "./bundle-d78727c9.js";
1
+ import { c as n, F as m, d as c, S as p, V as g } from "./USE_CLIENT_BUNDLE-07d1ba4b.js";
2
+ import { B as l, C as u, w as E, S, T as f, F as B, p as C, E as h, G as x, q as b, z as y, c as F, j as P, x as T, y as k, D as w, A as R } from "./bundle-53a4ab4a.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
- import "./USE_SERVER_BUNDLE-29f23050.js";
5
+ import "./USE_SERVER_BUNDLE-059335ee.js";
6
6
  import "next/navigation";
7
7
  import "lru-cache";
8
8
  export {
@@ -0,0 +1,21 @@
1
+ "use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-da19475d.cjs"),o=require("react"),_=require("./USE_SERVER_BUNDLE-37a2c2d3.cjs"),z=require("next/navigation");function E(e){return t.jsx(t.Fragment,{children:a.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function M(e){return t.jsx(E,{attributes:{...e.attributes,[a.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[a.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function D(e){return t.jsx(E,{TagName:e.Wrapper,attributes:a.getBlockProperties({block:e.block,context:e.context}),actionAttributes:a.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})}function V(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...a.getBlockProperties({block:e.block,context:e.context}),...a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function H(e){function r(){var l;return"builder-blocks"+((l=e.blocks)!=null&&l.length?"":" no-blocks")}function m(){var l,b;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((b=window.parent)==null||b.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var l,b;a.isEditing()&&!((l=e.blocks)!=null&&l.length)&&((b=window.parent)==null||b.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:r()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:l=>m(),onMouseEnter:l=>S(),onKeyPress:l=>m(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: stretch;
5
+ }`})]})}function U(e){return t.jsx("span",{children:e.children})}function $(e){var l,b,h,x;function r(){var f;const d=e.image||e.src;if(!d||!(d.match(/builder\.io/)||d.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),a.getSrcSet(d)}else if(e.image&&!e.srcset)return a.getSrcSet(d);return a.getSrcSet(d)}function m(){var g;return(g=r==null?void 0:r())!=null&&g.match(/builder\.io/)&&!e.noWebp?r().replace(/\?/g,"?format=webp&"):""}function S(){const g={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?g:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[m()?t.jsx("source",{type:"image/webp",srcSet:m()}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-a0c95e8c",src:e.image,srcSet:r(),sizes:e.sizes})]}),e.aspectRatio&&!((b=(l=e.builderBlock)==null?void 0:l.children)!=null&&b.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-a0c95e8c",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(x=(h=e.builderBlock)==null?void 0:h.children)!=null&&x.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx("div",{className:"div-a0c95e8c-2",children:e.children}):null]}),t.jsx("style",{children:`.img-a0c95e8c {
6
+ opacity: 1;
7
+ transition: opacity 0.2s ease-in-out;
8
+ }.div-a0c95e8c {
9
+ width: 100%;
10
+ pointer-events: none;
11
+ font-size: 0;
12
+ }.div-a0c95e8c-2 {
13
+ display: flex;
14
+ flex-direction: column;
15
+ align-items: stretch;
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 100%;
20
+ height: 100%;
21
+ }`})]})}function O(e){return t.jsx("section",{...e.attributes,style:{width:"100%",alignSelf:"stretch",flexGrow:1,boxSizing:"border-box",maxWidth:e.maxWidth||1200,display:"flex",flexDirection:"column",alignItems:"stretch",marginLeft:"auto",marginRight:"auto"},children:e.children})}function J(e){const r=o.useRef(null),[m,S]=o.useState(()=>[]),[l,b]=o.useState(()=>[]);return o.useEffect(()=>{var x;if(!((x=r.current)!=null&&x.getElementsByTagName)||typeof window>"u")return;const h=r.current.getElementsByTagName("script");for(let g=0;g<h.length;g++){const d=h[g];if(d.src){if(m.includes(d.src))continue;m.push(d.src);const f=document.createElement("script");f.async=!0,f.src=d.src,document.head.appendChild(f)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(l.includes(d.innerText))continue;try{l.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),t.jsx("div",{ref:r,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function G(e){const r=o.useRef(null),[m,S]=o.useState(()=>[]),[l,b]=o.useState(()=>[]),[h,x]=o.useState(()=>!1);function g(){if(!r.current||!r.current.getElementsByTagName)return;const d=r.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const k=d[f];if(k.src&&!m.includes(k.src)){m.push(k.src);const y=document.createElement("script");y.async=!0,y.src=k.src,document.head.appendChild(y)}else if(a.isJsScript(k)&&!l.includes(k.innerText))try{l.push(k.innerText),new Function(k.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return o.useEffect(()=>{r.current&&!h&&(x(!0),g())},[r.current,h]),t.jsx("div",{className:"builder-embed",ref:r,dangerouslySetInnerHTML:{__html:e.content}})}function Q(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},a.isEditing()&&e.imgSrc||"default-key")}function X(e){var S,l,b,h,x,g,d;function r(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function m(){return{...r()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...m(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((b=(l=e.builderBlock)==null?void 0:l.children)!=null&&b.length))?t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(x=(h=e.builderBlock)==null?void 0:h.children)!=null&&x.length&&e.fitContent?t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(d=(g=e.builderBlock)==null?void 0:g.children)!=null&&d.length&&!e.fitContent?t.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const Y=o.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function Z(e){var R,P,T,B,N,L,F;const r=o.useRef(null);function m(i){var c,s;const n={...e.builderContextSignal.rootState,...i};e.builderContextSignal.rootSetState?(s=(c=e.builderContextSignal).rootSetState)==null||s.call(c,n):e.builderContextSignal.rootState=n}function S(i){var c,s,u,v,W;const n={...e.builderContextSignal.content,...i,data:{...(c=e.builderContextSignal.content)==null?void 0:c.data,...i==null?void 0:i.data},meta:{...(s=e.builderContextSignal.content)==null?void 0:s.meta,...i==null?void 0:i.meta,breakpoints:((u=i==null?void 0:i.meta)==null?void 0:u.breakpoints)||((W=(v=e.builderContextSignal.content)==null?void 0:v.meta)==null?void 0:W.breakpoints)}};_.postPreviewContent({value:n,key:n.id}).then(()=>{q.refresh()})}const[l,b]=o.useState(()=>e.contentWrapper||"div");function h(i){return a.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:n=>{var u;const{breakpoints:c,contentId:s}=n;!s||s!==((u=e.builderContextSignal.content)==null?void 0:u.id)||c&&S({meta:{breakpoints:c}})},animation:n=>{a.triggerAnimation(n)},contentUpdate:n=>{S(n)}}})(i)}function x(){var n,c;const i=(c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.jsCode;i&&a.evaluate({code:i,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[g,d]=o.useState(()=>({})),[f,k]=o.useState(()=>!1);function y(i){var n,c;if(e.builderContextSignal.content){const s=(n=e.builderContextSignal.content)==null?void 0:n.testVariationId,u=(c=e.builderContextSignal.content)==null?void 0:c.id;a._track({type:"click",canTrack:a.getDefaultCanTrack(e.canTrack),contentId:u,apiKey:e.apiKey,variationId:s!==u?s:void 0,...a.getInteractionPropertiesForEvent(i),unique:!f})}f||k(!0)}function A(i){return i.replace(/{{([^}]+)}}/g,(n,c)=>String(a.evaluate({code:c,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})))}function K({url:i,key:n}){a.fetch(i).then(c=>c.json()).then(c=>{var u,v;const s={...e.builderContextSignal.rootState,[n]:c};(v=(u=e.builderContextSignal).rootSetState)==null||v.call(u,s),g[n]=!0}).catch(c=>{console.error("error fetching dynamic data",i,c)})}function j(){var n,c;const i=((c=(n=e.builderContextSignal.content)==null?void 0:n.data)==null?void 0:c.httpRequests)??{};Object.entries(i).forEach(([s,u])=>{if(u&&(!g[s]||a.isEditing())){const v=A(u);K({url:v,key:s})}})}function C(){a.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:a.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function w(i){window.addEventListener("message",h),a.registerInsertMenu(),a.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(n=>{var s;const c=a.createRegisterComponentMessage(n);(s=window.parent)==null||s.postMessage(c,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",C)}function I(i){const n=new URL(location.href).searchParams,c=n.get("builder.preview"),s=n.get(`builder.preview.${c}`),u=n.get("apiKey")||n.get("builder.space");c===e.model&&u===e.apiKey&&(!e.content||s===e.content.id)&&a.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(v=>{v&&S(v)})}const q=z.useRouter();return o.useEffect(()=>{var i;return(i=r.current)==null||i.addEventListener("initeditingbldr",w),()=>{var n;return(n=r.current)==null?void 0:n.removeEventListener("initeditingbldr",w)}},[]),o.useEffect(()=>{var i;return(i=r.current)==null||i.addEventListener("initpreviewingbldr",I),()=>{var n;return(n=r.current)==null?void 0:n.removeEventListener("initpreviewingbldr",I)}},[]),o.useEffect(()=>{var i,n;if(a.isBrowser()){if(a.isEditing()&&r.current&&r.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&a.getDefaultCanTrack(e.canTrack)){const s=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,u=(n=e.builderContextSignal.content)==null?void 0:n.id,v=e.apiKey;a._track({type:"impression",canTrack:!0,contentId:u,apiKey:v,variationId:s!==u?s:void 0})}a.isPreviewing()}},[]),o.useEffect(()=>{e.apiKey||a.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),x(),j(),C()},[]),o.useEffect(()=>{},[e.content]),o.useEffect(()=>{x()},[(P=(R=e.builderContextSignal.content)==null?void 0:R.data)==null?void 0:P.jsCode]),o.useEffect(()=>{j()},[(B=(T=e.builderContextSignal.content)==null?void 0:T.data)==null?void 0:B.httpRequests]),o.useEffect(()=>{C()},[e.builderContextSignal.rootState]),o.useEffect(()=>{e.data&&m(e.data)},[e.data]),o.useEffect(()=>{e.locale&&m({locale:e.locale})},[e.locale]),o.useEffect(()=>()=>{a.isBrowser()&&(window.removeEventListener("message",h),window.removeEventListener("builder:component:stateChangeListenerActivated",C))},[]),t.jsx(Y.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(l,{ref:r,onClick:i=>y(i),"builder-content-id":(N=e.builderContextSignal.content)==null?void 0:N.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((L=e.content)==null?void 0:L.testVariationId)||((F=e.content)==null?void 0:F.id)}`,children:e.children}):null})}exports.BlockWrapper=D;exports.BlocksWrapper=H;exports.Button=M;exports.CustomCode=J;exports.DynamicRenderer=E;exports.Embed=G;exports.EnableEditor=Z;exports.FragmentComponent=U;exports.Image=$;exports.ImgComponent=Q;exports.InteractiveElement=V;exports.SectionComponent=O;exports.Video=X;