@builder.io/sdk-react-nextjs 0.16.6 → 0.16.8
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 +27 -27
- package/lib/browser/blocks-exports.mjs +640 -618
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +2 -2
- package/lib/browser/init.cjs +2 -2
- package/lib/browser/init.mjs +20 -20
- package/lib/{node/server-entry-226d18cc.js → browser/server-entry-30b63436.js} +357 -355
- package/lib/browser/server-entry-89b4c0d0.cjs +2 -0
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/blocks-exports.cjs +38 -38
- package/lib/edge/blocks-exports.mjs +964 -942
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +2 -2
- package/lib/edge/init.cjs +2 -2
- package/lib/edge/init.mjs +20 -20
- package/lib/{browser/server-entry-226d18cc.js → edge/server-entry-30b63436.js} +357 -355
- package/lib/edge/server-entry-89b4c0d0.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/node/blocks-exports.cjs +26 -26
- package/lib/node/blocks-exports.mjs +665 -643
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +2 -2
- package/lib/node/{node-runtime-f354effa.cjs → node-runtime-60abefbd.cjs} +4 -4
- package/lib/node/{node-runtime-f79fed3b.js → node-runtime-c36924d7.js} +3 -3
- package/lib/{edge/server-entry-226d18cc.js → node/server-entry-30b63436.js} +357 -355
- package/lib/node/server-entry-89b4c0d0.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +3 -3
- package/types/cjs/components/block/block.helpers.d.ts +1 -2
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/evaluate/node-runtime/init.d.ts +1 -0
- package/types/cjs/functions/get-processed-block.d.ts +1 -0
- package/types/esm/components/block/block.helpers.d.ts +1 -2
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/evaluate/node-runtime/init.d.ts +1 -0
- package/types/esm/functions/get-processed-block.d.ts +1 -0
- package/lib/browser/server-entry-0418e1e6.cjs +0 -2
- package/lib/edge/server-entry-0418e1e6.cjs +0 -2
- package/lib/node/server-entry-0418e1e6.cjs +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const ue=require("lru-cache"),I="rsc",b="[Builder.io]: ",d={log:(...e)=>console.log(b,...e),error:(...e)=>console.error(b,...e),warn:(...e)=>console.warn(b,...e),debug:(...e)=>console.debug(b,...e)};function c(){return typeof window!="undefined"&&typeof document!="undefined"}const de=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},V=e=>e instanceof URLSearchParams?de(e):e,M=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function le(){return c()&&window.self!==window.top}function _(e){return le()&&M(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const fe=()=>{if(c()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},ge=()=>typeof navigator=="object"&&navigator.userAgent||"",F=()=>{const e=ge(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||I==="reactNative"}},n=e.match(/Tablet|iPad/i),r=fe();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},p=e=>e!=null;function he(e){const t=e||(c()?window.location.search:void 0);return t?M(t).indexOf("builder.preview=")!==-1:!1}const pe=e=>({type:"builder.registerComponent",data:k(e)}),me=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`};function k(e){return JSON.parse(JSON.stringify(e,(t,n)=>typeof n=="function"?me(n):n))}const T={};function D(e,t){e==="plugin"&&(t=k(t));let n=T[e];if(n||(n=T[e]=[]),n.push(t),c()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const x={};function ye(e){if(c()){Object.assign(x,e);const t={type:"builder.settingsChange",data:x};parent.postMessage(t,"*")}}const B="builder.",we="options.",P=e=>{if(!e)return{};const t=V(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(B)){const o=r.replace(B,"").replace(we,"");n[o]=t[r]}}),n},Se=()=>{if(!c())return{};const e=new URLSearchParams(window.location.search);return P(e)},be=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},N=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(r){d.warn("[COOKIE] GET error: ",(r==null?void 0:r.message)||r);return}},j=async e=>N(e),Ie=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(p).join("; "),ve=[["secure",""],["SameSite","None"]],Ee=({name:e,value:t,expires:n})=>{const o=(c()?location.protocol==="https:":!0)?ve:[[]],s=n?[["expires",n.toUTCString()]]:[[]],i=[[e,t],...s,["path","/"],["domain",be(window.location.hostname)],...o];return Ie(i)},K=async({name:e,value:t,expires:n,canTrack:r})=>{try{if(!r)return;const o=Ee({name:e,value:t,expires:n});document.cookie=o}catch(o){d.warn("[COOKIE] SET error: ",(o==null?void 0:o.message)||o)}};function ke(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function W(){return ke().replace(/-/g,"")}const $="builderSessionId",Pe=async({canTrack:e})=>{if(!e)return;const t=await j({name:$,canTrack:e});if(p(t))return t;{const n=Ce();return Re({id:n,canTrack:e}),n}},Ce=()=>W(),Re=({id:e,canTrack:t})=>K({name:$,value:e,canTrack:t}),G=()=>c()&&typeof localStorage!="undefined"?localStorage:void 0,Oe=({key:e,canTrack:t})=>{var n;try{return t?(n=G())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},Ae=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=G())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},H="builderVisitorId",Te=({canTrack:e})=>{if(!e)return;const t=Oe({key:H,canTrack:e});if(p(t))return t;{const n=xe();return Be({id:n,canTrack:e}),n}},xe=()=>W(),Be=({id:e,canTrack:t})=>Ae({key:H,value:e,canTrack:t}),Le=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await Pe({canTrack:e}),n=Te({canTrack:e});return{sessionId:t,visitorId:n}},Ue=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await Le({canTrack:t}),userAttributes:F(),ownerId:n}});async function z(e){if(!e.apiKey){d.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!_()&&(c()||I==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Ue(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Ve=e=>z({...e,canTrack:!0}),Me=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function J(e,t){if(!t.origin.startsWith("http")&&!t.origin.startsWith("https"))return!1;const n=new URL(t.origin),r=n.hostname;return(e||Me).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const _e="0.16.8",Fe=()=>{D("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 L=!1;const X=(e={})=>{var t,n;L||(L=!0,c()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:I,version:_e,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",r=>{var s,i;if(!J(e.trustedHosts,r))return;const{data:o}=r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const u=o.data.text,y=o.data.arguments||[],m=o.data.id,v=new Function(u);let l,g=null;try{l=v.apply(null,y)}catch(h){g=h}g?(s=window.parent)==null||s.postMessage({type:"builder.evaluateError",data:{id:m,error:g.message}},"*"):l&&typeof l.then=="function"?l.then(h=>{var w;(w=window.parent)==null||w.postMessage({type:"builder.evaluateResult",data:{id:m,result:h}},"*")}).catch(console.error):(i=window.parent)==null||i.postMessage({type:"builder.evaluateResult",data:{result:l,id:m}},"*");break}}})))},q=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!J(t,r))return;const{data:o}=r;if(o)switch(o.type){case"builder.configureSdk":{n.configureSdk(o.data);break}case"builder.triggerAnimation":{n.animation(o.data);break}case"builder.contentUpdate":{const s=o.data,i=s.key||s.alias||s.entry||s.modelName,u=s.data;i===e&&n.contentUpdate(u);break}}},De=(e,t,n)=>{if(!c)return d.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};X();const r=q({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}},Ne="builder.tests",C=e=>`${Ne}.${e}`,je=({contentId:e})=>j({name:C(e),canTrack:!0}),Ke=({contentId:e})=>N({name:C(e),canTrack:!0}),We=({contentId:e,value:t})=>K({name:C(e),value:t,canTrack:!0}),Q=e=>p(e.id)&&p(e.variations)&&Object.keys(e.variations).length>0,$e=({id:e,variations:t})=>{var o;let n=0;const r=Math.random();for(const s in t){const i=(o=t[s])==null?void 0:o.testRatio;if(n+=i,r<n)return s}return e},Y=e=>{const t=$e(e);return We({contentId:e.id,value:t}).catch(n=>{d.error("could not store A/B test variation: ",n)}),t},Z=({item:e,testGroupId:t})=>{const n=e.variations[t];return t===e.id||!n?{testVariationId:e.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===e.id?"Default":"")}},Ge=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!Q(e))return e;const n=Ke({contentId:e.id})||Y({variations:e.variations,id:e.id}),r=Z({item:e,testGroupId:n});return{...e,...r}},He=async({item:e,canTrack:t})=>{if(!t||!Q(e))return e;const r=await je({contentId:e.id})||Y({variations:e.variations,id:e.id}),o=Z({item:e,testGroupId:r});return{...e,...o}},ee=e=>p(e)?e:!0,ze=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||d.warn("No previewed ID found in search params."),n};function te(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new ue.LRUCache({max:500,ttl:1e3*60*5}))}function Je(e){te();const t=ze(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function Xe(){return typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:globalThis}function qe(){const e=Xe().fetch;if(typeof e=="undefined")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
2
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const ne=qe();function E(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const s=e[o],i=[t,o].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...r,...E(s,i,n)}:{...r,[i]:s}},{})}function re(e,t,n={}){for(const r in e){const o=e[r],s=t?t+"."+r:r;o&&typeof o=="object"&&!Array.isArray(o)&&!Object.keys(o).find(i=>i.startsWith("$"))?re(o,s,n):n[s]=o}return n}const Qe="v3",U=e=>typeof e=="number"&&!isNaN(e)&&e>=0,R=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:s,enrich:i,locale:u,apiVersion:y=Qe,fields:m,omit:v,offset:l,cacheSeconds:g,staleCacheSeconds:h,sort:w,includeUnpublished:O}=e;if(!s)throw new Error("Missing API key");if(!["v3"].includes(y))throw new Error(`Invalid apiVersion: expected 'v3', received '${y}'`);const ae=t!==1,a=new URL(`https://cdn.builder.io/api/${y}/content/${o}`);if(a.searchParams.set("apiKey",s),a.searchParams.set("limit",String(t)),a.searchParams.set("noTraverse",String(ae)),a.searchParams.set("includeRefs",String(!0)),u&&a.searchParams.set("locale",u),i&&a.searchParams.set("enrich",String(i)),a.searchParams.set("omit",v||"meta.componentsUsed"),m&&a.searchParams.set("fields",m),Number.isFinite(l)&&l>-1&&a.searchParams.set("offset",String(Math.floor(l))),typeof O=="boolean"&&a.searchParams.set("includeUnpublished",String(O)),g&&U(g)&&a.searchParams.set("cacheSeconds",String(g)),h&&U(h)&&a.searchParams.set("staleCacheSeconds",String(h)),w){const f=E({sort:w});for(const S in f)a.searchParams.set(S,JSON.stringify(f[S]))}const ce={...Se(),...V(e.options||{})},A=E(ce);for(const f in A)a.searchParams.set(f,String(A[f]));if(n&&a.searchParams.set("userAttributes",JSON.stringify(n)),r){const f=re({query:r});for(const S in f)a.searchParams.set(S,JSON.stringify(f[S]))}return a},Ye=e=>"results"in e;async function oe(e){const t=await ie({...e,limit:1});return t&&t[0]||null}const Ze=async e=>{var s;const t=R(e);return await(await((s=e.fetch)!=null?s:ne)(t.href,e.fetchOptions)).json()},se=async(e,t,n=R(e))=>{const r=ee(e.canTrack);if(n.search.includes("preview=")){const s=[];for(const i of t.results){const u=Je(n.searchParams);s.push(u||i)}t.results=s}if(!r||!(c()||I==="reactNative"))return t.results;try{const s=[];for(const i of t.results)s.push(await He({item:i,canTrack:r}));t.results=s}catch(s){d.error("Could not process A/B tests. ",s)}return t.results};async function ie(e){try{const t=R(e),n=await Ze(e);return Ye(n)?se(e,n):(d.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return d.error("Error fetching data. ",t),null}}const et=async e=>{var r,o,s;const t=e.path||((r=e.url)==null?void 0:r.pathname)||((o=e.userAttributes)==null?void 0:o.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:P(e.searchParams||((s=e.url)==null?void 0:s.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await oe(n)}};exports.MSG_PREFIX=b;exports.TARGET=I;exports._processContentResult=se;exports._track=z;exports.checkIsDefined=p;exports.createEditorListener=q;exports.createRegisterComponentMessage=pe;exports.fetch=ne;exports.fetchBuilderProps=et;exports.fetchEntries=ie;exports.fetchOneEntry=oe;exports.getBuilderSearchParams=P;exports.getDefaultCanTrack=ee;exports.getUserAttributes=F;exports.handleABTestingSync=Ge;exports.init=te;exports.isBrowser=c;exports.isEditing=_;exports.isPreviewing=he;exports.logger=d;exports.register=D;exports.registerInsertMenu=Fe;exports.serializeIncludingFunctions=k;exports.setEditorSettings=ye;exports.setupBrowserForEditing=X;exports.subscribeToEditor=De;exports.track=Ve;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./server-entry-89b4c0d0.cjs");require("lru-cache");exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _processContentResult as i, createRegisterComponentMessage as s, fetchBuilderProps as o, fetchEntries as n, fetchOneEntry as c, getBuilderSearchParams as g, isEditing as a, isPreviewing as d, register as p, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-
|
|
1
|
+
import { _processContentResult as i, createRegisterComponentMessage as s, fetchBuilderProps as o, fetchEntries as n, fetchOneEntry as c, getBuilderSearchParams as g, isEditing as a, isPreviewing as d, register as p, setEditorSettings as E, subscribeToEditor as f, track as h } from "./server-entry-30b63436.js";
|
|
2
2
|
import "lru-cache";
|
|
3
3
|
export {
|
|
4
4
|
i as _processContentResult,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use client";"use strict";var
|
|
1
|
+
"use client";"use strict";var je=Object.defineProperty;var Be=(e,t,n)=>t in e?je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var q=(e,t,n)=>(Be(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("./server-entry-89b4c0d0.cjs"),W=require("./node-runtime-60abefbd.cjs");require("lru-cache");const p=require("react"),We=require("next/navigation"),Ae=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Ne=e=>typeof e=="string"&&Ae.has(e.toLowerCase());function Q(e){return a.jsx(a.Fragment,{children:Ne(e.TagName)?a.jsx(a.Fragment,{children:a.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):a.jsx(a.Fragment,{children:typeof e.TagName=="string"?a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):a.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}const L=()=>{switch(u.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,[L()]:`${e.link?"":"builder-button"} ${e.attributes[L()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return a.jsx(Q,{attributes:t(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function Ve(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options}}function Fe(e,...t){const n=Object.assign({},e);for(const i of t)delete n[i];return n}const $e=({code:e,builder:t,context:n,event:i,localState:o,rootSetState:r,rootState:c})=>{const s=W.getFunctionArguments({builder:t,context:n,event:i,state:ue({rootState:c,localState:o,rootSetState:r})});return new Function(...s.map(([l])=>l),e)(...s.map(([,l])=>l))};function ue({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(i,o)=>{if(t&&o in t)return t[o];const r=i[o];return typeof r=="object"&&r!==null?ue({rootState:r,localState:void 0,rootSetState:n?c=>{i[o]=c,n(i)}:void 0}):r},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 i[o]=r,n==null||n(i),!0}})}function Le(){var e;return typeof process!="undefined"&&u.checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const De=()=>{var i;if(!Le())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(i=process.env.NODE_OPTIONS)==null?void 0:i.includes("--no-node-snapshot");return e&&t&&!n?(u.logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},Oe=e=>u.isBrowser()||De()?$e(e):W.runInNode(e),_e=!0,B=class B{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return B.cache.get(t)}static setCachedValue(t,n){B.cache.size>20&&B.cache.delete(B.cache.keys().next().value),B.cache.set(t,{value:n})}};q(B,"cacheLimit",20),q(B,"cache",new Map);let N=B;function V({code:e,context:t,localState:n,rootState:i,rootSetState:o,event:r,isExpression:c=!0,enableCache:s}){if(e==="")return;const l={code:W.parseCode(e,{isExpression:c}),builder:W.getBuilderGlobals(),context:t,event:r,rootSetState:o,rootState:i,localState:n};if(s&&!_e){const d=N.getCacheKey(l),m=N.getCachedValue(d);if(m)return m.value}try{const d=Oe(l);if(s){const m=N.getCacheKey(l);N.setCachedValue(m,d)}return d}catch(d){u.logger.error("Failed code evaluation: "+d.message,{code:e});return}}function G(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(n=>G(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]=G(e[n]));return t}const He=["svelte","vue","angular","qwik","solid"].includes(u.TARGET),Me=e=>{if(He){const t=W.fastClone(e);return{...t,properties:{...t.properties},actions:{...t.actions}}}else{const t=G(Fe(e,"children","meta"));return{...t,properties:{...t.properties},actions:{...t.actions},children:e.children,meta:e.meta}}},Ue=({block:e,context:t,localState:n,rootState:i,rootSetState:o})=>{if(!e.bindings)return e;const r=Me(e);for(const c in e.bindings){const s=e.bindings[c],l=V({code:s,localState:n,rootState:i,rootSetState:o,context:t,enableCache:!0});W.set(r,c,l)}return r};function Ke({block:e,context:t,shouldEvaluateBindings:n,localState:i,rootState:o,rootSetState:r}){const c=e;return n?Ue({block:c,localState:i,rootState:o,rootSetState:r,context:t}):c}const X=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"",me=e=>Object.entries(e).map(([n,i])=>{if(typeof i=="string")return`${X(n)}: ${i};`}).filter(u.checkIsDefined),ze=e=>me(e).join(`
|
|
2
2
|
`),O=({mediaQuery:e,className:t,styles:n})=>{const i=`.${t} {
|
|
3
|
-
${
|
|
3
|
+
${ze(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
5
5
|
${i}
|
|
6
|
-
}`:i};function
|
|
7
|
-
Could not find a registered component named "${
|
|
8
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},
|
|
6
|
+
}`:i};function qe({style:e}){return e}const Ye=({block:e,context:t})=>fe(qe({style:e.style||{},context:t,block:e}));function fe(e){switch(u.TARGET){case"svelte":case"vue":case"solid":case"angular":return me(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const Ge=({block:e,registeredComponents:t})=>{var o;const n=(o=e.component)==null?void 0:o.name;if(!n)return null;const i=t[n];if(i)return i;console.warn(`
|
|
7
|
+
Could not find a registered component named "${n}".
|
|
8
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},Je=({block:e,context:t})=>{const{repeat:n,...i}=e;if(!(n!=null&&n.collection))return;const o=V({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(o))return;const r=n.collection.split(".").pop(),c=n.itemName||(r?r+"Item":"item");return o.map((l,d)=>({context:{...t,localState:{...t.localState,$index:d,$item:l,[c]:l,[`$${c}Index`]:d}},block:i}))},Qe=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderLinkComponent?{builderLinkComponent:t}:{}},Xe=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderComponents?{builderComponents:t}:{}},Ze=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderBlock?{builderBlock:t}:{}},et=(e,t)=>{var n;return(n=e==null?void 0:e.shouldReceiveBuilderProps)!=null&&n.builderContext?{builderContext:t}:{}},he={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},ne=(e,t=he)=>`@media (max-width: ${t[e].max}px)`,ge=({small:e,medium:t})=>{const n=W.fastClone(he);if(!e||!t)return n;const i=Math.floor(e/2);n.small={max:e,min:i,default:i+1};const o=n.small.max+1;n.medium={max:t,min:o,default:o+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n};function H(e){return a.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id,nonce:e.nonce})}function tt(e){const t=function(){const o=e.block;return u.checkIsDefined(o.hide)?!o.hide:u.checkIsDefined(o.show)?o.show:!0},n=function(){var v,y,w;const o=e.block,r=o.responsiveStyles,c=e.context.content,s=ge(((v=c==null?void 0:c.meta)==null?void 0:v.breakpoints)||{}),l=r==null?void 0:r.large,d=r==null?void 0:r.medium,m=r==null?void 0:r.small,f=o.id;if(!f)return"";const h=l?O({className:f,styles:l}):"",C=d?O({className:f,styles:d,mediaQuery:ne("medium",s)}):"",I=m?O({className:f,styles:m,mediaQuery:ne("small",s)}):"",b=o.animations&&o.animations.find(R=>R.trigger==="hover");let E="";if(b){const R=((w=(y=b.steps)==null?void 0:y[1])==null?void 0:w.styles)||{};E=O({className:`${f}:hover`,styles:{...R,transition:`all ${b.duration}s ${X(b.easing)}`,transitionDelay:b.delay?`${b.delay}s`:"0s"}})||""}return[h,C,I,E].join(" ")};return a.jsx(a.Fragment,{children:n()&&t()?a.jsx(a.Fragment,{children:a.jsx(H,{id:"builderio-block",styles:n(),nonce:e.context.nonce})}):null})}function nt(e){return e.charAt(0).toUpperCase()+e.slice(1)}const it=e=>`on${nt(e)}`,ot=(e,t)=>n=>V({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function be(e){var i;const t={},n=(i=e.block.actions)!=null?i:{};for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o];let c=it(o);if(e.stripPrefix)switch(u.TARGET){case"vue":c=c.replace("v-on:","");break;case"svelte":c=c.replace("on:","");break}t[c]=ot(r,e)}return t}function at({properties:e}){return e}const rt=e=>({href:e.href});function Z({block:e,context:t}){var i;const n={...rt(e),...e.properties,"builder-id":e.id,style:Ye({block:e,context:t}),[L()]:[e.id,"builder-block",e.class,(i=e.properties)==null?void 0:i.class].filter(Boolean).join(" ")};return at({properties:n,context:t,block:e})}function ct(e){return a.jsx(Q,{TagName:e.Wrapper,attributes:Z({block:e.block,context:e.context}),actionAttributes:be({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 lt(e){function t(){return e.includeBlockProps?{...Z({block:e.block,context:e.context}),...be({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return a.jsx(e.Wrapper,{...e.wrapperProps,attributes:t(),children:e.children})}const st=({componentOptions:e,builderBlock:t,context:n,componentRef:i,includeBlockProps:o,isInteractive:r,contextValue:c})=>{const s={...e,...o?{attributes:Z({block:t,context:c})}:{}};return r?{Wrapper:i,block:t,context:n,wrapperProps:e,includeBlockProps:o}:s};function ie(e){var n;const t=e.isInteractive?lt:e.componentRef;return a.jsx(a.Fragment,{children:e.componentRef?a.jsx(a.Fragment,{children:a.jsx(t,{...st({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(n=e.blockChildren)==null?void 0:n.map(i=>a.jsx(M,{block:i,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},i.id))})}):null})}function dt(e){const t=e.repeatContext;return a.jsx(M,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})}function M(e){var d,m,f;const t=function(){return Je({block:e.block,context:e.context})},n={value:null,update:!1},i=function(){var I;if(n.value&&!n.update&&!u.isPreviewing())return n.value;const C=(I=e.block.repeat)!=null&&I.collection?e.block:Ke({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return n.value=C,n.update=!1,C},o=function(){return Ge({block:i(),registeredComponents:e.registeredComponents})},r=function(){var I;return e.block.tagName==="a"||((I=i().properties)==null?void 0:I.href)||i().href?e.linkComponent||"a":e.block.tagName||"div"},c=function(){var b,E;if((b=e.block.repeat)!=null&&b.collection)return!!((E=t())!=null&&E.length);const C="hide"in i()?i().hide:!1;return("show"in i()?i().show:!0)&&!C},s=function(){var I,b;return!((I=o())!=null&&I.component)&&!t()?(b=i().children)!=null?b:[]:[]},l=function(){var C,I,b,E;return{blockChildren:(C=i().children)!=null?C:[],componentRef:(I=o())==null?void 0:I.component,componentOptions:{...Ve(i()),...Ze(o(),i()),...et(o(),e.context),...Qe(o(),e.linkComponent),...Xe(o(),e.registeredComponents)},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:i(),includeBlockProps:((b=o())==null?void 0:b.noWrap)===!0,isInteractive:!((E=o())!=null&&E.isRSC&&u.TARGET==="rsc")}};return a.jsx(a.Fragment,{children:c()?a.jsxs(a.Fragment,{children:[a.jsx(tt,{block:i(),context:e.context}),(d=o())!=null&&d.noWrap?a.jsx(a.Fragment,{children:a.jsx(ie,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive})}):a.jsx(a.Fragment,{children:t()?a.jsx(a.Fragment,{children:(f=t())==null?void 0:f.map((h,C)=>a.jsx(dt,{repeatContext:h.context,block:h.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},C))}):a.jsxs(ct,{Wrapper:r(),block:i(),context:e.context,children:[a.jsx(ie,{componentRef:l().componentRef,componentOptions:l().componentOptions,blockChildren:l().blockChildren,context:l().context,registeredComponents:l().registeredComponents,linkComponent:l().linkComponent,builderBlock:l().builderBlock,includeBlockProps:l().includeBlockProps,isInteractive:l().isInteractive}),(m=s())==null?void 0:m.map(h=>a.jsx(M,{block:h,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},h.id))]})})]}):null})}function ut(e){const t=p.useRef(null);function n(){var r;return"builder-blocks"+((r=e.blocks)!=null&&r.length?"":" no-blocks")}function i(){var r,c;u.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((c=window.parent)==null||c.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function o(){var r,c;u.isEditing()&&!((r=e.blocks)!=null&&r.length)&&((c=window.parent)==null||c.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return p.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[a.jsx(e.BlocksWrapper,{ref:t,className:n()+" props-blocks-wrapper-51ef31b4","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:r=>i(),onMouseEnter:r=>o(),onKeyPress:r=>i(),...e.BlocksWrapperProps,children:e.children}),a.jsx("style",{children:`.props-blocks-wrapper-51ef31b4 {
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: stretch;
|
|
12
|
-
}`})]})}function
|
|
13
|
-
@media (max-width: ${
|
|
12
|
+
}`})]})}function U(e){var t,n,i;return a.jsx(ut,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(t=e.context)==null?void 0:t.BlocksWrapper,BlocksWrapperProps:(n=e.context)==null?void 0:n.BlocksWrapperProps,children:e.blocks?a.jsx(a.Fragment,{children:(i=e.blocks)==null?void 0:i.map(o=>a.jsx(M,{block:o,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},o.id))}):null})}const mt=e=>`builder-columns ${e}-breakpoints`;function xe(e){var b,E;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],i=e.stackColumnsAt||"tablet",o=function(y){return y.link?e.builderLinkComponent||"a":"div"},r=function(y){var w;return((w=n[y])==null?void 0:w.width)||100/n.length},c=function(y){const w=r(y),R=t*(n.length-1)*(w/100);return`calc(${w}% - ${R}px)`},s=function({stackedStyle:y,desktopStyle:w}){return i==="tablet"?y:w},l=function({stackedStyle:y,desktopStyle:w}){return i==="never"?w:y},d=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",m=function(){return{"--flex-dir":d,"--flex-dir-tablet":s({stackedStyle:d,desktopStyle:"row"})}},f=function(y){const w=y===0?0:t,R=c(y),j=`${w}px`,F="100%",$=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:R,["marginLeft"]:j,"--column-width-mobile":l({stackedStyle:F,desktopStyle:R}),"--column-margin-left-mobile":l({stackedStyle:$,desktopStyle:j}),"--column-width-tablet":s({stackedStyle:F,desktopStyle:R}),"--column-margin-left-tablet":s({stackedStyle:$,desktopStyle:j})}},h=function(y){var R,j;return ge(((j=(R=e.builderContext.content)==null?void 0:R.meta)==null?void 0:j.breakpoints)||{})[y].max},C=function(){const y=`.${e.builderBlock.id}-breakpoints > .builder-column`;return`
|
|
13
|
+
@media (max-width: ${h("medium")}px) {
|
|
14
14
|
.${e.builderBlock.id}-breakpoints {
|
|
15
15
|
flex-direction: var(--flex-dir-tablet);
|
|
16
16
|
align-items: stretch;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
@media (max-width: ${
|
|
25
|
+
@media (max-width: ${h("small")}px) {
|
|
26
26
|
.${e.builderBlock.id}-breakpoints {
|
|
27
27
|
flex-direction: var(--flex-dir);
|
|
28
28
|
align-items: stretch;
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
`},
|
|
36
|
+
`},I=function(y,w){return{...y.link?{href:y.link}:{},[L()]:"builder-column",style:fe(f(w))}};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:mt((b=e.builderBlock)==null?void 0:b.id)+" div-2cd13691",style:m(),children:[a.jsx(H,{id:"builderio-columns",styles:C(),nonce:e.builderContext.nonce}),(E=e.columns)==null?void 0:E.map((v,y)=>a.jsx(Q,{TagName:o(v),actionAttributes:{},attributes:I(v,y),children:a.jsx(U,{path:`component.options.columns.${y}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:v.blocks})},y))]}),a.jsx("style",{children:`.div-2cd13691 {
|
|
37
37
|
display: flex;
|
|
38
38
|
line-height: normal;
|
|
39
|
-
}`})]})}function ye(e){return a.jsx("span",{children:e.children})}function oe(e){return e.replace(/http(s)?:/,"")}function
|
|
39
|
+
}`})]})}function ye(e){return a.jsx("span",{children:e.children})}function oe(e){return e.replace(/http(s)?:/,"")}function ft(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 ht(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return oe(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 oe(`${i[0]}_${r}${o}`)}return null}function Y(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=>`${ft(e,"width",o)} ${o}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[ht(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,i])=>`${n} ${i}w`).concat([e]).join(", "):e}function pe(e){var o,r,c,s,l,d;function t(){var h;const f=e.image||e.src;if(!f||!(f.match(/builder\.io/)||f.match(/cdn\.shopify\.com/)))return e.srcset;if(!e.noWebp){if(e.srcset&&((h=e.image)!=null&&h.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),Y(f)}else if(e.image&&!e.srcset)return Y(f);return Y(f)}}function n(){var m;return(m=t==null?void 0:t())!=null&&m.match(/builder\.io/)&&!e.noWebp?t().replace(/\?/g,"?format=webp&"):""}function i(){const m={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?m:void 0}return p.useEffect(()=>{},[]),a.jsxs(a.Fragment,{children:[a.jsxs(a.Fragment,{children:[a.jsxs("picture",{children:[n()?a.jsx("source",{type:"image/webp",srcSet:n()}):null,a.jsx("img",{loading:e.highPriority?"eager":"lazy",fetchPriority:e.highPriority?"high":"auto",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...i()},className:"builder-image"+(e.className?" "+e.className:"")+" img-2d6925f2",src:e.image,srcSet:t(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length&&e.fitContent)?a.jsx("div",{className:"builder-image-sizer div-2d6925f2",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(s=(c=e.builderBlock)==null?void 0:c.children)!=null&&s.length&&e.fitContent?a.jsx(a.Fragment,{children:e.children}):null,!e.fitContent&&((d=(l=e.builderBlock)==null?void 0:l.children)!=null&&d.length)?a.jsx("div",{className:"div-2d6925f2-2",children:e.children}):null]}),a.jsx("style",{children:`.img-2d6925f2 {
|
|
40
40
|
opacity: 1;
|
|
41
41
|
transition: opacity 0.2s ease-in-out;
|
|
42
42
|
}.div-2d6925f2 {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
left: 0;
|
|
53
53
|
width: 100%;
|
|
54
54
|
height: 100%;
|
|
55
|
-
}`})]})}function ve(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 dt={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}},ut={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((c,s)=>c+s.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}},mt={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},ft={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg","webp"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(l,c=6e4){return new Promise((s,d)=>{const f=document.createElement("img");let u=!1;f.onload=()=>{u=!0,s(f)},f.addEventListener("error",g=>{console.warn("Image load failed",g.error),d(g.error)}),f.src=l,setTimeout(()=>{u||d(new Error("Image load timed out"))},c)})}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 c=e.get("aspectRatio");e.get("image")===o&&(!c||c===.7041)&&l.width&&l.height&&(e.set("aspectRatio",i(l.height/l.width)),e.set("height",l.height),e.set("width",l.width))})}},{name:"backgroundSize",type:"text",defaultValue:"cover",enum:[{label:"contain",value:"contain",helperText:"The image should never get cropped"},{label:"cover",value:"cover",helperText:"The image should fill it's box, cropping when needed"}]},{name:"backgroundPosition",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"altText",type:"string",helperText:"Text to display when the user has images off"},{name:"height",type:"number",hideFromUI:!0},{name:"width",type:"number",hideFromUI:!0},{name:"sizes",type:"string",hideFromUI:!0},{name:"srcset",type:"string",hideFromUI:!0},{name:"lazy",type:"boolean",defaultValue:!0,hideFromUI:!0},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the image's aspect ratio",defaultValue:!0},{name:"highPriority",type:"boolean",advanced:!0,helperText:"Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."},{name:"aspectRatio",type:"number",helperText:"This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",advanced:!0,defaultValue:.7041}],shouldReceiveBuilderProps:{builderBlock:!0}},ht={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>"}}}]},gt={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}};function bt(e){var t,n,i;return a.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:a.jsx(K,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const xt={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}},yt={shouldReceiveBuilderProps:{builderBlock:!1,builderContext:!0},name:"Text",static:!0,isRSC:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",inputs:[{name:"text",type:"html",required:!0,autoFocus:!0,bubble:!0,defaultValue:"Enter some text..."}],defaultStyles:{lineHeight:"normal",height:"auto",textAlign:"center"}};function ke(e){const t=function(){var s;const i=e.builderContext,{context:o,localState:r,rootState:l,rootSetState:c}=i;return String(((s=e.text)==null?void 0:s.toString())||"").replace(/{{([^}]+)}}/g,(d,f)=>V({code:f,context:o,localState:r,rootState:l,rootSetState:c,enableCache:!1}))};return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:t()},style:{outline:"none"}})}const St={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 vt(e){const t=v.useRef(null),[n,i]=v.useState(()=>[]),[o,r]=v.useState(()=>[]);return v.useEffect(()=>{var c;if(!((c=t.current)!=null&&c.getElementsByTagName)||typeof window=="undefined")return;const l=t.current.getElementsByTagName("script");for(let s=0;s<l.length;s++){const d=l[s];if(d.src){if(n.includes(d.src))continue;n.push(d.src);const f=document.createElement("script");f.async=!0,f.src=d.src,document.head.appendChild(f)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(o.includes(d.innerText))continue;try{o.push(d.innerText),new Function(d.innerText)()}catch(f){console.warn("`CustomCode`: Error running script:",f)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const kt={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}]},pt=["text/javascript","application/javascript","application/ecmascript"],Ct=e=>pt.includes(e.type);function It(e){const t=v.useRef(null),[n,i]=v.useState(()=>[]),[o,r]=v.useState(()=>[]),[l,c]=v.useState(()=>!1);function s(){if(!t.current||!t.current.getElementsByTagName)return;const d=t.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const u=d[f];if(u.src&&!n.includes(u.src)){n.push(u.src);const g=document.createElement("script");g.async=!0,g.src=u.src,document.head.appendChild(g)}else if(Ct(u)&&!o.includes(u.innerText))try{o.push(u.innerText),new Function(u.innerText)()}catch(g){console.warn("`Embed`: Error running script:",g)}}}return v.useEffect(()=>{t.current&&!l&&(c(!0),s())},[t.current,l]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const wt={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 Tt(e){return a.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},m.isEditing()&&e.imgSrc||"default-key")}const Et={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0}};function pe(e){var i,o,r,l,c,s,d;function t(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function n(){return{...t()}}return a.jsxs("div",{style:{position:"relative"},children:[a.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:a.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(c=(l=e.builderBlock)==null?void 0:l.children)!=null&&c.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(d=(s=e.builderBlock)==null?void 0:s.children)!=null&&d.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 Rt=()=>[{component:vt,...St},{component:It,...kt},{component:Tt,...wt},{component:pe,...Et}],ae=()=>[{component:de,...dt},{component:xe,...ut},{component:ye,...mt},{component:Se,...ft},{component:ve,...ht},{component:bt,...gt},{component:Re,...xt},{component:ke,...yt},...Rt()],jt=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
55
|
+
}`})]})}function ve(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 gt={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(r=>!r.get("width"))||n.reduce((s,l)=>s+l.get("width"),0)!==100)&&t()}},{name:"space",type:"number",defaultValue:20,helperText:"Size of gap between columns",advanced:!0},{name:"stackColumnsAt",type:"string",defaultValue:"tablet",helperText:"Convert horizontal columns to vertical at what device size",enum:["tablet","mobile","never"],advanced:!0},{name:"reverseColumnsWhenStacked",type:"boolean",defaultValue:!1,helperText:"When stacking columns for mobile devices, reverse the ordering",advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0,builderContext:!0,builderComponents:!0,builderLinkComponent:!0}},xt={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},yt={name:"Image",static:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",defaultStyles:{position:"relative",minHeight:"20px",minWidth:"20px",overflow:"hidden"},canHaveChildren:!0,inputs:[{name:"image",type:"file",bubble:!0,allowedFileTypes:["jpeg","jpg","png","svg","webp"],required:!0,defaultValue:"https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",onChange:e=>{e.delete("srcset"),e.delete("noWebp");function n(c,s=6e4){return new Promise((l,d)=>{const m=document.createElement("img");let f=!1;m.onload=()=>{f=!0,l(m)},m.addEventListener("error",h=>{console.warn("Image load failed",h.error),d(h.error)}),m.src=c,setTimeout(()=>{f||d(new Error("Image load timed out"))},s)})}function i(c){return Math.round(c*1e3)/1e3}const o=e.get("image"),r=e.get("aspectRatio");if(fetch(o).then(c=>c.blob()).then(c=>{c.type.includes("svg")&&e.set("noWebp",!0)}),o&&(!r||r===.7041))return n(o).then(c=>{const s=e.get("aspectRatio");e.get("image")===o&&(!s||s===.7041)&&c.width&&c.height&&(e.set("aspectRatio",i(c.height/c.width)),e.set("height",c.height),e.set("width",c.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}},pt={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>"}}}]},vt={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}};function St(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(U,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(i=e.builderContext.rootState)==null?void 0:i[e.name]})})}const kt={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}},Ct={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 Se(e){const t=function(){var l;const i=e.builderContext,{context:o,localState:r,rootState:c,rootSetState:s}=i;return String(((l=e.text)==null?void 0:l.toString())||"").replace(/{{([^}]+)}}/g,(d,m)=>V({code:m,context:o,localState:r,rootState:c,rootSetState:s,enableCache:!1}))};return a.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:t()},style:{outline:"none"}})}const It={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 wt(e){const t=p.useRef(null),[n,i]=p.useState(()=>[]),[o,r]=p.useState(()=>[]);return p.useEffect(()=>{var s;if(!((s=t.current)!=null&&s.getElementsByTagName)||typeof window=="undefined")return;const c=t.current.getElementsByTagName("script");for(let l=0;l<c.length;l++){const d=c[l];if(d.src){if(n.includes(d.src))continue;n.push(d.src);const m=document.createElement("script");m.async=!0,m.src=d.src,document.head.appendChild(m)}else if(!d.type||["text/javascript","application/javascript","application/ecmascript"].includes(d.type)){if(o.includes(d.innerText))continue;try{o.push(d.innerText),new Function(d.innerText)()}catch(m){console.warn("`CustomCode`: Error running script:",m)}}}},[]),a.jsx("div",{ref:t,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}const Tt={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}]},Et=["text/javascript","application/javascript","application/ecmascript"],Rt=e=>Et.includes(e.type);function Pt(e){const t=p.useRef(null),[n,i]=p.useState(()=>[]),[o,r]=p.useState(()=>[]),[c,s]=p.useState(()=>!1);function l(){if(!t.current||!t.current.getElementsByTagName)return;const d=t.current.getElementsByTagName("script");for(let m=0;m<d.length;m++){const f=d[m];if(f.src&&!n.includes(f.src)){n.push(f.src);const h=document.createElement("script");h.async=!0,h.src=f.src,document.head.appendChild(h)}else if(Rt(f)&&!o.includes(f.innerText))try{o.push(f.innerText),new Function(f.innerText)()}catch(h){console.warn("`Embed`: Error running script:",h)}}}return p.useEffect(()=>{t.current&&!c&&(s(!0),l())},[t.current,c]),a.jsx("div",{className:"builder-embed",ref:t,dangerouslySetInnerHTML:{__html:e.content}})}const jt={name:"Raw:Img",hideFromInsertMenu:!0,image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",inputs:[{name:"image",bubble:!0,type:"file",allowedFileTypes:["jpeg","jpg","png","svg","gif","webp"],required:!0}],noWrap:!0,static:!0};function Bt(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 Wt={name:"Video",canHaveChildren:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"preload",type:"text",defaultValue:"metadata",enum:["auto","metadata","none"]},{name:"fitContent",type:"boolean",helperText:"When child blocks are provided, fit to them instead of using the aspect ratio",defaultValue:!0,advanced:!0},{name:"position",type:"text",defaultValue:"center",enum:["center","top","left","right","bottom","top left","top right","bottom left","bottom right"]},{name:"height",type:"number",advanced:!0},{name:"width",type:"number",advanced:!0},{name:"aspectRatio",type:"number",advanced:!0,defaultValue:.7004048582995948},{name:"lazyLoad",type:"boolean",helperText:'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',defaultValue:!0,advanced:!0}],shouldReceiveBuilderProps:{builderBlock:!0}};function ke(e){var i,o,r,c,s,l,d;function t(){return{...e.autoPlay===!0?{autoPlay:!0}:{},...e.muted===!0?{muted:!0}:{},...e.controls===!0?{controls:!0}:{},...e.loop===!0?{loop:!0}:{},...e.playsInline===!0?{playsInline:!0}:{}}}function n(){return{...t()}}return a.jsxs("div",{style:{position:"relative"},children:[a.jsx("video",{className:"builder-video",...n(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(i=e.attributes)==null?void 0:i.style,objectFit:e.fit,objectPosition:e.position,zIndex:2,borderRadius:"1px",...e.aspectRatio?{position:"absolute"}:null},src:e.video||"no-src",poster:e.posterImage,children:e.lazyLoad?null:a.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((r=(o=e.builderBlock)==null?void 0:o.children)!=null&&r.length))?a.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(s=(c=e.builderBlock)==null?void 0:c.children)!=null&&s.length&&e.fitContent?a.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(d=(l=e.builderBlock)==null?void 0:l.children)!=null&&d.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 At=()=>[{component:wt,...It},{component:Pt,...Tt},{component:Bt,...jt},{component:ke,...Wt}],ae=()=>[{component:de,...gt},{component:xe,...bt},{component:ye,...xt},{component:pe,...yt},{component:ve,...pt},{component:St,...vt},{component:Re,...kt},{component:Se,...Ct},...At()],Nt=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
56
56
|
function getAndSetVariantId() {
|
|
57
57
|
function setCookie(name, value, days) {
|
|
58
58
|
let expires = '';
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}).join('');
|
|
109
109
|
styleEl.innerHTML = newStyleStr;
|
|
110
110
|
}
|
|
111
|
-
}`,
|
|
111
|
+
}`,Vt=`function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
112
112
|
if (!navigator.cookieEnabled) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
@@ -142,29 +142,29 @@
|
|
|
142
142
|
thisScriptEl?.remove();
|
|
143
143
|
}
|
|
144
144
|
return;
|
|
145
|
-
}`,Ce="builderIoAbTest",Ie="builderIoRenderContent",
|
|
146
|
-
window.${Ce} = ${
|
|
147
|
-
window.${Ie} = ${
|
|
148
|
-
`,
|
|
145
|
+
}`,Ce="builderIoAbTest",Ie="builderIoRenderContent",_=e=>Object.values((e==null?void 0:e.variations)||{}).map(t=>({...t,testVariationId:t.id,id:e==null?void 0:e.id})),Ft=({canTrack:e,content:t})=>!(!(_(t).length>0)||!e||u.isBrowser()),$t=e=>e==="react"||e==="reactNative",we=$t(u.TARGET),Lt=()=>`
|
|
146
|
+
window.${Ce} = ${Nt}
|
|
147
|
+
window.${Ie} = ${Vt}
|
|
148
|
+
`,Dt=(e,t)=>`
|
|
149
149
|
window.${Ce}(
|
|
150
150
|
"${t}",${JSON.stringify(e)}, ${we}
|
|
151
|
-
)`,
|
|
151
|
+
)`,Ot=({contentId:e,variationId:t})=>`window.${Ie}(
|
|
152
152
|
"${t}", "${e}", ${we}
|
|
153
|
-
)`;function J(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}const Te=
|
|
153
|
+
)`;function J(e){return a.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id,nonce:e.nonce||""})}const Te=p.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{},nonce:""});function re(e){return Math.round(e*1e3)/1e3}const _t=(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},Ht=e=>_t(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ce=({event:e,target:t})=>{const n=t.getBoundingClientRect(),i=e.clientX-n.left,o=e.clientY-n.top,r=re(i/n.width),c=re(o/n.height);return{x:r,y:c}},Mt=e=>{const t=e.target,n=t&&Ht(t),i=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:t?ce({event:e,target:t}):void 0,builderTargetOffset:n?ce({event:e,target:n}):void 0,builderElementIndex:n&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(n):void 0}}};async function Ut({key:e,value:t}){return u.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}function le(e,...t){const n=Object(e);for(let i=1;i<arguments.length;i++){const o=arguments[i];if(o!=null)for(const r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])}return n}function Kt(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function zt(e,t){const n=qt(e),i=getComputedStyle(t),o=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,c=[o,r];for(const s of c)for(const l of n)l in s||(s[l]=i[l])}function qt(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 Yt(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Kt(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{zt(e,n),n.style.transition="none",n.style.transitionDelay="0",le(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${X(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),le(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const Gt=e=>{var r,c;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],i=(c=e.fileUrl)!=null?c:(r=e==null?void 0:e.files)==null?void 0:r.regular;let o="";if(i&&t&&n&&(o+=`
|
|
154
154
|
@font-face {
|
|
155
155
|
font-family: "${t}";
|
|
156
156
|
src: local("${n}"), url('${i}') format('woff2');
|
|
157
157
|
font-display: fallback;
|
|
158
158
|
font-weight: 400;
|
|
159
159
|
}
|
|
160
|
-
`.trim()),e.files)for(const
|
|
160
|
+
`.trim()),e.files)for(const s in e.files){if(!(String(Number(s))===s))continue;const d=e.files[s];d&&d!==i&&(o+=`
|
|
161
161
|
@font-face {
|
|
162
162
|
font-family: "${t}";
|
|
163
163
|
src: url('${d}') format('woff2');
|
|
164
164
|
font-display: fallback;
|
|
165
|
-
font-weight: ${
|
|
165
|
+
font-weight: ${s};
|
|
166
166
|
}
|
|
167
|
-
`.trim())}return o},
|
|
167
|
+
`.trim())}return o},Jt=({customFonts:e})=>{var t;return((t=e==null?void 0:e.map(n=>Gt(n)))==null?void 0:t.join(" "))||""},Qt=({cssCode:e,contentId:t})=>e?t?(e==null?void 0:e.replace(/&/g,`div[builder-content-id="${t}"]`))||"":e:"",Xt=`
|
|
168
168
|
.builder-button {
|
|
169
169
|
all: unset;
|
|
170
170
|
}
|
|
@@ -181,8 +181,8 @@ font-weight: ${c};
|
|
|
181
181
|
text-align: inherit;
|
|
182
182
|
font-family: inherit;
|
|
183
183
|
}
|
|
184
|
-
`,
|
|
185
|
-
${
|
|
186
|
-
${
|
|
187
|
-
${
|
|
188
|
-
`.trim();return a.jsx(
|
|
184
|
+
`,Zt=e=>e?"":Xt,en=e=>`variant-${e}`;function tn(e){var j,F,$,K,z,ee,te;const t=p.useRef(null);function n(x){var S,k;const g={...e.builderContextSignal.rootState,...x};e.builderContextSignal.rootSetState?(k=(S=e.builderContextSignal).rootSetState)==null||k.call(S,g):e.builderContextSignal.rootState=g}function i(x){var S,k,T,P,D;const g={...e.builderContextSignal.content,...x,data:{...(S=e.builderContextSignal.content)==null?void 0:S.data,...x==null?void 0:x.data},meta:{...(k=e.builderContextSignal.content)==null?void 0:k.meta,...x==null?void 0:x.meta,breakpoints:((T=x==null?void 0:x.meta)==null?void 0:T.breakpoints)||((D=(P=e.builderContextSignal.content)==null?void 0:P.meta)==null?void 0:D.breakpoints)}};Ut({value:g,key:g.id}).then(()=>{R.refresh()})}function o(){return e.showContent?{}:{hidden:!0,"aria-hidden":!0}}const[r,c]=p.useState(()=>e.contentWrapper||"div");function s(x){return u.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:g=>{var T;const{breakpoints:S,contentId:k}=g;!k||k!==((T=e.builderContextSignal.content)==null?void 0:T.id)||S&&i({meta:{breakpoints:S}})},animation:g=>{Yt(g)},contentUpdate:g=>{i(g)}}})(x)}function l(){var g,S;const x=(S=(g=e.builderContextSignal.content)==null?void 0:g.data)==null?void 0:S.jsCode;x&&V({code:x,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[d,m]=p.useState(()=>({})),[f,h]=p.useState(()=>({})),[C,I]=p.useState(()=>!1);function b(x){var g,S;if(e.builderContextSignal.content){const k=(g=e.builderContextSignal.content)==null?void 0:g.testVariationId,T=(S=e.builderContextSignal.content)==null?void 0:S.id;u._track({type:"click",canTrack:u.getDefaultCanTrack(e.canTrack),contentId:T,apiKey:e.apiKey,variationId:k!==T?k:void 0,...Mt(x),unique:!C})}C||I(!0)}function E(){var g,S,k;const x=(k=(S=(g=e.builderContextSignal.content)==null?void 0:g.data)==null?void 0:S.httpRequests)!=null?k:{};Object.entries(x).forEach(([T,P])=>{if(!P||f[T]||d[T]&&!u.isEditing())return;f[T]=!0;const D=P.replace(/{{([^}]+)}}/g,(A,Pe)=>String(V({code:Pe,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));u.fetch(D).then(A=>A.json()).then(A=>{n({[T]:A}),d[T]=!0}).catch(A=>{console.error("error fetching dynamic data",P,A)}).finally(()=>{f[T]=!1})})}function v(){u.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:W.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function y(x){window.addEventListener("message",s),u.registerInsertMenu(),u.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(g=>{var k;const S=u.createRegisterComponentMessage(g);(k=window.parent)==null||k.postMessage(S,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",v)}function w(x){const g=new URL(location.href).searchParams,S=g.get("builder.preview"),k=g.get(`builder.overrides.${S}`),T=g.get("apiKey")||g.get("builder.space");S===e.model&&T===e.apiKey&&(!e.content||k===e.content.id)&&u.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(P=>{P&&i(P)})}const R=We.useRouter();return p.useEffect(()=>{var x;return(x=t.current)==null||x.addEventListener("initeditingbldr",y),()=>{var g;return(g=t.current)==null?void 0:g.removeEventListener("initeditingbldr",y)}},[]),p.useEffect(()=>{var x;return(x=t.current)==null||x.addEventListener("initpreviewingbldr",w),()=>{var g;return(g=t.current)==null?void 0:g.removeEventListener("initpreviewingbldr",w)}},[]),p.useEffect(()=>{var x,g;if(u.isBrowser()){if(u.isEditing()&&t.current&&t.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&u.getDefaultCanTrack(e.canTrack)){const k=(x=e.builderContextSignal.content)==null?void 0:x.testVariationId,T=(g=e.builderContextSignal.content)==null?void 0:g.id,P=e.apiKey;u._track({type:"impression",canTrack:!0,contentId:T,apiKey:P,variationId:k!==T?k:void 0})}u.isPreviewing()&&u.isEditing()}},[]),p.useEffect(()=>{e.apiKey||u.logger.error("No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."),l(),E(),v()},[]),p.useEffect(()=>{},[e.content]),p.useEffect(()=>{l()},[(F=(j=e.builderContextSignal.content)==null?void 0:j.data)==null?void 0:F.jsCode]),p.useEffect(()=>{E()},[(K=($=e.builderContextSignal.content)==null?void 0:$.data)==null?void 0:K.httpRequests]),p.useEffect(()=>{v()},[e.builderContextSignal.rootState]),p.useEffect(()=>{e.data&&n(e.data)},[e.data]),p.useEffect(()=>{e.locale&&n({locale:e.locale})},[e.locale]),p.useEffect(()=>()=>{u.isBrowser()&&(window.removeEventListener("message",s),window.removeEventListener("builder:component:stateChangeListenerActivated",v))},[]),a.jsx(Te.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?a.jsx(r,{ref:t,onClick:x=>b(x),"builder-content-id":(z=e.builderContextSignal.content)==null?void 0:z.id,"builder-model":e.model,...o(),...e.contentWrapperProps,className:en(((ee=e.content)==null?void 0:ee.testVariationId)||((te=e.content)==null?void 0:te.id)),children:e.children}):null})}function nn(e){const t=`
|
|
185
|
+
${Qt({cssCode:e.cssCode,contentId:e.contentId})}
|
|
186
|
+
${Jt({customFonts:e.customFonts})}
|
|
187
|
+
${Zt(e.isNestedRender)}
|
|
188
|
+
`.trim();return a.jsx(H,{id:"builderio-content",styles:t,nonce:e.nonce})}const on=({content:e,data:t,locale:n})=>{var r,c,s;const i={},o=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(s=(c=e==null?void 0:e.data)==null?void 0:c.inputs)==null||s.forEach(l=>{l.name&&l.defaultValue!==void 0&&(i[l.name]=l.defaultValue)}),{...i,...o,...t,...n?{locale:n}:{}}},an=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function se(e){var o,r,c,s,l,d,m,f,h,C,I;const t=Ot({variationId:(o=e.content)==null?void 0:o.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...ae(),...((c=e.customComponents)==null?void 0:c.filter(({models:b})=>!(b!=null&&b.length)||!e.model?!0:b.includes(e.model)))||[]].reduce((b,{component:E,...v})=>({...b,[v.name]:{component:E,...u.serializeIncludingFunctions(v)}}),{}),i={content:an({content:e.content,data:e.data}),localState:void 0,rootState:on({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...ae(),...((s=e.customComponents)==null?void 0:s.filter(({models:b})=>!(b!=null&&b.length)||!e.model?!0:b.includes(e.model)))||[]].reduce((b,{component:E,...v})=>({...b,[v.name]:u.serializeIncludingFunctions(v)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{},nonce:e.nonce||""};return a.jsxs(tn,{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:i,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?a.jsx(J,{id:"builderio-variant-visibility",scriptStr:t,nonce:e.nonce||""}):null,a.jsx(nn,{nonce:e.nonce||"",isNestedRender:e.isNestedRender,contentId:(l=i.content)==null?void 0:l.id,cssCode:(m=(d=i.content)==null?void 0:d.data)==null?void 0:m.cssCode,customFonts:(h=(f=i.content)==null?void 0:f.data)==null?void 0:h.customFonts}),a.jsx(U,{blocks:(I=(C=i.content)==null?void 0:C.data)==null?void 0:I.blocks,context:i,registeredComponents:n,linkComponent:e.linkComponent})]})}function Ee(e){var r;const t=Ft({canTrack:u.getDefaultCanTrack(e.canTrack),content:e.content}),n=function(){var s;return Dt(_(e.content).map(l=>({id:l.testVariationId,testRatio:l.testRatio})),((s=e.content)==null?void 0:s.id)||"")},i=function(){return _(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")},o=function(){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 a.jsxs(a.Fragment,{children:[!e.isNestedRender&&u.TARGET!=="reactNative"?a.jsx(J,{id:"builderio-init-variants-fns",scriptStr:Lt(),nonce:e.nonce||""}):null,t?a.jsxs(a.Fragment,{children:[a.jsx(H,{id:"builderio-variants",styles:i(),nonce:e.nonce||""}),a.jsx(J,{id:"builderio-variants-visibility",scriptStr:n(),nonce:e.nonce||""}),(r=_(e.content))==null?void 0:r.map(c=>a.jsx(se,{isNestedRender:e.isNestedRender,nonce:e.nonce,content:c,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},c.testVariationId))]}):null,a.jsx(se,{nonce:e.nonce,isNestedRender:e.isNestedRender,content:o(),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 rn=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)})};async function Re(e){var r,c,s,l,d;const t=function(){return"div"},n=function(){return"div"},i=function(){var f,h;return[e.attributes[L()],"builder-symbol",(f=e.symbol)!=null&&f.inline?"builder-inline-symbol":void 0,(h=e.symbol)!=null&&h.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},o=((r=e.symbol)==null?void 0:r.content)||await rn({symbol:e.symbol,builderContextValue:e.builderContext});return a.jsx("div",{...e.attributes,className:i(),children:a.jsx(Ee,{nonce:e.builderContext.nonce,isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(c=e.builderBlock)==null?void 0:c.id},customComponents:Object.values(e.builderComponents),data:{...(s=e.symbol)==null?void 0:s.data,...e.builderContext.localState,...(l=o==null?void 0:o.data)==null?void 0:l.state},canTrack:e.builderContext.canTrack,model:(d=e.symbol)==null?void 0:d.model,content:o,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}exports.Blocks=U;exports.BuilderContext=Te;exports.Button=de;exports.Columns=xe;exports.Content=Ee;exports.Fragment=ye;exports.Image=pe;exports.Section=ve;exports.Symbol=Re;exports.Text=Se;exports.Video=ke;
|