@builder.io/sdk-qwik 0.0.6 → 0.0.9

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.
@@ -0,0 +1,2521 @@
1
+ import { createContext, componentQrl, inlinedQrl, useContextProvider, useStore, useStylesScopedQrl, useContext, Host, useLexicalScope, Slot, Fragment as Fragment$2, useRef, useWatchQrl, useHostElement, useClientEffectQrl, _useMutableProps, useCleanupQrl } from "@builder.io/qwik";
2
+ import { jsx, Fragment as Fragment$1, jsxs } from "@builder.io/qwik/jsx-runtime";
3
+ const TARGET = "qwik";
4
+ function isBrowser() {
5
+ return typeof window !== "undefined" && typeof document !== "undefined";
6
+ }
7
+ const registry = {};
8
+ function register(type, info) {
9
+ let typeList = registry[type];
10
+ if (!typeList)
11
+ typeList = registry[type] = [];
12
+ typeList.push(info);
13
+ if (isBrowser()) {
14
+ const message = {
15
+ type: "builder.register",
16
+ data: {
17
+ type,
18
+ info
19
+ }
20
+ };
21
+ try {
22
+ parent.postMessage(message, "*");
23
+ if (parent !== window)
24
+ window.postMessage(message, "*");
25
+ } catch (err) {
26
+ console.debug("Could not postmessage", err);
27
+ }
28
+ }
29
+ }
30
+ const registerInsertMenu = () => {
31
+ register("insertMenu", {
32
+ name: "_default",
33
+ default: true,
34
+ items: [
35
+ {
36
+ name: "Box"
37
+ },
38
+ {
39
+ name: "Text"
40
+ },
41
+ {
42
+ name: "Image"
43
+ },
44
+ {
45
+ name: "Columns"
46
+ },
47
+ ...TARGET === "reactNative" ? [] : [
48
+ {
49
+ name: "Core:Section"
50
+ },
51
+ {
52
+ name: "Core:Button"
53
+ },
54
+ {
55
+ name: "Embed"
56
+ },
57
+ {
58
+ name: "Custom Code"
59
+ }
60
+ ]
61
+ ]
62
+ });
63
+ };
64
+ const setupBrowserForEditing = () => {
65
+ var _a;
66
+ if (isBrowser()) {
67
+ (_a = window.parent) == null || _a.postMessage({
68
+ type: "builder.sdkInfo",
69
+ data: {
70
+ target: TARGET,
71
+ supportsPatchUpdates: false
72
+ }
73
+ }, "*");
74
+ window.addEventListener("message", ({ data }) => {
75
+ var _a2, _b;
76
+ if (data)
77
+ switch (data.type) {
78
+ case "builder.evaluate": {
79
+ const text = data.data.text;
80
+ const args = data.data.arguments || [];
81
+ const id = data.data.id;
82
+ const fn = new Function(text);
83
+ let result;
84
+ let error = null;
85
+ try {
86
+ result = fn.apply(null, args);
87
+ } catch (err) {
88
+ error = err;
89
+ }
90
+ if (error)
91
+ (_a2 = window.parent) == null || _a2.postMessage({
92
+ type: "builder.evaluateError",
93
+ data: {
94
+ id,
95
+ error: error.message
96
+ }
97
+ }, "*");
98
+ else if (result && typeof result.then === "function")
99
+ result.then((finalResult) => {
100
+ var _a3;
101
+ (_a3 = window.parent) == null || _a3.postMessage({
102
+ type: "builder.evaluateResult",
103
+ data: {
104
+ id,
105
+ result: finalResult
106
+ }
107
+ }, "*");
108
+ }).catch(console.error);
109
+ else
110
+ (_b = window.parent) == null || _b.postMessage({
111
+ type: "builder.evaluateResult",
112
+ data: {
113
+ result,
114
+ id
115
+ }
116
+ }, "*");
117
+ break;
118
+ }
119
+ }
120
+ });
121
+ }
122
+ };
123
+ var stdin_default = createContext("Builder");
124
+ function isIframe() {
125
+ return isBrowser() && window.self !== window.top;
126
+ }
127
+ function isEditing() {
128
+ return isIframe() && window.location.search.indexOf("builder.frameEditing=") !== -1;
129
+ }
130
+ const SIZES = {
131
+ small: {
132
+ min: 320,
133
+ default: 321,
134
+ max: 640
135
+ },
136
+ medium: {
137
+ min: 641,
138
+ default: 642,
139
+ max: 991
140
+ },
141
+ large: {
142
+ min: 990,
143
+ default: 991,
144
+ max: 1200
145
+ }
146
+ };
147
+ const getMaxWidthQueryForSize = (size) => `@media (max-width: ${SIZES[size].max}px)`;
148
+ function evaluate({ code, context, state, event }) {
149
+ if (code === "") {
150
+ console.warn("Skipping evaluation of empty code block.");
151
+ return;
152
+ }
153
+ const builder = {
154
+ isEditing: isEditing(),
155
+ isBrowser: isBrowser(),
156
+ isServer: !isBrowser()
157
+ };
158
+ const useReturn = !(code.includes(";") || code.includes(" return ") || code.trim().startsWith("return "));
159
+ const useCode = useReturn ? `return (${code});` : code;
160
+ try {
161
+ return new Function("builder", "Builder", "state", "context", "event", useCode)(builder, builder, state, context, event);
162
+ } catch (e) {
163
+ console.warn("Builder custom code error: ", e);
164
+ }
165
+ }
166
+ const set = (obj, _path, value) => {
167
+ if (Object(obj) !== obj)
168
+ return obj;
169
+ const path = Array.isArray(_path) ? _path : _path.toString().match(/[^.[\]]+/g);
170
+ path.slice(0, -1).reduce(
171
+ (a, c, i) => Object(a[c]) === a[c] ? a[c] : a[c] = Math.abs(Number(path[i + 1])) >> 0 === +path[i + 1] ? [] : {},
172
+ obj
173
+ )[path[path.length - 1]] = value;
174
+ return obj;
175
+ };
176
+ function transformBlock(block) {
177
+ return block;
178
+ }
179
+ var __defProp$7 = Object.defineProperty;
180
+ var __defProps$5 = Object.defineProperties;
181
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
182
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
183
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
184
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
185
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, {
186
+ enumerable: true,
187
+ configurable: true,
188
+ writable: true,
189
+ value
190
+ }) : obj[key] = value;
191
+ var __spreadValues$7 = (a, b) => {
192
+ for (var prop in b || (b = {}))
193
+ if (__hasOwnProp$7.call(b, prop))
194
+ __defNormalProp$7(a, prop, b[prop]);
195
+ if (__getOwnPropSymbols$7) {
196
+ for (var prop of __getOwnPropSymbols$7(b))
197
+ if (__propIsEnum$7.call(b, prop))
198
+ __defNormalProp$7(a, prop, b[prop]);
199
+ }
200
+ return a;
201
+ };
202
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
203
+ const evaluateBindings = ({ block, context, state }) => {
204
+ if (!block.bindings)
205
+ return block;
206
+ const copied = __spreadProps$5(__spreadValues$7({}, block), {
207
+ properties: __spreadValues$7({}, block.properties),
208
+ actions: __spreadValues$7({}, block.actions)
209
+ });
210
+ for (const binding in block.bindings) {
211
+ const expression = block.bindings[binding];
212
+ const value = evaluate({
213
+ code: expression,
214
+ state,
215
+ context
216
+ });
217
+ set(copied, binding, value);
218
+ }
219
+ return copied;
220
+ };
221
+ function getProcessedBlock(options) {
222
+ const { state, context } = options;
223
+ const block = transformBlock(options.block);
224
+ if (evaluateBindings)
225
+ return evaluateBindings({
226
+ block,
227
+ state,
228
+ context
229
+ });
230
+ else
231
+ return block;
232
+ }
233
+ const camelToKebabCase = (string) => string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
234
+ const convertStyleMaptoCSS = (style) => {
235
+ const cssProps = Object.entries(style).map(([key, value]) => {
236
+ if (typeof value === "string")
237
+ return `${camelToKebabCase(key)}: ${value};`;
238
+ });
239
+ return cssProps.join("\n");
240
+ };
241
+ const RenderInlinedStyles = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
242
+ const state = {};
243
+ return /* @__PURE__ */ jsx(Fragment$1, {
244
+ children: /* @__PURE__ */ jsx(state.tagName, {
245
+ children: props.styles
246
+ })
247
+ });
248
+ }, "RenderInlinedStyles_component_0sD5UmyM3Rg"));
249
+ const RenderInlinedStyles$1 = RenderInlinedStyles;
250
+ const useBlock$1 = function useBlock(props, state) {
251
+ return getProcessedBlock({
252
+ block: props.block,
253
+ state: props.context.state,
254
+ context: props.context.context,
255
+ evaluateBindings: true
256
+ });
257
+ };
258
+ const css = function css2(props, state) {
259
+ const styles = useBlock$1(props).responsiveStyles;
260
+ const largeStyles = styles?.large;
261
+ const mediumStyles = styles?.medium;
262
+ const smallStyles = styles?.small;
263
+ return `
264
+ ${largeStyles ? `.${useBlock$1(props).id} {${convertStyleMaptoCSS(largeStyles)}}` : ""}
265
+ ${mediumStyles ? `${getMaxWidthQueryForSize("medium")} {
266
+ .${useBlock$1(props).id} {${convertStyleMaptoCSS(mediumStyles)}}
267
+ }` : ""}
268
+ ${smallStyles ? `${getMaxWidthQueryForSize("small")} {
269
+ .${useBlock$1(props).id} {${convertStyleMaptoCSS(smallStyles)}}
270
+ }` : ""}
271
+ }`;
272
+ };
273
+ const BlockStyles = (props) => {
274
+ return /* @__PURE__ */ jsx(Fragment$1, {
275
+ children: TARGET === "vue2" || TARGET === "vue3" || TARGET === "svelte" ? /* @__PURE__ */ jsx(RenderInlinedStyles$1, {
276
+ styles: css(props)
277
+ }) : null
278
+ });
279
+ };
280
+ const BlockStyles$1 = BlockStyles;
281
+ function capitalizeFirstLetter(string) {
282
+ return string.charAt(0).toUpperCase() + string.slice(1);
283
+ }
284
+ const getEventHandlerName = (key) => `on${capitalizeFirstLetter(key)}`;
285
+ function getBlockActions(options) {
286
+ var _a;
287
+ const obj = {};
288
+ const optionActions = (_a = options.block.actions) != null ? _a : {};
289
+ for (const key in optionActions) {
290
+ if (!optionActions.hasOwnProperty(key))
291
+ continue;
292
+ const value = optionActions[key];
293
+ obj[getEventHandlerName(key)] = (event) => evaluate({
294
+ code: value,
295
+ context: options.context,
296
+ state: options.state,
297
+ event
298
+ });
299
+ }
300
+ return obj;
301
+ }
302
+ var __defProp$6 = Object.defineProperty;
303
+ var __defProps$4 = Object.defineProperties;
304
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
305
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
306
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
307
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
308
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, {
309
+ enumerable: true,
310
+ configurable: true,
311
+ writable: true,
312
+ value
313
+ }) : obj[key] = value;
314
+ var __spreadValues$6 = (a, b) => {
315
+ for (var prop in b || (b = {}))
316
+ if (__hasOwnProp$6.call(b, prop))
317
+ __defNormalProp$6(a, prop, b[prop]);
318
+ if (__getOwnPropSymbols$6) {
319
+ for (var prop of __getOwnPropSymbols$6(b))
320
+ if (__propIsEnum$6.call(b, prop))
321
+ __defNormalProp$6(a, prop, b[prop]);
322
+ }
323
+ return a;
324
+ };
325
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
326
+ function getBlockComponentOptions(block) {
327
+ var _a;
328
+ return __spreadProps$4(__spreadValues$6(__spreadValues$6({}, (_a = block.component) == null ? void 0 : _a.options), block.options), {
329
+ builderBlock: block
330
+ });
331
+ }
332
+ var __defProp$5 = Object.defineProperty;
333
+ var __defProps$3 = Object.defineProperties;
334
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
335
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
336
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
337
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
338
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, {
339
+ enumerable: true,
340
+ configurable: true,
341
+ writable: true,
342
+ value
343
+ }) : obj[key] = value;
344
+ var __spreadValues$5 = (a, b) => {
345
+ for (var prop in b || (b = {}))
346
+ if (__hasOwnProp$5.call(b, prop))
347
+ __defNormalProp$5(a, prop, b[prop]);
348
+ if (__getOwnPropSymbols$5) {
349
+ for (var prop of __getOwnPropSymbols$5(b))
350
+ if (__propIsEnum$5.call(b, prop))
351
+ __defNormalProp$5(a, prop, b[prop]);
352
+ }
353
+ return a;
354
+ };
355
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
356
+ function getBlockProperties(block) {
357
+ var _a;
358
+ return __spreadProps$3(__spreadValues$5({}, block.properties), {
359
+ "builder-id": block.id,
360
+ class: [
361
+ block.id,
362
+ "builder-block",
363
+ block.class,
364
+ (_a = block.properties) == null ? void 0 : _a.class
365
+ ].filter(Boolean).join(" ")
366
+ });
367
+ }
368
+ const convertStyleObject = (obj) => {
369
+ return obj;
370
+ };
371
+ const sanitizeBlockStyles = (_styles) => {
372
+ };
373
+ var __defProp$4 = Object.defineProperty;
374
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
375
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
376
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
377
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, {
378
+ enumerable: true,
379
+ configurable: true,
380
+ writable: true,
381
+ value
382
+ }) : obj[key] = value;
383
+ var __spreadValues$4 = (a, b) => {
384
+ for (var prop in b || (b = {}))
385
+ if (__hasOwnProp$4.call(b, prop))
386
+ __defNormalProp$4(a, prop, b[prop]);
387
+ if (__getOwnPropSymbols$4) {
388
+ for (var prop of __getOwnPropSymbols$4(b))
389
+ if (__propIsEnum$4.call(b, prop))
390
+ __defNormalProp$4(a, prop, b[prop]);
391
+ }
392
+ return a;
393
+ };
394
+ function getBlockStyles(block) {
395
+ var _a, _b, _c, _d, _e;
396
+ const styles = __spreadValues$4(__spreadValues$4({}, convertStyleObject((_a = block.responsiveStyles) == null ? void 0 : _a.large)), block.styles);
397
+ if ((_b = block.responsiveStyles) == null ? void 0 : _b.medium)
398
+ styles[getMaxWidthQueryForSize("medium")] = convertStyleObject((_c = block.responsiveStyles) == null ? void 0 : _c.medium);
399
+ if ((_d = block.responsiveStyles) == null ? void 0 : _d.small)
400
+ styles[getMaxWidthQueryForSize("small")] = convertStyleObject((_e = block.responsiveStyles) == null ? void 0 : _e.small);
401
+ sanitizeBlockStyles();
402
+ return styles;
403
+ }
404
+ function getBlockTag(block) {
405
+ return block.tagName || "div";
406
+ }
407
+ const EMPTY_HTML_ELEMENTS = [
408
+ "area",
409
+ "base",
410
+ "br",
411
+ "col",
412
+ "embed",
413
+ "hr",
414
+ "img",
415
+ "input",
416
+ "keygen",
417
+ "link",
418
+ "meta",
419
+ "param",
420
+ "source",
421
+ "track",
422
+ "wbr"
423
+ ];
424
+ const isEmptyHtmlElement = (tagName3) => {
425
+ return typeof tagName3 === "string" && EMPTY_HTML_ELEMENTS.includes(tagName3.toLowerCase());
426
+ };
427
+ const RenderComponent = (props) => {
428
+ return /* @__PURE__ */ jsx(Fragment$1, {
429
+ children: props.componentRef ? /* @__PURE__ */ jsxs(props.componentRef, {
430
+ ...props.componentOptions,
431
+ children: [
432
+ (props.blockChildren || []).map((child) => {
433
+ return /* @__PURE__ */ jsx(RenderBlock$1, {
434
+ block: child,
435
+ context: props.context
436
+ }, "render-block-" + child.id);
437
+ }),
438
+ (props.blockChildren || []).map((child) => {
439
+ return /* @__PURE__ */ jsx(BlockStyles$1, {
440
+ block: child,
441
+ context: props.context
442
+ }, "block-style-" + child.id);
443
+ })
444
+ ]
445
+ }) : null
446
+ });
447
+ };
448
+ const RenderComponent$1 = RenderComponent;
449
+ const RenderRepeatedBlock = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
450
+ useContextProvider(stdin_default, useStore({
451
+ content: (() => {
452
+ return props.repeatContext.content;
453
+ })(),
454
+ state: (() => {
455
+ return props.repeatContext.state;
456
+ })(),
457
+ context: (() => {
458
+ return props.repeatContext.context;
459
+ })(),
460
+ apiKey: (() => {
461
+ return props.repeatContext.apiKey;
462
+ })(),
463
+ registeredComponents: (() => {
464
+ return props.repeatContext.registeredComponents;
465
+ })()
466
+ }));
467
+ return /* @__PURE__ */ jsx(RenderBlock$1, {
468
+ block: props.block,
469
+ context: props.context
470
+ });
471
+ }, "RenderRepeatedBlock_component_fV0PdmPN990"));
472
+ const RenderRepeatedBlock$1 = RenderRepeatedBlock;
473
+ const component = function component2(props, state) {
474
+ const componentName = getProcessedBlock({
475
+ block: props.block,
476
+ state: props.context.state,
477
+ context: props.context.context,
478
+ evaluateBindings: false
479
+ }).component?.name;
480
+ if (!componentName)
481
+ return null;
482
+ const ref = props.context.registeredComponents[componentName];
483
+ if (!ref) {
484
+ console.warn(`
485
+ Could not find a registered component named "${componentName}".
486
+ If you registered it, is the file that registered it imported by the file that needs to render it?`);
487
+ return void 0;
488
+ } else
489
+ return ref;
490
+ };
491
+ const componentInfo$9 = function componentInfo(props, state) {
492
+ if (component(props)) {
493
+ const { component: _, ...info } = component(props);
494
+ return info;
495
+ } else
496
+ return void 0;
497
+ };
498
+ const componentRef = function componentRef2(props, state) {
499
+ return component(props)?.component;
500
+ };
501
+ const tagName = function tagName2(props, state) {
502
+ return getBlockTag(useBlock2(props));
503
+ };
504
+ const useBlock2 = function useBlock3(props, state) {
505
+ return repeatItemData(props) ? props.block : getProcessedBlock({
506
+ block: props.block,
507
+ state: props.context.state,
508
+ context: props.context.context,
509
+ evaluateBindings: true
510
+ });
511
+ };
512
+ const attributes = function attributes2(props, state) {
513
+ return {
514
+ ...getBlockProperties(useBlock2(props)),
515
+ ...getBlockActions({
516
+ block: useBlock2(props),
517
+ state: props.context.state,
518
+ context: props.context.context
519
+ }),
520
+ style: getBlockStyles(useBlock2(props))
521
+ };
522
+ };
523
+ const shouldWrap = function shouldWrap2(props, state) {
524
+ return !componentInfo$9(props)?.noWrap;
525
+ };
526
+ const componentOptions = function componentOptions2(props, state) {
527
+ return {
528
+ ...getBlockComponentOptions(useBlock2(props)),
529
+ ...shouldWrap(props) ? {} : {
530
+ attributes: attributes(props)
531
+ }
532
+ };
533
+ };
534
+ const renderComponentProps = function renderComponentProps2(props, state) {
535
+ return {
536
+ blockChildren: children(props),
537
+ componentRef: componentRef(props),
538
+ componentOptions: componentOptions(props)
539
+ };
540
+ };
541
+ const children = function children2(props, state) {
542
+ return useBlock2(props).children ?? [];
543
+ };
544
+ const childrenWithoutParentComponent = function childrenWithoutParentComponent2(props, state) {
545
+ const shouldRenderChildrenOutsideRef = !componentRef(props) && !repeatItemData(props);
546
+ return shouldRenderChildrenOutsideRef ? children(props) : [];
547
+ };
548
+ const repeatItemData = function repeatItemData2(props, state) {
549
+ const { repeat, ...blockWithoutRepeat } = props.block;
550
+ if (!repeat?.collection)
551
+ return void 0;
552
+ const itemsArray = evaluate({
553
+ code: repeat.collection,
554
+ state: props.context.state,
555
+ context: props.context.context
556
+ });
557
+ if (!Array.isArray(itemsArray))
558
+ return void 0;
559
+ const collectionName = repeat.collection.split(".").pop();
560
+ const itemNameToUse = repeat.itemName || (collectionName ? collectionName + "Item" : "item");
561
+ const repeatArray = itemsArray.map(
562
+ (item, index) => ({
563
+ context: {
564
+ ...props.context,
565
+ state: {
566
+ ...props.context.state,
567
+ $index: index,
568
+ $item: item,
569
+ [itemNameToUse]: item,
570
+ [`$${itemNameToUse}Index`]: index
571
+ }
572
+ },
573
+ block: blockWithoutRepeat
574
+ })
575
+ );
576
+ return repeatArray;
577
+ };
578
+ const RenderBlock = (props) => {
579
+ const state = {};
580
+ state.tagName = tagName(props);
581
+ return /* @__PURE__ */ jsx(Fragment$1, {
582
+ children: shouldWrap(props) ? !isEmptyHtmlElement(tagName(props)) ? /* @__PURE__ */ jsxs(state.tagName, {
583
+ ...attributes(props),
584
+ children: [
585
+ repeatItemData(props) ? (repeatItemData(props) || []).map((data, index) => {
586
+ return /* @__PURE__ */ jsx(RenderRepeatedBlock$1, {
587
+ repeatContext: data.context,
588
+ block: data.block
589
+ }, index);
590
+ }) : null,
591
+ !repeatItemData(props) ? /* @__PURE__ */ jsx(RenderComponent$1, {
592
+ ...renderComponentProps(props)
593
+ }) : null,
594
+ (childrenWithoutParentComponent(props) || []).map((child) => {
595
+ return /* @__PURE__ */ jsx(RenderBlock, {
596
+ block: child,
597
+ context: props.context
598
+ }, "render-block-" + child.id);
599
+ }),
600
+ (childrenWithoutParentComponent(props) || []).map((child) => {
601
+ return /* @__PURE__ */ jsx(BlockStyles$1, {
602
+ block: child,
603
+ context: props.context
604
+ }, "block-style-" + child.id);
605
+ })
606
+ ]
607
+ }) : /* @__PURE__ */ jsx(state.tagName, {
608
+ ...attributes(props)
609
+ }) : /* @__PURE__ */ jsx(RenderComponent$1, {
610
+ ...renderComponentProps(props),
611
+ context: props.context
612
+ })
613
+ });
614
+ };
615
+ const RenderBlock$1 = RenderBlock;
616
+ const className = function className2(props, state, builderContext) {
617
+ return "builder-blocks" + (!props.blocks?.length ? " no-blocks" : "");
618
+ };
619
+ const onClick$1 = function onClick(props, state, builderContext) {
620
+ if (isEditing() && !props.blocks?.length)
621
+ window.parent?.postMessage({
622
+ type: "builder.clickEmptyBlocks",
623
+ data: {
624
+ parentElementId: props.parent,
625
+ dataPath: props.path
626
+ }
627
+ }, "*");
628
+ };
629
+ const onMouseEnter = function onMouseEnter2(props, state, builderContext) {
630
+ if (isEditing() && !props.blocks?.length)
631
+ window.parent?.postMessage({
632
+ type: "builder.hoverEmptyBlocks",
633
+ data: {
634
+ parentElementId: props.parent,
635
+ dataPath: props.path
636
+ }
637
+ }, "*");
638
+ };
639
+ const RenderBlocks = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
640
+ useStylesScopedQrl(inlinedQrl(STYLES$2, "RenderBlocks_component_useStylesScoped_QNti2s7juQc"));
641
+ const builderContext = useContext(stdin_default);
642
+ const state = {};
643
+ return /* @__PURE__ */ jsx(Host, {
644
+ class: className(props) + " div-RenderBlocks",
645
+ "builder-path": props.path,
646
+ "builder-parent-id": props.parent,
647
+ dataSet: {
648
+ class: className(props)
649
+ },
650
+ onClick$: inlinedQrl((event) => {
651
+ const [builderContext2, props2, state2] = useLexicalScope();
652
+ return onClick$1(props2);
653
+ }, "RenderBlocks_component_Host_onClick_81ErKSpyspw", [
654
+ builderContext,
655
+ props,
656
+ state
657
+ ]),
658
+ onMouseEnter$: inlinedQrl((event) => {
659
+ const [builderContext2, props2, state2] = useLexicalScope();
660
+ return onMouseEnter(props2);
661
+ }, "RenderBlocks_component_Host_onMouseEnter_h6rWG6KLkHE", [
662
+ builderContext,
663
+ props,
664
+ state
665
+ ]),
666
+ children: /* @__PURE__ */ jsxs(Fragment$1, {
667
+ children: [
668
+ props.blocks ? (props.blocks || []).map((block) => {
669
+ return /* @__PURE__ */ jsx(RenderBlock$1, {
670
+ block,
671
+ context: builderContext
672
+ }, "render-block-" + block.id);
673
+ }) : null,
674
+ props.blocks ? (props.blocks || []).map((block) => {
675
+ return /* @__PURE__ */ jsx(BlockStyles$1, {
676
+ block,
677
+ context: builderContext
678
+ }, "block-style-" + block.id);
679
+ }) : null
680
+ ]
681
+ })
682
+ });
683
+ }, "RenderBlocks_component_SXGwmVyEM0s"), {
684
+ tagName: "div"
685
+ });
686
+ const RenderBlocks$1 = RenderBlocks;
687
+ const STYLES$2 = `.div-RenderBlocks {
688
+ display: flex;
689
+ flex-direction: column;
690
+ align-items: stretch; }`;
691
+ const getGutterSize = function getGutterSize2(props, state) {
692
+ return typeof props.space === "number" ? props.space || 0 : 20;
693
+ };
694
+ const getColumns = function getColumns2(props, state) {
695
+ return props.columns || [];
696
+ };
697
+ const getWidth = function getWidth2(props, state, index) {
698
+ const columns = getColumns(props);
699
+ return columns[index]?.width || 100 / columns.length;
700
+ };
701
+ const getColumnCssWidth = function getColumnCssWidth2(props, state, index) {
702
+ const columns = getColumns(props);
703
+ const gutterSize = getGutterSize(props);
704
+ const subtractWidth = gutterSize * (columns.length - 1) / columns.length;
705
+ return `calc(${getWidth(props, state, index)}% - ${subtractWidth}px)`;
706
+ };
707
+ const maybeApplyForTablet = function maybeApplyForTablet2(props, state, prop) {
708
+ const _stackColumnsAt = props.stackColumnsAt || "tablet";
709
+ return _stackColumnsAt === "tablet" ? prop : "inherit";
710
+ };
711
+ const columnsCssVars = function columnsCssVars2(props, state) {
712
+ const flexDir = props.stackColumnsAt === "never" ? "inherit" : props.reverseColumnsWhenStacked ? "column-reverse" : "column";
713
+ return {
714
+ "--flex-dir": flexDir,
715
+ "--flex-dir-tablet": maybeApplyForTablet(props, state, flexDir)
716
+ };
717
+ };
718
+ const columnCssVars = function columnCssVars2(props, state) {
719
+ const width = "100%";
720
+ const marginLeft = "0";
721
+ return {
722
+ "--column-width": width,
723
+ "--column-margin-left": marginLeft,
724
+ "--column-width-tablet": maybeApplyForTablet(props, state, width),
725
+ "--column-margin-left-tablet": maybeApplyForTablet(props, state, marginLeft)
726
+ };
727
+ };
728
+ const Columns = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
729
+ useStylesScopedQrl(inlinedQrl(STYLES$1, "Columns_component_useStylesScoped_704fWXyHORo"));
730
+ const state = {};
731
+ return /* @__PURE__ */ jsx(Host, {
732
+ class: "builder-columns div-Columns",
733
+ style: columnsCssVars(props, state),
734
+ children: (props.columns || []).map((column, index) => {
735
+ return /* @__PURE__ */ jsx("div", {
736
+ class: "builder-column div-Columns-2",
737
+ style: {
738
+ width: getColumnCssWidth(props, state, index),
739
+ marginLeft: `${index === 0 ? 0 : getGutterSize(props)}px`,
740
+ ...columnCssVars(props, state)
741
+ },
742
+ children: /* @__PURE__ */ jsx(RenderBlocks$1, {
743
+ blocks: column.blocks
744
+ })
745
+ }, index);
746
+ })
747
+ });
748
+ }, "Columns_component_0PeVQGTMczc"), {
749
+ tagName: "div"
750
+ });
751
+ const Columns$1 = Columns;
752
+ const STYLES$1 = `.div-Columns {
753
+ display: flex;
754
+ align-items: stretch;
755
+ line-height: normal; }@media (max-width: 999px) { .div-Columns {
756
+ flex-direction: var(--flex-dir-tablet); } }@media (max-width: 639px) { .div-Columns {
757
+ flex-direction: var(--flex-dir); } }.div-Columns-2 {
758
+ flex-grow: 1; }@media (max-width: 999px) { .div-Columns-2 {
759
+ width: var(--column-width-tablet) !important;
760
+ margin-left: var(--column-margin-left-tablet) !important; } }@media (max-width: 639px) { .div-Columns-2 {
761
+ width: var(--column-width) !important;
762
+ margin-left: var(--column-margin-left) !important; } }`;
763
+ function removeProtocol(path) {
764
+ return path.replace(/http(s)?:/, "");
765
+ }
766
+ function updateQueryParam(uri = "", key, value) {
767
+ const re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
768
+ const separator = uri.indexOf("?") !== -1 ? "&" : "?";
769
+ if (uri.match(re))
770
+ return uri.replace(re, "$1" + key + "=" + encodeURIComponent(value) + "$2");
771
+ return uri + separator + key + "=" + encodeURIComponent(value);
772
+ }
773
+ function getShopifyImageUrl(src, size) {
774
+ if (!src || !(src == null ? void 0 : src.match(/cdn\.shopify\.com/)) || !size)
775
+ return src;
776
+ if (size === "master")
777
+ return removeProtocol(src);
778
+ const match = src.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
779
+ if (match) {
780
+ const prefix = src.split(match[0]);
781
+ const suffix = match[3];
782
+ const useSize = size.match("x") ? size : `${size}x`;
783
+ return removeProtocol(`${prefix[0]}_${useSize}${suffix}`);
784
+ }
785
+ return null;
786
+ }
787
+ function getSrcSet(url) {
788
+ if (!url)
789
+ return url;
790
+ const sizes = [
791
+ 100,
792
+ 200,
793
+ 400,
794
+ 800,
795
+ 1200,
796
+ 1600,
797
+ 2e3
798
+ ];
799
+ if (url.match(/builder\.io/)) {
800
+ let srcUrl = url;
801
+ const widthInSrc = Number(url.split("?width=")[1]);
802
+ if (!isNaN(widthInSrc))
803
+ srcUrl = `${srcUrl} ${widthInSrc}w`;
804
+ return sizes.filter(
805
+ (size) => size !== widthInSrc
806
+ ).map(
807
+ (size) => `${updateQueryParam(url, "width", size)} ${size}w`
808
+ ).concat([
809
+ srcUrl
810
+ ]).join(", ");
811
+ }
812
+ if (url.match(/cdn\.shopify\.com/))
813
+ return sizes.map(
814
+ (size) => [
815
+ getShopifyImageUrl(url, `${size}x${size}`),
816
+ size
817
+ ]
818
+ ).filter(
819
+ ([sizeUrl]) => !!sizeUrl
820
+ ).map(
821
+ ([sizeUrl, size]) => `${sizeUrl} ${size}w`
822
+ ).concat([
823
+ url
824
+ ]).join(", ");
825
+ return url;
826
+ }
827
+ const srcSetToUse = function srcSetToUse2(props, state) {
828
+ const imageToUse = props.image || props.src;
829
+ const url = imageToUse;
830
+ if (!url || !(url.match(/builder\.io/) || url.match(/cdn\.shopify\.com/)))
831
+ return props.srcset;
832
+ if (props.srcset && props.image?.includes("builder.io/api/v1/image")) {
833
+ if (!props.srcset.includes(props.image.split("?")[0])) {
834
+ console.debug("Removed given srcset");
835
+ return getSrcSet(url);
836
+ }
837
+ } else if (props.image && !props.srcset)
838
+ return getSrcSet(url);
839
+ return getSrcSet(url);
840
+ };
841
+ const webpSrcSet = function webpSrcSet2(props, state) {
842
+ if (srcSetToUse(props)?.match(/builder\.io/) && !props.noWebp)
843
+ return srcSetToUse(props).replace(/\?/g, "?format=webp&");
844
+ else
845
+ return "";
846
+ };
847
+ const Image = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
848
+ useStylesScopedQrl(inlinedQrl(STYLES, "Image_component_useStylesScoped_gRbO7w7SeZA"));
849
+ return /* @__PURE__ */ jsx(Host, {
850
+ class: "div-Image",
851
+ children: /* @__PURE__ */ jsxs(Fragment$1, {
852
+ children: [
853
+ /* @__PURE__ */ jsxs("picture", {
854
+ children: [
855
+ webpSrcSet(props) ? /* @__PURE__ */ jsx("source", {
856
+ type: "image/webp",
857
+ srcset: webpSrcSet(props)
858
+ }) : null,
859
+ /* @__PURE__ */ jsx("img", {
860
+ loading: "lazy",
861
+ alt: props.altText,
862
+ role: props.altText ? "presentation" : void 0,
863
+ style: {
864
+ objectPosition: props.backgroundSize || "center",
865
+ objectFit: props.backgroundSize || "cover"
866
+ },
867
+ class: "builder-image" + (props.className ? " " + props.className : "") + " img-Image",
868
+ src: props.image,
869
+ srcset: srcSetToUse(props),
870
+ sizes: props.sizes
871
+ }),
872
+ /* @__PURE__ */ jsx("source", {
873
+ srcset: srcSetToUse(props)
874
+ })
875
+ ]
876
+ }),
877
+ props.aspectRatio && !(props.fitContent && props.builderBlock?.children?.length) ? /* @__PURE__ */ jsx("div", {
878
+ class: "builder-image-sizer div-Image-2",
879
+ style: {
880
+ paddingTop: props.aspectRatio * 100 + "%"
881
+ }
882
+ }) : null,
883
+ props.builderBlock?.children?.length && props.fitContent ? /* @__PURE__ */ jsx(Slot, {}) : null,
884
+ !props.fitContent ? /* @__PURE__ */ jsx("div", {
885
+ class: "div-Image-3",
886
+ children: /* @__PURE__ */ jsx(Slot, {})
887
+ }) : null
888
+ ]
889
+ })
890
+ });
891
+ }, "Image_component_y3S3Zox9wEo"), {
892
+ tagName: "div"
893
+ });
894
+ const Image$1 = Image;
895
+ const STYLES = `.div-Image {
896
+ position: relative; }.img-Image {
897
+ opacity: 1;
898
+ transition: opacity 0.2s ease-in-out;
899
+ position: absolute;
900
+ height: 100%;
901
+ width: 100%;
902
+ top: 0px;
903
+ left: 0px; }.div-Image-2 {
904
+ width: 100%;
905
+ pointer-events: none;
906
+ font-size: 0; }.div-Image-3 {
907
+ display: flex;
908
+ flex-direction: column;
909
+ align-items: stretch;
910
+ position: absolute;
911
+ top: 0;
912
+ left: 0;
913
+ width: 100%;
914
+ height: 100%; }`;
915
+ const Text = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
916
+ return /* @__PURE__ */ jsx(Host, {
917
+ class: "builder-text",
918
+ dangerouslySetInnerHTML: props.text
919
+ });
920
+ }, "Text_component_ci0NVEdoK0Q"), {
921
+ tagName: "div"
922
+ });
923
+ const Text$1 = Text;
924
+ const videoProps = function videoProps2(props, state) {
925
+ return {
926
+ ...props.autoPlay === true ? {
927
+ autoPlay: true
928
+ } : {},
929
+ ...props.muted === true ? {
930
+ muted: true
931
+ } : {},
932
+ ...props.controls === true ? {
933
+ controls: true
934
+ } : {},
935
+ ...props.loop === true ? {
936
+ loop: true
937
+ } : {},
938
+ ...props.playsInline === true ? {
939
+ playsInline: true
940
+ } : {}
941
+ };
942
+ };
943
+ const Video = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
944
+ return /* @__PURE__ */ jsx(Host, {
945
+ ...videoProps(props),
946
+ style: {
947
+ width: "100%",
948
+ height: "100%",
949
+ ...props.attributes?.style,
950
+ objectFit: props.fit,
951
+ objectPosition: props.position,
952
+ borderRadius: 1
953
+ },
954
+ src: props.video || "no-src",
955
+ poster: props.posterImage
956
+ });
957
+ }, "Video_component_O5sPuWlrTvk"), {
958
+ tagName: "video"
959
+ });
960
+ const Video$1 = Video;
961
+ const Button = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
962
+ return /* @__PURE__ */ jsx(Fragment$2, {
963
+ children: props.link ? /* @__PURE__ */ jsx("a", {
964
+ role: "button",
965
+ ...props.attributes,
966
+ href: props.link,
967
+ target: props.openLinkInNewTab ? "_blank" : void 0,
968
+ children: props.text
969
+ }) : /* @__PURE__ */ jsx("span", {
970
+ ...props.attributes,
971
+ children: props.text
972
+ })
973
+ });
974
+ }, "Button_component_FtjCELjtKF4"));
975
+ const Button$1 = Button;
976
+ const componentInfo$8 = {
977
+ name: "Core:Button",
978
+ builtIn: true,
979
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
980
+ defaultStyles: {
981
+ appearance: "none",
982
+ paddingTop: "15px",
983
+ paddingBottom: "15px",
984
+ paddingLeft: "25px",
985
+ paddingRight: "25px",
986
+ backgroundColor: "#000000",
987
+ color: "white",
988
+ borderRadius: "4px",
989
+ textAlign: "center",
990
+ cursor: "pointer"
991
+ },
992
+ inputs: [
993
+ {
994
+ name: "text",
995
+ type: "text",
996
+ defaultValue: "Click me!",
997
+ bubble: true
998
+ },
999
+ {
1000
+ name: "link",
1001
+ type: "url",
1002
+ bubble: true
1003
+ },
1004
+ {
1005
+ name: "openLinkInNewTab",
1006
+ type: "boolean",
1007
+ defaultValue: false,
1008
+ friendlyName: "Open link in new tab"
1009
+ }
1010
+ ],
1011
+ static: true,
1012
+ noWrap: true
1013
+ };
1014
+ function markSerializable(fn) {
1015
+ fn.__qwik_serializable__ = true;
1016
+ return fn;
1017
+ }
1018
+ const componentInfo$7 = {
1019
+ name: "Columns",
1020
+ builtIn: true,
1021
+ inputs: [
1022
+ {
1023
+ name: "columns",
1024
+ type: "array",
1025
+ broadcast: true,
1026
+ subFields: [
1027
+ {
1028
+ name: "blocks",
1029
+ type: "array",
1030
+ hideFromUI: true,
1031
+ defaultValue: [
1032
+ {
1033
+ "@type": "@builder.io/sdk:Element",
1034
+ responsiveStyles: {
1035
+ large: {
1036
+ display: "flex",
1037
+ flexDirection: "column",
1038
+ alignItems: "stretch",
1039
+ flexShrink: "0",
1040
+ position: "relative",
1041
+ marginTop: "30px",
1042
+ textAlign: "center",
1043
+ lineHeight: "normal",
1044
+ height: "auto",
1045
+ minHeight: "20px",
1046
+ minWidth: "20px",
1047
+ overflow: "hidden"
1048
+ }
1049
+ },
1050
+ component: {
1051
+ name: "Image",
1052
+ options: {
1053
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1054
+ backgroundPosition: "center",
1055
+ backgroundSize: "cover",
1056
+ aspectRatio: 0.7004048582995948
1057
+ }
1058
+ }
1059
+ },
1060
+ {
1061
+ "@type": "@builder.io/sdk:Element",
1062
+ responsiveStyles: {
1063
+ large: {
1064
+ display: "flex",
1065
+ flexDirection: "column",
1066
+ alignItems: "stretch",
1067
+ flexShrink: "0",
1068
+ position: "relative",
1069
+ marginTop: "30px",
1070
+ textAlign: "center",
1071
+ lineHeight: "normal",
1072
+ height: "auto"
1073
+ }
1074
+ },
1075
+ component: {
1076
+ name: "Text",
1077
+ options: {
1078
+ text: "<p>Enter some text...</p>"
1079
+ }
1080
+ }
1081
+ }
1082
+ ]
1083
+ },
1084
+ {
1085
+ name: "width",
1086
+ type: "number",
1087
+ hideFromUI: true,
1088
+ helperText: "Width %, e.g. set to 50 to fill half of the space"
1089
+ },
1090
+ {
1091
+ name: "link",
1092
+ type: "url",
1093
+ helperText: "Optionally set a url that clicking this column will link to"
1094
+ }
1095
+ ],
1096
+ defaultValue: [
1097
+ {
1098
+ blocks: [
1099
+ {
1100
+ "@type": "@builder.io/sdk:Element",
1101
+ responsiveStyles: {
1102
+ large: {
1103
+ display: "flex",
1104
+ flexDirection: "column",
1105
+ alignItems: "stretch",
1106
+ flexShrink: "0",
1107
+ position: "relative",
1108
+ marginTop: "30px",
1109
+ textAlign: "center",
1110
+ lineHeight: "normal",
1111
+ height: "auto",
1112
+ minHeight: "20px",
1113
+ minWidth: "20px",
1114
+ overflow: "hidden"
1115
+ }
1116
+ },
1117
+ component: {
1118
+ name: "Image",
1119
+ options: {
1120
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1121
+ backgroundPosition: "center",
1122
+ backgroundSize: "cover",
1123
+ aspectRatio: 0.7004048582995948
1124
+ }
1125
+ }
1126
+ },
1127
+ {
1128
+ "@type": "@builder.io/sdk:Element",
1129
+ responsiveStyles: {
1130
+ large: {
1131
+ display: "flex",
1132
+ flexDirection: "column",
1133
+ alignItems: "stretch",
1134
+ flexShrink: "0",
1135
+ position: "relative",
1136
+ marginTop: "30px",
1137
+ textAlign: "center",
1138
+ lineHeight: "normal",
1139
+ height: "auto"
1140
+ }
1141
+ },
1142
+ component: {
1143
+ name: "Text",
1144
+ options: {
1145
+ text: "<p>Enter some text...</p>"
1146
+ }
1147
+ }
1148
+ }
1149
+ ]
1150
+ },
1151
+ {
1152
+ blocks: [
1153
+ {
1154
+ "@type": "@builder.io/sdk:Element",
1155
+ responsiveStyles: {
1156
+ large: {
1157
+ display: "flex",
1158
+ flexDirection: "column",
1159
+ alignItems: "stretch",
1160
+ flexShrink: "0",
1161
+ position: "relative",
1162
+ marginTop: "30px",
1163
+ textAlign: "center",
1164
+ lineHeight: "normal",
1165
+ height: "auto",
1166
+ minHeight: "20px",
1167
+ minWidth: "20px",
1168
+ overflow: "hidden"
1169
+ }
1170
+ },
1171
+ component: {
1172
+ name: "Image",
1173
+ options: {
1174
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1175
+ backgroundPosition: "center",
1176
+ backgroundSize: "cover",
1177
+ aspectRatio: 0.7004048582995948
1178
+ }
1179
+ }
1180
+ },
1181
+ {
1182
+ "@type": "@builder.io/sdk:Element",
1183
+ responsiveStyles: {
1184
+ large: {
1185
+ display: "flex",
1186
+ flexDirection: "column",
1187
+ alignItems: "stretch",
1188
+ flexShrink: "0",
1189
+ position: "relative",
1190
+ marginTop: "30px",
1191
+ textAlign: "center",
1192
+ lineHeight: "normal",
1193
+ height: "auto"
1194
+ }
1195
+ },
1196
+ component: {
1197
+ name: "Text",
1198
+ options: {
1199
+ text: "<p>Enter some text...</p>"
1200
+ }
1201
+ }
1202
+ }
1203
+ ]
1204
+ }
1205
+ ],
1206
+ onChange: markSerializable((options) => {
1207
+ function clearWidths() {
1208
+ columns.forEach((col) => {
1209
+ col.delete("width");
1210
+ });
1211
+ }
1212
+ const columns = options.get("columns");
1213
+ if (Array.isArray(columns)) {
1214
+ const containsColumnWithWidth = !!columns.find(
1215
+ (col) => col.get("width")
1216
+ );
1217
+ if (containsColumnWithWidth) {
1218
+ const containsColumnWithoutWidth = !!columns.find(
1219
+ (col) => !col.get("width")
1220
+ );
1221
+ if (containsColumnWithoutWidth)
1222
+ clearWidths();
1223
+ else {
1224
+ const sumWidths = columns.reduce((memo, col) => {
1225
+ return memo + col.get("width");
1226
+ }, 0);
1227
+ const widthsDontAddUp = sumWidths !== 100;
1228
+ if (widthsDontAddUp)
1229
+ clearWidths();
1230
+ }
1231
+ }
1232
+ }
1233
+ })
1234
+ },
1235
+ {
1236
+ name: "space",
1237
+ type: "number",
1238
+ defaultValue: 20,
1239
+ helperText: "Size of gap between columns",
1240
+ advanced: true
1241
+ },
1242
+ {
1243
+ name: "stackColumnsAt",
1244
+ type: "string",
1245
+ defaultValue: "tablet",
1246
+ helperText: "Convert horizontal columns to vertical at what device size",
1247
+ enum: [
1248
+ "tablet",
1249
+ "mobile",
1250
+ "never"
1251
+ ],
1252
+ advanced: true
1253
+ },
1254
+ {
1255
+ name: "reverseColumnsWhenStacked",
1256
+ type: "boolean",
1257
+ defaultValue: false,
1258
+ helperText: "When stacking columns for mobile devices, reverse the ordering",
1259
+ advanced: true
1260
+ }
1261
+ ]
1262
+ };
1263
+ const componentInfo$6 = {
1264
+ name: "Fragment",
1265
+ static: true,
1266
+ hidden: true,
1267
+ builtIn: true,
1268
+ canHaveChildren: true,
1269
+ noWrap: true
1270
+ };
1271
+ const FragmentComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1272
+ return /* @__PURE__ */ jsx(Host, {
1273
+ children: /* @__PURE__ */ jsx(Slot, {})
1274
+ });
1275
+ }, "FragmentComponent_component_FJmqlA66Rjg"), {
1276
+ tagName: "span"
1277
+ });
1278
+ const Fragment = FragmentComponent;
1279
+ const componentInfo$5 = {
1280
+ name: "Image",
1281
+ static: true,
1282
+ builtIn: true,
1283
+ 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",
1284
+ defaultStyles: {
1285
+ position: "relative",
1286
+ minHeight: "20px",
1287
+ minWidth: "20px",
1288
+ overflow: "hidden"
1289
+ },
1290
+ canHaveChildren: true,
1291
+ inputs: [
1292
+ {
1293
+ name: "image",
1294
+ type: "file",
1295
+ bubble: true,
1296
+ allowedFileTypes: [
1297
+ "jpeg",
1298
+ "jpg",
1299
+ "png",
1300
+ "svg"
1301
+ ],
1302
+ required: true,
1303
+ defaultValue: "https://cdn.builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1304
+ onChange: markSerializable((options) => {
1305
+ const DEFAULT_ASPECT_RATIO = 0.7041;
1306
+ options.delete("srcset");
1307
+ options.delete("noWebp");
1308
+ function loadImage(url, timeout = 6e4) {
1309
+ return new Promise((resolve, reject) => {
1310
+ const img = document.createElement("img");
1311
+ let loaded = false;
1312
+ img.onload = () => {
1313
+ loaded = true;
1314
+ resolve(img);
1315
+ };
1316
+ img.addEventListener("error", (event) => {
1317
+ console.warn("Image load failed", event.error);
1318
+ reject(event.error);
1319
+ });
1320
+ img.src = url;
1321
+ setTimeout(() => {
1322
+ if (!loaded)
1323
+ reject(new Error("Image load timed out"));
1324
+ }, timeout);
1325
+ });
1326
+ }
1327
+ function round(num) {
1328
+ return Math.round(num * 1e3) / 1e3;
1329
+ }
1330
+ const value = options.get("image");
1331
+ const aspectRatio = options.get("aspectRatio");
1332
+ fetch(value).then(
1333
+ (res) => res.blob()
1334
+ ).then((blob) => {
1335
+ if (blob.type.includes("svg"))
1336
+ options.set("noWebp", true);
1337
+ });
1338
+ if (value && (!aspectRatio || aspectRatio === DEFAULT_ASPECT_RATIO))
1339
+ return loadImage(value).then((img) => {
1340
+ const possiblyUpdatedAspectRatio = options.get("aspectRatio");
1341
+ if (options.get("image") === value && (!possiblyUpdatedAspectRatio || possiblyUpdatedAspectRatio === DEFAULT_ASPECT_RATIO)) {
1342
+ if (img.width && img.height) {
1343
+ options.set("aspectRatio", round(img.height / img.width));
1344
+ options.set("height", img.height);
1345
+ options.set("width", img.width);
1346
+ }
1347
+ }
1348
+ });
1349
+ })
1350
+ },
1351
+ {
1352
+ name: "backgroundSize",
1353
+ type: "text",
1354
+ defaultValue: "cover",
1355
+ enum: [
1356
+ {
1357
+ label: "contain",
1358
+ value: "contain",
1359
+ helperText: "The image should never get cropped"
1360
+ },
1361
+ {
1362
+ label: "cover",
1363
+ value: "cover",
1364
+ helperText: "The image should fill it's box, cropping when needed"
1365
+ }
1366
+ ]
1367
+ },
1368
+ {
1369
+ name: "backgroundPosition",
1370
+ type: "text",
1371
+ defaultValue: "center",
1372
+ enum: [
1373
+ "center",
1374
+ "top",
1375
+ "left",
1376
+ "right",
1377
+ "bottom",
1378
+ "top left",
1379
+ "top right",
1380
+ "bottom left",
1381
+ "bottom right"
1382
+ ]
1383
+ },
1384
+ {
1385
+ name: "altText",
1386
+ type: "string",
1387
+ helperText: "Text to display when the user has images off"
1388
+ },
1389
+ {
1390
+ name: "height",
1391
+ type: "number",
1392
+ hideFromUI: true
1393
+ },
1394
+ {
1395
+ name: "width",
1396
+ type: "number",
1397
+ hideFromUI: true
1398
+ },
1399
+ {
1400
+ name: "sizes",
1401
+ type: "string",
1402
+ hideFromUI: true
1403
+ },
1404
+ {
1405
+ name: "srcset",
1406
+ type: "string",
1407
+ hideFromUI: true
1408
+ },
1409
+ {
1410
+ name: "lazy",
1411
+ type: "boolean",
1412
+ defaultValue: true,
1413
+ hideFromUI: true
1414
+ },
1415
+ {
1416
+ name: "fitContent",
1417
+ type: "boolean",
1418
+ helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
1419
+ defaultValue: true
1420
+ },
1421
+ {
1422
+ name: "aspectRatio",
1423
+ type: "number",
1424
+ 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",
1425
+ advanced: true,
1426
+ defaultValue: 0.7041
1427
+ }
1428
+ ]
1429
+ };
1430
+ const componentInfo$4 = {
1431
+ name: "Core:Section",
1432
+ static: true,
1433
+ builtIn: true,
1434
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
1435
+ inputs: [
1436
+ {
1437
+ name: "maxWidth",
1438
+ type: "number",
1439
+ defaultValue: 1200
1440
+ },
1441
+ {
1442
+ name: "lazyLoad",
1443
+ type: "boolean",
1444
+ defaultValue: false,
1445
+ advanced: true,
1446
+ description: "Only render this section when in view"
1447
+ }
1448
+ ],
1449
+ defaultStyles: {
1450
+ paddingLeft: "20px",
1451
+ paddingRight: "20px",
1452
+ paddingTop: "50px",
1453
+ paddingBottom: "50px",
1454
+ marginTop: "0px",
1455
+ width: "100vw",
1456
+ marginLeft: "calc(50% - 50vw)"
1457
+ },
1458
+ canHaveChildren: true,
1459
+ defaultChildren: [
1460
+ {
1461
+ "@type": "@builder.io/sdk:Element",
1462
+ responsiveStyles: {
1463
+ large: {
1464
+ textAlign: "center"
1465
+ }
1466
+ },
1467
+ component: {
1468
+ name: "Text",
1469
+ options: {
1470
+ 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>"
1471
+ }
1472
+ }
1473
+ }
1474
+ ]
1475
+ };
1476
+ const SectionComponent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1477
+ return /* @__PURE__ */ jsx(Host, {
1478
+ ...props.attributes,
1479
+ style: (() => {
1480
+ props.maxWidth && typeof props.maxWidth === "number" ? props.maxWidth : void 0;
1481
+ })(),
1482
+ children: /* @__PURE__ */ jsx(Slot, {})
1483
+ });
1484
+ }, "SectionComponent_component_m1CcjCwgHug"), {
1485
+ tagName: "section"
1486
+ });
1487
+ const Section = SectionComponent;
1488
+ const componentInfo$3 = {
1489
+ name: "Symbol",
1490
+ noWrap: true,
1491
+ static: true,
1492
+ builtIn: true,
1493
+ inputs: [
1494
+ {
1495
+ name: "symbol",
1496
+ type: "uiSymbol"
1497
+ },
1498
+ {
1499
+ name: "dataOnly",
1500
+ helperText: "Make this a data symbol that doesn't display any UI",
1501
+ type: "boolean",
1502
+ defaultValue: false,
1503
+ advanced: true,
1504
+ hideFromUI: true
1505
+ },
1506
+ {
1507
+ name: "inheritState",
1508
+ helperText: "Inherit the parent component state and data",
1509
+ type: "boolean",
1510
+ defaultValue: false,
1511
+ advanced: true
1512
+ },
1513
+ {
1514
+ name: "renderToLiquid",
1515
+ helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1516
+ type: "boolean",
1517
+ defaultValue: false,
1518
+ advanced: true,
1519
+ hideFromUI: true
1520
+ },
1521
+ {
1522
+ name: "useChildren",
1523
+ hideFromUI: true,
1524
+ type: "boolean"
1525
+ }
1526
+ ]
1527
+ };
1528
+ const componentInfo$2 = {
1529
+ name: "Text",
1530
+ static: true,
1531
+ builtIn: true,
1532
+ 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",
1533
+ inputs: [
1534
+ {
1535
+ name: "text",
1536
+ type: "html",
1537
+ required: true,
1538
+ autoFocus: true,
1539
+ bubble: true,
1540
+ defaultValue: "Enter some text..."
1541
+ }
1542
+ ],
1543
+ defaultStyles: {
1544
+ lineHeight: "normal",
1545
+ height: "auto",
1546
+ textAlign: "center"
1547
+ }
1548
+ };
1549
+ const componentInfo$1 = {
1550
+ name: "Video",
1551
+ canHaveChildren: true,
1552
+ builtIn: true,
1553
+ defaultStyles: {
1554
+ minHeight: "20px",
1555
+ minWidth: "20px"
1556
+ },
1557
+ 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",
1558
+ inputs: [
1559
+ {
1560
+ name: "video",
1561
+ type: "file",
1562
+ allowedFileTypes: [
1563
+ "mp4"
1564
+ ],
1565
+ bubble: true,
1566
+ defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
1567
+ required: true
1568
+ },
1569
+ {
1570
+ name: "posterImage",
1571
+ type: "file",
1572
+ allowedFileTypes: [
1573
+ "jpeg",
1574
+ "png"
1575
+ ],
1576
+ helperText: "Image to show before the video plays"
1577
+ },
1578
+ {
1579
+ name: "autoPlay",
1580
+ type: "boolean",
1581
+ defaultValue: true
1582
+ },
1583
+ {
1584
+ name: "controls",
1585
+ type: "boolean",
1586
+ defaultValue: false
1587
+ },
1588
+ {
1589
+ name: "muted",
1590
+ type: "boolean",
1591
+ defaultValue: true
1592
+ },
1593
+ {
1594
+ name: "loop",
1595
+ type: "boolean",
1596
+ defaultValue: true
1597
+ },
1598
+ {
1599
+ name: "playsInline",
1600
+ type: "boolean",
1601
+ defaultValue: true
1602
+ },
1603
+ {
1604
+ name: "fit",
1605
+ type: "text",
1606
+ defaultValue: "cover",
1607
+ enum: [
1608
+ "contain",
1609
+ "cover",
1610
+ "fill",
1611
+ "auto"
1612
+ ]
1613
+ },
1614
+ {
1615
+ name: "fitContent",
1616
+ type: "boolean",
1617
+ helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
1618
+ defaultValue: true,
1619
+ advanced: true
1620
+ },
1621
+ {
1622
+ name: "position",
1623
+ type: "text",
1624
+ defaultValue: "center",
1625
+ enum: [
1626
+ "center",
1627
+ "top",
1628
+ "left",
1629
+ "right",
1630
+ "bottom",
1631
+ "top left",
1632
+ "top right",
1633
+ "bottom left",
1634
+ "bottom right"
1635
+ ]
1636
+ },
1637
+ {
1638
+ name: "height",
1639
+ type: "number",
1640
+ advanced: true
1641
+ },
1642
+ {
1643
+ name: "width",
1644
+ type: "number",
1645
+ advanced: true
1646
+ },
1647
+ {
1648
+ name: "aspectRatio",
1649
+ type: "number",
1650
+ advanced: true,
1651
+ defaultValue: 0.7004048582995948
1652
+ },
1653
+ {
1654
+ name: "lazyLoad",
1655
+ type: "boolean",
1656
+ helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
1657
+ defaultValue: true,
1658
+ advanced: true
1659
+ }
1660
+ ]
1661
+ };
1662
+ const componentInfo2 = {
1663
+ name: "Embed",
1664
+ static: true,
1665
+ builtIn: true,
1666
+ inputs: [
1667
+ {
1668
+ name: "url",
1669
+ type: "url",
1670
+ required: true,
1671
+ defaultValue: "",
1672
+ helperText: "e.g. enter a youtube url, google map, etc",
1673
+ onChange: markSerializable((options) => {
1674
+ const url = options.get("url");
1675
+ if (url) {
1676
+ options.set("content", "Loading...");
1677
+ const apiKey = "ae0e60e78201a3f2b0de4b";
1678
+ return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then(
1679
+ (res) => res.json()
1680
+ ).then((data) => {
1681
+ if (options.get("url") === url) {
1682
+ if (data.html)
1683
+ options.set("content", data.html);
1684
+ else
1685
+ options.set("content", "Invalid url, please try another");
1686
+ }
1687
+ }).catch((_err) => {
1688
+ options.set("content", "There was an error embedding this URL, please try again or another URL");
1689
+ });
1690
+ } else
1691
+ options.delete("content");
1692
+ })
1693
+ },
1694
+ {
1695
+ name: "content",
1696
+ type: "html",
1697
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1698
+ hideFromUI: true
1699
+ }
1700
+ ]
1701
+ };
1702
+ const SCRIPT_MIME_TYPES = [
1703
+ "text/javascript",
1704
+ "application/javascript",
1705
+ "application/ecmascript"
1706
+ ];
1707
+ const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
1708
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
1709
+ const scripts = elem.getElementsByTagName("script");
1710
+ for (let i = 0; i < scripts.length; i++) {
1711
+ const script = scripts[i];
1712
+ if (script.src && !state.scriptsInserted.includes(script.src)) {
1713
+ state.scriptsInserted.push(script.src);
1714
+ const newScript = document.createElement("script");
1715
+ newScript.async = true;
1716
+ newScript.src = script.src;
1717
+ document.head.appendChild(newScript);
1718
+ } else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
1719
+ try {
1720
+ state.scriptsRun.push(script.innerText);
1721
+ new Function(script.innerText)();
1722
+ } catch (error) {
1723
+ console.warn("`Embed`: Error running script:", error);
1724
+ }
1725
+ }
1726
+ };
1727
+ const Embed = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
1728
+ const elem = useRef();
1729
+ const state = useStore({
1730
+ scriptsInserted: [],
1731
+ scriptsRun: [],
1732
+ ranInitFn: false
1733
+ });
1734
+ useWatchQrl(inlinedQrl(({ track: track2 }) => {
1735
+ const [elem2, props2, state2] = useLexicalScope();
1736
+ state2 && track2(state2, "ranInitFn");
1737
+ if (elem2 && !state2.ranInitFn) {
1738
+ state2.ranInitFn = true;
1739
+ findAndRunScripts(props2, state2, elem2);
1740
+ }
1741
+ }, "Embed_component_useWatch_XE41s3iNuto", [
1742
+ elem,
1743
+ props,
1744
+ state
1745
+ ]));
1746
+ return /* @__PURE__ */ jsx(Host, {
1747
+ class: "builder-embed",
1748
+ ref: elem,
1749
+ dangerouslySetInnerHTML: props.content
1750
+ });
1751
+ }, "Embed_component_CP6B8Y76ylw"), {
1752
+ tagName: "div"
1753
+ });
1754
+ const embed = Embed;
1755
+ var __defProp$3 = Object.defineProperty;
1756
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1757
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1758
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1759
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
1760
+ enumerable: true,
1761
+ configurable: true,
1762
+ writable: true,
1763
+ value
1764
+ }) : obj[key] = value;
1765
+ var __spreadValues$3 = (a, b) => {
1766
+ for (var prop in b || (b = {}))
1767
+ if (__hasOwnProp$3.call(b, prop))
1768
+ __defNormalProp$3(a, prop, b[prop]);
1769
+ if (__getOwnPropSymbols$3) {
1770
+ for (var prop of __getOwnPropSymbols$3(b))
1771
+ if (__propIsEnum$3.call(b, prop))
1772
+ __defNormalProp$3(a, prop, b[prop]);
1773
+ }
1774
+ return a;
1775
+ };
1776
+ const getDefaultRegisteredComponents = () => [
1777
+ __spreadValues$3({
1778
+ component: Columns$1
1779
+ }, componentInfo$7),
1780
+ __spreadValues$3({
1781
+ component: Image$1
1782
+ }, componentInfo$5),
1783
+ __spreadValues$3({
1784
+ component: Text$1
1785
+ }, componentInfo$2),
1786
+ __spreadValues$3({
1787
+ component: Video$1
1788
+ }, componentInfo$1),
1789
+ __spreadValues$3({
1790
+ component: Symbol$2
1791
+ }, componentInfo$3),
1792
+ __spreadValues$3({
1793
+ component: Button$1
1794
+ }, componentInfo$8),
1795
+ __spreadValues$3({
1796
+ component: Section
1797
+ }, componentInfo$4),
1798
+ __spreadValues$3({
1799
+ component: Fragment
1800
+ }, componentInfo$6),
1801
+ __spreadValues$3({
1802
+ component: embed
1803
+ }, componentInfo2)
1804
+ ];
1805
+ var __defProp$2 = Object.defineProperty;
1806
+ var __defProps$2 = Object.defineProperties;
1807
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
1808
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1809
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1810
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1811
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {
1812
+ enumerable: true,
1813
+ configurable: true,
1814
+ writable: true,
1815
+ value
1816
+ }) : obj[key] = value;
1817
+ var __spreadValues$2 = (a, b) => {
1818
+ for (var prop in b || (b = {}))
1819
+ if (__hasOwnProp$2.call(b, prop))
1820
+ __defNormalProp$2(a, prop, b[prop]);
1821
+ if (__getOwnPropSymbols$2) {
1822
+ for (var prop of __getOwnPropSymbols$2(b))
1823
+ if (__propIsEnum$2.call(b, prop))
1824
+ __defNormalProp$2(a, prop, b[prop]);
1825
+ }
1826
+ return a;
1827
+ };
1828
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1829
+ function flatten(object, path = null, separator = ".") {
1830
+ return Object.keys(object).reduce((acc, key) => {
1831
+ const value = object[key];
1832
+ const newPath = [
1833
+ path,
1834
+ key
1835
+ ].filter(Boolean).join(separator);
1836
+ const isObject = [
1837
+ typeof value === "object",
1838
+ value !== null,
1839
+ !(Array.isArray(value) && value.length === 0)
1840
+ ].every(Boolean);
1841
+ return isObject ? __spreadValues$2(__spreadValues$2({}, acc), flatten(value, newPath, separator)) : __spreadProps$2(__spreadValues$2({}, acc), {
1842
+ [newPath]: value
1843
+ });
1844
+ }, {});
1845
+ }
1846
+ const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
1847
+ const convertSearchParamsToQueryObject = (searchParams) => {
1848
+ const options = {};
1849
+ searchParams.forEach((value, key) => {
1850
+ options[key] = value;
1851
+ });
1852
+ return options;
1853
+ };
1854
+ const getBuilderSearchParams = (options) => {
1855
+ const newOptions = {};
1856
+ Object.keys(options).forEach((key) => {
1857
+ if (key.startsWith(BUILDER_SEARCHPARAMS_PREFIX)) {
1858
+ const trimmedKey = key.replace(BUILDER_SEARCHPARAMS_PREFIX, "");
1859
+ newOptions[trimmedKey] = options[key];
1860
+ }
1861
+ });
1862
+ return newOptions;
1863
+ };
1864
+ const getBuilderSearchParamsFromWindow = () => {
1865
+ if (!isBrowser())
1866
+ return {};
1867
+ const searchParams = new URLSearchParams(window.location.search);
1868
+ return getBuilderSearchParams(convertSearchParamsToQueryObject(searchParams));
1869
+ };
1870
+ const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
1871
+ function getGlobalThis() {
1872
+ if (typeof globalThis !== "undefined")
1873
+ return globalThis;
1874
+ if (typeof window !== "undefined")
1875
+ return window;
1876
+ if (typeof global !== "undefined")
1877
+ return global;
1878
+ if (typeof self !== "undefined")
1879
+ return self;
1880
+ return null;
1881
+ }
1882
+ var __async$1 = (__this, __arguments, generator) => {
1883
+ return new Promise((resolve, reject) => {
1884
+ var fulfilled = (value) => {
1885
+ try {
1886
+ step(generator.next(value));
1887
+ } catch (e) {
1888
+ reject(e);
1889
+ }
1890
+ };
1891
+ var rejected = (value) => {
1892
+ try {
1893
+ step(generator.throw(value));
1894
+ } catch (e) {
1895
+ reject(e);
1896
+ }
1897
+ };
1898
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1899
+ step((generator = generator.apply(__this, __arguments)).next());
1900
+ });
1901
+ };
1902
+ function getFetch() {
1903
+ return __async$1(this, null, function* () {
1904
+ const globalFetch = getGlobalThis().fetch;
1905
+ if (typeof globalFetch === "undefined" && typeof global !== "undefined") {
1906
+ const nodeFetch = import("./index.97024df8.js").then(
1907
+ (d) => d.default
1908
+ );
1909
+ return nodeFetch.default || nodeFetch;
1910
+ }
1911
+ return globalFetch.default || globalFetch;
1912
+ });
1913
+ }
1914
+ const handleABTesting = (item, testGroups) => {
1915
+ if (item.variations && Object.keys(item.variations).length) {
1916
+ const testGroup = item.id ? testGroups[item.id] : void 0;
1917
+ const variationValue = testGroup ? item.variations[testGroup] : void 0;
1918
+ if (testGroup && variationValue) {
1919
+ item.data = variationValue.data;
1920
+ item.testVariationId = variationValue.id;
1921
+ item.testVariationName = variationValue.name;
1922
+ } else {
1923
+ let n = 0;
1924
+ const random = Math.random();
1925
+ let set2 = false;
1926
+ for (const id in item.variations) {
1927
+ const variation = item.variations[id];
1928
+ const testRatio = variation.testRatio;
1929
+ n += testRatio;
1930
+ if (random < n) {
1931
+ const variationName = variation.name || (variation.id === item.id ? "Default variation" : "");
1932
+ set2 = true;
1933
+ Object.assign(item, {
1934
+ data: variation.data,
1935
+ testVariationId: variation.id,
1936
+ testVariationName: variationName
1937
+ });
1938
+ }
1939
+ }
1940
+ if (!set2)
1941
+ Object.assign(item, {
1942
+ testVariationId: item.id,
1943
+ testVariationName: "Default"
1944
+ });
1945
+ }
1946
+ }
1947
+ };
1948
+ var __defProp$1 = Object.defineProperty;
1949
+ var __defProps$1 = Object.defineProperties;
1950
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
1951
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
1952
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1953
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
1954
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
1955
+ enumerable: true,
1956
+ configurable: true,
1957
+ writable: true,
1958
+ value
1959
+ }) : obj[key] = value;
1960
+ var __spreadValues$1 = (a, b) => {
1961
+ for (var prop in b || (b = {}))
1962
+ if (__hasOwnProp$1.call(b, prop))
1963
+ __defNormalProp$1(a, prop, b[prop]);
1964
+ if (__getOwnPropSymbols$1) {
1965
+ for (var prop of __getOwnPropSymbols$1(b))
1966
+ if (__propIsEnum$1.call(b, prop))
1967
+ __defNormalProp$1(a, prop, b[prop]);
1968
+ }
1969
+ return a;
1970
+ };
1971
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
1972
+ var __async = (__this, __arguments, generator) => {
1973
+ return new Promise((resolve, reject) => {
1974
+ var fulfilled = (value) => {
1975
+ try {
1976
+ step(generator.next(value));
1977
+ } catch (e) {
1978
+ reject(e);
1979
+ }
1980
+ };
1981
+ var rejected = (value) => {
1982
+ try {
1983
+ step(generator.throw(value));
1984
+ } catch (e) {
1985
+ reject(e);
1986
+ }
1987
+ };
1988
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
1989
+ step((generator = generator.apply(__this, __arguments)).next());
1990
+ });
1991
+ };
1992
+ const fetch$ = getFetch();
1993
+ function getContent(options) {
1994
+ return __async(this, null, function* () {
1995
+ return (yield getAllContent(__spreadProps$1(__spreadValues$1({}, options), {
1996
+ limit: 1
1997
+ }))).results[0] || null;
1998
+ });
1999
+ }
2000
+ const generateContentUrl = (options) => {
2001
+ const { limit = 1, userAttributes, query, noTraverse = false, model, apiKey } = options;
2002
+ const url = new URL(`https://cdn.builder.io/api/v2/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}`);
2003
+ const queryOptions = __spreadValues$1(__spreadValues$1({}, getBuilderSearchParamsFromWindow()), normalizeSearchParams(options.options || {}));
2004
+ const flattened = flatten(queryOptions);
2005
+ for (const key in flattened)
2006
+ url.searchParams.set(key, String(flattened[key]));
2007
+ if (userAttributes)
2008
+ url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
2009
+ if (query) {
2010
+ const flattened2 = flatten({
2011
+ query
2012
+ });
2013
+ for (const key in flattened2)
2014
+ url.searchParams.set(key, JSON.stringify(flattened2[key]));
2015
+ }
2016
+ return url;
2017
+ };
2018
+ function getAllContent(options) {
2019
+ return __async(this, null, function* () {
2020
+ const url = generateContentUrl(options);
2021
+ const fetch2 = yield fetch$;
2022
+ const content = yield fetch2(url.href).then(
2023
+ (res) => res.json()
2024
+ );
2025
+ if (options.testGroups)
2026
+ for (const item of content.results)
2027
+ handleABTesting(item, options.testGroups);
2028
+ return content;
2029
+ });
2030
+ }
2031
+ function isPreviewing() {
2032
+ if (!isBrowser())
2033
+ return false;
2034
+ if (isEditing())
2035
+ return false;
2036
+ return Boolean(location.search.indexOf("builder.preview=") !== -1);
2037
+ }
2038
+ var __defProp = Object.defineProperty;
2039
+ var __defProps = Object.defineProperties;
2040
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2041
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2042
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2043
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
2044
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
2045
+ enumerable: true,
2046
+ configurable: true,
2047
+ writable: true,
2048
+ value
2049
+ }) : obj[key] = value;
2050
+ var __spreadValues = (a, b) => {
2051
+ for (var prop in b || (b = {}))
2052
+ if (__hasOwnProp.call(b, prop))
2053
+ __defNormalProp(a, prop, b[prop]);
2054
+ if (__getOwnPropSymbols) {
2055
+ for (var prop of __getOwnPropSymbols(b))
2056
+ if (__propIsEnum.call(b, prop))
2057
+ __defNormalProp(a, prop, b[prop]);
2058
+ }
2059
+ return a;
2060
+ };
2061
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2062
+ var __objRest = (source, exclude) => {
2063
+ var target = {};
2064
+ for (var prop in source)
2065
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
2066
+ target[prop] = source[prop];
2067
+ if (source != null && __getOwnPropSymbols) {
2068
+ for (var prop of __getOwnPropSymbols(source))
2069
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
2070
+ target[prop] = source[prop];
2071
+ }
2072
+ return target;
2073
+ };
2074
+ const components = [];
2075
+ function registerComponent(component3, info) {
2076
+ components.push(__spreadValues({
2077
+ component: component3
2078
+ }, info));
2079
+ console.warn("registerComponent is deprecated. Use the `customComponents` prop in RenderContent instead to provide your custom components to the builder SDK.");
2080
+ return component3;
2081
+ }
2082
+ const createRegisterComponentMessage = (_a) => {
2083
+ var info = __objRest(_a, [
2084
+ "component"
2085
+ ]);
2086
+ return {
2087
+ type: "builder.registerComponent",
2088
+ data: prepareComponentInfoToSend(info)
2089
+ };
2090
+ };
2091
+ const fastClone = (obj) => JSON.parse(JSON.stringify(obj));
2092
+ const serializeValue = (value) => typeof value === "function" ? serializeFn(value) : fastClone(value);
2093
+ const serializeFn = (fnValue) => {
2094
+ const fnStr = fnValue.toString().trim();
2095
+ const appendFunction = !fnStr.startsWith("function") && !fnStr.startsWith("(");
2096
+ return `return (${appendFunction ? "function " : ""}${fnStr}).apply(this, arguments)`;
2097
+ };
2098
+ const prepareComponentInfoToSend = (_c) => {
2099
+ var { inputs } = _c, info = __objRest(_c, [
2100
+ "inputs"
2101
+ ]);
2102
+ return __spreadProps(__spreadValues({}, fastClone(info)), {
2103
+ inputs: inputs == null ? void 0 : inputs.map(
2104
+ (input) => Object.entries(input).reduce(
2105
+ (acc, [key, value]) => __spreadProps(__spreadValues({}, acc), {
2106
+ [key]: serializeValue(value)
2107
+ }),
2108
+ {}
2109
+ )
2110
+ )
2111
+ });
2112
+ };
2113
+ function track(event, properties) {
2114
+ if (isEditing())
2115
+ return;
2116
+ if (!(isBrowser() || TARGET === "reactNative"))
2117
+ return;
2118
+ return fetch(`https://builder.io/api/v1/track`, {
2119
+ method: "POST",
2120
+ body: JSON.stringify({
2121
+ events: [
2122
+ {
2123
+ type: event,
2124
+ data: properties
2125
+ }
2126
+ ]
2127
+ }),
2128
+ headers: {
2129
+ "content-type": "application/json"
2130
+ },
2131
+ mode: "cors"
2132
+ });
2133
+ }
2134
+ const getCssFromFont = function getCssFromFont2(props, state, font) {
2135
+ const family = font.family + (font.kind && !font.kind.includes("#") ? ", " + font.kind : "");
2136
+ const name = family.split(",")[0];
2137
+ const url = font.fileUrl ?? font?.files?.regular;
2138
+ let str = "";
2139
+ if (url && family && name)
2140
+ str += `
2141
+ @font-face {
2142
+ font-family: "${family}";
2143
+ src: local("${name}"), url('${url}') format('woff2');
2144
+ font-display: fallback;
2145
+ font-weight: 400;
2146
+ }
2147
+ `.trim();
2148
+ if (font.files)
2149
+ for (const weight in font.files) {
2150
+ const isNumber = String(Number(weight)) === weight;
2151
+ if (!isNumber)
2152
+ continue;
2153
+ const weightUrl = font.files[weight];
2154
+ if (weightUrl && weightUrl !== url)
2155
+ str += `
2156
+ @font-face {
2157
+ font-family: "${family}";
2158
+ src: url('${weightUrl}') format('woff2');
2159
+ font-display: fallback;
2160
+ font-weight: ${weight};
2161
+ }
2162
+ `.trim();
2163
+ }
2164
+ return str;
2165
+ };
2166
+ const getFontCss = function getFontCss2(props, state, { customFonts }) {
2167
+ return customFonts?.map(
2168
+ (font) => getCssFromFont(props, state, font)
2169
+ )?.join(" ") || "";
2170
+ };
2171
+ const injectedStyles = function injectedStyles2(props, state) {
2172
+ return `
2173
+ ${props.cssCode || ""}
2174
+ ${getFontCss(props, state, {
2175
+ customFonts: props.customFonts
2176
+ })}`;
2177
+ };
2178
+ const RenderContentStyles = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2179
+ const state = {};
2180
+ return /* @__PURE__ */ jsx(RenderInlinedStyles$1, {
2181
+ styles: injectedStyles(props, state)
2182
+ });
2183
+ }, "RenderContentStyles_component_32XAr483K2o"));
2184
+ const RenderContentStyles$1 = RenderContentStyles;
2185
+ const useContent = function useContent2(props, state) {
2186
+ const mergedContent = {
2187
+ ...props.content,
2188
+ ...state.overrideContent,
2189
+ data: {
2190
+ ...props.content?.data,
2191
+ ...props.data,
2192
+ ...state.overrideContent?.data
2193
+ }
2194
+ };
2195
+ return mergedContent;
2196
+ };
2197
+ const contentState = function contentState2(props, state) {
2198
+ return {
2199
+ ...props.content?.data?.state,
2200
+ ...props.data,
2201
+ ...state.overrideState
2202
+ };
2203
+ };
2204
+ const contextContext = function contextContext2(props, state) {
2205
+ return props.context || {};
2206
+ };
2207
+ const allRegisteredComponents = function allRegisteredComponents2(props, state) {
2208
+ const allComponentsArray = [
2209
+ ...getDefaultRegisteredComponents(),
2210
+ ...components,
2211
+ ...props.customComponents || []
2212
+ ];
2213
+ const allComponents = allComponentsArray.reduce(
2214
+ (acc, curr) => ({
2215
+ ...acc,
2216
+ [curr.name]: curr
2217
+ }),
2218
+ {}
2219
+ );
2220
+ return allComponents;
2221
+ };
2222
+ const processMessage = function processMessage2(props, state, event) {
2223
+ const { data } = event;
2224
+ if (data)
2225
+ switch (data.type) {
2226
+ case "builder.contentUpdate": {
2227
+ const messageContent = data.data;
2228
+ const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
2229
+ const contentData = messageContent.data;
2230
+ if (key === props.model)
2231
+ state.overrideContent = contentData;
2232
+ break;
2233
+ }
2234
+ }
2235
+ };
2236
+ const evaluateJsCode = function evaluateJsCode2(props, state) {
2237
+ const jsCode = useContent(props, state)?.data?.jsCode;
2238
+ if (jsCode)
2239
+ evaluate({
2240
+ code: jsCode,
2241
+ context: contextContext(props),
2242
+ state: contentState(props, state)
2243
+ });
2244
+ };
2245
+ const httpReqsData = function httpReqsData2(props, state) {
2246
+ return {};
2247
+ };
2248
+ const onClick2 = function onClick3(props, state, _event) {
2249
+ if (useContent(props, state) && props.canTrack !== false)
2250
+ track("click", {
2251
+ contentId: useContent(props, state).id
2252
+ });
2253
+ };
2254
+ const evalExpression = function evalExpression2(props, state, expression) {
2255
+ return expression.replace(
2256
+ /{{([^}]+)}}/g,
2257
+ (_match, group) => evaluate({
2258
+ code: group,
2259
+ context: contextContext(props),
2260
+ state: contentState(props, state)
2261
+ })
2262
+ );
2263
+ };
2264
+ const handleRequest = function handleRequest2(props, state, { url, key }) {
2265
+ const fetchAndSetState = async () => {
2266
+ const fetch2 = await getFetch();
2267
+ const response = await fetch2(url);
2268
+ const json = await response.json();
2269
+ const newOverrideState = {
2270
+ ...state.overrideState,
2271
+ [key]: json
2272
+ };
2273
+ state.overrideState = newOverrideState;
2274
+ };
2275
+ fetchAndSetState();
2276
+ };
2277
+ const runHttpRequests = function runHttpRequests2(props, state) {
2278
+ const requests = useContent(props, state)?.data?.httpRequests ?? {};
2279
+ Object.entries(requests).forEach(([key, url]) => {
2280
+ if (url && (!httpReqsData()[key] || isEditing())) {
2281
+ const evaluatedUrl = evalExpression(props, state, url);
2282
+ handleRequest(props, state, {
2283
+ url: evaluatedUrl,
2284
+ key
2285
+ });
2286
+ }
2287
+ });
2288
+ };
2289
+ const emitStateUpdate = function emitStateUpdate2(props, state) {
2290
+ if (isEditing())
2291
+ window.dispatchEvent(new CustomEvent("builder:component:stateChange", {
2292
+ detail: {
2293
+ state: contentState(props, state),
2294
+ ref: {
2295
+ name: props.model
2296
+ }
2297
+ }
2298
+ }));
2299
+ };
2300
+ const shouldRenderContentStyles = function shouldRenderContentStyles2(props, state) {
2301
+ return Boolean((useContent(props, state)?.data?.cssCode || useContent(props, state)?.data?.customFonts?.length) && TARGET !== "reactNative");
2302
+ };
2303
+ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2304
+ const hostElement = useHostElement();
2305
+ const state = useStore({
2306
+ forceReRenderCount: 0,
2307
+ overrideContent: null,
2308
+ update: 0,
2309
+ overrideState: {}
2310
+ });
2311
+ useContextProvider(stdin_default, useStore({
2312
+ content: (() => {
2313
+ return useContent(props, state);
2314
+ })(),
2315
+ state: (() => {
2316
+ return contentState(props, state);
2317
+ })(),
2318
+ context: (() => {
2319
+ return contextContext(props);
2320
+ })(),
2321
+ apiKey: (() => {
2322
+ return props.apiKey;
2323
+ })(),
2324
+ registeredComponents: (() => {
2325
+ return allRegisteredComponents(props);
2326
+ })()
2327
+ }));
2328
+ useClientEffectQrl(inlinedQrl(() => {
2329
+ const [hostElement2, props2, state2] = useLexicalScope();
2330
+ if (isBrowser()) {
2331
+ if (isEditing()) {
2332
+ state2.forceReRenderCount++;
2333
+ _useMutableProps(hostElement2, true);
2334
+ registerInsertMenu();
2335
+ setupBrowserForEditing();
2336
+ Object.values(allRegisteredComponents(props2)).forEach((registeredComponent) => {
2337
+ const message = createRegisterComponentMessage(registeredComponent);
2338
+ window.parent?.postMessage(message, "*");
2339
+ });
2340
+ window.addEventListener("message", processMessage.bind(null, props2, state2));
2341
+ window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2));
2342
+ }
2343
+ if (useContent(props2, state2) && props2.canTrack !== false)
2344
+ track("impression", {
2345
+ contentId: useContent(props2, state2).id
2346
+ });
2347
+ if (isPreviewing()) {
2348
+ const searchParams = new URL(location.href).searchParams;
2349
+ if (props2.model && searchParams.get("builder.preview") === props2.model) {
2350
+ const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
2351
+ if (previewApiKey)
2352
+ getContent({
2353
+ model: props2.model,
2354
+ apiKey: previewApiKey
2355
+ }).then((content) => {
2356
+ if (content)
2357
+ state2.overrideContent = content;
2358
+ });
2359
+ }
2360
+ }
2361
+ evaluateJsCode(props2, state2);
2362
+ runHttpRequests(props2, state2);
2363
+ emitStateUpdate(props2, state2);
2364
+ }
2365
+ }, "RenderContent_component_useClientEffect_ntruwSC9lSo", [
2366
+ hostElement,
2367
+ props,
2368
+ state
2369
+ ]));
2370
+ useWatchQrl(inlinedQrl(({ track: track1 }) => {
2371
+ const [props2, state2] = useLexicalScope();
2372
+ state2.useContent?.data && track1(state2.useContent?.data, "jsCode");
2373
+ evaluateJsCode(props2, state2);
2374
+ }, "RenderContent_component_useWatch_1P0ujLQOmzc", [
2375
+ props,
2376
+ state
2377
+ ]));
2378
+ useWatchQrl(inlinedQrl(({ track: track2 }) => {
2379
+ const [props2, state2] = useLexicalScope();
2380
+ state2.useContent?.data && track2(state2.useContent?.data, "httpRequests");
2381
+ runHttpRequests(props2, state2);
2382
+ }, "RenderContent_component_useWatch_1_0hAcn4V2AZw", [
2383
+ props,
2384
+ state
2385
+ ]));
2386
+ useWatchQrl(inlinedQrl(({ track: track3 }) => {
2387
+ const [props2, state2] = useLexicalScope();
2388
+ state2 && track3(state2, "contentState");
2389
+ emitStateUpdate(props2, state2);
2390
+ }, "RenderContent_component_useWatch_2_t2n8zpl4mRs", [
2391
+ props,
2392
+ state
2393
+ ]));
2394
+ useCleanupQrl(inlinedQrl(() => {
2395
+ const [props2, state2] = useLexicalScope();
2396
+ if (isBrowser()) {
2397
+ window.removeEventListener("message", processMessage.bind(null, props2, state2));
2398
+ window.removeEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2));
2399
+ }
2400
+ }, "RenderContent_component_useCleanup_sGf1npb03WA", [
2401
+ props,
2402
+ state
2403
+ ]));
2404
+ return /* @__PURE__ */ jsx(Fragment$1, {
2405
+ children: useContent(props, state) ? /* @__PURE__ */ jsxs("div", {
2406
+ onClick$: inlinedQrl((event) => {
2407
+ const [props2, state2] = useLexicalScope();
2408
+ return onClick2(props2, state2);
2409
+ }, "RenderContent_component__Fragment_div_onClick_76e3rL00UYE", [
2410
+ props,
2411
+ state
2412
+ ]),
2413
+ "builder-content-id": useContent(props, state)?.id,
2414
+ children: [
2415
+ shouldRenderContentStyles(props, state) ? /* @__PURE__ */ jsx(RenderContentStyles$1, {
2416
+ cssCode: useContent(props, state)?.data?.cssCode,
2417
+ customFonts: useContent(props, state)?.data?.customFonts
2418
+ }) : null,
2419
+ /* @__PURE__ */ jsx(RenderBlocks$1, {
2420
+ blocks: useContent(props, state)?.data?.blocks
2421
+ }, state.forceReRenderCount)
2422
+ ]
2423
+ }) : null
2424
+ });
2425
+ }, "RenderContent_component_I00xF3zGD1I"));
2426
+ const RenderContent$1 = RenderContent;
2427
+ const Symbol$1 = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
2428
+ const builderContext = useContext(stdin_default);
2429
+ const state = useStore({
2430
+ className: "builder-symbol",
2431
+ content: null
2432
+ });
2433
+ useClientEffectQrl(inlinedQrl(() => {
2434
+ const [props2, state2] = useLexicalScope();
2435
+ state2.content = props2.symbol?.content;
2436
+ }, "Symbol_component_useClientEffect_nexfMR52XGY", [
2437
+ props,
2438
+ state
2439
+ ]));
2440
+ useWatchQrl(inlinedQrl(({ track: track2 }) => {
2441
+ const [builderContext2, props2, state2] = useLexicalScope();
2442
+ props2.symbol && track2(props2.symbol, "content");
2443
+ props2.symbol && track2(props2.symbol, "model");
2444
+ props2.symbol && track2(props2.symbol, "entry");
2445
+ state2 && track2(state2, "content");
2446
+ const symbolToUse = props2.symbol;
2447
+ if (symbolToUse && !symbolToUse.content && !state2.content && symbolToUse.model)
2448
+ getContent({
2449
+ model: symbolToUse.model,
2450
+ apiKey: builderContext2.apiKey,
2451
+ query: {
2452
+ id: symbolToUse.entry
2453
+ }
2454
+ }).then((response) => {
2455
+ state2.content = response;
2456
+ });
2457
+ }, "Symbol_component_useWatch_cKXWtr2eEjY", [
2458
+ builderContext,
2459
+ props,
2460
+ state
2461
+ ]));
2462
+ return /* @__PURE__ */ jsx(Host, {
2463
+ ...props.attributes,
2464
+ dataSet: {
2465
+ class: state.className
2466
+ },
2467
+ class: state.className,
2468
+ children: /* @__PURE__ */ jsx(RenderContent$1, {
2469
+ apiKey: builderContext.apiKey,
2470
+ context: builderContext.context,
2471
+ customComponents: Object.values(builderContext.registeredComponents),
2472
+ data: {
2473
+ ...props.symbol?.data,
2474
+ ...builderContext.state,
2475
+ ...props.symbol?.content?.data?.state
2476
+ },
2477
+ model: props.symbol?.model,
2478
+ content: state.content
2479
+ })
2480
+ });
2481
+ }, "Symbol_component_Dn8mGpai87I"), {
2482
+ tagName: "div"
2483
+ });
2484
+ const Symbol$2 = Symbol$1;
2485
+ const settings = {};
2486
+ function setEditorSettings(newSettings) {
2487
+ if (isBrowser()) {
2488
+ Object.assign(settings, newSettings);
2489
+ const message = {
2490
+ type: "builder.settingsChange",
2491
+ data: settings
2492
+ };
2493
+ parent.postMessage(message, "*");
2494
+ }
2495
+ }
2496
+ export {
2497
+ Button$1 as Button,
2498
+ Columns$1 as Columns,
2499
+ Fragment,
2500
+ Image$1 as Image,
2501
+ RenderBlocks$1 as RenderBlocks,
2502
+ RenderContent$1 as RenderContent,
2503
+ Section,
2504
+ Symbol$2 as Symbol,
2505
+ Text$1 as Text,
2506
+ Video$1 as Video,
2507
+ components,
2508
+ convertSearchParamsToQueryObject,
2509
+ createRegisterComponentMessage,
2510
+ generateContentUrl,
2511
+ getAllContent,
2512
+ getBuilderSearchParams,
2513
+ getBuilderSearchParamsFromWindow,
2514
+ getContent,
2515
+ isEditing,
2516
+ isPreviewing,
2517
+ normalizeSearchParams,
2518
+ register,
2519
+ registerComponent,
2520
+ setEditorSettings
2521
+ };