@chaibuilder/sdk 1.1.18 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/AddBlocks-57-vroWk.cjs +1 -0
  2. package/dist/AddBlocks-QvCc-oag.js +225 -0
  3. package/dist/BrandingOptions-arKT1zCy.cjs +1 -0
  4. package/dist/{BrandingOptions-zFJ28xmJ.js → BrandingOptions-mZXO7thQ.js} +27 -25
  5. package/dist/{CanvasArea-vTV3O27-.js → CanvasArea-59Gm0EZx.js} +581 -598
  6. package/dist/CanvasArea-jRg53jrS.cjs +59 -0
  7. package/dist/CurrentPage-MLObvs0K.cjs +1 -0
  8. package/dist/{CurrentPage-Ay7X9h9y.js → CurrentPage-YPI5QTjk.js} +17 -14
  9. package/dist/Functions-7jnEwJyw.js +15 -0
  10. package/dist/Functions-N3yhPYKY.cjs +1 -0
  11. package/dist/{Layers-CWnzKXMo.js → Layers-no2keK4N.js} +149 -146
  12. package/dist/Layers-x_mWeT_q.cjs +1 -0
  13. package/dist/MODIFIERS-2FeVfZQ9.cjs +1 -0
  14. package/dist/{MODIFIERS-MLfpKQY1.js → MODIFIERS-RiXS5Mn1.js} +7 -13
  15. package/dist/MarkAsGlobalBlock-S2BhHTsK.cjs +1 -0
  16. package/dist/{MarkAsGlobalBlock-uhj0kGZo.js → MarkAsGlobalBlock-SPWd6Flk.js} +9 -7
  17. package/dist/{PagesPanel-ALbBHaO3.js → PagesPanel-Q08uN4X3.js} +12 -9
  18. package/dist/PagesPanel-pOIuFPOA.cjs +1 -0
  19. package/dist/ProjectPanel-4bN_GyNm.cjs +1 -0
  20. package/dist/{ProjectPanel-tIDarI9R.js → ProjectPanel-zzYV9yrV.js} +25 -22
  21. package/dist/{Settings-5uDMY9SU.js → Settings-28A7R61i.js} +334 -331
  22. package/dist/Settings-KlTtgu3w.cjs +1 -0
  23. package/dist/{SidePanels-D6U95ur1.js → SidePanels--ZK6Iqou.js} +80 -77
  24. package/dist/SidePanels-eJBA_cUu.cjs +1 -0
  25. package/dist/{Topbar-_-1HX-EE.js → Topbar-ks1ckGLz.js} +15 -13
  26. package/dist/Topbar-u5XKdWgQ.cjs +1 -0
  27. package/dist/{UnsplashImages-mqK09h8E.js → UnsplashImages-8vJPuqrF.js} +25 -23
  28. package/dist/UnsplashImages-V8oKEHfi.cjs +1 -0
  29. package/dist/{UploadImages-IDkkRuhx.js → UploadImages-6N6UrjLo.js} +26 -24
  30. package/dist/UploadImages-eHYxwWAp.cjs +1 -0
  31. package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
  32. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
  33. package/dist/{add-page-modal-C1UGoRkw.js → add-page-modal-EHIYTW4T.js} +27 -24
  34. package/dist/add-page-modal-OvNXLGf0.cjs +1 -0
  35. package/dist/{confirm-alert-ea5xpncD.js → confirm-alert-biqvaLT-.js} +9 -7
  36. package/dist/confirm-alert-f3DYO5Hj.cjs +1 -0
  37. package/dist/controls-Dy1qa8Dc.cjs +1 -0
  38. package/dist/controls-XPXGHKht.js +182 -0
  39. package/dist/core.cjs +1 -1
  40. package/dist/core.d.ts +10 -1
  41. package/dist/core.js +60 -57
  42. package/dist/delete-page-modal-U4yiuhx0.cjs +1 -0
  43. package/dist/{delete-page-modal-0GxR128b.js → delete-page-modal-qZJCk_JH.js} +15 -12
  44. package/dist/email-blocks.cjs +1 -0
  45. package/dist/email-blocks.d.ts +3 -0
  46. package/dist/email-blocks.js +35 -0
  47. package/dist/{form-irY39wvJ.js → form-Moz_psOw.js} +16 -16
  48. package/dist/form-lJhy9DEC.cjs +1 -0
  49. package/dist/functions-Ox_svtKm.cjs +1 -0
  50. package/dist/functions-xIebp8Aw.js +23 -0
  51. package/dist/html-to-json-dfALTAdG.cjs +1 -0
  52. package/dist/{html-to-json-wmbV9eZP.js → html-to-json-xKBERAI1.js} +47 -46
  53. package/dist/index-IIJ_o44s.cjs +1 -0
  54. package/dist/{index-qEix1meh.js → index-QEchoZ98.js} +8 -8
  55. package/dist/{index-0OqmBgqo.js → index-_OgCuSUz.js} +528 -533
  56. package/dist/{index-npVo1wi3.cjs → index-hMoPNZVn.cjs} +2 -2
  57. package/dist/{jsx-runtime-NV737rRe.js → jsx-runtime-WbnYoNE9.js} +1 -1
  58. package/dist/{jsx-runtime-WUGKV8jN.cjs → jsx-runtime-Z_BpKhVy.cjs} +7 -7
  59. package/dist/lib.cjs +2 -2
  60. package/dist/lib.d.ts +1 -1
  61. package/dist/lib.js +47 -44
  62. package/dist/page-viewer-WhM1FSU0.cjs +1 -0
  63. package/dist/{page-viewer-mgnZt6nO.js → page-viewer-zFLkUu2I.js} +17 -14
  64. package/dist/{project-general-setting-M52W-vUp.js → project-general-setting-MWGOOurD.js} +16 -13
  65. package/dist/project-general-setting-y8daY7V9.cjs +1 -0
  66. package/dist/project-seo-setting-9JGBPzcA.cjs +1 -0
  67. package/dist/{project-seo-setting-EhqUcTKy.js → project-seo-setting-dXclexQW.js} +15 -13
  68. package/dist/render.cjs +1 -1
  69. package/dist/render.d.ts +1 -1
  70. package/dist/render.js +50 -49
  71. package/dist/server.cjs +1 -1
  72. package/dist/server.d.ts +1 -1
  73. package/dist/server.js +11 -11
  74. package/dist/single-page-detail--xPv74bX.cjs +1 -0
  75. package/dist/{single-page-detail-61UDUgWG.js → single-page-detail-C48IPzbd.js} +77 -74
  76. package/dist/studio.cjs +1 -1
  77. package/dist/studio.js +11 -8
  78. package/dist/ui.cjs +1 -1
  79. package/dist/ui.d.ts +3 -3
  80. package/dist/ui.js +144 -142
  81. package/dist/useAddBlockByDrop-_nd8yZBa.cjs +1 -0
  82. package/dist/useAddBlockByDrop-uPXvrg4G.js +20 -0
  83. package/dist/{utils-XsPKXMVo.js → utils-AvyFzbPC.js} +26 -35
  84. package/dist/utils-PTxFk6qT.cjs +1 -0
  85. package/dist/web-blocks.cjs +9 -0
  86. package/dist/web-blocks.d.ts +3 -0
  87. package/dist/web-blocks.js +1033 -0
  88. package/package.json +5 -2
  89. package/dist/AddBlocks-sKF4ti68.js +0 -222
  90. package/dist/AddBlocks-yPovJXtD.cjs +0 -1
  91. package/dist/BrandingOptions-TRVyCvVq.cjs +0 -1
  92. package/dist/CanvasArea-xxqOiENt.cjs +0 -59
  93. package/dist/CurrentPage-ju6otPNk.cjs +0 -1
  94. package/dist/Layers-d9OU0HRE.cjs +0 -1
  95. package/dist/MODIFIERS-WFzDQfiT.cjs +0 -1
  96. package/dist/MarkAsGlobalBlock-CDmEHNx7.cjs +0 -1
  97. package/dist/PagesPanel-F9Cdi4Pf.cjs +0 -1
  98. package/dist/ProjectPanel-T49RUDyt.cjs +0 -1
  99. package/dist/Settings-eZnusNbR.cjs +0 -1
  100. package/dist/SidePanels-BVM5JwGC.cjs +0 -1
  101. package/dist/Topbar-gQxbcPtG.cjs +0 -1
  102. package/dist/UnsplashImages-PNp5fYCc.cjs +0 -1
  103. package/dist/UploadImages-BoSSsLtD.cjs +0 -1
  104. package/dist/add-page-modal-HP1yv9yJ.cjs +0 -1
  105. package/dist/confirm-alert-dHRDZrA1.cjs +0 -1
  106. package/dist/controls-QnyBNkXG.cjs +0 -36
  107. package/dist/controls-kEuiMMDf.js +0 -4600
  108. package/dist/delete-page-modal-yOgfPcHr.cjs +0 -1
  109. package/dist/form-6qGAOYI3.cjs +0 -1
  110. package/dist/functions-86L6n983.js +0 -23
  111. package/dist/functions-Jr7gX_RX.cjs +0 -1
  112. package/dist/html-to-json-AqLy6ye-.cjs +0 -1
  113. package/dist/index-d55M5MRz.cjs +0 -1
  114. package/dist/lodash-2us0VT8I.cjs +0 -36
  115. package/dist/lodash-3gkdNK5u.js +0 -4538
  116. package/dist/page-viewer-G2YIKVSt.cjs +0 -1
  117. package/dist/project-general-setting-sinIiBKe.cjs +0 -1
  118. package/dist/project-seo-setting-N0OnBCvh.cjs +0 -1
  119. package/dist/single-page-detail-oa-yTXhQ.cjs +0 -1
  120. package/dist/useAddBlockByDrop-5QW86HjG.js +0 -20
  121. package/dist/useAddBlockByDrop-Ckzuvu-s.cjs +0 -1
  122. package/dist/utils-37UXq2O5.cjs +0 -1
