@builder.io/sdk-react-nextjs 0.14.15 → 0.14.17
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/{node/USE_CLIENT_BUNDLE-85565442.cjs → browser/USE_CLIENT_BUNDLE-f11159f6.cjs} +3 -3
- package/lib/browser/{USE_CLIENT_BUNDLE-619fca6f.js → USE_CLIENT_BUNDLE-f685a480.js} +15 -15
- package/lib/{edge/USE_SERVER_BUNDLE-b436e323.cjs → browser/USE_SERVER_BUNDLE-1ee4e92a.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-54c1fcea.js → browser/USE_SERVER_BUNDLE-fbe70d66.js} +1 -1
- package/lib/browser/{bundle-62dcf48b.js → bundle-974bbd75.js} +555 -540
- package/lib/browser/bundle-e5f3c905.cjs +169 -0
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{browser/USE_CLIENT_BUNDLE-d44f1d9a.cjs → edge/USE_CLIENT_BUNDLE-22f09854.cjs} +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-c0730eab.js → edge/USE_CLIENT_BUNDLE-bf35f13e.js} +15 -15
- package/lib/{node/USE_SERVER_BUNDLE-81427dab.cjs → edge/USE_SERVER_BUNDLE-4035cf43.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-558179bb.js → edge/USE_SERVER_BUNDLE-6b33cfd7.js} +1 -1
- package/lib/edge/{bundle-67ad9183.js → bundle-0e4ba4de.js} +1027 -1012
- package/lib/edge/{bundle-fbc6c22e.cjs → bundle-15a88622.cjs} +29 -29
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-84dff6eb.js → node/USE_CLIENT_BUNDLE-8dadab11.js} +15 -15
- package/lib/{edge/USE_CLIENT_BUNDLE-97b90370.cjs → node/USE_CLIENT_BUNDLE-e62d9c72.cjs} +3 -3
- package/lib/{browser/USE_SERVER_BUNDLE-b4db53a9.js → node/USE_SERVER_BUNDLE-d7d118c1.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-72579b21.cjs → node/USE_SERVER_BUNDLE-d847a064.cjs} +1 -1
- package/lib/node/{bundle-3fe2b5da.cjs → bundle-39fe7680.cjs} +9 -9
- package/lib/node/{bundle-5f638f04.js → bundle-a8217ddb.js} +170 -155
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/components/block/animator.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/is-previewing.d.ts +1 -1
- package/types/esm/components/block/animator.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/is-previewing.d.ts +1 -1
- package/lib/browser/bundle-df3df109.cjs +0 -169
package/lib/edge/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-22f09854.cjs"),e=require("./bundle-15a88622.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-4035cf43.cjs");require("next/navigation");require("lru-cache");exports.BuilderContext=t.builderContext;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/edge/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-
|
|
2
|
-
import { B as l, C as f, w as B, S as C, T as E, F as S, q as x, E as h, G as b, u as y, z as F, c as P, j as T, x as k, y as w, D as R, A as V } from "./bundle-
|
|
1
|
+
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-bf35f13e.js";
|
|
2
|
+
import { B as l, C as f, w as B, S as C, T as E, F as S, q as x, E as h, G as b, u as y, z as F, c as P, j as T, x as k, y as w, D as R, A as V } from "./bundle-0e4ba4de.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-
|
|
5
|
+
import "./USE_SERVER_BUNDLE-6b33cfd7.js";
|
|
6
6
|
import "next/navigation";
|
|
7
7
|
import "lru-cache";
|
|
8
8
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as i, Fragment as
|
|
3
|
-
import { i as Y, g as q, a as U, b as $, c as
|
|
2
|
+
import { jsx as i, Fragment as w, jsxs as I } from "react/jsx-runtime";
|
|
3
|
+
import { i as Y, g as q, a as U, b as $, c as E, d as R, e as Z, f as H, h as _, _ as V, j as p, l as ee, k as te, t as ne, m as D, n as ie, o as ae, p as ce, r as re, s as le, q as oe, u as de } from "./bundle-a8217ddb.js";
|
|
4
4
|
import { useRef as T, useState as k, useEffect as f, createContext as se } from "react";
|
|
5
|
-
import { p as ue } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as ue } from "./USE_SERVER_BUNDLE-d7d118c1.js";
|
|
6
6
|
import { useRouter as me } from "next/navigation";
|
|
7
7
|
function O(e) {
|
|
8
|
-
return /* @__PURE__ */ i(
|
|
8
|
+
return /* @__PURE__ */ i(w, { children: Y(e.TagName) ? /* @__PURE__ */ i(w, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(w, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
9
9
|
}
|
|
10
10
|
function xe(e) {
|
|
11
11
|
return /* @__PURE__ */ i(
|
|
@@ -78,7 +78,7 @@ function Ce(e) {
|
|
|
78
78
|
}
|
|
79
79
|
function d() {
|
|
80
80
|
var r, g;
|
|
81
|
-
|
|
81
|
+
E() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
|
|
82
82
|
{
|
|
83
83
|
type: "builder.clickEmptyBlocks",
|
|
84
84
|
data: {
|
|
@@ -91,7 +91,7 @@ function Ce(e) {
|
|
|
91
91
|
}
|
|
92
92
|
function S() {
|
|
93
93
|
var r, g;
|
|
94
|
-
|
|
94
|
+
E() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
|
|
95
95
|
{
|
|
96
96
|
type: "builder.hoverEmptyBlocks",
|
|
97
97
|
data: {
|
|
@@ -102,7 +102,7 @@ function Ce(e) {
|
|
|
102
102
|
"*"
|
|
103
103
|
));
|
|
104
104
|
}
|
|
105
|
-
return /* @__PURE__ */ I(
|
|
105
|
+
return /* @__PURE__ */ I(w, { children: [
|
|
106
106
|
/* @__PURE__ */ i(
|
|
107
107
|
e.BlocksWrapper,
|
|
108
108
|
{
|
|
@@ -157,8 +157,8 @@ function we(e) {
|
|
|
157
157
|
};
|
|
158
158
|
return e.aspectRatio ? s : void 0;
|
|
159
159
|
}
|
|
160
|
-
return /* @__PURE__ */ I(
|
|
161
|
-
/* @__PURE__ */ I(
|
|
160
|
+
return /* @__PURE__ */ I(w, { children: [
|
|
161
|
+
/* @__PURE__ */ I(w, { children: [
|
|
162
162
|
/* @__PURE__ */ I("picture", { children: [
|
|
163
163
|
d() ? /* @__PURE__ */ i("source", { type: "image/webp", srcSet: d() }) : null,
|
|
164
164
|
/* @__PURE__ */ i(
|
|
@@ -188,7 +188,7 @@ function we(e) {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
) : null,
|
|
191
|
-
(h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ i(
|
|
191
|
+
(h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ i(w, { children: e.children }) : null,
|
|
192
192
|
!e.fitContent && e.children ? /* @__PURE__ */ i("div", { className: "div-a0c95e8c-2", children: e.children }) : null
|
|
193
193
|
] }),
|
|
194
194
|
/* @__PURE__ */ i("style", { children: `.img-a0c95e8c {
|
|
@@ -312,7 +312,7 @@ function Te(e) {
|
|
|
312
312
|
src: e.imgSrc || e.image,
|
|
313
313
|
...e.attributes
|
|
314
314
|
},
|
|
315
|
-
|
|
315
|
+
E() && e.imgSrc || "default-key"
|
|
316
316
|
);
|
|
317
317
|
}
|
|
318
318
|
function Ne(e) {
|
|
@@ -525,7 +525,7 @@ function Be(e) {
|
|
|
525
525
|
var t, o;
|
|
526
526
|
const n = ((o = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : o.httpRequests) ?? {};
|
|
527
527
|
Object.entries(n).forEach(([c, u]) => {
|
|
528
|
-
if (!u || m[c] || s[c] && !
|
|
528
|
+
if (!u || m[c] || s[c] && !E())
|
|
529
529
|
return;
|
|
530
530
|
m[c] = !0;
|
|
531
531
|
const x = u.replace(
|
|
@@ -553,7 +553,7 @@ function Be(e) {
|
|
|
553
553
|
});
|
|
554
554
|
}
|
|
555
555
|
function P() {
|
|
556
|
-
|
|
556
|
+
E() && window.dispatchEvent(
|
|
557
557
|
new CustomEvent(
|
|
558
558
|
"builder:component:stateChange",
|
|
559
559
|
{
|
|
@@ -629,7 +629,7 @@ function Be(e) {
|
|
|
629
629
|
}, []), f(() => {
|
|
630
630
|
var n, t;
|
|
631
631
|
if (H()) {
|
|
632
|
-
if (
|
|
632
|
+
if (E() && a.current && a.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && _(e.canTrack)) {
|
|
633
633
|
const c = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, u = (t = e.builderContextSignal.content) == null ? void 0 : t.id, x = e.apiKey;
|
|
634
634
|
V({
|
|
635
635
|
type: "impression",
|
|
@@ -639,7 +639,7 @@ function Be(e) {
|
|
|
639
639
|
variationId: c !== u ? c : void 0
|
|
640
640
|
});
|
|
641
641
|
}
|
|
642
|
-
p();
|
|
642
|
+
p() && E();
|
|
643
643
|
}
|
|
644
644
|
}, []), f(() => {
|
|
645
645
|
e.apiKey || ee.error(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./bundle-39fe7680.cjs"),l=require("react"),M=require("./USE_SERVER_BUNDLE-d847a064.cjs"),D=require("next/navigation");function j(e){return t.jsx(t.Fragment,{children:n.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function H(e){return t.jsx(j,{attributes:{...e.attributes,[n.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[n.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function V(e){return t.jsx(j,{TagName:e.Wrapper,attributes:n.getBlockProperties({block:e.block,context:e.context}),actionAttributes:n.getBlockActions({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 U(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function $(e){function c(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function u(){var o,b;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((b=window.parent)==null||b.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var o,b;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((b=window.parent)==null||b.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:c()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>u(),onMouseEnter:o=>S(),onKeyPress:o=>u(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: stretch;
|
|
5
|
-
}`})]})}function O(e){return t.jsx("span",{children:e.children})}function J(e){var o,b,h,x;function c(){var f;const d=e.image||e.src;if(!d||!(d.match(/builder\.io/)||d.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),
|
|
5
|
+
}`})]})}function O(e){return t.jsx("span",{children:e.children})}function J(e){var o,b,h,x;function c(){var f;const d=e.image||e.src;if(!d||!(d.match(/builder\.io/)||d.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((f=e.image)!=null&&f.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),n.getSrcSet(d)}else if(e.image&&!e.srcset)return n.getSrcSet(d);return n.getSrcSet(d)}function u(){var g;return(g=c==null?void 0:c())!=null&&g.match(/builder\.io/)&&!e.noWebp?c().replace(/\?/g,"?format=webp&"):""}function S(){const g={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?g:void 0}return t.jsxs(t.Fragment,{children:[t.jsxs(t.Fragment,{children:[t.jsxs("picture",{children:[u()?t.jsx("source",{type:"image/webp",srcSet:u()}):null,t.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...S()},className:"builder-image"+(e.className?" "+e.className:"")+" img-a0c95e8c",src:e.image,srcSet:c(),sizes:e.sizes})]}),e.aspectRatio&&!((b=(o=e.builderBlock)==null?void 0:o.children)!=null&&b.length&&e.fitContent)?t.jsx("div",{className:"builder-image-sizer div-a0c95e8c",style:{paddingTop:e.aspectRatio*100+"%"}}):null,(x=(h=e.builderBlock)==null?void 0:h.children)!=null&&x.length&&e.fitContent?t.jsx(t.Fragment,{children:e.children}):null,!e.fitContent&&e.children?t.jsx("div",{className:"div-a0c95e8c-2",children:e.children}):null]}),t.jsx("style",{children:`.img-a0c95e8c {
|
|
6
6
|
opacity: 1;
|
|
7
7
|
transition: opacity 0.2s ease-in-out;
|
|
8
8
|
}.div-a0c95e8c {
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
left: 0;
|
|
19
19
|
width: 100%;
|
|
20
20
|
height: 100%;
|
|
21
|
-
}`})]})}function G(e){return t.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})}function Q(e){const c=l.useRef(null),[u,S]=l.useState(()=>[]),[o,b]=l.useState(()=>[]);return l.useEffect(()=>{var x;if(!((x=c.current)!=null&&x.getElementsByTagName)||typeof window>"u")return;const h=c.current.getElementsByTagName("script");for(let g=0;g<h.length;g++){const d=h[g];if(d.src){if(u.includes(d.src))continue;u.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)}}}},[]),t.jsx("div",{ref:c,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function X(e){const c=l.useRef(null),[u,S]=l.useState(()=>[]),[o,b]=l.useState(()=>[]),[h,x]=l.useState(()=>!1);function g(){if(!c.current||!c.current.getElementsByTagName)return;const d=c.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const v=d[f];if(v.src&&!u.includes(v.src)){u.push(v.src);const C=document.createElement("script");C.async=!0,C.src=v.src,document.head.appendChild(C)}else if(
|
|
21
|
+
}`})]})}function G(e){return t.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})}function Q(e){const c=l.useRef(null),[u,S]=l.useState(()=>[]),[o,b]=l.useState(()=>[]);return l.useEffect(()=>{var x;if(!((x=c.current)!=null&&x.getElementsByTagName)||typeof window>"u")return;const h=c.current.getElementsByTagName("script");for(let g=0;g<h.length;g++){const d=h[g];if(d.src){if(u.includes(d.src))continue;u.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)}}}},[]),t.jsx("div",{ref:c,className:"builder-custom-code"+(e.replaceNodes?" replace-nodes":""),dangerouslySetInnerHTML:{__html:e.code}})}function X(e){const c=l.useRef(null),[u,S]=l.useState(()=>[]),[o,b]=l.useState(()=>[]),[h,x]=l.useState(()=>!1);function g(){if(!c.current||!c.current.getElementsByTagName)return;const d=c.current.getElementsByTagName("script");for(let f=0;f<d.length;f++){const v=d[f];if(v.src&&!u.includes(v.src)){u.push(v.src);const C=document.createElement("script");C.async=!0,C.src=v.src,document.head.appendChild(C)}else if(n.isJsScript(v)&&!o.includes(v.innerText))try{o.push(v.innerText),new Function(v.innerText)()}catch(C){console.warn("`Embed`: Error running script:",C)}}}return l.useEffect(()=>{c.current&&!h&&(x(!0),g())},[c.current,h]),t.jsx("div",{className:"builder-embed",ref:c,dangerouslySetInnerHTML:{__html:e.content}})}function Y(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},n.isEditing()&&e.imgSrc||"default-key")}function Z(e){var S,o,b,h,x,g,d;function c(){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 u(){return{...c()}}return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("video",{className:"builder-video",...u(),preload:e.preload||"metadata",style:{width:"100%",height:"100%",...(S=e.attributes)==null?void 0:S.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:t.jsx("source",{type:"video/mp4",src:e.video})}),e.aspectRatio&&!(e.fitContent&&((b=(o=e.builderBlock)==null?void 0:o.children)!=null&&b.length))?t.jsx("div",{style:{width:"100%",paddingTop:e.aspectRatio*100+"%",pointerEvents:"none",fontSize:"0px"}}):null,(x=(h=e.builderBlock)==null?void 0:h.children)!=null&&x.length&&e.fitContent?t.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"stretch"},children:e.children}):null,(d=(g=e.builderBlock)==null?void 0:g.children)!=null&&d.length&&!e.fitContent?t.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 q=l.createContext({content:null,context:{},localState:void 0,rootSetState(){},rootState:{},apiKey:null,apiVersion:void 0,componentInfos:{},inheritedStyles:{},BlocksWrapper:"div",BlocksWrapperProps:{}});function p(e){var P,T,B,N,L,F,W;const c=l.useRef(null);function u(a){var s,r;const i={...e.builderContextSignal.rootState,...a};e.builderContextSignal.rootSetState?(r=(s=e.builderContextSignal).rootSetState)==null||r.call(s,i):e.builderContextSignal.rootState=i}function S(a){var s,r,m,y,k;const i={...e.builderContextSignal.content,...a,data:{...(s=e.builderContextSignal.content)==null?void 0:s.data,...a==null?void 0:a.data},meta:{...(r=e.builderContextSignal.content)==null?void 0:r.meta,...a==null?void 0:a.meta,breakpoints:((m=a==null?void 0:a.meta)==null?void 0:m.breakpoints)||((k=(y=e.builderContextSignal.content)==null?void 0:y.meta)==null?void 0:k.breakpoints)}};M.postPreviewContent({value:i,key:i.id}).then(()=>{_.refresh()})}const[o,b]=l.useState(()=>e.contentWrapper||"div");function h(a){return n.createEditorListener({model:e.model,trustedHosts:e.trustedHosts,callbacks:{configureSdk:i=>{var m;const{breakpoints:s,contentId:r}=i;!r||r!==((m=e.builderContextSignal.content)==null?void 0:m.id)||s&&S({meta:{breakpoints:s}})},animation:i=>{n.triggerAnimation(i)},contentUpdate:i=>{S(i)}}})(a)}function x(){var i,s;const a=(s=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:s.jsCode;a&&n.evaluate({code:a,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!1})}const[g,d]=l.useState(()=>({})),[f,v]=l.useState(()=>({})),[C,A]=l.useState(()=>!1);function K(a){var i,s;if(e.builderContextSignal.content){const r=(i=e.builderContextSignal.content)==null?void 0:i.testVariationId,m=(s=e.builderContextSignal.content)==null?void 0:s.id;n._track({type:"click",canTrack:n.getDefaultCanTrack(e.canTrack),contentId:m,apiKey:e.apiKey,variationId:r!==m?r:void 0,...n.getInteractionPropertiesForEvent(a),unique:!C})}C||A(!0)}function I(){var i,s;const a=((s=(i=e.builderContextSignal.content)==null?void 0:i.data)==null?void 0:s.httpRequests)??{};Object.entries(a).forEach(([r,m])=>{if(!m||f[r]||g[r]&&!n.isEditing())return;f[r]=!0;const y=m.replace(/{{([^}]+)}}/g,(k,z)=>String(n.evaluate({code:z,context:e.context||{},localState:void 0,rootState:e.builderContextSignal.rootState,rootSetState:e.builderContextSignal.rootSetState,enableCache:!0})));n.fetch(y).then(k=>k.json()).then(k=>{u({[r]:k}),g[r]=!0}).catch(k=>{console.error("error fetching dynamic data",m,k)}).finally(()=>{f[r]=!1})})}function E(){n.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:n.fastClone(e.builderContextSignal.rootState),ref:{name:e.model}}}))}function w(a){window.addEventListener("message",h),n.registerInsertMenu(),n.setupBrowserForEditing({...e.locale?{locale:e.locale}:{},...e.enrich?{enrich:e.enrich}:{},...e.trustedHosts?{trustedHosts:e.trustedHosts}:{}}),Object.values(e.builderContextSignal.componentInfos).forEach(i=>{var r;const s=n.createRegisterComponentMessage(i);(r=window.parent)==null||r.postMessage(s,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",E)}function R(a){const i=new URL(location.href).searchParams,s=i.get("builder.preview"),r=i.get(`builder.preview.${s}`),m=i.get("apiKey")||i.get("builder.space");s===e.model&&m===e.apiKey&&(!e.content||r===e.content.id)&&n.fetchOneEntry({model:e.model,apiKey:e.apiKey,apiVersion:e.builderContextSignal.apiVersion}).then(y=>{y&&S(y)})}const _=D.useRouter();return l.useEffect(()=>{var a;return(a=c.current)==null||a.addEventListener("initeditingbldr",w),()=>{var i;return(i=c.current)==null?void 0:i.removeEventListener("initeditingbldr",w)}},[]),l.useEffect(()=>{var a;return(a=c.current)==null||a.addEventListener("initpreviewingbldr",R),()=>{var i;return(i=c.current)==null?void 0:i.removeEventListener("initpreviewingbldr",R)}},[]),l.useEffect(()=>{var a,i;if(n.isBrowser()){if(n.isEditing()&&c.current&&c.current.dispatchEvent(new CustomEvent("initeditingbldr")),e.builderContextSignal.content&&n.getDefaultCanTrack(e.canTrack)){const r=(a=e.builderContextSignal.content)==null?void 0:a.testVariationId,m=(i=e.builderContextSignal.content)==null?void 0:i.id,y=e.apiKey;n._track({type:"impression",canTrack:!0,contentId:m,apiKey:y,variationId:r!==m?r:void 0})}n.isPreviewing()&&n.isEditing()}},[]),l.useEffect(()=>{e.apiKey||n.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),x(),I(),E()},[]),l.useEffect(()=>{},[e.content]),l.useEffect(()=>{x()},[(T=(P=e.builderContextSignal.content)==null?void 0:P.data)==null?void 0:T.jsCode]),l.useEffect(()=>{I()},[(N=(B=e.builderContextSignal.content)==null?void 0:B.data)==null?void 0:N.httpRequests]),l.useEffect(()=>{E()},[e.builderContextSignal.rootState]),l.useEffect(()=>{e.data&&u(e.data)},[e.data]),l.useEffect(()=>{e.locale&&u({locale:e.locale})},[e.locale]),l.useEffect(()=>()=>{n.isBrowser()&&(window.removeEventListener("message",h),window.removeEventListener("builder:component:stateChangeListenerActivated",E))},[]),t.jsx(q.Provider,{value:e.builderContextSignal,children:e.builderContextSignal.content?t.jsx(o,{ref:c,onClick:a=>K(a),"builder-content-id":(L=e.builderContextSignal.content)==null?void 0:L.id,"builder-model":e.model,...e.showContent?{}:{hidden:!0,"aria-hidden":!0},...e.contentWrapperProps,className:`variant-${((F=e.content)==null?void 0:F.testVariationId)||((W=e.content)==null?void 0:W.id)}`,children:e.children}):null})}exports.BlockWrapper=V;exports.BlocksWrapper=$;exports.Button=H;exports.CustomCode=Q;exports.DynamicRenderer=j;exports.Embed=X;exports.EnableEditor=p;exports.FragmentComponent=O;exports.Image=J;exports.ImgComponent=Y;exports.InteractiveElement=U;exports.SectionComponent=G;exports.Video=Z;exports.builderContext=q;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-39fe7680.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const jsxRuntime=require("react/jsx-runtime");require("react");const USE_CLIENT_BUNDLE=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";const jsxRuntime=require("react/jsx-runtime");require("react");const USE_CLIENT_BUNDLE=require("./USE_CLIENT_BUNDLE-e62d9c72.cjs"),lruCache=require("lru-cache");require("next/navigation");const EMPTY_HTML_ELEMENTS=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),isEmptyElement=e=>typeof e=="string"&&EMPTY_HTML_ELEMENTS.has(e.toLowerCase()),TARGET="rsc",getClassPropName=()=>{switch(TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function getBlockComponentOptions(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const MSG_PREFIX="[Builder.io]: ",logger={log:(...e)=>console.log(MSG_PREFIX,...e),error:(...e)=>console.error(MSG_PREFIX,...e),warn:(...e)=>console.warn(MSG_PREFIX,...e),debug:(...e)=>console.debug(MSG_PREFIX,...e)};function isBrowser(){return typeof window<"u"&&typeof document<"u"}const convertSearchParamsToQueryObject=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},normalizeSearchParams=e=>e instanceof URLSearchParams?convertSearchParamsToQueryObject(e):e,getSearchString=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function isIframe(){return isBrowser()&&window.self!==window.top}function isEditing(e){return isIframe()&&getSearchString(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const getLocation=()=>{if(isBrowser()){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},getUserAgent=()=>typeof navigator=="object"&&navigator.userAgent||"",getUserAttributes=()=>{const e=getUserAgent(),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()||TARGET==="reactNative"}},n=e.match(/Tablet|iPad/i),o=getLocation();return{urlPath:o==null?void 0:o.pathname,host:(o==null?void 0:o.host)||(o==null?void 0:o.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},getFunctionArguments=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),getBuilderGlobals=()=>({isEditing:isEditing(),isBrowser:isBrowser(),isServer:!isBrowser(),getUserAttributes:()=>getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,runInBrowser=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const s=getFunctionArguments({builder:t,context:n,event:o,state:flattenState({rootState:a,localState:i,rootSetState:r})});return new Function(...s.map(([c])=>c),e)(...s.map(([,c])=>c))};function flattenState({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(o,i)=>{if(t&&i in t)return t[i];const r=o[i];return typeof r=="object"&&r!==null?flattenState({rootState:r,localState:void 0,rootSetState:n?a=>{o[i]=a,n(o)}:void 0}):r},set:(o,i,r)=>{if(t&&i in t)throw new Error("Writing to local state is not allowed as it is read-only.");return o[i]=r,n==null||n(o),!0}})}const fastClone=e=>JSON.parse(JSON.stringify(e)),set=(e,t,n)=>{if(Object(e)!==e)return e;const o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return o.slice(0,-1).reduce((i,r,a)=>Object(i[r])===i[r]?i[r]:i[r]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
|
|
2
2
|
var refToProxy = (obj) => {
|
|
3
3
|
if (typeof obj !== 'object' || obj === null) {
|
|
4
4
|
return obj;
|
|
@@ -45,15 +45,15 @@ output;
|
|
|
45
45
|
a server-only execution path within your application.
|
|
46
46
|
|
|
47
47
|
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
48
|
-
`)},getIsolateContext=()=>{const e=getIvm();return new e.Isolate({memoryLimit:128}).createContextSync()},runInNode=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const s=getIvm(),c=fastClone({...a,...i}),d=getFunctionArguments({builder:t,context:n,event:o,state:c}),g=getIsolateContext(),
|
|
48
|
+
`)},getIsolateContext=()=>{const e=getIvm();return new e.Isolate({memoryLimit:128}).createContextSync()},runInNode=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const s=getIvm(),c=fastClone({...a,...i}),d=getFunctionArguments({builder:t,context:n,event:o,state:c}),g=getIsolateContext(),u=g.global;u.setSync("global",u.derefInto()),u.setSync("log",function(...m){console.log(...m)}),u.setSync(BUILDER_SET_STATE_NAME,function(m,l){set(a,m,l),r==null||r(a)}),d.forEach(([m,l])=>{const b=typeof l=="object"?new s.Reference(m==="builder"?{...l,getUserAttributes:()=>l.getUserAttributes()}:l):null;u.setSync(getSyncValName(m),b)}),u.setSync(INJECTED_IVM_GLOBAL,s);const f=processCode({code:e,args:d}),h=g.evalSync(f);try{return JSON.parse(h)}catch{return h}},checkIsDefined=e=>e!=null;function isNodeRuntime(){var e;return typeof process<"u"&&checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const shouldForceBrowserRuntimeInNode=()=>{var o;if(!isNodeRuntime())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return e&&t&&!n?(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},chooseBrowserOrServerEval=e=>isBrowser()||shouldForceBrowserRuntimeInNode()?runInBrowser(e):runInNode(e),_EvalCache=class v{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return v.cache.get(t)}static setCachedValue(t,n){v.cache.size>20&&v.cache.delete(v.cache.keys().next().value),v.cache.set(t,{value:n})}};_EvalCache.cacheLimit=20;_EvalCache.cache=new Map;let EvalCache=_EvalCache;function evaluate({code:e,context:t,localState:n,rootState:o,rootSetState:i,event:r,isExpression:a=!0,enableCache:s}){if(e==="")return;const c={code:parseCode(e,{isExpression:a}),builder:getBuilderGlobals(),context:t,event:r,rootSetState:i,rootState:o,localState:n};if(s){const d=EvalCache.getCacheKey(c),g=EvalCache.getCachedValue(d);if(g)return g.value}try{const d=chooseBrowserOrServerEval(c);if(s){const g=EvalCache.getCacheKey(c);EvalCache.setCachedValue(g,d)}return d}catch(d){logger.error("Failed code evaluation: "+d.message,{code:e});return}}function transformBlock(e){return e}const evaluateBindings=({block:e,context:t,localState:n,rootState:o,rootSetState:i})=>{if(!e.bindings)return e;const r=fastClone(e),a={...r,properties:{...r.properties},actions:{...r.actions}};for(const s in e.bindings){const c=e.bindings[s],d=evaluate({code:c,localState:n,rootState:o,rootSetState:i,context:t,enableCache:!0});set(a,s,d)}return a};function getProcessedBlock({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:i,rootSetState:r}){const a=e;return n?evaluateBindings({block:a,localState:o,rootState:i,rootSetState:r,context:t}):a}const camelToKebabCase=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),convertStyleMapToCSSArray=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${camelToKebabCase(n)}: ${o};`}).filter(checkIsDefined),convertStyleMapToCSS=e=>convertStyleMapToCSSArray(e).join(`
|
|
49
49
|
`),createCssClass=({mediaQuery:e,className:t,styles:n})=>{const o=`.${t} {
|
|
50
50
|
${convertStyleMapToCSS(n)}
|
|
51
51
|
}`;return e?`${e} {
|
|
52
52
|
${o}
|
|
53
53
|
}`:o};function transformStyleProperty({style:e}){return e}const getStyle=({block:e,context:t})=>mapStyleObjToStrIfNeeded(transformStyleProperty({style:e.style||{},context:t,block:e}));function mapStyleObjToStrIfNeeded(e){switch(TARGET){case"svelte":case"vue":case"solid":return convertStyleMapToCSSArray(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const getComponent=({block:e,context:t,registeredComponents:n})=>{var r;const o=(r=getProcessedBlock({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:r.name;if(!o)return null;const i=n[o];if(i)return i;console.warn(`
|
|
54
54
|
Could not find a registered component named "${o}".
|
|
55
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},getRepeatItemData=({block:e,context:t})=>{const{repeat:n,...o}=e;if(!(n!=null&&n.collection))return;const i=evaluate({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(i))return;const r=n.collection.split(".").pop(),a=n.itemName||(r?r+"Item":"item");return i.map((c,d)=>({context:{...t,localState:{...t.localState,$index:d,$item:c,[a]:c,[`$${a}Index`]:d}},block:o}))},SIZES={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},getMaxWidthQueryForSize=(e,t=SIZES)=>`@media (max-width: ${t[e].max}px)`,getSizesForBreakpoints=({small:e,medium:t})=>{const n=fastClone(SIZES);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const i=n.small.max+1;n.medium={max:t,min:i,default:i+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n};function InlinedStyles(e){return jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id})}function BlockStyles(e){const t=function(){const i=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return checkIsDefined(i.hide)?!i.hide:checkIsDefined(i.show)?i.show:!0},n=function(){var u;const i=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),r=i.responsiveStyles,a=e.context.content,s=getSizesForBreakpoints(((u=a==null?void 0:a.meta)==null?void 0:u.breakpoints)||{}),c=r==null?void 0:r.large,d=r==null?void 0:r.medium,g=r==null?void 0:r.small,l=i.id;if(!l)return"";const f=c?createCssClass({className:l,styles:c}):"",p=d?createCssClass({className:l,styles:d,mediaQuery:getMaxWidthQueryForSize("medium",s)}):"",m=g?createCssClass({className:l,styles:g,mediaQuery:getMaxWidthQueryForSize("small",s)}):"";return[f,p,m].join(" ")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()&&t()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedStyles,{id:"builderio-block",styles:n()})}):null})}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}const getEventHandlerName=e=>`on${capitalizeFirstLetter(e)}`,createEventHandler=(e,t)=>n=>evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function getBlockActions(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const i=n[o];let r=getEventHandlerName(o);if(e.stripPrefix)switch(TARGET){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=createEventHandler(i,e)}return t}function transformBlockProperties({properties:e}){return e}const extractRelevantRootBlockProperties=e=>({href:e.href});function getBlockProperties({block:e,context:t}){var o;const n={...extractRelevantRootBlockProperties(e),...e.properties,"builder-id":e.id,style:getStyle({block:e,context:t}),[getClassPropName()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return transformBlockProperties({properties:n,context:t,block:e})}const getWrapperProps=({componentOptions:e,builderBlock:t,context:n,componentRef:o,includeBlockProps:i,isInteractive:r,contextValue:a})=>{const s={...e,...i?{attributes:getBlockProperties({block:t,context:a})}:{}};return r?{Wrapper:o,block:t,context:n,wrapperProps:e,includeBlockProps:i}:s};function ComponentRef(e){var n;const t=e.isInteractive?USE_CLIENT_BUNDLE.InteractiveElement:e.componentRef;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.componentRef?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(t,{...getWrapperProps({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(o=>jsxRuntime.jsx(Block,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function RepeatedBlock(e){const t=e.repeatContext;return jsxRuntime.jsx(Block,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})}function Block(e){var c,d,g;const t=function(){return getComponent({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return getRepeatItemData({block:e.block,context:e.context})},o=function(){var f;return(f=e.block.repeat)!=null&&f.collection?e.block:getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},i=function(){var p;return e.block.tagName==="a"||((p=o().properties)==null?void 0:p.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"},r=function(){var m,u;if((m=e.block.repeat)!=null&&m.collection)return!!((u=n())!=null&&u.length);const f="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!f},a=function(){var p;return!((p=t())!=null&&p.component)&&!n()?o().children??[]:[]},s=function(){var f,p,m,u,b,h,S,C,y,x;return{blockChildren:o().children??[],componentRef:(f=t())==null?void 0:f.component,componentOptions:{...getBlockComponentOptions(o()),builderContext:e.context,...((p=t())==null?void 0:p.name)==="Core:Button"||((m=t())==null?void 0:m.name)==="Symbol"||((u=t())==null?void 0:u.name)==="Columns"||((b=t())==null?void 0:b.name)==="Form:Form"?{builderLinkComponent:e.linkComponent}:{},...((h=t())==null?void 0:h.name)==="Symbol"||((S=t())==null?void 0:S.name)==="Columns"||((C=t())==null?void 0:C.name)==="Form:Form"?{builderComponents:e.registeredComponents}:{}},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((y=t())==null?void 0:y.noWrap)===!0,isInteractive:!((x=t())!=null&&x.isRSC)}};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:r()?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(BlockStyles,{block:e.block,context:e.context}),(c=t())!=null&&c.noWrap?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ComponentRef,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive})}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(g=n())==null?void 0:g.map((l,f)=>jsxRuntime.jsx(RepeatedBlock,{repeatContext:l.context,block:l.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},f))}):jsxRuntime.jsxs(USE_CLIENT_BUNDLE.BlockWrapper,{Wrapper:i(),block:o(),context:e.context,linkComponent:e.linkComponent,children:[jsxRuntime.jsx(ComponentRef,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive}),(d=a())==null?void 0:d.map(l=>jsxRuntime.jsx(Block,{block:l,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},l.id))]})})]}):null})}function Blocks(e){var t,n,o;return jsxRuntime.jsx(USE_CLIENT_BUNDLE.BlocksWrapper,{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?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(o=e.blocks)==null?void 0:o.map(i=>jsxRuntime.jsx(Block,{block:i,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},i.id))}):null})}function Columns(e){var p;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],o=e.stackColumnsAt||"tablet",i=function(u){var b;return((b=n[u])==null?void 0:b.width)||100/n.length},r=function(u){const b=t*(n.length-1)/n.length;return`calc(${i(u)}% - ${b}px)`},a=function({stackedStyle:u,desktopStyle:b}){return o==="tablet"?u:b},s=function({stackedStyle:u,desktopStyle:b}){return o==="never"?b:u},c=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",d=function(){return{"--flex-dir":c,"--flex-dir-tablet":a({stackedStyle:c,desktopStyle:"row"})}},g=function(u){const b=u===0?0:t,h=r(u),S=`${b}px`,C="100%",y=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:h,["marginLeft"]:S,"--column-width-mobile":s({stackedStyle:C,desktopStyle:h}),"--column-margin-left-mobile":s({stackedStyle:y,desktopStyle:S}),"--column-width-tablet":a({stackedStyle:C,desktopStyle:h}),"--column-margin-left-tablet":a({stackedStyle:y,desktopStyle:S})}},l=function(u){var h,S;return getSizesForBreakpoints(((S=(h=e.builderContext.content)==null?void 0:h.meta)==null?void 0:S.breakpoints)||{})[u].max},f=function(){return`
|
|
56
|
-
@media (max-width: ${
|
|
55
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},getRepeatItemData=({block:e,context:t})=>{const{repeat:n,...o}=e;if(!(n!=null&&n.collection))return;const i=evaluate({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(i))return;const r=n.collection.split(".").pop(),a=n.itemName||(r?r+"Item":"item");return i.map((c,d)=>({context:{...t,localState:{...t.localState,$index:d,$item:c,[a]:c,[`$${a}Index`]:d}},block:o}))},SIZES={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},getMaxWidthQueryForSize=(e,t=SIZES)=>`@media (max-width: ${t[e].max}px)`,getSizesForBreakpoints=({small:e,medium:t})=>{const n=fastClone(SIZES);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const i=n.small.max+1;n.medium={max:t,min:i,default:i+1};const r=n.medium.max+1;return n.large={max:2e3,min:r,default:r+1},n};function InlinedStyles(e){return jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id})}function assign(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const i=arguments[o];if(i!=null)for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n}const camelCaseToKebabCase=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function warnElementNotPresent(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function augmentAnimation(e,t){const n=getAllStylesUsed(e),o=getComputedStyle(t),i=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,a=[i,r];for(const s of a)for(const c of n)c in s||(s[c]=o[c])}function getAllStylesUsed(e){const t=[];for(const n of e.steps)for(const o in n.styles)t.indexOf(o)===-1&&t.push(o);return t}function triggerAnimation(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){warnElementNotPresent(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{augmentAnimation(e,n),n.style.transition="none",n.style.transitionDelay="0",assign(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),assign(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}function BlockStyles(e){const t=function(){const i=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return checkIsDefined(i.hide)?!i.hide:checkIsDefined(i.show)?i.show:!0},n=function(){var p,S,x;const i=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),r=i.responsiveStyles,a=e.context.content,s=getSizesForBreakpoints(((p=a==null?void 0:a.meta)==null?void 0:p.breakpoints)||{}),c=r==null?void 0:r.large,d=r==null?void 0:r.medium,g=r==null?void 0:r.small,u=i.id;if(!u)return"";const f=c?createCssClass({className:u,styles:c}):"",h=d?createCssClass({className:u,styles:d,mediaQuery:getMaxWidthQueryForSize("medium",s)}):"",m=g?createCssClass({className:u,styles:g,mediaQuery:getMaxWidthQueryForSize("small",s)}):"",l=i.animations&&i.animations.find(y=>y.trigger==="hover");let b="";if(l){const y=((x=(S=l.steps)==null?void 0:S[1])==null?void 0:x.styles)||{};b=createCssClass({className:`${u}:hover`,styles:{...y,transition:`all ${l.duration}s ${camelCaseToKebabCase(l.easing)}`,transitionDelay:l.delay?`${l.delay}s`:"0s"}})||""}return[f,h,m,b].join(" ")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()&&t()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedStyles,{id:"builderio-block",styles:n()})}):null})}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}const getEventHandlerName=e=>`on${capitalizeFirstLetter(e)}`,createEventHandler=(e,t)=>n=>evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function getBlockActions(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const i=n[o];let r=getEventHandlerName(o);if(e.stripPrefix)switch(TARGET){case"vue":r=r.replace("v-on:","");break;case"svelte":r=r.replace("on:","");break}t[r]=createEventHandler(i,e)}return t}function transformBlockProperties({properties:e}){return e}const extractRelevantRootBlockProperties=e=>({href:e.href});function getBlockProperties({block:e,context:t}){var o;const n={...extractRelevantRootBlockProperties(e),...e.properties,"builder-id":e.id,style:getStyle({block:e,context:t}),[getClassPropName()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return transformBlockProperties({properties:n,context:t,block:e})}const getWrapperProps=({componentOptions:e,builderBlock:t,context:n,componentRef:o,includeBlockProps:i,isInteractive:r,contextValue:a})=>{const s={...e,...i?{attributes:getBlockProperties({block:t,context:a})}:{}};return r?{Wrapper:o,block:t,context:n,wrapperProps:e,includeBlockProps:i}:s};function ComponentRef(e){var n;const t=e.isInteractive?USE_CLIENT_BUNDLE.InteractiveElement:e.componentRef;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.componentRef?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(t,{...getWrapperProps({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(o=>jsxRuntime.jsx(Block,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function RepeatedBlock(e){const t=e.repeatContext;return jsxRuntime.jsx(Block,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})}function Block(e){var c,d,g;const t=function(){return getComponent({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return getRepeatItemData({block:e.block,context:e.context})},o=function(){var f;return(f=e.block.repeat)!=null&&f.collection?e.block:getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},i=function(){var h;return e.block.tagName==="a"||((h=o().properties)==null?void 0:h.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"},r=function(){var m,l;if((m=e.block.repeat)!=null&&m.collection)return!!((l=n())!=null&&l.length);const f="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!f},a=function(){var h;return!((h=t())!=null&&h.component)&&!n()?o().children??[]:[]},s=function(){var f,h,m,l,b,p,S,x,y,C;return{blockChildren:o().children??[],componentRef:(f=t())==null?void 0:f.component,componentOptions:{...getBlockComponentOptions(o()),builderContext:e.context,...((h=t())==null?void 0:h.name)==="Core:Button"||((m=t())==null?void 0:m.name)==="Symbol"||((l=t())==null?void 0:l.name)==="Columns"||((b=t())==null?void 0:b.name)==="Form:Form"?{builderLinkComponent:e.linkComponent}:{},...((p=t())==null?void 0:p.name)==="Symbol"||((S=t())==null?void 0:S.name)==="Columns"||((x=t())==null?void 0:x.name)==="Form:Form"?{builderComponents:e.registeredComponents}:{}},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((y=t())==null?void 0:y.noWrap)===!0,isInteractive:!((C=t())!=null&&C.isRSC)}};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:r()?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(BlockStyles,{block:e.block,context:e.context}),(c=t())!=null&&c.noWrap?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ComponentRef,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive})}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(g=n())==null?void 0:g.map((u,f)=>jsxRuntime.jsx(RepeatedBlock,{repeatContext:u.context,block:u.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},f))}):jsxRuntime.jsxs(USE_CLIENT_BUNDLE.BlockWrapper,{Wrapper:i(),block:o(),context:e.context,linkComponent:e.linkComponent,children:[jsxRuntime.jsx(ComponentRef,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive}),(d=a())==null?void 0:d.map(u=>jsxRuntime.jsx(Block,{block:u,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},u.id))]})})]}):null})}function Blocks(e){var t,n,o;return jsxRuntime.jsx(USE_CLIENT_BUNDLE.BlocksWrapper,{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?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(o=e.blocks)==null?void 0:o.map(i=>jsxRuntime.jsx(Block,{block:i,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},i.id))}):null})}function Columns(e){var h;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],o=e.stackColumnsAt||"tablet",i=function(l){var b;return((b=n[l])==null?void 0:b.width)||100/n.length},r=function(l){const b=t*(n.length-1)/n.length;return`calc(${i(l)}% - ${b}px)`},a=function({stackedStyle:l,desktopStyle:b}){return o==="tablet"?l:b},s=function({stackedStyle:l,desktopStyle:b}){return o==="never"?b:l},c=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",d=function(){return{"--flex-dir":c,"--flex-dir-tablet":a({stackedStyle:c,desktopStyle:"row"})}},g=function(l){const b=l===0?0:t,p=r(l),S=`${b}px`,x="100%",y=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:p,["marginLeft"]:S,"--column-width-mobile":s({stackedStyle:x,desktopStyle:p}),"--column-margin-left-mobile":s({stackedStyle:y,desktopStyle:S}),"--column-width-tablet":a({stackedStyle:x,desktopStyle:p}),"--column-margin-left-tablet":a({stackedStyle:y,desktopStyle:S})}},u=function(l){var p,S;return getSizesForBreakpoints(((S=(p=e.builderContext.content)==null?void 0:p.meta)==null?void 0:S.breakpoints)||{})[l].max},f=function(){return`
|
|
56
|
+
@media (max-width: ${u("medium")}px) {
|
|
57
57
|
.${e.builderBlock.id}-breakpoints {
|
|
58
58
|
flex-direction: var(--flex-dir-tablet);
|
|
59
59
|
align-items: stretch;
|
|
@@ -65,7 +65,7 @@ output;
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
@media (max-width: ${
|
|
68
|
+
@media (max-width: ${u("small")}px) {
|
|
69
69
|
.${e.builderBlock.id}-breakpoints {
|
|
70
70
|
flex-direction: var(--flex-dir);
|
|
71
71
|
align-items: stretch;
|
|
@@ -76,10 +76,10 @@ output;
|
|
|
76
76
|
margin-left: var(--column-margin-left-mobile) !important;
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
`};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-664216e4`,style:d(),children:[jsxRuntime.jsx(InlinedStyles,{id:"builderio-columns",styles:f()}),(
|
|
79
|
+
`};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:`builder-columns ${e.builderBlock.id}-breakpoints div-664216e4`,style:d(),children:[jsxRuntime.jsx(InlinedStyles,{id:"builderio-columns",styles:f()}),(h=e.columns)==null?void 0:h.map((m,l)=>jsxRuntime.jsx(USE_CLIENT_BUNDLE.DynamicRenderer,{TagName:m.link?e.builderLinkComponent||"a":"div",actionAttributes:{},attributes:{...m.link?{href:m.link}:{},[getClassPropName()]:"builder-column",style:mapStyleObjToStrIfNeeded(g(l))},children:jsxRuntime.jsx(Blocks,{path:`component.options.columns.${l}.blocks`,parent:e.builderBlock.id,styleProp:{flexGrow:"1"},context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent,blocks:m.blocks})},l))]}),jsxRuntime.jsx("style",{children:`.div-664216e4 {
|
|
80
80
|
display: flex;
|
|
81
81
|
line-height: normal;
|
|
82
|
-
}`})]})}function removeProtocol(e){return e.replace(/http(s)?:/,"")}function updateQueryParam(e="",t,n){const o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=e.indexOf("?")!==-1?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+i+t+"="+encodeURIComponent(n)}function getShopifyImageUrl(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return removeProtocol(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const o=e.split(n[0]),i=n[3],r=t.match("x")?t:`${t}x`;return removeProtocol(`${o[0]}_${r}${i}`)}return null}function getSrcSet(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const o=Number(e.split("?width=")[1]);return isNaN(o)||(n=`${n} ${o}w`),t.filter(i=>i!==o).map(i=>`${updateQueryParam(e,"width",i)} ${i}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[getShopifyImageUrl(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,o])=>`${n} ${o}w`).concat([e]).join(", "):e}const getTopLevelDomain=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},getCookieSync=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(o=>o.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(o){logger.warn("[COOKIE] GET error: ",(o==null?void 0:o.message)||o);return}},getCookie=async e=>getCookieSync(e),stringifyCookie=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(checkIsDefined).join("; "),SECURE_CONFIG=[["secure",""],["SameSite","None"]],createCookieString=({name:e,value:t,expires:n})=>{const i=(isBrowser()?location.protocol==="https:":!0)?SECURE_CONFIG:[[]],r=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...r,["path","/"],["domain",getTopLevelDomain(window.location.hostname)],...i];return stringifyCookie(a)},setCookie=async({name:e,value:t,expires:n,canTrack:o})=>{try{if(!o)return;const i=createCookieString({name:e,value:t,expires:n});document.cookie=i}catch(i){logger.warn("[COOKIE] SET error: ",(i==null?void 0:i.message)||i)}},BUILDER_STORE_PREFIX="builder.tests",getContentTestKey=e=>`${BUILDER_STORE_PREFIX}.${e}`,getContentVariationCookie=({contentId:e})=>getCookie({name:getContentTestKey(e),canTrack:!0}),getContentVariationCookieSync=({contentId:e})=>getCookieSync({name:getContentTestKey(e),canTrack:!0}),setContentVariationCookie=({contentId:e,value:t})=>setCookie({name:getContentTestKey(e),value:t,canTrack:!0}),checkIsBuilderContentWithVariations=e=>checkIsDefined(e.id)&&checkIsDefined(e.variations)&&Object.keys(e.variations).length>0,getRandomVariationId=({id:e,variations:t})=>{var i;let n=0;const o=Math.random();for(const r in t){const a=(i=t[r])==null?void 0:i.testRatio;if(n+=a,o<n)return r}return e},getAndSetVariantId=e=>{const t=getRandomVariationId(e);return setContentVariationCookie({contentId:e.id,value:t}).catch(n=>{logger.error("could not store A/B test variation: ",n)}),t},getTestFields=({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":"")}},handleABTestingSync=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!checkIsBuilderContentWithVariations(e))return e;const n=getContentVariationCookieSync({contentId:e.id})||getAndSetVariantId({variations:e.variations,id:e.id}),o=getTestFields({item:e,testGroupId:n});return{...e,...o}},handleABTesting=async({item:e,canTrack:t})=>{if(!t||!checkIsBuilderContentWithVariations(e))return e;const o=await getContentVariationCookie({contentId:e.id})||getAndSetVariantId({variations:e.variations,id:e.id}),i=getTestFields({item:e,testGroupId:o});return{...e,...i}},getDefaultCanTrack=e=>checkIsDefined(e)?e:!0,componentInfo$b={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},componentInfo$a={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(o=>{o.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(i=>i.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((s,c)=>s+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}]},componentInfo$9={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},componentInfo$8={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(a,s=6e4){return new Promise((c,d)=>{const g=document.createElement("img");let l=!1;g.onload=()=>{l=!0,c(g)},g.addEventListener("error",f=>{console.warn("Image load failed",f.error),d(f.error)}),g.src=a,setTimeout(()=>{l||d(new Error("Image load timed out"))},s)})}function o(a){return Math.round(a*1e3)/1e3}const i=e.get("image"),r=e.get("aspectRatio");if(fetch(i).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),i&&(!r||r===.7041))return n(i).then(a=>{const s=e.get("aspectRatio");e.get("image")===i&&(!s||s===.7041)&&a.width&&a.height&&(e.set("aspectRatio",o(a.height/a.width)),e.set("height",a.height),e.set("width",a.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}]},componentInfo$7={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>"}}}]},componentInfo$6={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"}]};function Slot(e){var t,n,o;return jsxRuntime.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:jsxRuntime.jsx(Blocks,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(o=e.builderContext.rootState)==null?void 0:o[e.name]})})}const componentInfo$5={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"}]},componentInfo$4={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 Text(e){var t;return jsxRuntime.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const componentInfo$3={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}]},componentInfo$2={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(o=>o.json()).then(o=>{e.get("url")===t&&(o.html?e.set("content",o.html):e.set("content","Invalid url, please try another"))}).catch(o=>{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}]},SCRIPT_MIME_TYPES=["text/javascript","application/javascript","application/ecmascript"],isJsScript=e=>SCRIPT_MIME_TYPES.includes(e.type),componentInfo$1={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},componentInfo={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}]},getExtraComponents=()=>[{component:USE_CLIENT_BUNDLE.CustomCode,...componentInfo$3},{component:USE_CLIENT_BUNDLE.Embed,...componentInfo$2},{component:USE_CLIENT_BUNDLE.ImgComponent,...componentInfo$1},{component:USE_CLIENT_BUNDLE.Video,...componentInfo}],getDefaultRegisteredComponents=()=>[{component:USE_CLIENT_BUNDLE.Button,...componentInfo$b},{component:Columns,...componentInfo$a},{component:USE_CLIENT_BUNDLE.FragmentComponent,...componentInfo$9},{component:USE_CLIENT_BUNDLE.Image,...componentInfo$8},{component:USE_CLIENT_BUNDLE.SectionComponent,...componentInfo$7},{component:Slot,...componentInfo$6},{component:Symbol$1,...componentInfo$5},{component:Text,...componentInfo$4},...getExtraComponents()],createRegisterComponentMessage=e=>({type:"builder.registerComponent",data:serializeComponentInfo(e)}),serializeFn=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},serializeValue=e=>typeof e=="function"?serializeFn(e):fastClone(e),serializeComponentInfo=({inputs:e,...t})=>({...fastClone(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((o,[i,r])=>({...o,[i]:serializeValue(r)}),{}))}),UPDATE_COOKIES_AND_STYLES_SCRIPT=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
82
|
+
}`})]})}function removeProtocol(e){return e.replace(/http(s)?:/,"")}function updateQueryParam(e="",t,n){const o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=e.indexOf("?")!==-1?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+encodeURIComponent(n)+"$2"):e+i+t+"="+encodeURIComponent(n)}function getShopifyImageUrl(e,t){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!t)return e;if(t==="master")return removeProtocol(e);const n=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const o=e.split(n[0]),i=n[3],r=t.match("x")?t:`${t}x`;return removeProtocol(`${o[0]}_${r}${i}`)}return null}function getSrcSet(e){if(!e)return e;const t=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let n=e;const o=Number(e.split("?width=")[1]);return isNaN(o)||(n=`${n} ${o}w`),t.filter(i=>i!==o).map(i=>`${updateQueryParam(e,"width",i)} ${i}w`).concat([n]).join(", ")}return e.match(/cdn\.shopify\.com/)?t.map(n=>[getShopifyImageUrl(e,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,o])=>`${n} ${o}w`).concat([e]).join(", "):e}const getTopLevelDomain=e=>{if(e==="localhost"||e==="127.0.0.1")return e;const t=e.split(".");return t.length>2?t.slice(1).join("."):e},getCookieSync=({name:e,canTrack:t})=>{var n;try{return t?(n=document.cookie.split("; ").find(o=>o.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]:void 0}catch(o){logger.warn("[COOKIE] GET error: ",(o==null?void 0:o.message)||o);return}},getCookie=async e=>getCookieSync(e),stringifyCookie=e=>e.map(([t,n])=>n?`${t}=${n}`:t).filter(checkIsDefined).join("; "),SECURE_CONFIG=[["secure",""],["SameSite","None"]],createCookieString=({name:e,value:t,expires:n})=>{const i=(isBrowser()?location.protocol==="https:":!0)?SECURE_CONFIG:[[]],r=n?[["expires",n.toUTCString()]]:[[]],a=[[e,t],...r,["path","/"],["domain",getTopLevelDomain(window.location.hostname)],...i];return stringifyCookie(a)},setCookie=async({name:e,value:t,expires:n,canTrack:o})=>{try{if(!o)return;const i=createCookieString({name:e,value:t,expires:n});document.cookie=i}catch(i){logger.warn("[COOKIE] SET error: ",(i==null?void 0:i.message)||i)}},BUILDER_STORE_PREFIX="builder.tests",getContentTestKey=e=>`${BUILDER_STORE_PREFIX}.${e}`,getContentVariationCookie=({contentId:e})=>getCookie({name:getContentTestKey(e),canTrack:!0}),getContentVariationCookieSync=({contentId:e})=>getCookieSync({name:getContentTestKey(e),canTrack:!0}),setContentVariationCookie=({contentId:e,value:t})=>setCookie({name:getContentTestKey(e),value:t,canTrack:!0}),checkIsBuilderContentWithVariations=e=>checkIsDefined(e.id)&&checkIsDefined(e.variations)&&Object.keys(e.variations).length>0,getRandomVariationId=({id:e,variations:t})=>{var i;let n=0;const o=Math.random();for(const r in t){const a=(i=t[r])==null?void 0:i.testRatio;if(n+=a,o<n)return r}return e},getAndSetVariantId=e=>{const t=getRandomVariationId(e);return setContentVariationCookie({contentId:e.id,value:t}).catch(n=>{logger.error("could not store A/B test variation: ",n)}),t},getTestFields=({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":"")}},handleABTestingSync=({item:e,canTrack:t})=>{if(!t)return e;if(!e)return;if(!checkIsBuilderContentWithVariations(e))return e;const n=getContentVariationCookieSync({contentId:e.id})||getAndSetVariantId({variations:e.variations,id:e.id}),o=getTestFields({item:e,testGroupId:n});return{...e,...o}},handleABTesting=async({item:e,canTrack:t})=>{if(!t||!checkIsBuilderContentWithVariations(e))return e;const o=await getContentVariationCookie({contentId:e.id})||getAndSetVariantId({variations:e.variations,id:e.id}),i=getTestFields({item:e,testGroupId:o});return{...e,...i}},getDefaultCanTrack=e=>checkIsDefined(e)?e:!0,componentInfo$b={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},componentInfo$a={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(o=>{o.delete("width")})}const n=e.get("columns");Array.isArray(n)&&n.find(i=>i.get("width"))&&(n.find(r=>!r.get("width"))||n.reduce((s,c)=>s+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}]},componentInfo$9={name:"Fragment",static:!0,hidden:!0,canHaveChildren:!0,noWrap:!0},componentInfo$8={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(a,s=6e4){return new Promise((c,d)=>{const g=document.createElement("img");let u=!1;g.onload=()=>{u=!0,c(g)},g.addEventListener("error",f=>{console.warn("Image load failed",f.error),d(f.error)}),g.src=a,setTimeout(()=>{u||d(new Error("Image load timed out"))},s)})}function o(a){return Math.round(a*1e3)/1e3}const i=e.get("image"),r=e.get("aspectRatio");if(fetch(i).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&e.set("noWebp",!0)}),i&&(!r||r===.7041))return n(i).then(a=>{const s=e.get("aspectRatio");e.get("image")===i&&(!s||s===.7041)&&a.width&&a.height&&(e.set("aspectRatio",o(a.height/a.width)),e.set("height",a.height),e.set("width",a.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}]},componentInfo$7={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>"}}}]},componentInfo$6={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"}]};function Slot(e){var t,n,o;return jsxRuntime.jsx("div",{style:{pointerEvents:"auto"},...!((t=e.builderContext.context)!=null&&t.symbolId)&&{"builder-slot":e.name},children:jsxRuntime.jsx(Blocks,{parent:(n=e.builderContext.context)==null?void 0:n.symbolId,path:`symbol.data.${e.name}`,context:e.builderContext,blocks:(o=e.builderContext.rootState)==null?void 0:o[e.name]})})}const componentInfo$5={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"}]},componentInfo$4={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 Text(e){var t;return jsxRuntime.jsx("div",{className:"builder-text",dangerouslySetInnerHTML:{__html:((t=e.text)==null?void 0:t.toString())||""},style:{outline:"none"}})}const componentInfo$3={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}]},componentInfo$2={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(o=>o.json()).then(o=>{e.get("url")===t&&(o.html?e.set("content",o.html):e.set("content","Invalid url, please try another"))}).catch(o=>{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}]},SCRIPT_MIME_TYPES=["text/javascript","application/javascript","application/ecmascript"],isJsScript=e=>SCRIPT_MIME_TYPES.includes(e.type),componentInfo$1={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},componentInfo={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}]},getExtraComponents=()=>[{component:USE_CLIENT_BUNDLE.CustomCode,...componentInfo$3},{component:USE_CLIENT_BUNDLE.Embed,...componentInfo$2},{component:USE_CLIENT_BUNDLE.ImgComponent,...componentInfo$1},{component:USE_CLIENT_BUNDLE.Video,...componentInfo}],getDefaultRegisteredComponents=()=>[{component:USE_CLIENT_BUNDLE.Button,...componentInfo$b},{component:Columns,...componentInfo$a},{component:USE_CLIENT_BUNDLE.FragmentComponent,...componentInfo$9},{component:USE_CLIENT_BUNDLE.Image,...componentInfo$8},{component:USE_CLIENT_BUNDLE.SectionComponent,...componentInfo$7},{component:Slot,...componentInfo$6},{component:Symbol$1,...componentInfo$5},{component:Text,...componentInfo$4},...getExtraComponents()],createRegisterComponentMessage=e=>({type:"builder.registerComponent",data:serializeComponentInfo(e)}),serializeFn=e=>{const t=e.toString().trim();return`return (${!t.startsWith("function")&&!t.startsWith("(")?"function ":""}${t}).apply(this, arguments)`},serializeValue=e=>typeof e=="function"?serializeFn(e):fastClone(e),serializeComponentInfo=({inputs:e,...t})=>({...fastClone(t),inputs:e==null?void 0:e.map(n=>Object.entries(n).reduce((o,[i,r])=>({...o,[i]:serializeValue(r)}),{}))}),UPDATE_COOKIES_AND_STYLES_SCRIPT=`function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
83
83
|
function getAndSetVariantId() {
|
|
84
84
|
function setCookie(name, value, days) {
|
|
85
85
|
let expires = '';
|
|
@@ -178,7 +178,7 @@ output;
|
|
|
178
178
|
)`,getUpdateVariantVisibilityScript=({contentId:e,variationId:t})=>`window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
179
179
|
"${t}", "${e}", ${isHydrationTarget}
|
|
180
180
|
)`;function InlinedScript(e){return jsxRuntime.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}const getIdFromSearchParams=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||logger.warn("No previewed ID found in search params."),n};function init(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new lruCache.LRUCache({max:500,ttl:1e3*60*5}))}function getPreviewContent(e){init();const t=getIdFromSearchParams(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function getGlobalThis(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function getFetch(){const e=getGlobalThis().fetch;if(typeof e>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
181
|
-
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 fetch$1=getFetch();function flatten(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...flatten(r,a,n)}:{...o,[a]:r}},{})}const DEFAULT_API_VERSION="v3",BUILDER_SEARCHPARAMS_PREFIX="builder.",BUILDER_OPTIONS_PREFIX="options.",getBuilderSearchParams=e=>{if(!e)return{};const t=normalizeSearchParams(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)){const i=o.replace(BUILDER_SEARCHPARAMS_PREFIX,"").replace(BUILDER_OPTIONS_PREFIX,"");n[i]=t[o]}}),n},getBuilderSearchParamsFromWindow=()=>{if(!isBrowser())return{};const e=new URLSearchParams(window.location.search);return getBuilderSearchParams(e)},isPositiveNumber=e=>typeof e=="number"&&!isNaN(e)&&e>=0,generateContentUrl=e=>{const{limit:t=30,userAttributes:n,query:o,model:i,apiKey:r,enrich:a,locale:s,apiVersion:c=DEFAULT_API_VERSION,fields:d,omit:g,offset:l,cacheSeconds:f,staleCacheSeconds:p,sort:m,includeUnpublished:u}=e;if(!r)throw new Error("Missing API key");if(!["v3"].includes(c))throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);const b=t!==1,h=new URL(`https://cdn.builder.io/api/${c}/content/${i}`);if(h.searchParams.set("apiKey",r),h.searchParams.set("limit",String(t)),h.searchParams.set("noTraverse",String(b)),h.searchParams.set("includeRefs",String(!0)),s&&h.searchParams.set("locale",s),a&&h.searchParams.set("enrich",String(a)),h.searchParams.set("omit",g||"meta.componentsUsed"),d&&h.searchParams.set("fields",d),Number.isFinite(l)&&l>-1&&h.searchParams.set("offset",String(Math.floor(l))),typeof u=="boolean"&&h.searchParams.set("includeUnpublished",String(u)),f&&isPositiveNumber(f)&&h.searchParams.set("cacheSeconds",String(f)),p&&isPositiveNumber(p)&&h.searchParams.set("staleCacheSeconds",String(p)),m){const y=flatten({sort:m});for(const x in y)h.searchParams.set(x,JSON.stringify(y[x]))}const S={...getBuilderSearchParamsFromWindow(),...normalizeSearchParams(e.options||{})},C=flatten(S);for(const y in C)h.searchParams.set(y,String(C[y]));if(n&&h.searchParams.set("userAttributes",JSON.stringify(n)),o){const y=flatten({query:o});for(const x in y)h.searchParams.set(x,JSON.stringify(y[x]))}return h},checkContentHasResults=e=>"results"in e;async function fetchOneEntry(e){const t=await fetchEntries({...e,limit:1});return t&&t[0]||null}const _fetchContent=async e=>{const t=generateContentUrl(e);return await(await(e.fetch??fetch$1)(t.href,e.fetchOptions)).json()},_processContentResult=async(e,t,n=generateContentUrl(e))=>{const o=getDefaultCanTrack(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const s=getPreviewContent(n.searchParams);r.push(s||a)}t.results=r}if(!o||!(isBrowser()||TARGET==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await handleABTesting({item:a,canTrack:o}));t.results=r}catch(r){logger.error("Could not process A/B tests. ",r)}return t.results};async function fetchEntries(e){try{const t=generateContentUrl(e),n=await _fetchContent(e);return checkContentHasResults(n)?_processContentResult(e,n):(logger.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return logger.error("Error fetching data. ",t),null}}function isPreviewing(e){if(!isBrowser())return!1;const t=getSearchString(e||window.location.search);return isEditing(t)?!1:t.indexOf("builder.preview=")!==-1}function uuidv4(){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 uuid(){return uuidv4().replace(/-/g,"")}const SESSION_LOCAL_STORAGE_KEY="builderSessionId",getSessionId=async({canTrack:e})=>{if(!e)return;const t=await getCookie({name:SESSION_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createSessionId();return setSessionId({id:n,canTrack:e}),n}},createSessionId=()=>uuid(),setSessionId=({id:e,canTrack:t})=>setCookie({name:SESSION_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getLocalStorage=()=>isBrowser()&&typeof localStorage<"u"?localStorage:void 0,getLocalStorageItem=({key:e,canTrack:t})=>{var n;try{return t?(n=getLocalStorage())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},setLocalStorageItem=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=getLocalStorage())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},VISITOR_LOCAL_STORAGE_KEY="builderVisitorId",getVisitorId=({canTrack:e})=>{if(!e)return;const t=getLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createVisitorId();return setVisitorId({id:n,canTrack:e}),n}},createVisitorId=()=>uuid(),setVisitorId=({id:e,canTrack:t})=>setLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getTrackingEventData=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await getSessionId({canTrack:e}),n=getVisitorId({canTrack:e});return{sessionId:t,visitorId:n}},createEvent=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await getTrackingEventData({canTrack:t}),userAttributes:getUserAttributes(),ownerId:n}});async function _track(e){if(!e.apiKey){logger.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!isEditing()&&(isBrowser()||TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await createEvent(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const track=e=>_track({...e,canTrack:!0});function round(e){return Math.round(e*1e3)/1e3}const findParentElement=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},findBuilderParent=e=>findParentElement(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),computeOffset=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=round(o/n.width),a=round(i/n.height);return{x:r,y:a}},getInteractionPropertiesForEvent=e=>{const t=e.target,n=t&&findBuilderParent(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?computeOffset({event:e,target:t}):void 0,builderTargetOffset:n?computeOffset({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},DEFAULT_TRUSTED_HOSTS=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function isFromTrustedHost(e,t){const n=new URL(t.origin),o=n.hostname;return(e||DEFAULT_TRUSTED_HOSTS).findIndex(i=>i.startsWith("*.")?o.endsWith(i.slice(1)):i===o)>-1}const SDK_VERSION="0.14.15",registry={};function register(e,t){let n=registry[e];if(n||(n=registry[e]=[]),n.push(t),isBrowser()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(i){console.debug("Could not postmessage",i)}}}const registerInsertMenu=()=>{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 isSetupForEditing=!1;const setupBrowserForEditing=(e={})=>{var t,n;isSetupForEditing||(isSetupForEditing=!0,isBrowser()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:TARGET,version:SDK_VERSION,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var r,a;if(!isFromTrustedHost(e.trustedHosts,o))return;const{data:i}=o;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const s=i.data.text,c=i.data.arguments||[],d=i.data.id,g=new Function(s);let l,f=null;try{l=g.apply(null,c)}catch(p){f=p}f?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:d,error:f.message}},"*"):l&&typeof l.then=="function"?l.then(p=>{var m;(m=window.parent)==null||m.postMessage({type:"builder.evaluateResult",data:{id:d,result:p}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:l,id:d}},"*");break}}})))},createEditorListener=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!isFromTrustedHost(t,o))return;const{data:i}=o;if(i)switch(i.type){case"builder.configureSdk":{n.configureSdk(i.data);break}case"builder.triggerAnimation":{n.animation(i.data);break}case"builder.contentUpdate":{const r=i.data,a=r.key||r.alias||r.entry||r.modelName,s=r.data;a===e&&n.contentUpdate(s);break}}},subscribeToEditor=(e,t,n)=>{if(!isBrowser)return logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};setupBrowserForEditing();const o=createEditorListener({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function assign(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const i=arguments[o];if(i!=null)for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n}const camelCaseToKebabCase=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function warnElementNotPresent(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function augmentAnimation(e,t){const n=getAllStylesUsed(e),o=getComputedStyle(t),i=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,a=[i,r];for(const s of a)for(const c of n)c in s||(s[c]=o[c])}function getAllStylesUsed(e){const t=[];for(const n of e.steps)for(const o in n.styles)t.indexOf(o)===-1&&t.push(o);return t}function triggerAnimation(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){warnElementNotPresent(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{augmentAnimation(e,n),n.style.transition="none",n.style.transitionDelay="0",assign(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),assign(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const getCssFromFont=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let i="";if(o&&t&&n&&(i+=`
|
|
181
|
+
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 fetch$1=getFetch();function flatten(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...flatten(r,a,n)}:{...o,[a]:r}},{})}const DEFAULT_API_VERSION="v3",BUILDER_SEARCHPARAMS_PREFIX="builder.",BUILDER_OPTIONS_PREFIX="options.",getBuilderSearchParams=e=>{if(!e)return{};const t=normalizeSearchParams(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)){const i=o.replace(BUILDER_SEARCHPARAMS_PREFIX,"").replace(BUILDER_OPTIONS_PREFIX,"");n[i]=t[o]}}),n},getBuilderSearchParamsFromWindow=()=>{if(!isBrowser())return{};const e=new URLSearchParams(window.location.search);return getBuilderSearchParams(e)},isPositiveNumber=e=>typeof e=="number"&&!isNaN(e)&&e>=0,generateContentUrl=e=>{const{limit:t=30,userAttributes:n,query:o,model:i,apiKey:r,enrich:a,locale:s,apiVersion:c=DEFAULT_API_VERSION,fields:d,omit:g,offset:u,cacheSeconds:f,staleCacheSeconds:h,sort:m,includeUnpublished:l}=e;if(!r)throw new Error("Missing API key");if(!["v3"].includes(c))throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);const b=t!==1,p=new URL(`https://cdn.builder.io/api/${c}/content/${i}`);if(p.searchParams.set("apiKey",r),p.searchParams.set("limit",String(t)),p.searchParams.set("noTraverse",String(b)),p.searchParams.set("includeRefs",String(!0)),s&&p.searchParams.set("locale",s),a&&p.searchParams.set("enrich",String(a)),p.searchParams.set("omit",g||"meta.componentsUsed"),d&&p.searchParams.set("fields",d),Number.isFinite(u)&&u>-1&&p.searchParams.set("offset",String(Math.floor(u))),typeof l=="boolean"&&p.searchParams.set("includeUnpublished",String(l)),f&&isPositiveNumber(f)&&p.searchParams.set("cacheSeconds",String(f)),h&&isPositiveNumber(h)&&p.searchParams.set("staleCacheSeconds",String(h)),m){const y=flatten({sort:m});for(const C in y)p.searchParams.set(C,JSON.stringify(y[C]))}const S={...getBuilderSearchParamsFromWindow(),...normalizeSearchParams(e.options||{})},x=flatten(S);for(const y in x)p.searchParams.set(y,String(x[y]));if(n&&p.searchParams.set("userAttributes",JSON.stringify(n)),o){const y=flatten({query:o});for(const C in y)p.searchParams.set(C,JSON.stringify(y[C]))}return p},checkContentHasResults=e=>"results"in e;async function fetchOneEntry(e){const t=await fetchEntries({...e,limit:1});return t&&t[0]||null}const _fetchContent=async e=>{const t=generateContentUrl(e);return await(await(e.fetch??fetch$1)(t.href,e.fetchOptions)).json()},_processContentResult=async(e,t,n=generateContentUrl(e))=>{const o=getDefaultCanTrack(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const s=getPreviewContent(n.searchParams);r.push(s||a)}t.results=r}if(!o||!(isBrowser()||TARGET==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await handleABTesting({item:a,canTrack:o}));t.results=r}catch(r){logger.error("Could not process A/B tests. ",r)}return t.results};async function fetchEntries(e){try{const t=generateContentUrl(e),n=await _fetchContent(e);return checkContentHasResults(n)?_processContentResult(e,n):(logger.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return logger.error("Error fetching data. ",t),null}}function isPreviewing(e){const t=e||(isBrowser()?window.location.search:void 0);return t?getSearchString(t).indexOf("builder.preview=")!==-1:!1}function uuidv4(){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 uuid(){return uuidv4().replace(/-/g,"")}const SESSION_LOCAL_STORAGE_KEY="builderSessionId",getSessionId=async({canTrack:e})=>{if(!e)return;const t=await getCookie({name:SESSION_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createSessionId();return setSessionId({id:n,canTrack:e}),n}},createSessionId=()=>uuid(),setSessionId=({id:e,canTrack:t})=>setCookie({name:SESSION_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getLocalStorage=()=>isBrowser()&&typeof localStorage<"u"?localStorage:void 0,getLocalStorageItem=({key:e,canTrack:t})=>{var n;try{return t?(n=getLocalStorage())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},setLocalStorageItem=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=getLocalStorage())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},VISITOR_LOCAL_STORAGE_KEY="builderVisitorId",getVisitorId=({canTrack:e})=>{if(!e)return;const t=getLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createVisitorId();return setVisitorId({id:n,canTrack:e}),n}},createVisitorId=()=>uuid(),setVisitorId=({id:e,canTrack:t})=>setLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getTrackingEventData=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await getSessionId({canTrack:e}),n=getVisitorId({canTrack:e});return{sessionId:t,visitorId:n}},createEvent=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await getTrackingEventData({canTrack:t}),userAttributes:getUserAttributes(),ownerId:n}});async function _track(e){if(!e.apiKey){logger.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!isEditing()&&(isBrowser()||TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await createEvent(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const track=e=>_track({...e,canTrack:!0});function round(e){return Math.round(e*1e3)/1e3}const findParentElement=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},findBuilderParent=e=>findParentElement(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),computeOffset=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=round(o/n.width),a=round(i/n.height);return{x:r,y:a}},getInteractionPropertiesForEvent=e=>{const t=e.target,n=t&&findBuilderParent(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?computeOffset({event:e,target:t}):void 0,builderTargetOffset:n?computeOffset({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},DEFAULT_TRUSTED_HOSTS=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function isFromTrustedHost(e,t){const n=new URL(t.origin),o=n.hostname;return(e||DEFAULT_TRUSTED_HOSTS).findIndex(i=>i.startsWith("*.")?o.endsWith(i.slice(1)):i===o)>-1}const SDK_VERSION="0.14.17",registry={};function register(e,t){let n=registry[e];if(n||(n=registry[e]=[]),n.push(t),isBrowser()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(i){console.debug("Could not postmessage",i)}}}const registerInsertMenu=()=>{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 isSetupForEditing=!1;const setupBrowserForEditing=(e={})=>{var t,n;isSetupForEditing||(isSetupForEditing=!0,isBrowser()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:TARGET,version:SDK_VERSION,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var r,a;if(!isFromTrustedHost(e.trustedHosts,o))return;const{data:i}=o;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const s=i.data.text,c=i.data.arguments||[],d=i.data.id,g=new Function(s);let u,f=null;try{u=g.apply(null,c)}catch(h){f=h}f?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:d,error:f.message}},"*"):u&&typeof u.then=="function"?u.then(h=>{var m;(m=window.parent)==null||m.postMessage({type:"builder.evaluateResult",data:{id:d,result:h}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:u,id:d}},"*");break}}})))},createEditorListener=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!isFromTrustedHost(t,o))return;const{data:i}=o;if(i)switch(i.type){case"builder.configureSdk":{n.configureSdk(i.data);break}case"builder.triggerAnimation":{n.animation(i.data);break}case"builder.contentUpdate":{const r=i.data,a=r.key||r.alias||r.entry||r.modelName,s=r.data;a===e&&n.contentUpdate(s);break}}},subscribeToEditor=(e,t,n)=>{if(!isBrowser)return logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};setupBrowserForEditing();const o=createEditorListener({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}},getCssFromFont=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let i="";if(o&&t&&n&&(i+=`
|
|
182
182
|
@font-face {
|
|
183
183
|
font-family: "${t}";
|
|
184
184
|
src: local("${n}"), url('${o}') format('woff2');
|
|
@@ -213,4 +213,4 @@ font-weight: ${a};
|
|
|
213
213
|
${getCss({cssCode:e.cssCode,contentId:e.contentId})}
|
|
214
214
|
${getFontCss({customFonts:e.customFonts})}
|
|
215
215
|
${getDefaultStyles(e.isNestedRender)}
|
|
216
|
-
`.trim();return jsxRuntime.jsx(InlinedStyles,{id:"builderio-content",styles:t})}const getRootStateInitialValue=({content:e,data:t,locale:n})=>{var r,a,s;const o={},i=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(s=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||s.forEach(c=>{c.name&&c.defaultValue!==void 0&&(o[c.name]=c.defaultValue)}),{...o,...i,...t,...n?{locale:n}:{}}},getContentInitialValue=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ContentComponent(e){var i,r,a,s,c,d,g,
|
|
216
|
+
`.trim();return jsxRuntime.jsx(InlinedStyles,{id:"builderio-content",styles:t})}const getRootStateInitialValue=({content:e,data:t,locale:n})=>{var r,a,s;const o={},i=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(s=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||s.forEach(c=>{c.name&&c.defaultValue!==void 0&&(o[c.name]=c.defaultValue)}),{...o,...i,...t,...n?{locale:n}:{}}},getContentInitialValue=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ContentComponent(e){var i,r,a,s,c,d,g,u,f;const t=getUpdateVariantVisibilityScript({variationId:(i=e.content)==null?void 0:i.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...getDefaultRegisteredComponents(),...e.customComponents||[]].reduce((h,{component:m,...l})=>({...h,[l.name]:{component:m,...serializeComponentInfo(l)}}),{}),o={content:getContentInitialValue({content:e.content,data:e.data}),localState:void 0,rootState:getRootStateInitialValue({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...getDefaultRegisteredComponents(),...e.customComponents||[]].reduce((h,{component:m,...l})=>({...h,[l.name]:serializeComponentInfo(l)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return jsxRuntime.jsxs(USE_CLIENT_BUNDLE.EnableEditor,{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:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?jsxRuntime.jsx(InlinedScript,{id:"builderio-variant-visibility",scriptStr:t}):null,jsxRuntime.jsx(ContentStyles,{isNestedRender:e.isNestedRender,contentId:(a=o.content)==null?void 0:a.id,cssCode:(c=(s=o.content)==null?void 0:s.data)==null?void 0:c.cssCode,customFonts:(g=(d=o.content)==null?void 0:d.data)==null?void 0:g.customFonts}),jsxRuntime.jsx(Blocks,{blocks:(f=(u=o.content)==null?void 0:u.data)==null?void 0:f.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function ContentVariants(e){var r;const t=checkShouldRenderVariants({canTrack:getDefaultCanTrack(e.canTrack),content:e.content}),n=function(){var s;return getUpdateCookieAndStylesScript(getVariants(e.content).map(c=>({id:c.testVariationId,testRatio:c.testRatio})),((s=e.content)==null?void 0:s.id)||"")},o=function(){return getVariants(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")},i=function(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:handleABTestingSync({item:e.content,canTrack:getDefaultCanTrack(e.canTrack)})};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e.isNestedRender&&TARGET!=="reactNative"?jsxRuntime.jsx(InlinedScript,{id:"builderio-init-variants-fns",scriptStr:getInitVariantsFnsScriptString()}):null,t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(InlinedStyles,{id:"builderio-variants",styles:o()}),jsxRuntime.jsx(InlinedScript,{id:"builderio-variants-visibility",scriptStr:n()}),(r=getVariants(e.content))==null?void 0:r.map(a=>jsxRuntime.jsx(ContentComponent,{isNestedRender:e.isNestedRender,content:a,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},a.testVariationId))]}):null,jsxRuntime.jsx(ContentComponent,{isNestedRender:e.isNestedRender,content:i(),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 fetchSymbolContent=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{logger.error("Could not fetch symbol content: ",n)})};async function Symbol$1(e){var o,i,r,a,s;const t=function(){var d,g;return[e.attributes[getClassPropName()],"builder-symbol",(d=e.symbol)!=null&&d.inline?"builder-inline-symbol":void 0,(g=e.symbol)!=null&&g.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return jsxRuntime.jsx("div",{...e.attributes,className:t(),children:jsxRuntime.jsx(ContentVariants,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(i=e.builderBlock)==null?void 0:i.id},customComponents:Object.values(e.builderComponents),data:{...(r=e.symbol)==null?void 0:r.data,...e.builderContext.localState,...(a=n==null?void 0:n.data)==null?void 0:a.state},model:(s=e.symbol)==null?void 0:s.model,content:n,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}const settings={};function setEditorSettings(e){if(isBrowser()){Object.assign(settings,e);const t={type:"builder.settingsChange",data:settings};parent.postMessage(t,"*")}}const fetchBuilderProps=async e=>{var o,i,r;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((i=e.userAttributes)==null?void 0:i.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:getBuilderSearchParams(e.searchParams||((r=e.url)==null?void 0:r.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await fetchOneEntry(n)}};exports.Blocks=Blocks;exports.Columns=Columns;exports.ContentVariants=ContentVariants;exports.Symbol=Symbol$1;exports.Text=Text;exports._processContentResult=_processContentResult;exports._track=_track;exports.createEditorListener=createEditorListener;exports.createRegisterComponentMessage=createRegisterComponentMessage;exports.evaluate=evaluate;exports.fastClone=fastClone;exports.fetch=fetch$1;exports.fetchBuilderProps=fetchBuilderProps;exports.fetchEntries=fetchEntries;exports.fetchOneEntry=fetchOneEntry;exports.getBlockActions=getBlockActions;exports.getBlockProperties=getBlockProperties;exports.getBuilderSearchParams=getBuilderSearchParams;exports.getClassPropName=getClassPropName;exports.getDefaultCanTrack=getDefaultCanTrack;exports.getInteractionPropertiesForEvent=getInteractionPropertiesForEvent;exports.getSrcSet=getSrcSet;exports.init=init;exports.isBrowser=isBrowser;exports.isEditing=isEditing;exports.isEmptyElement=isEmptyElement;exports.isJsScript=isJsScript;exports.isPreviewing=isPreviewing;exports.logger=logger;exports.register=register;exports.registerInsertMenu=registerInsertMenu;exports.setEditorSettings=setEditorSettings;exports.setupBrowserForEditing=setupBrowserForEditing;exports.subscribeToEditor=subscribeToEditor;exports.track=track;exports.triggerAnimation=triggerAnimation;
|