@chaibuilder/sdk 1.2.27 → 1.2.28

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.
Files changed (99) hide show
  1. package/dist/{AddBlocks-ksZjjn0k.js → AddBlocks-0sW6gkCO.js} +8 -7
  2. package/dist/AddBlocks-YJPdSqcY.cjs +1 -0
  3. package/dist/{BrandingOptions-T_kbQFQv.js → BrandingOptions--vgnQvD1.js} +11 -10
  4. package/dist/BrandingOptions-RDn_Nhcq.cjs +1 -0
  5. package/dist/CanvasArea-41QoxuLf.cjs +55 -0
  6. package/dist/CanvasArea-aii0PyU-.js +1179 -0
  7. package/dist/{Class-3k8xjeiM.js → Class-6Hz2KzYb.js} +1 -1
  8. package/dist/{Class-MmCxz2Ay.cjs → Class-Zc8hpE7f.cjs} +1 -1
  9. package/dist/{CurrentPage-0eeU1V_c.js → CurrentPage-06Iacwyp.js} +9 -8
  10. package/dist/CurrentPage-2W1pdAOG.cjs +1 -0
  11. package/dist/ListTree-DnA8gj-7.js +314 -0
  12. package/dist/ListTree-pdQ14QJC.cjs +1 -0
  13. package/dist/MODIFIERS-YPHRtwrM.cjs +1 -0
  14. package/dist/{MODIFIERS-WQdaNvb8.js → MODIFIERS-cBT31iqE.js} +7 -19
  15. package/dist/PagesPanel-PBFzPSNY.cjs +1 -0
  16. package/dist/{PagesPanel-rYN28QpN.js → PagesPanel-_1CDTUdE.js} +9 -8
  17. package/dist/ProjectPanel-755bbzEQ.cjs +1 -0
  18. package/dist/{ProjectPanel-ivFOhdcz.js → ProjectPanel-pUMeIiUW.js} +14 -13
  19. package/dist/STRINGS--j49GZJP.js +7 -0
  20. package/dist/STRINGS-gPz7CUOk.cjs +1 -0
  21. package/dist/Settings-G9Xtqr7n.cjs +1 -0
  22. package/dist/{Settings-XWmKzRl9.js → Settings-dnO-s6x0.js} +596 -559
  23. package/dist/SidePanels-Gq2LdVuY.cjs +1 -0
  24. package/dist/{SidePanels-ODktnGbC.js → SidePanels-VxSXXkt_.js} +62 -61
  25. package/dist/{Topbar-Yunooh00.js → Topbar-5zbOSGF6.js} +6 -5
  26. package/dist/Topbar-J2tb4SA1.cjs +1 -0
  27. package/dist/{UnsplashImages-QMl0bxix.js → UnsplashImages-4WAWgA4s.js} +20 -19
  28. package/dist/UnsplashImages-XwjKheek.cjs +1 -0
  29. package/dist/{UploadImages-Si-A26bc.js → UploadImages-PONIHtn6.js} +11 -10
  30. package/dist/UploadImages-y7LAQVrT.cjs +1 -0
  31. package/dist/{add-page-modal-U7AUUrI1.js → add-page-modal-4VrFvgEm.js} +25 -24
  32. package/dist/add-page-modal-jWcp0w-S.cjs +1 -0
  33. package/dist/confirm-alert-4OQlXZTJ.cjs +1 -0
  34. package/dist/{confirm-alert-kV5-c70T.js → confirm-alert-j7b88hsW.js} +6 -5
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.js +47 -46
  37. package/dist/defaultTheme-7VqqhOcp.cjs +1 -0
  38. package/dist/{defaultTheme-gunU_Fe5.js → defaultTheme-D8B4-wHO.js} +1 -1
  39. package/dist/{delete-page-modal-UCBpdjLe.js → delete-page-modal--xHHdRAq.js} +9 -8
  40. package/dist/delete-page-modal-p6b0upz4.cjs +1 -0
  41. package/dist/email.cjs +1 -1
  42. package/dist/email.js +7 -6
  43. package/dist/{form-zmlTjM9j.js → form-_GJb9YcB.js} +1 -1
  44. package/dist/{form-Ap63cNec.cjs → form-jQj7E-hS.cjs} +1 -1
  45. package/dist/html-to-json-LJyJsnmZ.js +228 -0
  46. package/dist/html-to-json-vP1ESB_e.cjs +1 -0
  47. package/dist/{index-lOJfSheQ.js → index-0QJwevON.js} +2 -2
  48. package/dist/index-12HbDLon.cjs +1 -0
  49. package/dist/{index-f0AbmoYY.js → index-Eb5zyh2F.js} +4 -4
  50. package/dist/{index-Qk028f-N.cjs → index-KArv7pNz.cjs} +1 -1
  51. package/dist/{index-CFUoB97-.js → index-UHaqEdws.js} +993 -956
  52. package/dist/{index-l19JVVXI.cjs → index-mlMvwv2b.cjs} +2 -2
  53. package/dist/lib.cjs +3 -3
  54. package/dist/lib.js +17 -16
  55. package/dist/{page-viewer-jOwy--9A.js → page-viewer-00Xx4u8e.js} +10 -9
  56. package/dist/page-viewer-SZNm7b1n.cjs +1 -0
  57. package/dist/project-general-setting-C_pHNuZE.cjs +1 -0
  58. package/dist/{project-general-setting-3N8HZ2fe.js → project-general-setting-asDxlmhZ.js} +10 -9
  59. package/dist/{project-seo-setting-bSiNgO_1.js → project-seo-setting-DuAaDfDR.js} +7 -6
  60. package/dist/project-seo-setting-q2953ybQ.cjs +1 -0
  61. package/dist/render.cjs +1 -1
  62. package/dist/render.js +14 -13
  63. package/dist/{single-page-detail--AZlZ-pC.js → single-page-detail-UNxXvhl4.js} +17 -16
  64. package/dist/single-page-detail-oqj6zsLU.cjs +1 -0
  65. package/dist/studio.cjs +1 -1
  66. package/dist/studio.js +8 -7
  67. package/dist/ui.cjs +1 -1
  68. package/dist/ui.js +134 -133
  69. package/dist/useCanvasSettings-MR0Glu1b.cjs +1 -0
  70. package/dist/useCanvasSettings-R6br4J9i.js +6 -0
  71. package/dist/web-blocks.cjs +33 -1
  72. package/dist/web-blocks.js +603 -429
  73. package/package.json +1 -1
  74. package/dist/AddBlocks-S-4jzdWv.cjs +0 -1
  75. package/dist/BrandingOptions-EMCT0Wa3.cjs +0 -1
  76. package/dist/CanvasArea-SDzbubar.cjs +0 -55
  77. package/dist/CanvasArea-rhOeubmu.js +0 -950
  78. package/dist/CurrentPage-aTjWjc3o.cjs +0 -1
  79. package/dist/ListTree-Muu4rAtp.js +0 -308
  80. package/dist/ListTree-SWsqdfcG.cjs +0 -1
  81. package/dist/MODIFIERS-9EwxLM8V.cjs +0 -1
  82. package/dist/PagesPanel-n3x-0ozR.cjs +0 -1
  83. package/dist/ProjectPanel-pBePMOta.cjs +0 -1
  84. package/dist/Settings-JRyJayf5.cjs +0 -1
  85. package/dist/SidePanels-BtUeo6M9.cjs +0 -1
  86. package/dist/Topbar-QMeD3hvq.cjs +0 -1
  87. package/dist/UnsplashImages-05JR8oIu.cjs +0 -1
  88. package/dist/UploadImages-OgSN1HVt.cjs +0 -1
  89. package/dist/add-page-modal-9pTKItY-.cjs +0 -1
  90. package/dist/confirm-alert-DhRc-Zcd.cjs +0 -1
  91. package/dist/defaultTheme-7Lk2zq60.cjs +0 -1
  92. package/dist/delete-page-modal-4s-6AIy4.cjs +0 -1
  93. package/dist/html-to-json-C_Eobs_d.cjs +0 -1
  94. package/dist/html-to-json-p__Fgqdg.js +0 -210
  95. package/dist/index-F4AQQ6qq.cjs +0 -1
  96. package/dist/page-viewer-YFrIG3L7.cjs +0 -1
  97. package/dist/project-general-setting-hK7I7FuN.cjs +0 -1
  98. package/dist/project-seo-setting-x-FK0pez.cjs +0 -1
  99. package/dist/single-page-detail-9abF2g2R.cjs +0 -1
