@builder.io/sdk-react 2.0.24-0 → 2.0.24-2
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/blocks-exports.cjs +1 -1
- package/lib/browser/blocks-exports.mjs +1 -1
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-e7cbd2fc.js → server-entry-c147474a.js} +1 -1
- package/lib/browser/{server-entry-3855428f.cjs → server-entry-e66059f2.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-57df597a.js → accordion-5efe1f76.js} +1 -1
- package/lib/edge/{accordion-91147fe9.cjs → accordion-6cefa683.cjs} +1 -1
- package/lib/edge/{blocks-228052f4.js → blocks-47ceb648.js} +3 -3
- package/lib/edge/{blocks-2a92a0c1.cjs → blocks-ce41f8e2.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-ff78ab2a.cjs → button-375ad1e4.cjs} +1 -1
- package/lib/edge/{button-d681583e.js → button-68dc9c15.js} +2 -2
- package/lib/edge/{columns-354a8faf.cjs → columns-2ced7464.cjs} +1 -1
- package/lib/edge/{columns-59392fea.js → columns-fa195aa5.js} +4 -4
- package/lib/edge/{content-variants-f22b14d7.cjs → content-variants-12e2c711.cjs} +1 -1
- package/lib/edge/{content-variants-983cfed6.js → content-variants-b2ab5645.js} +11 -11
- package/lib/edge/{evaluate-f8347208.cjs → evaluate-71f3ff34.cjs} +1 -1
- package/lib/edge/{evaluate-b7da3191.js → evaluate-822680d7.js} +1 -1
- package/lib/edge/{form-52e60b8b.js → form-785f87de.js} +4 -4
- package/lib/edge/{form-2c8b99e2.cjs → form-eb6df3c0.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-956dc1ac.cjs → get-class-prop-name-20feabab.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-8c8a1b1c.js → get-class-prop-name-dba1cf23.js} +1 -1
- package/lib/edge/{img-ce324880.js → img-9409566a.js} +1 -1
- package/lib/edge/{img-9e702744.cjs → img-df10057c.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-c5dda333.js → input-175da017.js} +1 -1
- package/lib/edge/{input-09bbebbb.cjs → input-ad5251cd.cjs} +1 -1
- package/lib/edge/{select-235baf48.cjs → select-c59da945.cjs} +1 -1
- package/lib/edge/{select-8936ea79.js → select-e6904df2.js} +1 -1
- package/lib/edge/{server-entry-f0d7962f.cjs → server-entry-2d057cd0.cjs} +1 -1
- package/lib/edge/{server-entry-b3befa52.js → server-entry-7d728f1e.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-eb173f0a.cjs → slot-27d61c78.cjs} +1 -1
- package/lib/edge/{slot-f274570e.js → slot-a7fc3fa3.js} +4 -4
- package/lib/edge/{symbol-73a9d7cb.cjs → symbol-5cf11265.cjs} +1 -1
- package/lib/edge/{symbol-0deda8a7.js → symbol-d41cf7c4.js} +2 -2
- package/lib/edge/{tabs-4e5783b2.cjs → tabs-3a710ab1.cjs} +1 -1
- package/lib/edge/{tabs-791385cc.js → tabs-81ccc6f8.js} +4 -4
- package/lib/edge/{text-0a14d566.js → text-345dd047.js} +2 -2
- package/lib/edge/{text-3dd73c6e.cjs → text-59e297e6.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +21 -21
- package/lib/node/blocks-exports.mjs +7 -6
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +26 -25
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +7 -6
- package/lib/node/{server-entry-a7139d8f.cjs → server-entry-1c1c1459.cjs} +1 -1
- package/lib/node/{server-entry-fa11b353.js → server-entry-8956b57e.js} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-ddb84649.js → setIvm-2e562b9e.js} +41 -55
- package/lib/node/{should-force-browser-runtime-in-node-0bf7076b.cjs → setIvm-bf4f998d.cjs} +4 -4
- package/lib/node/setIvm.cjs +1 -0
- package/lib/node/setIvm.mjs +5 -0
- package/lib/node/should-force-browser-runtime-in-node-a23d3cc4.js +17 -0
- package/lib/node/should-force-browser-runtime-in-node-ce6ededa.cjs +1 -0
- package/package.json +6 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/evaluate/node-runtime/setIvm.d.ts +1 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),y=require("./server-entry-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),y=require("./server-entry-1c1c1459.cjs"),g=require("react"),V=require("./setIvm-bf4f998d.cjs"),Pe=require("./should-force-browser-runtime-in-node-ce6ededa.cjs"),Be=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Fe=e=>typeof e=="string"&&Be.has(e.toLowerCase());function Y(e){return a.jsx(a.Fragment,{children:Fe(e.TagName)?a.jsx(a.Fragment,{children:a.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):a.jsx(a.Fragment,{children:typeof e.TagName=="string"?a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const N=()=>{switch(y.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function le(e){function t(){return{...e.attributes,[N()]:`${e.link?"":"builder-button"} ${e.attributes[N()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return a.jsx(Y,{attributes:t(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const O=g.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{},nonce:""}),se=g.createContext({registeredComponents:{}});function Ve(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options}}function Ae(e,...t){const n=Object.assign({},e);for(const i of t)delete n[i];return n}const ce=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,r)=>o!=null?o[r]:o,e);return i===void 0||i===e?n:i},We=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:r,rootState:l})=>{const s=V.getFunctionArguments({builder:t,context:n,event:i,state:V.flattenState({rootState:l,localState:o,rootSetState:r})});return new Function(...s.map(([d])=>d),e)(...s.map(([,d])=>d))},Ne=e=>y.isBrowser()||Pe.shouldForceBrowserRuntimeInNode({shouldLogWarning:!0})?We(e):V.runInNode(e),$e=/^(return )?(\s*)?state(?<getPath>(\.\w+)+)(\s*);?$/,De=/(\s)*var(\s)+_virtual_index(\s)*=(\s)*state(?<getPath>(\.\w+)+)(\s*);?(\s)*return(\s)*_virtual_index(\s)*/,Le=e=>{var t,n,i,o,r,l;return((i=(n=(t=$e.exec(e.trim()))==null?void 0:t.groups)==null?void 0:n.getPath)==null?void 0:i.slice(1))||((l=(r=(o=De.exec(e.trim()))==null?void 0:o.groups)==null?void 0:r.getPath)==null?void 0:l.slice(1))};function A({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:r,isExpression:l=!0}){if(e.trim()==="")return;const s=Le(e.trim());if(s)return ce({...i,...n},s);const d={code:V.parseCode(e,{isExpression:l}),builder:V.getBuilderGlobals(),context:t,event:r,rootSetState:o,rootState:i,localState:n};try{return Ne(d)}catch(c){y.logger.error("Failed code evaluation: "+c.message,{code:e});return}}function J(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>J(n));if(e["@type"]==="@builder.io/sdk:Element")return e;const t={};for(const n in e)n!=="meta"&&Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=J(e[n]));return t}const Oe=["svelte","vue","angular","qwik","solid"].includes(y.TARGET),Ue=e=>{if(Oe){const t=V.fastClone(e);return{...t,properties:{...t.properties},actions:{...t.actions}}}else{const t=J(Ae(e,"children","meta"));return{...t,properties:{...t.properties},actions:{...t.actions},children:e.children,meta:e.meta}}},Me=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const r=Ue(e);for(const l in e.bindings){const s=e.bindings[l],d=A({code:s,localState:n,rootState:i,rootSetState:o,context:t});V.set(r,l,d)}return r};function _e({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:r}){const l=e;return n?Me({block:l,localState:i,rootState:o,rootSetState:r,context:t}):l}const U=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"";function He(e,t,n={}){let i,o,r,l=null,s=0;const d=function(){s=n.leading===!1?0:Date.now(),l=null,r=e.apply(i,o),l||(i=o=null)};return function(){const c=Date.now();!s&&n.leading===!1&&(s=c);const h=t-(c-s);return i=this,o=arguments,h<=0||h>t?(l&&(clearTimeout(l),l=null),s=c,r=e.apply(i,o),l||(i=o=null)):!l&&n.trailing!==!1&&(l=setTimeout(d,h)),r}}function W(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const o=arguments[i];if(o!=null)for(const r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])}return n}function qe(e){for(const t of e)switch(t.trigger){case"pageLoad":me(t);break;case"scrollInView":ze(t);break}}function de(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function ue(e,t){const n=Ke(e),i=getComputedStyle(t),o=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,l=[o,r];for(const s of l)for(const d of n)d in s||(s[d]=i[d])}function Ke(e){const t=[];for(const n of e.steps)for(const i in n.styles)t.indexOf(i)===-1&&t.push(i);return t}function me(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){de(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{ue(e,n),n.style.transition="none",n.style.transitionDelay="0",W(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${U(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),W(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function ze(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){de(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{ue(e,n);let i=!1,o=!1;function r(){!i&&s(n)?(i=!0,o=!0,setTimeout(()=>{W(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",l),setTimeout(()=>{o=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!o&&!s(n)&&(i=!1,W(n.style,e.steps[0].styles))}const l=He(r,200,{leading:!1});function s(h){const p=h.getBoundingClientRect(),f=window.innerHeight,b=(e.thresholdPercent||0)/100*f;return p.bottom>b&&p.top<f-b}const d=e.steps[0].styles;function c(){W(n.style,d)}c(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${U(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",l,{capture:!0,passive:!0}),r()})}const fe=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${U(n)}: ${i};`}).filter(y.checkIsDefined),Je=e=>fe(e).join(`
|
|
2
2
|
`),D=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
|
-
${
|
|
3
|
+
${Je(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
5
5
|
${i}
|
|
6
|
-
}`:i};function
|
|
6
|
+
}`:i};function Ge({style:e}){return e}const Ye=({block:e,context:t})=>ge(Ge({style:e.style||{},context:t,block:e}));function ge(e){switch(y.TARGET){case"svelte":case"vue":case"solid":case"angular":return fe(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const Qe=({block:e,registeredComponents:t})=>{var o;const n=(o=e.component)==null?void 0:o.name;if(!n)return null;const i=t[n];if(i)return i;console.warn(`
|
|
7
7
|
Could not find a registered component named "${n}".
|
|
8
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},Xe=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=A({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(o))return;const r=n.collection.split(".").pop(),l=n.itemName||(r?r+"Item":"item");return o.map((d,c)=>({context:{...t,localState:{...t.localState,$index:c,$item:d,[l]:d,[`$${l}Index`]:c}},block:i}))},Ze=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},et=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderComponents?{builderComponents:t}:{}},tt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},nt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},he={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},X=(e,t=he)=>`@media (max-width: ${t[e].max}px)`,be=({small:e,medium:t})=>{const n=V.fastClone(he);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n};function M(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function it(e){function t(){const i=e.block;return y.checkIsDefined(i.hide)?!i.hide:y.checkIsDefined(i.show)?i.show:!0}function n(){var S,R,I;const i=e.block,o=i.responsiveStyles,r=e.context.content,l=be(((S=r==null?void 0:r.meta)==null?void 0:S.breakpoints)||{}),s=o==null?void 0:o.large,d=o==null?void 0:o.medium,c=o==null?void 0:o.small,h=i.id;if(!h)return"";const p=s?D({className:h,styles:s}):"",f=d?D({className:h,styles:d,mediaQuery:X("medium",l)}):"",k=c?D({className:h,styles:c,mediaQuery:X("small",l)}):"",b=i.animations&&i.animations.find(T=>T.trigger==="hover");let C="";if(b){const T=((I=(R=b.steps)==null?void 0:R[1])==null?void 0:I.styles)||{};C=D({className:`${h}:hover`,styles:{...T,transition:`all ${b.duration}s ${U(b.easing)}`,transitionDelay:b.delay?`${b.delay}s`:"0s"}})||""}return[p,f,k,C].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(M,{id:"builderio-block",styles:n(),nonce:e.context.nonce})}):null})}function ot(e){return e.charAt(0).toUpperCase()+e.slice(1)}const at=e=>`on${ot(e)}`,rt=(e,t)=>n=>A({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function pe(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o];let l=at(o);if(e.stripPrefix)switch(y.TARGET){case"vue":l=l.replace("v-on:","");break;case"svelte":l=l.replace("on:","");break}t[l]=rt(r,e)}return t}function lt({properties:e}){return e}const st=e=>({href:e.href});function Q({block:e,context:t}){var i;const n={...st(e),...e.properties,"builder-id":e.id,style:Ye({block:e,context:t}),[N()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return lt({properties:n,context:t,block:e})}function ct(e){return a.jsx(Y,{TagName:e.Wrapper,attributes:Q({block:e.block,context:e.context}),actionAttributes:pe({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 dt(e){return g.useEffect(()=>{},[]),a.jsx(a.Fragment,{children:e.children})}function ut(e){function t(){return e.includeBlockProps?{...Q({block:e.block,context:e.context}),...pe({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return a.jsx(a.Fragment,{children:e.Wrapper.load?a.jsx(a.Fragment,{children:a.jsx(dt,{load:e.Wrapper.load,fallback:e.Wrapper.fallback,props:e.wrapperProps,attributes:t(),children:e.children})}):a.jsx(e.Wrapper,{...e.wrapperProps,attributes:t(),children:e.children})})}const mt=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:r,contextValue:l})=>{const s={...e,...o?{attributes:Q({block:t,context:l})}:{}};return r?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:s};function Z(e){var i;const[t,n]=g.useState(()=>e.isInteractive?ut:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...mt({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:(i=e.blockChildren)==null?void 0:i.map(o=>a.jsx($,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function ee(e){const[t,n]=g.useState(()=>e.repeatContext);return a.jsx(O.Provider,{value:t,children:a.jsx($,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function $(e){var h,p,f,k;function t(){return Xe({block:e.block,context:e.context})}const[n,i]=g.useState(()=>({value:null,update:!1}));function o(){var C;if(n.value&&!n.update&&!y.isPreviewing())return n.value;const b=(C=e.block.repeat)!=null&&C.collection?e.block:_e({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return n.value=b,n.update=!1,b}function r(){return Qe({block:o(),registeredComponents:e.registeredComponents})}function l(){var C;return e.block.tagName==="a"||((C=o().properties)==null?void 0:C.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"}function s(){var S,R;if((S=e.block.repeat)!=null&&S.collection)return!!((R=t==null?void 0:t())!=null&&R.length);const b="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!b}function d(){var C,S;return!((C=r==null?void 0:r())!=null&&C.component)&&!t()?(S=o().children)!=null?S:[]:[]}function c(){var b,C,S,R;return{blockChildren:(b=o().children)!=null?b:[],componentRef:(C=r==null?void 0:r())==null?void 0:C.component,componentOptions:{...Ve(o()),...tt(r(),o()),...nt(r(),e.context),...Ze(r(),e.linkComponent),...et(r(),e.registeredComponents)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((S=r==null?void 0:r())==null?void 0:S.noWrap)===!0,isInteractive:!((R=r==null?void 0:r())!=null&&R.isRSC&&y.TARGET==="rsc")}}return g.useEffect(()=>{const b=o().id,C=o().animations;C&&b&&qe(C.map(S=>({...S,elementId:b})))},[]),g.useEffect(()=>{n.update=!0}),a.jsx(a.Fragment,{children:s()?a.jsxs(a.Fragment,{children:[a.jsx(it,{block:o(),context:e.context}),(h=r==null?void 0:r())!=null&&h.noWrap?t()?a.jsx(a.Fragment,{children:(k=t())==null?void 0:k.map((b,C)=>a.jsx(ee,{repeatContext:b.context,block:b.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},C))}):a.jsx(Z,{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}):a.jsx(a.Fragment,{children:t()?a.jsx(a.Fragment,{children:(f=t())==null?void 0:f.map((b,C)=>a.jsx(ee,{repeatContext:b.context,block:b.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},C))}):a.jsxs(ct,{Wrapper:l(),block:o(),context:e.context,children:[a.jsx(Z,{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}),(p=d())==null?void 0:p.map(b=>a.jsx($,{block:b,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},b.id))]})})]}):null})}function ft(e){const t=g.useRef(null);function n(){var r;return["builder-blocks",(r=e.blocks)!=null&&r.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function i(){var r,l;y.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((l=window.parent)==null||l.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var r,l;y.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((l=window.parent)==null||l.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return g.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{ref:t,className:n()+" props-blocks-wrapper-43ec7ac8","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:r=>i(),onMouseEnter:r=>o(),onKeyPress:r=>i(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-43ec7ac8 {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
12
|
-
}`})]})}function F(e){var i,o,r;const t=g.useContext(O),n=g.useContext(se);return a.jsx(
|
|
12
|
+
}`})]})}function F(e){var i,o,r;const t=g.useContext(O),n=g.useContext(se);return a.jsx(ft,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,classNameProp:e.className,BlocksWrapper:((i=e.context)==null?void 0:i.BlocksWrapper)||t.BlocksWrapper,BlocksWrapperProps:((o=e.context)==null?void 0:o.BlocksWrapperProps)||t.BlocksWrapperProps,children:e.blocks?a.jsx(a.Fragment,{children:(r=e.blocks)==null?void 0:r.map(l=>a.jsx($,{block:l,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||n.registeredComponents},l.id))}):null})}const gt=e=>`builder-columns ${e}-breakpoints`;function xe(e){var T,B;const[t,n]=g.useState(()=>typeof e.space=="number"?e.space||0:20),[i,o]=g.useState(()=>e.columns||[]),[r,l]=g.useState(()=>e.stackColumnsAt||"tablet");function s(m){return m.link?e.builderLinkComponent||"a":"div"}function d(m){var v;return((v=i[m])==null?void 0:v.width)||100/i.length}function c(m){const v=d(m),w=t*(i.length-1)*(v/100);return`calc(${v}% - ${w}px)`}function h({stackedStyle:m,desktopStyle:v}){return r==="tablet"?m:v}function p({stackedStyle:m,desktopStyle:v}){return r==="never"?v:m}const[f,k]=g.useState(()=>e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column");function b(){return{"--flex-dir":f,"--flex-dir-tablet":h({stackedStyle:f,desktopStyle:"row"})}}function C(m){const v=m===0?0:t,w=c(m),u=`${v}px`,x="100%",E=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:w,["marginLeft"]:u,"--column-width-mobile":p({stackedStyle:x,desktopStyle:w}),"--column-margin-left-mobile":p({stackedStyle:E,desktopStyle:u}),"--column-width-tablet":h({stackedStyle:x,desktopStyle:w}),"--column-margin-left-tablet":h({stackedStyle:E,desktopStyle:u})}}function S(m){var w,u;return be(((u=(w=e.builderContext.content)==null?void 0:w.meta)==null?void 0:u.breakpoints)||{})[m].max}function R(){const m=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
|
|
13
13
|
@media (max-width: ${S("medium")}px) {
|
|
14
14
|
.${e.builderBlock.id}-breakpoints {
|
|
15
15
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
`}function I(m,v){return{...m.link?{href:m.link}:{},[N()]:"builder-column",style:ge(C(v))}}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:
|
|
36
|
+
`}function I(m,v){return{...m.link?{href:m.link}:{},[N()]:"builder-column",style:ge(C(v))}}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:gt((T=e.builderBlock)==null?void 0:T.id)+" div-3b0f6fe2",style:b(),children:[a.jsx(M,{id:"builderio-columns",styles:R(),nonce:e.builderContext.nonce}),(B=e.columns)==null?void 0:B.map((m,v)=>a.jsx(Y,{TagName:s(m),actionAttributes:{},attributes:I(m,v),children:a.jsx(F,{path:`component.options.columns.${v}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:m.blocks})},v))]}),a.jsx("style",{children:`.div-3b0f6fe2 {
|
|
37
37
|
display: flex;
|
|
38
38
|
line-height: normal;
|
|
39
|
-
}`})]})}function ye(e){return a.jsx("span",{children:e.children})}function te(e){return e.replace(/http(s)?:/,"")}function
|
|
39
|
+
}`})]})}function ye(e){return a.jsx("span",{children:e.children})}function te(e){return e.replace(/http(s)?:/,"")}function ht(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+o+t+"="+encodeURIComponent(n)}function bt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return te(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const i=e.split(n[0]),o=n[3],r=t.match("x")?t:`${t}x`;return te(`${i[0]}_${r}${o}`)}return null}function _(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const i=Number(e.split("?width=")[1]);return isNaN(i)||(n=`${n} ${i}w`),t.filter(o=>o!==i).map(o=>`${ht(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[bt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function ve(e){var o,r,l,s,d,c;function t(){var f;const p=e.image||e.src;if(!p||!(p.match(/builder\.io/)||p.match(/cdn\.shopify\.com/)))return e.srcset;if(!e.noWebp){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"),_(p)}else if(e.image&&!e.srcset)return _(p);return _(p)}}function n(){var h;return(h=t==null?void 0:t())!=null&&h.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const h={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?h:void 0}return g.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[a.jsxs(a.Fragment,{children:[a.jsxs("picture",{children:[n()?a.jsx("source",{type:"image/webp",srcSet:n()}):null,a.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...i()},className:"builder-image"+(e.className?" "+e.className:"")+" img-7a292ab8",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length&&e.fitContent)?a.jsx("div",{className:"builder-image-sizer div-7a292ab8",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(s=(l=e.builderBlock)==null?void 0:l.children)!=null&&s.length&&e.fitContent?a.jsx(a.Fragment,{children:e.children}):null,!e.fitContent&&((c=(d=e.builderBlock)==null?void 0:d.children)!=null&&c.length)?a.jsx("div",{className:"div-7a292ab8-2",children:e.children}):null]}),a.jsx("style",{children:`.img-7a292ab8 {
|
|
40
40
|
opacity: 1;
|
|
41
41
|
transition: opacity 0.2s ease-in-out;
|
|
42
42
|
}.div-7a292ab8 {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
left: 0;
|
|
53
53
|
width: 100%;
|
|
54
54
|
height: 100%;
|
|
55
|
-
}`})]})}function Se(e){return a.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})}const H={"@type":"@builder.io/sdk:Element",layerName:"Accordion item title",responsiveStyles:{large:{marginTop:"10px",position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"left",display:"flex",flexDirection:"column"}},component:{name:"Text",options:{text:"I am an accordion title. Click me!"}}}]},q={"@type":"@builder.io/sdk:Element",layerName:"Accordion item detail",responsiveStyles:{large:{position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",marginTop:"10px",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingTop:"50px",textAlign:"left",display:"flex",flexDirection:"column",paddingBottom:"50px"}},component:{name:"Text",options:{text:"I am an accordion detail, hello!"}}}]},bt={name:"Builder:Accordion",canHaveChildren:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",defaultStyles:{display:"flex",flexDirection:"column",alignItems:"stretch"},inputs:[{name:"items",type:"list",broadcast:!0,subFields:[{name:"title",type:"uiBlocks",hideFromUI:!0,defaultValue:[H]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[q]}],defaultValue:[{title:[H],detail:[q]},{title:[H],detail:[q]}],showIf:e=>!e.get("useChildrenForItems")},{name:"oneAtATime",helperText:"Only allow opening one at a time (collapse all others when new item openned)",type:"boolean",defaultValue:!1},{name:"grid",helperText:"Display as a grid",type:"boolean",defaultValue:!1},{name:"gridRowWidth",helperText:"Display as a grid",type:"string",showIf:e=>e.get("grid"),defaultValue:"25%"},{name:"useChildrenForItems",type:"boolean",helperText:"Use child elements for each slide, instead of the array. Useful for dynamically repeating items",advanced:!0,defaultValue:!1,onChange:e=>{e.get("useChildrenForItems")===!0&&e.set("items",[])}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},ne=e=>e.toString();function pt(e){var p;const[t,n]=g.useState(()=>[]);function i(){return!!(e.grid||e.oneAtATime)}function o(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...e.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function r(){const k={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(k).filter(([b,C])=>C!==void 0))}function l(f){return`builder-accordion-title builder-accordion-title-${t.includes(f)?"open":"closed"}`}function s(f){return`builder-accordion-detail builder-accordion-detail-${t.includes(f)?"open":"closed"}`}function d(){let f=null;if(e.grid&&t.length&&document){const b=t[0];let S=document.querySelector(`.builder-accordion-title[data-index="${b}"]`);if(f=b,S){let R=S.getBoundingClientRect();for(;S=S&&S.nextElementSibling;)if(S){if(S.classList.contains("builder-accordion-detail"))continue;const I=S.getBoundingClientRect();if(I.left>R.left){const T=parseInt(S.getAttribute("data-index")||"",10);isNaN(T)||(R=I,f=T)}else break}}}return typeof f=="number"&&(f=f+1),f}function c(){const f={order:typeof d()=="number"?d():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(f).filter(([k,b])=>b!==void 0))}function h(f){t.includes(f)?n(i()?[]:t.filter(k=>k!==f)):n(i()?[f]:t.concat(f))}return a.jsx("div",{className:"builder-accordion",style:o(),children:(p=e.items)==null?void 0:p.map((f,k)=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:l(k),style:{...r(),width:e.grid?e.gridRowWidth:void 0,order:d()!==null?ne(k):ne(k+1)},"data-index":k,onClick:b=>h(k),children:a.jsx(F,{blocks:f.title,path:`items.${k}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(k)?a.jsx("div",{className:s(k),style:c(),children:a.jsx(F,{blocks:f.detail,path:`items.${k}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]}))})}const xt={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,shouldReceiveBuilderProps:{builderLinkComponent:!0}},yt={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(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((s,d)=>s+d.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}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},vt={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},St={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","webp"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(l,s=6e4){return new Promise((d,c)=>{const h=document.createElement("img");let p=!1;h.onload=()=>{p=!0,d(h)},h.addEventListener("error",f=>{console.warn("Image load failed",f.error),c(f.error)}),h.src=l,setTimeout(()=>{p||c(new Error("Image load timed out"))},s)})}function i(l){return Math.round(l*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(l=>l.blob()).then(l=>{l.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(l=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&l.width&&l.height&&(e.set("aspectRatio",i(l.height/l.width)),e.set("height",l.height),e.set("width",l.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:"highPriority",type:"boolean",advanced:!0,helperText:"Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."},{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}],shouldReceiveBuilderProps:{builderBlock:!0}},kt={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>"}}}]},Ct={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"}],shouldReceiveBuilderProps:{builderContext:!0,builderComponents:!0}};function Tt(e){var t,n,i;return a.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:a.jsx(F,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,registeredComponents:e.builderComponents,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const It={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"}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},K={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px",minWidth:"100px",textAlign:"center",display:"flex",flexDirection:"column",cursor:"pointer",userSelect:"none"}},component:{name:"Text",options:{text:"New tab"}}},z={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},wt={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[K]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[z]}],defaultValue:[{label:[{...K,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...z,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...K,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...z,component:{name:"Text",options:{text:"Tab 2 content"}}}]}]},{name:"activeTabStyle",type:"uiStyle",helperText:"CSS styles for the active tab",defaultValue:{backgroundColor:"rgba(0, 0, 0, 0.1)"}},{name:"defaultActiveTab",type:"number",helperText:'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',defaultValue:1,advanced:!0},{name:"collapsible",type:"boolean",helperText:"If on, clicking an open tab closes it so no tabs are active",defaultValue:!1,advanced:!0},{name:"tabHeaderLayout",type:"enum",helperText:"Change the layout of the tab headers (uses justify-content)",defaultValue:"flex-start",enum:[{label:"Center",value:"center"},{label:"Space between",value:"space-between"},{label:"Space around",value:"space-around"},{label:"Left",value:"flex-start"},{label:"Right",value:"flex-end"}]}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}};function Et(e){var r;const[t,n]=g.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(l){return e.tabs&&e.tabs[l].content}function o(l){l===t&&e.collapsible?n(-1):n(l)}return a.jsxs("div",{children:[a.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(r=e.tabs)==null?void 0:r.map((l,s)=>a.jsx("span",{className:`builder-tab-wrap ${t===s?"builder-tab-active":""}`,style:{...t===s?e.activeTabStyle:{}},onClick:d=>o(s),children:a.jsx(F,{parent:e.builderBlock.id,path:`component.options.tabs.${s}.label`,blocks:l.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},s))}),i(t)?a.jsx("div",{children:a.jsx(F,{parent:e.builderBlock.id,path:`component.options.tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const Rt={shouldReceiveBuilderProps:{builderBlock:!1,builderContext:!0},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 ke(e){function t(){var s;const n=e.builderContext,{context:i,localState:o,rootState:r,rootSetState:l}=n;return String(((s=e.text)==null?void 0:s.toString())||"").replace(/{{([^}]+)}}/g,(d,c)=>A({code:c,context:i,localState:o,rootState:r,rootSetState:l}))}return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:t()},style:{outline:"none"}})}const 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}]};function Pt(e){const t=g.useRef(null),[n,i]=g.useState(()=>[]),[o,r]=g.useState(()=>[]);return g.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const l=t.current.getElementsByTagName("script");for(let d=0;d<l.length;d++){const c=l[d];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const h=document.createElement("script");h.async=!0,h.src=c.src,document.head.appendChild(h)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(o.includes(c.innerText))continue;try{o.push(c.innerText),new Function(c.innerText)()}catch(h){console.warn("`CustomCode`: Error running script:",h)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Bt={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc"},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},Ft=["text/javascript","application/javascript","application/ecmascript"],Vt=e=>Ft.includes(e.type);function At(e){const t=g.useRef(null),[n,i]=g.useState(()=>[]),[o,r]=g.useState(()=>[]),[l,s]=g.useState(()=>!1);function d(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let h=0;h<c.length;h++){const p=c[h];if(p.src&&!n.includes(p.src)){n.push(p.src);const f=document.createElement("script");f.async=!0,f.src=p.src,document.head.appendChild(f)}else if(Vt(p)&&!o.includes(p.innerText))try{o.push(p.innerText),new Function(p.innerText)()}catch(f){console.warn("`Embed`: Error running script:",f)}}}return g.useEffect(()=>{t.current&&!l&&(s(!0),d())},[t.current,l]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Wt={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Nt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],$t=()=>{const e=process.env.NODE_ENV||"production";return Nt.includes(e)?e:"production"};function Dt(e){var p,f;const t=g.useRef(null),[n,i]=g.useState(()=>"unsubmitted"),[o,r]=g.useState(()=>null),[l,s]=g.useState(()=>"");function d(k){var C,S;const b={...e.builderContext.rootState,...k};e.builderContext.rootSetState?(S=(C=e.builderContext).rootSetState)==null||S.call(C,b):e.builderContext.rootState=b}function c(){return y.isEditing()&&e.previewState||n}function h(k){var C;const b=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")k.preventDefault();else if(b){if(!(e.action||e.sendSubmissionsTo==="email")){k.preventDefault();return}k.preventDefault();const S=k.currentTarget||k.target,R=e.customHeaders||{};let I;const T=new FormData(S),B=Array.from(S.querySelectorAll("input,select,textarea")).filter(u=>!!u.name).map(u=>{let x;const E=u.name;if(u instanceof HTMLInputElement)if(u.type==="radio"){if(u.checked)return x=u.name,{key:E,value:x}}else if(u.type==="checkbox")x=u.checked;else if(u.type==="number"||u.type==="range"){const j=u.valueAsNumber;isNaN(j)||(x=j)}else u.type==="file"?x=u.files:x=u.value;else x=u.value;return{key:E,value:x}});let m=e.contentType;if(e.sendSubmissionsTo==="email"&&(m="multipart/form-data"),Array.from(B).forEach(({value:u})=>{(u instanceof File||Array.isArray(u)&&u[0]instanceof File||u instanceof FileList)&&(m="multipart/form-data")}),m!=="application/json")I=T;else{const u={};Array.from(B).forEach(({value:x,key:E})=>{V.set(u,E,x)}),I=JSON.stringify(u)}m&&m!=="multipart/form-data"&&(b&&((C=e.action)!=null&&C.includes("zapier.com"))||(R["content-type"]=m));const v=new CustomEvent("presubmit",{detail:{body:I}});if(t.current&&(t.current.dispatchEvent(v),v.defaultPrevented))return;i("sending");const w=`${$t()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?w:e.action,{body:I,headers:R,method:e.method||"post"}).then(async u=>{let x;const E=u.headers.get("content-type");if(E&&E.indexOf("application/json")!==-1?x=await u.json():x=await u.text(),!u.ok&&e.errorMessagePath){let j=ce(x,e.errorMessagePath);j&&(typeof j!="string"&&(j=JSON.stringify(j)),s(j),d({formErrorMessage:j}))}if(r(x),i(u.ok?"success":"error"),u.ok){const j=new CustomEvent("submit:success",{detail:{res:u,body:x}});if(t.current){if(t.current.dispatchEvent(j),j.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const P=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(P),P.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},u=>{const x=new CustomEvent("submit:error",{detail:{error:u}});t.current&&(t.current.dispatchEvent(x),x.defaultPrevented)||(r(u),i("error"))})}}return a.jsxs(a.Fragment,{children:[" ",a.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:k=>h(k),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?a.jsx(a.Fragment,{children:(f=(p=e.builderBlock)==null?void 0:p.children)==null?void 0:f.map((k,b)=>a.jsx($,{block:k,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${b}`))}):null,c()==="error"?a.jsx(F,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?a.jsx(F,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&o?a.jsx("pre",{className:"builder-form-error-text pre-3a20f614",children:JSON.stringify(o,null,2)}):null,c()==="success"?a.jsx(F,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-3a20f614 { padding: 10px; color: red; text-align: center; }"})," "]})}const Lt={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}};function Ot(e){return g.createElement("input",{...e.attributes,key:y.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Ut={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0};function Mt(e){var t;return g.createElement("select",{...e.attributes,value:e.value,key:y.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name,required:e.required},(t=e.options)==null?void 0:t.map((n,i)=>a.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const _t={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0};function Ht(e){return a.jsx("button",{type:"submit",...e.attributes,children:e.text})}const qt={name:"Form:TextArea",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",inputs:[{advanced:!0,name:"value",type:"string"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"placeholder",type:"string",defaultValue:"Hello there"},{name:"required",type:"boolean",defaultValue:!1}],defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"},static:!0,noWrap:!0};function Kt(e){return a.jsx("textarea",{...e.attributes,placeholder:e.placeholder,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const zt={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};function Jt(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},y.isEditing()&&e.imgSrc||"default-key")}const Gt={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://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",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}],shouldReceiveBuilderProps:{builderBlock:!0}};function Ce(e){var i,o,r,l,s,d,c;function t(){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 n(){return{...t()}}return a.jsxs("div",{style:{position:"relative"},children:[a.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.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:a.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(s=(l=e.builderBlock)==null?void 0:l.children)!=null&&s.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(c=(d=e.builderBlock)==null?void 0:d.children)!=null&&c.length&&!e.fitContent?a.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 Yt=()=>[{component:Pt,...jt},{component:At,...Bt},{component:Dt,...Wt},{component:Ot,...Lt},{component:Ht,..._t},{component:Mt,...Ut},{component:Kt,...qt},{component:Jt,...zt},{component:Ce,...Gt}],ie=()=>[{component:le,...xt},{component:xe,...yt},{component:ye,...vt},{component:ve,...St},{component:Se,...kt},{component:Tt,...Ct},{component:Re,...It},{component:ke,...Rt},{component:Et,...wt},{component:pt,...bt},...Yt()],Qt=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
55
|
+
}`})]})}function Se(e){return a.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})}const H={"@type":"@builder.io/sdk:Element",layerName:"Accordion item title",responsiveStyles:{large:{marginTop:"10px",position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{textAlign:"left",display:"flex",flexDirection:"column"}},component:{name:"Text",options:{text:"I am an accordion title. Click me!"}}}]},q={"@type":"@builder.io/sdk:Element",layerName:"Accordion item detail",responsiveStyles:{large:{position:"relative",display:"flex",alignItems:"stretch",flexDirection:"column",marginTop:"10px",paddingBottom:"10px"}},children:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingTop:"50px",textAlign:"left",display:"flex",flexDirection:"column",paddingBottom:"50px"}},component:{name:"Text",options:{text:"I am an accordion detail, hello!"}}}]},pt={name:"Builder:Accordion",canHaveChildren:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",defaultStyles:{display:"flex",flexDirection:"column",alignItems:"stretch"},inputs:[{name:"items",type:"list",broadcast:!0,subFields:[{name:"title",type:"uiBlocks",hideFromUI:!0,defaultValue:[H]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[q]}],defaultValue:[{title:[H],detail:[q]},{title:[H],detail:[q]}],showIf:e=>!e.get("useChildrenForItems")},{name:"oneAtATime",helperText:"Only allow opening one at a time (collapse all others when new item openned)",type:"boolean",defaultValue:!1},{name:"grid",helperText:"Display as a grid",type:"boolean",defaultValue:!1},{name:"gridRowWidth",helperText:"Display as a grid",type:"string",showIf:e=>e.get("grid"),defaultValue:"25%"},{name:"useChildrenForItems",type:"boolean",helperText:"Use child elements for each slide, instead of the array. Useful for dynamically repeating items",advanced:!0,defaultValue:!1,onChange:e=>{e.get("useChildrenForItems")===!0&&e.set("items",[])}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},ne=e=>e.toString();function xt(e){var p;const[t,n]=g.useState(()=>[]);function i(){return!!(e.grid||e.oneAtATime)}function o(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...e.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function r(){const k={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(k).filter(([b,C])=>C!==void 0))}function l(f){return`builder-accordion-title builder-accordion-title-${t.includes(f)?"open":"closed"}`}function s(f){return`builder-accordion-detail builder-accordion-detail-${t.includes(f)?"open":"closed"}`}function d(){let f=null;if(e.grid&&t.length&&document){const b=t[0];let S=document.querySelector(`.builder-accordion-title[data-index="${b}"]`);if(f=b,S){let R=S.getBoundingClientRect();for(;S=S&&S.nextElementSibling;)if(S){if(S.classList.contains("builder-accordion-detail"))continue;const I=S.getBoundingClientRect();if(I.left>R.left){const T=parseInt(S.getAttribute("data-index")||"",10);isNaN(T)||(R=I,f=T)}else break}}}return typeof f=="number"&&(f=f+1),f}function c(){const f={order:typeof d()=="number"?d():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(f).filter(([k,b])=>b!==void 0))}function h(f){t.includes(f)?n(i()?[]:t.filter(k=>k!==f)):n(i()?[f]:t.concat(f))}return a.jsx("div",{className:"builder-accordion",style:o(),children:(p=e.items)==null?void 0:p.map((f,k)=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:l(k),style:{...r(),width:e.grid?e.gridRowWidth:void 0,order:d()!==null?ne(k):ne(k+1)},"data-index":k,onClick:b=>h(k),children:a.jsx(F,{blocks:f.title,path:`items.${k}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(k)?a.jsx("div",{className:s(k),style:c(),children:a.jsx(F,{blocks:f.detail,path:`items.${k}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]}))})}const yt={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,shouldReceiveBuilderProps:{builderLinkComponent:!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(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((s,d)=>s+d.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}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},St={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},kt={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","webp"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(l,s=6e4){return new Promise((d,c)=>{const h=document.createElement("img");let p=!1;h.onload=()=>{p=!0,d(h)},h.addEventListener("error",f=>{console.warn("Image load failed",f.error),c(f.error)}),h.src=l,setTimeout(()=>{p||c(new Error("Image load timed out"))},s)})}function i(l){return Math.round(l*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(l=>l.blob()).then(l=>{l.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(l=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&l.width&&l.height&&(e.set("aspectRatio",i(l.height/l.width)),e.set("height",l.height),e.set("width",l.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:"highPriority",type:"boolean",advanced:!0,helperText:"Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."},{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}],shouldReceiveBuilderProps:{builderBlock:!0}},Ct={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>"}}}]},Tt={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"}],shouldReceiveBuilderProps:{builderContext:!0,builderComponents:!0}};function It(e){var t,n,i;return a.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:a.jsx(F,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,registeredComponents:e.builderComponents,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const wt={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"}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},K={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px",minWidth:"100px",textAlign:"center",display:"flex",flexDirection:"column",cursor:"pointer",userSelect:"none"}},component:{name:"Text",options:{text:"New tab"}}},z={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},Et={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[K]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[z]}],defaultValue:[{label:[{...K,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...z,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...K,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...z,component:{name:"Text",options:{text:"Tab 2 content"}}}]}]},{name:"activeTabStyle",type:"uiStyle",helperText:"CSS styles for the active tab",defaultValue:{backgroundColor:"rgba(0, 0, 0, 0.1)"}},{name:"defaultActiveTab",type:"number",helperText:'Default tab to open to. Set to "1" for the first tab, "2" for the second, or choose "0" for none',defaultValue:1,advanced:!0},{name:"collapsible",type:"boolean",helperText:"If on, clicking an open tab closes it so no tabs are active",defaultValue:!1,advanced:!0},{name:"tabHeaderLayout",type:"enum",helperText:"Change the layout of the tab headers (uses justify-content)",defaultValue:"flex-start",enum:[{label:"Center",value:"center"},{label:"Space between",value:"space-between"},{label:"Space around",value:"space-around"},{label:"Left",value:"flex-start"},{label:"Right",value:"flex-end"}]}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}};function Rt(e){var r;const[t,n]=g.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(l){return e.tabs&&e.tabs[l].content}function o(l){l===t&&e.collapsible?n(-1):n(l)}return a.jsxs("div",{children:[a.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(r=e.tabs)==null?void 0:r.map((l,s)=>a.jsx("span",{className:`builder-tab-wrap ${t===s?"builder-tab-active":""}`,style:{...t===s?e.activeTabStyle:{}},onClick:d=>o(s),children:a.jsx(F,{parent:e.builderBlock.id,path:`component.options.tabs.${s}.label`,blocks:l.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},s))}),i(t)?a.jsx("div",{children:a.jsx(F,{parent:e.builderBlock.id,path:`component.options.tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const jt={shouldReceiveBuilderProps:{builderBlock:!1,builderContext:!0},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 ke(e){function t(){var s;const n=e.builderContext,{context:i,localState:o,rootState:r,rootSetState:l}=n;return String(((s=e.text)==null?void 0:s.toString())||"").replace(/{{([^}]+)}}/g,(d,c)=>A({code:c,context:i,localState:o,rootState:r,rootSetState:l}))}return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:t()},style:{outline:"none"}})}const Pt={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}]};function Bt(e){const t=g.useRef(null),[n,i]=g.useState(()=>[]),[o,r]=g.useState(()=>[]);return g.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const l=t.current.getElementsByTagName("script");for(let d=0;d<l.length;d++){const c=l[d];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const h=document.createElement("script");h.async=!0,h.src=c.src,document.head.appendChild(h)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(o.includes(c.innerText))continue;try{o.push(c.innerText),new Function(c.innerText)()}catch(h){console.warn("`CustomCode`: Error running script:",h)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Ft={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc"},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},Vt=["text/javascript","application/javascript","application/ecmascript"],At=e=>Vt.includes(e.type);function Wt(e){const t=g.useRef(null),[n,i]=g.useState(()=>[]),[o,r]=g.useState(()=>[]),[l,s]=g.useState(()=>!1);function d(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let h=0;h<c.length;h++){const p=c[h];if(p.src&&!n.includes(p.src)){n.push(p.src);const f=document.createElement("script");f.async=!0,f.src=p.src,document.head.appendChild(f)}else if(At(p)&&!o.includes(p.innerText))try{o.push(p.innerText),new Function(p.innerText)()}catch(f){console.warn("`Embed`: Error running script:",f)}}}return g.useEffect(()=>{t.current&&!l&&(s(!0),d())},[t.current,l]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Nt={name:"Form:Form",defaults:{responsiveStyles:{large:{marginTop:"15px",paddingBottom:"15px"}}},image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",inputs:[{name:"sendSubmissionsTo",type:"string",enum:[{label:"Send to email",value:"email",helperText:"Send form submissions to the email address of your choosing"},{label:"Custom",value:"custom",helperText:"Handle where the form requests go manually with a little code, e.g. to your own custom backend"}],defaultValue:"email"},{name:"sendSubmissionsToEmail",type:"string",required:!0,defaultValue:"your@email.com",showIf:'options.get("sendSubmissionsTo") === "email"'},{name:"sendWithJs",type:"boolean",helperText:"Set to false to use basic html form action",defaultValue:!0,showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"name",type:"string",defaultValue:"My form"},{name:"action",type:"string",helperText:"URL to send the form data to",showIf:'options.get("sendSubmissionsTo") === "custom"'},{name:"contentType",type:"string",defaultValue:"application/json",advanced:!0,enum:["application/json","multipart/form-data","application/x-www-form-urlencoded"],showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'},{name:"method",type:"string",showIf:'options.get("sendSubmissionsTo") === "custom"',defaultValue:"POST",advanced:!0},{name:"previewState",type:"string",enum:["unsubmitted","sending","success","error"],defaultValue:"unsubmitted",helperText:'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"successUrl",type:"url",helperText:"Optional URL to redirect the user to on form submission success",showIf:'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'},{name:"resetFormOnSubmit",type:"boolean",showIf:"options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",advanced:!0},{name:"successMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Thanks!</span>"}}}]},{name:"validate",type:"boolean",defaultValue:!0,advanced:!0},{name:"errorMessagePath",type:"text",advanced:!0,helperText:'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'},{name:"errorMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},bindings:{"component.options.text":"state.formErrorMessage || block.component.options.text"},component:{name:"Text",options:{text:"<span>Form submission error :( Please check your answers and try again</span>"}}}]},{name:"sendingMessage",type:"uiBlocks",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Sending...</span>"}}}]},{name:"customHeaders",type:"map",valueType:{type:"string"},advanced:!0,showIf:'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'}],noWrap:!0,canHaveChildren:!0,defaultChildren:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your name</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"name",placeholder:"Jane Doe"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Text",options:{text:"<span>Enter your email</span>"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:Input",options:{name:"email",placeholder:"jane@doe.com"}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{marginTop:"10px"}},component:{name:"Form:SubmitButton",options:{text:"Submit"}}}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},$t=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Dt=()=>{const e=process.env.NODE_ENV||"production";return $t.includes(e)?e:"production"};function Lt(e){var p,f;const t=g.useRef(null),[n,i]=g.useState(()=>"unsubmitted"),[o,r]=g.useState(()=>null),[l,s]=g.useState(()=>"");function d(k){var C,S;const b={...e.builderContext.rootState,...k};e.builderContext.rootSetState?(S=(C=e.builderContext).rootSetState)==null||S.call(C,b):e.builderContext.rootState=b}function c(){return y.isEditing()&&e.previewState||n}function h(k){var C;const b=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")k.preventDefault();else if(b){if(!(e.action||e.sendSubmissionsTo==="email")){k.preventDefault();return}k.preventDefault();const S=k.currentTarget||k.target,R=e.customHeaders||{};let I;const T=new FormData(S),B=Array.from(S.querySelectorAll("input,select,textarea")).filter(u=>!!u.name).map(u=>{let x;const E=u.name;if(u instanceof HTMLInputElement)if(u.type==="radio"){if(u.checked)return x=u.name,{key:E,value:x}}else if(u.type==="checkbox")x=u.checked;else if(u.type==="number"||u.type==="range"){const j=u.valueAsNumber;isNaN(j)||(x=j)}else u.type==="file"?x=u.files:x=u.value;else x=u.value;return{key:E,value:x}});let m=e.contentType;if(e.sendSubmissionsTo==="email"&&(m="multipart/form-data"),Array.from(B).forEach(({value:u})=>{(u instanceof File||Array.isArray(u)&&u[0]instanceof File||u instanceof FileList)&&(m="multipart/form-data")}),m!=="application/json")I=T;else{const u={};Array.from(B).forEach(({value:x,key:E})=>{V.set(u,E,x)}),I=JSON.stringify(u)}m&&m!=="multipart/form-data"&&(b&&((C=e.action)!=null&&C.includes("zapier.com"))||(R["content-type"]=m));const v=new CustomEvent("presubmit",{detail:{body:I}});if(t.current&&(t.current.dispatchEvent(v),v.defaultPrevented))return;i("sending");const w=`${Dt()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?w:e.action,{body:I,headers:R,method:e.method||"post"}).then(async u=>{let x;const E=u.headers.get("content-type");if(E&&E.indexOf("application/json")!==-1?x=await u.json():x=await u.text(),!u.ok&&e.errorMessagePath){let j=ce(x,e.errorMessagePath);j&&(typeof j!="string"&&(j=JSON.stringify(j)),s(j),d({formErrorMessage:j}))}if(r(x),i(u.ok?"success":"error"),u.ok){const j=new CustomEvent("submit:success",{detail:{res:u,body:x}});if(t.current){if(t.current.dispatchEvent(j),j.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const P=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(P),P.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},u=>{const x=new CustomEvent("submit:error",{detail:{error:u}});t.current&&(t.current.dispatchEvent(x),x.defaultPrevented)||(r(u),i("error"))})}}return a.jsxs(a.Fragment,{children:[" ",a.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:k=>h(k),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?a.jsx(a.Fragment,{children:(f=(p=e.builderBlock)==null?void 0:p.children)==null?void 0:f.map((k,b)=>a.jsx($,{block:k,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${b}`))}):null,c()==="error"?a.jsx(F,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?a.jsx(F,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&o?a.jsx("pre",{className:"builder-form-error-text pre-3a20f614",children:JSON.stringify(o,null,2)}):null,c()==="success"?a.jsx(F,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-3a20f614 { padding: 10px; color: red; text-align: center; }"})," "]})}const Ot={name:"Form:Input",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",inputs:[{name:"type",type:"text",enum:["text","number","email","url","checkbox","radio","range","date","datetime-local","search","tel","time","file","month","week","password","color","hidden"],defaultValue:"text"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it takes, e.g. "email"'},{name:"placeholder",type:"string",defaultValue:"Hello there",helperText:"Text to display when there is no value"},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",helperText:"Is this input required to be filled out to submit a form",defaultValue:!1}],noWrap:!0,static:!0,defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"}};function Ut(e){return g.createElement("input",{...e.attributes,key:y.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Mt={name:"Form:Select",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",defaultStyles:{alignSelf:"flex-start"},inputs:[{name:"options",type:"list",required:!0,subFields:[{name:"value",type:"text",required:!0},{name:"name",type:"text"}],defaultValue:[{value:"option 1"},{value:"option 2"}]},{name:"name",type:"string",required:!0,helperText:'Every select in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"value",type:"string",advanced:!0},{name:"required",type:"boolean",defaultValue:!1}],static:!0,noWrap:!0};function _t(e){var t;return g.createElement("select",{...e.attributes,value:e.value,key:y.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name,required:e.required},(t=e.options)==null?void 0:t.map((n,i)=>a.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const Ht={name:"Form:SubmitButton",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#3898EC",color:"white",borderRadius:"4px",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me"}],static:!0,noWrap:!0};function qt(e){return a.jsx("button",{type:"submit",...e.attributes,children:e.text})}const Kt={name:"Form:TextArea",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",inputs:[{advanced:!0,name:"value",type:"string"},{name:"name",type:"string",required:!0,helperText:'Every input in a form needs a unique name describing what it gets, e.g. "email"'},{name:"defaultValue",type:"string"},{name:"placeholder",type:"string",defaultValue:"Hello there"},{name:"required",type:"boolean",defaultValue:!1}],defaultStyles:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",borderRadius:"3px",borderWidth:"1px",borderStyle:"solid",borderColor:"#ccc"},static:!0,noWrap:!0};function zt(e){return a.jsx("textarea",{...e.attributes,placeholder:e.placeholder,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const Jt={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};function Gt(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},y.isEditing()&&e.imgSrc||"default-key")}const Yt={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://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",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}],shouldReceiveBuilderProps:{builderBlock:!0}};function Ce(e){var i,o,r,l,s,d,c;function t(){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 n(){return{...t()}}return a.jsxs("div",{style:{position:"relative"},children:[a.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.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:a.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(s=(l=e.builderBlock)==null?void 0:l.children)!=null&&s.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(c=(d=e.builderBlock)==null?void 0:d.children)!=null&&c.length&&!e.fitContent?a.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 Qt=()=>[{component:Bt,...Pt},{component:Wt,...Ft},{component:Lt,...Nt},{component:Ut,...Ot},{component:qt,...Ht},{component:_t,...Mt},{component:zt,...Kt},{component:Gt,...Jt},{component:Ce,...Yt}],ie=()=>[{component:le,...yt},{component:xe,...vt},{component:ye,...St},{component:ve,...kt},{component:Se,...Ct},{component:It,...Tt},{component:Re,...wt},{component:ke,...jt},{component:Rt,...Et},{component:xt,...pt},...Qt()],Xt=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
56
56
|
function getAndSetVariantId() {
|
|
57
57
|
function setCookie(name, value, days) {
|
|
58
58
|
let expires = '';
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}).join('');
|
|
109
109
|
styleEl.innerHTML = newStyleStr;
|
|
110
110
|
}
|
|
111
|
-
}`,
|
|
111
|
+
}`,Zt=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
112
112
|
if (!navigator.cookieEnabled) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
@@ -142,15 +142,15 @@
|
|
|
142
142
|
thisScriptEl?.remove();
|
|
143
143
|
}
|
|
144
144
|
return;
|
|
145
|
-
}`,Te="builderIoAbTest",Ie="builderIoRenderContent",L=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),
|
|
146
|
-
window.${Te} = ${
|
|
147
|
-
window.${Ie} = ${
|
|
148
|
-
`,
|
|
145
|
+
}`,Te="builderIoAbTest",Ie="builderIoRenderContent",L=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),en=({canTrack:e,content:t})=>!(!(L(t).length>0)||!e||y.isBrowser()),tn=e=>e==="react"||e==="reactNative",we=tn(y.TARGET),nn=()=>`
|
|
146
|
+
window.${Te} = ${Xt}
|
|
147
|
+
window.${Ie} = ${Zt}
|
|
148
|
+
`,on=(e,t)=>`
|
|
149
149
|
window.${Te}(
|
|
150
150
|
"${t}",${JSON.stringify(e)}, ${we}
|
|
151
|
-
)`,
|
|
151
|
+
)`,an=({contentId:e,variationId:t})=>`window.${Ie}(
|
|
152
152
|
"${t}", "${e}", ${we}
|
|
153
|
-
)`;function G(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function oe(e){return Math.round(e*1e3)/1e3}const
|
|
153
|
+
)`;function G(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function oe(e){return Math.round(e*1e3)/1e3}const rn=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let i=n?e:e.parentElement;do{if(!i)return null;if(t(i))return i}while(i=i.parentElement);return null},ln=e=>rn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ae=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,r=oe(i/n.width),l=oe(o/n.height);return{x:r,y:l}},sn=e=>{const t=e.target,n=t&&ln(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?ae({event:e,target:t}):void 0,builderTargetOffset:n?ae({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}},cn=e=>{var r,l;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(l=e.fileUrl)!=null?l:(r=e==null?void 0:e.files)==null?void 0:r.regular;let o="";if(i&&t&&n&&(o+=`
|
|
154
154
|
@font-face {
|
|
155
155
|
font-family: "${t}";
|
|
156
156
|
src: local("${n}"), url('${i}') format('woff2');
|
|
@@ -164,7 +164,7 @@ src: url('${c}') format('woff2');
|
|
|
164
164
|
font-display: fallback;
|
|
165
165
|
font-weight: ${s};
|
|
166
166
|
}
|
|
167
|
-
`.trim())}return o},
|
|
167
|
+
`.trim())}return o},dn=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>cn(n)))==null?void 0:t.join(" "))||""},un=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",mn=`
|
|
168
168
|
.builder-button {
|
|
169
169
|
all: unset;
|
|
170
170
|
}
|
|
@@ -181,8 +181,8 @@ font-weight: ${s};
|
|
|
181
181
|
text-align: inherit;
|
|
182
182
|
font-family: inherit;
|
|
183
183
|
}
|
|
184
|
-
`,
|
|
185
|
-
${
|
|
186
|
-
${
|
|
187
|
-
${
|
|
188
|
-
`.trim());return a.jsx(M,{id:"builderio-content",styles:t,nonce:e.nonce})}const
|
|
184
|
+
`,fn=e=>e?"":mn,gn=e=>`variant-${e}`;function hn(e){var I,T,B;const t=g.useRef(null);function n(m){var w,u;const v={...e.builderContextSignal.rootState,...m};e.builderContextSignal.rootSetState?(u=(w=e.builderContextSignal).rootSetState)==null||u.call(w,v):e.setBuilderContextSignal(x=>({...x,rootState:v}))}function i(m){var w,u,x,E,j;const v={...e.builderContextSignal.content,...m,data:{...(w=e.builderContextSignal.content)==null?void 0:w.data,...m==null?void 0:m.data},meta:{...(u=e.builderContextSignal.content)==null?void 0:u.meta,...m==null?void 0:m.meta,breakpoints:((x=m==null?void 0:m.meta)==null?void 0:x.breakpoints)||((j=(E=e.builderContextSignal.content)==null?void 0:E.meta)==null?void 0:j.breakpoints)}};e.setBuilderContextSignal(P=>({...P,content:v}))}function o(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[r,l]=g.useState(()=>e.contentWrapper||"div");function s(m){return y.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:v=>{var x;const{breakpoints:w,contentId:u}=v;!u||u!==((x=e.builderContextSignal.content)==null?void 0:x.id)||w&&i({meta:{breakpoints:w}})},animation:v=>{me(v)},contentUpdate:v=>{i(v)}}})(m)}const[d,c]=g.useState(()=>({})),[h,p]=g.useState(()=>({})),[f,k]=g.useState(()=>!1);function b(m){var v,w;if(e.builderContextSignal.content){const u=(v=e.builderContextSignal.content)==null?void 0:v.testVariationId,x=(w=e.builderContextSignal.content)==null?void 0:w.id;y._track({type:"click",canTrack:y.getDefaultCanTrack(e.canTrack),contentId:x,apiKey:e.apiKey,variationId:u!==x?u:void 0,...sn(m),unique:!f})}f||k(!0)}function C(){var v,w,u;const m=(u=(w=(v=e.builderContextSignal.content)==null?void 0:v.data)==null?void 0:w.httpRequests)!=null?u:{};Object.entries(m).forEach(([x,E])=>{if(!E||h[x]||d[x]&&!y.isEditing())return;h[x]=!0;const j=E.replace(/{{([^}]+)}}/g,(P,je)=>String(A({code:je,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));fetch(j).then(P=>P.json()).then(P=>{n({[x]:P}),d[x]=!0}).catch(P=>{console.error("error fetching dynamic data",E,P)}).finally(()=>{h[x]=!1})})}function S(){y.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:V.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const R=g.useRef(!1);return R.current||(C(),S(),R.current=!0),g.useEffect(()=>{var m,v;if(y.isBrowser()){if(y.isEditing()&&(window.addEventListener("message",s),y.registerInsertMenu(),y.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(u=>{var E;const x=y.createRegisterComponentMessage(u);(E=window.parent)==null||E.postMessage(x,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",S)),e.builderContextSignal.content&&y.getDefaultCanTrack(e.canTrack)){const u=(m=e.builderContextSignal.content)==null?void 0:m.testVariationId,x=(v=e.builderContextSignal.content)==null?void 0:v.id,E=e.apiKey;y._track({type:"impression",canTrack:!0,contentId:x,apiKey:E,variationId:u!==x?u:void 0})}if(y.isPreviewing()&&!y.isEditing()){const u=new URL(location.href).searchParams,x=u.get("builder.preview"),E=u.get(`builder.overrides.${x}`),j=u.get("apiKey")||u.get("builder.space");x===e.model&&j===e.apiKey&&(!e.content||E===e.content.id)&&y.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(P=>{P&&i(P)})}}},[]),g.useEffect(()=>{e.content&&i(e.content)},[e.content]),g.useEffect(()=>{S()},[e.builderContextSignal.rootState]),g.useEffect(()=>{e.data&&n(e.data)},[e.data]),g.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),g.useEffect(()=>()=>{y.isBrowser()&&(window.removeEventListener("message",s),window.removeEventListener("builder:component:stateChangeListenerActivated",S))},[]),a.jsx(O.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(r,{ref:t,onClick:m=>b(m),"builder-content-id":(I=e.builderContextSignal.content)==null?void 0:I.id,"builder-model":e.model,className:gn(((T=e.content)==null?void 0:T.testVariationId)||((B=e.content)==null?void 0:B.id)),...o(),...e.contentWrapperProps,children:e.children}):null})}function bn(e){const[t,n]=g.useState(()=>`
|
|
185
|
+
${un({cssCode:e.cssCode,contentId:e.contentId})}
|
|
186
|
+
${dn({customFonts:e.customFonts})}
|
|
187
|
+
${fn(e.isNestedRender)}
|
|
188
|
+
`.trim());return a.jsx(M,{id:"builderio-content",styles:t,nonce:e.nonce})}const pn=({content:e,data:t,locale:n})=>{var r,l,s;const i={},o=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(s=(l=e==null?void 0:e.data)==null?void 0:l.inputs)==null||s.forEach(d=>{d.name&&d.defaultValue!==void 0&&(i[d.name]=d.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},xn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function re(e){var c,h,p,f,k,b,C,S,R;const[t,n]=g.useState(()=>{var I,T;return an({variationId:(I=e.content)==null?void 0:I.testVariationId,contentId:(T=e.content)==null?void 0:T.id})});function i(I){s(T=>({...T,rootState:I}))}const[o,r]=g.useState(()=>{var I;return[...ie(),...((I=e.customComponents)==null?void 0:I.filter(({models:T})=>!(T!=null&&T.length)||!e.model?!0:T.includes(e.model)))||[]].reduce((T,{component:B,...m})=>({...T,[m.name]:{component:B,...y.serializeIncludingFunctions(m)}}),{})}),[l,s]=g.useState(()=>{var I;return{content:xn({content:e.content,data:e.data}),localState:void 0,rootState:pn({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ie(),...((I=e.customComponents)==null?void 0:I.filter(({models:T})=>!(T!=null&&T.length)||!e.model?!0:T.includes(e.model)))||[]].reduce((T,{component:B,...m})=>({...T,[m.name]:y.serializeIncludingFunctions(m)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||""}}),d=g.useRef(!1);if(!d.current){e.apiKey||y.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const I=(h=(c=l.content)==null?void 0:c.data)==null?void 0:h.jsCode;I&&A({code:I,context:e.context||{},localState:void 0,rootState:l.rootState,rootSetState:T=>{Object.assign(l.rootState,T)},isExpression:!1}),d.current=!0}return a.jsx(se.Provider,{value:{registeredComponents:o},children:a.jsxs(hn,{nonce:e.nonce,content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:l,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,setBuilderContextSignal:s,children:[e.isSsrAbTest?a.jsx(G,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,a.jsx(bn,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(p=l.content)==null?void 0:p.id,cssCode:(k=(f=l.content)==null?void 0:f.data)==null?void 0:k.cssCode,customFonts:(C=(b=l.content)==null?void 0:b.data)==null?void 0:C.customFonts}),a.jsx(F,{blocks:(R=(S=l.content)==null?void 0:S.data)==null?void 0:R.blocks,context:l,registeredComponents:o,linkComponent:e.linkComponent})]})})}function Ee(e){var l;const[t,n]=g.useState(()=>en({canTrack:y.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var s;return on(L(e.content).map(d=>({id:d.testVariationId,testRatio:d.testRatio})),((s=e.content)==null?void 0:s.id)||"")}function o(){return L(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")}function r(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:y.handleABTestingSync({item:e.content,canTrack:y.getDefaultCanTrack(e.canTrack)})}return g.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.isNestedRender&&y.TARGET!=="reactNative"?a.jsx(G,{id:"builderio-init-variants-fns",scriptStr:nn(),nonce:e.nonce||""}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(M,{id:"builderio-variants",styles:o(),nonce:e.nonce||""}),a.jsx(G,{id:"builderio-variants-visibility",scriptStr:i(),nonce:e.nonce||""}),(l=L(e.content))==null?void 0:l.map(s=>a.jsx(re,{isNestedRender:e.isNestedRender,nonce:e.nonce,content:s,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,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},s.testVariationId))]}):null,a.jsx(re,{nonce:e.nonce,isNestedRender:e.isNestedRender,content:r(),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,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const yn=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return y.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{y.logger.error("Could not fetch symbol content: ",n)})};function Re(e){var s,d,c,h;function t(){return"div"}function n(){return"div"}function i(){var p,f;return[e.attributes[N()],"builder-symbol",(p=e.symbol)!=null&&p.inline?"builder-inline-symbol":void 0,(f=e.symbol)!=null&&f.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[o,r]=g.useState(()=>{var p;return(p=e.symbol)==null?void 0:p.content});function l(){o||yn({symbol:e.symbol,builderContextValue:e.builderContext}).then(p=>{p&&r(p)})}return g.useEffect(()=>{},[]),g.useEffect(()=>{l()},[e.symbol]),a.jsx("div",{...e.attributes,className:i(),children:a.jsx(Ee,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(s=e.builderBlock)==null?void 0:s.id},customComponents:Object.values(e.builderComponents),data:{...(d=e.symbol)==null?void 0:d.data,...e.builderContext.localState,...(c=o==null?void 0:o.data)==null?void 0:c.state},canTrack:e.builderContext.canTrack,model:(h=e.symbol)==null?void 0:h.model,content:o,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.Blocks=F;exports.BuilderContext=O;exports.Button=le;exports.Columns=xe;exports.Content=Ee;exports.Fragment=ye;exports.Image=ve;exports.Section=Se;exports.Symbol=Re;exports.Text=ke;exports.Video=Ce;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as l, Fragment as w, jsxs as V } from "react/jsx-runtime";
|
|
3
|
-
import { TARGET as D, isBrowser as H, logger as ne, checkIsDefined as Z, isPreviewing as xe, isEditing as N, registerInsertMenu as Le, setupBrowserForEditing as Oe, createRegisterComponentMessage as Ue, getDefaultCanTrack as q, _track as le, fetchOneEntry as ve, createEditorListener as je, serializeIncludingFunctions as se, handleABTestingSync as Me } from "./server-entry-
|
|
3
|
+
import { TARGET as D, isBrowser as H, logger as ne, checkIsDefined as Z, isPreviewing as xe, isEditing as N, registerInsertMenu as Le, setupBrowserForEditing as Oe, createRegisterComponentMessage as Ue, getDefaultCanTrack as q, _track as le, fetchOneEntry as ve, createEditorListener as je, serializeIncludingFunctions as se, handleABTestingSync as Me } from "./server-entry-8956b57e.js";
|
|
4
4
|
import { createContext as Se, useEffect as B, useState as T, useRef as $, useContext as ce, createElement as ke } from "react";
|
|
5
|
-
import { getFunctionArguments as _e, flattenState as He,
|
|
5
|
+
import { getFunctionArguments as _e, flattenState as He, runInNode as qe, parseCode as Ke, getBuilderGlobals as ze, set as Ce, fastClone as ie } from "./setIvm-2e562b9e.js";
|
|
6
|
+
import { shouldForceBrowserRuntimeInNode as Je } from "./should-force-browser-runtime-in-node-a23d3cc4.js";
|
|
6
7
|
const Ge = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), Ye = (e) => typeof e == "string" && Ge.has(e.toLowerCase());
|
|
7
8
|
function oe(e) {
|
|
8
9
|
return /* @__PURE__ */ l(w, { children: Ye(e.TagName) ? /* @__PURE__ */ l(w, { children: /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ l(w, { children: typeof e.TagName == "string" ? /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
@@ -96,9 +97,9 @@ const Ie = (e, t, n) => {
|
|
|
96
97
|
})
|
|
97
98
|
});
|
|
98
99
|
return new Function(...s.map(([d]) => d), e)(...s.map(([, d]) => d));
|
|
99
|
-
}, tt = (e) => H() ||
|
|
100
|
+
}, tt = (e) => H() || Je({
|
|
100
101
|
shouldLogWarning: !0
|
|
101
|
-
}) ? et(e) :
|
|
102
|
+
}) ? et(e) : qe(e), nt = /^(return )?(\s*)?state(?<getPath>(\.\w+)+)(\s*);?$/, it = /(\s)*var(\s)+_virtual_index(\s)*=(\s)*state(?<getPath>(\.\w+)+)(\s*);?(\s)*return(\s)*_virtual_index(\s)*/, ot = (e) => {
|
|
102
103
|
var t, n, i, o, a, r;
|
|
103
104
|
return ((i = (n = (t = nt.exec(e.trim())) == null ? void 0 : t.groups) == null ? void 0 : n.getPath) == null ? void 0 : i.slice(1)) || ((r = (a = (o = it.exec(e.trim())) == null ? void 0 : o.groups) == null ? void 0 : a.getPath) == null ? void 0 : r.slice(1));
|
|
104
105
|
};
|
|
@@ -120,10 +121,10 @@ function L({
|
|
|
120
121
|
...n
|
|
121
122
|
}, s);
|
|
122
123
|
const d = {
|
|
123
|
-
code:
|
|
124
|
+
code: Ke(e, {
|
|
124
125
|
isExpression: r
|
|
125
126
|
}),
|
|
126
|
-
builder:
|
|
127
|
+
builder: ze(),
|
|
127
128
|
context: t,
|
|
128
129
|
event: a,
|
|
129
130
|
rootSetState: o,
|
package/lib/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-1c1c1459.cjs");require("react/jsx-runtime");require("react");require("./setIvm-bf4f998d.cjs");require("./should-force-browser-runtime-in-node-ce6ededa.cjs");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;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;
|
package/lib/node/index.mjs
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { Blocks as
|
|
2
|
-
import { _processContentResult as
|
|
1
|
+
import { Blocks as n, BuilderContext as m, Button as c, Columns as g, Content as p, Fragment as a, Image as d, Section as l, Symbol as u, Text as f, Video as B } from "./blocks-exports.mjs";
|
|
2
|
+
import { _processContentResult as E, createRegisterComponentMessage as h, fetchBuilderProps as x, fetchEntries as S, fetchOneEntry as b, getBuilderSearchParams as P, isEditing as k, isPreviewing as y, register as R, setEditorSettings as T, subscribeToEditor as v, track as w } from "./server-entry-8956b57e.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./
|
|
5
|
+
import "./setIvm-2e562b9e.js";
|
|
6
|
+
import "./should-force-browser-runtime-in-node-a23d3cc4.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
n as Blocks,
|
|
9
|
+
m as BuilderContext,
|
|
10
|
+
c as Button,
|
|
11
|
+
g as Columns,
|
|
12
|
+
p as Content,
|
|
12
13
|
a as Fragment,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
d as Image,
|
|
15
|
+
l as Section,
|
|
16
|
+
u as Symbol,
|
|
17
|
+
f as Text,
|
|
18
|
+
B as Video,
|
|
19
|
+
E as _processContentResult,
|
|
20
|
+
h as createRegisterComponentMessage,
|
|
21
|
+
x as fetchBuilderProps,
|
|
22
|
+
S as fetchEntries,
|
|
23
|
+
b as fetchOneEntry,
|
|
24
|
+
P as getBuilderSearchParams,
|
|
25
|
+
k as isEditing,
|
|
26
|
+
y as isPreviewing,
|
|
27
|
+
R as register,
|
|
28
|
+
T as setEditorSettings,
|
|
29
|
+
v as subscribeToEditor,
|
|
30
|
+
w as track
|
|
30
31
|
};
|
package/lib/node/init.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./should-force-browser-runtime-in-node-ce6ededa.cjs"),r=require("isolated-vm"),e=require("./setIvm-bf4f998d.cjs");require("./server-entry-1c1c1459.cjs");const n=t=>{if(o.shouldForceBrowserRuntimeInNode({shouldLogWarning:!0}))return;const{ivmIsolateOptions:i}=t||{};e.setIvm(r,i)};exports.setIvm=e.setIvm;exports.initializeNodeRuntime=n;
|