@chaibuilder/sdk 1.2.25 → 1.2.26

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 (182) hide show
  1. package/dist/AddBlocks-l1JENNvq.js +206 -0
  2. package/dist/AddBlocks-zPPKkeKs.cjs +1 -0
  3. package/dist/BrandingOptions-DkpqGARR.cjs +1 -0
  4. package/dist/{BrandingOptions-iTyWpwTs.js → BrandingOptions-udtH5yJs.js} +54 -40
  5. package/dist/{CanvasArea-dZjng782.js → CanvasArea-h0W-Tyha.js} +324 -340
  6. package/dist/CanvasArea-zme1r3Zi.cjs +55 -0
  7. package/dist/Class-PoYusiA5.cjs +1 -0
  8. package/dist/{Class-ahc3NIbq.js → Class-lGzsNBOK.js} +29 -26
  9. package/dist/CurrentPage-Hl52iub_.cjs +1 -0
  10. package/dist/{CurrentPage-Kmfp-kFk.js → CurrentPage-tJUjXWdb.js} +54 -40
  11. package/dist/Functions-7jnEwJyw.js +15 -0
  12. package/dist/Functions-N3yhPYKY.cjs +1 -0
  13. package/dist/ListTree-WvTjY5rr.cjs +1 -0
  14. package/dist/{ListTree-N3jeD790.js → ListTree-cZ-Ihlt3.js} +96 -86
  15. package/dist/MODIFIERS-0g14w5RS.cjs +1 -0
  16. package/dist/{MODIFIERS-CNqNUapY.js → MODIFIERS-dytZ-osO.js} +4 -10
  17. package/dist/PagesPanel-6rrLXEO-.js +64 -0
  18. package/dist/PagesPanel-WzCocl6u.cjs +1 -0
  19. package/dist/ProjectPanel-o7gdcwPn.cjs +1 -0
  20. package/dist/ProjectPanel-tz3bjdXy.js +85 -0
  21. package/dist/{STRINGS-b432aBJJ.js → STRINGS--j49GZJP.js} +2 -2
  22. package/dist/{Settings-jCcd-VE6.js → Settings-4s2LUVmC.js} +401 -407
  23. package/dist/Settings-AqoKwR92.cjs +1 -0
  24. package/dist/SidePanels-3o6Okmvu.cjs +1 -0
  25. package/dist/{SidePanels-pHMYprpW.js → SidePanels-bugFfInz.js} +118 -108
  26. package/dist/Topbar-CqW7G360.cjs +1 -0
  27. package/dist/Topbar-pWzBEOed.js +132 -0
  28. package/dist/UnsplashImages-NGskB93R.cjs +1 -0
  29. package/dist/{UnsplashImages-L7x_3RQf.js → UnsplashImages-qvwFbV-E.js} +63 -50
  30. package/dist/{UploadImages-zdEJRLD8.js → UploadImages-9NapgXBq.js} +60 -37
  31. package/dist/UploadImages-Oh7Glr9A.cjs +1 -0
  32. package/dist/_commonjsHelpers-UyOWmZb0.js +8 -0
  33. package/dist/_commonjsHelpers-wDK0ZLPo.cjs +1 -0
  34. package/dist/add-page-modal--6TTBRYa.cjs +1 -0
  35. package/dist/add-page-modal-k2Kb92HS.js +104 -0
  36. package/dist/confirm-alert-C4M9eF-o.cjs +1 -0
  37. package/dist/confirm-alert-GUhZ_G8w.js +60 -0
  38. package/dist/controls-KK2oLIa8.cjs +1 -0
  39. package/dist/{controls-IS5qnRce.js → controls-OfJWSEqC.js} +85 -20
  40. package/dist/core.cjs +1 -1
  41. package/dist/core.js +75 -150
  42. package/dist/defaultTheme-7VqqhOcp.cjs +1 -0
  43. package/dist/{defaultTheme-4kA60XdB.js → defaultTheme-D8B4-wHO.js} +8 -6
  44. package/dist/delete-page-modal-cFoL-wdo.cjs +1 -0
  45. package/dist/delete-page-modal-zONvdebd.js +83 -0
  46. package/dist/email-blocks.cjs +1 -1
  47. package/dist/email-blocks.js +292 -3
  48. package/dist/email.cjs +1 -1
  49. package/dist/email.js +37 -18
  50. package/dist/empty-slot-ZBlsQi6m.js +15 -0
  51. package/dist/empty-slot-nzYOgZuS.cjs +1 -0
  52. package/dist/{form-0_RLz2TB.js → form-STUz-6nE.js} +12 -12
  53. package/dist/form-lBQ_76Uw.cjs +1 -0
  54. package/dist/{html-to-json-uSnxl72F.cjs → html-to-json-efmv1pCj.cjs} +1 -1
  55. package/dist/{html-to-json-2xtb7520.js → html-to-json-ngX9ef2u.js} +41 -41
  56. package/dist/index-Gk6sASBd.js +3080 -0
  57. package/dist/index-OB199Izc.cjs +206 -0
  58. package/dist/index-SkyM3d6Q.js +39503 -0
  59. package/dist/index-YpnaudSM.js +63 -0
  60. package/dist/index-e0c8PmRQ.js +205 -0
  61. package/dist/index-ecnGWzh9.cjs +1 -0
  62. package/dist/index-gi1LIOCw.cjs +1 -0
  63. package/dist/index-h-hd6EvN.cjs +1 -0
  64. package/dist/index-llTXLDGE.js +2201 -0
  65. package/dist/index-mbyqq81O.cjs +1 -0
  66. package/dist/{jsx-runtime-Sp0orL4X.js → jsx-runtime-WbnYoNE9.js} +109 -106
  67. package/dist/jsx-runtime-Z_BpKhVy.cjs +27 -0
  68. package/dist/lib.cjs +2 -2
  69. package/dist/lib.js +66 -62
  70. package/dist/page-viewer-2kwnKM6v.cjs +1 -0
  71. package/dist/{page-viewer-NnOwmAmu.js → page-viewer-Pdg9F5Hv.js} +57 -43
  72. package/dist/project-general-setting-CnNL98NM.cjs +1 -0
  73. package/dist/{project-general-setting-9ju3TDju.js → project-general-setting-f8Ebsn6K.js} +43 -35
  74. package/dist/project-seo-setting-mlxL_e2_.cjs +1 -0
  75. package/dist/{project-seo-setting-36CdUszM.js → project-seo-setting-pX34Qsym.js} +40 -23
  76. package/dist/render.cjs +1 -1
  77. package/dist/render.js +14 -13
  78. package/dist/single-page-detail-XfzrGlzA.cjs +1 -0
  79. package/dist/{single-page-detail-hD1jKZ8k.js → single-page-detail-dpe5LT0M.js} +74 -66
  80. package/dist/studio.cjs +1 -1
  81. package/dist/studio.js +40 -24
  82. package/dist/ui.cjs +1 -1
  83. package/dist/ui.js +160 -365
  84. package/dist/web-blocks.cjs +6 -1
  85. package/dist/web-blocks.js +1153 -3
  86. package/package.json +1 -1
  87. package/dist/AddBlocks-Ol3iIVKa.js +0 -207
  88. package/dist/AddBlocks-a1c-7Ewz.cjs +0 -1
  89. package/dist/BrandingOptions-6rnt0UaA.cjs +0 -1
  90. package/dist/CanvasArea-R4ogF9AT.cjs +0 -55
  91. package/dist/ChaiBuilderEditor-m30yoOgJ.cjs +0 -163
  92. package/dist/ChaiBuilderEditor-vP4at00I.js +0 -27974
  93. package/dist/Class-eieto7e-.cjs +0 -1
  94. package/dist/Controls-3Cc1XYXg.js +0 -105
  95. package/dist/Controls-ky25Ebo3.cjs +0 -1
  96. package/dist/CurrentPage-3gQTH0Zt.cjs +0 -1
  97. package/dist/Functions-Hvon6AMZ.cjs +0 -1
  98. package/dist/Functions-NzT2Six_.js +0 -15
  99. package/dist/ImagesPanel-J1RlG7xG.cjs +0 -1
  100. package/dist/ImagesPanel-Wb0GF_NA.js +0 -29
  101. package/dist/ListTree-CZ-mtjZ9.cjs +0 -1
  102. package/dist/MODIFIERS-o1p3VnpS.cjs +0 -1
  103. package/dist/PagesPanel-Gi0z6gaf.cjs +0 -1
  104. package/dist/PagesPanel-u1IB-nRr.js +0 -48
  105. package/dist/ProjectPanel-EydGZmMW.js +0 -71
  106. package/dist/ProjectPanel-kiiljG4H.cjs +0 -1
  107. package/dist/Settings-8ilCSH8b.cjs +0 -1
  108. package/dist/SidePanels-T36C6Lhc.cjs +0 -1
  109. package/dist/Topbar-CvWQuspR.cjs +0 -1
  110. package/dist/Topbar-pbIDUE_B.js +0 -122
  111. package/dist/UnsplashImages-KBZPd9dv.cjs +0 -1
  112. package/dist/UploadImages-GkkJVAgG.cjs +0 -1
  113. package/dist/accordion-oPUeqPCZ.js +0 -42
  114. package/dist/accordion-ynvFtV_p.cjs +0 -1
  115. package/dist/add-page-modal-9SGv2hgc.cjs +0 -1
  116. package/dist/add-page-modal-JCDXZIPW.js +0 -95
  117. package/dist/alert-dialog-P9xMMB6C.cjs +0 -1
  118. package/dist/alert-dialog-rypfO5ly.js +0 -64
  119. package/dist/badge-E-S7CqUt.cjs +0 -1
  120. package/dist/badge-tEwO7C51.js +0 -23
  121. package/dist/block-helpers-OKHmRRol.cjs +0 -1
  122. package/dist/block-helpers-oSFpSsGz.js +0 -23
  123. package/dist/command-BxR6jaCI.cjs +0 -1
  124. package/dist/command-Pn3HKDuV.js +0 -97
  125. package/dist/confirm-alert-uNm0lZ0y.cjs +0 -1
  126. package/dist/confirm-alert-wR5_VJ1l.js +0 -36
  127. package/dist/context-menu-8dC9uGXj.js +0 -122
  128. package/dist/context-menu-IgLbIuth.cjs +0 -1
  129. package/dist/controls-L7DPvB0m.cjs +0 -1
  130. package/dist/defaultTheme-mrkeGFGI.cjs +0 -1
  131. package/dist/delete-page-modal-7KmP1elv.js +0 -67
  132. package/dist/delete-page-modal-SgfwvfNu.cjs +0 -1
  133. package/dist/dropdown-menu-El86_9Uo.js +0 -124
  134. package/dist/dropdown-menu-SiHzqWwZ.cjs +0 -1
  135. package/dist/form-W58AVUdf.cjs +0 -1
  136. package/dist/hover-card-KUwpDkW8.cjs +0 -1
  137. package/dist/hover-card-q138xxXR.js +0 -45
  138. package/dist/iconBase-gbUAAO2L.cjs +0 -1
  139. package/dist/iconBase-h4DuR_XT.js +0 -63
  140. package/dist/index-9MmykVSc.cjs +0 -1
  141. package/dist/index-hElOGcFr.js +0 -2200
  142. package/dist/index-lDTsQp7h.js +0 -188
  143. package/dist/index-rq5Y9ZDy.cjs +0 -1
  144. package/dist/jsx-runtime-JYMCiFoE.cjs +0 -27
  145. package/dist/label-KaP7MRrs.js +0 -10
  146. package/dist/label-tFm8HZdb.cjs +0 -1
  147. package/dist/link-WbcKdQ9k.cjs +0 -1
  148. package/dist/link-xuhP-4dN.js +0 -196
  149. package/dist/page-viewer-Hx5hxHKm.cjs +0 -1
  150. package/dist/popover-a84pbVhQ.js +0 -23
  151. package/dist/popover-fKjgcRUx.cjs +0 -1
  152. package/dist/project-general-setting-FxkwjvJz.cjs +0 -1
  153. package/dist/project-seo-setting-RU7qiXxb.cjs +0 -1
  154. package/dist/scroll-area-FiHvy-TZ.cjs +0 -1
  155. package/dist/scroll-area-ewXbxc3n.js +0 -30
  156. package/dist/select-7bjg-rr9.cjs +0 -1
  157. package/dist/select-POGdEDHT.js +0 -75
  158. package/dist/separator-3Civ-6hb.cjs +0 -1
  159. package/dist/separator-SctTn0Qi.js +0 -18
  160. package/dist/single-page-detail-beY0MT1b.cjs +0 -1
  161. package/dist/skeleton-STeL9VrJ.cjs +0 -1
  162. package/dist/skeleton-lu8e7q2y.js +0 -239
  163. package/dist/tabs-_4WbA1cc.cjs +0 -1
  164. package/dist/tabs-yQ3oGziM.js +0 -106
  165. package/dist/textarea-1kZEh7ki.cjs +0 -1
  166. package/dist/textarea-b2QvVhrK.js +0 -73
  167. package/dist/useAddBlock-8pxOEYIl.cjs +0 -1
  168. package/dist/useAddBlock-FEKFJNwQ.js +0 -69
  169. package/dist/useChaiExternalData-fkFgoS80.js +0 -6
  170. package/dist/useChaiExternalData-rwoAZ6uU.cjs +0 -1
  171. package/dist/useDarkMode-7i57segK.cjs +0 -1
  172. package/dist/useDarkMode-8VHJlYyE.js +0 -23
  173. package/dist/useSelectedBreakpoints-6NK5qd7T.js +0 -10
  174. package/dist/useSelectedBreakpoints-7ONXb-vN.cjs +0 -1
  175. package/dist/useStylingState-Iuj84yvc.js +0 -186
  176. package/dist/useStylingState-OIvJMV6p.cjs +0 -1
  177. package/dist/useUiLibraries-nCdauJ4N.cjs +0 -1
  178. package/dist/useUiLibraries-psyWFbNc.js +0 -12
  179. package/dist/useUpdateBlocksProps-Unn8lUyj.cjs +0 -1
  180. package/dist/useUpdateBlocksProps-vWcDp-P9.js +0 -23
  181. package/dist/utils-dze1SGvB.js +0 -6
  182. package/dist/utils-qK_SjzzV.cjs +0 -1
