@chaibuilder/sdk 1.2.56 → 1.2.58

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 (96) hide show
  1. package/dist/{AddBlocks-HeYXoex4.js → AddBlocks-05ZH2Suu.js} +46 -50
  2. package/dist/AddBlocks-MH_fqSRf.cjs +1 -0
  3. package/dist/CanvasArea-7nhpzTI-.cjs +59 -0
  4. package/dist/{CanvasArea-CqILE5PR.js → CanvasArea-kMGTLtCw.js} +409 -394
  5. package/dist/CodeEditor-vECReGwz.cjs +1 -0
  6. package/dist/{CodeEditor-kxV5RCpd.js → CodeEditor-zYBqhBv3.js} +33 -39
  7. package/dist/{CurrentPage-IrFGAb7n.js → CurrentPage-VksVpchp.js} +26 -25
  8. package/dist/CurrentPage-caSpOhR9.cjs +1 -0
  9. package/dist/{ListTree-0n_G8NJx.js → ListTree-0iy8aBgI.js} +82 -65
  10. package/dist/ListTree-Njsk1AzL.cjs +1 -0
  11. package/dist/{PagesPanel-RYBf0Yct.js → PagesPanel-2AEsdqhe.js} +20 -19
  12. package/dist/PagesPanel-tb0qtxz4.cjs +1 -0
  13. package/dist/{ProjectPanel-Zagx6l3Q.js → ProjectPanel-IHFBvE5H.js} +25 -24
  14. package/dist/ProjectPanel-gmBUq2NI.cjs +1 -0
  15. package/dist/{Settings-RLDTFFf8.js → Settings-r9IvIq0G.js} +405 -396
  16. package/dist/Settings-uVLt1oiz.cjs +1 -0
  17. package/dist/{SidePanels-ao969pMV.js → SidePanels-2fD5UfH5.js} +89 -88
  18. package/dist/SidePanels-rhTLiLy6.cjs +1 -0
  19. package/dist/ThemeConfiguration-PvMN3j6h.cjs +1 -0
  20. package/dist/{ThemeConfiguration-S7yArRMp.js → ThemeConfiguration-ab7lbA2y.js} +18 -24
  21. package/dist/Topbar-1JTIu0uN.cjs +1 -0
  22. package/dist/{Topbar-B8u0whpc.js → Topbar-x4gslZ4T.js} +39 -38
  23. package/dist/UILibrariesPanel-CaGLzB9c.cjs +1 -0
  24. package/dist/UILibrariesPanel-raxCToMd.js +216 -0
  25. package/dist/{UnsplashImages-wWRifkCp.js → UnsplashImages-alt_doTy.js} +42 -47
  26. package/dist/UnsplashImages-cah1BRL_.cjs +1 -0
  27. package/dist/UploadImages-5dRETWCo.cjs +1 -0
  28. package/dist/{UploadImages-lUvZhW_j.js → UploadImages-JqVL_aQd.js} +32 -38
  29. package/dist/add-page-modal-9e6JkoxV.cjs +1 -0
  30. package/dist/{add-page-modal-04b4l2zu.js → add-page-modal-DbmbwG7V.js} +29 -28
  31. package/dist/{confirm-alert-FX5030eR.js → confirm-alert-m85JJlQi.js} +15 -21
  32. package/dist/confirm-alert-rYsxlfR4.cjs +1 -0
  33. package/dist/core.cjs +1 -1
  34. package/dist/core.js +44 -43
  35. package/dist/delete-page-modal-YtRcj7eK.cjs +1 -0
  36. package/dist/{delete-page-modal-1u9CyAIP.js → delete-page-modal-nIBA3zCg.js} +22 -21
  37. package/dist/email.cjs +1 -1
  38. package/dist/email.js +19 -19
  39. package/dist/form-G3PqS2Gc.cjs +1 -0
  40. package/dist/{form-HRdEJjVq.js → form-MSL4CDff.js} +3 -3
  41. package/dist/{html-to-json-OnIZDDXw.js → html-to-json-_01DXd-a.js} +37 -36
  42. package/dist/html-to-json-ndxaXRT8.cjs +1 -0
  43. package/dist/index-0FIxW0gR.cjs +1 -0
  44. package/dist/index-5IJnVFyU.cjs +206 -0
  45. package/dist/index-7zSzDmAA.cjs +1 -0
  46. package/dist/{index-vfmO3y2d.js → index-b4Wjumon.js} +19 -19
  47. package/dist/{ChaiBuilderEditor-tkzS851D.js → index-grcmKbfu.js} +14660 -17763
  48. package/dist/index-uLn8W3eR.js +3145 -0
  49. package/dist/lib.cjs +2 -2
  50. package/dist/lib.js +17 -16
  51. package/dist/mockServiceWorker.js +18 -10
  52. package/dist/page-viewer-JySaivSD.cjs +1 -0
  53. package/dist/{page-viewer-dcb3u4OV.js → page-viewer-QxHe6m6V.js} +27 -26
  54. package/dist/project-general-setting-FqXwffxC.cjs +1 -0
  55. package/dist/{project-general-setting--sS34seu.js → project-general-setting-nSzmnyIU.js} +23 -22
  56. package/dist/{project-seo-setting-8tc3I-0M.js → project-seo-setting-3kFJ77jY.js} +20 -26
  57. package/dist/project-seo-setting-C3ilIIeM.cjs +1 -0
  58. package/dist/render.cjs +1 -1
  59. package/dist/render.js +104 -102
  60. package/dist/single-page-detail-F5J53NCW.cjs +1 -0
  61. package/dist/{single-page-detail-tP2pfgBp.js → single-page-detail-uSK1ExCH.js} +26 -25
  62. package/dist/studio.cjs +1 -1
  63. package/dist/studio.js +19 -18
  64. package/dist/ui.cjs +1 -1
  65. package/dist/ui.js +144 -150
  66. package/dist/web-blocks.cjs +1 -1
  67. package/dist/web-blocks.js +164 -107
  68. package/package.json +1 -1
  69. package/dist/AddBlocks-VHoZezjj.cjs +0 -1
  70. package/dist/CanvasArea-137WY3Wx.cjs +0 -56
  71. package/dist/ChaiBuilderEditor-aY8flOgX.cjs +0 -206
  72. package/dist/CodeEditor-R2jKe97T.cjs +0 -1
  73. package/dist/CurrentPage-PjrVzHXR.cjs +0 -1
  74. package/dist/ListTree-C6oCXZDV.cjs +0 -1
  75. package/dist/PagesPanel-lIC3kYmS.cjs +0 -1
  76. package/dist/ProjectPanel-0Siyi5YS.cjs +0 -1
  77. package/dist/Settings-6QRVcl16.cjs +0 -1
  78. package/dist/SidePanels-j1EFsBlK.cjs +0 -1
  79. package/dist/ThemeConfiguration-q1471P7b.cjs +0 -1
  80. package/dist/Topbar-ogFKKDbx.cjs +0 -1
  81. package/dist/UILibrariesPanel-cm9CFWxc.cjs +0 -1
  82. package/dist/UILibrariesPanel-tcfz2ELp.js +0 -196
  83. package/dist/UnsplashImages-E2L3YDJI.cjs +0 -1
  84. package/dist/UploadImages-s-eeaGiS.cjs +0 -1
  85. package/dist/add-page-modal-eroF20lO.cjs +0 -1
  86. package/dist/confirm-alert-XuxEzG-V.cjs +0 -1
  87. package/dist/delete-page-modal-pgh7sdfg.cjs +0 -1
  88. package/dist/form-Z4IRWj0o.cjs +0 -1
  89. package/dist/html-to-json-rauxDBi6.cjs +0 -1
  90. package/dist/index-bt7EhwLh.cjs +0 -1
  91. package/dist/page-viewer-O960kM2x.cjs +0 -1
  92. package/dist/project-general-setting-lIvNs-Vq.cjs +0 -1
  93. package/dist/project-seo-setting-MIlAuqcc.cjs +0 -1
  94. package/dist/single-page-detail-0Z_hvd_j.cjs +0 -1
  95. package/dist/useCanvasSettings-R0h03UfD.cjs +0 -1
  96. package/dist/useCanvasSettings-rEZHbw3s.js +0 -6