@@ -3,19 +3,20 @@ import y, { createElement as D, useState as g, useCallback as O, useMemo as U, u
3
3
  import { has as F, isFunction as W, first as h, omit as Y, noop as J, isEmpty as b, filter as v, values as k, groupBy as w, mergeWith as K, isArray as L, keys as Q, get as X, map as A, uniq as Z, includes as $, find as ee, reject as I } from "lodash-es";
4
4
  import { useAtom as N } from "jotai";
5
5
  import { useTranslation as H } from "react-i18next";
6
- import { L as _, r as S, Y as se, at as P, ap as te, aq as re, ar as oe, h as T, a3 as G, aj as le, ak as ae, al as ce, am as ie, an as E, bj as ne, bk as de, bl as me, bm as pe, aB as ue, bn as xe, bo as he, B as fe, bp as ge, bq as je, br as be, au as ve, av as ke, aw as C, bf as ye, b9 as Be, ba as Ne, bb as Ce, bc as we, S as Ae } from "./index-CFUoB97-.js";
6
+ import { L as _, r as S, Y as se, at as P, ap as te, aq as re, ar as oe, h as T, a3 as G, aj as le, ak as ae, al as ce, am as ie, an as E, bo as ne, bp as de, bq as me, br as pe, aB as ue, bs as xe, bt as he, B as fe, bu as ge, bv as je, bw as be, au as ve, av as ke, aw as C, bh as ye, bb as Be, bc as Ne, bd as Ce, be as we, S as Ae } from "./index-UHaqEdws.js";
7
7
  import { BoxIcon as Te } from "@radix-ui/react-icons";
8
8
  import { syncBlocksWithDefaults as M, useChaiBlocks as q } from "@chaibuilder/runtime";
9
9
  import { useFeature as _e } from "flagged";
10
- import { O as B } from "./MODIFIERS-WQdaNvb8.js";
10
+ import { O as B } from "./STRINGS--j49GZJP.js";
11
11
  import { Loader as Se } from "lucide-react";
12
- import { g as Pe } from "./html-to-json-p__Fgqdg.js";
12
+ import { g as Pe } from "./html-to-json-LJyJsnmZ.js";
13
13
  import "./_commonjsHelpers-UyOWmZb0.js";
14
14
  import "./Functions-7jnEwJyw.js";
15
15
  import "clsx";
16
16
  import "tailwind-merge";
17
17
  import "@react-hookz/web";
18
- import "./Class-3k8xjeiM.js";
18
+ import "./MODIFIERS-cBT31iqE.js";
19
+ import "./Class-6Hz2KzYb.js";
19
20
  import "@radix-ui/react-toggle";
20
21
  import "class-variance-authority";
21
22
  import "@radix-ui/react-switch";
@@ -64,7 +65,7 @@ const Le = ({ block: s }) => {
64
65
  className: "space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 " + (a ? "cursor-grab" : "cursor-pointer"),
65
66
  children: [
66
67
  D(c || Te, { className: "w-4 h-4 mx-auto" }),
67
- /* @__PURE__ */ e.jsx("p", { className: "truncate text-xs", children: l || r })
68
+ /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: l || r })
68
69
  ]
69
70
  }
70
71
  ) }),
@@ -153,7 +154,7 @@ const Le = ({ block: s }) => {
153
154
  /* @__PURE__ */ e.jsx(ge, { variant: "default", className: "mt-2 border-none p-1 text-gray-400", children: /* @__PURE__ */ e.jsx(je, { className: "text-xs font-normal leading-4", children: s("note_imported_html") }) })
154
155
  ] })
155
156
  ] });
156
- }, Ns = () => {
157
+ }, Cs = () => {
157
158
  const { t: s } = H(), [r, c] = g("core"), [l, d] = g("basic"), i = q(), [, n] = N(be), t = T("importHTMLSupport", !0), p = T("filterChaiBlock", () => !0), { data: m, isLoading: o } = G(), a = v(i, p), u = w(a, "category"), f = Z(A(u.core, "group"));
158
159
  V(() => {
159
160
  !$(f, l) && !b(f) && !b(l) && d(h(f));
@@ -201,5 +202,5 @@ const Le = ({ block: s }) => {
201
202
  ] });
202
203
  };