@@ -1,29 +1,30 @@
1
- var bt = Object.defineProperty;
2
- var wt = (e, t, n) => t in e ? bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var J = (e, t, n) => (wt(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { j as r } from "./jsx-runtime-NV737rRe.js";
5
- import V, { createElement as kt, useCallback as ke, useState as q, useEffect as M, Component as ze, Children as jt, Suspense as Ye, useRef as De, useMemo as Ct, lazy as Tt } from "react";
6
- import { d as ie, c as _e, H as pe, I as It, J as Ke, K as te, a as K, h as ae, o as Et, B as St, g as _, i as je, m as Bt, f as Dt, j as _t, b as Je, A as Ot } from "./lodash-3gkdNK5u.js";
7
- import { ResetIcon as Oe, MobileIcon as Ae, LaptopIcon as At, DesktopIcon as Pt, DotsVerticalIcon as Rt, EraserIcon as Mt, ZoomInIcon as Lt, DragHandleDots2Icon as Nt, ArrowUpIcon as Ft, CopyIcon as $t, TrashIcon as Wt } from "@radix-ui/react-icons";
8
- import { p as Ce, B as le, W as Ve, aI as Ht, aJ as qt, aK as Ut, aL as zt, aM as Yt, R as Te, ai as Kt, aN as Jt, aO as Vt, aP as Zt, aQ as Qt, aR as Xt, aS as Gt, w as en, j as U, aj as Z, D as tn, E as nn, F as rn, G as sn, H as on, I as an, J as ln, K as cn, ap as dn, L as un, U as Ze, aH as oe, aT as pn, _ as X, ab as fn, aU as G, ae as Ie, m as Qe, n as hn, k as gn, o as mn, h as Xe, l as Ge, ag as yn, aV as vn, aW as et, aX as xn, aY as bn, x as wn, a as kn, aZ as jn, a_ as Cn, a6 as Tn, a$ as In, i as En, S as tt, aw as Sn } from "./index-0OqmBgqo.js";
1
+ var wt = Object.defineProperty;
2
+ var jt = (e, t, n) => t in e ? wt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var J = (e, t, n) => (jt(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { j as r } from "./jsx-runtime-WbnYoNE9.js";
5
+ import V, { createElement as _e, useCallback as we, useState as q, useEffect as M, Component as Ye, Children as Tt, Suspense as Ke, useRef as Be, useMemo as Ct } from "react";
6
+ import { map as re, includes as Oe, toUpper as pe, round as It, throttle as Je, noop as te, isEmpty as K, first as ae, omit as Et, pick as St, get as B, isString as je, memoize as Dt, each as _t, find as Bt, filter as Ve, isNull as Ot } from "lodash-es";
7
+ import { ResetIcon as Ae, MobileIcon as Re, LaptopIcon as At, DesktopIcon as Rt, DotsVerticalIcon as Pt, EraserIcon as Mt, ZoomInIcon as Lt, DragHandleDots2Icon as Nt, ArrowUpIcon as Ft, CopyIcon as Wt, TrashIcon as $t } from "@radix-ui/react-icons";
8
+ import { p as Te, B as le, W as Ze, aH as Ht, aI as qt, aJ as Ut, aK as zt, aL as Yt, R as Ce, ai as Kt, i as Ge, aM as Jt, aN as Vt, aO as Zt, aP as Gt, aQ as Qt, aR as Xt, w as en, j as U, aj as Z, D as tn, E as nn, F as rn, G as on, H as sn, I as an, J as ln, K as cn, ap as dn, L as un, U as Qe, aG as ie, aS as pn, _ as Q, ab as fn, aT as X, ae as Ie, m as Xe, n as hn, k as gn, o as mn, h as et, l as tt, ag as yn, aU as vn, aV as nt, aW as xn, aX as bn, x as kn, a as wn, aY as jn, aZ as Tn, a6 as Cn, a_ as In, S as rt } from "./index-_OgCuSUz.js";
9
9
  import { useTranslation as de } from "react-i18next";
10
- import { useAtom as N } from "jotai";
10
+ import { useAtom as F } from "jotai";
11
11
  import Pe from "react-dom";
12
- import { g as Bn, S as Re, a as nt } from "./MODIFIERS-MLfpKQY1.js";
13
- import { r as rt, u as Dn, B as _n, E as On } from "./index-qEix1meh.js";
14
- import { Quill as An } from "react-quill";
15
- import { u as Pn } from "./useAddBlockByDrop-5QW86HjG.js";
12
+ import { g as En } from "./_commonjsHelpers-UyOWmZb0.js";
13
+ import { r as ot, u as Sn, B as Dn, E as _n } from "./index-QEchoZ98.js";
14
+ import { Quill as Bn } from "react-quill";
15
+ import { u as On } from "./useAddBlockByDrop-uPXvrg4G.js";
16
16
  import { useFeature as st } from "flagged";
17
- import { flip as Rn } from "@floating-ui/dom";
18
- import { useFloating as Mn, shift as Ln } from "@floating-ui/react-dom";
19
- import { useResizeObserver as Nn } from "@react-hookz/web";
20
- import { tailwindcssPaletteGenerator as Fn } from "@bobthered/tailwindcss-palette-generator";
21
- import { Provider as $n } from "react-wrap-balancer";
22
- import { twMerge as Wn } from "tailwind-merge";
23
- import { getBlockComponent as Hn } from "@chaibuilder/runtime";
17
+ import { flip as An } from "@floating-ui/dom";
18
+ import { useFloating as Rn, shift as Pn } from "@floating-ui/react-dom";
19
+ import { useResizeObserver as Mn } from "@react-hookz/web";
20
+ import { tailwindcssPaletteGenerator as Ln } from "@bobthered/tailwindcss-palette-generator";
21
+ import { Provider as Nn } from "react-wrap-balancer";
22
+ import { twMerge as Fn } from "tailwind-merge";
23
+ import { S as Me, a as it } from "./MODIFIERS-RiXS5Mn1.js";
24
+ import { getBlockComponent as Wn } from "@chaibuilder/runtime";
24
25
  import "@radix-ui/react-toggle";
25
26
  import "class-variance-authority";
26
- import "./utils-XsPKXMVo.js";
27
+ import "./utils-AvyFzbPC.js";
27
28
  import "clsx";
28
29
  import "@radix-ui/react-switch";
29
30
  import "@radix-ui/react-slot";
@@ -45,6 +46,7 @@ import "cmdk";
45
46
  import "@radix-ui/react-context-menu";
46
47
  import "react-icons-picker";
47
48
  import "flat-to-nested";
49
+ import "./Functions-7jnEwJyw.js";
48
50
  import "redux-undo";
49
51
  import "i18next";
50
52
  import "react-textarea-autosize";
@@ -52,18 +54,19 @@ import "react-dnd";
52
54
  import "@minoru/react-dnd-treeview";
53
55
  import "react-hotkeys-hook";
54
56
  import "sonner";
55
- import "./html-to-json-wmbV9eZP.js";
57
+ import "./html-to-json-xKBERAI1.js";
56
58
  import "himalaya";
59
+ import "lodash";
57
60
  import "lucide-react";
58
- const qn = () => {
59
- const { undoCount: e, redoCount: t, undo: n, redo: o } = Ce();
61
+ const $n = () => {
62
+ const { undoCount: e, redoCount: t, undo: n, redo: s } = Te();
60
63
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
61
- /* @__PURE__ */ r.jsx(le, { disabled: !e, size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Oe, {}) }),
62
- /* @__PURE__ */ r.jsx(le, { disabled: !t, onClick: o, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Oe, { className: "rotate-180 scale-y-[-1] transform" }) })
64
+ /* @__PURE__ */ r.jsx(le, { disabled: !e, size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ae, {}) }),
65
+ /* @__PURE__ */ r.jsx(le, { disabled: !t, onClick: s, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ r.jsx(Ae, { className: "rotate-180 scale-y-[-1] transform" }) })
63
66
  ] });
64
67
  };
65
- function Un() {
66
- const [e, t] = Ve(), { t: n } = de();
68
+ function Hn() {
69
+ const [e, t] = Ze(), { t: n } = de();
67
70
  return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center", children: [
68
71
  /* @__PURE__ */ r.jsx(Ht, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
69
72
  /* @__PURE__ */ r.jsxs(
@@ -91,7 +94,7 @@ function Un() {
91
94
  )
92
95
  ] });
93
96
  }
94
- const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
97
+ const Le = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
95
98
  "svg",
96
99
  {
97
100
  className: e ? "rotate-90" : "",
@@ -114,33 +117,33 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
114
117
  )
115
118
  ]
116
119
  }
117
- ), Le = [
120
+ ), qn = [
118
121
  {
119
122
  title: "mobile_xs_title",
120
123
  content: "mobile_xs_content",
121
124
  breakpoint: "xs",
122
- icon: /* @__PURE__ */ r.jsx(Ae, {}),
125
+ icon: /* @__PURE__ */ r.jsx(Re, {}),
123
126
  width: 400
124
127
  },
125
128
  {
126
129
  title: "mobile_sm_title",
127
130
  content: "mobile_sm_content",
128
131
  breakpoint: "sm",
129
- icon: /* @__PURE__ */ r.jsx(Ae, { className: "rotate-90" }),
132
+ icon: /* @__PURE__ */ r.jsx(Re, { className: "rotate-90" }),
130
133
  width: 640
131
134
  },
132
135
  {
133
136
  title: "tablet_md_title",
134
137
  content: "tablet_md_content",
135
138
  breakpoint: "md",
136
- icon: /* @__PURE__ */ r.jsx(Me, {}),
139
+ icon: /* @__PURE__ */ r.jsx(Le, {}),
137
140
  width: 800
138
141
  },
139
142
  {
140
143
  title: "tablet_lg_title",
141
144
  content: "tablet_lg_content",
142
145
  breakpoint: "lg",
143
- icon: /* @__PURE__ */ r.jsx(Me, { landscape: !0 }),
146
+ icon: /* @__PURE__ */ r.jsx(Le, { landscape: !0 }),
144
147
  width: 1024
145
148
  },
146
149
  {
@@ -154,64 +157,64 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
154
157
  title: "large_desktop_2xl_title",
155
158
  content: "large_desktop_2xl_content",
156
159
  breakpoint: "2xl",
157
- icon: /* @__PURE__ */ r.jsx(Pt, {}),
160
+ icon: /* @__PURE__ */ r.jsx(Rt, {}),
158
161
  width: 1920
159
162
  }
160
- ], zn = ({
163
+ ], Ne = ({
161
164
  title: e,
162
165
  content: t,
163
166
  currentBreakpoint: n,
164
- breakpoint: o,
167
+ breakpoint: s,
165
168
  width: i,
166
- icon: l,
167
- onClick: c
169
+ icon: a,
170
+ onClick: d
168
171
  }) => {
169
- const { t: s } = de();
172
+ const { t: o } = de();
170
173
  return /* @__PURE__ */ r.jsxs(Ut, { children: [
171
174
  /* @__PURE__ */ r.jsx(zt, { asChild: !0, children: /* @__PURE__ */ r.jsx(
172
175
  le,
173
176
  {
174
- onClick: () => c(i),
177
+ onClick: () => d(i),
175
178
  size: "sm",
176
- variant: o === n ? "secondary" : "ghost",
177
- children: l
179
+ variant: s === n ? "secondary" : "ghost",
180
+ children: a
178
181
  }
179
182
  ) }),
180
183
  /* @__PURE__ */ r.jsx(Yt, { 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: [
181
- /* @__PURE__ */ r.jsx("h4", { className: "text-sm font-semibold", children: s(e) }),
182
- /* @__PURE__ */ r.jsx("p", { className: "text-xs", children: s(t) })
184
+ /* @__PURE__ */ r.jsx("h4", { className: "text-sm font-semibold", children: o(e) }),
185
+ /* @__PURE__ */ r.jsx("p", { className: "text-xs", children: o(t) })
183
186
  ] }) }) })
184
187
  ] });
185
- }, Yn = () => {
186
- const [, e, t] = Te(), [n, o] = Kt(), { t: i } = de(), l = (c) => {
187
- n.includes(c) ? n.length > 2 && o(n.filter((s) => s !== c)) : o((s) => [...s, c]);
188
+ }, Un = () => {
189
+ const [, e, t] = Ce(), [n, s] = Kt(), { t: i } = de(), a = Ge("breakpoints", qn), d = (o) => {
190
+ n.includes(o) ? n.length > 2 && s(n.filter((c) => c !== o)) : s((c) => [...c, o]);
188
191
  };
189
- return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
190
- ie(
191
- Le.filter((c) => _e(n, pe(c.breakpoint))),
192
- (c) => /* @__PURE__ */ kt(zn, { ...c, onClick: t, key: c.breakpoint, currentBreakpoint: e })
192
+ return a.length < 4 ? /* @__PURE__ */ r.jsx("div", { className: "flex items-center rounded-md", children: re(a, (o) => /* @__PURE__ */ _e(Ne, { ...o, onClick: t, key: o.breakpoint, currentBreakpoint: e })) }) : /* @__PURE__ */ r.jsxs("div", { className: "flex items-center rounded-md", children: [
193
+ re(
194
+ a.filter((o) => Oe(n, pe(o.breakpoint))),
195
+ (o) => /* @__PURE__ */ _e(Ne, { ...o, onClick: t, key: o.breakpoint, currentBreakpoint: e })
193
196
  ),
194
197
  /* @__PURE__ */ r.jsxs(Jt, { children: [
195
- /* @__PURE__ */ r.jsx(Vt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Rt, { className: "scale-90 transform" }) }) }),
198
+ /* @__PURE__ */ r.jsx(Vt, { asChild: !0, children: /* @__PURE__ */ r.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ r.jsx(Pt, { className: "scale-90 transform" }) }) }),
196
199
  /* @__PURE__ */ r.jsxs(Zt, { className: "w-56 border-border text-xs", children: [
197
- /* @__PURE__ */ r.jsx(Qt, { children: i("Breakpoints") }),
198
- /* @__PURE__ */ r.jsx(Xt, {}),
199
- ie(Le, (c) => /* @__PURE__ */ r.jsx(
200
- Gt,
200
+ /* @__PURE__ */ r.jsx(Gt, { children: i("Breakpoints") }),
201
+ /* @__PURE__ */ r.jsx(Qt, {}),
202
+ re(a, (o) => /* @__PURE__ */ r.jsx(
203
+ Xt,
201
204
  {
202
- disabled: c.breakpoint === "xs",
203
- onCheckedChange: () => l(pe(c.breakpoint)),
204
- checked: _e(n, pe(c.breakpoint)),
205
- children: i(c.title)
205
+ disabled: o.breakpoint === "xs",
206
+ onCheckedChange: () => d(pe(o.breakpoint)),
207
+ checked: Oe(n, pe(o.breakpoint)),
208
+ children: i(o.title)
206
209
  },
207
- c.breakpoint
210
+ o.breakpoint
208
211
  ))
209
212
  ] })
210
213
  ] })
211
214
  ] });
212
- }, Kn = () => {
213
- const { t: e } = de(), [t] = en(), { createSnapshot: n } = Ce(), [, o] = U(), [, i] = Z(), l = ke(() => {
214
- t([]), o([]), i([]), n();
215
+ }, zn = () => {
216
+ const { t: e } = de(), [t] = en(), { createSnapshot: n } = Te(), [, s] = U(), [, i] = Z(), a = we(() => {
217
+ t([]), s([]), i([]), n();
215
218
  }, [t, n]);
216
219
  return /* @__PURE__ */ r.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ r.jsxs(tn, { children: [
217
220
  /* @__PURE__ */ r.jsx(nn, { asChild: !0, children: /* @__PURE__ */ r.jsxs(le, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
@@ -220,26 +223,26 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
220
223
  e("clear")
221
224
  ] }) }),
222
225
  /* @__PURE__ */ r.jsxs(rn, { className: "border-border", children: [
223
- /* @__PURE__ */ r.jsxs(sn, { children: [
224
- /* @__PURE__ */ r.jsx(on, { children: e("clear_canvas_title") }),
226
+ /* @__PURE__ */ r.jsxs(on, { children: [
227
+ /* @__PURE__ */ r.jsx(sn, { children: e("clear_canvas_title") }),
225
228
  /* @__PURE__ */ r.jsx(an, { children: e("clear_canvas_description") })
226
229
  ] }),
227
230
  /* @__PURE__ */ r.jsxs(ln, { children: [
228
231
  /* @__PURE__ */ r.jsx(cn, { children: e("cancel") }),
229
- /* @__PURE__ */ r.jsx(dn, { onClick: l, children: e("yes") })
232
+ /* @__PURE__ */ r.jsx(dn, { onClick: a, children: e("yes") })
230
233
  ] })
231
234
  ] })
232
235
  ] }) });
233
- }, Jn = () => {
234
- const e = un("darkMode", !1), [t] = Ze();
236
+ }, Yn = () => {
237
+ const e = un("darkMode", !1), [t] = Qe();
235
238
  return /* @__PURE__ */ r.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
236
239
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full space-x-2", children: [
237
240
  e ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
238
- /* @__PURE__ */ r.jsx(Un, {}),
239
- /* @__PURE__ */ r.jsx(oe, { orientation: "vertical" })
241
+ /* @__PURE__ */ r.jsx(Hn, {}),
242
+ /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" })
240
243
  ] }) : null,
