@builder.io/sdk-react 3.0.5 → 3.0.6
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 +166 -29
- package/lib/browser/blocks-exports.mjs +1179 -765
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +17 -16
- package/lib/browser/server-entry-a1c64831.cjs +2 -0
- package/lib/browser/{server-entry-785c0408.js → server-entry-df5e89e5.js} +279 -237
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-cd6e0363.js → accordion-289f3464.js} +1 -1
- package/lib/edge/{accordion-190c4426.cjs → accordion-fbfb71f4.cjs} +1 -1
- package/lib/edge/{blocks-766e8d45.cjs → blocks-459a090b.cjs} +10 -10
- package/lib/edge/{blocks-fe2d7c1a.js → blocks-582a7fd7.js} +87 -87
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +13 -12
- package/lib/edge/{button-6a27481c.js → button-9b112da6.js} +2 -2
- package/lib/edge/{button-694fcd4f.cjs → button-da357144.cjs} +1 -1
- package/lib/edge/{columns-b38bf0f7.cjs → columns-a211113f.cjs} +1 -1
- package/lib/edge/{columns-90e6407e.js → columns-aba58dda.js} +3 -3
- package/lib/edge/{content-variants-cbb89349.js → content-variants-08f4371c.js} +165 -124
- package/lib/edge/content-variants-4b5899b5.cjs +134 -0
- package/lib/edge/dynamic-blocks-exports.cjs +3 -1
- package/lib/edge/dynamic-blocks-exports.mjs +5 -2
- package/lib/edge/{form-16bbf874.js → form-4d4553c2.js} +3 -3
- package/lib/edge/{form-547645eb.cjs → form-e3a3afd4.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-8b719c6b.js → get-class-prop-name-38c2baca.js} +1 -1
- package/lib/edge/{get-class-prop-name-58770197.cjs → get-class-prop-name-fbe244e3.cjs} +1 -1
- package/lib/edge/{img-8859c851.cjs → img-8d549af8.cjs} +1 -1
- package/lib/edge/{img-d3351743.js → img-c49066fa.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +18 -17
- package/lib/edge/{input-4fe0fc6d.cjs → input-1ae3842f.cjs} +1 -1
- package/lib/edge/{input-24c601b4.js → input-e7301f4e.js} +1 -1
- package/lib/edge/personalization-container-035be6ba.js +384 -0
- package/lib/edge/personalization-container-25cd8b5e.cjs +138 -0
- package/lib/edge/{select-af05377b.js → select-4187b229.js} +1 -1
- package/lib/edge/{select-c73bd418.cjs → select-64fdaa79.cjs} +1 -1
- package/lib/edge/server-entry-2ef4e66a.cjs +2 -0
- package/lib/edge/{server-entry-67bfc740.js → server-entry-61fca4f7.js} +322 -280
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-759c8dd9.cjs → slot-995f63c2.cjs} +1 -1
- package/lib/edge/{slot-32a4df0c.js → slot-d6c46a42.js} +3 -3
- package/lib/edge/{symbol-8d63aa7d.cjs → symbol-498daa97.cjs} +1 -1
- package/lib/edge/{symbol-50360a37.js → symbol-623dc717.js} +2 -2
- package/lib/edge/{tabs-6535c934.js → tabs-12ba41b1.js} +3 -3
- package/lib/edge/{tabs-fc6c1700.cjs → tabs-d39499cd.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +168 -31
- package/lib/node/blocks-exports.mjs +1292 -878
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +17 -16
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/{server-entry-ffc70868.js → server-entry-27d9d31e.js} +279 -237
- package/lib/node/server-entry-98ebff74.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-2cea7252.js → setIvm-2dde9074.js} +1 -1
- package/lib/node/{setIvm-4ce0db03.cjs → setIvm-784fe19f.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-c0d50009.js → should-force-browser-runtime-in-node-80f081c8.js} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-d3e6df07.cjs → should-force-browser-runtime-in-node-cd6baa94.cjs} +1 -1
- package/package.json +1 -1
- package/types/blocks/personalization-container/component-info.d.ts +2 -0
- package/types/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -0
- package/types/blocks/personalization-container/helpers.d.ts +27 -0
- package/types/blocks/personalization-container/index.d.ts +1 -0
- package/types/blocks/personalization-container/personalization-container.d.ts +4 -0
- package/types/blocks/personalization-container/personalization-container.types.d.ts +14 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/helpers/user-attributes.d.ts +17 -0
- package/types/index-helpers/blocks-exports.d.ts +1 -0
- package/types/types/input.d.ts +1 -0
- package/lib/browser/server-entry-101d66b8.cjs +0 -2
- package/lib/edge/content-variants-4e385c19.cjs +0 -134
- package/lib/edge/server-entry-3c7fa63a.cjs +0 -2
- package/lib/node/server-entry-95273908.cjs +0 -2
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`),
|
|
3
|
-
${
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./server-entry-98ebff74.cjs"),o=require("react/jsx-runtime"),h=require("react"),A=require("./setIvm-784fe19f.cjs"),Fe=require("./should-force-browser-runtime-in-node-cd6baa94.cjs");function We(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const De=We(h),$e=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Oe=e=>typeof e=="string"&&$e.has(e.toLowerCase());function X(e){return o.jsx(o.Fragment,{children:Oe(e.TagName)?o.jsx(o.Fragment,{children:o.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):o.jsx(o.Fragment,{children:typeof e.TagName=="string"?o.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):o.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const W=()=>{switch(y.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function de(e){function t(){return{...e.attributes,[W()]:`${e.link?"":"builder-button"} ${e.attributes[W()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return o.jsx(X,{attributes:t(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}const q=h.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{},nonce:"",model:""}),me=h.createContext({registeredComponents:{}}),fe=(e,t,n)=>{const i=String.prototype.split.call(t,/[,[\].]+?/).filter(Boolean).reduce((a,s)=>a!=null?a[s]:a,e);return i===void 0||i===e?n:i},Le=({code:e,builder:t,context:n,event:i,localState:a,rootSetState:s,rootState:r})=>{const l=A.getFunctionArguments({builder:t,context:n,event:i,state:A.flattenState({rootState:r,localState:a,rootSetState:s})});return new Function(...l.map(([u])=>u),e)(...l.map(([,u])=>u))},_e=e=>y.isBrowser()||Fe.shouldForceBrowserRuntimeInNode({shouldLogWarning:!0})?Le(e):A.runInNode(e),Ue=/^(return )?(\s*)?state(?<getPath>(\.\w+)+)(\s*);?$/,qe=/(\s)*var(\s)+_virtual_index(\s)*=(\s)*state(?<getPath>(\.\w+)+)(\s*);?(\s)*return(\s)*_virtual_index(\s)*/,He=e=>{var t,n,i,a,s,r;return((i=(n=(t=Ue.exec(e.trim()))==null?void 0:t.groups)==null?void 0:n.getPath)==null?void 0:i.slice(1))||((r=(s=(a=qe.exec(e.trim()))==null?void 0:a.groups)==null?void 0:s.getPath)==null?void 0:r.slice(1))};function N({code:e,context:t,localState:n,rootState:i,rootSetState:a,event:s,isExpression:r=!0}){if(e.trim()==="")return;const l=He(e.trim());if(l)return fe({...i,...n},l);const u={code:A.parseCode(e,{isExpression:r}),builder:A.getBuilderGlobals(),context:t,event:s,rootSetState:a,rootState:i,localState:n};try{return _e(u)}catch(c){y.logger.error("Failed code evaluation: "+c.message,{code:e});return}}function Me(e,t){var n;return{...(n=e.component)==null?void 0:n.options,...e.options,...ze(e,t)}}const ze=(e,t)=>{var n,i;if(((n=e.component)==null?void 0:n.name)==="Text"&&((i=e.component.options)!=null&&i.text)&&typeof e.component.options.text=="string")return{...e.component.options,text:e.component.options.text.replace(/{{([^}]+)}}/g,(a,s)=>N({code:s,context:t,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState}))}};function Ke(e,...t){const n=Object.assign({},e);for(const i of t)delete n[i];return n}function _(e,t,n=null,i=null,a=new WeakSet){if(e==null||typeof e!="object"){t(e,s=>{n!==null&&i!==null&&(n[i]=s)});return}a.has(e)||(a.add(e),Array.isArray(e)?e.forEach((s,r)=>{t(s,u=>{e[r]=u}),_(s,t,e,r,a)}):Object.entries(e).forEach(([s,r])=>{t(r,u=>{e[s]=u}),_(r,t,e,s,a)}))}function ge(e){return e&&typeof e=="object"&&e["@type"]==="@builder.io/core:LocalizedValue"}function Ge(e){if(!e||!Object.getOwnPropertyNames(e).length)return!1;let t=!1;return _(e,n=>{if(ge(n)){t=!0;return}}),t}function Je(e,t){return!e||!Object.getOwnPropertyNames(e).length?{}:(_(e,(n,i)=>{var a;ge(n)&&i((a=n[t])!=null?a:void 0)}),e)}function Qe(e,t){var n,i;return(n=e.component)!=null&&n.options&&Ge((i=e.component)==null?void 0:i.options)&&(t||console.warn("[Builder.io] In order to use localized fields in Builder, you must pass a locale prop to the BuilderComponent or to options object while fetching the content to resolve localized fields. Learn more: https://www.builder.io/c/docs/localization-inline#targeting-and-inline-localization"),e.component.options=Je(e.component.options,t!=null?t:"Default")),e}function Y(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>Y(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]=Y(e[n]));return t}const Ye=["svelte","vue","angular","qwik","solid"].includes(y.TARGET),Xe=e=>{if(Ye){const t=A.fastClone(e);return{...t,properties:{...t.properties},actions:{...t.actions}}}else{const t=Y(Ke(e,"children","meta"));return{...t,properties:{...t.properties},actions:{...t.actions},children:e.children,meta:e.meta}}},Ze=({block:e,context:t,localState:n,rootState:i,rootSetState:a})=>{if(!e.bindings)return e;const s=Xe(e);for(const r in e.bindings){const l=e.bindings[r],u=N({code:l,localState:n,rootState:i,rootSetState:a,context:t});A.set(s,r,u)}return s};function et({block:e,context:t,localState:n,rootState:i,rootSetState:a}){let s=Qe(e,i.locale);return s=s,Ze({block:s,localState:n,rootState:i,rootSetState:a,context:t})}const H=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"";function tt(e,t,n={}){let i,a,s,r=null,l=0;const u=function(){l=n.leading===!1?0:Date.now(),r=null,s=e.apply(i,a),r||(i=a=null)};return function(){const c=Date.now();!l&&n.leading===!1&&(l=c);const g=t-(c-l);return i=this,a=arguments,g<=0||g>t?(r&&(clearTimeout(r),r=null),l=c,s=e.apply(i,a),r||(i=a=null)):!r&&n.trailing!==!1&&(r=setTimeout(u,g)),s}}function F(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const a=arguments[i];if(a!=null)for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&(n[s]=a[s])}return n}function nt(e){for(const t of e)switch(t.trigger){case"pageLoad":pe(t);break;case"scrollInView":at(t);break}}function he(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function be(e,t){const n=it(e),i=getComputedStyle(t),a=e.steps[0].styles,s=e.steps[e.steps.length-1].styles,r=[a,s];for(const l of r)for(const u of n)u in l||(l[u]=i[u])}function it(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 pe(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){he(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{be(e,n),n.style.transition="none",n.style.transitionDelay="0",F(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${H(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),F(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function at(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){he(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{be(e,n);let i=!1,a=!1;function s(){!i&&l(n)?(i=!0,a=!0,setTimeout(()=>{F(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",r),setTimeout(()=>{a=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")},(e.duration+(e.delay||0))*1e3+100)})):e.repeat&&i&&!a&&!l(n)&&(i=!1,F(n.style,e.steps[0].styles))}const r=tt(s,200,{leading:!1});function l(g){const b=g.getBoundingClientRect(),f=window.innerHeight,d=(e.thresholdPercent||0)/100*f;return b.bottom>d&&b.top<f-d}const u=e.steps[0].styles;function c(){F(n.style,u)}c(),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${H(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s")}),document.addEventListener("scroll",r,{capture:!0,passive:!0}),s()})}const ye=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${H(n)}: ${i};`}).filter(y.checkIsDefined),ot=e=>ye(e).join(`
|
|
2
|
+
`),O=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
|
+
${ot(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
5
5
|
${i}
|
|
6
|
-
}`:i};function rt({style:e}){return e}const
|
|
6
|
+
}`:i};function rt({style:e}){return e}const st=({block:e,context:t})=>xe(rt({style:e.style||{},context:t,block:e}));function xe(e){switch(y.TARGET){case"svelte":case"vue":case"solid":case"angular":return ye(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const ve=(e,t)=>e?t?e.models&&e.models.length>0&&!e.models.includes(t):!1:!0,lt=({block:e,registeredComponents:t,model:n})=>{var s;const i=(s=e.component)==null?void 0:s.name;if(!i)return null;const a=t[i];if(!a||ve(a,n)){console.warn(`
|
|
7
7
|
Could not find a registered component named "${i}".
|
|
8
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`);return}else return
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`);return}else return a},ct=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const a=N({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(a))return;const s=n.collection.split(".").pop(),r=n.itemName||(s?s+"Item":"item");return a.map((u,c)=>({context:{...t,localState:{...t.localState,$index:c,$item:u,[r]:u,[`$${r}Index`]:c}},block:i}))},ut=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},dt=(e,t,n)=>{var i;return(i=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&i.builderComponents?{builderComponents:Object.fromEntries(Object.entries(t).filter(([s,r])=>!ve(r,n)))}:{}},mt=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},ft=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},Se={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},te=(e,t=Se)=>`@media (max-width: ${t[e].max}px)`,ke=({small:e,medium:t})=>{const n=A.fastClone(Se);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const a=n.small.max+1;n.medium={max:t,min:a,default:a+1};const s=n.medium.max+1;return n.large={max:2e3,min:s,default:s+1},n};function D(e){return o.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function gt(e){function t(){const i=e.block;return y.checkIsDefined(i.hide)?!i.hide:y.checkIsDefined(i.show)?i.show:!0}function n(){var S,v,k;const i=e.block,a=i.responsiveStyles,s=e.context.content,r=ke(((S=s==null?void 0:s.meta)==null?void 0:S.breakpoints)||{}),l=a==null?void 0:a.large,u=a==null?void 0:a.medium,c=a==null?void 0:a.small,g=i.id;if(!g)return"";const b=l?O({className:g,styles:l}):"",f=u?O({className:g,styles:u,mediaQuery:te("medium",r)}):"",T=c?O({className:g,styles:c,mediaQuery:te("small",r)}):"",d=i.animations&&i.animations.find(I=>I.trigger==="hover");let p="";if(d){const I=((k=(v=d.steps)==null?void 0:v[1])==null?void 0:k.styles)||{};p=O({className:`${g}:hover`,styles:{...I,transition:`all ${d.duration}s ${H(d.easing)}`,transitionDelay:d.delay?`${d.delay}s`:"0s"}})||""}return[b,f,T,p].join(" ")}return o.jsx(o.Fragment,{children:n()&&t()?o.jsx(o.Fragment,{children:o.jsx(D,{id:"builderio-block",styles:n(),nonce:e.context.nonce})}):null})}function ht(e){return e.charAt(0).toUpperCase()+e.slice(1)}const bt=e=>`on${ht(e)}`,pt=(e,t)=>n=>N({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function Ce(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const a in n){if(!n.hasOwnProperty(a))continue;const s=n[a];let r=bt(a);if(e.stripPrefix)switch(y.TARGET){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=pt(s,e)}return t}function yt({properties:e}){return e}const xt=e=>({href:e.href});function Z({block:e,context:t}){var i;const n={...xt(e),...e.properties,"builder-id":e.id,style:st({block:e,context:t}),[W()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return yt({properties:n,context:t,block:e})}function vt(e){return o.jsx(X,{TagName:e.Wrapper,attributes:Z({block:e.block,context:e.context}),actionAttributes:Ce({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 St(e){return h.useEffect(()=>{},[]),o.jsx(o.Fragment,{children:e.children})}function kt(e){function t(){return e.includeBlockProps?{...Z({block:e.block,context:e.context}),...Ce({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return o.jsx(o.Fragment,{children:e.Wrapper.load?o.jsx(o.Fragment,{children:o.jsx(St,{load:e.Wrapper.load,fallback:e.Wrapper.fallback,props:e.wrapperProps,attributes:t(),children:e.children})}):o.jsx(e.Wrapper,{...e.wrapperProps,attributes:t(),children:e.children})})}const Ct=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:a,isInteractive:s,contextValue:r})=>{const l={...e,...a?{attributes:Z({block:t,context:r})}:{}};return s?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:a}:l};function ne(e){var i;const[t,n]=h.useState(()=>e.isInteractive?kt:e.componentRef);return o.jsx(o.Fragment,{children:e.componentRef?o.jsx(o.Fragment,{children:o.jsx(t,{...Ct({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(a=>o.jsx(M,{block:a,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},a.id))})}):null})}function ie(e){const[t,n]=h.useState(()=>e.repeatContext);return o.jsx(q.Provider,{value:t,children:o.jsx(M,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})})}function M(e){var g,b,f,T;function t(){return ct({block:e.block,context:e.context})}const[n,i]=h.useState(()=>({value:null,update:!1}));function a(){var p;if(n.value&&!n.update&&!y.isPreviewing())return n.value;const d=(p=e.block.repeat)!=null&&p.collection?e.block:et({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context});return n.value=d,n.update=!1,d}function s(){return lt({block:a(),registeredComponents:e.registeredComponents,model:e.context.model})}function r(){var p;return e.block.tagName==="a"||((p=a().properties)==null?void 0:p.href)||a().href?e.linkComponent||"a":e.block.tagName||"div"}function l(){var S,v;if((S=e.block.repeat)!=null&&S.collection)return!!((v=t==null?void 0:t())!=null&&v.length);const d="hide"in a()?a().hide:!1;return("show"in a()?a().show:!0)&&!d}function u(){var p,S;return!((p=s==null?void 0:s())!=null&&p.component)&&!t()?(S=a().children)!=null?S:[]:[]}function c(){var d,p,S,v;return{blockChildren:(d=a().children)!=null?d:[],componentRef:(p=s==null?void 0:s())==null?void 0:p.component,componentOptions:{...Me(a(),e.context),...mt(s(),a()),...ft(s(),e.context),...ut(s(),e.linkComponent),...dt(s(),e.registeredComponents,e.context.model)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:a(),includeBlockProps:((S=s==null?void 0:s())==null?void 0:S.noWrap)===!0,isInteractive:!((v=s==null?void 0:s())!=null&&v.isRSC&&y.TARGET==="rsc")}}return h.useEffect(()=>{const d=a().id,p=a().animations;p&&d&&nt(p.map(S=>({...S,elementId:d})))},[]),h.useEffect(()=>{n.update=!0}),o.jsx(o.Fragment,{children:l()?o.jsxs(o.Fragment,{children:[o.jsx(gt,{block:a(),context:e.context}),(g=s==null?void 0:s())!=null&&g.noWrap?t()?o.jsx(o.Fragment,{children:(T=t())==null?void 0:T.map((d,p)=>o.jsx(ie,{repeatContext:d.context,block:d.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},p))}):o.jsx(ne,{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}):o.jsx(o.Fragment,{children:t()?o.jsx(o.Fragment,{children:(f=t())==null?void 0:f.map((d,p)=>o.jsx(ie,{repeatContext:d.context,block:d.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},p))}):o.jsxs(vt,{Wrapper:r(),block:a(),context:e.context,children:[o.jsx(ne,{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}),(b=u())==null?void 0:b.map(d=>o.jsx(M,{block:d,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},d.id))]})})]}):null})}function Tt(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="this.",l="component.options.";return e.path.startsWith(r)?e.path.replace(r,""):e.path.startsWith(l)?e.path:`${l}${e.path||""}`}function a(){var r,l;y.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((l=window.parent)==null||l.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}function s(){var r,l;y.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((l=window.parent)==null||l.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:i()}},"*"))}return h.useEffect(()=>{},[]),o.jsxs(o.Fragment,{children:[o.jsx(e.BlocksWrapper,{ref:t,className:n()+" props-blocks-wrapper-2936bbfc","builder-path":i(),"builder-parent-id":e.parent,style:e.styleProp,onClick:r=>a(),onMouseEnter:r=>s(),onKeyPress:r=>a(),...e.BlocksWrapperProps,children:e.children}),o.jsx("style",{children:`.props-blocks-wrapper-2936bbfc {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
12
|
-
}`})]})}function
|
|
13
|
-
@media (max-width: ${
|
|
12
|
+
}`})]})}function B(e){var i,a,s;const t=h.useContext(q),n=h.useContext(me);return o.jsx(Tt,{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:((a=e.context)==null?void 0:a.BlocksWrapperProps)||(t==null?void 0:t.BlocksWrapperProps),children:e.blocks?o.jsx(o.Fragment,{children:(s=e.blocks)==null?void 0:s.map(r=>o.jsx(M,{block:r,linkComponent:e.linkComponent,context:e.context||t,registeredComponents:e.registeredComponents||(n==null?void 0:n.registeredComponents)},r.id))}):null})}const wt=e=>`builder-columns ${e}-breakpoints`;function Te(e){var p,S;function t(){return typeof e.space=="number"?e.space||0:20}function n(){return e.columns||[]}function i(){return e.stackColumnsAt||"tablet"}function a(v){return v.link?e.builderLinkComponent||"a":"div"}function s(v){var k;return((k=n()[v])==null?void 0:k.width)||100/n().length}function r(v){const k=s(v),I=t()*(n().length-1)*(k/100);return`calc(${k}% - ${I}px)`}function l({stackedStyle:v,desktopStyle:k}){return i()==="tablet"?v:k}function u({stackedStyle:v,desktopStyle:k}){return i()==="never"?k:v}function c(){return e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column"}function g(){return{"--flex-dir":c(),"--flex-dir-tablet":l({stackedStyle:c(),desktopStyle:"row"})}}function b(v){const k=v===0?0:t(),I=r(v),P=`${k}px`,R="100%",C=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:I,["marginLeft"]:P,"--column-width-mobile":u({stackedStyle:R,desktopStyle:I}),"--column-margin-left-mobile":u({stackedStyle:C,desktopStyle:P}),"--column-width-tablet":l({stackedStyle:R,desktopStyle:I}),"--column-margin-left-tablet":l({stackedStyle:C,desktopStyle:P})}}function f(v){var I,P;return ke(((P=(I=e.builderContext.content)==null?void 0:I.meta)==null?void 0:P.breakpoints)||{})[v].max}function T(){const v=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
|
|
13
|
+
@media (max-width: ${f("medium")}px) {
|
|
14
14
|
.${e.builderBlock.id}-breakpoints {
|
|
15
15
|
flex-direction: var(--flex-dir-tablet);
|
|
16
16
|
align-items: stretch;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
${
|
|
19
|
+
${v} {
|
|
20
20
|
width: var(--column-width-tablet) !important;
|
|
21
21
|
margin-left: var(--column-margin-left-tablet) !important;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
@media (max-width: ${
|
|
25
|
+
@media (max-width: ${f("small")}px) {
|
|
26
26
|
.${e.builderBlock.id}-breakpoints {
|
|
27
27
|
flex-direction: var(--flex-dir);
|
|
28
28
|
align-items: stretch;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
${
|
|
31
|
+
${v} {
|
|
32
32
|
width: var(--column-width-mobile) !important;
|
|
33
33
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
`}function
|
|
36
|
+
`}function d(v,k){return{...v.link?{href:v.link}:{},[W()]:"builder-column",style:xe(b(k))}}return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:wt((p=e.builderBlock)==null?void 0:p.id)+" div-a6f3faac",style:g(),children:[o.jsx(D,{id:"builderio-columns",styles:T(),nonce:e.builderContext.nonce}),(S=e.columns)==null?void 0:S.map((v,k)=>o.jsx(X,{TagName:a(v),actionAttributes:{},attributes:d(v,k),children:o.jsx(B,{path:`columns.${k}.blocks`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:v.blocks,styleProp:{flexGrow:"1"}})},k))]}),o.jsx("style",{children:`.div-a6f3faac {
|
|
37
37
|
display: flex;
|
|
38
38
|
line-height: normal;
|
|
39
|
-
}`})]})}function
|
|
39
|
+
}`})]})}function we(e){return o.jsx("span",{children:e.children})}function ae(e){return e.replace(/http(s)?:/,"")}function It(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+a+t+"="+encodeURIComponent(n)}function Et(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return ae(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]),a=n[3],s=t.match("x")?t:`${t}x`;return ae(`${i[0]}_${s}${a}`)}return null}function z(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(a=>a!==i).map(a=>`${It(e,"width",a)} ${a}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[Et(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function Ie(e){var a,s,r,l,u,c;function t(){var f;const b=e.image||e.src;if(!b||!(typeof b=="string"&&(b.match(/builder\.io/)||b.match(/cdn\.shopify\.com/))))return e.srcset;if(!e.noWebp){if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),z(b)}else if(e.image&&!e.srcset)return z(b);return z(b)}}function n(){var g;return(g=t==null?void 0:t())!=null&&g.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const g={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?g:void 0}return o.jsxs(o.Fragment,{children:[o.jsxs(o.Fragment,{children:[o.jsxs("picture",{children:[n()?o.jsx("source",{type:"image/webp",srcSet:n()}):null,o.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-9dac2184",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((s=(a=e.builderBlock)==null?void 0:a.children)!=null&&s.length&&e.fitContent)?o.jsx("div",{className:"builder-image-sizer div-9dac2184",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(l=(r=e.builderBlock)==null?void 0:r.children)!=null&&l.length&&e.fitContent?o.jsx(o.Fragment,{children:e.children}):null,!e.fitContent&&((c=(u=e.builderBlock)==null?void 0:u.children)!=null&&c.length)?o.jsx("div",{className:"div-9dac2184-2",children:e.children}):null]}),o.jsx("style",{children:`.img-9dac2184 {
|
|
40
40
|
opacity: 1;
|
|
41
41
|
transition: opacity 0.2s ease-in-out;
|
|
42
42
|
}.div-9dac2184 {
|
|
@@ -52,7 +52,144 @@
|
|
|
52
52
|
left: 0;
|
|
53
53
|
width: 100%;
|
|
54
54
|
height: 100%;
|
|
55
|
-
}`})]})}function Ee(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 z={"@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!"}}}]},K={"@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!"}}}]},Rt={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:[z]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[K]}],defaultValue:[{title:[z],detail:[K]},{title:[z],detail:[K]}],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}},ae=e=>e.toString();function jt(e){var m;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 T={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(T).filter(([b,k])=>k!==void 0))}function r(u){return`builder-accordion-title builder-accordion-title-${t.includes(u)?"open":"closed"}`}function s(u){return`builder-accordion-detail builder-accordion-detail-${t.includes(u)?"open":"closed"}`}function d(){let u=null;if(e.grid&&t.length&&document){const b=t[0];let v=document.querySelector(`.builder-accordion-title[data-index="${b}"]`);if(u=b,v){let x=v.getBoundingClientRect();for(;v=v&&v.nextElementSibling;)if(v){if(v.classList.contains("builder-accordion-detail"))continue;const y=v.getBoundingClientRect();if(y.left>x.left){const I=parseInt(v.getAttribute("data-index")||"",10);isNaN(I)||(x=y,u=I)}else break}}}return typeof u=="number"&&(u=u+1),u}function c(){const u={order:typeof d()=="number"?d():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(u).filter(([T,b])=>b!==void 0))}function h(u){t.includes(u)?n(i()?[]:t.filter(T=>T!==u)):n(i()?[u]:t.concat(u))}return a.jsx("div",{className:"builder-accordion",style:o(),children:(m=e.items)==null?void 0:m.map((u,T)=>a.jsxs($e.Fragment,{children:[a.jsx("div",{className:r(T),style:{...l(),...e.grid&&{width:e.gridRowWidth,order:d()!==null?ae(T):ae(T+1)}},"data-index":T,onClick:b=>h(T),children:a.jsx(F,{blocks:u.title,path:`items.${T}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(T)?a.jsx("div",{className:s(T),style:c(),children:a.jsx(F,{blocks:u.detail,path:`items.${T}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]},T))})}const Pt={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}},Bt={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(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,d)=>s+d.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},Ft={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},ee=["jpeg","jpg","png","svg","webp","gif","jfif","pjpeg","pjp","apng","avif","tif","tiff","heif","bmp","eps","raw","cr2","nef","orf","sr2","psd","heic","dib","ai"],Vt=["mp4","webm","mkv","flv","vob","ogv","ogg","drc","gif","gifv","mng","avi","mov","qt","mts","m2ts","ts","wmv","yuv","rm","rmvb","viv","asf","amv","m4p","mpeg","mpe","m2v","m4v","svi","3gp","3g2","mxf","roq","nsv","f4v","f4p","f4a","f4b"],At={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:ee,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((d,c)=>{const h=document.createElement("img");let m=!1;h.onload=()=>{m=!0,d(h)},h.addEventListener("error",u=>{console.warn("Image load failed",u.error),c(u.error)}),h.src=r,setTimeout(()=>{m||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}},Wt={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>"}}}]},Nt={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 $t(e){var t,n,i;return a.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:a.jsx(F,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,registeredComponents:e.builderComponents,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const Dt={name:"Symbol",noWrap:!0,static:!0,isRSC:!0,inputs:[{name:"symbol",type:"uiSymbol"},{name:"dataOnly",helperText:"Make this a data symbol that doesn't display any UI",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"inheritState",helperText:"Inherit the parent component state and data",type:"boolean",defaultValue:!1,advanced:!0},{name:"renderToLiquid",helperText:"Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",type:"boolean",defaultValue:!1,advanced:!0,hideFromUI:!0},{name:"useChildren",hideFromUI:!0,type:"boolean"}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},G={"@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"}}},J={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},Lt={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[G]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[J]}],defaultValue:[{label:[{...G,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...J,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...G,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...J,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 Ot(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:d=>o(s),children:a.jsx(F,{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(F,{parent:e.builderBlock.id,path:`tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const _t={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 Re(e){var t;return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const Ut={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 Ht(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 d=0;d<r.length;d++){const c=r[d];if(c.src){if(n.includes(c.src))continue;n.push(c.src);const h=document.createElement("script");h.async=!0,h.src=c.src,document.head.appendChild(h)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(o.includes(c.innerText))continue;try{o.push(c.innerText),new Function(c.innerText)()}catch(h){console.warn("`CustomCode`: Error running script:",h)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Mt={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}]},qt=["text/javascript","application/javascript","application/ecmascript"],zt=e=>qt.includes(e.type);function Kt(e){const t=g.useRef(null),[n,i]=g.useState(()=>[]),[o,l]=g.useState(()=>[]),[r,s]=g.useState(()=>!1);function d(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let h=0;h<c.length;h++){const m=c[h];if(m.src&&!n.includes(m.src)){n.push(m.src);const u=document.createElement("script");u.async=!0,u.src=m.src,document.head.appendChild(u)}else if(zt(m)&&!o.includes(m.innerText))try{o.push(m.innerText),new Function(m.innerText)()}catch(u){console.warn("`Embed`: Error running script:",u)}}}return g.useEffect(()=>{t.current&&!r&&(s(!0),d())},[t.current,r]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const Gt={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}},Jt=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],Yt=()=>{const e=process.env.NODE_ENV||"production";return Jt.includes(e)?e:"production"};function Qt(e){const t=g.useRef(null),[n,i]=g.useState(()=>"unsubmitted"),[o,l]=g.useState(()=>null),[r,s]=g.useState(()=>"");function d(m){var T,b;const u={...e.builderContext.rootState,...m};e.builderContext.rootSetState?(b=(T=e.builderContext).rootSetState)==null||b.call(T,u):e.builderContext.rootState=u}function c(){return p.isEditing()&&e.previewState||n}function h(m){var T;const u=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")m.preventDefault();else if(u){if(!(e.action||e.sendSubmissionsTo==="email")){m.preventDefault();return}m.preventDefault();const b=m.currentTarget||m.target,k=e.customHeaders||{};let v;const x=new FormData(b),y=Array.from(b.querySelectorAll("input,select,textarea")).filter(f=>!!f.name).map(f=>{let C;const S=f.name;if(f instanceof HTMLInputElement)if(f.type==="radio"){if(f.checked)return C=f.name,{key:S,value:C}}else if(f.type==="checkbox")C=f.checked;else if(f.type==="number"||f.type==="range"){const w=f.valueAsNumber;isNaN(w)||(C=w)}else f.type==="file"?C=f.files:C=f.value;else C=f.value;return{key:S,value:C}});let I=e.contentType;if(e.sendSubmissionsTo==="email"&&(I="multipart/form-data"),Array.from(y).forEach(({value:f})=>{(f instanceof File||Array.isArray(f)&&f[0]instanceof File||f instanceof FileList)&&(I="multipart/form-data")}),I!=="application/json")v=x;else{const f={};Array.from(y).forEach(({value:C,key:S})=>{V.set(f,S,C)}),v=JSON.stringify(f)}I&&I!=="multipart/form-data"&&(u&&((T=e.action)!=null&&T.includes("zapier.com"))||(k["content-type"]=I));const j=new CustomEvent("presubmit",{detail:{body:v}});if(t.current&&(t.current.dispatchEvent(j),j.defaultPrevented))return;i("sending");const E=`${Yt()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,R=e.sendSubmissionsTo==="email"?E:e.action;p.logFetch(R),fetch(R,{body:v,headers:k,method:e.method||"post"}).then(async f=>{let C;const S=f.headers.get("content-type");if(S&&S.indexOf("application/json")!==-1?C=await f.json():C=await f.text(),!f.ok&&e.errorMessagePath){let w=fe(C,e.errorMessagePath);w&&(typeof w!="string"&&(w=JSON.stringify(w)),s(w),d({formErrorMessage:w}))}if(l(C),i(f.ok?"success":"error"),f.ok){const w=new CustomEvent("submit:success",{detail:{res:f,body:C}});if(t.current){if(t.current.dispatchEvent(w),w.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const P=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(P),P.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},f=>{const C=new CustomEvent("submit:error",{detail:{error:f}});t.current&&(t.current.dispatchEvent(C),C.defaultPrevented)||(l(f),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:m=>h(m),...e.attributes,children:[e.children,c()==="error"?a.jsx(F,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?a.jsx(F,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&o?a.jsx("pre",{className:"builder-form-error-text pre-7acc3b46",children:JSON.stringify(o,null,2)}):null,c()==="success"?a.jsx(F,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",a.jsx("style",{children:".pre-7acc3b46 { padding: 10px; color: red; text-align: center; }"})," "]})}const Xt={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:p.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 en={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 tn(e){var t;return g.createElement("select",{...e.attributes,value:e.value,key:p.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 nn={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 on(e){return a.jsx("button",{type:"submit",...e.attributes,children:e.text})}const an={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 rn(e){return a.jsx("textarea",{...e.attributes,placeholder:e.placeholder,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const ln={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:ee,required:!0}],noWrap:!0,static:!0};function sn(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},p.isEditing()&&e.imgSrc||"default-key")}const cn={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:Vt,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:ee,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 je(e){var i,o,l,r,s,d,c;function t(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function n(){return{...t()}}return a.jsxs("div",{style:{position:"relative"},children:[a.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,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=(d=e.builderBlock)==null?void 0:d.children)!=null&&c.length&&!e.fitContent?a.jsx("div",{style:{pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"stretch",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},children:e.children}):null]})}const dn=()=>[{component:Ht,...Ut},{component:Kt,...Mt},{component:Qt,...Gt},{component:Zt,...Xt},{component:on,...nn},{component:tn,...en},{component:rn,...an},{component:sn,...ln},{component:je,...cn}],re=()=>[{component:ue,...Pt},{component:Te,...Bt},{component:Ie,...Ft},{component:we,...At},{component:Ee,...Wt},{component:$t,...Nt},{component:Ae,...Dt},{component:Re,..._t},{component:Ot,...Lt},{component:jt,...Rt},...dn()],un=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
55
|
+
}`})]})}function Ee(e){return o.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 K={"@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!"}}}]},G={"@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!"}}}]},Rt={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:[K]},{name:"detail",type:"uiBlocks",hideFromUI:!0,defaultValue:[G]}],defaultValue:[{title:[K],detail:[G]},{title:[K],detail:[G]}],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 Pt(e){var b;const[t,n]=h.useState(()=>[]);function i(){return!!(e.grid||e.oneAtATime)}function a(){return{display:"flex",alignItems:"stretch",flexDirection:"column",...e.grid&&{flexDirection:"row",alignItems:"flex-start",flexWrap:"wrap"}}}function s(){const T={...{display:"flex",flexDirection:"column"},alignItems:"stretch",cursor:"pointer"};return Object.fromEntries(Object.entries(T).filter(([d,p])=>p!==void 0))}function r(f){return`builder-accordion-title builder-accordion-title-${t.includes(f)?"open":"closed"}`}function l(f){return`builder-accordion-detail builder-accordion-detail-${t.includes(f)?"open":"closed"}`}function u(){let f=null;if(e.grid&&t.length&&document){const d=t[0];let S=document.querySelector(`.builder-accordion-title[data-index="${d}"]`);if(f=d,S){let v=S.getBoundingClientRect();for(;S=S&&S.nextElementSibling;)if(S){if(S.classList.contains("builder-accordion-detail"))continue;const k=S.getBoundingClientRect();if(k.left>v.left){const I=parseInt(S.getAttribute("data-index")||"",10);isNaN(I)||(v=k,f=I)}else break}}}return typeof f=="number"&&(f=f+1),f}function c(){const f={order:typeof u()=="number"?u():void 0,...e.grid&&{width:"100%"}};return Object.fromEntries(Object.entries(f).filter(([T,d])=>d!==void 0))}function g(f){t.includes(f)?n(i()?[]:t.filter(T=>T!==f)):n(i()?[f]:t.concat(f))}return o.jsx("div",{className:"builder-accordion",style:a(),children:(b=e.items)==null?void 0:b.map((f,T)=>o.jsxs(De.Fragment,{children:[o.jsx("div",{className:r(T),style:{...s(),...e.grid&&{width:e.gridRowWidth,order:u()!==null?oe(T):oe(T+1)}},"data-index":T,onClick:d=>g(T),children:o.jsx(B,{blocks:f.title,path:`items.${T}.title`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}),t.includes(T)?o.jsx("div",{className:l(T),style:c(),children:o.jsx(B,{blocks:f.detail,path:`items.${T}.detail`,parent:e.builderBlock.id,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]},T))})}const jt={name:"Core:Button",image:"https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",defaultStyles:{appearance:"none",paddingTop:"15px",paddingBottom:"15px",paddingLeft:"25px",paddingRight:"25px",backgroundColor:"#000000",color:"white",borderRadius:"4px",textAlign:"center",cursor:"pointer"},inputs:[{name:"text",type:"text",defaultValue:"Click me!",bubble:!0},{name:"link",type:"url",bubble:!0},{name:"openLinkInNewTab",type:"boolean",defaultValue:!1,friendlyName:"Open link in new tab"}],static:!0,noWrap:!0,shouldReceiveBuilderProps:{builderLinkComponent:!0}},Vt={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(a=>a.get("width"))&&(n.find(s=>!s.get("width"))||n.reduce((l,u)=>l+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}},Bt={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},ee=["jpeg","jpg","png","svg","webp","gif","jfif","pjpeg","pjp","apng","avif","tif","tiff","heif","bmp","eps","raw","cr2","nef","orf","sr2","psd","heic","dib","ai"],At=["mp4","webm","mkv","flv","vob","ogv","ogg","drc","gif","gifv","mng","avi","mov","qt","mts","m2ts","ts","wmv","yuv","rm","rmvb","viv","asf","amv","m4p","mpeg","mpe","m2v","m4v","svi","3gp","3g2","mxf","roq","nsv","f4v","f4p","f4a","f4b"],Nt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:ee,required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(r,l=6e4){return new Promise((u,c)=>{const g=document.createElement("img");let b=!1;g.onload=()=>{b=!0,u(g)},g.addEventListener("error",f=>{console.warn("Image load failed",f.error),c(f.error)}),g.src=r,setTimeout(()=>{b||c(new Error("Image load timed out"))},l)})}function i(r){return Math.round(r*1e3)/1e3}const a=e.get("image"),s=e.get("aspectRatio");if(fetch(a).then(r=>r.blob()).then(r=>{r.type.includes("svg")&&e.set("noWebp",!0)}),a&&(!s||s===.7041))return n(a).then(r=>{const l=e.get("aspectRatio");e.get("image")===a&&(!l||l===.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}},Ft={name:"PersonalizationContainer",shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0},noWrap:!0,image:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",canHaveChildren:!0,inputs:[{name:"variants",defaultValue:[],behavior:"personalizationVariantList",type:"list",subFields:[{name:"name",type:"text"},{name:"query",friendlyName:"Targeting rules",type:"BuilderQuery",defaultValue:[]},{name:"startDate",type:"date"},{name:"endDate",type:"date"},{name:"blocks",type:"uiBlocks",hideFromUI:!0,defaultValue:[]}]}]};function U(e){return o.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}function Wt(e,t,n,i){function a(c){return typeof c=="string"}function s(c){return typeof c=="number"}function r(c,g){return(()=>{const f=g.property,T=g.operator;let d=g.value;if(g&&g.property==="urlPath"&&g.value&&typeof g.value=="string"&&g.value!=="/"&&g.value.endsWith("/")&&(d=g.value.slice(0,-1)),!(f&&T))return!0;if(Array.isArray(d))return T==="isNot"?d.every(S=>r(c,{property:f,operator:T,value:S})):!!d.find(S=>r(c,{property:f,operator:T,value:S}));const p=c[f];if(Array.isArray(p))return p.includes(d);switch(T){case"is":return p===d;case"isNot":return p!==d;case"contains":return(a(p)||Array.isArray(p))&&p.includes(String(d));case"startsWith":return a(p)&&p.startsWith(String(d));case"endsWith":return a(p)&&p.endsWith(String(d));case"greaterThan":return s(p)&&s(d)&&p>d;case"lessThan":return s(p)&&s(d)&&p<d;case"greaterThanOrEqualTo":return s(p)&&s(d)&&p>=d;case"lessThanOrEqualTo":return s(p)&&s(d)&&p<=d;default:return!1}})()}const l={query:t,startDate:n,endDate:i},u=e.date&&new Date(e.date)||new Date;return l.startDate&&new Date(l.startDate)>u||l.endDate&&new Date(l.endDate)<u?!1:!l.query||!l.query.length?!0:l.query.every(c=>r(e,c))}const Dt=`function getPersonalizedVariant(variants, blockId, locale) {
|
|
56
|
+
if (!navigator.cookieEnabled) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
function getCookie(name) {
|
|
60
|
+
const nameEQ = name + '=';
|
|
61
|
+
const ca = document.cookie.split(';');
|
|
62
|
+
for (let i = 0; i < ca.length; i++) {
|
|
63
|
+
let c = ca[i];
|
|
64
|
+
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
65
|
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
function removeVariants() {
|
|
70
|
+
variants?.forEach(function (_, index) {
|
|
71
|
+
document.querySelector('template[data-variant-id="' + blockId + '-' + index + '"]')?.remove();
|
|
72
|
+
});
|
|
73
|
+
document.querySelector('script[data-id="variants-script-' + blockId + '"]')?.remove();
|
|
74
|
+
document.querySelector('style[data-id="variants-styles-' + blockId + '"]')?.remove();
|
|
75
|
+
}
|
|
76
|
+
const attributes = JSON.parse(getCookie('builder.userAttributes') || '{}');
|
|
77
|
+
if (locale) {
|
|
78
|
+
attributes.locale = locale;
|
|
79
|
+
}
|
|
80
|
+
const winningVariantIndex = variants?.findIndex(function (variant) {
|
|
81
|
+
return filterWithCustomTargeting(attributes, variant.query, variant.startDate, variant.endDate);
|
|
82
|
+
});
|
|
83
|
+
const isDebug = location.href.includes('builder.debug=true');
|
|
84
|
+
if (isDebug) {
|
|
85
|
+
console.debug('PersonalizationContainer', {
|
|
86
|
+
attributes,
|
|
87
|
+
variants,
|
|
88
|
+
winningVariantIndex
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (winningVariantIndex !== -1) {
|
|
92
|
+
const winningVariant = document.querySelector('template[data-variant-id="' + blockId + '-' + winningVariantIndex + '"]');
|
|
93
|
+
if (winningVariant) {
|
|
94
|
+
const parentNode = winningVariant.parentNode;
|
|
95
|
+
if (parentNode) {
|
|
96
|
+
const newParent = parentNode.cloneNode(false);
|
|
97
|
+
newParent.appendChild(winningVariant.content.firstChild);
|
|
98
|
+
newParent.appendChild(winningVariant.content.lastChild);
|
|
99
|
+
parentNode.parentNode?.replaceChild(newParent, parentNode);
|
|
100
|
+
}
|
|
101
|
+
if (isDebug) {
|
|
102
|
+
console.debug('PersonalizationContainer', 'Winning variant Replaced:', winningVariant);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} else if (variants && variants.length > 0) {
|
|
106
|
+
removeVariants();
|
|
107
|
+
}
|
|
108
|
+
}`,$t=`function filterWithCustomTargeting(userAttributes, query, startDate, endDate) {
|
|
109
|
+
function isString(val) {
|
|
110
|
+
return typeof val === 'string';
|
|
111
|
+
}
|
|
112
|
+
function isNumber(val) {
|
|
113
|
+
return typeof val === 'number';
|
|
114
|
+
}
|
|
115
|
+
function objectMatchesQuery(userattr, query) {
|
|
116
|
+
const result = (() => {
|
|
117
|
+
const property = query.property;
|
|
118
|
+
const operator = query.operator;
|
|
119
|
+
let testValue = query.value;
|
|
120
|
+
if (query && query.property === 'urlPath' && query.value && typeof query.value === 'string' && query.value !== '/' && query.value.endsWith('/')) {
|
|
121
|
+
testValue = query.value.slice(0, -1);
|
|
122
|
+
}
|
|
123
|
+
if (!(property && operator)) {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
if (Array.isArray(testValue)) {
|
|
127
|
+
if (operator === 'isNot') {
|
|
128
|
+
return testValue.every(val => objectMatchesQuery(userattr, {
|
|
129
|
+
property,
|
|
130
|
+
operator,
|
|
131
|
+
value: val
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
return !!testValue.find(val => objectMatchesQuery(userattr, {
|
|
135
|
+
property,
|
|
136
|
+
operator,
|
|
137
|
+
value: val
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
const value = userattr[property];
|
|
141
|
+
if (Array.isArray(value)) {
|
|
142
|
+
return value.includes(testValue);
|
|
143
|
+
}
|
|
144
|
+
switch (operator) {
|
|
145
|
+
case 'is':
|
|
146
|
+
return value === testValue;
|
|
147
|
+
case 'isNot':
|
|
148
|
+
return value !== testValue;
|
|
149
|
+
case 'contains':
|
|
150
|
+
return (isString(value) || Array.isArray(value)) && value.includes(String(testValue));
|
|
151
|
+
case 'startsWith':
|
|
152
|
+
return isString(value) && value.startsWith(String(testValue));
|
|
153
|
+
case 'endsWith':
|
|
154
|
+
return isString(value) && value.endsWith(String(testValue));
|
|
155
|
+
case 'greaterThan':
|
|
156
|
+
return isNumber(value) && isNumber(testValue) && value > testValue;
|
|
157
|
+
case 'lessThan':
|
|
158
|
+
return isNumber(value) && isNumber(testValue) && value < testValue;
|
|
159
|
+
case 'greaterThanOrEqualTo':
|
|
160
|
+
return isNumber(value) && isNumber(testValue) && value >= testValue;
|
|
161
|
+
case 'lessThanOrEqualTo':
|
|
162
|
+
return isNumber(value) && isNumber(testValue) && value <= testValue;
|
|
163
|
+
default:
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
})();
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
const item = {
|
|
170
|
+
query,
|
|
171
|
+
startDate,
|
|
172
|
+
endDate
|
|
173
|
+
};
|
|
174
|
+
const now = userAttributes.date && new Date(userAttributes.date) || new Date();
|
|
175
|
+
if (item.startDate && new Date(item.startDate) > now) {
|
|
176
|
+
return false;
|
|
177
|
+
} else if (item.endDate && new Date(item.endDate) < now) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
if (!item.query || !item.query.length) {
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
return item.query.every(filter => {
|
|
184
|
+
return objectMatchesQuery(userAttributes, filter);
|
|
185
|
+
});
|
|
186
|
+
}`;function Ot(e,t){return!(!(e&&e.length>0)||!t||y.isBrowser())}function Lt({variants:e,previewingIndex:t,isHydrated:n,filteredVariants:i,fallbackBlocks:a}){var r;const s={blocks:a!=null?a:[],path:"this.children"};if(n&&y.isEditing())return typeof t=="number"&&t<((r=e==null?void 0:e.length)!=null?r:0)?{blocks:e[t].blocks,path:`component.options.variants.${t}.blocks`}:s;if(y.isBrowser()){const l=i==null?void 0:i[0];if(l)return{blocks:l.blocks,path:`component.options.variants.${e==null?void 0:e.indexOf(l)}.blocks`}}return s}const _t=(e,t,n)=>`
|
|
187
|
+
(function() {
|
|
188
|
+
${$t}
|
|
189
|
+
${Dt}
|
|
190
|
+
getPersonalizedVariant(${JSON.stringify(e)}, "${t}"${n?`, "${n}"`:""})
|
|
191
|
+
})();
|
|
192
|
+
`;function Ut(e){var p,S,v,k,I,P,R;const t=h.useRef(null),[n,i]=h.useState(()=>y.userAttributesService.getUserAttributes()),[a,s]=h.useState(()=>{var C,m,x;return _t(e.variants,((C=e.builderBlock)==null?void 0:C.id)||"none",(x=(m=e.builderContext)==null?void 0:m.rootState)==null?void 0:x.locale)}),[r,l]=h.useState(()=>[]),[u,c]=h.useState(()=>{var C;return Ot(e.variants,y.getDefaultCanTrack((C=e.builderContext)==null?void 0:C.canTrack))}),[g,b]=h.useState(()=>!1);function f(){return(e.variants||[]).filter(C=>{var m,x,w,E;return Wt({...(x=(m=e.builderContext)==null?void 0:m.rootState)!=null&&x.locale?{locale:(E=(w=e.builderContext)==null?void 0:w.rootState)==null?void 0:E.locale}:{},...n},C.query,C.startDate,C.endDate)})}function T(){var C;return Lt({variants:e.variants,fallbackBlocks:(C=e.builderBlock)==null?void 0:C.children,isHydrated:g,filteredVariants:f(),previewingIndex:e.previewingIndex})}function d(){return(e.variants||[]).map((C,m)=>{var x;return`[data-variant-id="${(x=e.builderBlock)==null?void 0:x.id}-${m}"] { display: none; } `}).join("")}return h.useEffect(()=>{var m;b(!0);const C=y.userAttributesService.subscribeOnUserAttributesChange(x=>{i(x)});if(!(y.isEditing()||y.isPreviewing())){const x=f()[0];t.current&&(t.current.dispatchEvent(new CustomEvent("builder.variantLoaded",{detail:{variant:x||"default",content:(m=e.builderContext)==null?void 0:m.content},bubbles:!0})),new IntersectionObserver(E=>{E.forEach(j=>{var V;j.isIntersecting&&t.current&&t.current.dispatchEvent(new CustomEvent("builder.variantDisplayed",{detail:{variant:x||"default",content:(V=e.builderContext)==null?void 0:V.content},bubbles:!0}))})}).observe(t.current))}r.push(C)},[]),h.useEffect(()=>()=>{r.forEach(C=>C())},[]),o.jsxs("div",{ref:t,...e.attributes,className:`builder-personalization-container ${((p=e.attributes)==null?void 0:p.className)||""}`,children:[u?o.jsxs(o.Fragment,{children:[(S=e.variants)==null?void 0:S.map((C,m)=>{var x,w;return o.jsx("template",{"data-variant-id":`${(x=e.builderBlock)==null?void 0:x.id}-${m}`,children:o.jsx(B,{blocks:C.blocks,parent:(w=e.builderBlock)==null?void 0:w.id,path:`component.options.variants.${m}.blocks`})},m)}),o.jsx(D,{nonce:((v=e.builderContext)==null?void 0:v.nonce)||"",styles:d(),id:`variants-styles-${(k=e.builderBlock)==null?void 0:k.id}`}),o.jsx(U,{nonce:((I=e.builderContext)==null?void 0:I.nonce)||"",scriptStr:a,id:`variants-script-${(P=e.builderBlock)==null?void 0:P.id}`})]}):null,o.jsx(B,{blocks:T().blocks,parent:(R=e.builderBlock)==null?void 0:R.id,path:T().path})]})}const qt={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>"}}}]},Ht={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 Mt(e){var t,n,i;return o.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:o.jsx(B,{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 zt={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}},J={"@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"}}},Q={"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{height:"200px",display:"flex",marginTop:"20px",flexDirection:"column"}},component:{name:"Text",options:{text:"New tab content "}}},Kt={name:"Builder: Tabs",inputs:[{name:"tabs",type:"list",broadcast:!0,subFields:[{name:"label",type:"uiBlocks",hideFromUI:!0,defaultValue:[J]},{name:"content",type:"uiBlocks",hideFromUI:!0,defaultValue:[Q]}],defaultValue:[{label:[{...J,component:{name:"Text",options:{text:"Tab 1"}}}],content:[{...Q,component:{name:"Text",options:{text:"Tab 1 content"}}}]},{label:[{...J,component:{name:"Text",options:{text:"Tab 2"}}}],content:[{...Q,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 Gt(e){var s;const[t,n]=h.useState(()=>e.defaultActiveTab?e.defaultActiveTab-1:0);function i(r){return e.tabs&&e.tabs[r].content}function a(r){r===t&&e.collapsible?n(-1):n(r)}return o.jsxs("div",{children:[o.jsx("div",{className:"builder-tabs-wrap",style:{display:"flex",flexDirection:"row",justifyContent:e.tabHeaderLayout||"flex-start",overflow:"auto"},children:(s=e.tabs)==null?void 0:s.map((r,l)=>o.jsx("span",{className:`builder-tab-wrap ${t===l?"builder-tab-active":""}`,style:{...t===l?e.activeTabStyle:{}},onClick:u=>a(l),children:o.jsx(B,{parent:e.builderBlock.id,path:`tabs.${l}.label`,blocks:r.label,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})},l))}),i(t)?o.jsx("div",{children:o.jsx(B,{parent:e.builderBlock.id,path:`tabs.${t}.content`,blocks:i(t),context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent})}):null]})}const Jt={shouldReceiveBuilderProps:{builderBlock:!1,builderContext:!0},name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function Re(e){var t;return o.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const Qt={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 Yt(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[a,s]=h.useState(()=>[]);return h.useEffect(()=>{var l;if(!((l=t.current)!=null&&l.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 g=document.createElement("script");g.async=!0,g.src=c.src,document.head.appendChild(g)}else if(!c.type||["text/javascript","application/javascript","application/ecmascript"].includes(c.type)){if(a.includes(c.innerText))continue;try{a.push(c.innerText),new Function(c.innerText)()}catch(g){console.warn("`CustomCode`: Error running script:",g)}}}},[]),o.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Xt={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}]},Zt=["text/javascript","application/javascript","application/ecmascript"],en=e=>Zt.includes(e.type);function tn(e){const t=h.useRef(null),[n,i]=h.useState(()=>[]),[a,s]=h.useState(()=>[]),[r,l]=h.useState(()=>!1);function u(){if(!t.current||!t.current.getElementsByTagName)return;const c=t.current.getElementsByTagName("script");for(let g=0;g<c.length;g++){const b=c[g];if(b.src&&!n.includes(b.src)){n.push(b.src);const f=document.createElement("script");f.async=!0,f.src=b.src,document.head.appendChild(f)}else if(en(b)&&!a.includes(b.innerText))try{a.push(b.innerText),new Function(b.innerText)()}catch(f){console.warn("`Embed`: Error running script:",f)}}}return h.useEffect(()=>{t.current&&!r&&(l(!0),u())},[t.current,r]),o.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const nn={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}},an=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],on=()=>{const e=process.env.NODE_ENV||"production";return an.includes(e)?e:"production"};function rn(e){const t=h.useRef(null),[n,i]=h.useState(()=>"unsubmitted"),[a,s]=h.useState(()=>null),[r,l]=h.useState(()=>"");function u(b){var T,d;const f={...e.builderContext.rootState,...b};e.builderContext.rootSetState?(d=(T=e.builderContext).rootSetState)==null||d.call(T,f):e.builderContext.rootState=f}function c(){return y.isEditing()&&e.previewState||n}function g(b){var T;const f=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")b.preventDefault();else if(f){if(!(e.action||e.sendSubmissionsTo==="email")){b.preventDefault();return}b.preventDefault();const d=b.currentTarget||b.target,p=e.customHeaders||{};let S;const v=new FormData(d),k=Array.from(d.querySelectorAll("input,select,textarea")).filter(m=>!!m.name).map(m=>{let x;const w=m.name;if(m instanceof HTMLInputElement)if(m.type==="radio"){if(m.checked)return x=m.name,{key:w,value:x}}else if(m.type==="checkbox")x=m.checked;else if(m.type==="number"||m.type==="range"){const E=m.valueAsNumber;isNaN(E)||(x=E)}else m.type==="file"?x=m.files:x=m.value;else x=m.value;return{key:w,value:x}});let I=e.contentType;if(e.sendSubmissionsTo==="email"&&(I="multipart/form-data"),Array.from(k).forEach(({value:m})=>{(m instanceof File||Array.isArray(m)&&m[0]instanceof File||m instanceof FileList)&&(I="multipart/form-data")}),I!=="application/json")S=v;else{const m={};Array.from(k).forEach(({value:x,key:w})=>{A.set(m,w,x)}),S=JSON.stringify(m)}I&&I!=="multipart/form-data"&&(f&&((T=e.action)!=null&&T.includes("zapier.com"))||(p["content-type"]=I));const P=new CustomEvent("presubmit",{detail:{body:S}});if(t.current&&(t.current.dispatchEvent(P),P.defaultPrevented))return;i("sending");const R=`${on()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`,C=e.sendSubmissionsTo==="email"?R:e.action;y.logFetch(C),fetch(C,{body:S,headers:p,method:e.method||"post"}).then(async m=>{let x;const w=m.headers.get("content-type");if(w&&w.indexOf("application/json")!==-1?x=await m.json():x=await m.text(),!m.ok&&e.errorMessagePath){let E=fe(x,e.errorMessagePath);E&&(typeof E!="string"&&(E=JSON.stringify(E)),l(E),u({formErrorMessage:E}))}if(s(x),i(m.ok?"success":"error"),m.ok){const E=new CustomEvent("submit:success",{detail:{res:m,body:x}});if(t.current){if(t.current.dispatchEvent(E),E.defaultPrevented)return;e.resetFormOnSubmit!==!1&&t.current.reset()}if(e.successUrl)if(t.current){const j=new CustomEvent("route",{detail:{url:e.successUrl}});t.current.dispatchEvent(j),j.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},m=>{const x=new CustomEvent("submit:error",{detail:{error:m}});t.current&&(t.current.dispatchEvent(x),x.defaultPrevented)||(s(m),i("error"))})}}return o.jsxs(o.Fragment,{children:[" ",o.jsxs("form",{validate:e.validate,ref:t,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:b=>g(b),...e.attributes,children:[e.children,c()==="error"?o.jsx(B,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext}):null,c()==="sending"?o.jsx(B,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext}):null,c()==="error"&&a?o.jsx("pre",{className:"builder-form-error-text pre-7acc3b46",children:JSON.stringify(a,null,2)}):null,c()==="success"?o.jsx(B,{path:"successMessage",blocks:e.successMessage,context:e.builderContext}):null]})," ",o.jsx("style",{children:".pre-7acc3b46 { padding: 10px; color: red; text-align: center; }"})," "]})}const sn={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 ln(e){return h.createElement("input",{...e.attributes,key:y.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const cn={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 un(e){var t;return h.createElement("select",{...e.attributes,value:e.value,key:y.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name,required:e.required},(t=e.options)==null?void 0:t.map((n,i)=>o.jsx("option",{value:n.value,children:n.name||n.value},`${n.name}-${i}`)))}const dn={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 mn(e){return o.jsx("button",{type:"submit",...e.attributes,children:e.text})}const fn={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 gn(e){return o.jsx("textarea",{...e.attributes,placeholder:e.placeholder,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}const hn={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:ee,required:!0}],noWrap:!0,static:!0};function bn(e){return o.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},y.isEditing()&&e.imgSrc||"default-key")}const pn={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:At,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:ee,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 Pe(e){var i,a,s,r,l,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 o.jsxs("div",{style:{position:"relative"},children:[o.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,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:o.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((s=(a=e.builderBlock)==null?void 0:a.children)!=null&&s.length))?o.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(l=(r=e.builderBlock)==null?void 0:r.children)!=null&&l.length&&e.fitContent?o.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?o.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 yn=()=>[{component:Yt,...Qt},{component:tn,...Xt},{component:rn,...nn},{component:ln,...sn},{component:mn,...dn},{component:un,...cn},{component:gn,...fn},{component:bn,...hn},{component:Pe,...pn}],re=()=>[{component:de,...jt},{component:Te,...Vt},{component:we,...Bt},{component:Ie,...Nt},{component:Ee,...qt},{component:Mt,...Ht},{component:Ne,...zt},{component:Re,...Jt},{component:Ut,...Ft},{component:Gt,...Kt},{component:Pt,...Rt},...yn()],xn=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
56
193
|
function getAndSetVariantId() {
|
|
57
194
|
function setCookie(name, value, days) {
|
|
58
195
|
let expires = '';
|
|
@@ -108,7 +245,7 @@
|
|
|
108
245
|
}).join('');
|
|
109
246
|
styleEl.innerHTML = newStyleStr;
|
|
110
247
|
}
|
|
111
|
-
}`,
|
|
248
|
+
}`,vn=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
112
249
|
if (!navigator.cookieEnabled) {
|
|
113
250
|
return;
|
|
114
251
|
}
|
|
@@ -142,29 +279,29 @@
|
|
|
142
279
|
thisScriptEl?.remove();
|
|
143
280
|
}
|
|
144
281
|
return;
|
|
145
|
-
}`,
|
|
146
|
-
window.${
|
|
147
|
-
window.${
|
|
148
|
-
`,
|
|
149
|
-
window.${
|
|
150
|
-
"${t}",${JSON.stringify(e)}, ${
|
|
151
|
-
)`,
|
|
152
|
-
"${t}", "${e}", ${
|
|
153
|
-
)`;function
|
|
282
|
+
}`,je="builderIoAbTest",Ve="builderIoRenderContent",L=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Sn=({canTrack:e,content:t})=>!(!(L(t).length>0)||!e||y.isBrowser()),kn=e=>e==="react"||e==="reactNative",Be=kn(y.TARGET),Cn=()=>`
|
|
283
|
+
window.${je} = ${xn}
|
|
284
|
+
window.${Ve} = ${vn}
|
|
285
|
+
`,Tn=(e,t)=>`
|
|
286
|
+
window.${je}(
|
|
287
|
+
"${t}",${JSON.stringify(e)}, ${Be}
|
|
288
|
+
)`,wn=({contentId:e,variationId:t})=>`window.${Ve}(
|
|
289
|
+
"${t}", "${e}", ${Be}
|
|
290
|
+
)`;function se(e){return Math.round(e*1e3)/1e3}const In=(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},En=e=>In(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,a=e.clientY-n.top,s=se(i/n.width),r=se(a/n.height);return{x:s,y:r}},Rn=e=>{const t=e.target,n=t&&En(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}}},Pn=["svelte","qwik","vue"],ce=()=>Pn.includes(y.TARGET)&&(y.isEditing()||y.isPreviewing()),jn=e=>{var s,r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(r=e.fileUrl)!=null?r:(s=e==null?void 0:e.files)==null?void 0:s.regular;let a="";if(i&&t&&n&&(a+=`
|
|
154
291
|
@font-face {
|
|
155
292
|
font-family: "${t}";
|
|
156
293
|
src: local("${n}"), url('${i}') format('woff2');
|
|
157
294
|
font-display: fallback;
|
|
158
295
|
font-weight: 400;
|
|
159
296
|
}
|
|
160
|
-
`.trim()),e.files)for(const
|
|
297
|
+
`.trim()),e.files)for(const l in e.files){if(!(String(Number(l))===l))continue;const c=e.files[l];c&&c!==i&&(a+=`
|
|
161
298
|
@font-face {
|
|
162
299
|
font-family: "${t}";
|
|
163
300
|
src: url('${c}') format('woff2');
|
|
164
301
|
font-display: fallback;
|
|
165
|
-
font-weight: ${
|
|
302
|
+
font-weight: ${l};
|
|
166
303
|
}
|
|
167
|
-
`.trim())}return
|
|
304
|
+
`.trim())}return a},Vn=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>jn(n)))==null?void 0:t.join(" "))||""},Bn=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",An=`
|
|
168
305
|
.builder-button {
|
|
169
306
|
all: unset;
|
|
170
307
|
}
|
|
@@ -181,8 +318,8 @@ font-weight: ${s};
|
|
|
181
318
|
text-align: inherit;
|
|
182
319
|
font-family: inherit;
|
|
183
320
|
}
|
|
184
|
-
`,
|
|
185
|
-
${
|
|
186
|
-
${
|
|
187
|
-
${
|
|
188
|
-
`.trim());return
|
|
321
|
+
`,Nn=e=>e?"":An,Fn=e=>`variant-${e}`;function Wn(e){var k,I,P;const t=h.useRef(null);function n(R){var m,x;const C={...e.builderContextSignal.rootState,...R};e.builderContextSignal.rootSetState?(x=(m=e.builderContextSignal).rootSetState)==null||x.call(m,C):e.setBuilderContextSignal(w=>({...w,rootState:C}))}function i(R){var m,x,w,E,j;const C={...e.builderContextSignal.content,...R,data:{...(m=e.builderContextSignal.content)==null?void 0:m.data,...R==null?void 0:R.data},meta:{...(x=e.builderContextSignal.content)==null?void 0:x.meta,...R==null?void 0:R.meta,breakpoints:((w=R==null?void 0:R.meta)==null?void 0:w.breakpoints)||((j=(E=e.builderContextSignal.content)==null?void 0:E.meta)==null?void 0:j.breakpoints)}};e.setBuilderContextSignal(V=>({...V,content:C}))}function a(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[s,r]=h.useState(()=>e.contentWrapper||"div");function l(R){return y.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:C=>{var w;const{breakpoints:m,contentId:x}=C;!x||x!==((w=e.builderContextSignal.content)==null?void 0:w.id)||m&&i({meta:{breakpoints:m}})},animation:C=>{pe(C)},contentUpdate:C=>{i(C)}}})(R)}const[u,c]=h.useState(()=>({})),[g,b]=h.useState(()=>({})),[f,T]=h.useState(()=>!1);function d(R){var C,m;if(e.builderContextSignal.content){const x=(C=e.builderContextSignal.content)==null?void 0:C.testVariationId,w=(m=e.builderContextSignal.content)==null?void 0:m.id;y._track({apiHost:e.apiHost,type:"click",canTrack:y.getDefaultCanTrack(e.canTrack),contentId:w,apiKey:e.apiKey,variationId:x!==w?x:void 0,...Rn(R),unique:!f})}f||T(!0)}function p(){var C,m,x;const R=(x=(m=(C=e.builderContextSignal.content)==null?void 0:C.data)==null?void 0:m.httpRequests)!=null?x:{};Object.entries(R).forEach(([w,E])=>{if(!E||g[w]||u[w]&&!y.isEditing())return;g[w]=!0;const j=E.replace(/{{([^}]+)}}/g,(V,$)=>String(N({code:$,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})));y.logFetch(j),fetch(j).then(V=>V.json()).then(V=>{n({[w]:V}),u[w]=!0}).catch(V=>{console.error("error fetching dynamic data",E,V)}).finally(()=>{g[w]=!1})})}function S(){y.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:A.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}const v=h.useRef(!1);return v.current||(p(),S(),v.current=!0),h.useEffect(()=>{var R,C,m;if(y.isBrowser()){if(y.isEditing()&&!e.isNestedRender&&(window.addEventListener("message",l),y.registerInsertMenu(),y.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(w=>{var E,j;if(!e.model||!((E=w.models)!=null&&E.length)||w.models.includes(e.model)){const V=y.createRegisterComponentMessage(w);(j=window.parent)==null||j.postMessage(V,"*")}}),window.addEventListener("builder:component:stateChangeListenerActivated",S)),e.builderContextSignal.content&&y.getDefaultCanTrack(e.canTrack)){const w=(R=e.builderContextSignal.content)==null?void 0:R.testVariationId,E=(C=e.builderContextSignal.content)==null?void 0:C.id,j=e.apiKey;y._track({apiHost:e.apiHost,type:"impression",canTrack:!0,contentId:E,apiKey:j,variationId:w!==E?w:void 0})}if(y.isPreviewing()&&!y.isEditing()){const w=new URL(location.href).searchParams,E=w.get("builder.preview"),j=w.get(`builder.overrides.${E}`),V=w.get("apiKey")||w.get("builder.space");(E==="BUILDER_STUDIO"||E===e.model&&V===e.apiKey&&(!e.content||j===e.content.id))&&y.fetchOneEntry({model:e.model||"",apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion,...E==="BUILDER_STUDIO"&&((m=e.context)!=null&&m.symbolId)?{query:{id:e.context.symbolId}}:{}}).then($=>{$&&i($)})}}},[]),h.useEffect(()=>{e.content&&i(e.content)},[e.content]),h.useEffect(()=>{S()},[e.builderContextSignal.rootState]),h.useEffect(()=>{e.data&&n(e.data)},[e.data]),h.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),h.useEffect(()=>()=>{y.isBrowser()&&(window.removeEventListener("message",l),window.removeEventListener("builder:component:stateChangeListenerActivated",S))},[]),o.jsx(q.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content||ce()?o.jsx(s,{ref:t,onClick:R=>d(R),"builder-content-id":(k=e.builderContextSignal.content)==null?void 0:k.id,"builder-model":e.model,className:Fn(((I=e.content)==null?void 0:I.testVariationId)||((P=e.content)==null?void 0:P.id)),style:{display:!e.builderContextSignal.content&&ce()?"none":void 0},...a(),...e.contentWrapperProps,children:e.children}):null})}function Dn(e){const[t,n]=h.useState(()=>`
|
|
322
|
+
${Bn({cssCode:e.cssCode,contentId:e.contentId})}
|
|
323
|
+
${Vn({customFonts:e.customFonts})}
|
|
324
|
+
${Nn(e.isNestedRender)}
|
|
325
|
+
`.trim());return o.jsx(D,{id:"builderio-content",styles:t,nonce:e.nonce})}const $n=({content:e,data:t,locale:n})=>{var s,r,l;const i={},a=((s=e==null?void 0:e.data)==null?void 0:s.state)||{};return(l=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||l.forEach(u=>{u.name&&u.defaultValue!==void 0&&(i[u.name]=u.defaultValue)}),{...i,...a,...t,...n?{locale:n}:{}}},On=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ue(e){var c,g,b,f,T,d,p,S,v;const[t,n]=h.useState(()=>{var k,I;return wn({variationId:(k=e.content)==null?void 0:k.testVariationId,contentId:(I=e.content)==null?void 0:I.id})});function i(k){l(I=>({...I,rootState:k}))}const[a,s]=h.useState(()=>[...re(),...e.customComponents||[]].reduce((k,{component:I,...P})=>({...k,[P.name]:{component:I,...y.serializeIncludingFunctions(P)}}),{})),[r,l]=h.useState(()=>({content:On({content:e.content,data:e.data}),localState:void 0,rootState:$n({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...re(),...e.customComponents||[]].reduce((k,{component:I,...P})=>({...k,[P.name]:y.serializeIncludingFunctions(P)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||"",model:e.model||""})),u=h.useRef(!1);if(!u.current){e.apiKey||y.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop.");const k=(g=(c=r.content)==null?void 0:c.data)==null?void 0:g.jsCode;k&&N({code:k,context:e.context||{},localState:void 0,rootState:r.rootState,rootSetState:I=>{Object.assign(r.rootState,I)},isExpression:!1}),u.current=!0}return o.jsx(me.Provider,{value:{registeredComponents:a},children:o.jsxs(Wn,{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:l,children:[e.isSsrAbTest?o.jsx(U,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,o.jsx(Dn,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(b=r.content)==null?void 0:b.id,cssCode:(T=(f=r.content)==null?void 0:f.data)==null?void 0:T.cssCode,customFonts:(p=(d=r.content)==null?void 0:d.data)==null?void 0:p.customFonts}),o.jsx(B,{blocks:(v=(S=r.content)==null?void 0:S.data)==null?void 0:v.blocks,context:r,registeredComponents:a,linkComponent:e.linkComponent})]})})}function Ae(e){var r;const[t,n]=h.useState(()=>Sn({canTrack:y.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var l;return Tn(L(e.content).map(u=>({id:u.testVariationId,testRatio:u.testRatio})),((l=e.content)==null?void 0:l.id)||"")}function a(){return L(e.content).map(l=>`.variant-${l.testVariationId} { display: none; } `).join("")}function s(){var l;return t?{...e.content,testVariationId:(l=e.content)==null?void 0:l.id}:y.handleABTestingSync({item:e.content,canTrack:y.getDefaultCanTrack(e.canTrack)})}return h.useEffect(()=>{},[]),o.jsxs(o.Fragment,{children:[!e.isNestedRender&&y.TARGET!=="reactNative"?o.jsx(U,{id:"builderio-init-variants-fns",scriptStr:Cn(),nonce:e.nonce||""}):null,t?o.jsxs(o.Fragment,{children:[o.jsx(D,{id:"builderio-variants",styles:a(),nonce:e.nonce||""}),o.jsx(U,{id:"builderio-variants-visibility",scriptStr:i(),nonce:e.nonce||""}),(r=L(e.content))==null?void 0:r.map(l=>o.jsx(ue,{apiHost:e.apiHost,isNestedRender:e.isNestedRender,nonce:e.nonce,content:l,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},l.testVariationId))]}):null,o.jsx(ue,{apiHost:e.apiHost,nonce:e.nonce,isNestedRender:e.isNestedRender,content:s(),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 Ln=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return y.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{y.logger.error("Could not fetch symbol content: ",n)})};function Ne(e){var l,u,c,g;function t(){return"div"}function n(){return"div"}function i(){var b,f;return[e.attributes[W()],"builder-symbol",(b=e.symbol)!=null&&b.inline?"builder-inline-symbol":void 0,(f=e.symbol)!=null&&f.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[a,s]=h.useState(()=>{var b;return(b=e.symbol)==null?void 0:b.content});function r(){a||Ln({symbol:e.symbol,builderContextValue:e.builderContext}).then(b=>{b&&s(b)})}return h.useEffect(()=>{},[]),h.useEffect(()=>{r()},[e.symbol]),o.jsx("div",{...e.attributes,className:i(),children:o.jsx(Ae,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(l=e.builderBlock)==null?void 0:l.id},customComponents:Object.values(e.builderComponents),data:{...(u=e.symbol)==null?void 0:u.data,...e.builderContext.localState,...(c=a==null?void 0:a.data)==null?void 0:c.state},canTrack:e.builderContext.canTrack,model:(g=e.symbol)==null?void 0:g.model,content:a,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.setClientUserAttributes=y.setClientUserAttributes;exports.Blocks=B;exports.BuilderContext=q;exports.Button=de;exports.Columns=Te;exports.Content=Ae;exports.Fragment=we;exports.Image=Ie;exports.Section=Ee;exports.Symbol=Ne;exports.Text=Re;exports.Video=Pe;
|