@builder.io/sdk-qwik 0.13.0 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { componentQrl, inlinedQrl, _jsxBranch, _jsxC, Slot as Slot$1, _fnSignal, _IMMUTABLE, createContextId, _jsxQ, useComputedQrl, useLexicalScope, useStore, useContextProvider, useVisibleTaskQrl, _wrapProp, useStylesScopedQrl, useContext, Fragment as Fragment$1, _jsxS, useSignal, useOn, useTaskQrl, createElement } from "@builder.io/qwik";
1
+ import { componentQrl, inlinedQrl, _jsxBranch, _jsxC, Slot as Slot$1, _fnSignal, _IMMUTABLE, createContextId, _jsxQ, useComputedQrl, useLexicalScope, useStore, useContextProvider, useVisibleTaskQrl, _wrapProp, useStylesScopedQrl, useContext, Fragment as Fragment$1, _jsxS, useSignal, useOn, useTaskQrl, createElement, _wrapSignal } from "@builder.io/qwik";
2
2
  import { Fragment } from "@builder.io/qwik/jsx-runtime";
3
3
  import { isBrowser as isBrowser$1 } from "@builder.io/qwik/build";
4
4
  const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set([
@@ -4255,7 +4255,7 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
4255
4255
  repeatItem
4256
4256
  ]));
4257
4257
  const componentRefProps = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
4258
- var _a2, _b, _c, _d, _e, _f, _g, _h;
4258
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
4259
4259
  const [blockComponent2, processedBlock2, props2, state2] = useLexicalScope();
4260
4260
  return {
4261
4261
  blockChildren: processedBlock2.value.children ?? [],
@@ -4263,10 +4263,10 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
4263
4263
  componentOptions: {
4264
4264
  ...getBlockComponentOptions(processedBlock2.value),
4265
4265
  builderContext: props2.context,
4266
- ...((_b = blockComponent2.value) == null ? void 0 : _b.name) === "Core:Button" || ((_c = blockComponent2.value) == null ? void 0 : _c.name) === "Symbol" || ((_d = blockComponent2.value) == null ? void 0 : _d.name) === "Columns" ? {
4266
+ ...((_b = blockComponent2.value) == null ? void 0 : _b.name) === "Core:Button" || ((_c = blockComponent2.value) == null ? void 0 : _c.name) === "Symbol" || ((_d = blockComponent2.value) == null ? void 0 : _d.name) === "Columns" || ((_e = blockComponent2.value) == null ? void 0 : _e.name) === "Form:Form" ? {
4267
4267
  builderLinkComponent: props2.linkComponent
4268
4268
  } : {},
4269
- ...((_e = blockComponent2.value) == null ? void 0 : _e.name) === "Symbol" || ((_f = blockComponent2.value) == null ? void 0 : _f.name) === "Columns" ? {
4269
+ ...((_f = blockComponent2.value) == null ? void 0 : _f.name) === "Symbol" || ((_g = blockComponent2.value) == null ? void 0 : _g.name) === "Columns" || ((_h = blockComponent2.value) == null ? void 0 : _h.name) === "Form:Form" ? {
4270
4270
  builderComponents: props2.registeredComponents
4271
4271
  } : {}
4272
4272
  },
@@ -4274,8 +4274,8 @@ const Block = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
4274
4274
  linkComponent: props2.linkComponent,
4275
4275
  registeredComponents: props2.registeredComponents,
4276
4276
  builderBlock: processedBlock2.value,
4277
- includeBlockProps: ((_g = blockComponent2.value) == null ? void 0 : _g.noWrap) === true,
4278
- isInteractive: !((_h = blockComponent2.value) == null ? void 0 : _h.isRSC)
4277
+ includeBlockProps: ((_i = blockComponent2.value) == null ? void 0 : _i.noWrap) === true,
4278
+ isInteractive: !((_j = blockComponent2.value) == null ? void 0 : _j.isRSC)
4279
4279
  };
4280
4280
  }, "Block_component_componentRefProps_useComputed_Ikbl8VO04ho", [
4281
4281
  blockComponent,
@@ -4536,7 +4536,7 @@ const onMouseEnter = function onMouseEnter2(props, state) {
4536
4536
  }, "*");
4537
4537
  };
4538
4538
  const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
4539
- useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$2, "BlocksWrapper_component_useStylesScoped_Kj0S9AOXQ0o"));
4539
+ useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "BlocksWrapper_component_useStylesScoped_Kj0S9AOXQ0o"));
4540
4540
  const className = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
4541
4541
  var _a;
4542
4542
  const [props2] = useLexicalScope();
@@ -4597,7 +4597,7 @@ const BlocksWrapper = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((p
4597
4597
  }
4598
4598
  }, 0, "3u_1");
4599
4599
  }, "BlocksWrapper_component_45hR0o6abzg"));
4600
- const STYLES$2 = `
4600
+ const STYLES$3 = `
4601
4601
  .props-blocks-wrapper-BlocksWrapper {
4602
4602
  display: flex;
4603
4603
  flex-direction: column;
@@ -4747,7 +4747,7 @@ const Columns = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
4747
4747
  gutterSize: typeof props.space === "number" ? props.space || 0 : 20,
4748
4748
  stackAt: props.stackColumnsAt || "tablet"
4749
4749
  });
4750
- useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$1, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
4750
+ useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$2, "Columns_component_useStylesScoped_s7JLZz7MCCQ"));
4751
4751
  const columnsCssVars = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
4752
4752
  const [props2, state2] = useLexicalScope();
4753
4753
  return {
@@ -4864,7 +4864,7 @@ const Columns = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props)
4864
4864
  })
4865
4865
  ], 1, "c0_2");
4866
4866
  }, "Columns_component_7yLj4bxdI6c"));
4867
- const STYLES$1 = `
4867
+ const STYLES$2 = `
4868
4868
  .div-Columns {
4869
4869
  display: flex;
4870
4870
  line-height: normal;
@@ -4930,7 +4930,7 @@ function getSrcSet(url) {
4930
4930
  const Image = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
4931
4931
  var _a, _b, _c, _d;
4932
4932
  _jsxBranch();
4933
- useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES, "Image_component_useStylesScoped_fBMYiVf9fuU"));
4933
+ useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$1, "Image_component_useStylesScoped_fBMYiVf9fuU"));
4934
4934
  const srcSetToUse = useComputedQrl(/* @__PURE__ */ inlinedQrl(() => {
4935
4935
  var _a2;
4936
4936
  const [props2] = useLexicalScope();
@@ -5030,7 +5030,7 @@ const Image = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
5030
5030
  ]
5031
5031
  }, 1, "0A_5");
5032
5032
  }, "Image_component_LRxDkFa1EfU"));
5033
- const STYLES = `
5033
+ const STYLES$1 = `
5034
5034
  .img-Image {
5035
5035
  opacity: 1;
5036
5036
  transition: opacity 0.2s ease-in-out;
@@ -5243,7 +5243,7 @@ const handleABTesting = async ({ item, canTrack }) => {
5243
5243
  };
5244
5244
  };
5245
5245
  const getDefaultCanTrack = (canTrack) => checkIsDefined(canTrack) ? canTrack : true;
