@builder.io/sdk-react-nextjs 0.12.6 → 0.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/{USE_CLIENT_BUNDLE-4d4e23b4.js → USE_CLIENT_BUNDLE-456ca2b5.js} +46 -42
- package/lib/{node/USE_CLIENT_BUNDLE-343cb348.cjs → browser/USE_CLIENT_BUNDLE-9d2b983d.cjs} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-fda604b6.js → browser/USE_SERVER_BUNDLE-e0f1c15b.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-19879780.cjs → browser/USE_SERVER_BUNDLE-ee4a5d19.cjs} +1 -1
- package/lib/browser/{bundle-b3104268.js → bundle-56e0b400.js} +477 -434
- package/lib/browser/{bundle-6e21e129.cjs → bundle-a408994f.cjs} +20 -20
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +6 -6
- package/lib/{node/USE_CLIENT_BUNDLE-aa8ab44a.js → edge/USE_CLIENT_BUNDLE-789e694f.js} +46 -42
- package/lib/{browser/USE_CLIENT_BUNDLE-e5d64246.cjs → edge/USE_CLIENT_BUNDLE-a6a0becc.cjs} +2 -2
- package/lib/{node/USE_SERVER_BUNDLE-cbcb1baf.cjs → edge/USE_SERVER_BUNDLE-dbf92938.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-2fdc522e.js → edge/USE_SERVER_BUNDLE-dffaa191.js} +1 -1
- package/lib/edge/{bundle-ee1ebe27.js → bundle-4bf88f38.js} +482 -439
- package/lib/edge/{bundle-f2d4a6db.cjs → bundle-97ad81d1.cjs} +28 -28
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +6 -6
- package/lib/{edge/USE_CLIENT_BUNDLE-41ee32e4.js → node/USE_CLIENT_BUNDLE-499aeaa2.js} +46 -42
- package/lib/{edge/USE_CLIENT_BUNDLE-cc55e91d.cjs → node/USE_CLIENT_BUNDLE-b2f9be29.cjs} +2 -2
- package/lib/{browser/USE_SERVER_BUNDLE-ccca985e.cjs → node/USE_SERVER_BUNDLE-b3ad9a89.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-2bf0dc28.js → node/USE_SERVER_BUNDLE-e3da6caa.js} +1 -1
- package/lib/node/{bundle-c799b7fc.cjs → bundle-97b4832a.cjs} +4 -4
- package/lib/node/{bundle-99e5b33f.js → bundle-d3f89e99.js} +216 -173
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +6 -6
- package/package.json +1 -1
- package/types/cjs/components/block/animator.d.ts +5 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/types/builder-block.d.ts +18 -1
- package/types/esm/components/block/animator.d.ts +5 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/types/builder-block.d.ts +18 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const Ue=require("lru-cache"),s=require("react/jsx-runtime"),S=require("./USE_CLIENT_BUNDLE-9d2b983d.cjs");require("react");require("next/navigation");const De=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Me=e=>typeof e=="string"&&De.has(e.toLowerCase()),I="rsc",F=()=>{switch(I){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function He(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const B="[Builder.io]: ",k={log:(...e)=>console.log(B,...e),error:(...e)=>console.error(B,...e),warn:(...e)=>console.warn(B,...e),debug:(...e)=>console.debug(B,...e)};function x(){return typeof window<"u"&&typeof document<"u"}function Ke(){return x()&&window.self!==window.top}function O(){return Ke()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const qe=()=>{if(x()){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},ze=()=>typeof navigator=="object"&&navigator.userAgent||"",ue=()=>{const e=ze(),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=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"}},Ge=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),Je=()=>({isEditing:O(),isBrowser:x(),isServer:!x(),getUserAttributes:()=>ue()}),Ye=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,Y=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const c=Ge({builder:t,context:n,event:o,state:me({rootState:a,localState:i,rootSetState:r})});return new Function(...c.map(([l])=>l),e)(...c.map(([,l])=>l))};function me({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"?me({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 C=e=>e!=null;function Qe(){var e;return typeof process<"u"&&C((e=process==null?void 0:process.versions)==null?void 0:e.node)}const Xe=()=>{var o;if(!Qe())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},Ze=e=>(x()||Xe(),Y(e));function N({code:e,context:t,localState:n,rootState:o,rootSetState:i,event:r,isExpression:a=!0}){if(e===""){k.warn("Skipping evaluation of empty code block.");return}const c={code:Ye(e,{isExpression:a}),builder:Je(),context:t,event:r,rootSetState:i,rootState:o,localState:n};try{return Ze(c)}catch(l){k.error("Failed code evaluation: "+l.message,{code:e});return}}const P=e=>JSON.parse(JSON.stringify(e)),et=(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 tt=({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 c in e.bindings){const l=e.bindings[c],m=N({code:l,localState:n,rootState:o,rootSetState:i,context:t});et(a,c,m)}return a};function $({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:i,rootSetState:r}){const a=e;return n?tt({block:a,localState:o,rootState:i,rootSetState:r,context:t}):a}const nt=({block:e,context:t,registeredComponents:n})=>{var r;const o=(r=$({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!o)return null;const i=n[o];if(i)return i;console.warn(`
|
|
2
2
|
Could not find a registered component named "${o}".
|
|
3
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},
|
|
3
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},ot=({block:e,context:t})=>{const{repeat:n,...o}=e;if(!(n!=null&&n.collection))return;const i=N({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(i))return;const r=n.collection.split(".").pop(),a=n.itemName||(r?r+"Item":"item");return i.map((l,m)=>({context:{...t,localState:{...t.localState,$index:m,$item:l,[a]:l,[`$${a}Index`]:m}},block:o}))},fe={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},Q=(e,t=fe)=>`@media (max-width: ${t[e].max}px)`,he=({small:e,medium:t})=>{const n=P(fe);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const i=n.small.max+1;n.medium={max:t,min:i,default:i+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n},it=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),pe=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${it(n)}: ${o};`}).filter(C),rt=e=>pe(e).join(`
|
|
4
4
|
`),D=({mediaQuery:e,className:t,styles:n})=>{const o=`.${t} {
|
|
5
|
-
${
|
|
5
|
+
${rt(n)}
|
|
6
6
|
}`;return e?`${e} {
|
|
7
7
|
${o}
|
|
8
|
-
}`:o};function L(e){return s.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function
|
|
8
|
+
}`:o};function L(e){return s.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function at(e){const t=function(){const i=$({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return C(i.hide)?!i.hide:C(i.show)?i.show:!0},n=function(){var d;const i=$({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),r=i.responsiveStyles,a=e.context.content,c=he(((d=a==null?void 0:a.meta)==null?void 0:d.breakpoints)||{}),l=r==null?void 0:r.large,m=r==null?void 0:r.medium,g=r==null?void 0:r.small,p=i.id;if(!p)return"";const f=l?D({className:p,styles:l}):"",h=m?D({className:p,styles:m,mediaQuery:Q("medium",c)}):"",u=g?D({className:p,styles:g,mediaQuery:Q("small",c)}):"";return[f,h,u].join(" ")};return s.jsx(s.Fragment,{children:n()&&t()?s.jsx(s.Fragment,{children:s.jsx(L,{styles:n()})}):null})}function st(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ct=e=>`on${st(e)}`,lt=(e,t)=>n=>N({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function dt(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const i=n[o];let r=ct(o);if(e.stripPrefix)switch(I){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=lt(i,e)}return t}function ut({style:e}){return e}const mt=({block:e,context:t})=>ge(ut({style:e.style||{},context:t,block:e}));function ge(e){switch(I){case"svelte":case"vue":case"solid":return pe(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}function ft({properties:e}){return e}const ht=e=>({href:e.href});function be({block:e,context:t}){var o;const n={...ht(e),...e.properties,"builder-id":e.id,style:mt({block:e,context:t}),[F()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return ft({properties:n,context:t,block:e})}const pt=({componentOptions:e,builderBlock:t,context:n,componentRef:o,includeBlockProps:i,isInteractive:r,contextValue:a})=>{const c={...e,...i?{attributes:be({block:t,context:a})}:{}};return r?{Wrapper:o,block:t,context:n,wrapperProps:e,includeBlockProps:i}:c};function X(e){var n;const t=e.isInteractive?S.InteractiveElement:e.componentRef;return s.jsx(s.Fragment,{children:e.componentRef?s.jsx(s.Fragment,{children:s.jsx(t,{...pt({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(n=e.blockChildren)==null?void 0:n.map(o=>s.jsx(_,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function gt(e){const t=e.repeatContext;return s.jsx(_,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})}function _(e){var m,g,p;const t=function(){return nt({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return ot({block:e.block,context:e.context})},o=function(){var h;return(h=e.block.repeat)!=null&&h.collection?e.block:$({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},i=function(){var u;return e.block.tagName==="a"||((u=o().properties)==null?void 0:u.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"},r=function(){var d,y;if((d=e.block.repeat)!=null&&d.collection)return!!((y=n())!=null&&y.length);const h="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!h},a=function(){var u;return!((u=t())!=null&&u.component)&&!n()?o().children??[]:[]},c=function(){var h,u,d,y,v,b,E,T;return{blockChildren:o().children??[],componentRef:(h=t())==null?void 0:h.component,componentOptions:{...He(o()),builderContext:e.context,...((u=t())==null?void 0:u.name)==="Core:Button"||((d=t())==null?void 0:d.name)==="Symbol"||((y=t())==null?void 0:y.name)==="Columns"?{builderLinkComponent:e.linkComponent}:{},...((v=t())==null?void 0:v.name)==="Symbol"||((b=t())==null?void 0:b.name)==="Columns"?{builderComponents:e.registeredComponents}:{}},context:l,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((E=t())==null?void 0:E.noWrap)===!0,isInteractive:!((T=t())!=null&&T.isRSC)}},l=e.context;return s.jsx(s.Fragment,{children:r()?s.jsxs(s.Fragment,{children:[s.jsx(at,{block:e.block,context:e.context}),(m=t())!=null&&m.noWrap?s.jsx(s.Fragment,{children:s.jsx(X,{componentRef:c().componentRef,componentOptions:c().componentOptions,blockChildren:c().blockChildren,context:c().context,registeredComponents:c().registeredComponents,linkComponent:c().linkComponent,builderBlock:c().builderBlock,includeBlockProps:c().includeBlockProps,isInteractive:c().isInteractive})}):s.jsx(s.Fragment,{children:n()?s.jsx(s.Fragment,{children:(p=n())==null?void 0:p.map((f,h)=>s.jsx(gt,{repeatContext:f.context,block:f.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},h))}):s.jsx(s.Fragment,{children:s.jsxs(S.BlockWrapper,{Wrapper:i(),block:o(),context:e.context,linkComponent:e.linkComponent,children:[s.jsx(X,{componentRef:c().componentRef,componentOptions:c().componentOptions,blockChildren:c().blockChildren,context:c().context,registeredComponents:c().registeredComponents,linkComponent:c().linkComponent,builderBlock:c().builderBlock,includeBlockProps:c().includeBlockProps,isInteractive:c().isInteractive}),(g=a())==null?void 0:g.map(f=>s.jsx(_,{block:f,context:l,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},f.id))]})})})]}):null})}function A(e){var t,n,o;return s.jsx(S.BlocksWrapper,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(t=e.context)==null?void 0:t.BlocksWrapper,BlocksWrapperProps:(n=e.context)==null?void 0:n.BlocksWrapperProps,children:e.blocks?s.jsx(s.Fragment,{children:(o=e.blocks)==null?void 0:o.map(i=>s.jsx(_,{block:i,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},i.id))}):null})}function ye(e){var h;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],o=e.stackColumnsAt||"tablet",i=function(d){var y;return((y=n[d])==null?void 0:y.width)||100/n.length},r=function(d){const y=t*(n.length-1)/n.length;return`calc(${i(d)}% - ${y}px)`},a=function({stackedStyle:d,desktopStyle:y}){return o==="tablet"?d:y},c=function({stackedStyle:d,desktopStyle:y}){return o==="never"?y:d},l=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",m=function(){return{"--flex-dir":l,"--flex-dir-tablet":a({stackedStyle:l,desktopStyle:"row"})}},g=function(d){const y=d===0?0:t,v=r(d),b=`${y}px`,E="100%",T=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:v,["marginLeft"]:b,"--column-width-mobile":c({stackedStyle:E,desktopStyle:v}),"--column-margin-left-mobile":c({stackedStyle:T,desktopStyle:b}),"--column-width-tablet":a({stackedStyle:E,desktopStyle:v}),"--column-margin-left-tablet":a({stackedStyle:T,desktopStyle:b})}},p=function(d){var v,b;return he(((b=(v=e.builderContext.content)==null?void 0:v.meta)==null?void 0:b.breakpoints)||{})[d].max},f=function(){return`
|
|
9
9
|
@media (max-width: ${p("medium")}px) {
|
|
10
10
|
.${e.builderBlock.id}-breakpoints {
|
|
11
11
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
`};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-3d816b82`,style:m(),children:[s.jsx(s.Fragment,{children:s.jsx(L,{styles:f()})}),(h=e.columns)==null?void 0:h.map((u,d)=>s.jsx(
|
|
32
|
+
`};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-3d816b82`,style:m(),children:[s.jsx(s.Fragment,{children:s.jsx(L,{styles:f()})}),(h=e.columns)==null?void 0:h.map((u,d)=>s.jsx(S.DynamicRenderer,{TagName:u.link?e.builderLinkComponent||"a":"div",actionAttributes:{},attributes:{...u.link?{href:u.link}:{},[F()]:"builder-column",style:ge(g(d))},children:s.jsx(A,{path:`component.options.columns.${d}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:u.blocks})},d))]}),s.jsx("style",{children:`.div-3d816b82 {
|
|
33
33
|
display: flex;
|
|
34
34
|
line-height: normal;
|
|
35
|
-
}`})]})}function Z(e){return e.replace(/http(s)?:/,"")}function gt(e="",t,n){const o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=e.indexOf("?")!==-1?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+i+t+"="+encodeURIComponent(n)}function bt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return Z(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const o=e.split(n[0]),i=n[3],r=t.match("x")?t:`${t}x`;return Z(`${o[0]}_${r}${i}`)}return null}function yt(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const o=Number(e.split("?width=")[1]);return isNaN(o)||(n=`${n} ${o}w`),t.filter(i=>i!==o).map(i=>`${gt(e,"width",i)} ${i}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[bt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,o])=>`${n} ${o}w`).concat([e]).join(", "):e}const xt=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},ye=({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){S.warn("[COOKIE] GET error: ",(o==null?void 0:o.message)||o);return}},xe=async e=>ye(e),kt=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(C).join("; "),St=[["secure",""],["SameSite","None"]],vt=({name:e,value:t,expires:n})=>{const i=(x()?location.protocol==="https:":!0)?St:[[]],r=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...r,["path","/"],["domain",xt(window.location.hostname)],...i];return kt(a)},ke=async({name:e,value:t,expires:n,canTrack:o})=>{try{if(!o)return;const i=vt({name:e,value:t,expires:n});document.cookie=i}catch(i){S.warn("[COOKIE] SET error: ",(i==null?void 0:i.message)||i)}},Ct="builder.tests",K=e=>`${Ct}.${e}`,wt=({contentId:e})=>xe({name:K(e),canTrack:!0}),It=({contentId:e})=>ye({name:K(e),canTrack:!0}),Tt=({contentId:e,value:t})=>ke({name:K(e),value:t,canTrack:!0}),Se=e=>C(e.id)&&C(e.variations)&&Object.keys(e.variations).length>0,Et=({id:e,variations:t})=>{var i;let n=0;const o=Math.random();for(const r in t){const a=(i=t[r])==null?void 0:i.testRatio;if(n+=a,o<n)return r}return e},ve=e=>{const t=Et(e);return Tt({contentId:e.id,value:t}).catch(n=>{S.error("could not store A/B test variation: ",n)}),t},Ce=({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":"")}},Rt=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!Se(e))return e;const n=It({contentId:e.id})||ve({variations:e.variations,id:e.id}),o=Ce({item:e,testGroupId:n});return{...e,...o}},Pt=async({item:e,canTrack:t})=>{if(!t||!Se(e))return e;const o=await wt({contentId:e.id})||ve({variations:e.variations,id:e.id}),i=Ce({item:e,testGroupId:o});return{...e,...i}},F=e=>C(e)?e:!0,At={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},Bt={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(o=>{o.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(i=>i.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((c,l)=>c+l.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}]},Vt={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]},jt={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(o=>o.json()).then(o=>{e.get("url")===t&&(o.html?e.set("content",o.html):e.set("content","Invalid url, please try another"))}).catch(o=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},Wt=["text/javascript","application/javascript","application/ecmascript"],Ft=e=>Wt.includes(e.type),$t={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},Ot={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(a,c=6e4){return new Promise((l,m)=>{const g=document.createElement("img");let p=!1;g.onload=()=>{p=!0,l(g)},g.addEventListener("error",f=>{console.warn("Image load failed",f.error),m(f.error)}),g.src=a,setTimeout(()=>{p||m(new Error("Image load timed out"))},c)})}function o(a){return Math.round(a*1e3)/1e3}const i=e.get("image"),r=e.get("aspectRatio");if(fetch(i).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),i&&(!r||r===.7041))return n(i).then(a=>{const c=e.get("aspectRatio");e.get("image")===i&&(!c||c===.7041)&&a.width&&a.height&&(e.set("aspectRatio",o(a.height/a.width)),e.set("height",a.height),e.set("width",a.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},Nt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0},Lt={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},_t={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function Ut(e){var t,n,o;return s.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:s.jsx(A,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(o=e.builderContext.rootState)==null?void 0:o[e.name]})})}const Dt={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},Mt={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function we(e){var t;return s.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const Ht={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]},ee=()=>[{component:k.Button,...At},{component:be,...Bt},{component:k.CustomCode,...Vt},{component:k.Embed,...jt},{component:k.FragmentComponent,...$t},{component:k.Image,...Ot},{component:k.ImgComponent,...Nt},{component:k.SectionComponent,...Lt},{component:Le,...Dt},{component:we,...Mt},{component:k.Video,...Ht},{component:Ut,..._t}],te=[],Kt=e=>({type:"builder.registerComponent",data:M(e)}),qt=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},zt=e=>typeof e=="function"?qt(e):P(e),M=({inputs:e,...t})=>({...P(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((o,[i,r])=>({...o,[i]:zt(r)}),{}))}),Gt=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
35
|
+
}`})]})}function Z(e){return e.replace(/http(s)?:/,"")}function bt(e="",t,n){const o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=e.indexOf("?")!==-1?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+i+t+"="+encodeURIComponent(n)}function yt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return Z(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const o=e.split(n[0]),i=n[3],r=t.match("x")?t:`${t}x`;return Z(`${o[0]}_${r}${i}`)}return null}function xt(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const o=Number(e.split("?width=")[1]);return isNaN(o)||(n=`${n} ${o}w`),t.filter(i=>i!==o).map(i=>`${bt(e,"width",i)} ${i}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[yt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,o])=>`${n} ${o}w`).concat([e]).join(", "):e}const St=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},xe=({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}},Se=async e=>xe(e),kt=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(C).join("; "),vt=[["secure",""],["SameSite","None"]],Ct=({name:e,value:t,expires:n})=>{const i=(x()?location.protocol==="https:":!0)?vt:[[]],r=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...r,["path","/"],["domain",St(window.location.hostname)],...i];return kt(a)},ke=async({name:e,value:t,expires:n,canTrack:o})=>{try{if(!o)return;const i=Ct({name:e,value:t,expires:n});document.cookie=i}catch(i){k.warn("[COOKIE] SET error: ",(i==null?void 0:i.message)||i)}},wt="builder.tests",K=e=>`${wt}.${e}`,It=({contentId:e})=>Se({name:K(e),canTrack:!0}),Tt=({contentId:e})=>xe({name:K(e),canTrack:!0}),Et=({contentId:e,value:t})=>ke({name:K(e),value:t,canTrack:!0}),ve=e=>C(e.id)&&C(e.variations)&&Object.keys(e.variations).length>0,Rt=({id:e,variations:t})=>{var i;let n=0;const o=Math.random();for(const r in t){const a=(i=t[r])==null?void 0:i.testRatio;if(n+=a,o<n)return r}return e},Ce=e=>{const t=Rt(e);return Et({contentId:e.id,value:t}).catch(n=>{k.error("could not store A/B test variation: ",n)}),t},we=({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":"")}},Pt=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!ve(e))return e;const n=Tt({contentId:e.id})||Ce({variations:e.variations,id:e.id}),o=we({item:e,testGroupId:n});return{...e,...o}},At=async({item:e,canTrack:t})=>{if(!t||!ve(e))return e;const o=await It({contentId:e.id})||Ce({variations:e.variations,id:e.id}),i=we({item:e,testGroupId:o});return{...e,...i}},W=e=>C(e)?e:!0,Bt={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0},Vt={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(o=>{o.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(i=>i.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((c,l)=>c+l.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}]},jt={name:"Custom Code",static:!0,requiredPermissions:["editCode"],inputs:[{name:"code",type:"html",required:!0,defaultValue:"<p>Hello there, I am custom HTML code!</p>",code:!0},{name:"replaceNodes",type:"boolean",helperText:"Preserve server rendered dom nodes",advanced:!0},{name:"scriptsClientOnly",type:"boolean",defaultValue:!1,helperText:"Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",advanced:!0}]},$t={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(o=>o.json()).then(o=>{e.get("url")===t&&(o.html?e.set("content",o.html):e.set("content","Invalid url, please try another"))}).catch(o=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},Wt=["text/javascript","application/javascript","application/ecmascript"],Ft=e=>Wt.includes(e.type),Ot={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},Nt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(a,c=6e4){return new Promise((l,m)=>{const g=document.createElement("img");let p=!1;g.onload=()=>{p=!0,l(g)},g.addEventListener("error",f=>{console.warn("Image load failed",f.error),m(f.error)}),g.src=a,setTimeout(()=>{p||m(new Error("Image load timed out"))},c)})}function o(a){return Math.round(a*1e3)/1e3}const i=e.get("image"),r=e.get("aspectRatio");if(fetch(i).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),i&&(!r||r===.7041))return n(i).then(a=>{const c=e.get("aspectRatio");e.get("image")===i&&(!c||c===.7041)&&a.width&&a.height&&(e.set("aspectRatio",o(a.height/a.width)),e.set("height",a.height),e.set("width",a.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}]},Lt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0},_t={name:"Core:Section",static:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",inputs:[{name:"maxWidth",type:"number",defaultValue:1200},{name:"lazyLoad",type:"boolean",defaultValue:!1,advanced:!0,description:"Only render this section when in view"}],defaultStyles:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"50px",paddingBottom:"50px",marginTop:"0px",width:"100vw",marginLeft:"calc(50% - 50vw)"},canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"center"}},component:{name:"Text",options:{text:"<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"}}}]},Ut={name:"Slot",isRSC:!0,description:"Allow child blocks to be inserted into this content when used as a Symbol",docsLink:"https://www.builder.io/c/docs/symbols-with-blocks",image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",inputs:[{name:"name",type:"string",required:!0,defaultValue:"children"}]};function Dt(e){var t,n,o;return s.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:s.jsx(A,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(o=e.builderContext.rootState)==null?void 0:o[e.name]})})}const Mt={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}]},Ht={name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function Ie(e){var t;return s.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const Kt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]},ee=()=>[{component:S.Button,...Bt},{component:ye,...Vt},{component:S.CustomCode,...jt},{component:S.Embed,...$t},{component:S.FragmentComponent,...Ot},{component:S.Image,...Nt},{component:S.ImgComponent,...Lt},{component:S.SectionComponent,..._t},{component:_e,...Mt},{component:Ie,...Ht},{component:S.Video,...Kt},{component:Dt,...Ut}],te=[],qt=e=>({type:"builder.registerComponent",data:M(e)}),zt=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},Gt=e=>typeof e=="function"?zt(e):P(e),M=({inputs:e,...t})=>({...P(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((o,[i,r])=>({...o,[i]:Gt(r)}),{}))}),Jt=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
36
36
|
function getAndSetVariantId() {
|
|
37
37
|
function setCookie(name, value, days) {
|
|
38
38
|
let expires = '';
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
}).join('');
|
|
89
89
|
styleEl.innerHTML = newStyleStr;
|
|
90
90
|
}
|
|
91
|
-
}`,
|
|
91
|
+
}`,Yt=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
92
92
|
if (!navigator.cookieEnabled) {
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
@@ -122,16 +122,16 @@
|
|
|
122
122
|
thisScriptEl?.remove();
|
|
123
123
|
}
|
|
124
124
|
return;
|
|
125
|
-
}`,
|
|
126
|
-
window.${Ie} = ${Gt}
|
|
125
|
+
}`,Te="builderIoAbTest",Ee="builderIoRenderContent",V=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Qt=({canTrack:e,content:t})=>!(!(V(t).length>0)||!e||x()),Xt=e=>e==="react"||e==="reactNative",Re=Xt(I),Zt=()=>`
|
|
127
126
|
window.${Te} = ${Jt}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
window.${Ee} = ${Yt}
|
|
128
|
+
`,en=(e,t)=>`
|
|
129
|
+
window.${Te}(
|
|
130
|
+
"${t}",${JSON.stringify(e)}, ${Re}
|
|
131
|
+
)`,tn=({contentId:e,variationId:t})=>`window.${Ee}(
|
|
132
|
+
"${t}", "${e}", ${Re}
|
|
133
|
+
)`;function H(e){return s.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id||""})}const nn=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||k.warn("No previewed ID found in search params."),n};function Pe(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new Ue.LRUCache({max:500,ttl:1e3*60*5}))}function on(e){Pe();const t=nn(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function rn(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function an(){const e=rn().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 Ae=an();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 sn="v3",ne="builder.",cn="options.",ln=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},q=e=>{if(!e)return{};const t=Be(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(ne)){const i=o.replace(ne,"").replace(cn,"");n[i]=t[o]}}),n},dn=()=>{if(!x())return{};const e=new URLSearchParams(window.location.search);return q(e)},Be=e=>e instanceof URLSearchParams?ln(e):e,oe=e=>typeof e=="number"&&!isNaN(e)&&e>=0,z=e=>{let{noTraverse:t=!1}=e;const{limit:n=30,userAttributes:o,query:i,model:r,apiKey:a,includeRefs:c=!0,enrich:l,locale:m,apiVersion:g=sn,fields:p,omit:f,offset:h,cacheSeconds:u,staleCacheSeconds:d,sort:y,includeUnpublished:v}=e;if(!a)throw new Error("Missing API key");if(!["v2","v3"].includes(g))throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${g}'`);(e.limit===void 0||e.limit>1)&&!("noTraverse"in e)&&(t=!0);const b=new URL(`https://cdn.builder.io/api/${g}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${c}${m?`&locale=${m}`:""}${l?`&enrich=${l}`:""}`);if(b.searchParams.set("omit",f||"meta.componentsUsed"),p&&b.searchParams.set("fields",p),Number.isFinite(h)&&h>-1&&b.searchParams.set("offset",String(Math.floor(h))),typeof v=="boolean"&&b.searchParams.set("includeUnpublished",String(v)),u&&oe(u)&&b.searchParams.set("cacheSeconds",String(u)),d&&oe(d)&&b.searchParams.set("staleCacheSeconds",String(d)),y){const w=j({sort:y});for(const R in w)b.searchParams.set(R,JSON.stringify(w[R]))}const E={...dn(),...Be(e.options||{})},T=j(E);for(const w in T)b.searchParams.set(w,String(T[w]));if(o&&b.searchParams.set("userAttributes",JSON.stringify(o)),i){const w=j({query:i});for(const R in w)b.searchParams.set(R,JSON.stringify(w[R]))}return b},un=e=>"results"in e;async function U(e){const t=await G({...e,limit:1});return t&&t[0]||null}const mn=U,fn=async e=>{const t=z(e);return await(await Ae(t.href)).json()},Ve=async(e,t,n=z(e))=>{const o=W(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const c=on(n.searchParams);r.push(c||a)}t.results=r}if(!o||!(x()||I==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await At({item:a,canTrack:o}));t.results=r}catch(r){k.error("Could not process A/B tests. ",r)}return t.results};async function G(e){try{const t=z(e),n=await fn(e);return un(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}}const hn=G,pn=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function je(e,t){const n=new URL(t.origin),o=n.hostname;return(e||pn).findIndex(i=>i.startsWith("*.")?o.endsWith(i.slice(1)):i===o)>-1}function gn(){return!x()||O()?!1:location.search.indexOf("builder.preview=")!==-1}function bn(){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 $e(){return bn().replace(/-/g,"")}const We="builderSessionId",yn=async({canTrack:e})=>{if(!e)return;const t=await Se({name:We,canTrack:e});if(C(t))return t;{const n=xn();return Sn({id:n,canTrack:e}),n}},xn=()=>$e(),Sn=({id:e,canTrack:t})=>ke({name:We,value:e,canTrack:t}),Fe=()=>x()&&typeof localStorage<"u"?localStorage:void 0,kn=({key:e,canTrack:t})=>{var n;try{return t?(n=Fe())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},vn=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Fe())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},Oe="builderVisitorId",Cn=({canTrack:e})=>{if(!e)return;const t=kn({key:Oe,canTrack:e});if(C(t))return t;{const n=wn();return In({id:n,canTrack:e}),n}},wn=()=>$e(),In=({id:e,canTrack:t})=>vn({key:Oe,value:e,canTrack:t}),Tn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await yn({canTrack:e}),n=Cn({canTrack:e});return{sessionId:t,visitorId:n}},En=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await Tn({canTrack:t}),userAttributes:ue(),ownerId:n}});async function Ne(e){if(!e.apiKey){k.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!O()&&(x()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await En(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Rn=e=>Ne({...e,canTrack:!0});function ie(e){return Math.round(e*1e3)/1e3}const Pn=(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},An=e=>Pn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),re=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=ie(o/n.width),a=ie(i/n.height);return{x:r,y:a}},Bn=e=>{const t=e.target,n=t&&An(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?re({event:e,target:t}):void 0,builderTargetOffset:n?re({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Vn="0.12.7",ae={};function Le(e,t){let n=ae[e];if(n||(n=ae[e]=[]),n.push(t),x()){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 jn=()=>{Le("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 se=!1;const $n=(e={})=>{var t,n;se||(se=!0,x()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:I,version:Vn,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(!je(e.trustedHosts,o))return;const{data:i}=o;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const c=i.data.text,l=i.data.arguments||[],m=i.data.id,g=new Function(c);let p,f=null;try{p=g.apply(null,l)}catch(h){f=h}f?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:m,error:f.message}},"*"):p&&typeof p.then=="function"?p.then(h=>{var u;(u=window.parent)==null||u.postMessage({type:"builder.evaluateResult",data:{id:m,result:h}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:p,id:m}},"*");break}}})))};function ce(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 Wn=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function Fn(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function On(e,t){const n=Nn(e),o=getComputedStyle(t),i=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,a=[i,r];for(const c of a)for(const l of n)l in c||(c[l]=o[l])}function Nn(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 Ln(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Fn(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{On(e,n),n.style.transition="none",n.style.transitionDelay="0",ce(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${Wn(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),ce(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const _n=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');
|
|
@@ -145,9 +145,9 @@ src: url('${l}') format('woff2');
|
|
|
145
145
|
font-display: fallback;
|
|
146
146
|
font-weight: ${a};
|
|
147
147
|
}
|
|
148
|
-
`.trim())}return i},
|
|
149
|
-
${
|
|
150
|
-
${
|
|
148
|
+
`.trim())}return i},Un=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>_n(n)))==null?void 0:t.join(" "))||""},Dn=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"";function Mn(e){const t=`
|
|
149
|
+
${Dn({cssCode:e.cssCode,contentId:e.contentId})}
|
|
150
|
+
${Un({customFonts:e.customFonts})}
|
|
151
151
|
|
|
152
152
|
.builder-button {
|
|
153
153
|
all: unset;
|
|
@@ -165,4 +165,4 @@ ${Fn({customFonts:e.customFonts})}
|
|
|
165
165
|
text-align: inherit;
|
|
166
166
|
font-family: inherit;
|
|
167
167
|
}
|
|
168
|
-
`.trim();return s.jsx(L,{styles:t})}const
|
|
168
|
+
`.trim();return s.jsx(L,{styles:t})}const Hn=({content:e,data:t,locale:n})=>{var r,a,c;const o={},i=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(c=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||c.forEach(l=>{l.name&&l.defaultValue!==void 0&&(o[l.name]=l.defaultValue)}),{...o,...i,...t,...n?{locale:n}:{}}},Kn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function le(e){var i,r,a,c,l,m,g,p,f;const t=tn({variationId:(i=e.content)==null?void 0:i.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...ee(),...te,...e.customComponents||[]].reduce((h,{component:u,...d})=>({...h,[d.name]:{component:u,...M(d)}}),{}),o={content:Kn({content:e.content,data:e.data}),localState:void 0,rootState:Hn({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ee(),...te,...e.customComponents||[]].reduce((h,{component:u,...d})=>({...h,[d.name]:M(d)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return s.jsxs(S.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?s.jsx(s.Fragment,{children:s.jsx(H,{scriptStr:t})}):null,s.jsx(s.Fragment,{children:s.jsx(Mn,{contentId:(a=o.content)==null?void 0:a.id,cssCode:(l=(c=o.content)==null?void 0:c.data)==null?void 0:l.cssCode,customFonts:(g=(m=o.content)==null?void 0:m.data)==null?void 0:g.customFonts})}),s.jsx(A,{blocks:(f=(p=o.content)==null?void 0:p.data)==null?void 0:f.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function J(e){var r,a;const t=Qt({canTrack:W(e.canTrack),content:e.content}),n=function(){var l;return en(V(e.content).map(m=>({id:m.testVariationId,testRatio:m.testRatio})),((l=e.content)==null?void 0:l.id)||"")},o=function(){return V(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")},i=function(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:Pt({item:e.content,canTrack:W(e.canTrack)})};return s.jsxs(s.Fragment,{children:[!e.__isNestedRender&&I!=="reactNative"?s.jsx(s.Fragment,{children:s.jsx(H,{scriptStr:Zt()})}):null,t?s.jsxs(s.Fragment,{children:[s.jsx(L,{id:`variants-styles-${(r=e.content)==null?void 0:r.id}`,styles:o()}),s.jsx(H,{scriptStr:n()}),(a=V(e.content))==null?void 0:a.map(c=>s.jsx(le,{content:c,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},c.testVariationId))]}):null,s.jsx(le,{content:i(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const qn=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 _e(e){var o,i,r,a,c;const t=function(){var m,g;return[e.attributes[F()],"builder-symbol",(m=e.symbol)!=null&&m.inline?"builder-inline-symbol":void 0,(g=e.symbol)!=null&&g.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await qn({symbol:e.symbol,builderContextValue:e.builderContext});return s.jsx("div",{...e.attributes,className:t(),children:s.jsx(J,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(i=e.builderBlock)==null?void 0:i.id},customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(a=n==null?void 0:n.data)==null?void 0:a.state},model:(c=e.symbol)==null?void 0:c.model,content:n,linkComponent:e.builderLinkComponent})})}const zn=A,Gn=J,de={};function Jn(e){if(x()){Object.assign(de,e);const t={type:"builder.settingsChange",data:de};parent.postMessage(t,"*")}}const Yn=async e=>{var o,i,r;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((i=e.userAttributes)==null?void 0:i.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:q(e.searchParams||((r=e.url)==null?void 0:r.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await U(n)}};exports.Blocks=A;exports.Columns=ye;exports.ContentVariants=J;exports.RenderBlocks=zn;exports.RenderContent=Gn;exports.Symbol=_e;exports.Text=Ie;exports._processContentResult=Ve;exports._track=Ne;exports.createRegisterComponentMessage=qt;exports.evaluate=N;exports.fastClone=P;exports.fetch=Ae;exports.fetchBuilderProps=Yn;exports.fetchEntries=G;exports.fetchOneEntry=U;exports.getAllContent=hn;exports.getBlockActions=dt;exports.getBlockProperties=be;exports.getBuilderSearchParams=q;exports.getClassPropName=F;exports.getContent=mn;exports.getDefaultCanTrack=W;exports.getInteractionPropertiesForEvent=Bn;exports.getSrcSet=xt;exports.init=Pe;exports.isBrowser=x;exports.isEditing=O;exports.isEmptyElement=Me;exports.isFromTrustedHost=je;exports.isJsScript=Ft;exports.isPreviewing=gn;exports.logger=k;exports.register=Le;exports.registerInsertMenu=jn;exports.setEditorSettings=Jn;exports.setupBrowserForEditing=$n;exports.track=Rn;exports.triggerAnimation=Ln;
|
package/lib/browser/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-a408994f.cjs"),t=require("./USE_CLIENT_BUNDLE-9d2b983d.cjs");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-ee4a5d19.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;
|
package/lib/browser/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { B as i,
|
|
2
|
-
import { b as
|
|
1
|
+
import { B as i, x as m, C as c, R as g, w as p, S as l, T as C, A as d, p as B, I as S, D as f, q as u, E, G as R, F as h, c as x, j as k, y, z as F, H as P } from "./bundle-56e0b400.js";
|
|
2
|
+
import { b as w, F as A, c as I, S as T, V } from "./USE_CLIENT_BUNDLE-456ca2b5.js";
|
|
3
3
|
import "lru-cache";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "next/navigation";
|
|
7
|
-
import "./USE_SERVER_BUNDLE-
|
|
7
|
+
import "./USE_SERVER_BUNDLE-e0f1c15b.js";
|
|
8
8
|
export {
|
|
9
9
|
i as Blocks,
|
|
10
|
-
|
|
10
|
+
w as Button,
|
|
11
11
|
m as Columns,
|
|
12
12
|
c as Content,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
A as Fragment,
|
|
14
|
+
I as Image,
|
|
15
15
|
g as RenderBlocks,
|
|
16
16
|
p as RenderContent,
|
|
17
17
|
T as Section,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i, Fragment as h, jsxs as E } from "react/jsx-runtime";
|
|
3
|
-
import { i as p, g as D, a as $, b as O, c as w, d as R, e as ee, f as P, h as H, _ as V, j as te, l as ne, k as ie, m as U, n as
|
|
4
|
-
import { useRef as T, useState as x, useEffect as f, createContext as
|
|
5
|
-
import { p as
|
|
6
|
-
import { useRouter as
|
|
3
|
+
import { i as p, g as D, a as $, b as O, c as w, d as R, e as ee, f as P, h as H, _ as V, j as te, l as ne, k as ie, t as ae, m as U, n as ce, o as re, r as le, s as oe, p as de, q as se, u as ue } from "./bundle-4bf88f38.js";
|
|
4
|
+
import { useRef as T, useState as x, useEffect as f, createContext as me, createElement as ge } from "react";
|
|
5
|
+
import { p as be } from "./USE_SERVER_BUNDLE-dffaa191.js";
|
|
6
|
+
import { useRouter as he } from "next/navigation";
|
|
7
7
|
function J(e) {
|
|
8
8
|
return /* @__PURE__ */ i(h, { children: p(e.TagName) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(h, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function we(e) {
|
|
11
11
|
return /* @__PURE__ */ i(
|
|
12
12
|
J,
|
|
13
13
|
{
|
|
@@ -28,7 +28,7 @@ function Ce(e) {
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ee(e) {
|
|
32
32
|
return /* @__PURE__ */ i(
|
|
33
33
|
J,
|
|
34
34
|
{
|
|
@@ -49,7 +49,7 @@ function we(e) {
|
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function Ie(e) {
|
|
53
53
|
return /* @__PURE__ */ i(
|
|
54
54
|
e.Wrapper,
|
|
55
55
|
{
|
|
@@ -71,7 +71,7 @@ function Ee(e) {
|
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Re(e) {
|
|
75
75
|
function c() {
|
|
76
76
|
var l;
|
|
77
77
|
return "builder-blocks" + ((l = e.blocks) != null && l.length ? "" : " no-blocks");
|
|
@@ -124,10 +124,10 @@ function Ie(e) {
|
|
|
124
124
|
}` })
|
|
125
125
|
] });
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Pe(e) {
|
|
128
128
|
return /* @__PURE__ */ i("span", { children: e.children });
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Te(e) {
|
|
131
131
|
var l, u, S, y;
|
|
132
132
|
function c() {
|
|
133
133
|
var m;
|
|
@@ -210,7 +210,7 @@ function Pe(e) {
|
|
|
210
210
|
}` })
|
|
211
211
|
] });
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Ne(e) {
|
|
214
214
|
return /* @__PURE__ */ i(
|
|
215
215
|
"section",
|
|
216
216
|
{
|
|
@@ -231,7 +231,7 @@ function Te(e) {
|
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function Be(e) {
|
|
235
235
|
const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []);
|
|
236
236
|
return f(() => {
|
|
237
237
|
var y;
|
|
@@ -269,7 +269,7 @@ function Ne(e) {
|
|
|
269
269
|
}
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Le(e) {
|
|
273
273
|
const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []), [S, y] = x(() => !1);
|
|
274
274
|
function b() {
|
|
275
275
|
if (!c.current || !c.current.getElementsByTagName)
|
|
@@ -300,7 +300,7 @@ function Be(e) {
|
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function je(e) {
|
|
304
304
|
return /* @__PURE__ */ i(
|
|
305
305
|
"img",
|
|
306
306
|
{
|
|
@@ -315,7 +315,7 @@ function Le(e) {
|
|
|
315
315
|
w() && e.imgSrc || "default-key"
|
|
316
316
|
);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function We(e) {
|
|
319
319
|
var v, l, u, S, y, b, o;
|
|
320
320
|
function c() {
|
|
321
321
|
return {
|
|
@@ -416,7 +416,7 @@ function je(e) {
|
|
|
416
416
|
}
|
|
417
417
|
);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
419
|
+
const fe = me({
|
|
420
420
|
content: null,
|
|
421
421
|
context: {},
|
|
422
422
|
localState: void 0,
|
|
@@ -430,8 +430,8 @@ const he = ue({
|
|
|
430
430
|
BlocksWrapper: "div",
|
|
431
431
|
BlocksWrapperProps: {}
|
|
432
432
|
});
|
|
433
|
-
function
|
|
434
|
-
var W, F, K,
|
|
433
|
+
function Ae(e) {
|
|
434
|
+
var W, A, F, K, z, M, _;
|
|
435
435
|
const c = T(null), [s, v] = x(() => 0);
|
|
436
436
|
x(() => !0);
|
|
437
437
|
function l(t) {
|
|
@@ -457,7 +457,7 @@ function We(e) {
|
|
|
457
457
|
breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((q = (g = e.builderContextSignal.content) == null ? void 0 : g.meta) == null ? void 0 : q.breakpoints)
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
|
-
|
|
460
|
+
be({
|
|
461
461
|
value: n,
|
|
462
462
|
key: n.id
|
|
463
463
|
}).then(() => {
|
|
@@ -488,6 +488,10 @@ function We(e) {
|
|
|
488
488
|
}), v(s + 1);
|
|
489
489
|
break;
|
|
490
490
|
}
|
|
491
|
+
case "builder.triggerAnimation": {
|
|
492
|
+
ae(n.data);
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
491
495
|
case "builder.contentUpdate": {
|
|
492
496
|
const r = n.data, d = r.key || r.alias || r.entry || r.modelName, g = r.data;
|
|
493
497
|
d === e.model && (u(g), v(s + 1));
|
|
@@ -506,7 +510,7 @@ function We(e) {
|
|
|
506
510
|
rootSetState: e.builderContextSignal.rootSetState
|
|
507
511
|
});
|
|
508
512
|
}
|
|
509
|
-
const [C,
|
|
513
|
+
const [C, Se] = x(() => ({})), [N, G] = x(() => !1);
|
|
510
514
|
function Q(t) {
|
|
511
515
|
var n, a;
|
|
512
516
|
if (e.builderContextSignal.content) {
|
|
@@ -517,7 +521,7 @@ function We(e) {
|
|
|
517
521
|
contentId: d,
|
|
518
522
|
apiKey: e.apiKey,
|
|
519
523
|
variationId: r !== d ? r : void 0,
|
|
520
|
-
...
|
|
524
|
+
...ce(t),
|
|
521
525
|
unique: !N
|
|
522
526
|
});
|
|
523
527
|
}
|
|
@@ -536,7 +540,7 @@ function We(e) {
|
|
|
536
540
|
);
|
|
537
541
|
}
|
|
538
542
|
function Y({ url: t, key: n }) {
|
|
539
|
-
|
|
543
|
+
ue(t).then((a) => a.json()).then((a) => {
|
|
540
544
|
var d, g;
|
|
541
545
|
const r = {
|
|
542
546
|
...e.builderContextSignal.rootState,
|
|
@@ -566,7 +570,7 @@ function We(e) {
|
|
|
566
570
|
"builder:component:stateChange",
|
|
567
571
|
{
|
|
568
572
|
detail: {
|
|
569
|
-
state:
|
|
573
|
+
state: re(e.builderContextSignal.rootState),
|
|
570
574
|
ref: {
|
|
571
575
|
name: e.model
|
|
572
576
|
}
|
|
@@ -576,7 +580,7 @@ function We(e) {
|
|
|
576
580
|
);
|
|
577
581
|
}
|
|
578
582
|
function L(t) {
|
|
579
|
-
v(s + 1), window.addEventListener("message", m),
|
|
583
|
+
v(s + 1), window.addEventListener("message", m), le(), oe({
|
|
580
584
|
...e.locale ? {
|
|
581
585
|
locale: e.locale
|
|
582
586
|
} : {},
|
|
@@ -593,7 +597,7 @@ function We(e) {
|
|
|
593
597
|
e.builderContextSignal.componentInfos
|
|
594
598
|
).forEach((n) => {
|
|
595
599
|
var r;
|
|
596
|
-
const a =
|
|
600
|
+
const a = de(n);
|
|
597
601
|
(r = window.parent) == null || r.postMessage(a, "*");
|
|
598
602
|
}), window.addEventListener(
|
|
599
603
|
"builder:component:stateChangeListenerActivated",
|
|
@@ -604,7 +608,7 @@ function We(e) {
|
|
|
604
608
|
const n = new URL(location.href).searchParams, a = n.get("builder.preview"), r = n.get(
|
|
605
609
|
`builder.preview.${a}`
|
|
606
610
|
), d = n.get("apiKey") || n.get("builder.space");
|
|
607
|
-
a === e.model && d === e.apiKey && (!e.content || r === e.content.id) &&
|
|
611
|
+
a === e.model && d === e.apiKey && (!e.content || r === e.content.id) && se({
|
|
608
612
|
model: e.model,
|
|
609
613
|
apiKey: e.apiKey,
|
|
610
614
|
apiVersion: e.builderContextSignal.apiVersion
|
|
@@ -612,7 +616,7 @@ function We(e) {
|
|
|
612
616
|
g && u(g);
|
|
613
617
|
});
|
|
614
618
|
}
|
|
615
|
-
const Z =
|
|
619
|
+
const Z = he();
|
|
616
620
|
return f(() => {
|
|
617
621
|
var t;
|
|
618
622
|
return (t = c.current) == null || t.addEventListener(
|
|
@@ -661,9 +665,9 @@ function We(e) {
|
|
|
661
665
|
P() && (window.removeEventListener("message", m), window.addEventListener("message", m));
|
|
662
666
|
}, [S]), f(() => {
|
|
663
667
|
k();
|
|
664
|
-
}, [(
|
|
668
|
+
}, [(A = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : A.jsCode]), f(() => {
|
|
665
669
|
B();
|
|
666
|
-
}, [(
|
|
670
|
+
}, [(K = (F = e.builderContextSignal.content) == null ? void 0 : F.data) == null ? void 0 : K.httpRequests]), f(() => {
|
|
667
671
|
I();
|
|
668
672
|
}, [e.builderContextSignal.rootState]), f(() => {
|
|
669
673
|
e.data && l(e.data);
|
|
@@ -676,7 +680,7 @@ function We(e) {
|
|
|
676
680
|
"builder:component:stateChangeListenerActivated",
|
|
677
681
|
I
|
|
678
682
|
));
|
|
679
|
-
}, []), /* @__PURE__ */ i(
|
|
683
|
+
}, []), /* @__PURE__ */ i(fe.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ ge(
|
|
680
684
|
b,
|
|
681
685
|
{
|
|
682
686
|
key: s,
|
|
@@ -695,17 +699,17 @@ function We(e) {
|
|
|
695
699
|
) }) : null });
|
|
696
700
|
}
|
|
697
701
|
export {
|
|
698
|
-
|
|
699
|
-
|
|
702
|
+
Ee as B,
|
|
703
|
+
Be as C,
|
|
700
704
|
J as D,
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
705
|
+
Le as E,
|
|
706
|
+
Pe as F,
|
|
707
|
+
Ie as I,
|
|
708
|
+
Ne as S,
|
|
709
|
+
We as V,
|
|
710
|
+
Re as a,
|
|
711
|
+
we as b,
|
|
712
|
+
Te as c,
|
|
713
|
+
je as d,
|
|
714
|
+
Ae as e
|
|
711
715
|
};
|