@@ -1,86 +1,70 @@
1
- var He = Object.defineProperty;
2
- var Oe = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var E = (e, t, n) => (Oe(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { j as o } from "./jsx-runtime-Sp0orL4X.js";
5
- import M, { useMemo as ge, useEffect as k, createElement as ie, useCallback as q, useState as I, Component as fe, Children as ze, Suspense as xe, useRef as re } from "react";
6
- import { each as G, find as ye, map as H, includes as ae, toUpper as J, round as Ue, noop as R, has as ve, throttle as be, isEmpty as A, first as W, omit as We, get as y, pick as Ke, memoize as qe, filter as ke, isNull as Ve, isString as te } from "lodash-es";
7
- import { ResetIcon as le, DotsVerticalIcon as Ye, MobileIcon as ce, LaptopIcon as Ze, DesktopIcon as Je, EraserIcon as Qe, ZoomInIcon as Ge, ArrowUpIcon as Xe, CopyIcon as et, TrashIcon as tt, DragHandleDots2Icon as nt } from "@radix-ui/react-icons";
8
- import { B as K, u as V, S as we } from "./skeleton-lu8e7q2y.js";
9
- import { o as ot, b as je, t as st, j as S, n as T, v as it, f as L, w as F, a as ne, u as Ce, g as Be, i as De, m as rt, x as at, y as Ie, h as lt, z as ct, k as dt, A as pt, E as ut } from "./ChaiBuilderEditor-vP4at00I.js";
10
- import { S as U } from "./separator-SctTn0Qi.js";
1
+ var Re = Object.defineProperty;
2
+ var $e = (e, t, n) => t in e ? Re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var E = (e, t, n) => ($e(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { j as o } from "./jsx-runtime-WbnYoNE9.js";
5
+ import M, { createElement as se, useCallback as K, useState as I, useEffect as j, Component as me, Children as Fe, Suspense as ge, useRef as ie, useMemo as Pe } from "react";
6
+ import { map as O, includes as re, toUpper as Q, round as Oe, noop as $, has as fe, throttle as xe, isEmpty as N, first as W, omit as He, pick as ze, get as y, isString as ee, memoize as Ue, each as We, find as qe, filter as ye, isNull as Ke } from "lodash-es";
7
+ import { ResetIcon as ae, MobileIcon as le, LaptopIcon as Ve, DesktopIcon as Ye, DotsVerticalIcon as Je, EraserIcon as Qe, ZoomInIcon as Ze, DragHandleDots2Icon as Ge, ArrowUpIcon as Xe, CopyIcon as et, TrashIcon as tt } from "@radix-ui/react-icons";
8
+ import { v as ve, B as q, V as be, aB as nt, aC as ot, aD as st, aE as it, aF as rt, N as te, ab as at, h as V, aG as lt, aH as ct, aI as dt, aJ as pt, aK as ut, aL as ht, aM as mt, r as S, ac as T, A as gt, a as ft, b as xt, c as yt, d as vt, e as bt, f as kt, g as wt, ai as jt, O as ke, aA as U, L as Ct, aN as Bt, Y as L, a5 as Dt, aO as F, E as ne, t as we, q as je, s as Ce, z as It, aP as St, aQ as Be, aR as _t, aS as Nt, F as At, aT as Et, a1 as Mt, aU as Tt, S as De } from "./index-Gk6sASBd.js";
11
9
  import { useTranslation as Y } from "react-i18next";
12
- import { a as Se, u as oe } from "./useDarkMode-8VHJlYyE.js";
13
- import { S as ht, H as mt, a as gt, b as ft } from "./hover-card-q138xxXR.js";
14
- import { L as xt } from "./label-KaP7MRrs.js";
15
- import { D as yt, a as vt, b as bt, f as kt, g as wt, d as jt } from "./dropdown-menu-El86_9Uo.js";
16
- import { a as Ct, u as _e } from "./useSelectedBreakpoints-6NK5qd7T.js";
17
- import { A as Bt, a as Dt, b as It, c as St, e as _t, f as At, d as Nt, h as Et, g as Mt } from "./alert-dialog-rypfO5ly.js";
18
10
  import { useAtom as C } from "jotai";
19
- import { u as Tt } from "./useUpdateBlocksProps-vWcDp-P9.js";
11
+ import ce from "react-dom";
12
+ import w from "prop-types";
20
13
  import { Quill as Lt } from "react-quill";
21
- import { u as $t } from "./useAddBlock-FEKFJNwQ.js";
22
- import { useFeature as Ae } from "flagged";
14
+ import { useFeature as Ie } from "flagged";
23
15
  import { flip as Rt } from "@floating-ui/dom";
24
- import { useFloating as Ft, shift as Pt } from "@floating-ui/react-dom";
25
- import { c as Ht, a as Ot } from "./block-helpers-oSFpSsGz.js";
26
- import { useResizeObserver as zt } from "@react-hookz/web";
27
- import { tailwindcssPaletteGenerator as Ut } from "@bobthered/tailwindcss-palette-generator";
28
- import Wt from "@tailwindcss/typography";
29
- import Kt from "@tailwindcss/forms";
30
- import qt from "@tailwindcss/aspect-ratio";
31
- import { Provider as Vt } from "react-wrap-balancer";
32
- import { twMerge as Yt } from "tailwind-merge";
33
- import { S as Ne, a as de } from "./STRINGS-b432aBJJ.js";
34
- import { getChaiDataProviders as Zt, getBlockComponent as Jt } from "@chaibuilder/runtime";
35
- import { u as Ee } from "./useChaiExternalData-fkFgoS80.js";
36
- import pe from "react-dom";
37
- import j from "prop-types";
38
- import "@radix-ui/react-slot";
39
- import "class-variance-authority";
40
- import "./utils-dze1SGvB.js";
16
+ import { useFloating as $t, shift as Ft } from "@floating-ui/react-dom";
17
+ import { useResizeObserver as Pt } from "@react-hookz/web";
18
+ import { tailwindcssPaletteGenerator as Ot } from "@bobthered/tailwindcss-palette-generator";
19
+ import Ht from "@tailwindcss/typography";
20
+ import zt from "@tailwindcss/forms";
21
+ import Ut from "@tailwindcss/aspect-ratio";
22
+ import { Provider as Wt } from "react-wrap-balancer";
23
+ import { twMerge as qt } from "tailwind-merge";
24
+ import { S as de, a as Se } from "./STRINGS--j49GZJP.js";
25
+ import { getBlockComponent as Kt } from "@chaibuilder/runtime";
26
+ import { u as Vt, B as Yt, E as Jt } from "./index-SkyM3d6Q.js";
27
+ import "./_commonjsHelpers-UyOWmZb0.js";
28
+ import "./Functions-7jnEwJyw.js";
41
29
  import "clsx";
30
+ import "./MODIFIERS-dytZ-osO.js";
31
+ import "./Class-lGzsNBOK.js";
32
+ import "@radix-ui/react-toggle";
33
+ import "class-variance-authority";
34
+ import "@radix-ui/react-switch";
35
+ import "@radix-ui/react-slot";
36
+ import "@radix-ui/react-accordion";
37
+ import "@radix-ui/react-alert-dialog";
38
+ import "@radix-ui/react-dialog";
39
+ import "@radix-ui/react-label";
40
+ import "@radix-ui/react-scroll-area";
41
+ import "@radix-ui/react-tabs";
42
42
  import "@radix-ui/react-tooltip";
43
+ import "@radix-ui/react-popover";
44
+ import "@radix-ui/react-menubar";
45
+ import "@radix-ui/react-hover-card";
46
+ import "@radix-ui/react-select";
47
+ import "@radix-ui/react-dropdown-menu";
48
+ import "@radix-ui/react-separator";
43
49
  import "@radix-ui/react-toast";
44
- import "./MODIFIERS-CNqNUapY.js";
45
- import "@radix-ui/react-scroll-area";
50
+ import "cmdk";
51
+ import "@radix-ui/react-context-menu";
52
+ import "react-icons-picker";
46
53
  import "i18next";
47
- import "./Functions-NzT2Six_.js";
48
54
  import "react-hotkeys-hook";
49
- import "@radix-ui/react-separator";
50
- import "@radix-ui/react-switch";
51
- import "@radix-ui/react-hover-card";
52
- import "@radix-ui/react-label";
53
- import "@radix-ui/react-dropdown-menu";
54
- import "@radix-ui/react-alert-dialog";
55
- import "./Controls-3Cc1XYXg.js";
56
- const Qt = () => ge(() => Zt(), []), Gt = ({ children: e }) => {
57
- const [, t] = Ee(), [n] = ot(), a = Qt();
58
- return k(() => (t({}), G(n, (r) => {
59
- const i = ye(a, { providerKey: r.providerKey });
60
- if (i) {
61
- const c = (i == null ? void 0 : i.mockFn) || (i == null ? void 0 : i.dataFn);
62
- c && c(r.args).then(
63
- (s) => t((l) => ({ ...l, [r.providerKey]: s }))
64
- );
65
- }
66
- }), () => {
67
- G(n, (r) => {
68
- t((i) => (delete i[r.providerKey], i));
69
- });
70
- }), [a, n, t]), /* @__PURE__ */ o.jsx(o.Fragment, { children: e });
71
- }, Xt = () => {
72
- const { hasUndo: e, hasRedo: t, undo: n, redo: a } = je();
55
+ const Qt = () => {
56
+ const { hasUndo: e, hasRedo: t, undo: n, redo: r } = ve();
73
57
  return /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
74
- /* @__PURE__ */ o.jsx(K, { disabled: !e(), size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ o.jsx(le, {}) }),
75
- /* @__PURE__ */ o.jsx(K, { disabled: !t(), onClick: a, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ o.jsx(le, { className: "rotate-180 scale-y-[-1] transform" }) })
58
+ /* @__PURE__ */ o.jsx(q, { disabled: !e(), size: "sm", onClick: n, className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ o.jsx(ae, {}) }),
59
+ /* @__PURE__ */ o.jsx(q, { disabled: !t(), onClick: r, size: "sm", className: "rounded-full", variant: "ghost", children: /* @__PURE__ */ o.jsx(ae, { className: "rotate-180 scale-y-[-1] transform" }) })
76
60
  ] });
77
61
  };
78
- function en() {
79
- const [e, t] = Se(), { t: n } = Y();
62
+ function Zt() {
63
+ const [e, t] = be(), { t: n } = Y();
80
64
  return /* @__PURE__ */ o.jsxs("div", { className: "flex items-center", children: [
81
- /* @__PURE__ */ o.jsx(xt, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
65
+ /* @__PURE__ */ o.jsx(nt, { htmlFor: "dark-mode-switch", children: n("dark_mode") }),
82
66
  /* @__PURE__ */ o.jsxs(
83
- ht,
67
+ ot,
84
68
  {
85
69
  id: "dark-mode-switch",
86
70
  checked: e,
@@ -104,7 +88,7 @@ function en() {
104
88
  )
105
89
  ] });
106
90
  }
107
- const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
91
+ const pe = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
108
92
  "svg",
109
93
  {
110
94
  className: e ? "rotate-90" : "",
@@ -127,149 +111,149 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
127
111
  )
128
112
  ]
129
113
  }
130
- ), tn = [
114
+ ), Gt = [
131
115
  {
132
116
  title: "mobile_xs_title",
133
117
  content: "mobile_xs_content",
134
118
  breakpoint: "xs",
135
- icon: /* @__PURE__ */ o.jsx(ce, {}),
119
+ icon: /* @__PURE__ */ o.jsx(le, {}),
136
120
  width: 400
137
121
  },
138
122
  {
139
123
  title: "mobile_sm_title",
140
124
  content: "mobile_sm_content",
141
125
  breakpoint: "sm",
142
- icon: /* @__PURE__ */ o.jsx(ce, { className: "rotate-90" }),
126
+ icon: /* @__PURE__ */ o.jsx(le, { className: "rotate-90" }),
143
127
  width: 640
144
128
  },
145
129
  {
146
130
  title: "tablet_md_title",
147
131
  content: "tablet_md_content",
148
132
  breakpoint: "md",
149
- icon: /* @__PURE__ */ o.jsx(ue, {}),
133
+ icon: /* @__PURE__ */ o.jsx(pe, {}),
150
134
  width: 800
151
135
  },
152
136
  {
153
137
  title: "tablet_lg_title",
154
138
  content: "tablet_lg_content",
155
139
  breakpoint: "lg",
156
- icon: /* @__PURE__ */ o.jsx(ue, { landscape: !0 }),
140
+ icon: /* @__PURE__ */ o.jsx(pe, { landscape: !0 }),
157
141
  width: 1024
158
142
  },
159
143
  {
160
144
  title: "desktop_xl_title",
161
145
  content: "desktop_xl_content",
162
146
  breakpoint: "xl",
163
- icon: /* @__PURE__ */ o.jsx(Ze, {}),
147
+ icon: /* @__PURE__ */ o.jsx(Ve, {}),
164
148
  width: 1420
165
149
  },
166
150
  {
167
151
  title: "large_desktop_2xl_title",
168
152
  content: "large_desktop_2xl_content",
169
153
  breakpoint: "2xl",
170
- icon: /* @__PURE__ */ o.jsx(Je, {}),
154
+ icon: /* @__PURE__ */ o.jsx(Ye, {}),
171
155
  width: 1920
172
156
  }
173
- ], he = ({
157
+ ], ue = ({
174
158
  title: e,
175
159
  content: t,
176
160
  currentBreakpoint: n,
177
- breakpoint: a,
178
- width: r,
161
+ breakpoint: r,
162
+ width: a,
179
163
  icon: i,
180
164
  onClick: c
181
165
  }) => {
182
166
  const { t: s } = Y();
183
- return /* @__PURE__ */ o.jsxs(mt, { children: [
184
- /* @__PURE__ */ o.jsx(gt, { asChild: !0, children: /* @__PURE__ */ o.jsx(
185
- K,
167
+ return /* @__PURE__ */ o.jsxs(st, { children: [
168
+ /* @__PURE__ */ o.jsx(it, { asChild: !0, children: /* @__PURE__ */ o.jsx(
169
+ q,
186
170
  {
187
- onClick: () => c(r),
171
+ onClick: () => c(a),
188
172
  size: "sm",
189
- variant: a === n ? "secondary" : "ghost",
173
+ variant: r === n ? "secondary" : "ghost",
190
174
  children: i
191
175
  }
192
176
  ) }),
193
- /* @__PURE__ */ o.jsx(ft, { className: "w-52 border-border", children: /* @__PURE__ */ o.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ o.jsxs("div", { className: "space-y-1", children: [
177
+ /* @__PURE__ */ o.jsx(rt, { className: "w-52 border-border", children: /* @__PURE__ */ o.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ o.jsxs("div", { className: "space-y-1", children: [
194
178
  /* @__PURE__ */ o.jsx("h4", { className: "text-sm font-semibold", children: s(e) }),
195
179
  /* @__PURE__ */ o.jsx("p", { className: "text-xs", children: s(t) })
196
180
  ] }) }) })
197
181
  ] });
198
- }, nn = () => {
199
- const [, e, t] = oe(), [n, a] = Ct(), { t: r } = Y(), i = V("breakpoints", tn), c = (s) => {
200
- n.includes(s) ? n.length > 2 && a(n.filter((l) => l !== s)) : a((l) => [...l, s]);
182
+ }, Xt = () => {
183
+ const [, e, t] = te(), [n, r] = at(), { t: a } = Y(), i = V("breakpoints", Gt), c = (s) => {
184
+ n.includes(s) ? n.length > 2 && r(n.filter((l) => l !== s)) : r((l) => [...l, s]);
201
185
  };
202
- return i.length < 4 ? /* @__PURE__ */ o.jsx("div", { className: "flex items-center rounded-md", children: H(i, (s) => /* @__PURE__ */ ie(he, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })) }) : /* @__PURE__ */ o.jsxs("div", { className: "flex items-center rounded-md", children: [
203
- H(
204
- i.filter((s) => ae(n, J(s.breakpoint))),
205
- (s) => /* @__PURE__ */ ie(he, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })
186
+ return i.length < 4 ? /* @__PURE__ */ o.jsx("div", { className: "flex items-center rounded-md", children: O(i, (s) => /* @__PURE__ */ se(ue, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })) }) : /* @__PURE__ */ o.jsxs("div", { className: "flex items-center rounded-md", children: [
187
+ O(
188
+ i.filter((s) => re(n, Q(s.breakpoint))),
189
+ (s) => /* @__PURE__ */ se(ue, { ...s, onClick: t, key: s.breakpoint, currentBreakpoint: e })
206
190
  ),
207
- /* @__PURE__ */ o.jsxs(yt, { children: [
208
- /* @__PURE__ */ o.jsx(vt, { asChild: !0, children: /* @__PURE__ */ o.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ o.jsx(Ye, { className: "scale-90 transform" }) }) }),
209
- /* @__PURE__ */ o.jsxs(bt, { className: "w-56 border-border text-xs", children: [
210
- /* @__PURE__ */ o.jsx(kt, { children: r("Breakpoints") }),
211
- /* @__PURE__ */ o.jsx(wt, {}),
212
- H(i, (s) => /* @__PURE__ */ o.jsx(
213
- jt,
191
+ /* @__PURE__ */ o.jsxs(lt, { children: [
192
+ /* @__PURE__ */ o.jsx(ct, { asChild: !0, children: /* @__PURE__ */ o.jsx("span", { className: "cursor-pointer px-2.5 hover:opacity-80", children: /* @__PURE__ */ o.jsx(Je, { className: "scale-90 transform" }) }) }),
193
+ /* @__PURE__ */ o.jsxs(dt, { className: "w-56 border-border text-xs", children: [
194
+ /* @__PURE__ */ o.jsx(pt, { children: a("Breakpoints") }),
195
+ /* @__PURE__ */ o.jsx(ut, {}),
196
+ O(i, (s) => /* @__PURE__ */ o.jsx(
197
+ ht,
214
198
  {
215
199
  disabled: s.breakpoint === "xs",
216
- onCheckedChange: () => c(J(s.breakpoint)),
217
- checked: ae(n, J(s.breakpoint)),
218
- children: r(s.title)
200
+ onCheckedChange: () => c(Q(s.breakpoint)),
201
+ checked: re(n, Q(s.breakpoint)),
202
+ children: a(s.title)
219
203
  },
220
204
  s.breakpoint
221
205
  ))
222
206
  ] })
223
207
  ] })
224
208
  ] });
225
- }, on = () => {
226
- const { t: e } = Y(), { setNewBlocks: t } = st(), [, n] = S(), [, a] = T(), r = q(() => {
227
- t([]), n([]), a([]);
209
+ }, en = () => {
210
+ const { t: e } = Y(), { setNewBlocks: t } = mt(), [, n] = S(), [, r] = T(), a = K(() => {
211
+ t([]), n([]), r([]);
228
212
  }, [t]);
229
- return /* @__PURE__ */ o.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ o.jsxs(Bt, { children: [
230
- /* @__PURE__ */ o.jsx(Dt, { asChild: !0, children: /* @__PURE__ */ o.jsxs(K, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
213
+ return /* @__PURE__ */ o.jsx("div", { className: "flex items-center", children: /* @__PURE__ */ o.jsxs(gt, { children: [
214
+ /* @__PURE__ */ o.jsx(ft, { asChild: !0, children: /* @__PURE__ */ o.jsxs(q, { size: "sm", variant: "ghost", className: "flex items-center gap-x-1", children: [
231
215
  /* @__PURE__ */ o.jsx(Qe, {}),
232
216
  " ",
233
217
  e("clear")
234
218
  ] }) }),
235
- /* @__PURE__ */ o.jsxs(It, { className: "border-border", children: [
236
- /* @__PURE__ */ o.jsxs(St, { children: [
237
- /* @__PURE__ */ o.jsx(_t, { children: e("clear_canvas_title") }),
238
- /* @__PURE__ */ o.jsx(At, { children: e("clear_canvas_description") })
219
+ /* @__PURE__ */ o.jsxs(xt, { className: "border-border", children: [
220
+ /* @__PURE__ */ o.jsxs(yt, { children: [
221
+ /* @__PURE__ */ o.jsx(vt, { children: e("clear_canvas_title") }),
222
+ /* @__PURE__ */ o.jsx(bt, { children: e("clear_canvas_description") })
239
223
  ] }),
240
- /* @__PURE__ */ o.jsxs(Nt, { children: [
241
- /* @__PURE__ */ o.jsx(Et, { children: e("cancel") }),
242
- /* @__PURE__ */ o.jsx(Mt, { onClick: r, children: e("yes") })
224
+ /* @__PURE__ */ o.jsxs(kt, { children: [
225
+ /* @__PURE__ */ o.jsx(wt, { children: e("cancel") }),
226
+ /* @__PURE__ */ o.jsx(jt, { onClick: a, children: e("yes") })
243
227
  ] })
244
228
  ] })
245
229
  ] }) });
246
- }, sn = () => {
247
- const e = V("darkMode", !1), [t] = _e();
230
+ }, tn = () => {
231
+ const e = V("darkMode", !1), [t] = ke();
248
232
  return /* @__PURE__ */ o.jsxs("div", { className: "flex h-10 items-center justify-between border-b bg-background/70 px-2", children: [
249
233
  /* @__PURE__ */ o.jsxs("div", { className: "flex h-full space-x-2", children: [
250
234
  e ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
251
- /* @__PURE__ */ o.jsx(en, {}),
235
+ /* @__PURE__ */ o.jsx(Zt, {}),
252
236
  /* @__PURE__ */ o.jsx(U, { orientation: "vertical" })
253
237
  ] }) : null,
254
- /* @__PURE__ */ o.jsx(nn, {}),
238
+ /* @__PURE__ */ o.jsx(Xt, {}),
255
239
  /* @__PURE__ */ o.jsx(U, { orientation: "vertical" }),
256
240
  /* @__PURE__ */ o.jsxs("div", { className: "flex w-12 items-center justify-center gap-x-1 space-x-0 font-medium", children: [
257
- /* @__PURE__ */ o.jsx(Ge, { className: "h-3.5 w-3.5 flex-shrink-0" }),
241
+ /* @__PURE__ */ o.jsx(Ze, { className: "h-3.5 w-3.5 flex-shrink-0" }),
258
242
  " ",
259
243
  /* @__PURE__ */ o.jsxs("div", { className: "text-xs leading-3", children: [
260
- Ue(t, 0),
244
+ Oe(t, 0),
261
245
  "%"
262
246
  ] })
263
247
  ] }),
264
248
  /* @__PURE__ */ o.jsx(U, { orientation: "vertical" }),
265
- /* @__PURE__ */ o.jsx(Xt, {})
249
+ /* @__PURE__ */ o.jsx(Qt, {})
266
250
  ] }),
267
251
  /* @__PURE__ */ o.jsxs("div", { className: "flex h-full items-center space-x-2", children: [
268
252
  /* @__PURE__ */ o.jsx(U, { orientation: "vertical" }),
269
- /* @__PURE__ */ o.jsx(on, {})
253
+ /* @__PURE__ */ o.jsx(en, {})
270
254
  ] })
271
255
  ] });
272
- }, rn = `<!doctype html>
256
+ }, nn = `<!doctype html>
273
257
  <html class="scroll-smooth h-full overflow-y-auto">
274
258
  <head>
275
259
  <meta charset="UTF-8">
@@ -317,8 +301,8 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
317
301
  <div class="frame-root h-full"></div>
318
302
  <script src="https://cdn.jsdelivr.net/npm/quill@2.0.0/dist/quill.js"><\/script>
319
303
  </body>
320
- </html>`, an = (e) => {
321
- const [t] = oe(), [, n] = _e(), [a, r] = I({}), i = q(() => {
304
+ </html>`, on = (e) => {
305
+ const [t] = te(), [, n] = ke(), [r, a] = I({}), i = K(() => {
322
306
  const { width: c, height: s } = e;
323
307
  if (c < t) {
324
308
  const l = parseFloat((c / t).toFixed(2).toString());
@@ -327,7 +311,7 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
327
311
  s && (d = {
328
312
  // Eureka! This is the formula to calculate the height of the scaled element. Thank you ChatGPT 4
329
313
  height: 100 + (s - p) / p * 100 + "%"
330
- }), r({
314
+ }), a({
331
315
  position: "relative",
332
316
  top: 0,
333
317
  transform: `scale(${l})`,
@@ -336,17 +320,17 @@ const ue = ({ landscape: e = !1 }) => /* @__PURE__ */ o.jsxs(
336
320
  maxWidth: "none"
337
321
  }), n(l * 100);
338
322
  } else
339
- r({}), n(100);
323
+ a({}), n(100);
340
324
  }, [t, e, n]);
341
- return k(() => {
325
+ return j(() => {
342
326
  i();
343
- }, [t, e, n, i]), a;
327
+ }, [t, e, n, i]), r;
344
328
  };
345
- let Me, Te;
346
- typeof document < "u" && (Me = document);
347
- typeof window < "u" && (Te = window);
348
- const Le = M.createContext({ document: Me, window: Te }), Z = () => M.useContext(Le), { Provider: ln, Consumer: To } = Le;
349
- class $e extends fe {
329
+ let _e, Ne;
330
+ typeof document < "u" && (_e = document);
331
+ typeof window < "u" && (Ne = window);
332
+ const Ae = M.createContext({ document: _e, window: Ne }), J = () => M.useContext(Ae), { Provider: sn, Consumer: No } = Ae;
333
+ class Ee extends me {
350
334
  componentDidMount() {
351
335
  this.props.contentDidMount();
352
336
  }
@@ -354,21 +338,21 @@ class $e extends fe {
354
338
  this.props.contentDidUpdate();
355
339
  }
356
340
  render() {
357
- return ze.only(this.props.children);
341
+ return Fe.only(this.props.children);
358
342
  }
359
343
  }
360
- E($e, "propTypes", {
361
- children: j.element.isRequired,
362
- contentDidMount: j.func.isRequired,
363
- contentDidUpdate: j.func.isRequired
344
+ E(Ee, "propTypes", {
345
+ children: w.element.isRequired,
346
+ contentDidMount: w.func.isRequired,
347
+ contentDidUpdate: w.func.isRequired
364
348
  });
365
- class X extends fe {
366
- constructor(n, a) {
367
- super(n, a);
349
+ class G extends me {
350
+ constructor(n, r) {
351
+ super(n, r);
368
352
  E(this, "setRef", (n) => {
369
353
  this.nodeRef.current = n;
370
- const { forwardedRef: a } = this.props;
371
- typeof a == "function" ? a(n) : a && (a.current = n);
354
+ const { forwardedRef: r } = this.props;
355
+ typeof r == "function" ? r(n) : r && (r.current = n);
372
356
  });
373
357
  E(this, "handleLoad", () => {
374
358
  clearInterval(this.loadCheck), this.state.iframeLoaded || this.setState({ iframeLoaded: !0 });
@@ -399,8 +383,8 @@ class X extends fe {
399
383
  const n = this.getDoc();
400
384
  if (!n)
401
385
  return null;
402
- const a = this.props.contentDidMount, r = this.props.contentDidUpdate, i = n.defaultView || n.parentView, c = /* @__PURE__ */ o.jsx($e, { contentDidMount: a, contentDidUpdate: r, children: /* @__PURE__ */ o.jsx(ln, { value: { document: n, window: i }, children: /* @__PURE__ */ o.jsx("div", { className: "frame-content", children: this.props.children }) }) }), s = this.getMountTarget();
403
- return [pe.createPortal(this.props.head, this.getDoc().head), pe.createPortal(c, s)];
386
+ const r = this.props.contentDidMount, a = this.props.contentDidUpdate, i = n.defaultView || n.parentView, c = /* @__PURE__ */ o.jsx(Ee, { contentDidMount: r, contentDidUpdate: a, children: /* @__PURE__ */ o.jsx(sn, { value: { document: n, window: i }, children: /* @__PURE__ */ o.jsx("div", { className: "frame-content", children: this.props.children }) }) }), s = this.getMountTarget();
387
+ return [ce.createPortal(this.props.head, this.getDoc().head), ce.createPortal(c, s)];
404
388
  }
405
389
  render() {
406
390
  const n = {
@@ -416,16 +400,16 @@ class X extends fe {
416
400
  // also inject into the body and can mess up React. For this reason
417
401
  // initialContent is expected to have a div inside of the body
418
402
  // element that we render react into.
419
- E(X, "propTypes", {
420
- style: j.object,
403
+ E(G, "propTypes", {
404
+ style: w.object,
421
405
  // eslint-disable-line
422
- head: j.node,
423
- initialContent: j.string,
424
- mountTarget: j.string,
425
- contentDidMount: j.func,
426
- contentDidUpdate: j.func,
427
- children: j.oneOfType([j.element, j.arrayOf(j.element)])
428
- }), E(X, "defaultProps", {
406
+ head: w.node,
407
+ initialContent: w.string,
408
+ mountTarget: w.string,
409
+ contentDidMount: w.func,
410
+ contentDidUpdate: w.func,
411
+ children: w.oneOfType([w.element, w.arrayOf(w.element)])
412
+ }), E(G, "defaultProps", {
429
413
  style: {},
430
414
  head: null,
431
415
  children: void 0,
@@ -436,117 +420,117 @@ E(X, "propTypes", {
436
420
  },
437
421
  initialContent: '<!DOCTYPE html><html><head></head><body><div class="frame-root"></div></body></html>'
438
422
  });
439
- const cn = M.forwardRef((e, t) => /* @__PURE__ */ o.jsx(X, { ...e, forwardedRef: t })), dn = () => {
440
- const { addCoreBlock: e } = $t(), t = V("getExternalPredefinedBlock", R);
441
- return q(
423
+ const rn = M.forwardRef((e, t) => /* @__PURE__ */ o.jsx(G, { ...e, forwardedRef: t })), an = () => {
424
+ const { addCoreBlock: e } = Ct(), t = V("getExternalPredefinedBlock", $);
425
+ return K(
442
426
  async (n) => {
443
- const { block: a, dropTargetId: r, relativeIndex: i } = n;
444
- if (ve(a, "format")) {
445
- const c = await t(a);
446
- return e({ blocks: c }, r === 0 ? null : r, i);
427
+ const { block: r, dropTargetId: a, relativeIndex: i } = n;
428
+ if (fe(r, "format")) {
429
+ const c = await t(r);
430
+ return e({ blocks: c }, a === 0 ? null : a, i);
447
431
  }
448
- return e(a, r === 0 ? null : r, i);
432
+ return e(r, a === 0 ? null : a, i);
449
433
  },
450
434
  [e]
451
435
  );
452
436
  };
453
- let _ = null, O = [], P = null, Re = null;
454
- function pn(e) {
455
- const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), a = parseInt(t.paddingTop, 10), r = parseInt(t.paddingRight, 10), i = parseInt(t.paddingBottom, 10);
456
- return { paddingLeft: n, paddingTop: a, paddingRight: r, paddingBottom: i };
437
+ let _ = null, H = [], P = null, Me = null;
438
+ function ln(e) {
439
+ const t = window.getComputedStyle(e), n = parseInt(t.paddingLeft, 10), r = parseInt(t.paddingTop, 10), a = parseInt(t.paddingRight, 10), i = parseInt(t.paddingBottom, 10);
440
+ return { paddingLeft: n, paddingTop: r, paddingRight: a, paddingBottom: i };
457
441
  }
458
- const me = (e, t, n) => {
442
+ const he = (e, t, n) => {
459
443
  if (!_)
460
444
  return;
461
- const a = e.getBoundingClientRect(), r = _ == null ? void 0 : _.getElementById("placeholder"), { paddingLeft: i, paddingTop: c, paddingRight: s, paddingBottom: l } = pn(e);
462
- r.style.width = t === "vertical" ? a.width - i - s + "px" : "2px", r.style.height = t === "vertical" ? "2px" : a.height - c - l + "px", r.style.display = "block";
463
- const d = O.reduce(
445
+ const r = e.getBoundingClientRect(), a = _ == null ? void 0 : _.getElementById("placeholder"), { paddingLeft: i, paddingTop: c, paddingRight: s, paddingBottom: l } = ln(e);
446
+ a.style.width = t === "vertical" ? r.width - i - s + "px" : "2px", a.style.height = t === "vertical" ? "2px" : r.height - c - l + "px", a.style.display = "block";
447
+ const d = H.reduce(
464
448
  (p, m) => Math.abs(m - n) < Math.abs(p - n) ? m : p
465
449
  );
466
- Re = O.indexOf(d), t === "vertical" ? (r.style.top = e.offsetTop + d + "px", r.style.left = e.offsetLeft + i + "px") : (r.style.top = e.offsetTop + c + "px", r.style.left = e.offsetLeft + d + "px");
467
- }, un = (e) => {
468
- const t = Fe(e), n = window.getComputedStyle(e), a = t === "horizontal", r = parseInt(n.paddingLeft), i = parseInt(n.paddingTop);
469
- let c = a ? r : i;
470
- O = [c], Array.from(e.children).forEach((s) => {
450
+ Me = H.indexOf(d), t === "vertical" ? (a.style.top = e.offsetTop + d + "px", a.style.left = e.offsetLeft + i + "px") : (a.style.top = e.offsetTop + c + "px", a.style.left = e.offsetLeft + d + "px");
451
+ }, cn = (e) => {
452
+ const t = Te(e), n = window.getComputedStyle(e), r = t === "horizontal", a = parseInt(n.paddingLeft), i = parseInt(n.paddingTop);
453
+ let c = r ? a : i;
454
+ H = [c], Array.from(e.children).forEach((s) => {
471
455
  const l = window.getComputedStyle(s), d = parseInt(
472
- a ? l.marginLeft + l.marginRight : l.marginTop + l.marginBottom
473
- ), p = a ? s.offsetWidth : s.offsetHeight;
474
- O.push(c + p + d), c += p + d;
456
+ r ? l.marginLeft + l.marginRight : l.marginTop + l.marginBottom
457
+ ), p = r ? s.offsetWidth : s.offsetHeight;
458
+ H.push(c + p + d), c += p + d;
475
459
  });
476
460
  };
477
- function Fe(e) {
461
+ function Te(e) {
478
462
  const t = window.getComputedStyle(e).display, n = window.getComputedStyle(e).flexDirection;
479
463
  if (t === "flex")
480
464
  return n === "column" || n === "column-reverse" ? "vertical" : "horizontal";
481
465
  if (t === "grid") {
482
- const a = window.getComputedStyle(e).gridTemplateRows, r = window.getComputedStyle(e).gridTemplateColumns;
483
- if (a.includes("auto"))
484
- return "vertical";
466
+ const r = window.getComputedStyle(e).gridTemplateRows, a = window.getComputedStyle(e).gridTemplateColumns;
485
467
  if (r.includes("auto"))
468
+ return "vertical";
469
+ if (a.includes("auto"))
486
470
  return "horizontal";
487
471
  }
488
472
  return t === "block" ? "vertical" : "horizontal";
489
473
  }
490
- const hn = be((e) => {
491
- const t = e.target, n = Fe(t);
474
+ const dn = xe((e) => {
475
+ const t = e.target, n = Te(t);
492
476
  if (n === "vertical") {
493
- const a = e.clientY - t.offsetTop;
494
- me(t, n, a);
477
+ const r = e.clientY - t.offsetTop;
478
+ he(t, n, r);
495
479
  } else {
496
- const a = e.clientX - t.offsetLeft;
497
- me(t, n, a);
480
+ const r = e.clientX - t.offsetLeft;
481
+ he(t, n, r);
498
482
  }
499
- }, 200), mn = (e) => {
500
- e.preventDefault(), e.stopPropagation(), hn(e);
483
+ }, 200), pn = (e) => {
484
+ e.preventDefault(), e.stopPropagation(), dn(e);
501
485
  };
502
- function Q() {
486
+ function Z() {
503
487
  const e = _ == null ? void 0 : _.getElementById("placeholder");
504
488
  e.style.display = "none";
505
489
  }
506
- const gn = () => {
507
- const { document: e } = Z(), [t, n] = C(it), a = dn(), r = Ae("dnd"), [, i] = L(), [, c] = S();
490
+ const un = () => {
491
+ const { document: e } = J(), [t, n] = C(Bt), r = an(), a = Ie("dnd"), [, i] = L(), [, c] = S();
508
492
  return _ = e, {
509
493
  isDragging: t,
510
494
  "data-dnd": "branch",
511
- onDragOver: r ? mn : R,
512
- onDrop: r ? (s) => {
495
+ onDragOver: a ? pn : $,
496
+ onDrop: a ? (s) => {
513
497
  P == null || P.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
514
498
  const l = JSON.parse(s.dataTransfer.getData("text/plain"));
515
499
  let d = s.target.getAttribute("data-block-id");
516
- d === null && (d = s.target.parentElement.getAttribute("data-block-id")), a({ block: l, dropTargetId: d || null, relativeIndex: Re }), n(!1), Q(), setTimeout(() => {
517
- Q();
500
+ d === null && (d = s.target.parentElement.getAttribute("data-block-id")), r({ block: l, dropTargetId: d || null, relativeIndex: Me }), n(!1), Z(), setTimeout(() => {
501
+ Z();
518
502
  }, 300);
519
- } : R,
520
- onDragEnter: r ? (s) => {
503
+ } : $,
504
+ onDragEnter: a ? (s) => {
521
505
  const l = s;
522
- P = l.target, l.stopPropagation(), l.preventDefault(), O = [];
506
+ P = l.target, l.stopPropagation(), l.preventDefault(), H = [];
523
507
  const d = l.target;
524
- un(d), d.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), i(""), c([]);
525
- } : R,
526
- onDragLeave: r ? (s) => {
508
+ cn(d), d.classList.add("outline", "outline-green-300", "outline-2", "-outline-offset-2"), n(!0), i(""), c([]);
509
+ } : $,
510
+ onDragLeave: a ? (s) => {
527
511
  const l = s;
528
512
  P = null, l.stopPropagation(), l.preventDefault(), l.target.classList.remove("outline", "outline-green-300", "outline-2", "-outline-offset-2");
529
- } : R,
530
- onMouseOut: r ? () => {
531
- n(!1), Q();
532
- } : R
513
+ } : $,
514
+ onMouseOut: a ? () => {
515
+ n(!1), Z();
516
+ } : $
533
517
  };
534
518
  };
535
- function se(e) {
519
+ function oe(e) {
536
520
  return e.getAttribute("data-block-id") ? e : e.closest("[data-block-id]");
537
521
  }
538
- function fn(e) {
522
+ function hn(e) {
539
523
  e.container.innerHTML = "", e.container.parentNode.removeChild(e.container);
540
524
  var t = document.querySelector(".ql-toolbar");
541
525
  t && t.parentNode.removeChild(t), e = null;
542
526
  }
543
- const xn = () => {
544
- const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = Tt(), [, n] = L(), [a, r] = C(F);
527
+ const mn = () => {
528
+ const e = ["Heading", "Paragraph", "Text", "Link", "Span", "Button"], t = Dt(), [, n] = L(), [r, a] = C(F);
545
529
  return (i) => {
546
530
  var m;
547
- if (a)
531
+ if (r)
548
532
  return;
549
- const c = se(i.target), s = c.getAttribute("data-block-type");
533
+ const c = oe(i.target), s = c.getAttribute("data-block-type");
550
534
  if (!s || !e.includes(s))
551
535
  return;
552
536
  const l = c.cloneNode(!0);
@@ -556,17 +540,17 @@ const xn = () => {
556
540
  const d = new Lt(l, { placeholder: "Type here..." });
557
541
  function p() {
558
542
  const g = d.getText(0, d.getLength());
559
- t([c.getAttribute("data-block-id")], { content: g }), c.removeAttribute("style"), l.removeEventListener("blur", p, !0), fn(d), r(""), n("");
543
+ t([c.getAttribute("data-block-id")], { content: g }), c.removeAttribute("style"), l.removeEventListener("blur", p, !0), hn(d), a(""), n("");
560
544
  }
561
- l.addEventListener("blur", p, !0), d.focus(), (m = l.querySelector(".ql-clipboard")) == null || m.remove(), r(c.getAttribute("data-block-id"));
545
+ l.addEventListener("blur", p, !0), d.focus(), (m = l.querySelector(".ql-clipboard")) == null || m.remove(), a(c.getAttribute("data-block-id"));
562
546
  };
563
- }, yn = () => {
564
- const [, e] = T(), [, t] = S(), [, n] = L(), [a] = C(F);
565
- return (r) => {
566
- if (a)
547
+ }, gn = () => {
548
+ const [, e] = T(), [, t] = S(), [, n] = L(), [r] = C(F);
549
+ return (a) => {
550
+ if (r)
567
551
  return;
568
- r.stopPropagation();
569
- const i = se(r.target);
552
+ a.stopPropagation();
553
+ const i = oe(a.target);
570
554
  if (i != null && i.getAttribute("data-block-id") && (i == null ? void 0 : i.getAttribute("data-block-id")) === "container") {
571
555
  t([]), e([]), n("");
572
556
  return;
@@ -578,31 +562,31 @@ const xn = () => {
578
562
  i != null && i.getAttribute("data-block-id") && t([i.getAttribute("data-block-id")]);
579
563
  n("");
580
564
  };
581
- }, vn = be((e, t) => {
582
- const n = se(e.target);
565
+ }, fn = xe((e, t) => {
566
+ const n = oe(e.target);
583
567
  n != null && n.getAttribute("data-style-id") && t(n.getAttribute("data-style-id"));
584
- }, 100), bn = () => {
568
+ }, 100), xn = () => {
585
569
  const [, e] = L(), [t] = C(F);
586
570
  return (n) => {
587
- t || vn(n, e);
571
+ t || fn(n, e);
588
572
  };
589
- }, kn = ({ children: e }) => {
590
- const { document: t } = Z(), [n] = S(), [a, r] = T();
591
- k(() => {
573
+ }, yn = ({ children: e }) => {
574
+ const { document: t } = J(), [n] = S(), [r, a] = T();
575
+ j(() => {
592
576
  setTimeout(() => {
593
- if (!A(a))
577
+ if (!N(r))
594
578
  return;
595
- const d = Pe(t, W(n));
579
+ const d = Le(t, W(n));
596
580
  if (d) {
597
581
  const p = d.getAttribute("data-style-prop");
598
582
  if (p) {
599
583
  const m = d.getAttribute("data-style-id"), g = d.getAttribute("data-block-parent");
600
- r([{ id: m, prop: p, blockId: g }]);
584
+ a([{ id: m, prop: p, blockId: g }]);
601
585
  }
602
586
  }
603
587
  }, 100);
604
- }, [t, n, r, a]);
605
- const i = xn(), c = yn(), s = bn(), l = gn();
588
+ }, [t, n, a, r]);
589
+ const i = mn(), c = gn(), s = xn(), l = un();
606
590
  return /* @__PURE__ */ o.jsx(
607
591
  "div",
608
592
  {
@@ -611,25 +595,25 @@ const xn = () => {
611
595
  onClick: c,
612
596
  onDoubleClick: i,
613
597
  onMouseMove: s,
614
- ...We(l, "isDragging"),
598
+ ...He(l, "isDragging"),
615
599
  className: "relative mb-5 h-full max-w-full " + (l.isDragging ? "dragging" : ""),
616
600
  children: e
617
601
  }
618
602
  );
619
- }, Pe = (e, t) => e.querySelector(`[data-block-id="${t}"]`), wn = () => {
620
- const { window: e } = Z(), [t, n] = S(), [a] = ne(), [, r] = T(), { undo: i, redo: c } = je(), s = Ce(), [, l] = Be(), d = De(), { savePage: p } = rt(), [m] = C(F), [, g] = C(at), w = (f) => {
603
+ }, Le = (e, t) => e.querySelector(`[data-block-id="${t}"]`), vn = () => {
604
+ const { window: e } = J(), [t, n] = S(), [r] = ne(), [, a] = T(), { undo: i, redo: c } = ve(), s = we(), [, l] = je(), d = Ce(), { savePage: p } = It(), [m] = C(F), [, g] = C(St), k = (f) => {
621
605
  f.key === "Enter" && (f.preventDefault(), t.length === 1 && g(W(t)));
622
606
  }, B = (f) => {
623
- const h = a.find((b) => b._id === f);
607
+ const h = r.find((b) => b._id === f);
624
608
  return h ? h._parent : null;
625
609
  };
626
- return k(() => {
610
+ return j(() => {
627
611
  const f = (h) => {
628
612
  if (h.key === "Escape") {
629
- n([]), r([]);
613
+ n([]), a([]);
630
614
  return;
631
615
  }
632
- if (w(h), !m && (h.key === "Delete" || h.key === "Backspace") && (h.preventDefault(), d(t)), h.ctrlKey || h.metaKey) {
616
+ if (k(h), !m && (h.key === "Delete" || h.key === "Backspace") && (h.preventDefault(), d(t)), h.ctrlKey || h.metaKey) {
633
617
  if (h.key === "ArrowUp") {
634
618
  h.preventDefault();
635
619
  const b = t.length > 0 ? B(t[0]) : null;
@@ -647,34 +631,34 @@ const xn = () => {
647
631
  e.removeEventListener("keydown", f);
648
632
  };
649
633
  }, [t, n, i, d, l, c, s, m, p, e]), null;
650
- }, jn = ({ block: e, label: t }) => {
651
- const [, n] = S(), [, a] = L(), [, r] = C(Ie), i = Ae("dnd");
634
+ }, bn = ({ block: e, label: t }) => {
635
+ const [, n] = S(), [, r] = L(), [, a] = C(Be), i = Ie("dnd");
652
636
  return /* @__PURE__ */ o.jsxs(
653
637
  "div",
654
638
  {
655
639
  className: "mr-10 flex cursor-grab items-center space-x-1 px-1",
656
640
  draggable: i ? "true" : "false",
657
641
  onDragStart: (c) => {
658
- c.dataTransfer.setData("text/plain", JSON.stringify(Ke(e, ["_id", "_type"]))), r(e._id), setTimeout(() => {
659
- n([]), a(null);
642
+ c.dataTransfer.setData("text/plain", JSON.stringify(ze(e, ["_id", "_type"]))), a(e._id), setTimeout(() => {
643
+ n([]), r(null);
660
644
  }, 200);
661
645
  },
662
646
  children: [
663
- /* @__PURE__ */ o.jsx(nt, {}),
647
+ /* @__PURE__ */ o.jsx(Ge, {}),
664
648
  t
665
649
  ]
666
650
  }
667
651
  );
668
- }, Cn = ({ selectedBlockElement: e, block: t }) => {
669
- const n = De(), a = Ce(), [, r] = S(), [, i] = T(), [c] = C(F), { floatingStyles: s, refs: l, update: d } = Ft({
652
+ }, kn = ({ selectedBlockElement: e, block: t }) => {
653
+ const n = Ce(), r = we(), [, a] = S(), [, i] = T(), [c] = C(F), { floatingStyles: s, refs: l, update: d } = $t({
670
654
  placement: "top-start",
671
- middleware: [Pt(), Rt()],
655
+ middleware: [Ft(), Rt()],
672
656
  elements: {
673
657
  reference: e
674
658
  }
675
659
  });
676
- zt(e, () => d(), e !== null);
677
- const p = y(t, "_parent", null), m = A(y(t, "_name", "")) ? y(t, "_type", "") : y(t, "_name", "");
660
+ Pt(e, () => d(), e !== null);
661
+ const p = y(t, "_parent", null), m = N(y(t, "_name", "")) ? y(t, "_type", "") : y(t, "_name", "");
678
662
  return !e || !t || c ? null : /* @__PURE__ */ o.jsxs(
679
663
  "div",
680
664
  {
@@ -688,58 +672,58 @@ const xn = () => {
688
672
  onKeyDown: (g) => g.stopPropagation(),
689
673
  className: "z-[99999] flex h-6 items-center bg-blue-500 py-2 text-xs text-white",
690
674
  children: [
691
- /* @__PURE__ */ o.jsx(jn, { label: m, block: t }),
675
+ /* @__PURE__ */ o.jsx(bn, { label: m, block: t }),
692
676
  /* @__PURE__ */ o.jsxs("div", { className: "flex gap-2 px-1", children: [
693
677
  p && /* @__PURE__ */ o.jsx(
694
678
  Xe,
695
679
  {
696
680
  className: "hover:scale-105",
697
681
  onClick: () => {
698
- i([]), r([p]);
682
+ i([]), a([p]);
699
683
  }
700
684
  }
701
685
  ),
702
- Ht(y(t, "_type", "")) ? /* @__PURE__ */ o.jsx(et, { className: "hover:scale-105", onClick: () => a([t == null ? void 0 : t._id]) }) : null,
703
- Ot(y(t, "_type", "")) ? /* @__PURE__ */ o.jsx(tt, { className: "hover:scale-105", onClick: () => n([t == null ? void 0 : t._id]) }) : null
686
+ _t(y(t, "_type", "")) ? /* @__PURE__ */ o.jsx(et, { className: "hover:scale-105", onClick: () => r([t == null ? void 0 : t._id]) }) : null,
687
+ Nt(y(t, "_type", "")) ? /* @__PURE__ */ o.jsx(tt, { className: "hover:scale-105", onClick: () => n([t == null ? void 0 : t._id]) }) : null
704
688
  ] })
705
689
  ]
706
690
  }
707
691
  );
708
- }, Bn = ({ model: e }) => {
709
- const [t] = lt(), [n] = S(), [a] = Se(), [r] = L(), [i] = T(), [c] = C(Ie), { document: s, window: l } = Z(), [d] = I(s == null ? void 0 : s.getElementById("highlighted-block")), [p] = I(
692
+ }, wn = ({ model: e }) => {
693
+ const [t] = At(), [n] = S(), [r] = be(), [a] = L(), [i] = T(), [c] = C(Be), { document: s, window: l } = J(), [d] = I(s == null ? void 0 : s.getElementById("highlighted-block")), [p] = I(
710
694
  s == null ? void 0 : s.getElementById("selected-block")
711
695
  ), [m] = I(
712
696
  s == null ? void 0 : s.getElementById("selected-styling-block")
713
697
  ), [g] = I(s == null ? void 0 : s.getElementById("dragged-block"));
714
- k(() => {
715
- a ? s == null || s.documentElement.classList.add("dark") : s == null || s.documentElement.classList.remove("dark");
716
- }, [a, s]);
717
- const w = y(t, "headingFont", "DM Sans"), B = y(t, "bodyFont", "DM Sans");
718
- return k(() => {
719
- const f = y(t, "primaryColor", "#000"), h = y(t, "secondaryColor", "#FFF"), b = Ut({
698
+ j(() => {
699
+ r ? s == null || s.documentElement.classList.add("dark") : s == null || s.documentElement.classList.remove("dark");
700
+ }, [r, s]);
701
+ const k = y(t, "headingFont", "DM Sans"), B = y(t, "bodyFont", "DM Sans");
702
+ return j(() => {
703
+ const f = y(t, "primaryColor", "#000"), h = y(t, "secondaryColor", "#FFF"), b = Ot({
720
704
  colors: [f, h],
721
705
  names: ["primary", "secondary"]
722
706
  });
723
707
  b.primary.DEFAULT = f, b.secondary.DEFAULT = h;
724
- const $ = y(t, "roundedCorners", "0");
708
+ const R = y(t, "roundedCorners", "0");
725
709
  !l || !l.tailwind || (l.tailwind.config = {
726
710
  darkMode: "class",
727
711
  theme: {
728
712
  fontFamily: {
729
- heading: [w],
713
+ heading: [k],
730
714
  body: [B]
731
715
  },
732
716
  extend: {
733
717
  borderRadius: {
734
- global: `${$ || "0"}px`
718
+ global: `${R || "0"}px`
735
719
  },
736
720
  colors: b
737
721
  }
738
722
  },
739
723
  plugins: [
740
- Wt,
741
- Kt,
742
- qt,
724
+ Ht,
725
+ zt,
726
+ Ut,
743
727
  l.tailwind.plugin.withOptions(() => ({ addVariant: z, e: D }) => {
744
728
  z("hs-accordion-active", [
745
729
  ({ modifySelectors: v, separator: u }) => {
@@ -774,40 +758,40 @@ const xn = () => {
774
758
  })
775
759
  ]
776
760
  });
777
- }, [t, l, w, B]), k(() => {
778
- p && (p.textContent = `${H(n, (f) => `[data-block-id="${f}"]`).join(",")}{
761
+ }, [t, l, k, B]), j(() => {
762
+ p && (p.textContent = `${O(n, (f) => `[data-block-id="${f}"]`).join(",")}{
779
763
  outline: 1px solid ${n.length === 1 ? "#42a1fc" : "orange"} !important; outline-offset: -1px;
780
764
  }`);
781
- }, [n, p]), k(() => {
765
+ }, [n, p]), j(() => {
782
766
  if (!c) {
783
767
  g.textContent = "";
784
768
  return;
785
769
  }
786
770
  g.textContent = `[data-block-id="${c}"]{ pointer-events: none !important; opacity: 0.2 !important}`;
787
- }, [c]), k(() => {
788
- d && (d.textContent = r ? `[data-style-id="${r}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
789
- }, [r, n, d]), k(() => {
790
- m && (m.textContent = `${H(i, ({ id: f }) => `[data-style-id="${f}"]`).join(",")}{
771
+ }, [c]), j(() => {
772
+ d && (d.textContent = a ? `[data-style-id="${a}"]{ outline: 1px solid #42a1fc !important; outline-offset: -1px;}` : "");
773
+ }, [a, n, d]), j(() => {
774
+ m && (m.textContent = `${O(i, ({ id: f }) => `[data-style-id="${f}"]`).join(",")}{
791
775
  outline: 1px solid #42a1fc !important; outline-offset: -1px;
792
776
  }`);
793
- }, [i, m]), k(() => {
794
- const f = y(t, "bodyTextLightColor", "#64748b"), h = y(t, "bodyTextDarkColor", "#94a3b8"), b = y(t, "bodyBgLightColor", "#FFFFFF"), $ = y(t, "bodyBgDarkColor", "#0f172a");
795
- s.body.className = `font-body antialiased text-[${f}] bg-[${b}] dark:text-[${h}] dark:bg-[${$}]`;
777
+ }, [i, m]), j(() => {
778
+ const f = y(t, "bodyTextLightColor", "#64748b"), h = y(t, "bodyTextDarkColor", "#94a3b8"), b = y(t, "bodyBgLightColor", "#FFFFFF"), R = y(t, "bodyBgDarkColor", "#0f172a");
779
+ s.body.className = `font-body antialiased text-[${f}] bg-[${b}] dark:text-[${h}] dark:bg-[${R}]`;
796
780
  }, [t, s, e]), e === "page" ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
797
- w && /* @__PURE__ */ o.jsx(
781
+ k && /* @__PURE__ */ o.jsx(
798
782
  "link",
799
783
  {
800
784
  id: "heading-font",
801
785
  rel: "stylesheet",
802
786
  type: "text/css",
803
- href: `https://fonts.googleapis.com/css2?family=${w.replace(
787
+ href: `https://fonts.googleapis.com/css2?family=${k.replace(
804
788
  / /g,
805
789
  "+"
806
790
  )}:wght@300;400;500;600;700;800;900&display=swap`,
807
791
  media: "all"
808
792
  }
809
793
  ),
810
- B && w !== B && /* @__PURE__ */ o.jsx(
794
+ B && k !== B && /* @__PURE__ */ o.jsx(
811
795
  "link",
812
796
  {
813
797
  id: "body-font",
@@ -820,93 +804,93 @@ const xn = () => {
820
804
  media: "all"
821
805
  }
822
806
  ),
823
- w && /* @__PURE__ */ o.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${w}",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";}` })
807
+ k && /* @__PURE__ */ o.jsx("style", { children: `h1,h2,h3,h4,h5,h6{font-family: "${k}",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";}` })
824
808
  ] }) : null;
825
- }, Dn = (e) => {
809
+ }, jn = (e) => {
826
810
  const t = {};
827
811
  return Object.keys(e).forEach((n) => {
828
- te(e[n]) && e[n].startsWith(de) && (t[n] = e[n].replace(de, "").split(","));
812
+ ee(e[n]) && e[n].startsWith(de) && (t[n] = e[n].replace(de, "").split(","));
829
813
  }), t;
830
- }, In = qe((e) => {
831
- const t = e.replace(Ne, "").split(",");
832
- return Yt(t[0], t[1]);
814
+ }, Cn = Ue((e) => {
815
+ const t = e.replace(Se, "").split(",");
816
+ return qt(t[0], t[1]);
833
817
  });
834
- function Sn(e, t) {
818
+ function Bn(e, t) {
835
819
  return y(e, `${t}_attrs`, {});
836
820
  }
837
- function _n(e) {
821
+ function Dn(e) {
838
822
  const t = {};
839
823
  return Object.keys(e).forEach((n) => {
840
- if (te(e[n]) && e[n].startsWith(Ne)) {
841
- const a = In(e[n]);
824
+ if (ee(e[n]) && e[n].startsWith(Se)) {
825
+ const r = Cn(e[n]);
842
826
  t[n] = {
843
- className: a,
827
+ className: r,
844
828
  "data-style-prop": n,
845
829
  "data-block-parent": e._id,
846
830
  "data-style-id": `${n}-${e._id}`,
847
- ...Sn(e, n)
831
+ ...Bn(e, n)
848
832
  };
849
833
  }
850
834
  }), t;
851
835
  }
852
- function An(e, t) {
836
+ function In(e, t) {
853
837
  const n = y(e, "_bindings", {});
854
- return A(n) ? { ...e } : (G(n, (a, r) => {
855
- te(a) && y(t, a, null) && (e[r] = y(t, a, null));
838
+ return N(n) ? { ...e } : (We(n, (r, a) => {
839
+ ee(r) && y(t, r, null) && (e[a] = y(t, r, null));
856
840
  }), e);
857
841
  }
858
- function ee({ blocks: e }) {
859
- const [t] = ne(), n = q((i) => _n(i), []), [a] = Ee(), [r] = C(F);
842
+ function X({ blocks: e }) {
843
+ const [t] = ne(), n = K((i) => Dn(i), []), [r] = Vt(), [a] = C(F);
860
844
  return /* @__PURE__ */ o.jsx(o.Fragment, { children: M.Children.toArray(
861
845
  e.map((i, c) => {
862
- if (r === i._id)
846
+ if (a === i._id)
863
847
  return null;
864
- const s = Dn(i), l = {};
865
- A(s) || Object.keys(s).forEach((g) => {
848
+ const s = jn(i), l = {};
849
+ N(s) || Object.keys(s).forEach((g) => {
866
850
  l[g] = M.Children.toArray(
867
- s[g].map((w) => /* @__PURE__ */ o.jsx(ee, { blocks: [ye(t, { _id: w })] }))
851
+ s[g].map((k) => /* @__PURE__ */ o.jsx(X, { blocks: [qe(t, { _id: k })] }))
868
852
  );
869
853
  });
870
- const d = ke(t, { _parent: i._id });
871
- l.children = d.length ? /* @__PURE__ */ o.jsx(ee, { blocks: d }) : null;
872
- const p = Jt(i._type), m = y(p, "builderComponent", y(p, "component", null));
873
- return Ve(m) ? /* @__PURE__ */ o.jsx("noscript", { children: `<!-- ${i == null ? void 0 : i._type} not registered -->` }) : /* @__PURE__ */ o.jsx(xe, { children: M.createElement(m, {
854
+ const d = ye(t, { _parent: i._id });
855
+ l.children = d.length ? /* @__PURE__ */ o.jsx(X, { blocks: d }) : null;
856
+ const p = Kt(i._type), m = y(p, "builderComponent", y(p, "component", null));
857
+ return Ke(m) ? /* @__PURE__ */ o.jsx("noscript", { children: `<!-- ${i == null ? void 0 : i._type} not registered -->` }) : /* @__PURE__ */ o.jsx(ge, { children: M.createElement(m, {
874
858
  blockProps: {
875
859
  "data-block-id": i._id,
876
860
  "data-block-type": i._type,
877
- "data-dnd": ve(p, "canAcceptBlock") ? "branch" : "leaf"
861
+ "data-dnd": fe(p, "canAcceptBlock") ? "branch" : "leaf"
878
862
  },
879
863
  inBuilder: !0,
880
864
  index: c,
881
- ...An(i, a),
865
+ ...In(i, r),
882
866
  ...n(i),
883
867
  ...l
884
868
  }) });
885
869
  })
886
870
  ) });
887
871
  }
888
- const Nn = () => {
889
- const [e] = ne(), t = A(e) ? null : /* @__PURE__ */ o.jsx(Gt, { children: /* @__PURE__ */ o.jsx(ee, { blocks: ke(e, (n) => A(n._parent)) }) });
890
- return /* @__PURE__ */ o.jsx(Vt, { children: t });
891
- }, En = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Mn = () => {
892
- const [e] = C(ct), [t] = Be(), [n] = oe(), [, a] = S(), r = dt(), [, i] = L(), c = re(null), s = re(null), [l, d] = I({ width: 0, height: 0 }), p = an(l), [m, g] = I(0), [w, B] = I([]), [, f] = I([]), [, h] = C(pt), [b, $] = T(), z = V("loading", !1);
893
- k(() => {
872
+ const Sn = () => {
873
+ const [e] = ne(), t = N(e) ? null : /* @__PURE__ */ o.jsx(Yt, { children: /* @__PURE__ */ o.jsx(X, { blocks: ye(e, (n) => N(n._parent)) }) });
874
+ return /* @__PURE__ */ o.jsx(Wt, { children: t });
875
+ }, _n = (e, t) => e.querySelector(`[data-style-id="${t}"]`), Nn = () => {
876
+ const [e] = C(Et), [t] = je(), [n] = te(), [, r] = S(), a = Mt(), [, i] = L(), c = ie(null), s = ie(null), [l, d] = I({ width: 0, height: 0 }), p = on(l), [m, g] = I(0), [k, B] = I([]), [, f] = I([]), [, h] = C(Tt), [b, R] = T(), z = V("loading", !1);
877
+ j(() => {
894
878
  const { clientWidth: u, clientHeight: x } = s.current;
895
879
  d({ width: u, height: x }), m === 0 && g(u);
896
880
  }, [s, n, m]);
897
881
  const D = (u, x = 0) => {
898
- const { top: N } = u.getBoundingClientRect();
899
- return N + x >= 0 && N - x <= window.innerHeight;
882
+ const { top: A } = u.getBoundingClientRect();
883
+ return A + x >= 0 && A - x <= window.innerHeight;
900
884
  };
901
- k(() => {
885
+ j(() => {
902
886
  var u, x;
903
- if (r && r.type !== "Multiple" && c.current) {
904
- const N = Pe(c.current.contentDocument, r._id);
905
- N && (D(N) || (x = (u = c.current) == null ? void 0 : u.contentWindow) == null || x.scrollTo({ top: N.offsetTop, behavior: "smooth" }), B([N]));
887
+ if (a && a.type !== "Multiple" && c.current) {
888
+ const A = Le(c.current.contentDocument, a._id);
889
+ A && (D(A) || (x = (u = c.current) == null ? void 0 : u.contentWindow) == null || x.scrollTo({ top: A.offsetTop, behavior: "smooth" }), B([A]));
906
890
  }
907
- }, [r]), k(() => {
908
- if (!A(b) && c.current) {
909
- const u = En(
891
+ }, [a]), j(() => {
892
+ if (!N(b) && c.current) {
893
+ const u = _n(
910
894
  c.current.contentDocument,
911
895
  W(b).id
912
896
  );
@@ -914,8 +898,8 @@ const Nn = () => {
914
898
  } else
915
899
  f([null]);
916
900
  }, [b]);
917
- const v = ge(() => {
918
- let u = rn;
901
+ const v = Pe(() => {
902
+ let u = nn;
919
903
  return e === "offline" && (u = u.replace(
920
904
  "https://old.chaibuilder.com/offline/tailwind.cdn.js",
921
905
  "/offline/tailwind.cdn.js"
@@ -925,14 +909,14 @@ const Nn = () => {
925
909
  "div",
926
910
  {
927
911
  onClick: () => {
928
- a([]), $([]);
912
+ r([]), R([]);
929
913
  },
930
914
  onMouseLeave: () => setTimeout(() => i(""), 300),
931
915
  className: "relative mx-auto h-full w-full overflow-hidden",
932
- style: m > 0 && !A(p) ? { width: t ? "100%" : m } : {},
916
+ style: m > 0 && !N(p) ? { width: t ? "100%" : m } : {},
933
917
  ref: s,
934
918
  children: /* @__PURE__ */ o.jsxs(
935
- cn,
919
+ rn,
936
920
  {
937
921
  contentDidMount: () => h(c.current),
938
922
  ref: c,
@@ -941,16 +925,16 @@ const Nn = () => {
941
925
  className: "relative mx-auto box-content h-full max-w-full shadow-lg transition-all duration-300 ease-linear",
942
926
  initialContent: v,
943
927
  children: [
944
- /* @__PURE__ */ o.jsx(wn, {}),
928
+ /* @__PURE__ */ o.jsx(vn, {}),
945
929
  /* @__PURE__ */ o.jsx(
946
- Cn,
930
+ kn,
947
931
  {
948
- block: r,
949
- selectedBlockElement: W(w)
932
+ block: a,
933
+ selectedBlockElement: W(k)
950
934
  }
951
935
  ),
952
- /* @__PURE__ */ o.jsx(Bn, { model: "page" }),
953
- /* @__PURE__ */ o.jsx(kn, { children: z ? /* @__PURE__ */ o.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ o.jsx(we, { className: "h-full" }) }) : /* @__PURE__ */ o.jsx(Nn, {}) }),
936
+ /* @__PURE__ */ o.jsx(wn, { model: "page" }),
937
+ /* @__PURE__ */ o.jsx(yn, { children: z ? /* @__PURE__ */ o.jsx("div", { className: "h-full p-4", children: /* @__PURE__ */ o.jsx(De, { className: "h-full" }) }) : /* @__PURE__ */ o.jsx(Sn, {}) }),
954
938
  /* @__PURE__ */ o.jsx("br", {}),
955
939
  /* @__PURE__ */ o.jsx("div", { id: "placeholder", className: "absolute z-[99999] max-w-full bg-green-500 transition-transform" })
956
940
  ]
@@ -958,10 +942,10 @@ const Nn = () => {
958
942
  )
959
943
  }
960
944
  );
961
- }, Lo = () => /* @__PURE__ */ o.jsxs("div", { className: "flex h-full w-full flex-col", children: [
962
- /* @__PURE__ */ o.jsx(sn, {}),
963
- /* @__PURE__ */ o.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ o.jsx(xe, { fallback: /* @__PURE__ */ o.jsx(we, { className: "h-full" }), children: /* @__PURE__ */ o.jsx(ut, { children: /* @__PURE__ */ o.jsx(Mn, {}) }) }) })
945
+ }, Ao = () => /* @__PURE__ */ o.jsxs("div", { className: "flex h-full w-full flex-col", children: [
946
+ /* @__PURE__ */ o.jsx(tn, {}),
947
+ /* @__PURE__ */ o.jsx("div", { className: "relative h-full overflow-hidden bg-slate-800/90 bg-[linear-gradient(to_right,#222_0.5px,transparent_0.5px),linear-gradient(to_bottom,#222_0.5px,transparent_0.5px)] bg-[size:12px_12px] px-2", children: /* @__PURE__ */ o.jsx(ge, { fallback: /* @__PURE__ */ o.jsx(De, { className: "h-full" }), children: /* @__PURE__ */ o.jsx(Jt, { children: /* @__PURE__ */ o.jsx(Nn, {}) }) }) })
964
948
  ] });
965
949
  export {
966
- Lo as default
950
+ Ao as default
967
951
  };