5246
- const componentInfo$b = {
5246
+ const componentInfo$f = {
5247
5247
  name: "Core:Button",
5248
5248
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
5249
5249
  defaultStyles: {
@@ -5281,7 +5281,7 @@ const componentInfo$b = {
5281
5281
  static: true,
5282
5282
  noWrap: true
5283
5283
  };
5284
- const componentInfo$a = {
5284
+ const componentInfo$e = {
5285
5285
  // TODO: ways to statically preprocess JSON for references, functions, etc
5286
5286
  name: "Columns",
5287
5287
  isRSC: true,
@@ -5523,186 +5523,14 @@ const componentInfo$a = {
5523
5523
  }
5524
5524
  ]
5525
5525
  };
5526
- const componentInfo$9 = {
5527
- name: "Custom Code",
5528
- static: true,
5529
- requiredPermissions: [
5530
- "editCode"
5531
- ],
5532
- inputs: [
5533
- {
5534
- name: "code",
5535
- type: "html",
5536
- required: true,
5537
- defaultValue: "<p>Hello there, I am custom HTML code!</p>",
5538
- code: true
5539
- },
5540
- {
5541
- name: "replaceNodes",
5542
- type: "boolean",
5543
- helperText: "Preserve server rendered dom nodes",
5544
- advanced: true
5545
- },
5546
- {
5547
- name: "scriptsClientOnly",
5548
- type: "boolean",
5549
- defaultValue: false,
5550
- helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
5551
- advanced: true
5552
- }
5553
- ]
5554
- };
5555
- const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
5556
- const elementRef = useSignal();
5557
- const state = useStore({
5558
- scriptsInserted: [],
5559
- scriptsRun: []
5560
- });
5561
- useOn("qvisible", /* @__PURE__ */ inlinedQrl((event, element) => {
5562
- const [state2] = useLexicalScope();
5563
- if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
5564
- return;
5565
- const scripts = element.getElementsByTagName("script");
5566
- for (let i = 0; i < scripts.length; i++) {
5567
- const script = scripts[i];
5568
- if (script.src) {
5569
- if (state2.scriptsInserted.includes(script.src))
5570
- continue;
5571
- state2.scriptsInserted.push(script.src);
5572
- const newScript = document.createElement("script");
5573
- newScript.async = true;
5574
- newScript.src = script.src;
5575
- document.head.appendChild(newScript);
5576
- } else if (!script.type || [
5577
- "text/javascript",
5578
- "application/javascript",
5579
- "application/ecmascript"
5580
- ].includes(script.type)) {
5581
- if (state2.scriptsRun.includes(script.innerText))
5582
- continue;
5583
- try {
5584
- state2.scriptsRun.push(script.innerText);
5585
- new Function(script.innerText)();
5586
- } catch (error) {
5587
- console.warn("`CustomCode`: Error running script:", error);
5588
- }
5589
- }
5590
- }
5591
- }, "CustomCode_component_useOn_zjAgBhFOiCs", [
5592
- state
5593
- ]));
5594
- return /* @__PURE__ */ _jsxQ("div", {
5595
- ref: elementRef
5596
- }, {
5597
- class: _fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
5598
- props
5599
- ], '"builder-custom-code"+(p0.replaceNodes?" replace-nodes":"")'),
5600
- dangerouslySetInnerHTML: _fnSignal((p0) => p0.code, [
5601
- props
5602
- ], "p0.code")
5603
- }, null, 3, "bY_0");
5604
- }, "CustomCode_component_uYOSy7w7Zqw"));
5605
- const componentInfo$8 = {
5606
- name: "Embed",
5607
- static: true,
5608
- inputs: [
5609
- {
5610
- name: "url",
5611
- type: "url",
5612
- required: true,
5613
- defaultValue: "",
5614
- helperText: "e.g. enter a youtube url, google map, etc",
5615
- onChange: (options) => {
5616
- const url = options.get("url");
5617
- if (url) {
5618
- options.set("content", "Loading...");
5619
- const apiKey = "ae0e60e78201a3f2b0de4b";
5620
- return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
5621
- if (options.get("url") === url) {
5622
- if (data.html)
5623
- options.set("content", data.html);
5624
- else
5625
- options.set("content", "Invalid url, please try another");
5626
- }
5627
- }).catch((_err) => {
5628
- options.set("content", "There was an error embedding this URL, please try again or another URL");
5629
- });
5630
- } else
5631
- options.delete("content");
5632
- }
5633
- },
5634
- {
5635
- name: "content",
5636
- type: "html",
5637
- defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
5638
- hideFromUI: true
5639
- }
5640
- ]
5641
- };
5642
- const SCRIPT_MIME_TYPES = [
5643
- "text/javascript",
5644
- "application/javascript",
5645
- "application/ecmascript"
5646
- ];
5647
- const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
5648
- const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
5649
- if (!elem.value || !elem.value.getElementsByTagName)
5650
- return;
5651
- const scripts = elem.value.getElementsByTagName("script");
5652
- for (let i = 0; i < scripts.length; i++) {
5653
- const script = scripts[i];
5654
- if (script.src && !state.scriptsInserted.includes(script.src)) {
5655
- state.scriptsInserted.push(script.src);
5656
- const newScript = document.createElement("script");
5657
- newScript.async = true;
5658
- newScript.src = script.src;
5659
- document.head.appendChild(newScript);
5660
- } else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
5661
- try {
5662
- state.scriptsRun.push(script.innerText);
5663
- new Function(script.innerText)();
5664
- } catch (error) {
5665
- console.warn("`Embed`: Error running script:", error);
5666
- }
5667
- }
5668
- };
5669
- const Embed = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
5670
- const elem = useSignal();
5671
- const state = useStore({
5672
- ranInitFn: false,
5673
- scriptsInserted: [],
5674
- scriptsRun: []
5675
- });
5676
- useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
5677
- const [elem2, props2, state2] = useLexicalScope();
5678
- track2(() => elem2.value);
5679
- track2(() => state2.ranInitFn);
5680
- if (elem2.value && !state2.ranInitFn) {
5681
- state2.ranInitFn = true;
5682
- findAndRunScripts(props2, state2, elem2);
5683
- }
5684
- }, "Embed_component_useTask_bg7ez0XUtiM", [
5685
- elem,
5686
- props,
5687
- state
5688
- ]));
5689
- return /* @__PURE__ */ _jsxQ("div", {
5690
- ref: elem
5691
- }, {
5692
- class: "builder-embed",
5693
- dangerouslySetInnerHTML: _fnSignal((p0) => p0.content, [
5694
- props
5695
- ], "p0.content")
5696
- }, null, 3, "9r_0");
5697
- }, "Embed_component_Uji08ORjXbE"));
5698
- const componentInfo$7 = {
5526
+ const componentInfo$d = {
5699
5527
  name: "Fragment",
5700
5528
  static: true,
5701
5529
  hidden: true,
5702
5530
  canHaveChildren: true,
5703
5531
  noWrap: true
5704
5532
  };
5705
- const componentInfo$6 = {
5533
+ const componentInfo$c = {
5706
5534
  name: "Image",
5707
5535
  static: true,
5708
5536
  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",
@@ -5850,49 +5678,7 @@ const componentInfo$6 = {
5850
5678
  }
5851
5679
  ]
5852
5680
  };
5853
- const componentInfo$5 = {
5854
- // friendlyName?
5855
- name: "Raw:Img",
5856
- hideFromInsertMenu: true,
5857
- 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",
5858
- inputs: [
5859
- {
5860
- name: "image",
5861
- bubble: true,
5862
- type: "file",
5863
- allowedFileTypes: [
5864
- "jpeg",
5865
- "jpg",
5866
- "png",
5867
- "svg",
5868
- "gif",
5869
- "webp"
5870
- ],
5871
- required: true
5872
- }
5873
- ],
5874
- noWrap: true,
5875
- static: true
5876
- };
5877
- const ImgComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
5878
- return /* @__PURE__ */ _jsxS("img", {
5879
- ...props.attributes
5880
- }, {
5881
- alt: _fnSignal((p0) => p0.altText, [
5882
- props
5883
- ], "p0.altText"),
5884
- src: _fnSignal((p0) => p0.imgSrc || p0.image, [
5885
- props
5886
- ], "p0.imgSrc||p0.image"),
5887
- style: _fnSignal((p0) => ({
5888
- objectFit: p0.backgroundSize || "cover",
5889
- objectPosition: p0.backgroundPosition || "center"
5890
- }), [
5891
- props
5892
- ], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
5893
- }, 0, isEditing() && props.imgSrc || "default-key");
5894
- }, "ImgComponent_component_FXvIDBSffO8"));
5895
- const componentInfo$4 = {
5681
+ const componentInfo$b = {
5896
5682
  name: "Core:Section",
5897
5683
  static: true,
5898
5684
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -5937,7 +5723,7 @@ const componentInfo$4 = {
5937
5723
  }
5938
5724
  ]
5939
5725
  };