241
- /* @__PURE__ */ r.jsx(Yn, {}),
242
- /* @__PURE__ */ r.jsx(oe, { orientation: "vertical" }),
244
+ /* @__PURE__ */ r.jsx(Un, {}),
245
+ /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
243
246
  /* @__PURE__ */ r.jsxs("div", { className: "flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium", children: [
244
247
  /* @__PURE__ */ r.jsx(Lt, { className: "h-3.5 w-3.5 flex-shrink-0" }),
245
248
  " ",
@@ -248,15 +251,15 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
248
251
  "%"
249
252
  ] })
250
253
  ] }),
251
- /* @__PURE__ */ r.jsx(oe, { orientation: "vertical" }),
252
- /* @__PURE__ */ r.jsx(qn, {})
254
+ /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
255
+ /* @__PURE__ */ r.jsx($n, {})
253
256
  ] }),
254
257
  /* @__PURE__ */ r.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
255
- /* @__PURE__ */ r.jsx(oe, { orientation: "vertical" }),
256
- /* @__PURE__ */ r.jsx(Kn, {})
258
+ /* @__PURE__ */ r.jsx(ie, { orientation: "vertical" }),
259
+ /* @__PURE__ */ r.jsx(zn, {})
257
260
  ] })
258
261
  ] });
259
- }, Vn = `<!doctype html>
262
+ }, Kn = `<!doctype html>
260
263
  <html class="scroll-smooth h-full overflow-y-auto">
261
264
  <head>
262
265
  <meta charset="UTF-8">
@@ -303,30 +306,30 @@ const Me = ({ landscape: e = !1 }) => /* @__PURE__ */ r.jsxs(
303
306
  <div class="frame-root"></div>
304
307
  <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
305
308
  </body>
306
- </html>`, Zn = (e) => {
307
- const [t] = Te(), [, n] = Ze(), [o, i] = q({}), l = ke(() => {
308
- const { width: c, height: s } = e;
309
- if (c < t) {
310
- const d = parseFloat((c / t).toFixed(2).toString());
309
+ </html>`, Jn = (e) => {
310
+ const [t] = Ce(), [, n] = Qe(), [s, i] = q({}), a = we(() => {
311
+ const { width: d, height: o } = e;
312
+ if (d < t) {
313
+ const c = parseFloat((d / t).toFixed(2).toString());
311
314
  let p = {};
312
- const f = s * d;
313
- s && (p = {
315
+ const f = o * c;
316
+ o && (p = {
314
317
  // Eureka! This is the formula to calculate the height of the scaled element. Thank you ChatGPT 4
315
- height: 100 + (s - f) / f * 100 + "%"
318
+ height: 100 + (o - f) / f * 100 + "%"
316
319
  }), i({
317
320
  position: "relative",
318
321
  top: 0,
319
- transform: `scale(${d})`,
322
+ transform: `scale(${c})`,
320
323
  transformOrigin: "top left",
321
324
  ...p,
322
325
  maxWidth: "none"
323
- }), n(d * 100);
326
+ }), n(c * 100);
324
327
  } else
325
328
  i({}), n(100);
326
329
  }, [t, e, n]);
327
330
  return M(() => {
328
- l();
329
- }, [t, e, n, l]), o;
331
+ a();
332
+ }, [t, e, n, a]), s;
330
333
  };
331
334
  var ce = { exports: {} };
332
335
  /*
@@ -334,30 +337,30 @@ object-assign
334
337
  (c) Sindre Sorhus
335
338
  @license MIT
336
339
  */
