@chaibuilder/sdk 1.0.13 → 1.0.15

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