5940
- const componentInfo$3 = {
5726
+ const componentInfo$a = {
5941
5727
  name: "Slot",
5942
5728
  isRSC: true,
5943
5729
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -5992,7 +5778,7 @@ const Slot = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
5992
5778
  }
5993
5779
  }, 0, "B1_1");
5994
5780
  }, "Slot_component_WWgWgfV0bb0"));
5995
- const componentInfo$2 = {
5781
+ const componentInfo$9 = {
5996
5782
  name: "Symbol",
5997
5783
  noWrap: true,
5998
5784
  static: true,
@@ -6032,7 +5818,7 @@ const componentInfo$2 = {
6032
5818
  }
6033
5819
  ]
6034
5820
  };
6035
- const componentInfo$1 = {
5821
+ const componentInfo$8 = {
6036
5822
  name: "Text",
6037
5823
  static: true,
6038
5824
  isRSC: true,
@@ -6067,27 +5853,1006 @@ const Text = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
6067
5853
  }
6068
5854
  }, null, 3, "yO_0");
6069
5855
  }, "Text_component_15p0cKUxgIE"));
6070
- const componentInfo = {
6071
- name: "Video",
6072
- canHaveChildren: true,
6073
- defaultStyles: {
6074
- minHeight: "20px",
6075
- minWidth: "20px"
6076
- },
6077
- 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",
5856
+ const componentInfo$7 = {
5857
+ name: "Custom Code",
5858
+ static: true,
5859
+ requiredPermissions: [
5860
+ "editCode"
5861
+ ],
6078
5862
  inputs: [
6079
5863
  {
6080
- name: "video",
6081
- type: "file",
6082
- allowedFileTypes: [
6083
- "mp4"
6084
- ],
6085
- bubble: true,
6086
- defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
6087
- required: true
6088
- },
6089
- {
6090
- name: "posterImage",
5864
+ name: "code",
5865
+ type: "html",
5866
+ required: true,
5867
+ defaultValue: "<p>Hello there, I am custom HTML code!</p>",
5868
+ code: true
5869
+ },
5870
+ {
5871
+ name: "replaceNodes",
5872
+ type: "boolean",
5873
+ helperText: "Preserve server rendered dom nodes",
5874
+ advanced: true
5875
+ },
5876
+ {
5877
+ name: "scriptsClientOnly",
5878
+ type: "boolean",
5879
+ defaultValue: false,
5880
+ helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
5881
+ advanced: true
5882
+ }
5883
+ ]
5884
+ };
5885
+ const CustomCode = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
5886
+ const elementRef = useSignal();
5887
+ const state = useStore({
5888
+ scriptsInserted: [],
5889
+ scriptsRun: []
5890
+ });
5891
+ useOn("qvisible", /* @__PURE__ */ inlinedQrl((event, element) => {
5892
+ const [state2] = useLexicalScope();
5893
+ if (!(element == null ? void 0 : element.getElementsByTagName) || typeof window === "undefined")
5894
+ return;
5895
+ const scripts = element.getElementsByTagName("script");
5896
+ for (let i = 0; i < scripts.length; i++) {
5897
+ const script = scripts[i];
5898
+ if (script.src) {
5899
+ if (state2.scriptsInserted.includes(script.src))
5900
+ continue;
5901
+ state2.scriptsInserted.push(script.src);
5902
+ const newScript = document.createElement("script");
5903
+ newScript.async = true;
5904
+ newScript.src = script.src;
5905
+ document.head.appendChild(newScript);
5906
+ } else if (!script.type || [
5907
+ "text/javascript",
5908
+ "application/javascript",
5909
+ "application/ecmascript"
5910
+ ].includes(script.type)) {
5911
+ if (state2.scriptsRun.includes(script.innerText))
5912
+ continue;
5913
+ try {
5914
+ state2.scriptsRun.push(script.innerText);
5915
+ new Function(script.innerText)();
5916
+ } catch (error) {
5917
+ console.warn("`CustomCode`: Error running script:", error);
5918
+ }
5919
+ }
5920
+ }
5921
+ }, "CustomCode_component_useOn_zjAgBhFOiCs", [
5922
+ state
5923
+ ]));
5924
+ return /* @__PURE__ */ _jsxQ("div", {
5925
+ ref: elementRef
5926
+ }, {
5927
+ class: _fnSignal((p0) => "builder-custom-code" + (p0.replaceNodes ? " replace-nodes" : ""), [
5928
+ props
5929
+ ], '"builder-custom-code"+(p0.replaceNodes?" replace-nodes":"")'),
5930
+ dangerouslySetInnerHTML: _fnSignal((p0) => p0.code, [
5931
+ props
5932
+ ], "p0.code")
5933
+ }, null, 3, "bY_0");
5934
+ }, "CustomCode_component_uYOSy7w7Zqw"));
5935
+ const componentInfo$6 = {
5936
+ name: "Embed",
5937
+ static: true,
5938
+ inputs: [
5939
+ {
5940
+ name: "url",
5941
+ type: "url",
5942
+ required: true,
5943
+ defaultValue: "",
5944
+ helperText: "e.g. enter a youtube url, google map, etc",
5945
+ onChange: (options) => {
5946
+ const url = options.get("url");
5947
+ if (url) {
5948
+ options.set("content", "Loading...");
5949
+ const apiKey = "ae0e60e78201a3f2b0de4b";
5950
+ return fetch(`https://iframe.ly/api/iframely?url=${url}&api_key=${apiKey}`).then((res) => res.json()).then((data) => {
5951
+ if (options.get("url") === url) {
5952
+ if (data.html)
5953
+ options.set("content", data.html);
5954
+ else
5955
+ options.set("content", "Invalid url, please try another");
5956
+ }
5957
+ }).catch((_err) => {
5958
+ options.set("content", "There was an error embedding this URL, please try again or another URL");
5959
+ });
5960
+ } else
5961
+ options.delete("content");
5962
+ }
5963
+ },
5964
+ {
5965
+ name: "content",
5966
+ type: "html",
5967
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
5968
+ hideFromUI: true
5969
+ }
5970
+ ]
5971
+ };
5972
+ const SCRIPT_MIME_TYPES = [
5973
+ "text/javascript",
5974
+ "application/javascript",
5975
+ "application/ecmascript"
5976
+ ];
5977
+ const isJsScript = (script) => SCRIPT_MIME_TYPES.includes(script.type);
5978
+ const findAndRunScripts = function findAndRunScripts2(props, state, elem) {
5979
+ if (!elem.value || !elem.value.getElementsByTagName)
5980
+ return;
5981
+ const scripts = elem.value.getElementsByTagName("script");
5982
+ for (let i = 0; i < scripts.length; i++) {
5983
+ const script = scripts[i];
5984
+ if (script.src && !state.scriptsInserted.includes(script.src)) {
5985
+ state.scriptsInserted.push(script.src);
5986
+ const newScript = document.createElement("script");
5987
+ newScript.async = true;
5988
+ newScript.src = script.src;
5989
+ document.head.appendChild(newScript);
5990
+ } else if (isJsScript(script) && !state.scriptsRun.includes(script.innerText))
5991
+ try {
5992
+ state.scriptsRun.push(script.innerText);
5993
+ new Function(script.innerText)();
5994
+ } catch (error) {
5995
+ console.warn("`Embed`: Error running script:", error);
5996
+ }
5997
+ }
5998
+ };
5999
+ const Embed = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
6000
+ const elem = useSignal();
6001
+ const state = useStore({
6002
+ ranInitFn: false,
6003
+ scriptsInserted: [],
6004
+ scriptsRun: []
6005
+ });
6006
+ useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
6007
+ const [elem2, props2, state2] = useLexicalScope();
6008
+ track2(() => elem2.value);
6009
+ track2(() => state2.ranInitFn);
6010
+ if (elem2.value && !state2.ranInitFn) {
6011
+ state2.ranInitFn = true;
6012
+ findAndRunScripts(props2, state2, elem2);
6013
+ }
6014
+ }, "Embed_component_useTask_bg7ez0XUtiM", [
6015
+ elem,
6016
+ props,
6017
+ state
6018
+ ]));
6019
+ return /* @__PURE__ */ _jsxQ("div", {
6020
+ ref: elem
6021
+ }, {
6022
+ class: "builder-embed",
6023
+ dangerouslySetInnerHTML: _fnSignal((p0) => p0.content, [
6024
+ props
6025
+ ], "p0.content")
6026
+ }, null, 3, "9r_0");
6027
+ }, "Embed_component_Uji08ORjXbE"));
6028
+ const componentInfo$5 = {
6029
+ name: "Form:Form",
6030
+ // editableTags: ['builder-form-error']
6031
+ defaults: {
6032
+ responsiveStyles: {
6033
+ large: {
6034
+ marginTop: "15px",
6035
+ paddingBottom: "15px"
6036
+ }
6037
+ }
6038
+ },
6039
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",
6040
+ inputs: [
6041
+ {
6042
+ name: "sendSubmissionsTo",
6043
+ type: "string",
6044
+ // TODO: save to builder data and user can download as csv
6045
+ // TODO: easy for mode too or computed add/remove fields form mode
6046
+ // so you can edit details and high level mode at same time...
6047
+ // Later - more integrations like mailchimp
6048
+ // /api/v1/form-submit?to=mailchimp
6049
+ enum: [
6050
+ {
6051
+ label: "Send to email",
6052
+ value: "email",
6053
+ helperText: "Send form submissions to the email address of your choosing"
6054
+ },
6055
+ {
6056
+ label: "Custom",
6057
+ value: "custom",
6058
+ helperText: "Handle where the form requests go manually with a little code, e.g. to your own custom backend"
6059
+ }
6060
+ ],
6061
+ defaultValue: "email"
6062
+ },
6063
+ {
6064
+ name: "sendSubmissionsToEmail",
6065
+ type: "string",
6066
+ required: true,
6067
+ // TODO: required: () => options.get("sendSubmissionsTo") === "email"
6068
+ defaultValue: "your@email.com",
6069
+ showIf: 'options.get("sendSubmissionsTo") === "email"'
6070
+ },
6071
+ {
6072
+ name: "sendWithJs",
6073
+ type: "boolean",
6074
+ helperText: "Set to false to use basic html form action",
6075
+ defaultValue: true,
6076
+ showIf: 'options.get("sendSubmissionsTo") === "custom"'
6077
+ },
6078
+ {
6079
+ name: "name",
6080
+ type: "string",
6081
+ defaultValue: "My form"
6082
+ },
6083
+ {
6084
+ name: "action",
6085
+ type: "string",
6086
+ helperText: "URL to send the form data to",
6087
+ showIf: 'options.get("sendSubmissionsTo") === "custom"'
6088
+ },
6089
+ {
6090
+ name: "contentType",
6091
+ type: "string",
6092
+ defaultValue: "application/json",
6093
+ advanced: true,
6094
+ // TODO: do automatically if file input
6095
+ enum: [
6096
+ "application/json",
6097
+ "multipart/form-data",
6098
+ "application/x-www-form-urlencoded"
6099
+ ],
6100
+ showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
6101
+ },
6102
+ {
6103
+ name: "method",
6104
+ type: "string",
6105
+ showIf: 'options.get("sendSubmissionsTo") === "custom"',
6106
+ defaultValue: "POST",
6107
+ advanced: true
6108
+ },
6109
+ {
6110
+ name: "previewState",
6111
+ type: "string",
6112
+ // TODO: persist: false flag
6113
+ enum: [
6114
+ "unsubmitted",
6115
+ "sending",
6116
+ "success",
6117
+ "error"
6118
+ ],
6119
+ defaultValue: "unsubmitted",
6120
+ helperText: 'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',
6121
+ showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
6122
+ },
6123
+ {
6124
+ name: "successUrl",
6125
+ type: "url",
6126
+ helperText: "Optional URL to redirect the user to on form submission success",
6127
+ showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
6128
+ },
6129
+ {
6130
+ name: "resetFormOnSubmit",
6131
+ type: "boolean",
6132
+ showIf: "options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",
6133
+ advanced: true
6134
+ },
6135
+ {
6136
+ name: "successMessage",
6137
+ type: "uiBlocks",
6138
+ hideFromUI: true,
6139
+ defaultValue: [
6140
+ {
6141
+ "@type": "@builder.io/sdk:Element",
6142
+ responsiveStyles: {
6143
+ large: {
6144
+ marginTop: "10px"
6145
+ }
6146
+ },
6147
+ component: {
6148
+ name: "Text",
6149
+ options: {
6150
+ text: "<span>Thanks!</span>"
6151
+ }
6152
+ }
6153
+ }
6154
+ ]
6155
+ },
6156
+ {
6157
+ name: "validate",
6158
+ type: "boolean",
6159
+ defaultValue: true,
6160
+ advanced: true
6161
+ },
6162
+ {
6163
+ name: "errorMessagePath",
6164
+ type: "text",
6165
+ advanced: true,
6166
+ helperText: 'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'
6167
+ },
6168
+ {
6169
+ name: "errorMessage",
6170
+ type: "uiBlocks",
6171
+ hideFromUI: true,
6172
+ defaultValue: [
6173
+ {
6174
+ "@type": "@builder.io/sdk:Element",
6175
+ responsiveStyles: {
6176
+ large: {
6177
+ marginTop: "10px"
6178
+ }
6179
+ },
6180
+ bindings: {
6181
+ "component.options.text": "state.formErrorMessage || block.component.options.text"
6182
+ },
6183
+ component: {
6184
+ name: "Text",
6185
+ options: {
6186
+ text: "<span>Form submission error :( Please check your answers and try again</span>"
6187
+ }
6188
+ }
6189
+ }
6190
+ ]
6191
+ },
6192
+ {
6193
+ name: "sendingMessage",
6194
+ type: "uiBlocks",
6195
+ hideFromUI: true,
6196
+ defaultValue: [
6197
+ {
6198
+ "@type": "@builder.io/sdk:Element",
6199
+ responsiveStyles: {
6200
+ large: {
6201
+ marginTop: "10px"
6202
+ }
6203
+ },
6204
+ component: {
6205
+ name: "Text",
6206
+ options: {
6207
+ text: "<span>Sending...</span>"
6208
+ }
6209
+ }
6210
+ }
6211
+ ]
6212
+ },
6213
+ {
6214
+ name: "customHeaders",
6215
+ type: "map",
6216
+ valueType: {
6217
+ type: "string"
6218
+ },
6219
+ advanced: true,
6220
+ showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
6221
+ }
6222
+ ],
6223
+ noWrap: true,
6224
+ canHaveChildren: true,
6225
+ defaultChildren: [
6226
+ {
6227
+ "@type": "@builder.io/sdk:Element",
6228
+ responsiveStyles: {
6229
+ large: {
6230
+ marginTop: "10px"
6231
+ }
6232
+ },
6233
+ component: {
6234
+ name: "Text",
6235
+ options: {
6236
+ text: "<span>Enter your name</span>"
6237
+ }
6238
+ }
6239
+ },
6240
+ {
6241
+ "@type": "@builder.io/sdk:Element",
6242
+ responsiveStyles: {
6243
+ large: {
6244
+ marginTop: "10px"
6245
+ }
6246
+ },
6247
+ component: {
6248
+ name: "Form:Input",
6249
+ options: {
6250
+ name: "name",
6251
+ placeholder: "Jane Doe"
6252
+ }
6253
+ }
6254
+ },
6255
+ {
6256
+ "@type": "@builder.io/sdk:Element",
6257
+ responsiveStyles: {
6258
+ large: {
6259
+ marginTop: "10px"
6260
+ }
6261
+ },
6262
+ component: {
6263
+ name: "Text",
6264
+ options: {
6265
+ text: "<span>Enter your email</span>"
6266
+ }
6267
+ }
6268
+ },
6269
+ {
6270
+ "@type": "@builder.io/sdk:Element",
6271
+ responsiveStyles: {
6272
+ large: {
6273
+ marginTop: "10px"
6274
+ }
6275
+ },
6276
+ component: {
6277
+ name: "Form:Input",
6278
+ options: {
6279
+ name: "email",
6280
+ placeholder: "jane@doe.com"
6281
+ }
6282
+ }
6283
+ },
6284
+ {
6285
+ "@type": "@builder.io/sdk:Element",
6286
+ responsiveStyles: {
6287
+ large: {
6288
+ marginTop: "10px"
6289
+ }
6290
+ },
6291
+ component: {
6292
+ name: "Form:SubmitButton",
6293
+ options: {
6294
+ text: "Submit"
6295
+ }
6296
+ }
6297
+ }
6298
+ ]
6299
+ };
6300
+ const validEnvList = [
6301
+ "production",
6302
+ "qa",
6303
+ "test",
6304
+ "development",
6305
+ "dev",
6306
+ "cdn-qa",
6307
+ "cloud",
6308
+ "fast",
6309
+ "cdn2",
6310
+ "cdn-prod"
6311
+ ];
6312
+ const getEnv = () => {
6313
+ const env = process.env.NODE_ENV || "production";
6314
+ return validEnvList.includes(env) ? env : "production";
6315
+ };
6316
+ const get = (obj, path, defaultValue) => {
6317
+ const result = String.prototype.split.call(path, /[,[\].]+?/).filter(Boolean).reduce((res, key) => res !== null && res !== void 0 ? res[key] : res, obj);
6318
+ return result === void 0 || result === obj ? defaultValue : result;
6319
+ };
6320
+ const mergeNewRootState$1 = function mergeNewRootState2(props, state, formRef, newData) {
6321
+ var _a, _b;
6322
+ const combinedState = {
6323
+ ...props.builderContext.rootState,
6324
+ ...newData
6325
+ };
6326
+ if (props.builderContext.rootSetState)
6327
+ (_b = (_a = props.builderContext).rootSetState) == null ? void 0 : _b.call(_a, combinedState);
6328
+ else
6329
+ props.builderContext.rootState = combinedState;
6330
+ };
6331
+ const submissionState = function submissionState2(props, state, formRef) {
6332
+ return isEditing() && props.previewState || state.formState;
6333
+ };
6334
+ const onSubmit = function onSubmit2(props, state, formRef, event) {
6335
+ var _a;
6336
+ const sendWithJsProp = props.sendWithJs || props.sendSubmissionsTo === "email";
6337
+ if (props.sendSubmissionsTo === "zapier")
6338
+ event.preventDefault();
6339
+ else if (sendWithJsProp) {
6340
+ if (!(props.action || props.sendSubmissionsTo === "email")) {
6341
+ event.preventDefault();
6342
+ return;
6343
+ }
6344
+ event.preventDefault();
6345
+ const el = event.currentTarget;
6346
+ const headers = props.customHeaders || {};
6347
+ let body;
6348
+ const formData = new FormData(el);
6349
+ const formPairs = Array.from(event.currentTarget.querySelectorAll("input,select,textarea")).filter((el2) => !!el2.name).map((el2) => {
6350
+ let value;
6351
+ const key = el2.name;
6352
+ if (el2 instanceof HTMLInputElement) {
6353
+ if (el2.type === "radio") {
6354
+ if (el2.checked) {
6355
+ value = el2.name;
6356
+ return {
6357
+ key,
6358
+ value
6359
+ };
6360
+ }
6361
+ } else if (el2.type === "checkbox")
6362
+ value = el2.checked;
6363
+ else if (el2.type === "number" || el2.type === "range") {
6364
+ const num = el2.valueAsNumber;
6365
+ if (!isNaN(num))
6366
+ value = num;
6367
+ } else if (el2.type === "file")
6368
+ value = el2.files;
6369
+ else
6370
+ value = el2.value;
6371
+ } else
6372
+ value = el2.value;
6373
+ return {
6374
+ key,
6375
+ value
6376
+ };
6377
+ });
6378
+ let formContentType = props.contentType;
6379
+ if (props.sendSubmissionsTo === "email")
6380
+ formContentType = "multipart/form-data";
6381
+ Array.from(formPairs).forEach(({ value }) => {
6382
+ if (value instanceof File || Array.isArray(value) && value[0] instanceof File || value instanceof FileList)
6383
+ formContentType = "multipart/form-data";
6384
+ });
6385
+ if (formContentType !== "application/json")
6386
+ body = formData;
6387
+ else {
6388
+ const json = {};
6389
+ Array.from(formPairs).forEach(({ value, key }) => {
6390
+ set(json, key, value);
6391
+ });
6392
+ body = JSON.stringify(json);
6393
+ }
6394
+ if (formContentType && formContentType !== "multipart/form-data") {
6395
+ if (
6396
+ /* Zapier doesn't allow content-type header to be sent from browsers */
6397
+ !(sendWithJsProp && ((_a = props.action) == null ? void 0 : _a.includes("zapier.com")))
6398
+ )
6399
+ headers["content-type"] = formContentType;
6400
+ }
6401
+ const presubmitEvent = new CustomEvent("presubmit", {
6402
+ detail: {
6403
+ body
6404
+ }
6405
+ });
6406
+ if (formRef.value) {
6407
+ formRef.value.dispatchEvent(presubmitEvent);
6408
+ if (presubmitEvent.defaultPrevented)
6409
+ return;
6410
+ }
6411
+ state.formState = "sending";
6412
+ const formUrl = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${props.builderContext.apiKey}&to=${btoa(props.sendSubmissionsToEmail || "")}&name=${encodeURIComponent(props.name || "")}`;
6413
+ fetch(props.sendSubmissionsTo === "email" ? formUrl : props.action, {
6414
+ body,
6415
+ headers,
6416
+ method: props.method || "post"
6417
+ }).then(async (res) => {
6418
+ let body2;
6419
+ const contentType = res.headers.get("content-type");
6420
+ if (contentType && contentType.indexOf("application/json") !== -1)
6421
+ body2 = await res.json();
6422
+ else
6423
+ body2 = await res.text();
6424
+ if (!res.ok && props.errorMessagePath) {
6425
+ let message = get(body2, props.errorMessagePath);
6426
+ if (message) {
6427
+ if (typeof message !== "string")
6428
+ message = JSON.stringify(message);
6429
+ state.formErrorMessage = message;
6430
+ mergeNewRootState$1(props, state, formRef, {
6431
+ formErrorMessage: message
6432
+ });
6433
+ }
6434
+ }
6435
+ state.responseData = body2;
6436
+ state.formState = res.ok ? "success" : "error";
6437
+ if (res.ok) {
6438
+ const submitSuccessEvent = new CustomEvent("submit:success", {
6439
+ detail: {
6440
+ res,
6441
+ body: body2
6442
+ }
6443
+ });
6444
+ if (formRef.value) {
6445
+ formRef.value.dispatchEvent(submitSuccessEvent);
6446
+ if (submitSuccessEvent.defaultPrevented)
6447
+ return;
6448
+ if (props.resetFormOnSubmit !== false)
6449
+ formRef.value.reset();
6450
+ }
6451
+ if (props.successUrl) {
6452
+ if (formRef.value) {
6453
+ const event2 = new CustomEvent("route", {
6454
+ detail: {
6455
+ url: props.successUrl
6456
+ }
6457
+ });
6458
+ formRef.value.dispatchEvent(event2);
6459
+ if (!event2.defaultPrevented)
6460
+ location.href = props.successUrl;
6461
+ } else
6462
+ location.href = props.successUrl;
6463
+ }
6464
+ }
6465
+ }, (err) => {
6466
+ const submitErrorEvent = new CustomEvent("submit:error", {
6467
+ detail: {
6468
+ error: err
6469
+ }
6470
+ });
6471
+ if (formRef.value) {
6472
+ formRef.value.dispatchEvent(submitErrorEvent);
6473
+ if (submitErrorEvent.defaultPrevented)
6474
+ return;
6475
+ }
6476
+ state.responseData = err;
6477
+ state.formState = "error";
6478
+ });
6479
+ }
6480
+ };
6481
+ const FormComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
6482
+ var _a;
6483
+ _jsxBranch();
6484
+ useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES, "FormComponent_component_useStylesScoped_SVdPvm0do3s"));
6485
+ const formRef = useSignal();
6486
+ const state = useStore({
6487
+ formErrorMessage: "",
6488
+ formState: "unsubmitted",
6489
+ responseData: null
6490
+ });
6491
+ return /* @__PURE__ */ _jsxS("form", {
6492
+ action: (() => {
6493
+ !props.sendWithJs && props.action;
6494
+ })(),
6495
+ ref: formRef,
6496
+ ...props.attributes,
6497
+ children: [
6498
+ props.builderBlock && props.builderBlock.children ? (((_a = props.builderBlock) == null ? void 0 : _a.children) || []).map((block, idx) => {
6499
+ return /* @__PURE__ */ _jsxC(Block, {
6500
+ block,
6501
+ get context() {
6502
+ return props.builderContext;
6503
+ },
6504
+ get registeredComponents() {
6505
+ return props.builderComponents;
6506
+ },
6507
+ get linkComponent() {
6508
+ return props.builderLinkComponent;
6509
+ },
6510
+ [_IMMUTABLE]: {
6511
+ context: _fnSignal((p0) => p0.builderContext, [
6512
+ props
6513
+ ], "p0.builderContext"),
6514
+ linkComponent: _fnSignal((p0) => p0.builderLinkComponent, [
6515
+ props
6516
+ ], "p0.builderLinkComponent"),
6517
+ registeredComponents: _fnSignal((p0) => p0.builderComponents, [
6518
+ props
6519
+ ], "p0.builderComponents")
6520
+ }
6521
+ }, 3, `form-block-${idx}`);
6522
+ }) : null,
6523
+ submissionState(props, state) === "error" ? /* @__PURE__ */ _jsxC(Blocks, {
6524
+ path: "errorMessage",
6525
+ get blocks() {
6526
+ return props.errorMessage;
6527
+ },
6528
+ get context() {
6529
+ return props.builderContext;
6530
+ },
6531
+ [_IMMUTABLE]: {
6532
+ blocks: _fnSignal((p0) => p0.errorMessage, [
6533
+ props
6534
+ ], "p0.errorMessage"),
6535
+ context: _fnSignal((p0) => p0.builderContext, [
6536
+ props
6537
+ ], "p0.builderContext"),
6538
+ path: _IMMUTABLE
6539
+ }
6540
+ }, 3, "0n_0") : null,
6541
+ submissionState(props, state) === "sending" ? /* @__PURE__ */ _jsxC(Blocks, {
6542
+ path: "sendingMessage",
6543
+ get blocks() {
6544
+ return props.sendingMessage;
6545
+ },
6546
+ get context() {
6547
+ return props.builderContext;
6548
+ },
6549
+ [_IMMUTABLE]: {
6550
+ blocks: _fnSignal((p0) => p0.sendingMessage, [
6551
+ props
6552
+ ], "p0.sendingMessage"),
6553
+ context: _fnSignal((p0) => p0.builderContext, [
6554
+ props
6555
+ ], "p0.builderContext"),
6556
+ path: _IMMUTABLE
6557
+ }
6558
+ }, 3, "0n_1") : null,
6559
+ submissionState(props, state) === "error" && state.responseData ? /* @__PURE__ */ _jsxQ("pre", null, {
6560
+ class: "builder-form-error-text pre-FormComponent"
6561
+ }, JSON.stringify(state.responseData, null, 2), 1, "0n_2") : null,
6562
+ submissionState(props, state) === "success" ? /* @__PURE__ */ _jsxC(Blocks, {
6563
+ path: "successMessage",
6564
+ get blocks() {
6565
+ return props.successMessage;
6566
+ },
6567
+ get context() {
6568
+ return props.builderContext;
6569
+ },
6570
+ [_IMMUTABLE]: {
6571
+ blocks: _fnSignal((p0) => p0.successMessage, [
6572
+ props
6573
+ ], "p0.successMessage"),
6574
+ context: _fnSignal((p0) => p0.builderContext, [
6575
+ props
6576
+ ], "p0.builderContext"),
6577
+ path: _IMMUTABLE
6578
+ }
6579
+ }, 3, "0n_3") : null
6580
+ ],
6581
+ onSubmit$: /* @__PURE__ */ inlinedQrl((event) => {
6582
+ const [formRef2, props2, state2] = useLexicalScope();
6583
+ return onSubmit(props2, state2, formRef2, event);
6584
+ }, "FormComponent_component_form_onSubmit_F3ZFTlkNAQk", [
6585
+ formRef,
6586
+ props,
6587
+ state
6588
+ ])
6589
+ }, {
6590
+ method: _fnSignal((p0) => p0.method, [
6591
+ props
6592
+ ], "p0.method"),
6593
+ name: _fnSignal((p0) => p0.name, [
6594
+ props
6595
+ ], "p0.name"),
6596
+ validate: _fnSignal((p0) => p0.validate, [
6597
+ props
6598
+ ], "p0.validate")
6599
+ }, 0, "0n_4");
6600
+ }, "FormComponent_component_dk5c15Rvsfg"));
6601
+ const STYLES = `
6602
+ .pre-FormComponent {
6603
+ padding: 10px;
6604
+ color: red;
6605
+ text-align: center;
6606
+ }
6607
+ `;
6608
+ const componentInfo$4 = {
6609
+ name: "Form:Input",
6610
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
6611
+ inputs: [
6612
+ {
6613
+ name: "type",
6614
+ type: "text",
6615
+ enum: [
6616
+ "text",
6617
+ "number",
6618
+ "email",
6619
+ "url",
6620
+ "checkbox",
6621
+ "radio",
6622
+ "range",
6623
+ "date",
6624
+ "datetime-local",
6625
+ "search",
6626
+ "tel",
6627
+ "time",
6628
+ "file",
6629
+ "month",
6630
+ "week",
6631
+ "password",
6632
+ "color",
6633
+ "hidden"
6634
+ ],
6635
+ defaultValue: "text"
6636
+ },
6637
+ {
6638
+ name: "name",
6639
+ type: "string",
6640
+ required: true,
6641
+ helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
6642
+ },
6643
+ {
6644
+ name: "placeholder",
6645
+ type: "string",
6646
+ defaultValue: "Hello there",
6647
+ helperText: "Text to display when there is no value"
6648
+ },
6649
+ // TODO: handle value vs default value automatically like ng-model
6650
+ {
6651
+ name: "defaultValue",
6652
+ type: "string"
6653
+ },
6654
+ {
6655
+ name: "value",
6656
+ type: "string",
6657
+ advanced: true
6658
+ },
6659
+ {
6660
+ name: "required",
6661
+ type: "boolean",
6662
+ helperText: "Is this input required to be filled out to submit a form",
6663
+ defaultValue: false
6664
+ }
6665
+ ],
6666
+ noWrap: true,
6667
+ static: true,
6668
+ defaultStyles: {
6669
+ paddingTop: "10px",
6670
+ paddingBottom: "10px",
6671
+ paddingLeft: "10px",
6672
+ paddingRight: "10px",
6673
+ borderRadius: "3px",
6674
+ borderWidth: "1px",
6675
+ borderStyle: "solid",
6676
+ borderColor: "#ccc"
6677
+ }
6678
+ };
6679
+ const FormInputComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
6680
+ return /* @__PURE__ */ createElement("input", {
6681
+ ...props.attributes,
6682
+ key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
6683
+ placeholder: props.placeholder,
6684
+ type: props.type,
6685
+ name: props.name,
6686
+ value: props.value,
6687
+ defaultValue: props.defaultValue,
6688
+ required: props.required
6689
+ });
6690
+ }, "FormInputComponent_component_AUUjdN0ueMs"));
6691
+ const componentInfo$3 = {
6692
+ name: "Form:Select",
6693
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
6694
+ defaultStyles: {
6695
+ alignSelf: "flex-start"
6696
+ },
6697
+ inputs: [
6698
+ {
6699
+ name: "options",
6700
+ type: "list",
6701
+ required: true,
6702
+ subFields: [
6703
+ {
6704
+ name: "value",
6705
+ type: "text",
6706
+ required: true
6707
+ },
6708
+ {
6709
+ name: "name",
6710
+ type: "text"
6711
+ }
6712
+ ],
6713
+ defaultValue: [
6714
+ {
6715
+ value: "option 1"
6716
+ },
6717
+ {
6718
+ value: "option 2"
6719
+ }
6720
+ ]
6721
+ },
6722
+ {
6723
+ name: "name",
6724
+ type: "string",
6725
+ required: true,
6726
+ helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
6727
+ },
6728
+ {
6729
+ name: "defaultValue",
6730
+ type: "string"
6731
+ },
6732
+ {
6733
+ name: "value",
6734
+ type: "string",
6735
+ advanced: true
6736
+ },
6737
+ {
6738
+ name: "required",
6739
+ type: "boolean",
6740
+ defaultValue: false
6741
+ }
6742
+ ],
6743
+ static: true,
6744
+ noWrap: true
6745
+ };
6746
+ const SelectComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
6747
+ return /* @__PURE__ */ createElement("select", {
6748
+ ...props.attributes,
6749
+ value: props.value,
6750
+ key: isEditing() && props.defaultValue ? props.defaultValue : "default-key",
6751
+ defaultValue: props.defaultValue,
6752
+ name: props.name
6753
+ }, (props.options || []).map((option) => {
6754
+ return /* @__PURE__ */ _jsxQ("option", {
6755
+ value: _wrapSignal(option, "value")
6756
+ }, null, option.name || option.value, 1, "tc_0");
6757
+ }));
6758
+ }, "SelectComponent_component_SPKbsFLikZU"));
6759
+ const componentInfo$2 = {
6760
+ name: "Form:SubmitButton",
6761
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
6762
+ defaultStyles: {
6763
+ appearance: "none",
6764
+ paddingTop: "15px",
6765
+ paddingBottom: "15px",
6766
+ paddingLeft: "25px",
6767
+ paddingRight: "25px",
6768
+ backgroundColor: "#3898EC",
6769
+ color: "white",
6770
+ borderRadius: "4px",
6771
+ cursor: "pointer"
6772
+ },
6773
+ inputs: [
6774
+ {
6775
+ name: "text",
6776
+ type: "text",
6777
+ defaultValue: "Click me"
6778
+ }
6779
+ ],
6780
+ static: true,
6781
+ noWrap: true
6782
+ };
6783
+ const SubmitButton = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
6784
+ return /* @__PURE__ */ _jsxS("button", {
6785
+ ...props.attributes,
6786
+ children: _fnSignal((p0) => p0.text, [
6787
+ props
6788
+ ], "p0.text")
6789
+ }, {
6790
+ type: "submit"
6791
+ }, 0, "6z_0");
6792
+ }, "SubmitButton_component_NXvMBMCDhwc"));
6793
+ const componentInfo$1 = {
6794
+ // friendlyName?
6795
+ name: "Raw:Img",
6796
+ hideFromInsertMenu: true,
6797
+ 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",
6798
+ inputs: [
6799
+ {
6800
+ name: "image",
6801
+ bubble: true,
6802
+ type: "file",
6803
+ allowedFileTypes: [
6804
+ "jpeg",
6805
+ "jpg",
6806
+ "png",
6807
+ "svg",
6808
+ "gif",
6809
+ "webp"
6810
+ ],
6811
+ required: true
6812
+ }
6813
+ ],
6814
+ noWrap: true,
6815
+ static: true
6816
+ };
6817
+ const ImgComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
6818
+ return /* @__PURE__ */ _jsxS("img", {
6819
+ ...props.attributes
6820
+ }, {
6821
+ alt: _fnSignal((p0) => p0.altText, [
6822
+ props
6823
+ ], "p0.altText"),
6824
+ src: _fnSignal((p0) => p0.imgSrc || p0.image, [
6825
+ props
6826
+ ], "p0.imgSrc||p0.image"),
6827
+ style: _fnSignal((p0) => ({
6828
+ objectFit: p0.backgroundSize || "cover",
6829
+ objectPosition: p0.backgroundPosition || "center"
6830
+ }), [
6831
+ props
6832
+ ], '{objectFit:p0.backgroundSize||"cover",objectPosition:p0.backgroundPosition||"center"}')
6833
+ }, 0, isEditing() && props.imgSrc || "default-key");
6834
+ }, "ImgComponent_component_FXvIDBSffO8"));
6835
+ const componentInfo = {
6836
+ name: "Video",
6837
+ canHaveChildren: true,
6838
+ defaultStyles: {
6839
+ minHeight: "20px",
6840
+ minWidth: "20px"
6841
+ },
6842
+ 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",
6843
+ inputs: [
6844
+ {
6845
+ name: "video",
6846
+ type: "file",
6847
+ allowedFileTypes: [
6848
+ "mp4"
6849
+ ],
6850
+ bubble: true,
6851
+ defaultValue: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/assets%2FKQlEmWDxA0coC3PK6UvkrjwkIGI2%2F28cb070609f546cdbe5efa20e931aa4b?alt=media&token=912e9551-7a7c-4dfb-86b6-3da1537d1a7f",
6852
+ required: true
6853
+ },
6854
+ {
6855
+ name: "posterImage",
6091
6856
  type: "file",
6092
6857
  allowedFileTypes: [
6093
6858
  "jpeg",
@@ -6293,55 +7058,76 @@ const Video = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) =>
6293
7058
  }, /* @__PURE__ */ _jsxC(Slot$1, null, 3, "j7_4"), 1, "j7_5") : null
6294
7059
  ], 1, "j7_6");
6295
7060
  }, "Video_component_qdcTZflYyoQ"));
6296
- const getDefaultRegisteredComponents = () => [
7061
+ const getExtraComponents = () => [
6297
7062
  {
6298
- component: Button,
6299
- ...componentInfo$b
7063
+ component: CustomCode,
7064
+ ...componentInfo$7
6300
7065
  },
6301
7066
  {
6302
- component: Columns,
6303
- ...componentInfo$a
7067
+ component: Embed,
7068
+ ...componentInfo$6
6304
7069
  },
7070
+ ...[
7071
+ {
7072
+ component: FormComponent,
7073
+ ...componentInfo$5
7074
+ },
7075
+ {
7076
+ component: FormInputComponent,
7077
+ ...componentInfo$4
7078
+ },
7079
+ {
7080
+ component: SubmitButton,
7081
+ ...componentInfo$2
7082
+ },
7083
+ {
7084
+ component: SelectComponent,
7085
+ ...componentInfo$3
7086
+ }
7087
+ ],
6305
7088
  {
6306
- component: CustomCode,
6307
- ...componentInfo$9
7089
+ component: ImgComponent,
7090
+ ...componentInfo$1
6308
7091
  },
6309
7092
  {
6310
- component: Embed,
6311
- ...componentInfo$8
7093
+ component: Video,
7094
+ ...componentInfo
7095
+ }
7096
+ ];
7097
+ const getDefaultRegisteredComponents = () => [
7098
+ {
7099
+ component: Button,
7100
+ ...componentInfo$f
7101
+ },
7102
+ {
7103
+ component: Columns,
7104
+ ...componentInfo$e
6312
7105
  },
6313
7106
  {
6314
7107
  component: FragmentComponent,
6315
- ...componentInfo$7
7108
+ ...componentInfo$d
6316
7109
  },
6317
7110
  {
6318
7111
  component: Image,
6319
- ...componentInfo$6
7112
+ ...componentInfo$c
6320
7113
  },
6321
7114
  {
6322
- component: ImgComponent,
6323
- ...componentInfo$5
7115
+ component: SectionComponent,
7116
+ ...componentInfo$b
6324
7117
  },
6325
7118
  {
6326
- component: SectionComponent,
6327
- ...componentInfo$4
7119
+ component: Slot,
7120
+ ...componentInfo$a
6328
7121
  },
6329
7122
  {
6330
7123
  component: Symbol$1,
6331
- ...componentInfo$2
7124
+ ...componentInfo$9
6332
7125
  },
6333
7126
  {
6334
7127
  component: Text,
6335
- ...componentInfo$1
6336
- },
6337
- {
6338
- component: Video,
6339
- ...componentInfo
7128
+ ...componentInfo$8
6340
7129
  },
6341
- {
6342
- component: Slot,
6343
- ...componentInfo$3
6344
- }
7130
+ ...getExtraComponents()
6345
7131
  ];
6346
7132
  const components = [];
6347
7133
  const createRegisterComponentMessage = (info) => ({
@@ -6790,7 +7576,7 @@ function isFromTrustedHost(trustedHosts, e) {
6790
7576
  const url = new URL(e.origin), hostname = url.hostname;
6791
7577
  return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
6792
7578
  }
6793
- const SDK_VERSION = "0.13.0";
7579
+ const SDK_VERSION = "0.13.2";
6794
7580
  const registry = {};
6795
7581
  function register(type, info) {
6796
7582
  let typeList = registry[type];
@@ -6973,7 +7759,7 @@ const subscribeToEditor = (model, callback, options) => {
6973
7759
  window.removeEventListener("message", listener);
6974
7760
  };
6975
7761
  };
6976
- const mergeNewRootState = function mergeNewRootState2(props, state, elementRef, newData) {
7762
+ const mergeNewRootState = function mergeNewRootState22(props, state, elementRef, newData) {
6977
7763
  var _a, _b;
6978
7764
  const combinedState = {
6979
7765
  ...props.builderContextSignal.rootState,