@builder.io/sdk-react-nextjs 0.5.8 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/USE_CLIENT_BUNDLE-29f9ac5c.js +23 -0
- package/lib/browser/USE_CLIENT_BUNDLE-dfa97c43.mjs +664 -0
- package/lib/browser/USE_SERVER_BUNDLE-25e181fa.js +1 -0
- package/lib/browser/USE_SERVER_BUNDLE-fcd44ecb.mjs +11 -0
- package/lib/browser/bundle-5cab6113.js +76 -0
- package/lib/browser/bundle-babbd573.mjs +2419 -0
- package/lib/browser/index.cjs +1 -0
- package/lib/browser/index.mjs +34 -0
- package/lib/edge/USE_CLIENT_BUNDLE-3cbb02d5.mjs +664 -0
- package/lib/edge/USE_CLIENT_BUNDLE-d0b99f60.js +23 -0
- package/lib/edge/USE_SERVER_BUNDLE-4eeb4634.mjs +11 -0
- package/lib/edge/USE_SERVER_BUNDLE-bbd89085.js +1 -0
- package/lib/edge/bundle-9ed99f98.mjs +4863 -0
- package/lib/edge/bundle-e4764e2a.js +96 -0
- package/lib/edge/index.cjs +1 -0
- package/lib/edge/index.mjs +34 -0
- package/lib/node/USE_CLIENT_BUNDLE-29f9ac5c.js +23 -0
- package/lib/node/USE_CLIENT_BUNDLE-dfa97c43.mjs +664 -0
- package/lib/node/USE_SERVER_BUNDLE-25e181fa.js +1 -0
- package/lib/node/USE_SERVER_BUNDLE-fcd44ecb.mjs +11 -0
- package/lib/node/bundle-5cab6113.js +76 -0
- package/lib/node/bundle-babbd573.mjs +2419 -0
- package/lib/node/index.cjs +1 -0
- package/lib/node/index.mjs +34 -0
- package/package.json +96 -13
- package/{dist → types}/components/content/content.types.d.ts +2 -2
- package/{dist → types}/components/content-variants/content-variants.d.ts +2 -2
- package/{dist → types}/components/content-variants/content-variants.types.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -0
- package/types/functions/deopt.d.ts +4 -0
- package/types/functions/evaluate/browser-runtime/browser.d.ts +4 -0
- package/types/functions/evaluate/browser-runtime/index.d.ts +1 -0
- package/types/functions/evaluate/evaluate.d.ts +6 -0
- package/types/functions/evaluate/helpers.d.ts +18 -0
- package/types/functions/evaluate/index.d.ts +1 -0
- package/{dist → types}/functions/fetch-builder-props.d.ts +4 -3
- package/{dist → types}/functions/get-content/index.d.ts +4 -5
- package/{dist → types}/index-helpers/blocks-exports.d.ts +2 -2
- package/types/index.d.ts +7 -0
- package/{dist/index.d.ts → types/server-index.d.ts} +0 -1
- package/dist/blocks/button/button.js +0 -12
- package/dist/blocks/button/component-info.js +0 -34
- package/dist/blocks/columns/columns.js +0 -119
- package/dist/blocks/columns/component-info.js +0 -219
- package/dist/blocks/custom-code/component-info.js +0 -23
- package/dist/blocks/custom-code/custom-code.js +0 -51
- package/dist/blocks/embed/component-info.js +0 -39
- package/dist/blocks/embed/embed.js +0 -42
- package/dist/blocks/embed/helpers.js +0 -2
- package/dist/blocks/fragment/component-info.js +0 -7
- package/dist/blocks/fragment/fragment.js +0 -6
- package/dist/blocks/helpers.js +0 -40
- package/dist/blocks/image/component-info.js +0 -122
- package/dist/blocks/image/image.helpers.js +0 -47
- package/dist/blocks/image/image.js +0 -82
- package/dist/blocks/img/component-info.js +0 -15
- package/dist/blocks/img/img.js +0 -10
- package/dist/blocks/section/component-info.js +0 -40
- package/dist/blocks/section/section.js +0 -17
- package/dist/blocks/symbol/component-info.js +0 -34
- package/dist/blocks/symbol/symbol.helpers.js +0 -31
- package/dist/blocks/symbol/symbol.js +0 -29
- package/dist/blocks/text/component-info.js +0 -19
- package/dist/blocks/text/text.js +0 -7
- package/dist/blocks/video/component-info.js +0 -82
- package/dist/blocks/video/video.js +0 -50
- package/dist/components/block/block.helpers.js +0 -69
- package/dist/components/block/block.js +0 -92
- package/dist/components/block/components/block-styles.js +0 -65
- package/dist/components/block/components/block-wrapper.js +0 -36
- package/dist/components/block/components/component-ref/component-ref.helpers.js +0 -22
- package/dist/components/block/components/component-ref/component-ref.js +0 -21
- package/dist/components/block/components/interactive-element.js +0 -20
- package/dist/components/block/components/repeated-block.js +0 -7
- package/dist/components/block/types.js +0 -1
- package/dist/components/blocks/blocks-wrapper.js +0 -38
- package/dist/components/blocks/blocks.js +0 -10
- package/dist/components/content/components/enable-editor.js +0 -250
- package/dist/components/content/components/styles.helpers.js +0 -58
- package/dist/components/content/components/styles.js +0 -30
- package/dist/components/content/content.helpers.js +0 -30
- package/dist/components/content/content.js +0 -74
- package/dist/components/content/content.types.js +0 -1
- package/dist/components/content/wrap-component-ref.js +0 -6
- package/dist/components/content-variants/content-variants.js +0 -45
- package/dist/components/content-variants/content-variants.types.js +0 -1
- package/dist/components/content-variants/helpers.js +0 -189
- package/dist/components/inlined-script.js +0 -5
- package/dist/components/inlined-styles.js +0 -5
- package/dist/constants/builder-registered-components.js +0 -60
- package/dist/constants/device-sizes.js +0 -45
- package/dist/constants/sdk-version.d.ts +0 -1
- package/dist/constants/sdk-version.js +0 -1
- package/dist/constants/target.js +0 -2
- package/dist/context/builder.context.js +0 -12
- package/dist/context/components.context.js +0 -2
- package/dist/context/types.js +0 -1
- package/dist/functions/camel-to-kebab-case.js +0 -1
- package/dist/functions/evaluate/acorn-interpreter.d.ts +0 -2
- package/dist/functions/evaluate/acorn-interpreter.js +0 -3111
- package/dist/functions/evaluate/evaluate.d.ts +0 -10
- package/dist/functions/evaluate/evaluate.js +0 -70
- package/dist/functions/evaluate/index.d.ts +0 -1
- package/dist/functions/evaluate/index.js +0 -1
- package/dist/functions/evaluate/non-node-runtime/index.d.ts +0 -1
- package/dist/functions/evaluate/non-node-runtime/index.js +0 -2
- package/dist/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
- package/dist/functions/evaluate/non-node-runtime/non-node-runtime.js +0 -84
- package/dist/functions/evaluate/types.d.ts +0 -11
- package/dist/functions/evaluate/types.js +0 -1
- package/dist/functions/event-handler-name.js +0 -4
- package/dist/functions/extract-text-styles.js +0 -22
- package/dist/functions/fast-clone.js +0 -4
- package/dist/functions/fetch-builder-props.js +0 -25
- package/dist/functions/get-block-actions-handler.js +0 -10
- package/dist/functions/get-block-actions.js +0 -28
- package/dist/functions/get-block-component-options.js +0 -10
- package/dist/functions/get-block-properties.js +0 -72
- package/dist/functions/get-builder-search-params/index.js +0 -38
- package/dist/functions/get-content/generate-content-url.js +0 -33
- package/dist/functions/get-content/index.js +0 -100
- package/dist/functions/get-content/types.js +0 -1
- package/dist/functions/get-fetch.js +0 -11
- package/dist/functions/get-global-this.js +0 -15
- package/dist/functions/get-processed-block.js +0 -46
- package/dist/functions/get-react-native-block-styles.js +0 -17
- package/dist/functions/is-browser.js +0 -3
- package/dist/functions/is-editing.js +0 -5
- package/dist/functions/is-iframe.js +0 -4
- package/dist/functions/is-non-node-server.d.ts +0 -4
- package/dist/functions/is-non-node-server.js +0 -8
- package/dist/functions/is-previewing.js +0 -11
- package/dist/functions/register-component.js +0 -38
- package/dist/functions/register.js +0 -27
- package/dist/functions/sanitize-react-native-block-styles.js +0 -61
- package/dist/functions/set-editor-settings.js +0 -12
- package/dist/functions/set.js +0 -14
- package/dist/functions/track/helpers.js +0 -51
- package/dist/functions/track/index.js +0 -71
- package/dist/functions/track/interaction.js +0 -53
- package/dist/functions/transform-block-properties.js +0 -5
- package/dist/functions/transform-block.js +0 -4
- package/dist/helpers/ab-tests.js +0 -122
- package/dist/helpers/canTrack.js +0 -2
- package/dist/helpers/cookie.js +0 -55
- package/dist/helpers/css.js +0 -27
- package/dist/helpers/flatten.js +0 -19
- package/dist/helpers/localStorage.js +0 -24
- package/dist/helpers/logger.js +0 -7
- package/dist/helpers/nullable.js +0 -1
- package/dist/helpers/preview-lru-cache/get.js +0 -9
- package/dist/helpers/preview-lru-cache/helpers.js +0 -9
- package/dist/helpers/preview-lru-cache/init.js +0 -15
- package/dist/helpers/preview-lru-cache/set.js +0 -7
- package/dist/helpers/preview-lru-cache/types.js +0 -6
- package/dist/helpers/sessionId.js +0 -30
- package/dist/helpers/url.js +0 -15
- package/dist/helpers/uuid.js +0 -15
- package/dist/helpers/visitorId.js +0 -30
- package/dist/index-helpers/blocks-exports.js +0 -19
- package/dist/index-helpers/top-of-file.js +0 -4
- package/dist/index.js +0 -11
- package/dist/scripts/init-editing.js +0 -110
- package/dist/types/api-version.js +0 -1
- package/dist/types/builder-block.js +0 -1
- package/dist/types/builder-content.js +0 -1
- package/dist/types/builder-props.js +0 -1
- package/dist/types/can-track.js +0 -1
- package/dist/types/components.js +0 -1
- package/dist/types/deep-partial.js +0 -1
- package/dist/types/element.js +0 -1
- package/dist/types/enforced-partials.js +0 -1
- package/dist/types/input.js +0 -1
- package/dist/types/targets.js +0 -1
- package/dist/types/typescript.js +0 -1
- /package/{dist → types}/blocks/button/button.d.ts +0 -0
- /package/{dist → types}/blocks/button/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/columns/columns.d.ts +0 -0
- /package/{dist → types}/blocks/columns/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/custom-code/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/custom-code/custom-code.d.ts +0 -0
- /package/{dist → types}/blocks/embed/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/embed/embed.d.ts +0 -0
- /package/{dist → types}/blocks/embed/helpers.d.ts +0 -0
- /package/{dist → types}/blocks/fragment/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/fragment/fragment.d.ts +0 -0
- /package/{dist → types}/blocks/helpers.d.ts +0 -0
- /package/{dist → types}/blocks/image/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/image/image.d.ts +0 -0
- /package/{dist → types}/blocks/image/image.helpers.d.ts +0 -0
- /package/{dist → types}/blocks/img/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/img/img.d.ts +0 -0
- /package/{dist → types}/blocks/section/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/section/section.d.ts +0 -0
- /package/{dist → types}/blocks/symbol/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/symbol/symbol.d.ts +0 -0
- /package/{dist → types}/blocks/symbol/symbol.helpers.d.ts +0 -0
- /package/{dist → types}/blocks/text/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/text/text.d.ts +0 -0
- /package/{dist → types}/blocks/video/component-info.d.ts +0 -0
- /package/{dist → types}/blocks/video/video.d.ts +0 -0
- /package/{dist → types}/components/block/block.d.ts +0 -0
- /package/{dist → types}/components/block/block.helpers.d.ts +0 -0
- /package/{dist → types}/components/block/components/block-styles.d.ts +0 -0
- /package/{dist → types}/components/block/components/block-wrapper.d.ts +0 -0
- /package/{dist → types}/components/block/components/component-ref/component-ref.d.ts +0 -0
- /package/{dist → types}/components/block/components/component-ref/component-ref.helpers.d.ts +0 -0
- /package/{dist → types}/components/block/components/interactive-element.d.ts +0 -0
- /package/{dist → types}/components/block/components/repeated-block.d.ts +0 -0
- /package/{dist → types}/components/block/types.d.ts +0 -0
- /package/{dist → types}/components/blocks/blocks-wrapper.d.ts +0 -0
- /package/{dist → types}/components/blocks/blocks.d.ts +0 -0
- /package/{dist → types}/components/content/components/enable-editor.d.ts +0 -0
- /package/{dist → types}/components/content/components/styles.d.ts +0 -0
- /package/{dist → types}/components/content/components/styles.helpers.d.ts +0 -0
- /package/{dist → types}/components/content/content.d.ts +0 -0
- /package/{dist → types}/components/content/content.helpers.d.ts +0 -0
- /package/{dist → types}/components/content/wrap-component-ref.d.ts +0 -0
- /package/{dist → types}/components/content-variants/helpers.d.ts +0 -0
- /package/{dist → types}/components/inlined-script.d.ts +0 -0
- /package/{dist → types}/components/inlined-styles.d.ts +0 -0
- /package/{dist → types}/constants/builder-registered-components.d.ts +0 -0
- /package/{dist → types}/constants/device-sizes.d.ts +0 -0
- /package/{dist → types}/constants/target.d.ts +0 -0
- /package/{dist → types}/context/builder.context.d.ts +0 -0
- /package/{dist → types}/context/components.context.d.ts +0 -0
- /package/{dist → types}/context/types.d.ts +0 -0
- /package/{dist → types}/functions/camel-to-kebab-case.d.ts +0 -0
- /package/{dist → types}/functions/event-handler-name.d.ts +0 -0
- /package/{dist → types}/functions/extract-text-styles.d.ts +0 -0
- /package/{dist → types}/functions/fast-clone.d.ts +0 -0
- /package/{dist → types}/functions/get-block-actions-handler.d.ts +0 -0
- /package/{dist → types}/functions/get-block-actions.d.ts +0 -0
- /package/{dist → types}/functions/get-block-component-options.d.ts +0 -0
- /package/{dist → types}/functions/get-block-properties.d.ts +0 -0
- /package/{dist → types}/functions/get-builder-search-params/index.d.ts +0 -0
- /package/{dist → types}/functions/get-content/generate-content-url.d.ts +0 -0
- /package/{dist → types}/functions/get-content/types.d.ts +0 -0
- /package/{dist → types}/functions/get-fetch.d.ts +0 -0
- /package/{dist → types}/functions/get-global-this.d.ts +0 -0
- /package/{dist → types}/functions/get-processed-block.d.ts +0 -0
- /package/{dist → types}/functions/get-react-native-block-styles.d.ts +0 -0
- /package/{dist → types}/functions/is-browser.d.ts +0 -0
- /package/{dist → types}/functions/is-editing.d.ts +0 -0
- /package/{dist → types}/functions/is-iframe.d.ts +0 -0
- /package/{dist → types}/functions/is-previewing.d.ts +0 -0
- /package/{dist → types}/functions/register-component.d.ts +0 -0
- /package/{dist → types}/functions/register.d.ts +0 -0
- /package/{dist → types}/functions/sanitize-react-native-block-styles.d.ts +0 -0
- /package/{dist → types}/functions/set-editor-settings.d.ts +0 -0
- /package/{dist → types}/functions/set.d.ts +0 -0
- /package/{dist → types}/functions/track/helpers.d.ts +0 -0
- /package/{dist → types}/functions/track/index.d.ts +0 -0
- /package/{dist → types}/functions/track/interaction.d.ts +0 -0
- /package/{dist → types}/functions/transform-block-properties.d.ts +0 -0
- /package/{dist → types}/functions/transform-block.d.ts +0 -0
- /package/{dist → types}/helpers/ab-tests.d.ts +0 -0
- /package/{dist → types}/helpers/canTrack.d.ts +0 -0
- /package/{dist → types}/helpers/cookie.d.ts +0 -0
- /package/{dist → types}/helpers/css.d.ts +0 -0
- /package/{dist → types}/helpers/flatten.d.ts +0 -0
- /package/{dist → types}/helpers/localStorage.d.ts +0 -0
- /package/{dist → types}/helpers/logger.d.ts +0 -0
- /package/{dist → types}/helpers/nullable.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/get.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/helpers.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/init.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/set.d.ts +0 -0
- /package/{dist → types}/helpers/preview-lru-cache/types.d.ts +0 -0
- /package/{dist → types}/helpers/sessionId.d.ts +0 -0
- /package/{dist → types}/helpers/url.d.ts +0 -0
- /package/{dist → types}/helpers/uuid.d.ts +0 -0
- /package/{dist → types}/helpers/visitorId.d.ts +0 -0
- /package/{dist → types}/index-helpers/top-of-file.d.ts +0 -0
- /package/{dist → types}/scripts/init-editing.d.ts +0 -0
- /package/{dist → types}/types/api-version.d.ts +0 -0
- /package/{dist → types}/types/builder-block.d.ts +0 -0
- /package/{dist → types}/types/builder-content.d.ts +0 -0
- /package/{dist → types}/types/builder-props.d.ts +0 -0
- /package/{dist → types}/types/can-track.d.ts +0 -0
- /package/{dist → types}/types/components.d.ts +0 -0
- /package/{dist → types}/types/deep-partial.d.ts +0 -0
- /package/{dist → types}/types/element.d.ts +0 -0
- /package/{dist → types}/types/enforced-partials.d.ts +0 -0
- /package/{dist → types}/types/input.d.ts +0 -0
- /package/{dist → types}/types/targets.d.ts +0 -0
- /package/{dist → types}/types/typescript.d.ts +0 -0
|
@@ -0,0 +1,2419 @@
|
|
|
1
|
+
import { LRUCache as Ce } from "lru-cache";
|
|
2
|
+
import { jsx as l, Fragment as x, jsxs as w } from "react/jsx-runtime";
|
|
3
|
+
import { createElement as Ie } from "react";
|
|
4
|
+
import { I as Te, B as O, a as D, b as Re, c as Ee, C as Ae, E as Ve, F as $e, d as Pe, e as Be, S as Fe, V as Oe, f as We } from "./USE_CLIENT_BUNDLE-dfa97c43.mjs";
|
|
5
|
+
import "next/navigation";
|
|
6
|
+
const E = (e) => JSON.parse(JSON.stringify(e)), oe = {
|
|
7
|
+
small: {
|
|
8
|
+
min: 320,
|
|
9
|
+
default: 321,
|
|
10
|
+
max: 640
|
|
11
|
+
},
|
|
12
|
+
medium: {
|
|
13
|
+
min: 641,
|
|
14
|
+
default: 642,
|
|
15
|
+
max: 991
|
|
16
|
+
},
|
|
17
|
+
large: {
|
|
18
|
+
min: 990,
|
|
19
|
+
default: 991,
|
|
20
|
+
max: 1200
|
|
21
|
+
}
|
|
22
|
+
}, Bn = (e, t = oe) => `@media (max-width: ${t[e].max}px)`, Ne = ({
|
|
23
|
+
small: e,
|
|
24
|
+
medium: t
|
|
25
|
+
}) => {
|
|
26
|
+
const n = E(oe);
|
|
27
|
+
if (!e || !t)
|
|
28
|
+
return n;
|
|
29
|
+
const o = Math.floor(e / 2);
|
|
30
|
+
n.small = {
|
|
31
|
+
max: e,
|
|
32
|
+
min: o,
|
|
33
|
+
default: o + 1
|
|
34
|
+
};
|
|
35
|
+
const i = n.small.max + 1;
|
|
36
|
+
n.medium = {
|
|
37
|
+
max: t,
|
|
38
|
+
min: i,
|
|
39
|
+
default: i + 1
|
|
40
|
+
};
|
|
41
|
+
const r = n.medium.max + 1;
|
|
42
|
+
return n.large = {
|
|
43
|
+
max: 2e3,
|
|
44
|
+
// TODO: decide upper limit
|
|
45
|
+
min: r,
|
|
46
|
+
default: r + 1
|
|
47
|
+
}, n;
|
|
48
|
+
}, C = "rsc", T = "[Builder.io]: ", k = {
|
|
49
|
+
log: (...e) => console.log(T, ...e),
|
|
50
|
+
error: (...e) => console.error(T, ...e),
|
|
51
|
+
warn: (...e) => console.warn(T, ...e),
|
|
52
|
+
debug: (...e) => console.debug(T, ...e)
|
|
53
|
+
};
|
|
54
|
+
function S() {
|
|
55
|
+
return typeof window < "u" && typeof document < "u";
|
|
56
|
+
}
|
|
57
|
+
function Le() {
|
|
58
|
+
return S() && window.self !== window.top;
|
|
59
|
+
}
|
|
60
|
+
function W() {
|
|
61
|
+
return Le() && window.location.search.indexOf("builder.frameEditing=") !== -1;
|
|
62
|
+
}
|
|
63
|
+
const Me = () => {
|
|
64
|
+
if (S()) {
|
|
65
|
+
const e = new URL(location.href);
|
|
66
|
+
return e.pathname === "" && (e.pathname = "/"), e;
|
|
67
|
+
} else
|
|
68
|
+
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
69
|
+
}, _e = () => typeof navigator == "object" && navigator.userAgent || "", ie = () => {
|
|
70
|
+
const e = _e(), t = {
|
|
71
|
+
Android() {
|
|
72
|
+
return e.match(/Android/i);
|
|
73
|
+
},
|
|
74
|
+
BlackBerry() {
|
|
75
|
+
return e.match(/BlackBerry/i);
|
|
76
|
+
},
|
|
77
|
+
iOS() {
|
|
78
|
+
return e.match(/iPhone|iPod/i);
|
|
79
|
+
},
|
|
80
|
+
Opera() {
|
|
81
|
+
return e.match(/Opera Mini/i);
|
|
82
|
+
},
|
|
83
|
+
Windows() {
|
|
84
|
+
return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
|
|
85
|
+
},
|
|
86
|
+
any() {
|
|
87
|
+
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || C === "reactNative";
|
|
88
|
+
}
|
|
89
|
+
}, n = e.match(/Tablet|iPad/i), o = Me();
|
|
90
|
+
return {
|
|
91
|
+
urlPath: o == null ? void 0 : o.pathname,
|
|
92
|
+
host: (o == null ? void 0 : o.host) || (o == null ? void 0 : o.hostname),
|
|
93
|
+
device: n ? "tablet" : t.any() ? "mobile" : "desktop"
|
|
94
|
+
};
|
|
95
|
+
}, Ue = ({
|
|
96
|
+
builder: e,
|
|
97
|
+
context: t,
|
|
98
|
+
event: n,
|
|
99
|
+
state: o
|
|
100
|
+
}) => Object.entries({
|
|
101
|
+
state: o,
|
|
102
|
+
Builder: e,
|
|
103
|
+
// legacy
|
|
104
|
+
builder: e,
|
|
105
|
+
context: t,
|
|
106
|
+
event: n
|
|
107
|
+
}), je = ({
|
|
108
|
+
code: e,
|
|
109
|
+
builder: t,
|
|
110
|
+
context: n,
|
|
111
|
+
event: o,
|
|
112
|
+
localState: i,
|
|
113
|
+
rootSetState: r,
|
|
114
|
+
rootState: a
|
|
115
|
+
}) => {
|
|
116
|
+
const c = Ue({
|
|
117
|
+
builder: t,
|
|
118
|
+
context: n,
|
|
119
|
+
event: o,
|
|
120
|
+
state: Ke(a, i, r)
|
|
121
|
+
});
|
|
122
|
+
return new Function(...c.map(([s]) => s), e)(...c.map(([, s]) => s));
|
|
123
|
+
};
|
|
124
|
+
function Ke(e, t, n) {
|
|
125
|
+
if (e === t)
|
|
126
|
+
throw new Error("rootState === localState");
|
|
127
|
+
return new Proxy(e, {
|
|
128
|
+
get: (o, i) => t && i in t ? t[i] : e[i],
|
|
129
|
+
set: (o, i, r) => {
|
|
130
|
+
if (t && i in t)
|
|
131
|
+
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
132
|
+
return e[i] = r, n == null || n(e), !0;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function N({
|
|
137
|
+
code: e,
|
|
138
|
+
context: t,
|
|
139
|
+
localState: n,
|
|
140
|
+
rootState: o,
|
|
141
|
+
rootSetState: i,
|
|
142
|
+
event: r,
|
|
143
|
+
isExpression: a = !0
|
|
144
|
+
}) {
|
|
145
|
+
if (e === "") {
|
|
146
|
+
k.warn("Skipping evaluation of empty code block.");
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const c = {
|
|
150
|
+
isEditing: W(),
|
|
151
|
+
isBrowser: S(),
|
|
152
|
+
isServer: !S(),
|
|
153
|
+
getUserAttributes: () => ie()
|
|
154
|
+
}, f = {
|
|
155
|
+
code: /* we disable this for cases where we definitely don't want a return */ a && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e,
|
|
156
|
+
builder: c,
|
|
157
|
+
context: t,
|
|
158
|
+
event: r,
|
|
159
|
+
rootSetState: i,
|
|
160
|
+
rootState: o,
|
|
161
|
+
localState: n
|
|
162
|
+
};
|
|
163
|
+
try {
|
|
164
|
+
return je(f);
|
|
165
|
+
} catch (g) {
|
|
166
|
+
k.error("Failed code evaluation: " + g.message, {
|
|
167
|
+
code: e
|
|
168
|
+
});
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const He = (e, t, n) => {
|
|
173
|
+
if (Object(e) !== e)
|
|
174
|
+
return e;
|
|
175
|
+
const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
176
|
+
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;
|
|
177
|
+
};
|
|
178
|
+
const De = ({
|
|
179
|
+
block: e,
|
|
180
|
+
context: t,
|
|
181
|
+
localState: n,
|
|
182
|
+
rootState: o,
|
|
183
|
+
rootSetState: i
|
|
184
|
+
}) => {
|
|
185
|
+
if (!e.bindings)
|
|
186
|
+
return e;
|
|
187
|
+
const r = E(e), a = {
|
|
188
|
+
...r,
|
|
189
|
+
properties: {
|
|
190
|
+
...r.properties
|
|
191
|
+
},
|
|
192
|
+
actions: {
|
|
193
|
+
...r.actions
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
for (const c in e.bindings) {
|
|
197
|
+
const s = e.bindings[c], u = N({
|
|
198
|
+
code: s,
|
|
199
|
+
localState: n,
|
|
200
|
+
rootState: o,
|
|
201
|
+
rootSetState: i,
|
|
202
|
+
context: t
|
|
203
|
+
});
|
|
204
|
+
He(a, c, u);
|
|
205
|
+
}
|
|
206
|
+
return a;
|
|
207
|
+
};
|
|
208
|
+
function re({
|
|
209
|
+
block: e,
|
|
210
|
+
context: t,
|
|
211
|
+
shouldEvaluateBindings: n,
|
|
212
|
+
localState: o,
|
|
213
|
+
rootState: i,
|
|
214
|
+
rootSetState: r
|
|
215
|
+
}) {
|
|
216
|
+
const a = e;
|
|
217
|
+
return n ? De({
|
|
218
|
+
block: a,
|
|
219
|
+
localState: o,
|
|
220
|
+
rootState: i,
|
|
221
|
+
rootSetState: r,
|
|
222
|
+
context: t
|
|
223
|
+
}) : a;
|
|
224
|
+
}
|
|
225
|
+
const ze = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), I = (e) => e != null, ae = (e) => Object.entries(e).map(([n, o]) => {
|
|
226
|
+
if (typeof o == "string")
|
|
227
|
+
return `${ze(n)}: ${o};`;
|
|
228
|
+
}).filter(I), qe = (e) => ae(e).join(`
|
|
229
|
+
`), Fn = ({
|
|
230
|
+
mediaQuery: e,
|
|
231
|
+
className: t,
|
|
232
|
+
styles: n
|
|
233
|
+
}) => {
|
|
234
|
+
const o = `.${t} {
|
|
235
|
+
${qe(n)}
|
|
236
|
+
}`;
|
|
237
|
+
return e ? `${e} {
|
|
238
|
+
${o}
|
|
239
|
+
}` : o;
|
|
240
|
+
};
|
|
241
|
+
function L(e) {
|
|
242
|
+
return /* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
|
|
243
|
+
}
|
|
244
|
+
function Ge(e) {
|
|
245
|
+
var t;
|
|
246
|
+
return {
|
|
247
|
+
...(t = e.component) == null ? void 0 : t.options,
|
|
248
|
+
...e.options,
|
|
249
|
+
/**
|
|
250
|
+
* Our built-in components frequently make use of the block, so we provide all of it under `builderBlock`
|
|
251
|
+
*/
|
|
252
|
+
builderBlock: e
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
const Je = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], V = (e) => typeof e == "string" && Je.includes(e.toLowerCase()), Ye = ({
|
|
256
|
+
block: e,
|
|
257
|
+
context: t,
|
|
258
|
+
registeredComponents: n
|
|
259
|
+
}) => {
|
|
260
|
+
var r;
|
|
261
|
+
const o = (r = re({
|
|
262
|
+
block: e,
|
|
263
|
+
localState: t.localState,
|
|
264
|
+
rootState: t.rootState,
|
|
265
|
+
rootSetState: t.rootSetState,
|
|
266
|
+
context: t.context,
|
|
267
|
+
shouldEvaluateBindings: !1
|
|
268
|
+
}).component) == null ? void 0 : r.name;
|
|
269
|
+
if (!o)
|
|
270
|
+
return null;
|
|
271
|
+
const i = n[o];
|
|
272
|
+
if (i)
|
|
273
|
+
return i;
|
|
274
|
+
console.warn(`
|
|
275
|
+
Could not find a registered component named "${o}".
|
|
276
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`);
|
|
277
|
+
}, Xe = ({
|
|
278
|
+
block: e,
|
|
279
|
+
context: t
|
|
280
|
+
}) => {
|
|
281
|
+
const {
|
|
282
|
+
repeat: n,
|
|
283
|
+
...o
|
|
284
|
+
} = e;
|
|
285
|
+
if (!(n != null && n.collection))
|
|
286
|
+
return;
|
|
287
|
+
const i = N({
|
|
288
|
+
code: n.collection,
|
|
289
|
+
localState: t.localState,
|
|
290
|
+
rootState: t.rootState,
|
|
291
|
+
rootSetState: t.rootSetState,
|
|
292
|
+
context: t.context
|
|
293
|
+
});
|
|
294
|
+
if (!Array.isArray(i))
|
|
295
|
+
return;
|
|
296
|
+
const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
|
|
297
|
+
return i.map((s, u) => ({
|
|
298
|
+
context: {
|
|
299
|
+
...t,
|
|
300
|
+
localState: {
|
|
301
|
+
...t.localState,
|
|
302
|
+
$index: u,
|
|
303
|
+
$item: s,
|
|
304
|
+
[a]: s,
|
|
305
|
+
[`$${a}Index`]: u
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
block: o
|
|
309
|
+
}));
|
|
310
|
+
};
|
|
311
|
+
function Qe(e) {
|
|
312
|
+
const t = e.repeatContext;
|
|
313
|
+
return /* @__PURE__ */ l(
|
|
314
|
+
A,
|
|
315
|
+
{
|
|
316
|
+
block: e.block,
|
|
317
|
+
context: t,
|
|
318
|
+
registeredComponents: e.registeredComponents
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
function Ze(e) {
|
|
323
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
324
|
+
}
|
|
325
|
+
const et = (e) => `on${Ze(e)}`, tt = (e, t) => (n) => N({
|
|
326
|
+
code: e,
|
|
327
|
+
context: t.context,
|
|
328
|
+
localState: t.localState,
|
|
329
|
+
rootState: t.rootState,
|
|
330
|
+
rootSetState: t.rootSetState,
|
|
331
|
+
event: n,
|
|
332
|
+
isExpression: !1
|
|
333
|
+
});
|
|
334
|
+
function On(e) {
|
|
335
|
+
const t = {}, n = e.block.actions ?? {};
|
|
336
|
+
for (const o in n) {
|
|
337
|
+
if (!n.hasOwnProperty(o))
|
|
338
|
+
continue;
|
|
339
|
+
const i = n[o];
|
|
340
|
+
let r = et(o);
|
|
341
|
+
if (e.stripPrefix)
|
|
342
|
+
switch (C) {
|
|
343
|
+
case "vue2":
|
|
344
|
+
case "vue3":
|
|
345
|
+
r = r.replace("v-on:", "");
|
|
346
|
+
break;
|
|
347
|
+
case "svelte":
|
|
348
|
+
r = r.replace("on:", "");
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
t[r] = tt(i, e);
|
|
352
|
+
}
|
|
353
|
+
return t;
|
|
354
|
+
}
|
|
355
|
+
function nt(e) {
|
|
356
|
+
return e.className = e.class, delete e.class, e;
|
|
357
|
+
}
|
|
358
|
+
const ot = (e) => ({
|
|
359
|
+
href: e.href
|
|
360
|
+
});
|
|
361
|
+
function it({
|
|
362
|
+
block: e,
|
|
363
|
+
context: t
|
|
364
|
+
}) {
|
|
365
|
+
var o;
|
|
366
|
+
const n = {
|
|
367
|
+
...ot(e),
|
|
368
|
+
...e.properties,
|
|
369
|
+
"builder-id": e.id,
|
|
370
|
+
style: e.style ? rt(e.style) : void 0,
|
|
371
|
+
class: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
|
|
372
|
+
};
|
|
373
|
+
return nt(n);
|
|
374
|
+
}
|
|
375
|
+
function rt(e) {
|
|
376
|
+
switch (C) {
|
|
377
|
+
case "svelte":
|
|
378
|
+
case "vue2":
|
|
379
|
+
case "vue3":
|
|
380
|
+
case "solid":
|
|
381
|
+
return ae(e).join(" ");
|
|
382
|
+
case "qwik":
|
|
383
|
+
case "reactNative":
|
|
384
|
+
case "react":
|
|
385
|
+
case "rsc":
|
|
386
|
+
return e;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
const at = ({
|
|
390
|
+
componentOptions: e,
|
|
391
|
+
builderBlock: t,
|
|
392
|
+
context: n,
|
|
393
|
+
componentRef: o,
|
|
394
|
+
includeBlockProps: i,
|
|
395
|
+
isInteractive: r,
|
|
396
|
+
contextValue: a
|
|
397
|
+
}) => r ? {
|
|
398
|
+
Wrapper: o,
|
|
399
|
+
block: t,
|
|
400
|
+
context: n,
|
|
401
|
+
wrapperProps: e
|
|
402
|
+
} : {
|
|
403
|
+
...e,
|
|
404
|
+
/**
|
|
405
|
+
* If `noWrap` is set to `true`, then the block's props/attributes are provided to the
|
|
406
|
+
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
407
|
+
*/
|
|
408
|
+
...i ? {
|
|
409
|
+
attributes: it({
|
|
410
|
+
block: t,
|
|
411
|
+
context: a
|
|
412
|
+
})
|
|
413
|
+
} : {}
|
|
414
|
+
};
|
|
415
|
+
function z(e) {
|
|
416
|
+
var n, o;
|
|
417
|
+
const t = e.isInteractive ? Te : e.componentRef;
|
|
418
|
+
return /* @__PURE__ */ l(x, { children: e.componentRef ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ w(
|
|
419
|
+
t,
|
|
420
|
+
{
|
|
421
|
+
...at({
|
|
422
|
+
componentOptions: e.componentOptions,
|
|
423
|
+
builderBlock: e.builderBlock,
|
|
424
|
+
context: e.context,
|
|
425
|
+
componentRef: e.componentRef,
|
|
426
|
+
includeBlockProps: e.includeBlockProps,
|
|
427
|
+
isInteractive: e.isInteractive,
|
|
428
|
+
contextValue: e.context
|
|
429
|
+
}),
|
|
430
|
+
children: [
|
|
431
|
+
(n = e.blockChildren) == null ? void 0 : n.map((i) => /* @__PURE__ */ l(
|
|
432
|
+
A,
|
|
433
|
+
{
|
|
434
|
+
block: i,
|
|
435
|
+
context: e.context,
|
|
436
|
+
registeredComponents: e.registeredComponents
|
|
437
|
+
},
|
|
438
|
+
"block-" + i.id
|
|
439
|
+
)),
|
|
440
|
+
(o = e.blockChildren) == null ? void 0 : o.map((i) => /* @__PURE__ */ l(
|
|
441
|
+
O,
|
|
442
|
+
{
|
|
443
|
+
block: i,
|
|
444
|
+
context: e.context
|
|
445
|
+
},
|
|
446
|
+
"block-style-" + i.id
|
|
447
|
+
))
|
|
448
|
+
]
|
|
449
|
+
}
|
|
450
|
+
) }) : null });
|
|
451
|
+
}
|
|
452
|
+
function A(e) {
|
|
453
|
+
var u, f, g, p;
|
|
454
|
+
const t = function() {
|
|
455
|
+
return Ye({
|
|
456
|
+
block: e.block,
|
|
457
|
+
context: e.context,
|
|
458
|
+
registeredComponents: e.registeredComponents
|
|
459
|
+
});
|
|
460
|
+
}, n = function() {
|
|
461
|
+
return Xe({
|
|
462
|
+
block: e.block,
|
|
463
|
+
context: e.context
|
|
464
|
+
});
|
|
465
|
+
}, o = function() {
|
|
466
|
+
return n() ? e.block : re({
|
|
467
|
+
block: e.block,
|
|
468
|
+
localState: e.context.localState,
|
|
469
|
+
rootState: e.context.rootState,
|
|
470
|
+
rootSetState: e.context.rootSetState,
|
|
471
|
+
context: e.context.context,
|
|
472
|
+
shouldEvaluateBindings: !0
|
|
473
|
+
});
|
|
474
|
+
}, i = function() {
|
|
475
|
+
return e.block.tagName || "div";
|
|
476
|
+
}, r = function() {
|
|
477
|
+
return "hide" in o() ? !o().hide : "show" in o() ? o().show : !0;
|
|
478
|
+
}, a = function() {
|
|
479
|
+
var d;
|
|
480
|
+
return !((d = t()) != null && d.component) && !n() ? o().children ?? [] : [];
|
|
481
|
+
}, c = function() {
|
|
482
|
+
var h, d, b, v, y;
|
|
483
|
+
return {
|
|
484
|
+
blockChildren: o().children ?? [],
|
|
485
|
+
componentRef: (h = t()) == null ? void 0 : h.component,
|
|
486
|
+
componentOptions: {
|
|
487
|
+
...Ge(o()),
|
|
488
|
+
builderContext: e.context,
|
|
489
|
+
...((d = t()) == null ? void 0 : d.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" ? {
|
|
490
|
+
builderComponents: e.registeredComponents
|
|
491
|
+
} : {}
|
|
492
|
+
},
|
|
493
|
+
context: s,
|
|
494
|
+
registeredComponents: e.registeredComponents,
|
|
495
|
+
builderBlock: o(),
|
|
496
|
+
includeBlockProps: ((v = t()) == null ? void 0 : v.noWrap) === !0,
|
|
497
|
+
isInteractive: !((y = t()) != null && y.isRSC)
|
|
498
|
+
};
|
|
499
|
+
}, s = e.context;
|
|
500
|
+
return /* @__PURE__ */ l(x, { children: r() ? /* @__PURE__ */ l(x, { children: (u = t()) != null && u.noWrap ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(z, { ...c() }) }) : /* @__PURE__ */ w(x, { children: [
|
|
501
|
+
V(i()) ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(
|
|
502
|
+
D,
|
|
503
|
+
{
|
|
504
|
+
Wrapper: i(),
|
|
505
|
+
block: o(),
|
|
506
|
+
context: e.context,
|
|
507
|
+
hasChildren: !1
|
|
508
|
+
}
|
|
509
|
+
) }) : null,
|
|
510
|
+
!V(i()) && n() ? /* @__PURE__ */ l(x, { children: (f = n()) == null ? void 0 : f.map((m, h) => /* @__PURE__ */ l(
|
|
511
|
+
Qe,
|
|
512
|
+
{
|
|
513
|
+
repeatContext: m.context,
|
|
514
|
+
block: m.block,
|
|
515
|
+
registeredComponents: e.registeredComponents
|
|
516
|
+
},
|
|
517
|
+
h
|
|
518
|
+
)) }) : null,
|
|
519
|
+
!V(i()) && !n() ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ w(
|
|
520
|
+
D,
|
|
521
|
+
{
|
|
522
|
+
Wrapper: i(),
|
|
523
|
+
block: o(),
|
|
524
|
+
context: e.context,
|
|
525
|
+
hasChildren: !0,
|
|
526
|
+
children: [
|
|
527
|
+
/* @__PURE__ */ l(z, { ...c() }),
|
|
528
|
+
(g = a()) == null ? void 0 : g.map((m) => /* @__PURE__ */ l(
|
|
529
|
+
A,
|
|
530
|
+
{
|
|
531
|
+
block: m,
|
|
532
|
+
context: s,
|
|
533
|
+
registeredComponents: e.registeredComponents
|
|
534
|
+
},
|
|
535
|
+
"block-" + m.id
|
|
536
|
+
)),
|
|
537
|
+
(p = a()) == null ? void 0 : p.map((m) => /* @__PURE__ */ l(
|
|
538
|
+
O,
|
|
539
|
+
{
|
|
540
|
+
block: m,
|
|
541
|
+
context: s
|
|
542
|
+
},
|
|
543
|
+
"block-style-" + m.id
|
|
544
|
+
))
|
|
545
|
+
]
|
|
546
|
+
}
|
|
547
|
+
) }) : null
|
|
548
|
+
] }) }) : null });
|
|
549
|
+
}
|
|
550
|
+
function M(e) {
|
|
551
|
+
var t, n;
|
|
552
|
+
return /* @__PURE__ */ w(
|
|
553
|
+
Re,
|
|
554
|
+
{
|
|
555
|
+
blocks: e.blocks,
|
|
556
|
+
parent: e.parent,
|
|
557
|
+
path: e.path,
|
|
558
|
+
styleProp: e.styleProp,
|
|
559
|
+
children: [
|
|
560
|
+
e.blocks ? /* @__PURE__ */ l(x, { children: (t = e.blocks) == null ? void 0 : t.map((o) => /* @__PURE__ */ l(
|
|
561
|
+
A,
|
|
562
|
+
{
|
|
563
|
+
block: o,
|
|
564
|
+
context: e.context,
|
|
565
|
+
registeredComponents: e.registeredComponents
|
|
566
|
+
},
|
|
567
|
+
"render-block-" + o.id
|
|
568
|
+
)) }) : null,
|
|
569
|
+
e.blocks ? /* @__PURE__ */ l(x, { children: (n = e.blocks) == null ? void 0 : n.map((o) => /* @__PURE__ */ l(
|
|
570
|
+
O,
|
|
571
|
+
{
|
|
572
|
+
block: o,
|
|
573
|
+
context: e.context
|
|
574
|
+
},
|
|
575
|
+
"block-style-" + o.id
|
|
576
|
+
)) }) : null
|
|
577
|
+
]
|
|
578
|
+
}
|
|
579
|
+
);
|
|
580
|
+
}
|
|
581
|
+
function st(e) {
|
|
582
|
+
var m;
|
|
583
|
+
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", i = function(d) {
|
|
584
|
+
var b;
|
|
585
|
+
return ((b = n[d]) == null ? void 0 : b.width) || 100 / n.length;
|
|
586
|
+
}, r = function(d) {
|
|
587
|
+
const b = t * (n.length - 1) / n.length;
|
|
588
|
+
return `calc(${i(d)}% - ${b}px)`;
|
|
589
|
+
}, a = function({
|
|
590
|
+
stackedStyle: d,
|
|
591
|
+
desktopStyle: b
|
|
592
|
+
}) {
|
|
593
|
+
return o === "tablet" ? d : b;
|
|
594
|
+
}, c = function({
|
|
595
|
+
stackedStyle: d,
|
|
596
|
+
desktopStyle: b
|
|
597
|
+
}) {
|
|
598
|
+
return o === "never" ? b : d;
|
|
599
|
+
}, s = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", u = function() {
|
|
600
|
+
return {
|
|
601
|
+
"--flex-dir": s,
|
|
602
|
+
"--flex-dir-tablet": a({
|
|
603
|
+
stackedStyle: s,
|
|
604
|
+
desktopStyle: "row"
|
|
605
|
+
})
|
|
606
|
+
};
|
|
607
|
+
}, f = function(d) {
|
|
608
|
+
const b = d === 0 ? 0 : t, v = r(d), y = `${b}px`, K = "100%", H = 0;
|
|
609
|
+
return {
|
|
610
|
+
width: v,
|
|
611
|
+
["marginLeft"]: y,
|
|
612
|
+
"--column-width-mobile": c({
|
|
613
|
+
stackedStyle: K,
|
|
614
|
+
desktopStyle: v
|
|
615
|
+
}),
|
|
616
|
+
"--column-margin-left-mobile": c({
|
|
617
|
+
stackedStyle: H,
|
|
618
|
+
desktopStyle: y
|
|
619
|
+
}),
|
|
620
|
+
"--column-width-tablet": a({
|
|
621
|
+
stackedStyle: K,
|
|
622
|
+
desktopStyle: v
|
|
623
|
+
}),
|
|
624
|
+
"--column-margin-left-tablet": a({
|
|
625
|
+
stackedStyle: H,
|
|
626
|
+
desktopStyle: y
|
|
627
|
+
})
|
|
628
|
+
};
|
|
629
|
+
}, g = function(d) {
|
|
630
|
+
var v, y;
|
|
631
|
+
return Ne(
|
|
632
|
+
((y = (v = e.builderContext.content) == null ? void 0 : v.meta) == null ? void 0 : y.breakpoints) || {}
|
|
633
|
+
)[d].max;
|
|
634
|
+
}, p = function() {
|
|
635
|
+
return `
|
|
636
|
+
@media (max-width: ${g("medium")}px) {
|
|
637
|
+
.${e.builderBlock.id}-breakpoints {
|
|
638
|
+
flex-direction: var(--flex-dir-tablet);
|
|
639
|
+
align-items: stretch;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.${e.builderBlock.id}-breakpoints > .builder-column {
|
|
643
|
+
width: var(--column-width-tablet) !important;
|
|
644
|
+
margin-left: var(--column-margin-left-tablet) !important;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
@media (max-width: ${g("small")}px) {
|
|
649
|
+
.${e.builderBlock.id}-breakpoints {
|
|
650
|
+
flex-direction: var(--flex-dir);
|
|
651
|
+
align-items: stretch;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.${e.builderBlock.id}-breakpoints > .builder-column {
|
|
655
|
+
width: var(--column-width-mobile) !important;
|
|
656
|
+
margin-left: var(--column-margin-left-mobile) !important;
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
`;
|
|
660
|
+
};
|
|
661
|
+
return /* @__PURE__ */ w(x, { children: [
|
|
662
|
+
/* @__PURE__ */ w(
|
|
663
|
+
"div",
|
|
664
|
+
{
|
|
665
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-119431c8`,
|
|
666
|
+
style: u(),
|
|
667
|
+
children: [
|
|
668
|
+
/* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(L, { styles: p() }) }),
|
|
669
|
+
(m = e.columns) == null ? void 0 : m.map((h, d) => /* @__PURE__ */ Ie(
|
|
670
|
+
"div",
|
|
671
|
+
{
|
|
672
|
+
className: "builder-column div-119431c8-2",
|
|
673
|
+
style: f(d),
|
|
674
|
+
key: d
|
|
675
|
+
},
|
|
676
|
+
/* @__PURE__ */ l(
|
|
677
|
+
M,
|
|
678
|
+
{
|
|
679
|
+
path: `component.options.columns.${d}.blocks`,
|
|
680
|
+
parent: e.builderBlock.id,
|
|
681
|
+
styleProp: {
|
|
682
|
+
flexGrow: "1"
|
|
683
|
+
},
|
|
684
|
+
context: e.builderContext,
|
|
685
|
+
registeredComponents: e.builderComponents,
|
|
686
|
+
blocks: h.blocks
|
|
687
|
+
}
|
|
688
|
+
)
|
|
689
|
+
))
|
|
690
|
+
]
|
|
691
|
+
}
|
|
692
|
+
),
|
|
693
|
+
/* @__PURE__ */ l("style", { children: `.div-119431c8 {
|
|
694
|
+
display: flex;
|
|
695
|
+
line-height: normal;
|
|
696
|
+
}.div-119431c8-2 {
|
|
697
|
+
display: flex;
|
|
698
|
+
flex-direction: column;
|
|
699
|
+
align-items: stretch;
|
|
700
|
+
}` })
|
|
701
|
+
] });
|
|
702
|
+
}
|
|
703
|
+
function q(e) {
|
|
704
|
+
return e.replace(/http(s)?:/, "");
|
|
705
|
+
}
|
|
706
|
+
function ct(e = "", t, n) {
|
|
707
|
+
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
|
|
708
|
+
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
|
|
709
|
+
}
|
|
710
|
+
function lt(e, t) {
|
|
711
|
+
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
712
|
+
return e;
|
|
713
|
+
if (t === "master")
|
|
714
|
+
return q(e);
|
|
715
|
+
const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
|
|
716
|
+
if (n) {
|
|
717
|
+
const o = e.split(n[0]), i = n[3], r = t.match("x") ? t : `${t}x`;
|
|
718
|
+
return q(`${o[0]}_${r}${i}`);
|
|
719
|
+
}
|
|
720
|
+
return null;
|
|
721
|
+
}
|
|
722
|
+
function Wn(e) {
|
|
723
|
+
if (!e)
|
|
724
|
+
return e;
|
|
725
|
+
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
726
|
+
if (e.match(/builder\.io/)) {
|
|
727
|
+
let n = e;
|
|
728
|
+
const o = Number(e.split("?width=")[1]);
|
|
729
|
+
return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${ct(e, "width", i)} ${i}w`).concat([n]).join(", ");
|
|
730
|
+
}
|
|
731
|
+
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [lt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
|
|
732
|
+
}
|
|
733
|
+
const R = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
|
|
734
|
+
...t,
|
|
735
|
+
testVariationId: t.id,
|
|
736
|
+
id: e == null ? void 0 : e.id
|
|
737
|
+
})), ut = ({
|
|
738
|
+
canTrack: e,
|
|
739
|
+
content: t
|
|
740
|
+
}) => !(!(R(t).length > 0) || !e || S());
|
|
741
|
+
function dt(e, t, n) {
|
|
742
|
+
var a;
|
|
743
|
+
function o() {
|
|
744
|
+
function c(h, d, b) {
|
|
745
|
+
let v = "";
|
|
746
|
+
if (b) {
|
|
747
|
+
const y = /* @__PURE__ */ new Date();
|
|
748
|
+
y.setTime(y.getTime() + b * 24 * 60 * 60 * 1e3), v = "; expires=" + y.toUTCString();
|
|
749
|
+
}
|
|
750
|
+
document.cookie = h + "=" + (d || "") + v + "; path=/; Secure; SameSite=None";
|
|
751
|
+
}
|
|
752
|
+
function s(h) {
|
|
753
|
+
const d = h + "=", b = document.cookie.split(";");
|
|
754
|
+
for (let v = 0; v < b.length; v++) {
|
|
755
|
+
let y = b[v];
|
|
756
|
+
for (; y.charAt(0) === " "; )
|
|
757
|
+
y = y.substring(1, y.length);
|
|
758
|
+
if (y.indexOf(d) === 0)
|
|
759
|
+
return y.substring(d.length, y.length);
|
|
760
|
+
}
|
|
761
|
+
return null;
|
|
762
|
+
}
|
|
763
|
+
const u = `builder.tests.${e}`, f = s(u), g = t.map((h) => h.id).concat(e);
|
|
764
|
+
if (f && g.includes(f))
|
|
765
|
+
return f;
|
|
766
|
+
let p = 0;
|
|
767
|
+
const m = Math.random();
|
|
768
|
+
for (let h = 0; h < t.length; h++) {
|
|
769
|
+
const d = t[h], b = d.testRatio;
|
|
770
|
+
if (p += b, m < p)
|
|
771
|
+
return c(u, d.id), d.id;
|
|
772
|
+
}
|
|
773
|
+
return c(u, e), e;
|
|
774
|
+
}
|
|
775
|
+
const i = o(), r = (a = document.currentScript) == null ? void 0 : a.previousElementSibling;
|
|
776
|
+
if (n) {
|
|
777
|
+
r.remove();
|
|
778
|
+
const c = document.currentScript;
|
|
779
|
+
c == null || c.remove();
|
|
780
|
+
} else {
|
|
781
|
+
const c = t.concat({
|
|
782
|
+
id: e
|
|
783
|
+
}).filter((s) => s.id !== i).map((s) => `.variant-${s.id} { display: none; }
|
|
784
|
+
`).join("");
|
|
785
|
+
r.innerHTML = c;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
function mt(e, t, n) {
|
|
789
|
+
var s;
|
|
790
|
+
if (!navigator.cookieEnabled)
|
|
791
|
+
return;
|
|
792
|
+
function o(u) {
|
|
793
|
+
const f = u + "=", g = document.cookie.split(";");
|
|
794
|
+
for (let p = 0; p < g.length; p++) {
|
|
795
|
+
let m = g[p];
|
|
796
|
+
for (; m.charAt(0) === " "; )
|
|
797
|
+
m = m.substring(1, m.length);
|
|
798
|
+
if (m.indexOf(f) === 0)
|
|
799
|
+
return m.substring(f.length, m.length);
|
|
800
|
+
}
|
|
801
|
+
return null;
|
|
802
|
+
}
|
|
803
|
+
const i = `builder.tests.${t}`, r = o(i), a = (s = document.currentScript) == null ? void 0 : s.parentElement, c = e === t;
|
|
804
|
+
if (r === e) {
|
|
805
|
+
if (c)
|
|
806
|
+
return;
|
|
807
|
+
a == null || a.removeAttribute("hidden"), a == null || a.removeAttribute("aria-hidden");
|
|
808
|
+
} else {
|
|
809
|
+
c && (n ? a == null || a.remove() : (a == null || a.setAttribute("hidden", "true"), a == null || a.setAttribute("aria-hidden", "true")));
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
const ft = (e) => e === "react" || e === "reactNative", se = ft(C), ce = "builderIoAbTest", le = "builderIoRenderContent", ht = () => {
|
|
814
|
+
const e = dt.toString().replace(/\s+/g, " "), t = mt.toString().replace(/\s+/g, " ");
|
|
815
|
+
return `
|
|
816
|
+
window.${ce} = ${e}
|
|
817
|
+
window.${le} = ${t}
|
|
818
|
+
`;
|
|
819
|
+
}, gt = (e, t) => `
|
|
820
|
+
window.${ce}("${t}",${JSON.stringify(e)}, ${se})`, pt = ({
|
|
821
|
+
contentId: e,
|
|
822
|
+
variationId: t
|
|
823
|
+
}) => `
|
|
824
|
+
window.${le}("${t}", "${e}", ${se})`, bt = {
|
|
825
|
+
name: "Core:Button",
|
|
826
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
827
|
+
defaultStyles: {
|
|
828
|
+
// TODO: make min width more intuitive and set one
|
|
829
|
+
appearance: "none",
|
|
830
|
+
paddingTop: "15px",
|
|
831
|
+
paddingBottom: "15px",
|
|
832
|
+
paddingLeft: "25px",
|
|
833
|
+
paddingRight: "25px",
|
|
834
|
+
backgroundColor: "#000000",
|
|
835
|
+
color: "white",
|
|
836
|
+
borderRadius: "4px",
|
|
837
|
+
textAlign: "center",
|
|
838
|
+
cursor: "pointer"
|
|
839
|
+
},
|
|
840
|
+
inputs: [{
|
|
841
|
+
name: "text",
|
|
842
|
+
type: "text",
|
|
843
|
+
defaultValue: "Click me!",
|
|
844
|
+
bubble: !0
|
|
845
|
+
}, {
|
|
846
|
+
name: "link",
|
|
847
|
+
type: "url",
|
|
848
|
+
bubble: !0
|
|
849
|
+
}, {
|
|
850
|
+
name: "openLinkInNewTab",
|
|
851
|
+
type: "boolean",
|
|
852
|
+
defaultValue: !1,
|
|
853
|
+
friendlyName: "Open link in new tab"
|
|
854
|
+
}],
|
|
855
|
+
static: !0,
|
|
856
|
+
noWrap: !0
|
|
857
|
+
}, yt = {
|
|
858
|
+
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
859
|
+
name: "Columns",
|
|
860
|
+
isRSC: !0,
|
|
861
|
+
inputs: [{
|
|
862
|
+
name: "columns",
|
|
863
|
+
type: "array",
|
|
864
|
+
broadcast: !0,
|
|
865
|
+
subFields: [{
|
|
866
|
+
name: "blocks",
|
|
867
|
+
type: "array",
|
|
868
|
+
hideFromUI: !0,
|
|
869
|
+
defaultValue: [{
|
|
870
|
+
"@type": "@builder.io/sdk:Element",
|
|
871
|
+
responsiveStyles: {
|
|
872
|
+
large: {
|
|
873
|
+
display: "flex",
|
|
874
|
+
flexDirection: "column",
|
|
875
|
+
alignItems: "stretch",
|
|
876
|
+
flexShrink: "0",
|
|
877
|
+
position: "relative",
|
|
878
|
+
marginTop: "30px",
|
|
879
|
+
textAlign: "center",
|
|
880
|
+
lineHeight: "normal",
|
|
881
|
+
height: "auto",
|
|
882
|
+
minHeight: "20px",
|
|
883
|
+
minWidth: "20px",
|
|
884
|
+
overflow: "hidden"
|
|
885
|
+
}
|
|
886
|
+
},
|
|
887
|
+
component: {
|
|
888
|
+
name: "Image",
|
|
889
|
+
options: {
|
|
890
|
+
image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
891
|
+
backgroundPosition: "center",
|
|
892
|
+
backgroundSize: "cover",
|
|
893
|
+
aspectRatio: 0.7004048582995948
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}, {
|
|
897
|
+
"@type": "@builder.io/sdk:Element",
|
|
898
|
+
responsiveStyles: {
|
|
899
|
+
large: {
|
|
900
|
+
display: "flex",
|
|
901
|
+
flexDirection: "column",
|
|
902
|
+
alignItems: "stretch",
|
|
903
|
+
flexShrink: "0",
|
|
904
|
+
position: "relative",
|
|
905
|
+
marginTop: "30px",
|
|
906
|
+
textAlign: "center",
|
|
907
|
+
lineHeight: "normal",
|
|
908
|
+
height: "auto"
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
component: {
|
|
912
|
+
name: "Text",
|
|
913
|
+
options: {
|
|
914
|
+
text: "<p>Enter some text...</p>"
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}]
|
|
918
|
+
}, {
|
|
919
|
+
name: "width",
|
|
920
|
+
type: "number",
|
|
921
|
+
hideFromUI: !0,
|
|
922
|
+
helperText: "Width %, e.g. set to 50 to fill half of the space"
|
|
923
|
+
}, {
|
|
924
|
+
name: "link",
|
|
925
|
+
type: "url",
|
|
926
|
+
helperText: "Optionally set a url that clicking this column will link to"
|
|
927
|
+
}],
|
|
928
|
+
defaultValue: [{
|
|
929
|
+
blocks: [{
|
|
930
|
+
"@type": "@builder.io/sdk:Element",
|
|
931
|
+
responsiveStyles: {
|
|
932
|
+
large: {
|
|
933
|
+
display: "flex",
|
|
934
|
+
flexDirection: "column",
|
|
935
|
+
alignItems: "stretch",
|
|
936
|
+
flexShrink: "0",
|
|
937
|
+
position: "relative",
|
|
938
|
+
marginTop: "30px",
|
|
939
|
+
textAlign: "center",
|
|
940
|
+
lineHeight: "normal",
|
|
941
|
+
height: "auto",
|
|
942
|
+
minHeight: "20px",
|
|
943
|
+
minWidth: "20px",
|
|
944
|
+
overflow: "hidden"
|
|
945
|
+
}
|
|
946
|
+
},
|
|
947
|
+
component: {
|
|
948
|
+
name: "Image",
|
|
949
|
+
options: {
|
|
950
|
+
image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
951
|
+
backgroundPosition: "center",
|
|
952
|
+
backgroundSize: "cover",
|
|
953
|
+
aspectRatio: 0.7004048582995948
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
}, {
|
|
957
|
+
"@type": "@builder.io/sdk:Element",
|
|
958
|
+
responsiveStyles: {
|
|
959
|
+
large: {
|
|
960
|
+
display: "flex",
|
|
961
|
+
flexDirection: "column",
|
|
962
|
+
alignItems: "stretch",
|
|
963
|
+
flexShrink: "0",
|
|
964
|
+
position: "relative",
|
|
965
|
+
marginTop: "30px",
|
|
966
|
+
textAlign: "center",
|
|
967
|
+
lineHeight: "normal",
|
|
968
|
+
height: "auto"
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
component: {
|
|
972
|
+
name: "Text",
|
|
973
|
+
options: {
|
|
974
|
+
text: "<p>Enter some text...</p>"
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}]
|
|
978
|
+
}, {
|
|
979
|
+
blocks: [{
|
|
980
|
+
"@type": "@builder.io/sdk:Element",
|
|
981
|
+
responsiveStyles: {
|
|
982
|
+
large: {
|
|
983
|
+
display: "flex",
|
|
984
|
+
flexDirection: "column",
|
|
985
|
+
alignItems: "stretch",
|
|
986
|
+
flexShrink: "0",
|
|
987
|
+
position: "relative",
|
|
988
|
+
marginTop: "30px",
|
|
989
|
+
textAlign: "center",
|
|
990
|
+
lineHeight: "normal",
|
|
991
|
+
height: "auto",
|
|
992
|
+
minHeight: "20px",
|
|
993
|
+
minWidth: "20px",
|
|
994
|
+
overflow: "hidden"
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
component: {
|
|
998
|
+
name: "Image",
|
|
999
|
+
options: {
|
|
1000
|
+
image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
|
|
1001
|
+
backgroundPosition: "center",
|
|
1002
|
+
backgroundSize: "cover",
|
|
1003
|
+
aspectRatio: 0.7004048582995948
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}, {
|
|
1007
|
+
"@type": "@builder.io/sdk:Element",
|
|
1008
|
+
responsiveStyles: {
|
|
1009
|
+
large: {
|
|
1010
|
+
display: "flex",
|
|
1011
|
+
flexDirection: "column",
|
|
1012
|
+
alignItems: "stretch",
|
|
1013
|
+
flexShrink: "0",
|
|
1014
|
+
position: "relative",
|
|
1015
|
+
marginTop: "30px",
|
|
1016
|
+
textAlign: "center",
|
|
1017
|
+
lineHeight: "normal",
|
|
1018
|
+
height: "auto"
|
|
1019
|
+
}
|
|
1020
|
+
},
|
|
1021
|
+
component: {
|
|
1022
|
+
name: "Text",
|
|
1023
|
+
options: {
|
|
1024
|
+
text: "<p>Enter some text...</p>"
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
}]
|
|
1028
|
+
}],
|
|
1029
|
+
onChange: (e) => {
|
|
1030
|
+
function t() {
|
|
1031
|
+
n.forEach((o) => {
|
|
1032
|
+
o.delete("width");
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
const n = e.get("columns");
|
|
1036
|
+
Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((c, s) => c + s.get("width"), 0) !== 100) && t();
|
|
1037
|
+
}
|
|
1038
|
+
}, {
|
|
1039
|
+
name: "space",
|
|
1040
|
+
type: "number",
|
|
1041
|
+
defaultValue: 20,
|
|
1042
|
+
helperText: "Size of gap between columns",
|
|
1043
|
+
advanced: !0
|
|
1044
|
+
}, {
|
|
1045
|
+
name: "stackColumnsAt",
|
|
1046
|
+
type: "string",
|
|
1047
|
+
defaultValue: "tablet",
|
|
1048
|
+
helperText: "Convert horizontal columns to vertical at what device size",
|
|
1049
|
+
enum: ["tablet", "mobile", "never"],
|
|
1050
|
+
advanced: !0
|
|
1051
|
+
}, {
|
|
1052
|
+
name: "reverseColumnsWhenStacked",
|
|
1053
|
+
type: "boolean",
|
|
1054
|
+
defaultValue: !1,
|
|
1055
|
+
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
1056
|
+
advanced: !0
|
|
1057
|
+
}]
|
|
1058
|
+
}, xt = {
|
|
1059
|
+
name: "Fragment",
|
|
1060
|
+
static: !0,
|
|
1061
|
+
hidden: !0,
|
|
1062
|
+
canHaveChildren: !0,
|
|
1063
|
+
noWrap: !0
|
|
1064
|
+
}, vt = {
|
|
1065
|
+
name: "Image",
|
|
1066
|
+
static: !0,
|
|
1067
|
+
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",
|
|
1068
|
+
defaultStyles: {
|
|
1069
|
+
position: "relative",
|
|
1070
|
+
minHeight: "20px",
|
|
1071
|
+
minWidth: "20px",
|
|
1072
|
+
overflow: "hidden"
|
|
1073
|
+
},
|
|
1074
|
+
canHaveChildren: !0,
|
|
1075
|
+
inputs: [{
|
|
1076
|
+
name: "image",
|
|
1077
|
+
type: "file",
|
|
1078
|
+
bubble: !0,
|
|
1079
|
+
allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
|
|
1080
|
+
required: !0,
|
|
1081
|
+
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
1082
|
+
onChange: (e) => {
|
|
1083
|
+
e.delete("srcset"), e.delete("noWebp");
|
|
1084
|
+
function n(a, c = 6e4) {
|
|
1085
|
+
return new Promise((s, u) => {
|
|
1086
|
+
const f = document.createElement("img");
|
|
1087
|
+
let g = !1;
|
|
1088
|
+
f.onload = () => {
|
|
1089
|
+
g = !0, s(f);
|
|
1090
|
+
}, f.addEventListener("error", (p) => {
|
|
1091
|
+
console.warn("Image load failed", p.error), u(p.error);
|
|
1092
|
+
}), f.src = a, setTimeout(() => {
|
|
1093
|
+
g || u(new Error("Image load timed out"));
|
|
1094
|
+
}, c);
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
function o(a) {
|
|
1098
|
+
return Math.round(a * 1e3) / 1e3;
|
|
1099
|
+
}
|
|
1100
|
+
const i = e.get("image"), r = e.get("aspectRatio");
|
|
1101
|
+
if (fetch(i).then((a) => a.blob()).then((a) => {
|
|
1102
|
+
a.type.includes("svg") && e.set("noWebp", !0);
|
|
1103
|
+
}), i && (!r || r === 0.7041))
|
|
1104
|
+
return n(i).then((a) => {
|
|
1105
|
+
const c = e.get("aspectRatio");
|
|
1106
|
+
e.get("image") === i && (!c || c === 0.7041) && a.width && a.height && (e.set("aspectRatio", o(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
}, {
|
|
1110
|
+
name: "backgroundSize",
|
|
1111
|
+
type: "text",
|
|
1112
|
+
defaultValue: "cover",
|
|
1113
|
+
enum: [{
|
|
1114
|
+
label: "contain",
|
|
1115
|
+
value: "contain",
|
|
1116
|
+
helperText: "The image should never get cropped"
|
|
1117
|
+
}, {
|
|
1118
|
+
label: "cover",
|
|
1119
|
+
value: "cover",
|
|
1120
|
+
helperText: "The image should fill it's box, cropping when needed"
|
|
1121
|
+
}]
|
|
1122
|
+
}, {
|
|
1123
|
+
name: "backgroundPosition",
|
|
1124
|
+
type: "text",
|
|
1125
|
+
defaultValue: "center",
|
|
1126
|
+
enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
|
|
1127
|
+
}, {
|
|
1128
|
+
name: "altText",
|
|
1129
|
+
type: "string",
|
|
1130
|
+
helperText: "Text to display when the user has images off"
|
|
1131
|
+
}, {
|
|
1132
|
+
name: "height",
|
|
1133
|
+
type: "number",
|
|
1134
|
+
hideFromUI: !0
|
|
1135
|
+
}, {
|
|
1136
|
+
name: "width",
|
|
1137
|
+
type: "number",
|
|
1138
|
+
hideFromUI: !0
|
|
1139
|
+
}, {
|
|
1140
|
+
name: "sizes",
|
|
1141
|
+
type: "string",
|
|
1142
|
+
hideFromUI: !0
|
|
1143
|
+
}, {
|
|
1144
|
+
name: "srcset",
|
|
1145
|
+
type: "string",
|
|
1146
|
+
hideFromUI: !0
|
|
1147
|
+
}, {
|
|
1148
|
+
name: "lazy",
|
|
1149
|
+
type: "boolean",
|
|
1150
|
+
defaultValue: !0,
|
|
1151
|
+
hideFromUI: !0
|
|
1152
|
+
}, {
|
|
1153
|
+
name: "fitContent",
|
|
1154
|
+
type: "boolean",
|
|
1155
|
+
helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
|
|
1156
|
+
defaultValue: !0
|
|
1157
|
+
}, {
|
|
1158
|
+
name: "aspectRatio",
|
|
1159
|
+
type: "number",
|
|
1160
|
+
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",
|
|
1161
|
+
advanced: !0,
|
|
1162
|
+
defaultValue: 0.7041
|
|
1163
|
+
}]
|
|
1164
|
+
}, St = {
|
|
1165
|
+
name: "Core:Section",
|
|
1166
|
+
static: !0,
|
|
1167
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
1168
|
+
inputs: [{
|
|
1169
|
+
name: "maxWidth",
|
|
1170
|
+
type: "number",
|
|
1171
|
+
defaultValue: 1200
|
|
1172
|
+
}, {
|
|
1173
|
+
name: "lazyLoad",
|
|
1174
|
+
type: "boolean",
|
|
1175
|
+
defaultValue: !1,
|
|
1176
|
+
advanced: !0,
|
|
1177
|
+
description: "Only render this section when in view"
|
|
1178
|
+
}],
|
|
1179
|
+
defaultStyles: {
|
|
1180
|
+
paddingLeft: "20px",
|
|
1181
|
+
paddingRight: "20px",
|
|
1182
|
+
paddingTop: "50px",
|
|
1183
|
+
paddingBottom: "50px",
|
|
1184
|
+
marginTop: "0px",
|
|
1185
|
+
width: "100vw",
|
|
1186
|
+
marginLeft: "calc(50% - 50vw)"
|
|
1187
|
+
},
|
|
1188
|
+
canHaveChildren: !0,
|
|
1189
|
+
defaultChildren: [{
|
|
1190
|
+
"@type": "@builder.io/sdk:Element",
|
|
1191
|
+
responsiveStyles: {
|
|
1192
|
+
large: {
|
|
1193
|
+
textAlign: "center"
|
|
1194
|
+
}
|
|
1195
|
+
},
|
|
1196
|
+
component: {
|
|
1197
|
+
name: "Text",
|
|
1198
|
+
options: {
|
|
1199
|
+
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>"
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
}]
|
|
1203
|
+
}, kt = {
|
|
1204
|
+
name: "Symbol",
|
|
1205
|
+
noWrap: !0,
|
|
1206
|
+
static: !0,
|
|
1207
|
+
isRSC: !0,
|
|
1208
|
+
inputs: [{
|
|
1209
|
+
name: "symbol",
|
|
1210
|
+
type: "uiSymbol"
|
|
1211
|
+
}, {
|
|
1212
|
+
name: "dataOnly",
|
|
1213
|
+
helperText: "Make this a data symbol that doesn't display any UI",
|
|
1214
|
+
type: "boolean",
|
|
1215
|
+
defaultValue: !1,
|
|
1216
|
+
advanced: !0,
|
|
1217
|
+
hideFromUI: !0
|
|
1218
|
+
}, {
|
|
1219
|
+
name: "inheritState",
|
|
1220
|
+
helperText: "Inherit the parent component state and data",
|
|
1221
|
+
type: "boolean",
|
|
1222
|
+
defaultValue: !1,
|
|
1223
|
+
advanced: !0
|
|
1224
|
+
}, {
|
|
1225
|
+
name: "renderToLiquid",
|
|
1226
|
+
helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
|
|
1227
|
+
type: "boolean",
|
|
1228
|
+
defaultValue: !1,
|
|
1229
|
+
advanced: !0,
|
|
1230
|
+
hideFromUI: !0
|
|
1231
|
+
}, {
|
|
1232
|
+
name: "useChildren",
|
|
1233
|
+
hideFromUI: !0,
|
|
1234
|
+
type: "boolean"
|
|
1235
|
+
}]
|
|
1236
|
+
}, wt = {
|
|
1237
|
+
name: "Text",
|
|
1238
|
+
static: !0,
|
|
1239
|
+
isRSC: !0,
|
|
1240
|
+
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",
|
|
1241
|
+
inputs: [{
|
|
1242
|
+
name: "text",
|
|
1243
|
+
type: "html",
|
|
1244
|
+
required: !0,
|
|
1245
|
+
autoFocus: !0,
|
|
1246
|
+
bubble: !0,
|
|
1247
|
+
defaultValue: "Enter some text..."
|
|
1248
|
+
}],
|
|
1249
|
+
defaultStyles: {
|
|
1250
|
+
lineHeight: "normal",
|
|
1251
|
+
height: "auto",
|
|
1252
|
+
textAlign: "center"
|
|
1253
|
+
}
|
|
1254
|
+
};
|
|
1255
|
+
function Ct(e) {
|
|
1256
|
+
var t;
|
|
1257
|
+
return /* @__PURE__ */ l(
|
|
1258
|
+
"span",
|
|
1259
|
+
{
|
|
1260
|
+
className: "builder-text",
|
|
1261
|
+
dangerouslySetInnerHTML: { __html: ((t = e.text) == null ? void 0 : t.toString()) || "" },
|
|
1262
|
+
style: {
|
|
1263
|
+
outline: "none"
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
);
|
|
1267
|
+
}
|
|
1268
|
+
const It = {
|
|
1269
|
+
name: "Video",
|
|
1270
|
+
canHaveChildren: !0,
|
|
1271
|
+
defaultStyles: {
|
|
1272
|
+
minHeight: "20px",
|
|
1273
|
+
minWidth: "20px"
|
|
1274
|
+
},
|
|
1275
|
+
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",
|
|
1276
|
+
inputs: [{
|
|
1277
|
+
name: "video",
|
|
1278
|
+
type: "file",
|
|
1279
|
+
allowedFileTypes: ["mp4"],
|
|
1280
|
+
bubble: !0,
|
|
1281
|
+
defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
|
|
1282
|
+
required: !0
|
|
1283
|
+
}, {
|
|
1284
|
+
name: "posterImage",
|
|
1285
|
+
type: "file",
|
|
1286
|
+
allowedFileTypes: ["jpeg", "png"],
|
|
1287
|
+
helperText: "Image to show before the video plays"
|
|
1288
|
+
}, {
|
|
1289
|
+
name: "autoPlay",
|
|
1290
|
+
type: "boolean",
|
|
1291
|
+
defaultValue: !0
|
|
1292
|
+
}, {
|
|
1293
|
+
name: "controls",
|
|
1294
|
+
type: "boolean",
|
|
1295
|
+
defaultValue: !1
|
|
1296
|
+
}, {
|
|
1297
|
+
name: "muted",
|
|
1298
|
+
type: "boolean",
|
|
1299
|
+
defaultValue: !0
|
|
1300
|
+
}, {
|
|
1301
|
+
name: "loop",
|
|
1302
|
+
type: "boolean",
|
|
1303
|
+
defaultValue: !0
|
|
1304
|
+
}, {
|
|
1305
|
+
name: "playsInline",
|
|
1306
|
+
type: "boolean",
|
|
1307
|
+
defaultValue: !0
|
|
1308
|
+
}, {
|
|
1309
|
+
name: "fit",
|
|
1310
|
+
type: "text",
|
|
1311
|
+
defaultValue: "cover",
|
|
1312
|
+
enum: ["contain", "cover", "fill", "auto"]
|
|
1313
|
+
}, {
|
|
1314
|
+
name: "preload",
|
|
1315
|
+
type: "text",
|
|
1316
|
+
defaultValue: "metadata",
|
|
1317
|
+
enum: ["auto", "metadata", "none"]
|
|
1318
|
+
}, {
|
|
1319
|
+
name: "fitContent",
|
|
1320
|
+
type: "boolean",
|
|
1321
|
+
helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
|
|
1322
|
+
defaultValue: !0,
|
|
1323
|
+
advanced: !0
|
|
1324
|
+
}, {
|
|
1325
|
+
name: "position",
|
|
1326
|
+
type: "text",
|
|
1327
|
+
defaultValue: "center",
|
|
1328
|
+
enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
|
|
1329
|
+
}, {
|
|
1330
|
+
name: "height",
|
|
1331
|
+
type: "number",
|
|
1332
|
+
advanced: !0
|
|
1333
|
+
}, {
|
|
1334
|
+
name: "width",
|
|
1335
|
+
type: "number",
|
|
1336
|
+
advanced: !0
|
|
1337
|
+
}, {
|
|
1338
|
+
name: "aspectRatio",
|
|
1339
|
+
type: "number",
|
|
1340
|
+
advanced: !0,
|
|
1341
|
+
defaultValue: 0.7004048582995948
|
|
1342
|
+
}, {
|
|
1343
|
+
name: "lazyLoad",
|
|
1344
|
+
type: "boolean",
|
|
1345
|
+
helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
|
|
1346
|
+
defaultValue: !0,
|
|
1347
|
+
advanced: !0
|
|
1348
|
+
}]
|
|
1349
|
+
}, Tt = {
|
|
1350
|
+
name: "Embed",
|
|
1351
|
+
static: !0,
|
|
1352
|
+
inputs: [{
|
|
1353
|
+
name: "url",
|
|
1354
|
+
type: "url",
|
|
1355
|
+
required: !0,
|
|
1356
|
+
defaultValue: "",
|
|
1357
|
+
helperText: "e.g. enter a youtube url, google map, etc",
|
|
1358
|
+
onChange: (e) => {
|
|
1359
|
+
const t = e.get("url");
|
|
1360
|
+
if (t)
|
|
1361
|
+
return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((o) => o.json()).then((o) => {
|
|
1362
|
+
e.get("url") === t && (o.html ? e.set("content", o.html) : e.set("content", "Invalid url, please try another"));
|
|
1363
|
+
}).catch((o) => {
|
|
1364
|
+
e.set("content", "There was an error embedding this URL, please try again or another URL");
|
|
1365
|
+
});
|
|
1366
|
+
e.delete("content");
|
|
1367
|
+
}
|
|
1368
|
+
}, {
|
|
1369
|
+
name: "content",
|
|
1370
|
+
type: "html",
|
|
1371
|
+
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
1372
|
+
hideFromUI: !0
|
|
1373
|
+
}]
|
|
1374
|
+
}, Rt = ["text/javascript", "application/javascript", "application/ecmascript"], Nn = (e) => Rt.includes(e.type), Et = {
|
|
1375
|
+
// friendlyName?
|
|
1376
|
+
name: "Raw:Img",
|
|
1377
|
+
hideFromInsertMenu: !0,
|
|
1378
|
+
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",
|
|
1379
|
+
inputs: [{
|
|
1380
|
+
name: "image",
|
|
1381
|
+
bubble: !0,
|
|
1382
|
+
type: "file",
|
|
1383
|
+
allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
|
|
1384
|
+
required: !0
|
|
1385
|
+
}],
|
|
1386
|
+
noWrap: !0,
|
|
1387
|
+
static: !0
|
|
1388
|
+
}, At = {
|
|
1389
|
+
name: "Custom Code",
|
|
1390
|
+
static: !0,
|
|
1391
|
+
requiredPermissions: ["editCode"],
|
|
1392
|
+
inputs: [{
|
|
1393
|
+
name: "code",
|
|
1394
|
+
type: "html",
|
|
1395
|
+
required: !0,
|
|
1396
|
+
defaultValue: "<p>Hello there, I am custom HTML code!</p>",
|
|
1397
|
+
code: !0
|
|
1398
|
+
}, {
|
|
1399
|
+
name: "replaceNodes",
|
|
1400
|
+
type: "boolean",
|
|
1401
|
+
helperText: "Preserve server rendered dom nodes",
|
|
1402
|
+
advanced: !0
|
|
1403
|
+
}, {
|
|
1404
|
+
name: "scriptsClientOnly",
|
|
1405
|
+
type: "boolean",
|
|
1406
|
+
defaultValue: !1,
|
|
1407
|
+
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
1408
|
+
advanced: !0
|
|
1409
|
+
}]
|
|
1410
|
+
}, G = () => [{
|
|
1411
|
+
component: Ee,
|
|
1412
|
+
...bt
|
|
1413
|
+
}, {
|
|
1414
|
+
component: st,
|
|
1415
|
+
...yt
|
|
1416
|
+
}, {
|
|
1417
|
+
component: Ae,
|
|
1418
|
+
...At
|
|
1419
|
+
}, {
|
|
1420
|
+
component: Ve,
|
|
1421
|
+
...Tt
|
|
1422
|
+
}, {
|
|
1423
|
+
component: $e,
|
|
1424
|
+
...xt
|
|
1425
|
+
}, {
|
|
1426
|
+
component: Pe,
|
|
1427
|
+
...vt
|
|
1428
|
+
}, {
|
|
1429
|
+
component: Be,
|
|
1430
|
+
...Et
|
|
1431
|
+
}, {
|
|
1432
|
+
component: Fe,
|
|
1433
|
+
...St
|
|
1434
|
+
}, {
|
|
1435
|
+
component: bn,
|
|
1436
|
+
...kt
|
|
1437
|
+
}, {
|
|
1438
|
+
component: Ct,
|
|
1439
|
+
...wt
|
|
1440
|
+
}, {
|
|
1441
|
+
component: Oe,
|
|
1442
|
+
...It
|
|
1443
|
+
}], J = [], Ln = (e) => ({
|
|
1444
|
+
type: "builder.registerComponent",
|
|
1445
|
+
data: $(e)
|
|
1446
|
+
}), Vt = (e) => {
|
|
1447
|
+
const t = e.toString().trim();
|
|
1448
|
+
return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
|
|
1449
|
+
}, $t = (e) => typeof e == "function" ? Vt(e) : E(e), $ = ({
|
|
1450
|
+
inputs: e,
|
|
1451
|
+
...t
|
|
1452
|
+
}) => ({
|
|
1453
|
+
...E(t),
|
|
1454
|
+
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [i, r]) => ({
|
|
1455
|
+
...o,
|
|
1456
|
+
[i]: $t(r)
|
|
1457
|
+
}), {}))
|
|
1458
|
+
}), Pt = (e) => {
|
|
1459
|
+
var r;
|
|
1460
|
+
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);
|
|
1461
|
+
let i = "";
|
|
1462
|
+
if (o && t && n && (i += `
|
|
1463
|
+
@font-face {
|
|
1464
|
+
font-family: "${t}";
|
|
1465
|
+
src: local("${n}"), url('${o}') format('woff2');
|
|
1466
|
+
font-display: fallback;
|
|
1467
|
+
font-weight: 400;
|
|
1468
|
+
}
|
|
1469
|
+
`.trim()), e.files)
|
|
1470
|
+
for (const a in e.files) {
|
|
1471
|
+
if (!(String(Number(a)) === a))
|
|
1472
|
+
continue;
|
|
1473
|
+
const s = e.files[a];
|
|
1474
|
+
s && s !== o && (i += `
|
|
1475
|
+
@font-face {
|
|
1476
|
+
font-family: "${t}";
|
|
1477
|
+
src: url('${s}') format('woff2');
|
|
1478
|
+
font-display: fallback;
|
|
1479
|
+
font-weight: ${a};
|
|
1480
|
+
}
|
|
1481
|
+
`.trim());
|
|
1482
|
+
}
|
|
1483
|
+
return i;
|
|
1484
|
+
}, Bt = ({
|
|
1485
|
+
customFonts: e
|
|
1486
|
+
}) => {
|
|
1487
|
+
var t;
|
|
1488
|
+
return ((t = e == null ? void 0 : e.map((n) => Pt(n))) == null ? void 0 : t.join(" ")) || "";
|
|
1489
|
+
}, Ft = ({
|
|
1490
|
+
cssCode: e,
|
|
1491
|
+
contentId: t
|
|
1492
|
+
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
|
|
1493
|
+
function Ot(e) {
|
|
1494
|
+
const t = `
|
|
1495
|
+
${Ft({
|
|
1496
|
+
cssCode: e.cssCode,
|
|
1497
|
+
contentId: e.contentId
|
|
1498
|
+
})}
|
|
1499
|
+
${Bt({
|
|
1500
|
+
customFonts: e.customFonts
|
|
1501
|
+
})}
|
|
1502
|
+
|
|
1503
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
1504
|
+
margin: 0;
|
|
1505
|
+
}
|
|
1506
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
1507
|
+
color: inherit;
|
|
1508
|
+
line-height: inherit;
|
|
1509
|
+
letter-spacing: inherit;
|
|
1510
|
+
font-weight: inherit;
|
|
1511
|
+
font-size: inherit;
|
|
1512
|
+
text-align: inherit;
|
|
1513
|
+
font-family: inherit;
|
|
1514
|
+
}
|
|
1515
|
+
`.trim();
|
|
1516
|
+
return /* @__PURE__ */ l(L, { styles: t });
|
|
1517
|
+
}
|
|
1518
|
+
const Wt = ({
|
|
1519
|
+
content: e,
|
|
1520
|
+
data: t,
|
|
1521
|
+
locale: n
|
|
1522
|
+
}) => {
|
|
1523
|
+
var r, a, c;
|
|
1524
|
+
const o = {};
|
|
1525
|
+
(a = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || a.forEach((s) => {
|
|
1526
|
+
var u;
|
|
1527
|
+
s.name && s.defaultValue !== void 0 && ((u = e == null ? void 0 : e.data) != null && u.state) && e.data.state[s.name] === void 0 && (o[s.name] = s.defaultValue);
|
|
1528
|
+
});
|
|
1529
|
+
const i = {
|
|
1530
|
+
...(c = e == null ? void 0 : e.data) == null ? void 0 : c.state,
|
|
1531
|
+
...t,
|
|
1532
|
+
...n ? {
|
|
1533
|
+
locale: n
|
|
1534
|
+
} : {}
|
|
1535
|
+
};
|
|
1536
|
+
return {
|
|
1537
|
+
...o,
|
|
1538
|
+
...i
|
|
1539
|
+
};
|
|
1540
|
+
}, Nt = ({
|
|
1541
|
+
content: e,
|
|
1542
|
+
data: t
|
|
1543
|
+
}) => e ? {
|
|
1544
|
+
...e,
|
|
1545
|
+
data: {
|
|
1546
|
+
...e == null ? void 0 : e.data,
|
|
1547
|
+
...t
|
|
1548
|
+
},
|
|
1549
|
+
meta: e == null ? void 0 : e.meta
|
|
1550
|
+
} : void 0;
|
|
1551
|
+
function Lt() {
|
|
1552
|
+
return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
|
|
1553
|
+
}
|
|
1554
|
+
function Mt() {
|
|
1555
|
+
const e = Lt().fetch;
|
|
1556
|
+
if (typeof e > "u")
|
|
1557
|
+
throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
1558
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
|
|
1559
|
+
return e;
|
|
1560
|
+
}
|
|
1561
|
+
const _t = Mt(), Ut = (e) => {
|
|
1562
|
+
if (e === "localhost" || e === "127.0.0.1")
|
|
1563
|
+
return e;
|
|
1564
|
+
const t = e.split(".");
|
|
1565
|
+
return t.length > 2 ? t.slice(1).join(".") : e;
|
|
1566
|
+
}, ue = ({
|
|
1567
|
+
name: e,
|
|
1568
|
+
canTrack: t
|
|
1569
|
+
}) => {
|
|
1570
|
+
var n;
|
|
1571
|
+
try {
|
|
1572
|
+
return t ? (n = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : n.split("=")[1] : void 0;
|
|
1573
|
+
} catch (o) {
|
|
1574
|
+
k.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
|
|
1575
|
+
return;
|
|
1576
|
+
}
|
|
1577
|
+
}, de = async (e) => ue(e), jt = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(I).join("; "), Kt = [["secure", ""], ["SameSite", "None"]], Ht = ({
|
|
1578
|
+
name: e,
|
|
1579
|
+
value: t,
|
|
1580
|
+
expires: n
|
|
1581
|
+
}) => {
|
|
1582
|
+
const i = (S() ? location.protocol === "https:" : !0) ? Kt : [[]], r = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...r, ["path", "/"], ["domain", Ut(window.location.hostname)], ...i];
|
|
1583
|
+
return jt(a);
|
|
1584
|
+
}, me = async ({
|
|
1585
|
+
name: e,
|
|
1586
|
+
value: t,
|
|
1587
|
+
expires: n,
|
|
1588
|
+
canTrack: o
|
|
1589
|
+
}) => {
|
|
1590
|
+
try {
|
|
1591
|
+
if (!o)
|
|
1592
|
+
return;
|
|
1593
|
+
const i = Ht({
|
|
1594
|
+
name: e,
|
|
1595
|
+
value: t,
|
|
1596
|
+
expires: n
|
|
1597
|
+
});
|
|
1598
|
+
document.cookie = i;
|
|
1599
|
+
} catch (i) {
|
|
1600
|
+
k.warn("[COOKIE] SET error: ", (i == null ? void 0 : i.message) || i);
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
function Dt() {
|
|
1604
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
1605
|
+
const t = Math.random() * 16 | 0;
|
|
1606
|
+
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
function fe() {
|
|
1610
|
+
return Dt().replace(/-/g, "");
|
|
1611
|
+
}
|
|
1612
|
+
const he = "builderSessionId", zt = async ({
|
|
1613
|
+
canTrack: e
|
|
1614
|
+
}) => {
|
|
1615
|
+
if (!e)
|
|
1616
|
+
return;
|
|
1617
|
+
const t = await de({
|
|
1618
|
+
name: he,
|
|
1619
|
+
canTrack: e
|
|
1620
|
+
});
|
|
1621
|
+
if (I(t))
|
|
1622
|
+
return t;
|
|
1623
|
+
{
|
|
1624
|
+
const n = qt();
|
|
1625
|
+
return Gt({
|
|
1626
|
+
id: n,
|
|
1627
|
+
canTrack: e
|
|
1628
|
+
}), n;
|
|
1629
|
+
}
|
|
1630
|
+
}, qt = () => fe(), Gt = ({
|
|
1631
|
+
id: e,
|
|
1632
|
+
canTrack: t
|
|
1633
|
+
}) => me({
|
|
1634
|
+
name: he,
|
|
1635
|
+
value: e,
|
|
1636
|
+
canTrack: t
|
|
1637
|
+
}), ge = () => S() && typeof localStorage < "u" ? localStorage : void 0, Jt = ({
|
|
1638
|
+
key: e,
|
|
1639
|
+
canTrack: t
|
|
1640
|
+
}) => {
|
|
1641
|
+
var n;
|
|
1642
|
+
try {
|
|
1643
|
+
return t ? (n = ge()) == null ? void 0 : n.getItem(e) : void 0;
|
|
1644
|
+
} catch (o) {
|
|
1645
|
+
console.debug("[LocalStorage] GET error: ", o);
|
|
1646
|
+
return;
|
|
1647
|
+
}
|
|
1648
|
+
}, Yt = ({
|
|
1649
|
+
key: e,
|
|
1650
|
+
canTrack: t,
|
|
1651
|
+
value: n
|
|
1652
|
+
}) => {
|
|
1653
|
+
var o;
|
|
1654
|
+
try {
|
|
1655
|
+
t && ((o = ge()) == null || o.setItem(e, n));
|
|
1656
|
+
} catch (i) {
|
|
1657
|
+
console.debug("[LocalStorage] SET error: ", i);
|
|
1658
|
+
}
|
|
1659
|
+
}, pe = "builderVisitorId", Xt = ({
|
|
1660
|
+
canTrack: e
|
|
1661
|
+
}) => {
|
|
1662
|
+
if (!e)
|
|
1663
|
+
return;
|
|
1664
|
+
const t = Jt({
|
|
1665
|
+
key: pe,
|
|
1666
|
+
canTrack: e
|
|
1667
|
+
});
|
|
1668
|
+
if (I(t))
|
|
1669
|
+
return t;
|
|
1670
|
+
{
|
|
1671
|
+
const n = Qt();
|
|
1672
|
+
return Zt({
|
|
1673
|
+
id: n,
|
|
1674
|
+
canTrack: e
|
|
1675
|
+
}), n;
|
|
1676
|
+
}
|
|
1677
|
+
}, Qt = () => fe(), Zt = ({
|
|
1678
|
+
id: e,
|
|
1679
|
+
canTrack: t
|
|
1680
|
+
}) => Yt({
|
|
1681
|
+
key: pe,
|
|
1682
|
+
value: e,
|
|
1683
|
+
canTrack: t
|
|
1684
|
+
}), en = async ({
|
|
1685
|
+
canTrack: e
|
|
1686
|
+
}) => {
|
|
1687
|
+
if (!e)
|
|
1688
|
+
return {
|
|
1689
|
+
visitorId: void 0,
|
|
1690
|
+
sessionId: void 0
|
|
1691
|
+
};
|
|
1692
|
+
const t = await zt({
|
|
1693
|
+
canTrack: e
|
|
1694
|
+
}), n = Xt({
|
|
1695
|
+
canTrack: e
|
|
1696
|
+
});
|
|
1697
|
+
return {
|
|
1698
|
+
sessionId: t,
|
|
1699
|
+
visitorId: n
|
|
1700
|
+
};
|
|
1701
|
+
}, tn = async ({
|
|
1702
|
+
type: e,
|
|
1703
|
+
canTrack: t,
|
|
1704
|
+
apiKey: n,
|
|
1705
|
+
metadata: o,
|
|
1706
|
+
...i
|
|
1707
|
+
}) => ({
|
|
1708
|
+
type: e,
|
|
1709
|
+
data: {
|
|
1710
|
+
...i,
|
|
1711
|
+
metadata: {
|
|
1712
|
+
url: location.href,
|
|
1713
|
+
...o
|
|
1714
|
+
},
|
|
1715
|
+
...await en({
|
|
1716
|
+
canTrack: t
|
|
1717
|
+
}),
|
|
1718
|
+
userAttributes: ie(),
|
|
1719
|
+
ownerId: n
|
|
1720
|
+
}
|
|
1721
|
+
});
|
|
1722
|
+
async function nn(e) {
|
|
1723
|
+
if (!e.apiKey) {
|
|
1724
|
+
k.error("Missing API key for track call. Please provide your API key.");
|
|
1725
|
+
return;
|
|
1726
|
+
}
|
|
1727
|
+
if (e.canTrack && !W() && (S() || C === "reactNative"))
|
|
1728
|
+
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
1729
|
+
method: "POST",
|
|
1730
|
+
body: JSON.stringify({
|
|
1731
|
+
events: [await tn(e)]
|
|
1732
|
+
}),
|
|
1733
|
+
headers: {
|
|
1734
|
+
"content-type": "application/json"
|
|
1735
|
+
},
|
|
1736
|
+
mode: "cors"
|
|
1737
|
+
}).catch((t) => {
|
|
1738
|
+
console.error("Failed to track: ", t);
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
const Mn = (e) => nn({
|
|
1742
|
+
...e,
|
|
1743
|
+
canTrack: !0
|
|
1744
|
+
}), on = "0.6.0", Y = {};
|
|
1745
|
+
function rn(e, t) {
|
|
1746
|
+
let n = Y[e];
|
|
1747
|
+
if (n || (n = Y[e] = []), n.push(t), S()) {
|
|
1748
|
+
const o = {
|
|
1749
|
+
type: "builder.register",
|
|
1750
|
+
data: {
|
|
1751
|
+
type: e,
|
|
1752
|
+
info: t
|
|
1753
|
+
}
|
|
1754
|
+
};
|
|
1755
|
+
try {
|
|
1756
|
+
parent.postMessage(o, "*"), parent !== window && window.postMessage(o, "*");
|
|
1757
|
+
} catch (i) {
|
|
1758
|
+
console.debug("Could not postmessage", i);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1762
|
+
const _n = () => {
|
|
1763
|
+
rn("insertMenu", {
|
|
1764
|
+
name: "_default",
|
|
1765
|
+
default: !0,
|
|
1766
|
+
items: [{
|
|
1767
|
+
name: "Box"
|
|
1768
|
+
}, {
|
|
1769
|
+
name: "Text"
|
|
1770
|
+
}, {
|
|
1771
|
+
name: "Image"
|
|
1772
|
+
}, {
|
|
1773
|
+
name: "Columns"
|
|
1774
|
+
}, {
|
|
1775
|
+
name: "Core:Section"
|
|
1776
|
+
}, {
|
|
1777
|
+
name: "Core:Button"
|
|
1778
|
+
}, {
|
|
1779
|
+
name: "Embed"
|
|
1780
|
+
}, {
|
|
1781
|
+
name: "Custom Code"
|
|
1782
|
+
}]
|
|
1783
|
+
});
|
|
1784
|
+
};
|
|
1785
|
+
let X = !1;
|
|
1786
|
+
const Un = (e = {}) => {
|
|
1787
|
+
var t, n;
|
|
1788
|
+
X || (X = !0, S() && ((t = window.parent) == null || t.postMessage({
|
|
1789
|
+
type: "builder.sdkInfo",
|
|
1790
|
+
data: {
|
|
1791
|
+
target: C,
|
|
1792
|
+
version: on,
|
|
1793
|
+
supportsPatchUpdates: !1,
|
|
1794
|
+
// Supports builder-model="..." attribute which is needed to
|
|
1795
|
+
// scope our '+ add block' button styling
|
|
1796
|
+
supportsAddBlockScoping: !0,
|
|
1797
|
+
supportsCustomBreakpoints: !0
|
|
1798
|
+
}
|
|
1799
|
+
}, "*"), (n = window.parent) == null || n.postMessage({
|
|
1800
|
+
type: "builder.updateContent",
|
|
1801
|
+
data: {
|
|
1802
|
+
options: e
|
|
1803
|
+
}
|
|
1804
|
+
}, "*"), window.addEventListener("message", ({
|
|
1805
|
+
data: o
|
|
1806
|
+
}) => {
|
|
1807
|
+
var i, r;
|
|
1808
|
+
if (o != null && o.type)
|
|
1809
|
+
switch (o.type) {
|
|
1810
|
+
case "builder.evaluate": {
|
|
1811
|
+
const a = o.data.text, c = o.data.arguments || [], s = o.data.id, u = new Function(a);
|
|
1812
|
+
let f, g = null;
|
|
1813
|
+
try {
|
|
1814
|
+
f = u.apply(null, c);
|
|
1815
|
+
} catch (p) {
|
|
1816
|
+
g = p;
|
|
1817
|
+
}
|
|
1818
|
+
g ? (i = window.parent) == null || i.postMessage({
|
|
1819
|
+
type: "builder.evaluateError",
|
|
1820
|
+
data: {
|
|
1821
|
+
id: s,
|
|
1822
|
+
error: g.message
|
|
1823
|
+
}
|
|
1824
|
+
}, "*") : f && typeof f.then == "function" ? f.then((p) => {
|
|
1825
|
+
var m;
|
|
1826
|
+
(m = window.parent) == null || m.postMessage({
|
|
1827
|
+
type: "builder.evaluateResult",
|
|
1828
|
+
data: {
|
|
1829
|
+
id: s,
|
|
1830
|
+
result: p
|
|
1831
|
+
}
|
|
1832
|
+
}, "*");
|
|
1833
|
+
}).catch(console.error) : (r = window.parent) == null || r.postMessage({
|
|
1834
|
+
type: "builder.evaluateResult",
|
|
1835
|
+
data: {
|
|
1836
|
+
result: f,
|
|
1837
|
+
id: s
|
|
1838
|
+
}
|
|
1839
|
+
}, "*");
|
|
1840
|
+
break;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
})));
|
|
1844
|
+
};
|
|
1845
|
+
function Q(e) {
|
|
1846
|
+
return Math.round(e * 1e3) / 1e3;
|
|
1847
|
+
}
|
|
1848
|
+
const an = (e, t, n = !0) => {
|
|
1849
|
+
if (!(e instanceof HTMLElement))
|
|
1850
|
+
return null;
|
|
1851
|
+
let o = n ? e : e.parentElement;
|
|
1852
|
+
do {
|
|
1853
|
+
if (!o)
|
|
1854
|
+
return null;
|
|
1855
|
+
if (t(o))
|
|
1856
|
+
return o;
|
|
1857
|
+
} while (o = o.parentElement);
|
|
1858
|
+
return null;
|
|
1859
|
+
}, sn = (e) => an(e, (t) => {
|
|
1860
|
+
const n = t.getAttribute("builder-id") || t.id;
|
|
1861
|
+
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
1862
|
+
}), Z = ({
|
|
1863
|
+
event: e,
|
|
1864
|
+
target: t
|
|
1865
|
+
}) => {
|
|
1866
|
+
const n = t.getBoundingClientRect(), o = e.clientX - n.left, i = e.clientY - n.top, r = Q(o / n.width), a = Q(i / n.height);
|
|
1867
|
+
return {
|
|
1868
|
+
x: r,
|
|
1869
|
+
y: a
|
|
1870
|
+
};
|
|
1871
|
+
}, jn = (e) => {
|
|
1872
|
+
const t = e.target, n = t && sn(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
1873
|
+
return {
|
|
1874
|
+
targetBuilderElement: o || void 0,
|
|
1875
|
+
metadata: {
|
|
1876
|
+
targetOffset: t ? Z({
|
|
1877
|
+
event: e,
|
|
1878
|
+
target: t
|
|
1879
|
+
}) : void 0,
|
|
1880
|
+
builderTargetOffset: n ? Z({
|
|
1881
|
+
event: e,
|
|
1882
|
+
target: n
|
|
1883
|
+
}) : void 0,
|
|
1884
|
+
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
1885
|
+
}
|
|
1886
|
+
};
|
|
1887
|
+
};
|
|
1888
|
+
function cn() {
|
|
1889
|
+
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new Ce({
|
|
1890
|
+
max: 500,
|
|
1891
|
+
// how long to live in ms
|
|
1892
|
+
ttl: 1e3 * 60 * 5
|
|
1893
|
+
}));
|
|
1894
|
+
}
|
|
1895
|
+
function P(e) {
|
|
1896
|
+
return /* @__PURE__ */ l(
|
|
1897
|
+
"script",
|
|
1898
|
+
{
|
|
1899
|
+
dangerouslySetInnerHTML: { __html: e.scriptStr },
|
|
1900
|
+
id: e.id
|
|
1901
|
+
}
|
|
1902
|
+
);
|
|
1903
|
+
}
|
|
1904
|
+
function ee(e) {
|
|
1905
|
+
var i, r, a, c, s, u, f, g, p;
|
|
1906
|
+
const t = pt({
|
|
1907
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
1908
|
+
variationId: (i = e.content) == null ? void 0 : i.testVariationId,
|
|
1909
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
1910
|
+
contentId: (r = e.content) == null ? void 0 : r.id
|
|
1911
|
+
}), n = [
|
|
1912
|
+
...G(),
|
|
1913
|
+
// While this `components` object is deprecated, we must maintain support for it.
|
|
1914
|
+
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
1915
|
+
// existing usage.
|
|
1916
|
+
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
1917
|
+
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
1918
|
+
...J,
|
|
1919
|
+
...e.customComponents || []
|
|
1920
|
+
].reduce(
|
|
1921
|
+
(m, { component: h, ...d }) => ({
|
|
1922
|
+
...m,
|
|
1923
|
+
[d.name]: {
|
|
1924
|
+
component: h,
|
|
1925
|
+
...$(d)
|
|
1926
|
+
}
|
|
1927
|
+
}),
|
|
1928
|
+
{}
|
|
1929
|
+
), o = {
|
|
1930
|
+
content: Nt({
|
|
1931
|
+
content: e.content,
|
|
1932
|
+
data: e.data
|
|
1933
|
+
}),
|
|
1934
|
+
localState: void 0,
|
|
1935
|
+
rootState: Wt({
|
|
1936
|
+
content: e.content,
|
|
1937
|
+
data: e.data,
|
|
1938
|
+
locale: e.locale
|
|
1939
|
+
}),
|
|
1940
|
+
rootSetState: void 0,
|
|
1941
|
+
context: e.context || {},
|
|
1942
|
+
apiKey: e.apiKey,
|
|
1943
|
+
apiVersion: e.apiVersion,
|
|
1944
|
+
componentInfos: [
|
|
1945
|
+
...G(),
|
|
1946
|
+
// While this `components` object is deprecated, we must maintain support for it.
|
|
1947
|
+
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
1948
|
+
// existing usage.
|
|
1949
|
+
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
1950
|
+
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
1951
|
+
...J,
|
|
1952
|
+
...e.customComponents || []
|
|
1953
|
+
].reduce(
|
|
1954
|
+
(m, { component: h, ...d }) => ({
|
|
1955
|
+
...m,
|
|
1956
|
+
[d.name]: $(d)
|
|
1957
|
+
}),
|
|
1958
|
+
{}
|
|
1959
|
+
),
|
|
1960
|
+
inheritedStyles: {}
|
|
1961
|
+
};
|
|
1962
|
+
return /* @__PURE__ */ w(
|
|
1963
|
+
We,
|
|
1964
|
+
{
|
|
1965
|
+
content: e.content,
|
|
1966
|
+
model: e.model,
|
|
1967
|
+
context: e.context,
|
|
1968
|
+
apiKey: e.apiKey,
|
|
1969
|
+
canTrack: e.canTrack,
|
|
1970
|
+
locale: e.locale,
|
|
1971
|
+
includeRefs: e.includeRefs,
|
|
1972
|
+
enrich: e.enrich,
|
|
1973
|
+
classNameProp: e.classNameProp,
|
|
1974
|
+
showContent: e.showContent,
|
|
1975
|
+
builderContextSignal: o,
|
|
1976
|
+
children: [
|
|
1977
|
+
e.isSsrAbTest ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(P, { scriptStr: t }) }) : null,
|
|
1978
|
+
/* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(
|
|
1979
|
+
Ot,
|
|
1980
|
+
{
|
|
1981
|
+
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
1982
|
+
cssCode: (s = (c = o.content) == null ? void 0 : c.data) == null ? void 0 : s.cssCode,
|
|
1983
|
+
customFonts: (f = (u = o.content) == null ? void 0 : u.data) == null ? void 0 : f.customFonts
|
|
1984
|
+
}
|
|
1985
|
+
) }),
|
|
1986
|
+
/* @__PURE__ */ l(
|
|
1987
|
+
M,
|
|
1988
|
+
{
|
|
1989
|
+
blocks: (p = (g = o.content) == null ? void 0 : g.data) == null ? void 0 : p.blocks,
|
|
1990
|
+
context: o,
|
|
1991
|
+
registeredComponents: n
|
|
1992
|
+
}
|
|
1993
|
+
)
|
|
1994
|
+
]
|
|
1995
|
+
}
|
|
1996
|
+
);
|
|
1997
|
+
}
|
|
1998
|
+
const B = (e) => I(e) ? e : !0, ln = "builder.tests", _ = (e) => `${ln}.${e}`, un = ({
|
|
1999
|
+
contentId: e
|
|
2000
|
+
}) => de({
|
|
2001
|
+
name: _(e),
|
|
2002
|
+
canTrack: !0
|
|
2003
|
+
}), dn = ({
|
|
2004
|
+
contentId: e
|
|
2005
|
+
}) => ue({
|
|
2006
|
+
name: _(e),
|
|
2007
|
+
canTrack: !0
|
|
2008
|
+
}), mn = ({
|
|
2009
|
+
contentId: e,
|
|
2010
|
+
value: t
|
|
2011
|
+
}) => me({
|
|
2012
|
+
name: _(e),
|
|
2013
|
+
value: t,
|
|
2014
|
+
canTrack: !0
|
|
2015
|
+
}), be = (e) => I(e.id) && I(e.variations) && Object.keys(e.variations).length > 0, fn = ({
|
|
2016
|
+
id: e,
|
|
2017
|
+
variations: t
|
|
2018
|
+
}) => {
|
|
2019
|
+
var i;
|
|
2020
|
+
let n = 0;
|
|
2021
|
+
const o = Math.random();
|
|
2022
|
+
for (const r in t) {
|
|
2023
|
+
const a = (i = t[r]) == null ? void 0 : i.testRatio;
|
|
2024
|
+
if (n += a, o < n)
|
|
2025
|
+
return r;
|
|
2026
|
+
}
|
|
2027
|
+
return e;
|
|
2028
|
+
}, ye = (e) => {
|
|
2029
|
+
const t = fn(e);
|
|
2030
|
+
return mn({
|
|
2031
|
+
contentId: e.id,
|
|
2032
|
+
value: t
|
|
2033
|
+
}).catch((n) => {
|
|
2034
|
+
k.error("could not store A/B test variation: ", n);
|
|
2035
|
+
}), t;
|
|
2036
|
+
}, xe = ({
|
|
2037
|
+
item: e,
|
|
2038
|
+
testGroupId: t
|
|
2039
|
+
}) => {
|
|
2040
|
+
const n = e.variations[t];
|
|
2041
|
+
return t === e.id || // handle edge-case where `testGroupId` points to non-existing variation
|
|
2042
|
+
!n ? {
|
|
2043
|
+
testVariationId: e.id,
|
|
2044
|
+
testVariationName: "Default"
|
|
2045
|
+
} : {
|
|
2046
|
+
data: n.data,
|
|
2047
|
+
testVariationId: n.id,
|
|
2048
|
+
testVariationName: n.name || (n.id === e.id ? "Default" : "")
|
|
2049
|
+
};
|
|
2050
|
+
}, hn = ({
|
|
2051
|
+
item: e,
|
|
2052
|
+
canTrack: t
|
|
2053
|
+
}) => {
|
|
2054
|
+
if (!t)
|
|
2055
|
+
return e;
|
|
2056
|
+
if (!e)
|
|
2057
|
+
return;
|
|
2058
|
+
if (!be(e))
|
|
2059
|
+
return e;
|
|
2060
|
+
const n = dn({
|
|
2061
|
+
contentId: e.id
|
|
2062
|
+
}) || ye({
|
|
2063
|
+
variations: e.variations,
|
|
2064
|
+
id: e.id
|
|
2065
|
+
}), o = xe({
|
|
2066
|
+
item: e,
|
|
2067
|
+
testGroupId: n
|
|
2068
|
+
});
|
|
2069
|
+
return {
|
|
2070
|
+
...e,
|
|
2071
|
+
...o
|
|
2072
|
+
};
|
|
2073
|
+
}, gn = async ({
|
|
2074
|
+
item: e,
|
|
2075
|
+
canTrack: t
|
|
2076
|
+
}) => {
|
|
2077
|
+
if (!t || !be(e))
|
|
2078
|
+
return e;
|
|
2079
|
+
const o = await un({
|
|
2080
|
+
contentId: e.id
|
|
2081
|
+
}) || ye({
|
|
2082
|
+
variations: e.variations,
|
|
2083
|
+
id: e.id
|
|
2084
|
+
}), i = xe({
|
|
2085
|
+
item: e,
|
|
2086
|
+
testGroupId: o
|
|
2087
|
+
});
|
|
2088
|
+
return {
|
|
2089
|
+
...e,
|
|
2090
|
+
...i
|
|
2091
|
+
};
|
|
2092
|
+
};
|
|
2093
|
+
function ve(e) {
|
|
2094
|
+
var r, a, c;
|
|
2095
|
+
const t = ut({
|
|
2096
|
+
canTrack: B(e.canTrack),
|
|
2097
|
+
content: e.content
|
|
2098
|
+
}), n = function() {
|
|
2099
|
+
var u;
|
|
2100
|
+
return gt(
|
|
2101
|
+
R(e.content).map((f) => ({
|
|
2102
|
+
id: f.testVariationId,
|
|
2103
|
+
testRatio: f.testRatio
|
|
2104
|
+
})),
|
|
2105
|
+
((u = e.content) == null ? void 0 : u.id) || ""
|
|
2106
|
+
);
|
|
2107
|
+
}, o = function() {
|
|
2108
|
+
return R(e.content).map((u) => `.variant-${u.testVariationId} { display: none; } `).join("");
|
|
2109
|
+
}, i = function() {
|
|
2110
|
+
var u;
|
|
2111
|
+
return t ? {
|
|
2112
|
+
...e.content,
|
|
2113
|
+
testVariationId: (u = e.content) == null ? void 0 : u.id
|
|
2114
|
+
} : hn({
|
|
2115
|
+
item: e.content,
|
|
2116
|
+
canTrack: B(e.canTrack)
|
|
2117
|
+
});
|
|
2118
|
+
};
|
|
2119
|
+
return /* @__PURE__ */ w(x, { children: [
|
|
2120
|
+
!e.__isNestedRender && C !== "reactNative" ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(P, { scriptStr: ht() }) }) : null,
|
|
2121
|
+
t ? /* @__PURE__ */ w(x, { children: [
|
|
2122
|
+
/* @__PURE__ */ l(
|
|
2123
|
+
L,
|
|
2124
|
+
{
|
|
2125
|
+
id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
|
|
2126
|
+
styles: o()
|
|
2127
|
+
}
|
|
2128
|
+
),
|
|
2129
|
+
/* @__PURE__ */ l(P, { scriptStr: n() }),
|
|
2130
|
+
(a = R(e.content)) == null ? void 0 : a.map((s) => /* @__PURE__ */ l(
|
|
2131
|
+
ee,
|
|
2132
|
+
{
|
|
2133
|
+
content: s,
|
|
2134
|
+
showContent: !1,
|
|
2135
|
+
classNameProp: void 0,
|
|
2136
|
+
model: e.model,
|
|
2137
|
+
data: e.data,
|
|
2138
|
+
context: e.context,
|
|
2139
|
+
apiKey: e.apiKey,
|
|
2140
|
+
apiVersion: e.apiVersion,
|
|
2141
|
+
customComponents: e.customComponents,
|
|
2142
|
+
canTrack: e.canTrack,
|
|
2143
|
+
locale: e.locale,
|
|
2144
|
+
includeRefs: e.includeRefs,
|
|
2145
|
+
enrich: e.enrich,
|
|
2146
|
+
isSsrAbTest: t
|
|
2147
|
+
},
|
|
2148
|
+
s.testVariationId
|
|
2149
|
+
))
|
|
2150
|
+
] }) : null,
|
|
2151
|
+
/* @__PURE__ */ l(
|
|
2152
|
+
ee,
|
|
2153
|
+
{
|
|
2154
|
+
content: i(),
|
|
2155
|
+
classNameProp: `variant-${(c = e.content) == null ? void 0 : c.id}`,
|
|
2156
|
+
showContent: !0,
|
|
2157
|
+
model: e.model,
|
|
2158
|
+
data: e.data,
|
|
2159
|
+
context: e.context,
|
|
2160
|
+
apiKey: e.apiKey,
|
|
2161
|
+
apiVersion: e.apiVersion,
|
|
2162
|
+
customComponents: e.customComponents,
|
|
2163
|
+
canTrack: e.canTrack,
|
|
2164
|
+
locale: e.locale,
|
|
2165
|
+
includeRefs: e.includeRefs,
|
|
2166
|
+
enrich: e.enrich,
|
|
2167
|
+
isSsrAbTest: t
|
|
2168
|
+
}
|
|
2169
|
+
)
|
|
2170
|
+
] });
|
|
2171
|
+
}
|
|
2172
|
+
const pn = async ({
|
|
2173
|
+
builderContextValue: e,
|
|
2174
|
+
symbol: t
|
|
2175
|
+
}) => {
|
|
2176
|
+
if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
2177
|
+
(e != null && e.apiKey))
|
|
2178
|
+
return j({
|
|
2179
|
+
model: t.model,
|
|
2180
|
+
apiKey: e.apiKey,
|
|
2181
|
+
apiVersion: e.apiVersion,
|
|
2182
|
+
...(t == null ? void 0 : t.entry) && {
|
|
2183
|
+
query: {
|
|
2184
|
+
id: t.entry
|
|
2185
|
+
}
|
|
2186
|
+
}
|
|
2187
|
+
}).catch((n) => {
|
|
2188
|
+
k.error("Could not fetch symbol content: ", n);
|
|
2189
|
+
});
|
|
2190
|
+
};
|
|
2191
|
+
async function bn(e) {
|
|
2192
|
+
var o, i, r, a;
|
|
2193
|
+
const t = function() {
|
|
2194
|
+
var s, u;
|
|
2195
|
+
return [
|
|
2196
|
+
e.attributes.className,
|
|
2197
|
+
"builder-symbol",
|
|
2198
|
+
(s = e.symbol) != null && s.inline ? "builder-inline-symbol" : void 0,
|
|
2199
|
+
(u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2200
|
+
].filter(Boolean).join(" ");
|
|
2201
|
+
}, n = ((o = e.symbol) == null ? void 0 : o.content) || await pn({
|
|
2202
|
+
symbol: e.symbol,
|
|
2203
|
+
builderContextValue: e.builderContext
|
|
2204
|
+
});
|
|
2205
|
+
return /* @__PURE__ */ l("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ l(
|
|
2206
|
+
ve,
|
|
2207
|
+
{
|
|
2208
|
+
__isNestedRender: !0,
|
|
2209
|
+
apiVersion: e.builderContext.apiVersion,
|
|
2210
|
+
apiKey: e.builderContext.apiKey,
|
|
2211
|
+
context: e.builderContext.context,
|
|
2212
|
+
customComponents: Object.values(e.builderComponents),
|
|
2213
|
+
data: {
|
|
2214
|
+
...(i = e.symbol) == null ? void 0 : i.data,
|
|
2215
|
+
...e.builderContext.localState,
|
|
2216
|
+
...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
|
|
2217
|
+
},
|
|
2218
|
+
model: (a = e.symbol) == null ? void 0 : a.model,
|
|
2219
|
+
content: n
|
|
2220
|
+
}
|
|
2221
|
+
) });
|
|
2222
|
+
}
|
|
2223
|
+
const Kn = M, Hn = ve;
|
|
2224
|
+
function Dn() {
|
|
2225
|
+
return !S() || W() ? !1 : location.search.indexOf("builder.preview=") !== -1;
|
|
2226
|
+
}
|
|
2227
|
+
const te = {};
|
|
2228
|
+
function zn(e) {
|
|
2229
|
+
if (S()) {
|
|
2230
|
+
Object.assign(te, e);
|
|
2231
|
+
const t = {
|
|
2232
|
+
type: "builder.settingsChange",
|
|
2233
|
+
data: te
|
|
2234
|
+
};
|
|
2235
|
+
parent.postMessage(t, "*");
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
const yn = (e) => {
|
|
2239
|
+
const t = e.get("preview"), n = e.get("overrides." + t);
|
|
2240
|
+
return n || k.warn("No previewed ID found in search params."), n;
|
|
2241
|
+
};
|
|
2242
|
+
function xn(e) {
|
|
2243
|
+
cn();
|
|
2244
|
+
const t = yn(e);
|
|
2245
|
+
return typeof t == "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t) : void 0;
|
|
2246
|
+
}
|
|
2247
|
+
function F(e, t = null, n = ".") {
|
|
2248
|
+
return Object.keys(e).reduce((o, i) => {
|
|
2249
|
+
const r = e[i], a = [t, i].filter(Boolean).join(n);
|
|
2250
|
+
return [typeof r == "object", r !== null, !(Array.isArray(r) && r.length === 0)].every(Boolean) ? {
|
|
2251
|
+
...o,
|
|
2252
|
+
...F(r, a, n)
|
|
2253
|
+
} : {
|
|
2254
|
+
...o,
|
|
2255
|
+
[a]: r
|
|
2256
|
+
};
|
|
2257
|
+
}, {});
|
|
2258
|
+
}
|
|
2259
|
+
const ne = "builder.", vn = "options.", Sn = (e) => {
|
|
2260
|
+
const t = {};
|
|
2261
|
+
return e.forEach((n, o) => {
|
|
2262
|
+
t[o] = n;
|
|
2263
|
+
}), t;
|
|
2264
|
+
}, Se = (e) => {
|
|
2265
|
+
if (!e)
|
|
2266
|
+
return {};
|
|
2267
|
+
const t = ke(e), n = {};
|
|
2268
|
+
return Object.keys(t).forEach((o) => {
|
|
2269
|
+
if (o.startsWith(ne)) {
|
|
2270
|
+
const i = o.replace(ne, "").replace(vn, "");
|
|
2271
|
+
n[i] = t[o];
|
|
2272
|
+
}
|
|
2273
|
+
}), n;
|
|
2274
|
+
}, kn = () => {
|
|
2275
|
+
if (!S())
|
|
2276
|
+
return {};
|
|
2277
|
+
const e = new URLSearchParams(window.location.search);
|
|
2278
|
+
return Se(e);
|
|
2279
|
+
}, ke = (e) => e instanceof URLSearchParams ? Sn(e) : e, wn = "v3", U = (e) => {
|
|
2280
|
+
const {
|
|
2281
|
+
limit: t = 30,
|
|
2282
|
+
userAttributes: n,
|
|
2283
|
+
query: o,
|
|
2284
|
+
noTraverse: i = !1,
|
|
2285
|
+
model: r,
|
|
2286
|
+
apiKey: a,
|
|
2287
|
+
includeRefs: c = !0,
|
|
2288
|
+
enrich: s,
|
|
2289
|
+
locale: u,
|
|
2290
|
+
apiVersion: f = wn
|
|
2291
|
+
} = e;
|
|
2292
|
+
if (!a)
|
|
2293
|
+
throw new Error("Missing API key");
|
|
2294
|
+
if (!["v2", "v3"].includes(f))
|
|
2295
|
+
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);
|
|
2296
|
+
const g = new URL(`https://cdn.builder.io/api/${f}/content/${r}?apiKey=${a}&limit=${t}&noTraverse=${i}&includeRefs=${c}${u ? `&locale=${u}` : ""}${s ? `&enrich=${s}` : ""}`), p = {
|
|
2297
|
+
...kn(),
|
|
2298
|
+
...ke(e.options || {})
|
|
2299
|
+
}, m = F(p);
|
|
2300
|
+
for (const h in m)
|
|
2301
|
+
g.searchParams.set(h, String(m[h]));
|
|
2302
|
+
if (n && g.searchParams.set("userAttributes", JSON.stringify(n)), o) {
|
|
2303
|
+
const h = F({
|
|
2304
|
+
query: o
|
|
2305
|
+
});
|
|
2306
|
+
for (const d in h)
|
|
2307
|
+
g.searchParams.set(d, JSON.stringify(h[d]));
|
|
2308
|
+
}
|
|
2309
|
+
return g;
|
|
2310
|
+
}, Cn = (e) => "results" in e;
|
|
2311
|
+
async function j(e) {
|
|
2312
|
+
const t = await we({
|
|
2313
|
+
...e,
|
|
2314
|
+
limit: 1
|
|
2315
|
+
});
|
|
2316
|
+
return t && t.results[0] || null;
|
|
2317
|
+
}
|
|
2318
|
+
const qn = j, In = async (e) => {
|
|
2319
|
+
const t = U(e);
|
|
2320
|
+
return await (await _t(t.href)).json();
|
|
2321
|
+
}, Tn = async (e, t, n = U(e)) => {
|
|
2322
|
+
const o = B(e.canTrack);
|
|
2323
|
+
if (n.search.includes("preview=")) {
|
|
2324
|
+
const r = [];
|
|
2325
|
+
for (const a of t.results) {
|
|
2326
|
+
const c = xn(n.searchParams);
|
|
2327
|
+
r.push(c || a);
|
|
2328
|
+
}
|
|
2329
|
+
t.results = r;
|
|
2330
|
+
}
|
|
2331
|
+
if (!o || !(S() || C === "reactNative"))
|
|
2332
|
+
return t;
|
|
2333
|
+
try {
|
|
2334
|
+
const r = [];
|
|
2335
|
+
for (const a of t.results)
|
|
2336
|
+
r.push(await gn({
|
|
2337
|
+
item: a,
|
|
2338
|
+
canTrack: o
|
|
2339
|
+
}));
|
|
2340
|
+
t.results = r;
|
|
2341
|
+
} catch (r) {
|
|
2342
|
+
k.error("Could not process A/B tests. ", r);
|
|
2343
|
+
}
|
|
2344
|
+
return t;
|
|
2345
|
+
};
|
|
2346
|
+
async function we(e) {
|
|
2347
|
+
try {
|
|
2348
|
+
const t = U(e), n = await In(e);
|
|
2349
|
+
return Cn(n) ? Tn(e, n) : (k.error("Error fetching data. ", {
|
|
2350
|
+
url: t,
|
|
2351
|
+
content: n,
|
|
2352
|
+
options: e
|
|
2353
|
+
}), null);
|
|
2354
|
+
} catch (t) {
|
|
2355
|
+
return k.error("Error fetching data. ", t), null;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
const Gn = we, Jn = async (e) => {
|
|
2359
|
+
var o, i, r;
|
|
2360
|
+
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((i = e.userAttributes) == null ? void 0 : i.urlPath), n = {
|
|
2361
|
+
...e,
|
|
2362
|
+
apiKey: e.apiKey,
|
|
2363
|
+
model: e.model || "page",
|
|
2364
|
+
userAttributes: {
|
|
2365
|
+
...e.userAttributes,
|
|
2366
|
+
...t ? {
|
|
2367
|
+
urlPath: t
|
|
2368
|
+
} : {}
|
|
2369
|
+
},
|
|
2370
|
+
options: Se(e.searchParams || ((r = e.url) == null ? void 0 : r.searchParams) || e.options)
|
|
2371
|
+
};
|
|
2372
|
+
return {
|
|
2373
|
+
apiKey: n.apiKey,
|
|
2374
|
+
model: n.model,
|
|
2375
|
+
content: await j(n)
|
|
2376
|
+
};
|
|
2377
|
+
};
|
|
2378
|
+
export {
|
|
2379
|
+
j as A,
|
|
2380
|
+
M as B,
|
|
2381
|
+
ve as C,
|
|
2382
|
+
Gn as D,
|
|
2383
|
+
qn as E,
|
|
2384
|
+
Tn as F,
|
|
2385
|
+
Se as G,
|
|
2386
|
+
Mn as H,
|
|
2387
|
+
L as I,
|
|
2388
|
+
Jn as J,
|
|
2389
|
+
Kn as R,
|
|
2390
|
+
bn as S,
|
|
2391
|
+
Ct as T,
|
|
2392
|
+
nn as _,
|
|
2393
|
+
Ne as a,
|
|
2394
|
+
Fn as b,
|
|
2395
|
+
I as c,
|
|
2396
|
+
Bn as d,
|
|
2397
|
+
it as e,
|
|
2398
|
+
On as f,
|
|
2399
|
+
re as g,
|
|
2400
|
+
Wn as h,
|
|
2401
|
+
W as i,
|
|
2402
|
+
Nn as j,
|
|
2403
|
+
S as k,
|
|
2404
|
+
k as l,
|
|
2405
|
+
Ln as m,
|
|
2406
|
+
N as n,
|
|
2407
|
+
jn as o,
|
|
2408
|
+
E as p,
|
|
2409
|
+
_t as q,
|
|
2410
|
+
_n as r,
|
|
2411
|
+
Un as s,
|
|
2412
|
+
cn as t,
|
|
2413
|
+
Hn as u,
|
|
2414
|
+
st as v,
|
|
2415
|
+
Dn as w,
|
|
2416
|
+
rn as x,
|
|
2417
|
+
zn as y,
|
|
2418
|
+
we as z
|
|
2419
|
+
};
|