@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,3079 +0,0 @@
1
- import * as f from "react";
2
- import et, { createContext as Ds, useContext as Es, useRef as hr, createElement as vr, useReducer as Os, useEffect as Ae, useDebugValue as Ls, useCallback as $, useMemo as zs, useState as Ce, Suspense as vt } from "react";
3
- import { memoize as Oe, has as pe, get as J, flatten as re, filter as E, isString as Lt, find as oe, map as I, omit as tt, each as ce, set as je, includes as Y, isUndefined as wr, without as zt, isEmpty as _e, forIn as Vt, isObject as Vs, first as ee, noop as $s, keys as Fs, startsWith as $t, isNull as qe, pick as yt, sortBy as wt } from "lodash-es";
4
- import { g as de, a as Us } from "./Functions-7jnEwJyw.js";
5
- import { getBlockComponent as Le } from "@chaibuilder/runtime";
6
- import { atom as w, useAtomValue as te, useAtom as O, useSetAtom as Be } from "jotai";
7
- import { a as fe, I as Ft, S as Ke } from "./STRINGS--j49GZJP.js";
8
- import { g as Ws } from "./_commonjsHelpers-UyOWmZb0.js";
9
- import { useThrottledCallback as Gs } from "@react-hookz/web";
10
- import { B as Je } from "./MODIFIERS-dytZ-osO.js";
11
- import { j as a } from "./jsx-runtime-WbnYoNE9.js";
12
- import * as Ut from "@radix-ui/react-toggle";
13
- import { cva as ge } from "class-variance-authority";
14
- import { a as d, c as Ie } from "./Class-lGzsNBOK.js";
15
- import * as Ye from "@radix-ui/react-switch";
16
- import { Slot as Hs } from "@radix-ui/react-slot";
17
- import * as me from "@radix-ui/react-accordion";
18
- import { ChevronDownIcon as qs, Cross2Icon as st, ChevronRightIcon as ot, CheckIcon as ze, DotFilledIcon as nt, CaretSortIcon as Ks, MagnifyingGlassIcon as Js } from "@radix-ui/react-icons";
19
- import * as H from "@radix-ui/react-alert-dialog";
20
- import * as P from "@radix-ui/react-dialog";
21
- import * as Wt from "@radix-ui/react-label";
22
- import * as ue from "@radix-ui/react-scroll-area";
23
- import * as be from "@radix-ui/react-tabs";
24
- import * as ve from "@radix-ui/react-tooltip";
25
- import * as Se from "@radix-ui/react-popover";
26
- import * as B from "@radix-ui/react-menubar";
27
- import * as Ve from "@radix-ui/react-hover-card";
28
- import * as U from "@radix-ui/react-select";
29
- import * as M from "@radix-ui/react-dropdown-menu";
30
- import * as Gt from "@radix-ui/react-separator";
31
- import * as Z from "@radix-ui/react-toast";
32
- import { Command as Q } from "cmdk";
33
- import * as D from "@radix-ui/react-context-menu";
34
- import Ys, { IconPickerItem as Qs } from "react-icons-picker";
35
- import Xs from "react-dom";
36
- import Zs from "react-quill";
37
- import "react-i18next";
38
- var W = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
39
- let eo = 0;
40
- function ae(e, t) {
41
- const s = `atom${++eo}`, o = {
42
- toString: () => s
43
- };
44
- return typeof e == "function" ? o.read = e : (o.init = e, o.read = (n) => n(o), o.write = (n, i, r) => i(
45
- o,
46
- typeof r == "function" ? r(n(o)) : r
47
- )), t && (o.write = t), o;
48
- }
49
- const Fe = (e) => "init" in e, Ue = (e) => !!e.write, Ee = /* @__PURE__ */ new WeakMap(), to = (e, t) => {
50
- Ee.set(e, t), e.catch(() => {
51
- }).finally(() => Ee.delete(e));
52
- }, Nt = (e, t) => {
53
- const s = Ee.get(e);
54
- s && (Ee.delete(e), s(t));
55
- }, kt = (e, t) => {
56
- e.status = "fulfilled", e.value = t;
57
- }, jt = (e, t) => {
58
- e.status = "rejected", e.reason = t;
59
- }, so = (e) => typeof (e == null ? void 0 : e.then) == "function", we = (e, t) => "v" in e && "v" in t && Object.is(e.v, t.v), St = (e, t) => "e" in e && "e" in t && Object.is(e.e, t.e), he = (e) => "v" in e && e.v instanceof Promise, oo = (e, t) => "v" in e && "v" in t && e.v.orig && e.v.orig === t.v.orig, Te = (e) => {
60
- if ("e" in e)
61
- throw e.e;
62
- return e.v;
63
- }, no = () => {
64
- const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new Map();
65
- let o, n, i;
66
- (W ? "production" : void 0) !== "production" && (o = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set());
67
- const r = (u) => e.get(u), c = (u, g) => {
68
- (W ? "production" : void 0) !== "production" && Object.freeze(g);
69
- const h = e.get(u);
70
- if (e.set(u, g), s.has(u) || s.set(u, h), h && he(h)) {
71
- const b = "v" in g ? g.v instanceof Promise ? g.v : Promise.resolve(g.v) : Promise.reject(g.e);
72
- Nt(h.v, b);
73
- }
74
- }, p = (u, g, h) => {
75
- const b = /* @__PURE__ */ new Map();
76
- let y = !1;
77
- h.forEach((x, k) => {
78
- !x && k === u && (x = g), x ? (b.set(k, x), g.d.get(k) !== x && (y = !0)) : (W ? "production" : void 0) !== "production" && console.warn("[Bug] atom state not found");
79
- }), (y || g.d.size !== b.size) && (g.d = b);
80
- }, l = (u, g, h) => {
81
- const b = r(u), y = {
82
- d: (b == null ? void 0 : b.d) || /* @__PURE__ */ new Map(),
83
- v: g
84
- };
85
- if (h && p(u, y, h), b && we(b, y) && b.d === y.d)
86
- return b;
87
- if (b && he(b) && he(y) && oo(b, y)) {
88
- if (b.d === y.d)
89
- return b;
90
- y.v = b.v;
91
- }
92
- return c(u, y), y;
93
- }, m = (u, g, h, b) => {
94
- if (so(g)) {
95
- let y;
96
- const x = new Promise((k, z) => {
97
- let A = !1;
98
- g.then(
99
- (R) => {
100
- if (!A) {
101
- A = !0;
102
- const C = r(u), se = l(
103
- u,
104
- x,
105
- h
106
- );
107
- kt(x, R), k(R), (C == null ? void 0 : C.d) !== se.d && q(u, se, C == null ? void 0 : C.d);
108
- }
109
- },
110
- (R) => {
111
- if (!A) {
112
- A = !0;
113
- const C = r(u), se = l(
114
- u,
115
- x,
116
- h
117
- );
118
- jt(x, R), z(R), (C == null ? void 0 : C.d) !== se.d && q(u, se, C == null ? void 0 : C.d);
119
- }
120
- }
121
- ), y = (R) => {
122
- A || (A = !0, R.then(
123
- (C) => kt(x, C),
124
- (C) => jt(x, C)
125
- ), k(R));
126
- };
127
- });
128
- return x.orig = g, x.status = "pending", to(x, (k) => {
129
- k && y(k), b == null || b();
130
- }), l(u, x, h);
131
- }
132
- return l(u, g, h);
133
- }, N = (u, g, h) => {
134
- const b = r(u), y = {
135
- d: (b == null ? void 0 : b.d) || /* @__PURE__ */ new Map(),
136
- e: g
137
- };
138
- return h && p(u, y, h), b && St(b, y) && b.d === y.d ? b : (c(u, y), y);
139
- }, j = (u) => {
140
- const g = r(u);
141
- if (g && (g.d.forEach((A, R) => {
142
- R !== u && !t.has(R) && j(R);
143
- }), Array.from(g.d).every(([A, R]) => {
144
- const C = r(A);
145
- return A === u || C === R || // TODO This is a hack, we should find a better solution.
146
- C && !he(C) && we(C, R);
147
- })))
148
- return g;
149
- const h = /* @__PURE__ */ new Map();
150
- let b = !0;
151
- const y = (A) => {
152
- if (A === u) {
153
- const C = r(A);
154
- if (C)
155
- return h.set(A, C), Te(C);
156
- if (Fe(A))
157
- return h.set(A, void 0), A.init;
158
- throw new Error("no atom init");
159
- }
160
- const R = j(A);
161
- return h.set(A, R), Te(R);
162
- };
163
- let x, k;
164
- const z = {
165
- get signal() {
166
- return x || (x = new AbortController()), x.signal;
167
- },
168
- get setSelf() {
169
- return (W ? "production" : void 0) !== "production" && !Ue(u) && console.warn("setSelf function cannot be used with read-only atom"), !k && Ue(u) && (k = (...A) => {
170
- if ((W ? "production" : void 0) !== "production" && b && console.warn("setSelf function cannot be called in sync"), !b)
171
- return G(u, ...A);
172
- }), k;
173
- }
174
- };
175
- try {
176
- const A = u.read(y, z);
177
- return m(
178
- u,
179
- A,
180
- h,
181
- () => x == null ? void 0 : x.abort()
182
- );
183
- } catch (A) {
184
- return N(u, A, h);
185
- } finally {
186
- b = !1;
187
- }
188
- }, v = (u) => Te(j(u)), S = (u) => {
189
- let g = t.get(u);
190
- return g || (g = V(u)), g;
191
- }, L = (u, g) => !g.l.size && (!g.t.size || g.t.size === 1 && g.t.has(u)), F = (u) => {
192
- const g = t.get(u);
193
- g && L(u, g) && X(u);
194
- }, _ = (u) => {
195
- const g = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new WeakMap(), b = (x) => {
196
- const k = t.get(x);
197
- k == null || k.t.forEach((z) => {
198
- z !== x && (g.set(
199
- z,
200
- (g.get(z) || /* @__PURE__ */ new Set()).add(x)
201
- ), h.set(z, (h.get(z) || 0) + 1), b(z));
202
- });
203
- };
204
- b(u);
205
- const y = (x) => {
206
- const k = t.get(x);
207
- k == null || k.t.forEach((z) => {
208
- var A;
209
- if (z !== x) {
210
- let R = h.get(z);
211
- if (R && h.set(z, --R), !R) {
212
- let C = !!((A = g.get(z)) != null && A.size);
213
- if (C) {
214
- const se = r(z), Ms = j(z);
215
- C = !se || !we(se, Ms);
216
- }
217
- C || g.forEach((se) => se.delete(z));
218
- }
219
- y(z);
220
- }
221
- });
222
- };
223
- y(u);
224
- }, T = (u, ...g) => {
225
- let h = !0;
226
- const b = (k) => Te(j(k)), y = (k, ...z) => {
227
- let A;
228
- if (k === u) {
229
- if (!Fe(k))
230
- throw new Error("atom not writable");
231
- const R = r(k), C = m(k, z[0]);
232
- (!R || !we(R, C)) && _(k);
233
- } else
234
- A = T(k, ...z);
235
- if (!h) {
236
- const R = K();
237
- (W ? "production" : void 0) !== "production" && n.forEach(
238
- (C) => C({ type: "async-write", flushed: R })
239
- );
240
- }
241
- return A;
242
- }, x = u.write(b, y, ...g);
243
- return h = !1, x;
244
- }, G = (u, ...g) => {
245
- const h = T(u, ...g), b = K();
246
- return (W ? "production" : void 0) !== "production" && n.forEach(
247
- (y) => y({ type: "write", flushed: b })
248
- ), h;
249
- }, V = (u, g) => {
250
- const h = {
251
- t: new Set(g && [g]),
252
- l: /* @__PURE__ */ new Set()
253
- };
254
- if (t.set(u, h), (W ? "production" : void 0) !== "production" && i.add(u), j(u).d.forEach((b, y) => {
255
- const x = t.get(y);
256
- x ? x.t.add(u) : y !== u && V(y, u);
257
- }), j(u), Ue(u) && u.onMount) {
258
- const b = u.onMount((...y) => G(u, ...y));
259
- b && (h.u = b);
260
- }
261
- return h;
262
- }, X = (u) => {
263
- var g;
264
- const h = (g = t.get(u)) == null ? void 0 : g.u;
265
- h && h(), t.delete(u), (W ? "production" : void 0) !== "production" && i.delete(u);
266
- const b = r(u);
267
- b ? (he(b) && Nt(b.v), b.d.forEach((y, x) => {
268
- if (x !== u) {
269
- const k = t.get(x);
270
- k && (k.t.delete(u), L(x, k) && X(x));
271
- }
272
- })) : (W ? "production" : void 0) !== "production" && console.warn("[Bug] could not find atom state to unmount", u);
273
- }, q = (u, g, h) => {
274
- const b = new Set(g.d.keys());
275
- h == null || h.forEach((y, x) => {
276
- if (b.has(x)) {
277
- b.delete(x);
278
- return;
279
- }
280
- const k = t.get(x);
281
- k && (k.t.delete(u), L(x, k) && X(x));
282
- }), b.forEach((y) => {
283
- const x = t.get(y);
284
- x ? x.t.add(u) : t.has(u) && V(y, u);
285
- });
286
- }, K = () => {
287
- let u;
288
- for ((W ? "production" : void 0) !== "production" && (u = /* @__PURE__ */ new Set()); s.size; ) {
289
- const g = Array.from(s);
290
- s.clear(), g.forEach(([h, b]) => {
291
- const y = r(h);
292
- if (y) {
293
- y.d !== (b == null ? void 0 : b.d) && q(h, y, b == null ? void 0 : b.d);
294
- const x = t.get(h);
295
- x && !// TODO This seems pretty hacky. Hope to fix it.
296
- // Maybe we could `mountDependencies` in `setAtomState`?
297
- (b && !he(b) && (we(b, y) || St(b, y))) && (x.l.forEach((k) => k()), (W ? "production" : void 0) !== "production" && u.add(h));
298
- } else
299
- (W ? "production" : void 0) !== "production" && console.warn("[Bug] no atom state to flush");
300
- });
301
- }
302
- if ((W ? "production" : void 0) !== "production")
303
- return o.forEach((g) => g("state")), u;
304
- }, le = (u, g) => {
305
- const h = S(u), b = K(), y = h.l;
306
- return y.add(g), (W ? "production" : void 0) !== "production" && (o.forEach((x) => x("sub")), n.forEach(
307
- (x) => x({ type: "sub", flushed: b })
308
- )), () => {
309
- y.delete(g), F(u), (W ? "production" : void 0) !== "production" && (o.forEach((x) => x("unsub")), n.forEach((x) => x({ type: "unsub" })));
310
- };
311
- };
312
- return (W ? "production" : void 0) !== "production" ? {
313
- get: v,
314
- set: G,
315
- sub: le,
316
- // store dev methods (these are tentative and subject to change without notice)
317
- dev_subscribe_store: (u, g) => g !== 2 ? (console.warn(
318
- "The current StoreListener revision is 2. The older ones are deprecated."
319
- ), o.add(u), () => {
320
- o.delete(u);
321
- }) : (n.add(u), () => {
322
- n.delete(u);
323
- }),
324
- dev_get_mounted_atoms: () => i.values(),
325
- dev_get_atom_state: (u) => e.get(u),
326
- dev_get_mounted: (u) => t.get(u),
327
- dev_restore_atoms: (u) => {
328
- for (const [h, b] of u)
329
- Fe(h) && (m(h, b), _(h));
330
- const g = K();
331
- n.forEach(
332
- (h) => h({ type: "restore", flushed: g })
333
- );
334
- }
335
- } : {
336
- get: v,
337
- set: G,
338
- sub: le
339
- };
340
- };
341
- let We;
342
- const ao = () => (We || (We = no()), We);
343
- var ro = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
344
- const io = Ds(void 0), Ht = (e) => {
345
- const t = Es(io);
346
- return (e == null ? void 0 : e.store) || t || ao();
347
- };
348
- const lo = (e) => typeof (e == null ? void 0 : e.then) == "function", co = et.use || ((e) => {
349
- if (e.status === "pending")
350
- throw e;
351
- if (e.status === "fulfilled")
352
- return e.value;
353
- throw e.status === "rejected" ? e.reason : (e.status = "pending", e.then(
354
- (t) => {
355
- e.status = "fulfilled", e.value = t;
356
- },
357
- (t) => {
358
- e.status = "rejected", e.reason = t;
359
- }
360
- ), e);
361
- });
362
- function uo(e, t) {
363
- const s = Ht(t), [[o, n, i], r] = Os(
364
- (l) => {
365
- const m = s.get(e);
366
- return Object.is(l[0], m) && l[1] === s && l[2] === e ? l : [m, s, e];
367
- },
368
- void 0,
369
- () => [s.get(e), s, e]
370
- );
371
- let c = o;
372
- (n !== s || i !== e) && (r(), c = s.get(e));
373
- const p = t == null ? void 0 : t.delay;
374
- return Ae(() => {
375
- const l = s.sub(e, () => {
376
- if (typeof p == "number") {
377
- setTimeout(r, p);
378
- return;
379
- }
380
- r();
381
- });
382
- return r(), l;
383
- }, [s, e, p]), Ls(c), lo(c) ? co(c) : c;
384
- }
385
- function fo(e, t) {
386
- const s = Ht(t);
387
- return $(
388
- (...n) => {
389
- if ((ro ? "production" : void 0) !== "production" && !("write" in e))
390
- throw new Error("not writable atom");
391
- return s.set(e, ...n);
392
- },
393
- [s, e]
394
- );
395
- }
396
- function zr(e, t) {
397
- return [
398
- uo(e, t),
399
- // We do wrong type assertion here, which results in throwing an error.
400
- fo(e, t)
401
- ];
402
- }
403
- var at = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
404
- const qt = Symbol();
405
- const At = (e, t, s) => (t.has(s) ? t : t.set(s, e())).get(s), mo = /* @__PURE__ */ new WeakMap(), po = (e, t, s) => {
406
- const o = At(() => /* @__PURE__ */ new WeakMap(), mo, t);
407
- return At(e, o, s);
408
- }, go = {}, Ct = (e) => !!e.write, bo = (e) => typeof e == "function";
409
- function xo(e, t) {
410
- return po(
411
- () => {
412
- const s = /* @__PURE__ */ new WeakMap(), o = (r, c) => {
413
- let p = s.get(r);
414
- if (p)
415
- return p;
416
- const l = c && s.get(c), m = [], N = [];
417
- return r.forEach((j, v) => {
418
- const S = t ? t(j) : v;
419
- N[v] = S;
420
- const L = l && l.atomList[l.keyList.indexOf(S)];
421
- if (L) {
422
- m[v] = L;
423
- return;
424
- }
425
- const F = (T) => {
426
- const G = T(n), V = T(e), q = o(V, G == null ? void 0 : G.arr).keyList.indexOf(S);
427
- if (q < 0 || q >= V.length) {
428
- const K = r[o(r).keyList.indexOf(S)];
429
- if (K)
430
- return K;
431
- throw new Error("splitAtom: index out of bounds for read");
432
- }
433
- return V[q];
434
- }, _ = (T, G, V) => {
435
- const X = T(n), q = T(e), le = o(q, X == null ? void 0 : X.arr).keyList.indexOf(S);
436
- if (le < 0 || le >= q.length)
437
- throw new Error("splitAtom: index out of bounds for write");
438
- const u = bo(V) ? V(q[le]) : V;
439
- G(e, [
440
- ...q.slice(0, le),
441
- u,
442
- ...q.slice(le + 1)
443
- ]);
444
- };
445
- m[v] = Ct(e) ? ae(F, _) : ae(F);
446
- }), l && l.keyList.length === N.length && l.keyList.every((j, v) => j === N[v]) ? p = l : p = { arr: r, atomList: m, keyList: N }, s.set(r, p), p;
447
- }, n = ae((r) => {
448
- const c = r(n), p = r(e);
449
- return o(p, c == null ? void 0 : c.arr);
450
- });
451
- (at ? "production" : void 0) !== "production" && (n.debugPrivate = !0), n.init = void 0;
452
- const i = Ct(e) ? ae(
453
- (r) => r(n).atomList,
454
- (r, c, p) => {
455
- switch (p.type) {
456
- case "remove": {
457
- const l = r(i).indexOf(p.atom);
458
- if (l >= 0) {
459
- const m = r(e);
460
- c(e, [
461
- ...m.slice(0, l),
462
- ...m.slice(l + 1)
463
- ]);
464
- }
465
- break;
466
- }
467
- case "insert": {
468
- const l = p.before ? r(i).indexOf(p.before) : r(i).length;
469
- if (l >= 0) {
470
- const m = r(e);
471
- c(e, [
472
- ...m.slice(0, l),
473
- p.value,
474
- ...m.slice(l)
475
- ]);
476
- }
477
- break;
478
- }
479
- case "move": {
480
- const l = r(i).indexOf(p.atom), m = p.before ? r(i).indexOf(p.before) : r(i).length;
481
- if (l >= 0 && m >= 0) {
482
- const N = r(e);
483
- l < m ? c(e, [
484
- ...N.slice(0, l),
485
- ...N.slice(l + 1, m),
486
- N[l],
487
- ...N.slice(m)
488
- ]) : c(e, [
489
- ...N.slice(0, m),
490
- N[l],
491
- ...N.slice(m, l),
492
- ...N.slice(l + 1)
493
- ]);
494
- }
495
- break;
496
- }
497
- }
498
- }
499
- ) : ae((r) => r(n).atomList);
500
- return i;
501
- },
502
- e,
503
- t || go
504
- );
505
- }
506
- function Vr(e) {
507
- const t = Symbol(), s = ae(t);
508
- (at ? "production" : void 0) !== "production" && (s.debugPrivate = !0);
509
- const o = ae(
510
- (n, i) => {
511
- const r = n(s);
512
- return r !== t ? r : e(n, i);
513
- },
514
- (n, i, r) => {
515
- if (r === qt)
516
- i(s, t);
517
- else if (typeof r == "function") {
518
- const c = n(o);
519
- i(s, r(c));
520
- } else
521
- i(s, r);
522
- }
523
- );
524
- return o;
525
- }
526
- const ho = (e) => typeof (e == null ? void 0 : e.then) == "function";
527
- function vo(e) {
528
- let t, s;
529
- const o = {
530
- getItem: (n, i) => {
531
- var r, c;
532
- const p = (m) => {
533
- if (m = m || "", t !== m) {
534
- try {
535
- s = JSON.parse(m);
536
- } catch {
537
- return i;
538
- }
539
- t = m;
540
- }
541
- return s;
542
- }, l = (c = (r = e()) == null ? void 0 : r.getItem(n)) != null ? c : null;
543
- return ho(l) ? l.then(p) : p(l);
544
- },
545
- setItem: (n, i) => {
546
- var r;
547
- return (r = e()) == null ? void 0 : r.setItem(n, JSON.stringify(i));
548
- },
549
- removeItem: (n) => {
550
- var i;
551
- return (i = e()) == null ? void 0 : i.removeItem(n);
552
- }
553
- };
554
- return typeof window < "u" && typeof window.addEventListener == "function" && (o.subscribe = (n, i, r) => {
555
- if (!(e() instanceof window.Storage))
556
- return () => {
557
- };
558
- const c = (p) => {
559
- if (p.storageArea === e() && p.key === n) {
560
- let l;
561
- try {
562
- l = JSON.parse(p.newValue || "");
563
- } catch {
564
- l = r;
565
- }
566
- i(l);
567
- }
568
- };
569
- return window.addEventListener("storage", c), () => {
570
- window.removeEventListener("storage", c);
571
- };
572
- }), o;
573
- }
574
- const yo = vo(
575
- () => typeof window < "u" ? window.localStorage : void 0
576
- );
577
- function Re(e, t, s = yo, o) {
578
- const n = o == null ? void 0 : o.unstable_getOnInit, i = ae(
579
- n ? s.getItem(e, t) : t
580
- );
581
- return (at ? "production" : void 0) !== "production" && (i.debugPrivate = !0), i.onMount = (c) => {
582
- n || c(s.getItem(e, t));
583
- let p;
584
- return s.subscribe && (p = s.subscribe(e, c, t)), p;
585
- }, ae(
586
- (c) => c(i),
587
- (c, p, l) => {
588
- const m = typeof l == "function" ? l(c(i)) : l;
589
- return m === qt ? (p(i, t), s.removeItem(e)) : m instanceof Promise ? m.then((N) => (p(i, N), s.setItem(e, N))) : (p(i, m), s.setItem(e, m));
590
- }
591
- );
592
- }
593
- const Kt = w(null);
594
- Kt.debugLabel = "chaiBuilderPropsAtom";
595
- const wo = w({});
596
- wo.debugLabel = "chaiExternalDataAtom";
597
- const $r = () => !1, No = (e) => {
598
- const t = e.replace(fe, "").split(",");
599
- return { baseClasses: t[0], classes: t[1] };
600
- }, _t = Oe((e, t) => {
601
- if (!e)
602
- return !0;
603
- const s = Le(e);
604
- return s && pe(s, "canAcceptBlock") ? s.canAcceptBlock(t) : !1;
605
- }), ko = Oe((e, t) => {
606
- const s = Le(t);
607
- return s && pe(s, "canBeNested") ? s.canBeNested(e) : !0;
608
- }), Fr = Oe((e) => {
609
- const t = Le(e);
610
- return t && pe(t, "canDuplicate") ? t.canDuplicate() : !0;
611
- }), Ur = Oe((e) => {
612
- const t = Le(e);
613
- return t && pe(t, "canDelete") ? t.canDelete() : !0;
614
- });
615
- function Jt(e, t, s) {
616
- const o = E(e, (i) => i._parent === t), n = [];
617
- for (let i = 0; i < o.length; i++) {
618
- const r = Qt(o[i]);
619
- if (Object.keys(r).length > 0 && Object.keys(r).forEach((c) => {
620
- o[i][c] = `slot:${de()}`;
621
- }), E(e, { _parent: o[i]._id }).length > 0) {
622
- const c = de();
623
- n.push({ ...o[i], oldId: o[i]._id, _id: c, _parent: s }), n.push(re(Jt(e, o[i]._id, c)));
624
- } else
625
- n.push({
626
- ...o[i],
627
- oldId: o[i]._id,
628
- _id: de(),
629
- _parent: s
630
- });
631
- }
632
- return re(n);
633
- }
634
- function Yt(e) {
635
- const t = {};
636
- e.forEach((o) => {
637
- t[o._id] = { ...o, children: [] };
638
- });
639
- const s = [];
640
- return e.forEach((o) => {
641
- if (o._parent) {
642
- const n = t[o._parent];
643
- n && n.children.push(t[o._id]);
644
- } else
645
- s.push(t[o._id]);
646
- }), s;
647
- }
648
- const Qt = (e) => {
649
- const t = {};
650
- return Object.keys(e).forEach((s) => {
651
- Lt(e[s]) && e[s].startsWith("slot") && (t[s] = e[s].replace("slot:", ""));
652
- }), t;
653
- }, jo = (e, t, s = null) => {
654
- let o = oe(e, { _id: t });
655
- o = { ...o, oldId: o._id, _id: de() }, s && (o = { ...o, _parent: s });
656
- const n = [o];
657
- E(e, { _parent: t }).length > 0 && n.push(re(Jt(e, t, o._id)));
658
- const i = re(n);
659
- return I(i, (r) => {
660
- const c = r, p = Qt(c);
661
- return Object.keys(p).length > 0 && Object.keys(p).forEach((l) => {
662
- const m = oe(i, { oldId: p[l].replace("slot:", "") });
663
- c[l] = `slot:${m._id}`;
664
- }), tt(c, ["global", "oldId"]);
665
- });
666
- };
667
- const ie = w([]);
668
- ie.debugLabel = "presentBlocksAtom";
669
- const So = w((e) => {
670
- const t = e(ie);
671
- return Yt([...t]);
672
- });
673
- So.debugLabel = "treeDSBlocks";
674
- ie.debugLabel = "presentBlocksAtom";
675
- const rt = xo(ie);
676
- rt.debugLabel = "pageBlocksAtomsAtom";
677
- const Ao = w("");
678
- Ao.debugLabel = "builderActivePageAtom";
679
- const Co = w(-1);
680
- Co.debugLabel = "destinationDropIndexAtom";
681
- const Xt = w([]);
682
- Xt.debugLabel = "buildingBlocksAtom";
683
- const _o = w((e) => {
684
- const t = e(Xt);
685
- return E(t, (s) => pe(s, "blockId"));
686
- });
687
- _o.debugLabel = "globalBlocksAtom";
688
- const it = w([]);
689
- it.debugLabel = "selectedBlockIdsAtom";
690
- const lt = w((e) => {
691
- const t = e(ie), s = e(it);
692
- return I(
693
- E(t, ({ _id: o }) => Y(s, o)),
694
- (o) => ({ ...o })
695
- );
696
- });
697
- lt.debugLabel = "selectedBlocksAtom";
698
- const ct = w((e) => {
699
- const t = e(lt);
700
- return t.length === 0 ? null : t.length === 1 ? t[0] : {
701
- type: "Multiple",
702
- id: I(t, "id")
703
- };
704
- });
705
- ct.debugLabel = "selectedBlockAtom";
706
- const Bo = (e) => J(e, "parent", null), Ro = w((e) => {
707
- const t = e(lt), s = I(t, Bo);
708
- return E(e(ie), (o) => Y(s, o._id));
709
- });
710
- Ro.debugLabel = "selectedBlocksParentsAtom";
711
- const Zt = w(() => !1);
712
- Zt.debugLabel = "selectedBlockFlexChildAtom";
713
- const es = w(() => !1);
714
- es.debugLabel = "selectedBlockGridChildAtom";
715
- const dt = w("");
716
- dt.debugLabel = "styleStateAtom";
717
- const ts = Re("styleBreakpoint", "xs");
718
- ts.debugLabel = "styleBreakpointAtom";
719
- const Wr = () => ({
720
- flexChild: te(Zt),
721
- gridChild: te(es)
722
- }), Gr = () => te(ct);
723
- const $e = () => {
724
- const [e, t] = O(it), s = $(
725
- (o) => {
726
- t((n) => Y(n, o) ? zt(n, o) : [...n, o]);
727
- },
728
- [t]
729
- );
730
- return [e, t, s];
731
- }, Bt = (e) => {
732
- switch (e.type) {
733
- case "singular":
734
- return e.uiSchema;
735
- case "model":
736
- const { properties: t } = e, s = {};
737
- return Object.keys(t).forEach((i) => {
738
- const r = t[i];
739
- if (Y(["slot", "styles"], r.type))
740
- return;
741
- const c = i;
742
- s[c] = Bt(r);
743
- }), s;
744
- case "list":
745
- const { itemProperties: o } = e, n = {
746
- items: {}
747
- };
748
- return Object.keys(o).forEach((i) => {
749
- const r = o[i];
750
- if (Y(["slot", "styles"], r.type))
751
- return;
752
- const c = i;
753
- n.items[c] = Bt(r);
754
- }), n;
755
- default:
756
- return {};
757
- }
758
- }, Rt = (e) => {
759
- switch (e.type) {
760
- case "singular":
761
- return e.schema;
762
- case "model":
763
- const { properties: t, title: s } = e, o = {
764
- title: s,
765
- type: "object",
766
- properties: {}
767
- };
768
- return Object.keys(t).forEach((c) => {
769
- const p = t[c];
770
- if (Y(["slot", "styles"], p.type))
771
- return;
772
- const l = c;
773
- o.properties[l] = Rt(p);
774
- }), o;
775
- case "list":
776
- const { itemProperties: n, title: i } = e, r = {
777
- title: i,
778
- type: "array",
779
- items: {
780
- type: "object",
781
- properties: {}
782
- }
783
- };
784
- return Object.keys(n).forEach((c) => {
785
- const p = n[c];
786
- if (Y(["slot", "styles"], p.type))
787
- return;
788
- const l = c;
789
- r.items.properties[l] = Rt(p), je(r.items, "title", J(p, "itemTitle", `${i} item`));
790
- }), r;
791
- default:
792
- return {};
793
- }
794
- }, ss = (e) => {
795
- if (!e)
796
- return {};
797
- const t = {};
798
- return Object.keys(e).forEach((s) => {
799
- t[s] = To(e[s]);
800
- }), t;
801
- }, Po = (e) => {
802
- if (_e(e.default))
803
- return [];
804
- const { itemProperties: t } = e;
805
- return I(e.default, (s) => {
806
- const o = { ...s };
807
- return Vt(s, (n, i) => {
808
- pe(t, i) && J(t[i], "i18n", !1) && (o[i] = Ft);
809
- }), o;
810
- });
811
- }, To = (e) => {
812
- switch (e.type) {
813
- case "styles":
814
- return e.default;
815
- case "slot":
816
- return `${Ke}${de()}`;
817
- case "singular":
818
- const { i18n: t, schema: s } = e;
819
- return t ? Ft : J(s, "default", "");
820
- case "model":
821
- return ss(e.properties);
822
- case "list":
823
- return Po(e);
824
- default:
825
- return "";
826
- }
827
- };
828
- var ut = { exports: {} }, Hr = ut.exports;
829
- (function(e) {
830
- (function() {
831
- "use strict";
832
- function t(o, n, i) {
833
- return o.splice(
834
- n,
835
- !i || 1 + i - n + (!(i < 0 ^ n >= 0) && (i < 0 || -1) * o.length)
836
- ), o.length;
837
- }
838
- let s = function() {
839
- let o = [], n = -1, i = 0, r = !1, c;
840
- function p(l, m) {
841
- return !l || typeof l[m] != "function" ? this : (r = !0, l[m](), r = !1, this);
842
- }
843
- return {
844
- /**
845
- * Adds a command to the queue.
846
- * @property {object} command - Command
847
- * @property {function} command.undo - Undo function
848
- * @property {function} command.redo - Redo function
849
- * @property {string} [command.groupId] - Optional group id
850
- */
851
- add: function(l) {
852
- return r ? this : (o.splice(n + 1, o.length - n), o.push(l), i && o.length > i && t(o, 0, -(i + 1)), n = o.length - 1, c && c(), this);
853
- },
854
- /**
855
- * Pass a function to be called on undo and redo actions.
856
- * @property {function} callbackFunc - Callback function
857
- */
858
- setCallback: function(l) {
859
- c = l;
860
- },
861
- /**
862
- * Performs undo: call the undo function at the current index and decrease the index by 1.
863
- */
864
- undo: function() {
865
- let l = o[n];
866
- if (!l)
867
- return this;
868
- const m = l.groupId;
869
- for (; l.groupId === m && (p(l, "undo"), n -= 1, l = o[n], !(!l || !l.groupId)); )
870
- ;
871
- return c && c(), this;
872
- },
873
- /**
874
- * Performs redo: call the redo function at the next index and increase the index by 1.
875
- */
876
- redo: function() {
877
- let l = o[n + 1];
878
- if (!l)
879
- return this;
880
- const m = l.groupId;
881
- for (; l.groupId === m && (p(l, "redo"), n += 1, l = o[n + 1], !(!l || !l.groupId)); )
882
- ;
883
- return c && c(), this;
884
- },
885
- /**
886
- * Clears the memory, losing all stored states. Resets the index.
887
- */
888
- clear: function() {
889
- let l = o.length;
890
- o = [], n = -1, c && l > 0 && c();
891
- },
892
- /**
893
- * Tests if any undo actions exist.
894
- * @returns {boolean}
895
- */
896
- hasUndo: function() {
897
- return n !== -1;
898
- },
899
- /**
900
- * Tests if any redo actions exist.
901
- * @returns {boolean}
902
- */
903
- hasRedo: function() {
904
- return n < o.length - 1;
905
- },
906
- /**
907
- * Returns the list of queued commands.
908
- * @param {string} [groupId] - Optionally filter commands by group ID
909
- * @returns {array}
910
- */
911
- getCommands: function(l) {
912
- return l ? o.filter((m) => m.groupId === l) : o;
913
- },
914
- /**
915
- * Returns the index of the actions list.
916
- * @returns {number}
917
- */
918
- getIndex: function() {
919
- return n;
920
- },
921
- /**
922
- * Sets the maximum number of undo steps. Default: 0 (unlimited).
923
- * @property {number} max - Maximum number of undo steps
924
- */
925
- setLimit: function(l) {
926
- i = l;
927
- }
928
- };
929
- };
930
- e.exports ? e.exports = s : window.UndoManager = s;
931
- })();
932
- })(ut);
933
- var Io = ut.exports;
934
- const Mo = /* @__PURE__ */ Ws(Io), Do = w(Je), Eo = w(null), os = () => {
935
- const [e, t] = O(Do);
936
- return [
937
- Vs(e) ? { ...Je, ...e } : Je,
938
- t
939
- ];
940
- }, qr = () => O(Eo), Oo = w(null), Lo = () => ({ currentPage: te(Oo) });
941
- function zo(e) {
942
- return Yt(e);
943
- }
944
- const ft = (e, t) => re(
945
- e.map((s) => {
946
- if (s = t ? { ...s, parent: t } : { ...s }, s.children) {
947
- const o = [...s.children];
948
- return delete s.children, re([s, ...ft(o, s._id)]);
949
- }
950
- return s;
951
- })
952
- );
953
- function mt(e, t = !1) {
954
- for (let s = 0; s < e.length; s++) {
955
- const o = e[s];
956
- o.global && !t ? e[s] = {
957
- type: "GlobalBlock",
958
- blockId: o.blockId,
959
- _parent: J(o, "parent", null),
960
- _id: o._id
961
- } : o.children && o.children.length && mt(o.children);
962
- }
963
- }
964
- function ns(e) {
965
- let t = [], s = E(e, { type: "GlobalBlock" });
966
- return s.length > 0 && (s = I(s, as), ce(s, (o) => {
967
- t = [...t, ...Vo(o)];
968
- })), t;
969
- }
970
- function Vo(e) {
971
- let t = [];
972
- const s = J(ee(e), "parent", null);
973
- je(ee(e), "parent", null);
974
- const o = [flatToNestedInstance.convert(rs(e))];
975
- mt(o, !0);
976
- let n = ft(o, e[0]._id);
977
- return n = je(n, "0.parent", s), t = [...t, n, ...ns(n)], t;
978
- }
979
- function as(e) {
980
- const t = oe(Qe, { _id: e._id });
981
- if (!t)
982
- return [];
983
- const s = [t], o = E(Qe, { _parent: e._id });
984
- return o.length ? re([...s, ...re(I(o, as))]) : re(s);
985
- }
986
- const rs = (e) => JSON.parse(JSON.stringify(e));
987
- let Qe = [];
988
- function $o(e) {
989
- Qe = e;
990
- const t = zo(rs(e));
991
- mt(t);
992
- const s = ft(t, null), o = ns(s), n = {};
993
- return ce(o, (i) => je(n, ee(i).blockId, i)), [s, n];
994
- }
995
- const Fo = () => {
996
- const [e] = os(), { currentPage: t } = Lo(), [s] = ye();
997
- return $(() => {
998
- const o = I(
999
- s,
1000
- (i) => tt(i, ["expanded", "order", "title", "siblings", "tempClasses"])
1001
- ), [n = []] = $o(o);
1002
- return {
1003
- currentPage: t,
1004
- blocks: n
1005
- };
1006
- }, [e, t, s]);
1007
- }, Ne = (e, t = void 0) => {
1008
- const s = te(Kt);
1009
- return J(s, e, t);
1010
- }, is = w([]);
1011
- is.debugLabel = "dataProvidersAtom";
1012
- const Uo = () => O(is), pt = w("SAVED");
1013
- pt.debugLabel = "pageSyncStateAtom";
1014
- const Kr = () => {
1015
- const [e, t] = O(pt), s = Ne("onSavePage", async (l) => {
1016
- }), o = Ne("onSave", async (l) => {
1017
- }), n = Ne("onSyncStatusChange", (l) => {
1018
- }), i = Fo(), [r] = Uo(), [c] = os();
1019
- return { savePage: Gs(
1020
- async () => {
1021
- t("SAVING"), n("SAVING");
1022
- const l = i();
1023
- return await s({ blocks: l.blocks, providers: r }), await o({ blocks: l.blocks, providers: r, brandingOptions: c }), setTimeout(() => {
1024
- t("SAVED"), n("SAVED");
1025
- }, 100), !0;
1026
- },
1027
- [i, t, c, o, n],
1028
- 5e3
1029
- // save only every 5 seconds
1030
- ), syncState: e, setSyncState: t };
1031
- }, ne = new Mo();
1032
- ne.setLimit(50);
1033
- const ls = () => {
1034
- const [, e] = O(pt);
1035
- return Ae(() => (ne.setCallback(() => e("UNSAVED")), () => {
1036
- ne.setCallback($s);
1037
- }), []), {
1038
- add: ne.add,
1039
- undo: ne.undo,
1040
- redo: ne.redo,
1041
- hasRedo: ne.hasRedo,
1042
- hasUndo: ne.hasUndo,
1043
- clear: ne.clear
1044
- };
1045
- }, gt = (e, t) => {
1046
- const s = [], o = E(e, (n) => Y(t, n._id) || Y(t, n._parent) ? (s.push(n._id), !1) : !0);
1047
- return _e(s) ? o : gt(o, s);
1048
- }, Jr = () => {
1049
- const [e] = ye(), [t, s] = $e(), { setNewBlocks: o } = xe();
1050
- return $(
1051
- (n) => {
1052
- var r;
1053
- const i = ((r = oe(e, { _id: n[0] })) == null ? void 0 : r._parent) || null;
1054
- o(gt(e, n)), setTimeout(() => s(i ? [i] : []), 200);
1055
- },
1056
- [e, s, t]
1057
- );
1058
- };
1059
- function Wo(e, t, s, o) {
1060
- let n = e.filter((c) => !c._parent);
1061
- s && (n = e.filter((c) => c._parent === s));
1062
- const i = o !== void 0 ? o : n.length;
1063
- let r = e.length;
1064
- for (let c = 0, p = 0; c < e.length; c++)
1065
- if (e[c]._parent === s) {
1066
- if (p === i) {
1067
- r = c;
1068
- break;
1069
- }
1070
- p++;
1071
- }
1072
- return !s && o !== void 0 && o >= n.length && (r = e.length), [...e.slice(0, r), ...t, ...e.slice(r)];
1073
- }
1074
- function Pt(e) {
1075
- const t = [], s = /* @__PURE__ */ new Map();
1076
- e.forEach((n) => {
1077
- s.set(n._id, n);
1078
- });
1079
- function o(n) {
1080
- const i = s.get(n);
1081
- t.includes(i) || (t.push(i), e.forEach((r) => {
1082
- r._parent === n && o(r._id);
1083
- }));
1084
- }
1085
- return e.forEach((n) => {
1086
- n._parent || o(n._id);
1087
- }), t;
1088
- }
1089
- const Go = (e, t, s, o) => {
1090
- if (_e(t))
1091
- return Pt(e);
1092
- function n(c, p) {
1093
- const l = c.filter((N) => N._parent === p);
1094
- let m = [...l];
1095
- return l.forEach((N) => {
1096
- m = m.concat(n(c, N._id));
1097
- }), m;
1098
- }
1099
- const i = t.reduce((c, p) => {
1100
- const l = e.find((m) => m._id === p);
1101
- if (l) {
1102
- const m = n(e, p);
1103
- c.push(l, ...m);
1104
- }
1105
- return c;
1106
- }, []);
1107
- e = e.filter((c) => !i.includes(c)), i.forEach((c) => {
1108
- t.includes(c._id) && (c._parent = s);
1109
- });
1110
- let r;
1111
- if (!s)
1112
- r = o;
1113
- else {
1114
- const c = e.findIndex((p) => p._id === s);
1115
- if (c === -1)
1116
- r = o;
1117
- else {
1118
- r = c + 1;
1119
- let p = 0;
1120
- for (; p < o && r < e.length; )
1121
- e[r]._parent === s && p++, r++;
1122
- }
1123
- }
1124
- return e.splice(r, 0, ...i), Pt(e);
1125
- }, Ho = () => {
1126
- const [, e] = ye();
1127
- return {
1128
- setNewBlocks: (t) => {
1129
- e(t);
1130
- },
1131
- addBlocks: (t, s, o) => {
1132
- e((n) => Wo(n, t, s, o));
1133
- },
1134
- removeBlocks: (t) => {
1135
- e((s) => gt(s, t));
1136
- },
1137
- moveBlocks: (t, s, o) => {
1138
- e((n) => Go(n, t, s, o));
1139
- },
1140
- updateBlocksProps: (t) => {
1141
- e((s) => {
1142
- const o = t.map((n) => n._id);
1143
- return s.map((n) => {
1144
- if (o.includes(n._id)) {
1145
- const i = oe(t, { _id: n._id });
1146
- return { ...n, ...tt(i, "_id") };
1147
- }
1148
- return n;
1149
- });
1150
- });
1151
- }
1152
- };
1153
- }, ye = () => O(ie), xe = () => {
1154
- const { add: e } = ls(), [t] = ye(), {
1155
- setNewBlocks: s,
1156
- addBlocks: o,
1157
- removeBlocks: n,
1158
- moveBlocks: i,
1159
- updateBlocksProps: r
1160
- } = Ho();
1161
- return {
1162
- moveBlocks: (v, S, L) => {
1163
- const F = I(v, (T) => {
1164
- const V = t.find((K) => K._id === T)._parent || null, q = t.filter((K) => V ? K._parent === V : !K._parent).map((K) => K._id).indexOf(T);
1165
- return { _id: T, oldParent: V, oldPosition: q };
1166
- }), _ = F.find(({ _id: T }) => T === v[0]);
1167
- _ && _.oldParent === S && _.oldPosition === L || (i(v, S, L), e({
1168
- undo: () => ce(F, ({ _id: T, oldParent: G, oldPosition: V }) => {
1169
- i([T], G, V);
1170
- }),
1171
- redo: () => i(v, S, L)
1172
- }));
1173
- },
1174
- addBlocks: (v, S, L) => {
1175
- o(v, S, L), e({
1176
- undo: () => n(I(v, "_id")),
1177
- redo: () => o(v, S, L)
1178
- });
1179
- },
1180
- removeBlocks: (v) => {
1181
- var _;
1182
- const S = (_ = ee(v)) == null ? void 0 : _._parent, F = t.filter((T) => S ? T._parent === S : !T._parent).indexOf(ee(v));
1183
- n(I(v, "_id")), e({
1184
- undo: () => o(v, S, F),
1185
- redo: () => n(I(v, "_id"))
1186
- });
1187
- },
1188
- updateBlocks: (v, S, L) => {
1189
- let F = [];
1190
- if (L)
1191
- F = I(v, (_) => ({ _id: _, ...L }));
1192
- else {
1193
- const _ = Fs(S);
1194
- F = I(v, (T) => {
1195
- const G = t.find((X) => X._id === T), V = { _id: T };
1196
- return ce(_, (X) => V[X] = G[X]), V;
1197
- });
1198
- }
1199
- r(I(v, (_) => ({ _id: _, ...S }))), e({
1200
- undo: () => r(F),
1201
- redo: () => r(I(v, (_) => ({ _id: _, ...S })))
1202
- });
1203
- },
1204
- updateBlocksRuntime: (v, S) => {
1205
- r(I(v, (L) => ({ _id: L, ...S })));
1206
- },
1207
- setNewBlocks: (v) => {
1208
- s(v), e({
1209
- undo: () => s(t),
1210
- redo: () => s(v)
1211
- });
1212
- }
1213
- };
1214
- }, qo = ge(
1215
- "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
1216
- {
1217
- variants: {
1218
- variant: {
1219
- default: "bg-transparent",
1220
- outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
1221
- },
1222
- size: {
1223
- default: "h-10 px-3",
1224
- sm: "h-9 px-2.5",
1225
- lg: "h-11 px-5"
1226
- }
1227
- },
1228
- defaultVariants: {
1229
- variant: "default",
1230
- size: "default"
1231
- }
1232
- }
1233
- ), Ko = f.forwardRef(({ className: e, variant: t, size: s, ...o }, n) => /* @__PURE__ */ a.jsx(Ut.Root, { ref: n, className: d(qo({ variant: t, size: s, className: e })), ...o }));
1234
- Ko.displayName = Ut.Root.displayName;
1235
- const Jo = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1236
- Ye.Root,
1237
- {
1238
- className: d(
1239
- "peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-slate-900 data-[state=unchecked]:bg-slate-200 dark:focus-visible:ring-slate-800 dark:focus-visible:ring-offset-slate-950 dark:data-[state=checked]:bg-slate-50 dark:data-[state=unchecked]:bg-slate-800",
1240
- e
1241
- ),
1242
- ...t,
1243
- ref: s,
1244
- children: /* @__PURE__ */ a.jsx(
1245
- Ye.Thumb,
1246
- {
1247
- className: d(
1248
- "pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 dark:bg-slate-950"
1249
- )
1250
- }
1251
- )
1252
- }
1253
- ));
1254
- Jo.displayName = Ye.Root.displayName;
1255
- const bt = ge(
1256
- "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
1257
- {
1258
- variants: {
1259
- variant: {
1260
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
1261
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
1262
- outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
1263
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
1264
- ghost: "hover:bg-accent hover:text-accent-foreground",
1265
- link: "text-primary underline-offset-4 hover:underline"
1266
- },
1267
- size: {
1268
- default: "h-9 px-4 py-2",
1269
- sm: "h-8 rounded-md px-3 text-xs",
1270
- lg: "h-10 rounded-md px-8",
1271
- icon: "h-9 w-9"
1272
- }
1273
- },
1274
- defaultVariants: {
1275
- variant: "default",
1276
- size: "default"
1277
- }
1278
- }
1279
- ), Yo = f.forwardRef(
1280
- ({ className: e, variant: t, size: s, asChild: o = !1, ...n }, i) => {
1281
- const r = o ? Hs : "button";
1282
- return /* @__PURE__ */ a.jsx(r, { className: d(bt({ variant: t, size: s, className: e })), ref: i, ...n });
1283
- }
1284
- );
1285
- Yo.displayName = "Button";
1286
- const Yr = me.Root, Qo = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(me.Item, { ref: s, className: d("border-b", e), ...t }));
1287
- Qo.displayName = "AccordionItem";
1288
- const Xo = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsx(me.Header, { className: "flex", children: /* @__PURE__ */ a.jsxs(
1289
- me.Trigger,
1290
- {
1291
- ref: o,
1292
- className: d(
1293
- "flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
1294
- e
1295
- ),
1296
- ...s,
1297
- children: [
1298
- t,
1299
- /* @__PURE__ */ a.jsx(qs, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200" })
1300
- ]
1301
- }
1302
- ) }));
1303
- Xo.displayName = me.Trigger.displayName;
1304
- const Zo = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1305
- me.Content,
1306
- {
1307
- ref: o,
1308
- className: d(
1309
- "text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
1310
- e
1311
- ),
1312
- ...s,
1313
- children: /* @__PURE__ */ a.jsx("div", { className: "pb-4 pt-0", children: t })
1314
- }
1315
- ));
1316
- Zo.displayName = me.Content.displayName;
1317
- const en = ge(
1318
- "relative w-full rounded-lg border px-4 py-3 text-sm [&:has(svg)]:pl-11 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
1319
- {
1320
- variants: {
1321
- variant: {
1322
- default: "bg-background text-foreground",
1323
- destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
1324
- }
1325
- },
1326
- defaultVariants: {
1327
- variant: "default"
1328
- }
1329
- }
1330
- ), tn = f.forwardRef(({ className: e, variant: t, ...s }, o) => /* @__PURE__ */ a.jsx("div", { ref: o, role: "alert", className: d(en({ variant: t }), e), ...s }));
1331
- tn.displayName = "Alert";
1332
- const sn = f.forwardRef(
1333
- ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("h5", { ref: s, className: d("mb-1 font-medium leading-none tracking-tight", e), ...t })
1334
- );
1335
- sn.displayName = "AlertTitle";
1336
- const on = f.forwardRef(
1337
- ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("text-sm [&_p]:leading-relaxed", e), ...t })
1338
- );
1339
- on.displayName = "AlertDescription";
1340
- const nn = ge(
1341
- "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
1342
- {
1343
- variants: {
1344
- variant: {
1345
- default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
1346
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
1347
- destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
1348
- outline: "text-foreground"
1349
- }
1350
- },
1351
- defaultVariants: {
1352
- variant: "default"
1353
- }
1354
- }
1355
- ), Qr = ({ className: e, variant: t, ...s }) => /* @__PURE__ */ a.jsx("div", { className: d(nn({ variant: t }), e), ...s }), Xr = H.Root, Zr = H.Trigger, cs = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(H.Portal, { className: d(e), ...t });
1356
- cs.displayName = H.Portal.displayName;
1357
- const ds = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1358
- H.Overlay,
1359
- {
1360
- className: d(
1361
- "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1362
- e
1363
- ),
1364
- ...t,
1365
- ref: s
1366
- }
1367
- ));
1368
- ds.displayName = H.Overlay.displayName;
1369
- const an = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsxs(cs, { children: [
1370
- /* @__PURE__ */ a.jsx(ds, {}),
1371
- /* @__PURE__ */ a.jsx(
1372
- H.Content,
1373
- {
1374
- ref: s,
1375
- className: d(
1376
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
1377
- e
1378
- ),
1379
- ...t
1380
- }
1381
- )
1382
- ] }));
1383
- an.displayName = H.Content.displayName;
1384
- const rn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
1385
- rn.displayName = "AlertDialogHeader";
1386
- const ln = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
1387
- ln.displayName = "AlertDialogFooter";
1388
- const cn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(H.Title, { ref: s, className: d("text-lg font-semibold", e), ...t }));
1389
- cn.displayName = H.Title.displayName;
1390
- const dn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(H.Description, { ref: s, className: d("text-sm text-muted-foreground", e), ...t }));
1391
- dn.displayName = H.Description.displayName;
1392
- const un = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(H.Action, { ref: s, className: d(bt(), e), ...t }));
1393
- un.displayName = H.Action.displayName;
1394
- const fn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1395
- H.Cancel,
1396
- {
1397
- ref: s,
1398
- className: d(bt({ variant: "outline" }), "mt-2 sm:mt-0", e),
1399
- ...t
1400
- }
1401
- ));
1402
- fn.displayName = H.Cancel.displayName;
1403
- const us = P.Root, mn = P.Trigger, fs = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(P.Portal, { className: d(e), ...t });
1404
- fs.displayName = P.Portal.displayName;
1405
- const ms = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1406
- P.Overlay,
1407
- {
1408
- ref: s,
1409
- className: d(
1410
- "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1411
- e
1412
- ),
1413
- ...t
1414
- }
1415
- ));
1416
- ms.displayName = P.Overlay.displayName;
1417
- const xt = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(fs, { children: [
1418
- /* @__PURE__ */ a.jsx(ms, {}),
1419
- /* @__PURE__ */ a.jsxs(
1420
- P.Content,
1421
- {
1422
- ref: o,
1423
- className: d(
1424
- "fixed left-[50%] top-[50%] z-[999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",
1425
- e
1426
- ),
1427
- ...s,
1428
- children: [
1429
- t,
1430
- /* @__PURE__ */ a.jsxs(P.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
1431
- /* @__PURE__ */ a.jsx(st, { className: "h-4 w-4" }),
1432
- /* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Close" })
1433
- ] })
1434
- ]
1435
- }
1436
- )
1437
- ] }));
1438
- xt.displayName = P.Content.displayName;
1439
- const pn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col space-y-1.5 text-center sm:text-left", e), ...t });
1440
- pn.displayName = "DialogHeader";
1441
- const gn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
1442
- gn.displayName = "DialogFooter";
1443
- const bn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1444
- P.Title,
1445
- {
1446
- ref: s,
1447
- className: d("text-lg font-semibold leading-none tracking-tight", e),
1448
- ...t
1449
- }
1450
- ));
1451
- bn.displayName = P.Title.displayName;
1452
- const xn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(P.Description, { ref: s, className: d("text-sm text-muted-foreground", e), ...t }));
1453
- xn.displayName = P.Description.displayName;
1454
- const hn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("rounded-xl border bg-card text-card-foreground shadow", e), ...t }));
1455
- hn.displayName = "Card";
1456
- const vn = f.forwardRef(
1457
- ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("flex flex-col space-y-1.5 p-6", e), ...t })
1458
- );
1459
- vn.displayName = "CardHeader";
1460
- const yn = f.forwardRef(
1461
- ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("h3", { ref: s, className: d("font-semibold leading-none tracking-tight", e), ...t })
1462
- );
1463
- yn.displayName = "CardTitle";
1464
- const wn = f.forwardRef(
1465
- ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("p", { ref: s, className: d("text-sm text-muted-foreground", e), ...t })
1466
- );
1467
- wn.displayName = "CardDescription";
1468
- const Nn = f.forwardRef(
1469
- ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d("p-6 pt-0", e), ...t })
1470
- );
1471
- Nn.displayName = "CardContent";
1472
- const kn = f.forwardRef(
1473
- ({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx("div", { ref: s, className: d(" flex items-center p-6 pt-0", e), ...t })
1474
- );
1475
- kn.displayName = "CardFooter";
1476
- const jn = f.forwardRef(({ className: e, type: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1477
- "input",
1478
- {
1479
- type: t,
1480
- className: d(
1481
- "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1482
- e
1483
- ),
1484
- ref: o,
1485
- ...s
1486
- }
1487
- ));
1488
- jn.displayName = "Input";
1489
- const Sn = ge("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"), An = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Wt.Root, { ref: s, className: d(Sn(), e), ...t }));
1490
- An.displayName = Wt.Root.displayName;
1491
- const Cn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1492
- "textarea",
1493
- {
1494
- className: d(
1495
- "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1496
- e
1497
- ),
1498
- ref: s,
1499
- ...t
1500
- }
1501
- ));
1502
- Cn.displayName = "Textarea";
1503
- const _n = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(ue.Root, { ref: o, className: d("relative overflow-hidden", e), ...s, children: [
1504
- /* @__PURE__ */ a.jsx(ue.Viewport, { className: "h-full w-full rounded-[inherit]", children: t }),
1505
- /* @__PURE__ */ a.jsx(ps, {}),
1506
- /* @__PURE__ */ a.jsx(ue.Corner, {})
1507
- ] }));
1508
- _n.displayName = ue.Root.displayName;
1509
- const ps = f.forwardRef(({ className: e, orientation: t = "vertical", ...s }, o) => /* @__PURE__ */ a.jsx(
1510
- ue.ScrollAreaScrollbar,
1511
- {
1512
- ref: o,
1513
- orientation: t,
1514
- className: d(
1515
- "flex touch-none select-none transition-colors",
1516
- t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
1517
- t === "horizontal" && "h-2.5 border-t border-t-transparent p-[1px]",
1518
- e
1519
- ),
1520
- ...s,
1521
- children: /* @__PURE__ */ a.jsx(ue.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
1522
- }
1523
- ));
1524
- ps.displayName = ue.ScrollAreaScrollbar.displayName;
1525
- const Bn = be.Root, gs = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1526
- be.List,
1527
- {
1528
- ref: s,
1529
- className: d(
1530
- "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
1531
- e
1532
- ),
1533
- ...t
1534
- }
1535
- ));
1536
- gs.displayName = be.List.displayName;
1537
- const Xe = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1538
- be.Trigger,
1539
- {
1540
- ref: s,
1541
- className: d(
1542
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
1543
- e
1544
- ),
1545
- ...t
1546
- }
1547
- ));
1548
- Xe.displayName = be.Trigger.displayName;
1549
- const Ze = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1550
- be.Content,
1551
- {
1552
- ref: s,
1553
- className: d(
1554
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1555
- e
1556
- ),
1557
- ...t
1558
- }
1559
- ));
1560
- Ze.displayName = be.Content.displayName;
1561
- const ei = ve.Portal, ti = ve.Provider, si = ve.Root, oi = ve.Trigger, Rn = f.forwardRef(({ className: e, sideOffset: t = 4, ...s }, o) => /* @__PURE__ */ a.jsx(
1562
- ve.Content,
1563
- {
1564
- ref: o,
1565
- sideOffset: t,
1566
- className: d(
1567
- "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1568
- e
1569
- ),
1570
- ...s
1571
- }
1572
- ));
1573
- Rn.displayName = ve.Content.displayName;
1574
- const ni = Se.Root, ai = Se.Trigger, Pn = f.forwardRef(({ className: e, align: t = "center", sideOffset: s = 4, ...o }, n) => /* @__PURE__ */ a.jsx(Se.Portal, { children: /* @__PURE__ */ a.jsx(
1575
- Se.Content,
1576
- {
1577
- ref: n,
1578
- align: t,
1579
- sideOffset: s,
1580
- className: d(
1581
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1582
- e
1583
- ),
1584
- ...o
1585
- }
1586
- ) }));
1587
- Pn.displayName = Se.Content.displayName;
1588
- const ri = B.Menu, ii = B.Group, li = B.Portal, ci = B.Sub, di = B.RadioGroup, Tn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1589
- B.Root,
1590
- {
1591
- ref: s,
1592
- className: d("flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm", e),
1593
- ...t
1594
- }
1595
- ));
1596
- Tn.displayName = B.Root.displayName;
1597
- const In = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1598
- B.Trigger,
1599
- {
1600
- ref: s,
1601
- className: d(
1602
- "flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
1603
- e
1604
- ),
1605
- ...t
1606
- }
1607
- ));
1608
- In.displayName = B.Trigger.displayName;
1609
- const Mn = f.forwardRef(({ className: e, inset: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1610
- B.SubTrigger,
1611
- {
1612
- ref: n,
1613
- className: d(
1614
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
1615
- t && "pl-8",
1616
- e
1617
- ),
1618
- ...o,
1619
- children: [
1620
- s,
1621
- /* @__PURE__ */ a.jsx(ot, { className: "ml-auto h-4 w-4" })
1622
- ]
1623
- }
1624
- ));
1625
- Mn.displayName = B.SubTrigger.displayName;
1626
- const Dn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1627
- B.SubContent,
1628
- {
1629
- ref: s,
1630
- className: d(
1631
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1632
- e
1633
- ),
1634
- ...t
1635
- }
1636
- ));
1637
- Dn.displayName = B.SubContent.displayName;
1638
- const En = f.forwardRef(({ className: e, align: t = "start", alignOffset: s = -4, sideOffset: o = 8, ...n }, i) => /* @__PURE__ */ a.jsx(B.Portal, { children: /* @__PURE__ */ a.jsx(
1639
- B.Content,
1640
- {
1641
- ref: i,
1642
- align: t,
1643
- alignOffset: s,
1644
- sideOffset: o,
1645
- className: d(
1646
- "z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1647
- e
1648
- ),
1649
- ...n
1650
- }
1651
- ) }));
1652
- En.displayName = B.Content.displayName;
1653
- const On = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1654
- B.Item,
1655
- {
1656
- ref: o,
1657
- className: d(
1658
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1659
- t && "pl-8",
1660
- e
1661
- ),
1662
- ...s
1663
- }
1664
- ));
1665
- On.displayName = B.Item.displayName;
1666
- const Ln = f.forwardRef(({ className: e, children: t, checked: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1667
- B.CheckboxItem,
1668
- {
1669
- ref: n,
1670
- className: d(
1671
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1672
- e
1673
- ),
1674
- checked: s,
1675
- ...o,
1676
- children: [
1677
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(B.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
1678
- t
1679
- ]
1680
- }
1681
- ));
1682
- Ln.displayName = B.CheckboxItem.displayName;
1683
- const zn = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1684
- B.RadioItem,
1685
- {
1686
- ref: o,
1687
- className: d(
1688
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1689
- e
1690
- ),
1691
- ...s,
1692
- children: [
1693
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(B.ItemIndicator, { children: /* @__PURE__ */ a.jsx(nt, { className: "h-4 w-4 fill-current" }) }) }),
1694
- t
1695
- ]
1696
- }
1697
- ));
1698
- zn.displayName = B.RadioItem.displayName;
1699
- const Vn = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1700
- B.Label,
1701
- {
1702
- ref: o,
1703
- className: d("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e),
1704
- ...s
1705
- }
1706
- ));
1707
- Vn.displayName = B.Label.displayName;
1708
- const $n = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(B.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-muted", e), ...t }));
1709
- $n.displayName = B.Separator.displayName;
1710
- const Fn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
1711
- Fn.displayname = "MenubarShortcut";
1712
- const ui = Ve.Root, fi = Ve.Trigger, Un = f.forwardRef(({ className: e, align: t = "center", sideOffset: s = 4, ...o }, n) => /* @__PURE__ */ a.jsx(
1713
- Ve.Content,
1714
- {
1715
- ref: n,
1716
- align: t,
1717
- sideOffset: s,
1718
- className: d(
1719
- "z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1720
- e
1721
- ),
1722
- ...o
1723
- }
1724
- ));
1725
- Un.displayName = Ve.Content.displayName;
1726
- const mi = U.Root, pi = U.Group, gi = U.Value, Wn = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1727
- U.Trigger,
1728
- {
1729
- ref: o,
1730
- className: d(
1731
- "flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1732
- e
1733
- ),
1734
- ...s,
1735
- children: [
1736
- t,
1737
- /* @__PURE__ */ a.jsx(U.Icon, { asChild: !0, children: /* @__PURE__ */ a.jsx(Ks, { className: "h-4 w-4 opacity-50" }) })
1738
- ]
1739
- }
1740
- ));
1741
- Wn.displayName = U.Trigger.displayName;
1742
- const Gn = f.forwardRef(({ className: e, children: t, position: s = "popper", ...o }, n) => /* @__PURE__ */ a.jsx(U.Portal, { children: /* @__PURE__ */ a.jsx(
1743
- U.Content,
1744
- {
1745
- ref: n,
1746
- className: d(
1747
- "relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1748
- s === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1749
- e
1750
- ),
1751
- position: s,
1752
- ...o,
1753
- children: /* @__PURE__ */ a.jsx(
1754
- U.Viewport,
1755
- {
1756
- className: d(
1757
- "p-1",
1758
- s === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
1759
- ),
1760
- children: t
1761
- }
1762
- )
1763
- }
1764
- ) }));
1765
- Gn.displayName = U.Content.displayName;
1766
- const Hn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(U.Label, { ref: s, className: d("px-2 py-1.5 text-sm font-semibold", e), ...t }));
1767
- Hn.displayName = U.Label.displayName;
1768
- const qn = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1769
- U.Item,
1770
- {
1771
- ref: o,
1772
- className: d(
1773
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1774
- e
1775
- ),
1776
- ...s,
1777
- children: [
1778
- /* @__PURE__ */ a.jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(U.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
1779
- /* @__PURE__ */ a.jsx(U.ItemText, { children: t })
1780
- ]
1781
- }
1782
- ));
1783
- qn.displayName = U.Item.displayName;
1784
- const Kn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(U.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-muted", e), ...t }));
1785
- Kn.displayName = U.Separator.displayName;
1786
- const bi = P.Root, xi = P.Trigger, hi = P.Close, bs = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx(P.Portal, { className: d(e), ...t });
1787
- bs.displayName = P.Portal.displayName;
1788
- const xs = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1789
- P.Overlay,
1790
- {
1791
- className: d(
1792
- "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1793
- e
1794
- ),
1795
- ...t,
1796
- ref: s
1797
- }
1798
- ));
1799
- xs.displayName = P.Overlay.displayName;
1800
- const Jn = ge(
1801
- "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
1802
- {
1803
- variants: {
1804
- side: {
1805
- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
1806
- bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
1807
- left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
1808
- right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
1809
- }
1810
- },
1811
- defaultVariants: {
1812
- side: "right"
1813
- }
1814
- }
1815
- ), Yn = f.forwardRef(
1816
- ({ side: e = "right", className: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(bs, { children: [
1817
- /* @__PURE__ */ a.jsx(xs, {}),
1818
- /* @__PURE__ */ a.jsxs(P.Content, { ref: n, className: d(Jn({ side: e }), t), ...o, children: [
1819
- s,
1820
- /* @__PURE__ */ a.jsxs(P.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
1821
- /* @__PURE__ */ a.jsx(st, { className: "h-4 w-4" }),
1822
- /* @__PURE__ */ a.jsx("span", { className: "sr-only", children: "Close" })
1823
- ] })
1824
- ] })
1825
- ] })
1826
- );
1827
- Yn.displayName = P.Content.displayName;
1828
- const Qn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
1829
- Qn.displayName = "SheetHeader";
1830
- const Xn = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
1831
- Xn.displayName = "SheetFooter";
1832
- const Zn = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(P.Title, { ref: s, className: d("text-lg font-semibold text-foreground", e), ...t }));
1833
- Zn.displayName = P.Title.displayName;
1834
- const ea = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(P.Description, { ref: s, className: d("text-sm text-muted-foreground", e), ...t }));
1835
- ea.displayName = P.Description.displayName;
1836
- const vi = M.Root, yi = M.Trigger, wi = M.Group, Ni = M.Portal, ki = M.Sub, ji = M.RadioGroup, ta = f.forwardRef(({ className: e, inset: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1837
- M.SubTrigger,
1838
- {
1839
- ref: n,
1840
- className: d(
1841
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
1842
- t && "pl-8",
1843
- e
1844
- ),
1845
- ...o,
1846
- children: [
1847
- s,
1848
- /* @__PURE__ */ a.jsx(ot, { className: "ml-auto h-4 w-4" })
1849
- ]
1850
- }
1851
- ));
1852
- ta.displayName = M.SubTrigger.displayName;
1853
- const sa = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
1854
- M.SubContent,
1855
- {
1856
- ref: s,
1857
- className: d(
1858
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1859
- e
1860
- ),
1861
- ...t
1862
- }
1863
- ));
1864
- sa.displayName = M.SubContent.displayName;
1865
- const oa = f.forwardRef(({ className: e, sideOffset: t = 4, ...s }, o) => /* @__PURE__ */ a.jsx(M.Portal, { children: /* @__PURE__ */ a.jsx(
1866
- M.Content,
1867
- {
1868
- ref: o,
1869
- sideOffset: t,
1870
- className: d(
1871
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
1872
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1873
- e
1874
- ),
1875
- ...s
1876
- }
1877
- ) }));
1878
- oa.displayName = M.Content.displayName;
1879
- const na = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1880
- M.Item,
1881
- {
1882
- ref: o,
1883
- className: d(
1884
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1885
- t && "pl-8",
1886
- e
1887
- ),
1888
- ...s
1889
- }
1890
- ));
1891
- na.displayName = M.Item.displayName;
1892
- const aa = f.forwardRef(({ className: e, children: t, checked: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
1893
- M.CheckboxItem,
1894
- {
1895
- ref: n,
1896
- className: d(
1897
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1898
- e
1899
- ),
1900
- checked: s,
1901
- ...o,
1902
- children: [
1903
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(M.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
1904
- t
1905
- ]
1906
- }
1907
- ));
1908
- aa.displayName = M.CheckboxItem.displayName;
1909
- const ra = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
1910
- M.RadioItem,
1911
- {
1912
- ref: o,
1913
- className: d(
1914
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1915
- e
1916
- ),
1917
- ...s,
1918
- children: [
1919
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(M.ItemIndicator, { children: /* @__PURE__ */ a.jsx(nt, { className: "h-4 w-4 fill-current" }) }) }),
1920
- t
1921
- ]
1922
- }
1923
- ));
1924
- ra.displayName = M.RadioItem.displayName;
1925
- const ia = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
1926
- M.Label,
1927
- {
1928
- ref: o,
1929
- className: d("px-2 py-1.5 text-sm font-semibold", t && "pl-8", e),
1930
- ...s
1931
- }
1932
- ));
1933
- ia.displayName = M.Label.displayName;
1934
- const la = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(M.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-muted", e), ...t }));
1935
- la.displayName = M.Separator.displayName;
1936
- const ca = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest opacity-60", e), ...t });
1937
- ca.displayName = "DropdownMenuShortcut";
1938
- const da = f.forwardRef(({ className: e, orientation: t = "horizontal", decorative: s = !0, ...o }, n) => /* @__PURE__ */ a.jsx(
1939
- Gt.Root,
1940
- {
1941
- ref: n,
1942
- decorative: s,
1943
- orientation: t,
1944
- className: d("shrink-0 bg-border", t === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", e),
1945
- ...o
1946
- }
1947
- ));
1948
- da.displayName = Gt.Root.displayName;
1949
- const ua = 1, fa = 1e6;
1950
- let Ge = 0;
1951
- function ma() {
1952
- return Ge = (Ge + 1) % Number.MAX_VALUE, Ge.toString();
1953
- }
1954
- const He = /* @__PURE__ */ new Map(), Tt = (e) => {
1955
- if (He.has(e))
1956
- return;
1957
- const t = setTimeout(() => {
1958
- He.delete(e), ke({
1959
- type: "REMOVE_TOAST",
1960
- toastId: e
1961
- });
1962
- }, fa);
1963
- He.set(e, t);
1964
- }, pa = (e, t) => {
1965
- switch (t.type) {
1966
- case "ADD_TOAST":
1967
- return {
1968
- ...e,
1969
- toasts: [t.toast, ...e.toasts].slice(0, ua)
1970
- };
1971
- case "UPDATE_TOAST":
1972
- return {
1973
- ...e,
1974
- toasts: e.toasts.map((s) => s.id === t.toast.id ? { ...s, ...t.toast } : s)
1975
- };
1976
- case "DISMISS_TOAST": {
1977
- const { toastId: s } = t;
1978
- return s ? Tt(s) : e.toasts.forEach((o) => {
1979
- Tt(o.id);
1980
- }), {
1981
- ...e,
1982
- toasts: e.toasts.map(
1983
- (o) => o.id === s || s === void 0 ? {
1984
- ...o,
1985
- open: !1
1986
- } : o
1987
- )
1988
- };
1989
- }
1990
- case "REMOVE_TOAST":
1991
- return t.toastId === void 0 ? {
1992
- ...e,
1993
- toasts: []
1994
- } : {
1995
- ...e,
1996
- toasts: e.toasts.filter((s) => s.id !== t.toastId)
1997
- };
1998
- }
1999
- }, Me = [];
2000
- let De = { toasts: [] };
2001
- function ke(e) {
2002
- De = pa(De, e), Me.forEach((t) => {
2003
- t(De);
2004
- });
2005
- }
2006
- function ga({ ...e }) {
2007
- const t = ma(), s = (n) => ke({
2008
- type: "UPDATE_TOAST",
2009
- toast: { ...n, id: t }
2010
- }), o = () => ke({ type: "DISMISS_TOAST", toastId: t });
2011
- return ke({
2012
- type: "ADD_TOAST",
2013
- toast: {
2014
- ...e,
2015
- id: t,
2016
- open: !0,
2017
- onOpenChange: (n) => {
2018
- n || o();
2019
- }
2020
- }
2021
- }), {
2022
- id: t,
2023
- dismiss: o,
2024
- update: s
2025
- };
2026
- }
2027
- function hs() {
2028
- const [e, t] = f.useState(De);
2029
- return f.useEffect(() => (Me.push(t), () => {
2030
- const s = Me.indexOf(t);
2031
- s > -1 && Me.splice(s, 1);
2032
- }), [e]), {
2033
- ...e,
2034
- toast: ga,
2035
- dismiss: (s) => ke({ type: "DISMISS_TOAST", toastId: s })
2036
- };
2037
- }
2038
- const ba = Z.Provider, vs = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2039
- Z.Viewport,
2040
- {
2041
- ref: s,
2042
- className: d(
2043
- "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
2044
- e
2045
- ),
2046
- ...t
2047
- }
2048
- ));
2049
- vs.displayName = Z.Viewport.displayName;
2050
- const xa = ge(
2051
- "group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
2052
- {
2053
- variants: {
2054
- variant: {
2055
- default: "border bg-background",
2056
- destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
2057
- }
2058
- },
2059
- defaultVariants: {
2060
- variant: "default"
2061
- }
2062
- }
2063
- ), ys = f.forwardRef(({ className: e, variant: t, ...s }, o) => /* @__PURE__ */ a.jsx(Z.Root, { ref: o, className: d(xa({ variant: t }), e), ...s }));
2064
- ys.displayName = Z.Root.displayName;
2065
- const ha = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2066
- Z.Action,
2067
- {
2068
- ref: s,
2069
- className: d(
2070
- "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
2071
- e
2072
- ),
2073
- ...t
2074
- }
2075
- ));
2076
- ha.displayName = Z.Action.displayName;
2077
- const ws = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2078
- Z.Close,
2079
- {
2080
- ref: s,
2081
- className: d(
2082
- "absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
2083
- e
2084
- ),
2085
- "toast-close": "",
2086
- ...t,
2087
- children: /* @__PURE__ */ a.jsx(st, { className: "h-4 w-4" })
2088
- }
2089
- ));
2090
- ws.displayName = Z.Close.displayName;
2091
- const Ns = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Z.Title, { ref: s, className: d("text-sm font-semibold [&+div]:text-xs", e), ...t }));
2092
- Ns.displayName = Z.Title.displayName;
2093
- const ks = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Z.Description, { ref: s, className: d("text-sm opacity-90", e), ...t }));
2094
- ks.displayName = Z.Description.displayName;
2095
- function Si() {
2096
- const { toasts: e } = hs();
2097
- return /* @__PURE__ */ a.jsxs(ba, { children: [
2098
- e.map(({ id: t, title: s, description: o, action: n, ...i }) => /* @__PURE__ */ a.jsxs(ys, { ...i, children: [
2099
- /* @__PURE__ */ a.jsxs("div", { className: "grid gap-1", children: [
2100
- s && /* @__PURE__ */ a.jsx(Ns, { children: s }),
2101
- o && /* @__PURE__ */ a.jsx(ks, { children: o })
2102
- ] }),
2103
- n,
2104
- /* @__PURE__ */ a.jsx(ws, {})
2105
- ] }, t)),
2106
- /* @__PURE__ */ a.jsx(vs, {})
2107
- ] });
2108
- }
2109
- const Ai = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: d("animate-pulse rounded-md bg-primary/10", e), ...t }), js = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2110
- Q,
2111
- {
2112
- ref: s,
2113
- className: d(
2114
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
2115
- e
2116
- ),
2117
- ...t
2118
- }
2119
- ));
2120
- js.displayName = Q.displayName;
2121
- const Ci = ({ children: e, ...t }) => /* @__PURE__ */ a.jsx(us, { ...t, children: /* @__PURE__ */ a.jsx(xt, { className: "overflow-hidden p-0", children: /* @__PURE__ */ a.jsx(js, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: e }) }) }), va = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
2122
- /* @__PURE__ */ a.jsx(Js, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
2123
- /* @__PURE__ */ a.jsx(
2124
- Q.Input,
2125
- {
2126
- ref: s,
2127
- className: d(
2128
- "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
2129
- e
2130
- ),
2131
- ...t
2132
- }
2133
- )
2134
- ] }));
2135
- va.displayName = Q.Input.displayName;
2136
- const ya = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2137
- Q.List,
2138
- {
2139
- ref: s,
2140
- className: d("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
2141
- ...t
2142
- }
2143
- ));
2144
- ya.displayName = Q.List.displayName;
2145
- const wa = f.forwardRef((e, t) => /* @__PURE__ */ a.jsx(Q.Empty, { ref: t, className: "py-6 text-center text-sm", ...e }));
2146
- wa.displayName = Q.Empty.displayName;
2147
- const Na = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2148
- Q.Group,
2149
- {
2150
- ref: s,
2151
- className: d(
2152
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
2153
- e
2154
- ),
2155
- ...t
2156
- }
2157
- ));
2158
- Na.displayName = Q.Group.displayName;
2159
- const ka = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(Q.Separator, { ref: s, className: d("-mx-1 h-px bg-border", e), ...t }));
2160
- ka.displayName = Q.Separator.displayName;
2161
- const ja = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2162
- Q.Item,
2163
- {
2164
- ref: s,
2165
- className: d(
2166
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2167
- e
2168
- ),
2169
- ...t
2170
- }
2171
- ));
2172
- ja.displayName = Q.Item.displayName;
2173
- const Sa = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
2174
- Sa.displayName = "CommandShortcut";
2175
- const _i = D.Root, Bi = D.Trigger, Ri = D.Group, Pi = D.Portal, Ti = D.Sub, Ii = D.RadioGroup, Aa = f.forwardRef(({ className: e, inset: t, children: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
2176
- D.SubTrigger,
2177
- {
2178
- ref: n,
2179
- className: d(
2180
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
2181
- t && "pl-8",
2182
- e
2183
- ),
2184
- ...o,
2185
- children: [
2186
- s,
2187
- /* @__PURE__ */ a.jsx(ot, { className: "ml-auto h-4 w-4" })
2188
- ]
2189
- }
2190
- ));
2191
- Aa.displayName = D.SubTrigger.displayName;
2192
- const Ca = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
2193
- D.SubContent,
2194
- {
2195
- ref: s,
2196
- className: d(
2197
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2198
- e
2199
- ),
2200
- ...t
2201
- }
2202
- ));
2203
- Ca.displayName = D.SubContent.displayName;
2204
- const _a = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(D.Portal, { children: /* @__PURE__ */ a.jsx(
2205
- D.Content,
2206
- {
2207
- ref: s,
2208
- className: d(
2209
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2210
- e
2211
- ),
2212
- ...t
2213
- }
2214
- ) }));
2215
- _a.displayName = D.Content.displayName;
2216
- const Ba = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
2217
- D.Item,
2218
- {
2219
- ref: o,
2220
- className: d(
2221
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2222
- t && "pl-8",
2223
- e
2224
- ),
2225
- ...s
2226
- }
2227
- ));
2228
- Ba.displayName = D.Item.displayName;
2229
- const Ra = f.forwardRef(({ className: e, children: t, checked: s, ...o }, n) => /* @__PURE__ */ a.jsxs(
2230
- D.CheckboxItem,
2231
- {
2232
- ref: n,
2233
- className: d(
2234
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2235
- e
2236
- ),
2237
- checked: s,
2238
- ...o,
2239
- children: [
2240
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(D.ItemIndicator, { children: /* @__PURE__ */ a.jsx(ze, { className: "h-4 w-4" }) }) }),
2241
- t
2242
- ]
2243
- }
2244
- ));
2245
- Ra.displayName = D.CheckboxItem.displayName;
2246
- const Pa = f.forwardRef(({ className: e, children: t, ...s }, o) => /* @__PURE__ */ a.jsxs(
2247
- D.RadioItem,
2248
- {
2249
- ref: o,
2250
- className: d(
2251
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
2252
- e
2253
- ),
2254
- ...s,
2255
- children: [
2256
- /* @__PURE__ */ a.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a.jsx(D.ItemIndicator, { children: /* @__PURE__ */ a.jsx(nt, { className: "h-4 w-4 fill-current" }) }) }),
2257
- t
2258
- ]
2259
- }
2260
- ));
2261
- Pa.displayName = D.RadioItem.displayName;
2262
- const Ta = f.forwardRef(({ className: e, inset: t, ...s }, o) => /* @__PURE__ */ a.jsx(
2263
- D.Label,
2264
- {
2265
- ref: o,
2266
- className: d("px-2 py-1.5 text-sm font-semibold text-foreground", t && "pl-8", e),
2267
- ...s
2268
- }
2269
- ));
2270
- Ta.displayName = D.Label.displayName;
2271
- const Ia = f.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(D.Separator, { ref: s, className: d("-mx-1 my-1 h-px bg-border", e), ...t }));
2272
- Ia.displayName = D.Separator.displayName;
2273
- const Ma = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...t });
2274
- Ma.displayName = "ContextMenuShortcut";
2275
- const Da = (e) => {
2276
- try {
2277
- const t = document.getElementById("icon-picker-field"), s = document.createElement("div");
2278
- Xs.render(/* @__PURE__ */ a.jsx(Qs, { value: e }), s), t.appendChild(s), s.hidden = !0;
2279
- let o = s.innerHTML;
2280
- setTimeout(() => t.removeChild(s), 100);
2281
- const i = new DOMParser().parseFromString(o, "image/svg+xml"), r = i.querySelector("svg");
2282
- return r && (r.removeAttribute("width"), r.removeAttribute("height")), new XMLSerializer().serializeToString(i);
2283
- } catch (t) {
2284
- return console.error(t), "";
2285
- }
2286
- }, Mi = ({ value: e, onChange: t }) => {
2287
- const s = (o) => {
2288
- t("<svg />");
2289
- const n = Da(o);
2290
- t(n);
2291
- };
2292
- return /* @__PURE__ */ a.jsxs("div", { className: "mt-1 flex h-20 items-center gap-x-2", id: "icon-picker-field", children: [
2293
- /* @__PURE__ */ a.jsxs("div", { className: "group relative h-12 w-12", children: [
2294
- /* @__PURE__ */ a.jsx(
2295
- "div",
2296
- {
2297
- dangerouslySetInnerHTML: {
2298
- __html: e ? e.replace("<svg", '<svg class="h-5 w-5"') : "<svg class='h-5 w-5' />"
2299
- },
2300
- className: "absolute left-1/2 top-1/2 z-0 -translate-x-1/2 -translate-y-1/2 transform cursor-pointer bg-white"
2301
- }
2302
- ),
2303
- /* @__PURE__ */ a.jsx(
2304
- Ys,
2305
- {
2306
- value: e ? "BiSolidGrid" : null,
2307
- onChange: s,
2308
- pickButtonStyle: {
2309
- position: "relative",
2310
- height: "48px",
2311
- width: "48px",
2312
- border: "1px solid #BBBBBB",
2313
- display: "flex",
2314
- alignItems: "center",
2315
- justifyContent: "center",
2316
- borderRadius: "6px",
2317
- backgroundColor: "transparent",
2318
- zIndex: 1
2319
- },
2320
- searchInputStyle: {
2321
- backgroundColor: "transparent",
2322
- width: "100%",
2323
- border: "1px solid #BBBBBB",
2324
- margin: "0px 10px",
2325
- padding: "10px"
2326
- }
2327
- }
2328
- )
2329
- ] }),
2330
- /* @__PURE__ */ a.jsx(
2331
- "textarea",
2332
- {
2333
- value: e,
2334
- onChange: (o) => t(o.target.value),
2335
- className: "h-full w-full rounded-sm border border-foreground/20 px-2 py-1 text-xs shadow-sm focus:border-gray-500/80 focus:outline-none focus:ring-0",
2336
- placeholder: "Choose icon or enter svg"
2337
- }
2338
- )
2339
- ] });
2340
- }, Ea = et.lazy(() => import("./UnsplashImages-eZedbK2J.js")), Oa = et.lazy(() => import("./UploadImages-71QziLbr.js")), Ss = ({
2341
- isModalView: e = !1,
2342
- onSelect: t = () => {
2343
- }
2344
- }) => {
2345
- const [s, o] = Ce("upload");
2346
- return /* @__PURE__ */ a.jsxs("div", { className: "flex h-full flex-col", children: [
2347
- /* @__PURE__ */ a.jsx("div", { className: "flex items-center justify-between rounded-md bg-background/30 p-1", children: /* @__PURE__ */ a.jsx("h1", { className: "px-1 font-semibold", children: e ? "Select or upload images" : "Images" }) }),
2348
- /* @__PURE__ */ a.jsxs(Bn, { value: s, onValueChange: (n) => o(n), className: "flex h-full w-full flex-col py-2", children: [
2349
- /* @__PURE__ */ a.jsxs(gs, { className: "w-full", children: [
2350
- /* @__PURE__ */ a.jsx(Xe, { value: "upload", className: "w-1/2", children: "Upload" }),
2351
- /* @__PURE__ */ a.jsx(Xe, { value: "unsplash", className: "w-1/2", children: "Unsplash" })
2352
- ] }),
2353
- s === "unsplash" ? /* @__PURE__ */ a.jsx(Ze, { value: "unsplash", className: "flex h-full flex-col overflow-hidden", children: /* @__PURE__ */ a.jsx(vt, { fallback: /* @__PURE__ */ a.jsx("div", { className: "h-64 w-full animate-pulse bg-gray-100" }), children: /* @__PURE__ */ a.jsx(Ea, { isModalView: e, onSelect: t }) }) }) : /* @__PURE__ */ a.jsx(Ze, { value: "upload", className: "flex h-full flex-col overflow-hidden", children: /* @__PURE__ */ a.jsx(vt, { fallback: /* @__PURE__ */ a.jsx("div", { className: "h-64 w-full animate-pulse bg-gray-100" }), children: /* @__PURE__ */ a.jsx(Oa, { isModalView: e, onSelect: t }) }) })
2354
- ] })
2355
- ] });
2356
- }, Di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2357
- __proto__: null,
2358
- default: Ss
2359
- }, Symbol.toStringTag, { value: "Module" })), It = ({ children: e, onSelect: t }) => {
2360
- const [s, o] = Ce(!1), n = (...i) => {
2361
- t.call(void 0, ...i), o(!1);
2362
- };
2363
- return /* @__PURE__ */ a.jsxs(us, { open: s, onOpenChange: (i) => o(i), children: [
2364
- /* @__PURE__ */ a.jsx(mn, { asChild: !0, children: e }),
2365
- /* @__PURE__ */ a.jsx(xt, { className: "flex h-3/4 max-w-5xl", children: /* @__PURE__ */ a.jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ a.jsx(Ss, { isModalView: !0, onSelect: n }) }) })
2366
- ] });
2367
- }, Ei = ({ value: e, onChange: t, id: s, onBlur: o }) => /* @__PURE__ */ a.jsxs("div", { className: "mt-1.5 flex items-center gap-x-3", children: [
2368
- e ? /* @__PURE__ */ a.jsx("img", { src: e, className: "h-20 w-20 overflow-hidden rounded-md border object-cover", alt: "" }) : /* @__PURE__ */ a.jsx(It, { onSelect: t, children: /* @__PURE__ */ a.jsx("div", { className: "h-20 w-20 cursor-pointer rounded-md border bg-[radial-gradient(#AAA,transparent_1px)] duration-300 [background-size:10px_10px] hover:border-gray-400" }) }),
2369
- /* @__PURE__ */ a.jsxs("div", { className: "flex w-3/5 flex-col", children: [
2370
- /* @__PURE__ */ a.jsx(It, { onSelect: t, children: /* @__PURE__ */ a.jsx("small", { className: "cursor-pointer rounded-full bg-gray-600 px-2 py-1 text-center text-xs text-white hover:bg-gray-500 dark:bg-gray-700", children: e || !_e(e) ? "Replace Image" : "Choose Image" }) }),
2371
- /* @__PURE__ */ a.jsx("small", { className: "-pl-4 pt-2 text-center text-xs text-gray-600", children: "OR" }),
2372
- /* @__PURE__ */ a.jsx(
2373
- "input",
2374
- {
2375
- type: "url",
2376
- className: "text-xs",
2377
- placeholder: "Enter image URL",
2378
- value: e,
2379
- onBlur: ({ target: { value: n } }) => o(s, n),
2380
- onChange: (n) => t(n.target.value)
2381
- }
2382
- )
2383
- ] })
2384
- ] }), Oi = ({ id: e, placeholder: t, value: s, onChange: o, onBlur: n }) => {
2385
- const i = {
2386
- toolbar: [
2387
- ["bold", "italic", "underline", "strike", "blockquote"],
2388
- [{ list: "ordered" }, { list: "bullet" }],
2389
- [{ color: [] }, { background: [] }, { align: [] }],
2390
- ["link", "clean"]
2391
- ]
2392
- }, r = [
2393
- "header",
2394
- "font",
2395
- "list",
2396
- "bold",
2397
- "italic",
2398
- "underline",
2399
- "strike",
2400
- "blockquote",
2401
- "color",
2402
- "background",
2403
- "align",
2404
- "link",
2405
- "image"
2406
- ];
2407
- return typeof window > "u" ? null : /* @__PURE__ */ a.jsx(
2408
- Zs,
2409
- {
2410
- id: e,
2411
- value: s,
2412
- onBlur: (c) => n(e, c),
2413
- onChange: (c) => o(c),
2414
- modules: i,
2415
- formats: r,
2416
- placeholder: t,
2417
- className: "mt-1 rounded-md"
2418
- }
2419
- );
2420
- }, Li = ({ schema: e, formData: t, onChange: s }) => {
2421
- const [o, n] = Ce([]), i = Ne("getPages", () => []), { type: r = "page", href: c = "", target: p = "self" } = t;
2422
- return Ae(() => {
2423
- (async () => {
2424
- const l = await i();
2425
- n(l || []);
2426
- })();
2427
- }, []), /* @__PURE__ */ a.jsxs("div", { children: [
2428
- /* @__PURE__ */ a.jsx("span", { className: "text-xs font-medium", children: (e == null ? void 0 : e.title) ?? "Link" }),
2429
- /* @__PURE__ */ a.jsxs("div", { className: "flex flex-col gap-y-1.5", children: [
2430
- /* @__PURE__ */ a.jsx("select", { name: "type", value: r, onChange: (l) => s({ ...t, type: l.target.value }), children: [
2431
- { const: "page", title: "Open Page" },
2432
- { const: "url", title: "Open URL" },
2433
- { const: "email", title: "Compose Email" },
2434
- { const: "telephone", title: "Call Phone" },
2435
- { const: "scroll", title: "Scroll to element" }
2436
- ].map((l) => /* @__PURE__ */ a.jsx("option", { value: l.const, children: l.title }, l.const)) }),
2437
- r === "page" ? /* @__PURE__ */ a.jsxs(
2438
- "select",
2439
- {
2440
- name: "href",
2441
- placeholder: "Choose Page",
2442
- value: c,
2443
- onChange: (l) => s({ ...t, href: l.target.value }),
2444
- children: [
2445
- /* @__PURE__ */ a.jsx("option", { value: "", children: "Choose page" }),
2446
- I(o, (l) => /* @__PURE__ */ a.jsx("option", { value: l.slug, children: l.name }, l.uuid))
2447
- ]
2448
- }
2449
- ) : /* @__PURE__ */ a.jsx(
2450
- "input",
2451
- {
2452
- name: "href",
2453
- type: "text",
2454
- value: c,
2455
- onChange: (l) => s({ ...t, href: l.target.value }),
2456
- placeholder: r === "page" || r === "url" ? "Enter URL" : r === "scroll" ? "#ElementID" : "Enter detail"
2457
- }
2458
- ),
2459
- (r === "page" || r === "url") && /* @__PURE__ */ a.jsxs("div", { className: "flex items-center gap-x-2", children: [
2460
- /* @__PURE__ */ a.jsx(
2461
- "input",
2462
- {
2463
- type: "checkbox",
2464
- defaultChecked: p === "_blank",
2465
- className: "cursor-pointer rounded-md border border-border",
2466
- onChange: () => s({ ...t, target: p === "_blank" ? "_self" : "_blank" })
2467
- }
2468
- ),
2469
- /* @__PURE__ */ a.jsx("span", { className: "pt-1 text-xs", children: "Open in new tab" })
2470
- ] })
2471
- ] })
2472
- ] });
2473
- }, zi = () => {
2474
- const [e] = ye(), [, t] = $e(), { addBlocks: s } = xe(), { toast: o } = hs(), n = $(
2475
- (r, c, p) => {
2476
- var v;
2477
- for (let S = 0; S < r.length; S++) {
2478
- const { _id: L } = r[S];
2479
- r[S]._id = de();
2480
- const F = E(r, { _parent: L });
2481
- for (let _ = 0; _ < F.length; _++)
2482
- F[_]._parent = r[S]._id;
2483
- }
2484
- const l = ee(r);
2485
- let m, N;
2486
- return c && (m = oe(e, { _id: c }), r[0]._parent = c, N = c), !(m ? _t(m._type, l._type) : !0) && m && (r[0]._parent = m._parent, N = m._parent), s(r, N, p), t([(v = ee(r)) == null ? void 0 : v._id]), ee(r);
2487
- },
2488
- [e, t]
2489
- );
2490
- return { addCoreBlock: $(
2491
- (r, c, p) => {
2492
- if (pe(r, "blocks")) {
2493
- const _ = r.blocks;
2494
- return n(_, c, p);
2495
- }
2496
- const l = de(), m = ss(r.props), N = [];
2497
- Vt(m, (_, T) => {
2498
- if ($t(_, Ke)) {
2499
- const G = _.replace(Ke, "");
2500
- N.push({
2501
- _id: G,
2502
- _type: "Slot",
2503
- _parent: l,
2504
- _name: r.props[T].name,
2505
- _styles: r.props[T].styles,
2506
- _emptyStyles: r.props[T].emptyStyles
2507
- });
2508
- }
2509
- });
2510
- const j = {
2511
- _type: r.type,
2512
- _id: l,
2513
- ...m
2514
- };
2515
- let v, S;
2516
- if (c && (v = oe(e, { _id: c }), j._parent = c, S = c), !ko(v == null ? void 0 : v._type, r.type)) {
2517
- o({
2518
- variant: "destructive",
2519
- title: "Error",
2520
- description: `"${r.type}" cannot be added under "${v ? v == null ? void 0 : v._type : "root"}"`
2521
- }), t([]);
2522
- return;
2523
- }
2524
- !(v ? _t(v._type, r.type) : !0) && v && (j._parent = v._parent, S = v._parent);
2525
- const F = [j, ...N];
2526
- return s(F, S, p), t([j._id]), j;
2527
- },
2528
- [n, e, t]
2529
- ), addPredefinedBlock: n };
2530
- }, Mt = {
2531
- xs: 420,
2532
- sm: 620,
2533
- md: 768,
2534
- lg: 1024,
2535
- xl: 1280,
2536
- "2xl": 1536
2537
- }, Dt = ["xs", "sm", "md", "lg", "xl", "2xl"];
2538
- function La(e, t) {
2539
- if (t === null)
2540
- return "baseClasses";
2541
- const s = t.mq;
2542
- if (s === "xs" || t.dark || t.mod !== "")
2543
- return "classes";
2544
- let o = "baseClasses", n = Dt.indexOf(s);
2545
- for (; n > 0; ) {
2546
- const i = Dt[n - 1];
2547
- if (oe(e, {
2548
- mq: i,
2549
- property: t.property
2550
- })) {
2551
- o = "classes";
2552
- break;
2553
- }
2554
- n--;
2555
- }
2556
- return o;
2557
- }
2558
- const Et = [];
2559
- function za(e = "", t = "", s = []) {
2560
- e = e.trim().replace(/ +/g, "");
2561
- let o = E(
2562
- I(e.split(" "), Ie),
2563
- (l) => !qe(l)
2564
- ), n = E(I(t.split(" "), Ie), (l) => !qe(l));
2565
- n = E(
2566
- n,
2567
- (l) => !Y(Et, l.property)
2568
- );
2569
- const i = [], r = [];
2570
- ce(s, (l) => {
2571
- const m = Ie(l), N = oe(o, yt(m, ["dark", "mq", "mod", "property"]));
2572
- if (N && (o = E(
2573
- o,
2574
- (j) => j.fullCls !== (N == null ? void 0 : N.fullCls)
2575
- )), i.push(m), m.mq === "xs" && !m.dark && m.mod === "" && (n = E(n, (j) => j.property !== m.property)), La(o, m) === "baseClasses" && !Y(Et, m.property)) {
2576
- const j = oe(n, yt(m, ["property"]));
2577
- N && (n = E(
2578
- n,
2579
- (v) => v.fullCls !== (j == null ? void 0 : j.fullCls)
2580
- )), r.push({
2581
- ...m,
2582
- fullCls: m.cls,
2583
- mq: "xs"
2584
- });
2585
- }
2586
- });
2587
- const c = I(
2588
- wt([...o, ...i], (l) => Mt[l.mq]),
2589
- "fullCls"
2590
- ).join(" ");
2591
- return `${I(
2592
- wt([...n, ...r], (l) => Mt[l.mq]),
2593
- "fullCls"
2594
- ).join(" ").trim()},${c.trim()}`.trim().replace(/ +/g, "");
2595
- }
2596
- const Pe = w([]);
2597
- Pe.debugLabel = "selectedStylingBlocksAtom";
2598
- const Va = () => O(Pe), $a = (e) => {
2599
- const t = e.replace(fe, "").split(",");
2600
- return { baseClasses: t[0], classes: t[1] };
2601
- }, Fa = w(null, (e, t, { blockIds: s, newClasses: o }) => {
2602
- const n = E(
2603
- e(rt),
2604
- (r) => (
2605
- // @ts-ignore
2606
- s.includes(e(r)._id)
2607
- )
2608
- ), i = ee(e(Pe));
2609
- return I(n, (r) => {
2610
- const c = e(r), p = J(c, i.prop, `${fe},`), { baseClasses: l, classes: m } = $a(p);
2611
- return {
2612
- ids: [c._id],
2613
- props: { [i.prop]: `${fe}${za(m, l, o)}` }
2614
- };
2615
- });
2616
- }), Vi = () => {
2617
- const e = Be(Fa), { updateBlocks: t, updateBlocksRuntime: s } = xe();
2618
- return $(
2619
- (o, n, i = !1) => {
2620
- const r = e({ blockIds: o, newClasses: n });
2621
- if (!i) {
2622
- s(o, r[0].props);
2623
- return;
2624
- }
2625
- t(o, r[0].props);
2626
- },
2627
- [e]
2628
- );
2629
- }, Ua = () => O(ts), As = Re("canvasWidth", 800), Cs = w((e) => {
2630
- const t = e(As);
2631
- return Us(t).toLowerCase();
2632
- }), $i = () => {
2633
- const [e, t] = O(As), s = te(Cs), [o, n] = Ua();
2634
- return Ae(() => {
2635
- o !== "xs" && n(s);
2636
- }, [s, o, n]), [e, s, t];
2637
- }, Wa = Re("canvasZoom", 100), Fi = () => O(Wa), _s = w([]), Ga = () => {
2638
- const [e, t] = O(_s), s = Be(ht), o = $(
2639
- (n) => {
2640
- t(n), s([]);
2641
- },
2642
- [t, s]
2643
- );
2644
- return [e, o];
2645
- }, ht = w([]), Ui = () => {
2646
- const [e, t] = O(ht), s = Be(_s), o = $(
2647
- (n) => {
2648
- t(n), s([]);
2649
- },
2650
- [t, s]
2651
- );
2652
- return [e, o];
2653
- }, Bs = Re("darkMode", !1), Wi = () => {
2654
- const [e, t] = O(Bs);
2655
- return [e, t];
2656
- }, Ha = () => {
2657
- const [e] = ye(), [, t] = $e(), { addBlocks: s } = xe();
2658
- return $(
2659
- (o, n = null) => {
2660
- const i = [];
2661
- ce(o, (r) => {
2662
- const c = e.find((j) => j._id === r);
2663
- n || (n = c._parent);
2664
- const m = E(
2665
- e,
2666
- (j) => Lt(n) ? j._parent === n : !c._parent
2667
- ).indexOf(c) + 1, N = jo(e, r, n);
2668
- s(N, n, m), i.push(J(N, "0._id", ""));
2669
- }), t(i);
2670
- },
2671
- [e, t]
2672
- );
2673
- }, qa = w([]), Gi = () => {
2674
- const [e, t] = O(qa), s = $(
2675
- (o) => {
2676
- t((n) => Y(n, o) ? zt(n, o) : [...n, o]);
2677
- },
2678
- [t]
2679
- );
2680
- return [e, t, s];
2681
- }, Ka = w(""), Ja = () => O(Ka), Ya = () => {
2682
- const e = te(ie);
2683
- return $(
2684
- (t, s) => {
2685
- const o = I(e, (n) => (Y(t, J(n, "_id")) && je(n, "_parent", s), n));
2686
- console.log("newBlocks", o);
2687
- },
2688
- [e]
2689
- );
2690
- }, Hi = () => {
2691
- console.warn("usePasteBlocks is not implemented");
2692
- const e = te(ht), [t, s] = Ga(), o = Ha(), n = Ya();
2693
- return {
2694
- canPaste: zs(
2695
- () => t.length > 0 || e.length > 0,
2696
- [e, t]
2697
- ),
2698
- pasteBlocks: $(
2699
- (r) => {
2700
- _e(e) ? n(t, r) : o(e, r), s(() => []);
2701
- },
2702
- [t, e, o, n, s]
2703
- )
2704
- };
2705
- }, Qa = w(!1), qi = () => {
2706
- const [e, t] = O(Qa);
2707
- return [e, t];
2708
- }, Xa = w(null, (e, t, { blockIds: s, fullClasses: o }) => {
2709
- const n = ee(e(Pe)), i = E(
2710
- e(rt),
2711
- (r) => (
2712
- // @ts-ignore
2713
- s.includes(e(r)._id)
2714
- )
2715
- );
2716
- return I(i, (r) => {
2717
- const c = e(r), p = o;
2718
- let { classes: l, baseClasses: m } = No(J(c, n.prop, "styles:,"));
2719
- return ce(p, (N) => {
2720
- const j = new RegExp(`(^| )${N.replace("[", "\\[").replace("]", "\\]")}($| )`, "g");
2721
- l = l.replace(j, " ").replace(/ +/g, " ").trim();
2722
- const v = ee(N.split(":"));
2723
- Y(["2xl", "xl", "lg", "md", "sm"], v) && p.push(N.split(":").pop().trim());
2724
- }), ce(p, (N) => {
2725
- const j = new RegExp(`(^| )${N.replace("[", "\\[").replace("]", "\\]")}($| )`, "g");
2726
- m = m.replace(j, " ").replace(/ +/g, " ").trim();
2727
- }), {
2728
- ids: [c._id],
2729
- props: {
2730
- [n.prop]: `${fe}${m},${l}`
2731
- }
2732
- };
2733
- });
2734
- }), Ki = () => {
2735
- const { updateBlocks: e } = xe(), t = Be(Xa);
2736
- return $(
2737
- (s, o) => {
2738
- const n = t({ blockIds: s, fullClasses: o });
2739
- e(s, n[0].props);
2740
- },
2741
- [t]
2742
- );
2743
- }, Rs = w((e) => {
2744
- const t = ee(e(Pe)), s = e(ct);
2745
- if (!t || t.blockId !== J(s, "_id", null))
2746
- return [];
2747
- const n = J(s, t.prop, `${fe},`).replace(fe, "").split(",").join(" ");
2748
- return E(I(n.trim().split(" "), Ie), (i) => !qe(i));
2749
- }), Ji = () => te(Rs), Ot = { xs: 0, sm: 1, md: 2, lg: 3, xl: 4, "2xl": 5 }, Za = w((e) => {
2750
- const t = e(Cs), s = e(dt), o = e(Bs), n = er(t);
2751
- let i = E(e(Rs), { mod: s });
2752
- return $t(s, "_") || (i = E(i, (r) => n.includes(r.mq))), i = i.sort((r, c) => Ot[r.mq] - Ot[c.mq]), o || (i = E(i, { dark: !1 })), i;
2753
- }), er = (e) => {
2754
- let t = [];
2755
- switch (e) {
2756
- case "xs":
2757
- t = ["xs"];
2758
- break;
2759
- case "sm":
2760
- t = ["xs", "sm"];
2761
- break;
2762
- case "md":
2763
- t = ["xs", "sm", "md"];
2764
- break;
2765
- case "lg":
2766
- t = ["xs", "sm", "md", "lg"];
2767
- break;
2768
- case "xl":
2769
- t = ["xs", "sm", "md", "lg", "xl"];
2770
- break;
2771
- case "2xl":
2772
- t = ["xs", "sm", "md", "lg", "xl", "2xl"];
2773
- break;
2774
- default:
2775
- t = ["xs"];
2776
- break;
2777
- }
2778
- return t;
2779
- }, Yi = () => te(Za), Qi = () => O(dt), Xi = () => {
2780
- const { updateBlocks: e } = xe();
2781
- return $(
2782
- (t, s, o) => {
2783
- e(t, s, o);
2784
- },
2785
- [e]
2786
- );
2787
- }, Zi = () => {
2788
- const { updateBlocksRuntime: e } = xe();
2789
- return $(
2790
- (t, s) => {
2791
- e(t, s);
2792
- },
2793
- [e]
2794
- );
2795
- }, Ps = {
2796
- name: "",
2797
- props: {},
2798
- modalProps: {},
2799
- backdropClose: !0
2800
- }, tr = w(Ps), el = () => {
2801
- const [e, t] = O(tr), s = $(
2802
- (n, i = {}, r = {}) => {
2803
- t({ name: n, props: i, modalProps: r });
2804
- },
2805
- [t]
2806
- ), o = $(
2807
- (...n) => {
2808
- J(e, "props.onClose", () => {
2809
- })(...n), t(Ps);
2810
- },
2811
- [t, e]
2812
- );
2813
- return {
2814
- activeModal: e,
2815
- openModal: s,
2816
- closeModal: o
2817
- };
2818
- }, tl = () => (console.warn("useAllBlocks is deprecated, use useBlocksStore() instead"), te(ie)), Ts = w(!1);
2819
- Ts.debugLabel = "readOnlyModeAtom";
2820
- const sr = w("online");
2821
- sr.debugLabel = "networkModeAtom";
2822
- const or = w(!1);
2823
- or.debugLabel = "codeEditorOpenAtom";
2824
- const nr = w(!1);
2825
- nr.debugLabel = "editLayerNameAtom";
2826
- const ar = w("");
2827
- ar.debugLabel = "activeLanguageAtom";
2828
- const rr = w("");
2829
- rr.debugLabel = "primaryLanguageAtom";
2830
- const ir = w(null);
2831
- ir.debugLabel = "canvasIframeAtom";
2832
- const lr = w("outline");
2833
- lr.debugLabel = "activePanelAtom";
2834
- const cr = w("");
2835
- cr.debugLabel = "showPredefinedBlockCategoryAtom";
2836
- const Is = w({ undoCount: 0, redoCount: 0 });
2837
- Is.debugLabel = "historyStatesAtom";
2838
- const dr = w("");
2839
- dr.debugLabel = "inlineEditingActiveAtom";
2840
- const ur = w(!1);
2841
- ur.debugLabel = "draggingFlagAtom";
2842
- const fr = w("");
2843
- fr.debugLabel = "draggedBlockIdAtom";
2844
- const sl = () => te(Ts), mr = w(""), pr = w(null), ol = () => O(mr), nl = () => O(pr), gr = Re("selectedBreakpoints", ["XS", "MD", "XL"]), al = () => {
2845
- const [e, t] = O(gr);
2846
- return [e, t];
2847
- }, rl = () => {
2848
- const e = Be(Is), { clear: t } = ls(), [, s] = $e(), [, o] = Ja(), [, n] = Va();
2849
- return () => {
2850
- s([]), n([]), o(""), t(), e({ undoCount: 0, redoCount: 0 });
2851
- };
2852
- }, br = w([]), il = () => {
2853
- const [e, t] = Ce(!1), [s, o] = O(br), n = Ne("getUILibraryBlocks", () => []);
2854
- return Ae(() => {
2855
- (async () => s.length > 0 || (t(!0), o(await n()), t(!1)))();
2856
- }, []), { data: s, isLoading: e };
2857
- }, ll = () => {
2858
- const [e, t] = Ce(null), s = $(async (o) => {
2859
- if (!(navigator != null && navigator.clipboard))
2860
- return console.warn("Clipboard not supported"), !1;
2861
- try {
2862
- return await navigator.clipboard.writeText(o), t(o), !0;
2863
- } catch (n) {
2864
- return console.warn("Copy failed", n), t(null), !1;
2865
- }
2866
- }, []);
2867
- return [e, s];
2868
- };
2869
- export {
2870
- Yi as $,
2871
- Xr as A,
2872
- Yo as B,
2873
- pt as C,
2874
- $r as D,
2875
- ye as E,
2876
- os as F,
2877
- Kt as G,
2878
- is as H,
2879
- Si as I,
2880
- sl as J,
2881
- el as K,
2882
- zi as L,
2883
- Vi as M,
2884
- $i as N,
2885
- Fi as O,
2886
- Ui as P,
2887
- ll as Q,
2888
- Lo as R,
2889
- Ai as S,
2890
- ti as T,
2891
- Ga as U,
2892
- Wi as V,
2893
- Fo as W,
2894
- Gi as X,
2895
- Ja as Y,
2896
- Hi as Z,
2897
- Ki as _,
2898
- Zr as a,
2899
- wa as a$,
2900
- Ji as a0,
2901
- Gr as a1,
2902
- Ua as a2,
2903
- il as a3,
2904
- Qi as a4,
2905
- Xi as a5,
2906
- Zi as a6,
2907
- Wr as a7,
2908
- tl as a8,
2909
- ol as a9,
2910
- da as aA,
2911
- An as aB,
2912
- Jo as aC,
2913
- ui as aD,
2914
- fi as aE,
2915
- Un as aF,
2916
- vi as aG,
2917
- yi as aH,
2918
- oa as aI,
2919
- ia as aJ,
2920
- la as aK,
2921
- aa as aL,
2922
- xe as aM,
2923
- ur as aN,
2924
- dr as aO,
2925
- nr as aP,
2926
- fr as aQ,
2927
- Fr as aR,
2928
- Ur as aS,
2929
- sr as aT,
2930
- ir as aU,
2931
- ni as aV,
2932
- ai as aW,
2933
- Pn as aX,
2934
- js as aY,
2935
- va as aZ,
2936
- ya as a_,
2937
- nl as aa,
2938
- al as ab,
2939
- Va as ac,
2940
- us as ad,
2941
- xt as ae,
2942
- pn as af,
2943
- bn as ag,
2944
- xn as ah,
2945
- un as ai,
2946
- mi as aj,
2947
- Wn as ak,
2948
- gi as al,
2949
- Gn as am,
2950
- qn as an,
2951
- mn as ao,
2952
- si as ap,
2953
- oi as aq,
2954
- Rn as ar,
2955
- Qr as as,
2956
- lr as at,
2957
- Bn as au,
2958
- gs as av,
2959
- Xe as aw,
2960
- Ze as ax,
2961
- pi as ay,
2962
- Hn as az,
2963
- an as b,
2964
- Qn as b$,
2965
- Na as b0,
2966
- ja as b1,
2967
- gn as b2,
2968
- Rt as b3,
2969
- Bt as b4,
2970
- Oi as b5,
2971
- Mi as b6,
2972
- Ei as b7,
2973
- Li as b8,
2974
- Yr as b9,
2975
- qo as bA,
2976
- bt as bB,
2977
- on as bC,
2978
- nn as bD,
2979
- yn as bE,
2980
- ps as bF,
2981
- Tn as bG,
2982
- ri as bH,
2983
- In as bI,
2984
- En as bJ,
2985
- On as bK,
2986
- $n as bL,
2987
- Vn as bM,
2988
- Ln as bN,
2989
- di as bO,
2990
- zn as bP,
2991
- li as bQ,
2992
- Dn as bR,
2993
- Mn as bS,
2994
- ii as bT,
2995
- ci as bU,
2996
- Fn as bV,
2997
- Kn as bW,
2998
- bi as bX,
2999
- xi as bY,
3000
- hi as bZ,
3001
- Yn as b_,
3002
- Qo as ba,
3003
- Xo as bb,
3004
- Zo as bc,
3005
- jn as bd,
3006
- ei as be,
3007
- _n as bf,
3008
- wi as bg,
3009
- na as bh,
3010
- ca as bi,
3011
- hn as bj,
3012
- vn as bk,
3013
- wn as bl,
3014
- Nn as bm,
3015
- Cn as bn,
3016
- kn as bo,
3017
- tn as bp,
3018
- sn as bq,
3019
- cr as br,
3020
- Ba as bs,
3021
- _a as bt,
3022
- _i as bu,
3023
- Bi as bv,
3024
- _t as bw,
3025
- So as bx,
3026
- qr as by,
3027
- Ko as bz,
3028
- rn as c,
3029
- Xn as c0,
3030
- Zn as c1,
3031
- ea as c2,
3032
- ra as c3,
3033
- Ni as c4,
3034
- ki as c5,
3035
- sa as c6,
3036
- ta as c7,
3037
- ji as c8,
3038
- pa as c9,
3039
- hs as ca,
3040
- ga as cb,
3041
- Ci as cc,
3042
- Sa as cd,
3043
- ka as ce,
3044
- Ra as cf,
3045
- Pa as cg,
3046
- Ta as ch,
3047
- Ia as ci,
3048
- Ma as cj,
3049
- Ri as ck,
3050
- Pi as cl,
3051
- Ti as cm,
3052
- Ca as cn,
3053
- Aa as co,
3054
- Ii as cp,
3055
- Di as cq,
3056
- cn as d,
3057
- dn as e,
3058
- ln as f,
3059
- fn as g,
3060
- Ne as h,
3061
- Ht as i,
3062
- zr as j,
3063
- no as k,
3064
- ae as l,
3065
- fo as m,
3066
- uo as n,
3067
- Re as o,
3068
- Vr as p,
3069
- qi as q,
3070
- $e as r,
3071
- Jr as s,
3072
- Ha as t,
3073
- rl as u,
3074
- ls as v,
3075
- ie as w,
3076
- wo as x,
3077
- Uo as y,
3078
- Kr as z
3079
- };