203
204
  export {
204
- Ns as default
205
+ Cs as default
205
206
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),n=require("react"),t=require("lodash-es"),y=require("jotai"),v=require("react-i18next"),s=require("./index-12HbDLon.cjs"),B=require("@radix-ui/react-icons"),b=require("@chaibuilder/runtime"),q=require("flagged"),R=require("./STRINGS-gPz7CUOk.cjs"),N=require("lucide-react"),C=require("./html-to-json-vP1ESB_e.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("himalaya");const T=({block:r})=>{const{type:i,icon:u,label:c}=r,{addCoreBlock:m,addPredefinedBlock:d}=s.useAddBlock(),[x,o]=s.useSelectedBlockIds(),[,j]=s.useHighlightBlockId(),[,p]=y.useAtom(s.activePanelAtom),l=()=>{if(t.has(r,"blocks")){const h=t.isFunction(r.blocks)?r.blocks():r.blocks;d(b.syncBlocksWithDefaults(h),t.first(x))}else m(r,t.first(x));p(R.OUTLINE_KEY)},a=q.useFeature("dnd");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(s.Tooltip,{children:[e.jsxRuntimeExports.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{onClick:l,type:"button",onDragStart:h=>{h.dataTransfer.setData("text/plain",JSON.stringify(t.omit(r,["component","icon"]))),setTimeout(()=>{o([]),j(null),p(R.OUTLINE_KEY)},200)},draggable:a?"true":"false",className:"space-y-2 rounded-lg border border-border p-3 text-center hover:bg-slate-300/50 "+(a?"cursor-grab":"cursor-pointer"),children:[n.createElement(u||B.BoxIcon,{className:"w-4 h-4 mx-auto"}),e.jsxRuntimeExports.jsx("p",{className:"text-xs",children:c||i})]})}),e.jsxRuntimeExports.jsx(s.TooltipContent,{children:e.jsxRuntimeExports.jsx("p",{children:c||i})})]})})},A=({block:r,closePopover:i})=>{const[u,c]=n.useState(!1),m=s.useBuilderProp("getExternalPredefinedBlock",t.noop()),{addCoreBlock:d,addPredefinedBlock:x}=s.useAddBlock(),[o]=s.useSelectedBlockIds(),j=n.useCallback(async p=>{if(p.stopPropagation(),t.has(r,"component")){d(r,t.first(o)),i();return}c(!0);const l=await m(r);t.isEmpty(l)||x(b.syncBlocksWithDefaults(l),t.first(o)),i()},[r]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{onClick:u?()=>{}:j,className:"relative cursor-pointer overflow-hidden rounded-md border border-transparent duration-200 hover:scale-x-105 hover:border-foreground/20 hover:shadow-2xl",children:[u&&e.jsxRuntimeExports.jsxs("div",{className:"absolute flex h-full w-full items-center justify-center bg-black bg-opacity-70",children:[e.jsxRuntimeExports.jsx(N.Loader,{className:"animate-spin",size:15,color:"white"})," ",e.jsxRuntimeExports.jsx("span",{className:"pl-2 text-sm text-white",children:"Adding..."})]}),r.preview?e.jsxRuntimeExports.jsx("img",{src:r.preview,className:"min-h-[50px] w-full rounded-md border border-gray-300",alt:r.label}):e.jsxRuntimeExports.jsx("div",{className:"flex h-20 items-center justify-center rounded-md border border-border border-gray-300 bg-gray-200",children:e.jsxRuntimeExports.jsx("p",{className:"max-w-xs text-center text-sm text-gray-700",children:r.label})})]})})},w=()=>{const{data:r}=s.useUILibraryBlocks(),i=b.useChaiBlocks(),u=t.filter(t.values(i),{category:"custom"}),c=t.groupBy(u,"group"),m=t.groupBy(r,"group"),d=n.useMemo(()=>t.mergeWith(c,m,(l,a)=>{if(t.isArray(l)&&t.isArray(a))return[...l,...a]}),[c,m]),[x,o]=n.useState(t.first(t.keys(d))||""),[,j]=y.useAtom(s.activePanelAtom),p=t.get(d,x,[]);return e.jsxRuntimeExports.jsxs("div",{className:"relative flex h-full max-h-full flex-col overflow-hidden py-2",children:[e.jsxRuntimeExports.jsx("div",{className:"sticky top-0 flex w-full items-center p-3",children:e.jsxRuntimeExports.jsxs(s.Select,{value:x,onValueChange:l=>o(l),children:[e.jsxRuntimeExports.jsx(s.SelectTrigger,{className:"w-full",children:e.jsxRuntimeExports.jsx(s.SelectValue,{placeholder:"Select a provider"})}),e.jsxRuntimeExports.jsxs(s.SelectContent,{children:[e.jsxRuntimeExports.jsx(s.SelectItem,{value:"",children:"Choose"}),n.Children.toArray(t.map(d,(l,a)=>e.jsxRuntimeExports.jsx(s.SelectItem,{value:a,children:a},a)))]})]})}),e.jsxRuntimeExports.jsx("div",{className:"h-full w-full space-y-2 overflow-y-auto px-2",children:n.Children.toArray(p.map(l=>e.jsxRuntimeExports.jsx(A,{block:l,closePopover:()=>j(R.OUTLINE_KEY)})))})]})},S=()=>{const{t:r}=v.useTranslation(),[i,u]=n.useState(""),{addPredefinedBlock:c}=s.useAddBlock(),[m]=s.useSelectedBlockIds(),[,d]=y.useAtom(s.activePanelAtom),x=()=>{const o=C.getBlocksFromHTML(i);c([...o],t.first(m)||null),u(""),d(R.OUTLINE_KEY)};return e.jsxRuntimeExports.jsxs(s.Card,{className:"border-border/0 p-0 shadow-none",children:[e.jsxRuntimeExports.jsx(s.CardHeader,{className:"p-3",children:e.jsxRuntimeExports.jsx(s.CardDescription,{children:r("html_snippet_description")})}),e.jsxRuntimeExports.jsx(s.CardContent,{className:"space-y-2 px-3 py-0",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[e.jsxRuntimeExports.jsx(s.Label,{htmlFor:"current",className:"text-sm",children:r("tailwind_html_snippet")}),e.jsxRuntimeExports.jsx(s.Textarea,{autoFocus:!0,tabIndex:1,ref:o=>o&&o.focus(),onChange:o=>u(o.target.value),rows:12,value:i,placeholder:r("enter_code_snippet"),className:"resize-none overflow-x-auto whitespace-pre bg-gray-100 font-mono text-xs font-normal"})]})}),e.jsxRuntimeExports.jsxs(s.CardFooter,{className:"flex flex-col justify-end p-3",children:[e.jsxRuntimeExports.jsx(s.Button,{disabled:i.trim()==="",onClick:()=>x(),size:"sm",className:"w-full",children:r("import_html")}),e.jsxRuntimeExports.jsx(s.Alert,{variant:"default",className:"mt-2 border-none p-1 text-gray-400",children:e.jsxRuntimeExports.jsx(s.AlertTitle,{className:"text-xs font-normal leading-4",children:r("note_imported_html")})})]})]})},_=()=>{const{t:r}=v.useTranslation(),[i,u]=n.useState("core"),[c,m]=n.useState("basic"),d=b.useChaiBlocks(),[,x]=y.useAtom(s.showPredefinedBlockCategoryAtom),o=s.useBuilderProp("importHTMLSupport",!0),j=s.useBuilderProp("filterChaiBlock",()=>!0),{data:p,isLoading:l}=s.useUILibraryBlocks(),a=t.filter(d,j),h=t.groupBy(a,"category"),g=t.uniq(t.map(h.core,"group"));n.useEffect(()=>{!t.includes(g,c)&&!t.isEmpty(g)&&!t.isEmpty(c)&&m(t.first(g))},[g,c]);const E=!l&&!t.isEmpty(p)||t.find(t.values(a),{category:"custom"})!==void 0;return e.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-72 flex-col overflow-hidden",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-2 flex flex-col justify-between rounded-md bg-background/30 p-1",children:[e.jsxRuntimeExports.jsx("h1",{className:"flex flex-col items-baseline px-1 text-xl font-semibold xl:flex-col",children:r("add_block")}),e.jsxRuntimeExports.jsx("span",{className:"p-0 text-xs font-light leading-3 opacity-80 xl:pl-1",children:r(i==="html"?"enter_paste_tailwind_html":"click_to_add_block")})]}),e.jsxRuntimeExports.jsx(s.Tabs,{onValueChange:f=>{x(""),u(f)},value:i,className:"h-max",children:e.jsxRuntimeExports.jsxs(s.TabsList,{className:"grid w-full "+(E&&o?"grid-cols-3":E&&!o||!E&&o?"grid-cols-2":"grid-cols-1"),children:[e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"core",children:r("Blocks")}),E?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"ui-blocks",children:r("ui_library")}):null,o?e.jsxRuntimeExports.jsx(s.TabsTrigger,{value:"html",children:r("import")}):null]})}),i==="core"&&e.jsxRuntimeExports.jsx(s.ScrollArea,{className:"-mx-1.5 h-full",children:e.jsxRuntimeExports.jsx("div",{className:"mt-2 w-full",children:n.Children.toArray(t.map(g,f=>t.reject(t.filter(t.values(h.core),{group:f}),{hidden:!0}).length?e.jsxRuntimeExports.jsx(s.Accordion,{type:"single",value:f,collapsible:!0,className:"w-full",children:e.jsxRuntimeExports.jsxs(s.AccordionItem,{value:f,children:[e.jsxRuntimeExports.jsx(s.AccordionTrigger,{className:"rounded-md bg-gray-100 px-4 py-2 capitalize",children:f}),e.jsxRuntimeExports.jsx(s.AccordionContent,{className:"p-3",children:e.jsxRuntimeExports.jsx("div",{className:"grid grid-cols-3 gap-2",children:n.Children.toArray(t.reject(t.filter(t.values(h.core),{group:f}),{hidden:!0}).map(k=>e.jsxRuntimeExports.jsx(T,{block:k})))})})]})}):null))})}),i==="ui-blocks"&&e.jsxRuntimeExports.jsx(n.Suspense,{fallback:e.jsxRuntimeExports.jsx(s.Skeleton,{className:"h-32 w-full"}),children:e.jsxRuntimeExports.jsx(w,{})}),i==="html"&&o?e.jsxRuntimeExports.jsx(S,{}):null]})};exports.default=_;
@@ -2,7 +2,7 @@ import { j as t } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import * as c from "react";
3
3
  import N from "@rjsf/validator-ajv8";
4
4
  import j from "@rjsf/core";
5
- import { h as k, F as w, by as D } from "./index-CFUoB97-.js";
5
+ import { h as k, F as D, bD as w } from "./index-UHaqEdws.js";
6
6
  import { s as f, c as P, f as a } from "./controls-OfJWSEqC.js";
7
7
  import { debounce as R, noop as F, isEqual as L } from "lodash-es";
8
8
  import "./_commonjsHelpers-UyOWmZb0.js";
@@ -11,9 +11,10 @@ import "clsx";
11
11
  import "tailwind-merge";
12
12
  import "@chaibuilder/runtime";
13
13
  import "jotai";
14
- import "./MODIFIERS-WQdaNvb8.js";
14
+ import "./STRINGS--j49GZJP.js";
15
15
  import "@react-hookz/web";
16
- import "./Class-3k8xjeiM.js";
16
+ import "./MODIFIERS-cBT31iqE.js";
17
+ import "./Class-6Hz2KzYb.js";
17
18
  import "react-i18next";
18
19
  import "@radix-ui/react-toggle";
19
20
  import "class-variance-authority";
@@ -101,8 +102,8 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
101
102
  { title: "Lustria", value: "Lustria" },
102
103
  { title: "Ovo", value: "Ovo" },
103
104
  { title: "Suranna", value: "Suranna" }
104
- ], Ct = () => {
105
- const u = k("onSaveBrandingOptions", F), [e, p] = w(), [d] = D(), i = c.useRef(e);
105
+ ], St = () => {
106
+ const u = k("onSaveBrandingOptions", F), [e, p] = D(), [d] = w(), i = c.useRef(e);
106
107
  c.useEffect(() => () => {
107
108
  L(e, i.current) || u(i.current);
108
109
  }, []);
@@ -112,8 +113,8 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
112
113
  bodyFont: l,
113
114
  headingFont: h,
114
115
  primaryColor: x,
115
- bodyTextDarkColor: y,
116
- bodyTextLightColor: b,
116
+ bodyTextDarkColor: b,
117
+ bodyTextLightColor: y,
117
118
  bodyBgDarkColor: C,
118
119
  secondaryColor: S,
119
120
  bodyBgLightColor: B,
@@ -145,7 +146,7 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
145
146
  }),
146
147
  bodyTextLightColor: a({
147
148
  title: "Body Text (Light Mode)",
148
- default: y
149
+ default: b
149
150
  }),
150
151
  bodyBgDarkColor: a({
151
152
  title: "Body Background (Dark mode)",
@@ -153,7 +154,7 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
153
154
  }),
154
155
  bodyTextDarkColor: a({
155
156
  title: "Body Text (Dark mode)",
156
- default: b
157
+ default: y
157
158
  })
158
159
  });
159
160
  const n = {
@@ -184,5 +185,5 @@ const M = ({ value: u, onChange: e, id: p, onBlur: d }) => {
184
185
  ] });
185
186
  };
