@chaibuilder/sdk 1.2.23 → 1.2.25

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