@@ -1,47 +1,45 @@
1
- var He = Object.defineProperty;
2
- var Pe = (n, s, e) => s in n ? He(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
3
- var N = (n, s, e) => (Pe(n, typeof s != "symbol" ? s + "" : s, e), e);
1
+ var Oe = Object.defineProperty;
2
+ var ze = (n, s, e) => s in n ? Oe(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
3
+ var M = (n, s, e) => (ze(n, typeof s != "symbol" ? s + "" : s, e), e);
4
4
  import { j as r } from "./jsx-runtime-WbnYoNE9.js";
5
- import A, { createElement as ce, useCallback as O, useState as B, useEffect as j, Component as $e, Children as ze, Suspense as J, useRef as de, useMemo as Oe } from "react";
6
- import { map as H, includes as pe, toUpper as X, round as Ue, throttle as ye, has as be, isEmpty as I, first as U, omit as We, pick as qe, get as f, isString as se, memoize as Ke, each as Ye, find as Ge, filter as ke, isNull as Xe } from "lodash-es";
7
- import { ResetIcon as ue, SunIcon as Qe, MobileIcon as he, LaptopIcon as Ze, DesktopIcon as Je, DotsVerticalIcon as Ve, EraserIcon as et, ZoomInIcon as tt, DragHandleDots2Icon as st, ArrowUpIcon as ot, CopyIcon as nt, TrashIcon as rt } from "@radix-ui/react-icons";
8
- import { k as we, B as W, w as je, aq as Ce, ar as it, as as at, at as lt, au as ct, p as oe, X as dt, h as P, av as pt, aw as ut, ax as ht, ay as mt, az as gt, aA as ft, aB as _e, L as D, Y as M, A as xt, a as vt, b as $t, c as yt, d as bt, e as kt, f as wt, g as jt, a3 as Ct, aC as _t, aD as Bt, q as Be, ap as z, aE as Dt, n as At, D as T, aF as De, Q as It, aG as F, aH as St, j as ne, x as Ae, F as Ie, H as Se, V as Et, aI as Nt, aJ as Mt, aK as Tt, G as Lt, aL as Ft, aM as Rt, aN as Ht, aO as Pt, M as zt, aP as Ot, ah as V, i as Ut, a2 as Wt } from "./ChaiBuilderEditor-tkzS851D.js";
5
+ import S, { createElement as ce, useCallback as q, useState as _, useEffect as j, Component as ye, Children as Ue, Suspense as V, useRef as de, useMemo as We } from "react";
6
+ import { map as z, includes as pe, toUpper as Z, round as qe, throttle as ke, has as K, isEmpty as I, first as Y, omit as we, pick as Ke, get as f, isString as oe, memoize as Ye, each as Xe, find as Ge, filter as je, isNull as Qe } from "lodash-es";
7
+ import { ResetIcon as ue, SunIcon as Ze, MobileIcon as he, LaptopIcon as Je, DesktopIcon as Ve, DotsVerticalIcon as et, EraserIcon as tt, ZoomInIcon as st, DragHandleDots2Icon as ot, ArrowUpIcon as nt, CopyIcon as rt, TrashIcon as it } from "@radix-ui/react-icons";
8
+ import { v as Ce, B as X, aa as _e, aR as Be, aS as lt, aT as at, aU as ct, a4 as G, as as dt, h as U, E as pt, F as ut, G as ht, H as mt, I as gt, aV as ft, aW as Ae, r as A, at as L, A as xt, a as vt, b as $t, c as bt, d as yt, e as kt, f as wt, g as jt, P as Ct, U as _t, aX as Bt, a5 as De, aQ as W, aY as At, a2 as Dt, ad as F, aZ as Se, am as St, a_ as P, a$ as It, D as ne, t as Ie, q as Ee, s as Te, Q as Et, b0 as Tt, b1 as Nt, b2 as Mt, X as Lt, b3 as Ft, b4 as Rt, b5 as Ht, b6 as Pt, ai as Ot, b7 as zt, S as ee, $ as Ut } from "./index-uLn8W3eR.js";
9
+ import { a as Wt, u as qt, B as Kt, E as Yt } from "./index-grcmKbfu.js";
9
10
  import { useTranslation as re } from "react-i18next";
10
11
  import { useAtom as b } from "jotai";
11
- import { SparklesIcon as qt } from "lucide-react";
12
+ import { SparklesIcon as Xt } from "lucide-react";
12
13
  import me from "react-dom";
13
14
  import w from "prop-types";
14
- import { Quill as Kt } from "react-quill";
15
- import { d as ie, a as Ee } from "./atoms-ZOWyNoiC.js";
16
- import { flip as Yt } from "@floating-ui/dom";
17
- import { useFloating as Gt, shift as Xt } from "@floating-ui/react-dom";
18
- import { useResizeObserver as Qt } from "@react-hookz/web";
19
- import { useFeature as Zt } from "flagged";
20
- import Jt from "@tailwindcss/typography";
21
- import Vt from "@tailwindcss/forms";
22
- import es from "@tailwindcss/aspect-ratio";
23
- import ts from "tailwindcss-palette-generator";
24
- import { twMerge as ss } from "tailwind-merge";
25
- import { S as ge, a as Ne } from "./MODIFIERS-fd5XOmum.js";
26
- import { getBlockComponent as os } from "@chaibuilder/runtime";
27
- import { u as ns } from "./useCanvasSettings-rEZHbw3s.js";
28
- import { Provider as rs } from "react-wrap-balancer";
29
- import { Resizable as is } from "re-resizable";
15
+ import { Quill as Gt } from "react-quill";
16
+ import { d as ie, a as Ne } from "./atoms-ZOWyNoiC.js";
17
+ import { flip as Qt } from "@floating-ui/dom";
18
+ import { useFloating as Zt, shift as Jt } from "@floating-ui/react-dom";
19
+ import { useResizeObserver as Vt } from "@react-hookz/web";
20
+ import { useFeature as es } from "flagged";
21
+ import ts from "@tailwindcss/typography";
22
+ import ss from "@tailwindcss/forms";
23
+ import os from "@tailwindcss/aspect-ratio";
24
+ import ns from "tailwindcss-palette-generator";
25
+ import { twMerge as rs } from "tailwind-merge";
26
+ import { S as ge, a as Me } from "./MODIFIERS-fd5XOmum.js";
27
+ import { getBlockComponent as is } from "@chaibuilder/runtime";
28
+ import { includes as fe } from "lodash";
29
+ import { Provider as ls } from "react-wrap-balancer";
30
+ import { Resizable as as } from "re-resizable";
30
31
  import "./_commonjsHelpers-UyOWmZb0.js";
31
- import "clsx";
32
- import "@radix-ui/react-scroll-area";
33
- import "i18next";
34
- import "./Functions-7jnEwJyw.js";
35
- import "tree-model";
36
- import "./utils-VpVqnC9m.js";
37
32
  import "@radix-ui/react-toggle";
38
33
  import "class-variance-authority";
34
+ import "./utils-VpVqnC9m.js";
35
+ import "clsx";
39
36
  import "@radix-ui/react-switch";
40
37
  import "@radix-ui/react-slot";
41
38
  import "@radix-ui/react-accordion";
42
39
  import "@radix-ui/react-alert-dialog";
43
40
  import "@radix-ui/react-dialog";
44
41
  import "@radix-ui/react-label";
42
+ import "@radix-ui/react-scroll-area";
45
43
  import "@radix-ui/react-tabs";
46
44
  import "@radix-ui/react-tooltip";
47
45
  import "@radix-ui/react-popover";
@@ -54,21 +52,24 @@ import "@radix-ui/react-toast";
54
52
  import "cmdk";
55
53
  import "@radix-ui/react-context-menu";
56
54
  import "react-icons-picker";
55
+ import "./Functions-7jnEwJyw.js";
56
+ import "tree-model";
57
+ import "i18next";
57
58
  import "react-hotkeys-hook";
58
59
  import "./index-VBXQixVm.js";
59
- const as = () => {
60
- const { hasUndo: n, hasRedo: s, undo: e, redo: t } = we();
60
+ const cs = () => {
61
+ const { hasUndo: n, hasRedo: s, undo: e, redo: t } = Ce();
61
62
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
62
- /* @__PURE__ */ r.jsx(W, { disabled: !n(), size: "sm", onClick: e, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(ue, {}) }),
63
- /* @__PURE__ */ r.jsx(W, { disabled: !s(), onClick: t, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(ue, { className: "rotate-180 scale-y-[-1] transform" }) })
63
+ /* @__PURE__ */ r.jsx(X, { disabled: !n(), size: "sm", onClick: e, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(ue, {}) }),
64
+ /* @__PURE__ */ r.jsx(X, { disabled: !s(), onClick: t, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(ue, { className: "rotate-180 scale-y-[-1] transform" }) })
64
65
  ] });
65
66
  };
66
- function ls() {
67
- const [n, s] = je();
67
+ function ds() {
68
+ const [n, s] = _e();
68
69
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
69
- /* @__PURE__ */ r.jsx(Qe, { className: "size-4 shrink-0" }),
70
+ /* @__PURE__ */ r.jsx(Ze, { className: "size-4 shrink-0" }),
70
71
  /* @__PURE__ */ r.jsx(
71
- Ce,
72
+ Be,
72
73
  {
73
74
  id: "dark-mode-switch",
74
75
  checked: n,
@@ -85,10 +86,10 @@ function ls() {
85
86
  )
86
87
  }
87
88
  ),
88
- /* @__PURE__ */ r.jsx(it, { className: "size-4 ml-3 shrink-0" })
89
+ /* @__PURE__ */ r.jsx(Wt, { className: "size-4 ml-3 shrink-0" })
89
90
  ] });
90
91
  }
91
- const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
92
+ const xe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
92
93
  "svg",
93
94
  {
94
95
  className: n ? "rotate-90" : "",
@@ -111,7 +112,7 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
111
112
  )
112
113
  ]
113
114
  }