186
187
  export {
187
- Ct as default
188
+ St as default
188
189
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./jsx-runtime-Z_BpKhVy.cjs"),B=require("react"),R=require("@rjsf/validator-ajv8"),E=require("@rjsf/core"),p=require("./index-12HbDLon.cjs"),r=require("./controls-KK2oLIa8.cjs"),f=require("lodash-es");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("@chaibuilder/runtime");require("jotai");require("./STRINGS-gPz7CUOk.cjs");require("@react-hookz/web");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("react-i18next");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");function N(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const x=N(B),k=({value:t,onChange:e,id:i,onBlur:l})=>{const n=f.debounce(e,200),v=u=>n(u.target.value);return a.jsxRuntimeExports.jsx("div",{className:"mt-1.5 flex items-center gap-x-3",children:a.jsxRuntimeExports.jsx("div",{className:"flex w-3/5 flex-col",children:a.jsxRuntimeExports.jsx("input",{type:"color",className:"text-xs p-0",value:t,onBlur:({target:{value:u}})=>l(i,u),onChange:v})})})},m=[{title:"Roboto",value:"Roboto"},{title:"Open Sans",value:"Open Sans"},{title:"Montserrat",value:"Montserrat"},{title:"Lato",value:"Lato"},{title:"Poppins",value:"Poppins"},{title:"Oswald",value:"Oswald"},{title:"Raleway",value:"Raleway"},{title:"Ubuntu",value:"Ubuntu"},{title:"Nunito",value:"Nunito"},{title:"Merriweather",value:"Merriweather"},{title:"Nunito Sans",value:"Nunito Sans"},{title:"Playfair Display",value:"Playfair Display"},{title:"Rubik",value:"Rubik"},{title:"Inter",value:"Inter"},{title:"Lora",value:"Lora"},{title:"Kanit",value:"Kanit"},{title:"Fira Sans",value:"Fira Sans"},{title:"Hind",value:"Hind"},{title:"Quicksand",value:"Quicksand"},{title:"Mulish",value:"Mulish"},{title:"Barlow",value:"Barlow"},{title:"Inconsolata",value:"Inconsolata"},{title:"Titillium Web",value:"Titillium Web"},{title:"Heebo",value:"Heebo"},{title:"IBM Plex Sans",value:"IBM Plex Sans"},{title:"DM Sans",value:"DM Sans"},{title:"Nanum Gothic",value:"Nanum Gothic"},{title:"Karla",value:"Karla"},{title:"Arimo",value:"Arimo"},{title:"Cabin",value:"Cabin"},{title:"Oxygen",value:"Oxygen"},{title:"Overpass",value:"Overpass"},{title:"Assistant",value:"Assistant"},{title:"Tajawal",value:"Tajawal"},{title:"Play",value:"Play"},{title:"Exo",value:"Exo"},{title:"Cinzel",value:"Cinzel"},{title:"Faustina",value:"Faustina"},{title:"Philosopher",value:"Philosopher"},{title:"Gelasio",value:"Gelasio"},{title:"Sofia Sans Condensed",value:"Sofia Sans Condensed"},{title:"Noto Sans Devanagari",value:"Noto Sans Devanagari"},{title:"Actor",value:"Actor"},{title:"Epilogue",value:"Epilogue"},{title:"Glegoo",value:"Glegoo"},{title:"Overlock",value:"Overlock"},{title:"Lustria",value:"Lustria"},{title:"Ovo",value:"Ovo"},{title:"Suranna",value:"Suranna"}],P=()=>{const t=p.useBuilderProp("onSaveBrandingOptions",f.noop),[e,i]=p.useBrandingOptions(),[l]=p.useBlocksContainer(),n=x.useRef(e);x.useEffect(()=>()=>{f.isEqual(e,n.current)||t(n.current)},[]);const v=({formData:o},c)=>{c&&(i(o),n.current=o)},{bodyFont:u,headingFont:q,primaryColor:b,bodyTextDarkColor:h,bodyTextLightColor:y,bodyBgDarkColor:S,secondaryColor:C,bodyBgLightColor:O,roundedCorners:j}=e;let s={headingFont:r.s({title:"Heading font",default:q,options:m}),bodyFont:r.s({title:"Body font",default:u,options:m}),roundedCorners:r.c({title:"Rounded Corner",default:parseInt(j||5,10)}),primaryColor:r.f({title:"Primary",default:b}),secondaryColor:r.f({title:"Secondary",default:C})};l||(s={...s,bodyBgLightColor:r.f({title:"Body Background (Light Mode)",default:O}),bodyTextLightColor:r.f({title:"Body Text (Light Mode)",default:h}),bodyBgDarkColor:r.f({title:"Body Background (Dark mode)",default:S}),bodyTextDarkColor:r.f({title:"Body Text (Dark mode)",default:y})});const d={type:"object",properties:{}},g={};return Object.keys(s).forEach(o=>{const c=s[o];return d.properties||(d.properties={}),d.properties[o]=c.schema,g[o]=c.uiSchema,!0}),a.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-60 select-none flex-col",children:[a.jsxRuntimeExports.jsx("div",{className:"rounded-md bg-background/30 p-1",children:a.jsxRuntimeExports.jsx("h1",{className:"px-1 font-semibold",children:"Branding Options"})}),a.jsxRuntimeExports.jsx("div",{className:"-mx-2",children:a.jsxRuntimeExports.jsx(E,{widgets:{color:k},idSeparator:".",autoComplete:"off",omitExtraData:!0,liveOmit:!0,liveValidate:!0,uiSchema:g,schema:d,formData:e,validator:R,onChange:v})})]})};exports.default=P;
@@ -0,0 +1,55 @@
1
+ "use strict";var ne=Object.defineProperty;var oe=(o,n,e)=>n in o?ne(o,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[n]=e;var C=(o,n,e)=>(oe(o,typeof n!="symbol"?n+"":n,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-Z_BpKhVy.cjs"),h=require("react"),a=require("lodash-es"),k=require("@radix-ui/react-icons"),i=require("./index-12HbDLon.cjs"),T=require("react-i18next"),E=require("jotai"),H=require("react-dom"),b=require("prop-types"),re=require("react-quill"),K=require("flagged"),ie=require("@floating-ui/dom"),O=require("@floating-ui/react-dom"),le=require("@react-hookz/web"),ce=require("@bobthered/tailwindcss-palette-generator"),ae=require("@tailwindcss/typography"),de=require("@tailwindcss/forms"),ue=require("@tailwindcss/aspect-ratio"),pe=require("react-wrap-balancer"),he=require("tailwind-merge"),_=require("./STRINGS-gPz7CUOk.cjs"),xe=require("@chaibuilder/runtime"),P=require("./index-mlMvwv2b.cjs"),me=require("./useCanvasSettings-MR0Glu1b.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("./MODIFIERS-YPHRtwrM.cjs");require("./Class-Zc8hpE7f.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("i18next");require("react-hotkeys-hook");const ge=()=>{const{hasUndo:o,hasRedo:n,undo:e,redo:t}=i.useUndoManager();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(i.Button,{disabled:!o(),size:"sm",onClick:e,className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(k.ResetIcon,{})}),r.jsxRuntimeExports.jsx(i.Button,{disabled:!n(),onClick:t,size:"sm",className:"rounded-full",variant:"ghost",children:r.jsxRuntimeExports.jsx(k.ResetIcon,{className:"rotate-180 scale-y-[-1] transform"})})]})};function fe(){const[o,n]=i.useDarkMode(),{t:e}=T.useTranslation();return r.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[r.jsxRuntimeExports.jsx(i.Label,{htmlFor:"dark-mode-switch",children:e("dark_mode")}),r.jsxRuntimeExports.jsxs(i.Switch,{id:"dark-mode-switch",checked:o,onCheckedChange:()=>{n(!o)},className:`${o?"bg-violet-600":"bg-violet-300"}
2
+ relative ml-2 inline-flex h-[20px] w-[40px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`,children:[r.jsxRuntimeExports.jsx("span",{className:"sr-only",children:e("use_setting")}),r.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",className:`${o?"translate-x-5":"translate-x-0"}
3
+ pointer-events-none -mt-px inline-block h-[18px] w-[20px] transform rounded-full bg-white shadow-lg ring-0 transition duration-200 ease-in-out`})]})]})}const U=({landscape:o=!1})=>r.jsxRuntimeExports.jsxs("svg",{className:o?"rotate-90":"",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 13",xmlSpace:"preserve",width:13,height:13,children:[r.jsxRuntimeExports.jsx("g",{strokeWidth:0}),r.jsxRuntimeExports.jsx("g",{strokeLinecap:"round",strokeLinejoin:"round"}),r.jsxRuntimeExports.jsx("path",{d:"M10.65 0H2.349a.851.851 0 0 0-.851.852v11.299c0 .47.382.852.851.852h8.3a.851.851 0 0 0 .851-.852V.852A.851.851 0 0 0 10.65 0zM6.599 12.466a.367.367 0 1 1 0-.735.367.367 0 0 1 0 .735zm3.9-1.267H2.5V1h8.001v10.199z",style:{fill:"#000"}})]}),ve=[{title:"mobile_xs_title",content:"mobile_xs_content",breakpoint:"xs",icon:r.jsxRuntimeExports.jsx(k.MobileIcon,{}),width:400},{title:"mobile_sm_title",content:"mobile_sm_content",breakpoint:"sm",icon:r.jsxRuntimeExports.jsx(k.MobileIcon,{className:"rotate-90"}),width:640},{title:"tablet_md_title",content:"tablet_md_content",breakpoint:"md",icon:r.jsxRuntimeExports.jsx(U,{}),width:800},{title:"tablet_lg_title",content:"tablet_lg_content",breakpoint:"lg",icon:r.jsxRuntimeExports.jsx(U,{landscape:!0}),width:1024},{title:"desktop_xl_title",content:"desktop_xl_content",breakpoint:"xl",icon:r.jsxRuntimeExports.jsx(k.LaptopIcon,{}),width:1420},{title:"large_desktop_2xl_title",content:"large_desktop_2xl_content",breakpoint:"2xl",icon:r.jsxRuntimeExports.jsx(k.DesktopIcon,{}),width:1920}],z=({title:o,content:n,currentBreakpoint:e,breakpoint:t,width:s,icon:p,onClick:c})=>{const{t:l}=T.useTranslation();return r.jsxRuntimeExports.jsxs(i.HoverCard,{children:[r.jsxRuntimeExports.jsx(i.HoverCardTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx(i.Button,{onClick:()=>c(s),size:"sm",variant:t===e?"secondary":"ghost",children:p})}),r.jsxRuntimeExports.jsx(i.HoverCardContent,{className:"w-52 border-border",children:r.jsxRuntimeExports.jsx("div",{className:"flex justify-between space-x-4",children:r.jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[r.jsxRuntimeExports.jsx("h4",{className:"text-sm font-semibold",children:l(o)}),r.jsxRuntimeExports.jsx("p",{className:"text-xs",children:l(n)})]})})})]})},$e=()=>{const[,o,n]=i.useCanvasWidth(),[e,t]=i.useSelectedBreakpoints(),{t:s}=T.useTranslation(),p=i.useBuilderProp("breakpoints",ve),c=l=>{e.includes(l)?e.length>2&&t(e.filter(d=>d!==l)):t(d=>[...d,l])};return p.length<4?r.jsxRuntimeExports.jsx("div",{className:"flex items-center rounded-md",children:a.map(p,l=>h.createElement(z,{...l,onClick:n,key:l.breakpoint,currentBreakpoint:o}))}):r.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md",children:[a.map(p.filter(l=>a.includes(e,a.toUpper(l.breakpoint))),l=>h.createElement(z,{...l,onClick:n,key:l.breakpoint,currentBreakpoint:o})),r.jsxRuntimeExports.jsxs(i.DropdownMenu,{children:[r.jsxRuntimeExports.jsx(i.DropdownMenuTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsx("span",{className:"cursor-pointer px-2.5 hover:opacity-80",children:r.jsxRuntimeExports.jsx(k.DotsVerticalIcon,{className:"scale-90 transform"})})}),r.jsxRuntimeExports.jsxs(i.DropdownMenuContent,{className:"w-56 border-border text-xs",children:[r.jsxRuntimeExports.jsx(i.DropdownMenuLabel,{children:s("Breakpoints")}),r.jsxRuntimeExports.jsx(i.DropdownMenuSeparator,{}),a.map(p,l=>r.jsxRuntimeExports.jsx(i.DropdownMenuCheckboxItem,{disabled:l.breakpoint==="xs",onCheckedChange:()=>c(a.toUpper(l.breakpoint)),checked:a.includes(e,a.toUpper(l.breakpoint)),children:s(l.title)},l.breakpoint))]})]})]})},je=()=>{const{t:o}=T.useTranslation(),{setNewBlocks:n}=i.useBlocksStoreUndoableActions(),[,e]=i.useSelectedBlockIds(),[,t]=i.useSelectedStylingBlocks(),s=h.useCallback(()=>{n([]),e([]),t([])},[n]);return r.jsxRuntimeExports.jsx("div",{className:"flex items-center",children:r.jsxRuntimeExports.jsxs(i.AlertDialog,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTrigger,{asChild:!0,children:r.jsxRuntimeExports.jsxs(i.Button,{size:"sm",variant:"ghost",className:"flex items-center gap-x-1",children:[r.jsxRuntimeExports.jsx(k.EraserIcon,{})," ",o("clear")]})}),r.jsxRuntimeExports.jsxs(i.AlertDialogContent,{className:"border-border",children:[r.jsxRuntimeExports.jsxs(i.AlertDialogHeader,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogTitle,{children:o("clear_canvas_title")}),r.jsxRuntimeExports.jsx(i.AlertDialogDescription,{children:o("clear_canvas_description")})]}),r.jsxRuntimeExports.jsxs(i.AlertDialogFooter,{children:[r.jsxRuntimeExports.jsx(i.AlertDialogCancel,{children:o("cancel")}),r.jsxRuntimeExports.jsx(i.AlertDialogAction,{onClick:s,children:o("yes")})]})]})]})})},ye=()=>{const o=i.useBuilderProp("darkMode",!1),[n]=i.useCanvasZoom();return r.jsxRuntimeExports.jsxs("div",{className:"flex h-10 items-center justify-between border-b bg-background/70 px-2",children:[r.jsxRuntimeExports.jsxs("div",{className:"flex h-full space-x-2",children:[o?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(fe,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"})]}):null,r.jsxRuntimeExports.jsx($e,{}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsxs("div",{className:"flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium",children:[r.jsxRuntimeExports.jsx(k.ZoomInIcon,{className:"h-3.5 w-3.5 flex-shrink-0"})," ",r.jsxRuntimeExports.jsxs("div",{className:"text-xs leading-3",children:[a.round(n,0),"%"]})]}),r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(ge,{})]}),r.jsxRuntimeExports.jsxs("div",{className:"flex h-full items-center space-x-2",children:[r.jsxRuntimeExports.jsx(i.Separator,{orientation:"vertical"}),r.jsxRuntimeExports.jsx(je,{})]})]})},be=`<!doctype html>
4
+ <html class="scroll-smooth h-full overflow-y-auto">
5
+ <head>
6
+ <meta charset="UTF-8">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
+ <script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"><\/script>
9
+ <style>
10
+ html { height: 100%; overflow:auto; }
11
+ body { height: 100%; }
12
+ .air-highlight{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}
13
+ .air-highlight-multi{ outline: 1px solid #29e503 !important; outline-offset: -1px;}
14
+ body{ -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none;
15
+ -moz-user-select: none;-ms-user-select: none; user-select: none; }
16
+ html{
17
+ -ms-overflow-style: none; /* IE and Edge */
18
+ scrollbar-width: none; /* Firefox */
19
+ }
20
+ /** IMPORTANT: Make fields content editable in SAFARI */
21
+ [contenteditable] {-webkit-user-select: text;user-select: text;}
22
+
23
+ html::-webkit-scrollbar { width: 0 !important }
24
+ .aspect-auto{aspect-ratio: auto;}
25
+ .aspect-square{aspect-ratio: 1/1;}
26
+ .aspect-video{aspect-ratio: 16/9;}
27
+ .dragging [data-dnd="leaf"] { pointer-events: none; } .dragging [data-dnd="leaf"] * { pointer-events: none; }
28
+ .dragging [data-dnd="ignore"], .dragging [data-dnd="ignore"] * { pointer-events: none; }
29
+ a{ pointer-events: none !important; }
30
+ [contenteditable="true"], [contenteditable="true"] * { cursor: text !important; }
31
+ [contenteditable="true"] {
32
+ outline: none;
33
+ box-shadow: 0 0 0px 4px rgba(36, 150, 255, 0.2);
34
+ -webkit-user-select: text;
35
+ -moz-user-select: text;
36
+ user-select: text;
37
+ }
38
+ .frame-root .frame-content { height: 100%; }
39
+ </style>
40
+ <style id="hidden-blocks"></style>
41
+ <style id="selected-block"></style>
42
+ <style id="selected-styling-block"></style>
43
+ <style id="highlighted-block"></style>
44
+ <style id="dragged-block"></style>
45
+
46
+ </head>
47
+ <body class="font-body antialiased h-full">
48
+ <div class="frame-root h-full"></div>
49
+ <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
50
+ </body>
51
+ </html>`,ke=o=>{const[n]=i.useCanvasWidth(),[,e]=i.useCanvasZoom(),[t,s]=h.useState({}),p=h.useCallback(()=>{const{width:c,height:l}=o;if(c<n){const d=parseFloat((c/n).toFixed(2).toString());let u={};const x=l*d;l&&(u={height:100+(l-x)/x*100+"%"}),s({position:"relative",top:0,transform:`scale(${d})`,transformOrigin:"top left",...u,maxWidth:"none"}),e(d*100)}else s({}),e(100)},[n,o,e]);return h.useEffect(()=>{p()},[n,o,e,p]),t};let Y,Z;typeof document<"u"&&(Y=document);typeof window<"u"&&(Z=window);const G=h.createContext({document:Y,window:Z}),M=()=>h.useContext(G),{Provider:Ee,Consumer:Ve}=G;class Q extends h.Component{componentDidMount(){this.props.contentDidMount()}componentDidUpdate(){this.props.contentDidUpdate()}render(){return h.Children.only(this.props.children)}}C(Q,"propTypes",{children:b.element.isRequired,contentDidMount:b.func.isRequired,contentDidUpdate:b.func.isRequired});class q extends h.Component{constructor(e,t){super(e,t);C(this,"setRef",e=>{this.nodeRef.current=e;const{forwardedRef:t}=this.props;typeof t=="function"?t(e):t&&(t.current=e)});C(this,"handleLoad",()=>{clearInterval(this.loadCheck),this.state.iframeLoaded||this.setState({iframeLoaded:!0})});C(this,"loadCheck",()=>setInterval(()=>{this.handleLoad()},500));this._isMounted=!1,this.nodeRef=h.createRef(),this.state={iframeLoaded:!1}}componentDidMount(){this._isMounted=!0,this.getDoc()&&this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded",this.handleLoad)}componentWillUnmount(){this._isMounted=!1,this.nodeRef.current.removeEventListener("DOMContentLoaded",this.handleLoad)}getDoc(){return this.nodeRef.current?this.nodeRef.current.contentDocument:null}getMountTarget(){const e=this.getDoc();return this.props.mountTarget?e.querySelector(this.props.mountTarget):e.body.children[0]}renderFrameContents(){if(!this._isMounted)return null;const e=this.getDoc();if(!e)return null;const t=this.props.contentDidMount,s=this.props.contentDidUpdate,p=e.defaultView||e.parentView,c=r.jsxRuntimeExports.jsx(Q,{contentDidMount:t,contentDidUpdate:s,children:r.jsxRuntimeExports.jsx(Ee,{value:{document:e,window:p},children:r.jsxRuntimeExports.jsx("div",{className:"frame-content",children:this.props.children})})}),l=this.getMountTarget();return[H.createPortal(this.props.head,this.getDoc().head),H.createPortal(c,l)]}render(){const e={...this.props,srcDoc:this.props.initialContent,children:void 0};return delete e.head,delete e.initialContent,delete e.mountTarget,delete e.contentDidMount,delete e.contentDidUpdate,delete e.forwardedRef,r.jsxRuntimeExports.jsx("iframe",{...e,ref:this.setRef,onLoad:this.handleLoad,children:this.state.iframeLoaded&&this.renderFrameContents()})}}C(q,"propTypes",{style:b.object,head:b.node,initialContent:b.string,mountTarget:b.string,contentDidMount:b.func,contentDidUpdate:b.func,children:b.oneOfType([b.element,b.arrayOf(b.element)])}),C(q,"defaultProps",{style:{},head:null,children:void 0,mountTarget:void 0,contentDidMount:()=>{},contentDidUpdate:()=>{},initialContent:'<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'});const we=h.forwardRef((o,n)=>r.jsxRuntimeExports.jsx(q,{...o,forwardedRef:n})),Re=()=>{const{addCoreBlock:o}=i.useAddBlock(),n=i.useBuilderProp("getExternalPredefinedBlock",a.noop);return h.useCallback(async e=>{const{block:t,dropTargetId:s,relativeIndex:p}=e;if(a.has(t,"format")){const c=await n(t);return o({blocks:c},s===0?null:s,p)}return o(t,s===0?null:s,p)},[o])};let R=null,A=[],D=null,J=null;function Se(o){const n=window.getComputedStyle(o),e=parseInt(n.paddingLeft,10),t=parseInt(n.paddingTop,10),s=parseInt(n.paddingRight,10),p=parseInt(n.paddingBottom,10);return{paddingLeft:e,paddingTop:t,paddingRight:s,paddingBottom:p}}const W=(o,n,e)=>{if(!R)return;const t=o.getBoundingClientRect(),s=R==null?void 0:R.getElementById("placeholder"),{paddingLeft:p,paddingTop:c,paddingRight:l,paddingBottom:d}=Se(o);s.style.width=n==="vertical"?t.width-p-l+"px":"2px",s.style.height=n==="vertical"?"2px":t.height-c-d+"px",s.style.display="block";const u=A.reduce((x,f)=>Math.abs(f-e)<Math.abs(x-e)?f:x);J=A.indexOf(u),n==="vertical"?(s.style.top=o.offsetTop+u+"px",s.style.left=o.offsetLeft+p+"px"):(s.style.top=o.offsetTop+c+"px",s.style.left=o.offsetLeft+u+"px")},Be=o=>{const n=X(o),e=window.getComputedStyle(o),t=n==="horizontal",s=parseInt(e.paddingLeft),p=parseInt(e.paddingTop);let c=t?s:p;A=[c],Array.from(o.children).forEach(l=>{const d=window.getComputedStyle(l),u=parseInt(t?d.marginLeft+d.marginRight:d.marginTop+d.marginBottom),x=t?l.offsetWidth:l.offsetHeight;A.push(c+x+u),c+=x+u})};function X(o){const n=window.getComputedStyle(o).display,e=window.getComputedStyle(o).flexDirection;if(n==="flex")return e==="column"||e==="column-reverse"?"vertical":"horizontal";if(n==="grid"){const t=window.getComputedStyle(o).gridTemplateRows,s=window.getComputedStyle(o).gridTemplateColumns;if(t.includes("auto"))return"vertical";if(s.includes("auto"))return"horizontal"}return n==="block"?"vertical":"horizontal"}const Ce=a.throttle(o=>{const n=o.target,e=X(n);if(e==="vertical"){const t=o.clientY-n.offsetTop;W(n,e,t)}else{const t=o.clientX-n.offsetLeft;W(n,e,t)}},200),Ie=o=>{o.preventDefault(),o.stopPropagation(),Ce(o)};function N(){const o=R==null?void 0:R.getElementById("placeholder");o.style.display="none"}const De=()=>{const{document:o}=M(),[n,e]=E.useAtom(i.draggingFlagAtom),t=Re(),s=K.useFeature("dnd"),[,p]=i.useHighlightBlockId(),[,c]=i.useSelectedBlockIds();return R=o,{isDragging:n,"data-dnd":"branch",onDragOver:s?Ie:a.noop,onDrop:s?l=>{D==null||D.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2");const d=JSON.parse(l.dataTransfer.getData("text/plain"));let u=l.target.getAttribute("data-block-id");u===null&&(u=l.target.parentElement.getAttribute("data-block-id")),t({block:d,dropTargetId:u||null,relativeIndex:J}),e(!1),N(),setTimeout(()=>{N()},300)}:a.noop,onDragEnter:s?l=>{const d=l;D=d.target,d.stopPropagation(),d.preventDefault(),A=[];const u=d.target;Be(u),u.classList.add("outline","outline-green-300","outline-2","-outline-offset-2"),e(!0),p(""),c([])}:a.noop,onDragLeave:s?l=>{const d=l;D=null,d.stopPropagation(),d.preventDefault(),d.target.classList.remove("outline","outline-green-300","outline-2","-outline-offset-2")}:a.noop,onMouseOut:s?()=>{e(!1),N()}:a.noop}};function F(o){return o.getAttribute("data-block-id")?o:o.closest("[data-block-id]")}function Ae(o){o.container.innerHTML="",o.container.parentNode.removeChild(o.container);var n=document.querySelector(".ql-toolbar");n&&n.parentNode.removeChild(n),o=null}const _e=()=>{const o=["Heading","Paragraph","Text","Link","Span","Button"],n=i.useUpdateBlocksProps(),[,e]=i.useHighlightBlockId(),[t,s]=E.useAtom(i.inlineEditingActiveAtom);return p=>{var f;if(t)return;const c=F(p.target),l=c.getAttribute("data-block-type");if(!l||!o.includes(l))return;const d=c.cloneNode(!0);c.style.display="none",Array.from(d.attributes).forEach(g=>{g.name!=="class"&&d.removeAttribute(g.name)}),l==="Text"&&(d.style.display="inline-block"),c.parentNode.insertBefore(d,c.nextSibling);const u=new re.Quill(d,{placeholder:"Type here..."});function x(){const g=u.getText(0,u.getLength());n([c.getAttribute("data-block-id")],{content:g}),c.removeAttribute("style"),d.removeEventListener("blur",x,!0),Ae(u),s(""),e("")}d.addEventListener("blur",x,!0),u.focus(),(f=d.querySelector(".ql-clipboard"))==null||f.remove(),s(c.getAttribute("data-block-id"))}},Te=()=>{const[,o]=i.useSelectedStylingBlocks(),[,n]=i.useSelectedBlockIds(),[,e]=i.useHighlightBlockId(),[t]=E.useAtom(i.inlineEditingActiveAtom),[s]=E.useAtom(i.treeRefAtom);return p=>{if(t)return;s.closeAll(),p.stopPropagation();const c=F(p.target);if(c!=null&&c.getAttribute("data-block-id")&&(c==null?void 0:c.getAttribute("data-block-id"))==="container"){n([]),o([]),e("");return}if(c!=null&&c.getAttribute("data-block-parent")){const l=c.getAttribute("data-style-prop"),d=c.getAttribute("data-style-id"),u=c.getAttribute("data-block-parent");o([{id:d,prop:l,blockId:u}]),n([u])}else c!=null&&c.getAttribute("data-block-id")&&n([c.getAttribute("data-block-id")]);e("")}},Me=a.throttle((o,n)=>{const e=F(o.target);e!=null&&e.getAttribute("data-style-id")&&n(e.getAttribute("data-style-id"))},100),Ne=()=>{const[,o]=i.useHighlightBlockId(),[n]=E.useAtom(i.inlineEditingActiveAtom);return e=>{n||Me(e,o)}},qe=({children:o})=>{const{document:n}=M(),[e]=i.useSelectedBlockIds(),[t,s]=i.useSelectedStylingBlocks();h.useEffect(()=>{setTimeout(()=>{if(!a.isEmpty(t))return;const u=V(n,a.first(e));if(u){const x=u.getAttribute("data-style-prop");if(x){const f=u.getAttribute("data-style-id"),g=u.getAttribute("data-block-parent");s([{id:f,prop:x,blockId:g}])}}},100)},[n,e,s,t]);const p=_e(),c=Te(),l=Ne(),d=De();return r.jsxRuntimeExports.jsx("div",{"data-block-id":"container",id:"canvas",onClick:c,onDoubleClick:p,onMouseMove:l,...a.omit(d,"isDragging"),className:"relative mb-5 h-full max-w-full "+(d.isDragging?"dragging":""),children:o})},V=(o,n)=>o.querySelector(`[data-block-id="${n}"]`),Le=()=>{const{window:o}=M(),[n,e]=i.useSelectedBlockIds(),[t]=i.useBlocksStore(),[,s]=i.useSelectedStylingBlocks(),{undo:p,redo:c}=i.useUndoManager(),l=i.useDuplicateBlocks(),[,d]=i.usePreviewMode(),u=i.useRemoveBlocks(),{savePage:x}=i.useSavePage(),[f]=E.useAtom(i.inlineEditingActiveAtom),[,g]=E.useAtom(i.editLayerNameAtom),y=v=>{v.key==="Enter"&&(v.preventDefault(),n.length===1&&g(a.first(n)))},w=v=>{const m=t.find(j=>j._id===v);return m?m._parent:null};return h.useEffect(()=>{const v=m=>{if(m.key==="Escape"){e([]),s([]);return}if(y(m),!f&&(m.key==="Delete"||m.key==="Backspace")&&(m.preventDefault(),u(n)),m.ctrlKey||m.metaKey){if(m.key==="ArrowUp"){m.preventDefault();const j=n.length>0?w(n[0]):null;j&&e([j])}if(["z","y","d","x","c","p","s","v"].includes(m.key)){if(f&&["x","z","v"].includes(m.key))return!0;m.preventDefault()}m.key==="s"&&(m.stopPropagation(),m.preventDefault(),x()),m.key==="z"&&p(),m.key==="y"&&c(),m.key==="d"&&l(n)}};return o.removeEventListener("keydown",v),o.addEventListener("keydown",v),()=>{o.removeEventListener("keydown",v)}},[n,e,p,u,d,c,l,f,x,o]),null},Pe=({block:o,label:n})=>{const[,e]=i.useSelectedBlockIds(),[,t]=i.useHighlightBlockId(),[,s]=E.useAtom(i.draggedBlockIdAtom),p=K.useFeature("dnd");return r.jsxRuntimeExports.jsxs("div",{className:"mr-10 flex cursor-grab items-center space-x-1 px-1",draggable:p?"true":"false",onDragStart:c=>{c.dataTransfer.setData("text/plain",JSON.stringify(a.pick(o,["_id","_type"]))),s(o._id),setTimeout(()=>{e([]),t(null)},200)},children:[r.jsxRuntimeExports.jsx(k.DragHandleDots2Icon,{}),n]})},Fe=({selectedBlockElement:o,block:n})=>{const e=i.useRemoveBlocks(),t=i.useDuplicateBlocks(),[,s]=i.useSelectedBlockIds(),[,p]=i.useSelectedStylingBlocks(),[c]=E.useAtom(i.inlineEditingActiveAtom),{floatingStyles:l,refs:d,update:u}=O.useFloating({placement:"top-start",middleware:[O.shift(),ie.flip()],elements:{reference:o}});le.useResizeObserver(o,()=>u(),o!==null);const x=a.get(n,"_parent",null),f=a.isEmpty(a.get(n,"_name",""))?a.get(n,"_type",""):a.get(n,"_name","");return!o||!n||c?null:r.jsxRuntimeExports.jsxs("div",{role:"button",tabIndex:0,ref:d.setFloating,style:l,onClick:g=>{g.stopPropagation(),g.preventDefault()},onKeyDown:g=>g.stopPropagation(),className:"z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",children:[r.jsxRuntimeExports.jsx(Pe,{label:f,block:n}),r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 px-1",children:[x&&r.jsxRuntimeExports.jsx(k.ArrowUpIcon,{className:"hover:scale-105",onClick:()=>{p([]),s([x])}}),i.canDuplicateBlock(a.get(n,"_type",""))?r.jsxRuntimeExports.jsx(k.CopyIcon,{className:"hover:scale-105",onClick:()=>t([n==null?void 0:n._id])}):null,i.canDeleteBlock(a.get(n,"_type",""))?r.jsxRuntimeExports.jsx(k.TrashIcon,{className:"hover:scale-105",onClick:()=>e([n==null?void 0:n._id])}):null]})]})},He=({addVariant:o,e:n})=>{o("hs-dropdown-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-dropdown.open > .${n(`hs-dropdown-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-dropdown.open .hs-dropdown-toggle .${n(`hs-dropdown-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-dropdown.open > .hs-dropdown-menu > .${n(`hs-dropdown-open${t}${s}`)}`)}]),o("hs-removing",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-removing.${n(`hs-removing${t}${s}`)}`)}),o("hs-tooltip-shown",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-tooltip.show .${n(`hs-tooltip-shown${t}${s}`)}`)}),o("hs-accordion-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active.${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-toggle .${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle .${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-toggle.${n(`hs-accordion-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion.active > .hs-accordion-heading > .hs-accordion-toggle.${n(`hs-accordion-active${t}${s}`)}`)}]),o("hs-accordion-selected",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-accordion .selected.${n(`hs-accordion-selected${t}${s}`)}`)}),o("hs-collapse-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse.open .${n(`hs-collapse-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse.open.${n(`hs-collapse-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse-toggle.open .${n(`hs-collapse-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-collapse-toggle.open.${n(`hs-collapse-open${t}${s}`)}`)}]),o("hs-tab-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`[data-hs-tab].active.${n(`hs-tab-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`[data-hs-tab].active .${n(`hs-tab-active${t}${s}`)}`)}]),o("hs-overlay-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.open.${n(`hs-overlay-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.open .${n(`hs-overlay-open${t}${s}`)}`)}]),o("hs-overlay-layout-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-body-open.${n(`hs-overlay-layout-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-body-open .${n(`hs-overlay-layout-open${t}${s}`)}`)}]),o("hs-overlay-backdrop-open",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-backdrop.${n(`hs-overlay-backdrop-open${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.hs-overlay-backdrop .${n(`hs-overlay-backdrop-open${t}${s}`)}`)}]),o("hs-scrollspy-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-scrollspy-active${t}${s}`)}`)}),o("hs-carousel-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-carousel-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-carousel-active${t}${s}`)}`)}]),o("hs-carousel-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-carousel${t}disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-carousel${t}disabled${t}${s}`)}`)}]),o("hs-selected",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected.${n(`hs-selected${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected .${n(`hs-selected${t}${s}`)}`)}]),o("hs-select-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-select-disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-select-disabled${t}${s}`)}`)}]),o("hs-select-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-select-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-select-active${t}${s}`)}`)}]),o("hs-input-number-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-input-number-disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-input-number-disabled${t}${s}`)}`)}]),o("hs-pin-input-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-pin-input-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-pin-input-active${t}${s}`)}`)}]),o("hs-select-opened",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.opened.${n(`hs-select-opened${t}${s}`)}`)}]),o("hs-password-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-password-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-password-active${t}${s}`)}`)}]),o("hs-stepper-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-stepper-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-stepper-active${t}${s}`)}`)}]),o("hs-stepper-success",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success.${n(`hs-stepper-success${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success .${n(`hs-stepper-success${t}${s}`)}`)}]),o("hs-stepper-completed",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.completed.${n(`hs-stepper-completed${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.completed .${n(`hs-stepper-completed${t}${s}`)}`)}]),o("hs-stepper-error",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error.${n(`hs-stepper-error${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error .${n(`hs-stepper-error${t}${s}`)}`)}]),o("hs-stepper-processed",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.processed.${n(`hs-stepper-processed${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.processed .${n(`hs-stepper-processed${t}${s}`)}`)}]),o("hs-stepper-disabled",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled.${n(`hs-stepper-disabled${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.disabled .${n(`hs-stepper-disabled${t}${s}`)}`)}]),o("hs-stepper-skipped",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.skipped.${n(`hs-stepper-skipped${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.skipped .${n(`hs-stepper-skipped${t}${s}`)}`)}]),o("hs-strong-password",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.passed.${n(`hs-strong-password${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.passed .${n(`hs-strong-password${t}${s}`)}`)}]),o("hs-strong-password-accepted",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.accepted.${n(`hs-strong-password-accepted${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.accepted .${n(`hs-strong-password-accepted${t}${s}`)}`)}]),o("hs-strong-password-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-strong-password-active${t}${s}`)}`)}]),o("hs-combo-box-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active .${n(`hs-combo-box-active${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-combo-box-active${t}${s}`)}`)}]),o("hs-combo-box-selected",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected .${n(`hs-combo-box-selected${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.selected.${n(`hs-combo-box-selected${t}${s}`)}`)}]),o("hs-combo-box-tab-active",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.active.${n(`hs-combo-box-tab-active${t}${s}`)}`)}]),o("hs-apexcharts-tooltip-dark",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.dark.${n(`hs-apexcharts-tooltip-dark${t}${s}`)}`)}]),o("hs-success",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success .${n(`hs-success${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.success.${n(`hs-success${t}${s}`)}`)}]),o("hs-error",[({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error .${n(`hs-error${t}${s}`)}`)},({modifySelectors:e,separator:t})=>{e(({className:s})=>`.error.${n(`hs-error${t}${s}`)}`)}]),o("hs-default-mode-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.default .${n(`hs-default-mode-active${t}${s}`)}`)}),o("hs-dark-mode-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.dark .${n(`hs-dark-mode-active${t}${s}`)}`)}),o("hs-auto-mode-active",({modifySelectors:e,separator:t})=>{e(({className:s})=>`.auto .${n(`hs-auto-mode-active${t}${s}`)}`)})},Oe=({model:o})=>{const[n]=i.useBrandingOptions(),[e]=i.useSelectedBlockIds(),[t]=i.useDarkMode(),[s]=i.useHighlightBlockId(),[p]=i.useSelectedStylingBlocks(),[c]=E.useAtom(i.draggedBlockIdAtom),{document:l,window:d}=M(),[u]=h.useState(l==null?void 0:l.getElementById("highlighted-block")),[x]=h.useState(l==null?void 0:l.getElementById("selected-block")),[f]=h.useState(l==null?void 0:l.getElementById("selected-styling-block")),[g]=h.useState(l==null?void 0:l.getElementById("dragged-block"));h.useEffect(()=>{t?l==null||l.documentElement.classList.add("dark"):l==null||l.documentElement.classList.remove("dark")},[t,l]);const y=a.get(n,"headingFont","DM Sans"),w=a.get(n,"bodyFont","DM Sans");return h.useEffect(()=>{const v=a.get(n,"primaryColor","#000"),m=a.get(n,"secondaryColor","#FFF"),j=ce.tailwindcssPaletteGenerator({colors:[v,m],names:["primary","secondary"]});j.primary.DEFAULT=v,j.secondary.DEFAULT=m;const I=a.get(n,"roundedCorners","0");!d||!d.tailwind||(d.tailwind.config={darkMode:"class",theme:{fontFamily:{heading:[y],body:[w]},extend:{borderRadius:{global:`${I||"0"}px`},colors:j}},plugins:[ae,de,ue,d.tailwind.plugin.withOptions(()=>He)]})},[n,d,y,w]),h.useEffect(()=>{x&&(x.textContent=`${a.map(e,v=>`[data-block-id="${v}"]`).join(",")}{
52
+ outline: 1px solid ${e.length===1?"#42a1fc":"orange"} !important; outline-offset: -1px;
53
+ }`)},[e,x]),h.useEffect(()=>{if(!c){g.textContent="";return}g.textContent=`[data-block-id="${c}"]{ pointer-events: none !important; opacity: 0.2 !important}`},[c]),h.useEffect(()=>{u&&(u.textContent=s?`[data-style-id="${s}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}`:"")},[s,e,u]),h.useEffect(()=>{f&&(f.textContent=`${a.map(p,({id:v})=>`[data-style-id="${v}"]`).join(",")}{
54
+ outline: 1px solid #42a1fc !important; outline-offset: -1px;
55
+ }`)},[p,f]),h.useEffect(()=>{const v=a.get(n,"bodyTextLightColor","#64748b"),m=a.get(n,"bodyTextDarkColor","#94a3b8"),j=a.get(n,"bodyBgLightColor","#FFFFFF"),I=a.get(n,"bodyBgDarkColor","#0f172a");l.body.className=`font-body antialiased text-[${v}] bg-[${j}] dark:text-[${m}] dark:bg-[${I}]`},[n,l,o]),o==="page"?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[y&&r.jsxRuntimeExports.jsx("link",{id:"heading-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${y.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),w&&y!==w&&r.jsxRuntimeExports.jsx("link",{id:"body-font",rel:"stylesheet",type:"text/css",href:`https://fonts.googleapis.com/css2?family=${w.replace(/ /g,"+")}:wght@300;400;500;600;700;800;900&display=swap`,media:"all"}),y&&r.jsxRuntimeExports.jsx("style",{children:`h1,h2,h3,h4,h5,h6{font-family: "${y}",ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";}`})]}):null},Ue=o=>{const n={};return Object.keys(o).forEach(e=>{a.isString(o[e])&&o[e].startsWith(_.SLOT_KEY)&&(n[e]=o[e].replace(_.SLOT_KEY,"").split(","))}),n},ze=a.memoize(o=>{const n=o.replace(_.STYLES_KEY,"").split(",");return he.twMerge(n[0],n[1])});function We(o,n){return a.get(o,`${n}_attrs`,{})}function Ke(o){const n={};return Object.keys(o).forEach(e=>{if(a.isString(o[e])&&o[e].startsWith(_.STYLES_KEY)){const t=ze(o[e]);n[e]={className:t,"data-style-prop":e,"data-block-parent":o._id,"data-style-id":`${e}-${o._id}`,...We(o,e)}}}),n}function Ye(o,n){const e=a.get(o,"_bindings",{});return a.isEmpty(e)?{...o}:(a.each(e,(t,s)=>{a.isString(t)&&a.get(n,t,null)&&(o[s]=a.get(n,t,null))}),o)}function L({blocks:o}){const[n]=i.useBlocksStore(),[e]=me.useCanvasSettings(),t=h.useCallback(l=>Ke(l),[]),[s]=P.useChaiExternalData(),[p]=E.useAtom(i.inlineEditingActiveAtom),c=h.useCallback(l=>l.reduce((d,u)=>{const x=a.get(e,u,{});return{...d,...x}},{}),[e,n]);return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:h.Children.toArray(o.map((l,d)=>{if(p===l._id)return null;const u=Ue(l),x={};a.isEmpty(u)||Object.keys(u).forEach(m=>{x[m]=h.Children.toArray(u[m].map(j=>r.jsxRuntimeExports.jsx(L,{blocks:[a.find(n,{_id:j})]})))});const f=a.filter(n,{_parent:l._id});x.children=f.length?r.jsxRuntimeExports.jsx(L,{blocks:f}):null;const g=xe.getBlockComponent(l._type),y=a.get(g,"builderComponent",a.get(g,"component",null));if(a.isNull(y))return r.jsxRuntimeExports.jsx("noscript",{children:`<!-- ${l==null?void 0:l._type} not registered -->`});const w=a.has(g,"getBlockStateFrom")?g==null?void 0:g.getBlockStateFrom(l,n):[],v=c(w);return r.jsxRuntimeExports.jsx(h.Suspense,{children:h.createElement(y,{blockProps:{"data-block-id":l._id,"data-block-type":l._type,"data-dnd":a.has(g,"canAcceptBlock")?"branch":"leaf"},index:d,...Ye(l,s),...t(l),...x,inBuilder:!0,blockState:v})})}))})}const Ze=()=>{const[o]=i.useBlocksStore(),n=a.isEmpty(o)?null:r.jsxRuntimeExports.jsx(P.BlocksExternalDataProvider,{children:r.jsxRuntimeExports.jsx(L,{blocks:a.filter(o,e=>a.isEmpty(e._parent))})});return r.jsxRuntimeExports.jsx(pe.Provider,{children:n})},Ge=(o,n)=>o.querySelector(`[data-style-id="${n}"]`),Qe=()=>{const[o]=E.useAtom(i.networkModeAtom),[n]=i.usePreviewMode(),[e]=i.useCanvasWidth(),[,t]=i.useSelectedBlockIds(),s=i.useSelectedBlock(),[,p]=i.useHighlightBlockId(),c=h.useRef(null),l=h.useRef(null),[d,u]=h.useState({width:0,height:0}),x=ke(d),[f,g]=h.useState(0),[y,w]=h.useState([]),[,v]=h.useState([]),[,m]=E.useAtom(i.canvasIframeAtom),[j,I]=i.useSelectedStylingBlocks(),ee=i.useBuilderProp("loading",!1);h.useEffect(()=>{const{clientWidth:$,clientHeight:S}=l.current;u({width:$,height:S}),f===0&&g($)},[l,e,f]);const te=($,S=0)=>{const{top:B}=$.getBoundingClientRect();return B+S>=0&&B-S<=window.innerHeight};h.useEffect(()=>{var $,S;if(s&&s.type!=="Multiple"&&c.current){const B=V(c.current.contentDocument,s._id);B&&(te(B)||(S=($=c.current)==null?void 0:$.contentWindow)==null||S.scrollTo({top:B.offsetTop,behavior:"smooth"}),w([B]))}},[s]),h.useEffect(()=>{if(!a.isEmpty(j)&&c.current){const $=Ge(c.current.contentDocument,a.first(j).id);v($?[$]:[null])}else v([null])},[j]);const se=h.useMemo(()=>{let $=be;return o==="offline"&&($=$.replace("https://old.chaibuilder.com/offline/tailwind.cdn.js","/offline/tailwind.cdn.js"),$=$.replace("https://unpkg.com/aos@next/dist/aos.css","/offline/aos.css"),$=$.replace("https://unpkg.com/aos@next/dist/aos.js","/offline/aos.js")),$},[o]);return r.jsxRuntimeExports.jsx("div",{onClick:()=>{t([]),I([])},onMouseLeave:()=>setTimeout(()=>p(""),300),className:"relative mx-auto h-full w-full overflow-hidden",style:f>0&&!a.isEmpty(x)?{width:n?"100%":f}:{},ref:l,children:r.jsxRuntimeExports.jsxs(we,{contentDidMount:()=>m(c.current),ref:c,id:"canvas-iframe",style:{width:`${e}px`,...x},className:"relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",initialContent:se,children:[r.jsxRuntimeExports.jsx(Le,{}),r.jsxRuntimeExports.jsx(Fe,{block:s,selectedBlockElement:a.first(y)}),r.jsxRuntimeExports.jsx(Oe,{model:"page"}),r.jsxRuntimeExports.jsx(qe,{children:ee?r.jsxRuntimeExports.jsx("div",{className:"h-full p-4",children:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"})}):r.jsxRuntimeExports.jsx(Ze,{})}),r.jsxRuntimeExports.jsx("br",{}),r.jsxRuntimeExports.jsx("div",{id:"placeholder",className:"absolute z-[99999] max-w-full bg-green-500 transition-transform"})]})})},Je=()=>r.jsxRuntimeExports.jsxs("div",{className:"flex h-full w-full flex-col",children:[r.jsxRuntimeExports.jsx(ye,{}),r.jsxRuntimeExports.jsx("div",{className:"relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2",children:r.jsxRuntimeExports.jsx(h.Suspense,{fallback:r.jsxRuntimeExports.jsx(i.Skeleton,{className:"h-full"}),children:r.jsxRuntimeExports.jsx(P.ErrorBoundary,{children:r.jsxRuntimeExports.jsx(Qe,{})})})})]});exports.default=Je;