337
- var fe, Ne;
338
- function Qn() {
339
- if (Ne)
340
+ var fe, Fe;
341
+ function Vn() {
342
+ if (Fe)
340
343
  return fe;
341
- Ne = 1;
344
+ Fe = 1;
342
345
  var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable;
343
- function o(l) {
344
- if (l == null)
346
+ function s(a) {
347
+ if (a == null)
345
348
  throw new TypeError("Object.assign cannot be called with null or undefined");
346
- return Object(l);
349
+ return Object(a);
347
350
  }
348
351
  function i() {
349
352
  try {
350
353
  if (!Object.assign)
351
354
  return !1;
352
- var l = new String("abc");
353
- if (l[5] = "de", Object.getOwnPropertyNames(l)[0] === "5")
355
+ var a = new String("abc");
356
+ if (a[5] = "de", Object.getOwnPropertyNames(a)[0] === "5")
354
357
  return !1;
355
- for (var c = {}, s = 0; s < 10; s++)
356
- c["_" + String.fromCharCode(s)] = s;
357
- var d = Object.getOwnPropertyNames(c).map(function(f) {
358
- return c[f];
358
+ for (var d = {}, o = 0; o < 10; o++)
359
+ d["_" + String.fromCharCode(o)] = o;
360
+ var c = Object.getOwnPropertyNames(d).map(function(f) {
361
+ return d[f];
359
362
  });
360
- if (d.join("") !== "0123456789")
363
+ if (c.join("") !== "0123456789")
361
364
  return !1;
362
365
  var p = {};
363
366
  return "abcdefghijklmnopqrst".split("").forEach(function(f) {
@@ -367,73 +370,73 @@ function Qn() {
367
370
  return !1;
368
371
  }
369
372
  }
370
- return fe = i() ? Object.assign : function(l, c) {
371
- for (var s, d = o(l), p, f = 1; f < arguments.length; f++) {
372
- s = Object(arguments[f]);
373
- for (var h in s)
374
- t.call(s, h) && (d[h] = s[h]);
373
+ return fe = i() ? Object.assign : function(a, d) {
374
+ for (var o, c = s(a), p, f = 1; f < arguments.length; f++) {
375
+ o = Object(arguments[f]);
376
+ for (var h in o)
377
+ t.call(o, h) && (c[h] = o[h]);
375
378
  if (e) {
376
- p = e(s);
379
+ p = e(o);
377
380
  for (var g = 0; g < p.length; g++)
378
- n.call(s, p[g]) && (d[p[g]] = s[p[g]]);
381
+ n.call(o, p[g]) && (c[p[g]] = o[p[g]]);
379
382
  }
380
383
  }
381
- return d;
384
+ return c;
382
385
  }, fe;
383
386
  }
384
- var he, Fe;
387
+ var he, We;
385
388
  function Ee() {
386
- if (Fe)
389
+ if (We)
387
390
  return he;
388
- Fe = 1;
391
+ We = 1;
389
392
  var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
390
393
  return he = e, he;
391
394
  }
392
395
  var ge, $e;
393
- function ot() {
396
+ function at() {
394
397
  return $e || ($e = 1, ge = Function.call.bind(Object.prototype.hasOwnProperty)), ge;
395
398
  }
396
- var me, We;
397
- function Xn() {
398
- if (We)
399
+ var me, He;
400
+ function Zn() {
401
+ if (He)
399
402
  return me;
400
- We = 1;
403
+ He = 1;
401
404
  var e = function() {
402
405
  };
403
406
  if (process.env.NODE_ENV !== "production") {
404
- var t = Ee(), n = {}, o = ot();
405
- e = function(l) {
406
- var c = "Warning: " + l;
407
- typeof console < "u" && console.error(c);
407
+ var t = Ee(), n = {}, s = at();
408
+ e = function(a) {
409
+ var d = "Warning: " + a;
410
+ typeof console < "u" && console.error(d);
408
411
  try {
409
- throw new Error(c);
412
+ throw new Error(d);
410
413
  } catch {
411
414
  }
412
415
  };
413
416
  }
414
- function i(l, c, s, d, p) {
417
+ function i(a, d, o, c, p) {
415
418
  if (process.env.NODE_ENV !== "production") {
416
- for (var f in l)
417
- if (o(l, f)) {
419
+ for (var f in a)
420
+ if (s(a, f)) {
418
421
  var h;
419
422
  try {
420
- if (typeof l[f] != "function") {
423
+ if (typeof a[f] != "function") {
421
424
  var g = Error(
422
- (d || "React class") + ": " + s + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof l[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
425
+ (c || "React class") + ": " + o + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
423
426
  );
424
427
  throw g.name = "Invariant Violation", g;
425
428
  }
426
- h = l[f](c, f, d, s, null, t);
429
+ h = a[f](d, f, c, o, null, t);
427
430
  } catch (A) {
428
431
  h = A;
429
432
  }
430
433
  if (h && !(h instanceof Error) && e(
431
- (d || "React class") + ": type specification of " + s + " `" + f + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof h + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
434
+ (c || "React class") + ": type specification of " + o + " `" + f + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof h + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
432
435
  ), h instanceof Error && !(h.message in n)) {
433
436
  n[h.message] = !0;
434
437
  var E = p ? p() : "";
435
438
  e(
436
- "Failed " + s + " type: " + h.message + (E ?? "")
439
+ "Failed " + o + " type: " + h.message + (E ?? "")
437
440
  );
438
441
  }
439
442
  }
@@ -443,90 +446,90 @@ function Xn() {
443
446
  process.env.NODE_ENV !== "production" && (n = {});
444
447
  }, me = i, me;
445
448
  }
446
- var ye, He;
449
+ var ye, qe;
447
450
  function Gn() {
448
- if (He)
451
+ if (qe)
449
452
  return ye;
450
- He = 1;
451
- var e = rt, t = Qn(), n = Ee(), o = ot(), i = Xn(), l = function() {
453
+ qe = 1;
454
+ var e = ot, t = Vn(), n = Ee(), s = at(), i = Zn(), a = function() {
452
455
  };
453
- process.env.NODE_ENV !== "production" && (l = function(s) {
454
- var d = "Warning: " + s;
455
- typeof console < "u" && console.error(d);
456
+ process.env.NODE_ENV !== "production" && (a = function(o) {
457
+ var c = "Warning: " + o;
458
+ typeof console < "u" && console.error(c);
456
459
  try {
457
- throw new Error(d);
460
+ throw new Error(c);
458
461
  } catch {
459
462
  }
460
463
  });
461
- function c() {
464
+ function d() {
462
465
  return null;
463
466
  }
464
- return ye = function(s, d) {
467
+ return ye = function(o, c) {
465
468
  var p = typeof Symbol == "function" && Symbol.iterator, f = "@@iterator";
466
- function h(a) {
467
- var u = a && (p && a[p] || a[f]);
469
+ function h(l) {
470
+ var u = l && (p && l[p] || l[f]);
468
471
  if (typeof u == "function")
469
472
  return u;
470
473
  }
471
474
  var g = "<<anonymous>>", E = {
472
- array: B("array"),
473
- bigint: B("bigint"),
474
- bool: B("boolean"),
475
- func: B("function"),
476
- number: B("number"),
477
- object: B("object"),
478
- string: B("string"),
479
- symbol: B("symbol"),
475
+ array: D("array"),
476
+ bigint: D("bigint"),
477
+ bool: D("boolean"),
478
+ func: D("function"),
479
+ number: D("number"),
480
+ object: D("object"),
481
+ string: D("string"),
482
+ symbol: D("symbol"),
480
483
  any: O(),
481
- arrayOf: k,
482
- element: F(),
483
- elementType: $(),
484
- instanceOf: D,
485
- node: ht(),
484
+ arrayOf: w,
485
+ element: N(),
486
+ elementType: W(),
487
+ instanceOf: _,
488
+ node: mt(),
486
489
  objectOf: H,
487
- oneOf: W,
488
- oneOfType: ft,
489
- shape: gt,
490
- exact: mt
490
+ oneOf: $,
491
+ oneOfType: gt,
492
+ shape: yt,
493
+ exact: vt
491
494
  };
492
- function A(a, u) {
493
- return a === u ? a !== 0 || 1 / a === 1 / u : a !== a && u !== u;
495
+ function A(l, u) {
496
+ return l === u ? l !== 0 || 1 / l === 1 / u : l !== l && u !== u;
494
497
  }
495
- function b(a, u) {
496
- this.message = a, this.data = u && typeof u == "object" ? u : {}, this.stack = "";
498
+ function b(l, u) {
499
+ this.message = l, this.data = u && typeof u == "object" ? u : {}, this.stack = "";
497
500
  }
498
501
  b.prototype = Error.prototype;
499
- function S(a) {
502
+ function S(l) {
500
503
  if (process.env.NODE_ENV !== "production")
501
- var u = {}, w = 0;
502
- function v(j, y, x, C, I, T, L) {
503
- if (C = C || g, T = T || x, L !== n) {
504
- if (d) {
505
- var P = new Error(
504
+ var u = {}, k = 0;
505
+ function v(j, y, x, T, I, C, L) {
506
+ if (T = T || g, C = C || x, L !== n) {
507
+ if (c) {
508
+ var R = new Error(
506
509
  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
507
510
  );
508
- throw P.name = "Invariant Violation", P;
511
+ throw R.name = "Invariant Violation", R;
509
512
  } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
510
- var Q = C + ":" + x;
511
- !u[Q] && // Avoid spamming the console because they are often not actionable except for lib authors
512
- w < 3 && (l(
513
- "You are manually calling a React.PropTypes validation function for the `" + T + "` prop on `" + C + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
514
- ), u[Q] = !0, w++);
513
+ var G = T + ":" + x;
514
+ !u[G] && // Avoid spamming the console because they are often not actionable except for lib authors
515
+ k < 3 && (a(
516
+ "You are manually calling a React.PropTypes validation function for the `" + C + "` prop on `" + T + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
517
+ ), u[G] = !0, k++);
515
518
  }
516
519
  }
517
- return y[x] == null ? j ? y[x] === null ? new b("The " + I + " `" + T + "` is marked as required " + ("in `" + C + "`, but its value is `null`.")) : new b("The " + I + " `" + T + "` is marked as required in " + ("`" + C + "`, but its value is `undefined`.")) : null : a(y, x, C, I, T);
520
+ return y[x] == null ? j ? y[x] === null ? new b("The " + I + " `" + C + "` is marked as required " + ("in `" + T + "`, but its value is `null`.")) : new b("The " + I + " `" + C + "` is marked as required in " + ("`" + T + "`, but its value is `undefined`.")) : null : l(y, x, T, I, C);
518
521
  }
519
522
  var m = v.bind(null, !1);
520
523
  return m.isRequired = v.bind(null, !0), m;
521
524
  }
522
- function B(a) {
523
- function u(w, v, m, j, y, x) {
524
- var C = w[v], I = z(C);
525
- if (I !== a) {
526
- var T = ee(C);
525
+ function D(l) {
526
+ function u(k, v, m, j, y, x) {
527
+ var T = k[v], I = z(T);
528
+ if (I !== l) {
529
+ var C = ee(T);
527
530
  return new b(
528
- "Invalid " + j + " `" + y + "` of type " + ("`" + T + "` supplied to `" + m + "`, expected ") + ("`" + a + "`."),
529
- { expectedType: a }
531
+ "Invalid " + j + " `" + y + "` of type " + ("`" + C + "` supplied to `" + m + "`, expected ") + ("`" + l + "`."),
532
+ { expectedType: l }
530
533
  );
531
534
  }
532
535
  return null;
@@ -534,135 +537,135 @@ function Gn() {
534
537
  return S(u);
535
538
  }
536
539
  function O() {
537
- return S(c);
540
+ return S(d);
538
541
  }
539
- function k(a) {
540
- function u(w, v, m, j, y) {
541
- if (typeof a != "function")
542
+ function w(l) {
543
+ function u(k, v, m, j, y) {
544
+ if (typeof l != "function")
542
545
  return new b("Property `" + y + "` of component `" + m + "` has invalid PropType notation inside arrayOf.");
543
- var x = w[v];
546
+ var x = k[v];
544
547
  if (!Array.isArray(x)) {
545
- var C = z(x);
546
- return new b("Invalid " + j + " `" + y + "` of type " + ("`" + C + "` supplied to `" + m + "`, expected an array."));
548
+ var T = z(x);
549
+ return new b("Invalid " + j + " `" + y + "` of type " + ("`" + T + "` supplied to `" + m + "`, expected an array."));
547
550
  }
548
551
  for (var I = 0; I < x.length; I++) {
549
- var T = a(x, I, m, j, y + "[" + I + "]", n);
550
- if (T instanceof Error)
551
- return T;
552
+ var C = l(x, I, m, j, y + "[" + I + "]", n);
553
+ if (C instanceof Error)
554
+ return C;
552
555
  }
553
556
  return null;
554
557
  }
555
558
  return S(u);
556
559
  }
557
- function F() {
558
- function a(u, w, v, m, j) {
559
- var y = u[w];
560
- if (!s(y)) {
560
+ function N() {
561
+ function l(u, k, v, m, j) {
562
+ var y = u[k];
563
+ if (!o(y)) {
561
564
  var x = z(y);
562
565
  return new b("Invalid " + m + " `" + j + "` of type " + ("`" + x + "` supplied to `" + v + "`, expected a single ReactElement."));
563
566
  }
564
567
  return null;
565
568
  }
566
- return S(a);
569
+ return S(l);
567
570
  }
568
- function $() {
569
- function a(u, w, v, m, j) {
570
- var y = u[w];
571
+ function W() {
572
+ function l(u, k, v, m, j) {
573
+ var y = u[k];
571
574
  if (!e.isValidElementType(y)) {
572
575
  var x = z(y);
573
576
  return new b("Invalid " + m + " `" + j + "` of type " + ("`" + x + "` supplied to `" + v + "`, expected a single ReactElement type."));
574
577
  }
575
578
  return null;
576
579
  }
577
- return S(a);
580
+ return S(l);
578
581
  }
579
- function D(a) {
580
- function u(w, v, m, j, y) {
581
- if (!(w[v] instanceof a)) {
582
- var x = a.name || g, C = xt(w[v]);
583
- return new b("Invalid " + j + " `" + y + "` of type " + ("`" + C + "` supplied to `" + m + "`, expected ") + ("instance of `" + x + "`."));
582
+ function _(l) {
583
+ function u(k, v, m, j, y) {
584
+ if (!(k[v] instanceof l)) {
585
+ var x = l.name || g, T = kt(k[v]);
586
+ return new b("Invalid " + j + " `" + y + "` of type " + ("`" + T + "` supplied to `" + m + "`, expected ") + ("instance of `" + x + "`."));
584
587
  }
585
588
  return null;
586
589
  }
587
590
  return S(u);
588
591
  }
589
- function W(a) {
590
- if (!Array.isArray(a))
591
- return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? l(
592
+ function $(l) {
593
+ if (!Array.isArray(l))
594
+ return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? a(
592
595
  "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
593
- ) : l("Invalid argument supplied to oneOf, expected an array.")), c;
594
- function u(w, v, m, j, y) {
595
- for (var x = w[v], C = 0; C < a.length; C++)
596
- if (A(x, a[C]))
596
+ ) : a("Invalid argument supplied to oneOf, expected an array.")), d;
597
+ function u(k, v, m, j, y) {
598
+ for (var x = k[v], T = 0; T < l.length; T++)
599
+ if (A(x, l[T]))
597
600
  return null;
598
- var I = JSON.stringify(a, function(L, P) {
599
- var Q = ee(P);
600
- return Q === "symbol" ? String(P) : P;
601
+ var I = JSON.stringify(l, function(L, R) {
602
+ var G = ee(R);
603
+ return G === "symbol" ? String(R) : R;
601
604
  });
602
605
  return new b("Invalid " + j + " `" + y + "` of value `" + String(x) + "` " + ("supplied to `" + m + "`, expected one of " + I + "."));
603
606
  }
604
607
  return S(u);
605
608
  }
606
- function H(a) {
607
- function u(w, v, m, j, y) {
608
- if (typeof a != "function")
609
+ function H(l) {
610
+ function u(k, v, m, j, y) {
611
+ if (typeof l != "function")
609
612
  return new b("Property `" + y + "` of component `" + m + "` has invalid PropType notation inside objectOf.");
610
- var x = w[v], C = z(x);
611
- if (C !== "object")
612
- return new b("Invalid " + j + " `" + y + "` of type " + ("`" + C + "` supplied to `" + m + "`, expected an object."));
613
+ var x = k[v], T = z(x);
614
+ if (T !== "object")
615
+ return new b("Invalid " + j + " `" + y + "` of type " + ("`" + T + "` supplied to `" + m + "`, expected an object."));
613
616
  for (var I in x)
614
- if (o(x, I)) {
615
- var T = a(x, I, m, j, y + "." + I, n);
616
- if (T instanceof Error)
617
- return T;
617
+ if (s(x, I)) {
618
+ var C = l(x, I, m, j, y + "." + I, n);
619
+ if (C instanceof Error)
620
+ return C;
618
621
  }
619
622
  return null;
620
623
  }
621
624
  return S(u);
622
625
  }
623
- function ft(a) {
624
- if (!Array.isArray(a))
625
- return process.env.NODE_ENV !== "production" && l("Invalid argument supplied to oneOfType, expected an instance of array."), c;
626
- for (var u = 0; u < a.length; u++) {
627
- var w = a[u];
628
- if (typeof w != "function")
629
- return l(
630
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + vt(w) + " at index " + u + "."
631
- ), c;
626
+ function gt(l) {
627
+ if (!Array.isArray(l))
628
+ return process.env.NODE_ENV !== "production" && a("Invalid argument supplied to oneOfType, expected an instance of array."), d;
629
+ for (var u = 0; u < l.length; u++) {
630
+ var k = l[u];
631
+ if (typeof k != "function")
632
+ return a(
633
+ "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + bt(k) + " at index " + u + "."
634
+ ), d;
632
635
  }
633
- function v(m, j, y, x, C) {
634
- for (var I = [], T = 0; T < a.length; T++) {
635
- var L = a[T], P = L(m, j, y, x, C, n);
636
- if (P == null)
636
+ function v(m, j, y, x, T) {
637
+ for (var I = [], C = 0; C < l.length; C++) {
638
+ var L = l[C], R = L(m, j, y, x, T, n);
639
+ if (R == null)
637
640
  return null;
638
- P.data && o(P.data, "expectedType") && I.push(P.data.expectedType);
641
+ R.data && s(R.data, "expectedType") && I.push(R.data.expectedType);
639
642
  }
640
- var Q = I.length > 0 ? ", expected one of type [" + I.join(", ") + "]" : "";
641
- return new b("Invalid " + x + " `" + C + "` supplied to " + ("`" + y + "`" + Q + "."));
643
+ var G = I.length > 0 ? ", expected one of type [" + I.join(", ") + "]" : "";
644
+ return new b("Invalid " + x + " `" + T + "` supplied to " + ("`" + y + "`" + G + "."));
642
645
  }
643
646
  return S(v);
644
647
  }
645
- function ht() {
646
- function a(u, w, v, m, j) {
647
- return se(u[w]) ? null : new b("Invalid " + m + " `" + j + "` supplied to " + ("`" + v + "`, expected a ReactNode."));
648
+ function mt() {
649
+ function l(u, k, v, m, j) {
650
+ return se(u[k]) ? null : new b("Invalid " + m + " `" + j + "` supplied to " + ("`" + v + "`, expected a ReactNode."));
648
651
  }
649
- return S(a);
652
+ return S(l);
650
653
  }
651
- function Be(a, u, w, v, m) {
654
+ function De(l, u, k, v, m) {
652
655
  return new b(
653
- (a || "React class") + ": " + u + " type `" + w + "." + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + m + "`."
656
+ (l || "React class") + ": " + u + " type `" + k + "." + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + m + "`."
654
657
  );
655
658
  }
656
- function gt(a) {
657
- function u(w, v, m, j, y) {
658
- var x = w[v], C = z(x);
659
- if (C !== "object")
660
- return new b("Invalid " + j + " `" + y + "` of type `" + C + "` " + ("supplied to `" + m + "`, expected `object`."));
661
- for (var I in a) {
662
- var T = a[I];
663
- if (typeof T != "function")
664
- return Be(m, j, y, I, ee(T));
665
- var L = T(x, I, m, j, y + "." + I, n);
659
+ function yt(l) {
660
+ function u(k, v, m, j, y) {
661
+ var x = k[v], T = z(x);
662
+ if (T !== "object")
663
+ return new b("Invalid " + j + " `" + y + "` of type `" + T + "` " + ("supplied to `" + m + "`, expected `object`."));
664
+ for (var I in l) {
665
+ var C = l[I];
666
+ if (typeof C != "function")
667
+ return De(m, j, y, I, ee(C));
668
+ var L = C(x, I, m, j, y + "." + I, n);
666
669
  if (L)
667
670
  return L;
668
671
  }
@@ -670,51 +673,51 @@ function Gn() {
670
673
  }
671
674
  return S(u);
672
675
  }
673
- function mt(a) {
674
- function u(w, v, m, j, y) {
675
- var x = w[v], C = z(x);
676
- if (C !== "object")
677
- return new b("Invalid " + j + " `" + y + "` of type `" + C + "` " + ("supplied to `" + m + "`, expected `object`."));
678
- var I = t({}, w[v], a);
679
- for (var T in I) {
680
- var L = a[T];
681
- if (o(a, T) && typeof L != "function")
682
- return Be(m, j, y, T, ee(L));
676
+ function vt(l) {
677
+ function u(k, v, m, j, y) {
678
+ var x = k[v], T = z(x);
679
+ if (T !== "object")
680
+ return new b("Invalid " + j + " `" + y + "` of type `" + T + "` " + ("supplied to `" + m + "`, expected `object`."));
681
+ var I = t({}, k[v], l);
682
+ for (var C in I) {
683
+ var L = l[C];
684
+ if (s(l, C) && typeof L != "function")
685
+ return De(m, j, y, C, ee(L));
683
686
  if (!L)
684
687
  return new b(
685
- "Invalid " + j + " `" + y + "` key `" + T + "` supplied to `" + m + "`.\nBad object: " + JSON.stringify(w[v], null, " ") + `
686
- Valid keys: ` + JSON.stringify(Object.keys(a), null, " ")
688
+ "Invalid " + j + " `" + y + "` key `" + C + "` supplied to `" + m + "`.\nBad object: " + JSON.stringify(k[v], null, " ") + `
689
+ Valid keys: ` + JSON.stringify(Object.keys(l), null, " ")
687
690
  );
688
- var P = L(x, T, m, j, y + "." + T, n);
689
- if (P)
690
- return P;
691
+ var R = L(x, C, m, j, y + "." + C, n);
692
+ if (R)
693
+ return R;
691
694
  }
692
695
  return null;
693
696
  }
694
697
  return S(u);
695
698
  }
696
- function se(a) {
697
- switch (typeof a) {
699
+ function se(l) {
700
+ switch (typeof l) {
698
701
  case "number":
699
702
  case "string":
700
703
  case "undefined":
701
704
  return !0;
702
705
  case "boolean":
703
- return !a;
706
+ return !l;
704
707
  case "object":
705
- if (Array.isArray(a))
706
- return a.every(se);
707
- if (a === null || s(a))
708
+ if (Array.isArray(l))
709
+ return l.every(se);
710
+ if (l === null || o(l))
708
711
  return !0;
709
- var u = h(a);
712
+ var u = h(l);
710
713
  if (u) {
711
- var w = u.call(a), v;
712
- if (u !== a.entries) {
713
- for (; !(v = w.next()).done; )
714
+ var k = u.call(l), v;
715
+ if (u !== l.entries) {
716
+ for (; !(v = k.next()).done; )
714
717
  if (!se(v.value))
715
718
  return !1;
716
719
  } else
717
- for (; !(v = w.next()).done; ) {
720
+ for (; !(v = k.next()).done; ) {
718
721
  var m = v.value;
719
722
  if (m && !se(m[1]))
720
723
  return !1;
@@ -726,27 +729,27 @@ Valid keys: ` + JSON.stringify(Object.keys(a), null, " ")
726
729
  return !1;
727
730
  }
728
731
  }
729
- function yt(a, u) {
730
- return a === "symbol" ? !0 : u ? u["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && u instanceof Symbol : !1;
732
+ function xt(l, u) {
733
+ return l === "symbol" ? !0 : u ? u["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && u instanceof Symbol : !1;
731
734
  }
732
- function z(a) {
733
- var u = typeof a;
734
- return Array.isArray(a) ? "array" : a instanceof RegExp ? "object" : yt(u, a) ? "symbol" : u;
735
+ function z(l) {
736
+ var u = typeof l;
737
+ return Array.isArray(l) ? "array" : l instanceof RegExp ? "object" : xt(u, l) ? "symbol" : u;
735
738
  }
736
- function ee(a) {
737
- if (typeof a > "u" || a === null)
738
- return "" + a;
739
- var u = z(a);
739
+ function ee(l) {
740
+ if (typeof l > "u" || l === null)
741
+ return "" + l;
742
+ var u = z(l);
740
743
  if (u === "object") {
741
- if (a instanceof Date)
744
+ if (l instanceof Date)
742
745
  return "date";
743
- if (a instanceof RegExp)
746
+ if (l instanceof RegExp)
744
747
  return "regexp";
745
748
  }
746
749
  return u;
747
750
  }
748
- function vt(a) {
749
- var u = ee(a);
751
+ function bt(l) {
752
+ var u = ee(l);
750
753
  switch (u) {
751
754
  case "array":
752
755
  case "object":
@@ -759,24 +762,24 @@ Valid keys: ` + JSON.stringify(Object.keys(a), null, " ")
759
762
  return u;
760
763
  }
761
764
  }
762
- function xt(a) {
763
- return !a.constructor || !a.constructor.name ? g : a.constructor.name;
765
+ function kt(l) {
766
+ return !l.constructor || !l.constructor.name ? g : l.constructor.name;
764
767
  }
765
768
  return E.checkPropTypes = i, E.resetWarningCache = i.resetWarningCache, E.PropTypes = E, E;
766
769
  }, ye;
767
770
  }
768
- var ve, qe;
769
- function er() {
770
- if (qe)
771
+ var ve, Ue;
772
+ function Qn() {
773
+ if (Ue)
771
774
  return ve;
772
- qe = 1;
775
+ Ue = 1;
773
776
  var e = Ee();
774
777
  function t() {
775
778
  }
776
779
  function n() {
777
780
  }
778
781
  return n.resetWarningCache = t, ve = function() {
779
- function o(c, s, d, p, f, h) {
782
+ function s(d, o, c, p, f, h) {
780
783
  if (h !== e) {
781
784
  var g = new Error(
782
785
  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
@@ -784,25 +787,25 @@ function er() {
784
787
  throw g.name = "Invariant Violation", g;
785
788
  }
786
789
  }
787
- o.isRequired = o;
790
+ s.isRequired = s;
788
791
  function i() {
789
- return o;
792
+ return s;
790
793
  }
791
- var l = {
792
- array: o,
793
- bigint: o,
794
- bool: o,
795
- func: o,
796
- number: o,
797
- object: o,
798
- string: o,
799
- symbol: o,
800
- any: o,
794
+ var a = {
795
+ array: s,
796
+ bigint: s,
797
+ bool: s,
798
+ func: s,
799
+ number: s,
800
+ object: s,
801
+ string: s,
802
+ symbol: s,
803
+ any: s,
801
804
  arrayOf: i,
802
- element: o,
803
- elementType: o,
805
+ element: s,
806
+ elementType: s,
804
807
  instanceOf: i,
805
- node: o,
808
+ node: s,
806
809
  objectOf: i,
807
810
  oneOf: i,
808
811
  oneOfType: i,
@@ -811,22 +814,22 @@ function er() {
811
814
  checkPropTypes: n,
812
815
  resetWarningCache: t
813
816
  };
814
- return l.PropTypes = l, l;
817
+ return a.PropTypes = a, a;
815
818
  }, ve;
816
819
  }
817
- var _s = ce.exports;
820
+ var Oo = ce.exports;
818
821
  if (process.env.NODE_ENV !== "production") {
819
- var tr = rt, nr = !0;
820
- ce.exports = Gn()(tr.isElement, nr);
822
+ var Xn = ot, er = !0;
823
+ ce.exports = Gn()(Xn.isElement, er);
821
824
  } else
822
- ce.exports = er()();
823
- var rr = ce.exports;
824
- const R = /* @__PURE__ */ Bn(rr);
825
- let it, at;
826
- typeof document < "u" && (it = document);
827
- typeof window < "u" && (at = window);
828
- const lt = V.createContext({ document: it, window: at }), ue = () => V.useContext(lt), { Provider: sr, Consumer: Os } = lt;
829
- class ct extends ze {
825
+ ce.exports = Qn()();
826
+ var tr = ce.exports;
827
+ const P = /* @__PURE__ */ En(tr);
828
+ let lt, ct;
829
+ typeof document < "u" && (lt = document);
830
+ typeof window < "u" && (ct = window);
831
+ const dt = V.createContext({ document: lt, window: ct }), ue = () => V.useContext(dt), { Provider: nr, Consumer: Ao } = dt;
832
+ class ut extends Ye {
830
833
  componentDidMount() {
831
834
  this.props.contentDidMount();
832
835
  }
@@ -834,21 +837,21 @@ class ct extends ze {
834
837
  this.props.contentDidUpdate();
835
838
  }
836
839
  render() {
837
- return jt.only(this.props.children);
840
+ return Tt.only(this.props.children);
838
841
  }
839
842
  }
840
- J(ct, "propTypes", {
841
- children: R.element.isRequired,
842
- contentDidMount: R.func.isRequired,
843
- contentDidUpdate: R.func.isRequired
843
+ J(ut, "propTypes", {
844
+ children: P.element.isRequired,
845
+ contentDidMount: P.func.isRequired,
846
+ contentDidUpdate: P.func.isRequired
844
847
  });
845
- class be extends ze {
846
- constructor(n, o) {
847
- super(n, o);
848
+ class be extends Ye {
849
+ constructor(n, s) {
850
+ super(n, s);
848
851
  J(this, "setRef", (n) => {
849
852
  this.nodeRef.current = n;
850
- const { forwardedRef: o } = this.props;
851
- typeof o == "function" ? o(n) : o && (o.current = n);
853
+ const { forwardedRef: s } = this.props;
854
+ typeof s == "function" ? s(n) : s && (s.current = n);
852
855
  });
853
856
  J(this, "handleLoad", () => {
854
857
  clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
@@ -879,8 +882,8 @@ class be extends ze {
879
882
  const n = this.getDoc();
880
883
  if (!n)
881
884
  return null;
882
- const o = this.props.contentDidMount, i = this.props.contentDidUpdate, l = n.defaultView || n.parentView, c = /* @__PURE__ */ r.jsx(ct, { contentDidMount: o, contentDidUpdate: i, children: /* @__PURE__ */ r.jsx(sr, { value: { document: n, window: l }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), s = this.getMountTarget();
883
- return [Pe.createPortal(this.props.head, this.getDoc().head), Pe.createPortal(c, s)];
885
+ const s = this.props.contentDidMount, i = this.props.contentDidUpdate, a = n.defaultView || n.parentView, d = /* @__PURE__ */ r.jsx(ut, { contentDidMount: s, contentDidUpdate: i, children: /* @__PURE__ */ r.jsx(nr, { value: { document: n, window: a }, children: /* @__PURE__ */ r.jsx("div", { className: "frame-content", children: this.props.children }) }) }), o = this.getMountTarget();
886
+ return [Pe.createPortal(this.props.head, this.getDoc().head), Pe.createPortal(d, o)];
884
887
  }
885
888
  render() {
886
889
  const n = {
@@ -897,14 +900,14 @@ class be extends ze {
897
900
  // initialContent is expected to have a div inside of the body
898
901
  // element that we render react into.
899
902
  J(be, "propTypes", {
900
- style: R.object,
903
+ style: P.object,
901
904
  // eslint-disable-line
902
- head: R.node,
903
- initialContent: R.string,
904
- mountTarget: R.string,
905
- contentDidMount: R.func,
906
- contentDidUpdate: R.func,
907
- children: R.oneOfType([R.element, R.arrayOf(R.element)])
905
+ head: P.node,
906
+ initialContent: P.string,
907
+ mountTarget: P.string,
908
+ contentDidMount: P.func,
909
+ contentDidUpdate: P.func,
910
+ children: P.oneOfType([P.element, P.arrayOf(P.element)])
908
911
  }), J(be, "defaultProps", {
909
912
  style: {},
910
913
  head: null,
@@ -916,83 +919,83 @@ J(be, "propTypes", {
916
919
  },
917
920
  initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
918
921
  });
919
- const or = V.forwardRef((e, t) => /* @__PURE__ */ r.jsx(be, { ...e, forwardedRef: t }));
920
- let Y = null, re = [], ne = null, dt = null;
921
- function ir(e) {
922
- const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), o = parseInt(t.paddingTop, 10), i = parseInt(t.paddingRight, 10), l = parseInt(t.paddingBottom, 10);
923
- return { paddingLeft: n, paddingTop: o, paddingRight: i, paddingBottom: l };
922
+ const rr = V.forwardRef((e, t) => /* @__PURE__ */ r.jsx(be, { ...e, forwardedRef: t }));
923
+ let Y = null, oe = [], ne = null, pt = null;
924
+ function or(e) {
925
+ const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), s = parseInt(t.paddingTop, 10), i = parseInt(t.paddingRight, 10), a = parseInt(t.paddingBottom, 10);
926
+ return { paddingLeft: n, paddingTop: s, paddingRight: i, paddingBottom: a };
924
927
  }
925
- const Ue = (e, t, n) => {
928
+ const ze = (e, t, n) => {
926
929
  if (!Y)
927
930
  return;
928
- const o = e.getBoundingClientRect(), i = Y == null ? void 0 : Y.getElementById("placeholder"), { paddingLeft: l, paddingTop: c, paddingRight: s, paddingBottom: d } = ir(e);
929
- i.style.width = t === "vertical" ? o.width - l - s + "px" : "2px", i.style.height = t === "vertical" ? "2px" : o.height - c - d + "px", i.style.display = "block";
930
- const p = re.reduce(
931
+ const s = e.getBoundingClientRect(), i = Y == null ? void 0 : Y.getElementById("placeholder"), { paddingLeft: a, paddingTop: d, paddingRight: o, paddingBottom: c } = or(e);
932
+ i.style.width = t === "vertical" ? s.width - a - o + "px" : "2px", i.style.height = t === "vertical" ? "2px" : s.height - d - c + "px", i.style.display = "block";
933
+ const p = oe.reduce(
931
934
  (f, h) => Math.abs(h - n) < Math.abs(f - n) ? h : f
932
935
  );
933
- dt = re.indexOf(p), t === "vertical" ? (i.style.top = e.offsetTop + p + "px", i.style.left = e.offsetLeft + l + "px") : (i.style.top = e.offsetTop + c + "px", i.style.left = e.offsetLeft + p + "px");
934
- }, ar = (e) => {
935
- const t = ut(e), n = window.getComputedStyle(e), o = t === "horizontal", i = parseInt(n.paddingLeft), l = parseInt(n.paddingTop);
936
- let c = o ? i : l;
937
- re = [c], Array.from(e.children).forEach((s) => {
938
- const d = window.getComputedStyle(s), p = parseInt(
939
- o ? d.marginLeft + d.marginRight : d.marginTop + d.marginBottom
940
- ), f = o ? s.offsetWidth : s.offsetHeight;
941
- re.push(c + f + p), c += f + p;
936
+ pt = oe.indexOf(p), t === "vertical" ? (i.style.top = e.offsetTop + p + "px", i.style.left = e.offsetLeft + a + "px") : (i.style.top = e.offsetTop + d + "px", i.style.left = e.offsetLeft + p + "px");
937
+ }, sr = (e) => {
938
+ const t = ft(e), n = window.getComputedStyle(e), s = t === "horizontal", i = parseInt(n.paddingLeft), a = parseInt(n.paddingTop);
939
+ let d = s ? i : a;
940
+ oe = [d], Array.from(e.children).forEach((o) => {
941
+ const c = window.getComputedStyle(o), p = parseInt(
942
+ s ? c.marginLeft + c.marginRight : c.marginTop + c.marginBottom
943
+ ), f = s ? o.offsetWidth : o.offsetHeight;
944
+ oe.push(d + f + p), d += f + p;
942
945
  });
943
946
  };
944
- function ut(e) {
947
+ function ft(e) {
945
948
  const t = window.getComputedStyle(e).display, n = window.getComputedStyle(e).flexDirection;
946
949
  if (t === "flex")
947
950
  return n === "column" || n === "column-reverse" ? "vertical" : "horizontal";
948
951
  if (t === "grid") {
949
- const o = window.getComputedStyle(e).gridTemplateRows, i = window.getComputedStyle(e).gridTemplateColumns;
950
- if (o.includes("auto"))
952
+ const s = window.getComputedStyle(e).gridTemplateRows, i = window.getComputedStyle(e).gridTemplateColumns;
953
+ if (s.includes("auto"))
951
954
  return "vertical";
952
955
  if (i.includes("auto"))
953
956
  return "horizontal";
954
957
  }
955
958
  return t === "block" ? "vertical" : "horizontal";
956
959
  }
957
- const lr = Ke((e) => {
958
- const t = e.target, n = ut(t);
960
+ const ir = Je((e) => {
961
+ const t = e.target, n = ft(t);
959
962
  if (n === "vertical") {
960
- const o = e.clientY - t.offsetTop;
961
- Ue(t, n, o);
963
+ const s = e.clientY - t.offsetTop;
964
+ ze(t, n, s);
962
965
  } else {
963
- const o = e.clientX - t.offsetLeft;
964
- Ue(t, n, o);
966
+ const s = e.clientX - t.offsetLeft;
967
+ ze(t, n, s);
965
968
  }
966
- }, 200), cr = (e) => {
967
- e.preventDefault(), e.stopPropagation(), lr(e);
969
+ }, 200), ar = (e) => {
970
+ e.preventDefault(), e.stopPropagation(), ir(e);
968
971
  };
969
972
  function xe() {
970
973
  const e = Y == null ? void 0 : Y.getElementById("placeholder");
971
974
  e.style.display = "none";
972
975
  }
973
- const dr = () => {
974
- const { document: e } = ue(), [t, n] = N(pn), o = Pn(), i = st("dnd"), [, l] = X(), [, c] = U();
976
+ const lr = () => {
977
+ const { document: e } = ue(), [t, n] = F(pn), s = On(), i = st("dnd"), [, a] = Q(), [, d] = U();
975
978
  return Y = e, {
976
979
  isDragging: t,
977
980
  "data-dnd": "branch",
978
- onDragOver: i ? cr : te,
979
- onDrop: i ? (s) => {
981
+ onDragOver: i ? ar : te,
982
+ onDrop: i ? (o) => {
980
983
  ne == null || ne.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
981
- const d = JSON.parse(s.dataTransfer.getData("text/plain"));
982
- let p = s.target.getAttribute("data-block-id");
983
- p === null && (p = s.target.parentElement.getAttribute("data-block-id")), o({ block: d, dropTargetId: p || null, relativeIndex: dt }), n(!1), xe(), setTimeout(() => {
984
+ const c = JSON.parse(o.dataTransfer.getData("text/plain"));
985
+ let p = o.target.getAttribute("data-block-id");
986
+ p === null && (p = o.target.parentElement.getAttribute("data-block-id")), s({ block: c, dropTargetId: p || null, relativeIndex: pt }), n(!1), xe(), setTimeout(() => {
984
987
  xe();
985
988
  }, 300);
986
989
  } : te,
987
- onDragEnter: i ? (s) => {
988
- const d = s;
989
- ne = d.target, d.stopPropagation(), d.preventDefault(), re = [];
990
- const p = d.target;
991
- ar(p), p.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), l(""), c([]);
990
+ onDragEnter: i ? (o) => {
991
+ const c = o;
992
+ ne = c.target, c.stopPropagation(), c.preventDefault(), oe = [];
993
+ const p = c.target;
994
+ sr(p), p.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), a(""), d([]);
992
995
  } : te,
993
- onDragLeave: i ? (s) => {
994
- const d = s;
995
- ne = null, d.stopPropagation(), d.preventDefault(), d.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
996
+ onDragLeave: i ? (o) => {
997
+ const c = o;
998
+ ne = null, c.stopPropagation(), c.preventDefault(), c.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
996
999
  } : te,
997
1000
  onMouseOut: i ? () => {
998
1001
  n(!1), xe();
@@ -1002,59 +1005,59 @@ const dr = () => {
1002
1005
  function Se(e) {
1003
1006
  return e.getAttribute("data-block-id") ? e : e.closest("[data-block-id]");
1004
1007
  }
1005
- function ur(e) {
1008
+ function cr(e) {
1006
1009
  e.container.innerHTML = "", e.container.parentNode.removeChild(e.container);
1007
1010
  var t = document.querySelector(".ql-toolbar");
1008
1011
  t && t.parentNode.removeChild(t), e = null;
1009
1012
  }
1010
- const pr = () => {
1011
- const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = fn(), [, n] = X(), [o, i] = N(G);
1012
- return (l) => {
1013
+ const dr = () => {
1014
+ const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = fn(), [, n] = Q(), [s, i] = F(X);
1015
+ return (a) => {
1013
1016
  var h;
1014
- if (o)
1017
+ if (s)
1015
1018
  return;
1016
- const c = Se(l.target), s = c.getAttribute("data-block-type");
1017
- if (!s || !e.includes(s))
1019
+ const d = Se(a.target), o = d.getAttribute("data-block-type");
1020
+ if (!o || !e.includes(o))
1018
1021
  return;
1019
- const d = c.cloneNode(!0);
1020
- c.style.display = "none", Array.from(d.attributes).forEach((g) => {
1021
- g.name !== "class" && d.removeAttribute(g.name);
1022
- }), s === "Text" && (d.style.display = "inline-block"), c.parentNode.insertBefore(d, c.nextSibling);
1023
- const p = new An(d, { placeholder: "Type here..." });
1022
+ const c = d.cloneNode(!0);
1023
+ d.style.display = "none", Array.from(c.attributes).forEach((g) => {
1024
+ g.name !== "class" && c.removeAttribute(g.name);
1025
+ }), o === "Text" && (c.style.display = "inline-block"), d.parentNode.insertBefore(c, d.nextSibling);
1026
+ const p = new Bn(c, { placeholder: "Type here..." });
1024
1027
  function f() {
1025
1028
  const g = p.getText(0, p.getLength());
1026
- t([c.getAttribute("data-block-id")], { content: g }), c.removeAttribute("style"), d.removeEventListener("blur", f, !0), ur(p), i(""), n("");
1029
+ t([d.getAttribute("data-block-id")], { content: g }), d.removeAttribute("style"), c.removeEventListener("blur", f, !0), cr(p), i(""), n("");
1027
1030
  }
1028
- d.addEventListener("blur", f, !0), p.focus(), (h = d.querySelector(".ql-clipboard")) == null || h.remove(), i(c.getAttribute("data-block-id"));
1031
+ c.addEventListener("blur", f, !0), p.focus(), (h = c.querySelector(".ql-clipboard")) == null || h.remove(), i(d.getAttribute("data-block-id"));
1029
1032
  };
1030
- }, fr = () => {
1031
- const [, e] = Z(), [, t] = U(), [n] = N(G);
1032
- return (o) => {
1033
+ }, ur = () => {
1034
+ const [, e] = Z(), [, t] = U(), [n] = F(X);
1035
+ return (s) => {
1033
1036
  if (n)
1034
1037
  return;
1035
- o.stopPropagation();
1036
- const i = Se(o.target);
1038
+ s.stopPropagation();
1039
+ const i = Se(s.target);
1037
1040
  if (i != null && i.getAttribute("data-block-parent")) {
1038
- const l = i.getAttribute("data-style-prop"), c = i.getAttribute("data-style-id"), s = i.getAttribute("data-block-parent");
1039
- e([{ id: c, prop: l, blockId: s }]), t([s]);
1041
+ const a = i.getAttribute("data-style-prop"), d = i.getAttribute("data-style-id"), o = i.getAttribute("data-block-parent");
1042
+ e([{ id: d, prop: a, blockId: o }]), t([o]);
1040
1043
  } else
1041
1044
  i != null && i.getAttribute("data-block-id") && t([i.getAttribute("data-block-id")]);
1042
1045
  };
1043
- }, hr = Ke((e, t) => {
1046
+ }, pr = Je((e, t) => {
1044
1047
  const n = Se(e.target);
1045
1048
  n != null && n.getAttribute("data-style-id") && t(n.getAttribute("data-style-id"));
1046
- }, 100), gr = () => {
1047
- const [, e] = X(), [t] = N(G);
1049
+ }, 100), fr = () => {
1050
+ const [, e] = Q(), [t] = F(X);
1048
1051
  return (n) => {
1049
- t || hr(n, e);
1052
+ t || pr(n, e);
1050
1053
  };
1051
- }, mr = ({ children: e }) => {
1052
- const { document: t } = ue(), [n] = U(), [o, i] = Z();
1054
+ }, hr = ({ children: e }) => {
1055
+ const { document: t } = ue(), [n] = U(), [s, i] = Z();
1053
1056
  M(() => {
1054
1057
  setTimeout(() => {
1055
- if (!K(o))
1058
+ if (!K(s))
1056
1059
  return;
1057
- const p = pt(t, ae(n));
1060
+ const p = ht(t, ae(n));
1058
1061
  if (p) {
1059
1062
  const f = p.getAttribute("data-style-prop");
1060
1063
  if (f) {
@@ -1063,45 +1066,45 @@ const pr = () => {
1063
1066
  }
1064
1067
  }
1065
1068
  }, 100);
1066
- }, [t, n, i, o]);
1067
- const l = pr(), c = fr(), s = gr(), d = dr();
1069
+ }, [t, n, i, s]);
1070
+ const a = dr(), d = ur(), o = fr(), c = lr();
1068
1071
  return /* @__PURE__ */ r.jsx(
1069
1072
  "div",
1070
1073
  {
1071
1074
  id: "canvas",
1072
- onClick: c,
1073
- onDoubleClick: l,
1074
- onMouseMove: s,
1075
- ...Et(d, "isDragging"),
1076
- className: "relative mb-5 max-w-full " + (d.isDragging ? "dragging" : ""),
1075
+ onClick: d,
1076
+ onDoubleClick: a,
1077
+ onMouseMove: o,
1078
+ ...Et(c, "isDragging"),
1079
+ className: "relative mb-5 max-w-full " + (c.isDragging ? "dragging" : ""),
1077
1080
  children: e
1078
1081
  }
1079
1082
  );
1080
- }, pt = (e, t) => e.querySelector(`[data-block-id="${t}"]`), yr = () => {
1081
- const { window: e } = ue(), [t, n] = U(), o = Ie(), [, i] = Z(), { undo: l, redo: c } = Ce(), s = Qe(), [, d] = hn(), [, p] = gn(), { pasteBlocks: f } = mn(), [, h] = Xe(), g = Ge(), { savePage: E } = yn(), [A] = N(G), [, b] = N(vn), S = (O) => {
1083
+ }, ht = (e, t) => e.querySelector(`[data-block-id="${t}"]`), gr = () => {
1084
+ const { window: e } = ue(), [t, n] = U(), s = Ie(), [, i] = Z(), { undo: a, redo: d } = Te(), o = Xe(), [, c] = hn(), [, p] = gn(), { pasteBlocks: f } = mn(), [, h] = et(), g = tt(), { savePage: E } = yn(), [A] = F(X), [, b] = F(vn), S = (O) => {
1082
1085
  O.key === "Enter" && (O.preventDefault(), t.length === 1 && b(ae(t)));
1083
- }, B = (O) => {
1084
- const k = o.find((F) => F._id === O);
1085
- return k ? k._parent : null;
1086
+ }, D = (O) => {
1087
+ const w = s.find((N) => N._id === O);
1088
+ return w ? w._parent : null;
1086
1089
  };
1087
1090
  return M(() => {
1088
- const O = (k) => {
1089
- if (k.key === "Escape") {
1091
+ const O = (w) => {
1092
+ if (w.key === "Escape") {
1090
1093
  n([]), i([]);
1091
1094
  return;
1092
1095
  }
1093
- if (S(k), !A && (k.key === "Delete" || k.key === "Backspace") && (k.preventDefault(), g(t)), k.ctrlKey || k.metaKey) {
1094
- if (k.key === "ArrowUp") {
1095
- k.preventDefault();
1096
- const F = t.length > 0 ? B(t[0]) : null;
1097
- F && n([F]);
1096
+ if (S(w), !A && (w.key === "Delete" || w.key === "Backspace") && (w.preventDefault(), g(t)), w.ctrlKey || w.metaKey) {
1097
+ if (w.key === "ArrowUp") {
1098
+ w.preventDefault();
1099
+ const N = t.length > 0 ? D(t[0]) : null;
1100
+ N && n([N]);
1098
1101
  }
1099
- if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(k.key)) {
1100
- if (A && ["x", "z", "v"].includes(k.key))
1102
+ if (["z", "y", "d", "x", "c", "p", "s", "v"].includes(w.key)) {
1103
+ if (A && ["x", "z", "v"].includes(w.key))
1101
1104
  return !0;
1102
- k.preventDefault();
1105
+ w.preventDefault();
1103
1106
  }
1104
- k.key === "s" && (k.stopPropagation(), k.preventDefault(), E()), k.key === "z" && l(), k.key === "y" && c(), k.key === "d" && s(t), k.key === "x" && d(t), k.key === "c" && p(t), k.key === "v" && t.length > 0 && f(t[0]);
1107
+ w.key === "s" && (w.stopPropagation(), w.preventDefault(), E()), w.key === "z" && a(), w.key === "y" && d(), w.key === "d" && o(t), w.key === "x" && c(t), w.key === "c" && p(t), w.key === "v" && t.length > 0 && f(t[0]);
1105
1108
  }
1106
1109
  };
1107
1110
  return e.removeEventListener("keydown", O), e.addEventListener("keydown", O), () => {
@@ -1110,28 +1113,28 @@ const pr = () => {
1110
1113
  }, [
1111
1114
  t,
1112
1115
  n,
1113
- l,
1116
+ a,
1114
1117
  g,
1115
1118
  h,
1116
- c,
1117
- s,
1118
1119
  d,
1120
+ o,
1121
+ c,
1119
1122
  p,
1120
1123
  f,
1121
1124
  A,
1122
1125
  E,
1123
1126
  e
1124
1127
  ]), null;
1125
- }, vr = ({ block: e, label: t }) => {
1126
- const [, n] = U(), [, o] = X(), [, i] = N(et), l = st("dnd");
1128
+ }, mr = ({ block: e, label: t }) => {
1129
+ const [, n] = U(), [, s] = Q(), [, i] = F(nt), a = st("dnd");
1127
1130
  return /* @__PURE__ */ r.jsxs(
1128
1131
  "div",
1129
1132
  {
1130
1133
  className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
1131
- draggable: l ? "true" : "false",
1132
- onDragStart: (c) => {
1133
- c.dataTransfer.setData("text/plain", JSON.stringify(St(e, ["_id", "_type"]))), i(e._id), setTimeout(() => {
1134
- n([]), o(null);
1134
+ draggable: a ? "true" : "false",
1135
+ onDragStart: (d) => {
1136
+ d.dataTransfer.setData("text/plain", JSON.stringify(St(e, ["_id", "_type"]))), i(e._id), setTimeout(() => {
1137
+ n([]), s(null);
1135
1138
  }, 200);
1136
1139
  },
1137
1140
  children: [
@@ -1140,64 +1143,64 @@ const pr = () => {
1140
1143
  ]
1141
1144
  }
1142
1145
  );
1143
- }, xr = ({ selectedBlockElement: e, block: t }) => {
1144
- const n = Ge(), o = Qe(), [, i] = U(), [, l] = Z(), [c] = N(G), { floatingStyles: s, refs: d, update: p } = Mn({
1146
+ }, yr = ({ selectedBlockElement: e, block: t }) => {
1147
+ const n = tt(), s = Xe(), [, i] = U(), [, a] = Z(), [d] = F(X), { floatingStyles: o, refs: c, update: p } = Rn({
1145
1148
  placement: "top-start",
1146
- middleware: [Ln(), Rn()],
1149
+ middleware: [Pn(), An()],
1147
1150
  elements: {
1148
1151
  reference: e
1149
1152
  }
1150
1153
  });
1151
- Nn(e, () => p(), e !== null);
1152
- const f = _(t, "_parent", null), h = K(_(t, "_name", "")) ? _(t, "_type", "") : _(t, "_name", "");
1153
- return !e || !t || c ? null : /* @__PURE__ */ r.jsxs(
1154
+ Mn(e, () => p(), e !== null);
1155
+ const f = B(t, "_parent", null), h = K(B(t, "_name", "")) ? B(t, "_type", "") : B(t, "_name", "");
1156
+ return !e || !t || d ? null : /* @__PURE__ */ r.jsxs(
1154
1157
  "div",
1155
1158
  {
1156
1159
  role: "button",
1157
1160
  tabIndex: 0,
1158
- ref: d.setFloating,
1159
- style: s,
1161
+ ref: c.setFloating,
1162
+ style: o,
1160
1163
  onClick: (g) => {
1161
1164
  g.stopPropagation(), g.preventDefault();
1162
1165
  },
1163
1166
  onKeyDown: (g) => g.stopPropagation(),
1164
1167
  className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
1165
1168
  children: [
1166
- /* @__PURE__ */ r.jsx(vr, { label: h, block: t }),
1169
+ /* @__PURE__ */ r.jsx(mr, { label: h, block: t }),
1167
1170
  /* @__PURE__ */ r.jsxs("div", { className: "flex gap-2 px-1 ", children: [
1168
1171
  f && /* @__PURE__ */ r.jsx(
1169
1172
  Ft,
1170
1173
  {
1171
1174
  className: "hover:scale-105 ",
1172
1175
  onClick: () => {
1173
- l([]), i([f]);
1176
+ a([]), i([f]);
1174
1177
  }
1175
1178
  }
1176
1179
  ),
1177
- xn(_(t, "_type", "")) ? /* @__PURE__ */ r.jsx($t, { className: "hover:scale-105 ", onClick: () => o([t == null ? void 0 : t._id]) }) : null,
1178
- bn(_(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Wt, { className: "hover:scale-105 ", onClick: () => n([t == null ? void 0 : t._id]) }) : null
1180
+ xn(B(t, "_type", "")) ? /* @__PURE__ */ r.jsx(Wt, { className: "hover:scale-105 ", onClick: () => s([t == null ? void 0 : t._id]) }) : null,
1181
+ bn(B(t, "_type", "")) ? /* @__PURE__ */ r.jsx($t, { className: "hover:scale-105 ", onClick: () => n([t == null ? void 0 : t._id]) }) : null
1179
1182
  ] })
1180
1183
  ]
1181
1184
  }
1182
1185
  );
1183
- }, br = ({ model: e }) => {
1184
- const [t] = wn(), [n] = U(), [o] = Ve(), [i] = X(), [l] = Z(), [c] = N(et), { document: s, window: d } = ue(), [p] = q(s == null ? void 0 : s.getElementById("highlighted-block")), [f] = q(
1185
- s == null ? void 0 : s.getElementById("selected-block")
1186
+ }, vr = ({ model: e }) => {
1187
+ const [t] = kn(), [n] = U(), [s] = Ze(), [i] = Q(), [a] = Z(), [d] = F(nt), { document: o, window: c } = ue(), [p] = q(o == null ? void 0 : o.getElementById("highlighted-block")), [f] = q(
1188
+ o == null ? void 0 : o.getElementById("selected-block")
1186
1189
  ), [h] = q(
1187
- s == null ? void 0 : s.getElementById("selected-styling-block")
1188
- ), [g] = q(s == null ? void 0 : s.getElementById("dragged-block"));
1190
+ o == null ? void 0 : o.getElementById("selected-styling-block")
1191
+ ), [g] = q(o == null ? void 0 : o.getElementById("dragged-block"));
1189
1192
  M(() => {
1190
- o ? s == null || s.documentElement.classList.add("dark") : s == null || s.documentElement.classList.remove("dark");
1191
- }, [o, s]);
1192
- const E = _(t, "headingFont", "DM Sans"), A = _(t, "bodyFont", "DM Sans");
1193
+ s ? o == null || o.documentElement.classList.add("dark") : o == null || o.documentElement.classList.remove("dark");
1194
+ }, [s, o]);
1195
+ const E = B(t, "headingFont", "DM Sans"), A = B(t, "bodyFont", "DM Sans");
1193
1196
  return M(() => {
1194
- const b = _(t, "primaryColor", "#000"), S = _(t, "secondaryColor", "#FFF"), B = Fn({
1197
+ const b = B(t, "primaryColor", "#000"), S = B(t, "secondaryColor", "#FFF"), D = Ln({
1195
1198
  colors: [b, S],
1196
1199
  names: ["primary", "secondary"]
1197
1200
  });
1198
- B.primary.DEFAULT = b, B.secondary.DEFAULT = S;
1199
- const O = _(t, "roundedCorners", "0");
1200
- !d || !d.tailwind || (d.tailwind.config = {
1201
+ D.primary.DEFAULT = b, D.secondary.DEFAULT = S;
1202
+ const O = B(t, "roundedCorners", "0");
1203
+ !c || !c.tailwind || (c.tailwind.config = {
1201
1204
  darkMode: "class",
1202
1205
  theme: {
1203
1206
  fontFamily: {
@@ -1208,43 +1211,43 @@ const pr = () => {
1208
1211
  borderRadius: {
1209
1212
  global: `${O || "0"}px`
1210
1213
  },
1211
- colors: B
1214
+ colors: D
1212
1215
  }
1213
1216
  },
1214
1217
  plugins: [
1215
1218
  // @ts-ignore
1216
- d.tailwind.plugin.withOptions(({ prefix: k = "ui" } = {}) => ({ addVariant: F }) => {
1217
- for (const $ of ["open", "checked", "selected", "active", "disabled"])
1218
- F(`${k}-${$}`, [
1219
- `&[data-headlessui-state~="${$}"]`,
1220
- `:where([data-headlessui-state~="${$}"]) &`
1221
- ]), F(`${k}-not-${$}`, [
1222
- `&[data-headlessui-state]:not([data-headlessui-state~="${$}"])`,
1223
- `:where([data-headlessui-state]:not([data-headlessui-state~="${$}"])) &:not([data-headlessui-state])`
1219
+ c.tailwind.plugin.withOptions(({ prefix: w = "ui" } = {}) => ({ addVariant: N }) => {
1220
+ for (const W of ["open", "checked", "selected", "active", "disabled"])
1221
+ N(`${w}-${W}`, [
1222
+ `&[data-headlessui-state~="${W}"]`,
1223
+ `:where([data-headlessui-state~="${W}"]) &`
1224
+ ]), N(`${w}-not-${W}`, [
1225
+ `&[data-headlessui-state]:not([data-headlessui-state~="${W}"])`,
1226
+ `:where([data-headlessui-state]:not([data-headlessui-state~="${W}"])) &:not([data-headlessui-state])`
1224
1227
  ]);
1225
1228
  })
1226
1229
  ]
1227
1230
  });
1228
- }, [t, d, E, A]), M(() => {
1229
- f && (f.textContent = `${ie(n, (b) => `[data-block-id="${b}"]`).join(",")}{
1231
+ }, [t, c, E, A]), M(() => {
1232
+ f && (f.textContent = `${re(n, (b) => `[data-block-id="${b}"]`).join(",")}{
1230
1233
  outline: 1px solid ${n.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
1231
1234
  }`);
1232
1235
  }, [n, f]), M(() => {
1233
- if (!c) {
1236
+ if (!d) {
1234
1237
  g.textContent = "";
1235
1238
  return;
1236
1239
  }
1237
- g.textContent = `[data-block-id="${c}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
1238
- }, [c]), M(() => {
1240
+ g.textContent = `[data-block-id="${d}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
1241
+ }, [d]), M(() => {
1239
1242
  p && (p.textContent = i ? `[data-style-id="${i}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
1240
1243
  }, [i, n, p]), M(() => {
1241
- h && (h.textContent = `${ie(l, ({ id: b }) => `[data-style-id="${b}"]`).join(",")}{
1244
+ h && (h.textContent = `${re(a, ({ id: b }) => `[data-style-id="${b}"]`).join(",")}{
1242
1245
  outline: 1px solid #42a1fc !important; outline-offset: -1px;
1243
1246
  }`);
1244
- }, [l, h]), M(() => {
1245
- const b = _(t, "bodyTextLightColor", "#64748b"), S = _(t, "bodyTextDarkColor", "#94a3b8"), B = _(t, "bodyBgLightColor", "#FFFFFF"), O = _(t, "bodyBgDarkColor", "#0f172a");
1246
- s.body.className = `font-body antialiased text-[${b}] bg-[${B}] dark:text-[${S}] dark:bg-[${O}]`;
1247
- }, [t, s, e]), e === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1247
+ }, [a, h]), M(() => {
1248
+ const b = B(t, "bodyTextLightColor", "#64748b"), S = B(t, "bodyTextDarkColor", "#94a3b8"), D = B(t, "bodyBgLightColor", "#FFFFFF"), O = B(t, "bodyBgDarkColor", "#0f172a");
1249
+ o.body.className = `font-body antialiased text-[${b}] bg-[${D}] dark:text-[${S}] dark:bg-[${O}]`;
1250
+ }, [t, o, e]), e === "page" ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
1248
1251
  E && /* @__PURE__ */ r.jsx(
1249
1252
  "link",
1250
1253
  {
@@ -1273,135 +1276,135 @@ const pr = () => {
1273
1276
  ),
1274
1277
  E && /* @__PURE__ */ r.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${E}",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";}` })
1275
1278
  ] }) : null;
1276
- }, wr = (e) => {
1279
+ }, xr = (e) => {
1277
1280
  const t = {};
1278
1281
  return Object.keys(e).forEach((n) => {
1279
- je(e[n]) && e[n].startsWith(Re) && (t[n] = e[n].replace(Re, "").split(","));
1282
+ je(e[n]) && e[n].startsWith(Me) && (t[n] = e[n].replace(Me, "").split(","));
1280
1283
  }), t;
1281
- }, kr = Bt((e) => {
1282
- const t = e.replace(nt, "").split(",");
1283
- return Wn(t[0], t[1]);
1284
+ }, br = Dt((e) => {
1285
+ const t = e.replace(it, "").split(",");
1286
+ return Fn(t[0], t[1]);
1284
1287
  });
1285
- function jr(e, t) {
1286
- return _(e, `${t}_attrs`, {});
1288
+ function kr(e, t) {
1289
+ return B(e, `${t}_attrs`, {});
1287
1290
  }
1288
- function Cr(e) {
1291
+ function wr(e) {
1289
1292
  const t = {};
1290
1293
  return Object.keys(e).forEach((n) => {
1291
- if (je(e[n]) && e[n].startsWith(nt)) {
1292
- const o = kr(e[n]);
1294
+ if (je(e[n]) && e[n].startsWith(it)) {
1295
+ const s = br(e[n]);
1293
1296
  t[n] = {
1294
- className: o,
1297
+ className: s,
1295
1298
  "data-style-prop": n,
1296
1299
  "data-block-parent": e._id,
1297
1300
  "data-style-id": `${n}-${e._id}`,
1298
- ...jr(e, n)
1301
+ ...kr(e, n)
1299
1302
  };
1300
1303
  }
1301
1304
  }), t;
1302
1305
  }
1303
- function Tr(e, t) {
1304
- const n = _(e, "_bindings", {});
1305
- return K(n) ? { ...e } : (Dt(n, (o, i) => {
1306
- je(o) && _(t, o, null) && (e[i] = _(t, o, null));
1306
+ function jr(e, t) {
1307
+ const n = B(e, "_bindings", {});
1308
+ return K(n) ? { ...e } : (_t(n, (s, i) => {
1309
+ je(s) && B(t, s, null) && (e[i] = B(t, s, null));
1307
1310
  }), e);
1308
1311
  }
1309
- function we({ blocks: e }) {
1310
- const t = Ie(), n = ke((l) => Cr(l), []), [o] = Dn(), [i] = kn(G);
1312
+ function ke({ blocks: e }) {
1313
+ const t = Ie(), n = we((a) => wr(a), []), [s] = Sn(), [i] = wn(X);
1311
1314
  return /* @__PURE__ */ r.jsx(r.Fragment, { children: V.Children.toArray(
1312
- e.map((l, c) => {
1313
- if (i === l._id)
1315
+ e.map((a, d) => {
1316
+ if (i === a._id)
1314
1317
  return null;
1315
- const s = wr(l), d = {};
1316
- K(s) || Object.keys(s).forEach((g) => {
1317
- d[g] = V.Children.toArray(
1318
- s[g].map((E) => /* @__PURE__ */ r.jsx(we, { blocks: [_t(t, { _id: E })] }))
1318
+ const o = xr(a), c = {};
1319
+ K(o) || Object.keys(o).forEach((g) => {
1320
+ c[g] = V.Children.toArray(
1321
+ o[g].map((E) => /* @__PURE__ */ r.jsx(ke, { blocks: [Bt(t, { _id: E })] }))
1319
1322
  );
1320
1323
  });
1321
- const p = Je(t, { _parent: l._id });
1322
- d.children = p.length ? /* @__PURE__ */ r.jsx(we, { blocks: p }) : null;
1323
- const f = Hn(l._type), h = _(f, "component", null);
1324
- return Ot(h) ? /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${l == null ? void 0 : l._type} not registered -->` }) : /* @__PURE__ */ r.jsx(Ye, { children: V.createElement(h, {
1324
+ const p = Ve(t, { _parent: a._id });
1325
+ c.children = p.length ? /* @__PURE__ */ r.jsx(ke, { blocks: p }) : null;
1326
+ const f = Wn(a._type), h = B(f, "component", null);
1327
+ return Ot(h) ? /* @__PURE__ */ r.jsx("noscript", { children: `<!-- ${a == null ? void 0 : a._type} not registered -->` }) : /* @__PURE__ */ r.jsx(Ke, { children: V.createElement(h, {
1325
1328
  blockProps: {
1326
- "data-block-id": l._id,
1327
- "data-block-type": l._type,
1328
- "data-dnd": jn(l._type) ? "branch" : "leaf"
1329
+ "data-block-id": a._id,
1330
+ "data-block-type": a._type,
1331
+ "data-dnd": jn(a._type) ? "branch" : "leaf"
1329
1332
  },
1330
1333
  inBuilder: !0,
1331
- index: c,
1332
- ...Tr(l, o),
1333
- ...n(l),
1334
- ...d
1334
+ index: d,
1335
+ ...jr(a, s),
1336
+ ...n(a),
1337
+ ...c
1335
1338
  }) });
1336
1339
  })
1337
1340
  ) });
1338
1341
  }
1339
- const Ir = () => {
1342
+ const Tr = () => {
1340
1343
  const e = Ie();
1341
- return /* @__PURE__ */ r.jsx($n, { children: K(e) ? null : /* @__PURE__ */ r.jsx(_n, { children: /* @__PURE__ */ r.jsx(we, { blocks: Je(e, (t) => K(t._parent)) }) }) });
1342
- }, Er = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Sr = () => {
1343
- const [e] = N(Cn), [t] = Xe(), [n] = Te(), [, o] = U(), i = Tn(), [, l] = X(), c = De(null), s = De(null), [d, p] = q({ width: 0, height: 0 }), f = Zn(d), [h, g] = q(0), [E, A] = q([]), [, b] = q([]), [, S] = N(In), [B, O] = Z(), k = En("loadingCanvas", !1);
1344
+ return /* @__PURE__ */ r.jsx(Nn, { children: K(e) ? null : /* @__PURE__ */ r.jsx(Dn, { children: /* @__PURE__ */ r.jsx(ke, { blocks: Ve(e, (t) => K(t._parent)) }) }) });
1345
+ }, Cr = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Ir = () => {
1346
+ const [e] = F(Tn), [t] = et(), [n] = Ce(), [, s] = U(), i = Cn(), [, a] = Q(), d = Be(null), o = Be(null), [c, p] = q({ width: 0, height: 0 }), f = Jn(c), [h, g] = q(0), [E, A] = q([]), [, b] = q([]), [, S] = F(In), [D, O] = Z(), w = Ge("loadingCanvas", !1);
1344
1347
  M(() => {
1345
- const { clientWidth: D, clientHeight: W } = s.current;
1346
- p({ width: D, height: W }), h === 0 && g(D);
1347
- }, [s, n, h]);
1348
- const F = (D, W = 0) => {
1349
- const { top: H } = D.getBoundingClientRect();
1350
- return H + W >= 0 && H - W <= window.innerHeight;
1348
+ const { clientWidth: _, clientHeight: $ } = o.current;
1349
+ p({ width: _, height: $ }), h === 0 && g(_);
1350
+ }, [o, n, h]);
1351
+ const N = (_, $ = 0) => {
1352
+ const { top: H } = _.getBoundingClientRect();
1353
+ return H + $ >= 0 && H - $ <= window.innerHeight;
1351
1354
  };
1352
1355
  M(() => {
1353
- var D, W;
1354
- if (i && i.type !== "Multiple" && c.current) {
1355
- const H = pt(c.current.contentDocument, i._id);
1356
- H && (F(H) || (W = (D = c.current) == null ? void 0 : D.contentWindow) == null || W.scrollTo({ top: H.offsetTop, behavior: "smooth" }), A([H]));
1356
+ var _, $;
1357
+ if (i && i.type !== "Multiple" && d.current) {
1358
+ const H = ht(d.current.contentDocument, i._id);
1359
+ H && (N(H) || ($ = (_ = d.current) == null ? void 0 : _.contentWindow) == null || $.scrollTo({ top: H.offsetTop, behavior: "smooth" }), A([H]));
1357
1360
  }
1358
1361
  }, [i]), M(() => {
1359
- if (!K(B) && c.current) {
1360
- const D = Er(
1361
- c.current.contentDocument,
1362
- ae(B).id
1362
+ if (!K(D) && d.current) {
1363
+ const _ = Cr(
1364
+ d.current.contentDocument,
1365
+ ae(D).id
1363
1366
  );
1364
- b(D ? [D] : [null]);
1367
+ b(_ ? [_] : [null]);
1365
1368
  } else
1366
1369
  b([null]);
1367
- }, [B]);
1368
- const $ = Ct(() => {
1369
- let D = Vn;
1370
- return e === "offline" && (D = D.replace(
1370
+ }, [D]);
1371
+ const W = Ct(() => {
1372
+ let _ = Kn;
1373
+ return e === "offline" && (_ = _.replace(
1371
1374
  "https://old.chaibuilder.com/offline/tailwind.cdn.js",
1372
1375
  "/offline/tailwind.cdn.js"
1373
- ), D = D.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), D = D.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), D;
1376
+ ), _ = _.replace("https://unpkg.com/aos@next/dist/aos.css", "/offline/aos.css"), _ = _.replace("https://unpkg.com/aos@next/dist/aos.js", "/offline/aos.js")), _;
1374
1377
  }, [e]);
1375
1378
  return /* @__PURE__ */ r.jsx(
1376
1379
  "div",
1377
1380
  {
1378
1381
  onClick: () => {
1379
- o([]), O([]);
1382
+ s([]), O([]);
1380
1383
  },
1381
- onMouseLeave: () => setTimeout(() => l(""), 300),
1384
+ onMouseLeave: () => setTimeout(() => a(""), 300),
1382
1385
  className: "relative mx-auto overflow-hidden h-full w-full",
1383
1386
  style: h > 0 && !K(f) ? { width: t ? "100%" : h } : {},
1384
- ref: s,
1387
+ ref: o,
1385
1388
  children: /* @__PURE__ */ r.jsxs(
1386
- or,
1389
+ rr,
1387
1390
  {
1388
- contentDidMount: () => S(c.current),
1389
- ref: c,
1391
+ contentDidMount: () => S(d.current),
1392
+ ref: d,
1390
1393
  id: "canvas-iframe",
1391
1394
  style: { width: `${n}px`, ...f },
1392
1395
  className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
1393
- initialContent: $,
1396
+ initialContent: W,
1394
1397
  children: [
1395
- /* @__PURE__ */ r.jsx(yr, {}),
1398
+ /* @__PURE__ */ r.jsx(gr, {}),
1396
1399
  /* @__PURE__ */ r.jsx(
1397
- xr,
1400
+ yr,
1398
1401
  {
1399
1402
  block: i,
1400
1403
  selectedBlockElement: ae(E)
1401
1404
  }
1402
1405
  ),
1403
- /* @__PURE__ */ r.jsx(br, { model: "page" }),
1404
- /* @__PURE__ */ r.jsx(mr, { children: k ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(tt, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Ir, {}) }),
1406
+ /* @__PURE__ */ r.jsx(vr, { model: "page" }),
1407
+ /* @__PURE__ */ r.jsx(hr, { children: w ? /* @__PURE__ */ r.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }) }) : /* @__PURE__ */ r.jsx(Tr, {}) }),
1405
1408
  /* @__PURE__ */ r.jsx("br", {}),
1406
1409
  /* @__PURE__ */ r.jsx("div", { id: "placeholder", className: "absolute bg-green-500 z-[99999] max-w-full transition-transform" })
1407
1410
  ]
@@ -1409,30 +1412,10 @@ const Ir = () => {
1409
1412
  )
1410
1413
  }
1411
1414
  );
1412
- }, Br = Tt(() => import("./AddBlocks-sKF4ti68.js")), As = () => {
1413
- const [e, t] = N(Sn);
1414
- return /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1415
- /* @__PURE__ */ r.jsx(Jn, {}),
1416
- /* @__PURE__ */ r.jsxs("div", { className: "relative h-full overflow-hidden bg-slate-800/90 px-2 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]", children: [
1417
- /* @__PURE__ */ r.jsx(Ye, { fallback: /* @__PURE__ */ r.jsx(tt, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(On, { children: /* @__PURE__ */ r.jsx(Sr, {}) }) }),
1418
- e ? /* @__PURE__ */ r.jsx(
1419
- "div",
1420
- {
1421
- onClick: () => t(!1),
1422
- className: "absolute inset-0 z-50 flex items-center bg-black/30 backdrop-blur-sm",
1423
- children: /* @__PURE__ */ r.jsx(
1424
- "div",
1425
- {
1426
- onClick: (n) => n.stopPropagation(),
1427
- className: "mx-auto h-[90%] w-[90%] max-w-3xl rounded-md bg-white p-4 shadow-lg shadow-black/10 xl:w-[65%]",
1428
- children: /* @__PURE__ */ r.jsx(Br, {})
1429
- }
1430
- )
1431
- }
1432
- ) : null
1433
- ] })
1434
- ] });
1435
- };
1415
+ }, Ro = () => /* @__PURE__ */ r.jsxs("div", { className: "flex h-full w-full flex-col", children: [
1416
+ /* @__PURE__ */ r.jsx(Yn, {}),
1417
+ /* @__PURE__ */ r.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 px-2 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]", children: /* @__PURE__ */ r.jsx(Ke, { fallback: /* @__PURE__ */ r.jsx(rt, { className: "h-full" }), children: /* @__PURE__ */ r.jsx(_n, { children: /* @__PURE__ */ r.jsx(Ir, {}) }) }) })
1418
+ ] });
1436
1419
  export {
1437
- As as default
1420
+ Ro as default
1438
1421
  };