@builder.io/sdk-react 0.6.2 → 0.6.4
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/index.cjs +13 -13
- package/lib/browser/index.mjs +155 -150
- package/lib/edge/index.cjs +20 -20
- package/lib/edge/index.mjs +396 -391
- package/lib/node/index.cjs +13 -13
- package/lib/node/index.mjs +155 -150
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/fetch-builder-props.d.ts +13 -0
- package/types/types/components.d.ts +0 -1
package/lib/browser/index.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),f=require("react"),u=require("./server-entry-2e639417.js");function oe(e){return a.jsxs(a.Fragment,{children:[e.link?a.jsx(a.Fragment,{children:a.jsx("a",{role:"button",...e.attributes,href:e.link,target:e.openLinkInNewTab?"_blank":void 0,children:e.text})}):a.jsx(a.Fragment,{children:a.jsx("button",{...e.attributes,style:e.attributes.style,className:e.attributes.className+" button-3e7bc8b2",children:e.text})}),a.jsx("style",{children:`.button-3e7bc8b2 {
|
|
2
2
|
all: unset;
|
|
3
|
-
}`})]})}const re={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},Y=(e,t=re)=>`@media (max-width: ${t[e].max}px)`,le=({small:e,medium:t})=>{const n=u.fastClone(re);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n},
|
|
4
|
-
`),
|
|
3
|
+
}`})]})}const re={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},Y=(e,t=re)=>`@media (max-width: ${t[e].max}px)`,le=({small:e,medium:t})=>{const n=u.fastClone(re);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n},ke=({builder:e,context:t,event:n,state:i})=>Object.entries({state:i,Builder:e,builder:e,context:t,event:n}),pe=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:r,rootState:l})=>{const d=ke({builder:t,context:n,event:i,state:Ce(l,o,r)});return new Function(...d.map(([c])=>c),e)(...d.map(([,c])=>c))};function Ce(e,t,n){if(e===t)throw new Error("rootState === localState");return new Proxy(e,{get:(i,o)=>t&&o in t?t[o]:e[o],set:(i,o,r)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return e[o]=r,n==null||n(e),!0}})}function A({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:r,isExpression:l=!0}){if(e===""){u.logger.warn("Skipping evaluation of empty code block.");return}const d={isEditing:u.isEditing(),isBrowser:u.isBrowser(),isServer:!u.isBrowser(),getUserAttributes:()=>u.getUserAttributes()},m={code:l&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,builder:d,context:t,event:r,rootSetState:o,rootState:i,localState:n};try{return pe(m)}catch(g){u.logger.error("Failed code evaluation: "+g.message,{code:e});return}}const we=(e,t,n)=>{if(Object(e)!==e)return e;const i=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return i.slice(0,-1).reduce((o,r,l)=>Object(o[r])===o[r]?o[r]:o[r]=Math.abs(Number(i[l+1]))>>0===+i[l+1]?[]:{},e)[i[i.length-1]]=n,e};const je=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const r=u.fastClone(e),l={...r,properties:{...r.properties},actions:{...r.actions}};for(const d in e.bindings){const c=e.bindings[d],s=A({code:c,localState:n,rootState:i,rootSetState:o,context:t});we(l,d,s)}return l};function N({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:r}){const l=e;return n?je({block:l,localState:i,rootState:o,rootSetState:r,context:t}):l}const Te=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),ce=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${Te(n)}: ${i};`}).filter(u.checkIsDefined),Ie=e=>ce(e).join(`
|
|
4
|
+
`),O=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
5
5
|
${Ie(n)}
|
|
6
6
|
}`;return e?`${e} {
|
|
7
7
|
${i}
|
|
8
|
-
}`:i};function
|
|
8
|
+
}`:i};function M(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},id:e.id})}function D(e){function t(){const i=N({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return u.checkIsDefined(i.hide)?!i.hide:u.checkIsDefined(i.show)?i.show:!0}function n(){var h;const i=N({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),o=i.responsiveStyles,r=e.context.content,l=le(((h=r==null?void 0:r.meta)==null?void 0:h.breakpoints)||{}),d=o==null?void 0:o.large,c=o==null?void 0:o.medium,s=o==null?void 0:o.small,m=i.id;if(!m)return"";const g=d?O({className:m,styles:d}):"",y=c?O({className:m,styles:c,mediaQuery:Y("medium",l)}):"",p=s?O({className:m,styles:s,mediaQuery:Y("small",l)}):"";return[g,y,p].join(" ")}return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(M,{styles:n()})}):null})}function Re(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const Ee=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],K=e=>typeof e=="string"&&Ee.includes(e.toLowerCase()),Fe=({block:e,context:t,registeredComponents:n})=>{var r;const i=(r=N({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!i)return null;const o=n[i];if(o)return o;console.warn(`
|
|
9
9
|
Could not find a registered component named "${i}".
|
|
10
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},Pe=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=A({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(o))return;const r=n.collection.split(".").pop(),l=n.itemName||(r?r+"Item":"item");return o.map((c,s)=>({context:{...t,localState:{...t.localState,$index:s,$item:c,[l]:c,[`$${l}Index`]:s}},block:i}))},G=f.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}});function Be(e){const[t,n]=f.useState(()=>e.repeatContext);return a.jsx(G.Provider,{value:t,children:a.jsx(
|
|
10
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},Pe=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=A({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(o))return;const r=n.collection.split(".").pop(),l=n.itemName||(r?r+"Item":"item");return o.map((c,s)=>({context:{...t,localState:{...t.localState,$index:s,$item:c,[l]:c,[`$${l}Index`]:s}},block:i}))},G=f.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{}});function Be(e){const[t,n]=f.useState(()=>e.repeatContext);return a.jsx(G.Provider,{value:t,children:a.jsx(U,{block:e.block,context:t,registeredComponents:e.registeredComponents})})}function $e(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ae=e=>`on${$e(e)}`,Ve=(e,t)=>n=>A({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1});function z(e){const t={},n=e.block.actions??{};for(const i in n){if(!n.hasOwnProperty(i))continue;const o=n[i];let r=Ae(i);if(e.stripPrefix)switch(u.TARGET){case"vue2":case"vue3":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=Ve(o,e)}return t}function Ne(e){return e.className=e.class,delete e.class,e}const We=e=>({href:e.href});function W({block:e,context:t}){var i;const n={...We(e),...e.properties,"builder-id":e.id,style:e.style?Me(e.style):void 0,class:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return Ne(n)}function Me(e){switch(u.TARGET){case"svelte":case"vue2":case"vue3":case"solid":return ce(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}function Ue(e){return a.jsx(e.Wrapper,{...e.wrapperProps,attributes:{...W({block:e.block,context:e.context}),...z({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})},children:e.children})}const Le=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:r,contextValue:l})=>r?{Wrapper:i,block:t,context:n,wrapperProps:e}:{...e,...o?{attributes:W({block:t,context:l})}:{}};function Q(e){var i,o;const[t,n]=f.useState(()=>e.isInteractive?Ue:e.componentRef);return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsxs(t,{...Le({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:[(i=e.blockChildren)==null?void 0:i.map(r=>a.jsx(U,{block:r,context:e.context,registeredComponents:e.registeredComponents},"block-"+r.id)),(o=e.blockChildren)==null?void 0:o.map(r=>a.jsx(D,{block:r,context:e.context},"block-style-"+r.id))]})}):null})}function X(e){return a.jsxs(a.Fragment,{children:[" ",e.hasChildren?a.jsx(a.Fragment,{children:a.jsxs(e.Wrapper,{...W({block:e.block,context:e.context}),...z({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:[" ",e.children," "]})}):a.jsx(a.Fragment,{children:a.jsx(e.Wrapper,{...W({block:e.block,context:e.context}),...z({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0})})})," "]})}function U(e){var m,g,y,p;function t(){return Fe({block:e.block,context:e.context,registeredComponents:e.registeredComponents})}function n(){return Pe({block:e.block,context:e.context})}function i(){return n()?e.block:N({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})}function o(){return e.block.tagName||"div"}function r(){return"hide"in i()?!i().hide:"show"in i()?i().show:!0}function l(){var S;return!((S=t==null?void 0:t())!=null&&S.component)&&!n()?i().children??[]:[]}function d(){var h,S,C,T,b;return{blockChildren:i().children??[],componentRef:(h=t==null?void 0:t())==null?void 0:h.component,componentOptions:{...Re(i()),builderContext:e.context,...((S=t==null?void 0:t())==null?void 0:S.name)==="Symbol"||((C=t==null?void 0:t())==null?void 0:C.name)==="Columns"?{builderComponents:e.registeredComponents}:{}},context:c,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((T=t==null?void 0:t())==null?void 0:T.noWrap)===!0,isInteractive:!((b=t==null?void 0:t())!=null&&b.isRSC)}}const[c,s]=f.useState(()=>e.context);return a.jsx(a.Fragment,{children:r()?a.jsx(a.Fragment,{children:(m=t==null?void 0:t())!=null&&m.noWrap?a.jsx(a.Fragment,{children:a.jsx(Q,{...d()})}):a.jsxs(a.Fragment,{children:[K(o())?a.jsx(a.Fragment,{children:a.jsx(X,{Wrapper:o(),block:i(),context:e.context,hasChildren:!1})}):null,!K(o())&&n()?a.jsx(a.Fragment,{children:(g=n())==null?void 0:g.map((h,S)=>a.jsx(Be,{repeatContext:h.context,block:h.block,registeredComponents:e.registeredComponents},S))}):null,!K(o())&&!n()?a.jsx(a.Fragment,{children:a.jsxs(X,{Wrapper:o(),block:i(),context:e.context,hasChildren:!0,children:[a.jsx(Q,{...d()}),(y=l())==null?void 0:y.map(h=>a.jsx(U,{block:h,context:c,registeredComponents:e.registeredComponents},"block-"+h.id)),(p=l())==null?void 0:p.map(h=>a.jsx(D,{block:h,context:c},"block-style-"+h.id))]})}):null]})}):null})}function _e(e){function t(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function n(){var o,r;u.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function i(){var o,r;u.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((r=window.parent)==null||r.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:t()+" div-5821bd52","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>n(),onMouseEnter:o=>i(),onKeyPress:o=>n(),children:e.children}),a.jsx("style",{children:`.div-5821bd52 {
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
align-items: stretch;
|
|
14
|
-
}`})]})}const se=f.createContext({registeredComponents:{}});function
|
|
15
|
-
@media (max-width: ${
|
|
14
|
+
}`})]})}const se=f.createContext({registeredComponents:{}});function L(e){var i,o;const t=f.useContext(G),n=f.useContext(se);return a.jsxs(_e,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,children:[e.blocks?a.jsx(a.Fragment,{children:(i=e.blocks)==null?void 0:i.map(r=>a.jsx(U,{block:r,context:e.context||t,registeredComponents:e.registeredComponents||n.registeredComponents},"render-block-"+r.id))}):null,e.blocks?a.jsx(a.Fragment,{children:(o=e.blocks)==null?void 0:o.map(r=>a.jsx(D,{block:r,context:e.context||t},"block-style-"+r.id))}):null]})}function de(e){var T;const[t,n]=f.useState(()=>typeof e.space=="number"?e.space||0:20),[i,o]=f.useState(()=>e.columns||[]),[r,l]=f.useState(()=>e.stackColumnsAt||"tablet");function d(b){var I;return((I=i[b])==null?void 0:I.width)||100/i.length}function c(b){const I=t*(i.length-1)/i.length;return`calc(${d(b)}% - ${I}px)`}function s({stackedStyle:b,desktopStyle:I}){return r==="tablet"?b:I}function m({stackedStyle:b,desktopStyle:I}){return r==="never"?I:b}const[g,y]=f.useState(()=>e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column");function p(){return{"--flex-dir":g,"--flex-dir-tablet":s({stackedStyle:g,desktopStyle:"row"})}}function h(b){const I=b===0?0:t,E=c(b),F=`${I}px`,P="100%",B=0;return{width:E,["marginLeft"]:F,"--column-width-mobile":m({stackedStyle:P,desktopStyle:E}),"--column-margin-left-mobile":m({stackedStyle:B,desktopStyle:F}),"--column-width-tablet":s({stackedStyle:P,desktopStyle:E}),"--column-margin-left-tablet":s({stackedStyle:B,desktopStyle:F})}}function S(b){var E,F;return le(((F=(E=e.builderContext.content)==null?void 0:E.meta)==null?void 0:F.breakpoints)||{})[b].max}function C(){return`
|
|
15
|
+
@media (max-width: ${S("medium")}px) {
|
|
16
16
|
.${e.builderBlock.id}-breakpoints {
|
|
17
17
|
flex-direction: var(--flex-dir-tablet);
|
|
18
18
|
align-items: stretch;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
@media (max-width: ${
|
|
27
|
+
@media (max-width: ${S("small")}px) {
|
|
28
28
|
.${e.builderBlock.id}-breakpoints {
|
|
29
29
|
flex-direction: var(--flex-dir);
|
|
30
30
|
align-items: stretch;
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
-
`}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-d734ad62`,style:
|
|
38
|
+
`}return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-d734ad62`,style:p(),children:[a.jsx(a.Fragment,{children:a.jsx(M,{styles:C()})}),(T=e.columns)==null?void 0:T.map((b,I)=>f.createElement("div",{className:"builder-column div-d734ad62-2",style:h(I),key:I},a.jsx(L,{path:`component.options.columns.${I}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,blocks:b.blocks})))]}),a.jsx("style",{children:`.div-d734ad62 {
|
|
39
39
|
display: flex;
|
|
40
40
|
line-height: normal;
|
|
41
41
|
}.div-d734ad62-2 {
|
|
42
42
|
display: flex;
|
|
43
43
|
flex-direction: column;
|
|
44
44
|
align-items: stretch;
|
|
45
|
-
}`})]})}function ue(e){return a.jsx("span",{children:e.children})}function Z(e){return e.replace(/http(s)?:/,"")}function Oe(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+o+t+"="+encodeURIComponent(n)}function Ke(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return Z(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const i=e.split(n[0]),o=n[3],r=t.match("x")?t:`${t}x`;return Z(`${i[0]}_${r}${o}`)}return null}function
|
|
45
|
+
}`})]})}function ue(e){return a.jsx("span",{children:e.children})}function Z(e){return e.replace(/http(s)?:/,"")}function Oe(e="",t,n){const i=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=e.indexOf("?")!==-1?"&":"?";return e.match(i)?e.replace(i,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+o+t+"="+encodeURIComponent(n)}function Ke(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return Z(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const i=e.split(n[0]),o=n[3],r=t.match("x")?t:`${t}x`;return Z(`${i[0]}_${r}${o}`)}return null}function H(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const i=Number(e.split("?width=")[1]);return isNaN(i)||(n=`${n} ${i}w`),t.filter(o=>o!==i).map(o=>`${Oe(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[Ke(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function me(e){var o,r,l,d;function t(){var m;const s=e.image||e.src;if(!s||!(s.match(/builder\.io/)||s.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((m=e.image)!=null&&m.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),H(s)}else if(e.image&&!e.srcset)return H(s);return H(s)}function n(){var c;return(c=t==null?void 0:t())!=null&&c.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const c={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?c:void 0}return a.jsxs(a.Fragment,{children:[a.jsxs(a.Fragment,{children:[a.jsxs("picture",{children:[n()?a.jsx(a.Fragment,{children:a.jsx("source",{type:"image/webp",srcSet:n()})}):null,a.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...i()},className:"builder-image"+(e.className?" "+e.className:"")+" img-ef11a6be",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length&&e.fitContent)?a.jsx(a.Fragment,{children:a.jsx("div",{className:"builder-image-sizer div-ef11a6be",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(d=(l=e.builderBlock)==null?void 0:l.children)!=null&&d.length&&e.fitContent?a.jsx(a.Fragment,{children:e.children}):null,!e.fitContent&&e.children?a.jsx(a.Fragment,{children:a.jsx("div",{className:"div-ef11a6be-2",children:e.children})}):null]}),a.jsx("style",{children:`.img-ef11a6be {
|
|
46
46
|
opacity: 1;
|
|
47
47
|
transition: opacity 0.2s ease-in-out;
|
|
48
48
|
}.div-ef11a6be {
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
left: 0;
|
|
59
59
|
width: 100%;
|
|
60
60
|
height: 100%;
|
|
61
|
-
}`})]})}function fe(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 V=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),He=({canTrack:e,content:t})=>!(!(V(t).length>0)||!e||u.isBrowser());function ze(e,t,n){var l;function i(){function d(S,
|
|
62
|
-
`).join("");r.innerHTML=d}}function qe(e,t,n){var c;if(!navigator.cookieEnabled)return;function i(s){const m=s+"=",g=document.cookie.split(";");for(let y=0;y<g.length;y++){let
|
|
61
|
+
}`})]})}function fe(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 V=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),He=({canTrack:e,content:t})=>!(!(V(t).length>0)||!e||u.isBrowser());function ze(e,t,n){var l;function i(){function d(h,S,C){let T="";if(C){const b=new Date;b.setTime(b.getTime()+C*24*60*60*1e3),T="; expires="+b.toUTCString()}document.cookie=h+"="+(S||"")+T+"; path=/; Secure; SameSite=None"}function c(h){const S=h+"=",C=document.cookie.split(";");for(let T=0;T<C.length;T++){let b=C[T];for(;b.charAt(0)===" ";)b=b.substring(1,b.length);if(b.indexOf(S)===0)return b.substring(S.length,b.length)}return null}const s=`builder.tests.${e}`,m=c(s),g=t.map(h=>h.id).concat(e);if(m&&g.includes(m))return m;let y=0;const p=Math.random();for(let h=0;h<t.length;h++){const S=t[h],C=S.testRatio;if(y+=C,p<y)return d(s,S.id),S.id}return d(s,e),e}const o=i(),r=(l=document.currentScript)==null?void 0:l.previousElementSibling;if(n){r.remove();const d=document.currentScript;d==null||d.remove()}else{const d=t.concat({id:e}).filter(c=>c.id!==o).map(c=>`.variant-${c.id} { display: none; }
|
|
62
|
+
`).join("");r.innerHTML=d}}function qe(e,t,n){var c;if(!navigator.cookieEnabled)return;function i(s){const m=s+"=",g=document.cookie.split(";");for(let y=0;y<g.length;y++){let p=g[y];for(;p.charAt(0)===" ";)p=p.substring(1,p.length);if(p.indexOf(m)===0)return p.substring(m.length,p.length)}return null}const o=`builder.tests.${t}`,r=i(o),l=(c=document.currentScript)==null?void 0:c.parentElement,d=e===t;if(r===e){if(d)return;l==null||l.removeAttribute("hidden"),l==null||l.removeAttribute("aria-hidden")}else{d&&(n?l==null||l.remove():(l==null||l.setAttribute("hidden","true"),l==null||l.setAttribute("aria-hidden","true")));return}}const De=e=>e==="react"||e==="reactNative",ge=De(u.TARGET),he="builderIoAbTest",be="builderIoRenderContent",Ge=()=>{const e=ze.toString().replace(/\s+/g," "),t=qe.toString().replace(/\s+/g," ");return`
|
|
63
63
|
window.${he} = ${e}
|
|
64
64
|
window.${be} = ${t}
|
|
65
65
|
`},Je=(e,t)=>`
|
|
66
66
|
window.${he}("${t}",${JSON.stringify(e)}, ${ge})`,Ye=({contentId:e,variationId:t})=>`
|
|
67
|
-
window.${be}("${t}", "${e}", ${ge})`,Qe={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},Xe={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((d,c)=>d+c.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}]},Ze={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},et={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(l,d=6e4){return new Promise((c,s)=>{const m=document.createElement("img");let g=!1;m.onload=()=>{g=!0,c(m)},m.addEventListener("error",y=>{console.warn("Image load failed",y.error),s(y.error)}),m.src=l,setTimeout(()=>{g||s(new Error("Image load timed out"))},d)})}function i(l){return Math.round(l*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(l=>l.blob()).then(l=>{l.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(l=>{const d=e.get("aspectRatio");e.get("image")===o&&(!d||d===.7041)&&l.width&&l.height&&(e.set("aspectRatio",i(l.height/l.width)),e.set("height",l.height),e.set("width",l.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"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}]},tt={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:"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"}]},it={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 xe(e){var t;return a.jsx("span",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const at={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function Se(e){var i;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{...e.attributes,...t()}}return a.jsx("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:1},src:e.video||"no-src",poster:e.posterImage})}const ot={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},rt=["text/javascript","application/javascript","application/ecmascript"],lt=e=>rt.includes(e.type);function ct(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[o,r]=f.useState(()=>[]),[l,d]=f.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const s=t.current.getElementsByTagName("script");for(let m=0;m<s.length;m++){const g=s[m];if(g.src&&!n.includes(g.src)){n.push(g.src);const y=document.createElement("script");y.async=!0,y.src=g.src,document.head.appendChild(y)}else if(lt(g)&&!o.includes(g.innerText))try{o.push(g.innerText),new Function(g.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return f.useEffect(()=>{t.current&&!l&&(d(!0),c())},[t.current,l]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}function st(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},u.isEditing()&&e.imgSrc||"default-key")}const dt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function ut(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[o,r]=f.useState(()=>[]);function l(){if(t.current&&t.current.getElementsByTagName&&typeof window<"u"){const d=t.current.getElementsByTagName("script");for(let c=0;c<d.length;c++){const s=d[c];if(s.src){if(n.includes(s.src))continue;n.push(s.src);const m=document.createElement("script");m.async=!0,m.src=s.src,document.head.appendChild(m)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(o.includes(s.innerText))continue;try{o.push(s.innerText),new Function(s.innerText)()}catch(m){console.warn("`CustomCode`: Error running script:",m)}}}}}return f.useEffect(()=>{l()},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const mt={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}]},ee=()=>[{component:oe,...Qe},{component:de,...Xe},{component:ut,...mt},{component:ct,...ot},{component:ue,...Ze},{component:me,...et},{component:st,...dt},{component:fe,...tt},{component:ye,...nt},{component:xe,...it},{component:Se,...at}],ft=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let o="";if(i&&t&&n&&(o+=`
|
|
67
|
+
window.${be}("${t}", "${e}", ${ge})`,Qe={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},Xe={name:"Columns",isRSC:!0,inputs:[{name:"columns",type:"array",broadcast:!0,subFields:[{name:"blocks",type:"array",hideFromUI:!0,defaultValue:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{name:"width",type:"number",hideFromUI:!0,helperText:"Width %, e.g. set to 50 to fill half of the space"},{name:"link",type:"url",helperText:"Optionally set a url that clicking this column will link to"}],defaultValue:[{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]},{blocks:[{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto",minHeight:"20px",minWidth:"20px",overflow:"hidden"}},component:{name:"Image",options:{image:"https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",backgroundPosition:"center",backgroundSize:"cover",aspectRatio:.7004048582995948}}},{"@type":"@builder.io/sdk:Element",responsiveStyles:{large:{display:"flex",flexDirection:"column",alignItems:"stretch",flexShrink:"0",position:"relative",marginTop:"30px",textAlign:"center",lineHeight:"normal",height:"auto"}},component:{name:"Text",options:{text:"<p>Enter some text...</p>"}}}]}],onChange:e=>{function t(){n.forEach(i=>{i.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(o=>o.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((d,c)=>d+c.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}]},Ze={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},et={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(l,d=6e4){return new Promise((c,s)=>{const m=document.createElement("img");let g=!1;m.onload=()=>{g=!0,c(m)},m.addEventListener("error",y=>{console.warn("Image load failed",y.error),s(y.error)}),m.src=l,setTimeout(()=>{g||s(new Error("Image load timed out"))},d)})}function i(l){return Math.round(l*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(l=>l.blob()).then(l=>{l.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(l=>{const d=e.get("aspectRatio");e.get("image")===o&&(!d||d===.7041)&&l.width&&l.height&&(e.set("aspectRatio",i(l.height/l.width)),e.set("height",l.height),e.set("width",l.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"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}]},tt={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:"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"}]},it={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 xe(e){var t;return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const at={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}]};function Se(e){var i;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{...e.attributes,...t()}}return a.jsx("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:1},src:e.video||"no-src",poster:e.posterImage})}const ot={name:"Embed",static:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:e=>{const t=e.get("url");if(t)return e.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then(i=>i.json()).then(i=>{e.get("url")===t&&(i.html?e.set("content",i.html):e.set("content","Invalid url, please try another"))}).catch(i=>{e.set("content","There was an error embedding this URL, please try again or another URL")});e.delete("content")}},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},rt=["text/javascript","application/javascript","application/ecmascript"],lt=e=>rt.includes(e.type);function ct(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[o,r]=f.useState(()=>[]),[l,d]=f.useState(()=>!1);function c(){if(!t.current||!t.current.getElementsByTagName)return;const s=t.current.getElementsByTagName("script");for(let m=0;m<s.length;m++){const g=s[m];if(g.src&&!n.includes(g.src)){n.push(g.src);const y=document.createElement("script");y.async=!0,y.src=g.src,document.head.appendChild(y)}else if(lt(g)&&!o.includes(g.innerText))try{o.push(g.innerText),new Function(g.innerText)()}catch(y){console.warn("`Embed`: Error running script:",y)}}}return f.useEffect(()=>{t.current&&!l&&(d(!0),c())},[t.current,l]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}function st(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},u.isEditing()&&e.imgSrc||"default-key")}const dt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function ut(e){const t=f.useRef(null),[n,i]=f.useState(()=>[]),[o,r]=f.useState(()=>[]);function l(){if(t.current&&t.current.getElementsByTagName&&typeof window<"u"){const d=t.current.getElementsByTagName("script");for(let c=0;c<d.length;c++){const s=d[c];if(s.src){if(n.includes(s.src))continue;n.push(s.src);const m=document.createElement("script");m.async=!0,m.src=s.src,document.head.appendChild(m)}else if(!s.type||["text/javascript","application/javascript","application/ecmascript"].includes(s.type)){if(o.includes(s.innerText))continue;try{o.push(s.innerText),new Function(s.innerText)()}catch(m){console.warn("`CustomCode`: Error running script:",m)}}}}}return f.useEffect(()=>{l()},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const mt={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}]},ee=()=>[{component:oe,...Qe},{component:de,...Xe},{component:ut,...mt},{component:ct,...ot},{component:ue,...Ze},{component:me,...et},{component:st,...dt},{component:fe,...tt},{component:ye,...nt},{component:xe,...it},{component:Se,...at}],ft=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let o="";if(i&&t&&n&&(o+=`
|
|
68
68
|
@font-face {
|
|
69
69
|
font-family: "${t}";
|
|
70
70
|
src: local("${n}"), url('${i}') format('woff2');
|
|
@@ -94,4 +94,4 @@ ${gt({customFonts:e.customFonts})}
|
|
|
94
94
|
text-align: inherit;
|
|
95
95
|
font-family: inherit;
|
|
96
96
|
}
|
|
97
|
-
`.trim());return a.jsx(W,{styles:t})}const xt=({content:e,data:t,locale:n})=>{var r,l,d;const i={};(l=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||l.forEach(c=>{var s;c.name&&c.defaultValue!==void 0&&((s=e==null?void 0:e.data)!=null&&s.state)&&e.data.state[c.name]===void 0&&(i[c.name]=c.defaultValue)});const o={...(d=e==null?void 0:e.data)==null?void 0:d.state,...t,...n?{locale:n}:{}};return{...i,...o}},St=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0,yt="0.6.2",vt=()=>{u.register("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let te=!1;const pt=(e={})=>{var t,n;te||(te=!0,u.isBrowser()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:u.TARGET,version:yt,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:i})=>{var o,r;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const l=i.data.text,d=i.data.arguments||[],c=i.data.id,s=new Function(l);let m,g=null;try{m=s.apply(null,d)}catch(y){g=y}g?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:c,error:g.message}},"*"):m&&typeof m.then=="function"?m.then(y=>{var k;(k=window.parent)==null||k.postMessage({type:"builder.evaluateResult",data:{id:c,result:y}},"*")}).catch(console.error):(r=window.parent)==null||r.postMessage({type:"builder.evaluateResult",data:{result:m,id:c}},"*");break}}})))};function ne(e){return Math.round(e*1e3)/1e3}const kt=(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},Ct=e=>kt(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ie=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,r=ne(i/n.width),l=ne(o/n.height);return{x:r,y:l}},wt=e=>{const t=e.target,n=t&&Ct(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?ie({event:e,target:t}):void 0,builderTargetOffset:n?ie({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}};function jt(e){var E,F,P,B,L;const t=f.useRef(null),[n,i]=f.useState(()=>u.checkIsDefined(e.canTrack)?e.canTrack:!0),[o,r]=f.useState(()=>0);function l(v){var x,p,j,R,$;const w={...e.builderContextSignal.content,...v,data:{...(x=e.builderContextSignal.content)==null?void 0:x.data,...v==null?void 0:v.data},meta:{...(p=e.builderContextSignal.content)==null?void 0:p.meta,...v==null?void 0:v.meta,breakpoints:((j=v==null?void 0:v.meta)==null?void 0:j.breakpoints)||(($=(R=e.builderContextSignal.content)==null?void 0:R.meta)==null?void 0:$.breakpoints)}};e.setBuilderContextSignal(ve=>({...ve,content:w}))}f.useState(()=>0);const[d,c]=f.useState(()=>!1);function s(v){var x;const{data:w}=v;if(w)switch(w.type){case"builder.configureSdk":{const p=w.data,{breakpoints:j,contentId:R}=p;if(!R||R!==((x=e.builderContextSignal.content)==null?void 0:x.id))return;j&&l({meta:{breakpoints:j}}),r(o+1);break}case"builder.contentUpdate":{const p=w.data,j=p.key||p.alias||p.entry||p.modelName,R=p.data;j===e.model&&(l(R),r(o+1));break}}}function m(){var w,x;const v=(x=(w=e.builderContextSignal.content)==null?void 0:w.data)==null?void 0:x.jsCode;v&&A({code:v,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[g,y]=f.useState(()=>({})),[k,S]=f.useState(()=>!1);function h(v){var w,x;if(e.builderContextSignal.content){const p=(w=e.builderContextSignal.content)==null?void 0:w.testVariationId,j=(x=e.builderContextSignal.content)==null?void 0:x.id;u._track({type:"click",canTrack:n,contentId:j,apiKey:e.apiKey,variationId:p!==j?p:void 0,...wt(v),unique:!k})}k||S(!0)}function C(v){return v.replace(/{{([^}]+)}}/g,(w,x)=>A({code:x,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function T({url:v,key:w}){u.fetch(v).then(x=>x.json()).then(x=>{var j,R;const p={...e.builderContextSignal.rootState,[w]:x};(R=(j=e.builderContextSignal).rootSetState)==null||R.call(j,p),g[w]=!0}).catch(x=>{console.error("error fetching dynamic data",v,x)})}function b(){var w,x;const v=((x=(w=e.builderContextSignal.content)==null?void 0:w.data)==null?void 0:x.httpRequests)??{};Object.entries(v).forEach(([p,j])=>{if(j&&(!g[p]||u.isEditing())){const R=C(j);T({url:R,key:p})}})}function I(){u.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:u.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}return f.useEffect(()=>{var v,w;if(e.apiKey||u.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),u.isBrowser()){if(u.isEditing()&&(r(o+1),window.addEventListener("message",s),vt(),pt({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(x=>{var j;const p=u.createRegisterComponentMessage(x);(j=window.parent)==null||j.postMessage(p,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",I)),e.builderContextSignal.content){const x=(v=e.builderContextSignal.content)==null?void 0:v.testVariationId,p=(w=e.builderContextSignal.content)==null?void 0:w.id;u._track({type:"impression",canTrack:n,contentId:p,apiKey:e.apiKey,variationId:x!==p?x:void 0})}if(u.isPreviewing()){const x=new URL(location.href).searchParams,p=x.get("builder.preview"),j=x.get(`builder.preview.${p}`),R=x.get("apiKey")||x.get("builder.space");p===e.model&&R===e.apiKey&&(!e.content||j===e.content.id)&&u.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then($=>{$&&l($)})}m(),b(),I()}},[]),f.useEffect(()=>{e.content&&l(e.content)},[e.content]),f.useEffect(()=>{},[d]),f.useEffect(()=>{m()},[(F=(E=e.builderContextSignal.content)==null?void 0:E.data)==null?void 0:F.jsCode,e.builderContextSignal.rootState]),f.useEffect(()=>{b()},[(B=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:B.httpRequests]),f.useEffect(()=>{I()},[e.builderContextSignal.rootState]),f.useEffect(()=>()=>{u.isBrowser()&&(window.removeEventListener("message",s),window.removeEventListener("builder:component:stateChangeListenerActivated",I))},[]),a.jsx(G.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(a.Fragment,{children:a.jsx("div",{ref:t,onClick:v=>h(v),"builder-content-id":(L=e.builderContextSignal.content)==null?void 0:L.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},className:e.classNameProp,children:e.children},o)}):null})}function z(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id})}function ae(e){var c,s,m,g,y,k,S;const[t,n]=f.useState(()=>{var h,C;return Ye({variationId:(h=e.content)==null?void 0:h.testVariationId,contentId:(C=e.content)==null?void 0:C.id})});function i(h){d(C=>({...C,rootState:h}))}const[o,r]=f.useState(()=>[...ee(),...u.components,...e.customComponents||[]].reduce((h,{component:C,...T})=>({...h,[T.name]:{component:C,...u.serializeComponentInfo(T)}}),{})),[l,d]=f.useState(()=>({content:St({content:e.content,data:e.data}),localState:void 0,rootState:xt({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ee(),...u.components,...e.customComponents||[]].reduce((h,{component:C,...T})=>({...h,[T.name]:u.serializeComponentInfo(T)}),{}),inheritedStyles:{}}));return a.jsx(se.Provider,{value:{registeredComponents:o},children:a.jsxs(jt,{content:e.content,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,classNameProp:e.classNameProp,showContent:e.showContent,builderContextSignal:l,setBuilderContextSignal:d,children:[e.isSsrAbTest?a.jsx(a.Fragment,{children:a.jsx(z,{scriptStr:t})}):null,a.jsx(a.Fragment,{children:a.jsx(bt,{contentId:(c=l.content)==null?void 0:c.id,cssCode:(m=(s=l.content)==null?void 0:s.data)==null?void 0:m.cssCode,customFonts:(y=(g=l.content)==null?void 0:g.data)==null?void 0:y.customFonts})}),a.jsx(U,{blocks:(S=(k=l.content)==null?void 0:k.data)==null?void 0:S.blocks,context:l,registeredComponents:o})]})})}function J(e){var l,d,c;const[t,n]=f.useState(()=>He({canTrack:u.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var s;return Je(V(e.content).map(m=>({id:m.testVariationId,testRatio:m.testRatio})),((s=e.content)==null?void 0:s.id)||"")}function o(){return V(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")}function r(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:u.handleABTestingSync({item:e.content,canTrack:u.getDefaultCanTrack(e.canTrack)})}return f.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.__isNestedRender&&u.TARGET!=="reactNative"?a.jsx(a.Fragment,{children:a.jsx(z,{scriptStr:Ge()})}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(W,{id:`variants-styles-${(l=e.content)==null?void 0:l.id}`,styles:o()}),a.jsx(z,{scriptStr:i()}),(d=V(e.content))==null?void 0:d.map(s=>a.jsx(ae,{content:s,showContent:!1,classNameProp:void 0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t},s.testVariationId))]}):null,a.jsx(ae,{content:r(),classNameProp:`variant-${(c=e.content)==null?void 0:c.id}`,showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t})]})}const Tt=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return u.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{u.logger.error("Could not fetch symbol content: ",n)})};function ye(e){var r,l,d;function t(){var c,s;return[e.attributes.className,"builder-symbol",(c=e.symbol)!=null&&c.inline?"builder-inline-symbol":void 0,(s=e.symbol)!=null&&s.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[n,i]=f.useState(()=>{var c;return(c=e.symbol)==null?void 0:c.content});function o(){n||Tt({symbol:e.symbol,builderContextValue:e.builderContext}).then(c=>{c&&i(c)})}return f.useEffect(()=>{o()},[]),f.useEffect(()=>{o()},[e.symbol]),a.jsx("div",{...e.attributes,className:t(),children:a.jsx(J,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(l=n==null?void 0:n.data)==null?void 0:l.state},model:(d=e.symbol)==null?void 0:d.model,content:n})})}const It=U,Rt=J;exports._processContentResult=u._processContentResult;exports.createRegisterComponentMessage=u.createRegisterComponentMessage;exports.fetchBuilderProps=u.fetchBuilderProps;exports.fetchEntries=u.fetchEntries;exports.fetchOneEntry=u.fetchOneEntry;exports.getAllContent=u.getAllContent;exports.getBuilderSearchParams=u.getBuilderSearchParams;exports.getContent=u.getContent;exports.isEditing=u.isEditing;exports.isPreviewing=u.isPreviewing;exports.register=u.register;exports.setEditorSettings=u.setEditorSettings;exports.track=u.track;exports.Blocks=U;exports.Button=oe;exports.Columns=de;exports.Content=J;exports.Fragment=ue;exports.Image=me;exports.RenderBlocks=It;exports.RenderContent=Rt;exports.Section=fe;exports.Symbol=ye;exports.Text=xe;exports.Video=Se;
|
|
97
|
+
`.trim());return a.jsx(M,{styles:t})}const xt=({content:e,data:t,locale:n})=>{var r,l,d;const i={};(l=(r=e==null?void 0:e.data)==null?void 0:r.inputs)==null||l.forEach(c=>{var s;c.name&&c.defaultValue!==void 0&&((s=e==null?void 0:e.data)!=null&&s.state)&&e.data.state[c.name]===void 0&&(i[c.name]=c.defaultValue)});const o={...(d=e==null?void 0:e.data)==null?void 0:d.state,...t,...n?{locale:n}:{}};return{...i,...o}},St=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0,yt="0.6.4",vt=()=>{u.register("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let te=!1;const kt=(e={})=>{var t,n;te||(te=!0,u.isBrowser()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:u.TARGET,version:yt,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",({data:i})=>{var o,r;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const l=i.data.text,d=i.data.arguments||[],c=i.data.id,s=new Function(l);let m,g=null;try{m=s.apply(null,d)}catch(y){g=y}g?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:c,error:g.message}},"*"):m&&typeof m.then=="function"?m.then(y=>{var p;(p=window.parent)==null||p.postMessage({type:"builder.evaluateResult",data:{id:c,result:y}},"*")}).catch(console.error):(r=window.parent)==null||r.postMessage({type:"builder.evaluateResult",data:{result:m,id:c}},"*");break}}})))};function ne(e){return Math.round(e*1e3)/1e3}const pt=(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},Ct=e=>pt(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ie=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,r=ne(i/n.width),l=ne(o/n.height);return{x:r,y:l}},wt=e=>{const t=e.target,n=t&&Ct(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?ie({event:e,target:t}):void 0,builderTargetOffset:n?ie({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}};function jt(e){var E,F,P,B,_;const t=f.useRef(null),[n,i]=f.useState(()=>u.checkIsDefined(e.canTrack)?e.canTrack:!0),[o,r]=f.useState(()=>0);function l(v){var x,k,j,R,$;const w={...e.builderContextSignal.content,...v,data:{...(x=e.builderContextSignal.content)==null?void 0:x.data,...v==null?void 0:v.data},meta:{...(k=e.builderContextSignal.content)==null?void 0:k.meta,...v==null?void 0:v.meta,breakpoints:((j=v==null?void 0:v.meta)==null?void 0:j.breakpoints)||(($=(R=e.builderContextSignal.content)==null?void 0:R.meta)==null?void 0:$.breakpoints)}};e.setBuilderContextSignal(ve=>({...ve,content:w}))}f.useState(()=>0);const[d,c]=f.useState(()=>!1);function s(v){var x;const{data:w}=v;if(w)switch(w.type){case"builder.configureSdk":{const k=w.data,{breakpoints:j,contentId:R}=k;if(!R||R!==((x=e.builderContextSignal.content)==null?void 0:x.id))return;j&&l({meta:{breakpoints:j}}),r(o+1);break}case"builder.contentUpdate":{const k=w.data,j=k.key||k.alias||k.entry||k.modelName,R=k.data;j===e.model&&(l(R),r(o+1));break}}}function m(){var w,x;const v=(x=(w=e.builderContextSignal.content)==null?void 0:w.data)==null?void 0:x.jsCode;v&&A({code:v,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState})}const[g,y]=f.useState(()=>({})),[p,h]=f.useState(()=>!1);function S(v){var w,x;if(e.builderContextSignal.content){const k=(w=e.builderContextSignal.content)==null?void 0:w.testVariationId,j=(x=e.builderContextSignal.content)==null?void 0:x.id;u._track({type:"click",canTrack:n,contentId:j,apiKey:e.apiKey,variationId:k!==j?k:void 0,...wt(v),unique:!p})}p||h(!0)}function C(v){return v.replace(/{{([^}]+)}}/g,(w,x)=>A({code:x,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState}))}function T({url:v,key:w}){u.fetch(v).then(x=>x.json()).then(x=>{var j,R;const k={...e.builderContextSignal.rootState,[w]:x};(R=(j=e.builderContextSignal).rootSetState)==null||R.call(j,k),g[w]=!0}).catch(x=>{console.error("error fetching dynamic data",v,x)})}function b(){var w,x;const v=((x=(w=e.builderContextSignal.content)==null?void 0:w.data)==null?void 0:x.httpRequests)??{};Object.entries(v).forEach(([k,j])=>{if(j&&(!g[k]||u.isEditing())){const R=C(j);T({url:R,key:k})}})}function I(){u.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:u.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}return f.useEffect(()=>{var v,w;if(e.apiKey||u.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),u.isBrowser()){if(u.isEditing()&&(r(o+1),window.addEventListener("message",s),vt(),kt({...e.locale?{locale:e.locale}:{},...e.includeRefs?{includeRefs:e.includeRefs}:{},...e.enrich?{enrich:e.enrich}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(x=>{var j;const k=u.createRegisterComponentMessage(x);(j=window.parent)==null||j.postMessage(k,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",I)),e.builderContextSignal.content){const x=(v=e.builderContextSignal.content)==null?void 0:v.testVariationId,k=(w=e.builderContextSignal.content)==null?void 0:w.id;u._track({type:"impression",canTrack:n,contentId:k,apiKey:e.apiKey,variationId:x!==k?x:void 0})}if(u.isPreviewing()){const x=new URL(location.href).searchParams,k=x.get("builder.preview"),j=x.get(`builder.preview.${k}`),R=x.get("apiKey")||x.get("builder.space");k===e.model&&R===e.apiKey&&(!e.content||j===e.content.id)&&u.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then($=>{$&&l($)})}m(),b(),I()}},[]),f.useEffect(()=>{e.content&&l(e.content)},[e.content]),f.useEffect(()=>{},[d]),f.useEffect(()=>{m()},[(F=(E=e.builderContextSignal.content)==null?void 0:E.data)==null?void 0:F.jsCode,e.builderContextSignal.rootState]),f.useEffect(()=>{b()},[(B=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:B.httpRequests]),f.useEffect(()=>{I()},[e.builderContextSignal.rootState]),f.useEffect(()=>()=>{u.isBrowser()&&(window.removeEventListener("message",s),window.removeEventListener("builder:component:stateChangeListenerActivated",I))},[]),a.jsx(G.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(a.Fragment,{children:a.jsx("div",{ref:t,onClick:v=>S(v),"builder-content-id":(_=e.builderContextSignal.content)==null?void 0:_.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},className:e.classNameProp,children:e.children},o)}):null})}function q(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id})}function ae(e){var c,s,m,g,y,p,h;const[t,n]=f.useState(()=>{var S,C;return Ye({variationId:(S=e.content)==null?void 0:S.testVariationId,contentId:(C=e.content)==null?void 0:C.id})});function i(S){d(C=>({...C,rootState:S}))}const[o,r]=f.useState(()=>[...ee(),...u.components,...e.customComponents||[]].reduce((S,{component:C,...T})=>({...S,[T.name]:{component:C,...u.serializeComponentInfo(T)}}),{})),[l,d]=f.useState(()=>({content:St({content:e.content,data:e.data}),localState:void 0,rootState:xt({content:e.content,data:e.data,locale:e.locale}),rootSetState:i,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ee(),...u.components,...e.customComponents||[]].reduce((S,{component:C,...T})=>({...S,[T.name]:u.serializeComponentInfo(T)}),{}),inheritedStyles:{}}));return a.jsx(se.Provider,{value:{registeredComponents:o},children:a.jsxs(jt,{content:e.content,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,classNameProp:e.classNameProp,showContent:e.showContent,builderContextSignal:l,setBuilderContextSignal:d,children:[e.isSsrAbTest?a.jsx(a.Fragment,{children:a.jsx(q,{scriptStr:t})}):null,a.jsx(a.Fragment,{children:a.jsx(bt,{contentId:(c=l.content)==null?void 0:c.id,cssCode:(m=(s=l.content)==null?void 0:s.data)==null?void 0:m.cssCode,customFonts:(y=(g=l.content)==null?void 0:g.data)==null?void 0:y.customFonts})}),a.jsx(L,{blocks:(h=(p=l.content)==null?void 0:p.data)==null?void 0:h.blocks,context:l,registeredComponents:o})]})})}function J(e){var l,d,c;const[t,n]=f.useState(()=>He({canTrack:u.getDefaultCanTrack(e.canTrack),content:e.content}));function i(){var s;return Je(V(e.content).map(m=>({id:m.testVariationId,testRatio:m.testRatio})),((s=e.content)==null?void 0:s.id)||"")}function o(){return V(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")}function r(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:u.handleABTestingSync({item:e.content,canTrack:u.getDefaultCanTrack(e.canTrack)})}return f.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[!e.__isNestedRender&&u.TARGET!=="reactNative"?a.jsx(a.Fragment,{children:a.jsx(q,{scriptStr:Ge()})}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(M,{id:`variants-styles-${(l=e.content)==null?void 0:l.id}`,styles:o()}),a.jsx(q,{scriptStr:i()}),(d=V(e.content))==null?void 0:d.map(s=>a.jsx(ae,{content:s,showContent:!1,classNameProp:void 0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t},s.testVariationId))]}):null,a.jsx(ae,{content:r(),classNameProp:`variant-${(c=e.content)==null?void 0:c.id}`,showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,canTrack:e.canTrack,locale:e.locale,includeRefs:e.includeRefs,enrich:e.enrich,isSsrAbTest:t})]})}const Tt=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return u.fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{u.logger.error("Could not fetch symbol content: ",n)})};function ye(e){var r,l,d;function t(){var c,s;return[e.attributes.className,"builder-symbol",(c=e.symbol)!=null&&c.inline?"builder-inline-symbol":void 0,(s=e.symbol)!=null&&s.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")}const[n,i]=f.useState(()=>{var c;return(c=e.symbol)==null?void 0:c.content});function o(){n||Tt({symbol:e.symbol,builderContextValue:e.builderContext}).then(c=>{c&&i(c)})}return f.useEffect(()=>{o()},[]),f.useEffect(()=>{o()},[e.symbol]),a.jsx("div",{...e.attributes,className:t(),children:a.jsx(J,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(l=n==null?void 0:n.data)==null?void 0:l.state},model:(d=e.symbol)==null?void 0:d.model,content:n})})}const It=L,Rt=J;exports._processContentResult=u._processContentResult;exports.createRegisterComponentMessage=u.createRegisterComponentMessage;exports.fetchBuilderProps=u.fetchBuilderProps;exports.fetchEntries=u.fetchEntries;exports.fetchOneEntry=u.fetchOneEntry;exports.getAllContent=u.getAllContent;exports.getBuilderSearchParams=u.getBuilderSearchParams;exports.getContent=u.getContent;exports.isEditing=u.isEditing;exports.isPreviewing=u.isPreviewing;exports.register=u.register;exports.setEditorSettings=u.setEditorSettings;exports.track=u.track;exports.Blocks=L;exports.Button=oe;exports.Columns=de;exports.Content=J;exports.Fragment=ue;exports.Image=me;exports.RenderBlocks=It;exports.RenderContent=Rt;exports.Section=fe;exports.Symbol=ye;exports.Text=xe;exports.Video=Se;
|