@chaibuilder/sdk 1.2.8 → 1.2.10

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