@builder.io/sdk-vue 0.0.2-0 → 0.0.2-2
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/package.json +4 -4
- package/packages/_vue2/dist/block-styles.7900ea80.cjs +10 -0
- package/packages/_vue2/dist/block-styles.dd3d70e3.js +56 -0
- package/packages/_vue2/dist/get-processed-block.14848083.cjs +1 -0
- package/packages/_vue2/dist/get-processed-block.eda4b627.js +57 -0
- package/packages/_vue2/dist/index.9247eff2.cjs +4 -0
- package/packages/_vue2/dist/index.e1356b24.js +2081 -0
- package/packages/_vue2/dist/render-block.a2f51c18.js +237 -0
- package/packages/_vue2/dist/render-block.e4f18476.cjs +3 -0
- package/packages/_vue2/dist/render-component.76541f08.js +38 -0
- package/packages/_vue2/dist/render-component.fc56f8dc.cjs +1 -0
- package/packages/_vue2/dist/render-inlined-styles.0a71b4a1.cjs +1 -0
- package/packages/_vue2/dist/render-inlined-styles.fb54d112.js +31 -0
- package/packages/_vue2/dist/render-repeated-block.0990371f.cjs +1 -0
- package/packages/_vue2/dist/render-repeated-block.caf201fb.js +50 -0
- package/packages/_vue2/dist/render-styles.76adf086.cjs +17 -0
- package/packages/_vue2/dist/render-styles.79b15aed.js +70 -0
- package/packages/_vue2/dist/sdk.cjs +1 -0
- package/packages/_vue2/dist/sdk.js +27 -0
- package/packages/_vue2/dist/style.css +1 -0
- package/packages/_vue3/dist/block-styles.1f1fb83d.js +54 -0
- package/packages/_vue3/dist/block-styles.eb8f30fe.cjs +10 -0
- package/packages/_vue3/dist/get-processed-block.b7ff491d.cjs +1 -0
- package/packages/_vue3/dist/get-processed-block.c491559e.js +57 -0
- package/packages/_vue3/dist/index.36507004.cjs +4 -0
- package/packages/_vue3/dist/index.eb0e01ba.js +2067 -0
- package/packages/_vue3/dist/render-block.3cdd0c66.js +254 -0
- package/packages/_vue3/dist/render-block.98541a38.cjs +3 -0
- package/packages/_vue3/dist/render-component.442d659d.cjs +1 -0
- package/packages/_vue3/dist/render-component.963a01c2.js +44 -0
- package/packages/_vue3/dist/render-inlined-styles.1c41d49e.js +31 -0
- package/packages/_vue3/dist/render-inlined-styles.662df301.cjs +1 -0
- package/packages/_vue3/dist/render-repeated-block.2212c878.cjs +1 -0
- package/packages/_vue3/dist/render-repeated-block.760bb69a.js +46 -0
- package/packages/_vue3/dist/render-styles.750ea842.js +65 -0
- package/packages/_vue3/dist/render-styles.c0cc9565.cjs +17 -0
- package/packages/_vue3/dist/sdk.cjs +1 -0
- package/packages/_vue3/dist/sdk.js +28 -0
- package/packages/_vue3/dist/style.css +1 -0
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"workspaces": [
|
|
5
5
|
"packages/*"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.0.2-
|
|
7
|
+
"version": "0.0.2-2",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"node-fetch": "^2.6.1"
|
|
10
10
|
},
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"module": "./packages/_vue2/dist/sdk.js",
|
|
13
13
|
"type": "module",
|
|
14
14
|
"files": [
|
|
15
|
-
"dist"
|
|
15
|
+
"packages/_vue2/dist",
|
|
16
|
+
"packages/_vue3/dist"
|
|
16
17
|
],
|
|
17
18
|
"exports": {
|
|
18
19
|
".": {
|
|
@@ -37,10 +38,9 @@
|
|
|
37
38
|
}
|
|
38
39
|
},
|
|
39
40
|
"scripts": {
|
|
40
|
-
"clear-dist": "rm -rf dist && mkdir dist",
|
|
41
41
|
"add-debug": "bash ./scripts/add-debug.sh",
|
|
42
42
|
"remove-debug": "bash ./scripts/remove-debug.sh",
|
|
43
|
-
"build": "yarn
|
|
43
|
+
"build": "yarn workspaces foreach run build",
|
|
44
44
|
"release:patch": "yarn run build && npm version patch --no-git-tag-version && npm publish --access public",
|
|
45
45
|
"release:dev": "yarn run build && npm version prerelease --no-git-tag-version && npm publish --tag dev --access public"
|
|
46
46
|
},
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./get-processed-block.14848083.cjs"),c=require("./index.9247eff2.cjs"),l=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),r=e=>Object.entries(e).map(([s,n])=>{if(typeof n=="string")return`${l(s)}: ${n};`}).join(`
|
|
2
|
+
`),i=()=>Promise.resolve().then(()=>require("./render-inlined-styles.0a71b4a1.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component RenderInlinedStyles at ../render-inlined-styles.vue",e),e}),a={name:"block-styles",components:{"render-inlined-styles":i},props:["block","context"],data:()=>({TARGET:c.TARGET}),computed:{useBlock(){return o.getProcessedBlock({block:this.block,state:this.context.state,context:this.context.context,shouldEvaluateBindings:!0})},css(){const e=this.useBlock.responsiveStyles,t=e==null?void 0:e.large,s=e==null?void 0:e.medium,n=e==null?void 0:e.small;return`
|
|
3
|
+
${t?`.${this.useBlock.id} {${r(t)}}`:""}
|
|
4
|
+
${s?`${o.getMaxWidthQueryForSize("medium")} {
|
|
5
|
+
.${this.useBlock.id} {${r(s)}}
|
|
6
|
+
}`:""}
|
|
7
|
+
${n?`${o.getMaxWidthQueryForSize("small")} {
|
|
8
|
+
.${this.useBlock.id} {${r(n)}}
|
|
9
|
+
}`:""}
|
|
10
|
+
}`}}};var d=function(){var t=this,s=t._self._c;return t.TARGET==="vue2"||t.TARGET==="vue3"||t.TARGET==="svelte"||t.TARGET==="qwik"?s("render-inlined-styles",{attrs:{styles:t.css}}):t._e()},u=[],m=c.normalizeComponent(a,d,u,!1,null,null,null,null);const p=m.exports;exports.default=p;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { g as l, a as r } from "./get-processed-block.eda4b627.js";
|
|
2
|
+
import { T as c, n as i } from "./index.e1356b24.js";
|
|
3
|
+
const a = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), o = (e) => Object.entries(e).map(([s, n]) => {
|
|
4
|
+
if (typeof n == "string")
|
|
5
|
+
return `${a(s)}: ${n};`;
|
|
6
|
+
}).join(`
|
|
7
|
+
`), d = () => import("./render-inlined-styles.fb54d112.js").then((e) => e.default).catch((e) => {
|
|
8
|
+
throw console.error(
|
|
9
|
+
"Error while attempting to dynamically import component RenderInlinedStyles at ../render-inlined-styles.vue",
|
|
10
|
+
e
|
|
11
|
+
), e;
|
|
12
|
+
}), m = {
|
|
13
|
+
name: "block-styles",
|
|
14
|
+
components: { "render-inlined-styles": d },
|
|
15
|
+
props: ["block", "context"],
|
|
16
|
+
data: () => ({ TARGET: c }),
|
|
17
|
+
computed: {
|
|
18
|
+
useBlock() {
|
|
19
|
+
return l({
|
|
20
|
+
block: this.block,
|
|
21
|
+
state: this.context.state,
|
|
22
|
+
context: this.context.context,
|
|
23
|
+
shouldEvaluateBindings: !0
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
css() {
|
|
27
|
+
const e = this.useBlock.responsiveStyles, t = e == null ? void 0 : e.large, s = e == null ? void 0 : e.medium, n = e == null ? void 0 : e.small;
|
|
28
|
+
return `
|
|
29
|
+
${t ? `.${this.useBlock.id} {${o(t)}}` : ""}
|
|
30
|
+
${s ? `${r("medium")} {
|
|
31
|
+
.${this.useBlock.id} {${o(s)}}
|
|
32
|
+
}` : ""}
|
|
33
|
+
${n ? `${r("small")} {
|
|
34
|
+
.${this.useBlock.id} {${o(n)}}
|
|
35
|
+
}` : ""}
|
|
36
|
+
}`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var u = function() {
|
|
41
|
+
var t = this, s = t._self._c;
|
|
42
|
+
return t.TARGET === "vue2" || t.TARGET === "vue3" || t.TARGET === "svelte" || t.TARGET === "qwik" ? s("render-inlined-styles", { attrs: { styles: t.css } }) : t._e();
|
|
43
|
+
}, p = [], _ = /* @__PURE__ */ i(
|
|
44
|
+
m,
|
|
45
|
+
u,
|
|
46
|
+
p,
|
|
47
|
+
!1,
|
|
48
|
+
null,
|
|
49
|
+
null,
|
|
50
|
+
null,
|
|
51
|
+
null
|
|
52
|
+
);
|
|
53
|
+
const f = _.exports;
|
|
54
|
+
export {
|
|
55
|
+
f as default
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("./index.9247eff2.cjs"),c={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},u=e=>`@media (max-width: ${c[e].max}px)`,d=(e,r,s)=>{if(Object(e)!==e)return e;const t=Array.isArray(r)?r:r.toString().match(/[^.[\]]+/g);return t.slice(0,-1).reduce((n,i,a)=>Object(n[i])===n[i]?n[i]:n[i]=Math.abs(Number(t[a+1]))>>0===+t[a+1]?[]:{},e)[t[t.length-1]]=s,e};const m=({block:e,context:r,state:s})=>{if(!e.bindings)return e;const t={...e,properties:{...e.properties},actions:{...e.actions}};for(const n in e.bindings){const i=e.bindings[n],a=o.evaluate({code:i,state:s,context:r});d(t,n,a)}return t};function f({block:e,context:r,shouldEvaluateBindings:s,state:t}){const n=e;return s?m({block:n,state:t,context:r}):n}exports.getMaxWidthQueryForSize=u;exports.getProcessedBlock=f;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { e as o } from "./index.e1356b24.js";
|
|
2
|
+
const u = {
|
|
3
|
+
small: {
|
|
4
|
+
min: 320,
|
|
5
|
+
default: 321,
|
|
6
|
+
max: 640
|
|
7
|
+
},
|
|
8
|
+
medium: {
|
|
9
|
+
min: 641,
|
|
10
|
+
default: 642,
|
|
11
|
+
max: 991
|
|
12
|
+
},
|
|
13
|
+
large: {
|
|
14
|
+
min: 990,
|
|
15
|
+
default: 991,
|
|
16
|
+
max: 1200
|
|
17
|
+
}
|
|
18
|
+
}, f = (e) => `@media (max-width: ${u[e].max}px)`, m = (e, r, s) => {
|
|
19
|
+
if (Object(e) !== e)
|
|
20
|
+
return e;
|
|
21
|
+
const t = Array.isArray(r) ? r : r.toString().match(/[^.[\]]+/g);
|
|
22
|
+
return t.slice(0, -1).reduce(
|
|
23
|
+
(n, i, a) => Object(n[i]) === n[i] ? n[i] : n[i] = Math.abs(Number(t[a + 1])) >> 0 === +t[a + 1] ? [] : {},
|
|
24
|
+
e
|
|
25
|
+
)[t[t.length - 1]] = s, e;
|
|
26
|
+
};
|
|
27
|
+
const c = ({
|
|
28
|
+
block: e,
|
|
29
|
+
context: r,
|
|
30
|
+
state: s
|
|
31
|
+
}) => {
|
|
32
|
+
if (!e.bindings)
|
|
33
|
+
return e;
|
|
34
|
+
const t = {
|
|
35
|
+
...e,
|
|
36
|
+
properties: { ...e.properties },
|
|
37
|
+
actions: { ...e.actions }
|
|
38
|
+
};
|
|
39
|
+
for (const n in e.bindings) {
|
|
40
|
+
const i = e.bindings[n], a = o({ code: i, state: s, context: r });
|
|
41
|
+
m(t, n, a);
|
|
42
|
+
}
|
|
43
|
+
return t;
|
|
44
|
+
};
|
|
45
|
+
function g({
|
|
46
|
+
block: e,
|
|
47
|
+
context: r,
|
|
48
|
+
shouldEvaluateBindings: s,
|
|
49
|
+
state: t
|
|
50
|
+
}) {
|
|
51
|
+
const n = e;
|
|
52
|
+
return s ? c({ block: n, state: t, context: r }) : n;
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
f as a,
|
|
56
|
+
g
|
|
57
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";function ce(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const b="reactNative";function p(){return typeof window<"u"&&typeof document<"u"}const T={};function U(t,e){let n=T[t];if(n||(n=T[t]=[]),n.push(e),p()){const o={type:"builder.register",data:{type:t,info:e}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(r){console.debug("Could not postmessage",r)}}}const le=()=>{U("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"}]})},ue=()=>{var t;p()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:b,supportsPatchUpdates:!1}},"*"),window.addEventListener("message",({data:e})=>{var n,o;if(e)switch(e.type){case"builder.evaluate":{const r=e.data.text,s=e.data.arguments||[],a=e.data.id,c=new Function(r);let i,l=null;try{i=c.apply(null,s)}catch(u){l=u}l?(n=window.parent)==null||n.postMessage({type:"builder.evaluateError",data:{id:a,error:l.message}},"*"):i&&typeof i.then=="function"?i.then(u=>{var f;(f=window.parent)==null||f.postMessage({type:"builder.evaluateResult",data:{id:a,result:u}},"*")}).catch(console.error):(o=window.parent)==null||o.postMessage({type:"builder.evaluateResult",data:{result:i,id:a}},"*");break}}}))};function x(t){return t}function de(t){return t}const pe=()=>Promise.resolve().then(()=>ae).then(t=>t.default).catch(t=>{throw console.error("Error while attempting to dynamically import component RenderBlocks at ../../components/render-blocks.vue",t),t}),me={name:"builder-columns",components:{"render-blocks":pe},props:["space","columns","stackColumnsAt","reverseColumnsWhenStacked","builderBlock"],data:()=>({markMutable:x}),computed:{columnsCssVars(){const t=this.stackColumnsAt==="never"?"inherit":this.reverseColumnsWhenStacked?"column-reverse":"column";return{"--flex-dir":t,"--flex-dir-tablet":this.maybeApplyForTablet(t)}},columnCssVars(){const t="100%",e="0";return{"--column-width":t,"--column-margin-left":e,"--column-width-tablet":this.maybeApplyForTablet(t),"--column-margin-left-tablet":this.maybeApplyForTablet(e)}}},methods:{getGutterSize(){return typeof this.space=="number"?this.space||0:20},getColumns(){return this.columns||[]},getWidth(t){var n;const e=this.getColumns();return((n=e[t])==null?void 0:n.width)||100/e.length},getColumnCssWidth(t){const e=this.getColumns(),o=this.getGutterSize()*(e.length-1)/e.length;return`calc(${this.getWidth(t)}% - ${o}px)`},maybeApplyForTablet(t){return(this.stackColumnsAt||"tablet")==="tablet"?t:"inherit"}}};function d(t,e,n,o,r,s,a,c){var i=typeof t=="function"?t.options:t;e&&(i.render=e,i.staticRenderFns=n,i._compiled=!0),o&&(i.functional=!0),s&&(i._scopeId="data-v-"+s);var l;if(a?(l=function(m){m=m||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!m&&typeof __VUE_SSR_CONTEXT__<"u"&&(m=__VUE_SSR_CONTEXT__),r&&r.call(this,m),m&&m._registeredComponents&&m._registeredComponents.add(a)},i._ssrRegister=l):r&&(l=c?function(){r.call(this,(i.functional?this.parent:this).$root.$options.shadowRoot)}:r),l)if(i.functional){i._injectStyles=l;var u=i.render;i.render=function(ie,I){return l.call(I),u(ie,I)}}else{var f=i.beforeCreate;i.beforeCreate=f?[].concat(f,l):[l]}return{exports:t,options:i}}var fe=function(){var e=this,n=e._self._c;return n("div",{staticClass:"builder-columns div-20351ewpue7",style:e.columnsCssVars},e._l(e.columns,function(o,r){return n("div",{key:r,staticClass:"builder-column div-20351ewpue7-2",style:{width:e.getColumnCssWidth(r),marginLeft:`${r===0?0:e.getGutterSize()}px`,...e.columnCssVars}},[n("render-blocks",{attrs:{blocks:e.markMutable(o.blocks),path:`component.options.columns.${r}.blocks`,parent:e.builderBlock.id}})],1)}),0)},he=[],ge=d(me,fe,he,!1,null,"074f8045",null,null);const P=ge.exports;function R(t){return t.replace(/http(s)?:/,"")}function be(t="",e,n){const o=new RegExp("([?&])"+e+"=.*?(&|$)","i"),r=t.indexOf("?")!==-1?"&":"?";return t.match(o)?t.replace(o,"$1"+e+"="+encodeURIComponent(n)+"$2"):t+r+e+"="+encodeURIComponent(n)}function ve(t,e){if(!t||!(t!=null&&t.match(/cdn\.shopify\.com/))||!e)return t;if(e==="master")return R(t);const n=t.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(n){const o=t.split(n[0]),r=n[3],s=e.match("x")?e:`${e}x`;return R(`${o[0]}_${s}${r}`)}return null}function v(t){if(!t)return t;const e=[100,200,400,800,1200,1600,2e3];if(t.match(/builder\.io/)){let n=t;const o=Number(t.split("?width=")[1]);return isNaN(o)||(n=`${n} ${o}w`),e.filter(r=>r!==o).map(r=>`${be(t,"width",r)} ${r}w`).concat([n]).join(", ")}return t.match(/cdn\.shopify\.com/)?e.map(n=>[ve(t,`${n}x${n}`),n]).filter(([n])=>!!n).map(([n,o])=>`${n} ${o}w`).concat([t]).join(", "):t}const _e={name:"builder-image",props:["image","src","srcset","noWebp","altText","backgroundSize","className","sizes","aspectRatio","fitContent","builderBlock"],computed:{srcSetToUse(){var n;const e=this.image||this.src;if(!e||!(e.match(/builder\.io/)||e.match(/cdn\.shopify\.com/)))return this.srcset;if(this.srcset&&((n=this.image)==null?void 0:n.includes("builder.io/api/v1/image"))){if(!this.srcset.includes(this.image.split("?")[0]))return console.debug("Removed given srcset"),v(e)}else if(this.image&&!this.srcset)return v(e);return v(e)},webpSrcSet(){var t;return((t=this.srcSetToUse)==null?void 0:t.match(/builder\.io/))&&!this.noWebp?this.srcSetToUse.replace(/\?/g,"?format=webp&"):""}},methods:{_classStringToObject(t){const e={};if(typeof t!="string")return e;const n=t.trim().split(/\s+/);for(const o of n)e[o]=!0;return e}}};var ye=function(){var o,r,s,a;var e=this,n=e._self._c;return n("div",{staticClass:"div-cvp1sc2nsao"},[n("picture",[e.webpSrcSet?[n("source",{attrs:{type:"image/webp",srcset:e.webpSrcSet}})]:e._e(),n("img",{class:e._classStringToObject("builder-image"+(e.className?" "+e.className:"")+" img-cvp1sc2nsao"),style:{objectPosition:e.backgroundSize||"center",objectFit:e.backgroundSize||"cover"},attrs:{loading:"lazy",alt:e.altText,role:e.altText?"presentation":void 0,src:e.image,srcset:e.srcSetToUse,sizes:e.sizes}}),n("source",{attrs:{srcset:e.srcSetToUse}})],2),e.aspectRatio&&!(e.fitContent&&((r=(o=e.builderBlock)==null?void 0:o.children)==null?void 0:r.length))?[n("div",{staticClass:"builder-image-sizer div-cvp1sc2nsao-2",style:{paddingTop:e.aspectRatio*100+"%"}})]:e._e(),((a=(s=e.builderBlock)==null?void 0:s.children)==null?void 0:a.length)&&e.fitContent?[e._t("default")]:e._e(),e.fitContent?e._e():[n("div",{staticClass:"div-cvp1sc2nsao-3"},[e._t("default")],2)]],2)},xe=[],Ce=d(_e,ye,xe,!1,null,"fef5e4cf",null,null);const O=Ce.exports,ke={name:"builder-text",props:["text"]};var we=function(){var e=this,n=e._self._c;return n("span",{staticClass:"builder-text",domProps:{innerHTML:e._s(e.text)}})},Se=[],Ie=d(ke,we,Se,!1,null,null,null,null);const A=Ie.exports,Te={name:"builder-video",props:["autoPlay","muted","controls","loop","playsInline","attributes","fit","position","video","posterImage"],computed:{videoProps(){return{...this.autoPlay===!0?{autoPlay:!0}:{},...this.muted===!0?{muted:!0}:{},...this.controls===!0?{controls:!0}:{},...this.loop===!0?{loop:!0}:{},...this.playsInline===!0?{playsInline:!0}:{}}}}};var Re=function(){var o;var e=this,n=e._self._c;return n("video",e._b({style:{width:"100%",height:"100%",...(o=e.attributes)==null?void 0:o.style,objectFit:e.fit,objectPosition:e.position,borderRadius:1},attrs:{src:e.video||"no-src",poster:e.posterImage}},"video",e.videoProps,!1))},$e=[],Ee=d(Te,Re,$e,!1,null,null,null,null);const V=Ee.exports;function _(t,e=null,n="."){return Object.keys(t).reduce((o,r)=>{const s=t[r],a=[e,r].filter(Boolean).join(n);return[typeof s=="object",s!==null,!(Array.isArray(s)&&s.length===0)].every(Boolean)?{...o,..._(s,a,n)}:{...o,[a]:s}},{})}const $="builder.",W=t=>{const e={};return t.forEach((n,o)=>{e[o]=n}),e},B=t=>{if(!t)return{};const e=C(t),n={};return Object.keys(e).forEach(o=>{if(o.startsWith($)){const r=o.replace($,"");n[r]=e[o]}}),n},M=()=>{if(!p())return{};const t=new URLSearchParams(window.location.search);return B(t)},C=t=>t instanceof URLSearchParams?W(t):t;function Fe(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:null}async function L(){const t=Fe().fetch;if(typeof t>"u"&&typeof global<"u"){const e=Promise.resolve().then(()=>ce(require("node-fetch"))).then(n=>n.default);return e.default||e}return t.default||t}const je=t=>{const e=t.split(".");return e.length>2?e.slice(1).join("."):t},N=async({name:t,canTrack:e})=>{var n;try{return e?(n=document.cookie.split("; ").find(o=>o.startsWith(`${t}=`)))==null?void 0:n.split("=")[1]:void 0}catch(o){console.debug("[COOKIE] GET error: ",o)}},Ue=t=>t.map(([e,n])=>n?`${e}=${n}`:e).join("; "),Pe=[["secure",""],["SameSite","None"]],Oe=({name:t,value:e,expires:n})=>{const r=(p()?location.protocol==="https:":!0)?Pe:[[]],s=n?[["expires",n.toUTCString()]]:[[]],a=[[t,e],...s,["path","/"],["domain",je(window.location.hostname)],...r];return Ue(a)},z=async({name:t,value:e,expires:n,canTrack:o})=>{try{if(!o)return;const r=Oe({name:t,value:e,expires:n});document.cookie=r}catch(r){console.warn("[COOKIE] SET error: ",r)}},Ae="builderio.variations",H=t=>`${Ae}.${t}`,Ve=({contentId:t,canTrack:e})=>N({name:H(t),canTrack:e}),We=({contentId:t,canTrack:e,value:n})=>z({name:H(t),value:n,canTrack:e}),g=t=>t!=null,Be=t=>g(t.id)&&g(t.variations)&&Object.keys(t.variations).length>0,Me=({id:t,variations:e})=>{var r;let n=0;const o=Math.random();for(const s in e)if(n+=(r=e[s])==null?void 0:r.testRatio,o<n)return s;return t},E=({item:t,testGroupId:e})=>{const n=t.variations[e];return e===t.id||!n?{testVariationId:t.id,testVariationName:"Default"}:{data:n.data,testVariationId:n.id,testVariationName:n.name||(n.id===t.id?"Default":"")}},Le=async({item:t,canTrack:e})=>{const n=await Ve({canTrack:e,contentId:t.id}),o=n?E({item:t,testGroupId:n}):void 0;if(o)return o;{const r=Me({variations:t.variations,id:t.id});return We({contentId:t.id,value:r,canTrack:e}).catch(s=>{console.error("could not store A/B test variation: ",s)}),E({item:t,testGroupId:r})}},Ne=async({item:t,canTrack:e})=>{if(!Be(t))return;const n=await Le({item:t,canTrack:e});Object.assign(t,n)};async function k(t){return(await D({...t,limit:1})).results[0]||null}const q=t=>{const{limit:e=30,userAttributes:n,query:o,noTraverse:r=!1,model:s,apiKey:a}=t,c=new URL(`https://cdn.builder.io/api/v2/content/${s}?apiKey=${a}&limit=${e}&noTraverse=${r}`),i={...M(),...C(t.options||{})},l=_(i);for(const u in l)c.searchParams.set(u,String(l[u]));if(n&&c.searchParams.set("userAttributes",JSON.stringify(n)),o){const u=_({query:o});for(const f in u)c.searchParams.set(f,JSON.stringify(u[f]))}return c};async function D(t){const e=q(t),o=await(await L())(e.href).then(s=>s.json()),r=t.canTrack!==!1;if(r)for(const s of o.results)await Ne({item:s,canTrack:r});return o}const ze=()=>Promise.resolve().then(()=>on).then(t=>t.default).catch(t=>{throw console.error("Error while attempting to dynamically import component RenderContent at ../../components/render-content/render-content.vue",t),t}),He={name:"builder-symbol",components:{"render-content":ze},props:["symbol","attributes"],data:()=>({className:"builder-symbol",content:null,markMutable:x}),inject:{builderContext:"BuilderContext"},mounted(){var t;this.content=(t=this.symbol)==null?void 0:t.content},watch:{onUpdateHook0(){const t=this.symbol;t&&!t.content&&!this.content&&t.model&&k({model:t.model,apiKey:this.builderContext.apiKey,query:{id:t.entry}}).then(e=>{this.content=e})}},computed:{onUpdateHook0(){return{0:this.symbol,1:this.content}}},methods:{_classStringToObject(t){const e={};if(typeof t!="string")return e;const n=t.trim().split(/\s+/);for(const o of n)e[o]=!0;return e}}};var qe=function(){var o,r,s,a,c;var e=this,n=e._self._c;return n("div",e._b({class:e._classStringToObject(e.className),attrs:{dataSet:{class:e.className}}},"div",e.attributes,!1),[n("render-content",{attrs:{apiKey:e.builderContext.apiKey,context:e.builderContext.context,customComponents:e.markMutable(Object.values(e.builderContext.registeredComponents)),data:e.markMutable({...(o=e.symbol)==null?void 0:o.data,...e.builderContext.state,...(a=(s=(r=e.symbol)==null?void 0:r.content)==null?void 0:s.data)==null?void 0:a.state}),model:(c=e.symbol)==null?void 0:c.model,content:e.markMutable(e.content)}})],1)},De=[],Ke=d(He,qe,De,!1,null,null,null,null);const K=Ke.exports,Ge={name:"builder-button",props:["attributes","text","link","openLinkInNewTab"]};var Je=function(){var e=this,n=e._self._c;return e.link?n("a",e._b({attrs:{role:"button",href:e.link,target:e.openLinkInNewTab?"_blank":void 0}},"a",e.attributes,!1),[e._v(" "+e._s(e.text)+" ")]):n("button",e._b({staticClass:"button-1be3j8m9ewb"},"button",e.attributes,!1),[e._v(" "+e._s(e.text)+" ")])},Xe=[],Ye=d(Ge,Je,Xe,!1,null,"4348d458",null,null);const G=Ye.exports,Qe={name:"builder-section-component",props:["attributes","maxWidth"]};var Ze=function(){var e=this,n=e._self._c;return n("section",e._b({style:e.maxWidth&&typeof e.maxWidth=="number"?{maxWidth:e.maxWidth}:void 0},"section",e.attributes,!1),[e._t("default")],2)},et=[],tt=d(Qe,Ze,et,!1,null,null,null,null);const J=tt.exports,nt={name:"builder-fragment-component",props:[]};var ot=function(){var e=this,n=e._self._c;return n("span",[e._t("default")],2)},rt=[],st=d(nt,ot,rt,!1,null,null,null,null);const X=st.exports,at={name:"Core:Button",builtIn:!0,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};function w(t){return t.__qwik_serializable__=!0,t}const it={name:"Columns",builtIn:!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:w(t=>{function e(){n.forEach(o=>{o.delete("width")})}const n=t.get("columns");Array.isArray(n)&&!!n.find(r=>r.get("width"))&&(!!n.find(s=>!s.get("width"))||n.reduce((c,i)=>c+i.get("width"),0)!==100)&&e()})},{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}]},ct={name:"Fragment",static:!0,hidden:!0,builtIn:!0,canHaveChildren:!0,noWrap:!0},lt={name:"Image",static:!0,builtIn:!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%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",onChange:w(t=>{t.delete("srcset"),t.delete("noWebp");function n(a,c=6e4){return new Promise((i,l)=>{const u=document.createElement("img");let f=!1;u.onload=()=>{f=!0,i(u)},u.addEventListener("error",m=>{console.warn("Image load failed",m.error),l(m.error)}),u.src=a,setTimeout(()=>{f||l(new Error("Image load timed out"))},c)})}function o(a){return Math.round(a*1e3)/1e3}const r=t.get("image"),s=t.get("aspectRatio");if(fetch(r).then(a=>a.blob()).then(a=>{a.type.includes("svg")&&t.set("noWebp",!0)}),r&&(!s||s===.7041))return n(r).then(a=>{const c=t.get("aspectRatio");t.get("image")===r&&(!c||c===.7041)&&a.width&&a.height&&(t.set("aspectRatio",o(a.height/a.width)),t.set("height",a.height),t.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}]},ut={name:"Core:Section",static:!0,builtIn:!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>"}}}]},dt={name:"Symbol",noWrap:!0,static:!0,builtIn:!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"}]},pt={name:"Text",static:!0,builtIn:!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"}},mt={name:"Video",canHaveChildren:!0,builtIn:!0,defaultStyles:{minHeight:"20px",minWidth:"20px"},image:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",inputs:[{name:"video",type:"file",allowedFileTypes:["mp4"],bubble:!0,defaultValue:"https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",required:!0},{name:"posterImage",type:"file",allowedFileTypes:["jpeg","png"],helperText:"Image to show before the video plays"},{name:"autoPlay",type:"boolean",defaultValue:!0},{name:"controls",type:"boolean",defaultValue:!1},{name:"muted",type:"boolean",defaultValue:!0},{name:"loop",type:"boolean",defaultValue:!0},{name:"playsInline",type:"boolean",defaultValue:!0},{name:"fit",type:"text",defaultValue:"cover",enum:["contain","cover","fill","auto"]},{name:"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}]},ft={name:"Embed",static:!0,builtIn:!0,inputs:[{name:"url",type:"url",required:!0,defaultValue:"",helperText:"e.g. enter a youtube url, google map, etc",onChange:w(t=>{const e=t.get("url");if(e)return t.set("content","Loading..."),fetch(`https://iframe.ly/api/iframely?url=${e}&api_key=ae0e60e78201a3f2b0de4b`).then(o=>o.json()).then(o=>{t.get("url")===e&&(o.html?t.set("content",o.html):t.set("content","Invalid url, please try another"))}).catch(o=>{t.set("content","There was an error embedding this URL, please try again or another URL")});t.delete("content")})},{name:"content",type:"html",defaultValue:'<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',hideFromUI:!0}]},ht=["text/javascript","application/javascript","application/ecmascript"],gt=t=>ht.includes(t.type),bt={name:"builder-embed",props:["content"],data:()=>({scriptsInserted:[],scriptsRun:[],ranInitFn:!1}),watch:{onUpdateHook0(){this.$refs.elem&&!this.ranInitFn&&(this.ranInitFn=!0,this.findAndRunScripts())}},computed:{onUpdateHook0(){return{0:this.$refs.elem,1:this.ranInitFn}}},methods:{findAndRunScripts(){if(!this.$refs.elem||!this.$refs.elem.getElementsByTagName)return;const t=this.$refs.elem.getElementsByTagName("script");for(let e=0;e<t.length;e++){const n=t[e];if(n.src&&!this.scriptsInserted.includes(n.src)){this.scriptsInserted.push(n.src);const o=document.createElement("script");o.async=!0,o.src=n.src,document.head.appendChild(o)}else if(gt(n)&&!this.scriptsRun.includes(n.innerText))try{this.scriptsRun.push(n.innerText),new Function(n.innerText)()}catch(o){console.warn("`Embed`: Error running script:",o)}}}}};var vt=function(){var e=this,n=e._self._c;return n("div",{ref:"elem",staticClass:"builder-embed",domProps:{innerHTML:e._s(e.content)}})},_t=[],yt=d(bt,vt,_t,!1,null,null,null,null);const xt=yt.exports;function Ct(){return p()&&window.self!==window.top}function h(){return Ct()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const kt={name:"builder-img-component",props:["backgroundSize","backgroundPosition","imgSrc","altText","image","attributes"],data:()=>({isEditing:h})};var wt=function(){var e=this,n=e._self._c;return n("img",e._b({key:e.isEditing()&&e.imgSrc||"default-key",style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},attrs:{alt:e.altText,src:e.imgSrc||e.image}},"img",e.attributes,!1))},St=[],It=d(kt,wt,St,!1,null,null,null,null);const Tt=It.exports,Rt={name:"Raw:Img",hideFromInsertMenu:!0,builtIn:!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"],required:!0}],noWrap:!0,static:!0},$t={name:"builder-custom-code",props:["replaceNodes","code"],data:()=>({scriptsInserted:[],scriptsRun:[]}),mounted(){this.findAndRunScripts()},methods:{findAndRunScripts(){if(this.$refs.elem&&this.$refs.elem.getElementsByTagName&&typeof window<"u"){const t=this.$refs.elem.getElementsByTagName("script");for(let e=0;e<t.length;e++){const n=t[e];if(n.src){if(this.scriptsInserted.includes(n.src))continue;this.scriptsInserted.push(n.src);const o=document.createElement("script");o.async=!0,o.src=n.src,document.head.appendChild(o)}else if(!n.type||["text/javascript","application/javascript","application/ecmascript"].includes(n.type)){if(this.scriptsRun.includes(n.innerText))continue;try{this.scriptsRun.push(n.innerText),new Function(n.innerText)()}catch(o){console.warn("`CustomCode`: Error running script:",o)}}}}},_classStringToObject(t){const e={};if(typeof t!="string")return e;const n=t.trim().split(/\s+/);for(const o of n)e[o]=!0;return e}}};var Et=function(){var e=this,n=e._self._c;return n("div",{ref:"elem",class:e._classStringToObject("builder-custom-code"+(e.replaceNodes?" replace-nodes":"")),domProps:{innerHTML:e._s(e.code)}})},Ft=[],jt=d($t,Et,Ft,!1,null,null,null,null);const Ut=jt.exports,Pt={name:"Custom Code",static:!0,builtIn:!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}]},Ot=()=>[{component:P,...it},{component:O,...lt},{component:Tt,...Rt},{component:A,...pt},{component:V,...mt},{component:K,...dt},{component:G,...at},{component:J,...ut},{component:X,...ct},{component:xt,...ft},{component:Ut,...Pt}];function y({code:t,context:e,state:n,event:o}){if(t===""){console.warn("Skipping evaluation of empty code block.");return}const r={isEditing:h(),isBrowser:p(),isServer:!p()},a=!(t.includes(";")||t.includes(" return ")||t.trim().startsWith("return "))?`return (${t});`:t;try{return new Function("builder","Builder","state","context","event",a)(r,r,n,e,o)}catch(c){console.warn(`Builder custom code error:
|
|
2
|
+
While Evaluating:
|
|
3
|
+
`,a,`
|
|
4
|
+
`,c.message||c)}}function Y(){return!p()||h()?!1:Boolean(location.search.indexOf("builder.preview=")!==-1)}const S=[];function At(t,e){return S.push({component:t,...e}),console.warn("registerComponent is deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK."),t}const Q=({component:t,...e})=>({type:"builder.registerComponent",data:Bt(e)}),Z=t=>JSON.parse(JSON.stringify(t)),Vt=t=>typeof t=="function"?Wt(t):Z(t),Wt=t=>{const e=t.toString().trim();return`return (${!e.startsWith("function")&&!e.startsWith("(")?"function ":""}${e}).apply(this, arguments)`},Bt=({inputs:t,...e})=>({...Z(e),inputs:t==null?void 0:t.map(n=>Object.entries(n).reduce((o,[r,s])=>({...o,[r]:Vt(s)}),{}))});function Mt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}function ee(){return Mt().replace(/-/g,"")}const te="builderSessionId",Lt=async({canTrack:t})=>{if(!t)return;const e=await N({name:te,canTrack:t});if(g(e))return e;{const n=Nt();zt({id:n,canTrack:t})}},Nt=()=>ee(),zt=({id:t,canTrack:e})=>z({name:te,value:t,canTrack:e}),ne=()=>p()&&typeof localStorage<"u"?localStorage:void 0,Ht=({key:t,canTrack:e})=>{var n;try{return e?(n=ne())==null?void 0:n.getItem(t):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o)}},qt=({key:t,canTrack:e,value:n})=>{var o;try{e&&((o=ne())==null||o.setItem(t,n))}catch(r){console.debug("[LocalStorage] SET error: ",r)}},oe="builderVisitorId",Dt=({canTrack:t})=>{if(!t)return;const e=Ht({key:oe,canTrack:t});if(g(e))return e;{const n=Kt();Gt({id:n,canTrack:t})}},Kt=()=>ee(),Gt=({id:t,canTrack:e})=>qt({key:oe,value:t,canTrack:e}),Jt=async({canTrack:t})=>{if(!t)return{visitorId:void 0,sessionId:void 0};const e=await Lt({canTrack:t}),n=Dt({canTrack:t});return{sessionId:e,visitorId:n}},Xt=async({type:t,canTrack:e,orgId:n,contentId:o,...r})=>({type:t,data:{...r,...await Jt({canTrack:e}),ownerId:n,contentId:o}});async function F(t){if(!!t.canTrack&&!h()&&!!(p()||b==="reactNative"))return fetch("https://builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Xt(t)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(e=>{console.error("Failed to track: ",e)})}const Yt=()=>Promise.resolve().then(()=>ae).then(t=>t.default).catch(t=>{throw console.error("Error while attempting to dynamically import component RenderBlocks at ../render-blocks.vue",t),t}),Qt=()=>Promise.resolve().then(()=>require("./render-styles.76adf086.cjs")).then(t=>t.default).catch(t=>{throw console.error("Error while attempting to dynamically import component RenderContentStyles at ./components/render-styles.vue",t),t}),Zt={name:"render-content",components:{"render-content-styles":Qt,"render-blocks":Yt},props:["content","data","canTrack","context","customComponents","model","apiKey"],data:()=>({forceReRenderCount:0,overrideContent:null,update:0,overrideState:{},markMutable:x}),provide(){const t=this;return{BuilderContext:{get content(){return t.useContent},get state(){return t.contentState},get context(){return t.contextContext},get apiKey(){return t.apiKey},get registeredComponents(){return t.allRegisteredComponents}}}},mounted(){var t;if(p()){if(h()&&(this.forceReRenderCount=this.forceReRenderCount+1,le(),ue(),Object.values(this.allRegisteredComponents).forEach(e=>{var o;const n=Q(e);(o=window.parent)==null||o.postMessage(n,"*")}),window.addEventListener("message",this.processMessage),window.addEventListener("builder:component:stateChangeListenerActivated",this.emitStateUpdate)),this.useContent&&F({type:"impression",canTrack:this.canTrackToUse,contentId:(t=this.useContent)==null?void 0:t.id,orgId:this.apiKey}),Y()){const e=new URL(location.href).searchParams;if(this.model&&e.get("builder.preview")===this.model){const n=e.get("apiKey")||e.get("builder.space");n&&k({model:this.model,apiKey:n}).then(o=>{o&&(this.overrideContent=o)})}}this.evaluateJsCode(),this.runHttpRequests(),this.emitStateUpdate()}},watch:{onUpdateHook0(){this.evaluateJsCode()},onUpdateHook1(){this.runHttpRequests()},onUpdateHook2(){this.emitStateUpdate()}},unmounted(){p()&&(window.removeEventListener("message",this.processMessage),window.removeEventListener("builder:component:stateChangeListenerActivated",this.emitStateUpdate))},computed:{useContent(){var e,n;return!this.content&&!this.overrideContent?void 0:{...this.content,...this.overrideContent,data:{...(e=this.content)==null?void 0:e.data,...this.data,...(n=this.overrideContent)==null?void 0:n.data}}},canTrackToUse(){return this.canTrack||!0},contentState(){var t,e;return{...(e=(t=this.content)==null?void 0:t.data)==null?void 0:e.state,...this.data,...this.overrideState}},contextContext(){return this.context||{}},allRegisteredComponents(){return[...Ot(),...S,...this.customComponents||[]].reduce((n,o)=>({...n,[o.name]:o}),{})},httpReqsData(){return{}},shouldRenderContentStyles(){var t,e,n,o,r;return Boolean((((e=(t=this.useContent)==null?void 0:t.data)==null?void 0:e.cssCode)||((r=(o=(n=this.useContent)==null?void 0:n.data)==null?void 0:o.customFonts)==null?void 0:r.length))&&b!=="reactNative")},onUpdateHook0(){var t,e;return{0:(e=(t=this.useContent)==null?void 0:t.data)==null?void 0:e.jsCode}},onUpdateHook1(){var t,e;return{0:(e=(t=this.useContent)==null?void 0:t.data)==null?void 0:e.httpRequests}},onUpdateHook2(){return{0:this.contentState}}},methods:{processMessage(t){const{data:e}=t;if(e)switch(e.type){case"builder.contentUpdate":{const n=e.data,o=n.key||n.alias||n.entry||n.modelName,r=n.data;o===this.model&&(this.overrideContent=r,this.forceReRenderCount=this.forceReRenderCount+1);break}}},evaluateJsCode(){var e,n;const t=(n=(e=this.useContent)==null?void 0:e.data)==null?void 0:n.jsCode;t&&y({code:t,context:this.contextContext,state:this.contentState})},onClick(t){var e;this.useContent&&F({type:"click",canTrack:this.canTrackToUse,contentId:(e=this.useContent)==null?void 0:e.id,orgId:this.apiKey})},evalExpression(t){return t.replace(/{{([^}]+)}}/g,(e,n)=>y({code:n,context:this.contextContext,state:this.contentState}))},handleRequest({url:t,key:e}){L().then(n=>n(t)).then(n=>n.json()).then(n=>{const o={...this.overrideState,[e]:n};this.overrideState=o}).catch(n=>{console.log("error fetching dynamic data",t,n)})},runHttpRequests(){var e,n,o;const t=(o=(n=(e=this.useContent)==null?void 0:e.data)==null?void 0:n.httpRequests)!=null?o:{};Object.entries(t).forEach(([r,s])=>{if(s&&(!this.httpReqsData[r]||h())){const a=this.evalExpression(s);this.handleRequest({url:a,key:r})}})},emitStateUpdate(){h()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:this.contentState,ref:{name:this.model}}}))}}};var en=function(){var o,r,s,a,c,i,l;var e=this,n=e._self._c;return e.useContent?n("div",{ref:"elementRef",attrs:{"builder-content-id":(o=e.useContent)==null?void 0:o.id},on:{click:function(u){return e.onClick(u)}}},[e.shouldRenderContentStyles?[n("render-content-styles",{attrs:{cssCode:(s=(r=e.useContent)==null?void 0:r.data)==null?void 0:s.cssCode,customFonts:(c=(a=e.useContent)==null?void 0:a.data)==null?void 0:c.customFonts}})]:e._e(),n("render-blocks",{key:e.forceReRenderCount,attrs:{blocks:e.markMutable((l=(i=e.useContent)==null?void 0:i.data)==null?void 0:l.blocks)}})],2):e._e()},tn=[],nn=d(Zt,en,tn,!1,null,null,null,null);const re=nn.exports,on=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"})),rn=()=>Promise.resolve().then(()=>require("./block-styles.7900ea80.cjs")).then(t=>t.default).catch(t=>{throw console.error("Error while attempting to dynamically import component BlockStyles at ./render-block/block-styles.vue",t),t}),sn=()=>Promise.resolve().then(()=>require("./render-block.e4f18476.cjs")).then(t=>t.default).catch(t=>{throw console.error("Error while attempting to dynamically import component RenderBlock at ./render-block/render-block.vue",t),t}),an={name:"render-blocks",components:{"render-block":sn,"block-styles":rn},props:["blocks","parent","path"],inject:{builderContext:"BuilderContext"},computed:{className(){var t;return"builder-blocks"+((t=this.blocks)!=null&&t.length?"":" no-blocks")}},methods:{onClick(){var t,e;h()&&!((t=this.blocks)!=null&&t.length)&&((e=window.parent)==null||e.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:this.parent,dataPath:this.path}},"*"))},onMouseEnter(){var t,e;h()&&!((t=this.blocks)!=null&&t.length)&&((e=window.parent)==null||e.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:this.parent,dataPath:this.path}},"*"))},_classStringToObject(t){const e={};if(typeof t!="string")return e;const n=t.trim().split(/\s+/);for(const o of n)e[o]=!0;return e}}};var cn=function(){var e=this,n=e._self._c;return n("div",{class:e._classStringToObject(e.className+" div-23e8fqt91nf"),attrs:{"builder-path":e.path,"builder-parent-id":e.parent,dataSet:{class:e.className}},on:{click:function(o){return e.onClick()},mouseenter:function(o){return e.onMouseEnter()}}},[e.blocks?e._l(e.blocks,function(o,r){return n("render-block",{key:"render-block-"+o.id,attrs:{block:o,context:e.builderContext}})}):e._e(),e.blocks?e._l(e.blocks,function(o,r){return n("block-styles",{key:"block-style-"+o.id,attrs:{block:o,context:e.builderContext}})}):e._e()],2)},ln=[],un=d(an,cn,ln,!1,null,"69abb8b2",null,null);const se=un.exports,ae=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"})),j={};function dn(t){if(p()){Object.assign(j,t);const e={type:"builder.settingsChange",data:j};parent.postMessage(e,"*")}}exports.Button=G;exports.Columns=P;exports.Fragment=X;exports.Image=O;exports.Section=J;exports.Symbol=K;exports.TARGET=b;exports.Text=A;exports.Video=V;exports.components=S;exports.convertSearchParamsToQueryObject=W;exports.createRegisterComponentMessage=Q;exports.evaluate=y;exports.generateContentUrl=q;exports.getAllContent=D;exports.getBuilderSearchParams=B;exports.getBuilderSearchParamsFromWindow=M;exports.getContent=k;exports.isEditing=h;exports.isPreviewing=Y;exports.markPropsMutable=de;exports.normalizeComponent=d;exports.normalizeSearchParams=C;exports.register=U;exports.registerComponent=At;exports.renderBlocks=se;exports.renderContent=re;exports.setEditorSettings=dn;
|