@builder.io/sdk-react 2.0.29 → 2.0.31
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 +18 -18
- package/lib/browser/blocks-exports.mjs +584 -587
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/{edge/server-entry-05dd3f4b.js → browser/server-entry-77f4513c.js} +245 -228
- package/lib/browser/server-entry-d7a13b14.cjs +2 -0
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-200ac141.cjs → accordion-696fad97.cjs} +1 -1
- package/lib/edge/{accordion-1fae9bd5.js → accordion-d1213549.js} +1 -1
- package/lib/edge/{blocks-b47cd3fc.js → blocks-9ef79098.js} +3 -3
- package/lib/edge/{blocks-fd9e445c.cjs → blocks-aa67fee8.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-ffe70d17.cjs → button-2ed05d22.cjs} +1 -1
- package/lib/edge/{button-5cc9a94f.js → button-b41f1129.js} +2 -2
- package/lib/edge/{columns-9ad996bb.js → columns-5f8497fb.js} +4 -4
- package/lib/edge/{columns-7651ba21.cjs → columns-ca9ac444.cjs} +1 -1
- package/lib/edge/{content-variants-a9017964.cjs → content-variants-2f5a6ccd.cjs} +4 -4
- package/lib/edge/{content-variants-0ece6057.js → content-variants-9c4db669.js} +118 -118
- package/lib/edge/{evaluate-73e0df40.cjs → evaluate-8453ffc0.cjs} +1 -1
- package/lib/edge/{evaluate-5cfe10b0.js → evaluate-f626f584.js} +1 -1
- package/lib/edge/{form-186bf59f.js → form-a5407307.js} +30 -33
- package/lib/edge/form-b0c5418b.cjs +1 -0
- package/lib/edge/{get-class-prop-name-7d6a77a4.js → get-class-prop-name-40d6defb.js} +1 -1
- package/lib/edge/{get-class-prop-name-11734dbc.cjs → get-class-prop-name-86f0330a.cjs} +1 -1
- package/lib/edge/{img-ef160d2b.cjs → img-83ed868e.cjs} +1 -1
- package/lib/edge/{img-6c1f4ea4.js → img-fa36f926.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-97dc199a.cjs → input-3106b577.cjs} +1 -1
- package/lib/edge/{input-b4ee4339.js → input-93e42e28.js} +1 -1
- package/lib/edge/{select-2cdf2c8f.cjs → select-29495824.cjs} +1 -1
- package/lib/edge/{select-e79d6e1b.js → select-4cf4356a.js} +1 -1
- package/lib/edge/server-entry-4cd5389e.cjs +2 -0
- package/lib/{node/server-entry-00c52924.js → edge/server-entry-ea35faa6.js} +243 -231
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-680234a8.js → slot-6ad4152e.js} +4 -4
- package/lib/edge/{slot-66ba436b.cjs → slot-c8ab71b6.cjs} +1 -1
- package/lib/edge/{symbol-4d0b1228.cjs → symbol-74313a4b.cjs} +1 -1
- package/lib/edge/{symbol-e920f028.js → symbol-d2b48e54.js} +2 -2
- package/lib/edge/{tabs-1bea88d1.js → tabs-6d924c90.js} +4 -4
- package/lib/edge/{tabs-1f3f45cf.cjs → tabs-f699b318.cjs} +1 -1
- package/lib/edge/{text-9533b278.cjs → text-7120ee0c.cjs} +1 -1
- package/lib/edge/{text-fd78274f.js → text-7137a306.js} +2 -2
- package/lib/node/blocks-exports.cjs +20 -20
- package/lib/node/blocks-exports.mjs +576 -579
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/{browser/server-entry-712b1faa.js → node/server-entry-32ef60c0.js} +213 -197
- package/lib/node/server-entry-9c026e49.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-156def75.js → setIvm-26e65816.js} +1 -1
- package/lib/node/{setIvm-ca4d1590.cjs → setIvm-bf1ad328.cjs} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-bc24fcdd.cjs → should-force-browser-runtime-in-node-000957e3.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-eb3eac6a.js → should-force-browser-runtime-in-node-343fd6c7.js} +1 -1
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/log-fetch.d.ts +1 -0
- package/lib/browser/server-entry-3e3279b7.cjs +0 -2
- package/lib/edge/form-c98c7fc1.cjs +0 -1
- package/lib/edge/server-entry-0224e0bb.cjs +0 -2
- package/lib/node/server-entry-0b1fe826.cjs +0 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),
|
|
2
|
-
`)
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),g=require("./server-entry-d7a13b14.cjs"),h=require("react"),Fe=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Ve=e=>typeof e=="string"&&Fe.has(e.toLowerCase());function Y(e){return a.jsx(a.Fragment,{children:Ve(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(g.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function ce(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 L=h.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{},nonce:""}),ue=h.createContext({registeredComponents:{}});function Ne(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options}}function We(e,...t){const n=Object.assign({},e);for(const i of t)delete n[i];return n}const de=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((o,l)=>o!=null?o[l]:o,e);return i===void 0||i===e?n:i},$e=({builder:e,context:t,event:n,state:i})=>Object.entries({state:i,Builder:e,builder:e,context:t,event:n}),De=()=>({isEditing:g.isEditing(),isBrowser:g.isBrowser(),isServer:!g.isBrowser(),getUserAttributes:()=>g.getUserAttributes()}),Oe=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e;function me({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(i,o)=>{if(t&&o in t)return t[o];const l=i[o];return typeof l=="object"&&l!==null?me({rootState:l,localState:void 0,rootSetState:n?r=>{i[o]=r,n(i)}:void 0}):l},set:(i,o,l)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return i[o]=l,n==null||n(i),!0}})}const Z=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:l,rootState:r})=>{const s=$e({builder:t,context:n,event:i,state:me({rootState:r,localState:o,rootSetState:l})});return new Function(...s.map(([u])=>u),e)(...s.map(([,u])=>u))};function Le(){var e;return typeof process!="undefined"&&g.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const Ue=({shouldLogWarning:e})=>{var o;if(!Le())return!1;const t=process.arch==="arm64",n=process.version.startsWith("v20"),i=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return t&&n&&!i?(e&&g.logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},He=e=>(g.isBrowser()||Ue({shouldLogWarning:!0}),Z(e)),Me=/^(return )?(\s*)?state(?<getPath>(\.\w+)+)(\s*);?$/,_e=/(\s)*var(\s)+_virtual_index(\s)*=(\s)*state(?<getPath>(\.\w+)+)(\s*);?(\s)*return(\s)*_virtual_index(\s)*/,qe=e=>{var t,n,i,o,l,r;return((i=(n=(t=Me.exec(e.trim()))==null?void 0:t.groups)==null?void 0:n.getPath)==null?void 0:i.slice(1))||((r=(l=(o=_e.exec(e.trim()))==null?void 0:o.groups)==null?void 0:l.getPath)==null?void 0:r.slice(1))};function F({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:l,isExpression:r=!0}){if(e.trim()==="")return;const s=qe(e.trim());if(s)return de({...i,...n},s);const u={code:Oe(e,{isExpression:r}),builder:De(),context:t,event:l,rootSetState:o,rootState:i,localState:n};try{return He(u)}catch(c){g.logger.error("Failed code evaluation: "+c.message,{code:e});return}}const Q=e=>JSON.parse(JSON.stringify(e)),fe=(e,t,n)=>{if(Object(e)!==e)return e;const i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((o,l,r)=>Object(o[l])===o[l]?o[l]:o[l]=Math.abs(Number(i[r+1]))>>0===+i[r+1]?[]:{},e)[i[i.length-1]]=n,e};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 Ke=["svelte","vue","angular","qwik","solid"].includes(g.TARGET),ze=e=>{if(Ke){const t=Q(e);return{...t,properties:{...t.properties},actions:{...t.actions}}}else{const t=J(We(e,"children","meta"));return{...t,properties:{...t.properties},actions:{...t.actions},children:e.children,meta:e.meta}}},Je=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const l=ze(e);for(const r in e.bindings){const s=e.bindings[r],u=F({code:s,localState:n,rootState:i,rootSetState:o,context:t});fe(l,r,u)}return l};function Ge({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:l}){const r=e;return n?Je({block:r,localState:i,rootState:o,rootSetState:l,context:t}):r}const U=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"";function Ye(e,t,n={}){let i,o,l,r=null,s=0;const u=function(){s=n.leading===!1?0:Date.now(),r=null,l=e.apply(i,o),r||(i=o=null)};return function(){const c=Date.now();!s&&n.leading===!1&&(s=c);const b=t-(c-s);return i=this,o=arguments,b<=0||b>t?(r&&(clearTimeout(r),r=null),s=c,l=e.apply(i,o),r||(i=o=null)):!r&&n.trailing!==!1&&(r=setTimeout(u,b)),l}}function V(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const o=arguments[i];if(o!=null)for(const l in o)Object.prototype.hasOwnProperty.call(o,l)&&(n[l]=o[l])}return n}function Qe(e){for(const t of e)switch(t.trigger){case"pageLoad":be(t);break;case"scrollInView":Ze(t);break}}function ge(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function he(e,t){const n=Xe(e),i=getComputedStyle(t),o=e.steps[0].styles,l=e.steps[e.steps.length-1].styles,r=[o,l];for(const s of r)for(const u of n)u in s||(s[u]=i[u])}function Xe(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 be(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){ge(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{he(e,n),n.style.transition="none",n.style.transitionDelay="0",V(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"),V(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){ge(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{he(e,n);let i=!1,o=!1;function l(){!i&&s(n)?(i=!0,o=!0,setTimeout(()=>{V(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",r),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,V(n.style,e.steps[0].styles))}const r=Ye(l,200,{leading:!1});function s(b){const p=b.getBoundingClientRect(),m=window.innerHeight,f=(e.thresholdPercent||0)/100*m;return p.bottom>f&&p.top<m-f}const u=e.steps[0].styles;function c(){V(n.style,u)}c(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${U(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",r,{capture:!0,passive:!0}),l()})}const pe=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${U(n)}: ${i};`}).filter(g.checkIsDefined),et=e=>pe(e).join(`
|
|
2
|
+
`),D=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
3
|
${et(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
5
5
|
${i}
|
|
6
|
-
}`:i};function tt({style:e}){return e}const nt=({block:e,context:t})=>
|
|
6
|
+
}`:i};function tt({style:e}){return e}const nt=({block:e,context:t})=>xe(tt({style:e.style||{},context:t,block:e}));function xe(e){switch(g.TARGET){case"svelte":case"vue":case"solid":case"angular":return pe(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const it=({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?`)},ot=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=F({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(o))return;const l=n.collection.split(".").pop(),r=n.itemName||(l?l+"Item":"item");return o.map((u,c)=>({context:{...t,localState:{...t.localState,$index:c,$item:u,[r]:u,[`$${r}Index`]:c}},block:i}))},at=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},rt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderComponents?{builderComponents:t}:{}},lt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},st=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},ot=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=F({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(o))return;const l=n.collection.split(".").pop(),r=n.itemName||(l?l+"Item":"item");return o.map((u,c)=>({context:{...t,localState:{...t.localState,$index:c,$item:u,[r]:u,[`$${r}Index`]:c}},block:i}))},at=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},rt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderComponents?{builderComponents:t}:{}},lt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},st=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},ye={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ee=(e,t=ye)=>`@media (max-width: ${t[e].max}px)`,ve=({small:e,medium:t})=>{const n=Q(ye);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 l=n.medium.max+1;return n.large={max:2e3,min:l,default:l+1},n};function H(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function ct(e){function t(){const i=e.block;return g.checkIsDefined(i.hide)?!i.hide:g.checkIsDefined(i.show)?i.show:!0}function n(){var k,y,x;const i=e.block,o=i.responsiveStyles,l=e.context.content,r=ve(((k=l==null?void 0:l.meta)==null?void 0:k.breakpoints)||{}),s=o==null?void 0:o.large,u=o==null?void 0:o.medium,c=o==null?void 0:o.small,b=i.id;if(!b)return"";const p=s?D({className:b,styles:s}):"",m=u?D({className:b,styles:u,mediaQuery:ee("medium",r)}):"",S=c?D({className:b,styles:c,mediaQuery:ee("small",r)}):"",f=i.animations&&i.animations.find(v=>v.trigger==="hover");let C="";if(f){const v=((x=(y=f.steps)==null?void 0:y[1])==null?void 0:x.styles)||{};C=D({className:`${b}:hover`,styles:{...v,transition:`all ${f.duration}s ${U(f.easing)}`,transitionDelay:f.delay?`${f.delay}s`:"0s"}})||""}return[p,m,S,C].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(H,{id:"builderio-block",styles:n(),nonce:e.context.nonce})}):null})}function ut(e){return e.charAt(0).toUpperCase()+e.slice(1)}const dt=e=>`on${ut(e)}`,mt=(e,t)=>n=>F({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function Se(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const l=n[o];let r=dt(o);if(e.stripPrefix)switch(g.TARGET){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=mt(l,e)}return t}function ft({properties:e}){return e}const gt=e=>({href:e.href});function X({block:e,context:t}){var i;const n={...gt(e),...e.properties,"builder-id":e.id,style:nt({block:e,context:t}),[N()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return ft({properties:n,context:t,block:e})}function ht(e){return a.jsx(Y,{TagName:e.Wrapper,attributes:X({block:e.block,context:e.context}),actionAttributes:Se({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 bt(e){return h.useEffect(()=>{},[]),a.jsx(a.Fragment,{children:e.children})}function pt(e){function t(){return e.includeBlockProps?{...X({block:e.block,context:e.context}),...Se({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(bt,{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 xt=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:l,contextValue:r})=>{const s={...e,...o?{attributes:X({block:t,context:r})}:{}};return l?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:s};function te(e){var i;const[t,n]=h.useState(()=>e.isInteractive?pt:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...xt({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(W,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function ne(e){const[t,n]=h.useState(()=>e.repeatContext);return a.jsx(L.Provider,{value:t,children:a.jsx(W,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function W(e){var b,p,m,S;function t(){return ot({block:e.block,context:e.context})}const[n,i]=h.useState(()=>({value:null,update:!1}));function o(){var C;if(n.value&&!n.update&&!g.isPreviewing())return n.value;const f=(C=e.block.repeat)!=null&&C.collection?e.block:Ge({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return n.value=f,n.update=!1,f}function l(){return it({block:o(),registeredComponents:e.registeredComponents})}function r(){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 k,y;if((k=e.block.repeat)!=null&&k.collection)return!!((y=t==null?void 0:t())!=null&&y.length);const f="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!f}function u(){var C,k;return!((C=l==null?void 0:l())!=null&&C.component)&&!t()?(k=o().children)!=null?k:[]:[]}function c(){var f,C,k,y;return{blockChildren:(f=o().children)!=null?f:[],componentRef:(C=l==null?void 0:l())==null?void 0:C.component,componentOptions:{...Ne(o()),...lt(l(),o()),...st(l(),e.context),...at(l(),e.linkComponent),...rt(l(),e.registeredComponents)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((k=l==null?void 0:l())==null?void 0:k.noWrap)===!0,isInteractive:!((y=l==null?void 0:l())!=null&&y.isRSC&&g.TARGET==="rsc")}}return h.useEffect(()=>{const f=o().id,C=o().animations;C&&f&&Qe(C.map(k=>({...k,elementId:f})))},[]),h.useEffect(()=>{n.update=!0}),a.jsx(a.Fragment,{children:s()?a.jsxs(a.Fragment,{children:[a.jsx(ct,{block:o(),context:e.context}),(b=l==null?void 0:l())!=null&&b.noWrap?t()?a.jsx(a.Fragment,{children:(S=t())==null?void 0:S.map((f,C)=>a.jsx(ne,{repeatContext:f.context,block:f.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},C))}):a.jsx(te,{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:(m=t())==null?void 0:m.map((f,C)=>a.jsx(ne,{repeatContext:f.context,block:f.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},C))}):a.jsxs(ht,{Wrapper:r(),block:o(),context:e.context,children:[a.jsx(te,{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=u())==null?void 0:p.map(f=>a.jsx(W,{block:f,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},f.id))]})})]}):null})}function yt(e){const t=h.useRef(null);function n(){var r;return["builder-blocks",(r=e.blocks)!=null&&r.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function i(){if(!e.path)return;const r="component.options.";return e.path.startsWith(r)?e.path:`${r}${e.path||""}`}function o(){var r,s;g.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((s=window.parent)==null||s.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}function l(){var r,s;g.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((s=window.parent)==null||s.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}return h.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{ref:t,className:n()+" props-blocks-wrapper-215a41e0","builder-path":i(),"builder-parent-id":e.parent,style:e.styleProp,onClick:r=>o(),onMouseEnter:r=>l(),onKeyPress:r=>o(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-215a41e0 {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
12
|
-
}`})]})}function A(e){var i,o,l;const t=
|
|
12
|
+
}`})]})}function A(e){var i,o,l;const t=h.useContext(L),n=h.useContext(ue);return a.jsx(yt,{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==null?void 0:t.BlocksWrapper),BlocksWrapperProps:((o=e.context)==null?void 0:o.BlocksWrapperProps)||(t==null?void 0:t.BlocksWrapperProps),children:e.blocks?a.jsx(a.Fragment,{children:(l=e.blocks)==null?void 0:l.map(r=>a.jsx(W,{block:r,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||(n==null?void 0:n.registeredComponents)},r.id))}):null})}const vt=e=>`builder-columns ${e}-breakpoints`;function ke(e){var C,k;function t(){return typeof e.space=="number"?e.space||0:20}function n(){return e.columns||[]}function i(){return e.stackColumnsAt||"tablet"}function o(y){return y.link?e.builderLinkComponent||"a":"div"}function l(y){var x;return((x=n()[y])==null?void 0:x.width)||100/n().length}function r(y){const x=l(y),v=t()*(n().length-1)*(x/100);return`calc(${x}% - ${v}px)`}function s({stackedStyle:y,desktopStyle:x}){return i()==="tablet"?y:x}function u({stackedStyle:y,desktopStyle:x}){return i()==="never"?x:y}function c(){return e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column"}function b(){return{"--flex-dir":c(),"--flex-dir-tablet":s({stackedStyle:c(),desktopStyle:"row"})}}function p(y){const x=y===0?0:t(),v=r(y),P=`${x}px`,T="100%",E=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:v,["marginLeft"]:P,"--column-width-mobile":u({stackedStyle:T,desktopStyle:v}),"--column-margin-left-mobile":u({stackedStyle:E,desktopStyle:P}),"--column-width-tablet":s({stackedStyle:T,desktopStyle:v}),"--column-margin-left-tablet":s({stackedStyle:E,desktopStyle:P})}}function m(y){var v,P;return ve(((P=(v=e.builderContext.content)==null?void 0:v.meta)==null?void 0:P.breakpoints)||{})[y].max}function S(){const y=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
|
|
13
13
|
@media (max-width: ${m("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 f(y,x){return{...y.link?{href:y.link}:{},[N()]:"builder-column",style:
|
|
36
|
+
`}function f(y,x){return{...y.link?{href:y.link}:{},[N()]:"builder-column",style:xe(p(x))}}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:vt((C=e.builderBlock)==null?void 0:C.id)+" div-49f40bae",style:b(),children:[a.jsx(H,{id:"builderio-columns",styles:S(),nonce:e.builderContext.nonce}),(k=e.columns)==null?void 0:k.map((y,x)=>a.jsx(Y,{TagName:o(y),actionAttributes:{},attributes:f(y,x),children:a.jsx(A,{path:`columns.${x}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:y.blocks})},x))]}),a.jsx("style",{children:`.div-49f40bae {
|
|
37
37
|
display: flex;
|
|
38
38
|
line-height: normal;
|
|
39
|
-
}`})]})}function
|
|
39
|
+
}`})]})}function Ce(e){return a.jsx("span",{children:e.children})}function ie(e){return e.replace(/http(s)?:/,"")}function St(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 kt(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return ie(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],l=t.match("x")?t:`${t}x`;return ie(`${i[0]}_${l}${o}`)}return null}function M(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=>`${St(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[kt(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function Te(e){var o,l,r,s,u,c;function t(){var m;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&&((m=e.image)!=null&&m.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),M(p)}else if(e.image&&!e.srcset)return M(p);return M(p)}}function n(){var b;return(b=t==null?void 0:t())!=null&&b.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const b={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?b:void 0}return h.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&&!((l=(o=e.builderBlock)==null?void 0:o.children)!=null&&l.length&&e.fitContent)?a.jsx("div",{className:"builder-image-sizer div-7a292ab8",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(s=(r=e.builderBlock)==null?void 0:r.children)!=null&&s.length&&e.fitContent?a.jsx(a.Fragment,{children:e.children}):null,!e.fitContent&&((c=(u=e.builderBlock)==null?void 0:u.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 Te(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 M={"@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!"}}}]},_={"@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!"}}}]},Ct={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:[M]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[_]}],defaultValue:[{title:[M],detail:[_]},{title:[M],detail:[_]}],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}},ie=e=>e.toString();function Tt(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 l(){const k={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(k).filter(([f,T])=>T!==void 0))}function r(m){return`builder-accordion-title builder-accordion-title-${t.includes(m)?"open":"closed"}`}function s(m){return`builder-accordion-detail builder-accordion-detail-${t.includes(m)?"open":"closed"}`}function u(){let m=null;if(e.grid&&t.length&&document){const f=t[0];let C=document.querySelector(`.builder-accordion-title[data-index="${f}"]`);if(m=f,C){let y=C.getBoundingClientRect();for(;C=C&&C.nextElementSibling;)if(C){if(C.classList.contains("builder-accordion-detail"))continue;const x=C.getBoundingClientRect();if(x.left>y.left){const S=parseInt(C.getAttribute("data-index")||"",10);isNaN(S)||(y=x,m=S)}else break}}}return typeof m=="number"&&(m=m+1),m}function c(){const m={order:typeof u()=="number"?u():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(m).filter(([k,f])=>f!==void 0))}function h(m){t.includes(m)?n(i()?[]:t.filter(k=>k!==m)):n(i()?[m]:t.concat(m))}return a.jsx("div",{className:"builder-accordion",style:o(),children:(p=e.items)==null?void 0:p.map((m,k)=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:r(k),style:{...l(),...e.grid&&{width:e.gridRowWidth,order:u()!==null?ie(k):ie(k+1)}},"data-index":k,onClick:f=>h(k),children:a.jsx(A,{blocks:m.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(A,{blocks:m.detail,path:`items.${k}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]}))})}const It={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}},wt={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(l=>!l.get("width"))||n.reduce((s,u)=>s+u.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}},Et={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},Rt={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(r,s=6e4){return new Promise((u,c)=>{const h=document.createElement("img");let p=!1;h.onload=()=>{p=!0,u(h)},h.addEventListener("error",m=>{console.warn("Image load failed",m.error),c(m.error)}),h.src=r,setTimeout(()=>{p||c(new Error("Image load timed out"))},s)})}function i(r){return Math.round(r*1e3)/1e3}const o=e.get("image"),l=e.get("aspectRatio");if(fetch(o).then(r=>r.blob()).then(r=>{r.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!l||l===.7041))return n(o).then(r=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&r.width&&r.height&&(e.set("aspectRatio",i(r.height/r.width)),e.set("height",r.height),e.set("width",r.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}},jt={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>"}}}]},Pt={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 Bt(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(A,{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 At={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}},q={"@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"}}},K={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},Ft={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[q]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[K]}],defaultValue:[{label:[{...q,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...K,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...q,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...K,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 Vt(e){var l;const[t,n]=g.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(r){return e.tabs&&e.tabs[r].content}function o(r){r===t&&e.collapsible?n(-1):n(r)}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:(l=e.tabs)==null?void 0:l.map((r,s)=>a.jsx("span",{className:`builder-tab-wrap ${t===s?"builder-tab-active":""}`,style:{...t===s?e.activeTabStyle:{}},onClick:u=>o(s),children:a.jsx(A,{parent:e.builderBlock.id,path:`tabs.${s}.label`,blocks:r.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},s))}),i(t)?a.jsx("div",{children:a.jsx(A,{parent:e.builderBlock.id,path:`tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const Nt={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 Ie(e){function t(){var s;const n=e.builderContext,{context:i,localState:o,rootState:l,rootSetState:r}=n;return String(((s=e.text)==null?void 0:s.toString())||"").replace(/{{([^}]+)}}/g,(u,c)=>F({code:c,context:i,localState:o,rootState:l,rootSetState:r}))}return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:t()},style:{outline:"none"}})}const Wt={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 $t(e){const t=g.useRef(null),[n,i]=g.useState(()=>[]),[o,l]=g.useState(()=>[]);return g.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const r=t.current.getElementsByTagName("script");for(let u=0;u<r.length;u++){const c=r[u];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 Dt={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}]},Ot=["text/javascript","application/javascript","application/ecmascript"],Lt=e=>Ot.includes(e.type);function Ut(e){const t=g.useRef(null),[n,i]=g.useState(()=>[]),[o,l]=g.useState(()=>[]),[r,s]=g.useState(()=>!1);function u(){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 m=document.createElement("script");m.async=!0,m.src=p.src,document.head.appendChild(m)}else if(Lt(p)&&!o.includes(p.innerText))try{o.push(p.innerText),new Function(p.innerText)()}catch(m){console.warn("`Embed`: Error running script:",m)}}}return g.useEffect(()=>{t.current&&!r&&(s(!0),u())},[t.current,r]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Ht={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}},Mt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],_t=()=>{const e=process.env.NODE_ENV||"production";return Mt.includes(e)?e:"production"};function qt(e){var p,m;const t=g.useRef(null),[n,i]=g.useState(()=>"unsubmitted"),[o,l]=g.useState(()=>null),[r,s]=g.useState(()=>"");function u(k){var T,C;const f={...e.builderContext.rootState,...k};e.builderContext.rootSetState?(C=(T=e.builderContext).rootSetState)==null||C.call(T,f):e.builderContext.rootState=f}function c(){return b.isEditing()&&e.previewState||n}function h(k){var T;const f=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")k.preventDefault();else if(f){if(!(e.action||e.sendSubmissionsTo==="email")){k.preventDefault();return}k.preventDefault();const C=k.currentTarget||k.target,y=e.customHeaders||{};let x;const S=new FormData(C),P=Array.from(C.querySelectorAll("input,select,textarea")).filter(d=>!!d.name).map(d=>{let v;const E=d.name;if(d instanceof HTMLInputElement)if(d.type==="radio"){if(d.checked)return v=d.name,{key:E,value:v}}else if(d.type==="checkbox")v=d.checked;else if(d.type==="number"||d.type==="range"){const R=d.valueAsNumber;isNaN(R)||(v=R)}else d.type==="file"?v=d.files:v=d.value;else v=d.value;return{key:E,value:v}});let I=e.contentType;if(e.sendSubmissionsTo==="email"&&(I="multipart/form-data"),Array.from(P).forEach(({value:d})=>{(d instanceof File||Array.isArray(d)&&d[0]instanceof File||d instanceof FileList)&&(I="multipart/form-data")}),I!=="application/json")x=S;else{const d={};Array.from(P).forEach(({value:v,key:E})=>{me(d,E,v)}),x=JSON.stringify(d)}I&&I!=="multipart/form-data"&&(f&&((T=e.action)!=null&&T.includes("zapier.com"))||(y["content-type"]=I));const w=new CustomEvent("presubmit",{detail:{body:x}});if(t.current&&(t.current.dispatchEvent(w),w.defaultPrevented))return;i("sending");const j=`${_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"?j:e.action,{body:x,headers:y,method:e.method||"post"}).then(async d=>{let v;const E=d.headers.get("content-type");if(E&&E.indexOf("application/json")!==-1?v=await d.json():v=await d.text(),!d.ok&&e.errorMessagePath){let R=ue(v,e.errorMessagePath);R&&(typeof R!="string"&&(R=JSON.stringify(R)),s(R),u({formErrorMessage:R}))}if(l(v),i(d.ok?"success":"error"),d.ok){const R=new CustomEvent("submit:success",{detail:{res:d,body:v}});if(t.current){if(t.current.dispatchEvent(R),R.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const B=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(B),B.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},d=>{const v=new CustomEvent("submit:error",{detail:{error:d}});t.current&&(t.current.dispatchEvent(v),v.defaultPrevented)||(l(d),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:(m=(p=e.builderBlock)==null?void 0:p.children)==null?void 0:m.map((k,f)=>a.jsx(W,{block:k,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${f}`))}):null,c()==="error"?a.jsx(A,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?a.jsx(A,{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(A,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-3a20f614 { padding: 10px; color: red; text-align: center; }"})," "]})}const Kt={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 zt(e){return g.createElement("input",{...e.attributes,key:b.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 Jt={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 Gt(e){var t;return g.createElement("select",{...e.attributes,value:e.value,key:b.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 Yt={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 Xt={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 en={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 tn(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},b.isEditing()&&e.imgSrc||"default-key")}const nn={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 we(e){var i,o,l,r,s,u,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&&((l=(o=e.builderBlock)==null?void 0:o.children)!=null&&l.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(s=(r=e.builderBlock)==null?void 0:r.children)!=null&&s.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(c=(u=e.builderBlock)==null?void 0:u.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 on=()=>[{component:$t,...Wt},{component:Ut,...Dt},{component:qt,...Ht},{component:zt,...Kt},{component:Qt,...Yt},{component:Gt,...Jt},{component:Zt,...Xt},{component:tn,...en},{component:we,...nn}],oe=()=>[{component:se,...It},{component:Se,...wt},{component:ke,...Et},{component:Ce,...Rt},{component:Te,...jt},{component:Bt,...Pt},{component:Be,...At},{component:Ie,...Nt},{component:Vt,...Ft},{component:Tt,...Ct},...on()],an=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
55
|
+
}`})]})}function Ie(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 _={"@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!"}}}]},Ct={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:[_]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[q]}],defaultValue:[{title:[_],detail:[q]},{title:[_],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}},oe=e=>e.toString();function Tt(e){var p;const[t,n]=h.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 l(){const S={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(S).filter(([f,C])=>C!==void 0))}function r(m){return`builder-accordion-title builder-accordion-title-${t.includes(m)?"open":"closed"}`}function s(m){return`builder-accordion-detail builder-accordion-detail-${t.includes(m)?"open":"closed"}`}function u(){let m=null;if(e.grid&&t.length&&document){const f=t[0];let k=document.querySelector(`.builder-accordion-title[data-index="${f}"]`);if(m=f,k){let y=k.getBoundingClientRect();for(;k=k&&k.nextElementSibling;)if(k){if(k.classList.contains("builder-accordion-detail"))continue;const x=k.getBoundingClientRect();if(x.left>y.left){const v=parseInt(k.getAttribute("data-index")||"",10);isNaN(v)||(y=x,m=v)}else break}}}return typeof m=="number"&&(m=m+1),m}function c(){const m={order:typeof u()=="number"?u():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(m).filter(([S,f])=>f!==void 0))}function b(m){t.includes(m)?n(i()?[]:t.filter(S=>S!==m)):n(i()?[m]:t.concat(m))}return a.jsx("div",{className:"builder-accordion",style:o(),children:(p=e.items)==null?void 0:p.map((m,S)=>a.jsxs(a.Fragment,{children:[a.jsx("div",{className:r(S),style:{...l(),...e.grid&&{width:e.gridRowWidth,order:u()!==null?oe(S):oe(S+1)}},"data-index":S,onClick:f=>b(S),children:a.jsx(A,{blocks:m.title,path:`items.${S}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(S)?a.jsx("div",{className:s(S),style:c(),children:a.jsx(A,{blocks:m.detail,path:`items.${S}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]}))})}const It={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}},wt={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(l=>!l.get("width"))||n.reduce((s,u)=>s+u.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}},Et={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},Rt={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(r,s=6e4){return new Promise((u,c)=>{const b=document.createElement("img");let p=!1;b.onload=()=>{p=!0,u(b)},b.addEventListener("error",m=>{console.warn("Image load failed",m.error),c(m.error)}),b.src=r,setTimeout(()=>{p||c(new Error("Image load timed out"))},s)})}function i(r){return Math.round(r*1e3)/1e3}const o=e.get("image"),l=e.get("aspectRatio");if(fetch(o).then(r=>r.blob()).then(r=>{r.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!l||l===.7041))return n(o).then(r=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&r.width&&r.height&&(e.set("aspectRatio",i(r.height/r.width)),e.set("height",r.height),e.set("width",r.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}},jt={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>"}}}]},Pt={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 Bt(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(A,{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 At={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 "}}},Ft={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 Vt(e){var l;const[t,n]=h.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(r){return e.tabs&&e.tabs[r].content}function o(r){r===t&&e.collapsible?n(-1):n(r)}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:(l=e.tabs)==null?void 0:l.map((r,s)=>a.jsx("span",{className:`builder-tab-wrap ${t===s?"builder-tab-active":""}`,style:{...t===s?e.activeTabStyle:{}},onClick:u=>o(s),children:a.jsx(A,{parent:e.builderBlock.id,path:`tabs.${s}.label`,blocks:r.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},s))}),i(t)?a.jsx("div",{children:a.jsx(A,{parent:e.builderBlock.id,path:`tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const Nt={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 we(e){function t(){var s;const n=e.builderContext,{context:i,localState:o,rootState:l,rootSetState:r}=n;return String(((s=e.text)==null?void 0:s.toString())||"").replace(/{{([^}]+)}}/g,(u,c)=>F({code:c,context:i,localState:o,rootState:l,rootSetState:r}))}return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:t()},style:{outline:"none"}})}const Wt={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 $t(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,l]=h.useState(()=>[]);return h.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const r=t.current.getElementsByTagName("script");for(let u=0;u<r.length;u++){const c=r[u];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const b=document.createElement("script");b.async=!0,b.src=c.src,document.head.appendChild(b)}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(b){console.warn("`CustomCode`: Error running script:",b)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Dt={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}]},Ot=["text/javascript","application/javascript","application/ecmascript"],Lt=e=>Ot.includes(e.type);function Ut(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[o,l]=h.useState(()=>[]),[r,s]=h.useState(()=>!1);function u(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let b=0;b<c.length;b++){const p=c[b];if(p.src&&!n.includes(p.src)){n.push(p.src);const m=document.createElement("script");m.async=!0,m.src=p.src,document.head.appendChild(m)}else if(Lt(p)&&!o.includes(p.innerText))try{o.push(p.innerText),new Function(p.innerText)()}catch(m){console.warn("`Embed`: Error running script:",m)}}}return h.useEffect(()=>{t.current&&!r&&(s(!0),u())},[t.current,r]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Ht={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}},Mt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],_t=()=>{const e=process.env.NODE_ENV||"production";return Mt.includes(e)?e:"production"};function qt(e){var p,m;const t=h.useRef(null),[n,i]=h.useState(()=>"unsubmitted"),[o,l]=h.useState(()=>null),[r,s]=h.useState(()=>"");function u(S){var C,k;const f={...e.builderContext.rootState,...S};e.builderContext.rootSetState?(k=(C=e.builderContext).rootSetState)==null||k.call(C,f):e.builderContext.rootState=f}function c(){return g.isEditing()&&e.previewState||n}function b(S){var C;const f=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")S.preventDefault();else if(f){if(!(e.action||e.sendSubmissionsTo==="email")){S.preventDefault();return}S.preventDefault();const k=S.currentTarget||S.target,y=e.customHeaders||{};let x;const v=new FormData(k),P=Array.from(k.querySelectorAll("input,select,textarea")).filter(d=>!!d.name).map(d=>{let I;const B=d.name;if(d instanceof HTMLInputElement)if(d.type==="radio"){if(d.checked)return I=d.name,{key:B,value:I}}else if(d.type==="checkbox")I=d.checked;else if(d.type==="number"||d.type==="range"){const R=d.valueAsNumber;isNaN(R)||(I=R)}else d.type==="file"?I=d.files:I=d.value;else I=d.value;return{key:B,value:I}});let T=e.contentType;if(e.sendSubmissionsTo==="email"&&(T="multipart/form-data"),Array.from(P).forEach(({value:d})=>{(d instanceof File||Array.isArray(d)&&d[0]instanceof File||d instanceof FileList)&&(T="multipart/form-data")}),T!=="application/json")x=v;else{const d={};Array.from(P).forEach(({value:I,key:B})=>{fe(d,B,I)}),x=JSON.stringify(d)}T&&T!=="multipart/form-data"&&(f&&((C=e.action)!=null&&C.includes("zapier.com"))||(y["content-type"]=T));const E=new CustomEvent("presubmit",{detail:{body:x}});if(t.current&&(t.current.dispatchEvent(E),E.defaultPrevented))return;i("sending");const j=`${_t()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,w=e.sendSubmissionsTo==="email"?j:e.action;g.logFetch(w),fetch(w,{body:x,headers:y,method:e.method||"post"}).then(async d=>{let I;const B=d.headers.get("content-type");if(B&&B.indexOf("application/json")!==-1?I=await d.json():I=await d.text(),!d.ok&&e.errorMessagePath){let R=de(I,e.errorMessagePath);R&&(typeof R!="string"&&(R=JSON.stringify(R)),s(R),u({formErrorMessage:R}))}if(l(I),i(d.ok?"success":"error"),d.ok){const R=new CustomEvent("submit:success",{detail:{res:d,body:I}});if(t.current){if(t.current.dispatchEvent(R),R.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const $=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent($),$.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},d=>{const I=new CustomEvent("submit:error",{detail:{error:d}});t.current&&(t.current.dispatchEvent(I),I.defaultPrevented)||(l(d),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:S=>b(S),...e.attributes,children:[e.builderBlock&&e.builderBlock.children?a.jsx(a.Fragment,{children:(m=(p=e.builderBlock)==null?void 0:p.children)==null?void 0:m.map((S,f)=>a.jsx(W,{block:S,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${f}`))}):null,c()==="error"?a.jsx(A,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?a.jsx(A,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&o?a.jsx("pre",{className:"builder-form-error-text pre-135d4696",children:JSON.stringify(o,null,2)}):null,c()==="success"?a.jsx(A,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-135d4696 { padding: 10px; color: red; text-align: center; }"})," "]})}const Kt={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 zt(e){return h.createElement("input",{...e.attributes,key:g.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 Jt={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 Gt(e){var t;return h.createElement("select",{...e.attributes,value:e.value,key:g.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 Yt={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 Xt={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 en={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 tn(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},g.isEditing()&&e.imgSrc||"default-key")}const nn={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 Ee(e){var i,o,l,r,s,u,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&&((l=(o=e.builderBlock)==null?void 0:o.children)!=null&&l.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(s=(r=e.builderBlock)==null?void 0:r.children)!=null&&s.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(c=(u=e.builderBlock)==null?void 0:u.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 on=()=>[{component:$t,...Wt},{component:Ut,...Dt},{component:qt,...Ht},{component:zt,...Kt},{component:Qt,...Yt},{component:Gt,...Jt},{component:Zt,...Xt},{component:tn,...en},{component:Ee,...nn}],ae=()=>[{component:ce,...It},{component:ke,...wt},{component:Ce,...Et},{component:Te,...Rt},{component:Ie,...jt},{component:Bt,...Pt},{component:Ae,...At},{component:we,...Nt},{component:Vt,...Ft},{component:Tt,...Ct},...on()],an=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
56
56
|
function getAndSetVariantId() {
|
|
57
57
|
function setCookie(name, value, days) {
|
|
58
58
|
let expires = '';
|
|
@@ -142,15 +142,15 @@
|
|
|
142
142
|
thisScriptEl?.remove();
|
|
143
143
|
}
|
|
144
144
|
return;
|
|
145
|
-
}`,
|
|
146
|
-
window.${
|
|
147
|
-
window.${
|
|
145
|
+
}`,Re="builderIoAbTest",je="builderIoRenderContent",O=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),ln=({canTrack:e,content:t})=>!(!(O(t).length>0)||!e||g.isBrowser()),sn=e=>e==="react"||e==="reactNative",Pe=sn(g.TARGET),cn=()=>`
|
|
146
|
+
window.${Re} = ${an}
|
|
147
|
+
window.${je} = ${rn}
|
|
148
148
|
`,un=(e,t)=>`
|
|
149
|
-
window.${
|
|
150
|
-
"${t}",${JSON.stringify(e)}, ${
|
|
151
|
-
)`,dn=({contentId:e,variationId:t})=>`window.${
|
|
152
|
-
"${t}", "${e}", ${
|
|
153
|
-
)`;function
|
|
149
|
+
window.${Re}(
|
|
150
|
+
"${t}",${JSON.stringify(e)}, ${Pe}
|
|
151
|
+
)`,dn=({contentId:e,variationId:t})=>`window.${je}(
|
|
152
|
+
"${t}", "${e}", ${Pe}
|
|
153
|
+
)`;function G(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function re(e){return Math.round(e*1e3)/1e3}const mn=(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},fn=e=>mn(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),le=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,l=re(i/n.width),r=re(o/n.height);return{x:l,y:r}},gn=e=>{const t=e.target,n=t&&fn(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?le({event:e,target:t}):void 0,builderTargetOffset:n?le({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}},hn=e=>{var l,r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(r=e.fileUrl)!=null?r:(l=e==null?void 0:e.files)==null?void 0:l.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');
|
|
@@ -181,8 +181,8 @@ font-weight: ${s};
|
|
|
181
181
|
text-align: inherit;
|
|
182
182
|
font-family: inherit;
|
|
183
183
|
}
|
|
184
|
-
`,yn=e=>e?"":xn,vn=e=>`variant-${e}`;function Sn(e){var x,
|
|
184
|
+
`,yn=e=>e?"":xn,vn=e=>`variant-${e}`;function Sn(e){var x,v,P;const t=h.useRef(null);function n(T){var j,w;const E={...e.builderContextSignal.rootState,...T};e.builderContextSignal.rootSetState?(w=(j=e.builderContextSignal).rootSetState)==null||w.call(j,E):e.setBuilderContextSignal(d=>({...d,rootState:E}))}function i(T){var j,w,d,I,B;const E={...e.builderContextSignal.content,...T,data:{...(j=e.builderContextSignal.content)==null?void 0:j.data,...T==null?void 0:T.data},meta:{...(w=e.builderContextSignal.content)==null?void 0:w.meta,...T==null?void 0:T.meta,breakpoints:((d=T==null?void 0:T.meta)==null?void 0:d.breakpoints)||((B=(I=e.builderContextSignal.content)==null?void 0:I.meta)==null?void 0:B.breakpoints)}};e.setBuilderContextSignal(R=>({...R,content:E}))}function o(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[l,r]=h.useState(()=>e.contentWrapper||"div");function s(T){return g.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:E=>{var d;const{breakpoints:j,contentId:w}=E;!w||w!==((d=e.builderContextSignal.content)==null?void 0:d.id)||j&&i({meta:{breakpoints:j}})},animation:E=>{be(E)},contentUpdate:E=>{i(E)}}})(T)}const[u,c]=h.useState(()=>({})),[b,p]=h.useState(()=>({})),[m,S]=h.useState(()=>!1);function f(T){var E,j;if(e.builderContextSignal.content){const w=(E=e.builderContextSignal.content)==null?void 0:E.testVariationId,d=(j=e.builderContextSignal.content)==null?void 0:j.id;g._track({apiHost:e.apiHost,type:"click",canTrack:g.getDefaultCanTrack(e.canTrack),contentId:d,apiKey:e.apiKey,variationId:w!==d?w:void 0,...gn(T),unique:!m})}m||S(!0)}function C(){var E,j,w;const T=(w=(j=(E=e.builderContextSignal.content)==null?void 0:E.data)==null?void 0:j.httpRequests)!=null?w:{};Object.entries(T).forEach(([d,I])=>{if(!I||b[d]||u[d]&&!g.isEditing())return;b[d]=!0;const B=I.replace(/{{([^}]+)}}/g,(R,$)=>String(F({code:$,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));g.logFetch(B),fetch(B).then(R=>R.json()).then(R=>{n({[d]:R}),u[d]=!0}).catch(R=>{console.error("error fetching dynamic data",I,R)}).finally(()=>{b[d]=!1})})}function k(){g.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:Q(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const y=h.useRef(!1);return y.current||(C(),k(),y.current=!0),h.useEffect(()=>{var T,E;if(g.isBrowser()){if(g.isEditing()&&!e.isNestedRender&&(window.addEventListener("message",s),g.registerInsertMenu(),g.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(w=>{var I;const d=g.createRegisterComponentMessage(w);(I=window.parent)==null||I.postMessage(d,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",k)),e.builderContextSignal.content&&g.getDefaultCanTrack(e.canTrack)){const w=(T=e.builderContextSignal.content)==null?void 0:T.testVariationId,d=(E=e.builderContextSignal.content)==null?void 0:E.id,I=e.apiKey;g._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:d,apiKey:I,variationId:w!==d?w:void 0})}if(g.isPreviewing()&&!g.isEditing()){const w=new URL(location.href).searchParams,d=w.get("builder.preview"),I=w.get(`builder.overrides.${d}`),B=w.get("apiKey")||w.get("builder.space");d===e.model&&B===e.apiKey&&(!e.content||I===e.content.id)&&g.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(R=>{R&&i(R)})}}},[]),h.useEffect(()=>{e.content&&i(e.content)},[e.content]),h.useEffect(()=>{k()},[e.builderContextSignal.rootState]),h.useEffect(()=>{e.data&&n(e.data)},[e.data]),h.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),h.useEffect(()=>()=>{g.isBrowser()&&(window.removeEventListener("message",s),window.removeEventListener("builder:component:stateChangeListenerActivated",k))},[]),a.jsx(L.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(l,{ref:t,onClick:T=>f(T),"builder-content-id":(x=e.builderContextSignal.content)==null?void 0:x.id,"builder-model":e.model,className:vn(((v=e.content)==null?void 0:v.testVariationId)||((P=e.content)==null?void 0:P.id)),...o(),...e.contentWrapperProps,children:e.children}):null})}function kn(e){const[t,n]=h.useState(()=>`
|
|
185
185
|
${pn({cssCode:e.cssCode,contentId:e.contentId})}
|
|
186
186
|
${bn({customFonts:e.customFonts})}
|
|
187
187
|
${yn(e.isNestedRender)}
|
|
188
|
-
`.trim());return a.jsx(
|
|
188
|
+
`.trim());return a.jsx(H,{id:"builderio-content",styles:t,nonce:e.nonce})}const Cn=({content:e,data:t,locale:n})=>{var l,r,s;const i={},o=((l=e==null?void 0:e.data)==null?void 0:l.state)||{};return(s=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||s.forEach(u=>{u.name&&u.defaultValue!==void 0&&(i[u.name]=u.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},Tn=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function se(e){var c,b,p,m,S,f,C,k,y;const[t,n]=h.useState(()=>{var x,v;return dn({variationId:(x=e.content)==null?void 0:x.testVariationId,contentId:(v=e.content)==null?void 0:v.id})});function i(x){s(v=>({...v,rootState:x}))}const[o,l]=h.useState(()=>{var x;return[...ae(),...((x=e.customComponents)==null?void 0:x.filter(({models:v})=>!(v!=null&&v.length)||!e.model?!0:v.includes(e.model)))||[]].reduce((v,{component:P,...T})=>({...v,[T.name]:{component:P,...g.serializeIncludingFunctions(T)}}),{})}),[r,s]=h.useState(()=>{var x;return{content:Tn({content:e.content,data:e.data}),localState:void 0,rootState:Cn({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ae(),...((x=e.customComponents)==null?void 0:x.filter(({models:v})=>!(v!=null&&v.length)||!e.model?!0:v.includes(e.model)))||[]].reduce((v,{component:P,...T})=>({...v,[T.name]:g.serializeIncludingFunctions(T)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||""}}),u=h.useRef(!1);if(!u.current){e.apiKey||g.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const x=(b=(c=r.content)==null?void 0:c.data)==null?void 0:b.jsCode;x&&F({code:x,context:e.context||{},localState:void 0,rootState:r.rootState,rootSetState:v=>{Object.assign(r.rootState,v)},isExpression:!1}),u.current=!0}return a.jsx(ue.Provider,{value:{registeredComponents:o},children:a.jsxs(Sn,{apiHost:e.apiHost,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:r,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,isNestedRender:e.isNestedRender,setBuilderContextSignal:s,children:[e.isSsrAbTest?a.jsx(G,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,a.jsx(kn,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(p=r.content)==null?void 0:p.id,cssCode:(S=(m=r.content)==null?void 0:m.data)==null?void 0:S.cssCode,customFonts:(C=(f=r.content)==null?void 0:f.data)==null?void 0:C.customFonts}),a.jsx(A,{blocks:(y=(k=r.content)==null?void 0:k.data)==null?void 0:y.blocks,context:r,registeredComponents:o,linkComponent:e.linkComponent})]})})}function Be(e){var r;const[t,n]=h.useState(()=>ln({canTrack:g.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var s;return un(O(e.content).map(u=>({id:u.testVariationId,testRatio:u.testRatio})),((s=e.content)==null?void 0:s.id)||"")}function o(){return O(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")}function l(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:g.handleABTestingSync({item:e.content,canTrack:g.getDefaultCanTrack(e.canTrack)})}return h.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.isNestedRender&&g.TARGET!=="reactNative"?a.jsx(G,{id:"builderio-init-variants-fns",scriptStr:cn(),nonce:e.nonce||""}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(H,{id:"builderio-variants",styles:o(),nonce:e.nonce||""}),a.jsx(G,{id:"builderio-variants-visibility",scriptStr:i(),nonce:e.nonce||""}),(r=O(e.content))==null?void 0:r.map(s=>a.jsx(se,{apiHost:e.apiHost,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(se,{apiHost:e.apiHost,nonce:e.nonce,isNestedRender:e.isNestedRender,content:l(),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 In=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return g.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{g.logger.error("Could not fetch symbol content: ",n)})};function Ae(e){var s,u,c,b;function t(){return"div"}function n(){return"div"}function i(){var p,m;return[e.attributes[N()],"builder-symbol",(p=e.symbol)!=null&&p.inline?"builder-inline-symbol":void 0,(m=e.symbol)!=null&&m.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[o,l]=h.useState(()=>{var p;return(p=e.symbol)==null?void 0:p.content});function r(){o||In({symbol:e.symbol,builderContextValue:e.builderContext}).then(p=>{p&&l(p)})}return h.useEffect(()=>{},[]),h.useEffect(()=>{r()},[e.symbol]),a.jsx("div",{...e.attributes,className:i(),children:a.jsx(Be,{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:{...(u=e.symbol)==null?void 0:u.data,...e.builderContext.localState,...(c=o==null?void 0:o.data)==null?void 0:c.state},canTrack:e.builderContext.canTrack,model:(b=e.symbol)==null?void 0:b.model,content:o,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.Blocks=A;exports.BuilderContext=L;exports.Button=ce;exports.Columns=ke;exports.Content=Be;exports.Fragment=Ce;exports.Image=Te;exports.Section=Ie;exports.Symbol=Ae;exports.Text=we;exports.Video=Ee;
|