114
- ), cs = [
115
+ ), ps = [
115
116
  {
116
117
  title: "mobile_xs_title",
117
118
  content: "mobile_xs_content",
@@ -130,48 +131,48 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
130
131
  title: "tablet_md_title",
131
132
  content: "tablet_md_content",
132
133
  breakpoint: "md",
133
- icon: /* @__PURE__ */ r.jsx(fe, {}),
134
+ icon: /* @__PURE__ */ r.jsx(xe, {}),
134
135
  width: 800
135
136
  },
136
137
  {
137
138
  title: "tablet_lg_title",
138
139
  content: "tablet_lg_content",
139
140
  breakpoint: "lg",
140
- icon: /* @__PURE__ */ r.jsx(fe, { landscape: !0 }),
141
+ icon: /* @__PURE__ */ r.jsx(xe, { landscape: !0 }),
141
142
  width: 1024
142
143
  },
143
144
  {
144
145
  title: "desktop_xl_title",
145
146
  content: "desktop_xl_content",
146
147
  breakpoint: "xl",
147
- icon: /* @__PURE__ */ r.jsx(Ze, {}),
148
+ icon: /* @__PURE__ */ r.jsx(Je, {}),
148
149
  width: 1420
149
150
  },
150
151
  {
151
152
  title: "large_desktop_2xl_title",
152
153
  content: "large_desktop_2xl_content",
153
154
  breakpoint: "2xl",
154
- icon: /* @__PURE__ */ r.jsx(Je, {}),
155
+ icon: /* @__PURE__ */ r.jsx(Ve, {}),
155
156
  width: 1920
156
157
  }
157
- ], xe = ({
158
+ ], ve = ({
158
159
  title: n,
159
160
  content: s,
160
161
  currentBreakpoint: e,
161
162
  breakpoint: t,
162
163
  width: o,
163
- icon: c,
164
- onClick: a
164
+ icon: a,
165
+ onClick: l
165
166
  }) => {
166
167
  const { t: i } = re();
167
- return /* @__PURE__ */ r.jsxs(at, { children: [
168
- /* @__PURE__ */ r.jsx(lt, { asChild: !0, children: /* @__PURE__ */ r.jsx(
169
- W,
168
+ return /* @__PURE__ */ r.jsxs(lt, { children: [
169
+ /* @__PURE__ */ r.jsx(at, { asChild: !0, children: /* @__PURE__ */ r.jsx(
170
+ X,
170
171
  {
171
- onClick: () => a(o),
172
+ onClick: () => l(o),
172
173
  size: "sm",
173
174
  variant: t === e ? "secondary" : "ghost",
174
- children: c
175
+ children: a
175
176
  }
176
177
  ) }),
177
178
  /* @__PURE__ */ r.jsx(ct, { className: "w-52 border-border", children: /* @__PURE__ */ r.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
@@ -179,26 +180,26 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
179
180
  /* @__PURE__ */ r.jsx("p", { className: "text-xs", children: i(s) })
180
181
  ] }) }) })
181
182
  ] });
182
- }, ds = () => {
183
- const [, n, s] = oe(), [e, t] = dt(), { t: o } = re(), c = P("breakpoints", cs), a = (i) => {
184
- e.includes(i) ? e.length > 2 && t(e.filter((d) => d !== i)) : t((d) => [...d, i]);
183
+ }, us = () => {
184
+ const [, n, s] = G(), [e, t] = dt(), { t: o } = re(), a = U("breakpoints", ps), l = (i) => {
185
+ e.includes(i) ? e.length > 2 && t(e.filter((c) => c !== i)) : t((c) => [...c, i]);
185
186
  };
186
- return c.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: H(c, (i) => /* @__PURE__ */ ce(xe, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
187
- H(
188
- c.filter((i) => pe(e, X(i.breakpoint))),
189
- (i) => /* @__PURE__ */ ce(xe, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })
187
+ return a.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: z(a, (i) => /* @__PURE__ */ ce(ve, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
188
+ z(
189
+ a.filter((i) => pe(e, Z(i.breakpoint))),
190
+ (i) => /* @__PURE__ */ ce(ve, { ...i, onClick: s, key: i.breakpoint, currentBreakpoint: n })
190
191
  ),
191
192
  /* @__PURE__ */ r.jsxs(pt, { children: [
192
- /* @__PURE__ */ r.jsx(ut, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Ve, { className: "scale-90 transform" }) }) }),
193
+ /* @__PURE__ */ r.jsx(ut, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(et, { className: "scale-90 transform" }) }) }),
193
194
  /* @__PURE__ */ r.jsxs(ht, { className: "w-56 border-border text-xs", children: [
194
195
  /* @__PURE__ */ r.jsx(mt, { children: o("Breakpoints") }),
195
196
  /* @__PURE__ */ r.jsx(gt, {}),
196
- H(c, (i) => /* @__PURE__ */ r.jsx(
197
+ z(a, (i) => /* @__PURE__ */ r.jsx(
197
198
  ft,
198
199
  {
199
200
  disabled: i.breakpoint === "xs",
200
- onCheckedChange: () => a(X(i.breakpoint)),
201
- checked: pe(e, X(i.breakpoint)),
201
+ onCheckedChange: () => l(Z(i.breakpoint)),
202
+ checked: pe(e, Z(i.breakpoint)),
202
203
  children: o(i.title)
203
204
  },
204
205
  i.breakpoint
@@ -206,19 +207,19 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
206
207
  ] })
207
208
  ] })
208
209
  ] });
209
- }, ps = () => {
210
- const { t: n } = re(), { setNewBlocks: s } = _e(), [, e] = D(), [, t] = M(), o = O(() => {
210
+ }, hs = () => {
211
+ const { t: n } = re(), { setNewBlocks: s } = Ae(), [, e] = A(), [, t] = L(), o = q(() => {
211
212
  s([]), e([]), t([]);
212
213
  }, [s]);
213
214
  return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(xt, { children: [
214
- /* @__PURE__ */ r.jsx(vt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(W, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
215
- /* @__PURE__ */ r.jsx(et, {}),
215
+ /* @__PURE__ */ r.jsx(vt, { asChild: !0, children: /* @__PURE__ */ r.jsxs(X, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
216
+ /* @__PURE__ */ r.jsx(tt, {}),
216
217
  " ",
217
218
  n("clear")
218
219
  ] }) }),
219
220
  /* @__PURE__ */ r.jsxs($t, { className: "border-border", children: [
220
- /* @__PURE__ */ r.jsxs(yt, { children: [
221
- /* @__PURE__ */ r.jsx(bt, { children: n("clear_canvas_title") }),
221
+ /* @__PURE__ */ r.jsxs(bt, { children: [
222
+ /* @__PURE__ */ r.jsx(yt, { children: n("clear_canvas_title") }),
222
223
  /* @__PURE__ */ r.jsx(kt, { children: n("clear_canvas_description") })
223
224
  ] }),
224
225
  /* @__PURE__ */ r.jsxs(wt, { children: [
@@ -227,15 +228,15 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
227
228
  ] })
228
229
  ] })
229
230
  ] }) });
230
- }, us = () => {
231
+ }, ms = () => {
231
232
  const [n, s] = b(_t);
232
- return P("askAiCallBack", null) ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
233
+ return U("askAiCallBack", null) ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center space-x-2", children: [
233
234
  /* @__PURE__ */ r.jsxs(Bt, { htmlFor: "ai-assistant", className: "flex items-center gap-x-1 text-sm text-yellow-600", children: [
234
- /* @__PURE__ */ r.jsx(qt, { className: "w-4" }),
235
+ /* @__PURE__ */ r.jsx(Xt, { className: "w-4" }),
235
236
  "AI Assistant"
236
237
  ] }),
237
238
  /* @__PURE__ */ r.jsx(
238
- Ce,
239
+ Be,
239
240
  {
240
241
  className: "scale-90",
241
242
  checked: n,
@@ -246,34 +247,34 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
246
247
  }
247
248
  )
248
249
  ] }) : null;
249
- }, hs = () => {
250
- const n = P("darkMode", !0), [s] = Be();
250
+ }, gs = () => {
251
+ const n = U("darkMode", !0), [s] = De();
251
252
  return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
252
253
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
253
- /* @__PURE__ */ r.jsx(ds, {}),
254
- /* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
254
+ /* @__PURE__ */ r.jsx(us, {}),
255
+ /* @__PURE__ */ r.jsx(W, { orientation: "vertical" }),
255
256
  n ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
256
- /* @__PURE__ */ r.jsx(ls, {}),
257
- /* @__PURE__ */ r.jsx(z, { orientation: "vertical" })
257
+ /* @__PURE__ */ r.jsx(ds, {}),
258
+ /* @__PURE__ */ r.jsx(W, { orientation: "vertical" })
258
259
  ] }) : null,
259
260
  /* @__PURE__ */ r.jsxs("div", { className: "flex w-12 cursor-not-allowed items-center justify-center gap-x-1 space-x-0 font-medium text-gray-400", children: [
260
- /* @__PURE__ */ r.jsx(tt, { className: "h-3.5 w-3.5 flex-shrink-0" }),
261
+ /* @__PURE__ */ r.jsx(st, { className: "h-3.5 w-3.5 flex-shrink-0" }),
261
262
  " ",
262
263
  /* @__PURE__ */ r.jsxs("div", { className: "text-xs leading-3", children: [
263
- Ue(s, 0),
264
+ qe(s, 0),
264
265
  "%"
265
266
  ] })
266
267
  ] }),
267
- /* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
268
- /* @__PURE__ */ r.jsx(as, {})
268
+ /* @__PURE__ */ r.jsx(W, { orientation: "vertical" }),
269
+ /* @__PURE__ */ r.jsx(cs, {})
269
270
  ] }),
270
271
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
271
- /* @__PURE__ */ r.jsx(ps, {}),
272
- /* @__PURE__ */ r.jsx(z, { orientation: "vertical" }),
273
- /* @__PURE__ */ r.jsx(us, {})
272
+ /* @__PURE__ */ r.jsx(hs, {}),
273
+ /* @__PURE__ */ r.jsx(W, { orientation: "vertical" }),
274
+ /* @__PURE__ */ r.jsx(ms, {})
274
275
  ] })
275
276
  ] });
276
- }, ms = `<!doctype html>
277
+ }, fs = `<!doctype html>
277
278
  <html lang="en" dir="__HTML_DIR__" class="scroll-smooth h-full overflow-y-auto">
278
279
  <head>
279
280
  <meta charset="UTF-8">
@@ -312,6 +313,9 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
312
313
  [data-drop="yes"] { outline: 2px dashed orange !important; outline-offset: -2px }
313
314
  [data-dnd="yes"] { pointer-events: auto !important}
314
315
  [data-dnd="no"] { pointer-events: none !important; }
316
+ [data-dnd-dragged="yes"] { opacity: 0.6; pointer-events: none; }
317
+ [data-dnd-dragged="no"] { opacity: 1; pointer-events: auto !important; }
318
+ [force-show] { display: block !important; }
315
319
  </style>
316
320
  <style id="hidden-blocks"></style>
317
321
  <style id="selected-block"></style>
@@ -324,36 +328,36 @@ const fe = ({ landscape: n = !1 }) => /* @__PURE__ */ r.jsxs(
324
328
  <div class="frame-root h-full"></div>
325
329
  <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
326
330
  </body>
327
- </html>`, gs = (n) => {
328
- const [s] = oe(), [, e] = Be(), [t, o] = B({}), c = O(() => {
329
- const { width: a, height: i } = n;
330
- if (a < s) {
331
- const d = parseFloat((a / s).toFixed(2).toString());
332
- let l = {};
333
- const h = i * d;
334
- i && (l = {
331
+ </html>`, xs = (n) => {
332
+ const [s] = G(), [, e] = De(), [t, o] = _({}), a = q(() => {
333
+ const { width: l, height: i } = n;
334
+ if (l < s) {
335
+ const c = parseFloat((l / s).toFixed(2).toString());
336
+ let u = {};
337
+ const m = i * c;
338
+ i && (u = {
335
339
  // Eureka! This is the formula to calculate the height of the scaled element. Thank you ChatGPT 4
336
- height: 100 + (i - h) / h * 100 + "%"
340
+ height: 100 + (i - m) / m * 100 + "%"
337
341
  }), o({
338
342
  position: "relative",
339
343
  top: 0,
340
- transform: `scale(${d})`,
344
+ transform: `scale(${c})`,
341
345
  transformOrigin: "top left",
342
- ...l,
346
+ ...u,
343
347
  maxWidth: "none"
344
- }), e(d * 100);
348
+ }), e(c * 100);
345
349
  } else
346
350
  o({}), e(100);
347
351
  }, [s, n, e]);
348
352
  return j(() => {
349
- c();
350
- }, [s, n, e, c]), t;
353
+ a();
354
+ }, [s, n, e, a]), t;
351
355
  };
352
- let Me, Te;
353
- typeof document < "u" && (Me = document);
354
- typeof window < "u" && (Te = window);
355
- const Le = A.createContext({ document: Me, window: Te }), q = () => A.useContext(Le), { Provider: fs, Consumer: Yo } = Le;
356
- class Fe extends $e {
356
+ let Le, Fe;
357
+ typeof document < "u" && (Le = document);
358
+ typeof window < "u" && (Fe = window);
359
+ const Re = S.createContext({ document: Le, window: Fe }), Q = () => S.useContext(Re), { Provider: vs, Consumer: Jo } = Re;
360
+ class He extends ye {
357
361
  componentDidMount() {
358
362
  this.props.contentDidMount();
359
363
  }
@@ -361,31 +365,31 @@ class Fe extends $e {
361
365
  this.props.contentDidUpdate();
362
366
  }
363
367
  render() {
364
- return ze.only(this.props.children);
368
+ return Ue.only(this.props.children);
365
369
  }
366
370
  }
367
- N(Fe, "propTypes", {
371
+ M(He, "propTypes", {
368
372
  children: w.element.isRequired,
369
373
  contentDidMount: w.func.isRequired,
370
374
  contentDidUpdate: w.func.isRequired
371
375
  });
372
- class ee extends $e {
376
+ class te extends ye {
373
377
  constructor(e, t) {
374
378
  super(e, t);
375
- N(this, "setRef", (e) => {
379
+ M(this, "setRef", (e) => {
376
380
  this.nodeRef.current = e;
377
381
  const { forwardedRef: t } = this.props;
378
382
  typeof t == "function" ? t(e) : t && (t.current = e);
379
383
  });
380
- N(this, "handleLoad", () => {
384
+ M(this, "handleLoad", () => {
381
385
  clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
382
386
  });
383
387
  // In certain situations on a cold cache DOMContentLoaded never gets called
384
388
  // fallback to an interval to check if that's the case
385
- N(this, "loadCheck", () => setInterval(() => {
389
+ M(this, "loadCheck", () => setInterval(() => {
386
390
  this.handleLoad();
387
391
  }, 500));
388
- this._isMounted = !1, this.nodeRef = A.createRef(), this.state = { iframeLoaded: !1 };
392
+ this._isMounted = !1, this.nodeRef = S.createRef(), this.state = { iframeLoaded: !1 };
389
393
  }
390
394
  componentDidMount() {
391
395
  this._isMounted = !0, this.getDoc() && this.nodeRef.current.contentWindow.addEventListener("DOMContentLoaded", this.handleLoad);
@@ -406,8 +410,8 @@ class ee extends $e {
406
410
  const e = this.getDoc();
407
411
  if (!e)
408
412
  return null;
409
- const t = this.props.contentDidMount, o = this.props.contentDidUpdate, c = e.defaultView || e.parentView, a = /* @__PURE__ */ r.jsx(Fe, { contentDidMount: t, contentDidUpdate: o, children: /* @__PURE__ */ r.jsx(fs, { value: { document: e, window: c }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), i = this.getMountTarget();
410
- return [me.createPortal(this.props.head, this.getDoc().head), me.createPortal(a, i)];
413
+ const t = this.props.contentDidMount, o = this.props.contentDidUpdate, a = e.defaultView || e.parentView, l = /* @__PURE__ */ r.jsx(He, { contentDidMount: t, contentDidUpdate: o, children: /* @__PURE__ */ r.jsx(vs, { value: { document: e, window: a }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), i = this.getMountTarget();
414
+ return [me.createPortal(this.props.head, this.getDoc().head), me.createPortal(l, i)];
411
415
  }
412
416
  render() {
413
417
  const e = {
@@ -423,7 +427,7 @@ class ee extends $e {
423
427
  // also inject into the body and can mess up React. For this reason
424
428
  // initialContent is expected to have a div inside of the body
425
429
  // element that we render react into.
426
- N(ee, "propTypes", {
430
+ M(te, "propTypes", {
427
431
  style: w.object,
428
432
  // eslint-disable-line
429
433
  head: w.node,
@@ -432,7 +436,7 @@ N(ee, "propTypes", {
432
436
  contentDidMount: w.func,
433
437
  contentDidUpdate: w.func,
434
438
  children: w.oneOfType([w.element, w.arrayOf(w.element)])
435
- }), N(ee, "defaultProps", {
439
+ }), M(te, "defaultProps", {
436
440
  style: {},
437
441
  head: null,
438
442
  children: void 0,
@@ -443,289 +447,280 @@ N(ee, "propTypes", {
443
447
  },
444
448
  initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
445
449
  });
446
- const xs = A.forwardRef((n, s) => /* @__PURE__ */ r.jsx(ee, { ...n, forwardedRef: s }));
447
- function ae(n) {
450
+ const $s = S.forwardRef((n, s) => /* @__PURE__ */ r.jsx(te, { ...n, forwardedRef: s }));
451
+ function le(n) {
448
452
  const s = window.getComputedStyle(n), e = s.display;
449
453
  if (e === "flex" || e === "inline-flex") {
450
454
  const t = s.flexDirection;
451
455
  return t === "column" || t === "column-reverse" ? "vertical" : "horizontal";
452
456
  } else if (e === "grid") {
453
- const t = s.gridAutoFlow, o = s.gridTemplateRows, c = s.gridTemplateColumns;
454
- return t.includes("column") || o.split(" ").length > c.split(" ").length ? "vertical" : "horizontal";
457
+ const t = s.gridAutoFlow, o = s.gridTemplateRows, a = s.gridTemplateColumns;
458
+ return t.includes("column") || o.split(" ").length > a.split(" ").length ? "vertical" : "horizontal";
455
459
  } else if (e === "block" || e === "inline-block")
456
460
  return "vertical";
457
461
  return "horizontal";
458
462
  }
459
- let v = null, _ = [], R = null, Q = null;
460
- const ve = (n, s, e) => {
461
- if (!v || !n)
463
+ let y = null, B = [], H = null, J = null;
464
+ const $e = (n, s, e) => {
465
+ if (!y || !n)
462
466
  return;
463
- const t = v == null ? void 0 : v.getElementById("placeholder"), o = _.map(([d]) => d), c = o.reduce(
464
- (d, l) => Math.abs(l - e) < Math.abs(d - e) ? l : d,
467
+ const t = y == null ? void 0 : y.getElementById("placeholder"), o = B.map(([c]) => c), a = o.reduce(
468
+ (c, u) => Math.abs(u - e) < Math.abs(c - e) ? u : c,
465
469
  0
466
- ), a = o.indexOf(c);
467
- if (!_[a])
470
+ ), l = o.indexOf(a);
471
+ if (!B[l])
468
472
  return;
469
- const i = _[a];
473
+ const i = B[l];
470
474
  t.style.width = s === "vertical" ? i[2] + "px" : "2px", t.style.height = s === "vertical" ? "2px" : i[2] + "px", t.style.display = "block", s === "vertical" ? (t.style.top = i[0] + "px", t.style.left = i[1] + "px") : (t.style.top = i[1] + "px", t.style.left = i[0] + "px");
471
475
  };
472
- function vs(n, s) {
476
+ function bs(n, s) {
473
477
  let e = 0, t = 1 / 0;
474
- return s.forEach((o, c) => {
475
- const a = Math.abs(o[0] - n);
476
- a < t && (t = a, e = c);
478
+ return s.forEach((o, a) => {
479
+ const l = Math.abs(o[0] - n);
480
+ l < t && (t = l, e = a);
477
481
  }), e;
478
482
  }
479
- const $s = (n) => {
480
- const e = ae(n) === "horizontal";
481
- _ = [], Array.from(n.children).forEach((t, o) => {
483
+ const ys = (n) => {
484
+ const e = le(n) === "horizontal";
485
+ B = [], Array.from(n.children).forEach((t, o) => {
482
486
  if (t.classList.contains("pointer-events-none"))
483
487
  return;
484
- const c = e ? t.offsetLeft : t.offsetTop, a = e ? [t.offsetTop, t.clientHeight] : [t.offsetLeft, t.clientWidth];
485
- if (_.push([c, a[0], a[1]]), o === n.children.length - 1) {
488
+ const a = e ? t.offsetLeft : t.offsetTop, l = e ? [t.offsetTop, t.clientHeight] : [t.offsetLeft, t.clientWidth];
489
+ if (B.push([a, l[0], l[1]]), o === n.children.length - 1) {
486
490
  const i = e ? t.offsetLeft + t.clientWidth : t.offsetTop + t.clientHeight;
487
- _.push([i, a[0], a[1]]);
491
+ B.push([i, l[0], l[1]]);
488
492
  }
489
493
  });
490
- }, ys = ye((n) => {
494
+ }, ks = ke((n) => {
491
495
  var o;
492
- const s = n.target, e = ae(s), t = (o = v == null ? void 0 : v.defaultView) == null ? void 0 : o.scrollY;
493
- e === "vertical" ? ve(s, e, n.clientY + t) : ve(s, e, n.clientX);
496
+ const s = n.target, e = le(s), t = (o = y == null ? void 0 : y.defaultView) == null ? void 0 : o.scrollY;
497
+ e === "vertical" ? $e(s, e, n.clientY + t) : $e(s, e, n.clientX);
494
498
  }, 0);
495
- function Z() {
496
- const n = v == null ? void 0 : v.getElementById("placeholder");
497
- n.style.display = "none", bs("pointer-none"), ks();
499
+ function be() {
500
+ const n = y == null ? void 0 : y.getElementById("placeholder");
501
+ n.style.display = "none", ws("pointer-none"), js();
498
502
  }
499
- function bs(n) {
500
- (v == null ? void 0 : v.querySelectorAll(`.${n}`)).forEach((e) => {
503
+ function ws(n) {
504
+ (y == null ? void 0 : y.querySelectorAll(`.${n}`)).forEach((e) => {
501
505
  e.classList.remove(n);
502
506
  });
503
507
  }
504
- function ks() {
505
- const n = v == null ? void 0 : v.querySelector('[data-drop="yes"]');
508
+ function js() {
509
+ const n = y == null ? void 0 : y.querySelector('[data-drop="yes"]');
506
510
  n && n.removeAttribute("data-drop");
507
511
  }
508
- const ws = () => {
509
- const { document: n } = q(), [s, e] = b(Dt), { addCoreBlock: t } = At(), [, o] = T(), [, c] = D(), { moveBlocks: a } = _e(), [, i] = b(De), [d, l] = b(ie), [, h] = b(Ee);
510
- return v = n, {
512
+ const Cs = () => {
513
+ const { document: n } = Q(), [s, e] = b(At), { addCoreBlock: t } = Dt(), [, o] = F(), [, a] = A(), { moveBlocks: l } = Ae(), [, i] = b(Se), [c, u] = b(ie), [, m] = b(Ne), d = () => {
514
+ be(), e(!1), i(""), u(null), m(null), B = [];
515
+ };
516
+ return y = n, {
511
517
  isDragging: s,
512
- onDragOver: (p) => {
513
- p.preventDefault(), p.stopPropagation(), ys(p);
518
+ onDragOver: (h) => {
519
+ h.preventDefault(), h.stopPropagation(), ks(h);
514
520
  },
515
- onDrop: (p) => {
516
- var C;
517
- R == null || R.classList.remove("drop-target");
518
- const u = R, y = ae(u) === "vertical" ? p.clientY + ((C = v == null ? void 0 : v.defaultView) == null ? void 0 : C.scrollY) : p.clientX;
519
- Q = vs(y, _);
520
- const g = d, m = u.getAttribute("data-block-id");
521
- if (!be(g, "_id")) {
522
- t(g, m === "canvas" ? null : m, Q), setTimeout(() => {
523
- Z();
524
- }, 300), _ = [], e(!1), i(""), l(null), h(null);
521
+ onDrop: (h) => {
522
+ var D;
523
+ H == null || H.classList.remove("drop-target");
524
+ const x = H, g = le(x) === "vertical" ? h.clientY + ((D = y == null ? void 0 : y.defaultView) == null ? void 0 : D.scrollY) : h.clientX;
525
+ J = bs(g, B);
526
+ const p = c, k = x.getAttribute("data-block-id");
527
+ if (p === H) {
528
+ d();
525
529
  return;
526
530
  }
527
- let k = u.getAttribute("data-block-id");
528
- k === null && (k = p.target.parentElement.getAttribute("data-block-id")), a([g._id], k, Q), Z(), e(!1), i(""), _ = [], setTimeout(() => Z(), 300);
531
+ if (!K(p, "_id")) {
532
+ t(p, k === "canvas" ? null : k, J), setTimeout(d, 300);
533
+ return;
534
+ }
535
+ let C = x.getAttribute("data-block-id");
536
+ C === null && (C = h.target.parentElement.getAttribute("data-block-id")), l([p._id], C, J), d(), setTimeout(be, 300);
529
537
  },
530
- onDragEnter: (p) => {
531
- const u = p, $ = u.target;
532
- R = $;
533
- const y = $.getAttribute("data-block-id");
534
- h(y), u.stopPropagation(), u.preventDefault(), _ = [], $s($), console.log(_, p.clientY, v.defaultView.scrollY), $.classList.add("drop-target"), e(!0), o(""), c([]);
538
+ onDragEnter: (h) => {
539
+ const x = h, $ = x.target;
540
+ H = $;
541
+ const g = $.getAttribute("data-block-id");
542
+ m(g), x.stopPropagation(), x.preventDefault(), B = [], ys($), $.classList.add("drop-target"), e(!0), o(""), a([]);
535
543
  }
536
- // onDragLeave: (e: DragEvent) => {
537
- // const event = e;
538
- // event.stopPropagation();
539
- // event.preventDefault();
540
- // const target = event.target as HTMLElement;
541
- // if (target && target.classList.contains("drop-target")) {
542
- // target.classList.remove("drop-target");
543
- // if (dropTarget === target) {
544
- // dropTarget = null;
545
- // }
546
- // }
547
- // removePlaceholder();
548
- // },
549
544
  };
550
545
  };
551
- function le(n) {
546
+ function ae(n) {
552
547
  return n.getAttribute("data-block-id") ? n : n.closest("[data-block-id]");
553
548
  }
554
- function js(n) {
549
+ function _s(n) {
555
550
  n.container.innerHTML = "", n.container.parentNode.removeChild(n.container);
556
551
  var s = document.querySelector(".ql-toolbar");
557
552
  s && s.parentNode.removeChild(s), n = null;
558
553
  }
559
- const Cs = () => {
560
- const n = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], s = It(), [, e] = T(), [t, o] = b(F);
561
- return (c) => {
562
- var p;
554
+ const Bs = () => {
555
+ const n = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], s = St(), [, e] = F(), [t, o] = b(P);
556
+ return (a) => {
557
+ var d;
563
558
  if (t)
564
559
  return;
565
- const a = le(c.target), i = a.getAttribute("data-block-type");
560
+ const l = ae(a.target), i = l.getAttribute("data-block-type");
566
561
  if (!i || !n.includes(i))
567
562
  return;
568
- const d = a.cloneNode(!0);
569
- a.style.display = "none", Array.from(d.attributes).forEach((u) => {
570
- u.name !== "class" && d.removeAttribute(u.name);
571
- }), i === "Text" && (d.style.display = "inline-block"), a.parentNode.insertBefore(d, a.nextSibling);
572
- const l = new Kt(d, { placeholder: "Type here..." });
573
- function h() {
574
- const u = l.getText(0, l.getLength());
575
- s([a.getAttribute("data-block-id")], { content: u }), a.removeAttribute("style"), d.removeEventListener("blur", h, !0), js(l), o(""), e("");
563
+ const c = l.cloneNode(!0);
564
+ l.style.display = "none", Array.from(c.attributes).forEach((h) => {
565
+ h.name !== "class" && c.removeAttribute(h.name);
566
+ }), i === "Text" && (c.style.display = "inline-block"), l.parentNode.insertBefore(c, l.nextSibling);
567
+ const u = new Gt(c, { placeholder: "Type here..." });
568
+ function m() {
569
+ const h = u.getText(0, u.getLength());
570
+ s([l.getAttribute("data-block-id")], { content: h }), l.removeAttribute("style"), c.removeEventListener("blur", m, !0), _s(u), o(""), e("");
576
571
  }
577
- d.addEventListener("blur", h, !0), d.addEventListener("keydown", (u) => {
578
- (u.key === "Enter" || u.key === "Escape") && h();
579
- }), l.focus(), (p = d.querySelector(".ql-clipboard")) == null || p.remove(), o(a.getAttribute("data-block-id"));
572
+ c.addEventListener("blur", m, !0), c.addEventListener("keydown", (h) => {
573
+ (h.key === "Enter" || h.key === "Escape") && m();
574
+ }), u.focus(), (d = c.querySelector(".ql-clipboard")) == null || d.remove(), o(l.getAttribute("data-block-id"));
580
575
  };
581
- }, _s = () => {
582
- const [, n] = M(), [s, e] = D(), [, t] = T(), [o] = b(F), [c] = b(St);
583
- return (a) => {
576
+ }, As = () => {
577
+ const [, n] = L(), [s, e] = A(), [, t] = F(), [o] = b(P), [a] = b(It);
578
+ return (l) => {
584
579
  if (o)
585
580
  return;
586
- a.stopPropagation();
587
- const i = le(a.target);
581
+ l.stopPropagation();
582
+ const i = ae(l.target);
588
583
  if (i != null && i.getAttribute("data-block-id") && (i == null ? void 0 : i.getAttribute("data-block-id")) === "container") {
589
584
  e([]), n([]), t("");
590
585
  return;
591
586
  }
592
587
  if (i != null && i.getAttribute("data-block-parent")) {
593
- const d = i.getAttribute("data-style-prop"), l = i.getAttribute("data-style-id"), h = i.getAttribute("data-block-parent");
594
- s.includes(h) || c == null || c.closeAll(), n([{ id: l, prop: d, blockId: h }]), e([h]);
588
+ const c = i.getAttribute("data-style-prop"), u = i.getAttribute("data-style-id"), m = i.getAttribute("data-block-parent");
589
+ s.includes(m) || a == null || a.closeAll(), n([{ id: u, prop: c, blockId: m }]), e([m]);
595
590
  } else if (i != null && i.getAttribute("data-block-id")) {
596
- let d = i.getAttribute("data-block-id");
597
- s.includes(d) || c == null || c.closeAll(), e([d]);
591
+ let c = i.getAttribute("data-block-id");
592
+ s.includes(c) || a == null || a.closeAll(), e([c]);
598
593
  }
599
594
  t("");
600
595
  };
601
- }, Bs = ye((n, s) => {
602
- const e = le(n.target);
596
+ }, Ds = ke((n, s) => {
597
+ const e = ae(n.target);
603
598
  e != null && e.getAttribute("data-style-id") && s(e.getAttribute("data-style-id"));
604
- }, 100), Ds = () => {
605
- const [, n] = T(), [s] = b(F);
599
+ }, 100), Ss = () => {
600
+ const [, n] = F(), [s] = b(P);
606
601
  return (e) => {
607
- s || Bs(e, n);
602
+ s || Ds(e, n);
608
603
  };
609
- }, As = ({ children: n }) => {
610
- const { document: s } = q(), [e] = D(), [t, o] = M();
604
+ }, Is = ({ children: n }) => {
605
+ const { document: s } = Q(), [e] = A(), [t, o] = L();
611
606
  j(() => {
612
607
  setTimeout(() => {
613
608
  if (!I(t))
614
609
  return;
615
- const l = Re(s, U(e));
616
- if (l) {
617
- const h = l.getAttribute("data-style-prop");
618
- if (h) {
619
- const p = l.getAttribute("data-style-id"), u = l.getAttribute("data-block-parent");
620
- o([{ id: p, prop: h, blockId: u }]);
610
+ const u = Pe(s, Y(e));
611
+ if (u) {
612
+ const m = u.getAttribute("data-style-prop");
613
+ if (m) {
614
+ const d = u.getAttribute("data-style-id"), h = u.getAttribute("data-block-parent");
615
+ o([{ id: d, prop: m, blockId: h }]);
621
616
  }
622
617
  }
623
618
  }, 100);
624
619
  }, [s, e, o, t]);
625
- const c = Cs(), a = _s(), i = Ds(), d = ws();
620
+ const a = Bs(), l = As(), i = Ss(), c = Cs();
626
621
  return /* @__PURE__ */ r.jsx(
627
622
  "div",
628
623
  {
629
624
  "data-block-id": "canvas",
630
625
  id: "canvas",
631
- onClick: a,
632
- onDoubleClick: c,
626
+ onClick: l,
627
+ onDoubleClick: a,
633
628
  onMouseMove: i,
634
- ...We(d, "isDragging"),
635
- className: "relative mb-5 h-full max-w-full " + (d.isDragging ? "dragging" : ""),
629
+ ...we(c, "isDragging"),
630
+ className: "relative mb-5 h-full max-w-full " + (c.isDragging ? "dragging" : ""),
636
631
  children: n
637
632
  }
638
633
  );
639
- }, Re = (n, s) => n.querySelector(`[data-block-id="${s}"]`), Is = () => {
640
- const { window: n } = q(), [s, e] = D(), [t] = ne(), [, o] = M(), { undo: c, redo: a } = we(), i = Ae(), [, d] = Ie(), l = Se(), { savePage: h } = Et(), [p] = b(F), [, u] = b(Nt), $ = (g) => {
641
- g.key === "Enter" && (g.preventDefault(), s.length === 1 && u(U(s)));
642
- }, y = (g) => {
643
- const m = t.find((k) => k._id === g);
644
- return m ? m._parent : null;
634
+ }, Pe = (n, s) => n.querySelector(`[data-block-id="${s}"]`), Es = () => {
635
+ const { window: n } = Q(), [s, e] = A(), [t] = ne(), [, o] = L(), { undo: a, redo: l } = Ce(), i = Ie(), [, c] = Ee(), u = Te(), { savePage: m } = Et(), [d] = b(P), [, h] = b(Tt), x = (g) => {
636
+ g.key === "Enter" && (g.preventDefault(), s.length === 1 && h(Y(s)));
637
+ }, $ = (g) => {
638
+ const p = t.find((k) => k._id === g);
639
+ return p ? p._parent : null;
645
640
  };
646
641
  return j(() => {
647
- const g = (m) => {
648
- if (m.key === "Escape") {
642
+ const g = (p) => {
643
+ if (p.key === "Escape") {
649
644
  e([]), o([]);
650
645
  return;
651
646
  }
652
- if ($(m), !p && (m.key === "Delete" || m.key === "Backspace") && (m.preventDefault(), l(s)), m.ctrlKey || m.metaKey) {
653
- if (m.key === "ArrowUp") {
654
- m.preventDefault();
655
- const k = s.length > 0 ? y(s[0]) : null;
647
+ if (x(p), !d && (p.key === "Delete" || p.key === "Backspace") && (p.preventDefault(), u(s)), p.ctrlKey || p.metaKey) {
648
+ if (p.key === "ArrowUp") {
649
+ p.preventDefault();
650
+ const k = s.length > 0 ? $(s[0]) : null;
656
651
  k && e([k]);
657
652
  }
658
- if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(m.key)) {
659
- if (p && ["x", "z", "v"].includes(m.key))
653
+ if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(p.key)) {
654
+ if (d && ["x", "z", "v"].includes(p.key))
660
655
  return !0;
661
- m.preventDefault();
656
+ p.preventDefault();
662
657
  }
663
- m.key === "s" && (m.stopPropagation(), m.preventDefault(), h()), m.key === "z" && c(), m.key === "y" && a(), m.key === "d" && i(s);
658
+ p.key === "s" && (p.stopPropagation(), p.preventDefault(), m()), p.key === "z" && a(), p.key === "y" && l(), p.key === "d" && i(s);
664
659
  }
665
660
  };
666
661
  return n.removeEventListener("keydown", g), n.addEventListener("keydown", g), () => {
667
662
  n.removeEventListener("keydown", g);
668
663
  };
669
- }, [s, e, c, l, d, a, i, p, h, n]), null;
670
- }, Ss = ({ block: n, label: s }) => {
671
- const [, e] = D(), [, t] = T(), [, o] = b(ie), c = Zt("dnd");
664
+ }, [s, e, a, u, c, l, i, d, m, n]), null;
665
+ }, Ts = ({ block: n, label: s }) => {
666
+ const [, e] = A(), [, t] = F(), [, o] = b(ie), a = es("dnd");
672
667
  return /* @__PURE__ */ r.jsxs(
673
668
  "div",
674
669
  {
675
670
  className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
676
- draggable: c ? "true" : "false",
677
- onDragStart: (a) => {
678
- a.dataTransfer.setData("text/plain", JSON.stringify(qe(n, ["_id", "_type", "_name"]))), o(n), setTimeout(() => {
671
+ draggable: a ? "true" : "false",
672
+ onDragStart: (l) => {
673
+ l.dataTransfer.setData("text/plain", JSON.stringify(Ke(n, ["_id", "_type", "_name"]))), o(n), setTimeout(() => {
679
674
  e([]), t(null);
680
675
  }, 200);
681
676
  },
682
677
  children: [
683
- /* @__PURE__ */ r.jsx(st, {}),
678
+ /* @__PURE__ */ r.jsx(ot, {}),
684
679
  s
685
680
  ]
686
681
  }
687
682
  );
688
- }, Es = ({ selectedBlockElement: n, block: s }) => {
689
- const e = Se(), t = Ae(), [, o] = D(), [, c] = M(), [a] = b(F), { floatingStyles: i, refs: d, update: l } = Gt({
683
+ }, Ns = ({ selectedBlockElement: n, block: s }) => {
684
+ const e = Te(), t = Ie(), [, o] = A(), [, a] = L(), [l] = b(P), { floatingStyles: i, refs: c, update: u } = Zt({
690
685
  placement: "top-start",
691
- middleware: [Xt(), Yt()],
686
+ middleware: [Jt(), Qt()],
692
687
  elements: {
693
688
  reference: n
694
689
  }
695
690
  });
696
- Qt(n, () => l(), n !== null);
697
- const h = f(s, "_parent", null), p = I(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
698
- return !n || !s || a ? null : /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(
691
+ Vt(n, () => u(), n !== null);
692
+ const m = f(s, "_parent", null), d = I(f(s, "_name", "")) ? f(s, "_type", "") : f(s, "_name", "");
693
+ return !n || !s || l ? null : /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(
699
694
  "div",
700
695
  {
701
696
  role: "button",
702
697
  tabIndex: 0,
703
- ref: d.setFloating,
698
+ ref: c.setFloating,
704
699
  style: i,
705
- onClick: (u) => {
706
- u.stopPropagation(), u.preventDefault();
700
+ onClick: (h) => {
701
+ h.stopPropagation(), h.preventDefault();
707
702
  },
708
- onKeyDown: (u) => u.stopPropagation(),
703
+ onKeyDown: (h) => h.stopPropagation(),
709
704
  className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
710
705
  children: [
711
- /* @__PURE__ */ r.jsx(Ss, { label: p, block: s }),
706
+ /* @__PURE__ */ r.jsx(Ts, { label: d, block: s }),
712
707
  /* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1", children: [
713
- h && /* @__PURE__ */ r.jsx(
714
- ot,
708
+ m && /* @__PURE__ */ r.jsx(
709
+ nt,
715
710
  {
716
711
  className: "hover:scale-105",
717
712
  onClick: () => {
718
- c([]), o([h]);
713
+ a([]), o([m]);
719
714
  }
720
715
  }
721
716
  ),
722
- Mt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(nt, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
723
- Tt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(rt, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
717
+ Nt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(rt, { className: "hover:scale-105", onClick: () => t([s == null ? void 0 : s._id]) }) : null,
718
+ Mt(f(s, "_type", "")) ? /* @__PURE__ */ r.jsx(it, { className: "hover:scale-105", onClick: () => e([s == null ? void 0 : s._id]) }) : null
724
719
  ] })
725
720
  ]
726
721
  }
727
722
  ) });
728
- }, Ns = ({ addVariant: n, e: s }) => {
723
+ }, Ms = ({ addVariant: n, e: s }) => {
729
724
  n("hs-dropdown-open", [
730
725
  ({ modifySelectors: e, separator: t }) => {
731
726
  e(({ className: o }) => `.hs-dropdown.open > .${s(`hs-dropdown-open${t}${o}`)}`);
@@ -978,27 +973,27 @@ const Cs = () => {
978
973
  }), n("hs-auto-mode-active", ({ modifySelectors: e, separator: t }) => {
979
974
  e(({ className: o }) => `.auto .${s(`hs-auto-mode-active${t}${o}`)}`);
980
975
  });
981
- }, Ms = ({ model: n }) => {
982
- const [s] = Lt(), [e] = D(), [t] = je(), [o] = T(), [c] = M(), [a] = b(De), { document: i, window: d } = q(), [l] = B(i == null ? void 0 : i.getElementById("highlighted-block")), [h] = B(
976
+ }, Ls = ({ model: n }) => {
977
+ const [s] = Lt(), [e] = A(), [t] = _e(), [o] = F(), [a] = L(), [l] = b(Se), { document: i, window: c } = Q(), [u] = _(i == null ? void 0 : i.getElementById("highlighted-block")), [m] = _(
983
978
  i == null ? void 0 : i.getElementById("selected-block")
984
- ), [p] = B(
979
+ ), [d] = _(
985
980
  i == null ? void 0 : i.getElementById("selected-styling-block")
986
- ), [u] = B(i == null ? void 0 : i.getElementById("dragged-block"));
981
+ ), [h] = _(i == null ? void 0 : i.getElementById("dragged-block"));
987
982
  j(() => {
988
983
  t ? i == null || i.documentElement.classList.add("dark") : i == null || i.documentElement.classList.remove("dark");
989
984
  }, [t, i]);
990
- const $ = f(s, "headingFont", "DM Sans"), y = f(s, "bodyFont", "DM Sans");
985
+ const x = f(s, "headingFont", "DM Sans"), $ = f(s, "bodyFont", "DM Sans");
991
986
  return j(() => {
992
- const g = f(s, "primaryColor", "#000"), m = f(s, "secondaryColor", "#FFF"), k = f(s, "bodyBgLightColor", "#fff"), C = f(s, "bodyBgDarkColor", "#000"), L = f(s, "bodyTextDarkColor", "#000"), K = f(s, "bodyTextLightColor", "#fff"), Y = ts([
987
+ const g = f(s, "primaryColor", "#000"), p = f(s, "secondaryColor", "#FFF"), k = f(s, "bodyBgLightColor", "#fff"), C = f(s, "bodyBgDarkColor", "#000"), D = f(s, "bodyTextDarkColor", "#000"), E = f(s, "bodyTextLightColor", "#fff"), R = ns([
993
988
  { color: g, name: "primary" },
994
- { color: m, name: "secondary" }
995
- ]), G = {
989
+ { color: p, name: "secondary" }
990
+ ]), O = {
996
991
  "bg-light": k,
997
992
  "bg-dark": C,
998
- "text-dark": L,
999
- "text-light": K
1000
- }, x = f(s, "roundedCorners", "0");
1001
- !d || !d.tailwind || (d.tailwind.config = {
993
+ "text-dark": D,
994
+ "text-light": E
995
+ }, v = f(s, "roundedCorners", "0");
996
+ !c || !c.tailwind || (c.tailwind.config = {
1002
997
  darkMode: "class",
1003
998
  theme: {
1004
999
  extend: {
@@ -1010,177 +1005,197 @@ const Cs = () => {
1010
1005
  }
1011
1006
  },
1012
1007
  fontFamily: {
1013
- heading: [$],
1014
- body: [y]
1008
+ heading: [x],
1009
+ body: [$]
1015
1010
  },
1016
1011
  borderRadius: {
1017
- DEFAULT: `${x || "0"}px`
1012
+ DEFAULT: `${v || "0"}px`
1018
1013
  },
1019
- colors: { ...G, ...Y }
1014
+ colors: { ...O, ...R }
1020
1015
  }
1021
1016
  },
1022
- plugins: [Jt, Vt, es, d.tailwind.plugin.withOptions(() => Ns)]
1017
+ plugins: [ts, ss, os, c.tailwind.plugin.withOptions(() => Ms)]
1023
1018
  });
1024
- }, [s, d, $, y]), j(() => {
1025
- h && (h.textContent = `${H(e, (g) => `[data-block-id="${g}"]`).join(",")}{
1019
+ }, [s, c, x, $]), j(() => {
1020
+ m && (m.textContent = `${z(e, (g) => `[data-block-id="${g}"]`).join(",")}{
1026
1021
  outline: 1px solid ${e.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
1027
1022
  }`);
1028
- }, [e, h]), j(() => {
1029
- if (!a) {
1030
- u.textContent = "";
1023
+ }, [e, m]), j(() => {
1024
+ if (!l) {
1025
+ h.textContent = "";
1031
1026
  return;
1032
1027
  }
1033
- u.textContent = `[data-block-id="${a}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
1034
- }, [a]), j(() => {
1035
- l && (l.textContent = o ? `[data-style-id="${o}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
1036
- }, [o, e, l]), j(() => {
1037
- p && (p.textContent = `${H(c, ({ id: g }) => `[data-style-id="${g}"]`).join(",")}{
1028
+ h.textContent = `[data-block-id="${l}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
1029
+ }, [l]), j(() => {
1030
+ u && (u.textContent = o ? `[data-style-id="${o}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
1031
+ }, [o, e, u]), j(() => {
1032
+ d && (d.textContent = `${z(a, ({ id: g }) => `[data-style-id="${g}"]`).join(",")}{
1038
1033
  outline: 1px solid #42a1fc !important; outline-offset: -1px;
1039
1034
  }`);
1040
- }, [c, p]), j(() => {
1041
- const g = f(s, "bodyTextLightColor", "#64748b"), m = f(s, "bodyTextDarkColor", "#94a3b8"), k = f(s, "bodyBgLightColor", "#FFFFFF"), C = f(s, "bodyBgDarkColor", "#0f172a");
1042
- i.body.className = `font-body antialiased text-[${g}] bg-[${k}] dark:text-[${m}] dark:bg-[${C}]`;
1035
+ }, [a, d]), j(() => {
1036
+ const g = f(s, "bodyTextLightColor", "#64748b"), p = f(s, "bodyTextDarkColor", "#94a3b8"), k = f(s, "bodyBgLightColor", "#FFFFFF"), C = f(s, "bodyBgDarkColor", "#0f172a");
1037
+ i.body.className = `font-body antialiased text-[${g}] bg-[${k}] dark:text-[${p}] dark:bg-[${C}]`;
1043
1038
  }, [s, i, n]), n === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1044
- $ && /* @__PURE__ */ r.jsx(
1039
+ x && /* @__PURE__ */ r.jsx(
1045
1040
  "link",
1046
1041
  {
1047
1042
  id: "heading-font",
1048
1043
  rel: "stylesheet",
1049
1044
  type: "text/css",
1050
- href: `https://fonts.googleapis.com/css2?family=${$.replace(
1045
+ href: `https://fonts.googleapis.com/css2?family=${x.replace(
1051
1046
  / /g,
1052
1047
  "+"
1053
1048
  )}:wght@300;400;500;600;700;800;900&display=swap`,
1054
1049
  media: "all"
1055
1050
  }
1056
1051
  ),
1057
- y && $ !== y && /* @__PURE__ */ r.jsx(
1052
+ $ && x !== $ && /* @__PURE__ */ r.jsx(
1058
1053
  "link",
1059
1054
  {
1060
1055
  id: "body-font",
1061
1056
  rel: "stylesheet",
1062
1057
  type: "text/css",
1063
- href: `https://fonts.googleapis.com/css2?family=${y.replace(
1058
+ href: `https://fonts.googleapis.com/css2?family=${$.replace(
1064
1059
  / /g,
1065
1060
  "+"
1066
1061
  )}:wght@300;400;500;600;700;800;900&display=swap`,
1067
1062
  media: "all"
1068
1063
  }
1069
1064
  ),
1070
- $ && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${$}",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";}` })
1065
+ x && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${x}",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";}` })
1071
1066
  ] }) : null;
1072
- }, Ts = (n) => {
1067
+ }, Fs = () => b(Ft), Rs = (n, s) => {
1068
+ const e = ["xs", "sm", "md", "lg", "xl", "2xl"], t = e.indexOf(s), o = n.split(" ");
1069
+ let a = new Array(e.length).fill(!1);
1070
+ for (const l of o) {
1071
+ let [i, c] = l.split(":");
1072
+ c || (c = i, i = "xs");
1073
+ const u = e.indexOf(i);
1074
+ if (u <= t) {
1075
+ const m = ["block", "flex", "inline", "inline-block", "inline-flex", "grid", "table"].includes(c);
1076
+ for (let d = u; d < e.length; d++)
1077
+ a[d] = m;
1078
+ }
1079
+ }
1080
+ return a[t];
1081
+ }, Hs = (n) => {
1073
1082
  const s = {};
1074
1083
  return Object.keys(n).forEach((e) => {
1075
- se(n[e]) && n[e].startsWith(ge) && (s[e] = n[e].replace(ge, "").split(","));
1084
+ oe(n[e]) && n[e].startsWith(ge) && (s[e] = n[e].replace(ge, "").split(","));
1076
1085
  }), s;
1077
- }, Ls = Ke((n) => {
1078
- const s = n.replace(Ne, "").split(",");
1079
- return ss(s[0], s[1]);
1086
+ }, Ps = Ye((n) => {
1087
+ const s = n.replace(Me, "").split(",");
1088
+ return rs(s[0], s[1]);
1080
1089
  });
1081
- function Fs(n, s) {
1090
+ function Os(n, s) {
1082
1091
  return f(n, `${s}_attrs`, {});
1083
1092
  }
1084
- function Rs(n) {
1085
- const s = {};
1086
- return Object.keys(n).forEach((e) => {
1087
- if (se(n[e]) && n[e].startsWith(Ne)) {
1088
- const t = Ls(n[e]);
1089
- s[e] = {
1090
- className: t,
1091
- "data-style-prop": e,
1093
+ function zs(n, s) {
1094
+ const e = {};
1095
+ return Object.keys(n).forEach((t) => {
1096
+ if (oe(n[t]) && n[t].startsWith(Me)) {
1097
+ const o = Ps(n[t]), a = Os(n, t);
1098
+ e[t] = {
1099
+ className: o,
1100
+ "data-style-prop": t,
1092
1101
  "data-block-parent": n._id,
1093
- "data-style-id": `${e}-${n._id}`,
1094
- ...Fs(n, e)
1102
+ "data-style-id": `${t}-${n._id}`,
1103
+ ...a
1095
1104
  };
1105
+ const l = K(a, "x-show") || K(a, "x-if");
1106
+ l && (e.__isHidden = l && !Rs(o, s));
1096
1107
  }
1097
- }), s;
1108
+ }), e;
1098
1109
  }
1099
- function Hs(n, s) {
1110
+ function Us(n, s) {
1100
1111
  const e = f(n, "_bindings", {});
1101
- return I(e) ? { ...n } : (Ye(e, (t, o) => {
1102
- se(t) && f(s, t, null) && (n[o] = f(s, t, null));
1112
+ return I(e) ? { ...n } : (Xe(e, (t, o) => {
1113
+ oe(t) && f(s, t, null) && (n[o] = f(s, t, null));
1103
1114
  }), n);
1104
1115
  }
1105
- function te({ blocks: n }) {
1106
- const [s] = ne(), [e] = b(ie), [t] = b(Ee), [o] = ns(), c = O((l) => Rs(l), []), [a] = Ft(), [i] = b(F), d = O(
1107
- (l) => l.reduce((h, p) => {
1108
- const u = f(o, p, {});
1109
- return { ...h, ...u };
1116
+ function se({ blocks: n }) {
1117
+ const [s] = ne(), [e] = b(Rt), [t] = b(ie), [o] = b(Ne), [, a] = G(), [l] = Fs(), i = q((d) => zs(d, a), [a]), [c] = qt(), [u] = b(P), m = q(
1118
+ (d) => d.reduce((h, x) => {
1119
+ const $ = f(l, x, {});
1120
+ return { ...h, ...$ };
1110
1121
  }, {}),
1111
- [o, s]
1122
+ [l, s]
1112
1123
  );
1113
- return /* @__PURE__ */ r.jsx(r.Fragment, { children: A.Children.toArray(
1114
- n.map((l, h) => {
1115
- if (i === l._id)
1124
+ return /* @__PURE__ */ r.jsx(r.Fragment, { children: S.Children.toArray(
1125
+ n.map((d, h) => {
1126
+ if (u === d._id)
1116
1127
  return null;
1117
- const p = Ts(l), u = {};
1118
- I(p) || Object.keys(p).forEach((C) => {
1119
- u[C] = A.Children.toArray(
1120
- p[C].map((L) => /* @__PURE__ */ r.jsx(te, { blocks: [Ge(s, { _id: L })] }))
1128
+ const x = Hs(d), $ = {};
1129
+ I(x) || Object.keys(x).forEach((R) => {
1130
+ $[R] = S.Children.toArray(
1131
+ x[R].map((O) => /* @__PURE__ */ r.jsx(se, { blocks: [Ge(s, { _id: O })] }))
1121
1132
  );
1122
1133
  });
1123
- const $ = ke(s, { _parent: l._id });
1124
- u.children = $.length ? /* @__PURE__ */ r.jsx(te, { blocks: $ }) : null;
1125
- const y = os(l._type), g = f(y, "builderComponent", f(y, "component", null));
1126
- if (Xe(g))
1127
- return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${l == null ? void 0 : l._type} not registered -->` });
1128
- const m = be(y, "getBlockStateFrom") ? y == null ? void 0 : y.getBlockStateFrom(l, s) : [], k = d(m);
1129
- return /* @__PURE__ */ r.jsx(J, { children: A.createElement(g, {
1134
+ const g = je(s, { _parent: d._id });
1135
+ $.children = g.length ? /* @__PURE__ */ r.jsx(se, { blocks: g }) : null;
1136
+ const p = is(d._type), k = f(p, "builderComponent", f(p, "component", null));
1137
+ if (Qe(k))
1138
+ return /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${d == null ? void 0 : d._type} not registered -->` });
1139
+ const C = K(p, "getBlockStateFrom") ? p == null ? void 0 : p.getBlockStateFrom(d, s) : [], D = m(C), E = i(d);
1140
+ return f(E, "__isHidden", !1) && !fe(e, d._id) ? null : /* @__PURE__ */ r.jsx(V, { children: S.createElement(k, {
1130
1141
  blockProps: {
1131
- "data-block-id": l._id,
1132
- "data-block-type": l._type,
1133
- ...e ? (
1142
+ ...fe(e, d._id) ? { "force-show": "" } : {},
1143
+ "data-block-id": d._id,
1144
+ "data-block-type": d._type,
1145
+ ...t ? (
1134
1146
  // @ts-ignore
1135
- { "data-dnd": Rt(l._type, e == null ? void 0 : e._type) ? "yes" : "no" }
1147
+ {
1148
+ "data-dnd": Ht(d._type, t == null ? void 0 : t._type) ? "yes" : "no",
1149
+ "data-dnd-dragged": t._id === d._id ? "yes" : "no"
1150
+ }
1136
1151
  ) : {},
1137
- ...t === l._id ? { "data-drop": "yes" } : {}
1152
+ ...o === d._id ? { "data-drop": "yes" } : {}
1138
1153
  },
1139
1154
  index: h,
1140
- ...Hs(l, a),
1141
- ...c(l),
1142
- ...u,
1155
+ ...Us(d, c),
1156
+ ...we(E, ["__isHidden"]),
1157
+ ...$,
1143
1158
  inBuilder: !0,
1144
- blockState: k
1159
+ blockState: D
1145
1160
  }) });
1146
1161
  })
1147
1162
  ) });
1148
1163
  }
1149
- const Ps = () => {
1150
- const [n] = ne(), s = I(n) ? null : /* @__PURE__ */ r.jsx(Ht, { children: /* @__PURE__ */ r.jsx(te, { blocks: ke(n, (e) => I(e._parent)) }) });
1164
+ const Ws = () => {
1165
+ const [n] = ne(), s = I(n) ? null : /* @__PURE__ */ r.jsx(Kt, { children: /* @__PURE__ */ r.jsx(se, { blocks: je(n, (e) => I(e._parent)) }) });
1151
1166
  return /* @__PURE__ */ r.jsx(r.Fragment, { children: s });
1152
- }, zs = (n, s) => n.querySelector(`[data-style-id="${s}"]`), Os = () => {
1153
- const [n] = b(Pt), [s] = Ie(), [e] = oe(), [, t] = D(), o = zt(), [, c] = T(), a = de(null), i = de(null), [d, l] = B({ width: 0, height: 0 }), h = gs(d), [p, u] = B(0), [$, y] = B([]), [, g] = B([]), [, m] = b(Ot), [k, C] = M(), L = P("loading", !1), K = P("htmlDir", "ltr");
1167
+ }, qs = (n, s) => n.querySelector(`[data-style-id="${s}"]`), Ks = () => {
1168
+ const [n] = b(Pt), [s] = Ee(), [e] = G(), [, t] = A(), o = Ot(), [, a] = F(), l = de(null), i = de(null), [c, u] = _({ width: 0, height: 0 }), m = xs(c), [d, h] = _(0), [x, $] = _([]), [, g] = _([]), [, p] = b(zt), [k, C] = L(), D = U("loading", !1), E = U("htmlDir", "ltr");
1154
1169
  j(() => {
1155
- const { clientWidth: x, clientHeight: S } = i.current;
1156
- l({ width: x, height: S }), p === 0 && u(x);
1157
- }, [i, e, p]);
1158
- const Y = (x, S = 0) => {
1159
- const { top: E } = x.getBoundingClientRect();
1160
- return E + S >= 0 && E - S <= window.innerHeight;
1170
+ const { clientWidth: v, clientHeight: T } = i.current;
1171
+ u({ width: v, height: T }), d === 0 && h(v);
1172
+ }, [i, e, d]);
1173
+ const R = (v, T = 0) => {
1174
+ const { top: N } = v.getBoundingClientRect();
1175
+ return N + T >= 0 && N - T <= window.innerHeight;
1161
1176
  };
1162
1177
  j(() => {
1163
- var x, S;
1164
- if (o && o.type !== "Multiple" && a.current) {
1165
- const E = Re(a.current.contentDocument, o._id);
1166
- E && (Y(E) || (S = (x = a.current) == null ? void 0 : x.contentWindow) == null || S.scrollTo({ top: E.offsetTop, behavior: "smooth" }), y([E]));
1178
+ var v, T;
1179
+ if (o && o.type !== "Multiple" && l.current) {
1180
+ const N = Pe(l.current.contentDocument, o._id);
1181
+ N && (R(N) || (T = (v = l.current) == null ? void 0 : v.contentWindow) == null || T.scrollTo({ top: N.offsetTop, behavior: "smooth" }), $([N]));
1167
1182
  }
1168
1183
  }, [o]), j(() => {
1169
- if (!I(k) && a.current) {
1170
- const x = zs(
1171
- a.current.contentDocument,
1172
- U(k).id
1184
+ if (!I(k) && l.current) {
1185
+ const v = qs(
1186
+ l.current.contentDocument,
1187
+ Y(k).id
1173
1188
  );
1174
- g(x ? [x] : [null]);
1189
+ g(v ? [v] : [null]);
1175
1190
  } else
1176
1191
  g([null]);
1177
1192
  }, [k]);
1178
- const G = Oe(() => {
1179
- let x = ms;
1180
- return x = x.replace("__HTML_DIR__", K), n === "offline" && (x = x.replace(
1193
+ const O = We(() => {
1194
+ let v = fs;
1195
+ return v = v.replace("__HTML_DIR__", E), n === "offline" && (v = v.replace(
1181
1196
  "https://old.chaibuilder.com/offline/tailwind.cdn.js",
1182
1197
  "/offline/tailwind.cdn.js"
1183
- ), x = x.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), x = x.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), x;
1198
+ ), v = v.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), v = v.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), v;
1184
1199
  }, [n]);
1185
1200
  return /* @__PURE__ */ r.jsx(
1186
1201
  "div",
@@ -1188,30 +1203,30 @@ const Ps = () => {
1188
1203
  onClick: () => {
1189
1204
  t([]), C([]);
1190
1205
  },
1191
- onMouseLeave: () => setTimeout(() => c(""), 300),
1206
+ onMouseLeave: () => setTimeout(() => a(""), 300),
1192
1207
  className: "relative mx-auto h-full w-full overflow-hidden",
1193
- style: p > 0 && !I(h) ? { width: s ? "100%" : p } : {},
1208
+ style: d > 0 && !I(m) ? { width: s ? "100%" : d } : {},
1194
1209
  ref: i,
1195
1210
  children: /* @__PURE__ */ r.jsxs(
1196
- xs,
1211
+ $s,
1197
1212
  {
1198
- contentDidMount: () => m(a.current),
1199
- ref: a,
1213
+ contentDidMount: () => p(l.current),
1214
+ ref: l,
1200
1215
  id: "canvas-iframe",
1201
- style: { width: `${e}px`, ...h },
1216
+ style: { width: `${e}px`, ...m },
1202
1217
  className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
1203
- initialContent: G,
1218
+ initialContent: O,
1204
1219
  children: [
1205
- /* @__PURE__ */ r.jsx(Is, {}),
1220
+ /* @__PURE__ */ r.jsx(Es, {}),
1206
1221
  /* @__PURE__ */ r.jsx(
1207
- Es,
1222
+ Ns,
1208
1223
  {
1209
1224
  block: o,
1210
- selectedBlockElement: U($)
1225
+ selectedBlockElement: Y(x)
1211
1226
  }
1212
1227
  ),
1213
- /* @__PURE__ */ r.jsx(Ms, { model: "page" }),
1214
- /* @__PURE__ */ r.jsx(rs, { children: /* @__PURE__ */ r.jsx(As, { children: L ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(V, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Ps, {}) }) }),
1228
+ /* @__PURE__ */ r.jsx(Ls, { model: "page" }),
1229
+ /* @__PURE__ */ r.jsx(ls, { children: /* @__PURE__ */ r.jsx(Is, { children: D ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(ee, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Ws, {}) }) }),
1215
1230
  /* @__PURE__ */ r.jsx("br", {}),
1216
1231
  /* @__PURE__ */ r.jsx(
1217
1232
  "div",
@@ -1225,16 +1240,16 @@ const Ps = () => {
1225
1240
  )
1226
1241
  }
1227
1242
  );
1228
- }, Us = A.lazy(() => import("./CodeEditor-kxV5RCpd.js")), Go = () => {
1243
+ }, Ys = S.lazy(() => import("./CodeEditor-zYBqhBv3.js")), Vo = () => {
1229
1244
  const [n] = Ut();
1230
1245
  return /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1231
- /* @__PURE__ */ r.jsx(hs, {}),
1246
+ /* @__PURE__ */ r.jsx(gs, {}),
1232
1247
  /* @__PURE__ */ r.jsxs("div", { className: "relative flex h-full flex-col 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: [
1233
- /* @__PURE__ */ r.jsx(J, { fallback: /* @__PURE__ */ r.jsx(V, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Wt, { children: /* @__PURE__ */ r.jsx(Os, {}) }) }),
1234
- n ? /* @__PURE__ */ r.jsx(J, { fallback: /* @__PURE__ */ r.jsx(V, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(is, { enable: { top: !0, bottom: !1 }, className: "max-h-[400px] min-h-[200px]", children: /* @__PURE__ */ r.jsx(Us, {}) }) }) : null
1248
+ /* @__PURE__ */ r.jsx(V, { fallback: /* @__PURE__ */ r.jsx(ee, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(Yt, { children: /* @__PURE__ */ r.jsx(Ks, {}) }) }),
1249
+ n ? /* @__PURE__ */ r.jsx(V, { fallback: /* @__PURE__ */ r.jsx(ee, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(as, { enable: { top: !0, bottom: !1 }, className: "max-h-[400px] min-h-[200px]", children: /* @__PURE__ */ r.jsx(Ys, {}) }) }) : null
1235
1250
  ] })
1236
1251
  ] });
1237
1252
  };
1238
1253
  export {
1239
- Go as default
1254
+ Vo as default
1240
1255
  };