@chaibuilder/pages 0.1.0-beta.4 → 0.1.0-beta.40

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.
@@ -0,0 +1,4935 @@
1
+ var xs = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var ps = (e, t, n) => t.has(e) || xs("Cannot " + n);
5
+ var C = (e, t, n) => (ps(e, t, "read from private field"), n ? n.call(e) : t.get(e)), U = (e, t, n) => t.has(e) ? xs("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), G = (e, t, n, s) => (ps(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
6
+ import * as ie from "react";
7
+ import ln, { useCallback as Dt, useState as $, useEffect as Se, useMemo as ce, useRef as Ls } from "react";
8
+ import { useQueryClient as ge, onlineManager as Us, useQuery as ve, useMutation as be, QueryClient as ni, QueryClientProvider as si } from "@tanstack/react-query";
9
+ import { loadWebBlocks as ri } from "@chaibuilder/sdk/web-blocks";
10
+ import { getBlocksFromHTML as ii, useLanguages as cn, useRightPanel as ai, useSavePage as oi, mergeClasses as li, ChaiBuilderEditor as ci } from "@chaibuilder/sdk";
11
+ import { get as K, find as Ce, isEmpty as Y, filter as fe, includes as Ee, startCase as Pe, reverse as ui, sortBy as fi, isEqual as Ve, startsWith as en, map as de, toLower as yt, trim as di, orderBy as xt, first as hi, concat as gi, debounce as mi, groupBy as yi, uniq as xi, pick as pi, compact as vi, isString as vs } from "lodash-es";
12
+ import { atom as bi, useAtom as wi } from "jotai";
13
+ import { useToast as Te, Accordion as Ei, AccordionItem as qt, AccordionTrigger as Vt, AccordionContent as Kt, Label as Z, Input as le, Textarea as Wt, Button as V, Dialog as Ge, DialogContent as De, DialogHeader as Le, DialogTitle as Ue, DialogDescription as ot, Alert as ji, DialogFooter as lt, DropdownMenu as Mn, DropdownMenuTrigger as $n, DropdownMenuContent as qn, DropdownMenuItem as xe, TooltipProvider as Si, Tooltip as Ni, TooltipTrigger as Ci, TooltipContent as Ti, Badge as bs, Sheet as Ai, SheetContent as ki } from "@chaibuilder/sdk/ui";
14
+ import { AlertCircle as Pi, StarIcon as _i, MoreVertical as Oi, PencilIcon as Ii, Power as Fs, Link as Bs, TrashIcon as Ri, GlobeIcon as Gi, File as Xt, Eye as Di, Palette as Li, Check as ws, Loader as Ms, Rocket as Ui, Send as Fi, Settings as Bi, Search as Mi, ChevronRight as $i, ChevronDown as $s, Database as qi, Folder as Vi, Plus as Es, Globe as Ki, MoreHorizontal as Wi, Pencil as zi, Trash as Hi, Logs as Qi, LanguagesIcon as An, Star as Yi } from "lucide-react";
15
+ var kn = { exports: {} }, gt = {};
16
+ /**
17
+ * @license React
18
+ * react-jsx-runtime.production.min.js
19
+ *
20
+ * Copyright (c) Facebook, Inc. and its affiliates.
21
+ *
22
+ * This source code is licensed under the MIT license found in the
23
+ * LICENSE file in the root directory of this source tree.
24
+ */
25
+ var js;
26
+ function Ji() {
27
+ if (js) return gt;
28
+ js = 1;
29
+ var e = ln, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
30
+ function o(l, u, f) {
31
+ var h, d = {}, p = null, E = null;
32
+ f !== void 0 && (p = "" + f), u.key !== void 0 && (p = "" + u.key), u.ref !== void 0 && (E = u.ref);
33
+ for (h in u) s.call(u, h) && !a.hasOwnProperty(h) && (d[h] = u[h]);
34
+ if (l && l.defaultProps) for (h in u = l.defaultProps, u) d[h] === void 0 && (d[h] = u[h]);
35
+ return { $$typeof: t, type: l, key: p, ref: E, props: d, _owner: i.current };
36
+ }
37
+ return gt.Fragment = n, gt.jsx = o, gt.jsxs = o, gt;
38
+ }
39
+ var mt = {};
40
+ /**
41
+ * @license React
42
+ * react-jsx-runtime.development.js
43
+ *
44
+ * Copyright (c) Facebook, Inc. and its affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */
49
+ var Ss;
50
+ function Xi() {
51
+ return Ss || (Ss = 1, process.env.NODE_ENV !== "production" && function() {
52
+ var e = ln, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), l = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), S = Symbol.iterator, y = "@@iterator";
53
+ function x(c) {
54
+ if (c === null || typeof c != "object")
55
+ return null;
56
+ var g = S && c[S] || c[y];
57
+ return typeof g == "function" ? g : null;
58
+ }
59
+ var v = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
60
+ function b(c) {
61
+ {
62
+ for (var g = arguments.length, m = new Array(g > 1 ? g - 1 : 0), N = 1; N < g; N++)
63
+ m[N - 1] = arguments[N];
64
+ q("error", c, m);
65
+ }
66
+ }
67
+ function q(c, g, m) {
68
+ {
69
+ var N = v.ReactDebugCurrentFrame, R = N.getStackAddendum();
70
+ R !== "" && (g += "%s", m = m.concat([R]));
71
+ var M = m.map(function(_) {
72
+ return String(_);
73
+ });
74
+ M.unshift("Warning: " + g), Function.prototype.apply.call(console[c], console, M);
75
+ }
76
+ }
77
+ var H = !1, O = !1, j = !1, L = !1, he = !1, w;
78
+ w = Symbol.for("react.module.reference");
79
+ function P(c) {
80
+ return !!(typeof c == "string" || typeof c == "function" || c === s || c === a || he || c === i || c === f || c === h || L || c === E || H || O || j || typeof c == "object" && c !== null && (c.$$typeof === p || c.$$typeof === d || c.$$typeof === o || c.$$typeof === l || c.$$typeof === u || // This needs to include all possible module reference object
81
+ // types supported by any Flight configuration anywhere since
82
+ // we don't know which Flight build this will end up being used
83
+ // with.
84
+ c.$$typeof === w || c.getModuleId !== void 0));
85
+ }
86
+ function D(c, g, m) {
87
+ var N = c.displayName;
88
+ if (N)
89
+ return N;
90
+ var R = g.displayName || g.name || "";
91
+ return R !== "" ? m + "(" + R + ")" : m;
92
+ }
93
+ function oe(c) {
94
+ return c.displayName || "Context";
95
+ }
96
+ function se(c) {
97
+ if (c == null)
98
+ return null;
99
+ if (typeof c.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof c == "function")
100
+ return c.displayName || c.name || null;
101
+ if (typeof c == "string")
102
+ return c;
103
+ switch (c) {
104
+ case s:
105
+ return "Fragment";
106
+ case n:
107
+ return "Portal";
108
+ case a:
109
+ return "Profiler";
110
+ case i:
111
+ return "StrictMode";
112
+ case f:
113
+ return "Suspense";
114
+ case h:
115
+ return "SuspenseList";
116
+ }
117
+ if (typeof c == "object")
118
+ switch (c.$$typeof) {
119
+ case l:
120
+ var g = c;
121
+ return oe(g) + ".Consumer";
122
+ case o:
123
+ var m = c;
124
+ return oe(m._context) + ".Provider";
125
+ case u:
126
+ return D(c, c.render, "ForwardRef");
127
+ case d:
128
+ var N = c.displayName || null;
129
+ return N !== null ? N : se(c.type) || "Memo";
130
+ case p: {
131
+ var R = c, M = R._payload, _ = R._init;
132
+ try {
133
+ return se(_(M));
134
+ } catch {
135
+ return null;
136
+ }
137
+ }
138
+ }
139
+ return null;
140
+ }
141
+ var Ae = Object.assign, ft = 0, Qn, Yn, Jn, Xn, Zn, es, ts;
142
+ function ns() {
143
+ }
144
+ ns.__reactDisabledLog = !0;
145
+ function kr() {
146
+ {
147
+ if (ft === 0) {
148
+ Qn = console.log, Yn = console.info, Jn = console.warn, Xn = console.error, Zn = console.group, es = console.groupCollapsed, ts = console.groupEnd;
149
+ var c = {
150
+ configurable: !0,
151
+ enumerable: !0,
152
+ value: ns,
153
+ writable: !0
154
+ };
155
+ Object.defineProperties(console, {
156
+ info: c,
157
+ log: c,
158
+ warn: c,
159
+ error: c,
160
+ group: c,
161
+ groupCollapsed: c,
162
+ groupEnd: c
163
+ });
164
+ }
165
+ ft++;
166
+ }
167
+ }
168
+ function Pr() {
169
+ {
170
+ if (ft--, ft === 0) {
171
+ var c = {
172
+ configurable: !0,
173
+ enumerable: !0,
174
+ writable: !0
175
+ };
176
+ Object.defineProperties(console, {
177
+ log: Ae({}, c, {
178
+ value: Qn
179
+ }),
180
+ info: Ae({}, c, {
181
+ value: Yn
182
+ }),
183
+ warn: Ae({}, c, {
184
+ value: Jn
185
+ }),
186
+ error: Ae({}, c, {
187
+ value: Xn
188
+ }),
189
+ group: Ae({}, c, {
190
+ value: Zn
191
+ }),
192
+ groupCollapsed: Ae({}, c, {
193
+ value: es
194
+ }),
195
+ groupEnd: Ae({}, c, {
196
+ value: ts
197
+ })
198
+ });
199
+ }
200
+ ft < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
201
+ }
202
+ }
203
+ var mn = v.ReactCurrentDispatcher, yn;
204
+ function Ft(c, g, m) {
205
+ {
206
+ if (yn === void 0)
207
+ try {
208
+ throw Error();
209
+ } catch (R) {
210
+ var N = R.stack.trim().match(/\n( *(at )?)/);
211
+ yn = N && N[1] || "";
212
+ }
213
+ return `
214
+ ` + yn + c;
215
+ }
216
+ }
217
+ var xn = !1, Bt;
218
+ {
219
+ var _r = typeof WeakMap == "function" ? WeakMap : Map;
220
+ Bt = new _r();
221
+ }
222
+ function ss(c, g) {
223
+ if (!c || xn)
224
+ return "";
225
+ {
226
+ var m = Bt.get(c);
227
+ if (m !== void 0)
228
+ return m;
229
+ }
230
+ var N;
231
+ xn = !0;
232
+ var R = Error.prepareStackTrace;
233
+ Error.prepareStackTrace = void 0;
234
+ var M;
235
+ M = mn.current, mn.current = null, kr();
236
+ try {
237
+ if (g) {
238
+ var _ = function() {
239
+ throw Error();
240
+ };
241
+ if (Object.defineProperty(_.prototype, "props", {
242
+ set: function() {
243
+ throw Error();
244
+ }
245
+ }), typeof Reflect == "object" && Reflect.construct) {
246
+ try {
247
+ Reflect.construct(_, []);
248
+ } catch (re) {
249
+ N = re;
250
+ }
251
+ Reflect.construct(c, [], _);
252
+ } else {
253
+ try {
254
+ _.call();
255
+ } catch (re) {
256
+ N = re;
257
+ }
258
+ c.call(_.prototype);
259
+ }
260
+ } else {
261
+ try {
262
+ throw Error();
263
+ } catch (re) {
264
+ N = re;
265
+ }
266
+ c();
267
+ }
268
+ } catch (re) {
269
+ if (re && N && typeof re.stack == "string") {
270
+ for (var k = re.stack.split(`
271
+ `), ne = N.stack.split(`
272
+ `), W = k.length - 1, Q = ne.length - 1; W >= 1 && Q >= 0 && k[W] !== ne[Q]; )
273
+ Q--;
274
+ for (; W >= 1 && Q >= 0; W--, Q--)
275
+ if (k[W] !== ne[Q]) {
276
+ if (W !== 1 || Q !== 1)
277
+ do
278
+ if (W--, Q--, Q < 0 || k[W] !== ne[Q]) {
279
+ var ue = `
280
+ ` + k[W].replace(" at new ", " at ");
281
+ return c.displayName && ue.includes("<anonymous>") && (ue = ue.replace("<anonymous>", c.displayName)), typeof c == "function" && Bt.set(c, ue), ue;
282
+ }
283
+ while (W >= 1 && Q >= 0);
284
+ break;
285
+ }
286
+ }
287
+ } finally {
288
+ xn = !1, mn.current = M, Pr(), Error.prepareStackTrace = R;
289
+ }
290
+ var Me = c ? c.displayName || c.name : "", ke = Me ? Ft(Me) : "";
291
+ return typeof c == "function" && Bt.set(c, ke), ke;
292
+ }
293
+ function Or(c, g, m) {
294
+ return ss(c, !1);
295
+ }
296
+ function Ir(c) {
297
+ var g = c.prototype;
298
+ return !!(g && g.isReactComponent);
299
+ }
300
+ function Mt(c, g, m) {
301
+ if (c == null)
302
+ return "";
303
+ if (typeof c == "function")
304
+ return ss(c, Ir(c));
305
+ if (typeof c == "string")
306
+ return Ft(c);
307
+ switch (c) {
308
+ case f:
309
+ return Ft("Suspense");
310
+ case h:
311
+ return Ft("SuspenseList");
312
+ }
313
+ if (typeof c == "object")
314
+ switch (c.$$typeof) {
315
+ case u:
316
+ return Or(c.render);
317
+ case d:
318
+ return Mt(c.type, g, m);
319
+ case p: {
320
+ var N = c, R = N._payload, M = N._init;
321
+ try {
322
+ return Mt(M(R), g, m);
323
+ } catch {
324
+ }
325
+ }
326
+ }
327
+ return "";
328
+ }
329
+ var dt = Object.prototype.hasOwnProperty, rs = {}, is = v.ReactDebugCurrentFrame;
330
+ function $t(c) {
331
+ if (c) {
332
+ var g = c._owner, m = Mt(c.type, c._source, g ? g.type : null);
333
+ is.setExtraStackFrame(m);
334
+ } else
335
+ is.setExtraStackFrame(null);
336
+ }
337
+ function Rr(c, g, m, N, R) {
338
+ {
339
+ var M = Function.call.bind(dt);
340
+ for (var _ in c)
341
+ if (M(c, _)) {
342
+ var k = void 0;
343
+ try {
344
+ if (typeof c[_] != "function") {
345
+ var ne = Error((N || "React class") + ": " + m + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof c[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
346
+ throw ne.name = "Invariant Violation", ne;
347
+ }
348
+ k = c[_](g, _, N, m, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
349
+ } catch (W) {
350
+ k = W;
351
+ }
352
+ k && !(k instanceof Error) && ($t(R), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", N || "React class", m, _, typeof k), $t(null)), k instanceof Error && !(k.message in rs) && (rs[k.message] = !0, $t(R), b("Failed %s type: %s", m, k.message), $t(null));
353
+ }
354
+ }
355
+ }
356
+ var Gr = Array.isArray;
357
+ function pn(c) {
358
+ return Gr(c);
359
+ }
360
+ function Dr(c) {
361
+ {
362
+ var g = typeof Symbol == "function" && Symbol.toStringTag, m = g && c[Symbol.toStringTag] || c.constructor.name || "Object";
363
+ return m;
364
+ }
365
+ }
366
+ function Lr(c) {
367
+ try {
368
+ return as(c), !1;
369
+ } catch {
370
+ return !0;
371
+ }
372
+ }
373
+ function as(c) {
374
+ return "" + c;
375
+ }
376
+ function os(c) {
377
+ if (Lr(c))
378
+ return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Dr(c)), as(c);
379
+ }
380
+ var ht = v.ReactCurrentOwner, Ur = {
381
+ key: !0,
382
+ ref: !0,
383
+ __self: !0,
384
+ __source: !0
385
+ }, ls, cs, vn;
386
+ vn = {};
387
+ function Fr(c) {
388
+ if (dt.call(c, "ref")) {
389
+ var g = Object.getOwnPropertyDescriptor(c, "ref").get;
390
+ if (g && g.isReactWarning)
391
+ return !1;
392
+ }
393
+ return c.ref !== void 0;
394
+ }
395
+ function Br(c) {
396
+ if (dt.call(c, "key")) {
397
+ var g = Object.getOwnPropertyDescriptor(c, "key").get;
398
+ if (g && g.isReactWarning)
399
+ return !1;
400
+ }
401
+ return c.key !== void 0;
402
+ }
403
+ function Mr(c, g) {
404
+ if (typeof c.ref == "string" && ht.current && g && ht.current.stateNode !== g) {
405
+ var m = se(ht.current.type);
406
+ vn[m] || (b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', se(ht.current.type), c.ref), vn[m] = !0);
407
+ }
408
+ }
409
+ function $r(c, g) {
410
+ {
411
+ var m = function() {
412
+ ls || (ls = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", g));
413
+ };
414
+ m.isReactWarning = !0, Object.defineProperty(c, "key", {
415
+ get: m,
416
+ configurable: !0
417
+ });
418
+ }
419
+ }
420
+ function qr(c, g) {
421
+ {
422
+ var m = function() {
423
+ cs || (cs = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", g));
424
+ };
425
+ m.isReactWarning = !0, Object.defineProperty(c, "ref", {
426
+ get: m,
427
+ configurable: !0
428
+ });
429
+ }
430
+ }
431
+ var Vr = function(c, g, m, N, R, M, _) {
432
+ var k = {
433
+ // This tag allows us to uniquely identify this as a React Element
434
+ $$typeof: t,
435
+ // Built-in properties that belong on the element
436
+ type: c,
437
+ key: g,
438
+ ref: m,
439
+ props: _,
440
+ // Record the component responsible for creating this element.
441
+ _owner: M
442
+ };
443
+ return k._store = {}, Object.defineProperty(k._store, "validated", {
444
+ configurable: !1,
445
+ enumerable: !1,
446
+ writable: !0,
447
+ value: !1
448
+ }), Object.defineProperty(k, "_self", {
449
+ configurable: !1,
450
+ enumerable: !1,
451
+ writable: !1,
452
+ value: N
453
+ }), Object.defineProperty(k, "_source", {
454
+ configurable: !1,
455
+ enumerable: !1,
456
+ writable: !1,
457
+ value: R
458
+ }), Object.freeze && (Object.freeze(k.props), Object.freeze(k)), k;
459
+ };
460
+ function Kr(c, g, m, N, R) {
461
+ {
462
+ var M, _ = {}, k = null, ne = null;
463
+ m !== void 0 && (os(m), k = "" + m), Br(g) && (os(g.key), k = "" + g.key), Fr(g) && (ne = g.ref, Mr(g, R));
464
+ for (M in g)
465
+ dt.call(g, M) && !Ur.hasOwnProperty(M) && (_[M] = g[M]);
466
+ if (c && c.defaultProps) {
467
+ var W = c.defaultProps;
468
+ for (M in W)
469
+ _[M] === void 0 && (_[M] = W[M]);
470
+ }
471
+ if (k || ne) {
472
+ var Q = typeof c == "function" ? c.displayName || c.name || "Unknown" : c;
473
+ k && $r(_, Q), ne && qr(_, Q);
474
+ }
475
+ return Vr(c, k, ne, R, N, ht.current, _);
476
+ }
477
+ }
478
+ var bn = v.ReactCurrentOwner, us = v.ReactDebugCurrentFrame;
479
+ function Be(c) {
480
+ if (c) {
481
+ var g = c._owner, m = Mt(c.type, c._source, g ? g.type : null);
482
+ us.setExtraStackFrame(m);
483
+ } else
484
+ us.setExtraStackFrame(null);
485
+ }
486
+ var wn;
487
+ wn = !1;
488
+ function En(c) {
489
+ return typeof c == "object" && c !== null && c.$$typeof === t;
490
+ }
491
+ function fs() {
492
+ {
493
+ if (bn.current) {
494
+ var c = se(bn.current.type);
495
+ if (c)
496
+ return `
497
+
498
+ Check the render method of \`` + c + "`.";
499
+ }
500
+ return "";
501
+ }
502
+ }
503
+ function Wr(c) {
504
+ return "";
505
+ }
506
+ var ds = {};
507
+ function zr(c) {
508
+ {
509
+ var g = fs();
510
+ if (!g) {
511
+ var m = typeof c == "string" ? c : c.displayName || c.name;
512
+ m && (g = `
513
+
514
+ Check the top-level render call using <` + m + ">.");
515
+ }
516
+ return g;
517
+ }
518
+ }
519
+ function hs(c, g) {
520
+ {
521
+ if (!c._store || c._store.validated || c.key != null)
522
+ return;
523
+ c._store.validated = !0;
524
+ var m = zr(g);
525
+ if (ds[m])
526
+ return;
527
+ ds[m] = !0;
528
+ var N = "";
529
+ c && c._owner && c._owner !== bn.current && (N = " It was passed a child from " + se(c._owner.type) + "."), Be(c), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', m, N), Be(null);
530
+ }
531
+ }
532
+ function gs(c, g) {
533
+ {
534
+ if (typeof c != "object")
535
+ return;
536
+ if (pn(c))
537
+ for (var m = 0; m < c.length; m++) {
538
+ var N = c[m];
539
+ En(N) && hs(N, g);
540
+ }
541
+ else if (En(c))
542
+ c._store && (c._store.validated = !0);
543
+ else if (c) {
544
+ var R = x(c);
545
+ if (typeof R == "function" && R !== c.entries)
546
+ for (var M = R.call(c), _; !(_ = M.next()).done; )
547
+ En(_.value) && hs(_.value, g);
548
+ }
549
+ }
550
+ }
551
+ function Hr(c) {
552
+ {
553
+ var g = c.type;
554
+ if (g == null || typeof g == "string")
555
+ return;
556
+ var m;
557
+ if (typeof g == "function")
558
+ m = g.propTypes;
559
+ else if (typeof g == "object" && (g.$$typeof === u || // Note: Memo only checks outer props here.
560
+ // Inner props are checked in the reconciler.
561
+ g.$$typeof === d))
562
+ m = g.propTypes;
563
+ else
564
+ return;
565
+ if (m) {
566
+ var N = se(g);
567
+ Rr(m, c.props, "prop", N, c);
568
+ } else if (g.PropTypes !== void 0 && !wn) {
569
+ wn = !0;
570
+ var R = se(g);
571
+ b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", R || "Unknown");
572
+ }
573
+ typeof g.getDefaultProps == "function" && !g.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
574
+ }
575
+ }
576
+ function Qr(c) {
577
+ {
578
+ for (var g = Object.keys(c.props), m = 0; m < g.length; m++) {
579
+ var N = g[m];
580
+ if (N !== "children" && N !== "key") {
581
+ Be(c), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", N), Be(null);
582
+ break;
583
+ }
584
+ }
585
+ c.ref !== null && (Be(c), b("Invalid attribute `ref` supplied to `React.Fragment`."), Be(null));
586
+ }
587
+ }
588
+ var ms = {};
589
+ function ys(c, g, m, N, R, M) {
590
+ {
591
+ var _ = P(c);
592
+ if (!_) {
593
+ var k = "";
594
+ (c === void 0 || typeof c == "object" && c !== null && Object.keys(c).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
595
+ var ne = Wr();
596
+ ne ? k += ne : k += fs();
597
+ var W;
598
+ c === null ? W = "null" : pn(c) ? W = "array" : c !== void 0 && c.$$typeof === t ? (W = "<" + (se(c.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : W = typeof c, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", W, k);
599
+ }
600
+ var Q = Kr(c, g, m, R, M);
601
+ if (Q == null)
602
+ return Q;
603
+ if (_) {
604
+ var ue = g.children;
605
+ if (ue !== void 0)
606
+ if (N)
607
+ if (pn(ue)) {
608
+ for (var Me = 0; Me < ue.length; Me++)
609
+ gs(ue[Me], c);
610
+ Object.freeze && Object.freeze(ue);
611
+ } else
612
+ b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
613
+ else
614
+ gs(ue, c);
615
+ }
616
+ if (dt.call(g, "key")) {
617
+ var ke = se(c), re = Object.keys(g).filter(function(ti) {
618
+ return ti !== "key";
619
+ }), jn = re.length > 0 ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}";
620
+ if (!ms[ke + jn]) {
621
+ var ei = re.length > 0 ? "{" + re.join(": ..., ") + ": ...}" : "{}";
622
+ b(`A props object containing a "key" prop is being spread into JSX:
623
+ let props = %s;
624
+ <%s {...props} />
625
+ React keys must be passed directly to JSX without using spread:
626
+ let props = %s;
627
+ <%s key={someKey} {...props} />`, jn, ke, ei, ke), ms[ke + jn] = !0;
628
+ }
629
+ }
630
+ return c === s ? Qr(Q) : Hr(Q), Q;
631
+ }
632
+ }
633
+ function Yr(c, g, m) {
634
+ return ys(c, g, m, !0);
635
+ }
636
+ function Jr(c, g, m) {
637
+ return ys(c, g, m, !1);
638
+ }
639
+ var Xr = Jr, Zr = Yr;
640
+ mt.Fragment = s, mt.jsx = Xr, mt.jsxs = Zr;
641
+ }()), mt;
642
+ }
643
+ process.env.NODE_ENV === "production" ? kn.exports = Ji() : kn.exports = Xi();
644
+ var r = kn.exports, A = {
645
+ context: void 0,
646
+ registry: void 0,
647
+ getContextId() {
648
+ return Ns(this.context.count);
649
+ },
650
+ getNextContextId() {
651
+ return Ns(this.context.count++);
652
+ }
653
+ };
654
+ function Ns(e) {
655
+ const t = String(e), n = t.length - 1;
656
+ return A.context.id + (n ? String.fromCharCode(96 + n) : "") + t;
657
+ }
658
+ function pt(e) {
659
+ A.context = e;
660
+ }
661
+ var Zi = (e, t) => e === t, tn = Symbol("solid-proxy"), qs = Symbol("solid-track"), nn = {
662
+ equals: Zi
663
+ }, Vs = Ys, we = 1, sn = 2, Ks = {
664
+ owned: null,
665
+ cleanups: null,
666
+ context: null,
667
+ owner: null
668
+ }, Sn = {}, I = null, Nn = null, ea = null, F = null, te = null, pe = null, un = 0;
669
+ function Ie(e, t) {
670
+ const n = F, s = I, i = e.length === 0, a = t === void 0 ? s : t, o = i ? Ks : {
671
+ owned: null,
672
+ cleanups: null,
673
+ context: a ? a.context : null,
674
+ owner: a
675
+ }, l = i ? e : () => e(() => ee(() => dn(o)));
676
+ I = o, F = null;
677
+ try {
678
+ return ye(l, !0);
679
+ } finally {
680
+ F = n, I = s;
681
+ }
682
+ }
683
+ function z(e, t) {
684
+ t = t ? Object.assign({}, nn, t) : nn;
685
+ const n = {
686
+ value: e,
687
+ observers: null,
688
+ observerSlots: null,
689
+ comparator: t.equals || void 0
690
+ }, s = (i) => (typeof i == "function" && (i = i(n.value)), Qs(n, i));
691
+ return [Hs.bind(n), s];
692
+ }
693
+ function Cs(e, t, n) {
694
+ const s = fn(e, t, !0, we);
695
+ ct(s);
696
+ }
697
+ function Re(e, t, n) {
698
+ const s = fn(e, t, !1, we);
699
+ ct(s);
700
+ }
701
+ function Ws(e, t, n) {
702
+ Vs = ua;
703
+ const s = fn(e, t, !1, we);
704
+ (!n || !n.render) && (s.user = !0), pe ? pe.push(s) : ct(s);
705
+ }
706
+ function ae(e, t, n) {
707
+ n = n ? Object.assign({}, nn, n) : nn;
708
+ const s = fn(e, t, !0, 0);
709
+ return s.observers = null, s.observerSlots = null, s.comparator = n.equals || void 0, ct(s), Hs.bind(s);
710
+ }
711
+ function ta(e) {
712
+ return e && typeof e == "object" && "then" in e;
713
+ }
714
+ function na(e, t, n) {
715
+ let s, i, a;
716
+ arguments.length === 2 && typeof t == "object" || arguments.length === 1 ? (s = !0, i = e, a = {}) : (s = e, i = t, a = {});
717
+ let o = null, l = Sn, u = null, f = !1, h = "initialValue" in a, d = typeof s == "function" && ae(s);
718
+ const p = /* @__PURE__ */ new Set(), [E, S] = (a.storage || z)(a.initialValue), [y, x] = z(void 0), [v, b] = z(void 0, {
719
+ equals: !1
720
+ }), [q, H] = z(h ? "ready" : "unresolved");
721
+ if (A.context) {
722
+ u = A.getNextContextId();
723
+ let w;
724
+ a.ssrLoadFrom === "initial" ? l = a.initialValue : A.load && (w = A.load(u)) && (l = w);
725
+ }
726
+ function O(w, P, D, oe) {
727
+ return o === w && (o = null, oe !== void 0 && (h = !0), (w === l || P === l) && a.onHydrated && queueMicrotask(() => a.onHydrated(oe, {
728
+ value: P
729
+ })), l = Sn, j(P, D)), P;
730
+ }
731
+ function j(w, P) {
732
+ ye(() => {
733
+ P === void 0 && S(() => w), H(P !== void 0 ? "errored" : h ? "ready" : "unresolved"), x(P);
734
+ for (const D of p.keys())
735
+ D.decrement();
736
+ p.clear();
737
+ }, !1);
738
+ }
739
+ function L() {
740
+ const w = oa, P = E(), D = y();
741
+ if (D !== void 0 && !o)
742
+ throw D;
743
+ return F && !F.user && w && Cs(() => {
744
+ v(), o && (w.resolved || p.has(w) || (w.increment(), p.add(w)));
745
+ }), P;
746
+ }
747
+ function he(w = !0) {
748
+ if (w !== !1 && f)
749
+ return;
750
+ f = !1;
751
+ const P = d ? d() : s;
752
+ if (P == null || P === !1) {
753
+ O(o, ee(E));
754
+ return;
755
+ }
756
+ const D = l !== Sn ? l : ee(() => i(P, {
757
+ value: E(),
758
+ refetching: w
759
+ }));
760
+ return ta(D) ? (o = D, "value" in D ? (D.status === "success" ? O(o, D.value, void 0, P) : O(o, void 0, Pn(D.value), P), D) : (f = !0, queueMicrotask(() => f = !1), ye(() => {
761
+ H(h ? "refreshing" : "pending"), b();
762
+ }, !1), D.then((oe) => O(D, oe, void 0, P), (oe) => O(D, void 0, Pn(oe), P)))) : (O(o, D, void 0, P), D);
763
+ }
764
+ return Object.defineProperties(L, {
765
+ state: {
766
+ get: () => q()
767
+ },
768
+ error: {
769
+ get: () => y()
770
+ },
771
+ loading: {
772
+ get() {
773
+ const w = q();
774
+ return w === "pending" || w === "refreshing";
775
+ }
776
+ },
777
+ latest: {
778
+ get() {
779
+ if (!h)
780
+ return L();
781
+ const w = y();
782
+ if (w && !o)
783
+ throw w;
784
+ return E();
785
+ }
786
+ }
787
+ }), d ? Cs(() => he(!1)) : he(!1), [L, {
788
+ refetch: he,
789
+ mutate: S
790
+ }];
791
+ }
792
+ function ml(e) {
793
+ return ye(e, !1);
794
+ }
795
+ function ee(e) {
796
+ if (F === null)
797
+ return e();
798
+ const t = F;
799
+ F = null;
800
+ try {
801
+ return e();
802
+ } finally {
803
+ F = t;
804
+ }
805
+ }
806
+ function yl(e, t, n) {
807
+ const s = Array.isArray(e);
808
+ let i, a = n && n.defer;
809
+ return (o) => {
810
+ let l;
811
+ if (s) {
812
+ l = Array(e.length);
813
+ for (let f = 0; f < e.length; f++)
814
+ l[f] = e[f]();
815
+ } else
816
+ l = e();
817
+ if (a)
818
+ return a = !1, o;
819
+ const u = ee(() => t(l, i, o));
820
+ return i = l, u;
821
+ };
822
+ }
823
+ function sa(e) {
824
+ Ws(() => ee(e));
825
+ }
826
+ function wt(e) {
827
+ return I === null || (I.cleanups === null ? I.cleanups = [e] : I.cleanups.push(e)), e;
828
+ }
829
+ function Ts() {
830
+ return I;
831
+ }
832
+ function ra(e, t) {
833
+ const n = I, s = F;
834
+ I = e, F = null;
835
+ try {
836
+ return ye(t, !0);
837
+ } catch (i) {
838
+ Vn(i);
839
+ } finally {
840
+ I = n, F = s;
841
+ }
842
+ }
843
+ function ia(e) {
844
+ const t = F, n = I;
845
+ return Promise.resolve().then(() => {
846
+ F = t, I = n;
847
+ let s;
848
+ return ye(e, !1), F = I = null, s ? s.done : void 0;
849
+ });
850
+ }
851
+ var [aa, xl] = /* @__PURE__ */ z(!1);
852
+ function pl() {
853
+ return [aa, ia];
854
+ }
855
+ function vl(e, t) {
856
+ const n = Symbol("context");
857
+ return {
858
+ id: n,
859
+ Provider: fa(n),
860
+ defaultValue: e
861
+ };
862
+ }
863
+ function bl(e) {
864
+ let t;
865
+ return I && I.context && (t = I.context[e.id]) !== void 0 ? t : e.defaultValue;
866
+ }
867
+ function zs(e) {
868
+ const t = ae(e), n = ae(() => _n(t()));
869
+ return n.toArray = () => {
870
+ const s = n();
871
+ return Array.isArray(s) ? s : s != null ? [s] : [];
872
+ }, n;
873
+ }
874
+ var oa;
875
+ function Hs() {
876
+ if (this.sources && this.state)
877
+ if (this.state === we)
878
+ ct(this);
879
+ else {
880
+ const e = te;
881
+ te = null, ye(() => an(this), !1), te = e;
882
+ }
883
+ if (F) {
884
+ const e = this.observers ? this.observers.length : 0;
885
+ F.sources ? (F.sources.push(this), F.sourceSlots.push(e)) : (F.sources = [this], F.sourceSlots = [e]), this.observers ? (this.observers.push(F), this.observerSlots.push(F.sources.length - 1)) : (this.observers = [F], this.observerSlots = [F.sources.length - 1]);
886
+ }
887
+ return this.value;
888
+ }
889
+ function Qs(e, t, n) {
890
+ let s = e.value;
891
+ return (!e.comparator || !e.comparator(s, t)) && (e.value = t, e.observers && e.observers.length && ye(() => {
892
+ for (let i = 0; i < e.observers.length; i += 1) {
893
+ const a = e.observers[i], o = Nn && Nn.running;
894
+ o && Nn.disposed.has(a), (o ? !a.tState : !a.state) && (a.pure ? te.push(a) : pe.push(a), a.observers && Js(a)), o || (a.state = we);
895
+ }
896
+ if (te.length > 1e6)
897
+ throw te = [], new Error();
898
+ }, !1)), t;
899
+ }
900
+ function ct(e) {
901
+ if (!e.fn)
902
+ return;
903
+ dn(e);
904
+ const t = un;
905
+ la(e, e.value, t);
906
+ }
907
+ function la(e, t, n) {
908
+ let s;
909
+ const i = I, a = F;
910
+ F = I = e;
911
+ try {
912
+ s = e.fn(t);
913
+ } catch (o) {
914
+ return e.pure && (e.state = we, e.owned && e.owned.forEach(dn), e.owned = null), e.updatedAt = n + 1, Vn(o);
915
+ } finally {
916
+ F = a, I = i;
917
+ }
918
+ (!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? Qs(e, s) : e.value = s, e.updatedAt = n);
919
+ }
920
+ function fn(e, t, n, s = we, i) {
921
+ const a = {
922
+ fn: e,
923
+ state: s,
924
+ updatedAt: null,
925
+ owned: null,
926
+ sources: null,
927
+ sourceSlots: null,
928
+ cleanups: null,
929
+ value: t,
930
+ owner: I,
931
+ context: I ? I.context : null,
932
+ pure: n
933
+ };
934
+ return I === null || I !== Ks && (I.owned ? I.owned.push(a) : I.owned = [a]), a;
935
+ }
936
+ function rn(e) {
937
+ if (e.state === 0)
938
+ return;
939
+ if (e.state === sn)
940
+ return an(e);
941
+ if (e.suspense && ee(e.suspense.inFallback))
942
+ return e.suspense.effects.push(e);
943
+ const t = [e];
944
+ for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < un); )
945
+ e.state && t.push(e);
946
+ for (let n = t.length - 1; n >= 0; n--)
947
+ if (e = t[n], e.state === we)
948
+ ct(e);
949
+ else if (e.state === sn) {
950
+ const s = te;
951
+ te = null, ye(() => an(e, t[0]), !1), te = s;
952
+ }
953
+ }
954
+ function ye(e, t) {
955
+ if (te)
956
+ return e();
957
+ let n = !1;
958
+ t || (te = []), pe ? n = !0 : pe = [], un++;
959
+ try {
960
+ const s = e();
961
+ return ca(n), s;
962
+ } catch (s) {
963
+ n || (pe = null), te = null, Vn(s);
964
+ }
965
+ }
966
+ function ca(e) {
967
+ if (te && (Ys(te), te = null), e)
968
+ return;
969
+ const t = pe;
970
+ pe = null, t.length && ye(() => Vs(t), !1);
971
+ }
972
+ function Ys(e) {
973
+ for (let t = 0; t < e.length; t++)
974
+ rn(e[t]);
975
+ }
976
+ function ua(e) {
977
+ let t, n = 0;
978
+ for (t = 0; t < e.length; t++) {
979
+ const s = e[t];
980
+ s.user ? e[n++] = s : rn(s);
981
+ }
982
+ if (A.context) {
983
+ if (A.count) {
984
+ A.effects || (A.effects = []), A.effects.push(...e.slice(0, n));
985
+ return;
986
+ } else A.effects && (e = [...A.effects, ...e], n += A.effects.length, delete A.effects);
987
+ pt();
988
+ }
989
+ for (t = 0; t < n; t++)
990
+ rn(e[t]);
991
+ }
992
+ function an(e, t) {
993
+ e.state = 0;
994
+ for (let n = 0; n < e.sources.length; n += 1) {
995
+ const s = e.sources[n];
996
+ if (s.sources) {
997
+ const i = s.state;
998
+ i === we ? s !== t && (!s.updatedAt || s.updatedAt < un) && rn(s) : i === sn && an(s, t);
999
+ }
1000
+ }
1001
+ }
1002
+ function Js(e) {
1003
+ for (let t = 0; t < e.observers.length; t += 1) {
1004
+ const n = e.observers[t];
1005
+ n.state || (n.state = sn, n.pure ? te.push(n) : pe.push(n), n.observers && Js(n));
1006
+ }
1007
+ }
1008
+ function dn(e) {
1009
+ let t;
1010
+ if (e.sources)
1011
+ for (; e.sources.length; ) {
1012
+ const n = e.sources.pop(), s = e.sourceSlots.pop(), i = n.observers;
1013
+ if (i && i.length) {
1014
+ const a = i.pop(), o = n.observerSlots.pop();
1015
+ s < i.length && (a.sourceSlots[o] = s, i[s] = a, n.observerSlots[s] = o);
1016
+ }
1017
+ }
1018
+ if (e.owned) {
1019
+ for (t = e.owned.length - 1; t >= 0; t--)
1020
+ dn(e.owned[t]);
1021
+ e.owned = null;
1022
+ }
1023
+ if (e.cleanups) {
1024
+ for (t = e.cleanups.length - 1; t >= 0; t--)
1025
+ e.cleanups[t]();
1026
+ e.cleanups = null;
1027
+ }
1028
+ e.state = 0;
1029
+ }
1030
+ function Pn(e) {
1031
+ return e instanceof Error ? e : new Error(typeof e == "string" ? e : "Unknown error", {
1032
+ cause: e
1033
+ });
1034
+ }
1035
+ function Vn(e, t = I) {
1036
+ throw Pn(e);
1037
+ }
1038
+ function _n(e) {
1039
+ if (typeof e == "function" && !e.length)
1040
+ return _n(e());
1041
+ if (Array.isArray(e)) {
1042
+ const t = [];
1043
+ for (let n = 0; n < e.length; n++) {
1044
+ const s = _n(e[n]);
1045
+ Array.isArray(s) ? t.push.apply(t, s) : t.push(s);
1046
+ }
1047
+ return t;
1048
+ }
1049
+ return e;
1050
+ }
1051
+ function fa(e, t) {
1052
+ return function(s) {
1053
+ let i;
1054
+ return Re(() => i = ee(() => (I.context = {
1055
+ ...I.context,
1056
+ [e]: s.value
1057
+ }, zs(() => s.children))), void 0), i;
1058
+ };
1059
+ }
1060
+ var On = Symbol("fallback");
1061
+ function on(e) {
1062
+ for (let t = 0; t < e.length; t++)
1063
+ e[t]();
1064
+ }
1065
+ function da(e, t, n = {}) {
1066
+ let s = [], i = [], a = [], o = 0, l = t.length > 1 ? [] : null;
1067
+ return wt(() => on(a)), () => {
1068
+ let u = e() || [], f = u.length, h, d;
1069
+ return u[qs], ee(() => {
1070
+ let E, S, y, x, v, b, q, H, O;
1071
+ if (f === 0)
1072
+ o !== 0 && (on(a), a = [], s = [], i = [], o = 0, l && (l = [])), n.fallback && (s = [On], i[0] = Ie((j) => (a[0] = j, n.fallback())), o = 1);
1073
+ else if (o === 0) {
1074
+ for (i = new Array(f), d = 0; d < f; d++)
1075
+ s[d] = u[d], i[d] = Ie(p);
1076
+ o = f;
1077
+ } else {
1078
+ for (y = new Array(f), x = new Array(f), l && (v = new Array(f)), b = 0, q = Math.min(o, f); b < q && s[b] === u[b]; b++)
1079
+ ;
1080
+ for (q = o - 1, H = f - 1; q >= b && H >= b && s[q] === u[H]; q--, H--)
1081
+ y[H] = i[q], x[H] = a[q], l && (v[H] = l[q]);
1082
+ for (E = /* @__PURE__ */ new Map(), S = new Array(H + 1), d = H; d >= b; d--)
1083
+ O = u[d], h = E.get(O), S[d] = h === void 0 ? -1 : h, E.set(O, d);
1084
+ for (h = b; h <= q; h++)
1085
+ O = s[h], d = E.get(O), d !== void 0 && d !== -1 ? (y[d] = i[h], x[d] = a[h], l && (v[d] = l[h]), d = S[d], E.set(O, d)) : a[h]();
1086
+ for (d = b; d < f; d++)
1087
+ d in y ? (i[d] = y[d], a[d] = x[d], l && (l[d] = v[d], l[d](d))) : i[d] = Ie(p);
1088
+ i = i.slice(0, o = f), s = u.slice(0);
1089
+ }
1090
+ return i;
1091
+ });
1092
+ function p(E) {
1093
+ if (a[d] = E, l) {
1094
+ const [S, y] = z(d);
1095
+ return l[d] = y, t(u[d], S);
1096
+ }
1097
+ return t(u[d]);
1098
+ }
1099
+ };
1100
+ }
1101
+ function ha(e, t, n = {}) {
1102
+ let s = [], i = [], a = [], o = [], l = 0, u;
1103
+ return wt(() => on(a)), () => {
1104
+ const f = e() || [], h = f.length;
1105
+ return f[qs], ee(() => {
1106
+ if (h === 0)
1107
+ return l !== 0 && (on(a), a = [], s = [], i = [], l = 0, o = []), n.fallback && (s = [On], i[0] = Ie((p) => (a[0] = p, n.fallback())), l = 1), i;
1108
+ for (s[0] === On && (a[0](), a = [], s = [], i = [], l = 0), u = 0; u < h; u++)
1109
+ u < s.length && s[u] !== f[u] ? o[u](() => f[u]) : u >= s.length && (i[u] = Ie(d));
1110
+ for (; u < s.length; u++)
1111
+ a[u]();
1112
+ return l = o.length = a.length = h, s = f.slice(0), i = i.slice(0, l);
1113
+ });
1114
+ function d(p) {
1115
+ a[u] = p;
1116
+ const [E, S] = z(f[u]);
1117
+ return o[u] = S, t(E, u);
1118
+ }
1119
+ };
1120
+ }
1121
+ function Xs(e, t) {
1122
+ return ee(() => e(t || {}));
1123
+ }
1124
+ function zt() {
1125
+ return !0;
1126
+ }
1127
+ var In = {
1128
+ get(e, t, n) {
1129
+ return t === tn ? n : e.get(t);
1130
+ },
1131
+ has(e, t) {
1132
+ return t === tn ? !0 : e.has(t);
1133
+ },
1134
+ set: zt,
1135
+ deleteProperty: zt,
1136
+ getOwnPropertyDescriptor(e, t) {
1137
+ return {
1138
+ configurable: !0,
1139
+ enumerable: !0,
1140
+ get() {
1141
+ return e.get(t);
1142
+ },
1143
+ set: zt,
1144
+ deleteProperty: zt
1145
+ };
1146
+ },
1147
+ ownKeys(e) {
1148
+ return e.keys();
1149
+ }
1150
+ };
1151
+ function Cn(e) {
1152
+ return (e = typeof e == "function" ? e() : e) ? e : {};
1153
+ }
1154
+ function ga() {
1155
+ for (let e = 0, t = this.length; e < t; ++e) {
1156
+ const n = this[e]();
1157
+ if (n !== void 0)
1158
+ return n;
1159
+ }
1160
+ }
1161
+ function Zs(...e) {
1162
+ let t = !1;
1163
+ for (let o = 0; o < e.length; o++) {
1164
+ const l = e[o];
1165
+ t = t || !!l && tn in l, e[o] = typeof l == "function" ? (t = !0, ae(l)) : l;
1166
+ }
1167
+ if (t)
1168
+ return new Proxy({
1169
+ get(o) {
1170
+ for (let l = e.length - 1; l >= 0; l--) {
1171
+ const u = Cn(e[l])[o];
1172
+ if (u !== void 0)
1173
+ return u;
1174
+ }
1175
+ },
1176
+ has(o) {
1177
+ for (let l = e.length - 1; l >= 0; l--)
1178
+ if (o in Cn(e[l]))
1179
+ return !0;
1180
+ return !1;
1181
+ },
1182
+ keys() {
1183
+ const o = [];
1184
+ for (let l = 0; l < e.length; l++)
1185
+ o.push(...Object.keys(Cn(e[l])));
1186
+ return [...new Set(o)];
1187
+ }
1188
+ }, In);
1189
+ const n = {}, s = /* @__PURE__ */ Object.create(null);
1190
+ for (let o = e.length - 1; o >= 0; o--) {
1191
+ const l = e[o];
1192
+ if (!l)
1193
+ continue;
1194
+ const u = Object.getOwnPropertyNames(l);
1195
+ for (let f = u.length - 1; f >= 0; f--) {
1196
+ const h = u[f];
1197
+ if (h === "__proto__" || h === "constructor")
1198
+ continue;
1199
+ const d = Object.getOwnPropertyDescriptor(l, h);
1200
+ if (!s[h])
1201
+ s[h] = d.get ? {
1202
+ enumerable: !0,
1203
+ configurable: !0,
1204
+ get: ga.bind(n[h] = [d.get.bind(l)])
1205
+ } : d.value !== void 0 ? d : void 0;
1206
+ else {
1207
+ const p = n[h];
1208
+ p && (d.get ? p.push(d.get.bind(l)) : d.value !== void 0 && p.push(() => d.value));
1209
+ }
1210
+ }
1211
+ }
1212
+ const i = {}, a = Object.keys(s);
1213
+ for (let o = a.length - 1; o >= 0; o--) {
1214
+ const l = a[o], u = s[l];
1215
+ u && u.get ? Object.defineProperty(i, l, u) : i[l] = u ? u.value : void 0;
1216
+ }
1217
+ return i;
1218
+ }
1219
+ function ma(e, ...t) {
1220
+ if (tn in e) {
1221
+ const i = new Set(t.length > 1 ? t.flat() : t[0]), a = t.map((o) => new Proxy({
1222
+ get(l) {
1223
+ return o.includes(l) ? e[l] : void 0;
1224
+ },
1225
+ has(l) {
1226
+ return o.includes(l) && l in e;
1227
+ },
1228
+ keys() {
1229
+ return o.filter((l) => l in e);
1230
+ }
1231
+ }, In));
1232
+ return a.push(new Proxy({
1233
+ get(o) {
1234
+ return i.has(o) ? void 0 : e[o];
1235
+ },
1236
+ has(o) {
1237
+ return i.has(o) ? !1 : o in e;
1238
+ },
1239
+ keys() {
1240
+ return Object.keys(e).filter((o) => !i.has(o));
1241
+ }
1242
+ }, In)), a;
1243
+ }
1244
+ const n = {}, s = t.map(() => ({}));
1245
+ for (const i of Object.getOwnPropertyNames(e)) {
1246
+ const a = Object.getOwnPropertyDescriptor(e, i), o = !a.get && !a.set && a.enumerable && a.writable && a.configurable;
1247
+ let l = !1, u = 0;
1248
+ for (const f of t)
1249
+ f.includes(i) && (l = !0, o ? s[u][i] = a.value : Object.defineProperty(s[u], i, a)), ++u;
1250
+ l || (o ? n[i] = a.value : Object.defineProperty(n, i, a));
1251
+ }
1252
+ return [...s, n];
1253
+ }
1254
+ function er(e) {
1255
+ let t, n;
1256
+ const s = (i) => {
1257
+ const a = A.context;
1258
+ if (a) {
1259
+ const [l, u] = z();
1260
+ A.count || (A.count = 0), A.count++, (n || (n = e())).then((f) => {
1261
+ pt(a), A.count--, u(() => f.default), pt();
1262
+ }), t = l;
1263
+ } else if (!t) {
1264
+ const [l] = na(() => (n || (n = e())).then((u) => u.default));
1265
+ t = l;
1266
+ }
1267
+ let o;
1268
+ return ae(() => (o = t()) && ee(() => {
1269
+ if (!a)
1270
+ return o(i);
1271
+ const l = A.context;
1272
+ pt(a);
1273
+ const u = o(i);
1274
+ return pt(l), u;
1275
+ }));
1276
+ };
1277
+ return s.preload = () => n || ((n = e()).then((i) => t = () => i.default), n), s;
1278
+ }
1279
+ var ya = 0;
1280
+ function wl() {
1281
+ return A.context ? A.getNextContextId() : `cl-${ya++}`;
1282
+ }
1283
+ var tr = (e) => `Stale read from <${e}>.`;
1284
+ function El(e) {
1285
+ const t = "fallback" in e && {
1286
+ fallback: () => e.fallback
1287
+ };
1288
+ return ae(da(() => e.each, e.children, t || void 0));
1289
+ }
1290
+ function jl(e) {
1291
+ const t = "fallback" in e && {
1292
+ fallback: () => e.fallback
1293
+ };
1294
+ return ae(ha(() => e.each, e.children, t || void 0));
1295
+ }
1296
+ function Sl(e) {
1297
+ const t = e.keyed, n = ae(() => e.when, void 0, {
1298
+ equals: (s, i) => t ? s === i : !s == !i
1299
+ });
1300
+ return ae(() => {
1301
+ const s = n();
1302
+ if (s) {
1303
+ const i = e.children;
1304
+ return typeof i == "function" && i.length > 0 ? ee(() => i(t ? s : () => {
1305
+ if (!ee(n))
1306
+ throw tr("Show");
1307
+ return e.when;
1308
+ })) : i;
1309
+ }
1310
+ return e.fallback;
1311
+ }, void 0, void 0);
1312
+ }
1313
+ function Nl(e) {
1314
+ let t = !1;
1315
+ const n = (a, o) => (t ? a[1] === o[1] : !a[1] == !o[1]) && a[2] === o[2], s = zs(() => e.children), i = ae(() => {
1316
+ let a = s();
1317
+ Array.isArray(a) || (a = [a]);
1318
+ for (let o = 0; o < a.length; o++) {
1319
+ const l = a[o].when;
1320
+ if (l)
1321
+ return t = !!a[o].keyed, [o, l, a[o]];
1322
+ }
1323
+ return [-1];
1324
+ }, void 0, {
1325
+ equals: n
1326
+ });
1327
+ return ae(() => {
1328
+ const [a, o, l] = i();
1329
+ if (a < 0)
1330
+ return e.fallback;
1331
+ const u = l.children;
1332
+ return typeof u == "function" && u.length > 0 ? ee(() => u(t ? o : () => {
1333
+ if (ee(i)[0] !== a)
1334
+ throw tr("Match");
1335
+ return l.when;
1336
+ })) : u;
1337
+ }, void 0, void 0);
1338
+ }
1339
+ function Cl(e) {
1340
+ return e;
1341
+ }
1342
+ var xa = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"], pa = /* @__PURE__ */ new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...xa]), va = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]), ba = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
1343
+ className: "class",
1344
+ htmlFor: "for"
1345
+ }), wa = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
1346
+ class: "className",
1347
+ formnovalidate: {
1348
+ $: "formNoValidate",
1349
+ BUTTON: 1,
1350
+ INPUT: 1
1351
+ },
1352
+ ismap: {
1353
+ $: "isMap",
1354
+ IMG: 1
1355
+ },
1356
+ nomodule: {
1357
+ $: "noModule",
1358
+ SCRIPT: 1
1359
+ },
1360
+ playsinline: {
1361
+ $: "playsInline",
1362
+ VIDEO: 1
1363
+ },
1364
+ readonly: {
1365
+ $: "readOnly",
1366
+ INPUT: 1,
1367
+ TEXTAREA: 1
1368
+ }
1369
+ });
1370
+ function Ea(e, t) {
1371
+ const n = wa[e];
1372
+ return typeof n == "object" ? n[t] ? n.$ : void 0 : n;
1373
+ }
1374
+ var ja = /* @__PURE__ */ new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]), Sa = /* @__PURE__ */ new Set([
1375
+ "altGlyph",
1376
+ "altGlyphDef",
1377
+ "altGlyphItem",
1378
+ "animate",
1379
+ "animateColor",
1380
+ "animateMotion",
1381
+ "animateTransform",
1382
+ "circle",
1383
+ "clipPath",
1384
+ "color-profile",
1385
+ "cursor",
1386
+ "defs",
1387
+ "desc",
1388
+ "ellipse",
1389
+ "feBlend",
1390
+ "feColorMatrix",
1391
+ "feComponentTransfer",
1392
+ "feComposite",
1393
+ "feConvolveMatrix",
1394
+ "feDiffuseLighting",
1395
+ "feDisplacementMap",
1396
+ "feDistantLight",
1397
+ "feDropShadow",
1398
+ "feFlood",
1399
+ "feFuncA",
1400
+ "feFuncB",
1401
+ "feFuncG",
1402
+ "feFuncR",
1403
+ "feGaussianBlur",
1404
+ "feImage",
1405
+ "feMerge",
1406
+ "feMergeNode",
1407
+ "feMorphology",
1408
+ "feOffset",
1409
+ "fePointLight",
1410
+ "feSpecularLighting",
1411
+ "feSpotLight",
1412
+ "feTile",
1413
+ "feTurbulence",
1414
+ "filter",
1415
+ "font",
1416
+ "font-face",
1417
+ "font-face-format",
1418
+ "font-face-name",
1419
+ "font-face-src",
1420
+ "font-face-uri",
1421
+ "foreignObject",
1422
+ "g",
1423
+ "glyph",
1424
+ "glyphRef",
1425
+ "hkern",
1426
+ "image",
1427
+ "line",
1428
+ "linearGradient",
1429
+ "marker",
1430
+ "mask",
1431
+ "metadata",
1432
+ "missing-glyph",
1433
+ "mpath",
1434
+ "path",
1435
+ "pattern",
1436
+ "polygon",
1437
+ "polyline",
1438
+ "radialGradient",
1439
+ "rect",
1440
+ "set",
1441
+ "stop",
1442
+ "svg",
1443
+ "switch",
1444
+ "symbol",
1445
+ "text",
1446
+ "textPath",
1447
+ "tref",
1448
+ "tspan",
1449
+ "use",
1450
+ "view",
1451
+ "vkern"
1452
+ ]), Na = {
1453
+ xlink: "http://www.w3.org/1999/xlink",
1454
+ xml: "http://www.w3.org/XML/1998/namespace"
1455
+ };
1456
+ function Ca(e, t, n) {
1457
+ let s = n.length, i = t.length, a = s, o = 0, l = 0, u = t[i - 1].nextSibling, f = null;
1458
+ for (; o < i || l < a; ) {
1459
+ if (t[o] === n[l]) {
1460
+ o++, l++;
1461
+ continue;
1462
+ }
1463
+ for (; t[i - 1] === n[a - 1]; )
1464
+ i--, a--;
1465
+ if (i === o) {
1466
+ const h = a < s ? l ? n[l - 1].nextSibling : n[a - l] : u;
1467
+ for (; l < a; )
1468
+ e.insertBefore(n[l++], h);
1469
+ } else if (a === l)
1470
+ for (; o < i; )
1471
+ (!f || !f.has(t[o])) && t[o].remove(), o++;
1472
+ else if (t[o] === n[a - 1] && n[l] === t[i - 1]) {
1473
+ const h = t[--i].nextSibling;
1474
+ e.insertBefore(n[l++], t[o++].nextSibling), e.insertBefore(n[--a], h), t[i] = n[a];
1475
+ } else {
1476
+ if (!f) {
1477
+ f = /* @__PURE__ */ new Map();
1478
+ let d = l;
1479
+ for (; d < a; )
1480
+ f.set(n[d], d++);
1481
+ }
1482
+ const h = f.get(t[o]);
1483
+ if (h != null)
1484
+ if (l < h && h < a) {
1485
+ let d = o, p = 1, E;
1486
+ for (; ++d < i && d < a && !((E = f.get(t[d])) == null || E !== h + p); )
1487
+ p++;
1488
+ if (p > h - l) {
1489
+ const S = t[o];
1490
+ for (; l < h; )
1491
+ e.insertBefore(n[l++], S);
1492
+ } else
1493
+ e.replaceChild(n[l++], t[o++]);
1494
+ } else
1495
+ o++;
1496
+ else
1497
+ t[o++].remove();
1498
+ }
1499
+ }
1500
+ }
1501
+ var vt = "_$DX_DELEGATE";
1502
+ function nr(e, t, n, s = {}) {
1503
+ let i;
1504
+ return Ie((a) => {
1505
+ i = a, t === document ? e() : Gn(t, e(), t.firstChild ? null : void 0, n);
1506
+ }, s.owner), () => {
1507
+ i(), t.textContent = "";
1508
+ };
1509
+ }
1510
+ function Tl(e, t, n) {
1511
+ let s;
1512
+ const i = () => {
1513
+ const o = document.createElement("template");
1514
+ return o.innerHTML = e, o.content.firstChild;
1515
+ }, a = () => (s || (s = i())).cloneNode(!0);
1516
+ return a.cloneNode = a, a;
1517
+ }
1518
+ function Ta(e, t = window.document) {
1519
+ const n = t[vt] || (t[vt] = /* @__PURE__ */ new Set());
1520
+ for (let s = 0, i = e.length; s < i; s++) {
1521
+ const a = e[s];
1522
+ n.has(a) || (n.add(a), t.addEventListener(a, sr));
1523
+ }
1524
+ }
1525
+ function Al(e = window.document) {
1526
+ if (e[vt]) {
1527
+ for (let t of e[vt].keys())
1528
+ e.removeEventListener(t, sr);
1529
+ delete e[vt];
1530
+ }
1531
+ }
1532
+ function Rn(e, t, n) {
1533
+ A.context && e.isConnected || (n == null ? e.removeAttribute(t) : e.setAttribute(t, n));
1534
+ }
1535
+ function Aa(e, t, n, s) {
1536
+ A.context && e.isConnected || (s == null ? e.removeAttributeNS(t, n) : e.setAttributeNS(t, n, s));
1537
+ }
1538
+ function ka(e, t) {
1539
+ A.context && e.isConnected || (t == null ? e.removeAttribute("class") : e.className = t);
1540
+ }
1541
+ function Pa(e, t, n, s) {
1542
+ if (s)
1543
+ Array.isArray(n) ? (e[`$$${t}`] = n[0], e[`$$${t}Data`] = n[1]) : e[`$$${t}`] = n;
1544
+ else if (Array.isArray(n)) {
1545
+ const i = n[0];
1546
+ e.addEventListener(t, n[0] = (a) => i.call(e, n[1], a));
1547
+ } else
1548
+ e.addEventListener(t, n);
1549
+ }
1550
+ function _a(e, t, n = {}) {
1551
+ const s = Object.keys(t || {}), i = Object.keys(n);
1552
+ let a, o;
1553
+ for (a = 0, o = i.length; a < o; a++) {
1554
+ const l = i[a];
1555
+ !l || l === "undefined" || t[l] || (As(e, l, !1), delete n[l]);
1556
+ }
1557
+ for (a = 0, o = s.length; a < o; a++) {
1558
+ const l = s[a], u = !!t[l];
1559
+ !l || l === "undefined" || n[l] === u || !u || (As(e, l, !0), n[l] = u);
1560
+ }
1561
+ return n;
1562
+ }
1563
+ function Oa(e, t, n) {
1564
+ if (!t)
1565
+ return n ? Rn(e, "style") : t;
1566
+ const s = e.style;
1567
+ if (typeof t == "string")
1568
+ return s.cssText = t;
1569
+ typeof n == "string" && (s.cssText = n = void 0), n || (n = {}), t || (t = {});
1570
+ let i, a;
1571
+ for (a in n)
1572
+ t[a] == null && s.removeProperty(a), delete n[a];
1573
+ for (a in t)
1574
+ i = t[a], i !== n[a] && (s.setProperty(a, i), n[a] = i);
1575
+ return n;
1576
+ }
1577
+ function Ia(e, t = {}, n, s) {
1578
+ const i = {};
1579
+ return s || Re(() => i.children = Et(e, t.children, i.children)), Re(() => typeof t.ref == "function" && Ra(t.ref, e)), Re(() => Ga(e, t, n, !0, i, !0)), i;
1580
+ }
1581
+ function Ra(e, t, n) {
1582
+ return ee(() => e(t, n));
1583
+ }
1584
+ function Gn(e, t, n, s) {
1585
+ if (n !== void 0 && !s && (s = []), typeof t != "function")
1586
+ return Et(e, t, s, n);
1587
+ Re((i) => Et(e, t(), i, n), s);
1588
+ }
1589
+ function Ga(e, t, n, s, i = {}, a = !1) {
1590
+ t || (t = {});
1591
+ for (const o in i)
1592
+ if (!(o in t)) {
1593
+ if (o === "children")
1594
+ continue;
1595
+ i[o] = ks(e, o, null, i[o], n, a);
1596
+ }
1597
+ for (const o in t) {
1598
+ if (o === "children")
1599
+ continue;
1600
+ const l = t[o];
1601
+ i[o] = ks(e, o, l, i[o], n, a);
1602
+ }
1603
+ }
1604
+ function Da(e) {
1605
+ let t, n;
1606
+ return !A.context || !(t = A.registry.get(n = Ua())) ? e() : (A.completed && A.completed.add(t), A.registry.delete(n), t);
1607
+ }
1608
+ function La(e) {
1609
+ return e.toLowerCase().replace(/-([a-z])/g, (t, n) => n.toUpperCase());
1610
+ }
1611
+ function As(e, t, n) {
1612
+ const s = t.trim().split(/\s+/);
1613
+ for (let i = 0, a = s.length; i < a; i++)
1614
+ e.classList.toggle(s[i], n);
1615
+ }
1616
+ function ks(e, t, n, s, i, a) {
1617
+ let o, l, u, f, h;
1618
+ if (t === "style")
1619
+ return Oa(e, n, s);
1620
+ if (t === "classList")
1621
+ return _a(e, n, s);
1622
+ if (n === s)
1623
+ return s;
1624
+ if (t === "ref")
1625
+ a || n(e);
1626
+ else if (t.slice(0, 3) === "on:") {
1627
+ const d = t.slice(3);
1628
+ s && e.removeEventListener(d, s), n && e.addEventListener(d, n);
1629
+ } else if (t.slice(0, 10) === "oncapture:") {
1630
+ const d = t.slice(10);
1631
+ s && e.removeEventListener(d, s, !0), n && e.addEventListener(d, n, !0);
1632
+ } else if (t.slice(0, 2) === "on") {
1633
+ const d = t.slice(2).toLowerCase(), p = ja.has(d);
1634
+ if (!p && s) {
1635
+ const E = Array.isArray(s) ? s[0] : s;
1636
+ e.removeEventListener(d, E);
1637
+ }
1638
+ (p || n) && (Pa(e, d, n, p), p && Ta([d]));
1639
+ } else if (t.slice(0, 5) === "attr:")
1640
+ Rn(e, t.slice(5), n);
1641
+ else if ((h = t.slice(0, 5) === "prop:") || (u = va.has(t)) || !i && ((f = Ea(t, e.tagName)) || (l = pa.has(t))) || (o = e.nodeName.includes("-"))) {
1642
+ if (h)
1643
+ t = t.slice(5), l = !0;
1644
+ else if (A.context && e.isConnected)
1645
+ return n;
1646
+ t === "class" || t === "className" ? ka(e, n) : o && !l && !u ? e[La(t)] = n : e[f || t] = n;
1647
+ } else {
1648
+ const d = i && t.indexOf(":") > -1 && Na[t.split(":")[0]];
1649
+ d ? Aa(e, d, t, n) : Rn(e, ba[t] || t, n);
1650
+ }
1651
+ return n;
1652
+ }
1653
+ function sr(e) {
1654
+ const t = `$$${e.type}`;
1655
+ let n = e.composedPath && e.composedPath()[0] || e.target;
1656
+ for (e.target !== n && Object.defineProperty(e, "target", {
1657
+ configurable: !0,
1658
+ value: n
1659
+ }), Object.defineProperty(e, "currentTarget", {
1660
+ configurable: !0,
1661
+ get() {
1662
+ return n || document;
1663
+ }
1664
+ }), A.registry && !A.done && (A.done = _$HY.done = !0); n; ) {
1665
+ const s = n[t];
1666
+ if (s && !n.disabled) {
1667
+ const i = n[`${t}Data`];
1668
+ if (i !== void 0 ? s.call(n, i, e) : s.call(n, e), e.cancelBubble)
1669
+ return;
1670
+ }
1671
+ n = n._$host || n.parentNode || n.host;
1672
+ }
1673
+ }
1674
+ function Et(e, t, n, s, i) {
1675
+ const a = !!A.context && e.isConnected;
1676
+ if (a) {
1677
+ !n && (n = [...e.childNodes]);
1678
+ let u = [];
1679
+ for (let f = 0; f < n.length; f++) {
1680
+ const h = n[f];
1681
+ h.nodeType === 8 && h.data.slice(0, 2) === "!$" ? h.remove() : u.push(h);
1682
+ }
1683
+ n = u;
1684
+ }
1685
+ for (; typeof n == "function"; )
1686
+ n = n();
1687
+ if (t === n)
1688
+ return n;
1689
+ const o = typeof t, l = s !== void 0;
1690
+ if (e = l && n[0] && n[0].parentNode || e, o === "string" || o === "number") {
1691
+ if (a || o === "number" && (t = t.toString(), t === n))
1692
+ return n;
1693
+ if (l) {
1694
+ let u = n[0];
1695
+ u && u.nodeType === 3 ? u.data !== t && (u.data = t) : u = document.createTextNode(t), n = $e(e, n, s, u);
1696
+ } else
1697
+ n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
1698
+ } else if (t == null || o === "boolean") {
1699
+ if (a)
1700
+ return n;
1701
+ n = $e(e, n, s);
1702
+ } else {
1703
+ if (o === "function")
1704
+ return Re(() => {
1705
+ let u = t();
1706
+ for (; typeof u == "function"; )
1707
+ u = u();
1708
+ n = Et(e, u, n, s);
1709
+ }), () => n;
1710
+ if (Array.isArray(t)) {
1711
+ const u = [], f = n && Array.isArray(n);
1712
+ if (Dn(u, t, n, i))
1713
+ return Re(() => n = Et(e, u, n, s, !0)), () => n;
1714
+ if (a) {
1715
+ if (!u.length)
1716
+ return n;
1717
+ if (s === void 0)
1718
+ return [...e.childNodes];
1719
+ let h = u[0], d = [h];
1720
+ for (; (h = h.nextSibling) !== s; )
1721
+ d.push(h);
1722
+ return n = d;
1723
+ }
1724
+ if (u.length === 0) {
1725
+ if (n = $e(e, n, s), l)
1726
+ return n;
1727
+ } else f ? n.length === 0 ? Ps(e, u, s) : Ca(e, n, u) : (n && $e(e), Ps(e, u));
1728
+ n = u;
1729
+ } else if (t.nodeType) {
1730
+ if (a && t.parentNode)
1731
+ return n = l ? [t] : t;
1732
+ if (Array.isArray(n)) {
1733
+ if (l)
1734
+ return n = $e(e, n, s, t);
1735
+ $e(e, n, null, t);
1736
+ } else n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
1737
+ n = t;
1738
+ }
1739
+ }
1740
+ return n;
1741
+ }
1742
+ function Dn(e, t, n, s) {
1743
+ let i = !1;
1744
+ for (let a = 0, o = t.length; a < o; a++) {
1745
+ let l = t[a], u = n && n[e.length], f;
1746
+ if (!(l == null || l === !0 || l === !1))
1747
+ if ((f = typeof l) == "object" && l.nodeType)
1748
+ e.push(l);
1749
+ else if (Array.isArray(l))
1750
+ i = Dn(e, l, u) || i;
1751
+ else if (f === "function")
1752
+ if (s) {
1753
+ for (; typeof l == "function"; )
1754
+ l = l();
1755
+ i = Dn(e, Array.isArray(l) ? l : [l], Array.isArray(u) ? u : [u]) || i;
1756
+ } else
1757
+ e.push(l), i = !0;
1758
+ else {
1759
+ const h = String(l);
1760
+ u && u.nodeType === 3 && u.data === h ? e.push(u) : e.push(document.createTextNode(h));
1761
+ }
1762
+ }
1763
+ return i;
1764
+ }
1765
+ function Ps(e, t, n = null) {
1766
+ for (let s = 0, i = t.length; s < i; s++)
1767
+ e.insertBefore(t[s], n);
1768
+ }
1769
+ function $e(e, t, n, s) {
1770
+ if (n === void 0)
1771
+ return e.textContent = "";
1772
+ const i = s || document.createTextNode("");
1773
+ if (t.length) {
1774
+ let a = !1;
1775
+ for (let o = t.length - 1; o >= 0; o--) {
1776
+ const l = t[o];
1777
+ if (i !== l) {
1778
+ const u = l.parentNode === e;
1779
+ !a && !o ? u ? e.replaceChild(i, l) : e.insertBefore(i, n) : u && l.remove();
1780
+ } else
1781
+ a = !0;
1782
+ }
1783
+ } else
1784
+ e.insertBefore(i, n);
1785
+ return [i];
1786
+ }
1787
+ function Ua() {
1788
+ return A.getNextContextId();
1789
+ }
1790
+ var Fa = "http://www.w3.org/2000/svg";
1791
+ function rr(e, t = !1) {
1792
+ return t ? document.createElementNS(Fa, e) : document.createElement(e);
1793
+ }
1794
+ function kl(e) {
1795
+ const {
1796
+ useShadow: t
1797
+ } = e, n = document.createTextNode(""), s = () => e.mount || document.body, i = Ts();
1798
+ let a, o = !!A.context;
1799
+ return Ws(() => {
1800
+ o && (Ts().user = o = !1), a || (a = ra(i, () => ae(() => e.children)));
1801
+ const l = s();
1802
+ if (l instanceof HTMLHeadElement) {
1803
+ const [u, f] = z(!1), h = () => f(!0);
1804
+ Ie((d) => Gn(l, () => u() ? d() : a(), null)), wt(h);
1805
+ } else {
1806
+ const u = rr(e.isSVG ? "g" : "div", e.isSVG), f = t && u.attachShadow ? u.attachShadow({
1807
+ mode: "open"
1808
+ }) : u;
1809
+ Object.defineProperty(u, "_$host", {
1810
+ get() {
1811
+ return n.parentNode;
1812
+ },
1813
+ configurable: !0
1814
+ }), Gn(f, a), l.appendChild(u), e.ref && e.ref(u), wt(() => l.removeChild(u));
1815
+ }
1816
+ }, void 0, {
1817
+ render: !o
1818
+ }), n;
1819
+ }
1820
+ function Pl(e) {
1821
+ const [t, n] = ma(e, ["component"]), s = ae(() => t.component);
1822
+ return ae(() => {
1823
+ const i = s();
1824
+ switch (typeof i) {
1825
+ case "function":
1826
+ return ee(() => i(n));
1827
+ case "string":
1828
+ const a = Sa.has(i), o = A.context ? Da() : rr(i, a);
1829
+ return Ia(o, n, a), o;
1830
+ }
1831
+ });
1832
+ }
1833
+ var Ba = class {
1834
+ constructor() {
1835
+ this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
1836
+ }
1837
+ set(e, t) {
1838
+ this.keyToValue.set(e, t), this.valueToKey.set(t, e);
1839
+ }
1840
+ getByKey(e) {
1841
+ return this.keyToValue.get(e);
1842
+ }
1843
+ getByValue(e) {
1844
+ return this.valueToKey.get(e);
1845
+ }
1846
+ clear() {
1847
+ this.keyToValue.clear(), this.valueToKey.clear();
1848
+ }
1849
+ }, ir = class {
1850
+ constructor(e) {
1851
+ this.generateIdentifier = e, this.kv = new Ba();
1852
+ }
1853
+ register(e, t) {
1854
+ this.kv.getByValue(e) || (t || (t = this.generateIdentifier(e)), this.kv.set(t, e));
1855
+ }
1856
+ clear() {
1857
+ this.kv.clear();
1858
+ }
1859
+ getIdentifier(e) {
1860
+ return this.kv.getByValue(e);
1861
+ }
1862
+ getValue(e) {
1863
+ return this.kv.getByKey(e);
1864
+ }
1865
+ }, Ma = class extends ir {
1866
+ constructor() {
1867
+ super((e) => e.name), this.classToAllowedProps = /* @__PURE__ */ new Map();
1868
+ }
1869
+ register(e, t) {
1870
+ typeof t == "object" ? (t.allowProps && this.classToAllowedProps.set(e, t.allowProps), super.register(e, t.identifier)) : super.register(e, t);
1871
+ }
1872
+ getAllowedProps(e) {
1873
+ return this.classToAllowedProps.get(e);
1874
+ }
1875
+ };
1876
+ function $a(e) {
1877
+ if ("values" in Object)
1878
+ return Object.values(e);
1879
+ const t = [];
1880
+ for (const n in e)
1881
+ e.hasOwnProperty(n) && t.push(e[n]);
1882
+ return t;
1883
+ }
1884
+ function qa(e, t) {
1885
+ const n = $a(e);
1886
+ if ("find" in n)
1887
+ return n.find(t);
1888
+ const s = n;
1889
+ for (let i = 0; i < s.length; i++) {
1890
+ const a = s[i];
1891
+ if (t(a))
1892
+ return a;
1893
+ }
1894
+ }
1895
+ function at(e, t) {
1896
+ Object.entries(e).forEach(([n, s]) => t(s, n));
1897
+ }
1898
+ function Zt(e, t) {
1899
+ return e.indexOf(t) !== -1;
1900
+ }
1901
+ function _s(e, t) {
1902
+ for (let n = 0; n < e.length; n++) {
1903
+ const s = e[n];
1904
+ if (t(s))
1905
+ return s;
1906
+ }
1907
+ }
1908
+ var Va = class {
1909
+ constructor() {
1910
+ this.transfomers = {};
1911
+ }
1912
+ register(e) {
1913
+ this.transfomers[e.name] = e;
1914
+ }
1915
+ findApplicable(e) {
1916
+ return qa(this.transfomers, (t) => t.isApplicable(e));
1917
+ }
1918
+ findByName(e) {
1919
+ return this.transfomers[e];
1920
+ }
1921
+ }, Ka = (e) => Object.prototype.toString.call(e).slice(8, -1), ar = (e) => typeof e > "u", Wa = (e) => e === null, jt = (e) => typeof e != "object" || e === null || e === Object.prototype ? !1 : Object.getPrototypeOf(e) === null ? !0 : Object.getPrototypeOf(e) === Object.prototype, Ln = (e) => jt(e) && Object.keys(e).length === 0, Ne = (e) => Array.isArray(e), za = (e) => typeof e == "string", Ha = (e) => typeof e == "number" && !isNaN(e), Qa = (e) => typeof e == "boolean", Ya = (e) => e instanceof RegExp, St = (e) => e instanceof Map, Nt = (e) => e instanceof Set, or = (e) => Ka(e) === "Symbol", Ja = (e) => e instanceof Date && !isNaN(e.valueOf()), Xa = (e) => e instanceof Error, Os = (e) => typeof e == "number" && isNaN(e), Za = (e) => Qa(e) || Wa(e) || ar(e) || Ha(e) || za(e) || or(e), eo = (e) => typeof e == "bigint", to = (e) => e === 1 / 0 || e === -1 / 0, no = (e) => ArrayBuffer.isView(e) && !(e instanceof DataView), so = (e) => e instanceof URL, lr = (e) => e.replace(/\./g, "\\."), Tn = (e) => e.map(String).map(lr).join("."), bt = (e) => {
1922
+ const t = [];
1923
+ let n = "";
1924
+ for (let i = 0; i < e.length; i++) {
1925
+ let a = e.charAt(i);
1926
+ if (a === "\\" && e.charAt(i + 1) === ".") {
1927
+ n += ".", i++;
1928
+ continue;
1929
+ }
1930
+ if (a === ".") {
1931
+ t.push(n), n = "";
1932
+ continue;
1933
+ }
1934
+ n += a;
1935
+ }
1936
+ const s = n;
1937
+ return t.push(s), t;
1938
+ };
1939
+ function me(e, t, n, s) {
1940
+ return {
1941
+ isApplicable: e,
1942
+ annotation: t,
1943
+ transform: n,
1944
+ untransform: s
1945
+ };
1946
+ }
1947
+ var cr = [
1948
+ me(ar, "undefined", () => null, () => {
1949
+ }),
1950
+ me(eo, "bigint", (e) => e.toString(), (e) => typeof BigInt < "u" ? BigInt(e) : e),
1951
+ me(Ja, "Date", (e) => e.toISOString(), (e) => new Date(e)),
1952
+ me(Xa, "Error", (e, t) => {
1953
+ const n = {
1954
+ name: e.name,
1955
+ message: e.message
1956
+ };
1957
+ return t.allowedErrorProps.forEach((s) => {
1958
+ n[s] = e[s];
1959
+ }), n;
1960
+ }, (e, t) => {
1961
+ const n = new Error(e.message);
1962
+ return n.name = e.name, n.stack = e.stack, t.allowedErrorProps.forEach((s) => {
1963
+ n[s] = e[s];
1964
+ }), n;
1965
+ }),
1966
+ me(Ya, "regexp", (e) => "" + e, (e) => {
1967
+ const t = e.slice(1, e.lastIndexOf("/")), n = e.slice(e.lastIndexOf("/") + 1);
1968
+ return new RegExp(t, n);
1969
+ }),
1970
+ me(
1971
+ Nt,
1972
+ "set",
1973
+ // (sets only exist in es6+)
1974
+ // eslint-disable-next-line es5/no-es6-methods
1975
+ (e) => [...e.values()],
1976
+ (e) => new Set(e)
1977
+ ),
1978
+ me(St, "map", (e) => [...e.entries()], (e) => new Map(e)),
1979
+ me((e) => Os(e) || to(e), "number", (e) => Os(e) ? "NaN" : e > 0 ? "Infinity" : "-Infinity", Number),
1980
+ me((e) => e === 0 && 1 / e === -1 / 0, "number", () => "-0", Number),
1981
+ me(so, "URL", (e) => e.toString(), (e) => new URL(e))
1982
+ ];
1983
+ function hn(e, t, n, s) {
1984
+ return {
1985
+ isApplicable: e,
1986
+ annotation: t,
1987
+ transform: n,
1988
+ untransform: s
1989
+ };
1990
+ }
1991
+ var ur = hn((e, t) => or(e) ? !!t.symbolRegistry.getIdentifier(e) : !1, (e, t) => ["symbol", t.symbolRegistry.getIdentifier(e)], (e) => e.description, (e, t, n) => {
1992
+ const s = n.symbolRegistry.getValue(t[1]);
1993
+ if (!s)
1994
+ throw new Error("Trying to deserialize unknown symbol");
1995
+ return s;
1996
+ }), ro = [
1997
+ Int8Array,
1998
+ Uint8Array,
1999
+ Int16Array,
2000
+ Uint16Array,
2001
+ Int32Array,
2002
+ Uint32Array,
2003
+ Float32Array,
2004
+ Float64Array,
2005
+ Uint8ClampedArray
2006
+ ].reduce((e, t) => (e[t.name] = t, e), {}), fr = hn(no, (e) => ["typed-array", e.constructor.name], (e) => [...e], (e, t) => {
2007
+ const n = ro[t[1]];
2008
+ if (!n)
2009
+ throw new Error("Trying to deserialize unknown typed array");
2010
+ return new n(e);
2011
+ });
2012
+ function dr(e, t) {
2013
+ return e != null && e.constructor ? !!t.classRegistry.getIdentifier(e.constructor) : !1;
2014
+ }
2015
+ var hr = hn(dr, (e, t) => ["class", t.classRegistry.getIdentifier(e.constructor)], (e, t) => {
2016
+ const n = t.classRegistry.getAllowedProps(e.constructor);
2017
+ if (!n)
2018
+ return { ...e };
2019
+ const s = {};
2020
+ return n.forEach((i) => {
2021
+ s[i] = e[i];
2022
+ }), s;
2023
+ }, (e, t, n) => {
2024
+ const s = n.classRegistry.getValue(t[1]);
2025
+ if (!s)
2026
+ throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");
2027
+ return Object.assign(Object.create(s.prototype), e);
2028
+ }), gr = hn((e, t) => !!t.customTransformerRegistry.findApplicable(e), (e, t) => ["custom", t.customTransformerRegistry.findApplicable(e).name], (e, t) => t.customTransformerRegistry.findApplicable(e).serialize(e), (e, t, n) => {
2029
+ const s = n.customTransformerRegistry.findByName(t[1]);
2030
+ if (!s)
2031
+ throw new Error("Trying to deserialize unknown custom value");
2032
+ return s.deserialize(e);
2033
+ }), io = [hr, ur, gr, fr], Is = (e, t) => {
2034
+ const n = _s(io, (i) => i.isApplicable(e, t));
2035
+ if (n)
2036
+ return {
2037
+ value: n.transform(e, t),
2038
+ type: n.annotation(e, t)
2039
+ };
2040
+ const s = _s(cr, (i) => i.isApplicable(e, t));
2041
+ if (s)
2042
+ return {
2043
+ value: s.transform(e, t),
2044
+ type: s.annotation
2045
+ };
2046
+ }, mr = {};
2047
+ cr.forEach((e) => {
2048
+ mr[e.annotation] = e;
2049
+ });
2050
+ var ao = (e, t, n) => {
2051
+ if (Ne(t))
2052
+ switch (t[0]) {
2053
+ case "symbol":
2054
+ return ur.untransform(e, t, n);
2055
+ case "class":
2056
+ return hr.untransform(e, t, n);
2057
+ case "custom":
2058
+ return gr.untransform(e, t, n);
2059
+ case "typed-array":
2060
+ return fr.untransform(e, t, n);
2061
+ default:
2062
+ throw new Error("Unknown transformation: " + t);
2063
+ }
2064
+ else {
2065
+ const s = mr[t];
2066
+ if (!s)
2067
+ throw new Error("Unknown transformation: " + t);
2068
+ return s.untransform(e, n);
2069
+ }
2070
+ }, qe = (e, t) => {
2071
+ const n = e.keys();
2072
+ for (; t > 0; )
2073
+ n.next(), t--;
2074
+ return n.next().value;
2075
+ };
2076
+ function yr(e) {
2077
+ if (Zt(e, "__proto__"))
2078
+ throw new Error("__proto__ is not allowed as a property");
2079
+ if (Zt(e, "prototype"))
2080
+ throw new Error("prototype is not allowed as a property");
2081
+ if (Zt(e, "constructor"))
2082
+ throw new Error("constructor is not allowed as a property");
2083
+ }
2084
+ var oo = (e, t) => {
2085
+ yr(t);
2086
+ for (let n = 0; n < t.length; n++) {
2087
+ const s = t[n];
2088
+ if (Nt(e))
2089
+ e = qe(e, +s);
2090
+ else if (St(e)) {
2091
+ const i = +s, a = +t[++n] == 0 ? "key" : "value", o = qe(e, i);
2092
+ switch (a) {
2093
+ case "key":
2094
+ e = o;
2095
+ break;
2096
+ case "value":
2097
+ e = e.get(o);
2098
+ break;
2099
+ }
2100
+ } else
2101
+ e = e[s];
2102
+ }
2103
+ return e;
2104
+ }, Un = (e, t, n) => {
2105
+ if (yr(t), t.length === 0)
2106
+ return n(e);
2107
+ let s = e;
2108
+ for (let a = 0; a < t.length - 1; a++) {
2109
+ const o = t[a];
2110
+ if (Ne(s)) {
2111
+ const l = +o;
2112
+ s = s[l];
2113
+ } else if (jt(s))
2114
+ s = s[o];
2115
+ else if (Nt(s)) {
2116
+ const l = +o;
2117
+ s = qe(s, l);
2118
+ } else if (St(s)) {
2119
+ if (a === t.length - 2)
2120
+ break;
2121
+ const u = +o, f = +t[++a] == 0 ? "key" : "value", h = qe(s, u);
2122
+ switch (f) {
2123
+ case "key":
2124
+ s = h;
2125
+ break;
2126
+ case "value":
2127
+ s = s.get(h);
2128
+ break;
2129
+ }
2130
+ }
2131
+ }
2132
+ const i = t[t.length - 1];
2133
+ if (Ne(s) ? s[+i] = n(s[+i]) : jt(s) && (s[i] = n(s[i])), Nt(s)) {
2134
+ const a = qe(s, +i), o = n(a);
2135
+ a !== o && (s.delete(a), s.add(o));
2136
+ }
2137
+ if (St(s)) {
2138
+ const a = +t[t.length - 2], o = qe(s, a);
2139
+ switch (+i == 0 ? "key" : "value") {
2140
+ case "key": {
2141
+ const u = n(o);
2142
+ s.set(u, s.get(o)), u !== o && s.delete(o);
2143
+ break;
2144
+ }
2145
+ case "value": {
2146
+ s.set(o, n(s.get(o)));
2147
+ break;
2148
+ }
2149
+ }
2150
+ }
2151
+ return e;
2152
+ };
2153
+ function Fn(e, t, n = []) {
2154
+ if (!e)
2155
+ return;
2156
+ if (!Ne(e)) {
2157
+ at(e, (a, o) => Fn(a, t, [...n, ...bt(o)]));
2158
+ return;
2159
+ }
2160
+ const [s, i] = e;
2161
+ i && at(i, (a, o) => {
2162
+ Fn(a, t, [...n, ...bt(o)]);
2163
+ }), t(s, n);
2164
+ }
2165
+ function lo(e, t, n) {
2166
+ return Fn(t, (s, i) => {
2167
+ e = Un(e, i, (a) => ao(a, s, n));
2168
+ }), e;
2169
+ }
2170
+ function co(e, t) {
2171
+ function n(s, i) {
2172
+ const a = oo(e, bt(i));
2173
+ s.map(bt).forEach((o) => {
2174
+ e = Un(e, o, () => a);
2175
+ });
2176
+ }
2177
+ if (Ne(t)) {
2178
+ const [s, i] = t;
2179
+ s.forEach((a) => {
2180
+ e = Un(e, bt(a), () => e);
2181
+ }), i && at(i, n);
2182
+ } else
2183
+ at(t, n);
2184
+ return e;
2185
+ }
2186
+ var uo = (e, t) => jt(e) || Ne(e) || St(e) || Nt(e) || dr(e, t);
2187
+ function fo(e, t, n) {
2188
+ const s = n.get(e);
2189
+ s ? s.push(t) : n.set(e, [t]);
2190
+ }
2191
+ function ho(e, t) {
2192
+ const n = {};
2193
+ let s;
2194
+ return e.forEach((i) => {
2195
+ if (i.length <= 1)
2196
+ return;
2197
+ t || (i = i.map((l) => l.map(String)).sort((l, u) => l.length - u.length));
2198
+ const [a, ...o] = i;
2199
+ a.length === 0 ? s = o.map(Tn) : n[Tn(a)] = o.map(Tn);
2200
+ }), s ? Ln(n) ? [s] : [s, n] : Ln(n) ? void 0 : n;
2201
+ }
2202
+ var xr = (e, t, n, s, i = [], a = [], o = /* @__PURE__ */ new Map()) => {
2203
+ const l = Za(e);
2204
+ if (!l) {
2205
+ fo(e, i, t);
2206
+ const E = o.get(e);
2207
+ if (E)
2208
+ return s ? {
2209
+ transformedValue: null
2210
+ } : E;
2211
+ }
2212
+ if (!uo(e, n)) {
2213
+ const E = Is(e, n), S = E ? {
2214
+ transformedValue: E.value,
2215
+ annotations: [E.type]
2216
+ } : {
2217
+ transformedValue: e
2218
+ };
2219
+ return l || o.set(e, S), S;
2220
+ }
2221
+ if (Zt(a, e))
2222
+ return {
2223
+ transformedValue: null
2224
+ };
2225
+ const u = Is(e, n), f = (u == null ? void 0 : u.value) ?? e, h = Ne(f) ? [] : {}, d = {};
2226
+ at(f, (E, S) => {
2227
+ if (S === "__proto__" || S === "constructor" || S === "prototype")
2228
+ throw new Error(`Detected property ${S}. This is a prototype pollution risk, please remove it from your object.`);
2229
+ const y = xr(E, t, n, s, [...i, S], [...a, e], o);
2230
+ h[S] = y.transformedValue, Ne(y.annotations) ? d[S] = y.annotations : jt(y.annotations) && at(y.annotations, (x, v) => {
2231
+ d[lr(S) + "." + v] = x;
2232
+ });
2233
+ });
2234
+ const p = Ln(d) ? {
2235
+ transformedValue: h,
2236
+ annotations: u ? [u.type] : void 0
2237
+ } : {
2238
+ transformedValue: h,
2239
+ annotations: u ? [u.type, d] : d
2240
+ };
2241
+ return l || o.set(e, p), p;
2242
+ };
2243
+ function pr(e) {
2244
+ return Object.prototype.toString.call(e).slice(8, -1);
2245
+ }
2246
+ function Rs(e) {
2247
+ return pr(e) === "Array";
2248
+ }
2249
+ function go(e) {
2250
+ if (pr(e) !== "Object")
2251
+ return !1;
2252
+ const t = Object.getPrototypeOf(e);
2253
+ return !!t && t.constructor === Object && t === Object.prototype;
2254
+ }
2255
+ function mo(e, t, n, s, i) {
2256
+ const a = {}.propertyIsEnumerable.call(s, t) ? "enumerable" : "nonenumerable";
2257
+ a === "enumerable" && (e[t] = n), i && a === "nonenumerable" && Object.defineProperty(e, t, {
2258
+ value: n,
2259
+ enumerable: !1,
2260
+ writable: !0,
2261
+ configurable: !0
2262
+ });
2263
+ }
2264
+ function Bn(e, t = {}) {
2265
+ if (Rs(e))
2266
+ return e.map((i) => Bn(i, t));
2267
+ if (!go(e))
2268
+ return e;
2269
+ const n = Object.getOwnPropertyNames(e), s = Object.getOwnPropertySymbols(e);
2270
+ return [...n, ...s].reduce((i, a) => {
2271
+ if (Rs(t.props) && !t.props.includes(a))
2272
+ return i;
2273
+ const o = e[a], l = Bn(o, t);
2274
+ return mo(i, a, l, e, t.nonenumerable), i;
2275
+ }, {});
2276
+ }
2277
+ var B = class {
2278
+ /**
2279
+ * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
2280
+ */
2281
+ constructor({ dedupe: e = !1 } = {}) {
2282
+ this.classRegistry = new Ma(), this.symbolRegistry = new ir((t) => t.description ?? ""), this.customTransformerRegistry = new Va(), this.allowedErrorProps = [], this.dedupe = e;
2283
+ }
2284
+ serialize(e) {
2285
+ const t = /* @__PURE__ */ new Map(), n = xr(e, t, this, this.dedupe), s = {
2286
+ json: n.transformedValue
2287
+ };
2288
+ n.annotations && (s.meta = {
2289
+ ...s.meta,
2290
+ values: n.annotations
2291
+ });
2292
+ const i = ho(t, this.dedupe);
2293
+ return i && (s.meta = {
2294
+ ...s.meta,
2295
+ referentialEqualities: i
2296
+ }), s;
2297
+ }
2298
+ deserialize(e) {
2299
+ const { json: t, meta: n } = e;
2300
+ let s = Bn(t);
2301
+ return n != null && n.values && (s = lo(s, n.values, this)), n != null && n.referentialEqualities && (s = co(s, n.referentialEqualities)), s;
2302
+ }
2303
+ stringify(e) {
2304
+ return JSON.stringify(this.serialize(e));
2305
+ }
2306
+ parse(e) {
2307
+ return this.deserialize(JSON.parse(e));
2308
+ }
2309
+ registerClass(e, t) {
2310
+ this.classRegistry.register(e, t);
2311
+ }
2312
+ registerSymbol(e, t) {
2313
+ this.symbolRegistry.register(e, t);
2314
+ }
2315
+ registerCustom(e, t) {
2316
+ this.customTransformerRegistry.register({
2317
+ name: t,
2318
+ ...e
2319
+ });
2320
+ }
2321
+ allowErrorProps(...e) {
2322
+ this.allowedErrorProps.push(...e);
2323
+ }
2324
+ };
2325
+ B.defaultInstance = new B();
2326
+ B.serialize = B.defaultInstance.serialize.bind(B.defaultInstance);
2327
+ B.deserialize = B.defaultInstance.deserialize.bind(B.defaultInstance);
2328
+ B.stringify = B.defaultInstance.stringify.bind(B.defaultInstance);
2329
+ B.parse = B.defaultInstance.parse.bind(B.defaultInstance);
2330
+ B.registerClass = B.defaultInstance.registerClass.bind(B.defaultInstance);
2331
+ B.registerSymbol = B.defaultInstance.registerSymbol.bind(B.defaultInstance);
2332
+ B.registerCustom = B.defaultInstance.registerCustom.bind(B.defaultInstance);
2333
+ B.allowErrorProps = B.defaultInstance.allowErrorProps.bind(B.defaultInstance);
2334
+ var yo = B.serialize, _l = B.stringify;
2335
+ function Ol(e) {
2336
+ return e.state.fetchStatus === "fetching" ? "fetching" : e.getObserversCount() ? e.state.fetchStatus === "paused" ? "paused" : e.isStale() ? "stale" : "fresh" : "inactive";
2337
+ }
2338
+ function Il(e, t) {
2339
+ return `${e}${t.charAt(0).toUpperCase() + t.slice(1)}`;
2340
+ }
2341
+ function Rl({
2342
+ queryState: e,
2343
+ observerCount: t,
2344
+ isStale: n
2345
+ }) {
2346
+ return e.fetchStatus === "fetching" ? "blue" : t ? e.fetchStatus === "paused" ? "purple" : n ? "yellow" : "green" : "gray";
2347
+ }
2348
+ function Gl({
2349
+ status: e,
2350
+ isPaused: t
2351
+ }) {
2352
+ return t ? "purple" : e === "error" ? "red" : e === "pending" ? "yellow" : e === "success" ? "green" : "gray";
2353
+ }
2354
+ function Dl(e) {
2355
+ return e === "fresh" ? "green" : e === "stale" ? "yellow" : e === "paused" ? "purple" : e === "inactive" ? "gray" : "blue";
2356
+ }
2357
+ var Ll = (e, t = !1) => {
2358
+ const {
2359
+ json: n
2360
+ } = yo(e);
2361
+ return JSON.stringify(n, null, t ? 2 : void 0);
2362
+ }, Ht = (e) => e.state.fetchStatus !== "idle" ? 0 : e.getObserversCount() ? e.isStale() ? 2 : 1 : 3, xo = (e, t) => e.queryHash.localeCompare(t.queryHash), vr = (e, t) => e.state.dataUpdatedAt < t.state.dataUpdatedAt ? 1 : -1, po = (e, t) => Ht(e) === Ht(t) ? vr(e, t) : Ht(e) > Ht(t) ? 1 : -1, Ul = {
2363
+ status: po,
2364
+ "query hash": xo,
2365
+ "last updated": vr
2366
+ }, Qt = (e) => e.state.isPaused ? 0 : e.state.status === "error" ? 2 : e.state.status === "pending" ? 1 : 3, br = (e, t) => e.state.submittedAt < t.state.submittedAt ? 1 : -1, vo = (e, t) => Qt(e) === Qt(t) ? br(e, t) : Qt(e) > Qt(t) ? 1 : -1, Fl = {
2367
+ status: vo,
2368
+ "last updated": br
2369
+ }, Bl = (e) => e * parseFloat(getComputedStyle(document.documentElement).fontSize), Ml = () => {
2370
+ const [e, t] = z("dark");
2371
+ return sa(() => {
2372
+ const n = window.matchMedia("(prefers-color-scheme: dark)");
2373
+ t(n.matches ? "dark" : "light");
2374
+ const s = (i) => {
2375
+ t(i.matches ? "dark" : "light");
2376
+ };
2377
+ n.addEventListener("change", s), wt(() => n.removeEventListener("change", s));
2378
+ }), e;
2379
+ }, Yt = (e, t, n) => {
2380
+ if (t.length === 0)
2381
+ return n;
2382
+ if (e instanceof Map) {
2383
+ const s = new Map(e);
2384
+ if (t.length === 1)
2385
+ return s.set(t[0], n), s;
2386
+ const [i, ...a] = t;
2387
+ return s.set(i, Yt(s.get(i), a, n)), s;
2388
+ }
2389
+ if (e instanceof Set) {
2390
+ const s = Yt(Array.from(e), t, n);
2391
+ return new Set(s);
2392
+ }
2393
+ if (Array.isArray(e)) {
2394
+ const s = [...e];
2395
+ if (t.length === 1)
2396
+ return s[t[0]] = n, s;
2397
+ const [i, ...a] = t;
2398
+ return s[i] = Yt(s[i], a, n), s;
2399
+ }
2400
+ if (e instanceof Object) {
2401
+ const s = {
2402
+ ...e
2403
+ };
2404
+ if (t.length === 1)
2405
+ return s[t[0]] = n, s;
2406
+ const [i, ...a] = t;
2407
+ return s[i] = Yt(s[i], a, n), s;
2408
+ }
2409
+ return e;
2410
+ }, Jt = (e, t) => {
2411
+ if (e instanceof Map) {
2412
+ const n = new Map(e);
2413
+ if (t.length === 1)
2414
+ return n.delete(t[0]), n;
2415
+ const [s, ...i] = t;
2416
+ return n.set(s, Jt(n.get(s), i)), n;
2417
+ }
2418
+ if (e instanceof Set) {
2419
+ const n = Jt(Array.from(e), t);
2420
+ return new Set(n);
2421
+ }
2422
+ if (Array.isArray(e)) {
2423
+ const n = [...e];
2424
+ if (t.length === 1)
2425
+ return n.filter((a, o) => o.toString() !== t[0]);
2426
+ const [s, ...i] = t;
2427
+ return n[s] = Jt(n[s], i), n;
2428
+ }
2429
+ if (e instanceof Object) {
2430
+ const n = {
2431
+ ...e
2432
+ };
2433
+ if (t.length === 1)
2434
+ return delete n[t[0]], n;
2435
+ const [s, ...i] = t;
2436
+ return n[s] = Jt(n[s], i), n;
2437
+ }
2438
+ return e;
2439
+ }, wr = (e, t) => {
2440
+ if (!e || document.querySelector("#_goober") || (t == null ? void 0 : t.querySelector("#_goober")))
2441
+ return;
2442
+ const s = document.createElement("style"), i = document.createTextNode("");
2443
+ s.appendChild(i), s.id = "_goober", s.setAttribute("nonce", e), t ? t.appendChild(s) : document.head.appendChild(s);
2444
+ }, Ke, Ct, Tt, At, _e, kt, We, ze, He, Qe, Ye, Je, Pt, Gs, bo = (Gs = class {
2445
+ constructor(e) {
2446
+ U(this, Ke);
2447
+ U(this, Ct);
2448
+ U(this, Tt);
2449
+ U(this, At);
2450
+ U(this, _e, !1);
2451
+ U(this, kt);
2452
+ U(this, We);
2453
+ U(this, ze);
2454
+ U(this, He);
2455
+ U(this, Qe);
2456
+ U(this, Ye);
2457
+ U(this, Je);
2458
+ U(this, Pt);
2459
+ const {
2460
+ client: t,
2461
+ queryFlavor: n,
2462
+ version: s,
2463
+ onlineManager: i,
2464
+ buttonPosition: a,
2465
+ position: o,
2466
+ initialIsOpen: l,
2467
+ errorTypes: u,
2468
+ styleNonce: f,
2469
+ shadowDOMTarget: h
2470
+ } = e;
2471
+ G(this, Ke, z(t)), G(this, Tt, n), G(this, At, s), G(this, Ct, i), G(this, kt, f), G(this, We, h), G(this, ze, z(a)), G(this, He, z(o)), G(this, Qe, z(l)), G(this, Ye, z(u));
2472
+ }
2473
+ setButtonPosition(e) {
2474
+ C(this, ze)[1](e);
2475
+ }
2476
+ setPosition(e) {
2477
+ C(this, He)[1](e);
2478
+ }
2479
+ setInitialIsOpen(e) {
2480
+ C(this, Qe)[1](e);
2481
+ }
2482
+ setErrorTypes(e) {
2483
+ C(this, Ye)[1](e);
2484
+ }
2485
+ setClient(e) {
2486
+ C(this, Ke)[1](e);
2487
+ }
2488
+ mount(e) {
2489
+ if (C(this, _e))
2490
+ throw new Error("Devtools is already mounted");
2491
+ const t = nr(() => {
2492
+ const n = this, [s] = C(this, ze), [i] = C(this, He), [a] = C(this, Qe), [o] = C(this, Ye), [l] = C(this, Ke);
2493
+ let u;
2494
+ return C(this, Je) ? u = C(this, Je) : (u = er(() => import("./BMGNQTAT-lkaYe2TN.js")), G(this, Je, u)), wr(C(this, kt), C(this, We)), Xs(u, Zs({
2495
+ get queryFlavor() {
2496
+ return C(n, Tt);
2497
+ },
2498
+ get version() {
2499
+ return C(n, At);
2500
+ },
2501
+ get onlineManager() {
2502
+ return C(n, Ct);
2503
+ },
2504
+ get shadowDOMTarget() {
2505
+ return C(n, We);
2506
+ }
2507
+ }, {
2508
+ get client() {
2509
+ return l();
2510
+ },
2511
+ get buttonPosition() {
2512
+ return s();
2513
+ },
2514
+ get position() {
2515
+ return i();
2516
+ },
2517
+ get initialIsOpen() {
2518
+ return a();
2519
+ },
2520
+ get errorTypes() {
2521
+ return o();
2522
+ }
2523
+ }));
2524
+ }, e);
2525
+ G(this, _e, !0), G(this, Pt, t);
2526
+ }
2527
+ unmount() {
2528
+ var e;
2529
+ if (!C(this, _e))
2530
+ throw new Error("Devtools is not mounted");
2531
+ (e = C(this, Pt)) == null || e.call(this), G(this, _e, !1);
2532
+ }
2533
+ }, Ke = new WeakMap(), Ct = new WeakMap(), Tt = new WeakMap(), At = new WeakMap(), _e = new WeakMap(), kt = new WeakMap(), We = new WeakMap(), ze = new WeakMap(), He = new WeakMap(), Qe = new WeakMap(), Ye = new WeakMap(), Je = new WeakMap(), Pt = new WeakMap(), Gs), Xe, _t, Ot, It, Oe, Rt, Ze, et, tt, nt, st, rt, it, Gt, Ds, wo = (Ds = class {
2534
+ constructor(e) {
2535
+ U(this, Xe);
2536
+ U(this, _t);
2537
+ U(this, Ot);
2538
+ U(this, It);
2539
+ U(this, Oe, !1);
2540
+ U(this, Rt);
2541
+ U(this, Ze);
2542
+ U(this, et);
2543
+ U(this, tt);
2544
+ U(this, nt);
2545
+ U(this, st);
2546
+ U(this, rt);
2547
+ U(this, it);
2548
+ U(this, Gt);
2549
+ const {
2550
+ client: t,
2551
+ queryFlavor: n,
2552
+ version: s,
2553
+ onlineManager: i,
2554
+ buttonPosition: a,
2555
+ position: o,
2556
+ initialIsOpen: l,
2557
+ errorTypes: u,
2558
+ styleNonce: f,
2559
+ shadowDOMTarget: h,
2560
+ onClose: d
2561
+ } = e;
2562
+ G(this, Xe, z(t)), G(this, Ot, n), G(this, It, s), G(this, _t, i), G(this, Rt, f), G(this, Ze, h), G(this, et, z(a)), G(this, tt, z(o)), G(this, nt, z(l)), G(this, st, z(u)), G(this, rt, z(d));
2563
+ }
2564
+ setButtonPosition(e) {
2565
+ C(this, et)[1](e);
2566
+ }
2567
+ setPosition(e) {
2568
+ C(this, tt)[1](e);
2569
+ }
2570
+ setInitialIsOpen(e) {
2571
+ C(this, nt)[1](e);
2572
+ }
2573
+ setErrorTypes(e) {
2574
+ C(this, st)[1](e);
2575
+ }
2576
+ setClient(e) {
2577
+ C(this, Xe)[1](e);
2578
+ }
2579
+ setOnClose(e) {
2580
+ C(this, rt)[1](() => e);
2581
+ }
2582
+ mount(e) {
2583
+ if (C(this, Oe))
2584
+ throw new Error("Devtools is already mounted");
2585
+ const t = nr(() => {
2586
+ const n = this, [s] = C(this, et), [i] = C(this, tt), [a] = C(this, nt), [o] = C(this, st), [l] = C(this, Xe), [u] = C(this, rt);
2587
+ let f;
2588
+ return C(this, it) ? f = C(this, it) : (f = er(() => import("./UODQIBEW-Bv_kQBsJ.js")), G(this, it, f)), wr(C(this, Rt), C(this, Ze)), Xs(f, Zs({
2589
+ get queryFlavor() {
2590
+ return C(n, Ot);
2591
+ },
2592
+ get version() {
2593
+ return C(n, It);
2594
+ },
2595
+ get onlineManager() {
2596
+ return C(n, _t);
2597
+ },
2598
+ get shadowDOMTarget() {
2599
+ return C(n, Ze);
2600
+ }
2601
+ }, {
2602
+ get client() {
2603
+ return l();
2604
+ },
2605
+ get buttonPosition() {
2606
+ return s();
2607
+ },
2608
+ get position() {
2609
+ return i();
2610
+ },
2611
+ get initialIsOpen() {
2612
+ return a();
2613
+ },
2614
+ get errorTypes() {
2615
+ return o();
2616
+ },
2617
+ get onClose() {
2618
+ return u();
2619
+ }
2620
+ }));
2621
+ }, e);
2622
+ G(this, Oe, !0), G(this, Gt, t);
2623
+ }
2624
+ unmount() {
2625
+ var e;
2626
+ if (!C(this, Oe))
2627
+ throw new Error("Devtools is not mounted");
2628
+ (e = C(this, Gt)) == null || e.call(this), G(this, Oe, !1);
2629
+ }
2630
+ }, Xe = new WeakMap(), _t = new WeakMap(), Ot = new WeakMap(), It = new WeakMap(), Oe = new WeakMap(), Rt = new WeakMap(), Ze = new WeakMap(), et = new WeakMap(), tt = new WeakMap(), nt = new WeakMap(), st = new WeakMap(), rt = new WeakMap(), it = new WeakMap(), Gt = new WeakMap(), Ds);
2631
+ function Eo(e) {
2632
+ const t = ge(e.client), n = ie.useRef(null), {
2633
+ buttonPosition: s,
2634
+ position: i,
2635
+ initialIsOpen: a,
2636
+ errorTypes: o,
2637
+ styleNonce: l,
2638
+ shadowDOMTarget: u
2639
+ } = e, [f] = ie.useState(
2640
+ new bo({
2641
+ client: t,
2642
+ queryFlavor: "React Query",
2643
+ version: "5",
2644
+ onlineManager: Us,
2645
+ buttonPosition: s,
2646
+ position: i,
2647
+ initialIsOpen: a,
2648
+ errorTypes: o,
2649
+ styleNonce: l,
2650
+ shadowDOMTarget: u
2651
+ })
2652
+ );
2653
+ return ie.useEffect(() => {
2654
+ f.setClient(t);
2655
+ }, [t, f]), ie.useEffect(() => {
2656
+ s && f.setButtonPosition(s);
2657
+ }, [s, f]), ie.useEffect(() => {
2658
+ i && f.setPosition(i);
2659
+ }, [i, f]), ie.useEffect(() => {
2660
+ f.setInitialIsOpen(a || !1);
2661
+ }, [a, f]), ie.useEffect(() => {
2662
+ f.setErrorTypes(o || []);
2663
+ }, [o, f]), ie.useEffect(() => (n.current && f.mount(n.current), () => {
2664
+ f.unmount();
2665
+ }), [f]), /* @__PURE__ */ r.jsx("div", { className: "tsqd-parent-container", ref: n });
2666
+ }
2667
+ function jo(e) {
2668
+ const t = ge(e.client), n = ie.useRef(null), { errorTypes: s, styleNonce: i, shadowDOMTarget: a } = e, [o] = ie.useState(
2669
+ new wo({
2670
+ client: t,
2671
+ queryFlavor: "React Query",
2672
+ version: "5",
2673
+ onlineManager: Us,
2674
+ buttonPosition: "bottom-left",
2675
+ position: "bottom",
2676
+ initialIsOpen: !0,
2677
+ errorTypes: s,
2678
+ styleNonce: i,
2679
+ shadowDOMTarget: a,
2680
+ onClose: e.onClose
2681
+ })
2682
+ );
2683
+ return ie.useEffect(() => {
2684
+ o.setClient(t);
2685
+ }, [t, o]), ie.useEffect(() => {
2686
+ o.setOnClose(e.onClose ?? (() => {
2687
+ }));
2688
+ }, [e.onClose, o]), ie.useEffect(() => {
2689
+ o.setErrorTypes(s || []);
2690
+ }, [s, o]), ie.useEffect(() => (n.current && o.mount(n.current), () => {
2691
+ o.unmount();
2692
+ }), [o]), /* @__PURE__ */ r.jsx(
2693
+ "div",
2694
+ {
2695
+ style: { height: "500px", ...e.style },
2696
+ className: "tsqd-parent-container",
2697
+ ref: n
2698
+ }
2699
+ );
2700
+ }
2701
+ var So = process.env.NODE_ENV !== "development" ? function() {
2702
+ return null;
2703
+ } : Eo;
2704
+ process.env.NODE_ENV;
2705
+ const No = bi({}), Er = () => wi(No), Lt = (e, t) => {
2706
+ const [n] = Er();
2707
+ return K(n, e, t);
2708
+ }, J = () => Lt("apiUrl", "/chai/api"), T = {
2709
+ ASK_AI: "ASK_AI",
2710
+ GET_PAGE: "GET_PAGE",
2711
+ CREATE_PAGE: "CREATE_PAGE",
2712
+ UPDATE_PAGE: "UPDATE_PAGE",
2713
+ DELETE_PAGE: "DELETE_PAGE",
2714
+ CHANGE_SLUG: "CHANGE_SLUG",
2715
+ TAKE_OFFLINE: "TAKE_OFFLINE",
2716
+ PUBLISH_PAGE: "PUBLISH_PAGE",
2717
+ PUBLISH_CHANGES: "PUBLISH_CHANGES",
2718
+ ADD_NEW_LANGUAGE: "ADD_NEW_LANGUAGE",
2719
+ EDIT_LANGUAGE: "EDIT_LANGUAGE",
2720
+ DELETE_LANGUAGE: "DELETE_LANGUAGE",
2721
+ GET_CHANGES: "GET_CHANGES",
2722
+ GET_SERVER_BLOCK: "GET_SERVER_BLOCK",
2723
+ GET_LANGUAGE_PAGES: "GET_LANGUAGE_PAGES",
2724
+ GET_PROJECT_PAGES: "GET_PROJECT_PAGES",
2725
+ UPDATE_WEBSITE_SETTINGS: "UPDATE_WEBSITE_SETTINGS",
2726
+ GET_COLLECTIONS: "GET_COLLECTIONS",
2727
+ SEARCH_PAGES: "SEARCH_PAGES",
2728
+ GET_WEBSITE_SETTINGS: "GET_WEBSITE_SETTINGS",
2729
+ AI_CONTEXT: "AI_CONTEXT",
2730
+ GET_WEBSITE_DATA: "GET_WEBSITE_DATA",
2731
+ UPDATE_WEBSITE_DATA: "UPDATE_WEBSITE_DATA"
2732
+ }, Kn = () => {
2733
+ const e = ge(), { data: t } = ve({
2734
+ queryKey: [T.AI_CONTEXT],
2735
+ initialData: "",
2736
+ queryFn: () => ""
2737
+ });
2738
+ return { setAiContext: Dt((s) => {
2739
+ e.setQueryData([T.AI_CONTEXT], s);
2740
+ }, []), aiContext: t };
2741
+ }, X = async (e, t) => {
2742
+ const n = await fetch(e, {
2743
+ method: "POST",
2744
+ headers: { "Content-Type": "application/json" },
2745
+ body: JSON.stringify(t)
2746
+ }), s = await n.json();
2747
+ if (s != null && s.error || n.status === 400 || !n.ok)
2748
+ throw new Error((s == null ? void 0 : s.error) || "Something went wrong.");
2749
+ return s;
2750
+ }, Co = () => {
2751
+ const e = J(), { aiContext: t } = Kn();
2752
+ return Dt(
2753
+ async (n, s, i, a) => X(e, {
2754
+ action: T.ASK_AI,
2755
+ data: { type: n, prompt: s, blocks: i, context: t, lang: a }
2756
+ }),
2757
+ [e, t]
2758
+ );
2759
+ }, To = () => {
2760
+ const e = J();
2761
+ return { getUILibraryBlock: async (i, a) => {
2762
+ const u = (await (await fetch(
2763
+ i.url + (a.path ? "/blocks/" + a.path : "/" + a.uuid + ".html")
2764
+ )).text()).replace(/---([\s\S]*?)---/g, "");
2765
+ return ii(`${u}`);
2766
+ }, getUILibraryBlocks: async (i) => {
2767
+ try {
2768
+ return (await (await fetch(i.url + "/blocks.json")).json()).map((l) => ({
2769
+ ...l,
2770
+ preview: i.url.replace("chaiblocks", "") + l.preview
2771
+ }));
2772
+ } catch (a) {
2773
+ return console.error(a), [];
2774
+ }
2775
+ }, onSave: async ({
2776
+ page: i,
2777
+ blocks: a
2778
+ }) => {
2779
+ try {
2780
+ return await X(e, {
2781
+ action: "UPDATE_PAGE",
2782
+ data: { id: i, blocks: a }
2783
+ });
2784
+ } catch {
2785
+ return new Error("Failed to save blocks");
2786
+ }
2787
+ } };
2788
+ };
2789
+ function Fe() {
2790
+ const [e, t] = $(
2791
+ new URLSearchParams(window.location.search)
2792
+ );
2793
+ return Se(() => {
2794
+ const n = () => {
2795
+ t(new URLSearchParams(window.location.search));
2796
+ };
2797
+ return window.addEventListener("popstate", n), () => {
2798
+ window.removeEventListener("popstate", n);
2799
+ };
2800
+ }, []), [e, t];
2801
+ }
2802
+ const Wn = () => {
2803
+ const e = J();
2804
+ return ve({
2805
+ queryKey: [T.GET_PROJECT_PAGES],
2806
+ staleTime: 1e3 * 60 * 5,
2807
+ queryFn: async () => X(e, { action: T.GET_PROJECT_PAGES }) || []
2808
+ });
2809
+ }, ut = () => {
2810
+ const [e] = Fe(), t = e.get("page"), { data: n, isFetching: s } = Wn();
2811
+ return { data: ce(
2812
+ () => Ce(n, { id: t }) || {},
2813
+ [n, t]
2814
+ ), isFetching: s };
2815
+ }, Ao = () => ve({
2816
+ queryKey: ["uiLibraries"],
2817
+ initialData: [],
2818
+ queryFn: async () => [
2819
+ {
2820
+ uuid: "meraki-ui",
2821
+ name: "Meraki UI",
2822
+ url: "https://chai-ui-blocks.vercel.app"
2823
+ },
2824
+ {
2825
+ uuid: "chaiblocks",
2826
+ name: "UI Blocks",
2827
+ url: "https://chaibuilder.com/chaiblocks"
2828
+ }
2829
+ ]
2830
+ }), ko = () => {
2831
+ const [e] = Fe(), t = e.get("page"), n = J(), { setAiContext: s } = Kn();
2832
+ return ve({
2833
+ queryKey: [T.GET_PAGE, t],
2834
+ initialData: [],
2835
+ queryFn: async () => {
2836
+ const a = (await X(n, {
2837
+ action: T.GET_PAGE,
2838
+ data: { id: t, draft: !0 }
2839
+ })).blocks ?? [], o = Ce(a, { _type: "@chai/ai-context" });
2840
+ return s(K(o, "_value", "") || ""), a;
2841
+ },
2842
+ enabled: !!t
2843
+ });
2844
+ }, Po = (e) => ce(() => {
2845
+ if (!e || Y(e))
2846
+ return {
2847
+ blocks: [],
2848
+ theme: {}
2849
+ };
2850
+ const t = Ce(e, { _type: "@chai/theme" }), n = K(t, "_value", {}) || {}, s = fe(
2851
+ e,
2852
+ (i) => !Ee(i == null ? void 0 : i._type, "@chai/")
2853
+ );
2854
+ return { theme: n, blocks: s };
2855
+ }, [e]), jr = () => {
2856
+ const e = J();
2857
+ return ve({
2858
+ queryKey: [T.GET_WEBSITE_SETTINGS],
2859
+ initialData: {
2860
+ theme: {},
2861
+ fallbackLang: "en",
2862
+ languages: []
2863
+ },
2864
+ queryFn: async () => X(e, {
2865
+ action: T.GET_WEBSITE_SETTINGS,
2866
+ data: { draft: !0 }
2867
+ })
2868
+ });
2869
+ }, _o = () => {
2870
+ const { data: e } = Wn(), t = J();
2871
+ return {
2872
+ getGlobalBlocks: async () => {
2873
+ const n = {};
2874
+ for (const s of e ?? [])
2875
+ Y(s == null ? void 0 : s.slug) && (n[s.id] = {
2876
+ name: Pe(s.name ?? s.slug),
2877
+ description: ""
2878
+ });
2879
+ return n;
2880
+ },
2881
+ getGlobalBlockBlocks: async (n) => n ? (await X(t, {
2882
+ action: "GET_PAGE",
2883
+ data: { id: n, draft: !0 }
2884
+ })).blocks : []
2885
+ };
2886
+ }, zn = () => {
2887
+ const e = J(), [t] = Fe(), n = t.get("page");
2888
+ return ve({
2889
+ queryKey: [T.GET_LANGUAGE_PAGES, n],
2890
+ initialData: [],
2891
+ queryFn: async () => {
2892
+ if (!n) return null;
2893
+ const s = await X(e, {
2894
+ action: T.GET_LANGUAGE_PAGES,
2895
+ data: { id: n }
2896
+ });
2897
+ return ui(fi(s, "primaryPage"));
2898
+ }
2899
+ });
2900
+ }, Ut = () => {
2901
+ const e = J();
2902
+ return ve({
2903
+ queryKey: [T.GET_COLLECTIONS],
2904
+ initialData: [],
2905
+ queryFn: async () => X(e, { action: T.GET_COLLECTIONS })
2906
+ });
2907
+ }, Oo = () => {
2908
+ const e = J();
2909
+ return be({
2910
+ mutationFn: async ({ collection: t, query: n }) => {
2911
+ try {
2912
+ return X(e, {
2913
+ action: T.SEARCH_PAGES,
2914
+ data: {
2915
+ collection: t,
2916
+ query: Array.isArray(n) && n.length > 0 ? n[0] : n
2917
+ }
2918
+ }) || [];
2919
+ } catch {
2920
+ return [];
2921
+ }
2922
+ }
2923
+ });
2924
+ }, je = {
2925
+ ab: "Abkhazian",
2926
+ aa: "Afar",
2927
+ af: "Afrikaans",
2928
+ ak: "Akan",
2929
+ sq: "Albanian",
2930
+ am: "Amharic",
2931
+ ar: "Arabic",
2932
+ an: "Aragonese",
2933
+ hy: "Armenian",
2934
+ as: "Assamese",
2935
+ av: "Avaric",
2936
+ ae: "Avestan",
2937
+ ay: "Aymara",
2938
+ az: "Azerbaijani",
2939
+ bm: "Bambara",
2940
+ ba: "Bashkir",
2941
+ eu: "Basque",
2942
+ be: "Belarusian",
2943
+ bn: "Bengali",
2944
+ bh: "Bihari",
2945
+ bi: "Bislama",
2946
+ bs: "Bosnian",
2947
+ br: "Breton",
2948
+ bg: "Bulgarian",
2949
+ my: "Burmese",
2950
+ ca: "Catalan",
2951
+ ch: "Chamorro",
2952
+ ce: "Chechen",
2953
+ ny: "Chichewa",
2954
+ zh: "Chinese",
2955
+ "zh-Hans": "Chinese (Simplified)",
2956
+ "zh-Hant": "Chinese (Traditional)",
2957
+ cv: "Chuvash",
2958
+ kw: "Cornish",
2959
+ co: "Corsican",
2960
+ cr: "Cree",
2961
+ hr: "Croatian",
2962
+ cs: "Czech",
2963
+ da: "Danish",
2964
+ dv: "Maldivian",
2965
+ nl: "Dutch",
2966
+ dz: "Dzongkha",
2967
+ en: "English",
2968
+ eo: "Esperanto",
2969
+ et: "Estonian",
2970
+ ee: "Ewe",
2971
+ fo: "Faroese",
2972
+ fj: "Fijian",
2973
+ fi: "Finnish",
2974
+ fr: "French",
2975
+ ff: "Fula, Pular",
2976
+ gl: "Galician",
2977
+ gd: "Gaelic (Scottish)",
2978
+ gv: "Manx",
2979
+ ka: "Georgian",
2980
+ de: "German",
2981
+ el: "Greek",
2982
+ kl: "Kalaallisut",
2983
+ gn: "Guarani",
2984
+ gu: "Gujarati",
2985
+ ht: "Haitian Creole",
2986
+ ha: "Hausa",
2987
+ he: "Hebrew",
2988
+ hz: "Herero",
2989
+ hi: "Hindi",
2990
+ ho: "Hiri Motu",
2991
+ hu: "Hungarian",
2992
+ is: "Icelandic",
2993
+ io: "Ido",
2994
+ ig: "Igbo",
2995
+ id: "Indonesian",
2996
+ ia: "Interlingua",
2997
+ ie: "Interlingue",
2998
+ iu: "Inuktitut",
2999
+ ik: "Inupiak",
3000
+ ga: "Irish",
3001
+ it: "Italian",
3002
+ ja: "Japanese",
3003
+ jv: "Javanese",
3004
+ kn: "Kannada",
3005
+ kr: "Kanuri",
3006
+ ks: "Kashmiri",
3007
+ kk: "Kazakh",
3008
+ km: "Khmer",
3009
+ ki: "Kikuyu",
3010
+ rw: "Kinyarwanda",
3011
+ rn: "Kirundi",
3012
+ ky: "Kyrgyz",
3013
+ kv: "Komi",
3014
+ kg: "Kongo",
3015
+ ko: "Korean",
3016
+ ku: "Kurdish",
3017
+ kj: "Kwanyama",
3018
+ lo: "Lao",
3019
+ la: "Latin",
3020
+ lv: "Latvian",
3021
+ li: "Limburgish",
3022
+ ln: "Lingala",
3023
+ lt: "Lithuanian",
3024
+ lu: "Luga-Katanga",
3025
+ lg: "Luganda, Ganda",
3026
+ lb: "Luxembourgish",
3027
+ mk: "Macedonian",
3028
+ mg: "Malagasy",
3029
+ ms: "Malay",
3030
+ ml: "Malayalam",
3031
+ mt: "Maltese",
3032
+ mi: "Maori",
3033
+ mr: "Marathi",
3034
+ mh: "Marshallese",
3035
+ mo: "Moldavian",
3036
+ mn: "Mongolian",
3037
+ na: "Nauru",
3038
+ nv: "Navajo",
3039
+ ng: "Ndonga",
3040
+ nd: "Northern Ndebele",
3041
+ ne: "Nepali",
3042
+ no: "Norwegian",
3043
+ nb: "Norwegian bokmål",
3044
+ nn: "Norwegian nynorsk",
3045
+ ii: "Sichuan Yi",
3046
+ oc: "Occitan",
3047
+ oj: "Ojibwe",
3048
+ cu: "Old Church Slavonic",
3049
+ or: "Oriya",
3050
+ om: "Oromo",
3051
+ os: "Ossetian",
3052
+ pi: "Pāli",
3053
+ ps: "Pashto, Pushto",
3054
+ fa: "Persian (Farsi)",
3055
+ pl: "Polish",
3056
+ pt: "Portuguese",
3057
+ pa: "Punjabi (Eastern)",
3058
+ qu: "Quechua",
3059
+ rm: "Romansh",
3060
+ ro: "Romanian",
3061
+ ru: "Russian",
3062
+ se: "Sami",
3063
+ sm: "Samoan",
3064
+ sg: "Sango",
3065
+ sa: "Sanskrit",
3066
+ sr: "Serbian",
3067
+ sh: "Serbo-Croatian",
3068
+ st: "Sesotho",
3069
+ tn: "Setswana",
3070
+ sn: "Shona",
3071
+ sd: "Sindhi",
3072
+ si: "Sinhalese",
3073
+ ss: "Swati",
3074
+ sk: "Slovak",
3075
+ sl: "Slovenian",
3076
+ so: "Somali",
3077
+ nr: "Southern Ndebele",
3078
+ es: "Spanish",
3079
+ su: "Sundanese",
3080
+ sw: "Swahili (Kiswahili)",
3081
+ sv: "Swedish",
3082
+ tl: "Tagalog",
3083
+ ty: "Tahitian",
3084
+ tg: "Tajik",
3085
+ ta: "Tamil",
3086
+ tt: "Tatar",
3087
+ te: "Telugu",
3088
+ th: "Thai",
3089
+ bo: "Tibetan",
3090
+ ti: "Tigrinya",
3091
+ to: "Tonga",
3092
+ ts: "Tsonga",
3093
+ tr: "Turkish",
3094
+ tk: "Turkmen",
3095
+ tw: "Twi",
3096
+ ug: "Uyghur",
3097
+ uk: "Ukrainian",
3098
+ ur: "Urdu",
3099
+ uz: "Uzbek",
3100
+ ve: "Venda",
3101
+ vi: "Vietnamese",
3102
+ vo: "Volapük",
3103
+ wa: "Wallon",
3104
+ cy: "Welsh",
3105
+ wo: "Wolof",
3106
+ fy: "Western Frisian",
3107
+ xh: "Xhosa",
3108
+ yi: "Yiddish",
3109
+ yo: "Yoruba",
3110
+ za: "Zhuang, Chuang",
3111
+ zu: "Zulu"
3112
+ }, Sr = () => {
3113
+ const e = J(), t = ge(), { toast: n } = Te();
3114
+ return be({
3115
+ mutationFn: async (s) => X(e, { action: T.CREATE_PAGE, data: s }),
3116
+ onSuccess: (s, i) => {
3117
+ i && (i != null && i.primaryPage) ? t.invalidateQueries({
3118
+ queryKey: [T.GET_LANGUAGE_PAGES, i == null ? void 0 : i.primaryPage]
3119
+ }) : t.invalidateQueries({
3120
+ queryKey: [T.GET_PROJECT_PAGES]
3121
+ }), n({
3122
+ title: `New ${i.collection === "global" ? "global block" : "page"} added successfully.`
3123
+ });
3124
+ },
3125
+ onError: (s, i) => {
3126
+ n({
3127
+ variant: "destructive",
3128
+ title: `Failed to add new ${i.collection === "global" ? "global block" : "page"}.`,
3129
+ description: s.message
3130
+ });
3131
+ }
3132
+ });
3133
+ }, Hn = () => {
3134
+ const e = J(), t = ge(), { toast: n } = Te();
3135
+ return be({
3136
+ mutationFn: async (s) => X(e, {
3137
+ action: T.UPDATE_PAGE,
3138
+ data: s
3139
+ }),
3140
+ onSuccess: (s, i) => {
3141
+ i && (i != null && i.primaryPage || i != null && i.seo) ? t.invalidateQueries({
3142
+ queryKey: [T.GET_LANGUAGE_PAGES, i == null ? void 0 : i.primaryPage]
3143
+ }) : t.invalidateQueries({
3144
+ queryKey: [T.GET_PROJECT_PAGES]
3145
+ }), i != null && i.seo ? n({
3146
+ title: "SEO Settings updated successfully."
3147
+ }) : n({
3148
+ title: `${i.collection === "global" ? "Global block" : "Page"} updated successfully.`
3149
+ });
3150
+ },
3151
+ onError: (s, i) => {
3152
+ n({
3153
+ variant: "destructive",
3154
+ title: `Failed to update ${i.collection === "global" ? "global block" : "page"}.`,
3155
+ description: s.message
3156
+ });
3157
+ }
3158
+ });
3159
+ }, Io = () => {
3160
+ const e = J(), t = ge(), { toast: n } = Te();
3161
+ return be({
3162
+ mutationFn: async (s) => X(e, {
3163
+ action: T.DELETE_PAGE,
3164
+ data: { id: s == null ? void 0 : s.id }
3165
+ }),
3166
+ onSuccess: (s, i) => {
3167
+ i && (i != null && i.primaryPage) ? t.invalidateQueries({
3168
+ queryKey: [T.GET_LANGUAGE_PAGES, i == null ? void 0 : i.primaryPage]
3169
+ }) : t.invalidateQueries({
3170
+ queryKey: [T.GET_PROJECT_PAGES]
3171
+ }), n({
3172
+ title: `${i.collection === "global" ? "Global block" : "Page"} deleted successfully.`
3173
+ });
3174
+ },
3175
+ onError: (s, i) => {
3176
+ n({
3177
+ variant: "destructive",
3178
+ title: `Failed to delete ${i.collection === "global" ? "global block" : "page"}.`,
3179
+ description: s.message
3180
+ });
3181
+ }
3182
+ });
3183
+ }, Ro = () => {
3184
+ const e = J(), t = ge(), { toast: n } = Te();
3185
+ return be({
3186
+ mutationFn: async (s) => X(e, {
3187
+ action: T.TAKE_OFFLINE,
3188
+ data: { id: s == null ? void 0 : s.id }
3189
+ }),
3190
+ onSuccess: (s, i) => {
3191
+ i && (i != null && i.primaryPage) ? t.invalidateQueries({
3192
+ queryKey: [T.GET_LANGUAGE_PAGES, i == null ? void 0 : i.primaryPage]
3193
+ }) : t.invalidateQueries({
3194
+ queryKey: [T.GET_PROJECT_PAGES]
3195
+ }), n({
3196
+ title: `${i.collection === "global" ? "Global block" : "Page"} taken offline successfully.`
3197
+ });
3198
+ },
3199
+ onError: (s, i) => {
3200
+ n({
3201
+ variant: "destructive",
3202
+ title: `Failed to take offline ${i.collection === "global" ? "global block" : "page"}.`,
3203
+ description: s.message
3204
+ });
3205
+ }
3206
+ });
3207
+ }, Go = () => {
3208
+ const e = J(), { toast: t } = Te(), n = ge(), { data: s } = ut();
3209
+ return be({
3210
+ mutationFn: async ({ ids: i, theme: a }) => X(e, {
3211
+ action: T.PUBLISH_CHANGES,
3212
+ data: { ids: i, theme: a }
3213
+ }),
3214
+ onSuccess: () => {
3215
+ t({ title: "Your changes have been published successfully." }), n.invalidateQueries({ queryKey: [T.GET_CHANGES] }), n.invalidateQueries({ queryKey: [T.GET_PROJECT_PAGES] }), n.invalidateQueries({
3216
+ queryKey: [T.GET_LANGUAGE_PAGES, s == null ? void 0 : s.id]
3217
+ });
3218
+ },
3219
+ onError: () => {
3220
+ t({ title: "Failed to publish pages.", variant: "destructive" });
3221
+ }
3222
+ });
3223
+ }, Do = () => {
3224
+ const e = J(), { toast: t } = Te(), n = ge();
3225
+ return be({
3226
+ mutationFn: async ({ id: s, slug: i }) => X(e, {
3227
+ action: T.CHANGE_SLUG,
3228
+ data: { id: s, slug: i }
3229
+ }),
3230
+ onSuccess: (s, { primaryPage: i }) => {
3231
+ t({ title: "Slug changed successfully." }), i ? n.invalidateQueries({
3232
+ queryKey: [T.GET_LANGUAGE_PAGES, i]
3233
+ }) : n.invalidateQueries({
3234
+ queryKey: [T.GET_PROJECT_PAGES]
3235
+ });
3236
+ },
3237
+ onError: () => {
3238
+ t({ title: "Failed to change slug", variant: "destructive" });
3239
+ }
3240
+ });
3241
+ }, Lo = () => {
3242
+ const { selectedLang: e } = cn(), { data: t, isFetching: n } = zn();
3243
+ return { data: ce(() => Ce(t, { lang: e || "" }) || {}, [t, e]), isFetching: n };
3244
+ }, Nr = () => {
3245
+ const { data: e, isFetching: t } = Lo(), n = e == null ? void 0 : e.seo, [s, i] = $({
3246
+ title: "",
3247
+ description: "",
3248
+ cononicalUrl: "",
3249
+ noIndex: !1,
3250
+ noFollow: "",
3251
+ ogTitle: "",
3252
+ ogDescription: "",
3253
+ ogImage: "",
3254
+ searchTitle: "",
3255
+ searchDescription: "",
3256
+ jsonLD: "",
3257
+ ...n
3258
+ }), a = Ls({ initial: s, updated: s }), { selectedLang: o, fallbackLang: l, languages: u } = cn(), f = o.length ? o : l, { mutate: h, isPending: d } = Hn(), p = d;
3259
+ Se(() => {
3260
+ !t && n && i({
3261
+ title: "",
3262
+ description: "",
3263
+ cononicalUrl: "",
3264
+ noIndex: !1,
3265
+ noFollow: "",
3266
+ ogTitle: "",
3267
+ ogDescription: "",
3268
+ ogImage: "",
3269
+ searchTitle: "",
3270
+ searchDescription: "",
3271
+ jsonLD: "",
3272
+ ...n
3273
+ });
3274
+ }, [t, n]);
3275
+ const E = async () => {
3276
+ h({ id: e == null ? void 0 : e.id, seo: s }), a.current.initial = s, a.current.updated = s;
3277
+ }, S = () => {
3278
+ i({
3279
+ ...s,
3280
+ ogTitle: s.title,
3281
+ ogDescription: s.description
3282
+ });
3283
+ }, y = () => {
3284
+ i({
3285
+ ...s,
3286
+ searchTitle: s.ogTitle,
3287
+ searchDescription: s.ogDescription
3288
+ });
3289
+ }, x = (v) => {
3290
+ const b = {
3291
+ ...s,
3292
+ [v.target.name]: v.target.name === "noIndex" || v.target.name === "noFollow" ? v.target.checked : v.target.value
3293
+ };
3294
+ i(b), a.current.updated = b;
3295
+ };
3296
+ return /* @__PURE__ */ r.jsxs("div", { className: "relative pb-40", children: [
3297
+ /* @__PURE__ */ r.jsxs("div", { className: "text-xs bg-gray-100 p-2 rounded-md text-left", children: [
3298
+ "Slug: ",
3299
+ e == null ? void 0 : e.slug,
3300
+ "  ",
3301
+ u.length > 0 && /* @__PURE__ */ r.jsxs("span", { className: "text-blue-500 font-semibold", children: [
3302
+ "(",
3303
+ K(je, f, f),
3304
+ ")"
3305
+ ] })
3306
+ ] }),
3307
+ /* @__PURE__ */ r.jsx("form", { className: "space-y-8", children: /* @__PURE__ */ r.jsxs(Ei, { type: "multiple", defaultValue: ["page"], children: [
3308
+ /* @__PURE__ */ r.jsxs(qt, { value: "page", children: [
3309
+ /* @__PURE__ */ r.jsx(Vt, { className: "text-slate-700 font-semibold", children: "SEO" }),
3310
+ /* @__PURE__ */ r.jsx(Kt, { className: "pt-2", children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-4", children: [
3311
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3312
+ /* @__PURE__ */ r.jsx(Z, { className: "text-xs", htmlFor: "title", children: "SEO Title" }),
3313
+ /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3314
+ /* @__PURE__ */ r.jsx(
3315
+ le,
3316
+ {
3317
+ type: "text",
3318
+ id: "title",
3319
+ name: "title",
3320
+ value: s.title,
3321
+ onChange: x,
3322
+ disabled: p,
3323
+ placeholder: "Enter SEO title"
3324
+ }
3325
+ ),
3326
+ /* @__PURE__ */ r.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400 leading-4", children: "The title should be between 10 and 60 characters." })
3327
+ ] })
3328
+ ] }),
3329
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3330
+ /* @__PURE__ */ r.jsx(Z, { className: "text-xs", htmlFor: "description", children: "SEO Description" }),
3331
+ /* @__PURE__ */ r.jsx(
3332
+ Wt,
3333
+ {
3334
+ id: "description",
3335
+ name: "description",
3336
+ value: s.description,
3337
+ onChange: x,
3338
+ disabled: p,
3339
+ placeholder: "Enter SEO description"
3340
+ }
3341
+ ),
3342
+ /* @__PURE__ */ r.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400 leading-4", children: "The description should be between 50 and 160 characters." })
3343
+ ] }),
3344
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3345
+ /* @__PURE__ */ r.jsx(Z, { className: "text-xs", htmlFor: "title", children: "Canonical URL" }),
3346
+ /* @__PURE__ */ r.jsx(
3347
+ le,
3348
+ {
3349
+ type: "text",
3350
+ id: "canonicalUrl",
3351
+ name: "canonicalUrl",
3352
+ value: s.canonicalUrl,
3353
+ onChange: x,
3354
+ disabled: p,
3355
+ placeholder: "Enter Canonical URL"
3356
+ }
3357
+ )
3358
+ ] }),
3359
+ /* @__PURE__ */ r.jsxs("div", { className: "", children: [
3360
+ /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-x-2", children: [
3361
+ /* @__PURE__ */ r.jsx(
3362
+ le,
3363
+ {
3364
+ type: "checkbox",
3365
+ id: "noIndex",
3366
+ name: "noIndex",
3367
+ checked: s.noIndex,
3368
+ onChange: x,
3369
+ disabled: p,
3370
+ className: "h-4 w-4"
3371
+ }
3372
+ ),
3373
+ /* @__PURE__ */ r.jsx(Z, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Index" })
3374
+ ] }),
3375
+ /* @__PURE__ */ r.jsx("p", { className: "mt-0 text-[10px] font-light text-gray-400 leading-4", children: "Check this if you don't want search engines to index this page." })
3376
+ ] }),
3377
+ /* @__PURE__ */ r.jsxs("div", { className: "", children: [
3378
+ /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-x-2", children: [
3379
+ /* @__PURE__ */ r.jsx(
3380
+ le,
3381
+ {
3382
+ type: "checkbox",
3383
+ id: "noFollow",
3384
+ name: "noFollow",
3385
+ checked: s.noFollow,
3386
+ onChange: x,
3387
+ disabled: p,
3388
+ className: "h-4 w-4"
3389
+ }
3390
+ ),
3391
+ /* @__PURE__ */ r.jsx(Z, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Follow" })
3392
+ ] }),
3393
+ /* @__PURE__ */ r.jsx("p", { className: "text-[10px] font-light text-gray-400 leading-4", children: "Check this if you don't want search engines to follow links on this page." })
3394
+ ] })
3395
+ ] }) })
3396
+ ] }),
3397
+ /* @__PURE__ */ r.jsxs(qt, { value: "og", children: [
3398
+ /* @__PURE__ */ r.jsx(Vt, { className: "text-slate-700 font-bold", children: "OG" }),
3399
+ /* @__PURE__ */ r.jsx(Kt, { children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-4", children: [
3400
+ /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r.jsx(
3401
+ V,
3402
+ {
3403
+ type: "button",
3404
+ variant: "outline",
3405
+ size: "sm",
3406
+ onClick: S,
3407
+ children: "Copy from SEO Settings"
3408
+ }
3409
+ ) }),
3410
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3411
+ /* @__PURE__ */ r.jsx(Z, { className: "text-xs", htmlFor: "ogTitle", children: "OG Title" }),
3412
+ /* @__PURE__ */ r.jsx(
3413
+ le,
3414
+ {
3415
+ type: "text",
3416
+ id: "ogTitle",
3417
+ name: "ogTitle",
3418
+ value: s.ogTitle,
3419
+ onChange: x,
3420
+ disabled: p,
3421
+ placeholder: "Enter OG title"
3422
+ }
3423
+ ),
3424
+ /* @__PURE__ */ r.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400 leading-4", children: "The OG title should be between 10 and 60 characters." })
3425
+ ] }),
3426
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3427
+ /* @__PURE__ */ r.jsx(Z, { className: "text-xs pb-1", htmlFor: "ogDescription", children: "OG Description" }),
3428
+ /* @__PURE__ */ r.jsx(
3429
+ Wt,
3430
+ {
3431
+ id: "ogDescription",
3432
+ name: "ogDescription",
3433
+ value: s.ogDescription,
3434
+ onChange: x,
3435
+ disabled: p,
3436
+ placeholder: "Enter OG description"
3437
+ }
3438
+ ),
3439
+ /* @__PURE__ */ r.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400 leading-4", children: "The OG description should be between 50 and 160 characters." })
3440
+ ] }),
3441
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3442
+ /* @__PURE__ */ r.jsx(Z, { className: "text-xs pb-1", htmlFor: "ogImage", children: "OG Image URL" }),
3443
+ /* @__PURE__ */ r.jsx(
3444
+ le,
3445
+ {
3446
+ type: "text",
3447
+ id: "ogImage",
3448
+ name: "ogImage",
3449
+ value: s.ogImage,
3450
+ onChange: x,
3451
+ disabled: p,
3452
+ placeholder: "Enter OG image URL"
3453
+ }
3454
+ ),
3455
+ /* @__PURE__ */ r.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400 leading-4", children: "Enter a valid URL for the OG image." })
3456
+ ] })
3457
+ ] }) })
3458
+ ] }),
3459
+ /* @__PURE__ */ r.jsxs(qt, { value: "search", children: [
3460
+ /* @__PURE__ */ r.jsx(Vt, { className: "text-slate-700 font-bold", children: "SEARCH" }),
3461
+ /* @__PURE__ */ r.jsx(Kt, { children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-4", children: [
3462
+ /* @__PURE__ */ r.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r.jsx(
3463
+ V,
3464
+ {
3465
+ type: "button",
3466
+ variant: "outline",
3467
+ size: "sm",
3468
+ onClick: y,
3469
+ children: "Copy from OG Settings"
3470
+ }
3471
+ ) }),
3472
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3473
+ /* @__PURE__ */ r.jsx(Z, { className: "text-xs", htmlFor: "searchTitle", children: "Search Title" }),
3474
+ /* @__PURE__ */ r.jsx(
3475
+ le,
3476
+ {
3477
+ type: "text",
3478
+ id: "searchTitle",
3479
+ name: "searchTitle",
3480
+ value: s.searchTitle,
3481
+ onChange: x,
3482
+ disabled: p,
3483
+ placeholder: "Enter search title"
3484
+ }
3485
+ ),
3486
+ /* @__PURE__ */ r.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400 leading-4", children: "The search title should be between 10 and 60 characters." })
3487
+ ] }),
3488
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3489
+ /* @__PURE__ */ r.jsx(Z, { className: "text-xs", htmlFor: "searchDescription", children: "Search Description" }),
3490
+ /* @__PURE__ */ r.jsx(
3491
+ Wt,
3492
+ {
3493
+ id: "searchDescription",
3494
+ name: "searchDescription",
3495
+ value: s.searchDescription,
3496
+ onChange: x,
3497
+ placeholder: "Enter search description"
3498
+ }
3499
+ ),
3500
+ /* @__PURE__ */ r.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400 leading-4", children: "The search description should be between 50 and 160 characters." })
3501
+ ] })
3502
+ ] }) })
3503
+ ] }),
3504
+ /* @__PURE__ */ r.jsxs(qt, { value: "jsonLD", children: [
3505
+ /* @__PURE__ */ r.jsx(Vt, { className: "text-slate-700 font-bold", children: "JSON-LD" }),
3506
+ /* @__PURE__ */ r.jsx(Kt, { children: /* @__PURE__ */ r.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsx(
3507
+ Wt,
3508
+ {
3509
+ id: "jsonLD",
3510
+ name: "jsonLD",
3511
+ rows: 3,
3512
+ value: s.jsonLD,
3513
+ onChange: x,
3514
+ placeholder: "Enter JSON-LD"
3515
+ }
3516
+ ) }) }) })
3517
+ ] })
3518
+ ] }) }),
3519
+ /* @__PURE__ */ r.jsx("div", { className: "w-full flex items-center justify-end mt-4", children: /* @__PURE__ */ r.jsx(
3520
+ V,
3521
+ {
3522
+ size: "lg",
3523
+ variant: "default",
3524
+ onClick: E,
3525
+ disabled: Ve(a.current.initial, s) || p,
3526
+ children: d ? "Saving..." : "Save"
3527
+ }
3528
+ ) })
3529
+ ] });
3530
+ };
3531
+ Nr.displayName = "SeoPanel";
3532
+ const Cr = ({
3533
+ page: e,
3534
+ onClose: t
3535
+ }) => {
3536
+ const [n, s] = $(e.slug || ""), { mutate: i, isPending: a } = Do(), { data: o } = Ut(), l = Ce(o, { key: e == null ? void 0 : e.collection }), u = (h) => {
3537
+ h.preventDefault(), i({ ...e, slug: n }, { onSuccess: t });
3538
+ }, f = (e == null ? void 0 : e.lang) || "";
3539
+ return /* @__PURE__ */ r.jsx(Ge, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ r.jsxs(De, { children: [
3540
+ /* @__PURE__ */ r.jsxs(Le, { children: [
3541
+ /* @__PURE__ */ r.jsx(Ue, { children: "Change Slug" }),
3542
+ /* @__PURE__ */ r.jsx(ot, { className: "text-xs", children: /* @__PURE__ */ r.jsxs(ji, { variant: "destructive", className: "mt-2", children: [
3543
+ /* @__PURE__ */ r.jsx(Pi, { className: "h-4 w-4" }),
3544
+ "Changing the slug may have impact on your SEO. Please proceed with caution."
3545
+ ] }) })
3546
+ ] }),
3547
+ /* @__PURE__ */ r.jsxs("form", { onSubmit: u, children: [
3548
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-4 py-4 text-sm ", children: [
3549
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3550
+ /* @__PURE__ */ r.jsxs("div", { children: [
3551
+ /* @__PURE__ */ r.jsx("span", { children: "Type:" }),
3552
+ /* @__PURE__ */ r.jsxs("span", { className: "font-medium text-gray-600", children: [
3553
+ " ",
3554
+ (l == null ? void 0 : l.name) || (e == null ? void 0 : e.collection)
3555
+ ] })
3556
+ ] }),
3557
+ /* @__PURE__ */ r.jsxs("div", { children: [
3558
+ /* @__PURE__ */ r.jsx("span", { children: "Name:" }),
3559
+ /* @__PURE__ */ r.jsxs("span", { className: "font-medium text-gray-600", children: [
3560
+ " ",
3561
+ e.name
3562
+ ] })
3563
+ ] })
3564
+ ] }),
3565
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3566
+ /* @__PURE__ */ r.jsxs(Z, { htmlFor: "slug", className: "text-right", children: [
3567
+ "Slug",
3568
+ " ",
3569
+ /* @__PURE__ */ r.jsxs("small", { className: "font-light text-gray-500", children: [
3570
+ "Slug should start with /",
3571
+ f
3572
+ ] })
3573
+ ] }),
3574
+ /* @__PURE__ */ r.jsx(
3575
+ le,
3576
+ {
3577
+ id: "slug",
3578
+ value: n,
3579
+ onChange: (h) => {
3580
+ const d = h.target.value;
3581
+ en(d, `/${f}`) && s(d);
3582
+ },
3583
+ className: "col-span-3",
3584
+ required: !0,
3585
+ pattern: "^/.*",
3586
+ title: "Slug must start with /",
3587
+ placeholder: "Enter page slug"
3588
+ }
3589
+ )
3590
+ ] })
3591
+ ] }),
3592
+ /* @__PURE__ */ r.jsx(lt, { children: /* @__PURE__ */ r.jsx(
3593
+ V,
3594
+ {
3595
+ type: "submit",
3596
+ disabled: a || !en(n, `/${f}`) || Ve(e == null ? void 0 : e.slug, n),
3597
+ children: a ? "Changing..." : "Change Slug"
3598
+ }
3599
+ ) })
3600
+ ] })
3601
+ ] }) });
3602
+ };
3603
+ function Tr({
3604
+ page: e,
3605
+ onClose: t
3606
+ }) {
3607
+ const [, n] = Fe(), { mutate: s, isPending: i } = Io(), a = () => {
3608
+ s(e, {
3609
+ onSuccess: () => {
3610
+ e != null && e.primaryPage || (window.history.replaceState(null, "", "/"), n(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate"))), t();
3611
+ }
3612
+ });
3613
+ };
3614
+ return /* @__PURE__ */ r.jsx(Ge, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ r.jsxs(De, { children: [
3615
+ /* @__PURE__ */ r.jsxs(Le, { children: [
3616
+ /* @__PURE__ */ r.jsx(Ue, { children: "Confirm Deletion" }),
3617
+ /* @__PURE__ */ r.jsxs(ot, { className: "py-4 text-slate-500", children: [
3618
+ /* @__PURE__ */ r.jsxs("div", { children: [
3619
+ "Are you sure you want to remove ",
3620
+ /* @__PURE__ */ r.jsx("b", { children: (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.slug) }),
3621
+ " ",
3622
+ (e == null ? void 0 : e.collection) === "global" ? "global block?" : `page? ${e != null && e.primaryPage ? "" : "This will also delete all associated language pages."}`
3623
+ ] }),
3624
+ e.lang && /* @__PURE__ */ r.jsxs("div", { className: "py-2 text-sm", children: [
3625
+ "Language:",
3626
+ " ",
3627
+ /* @__PURE__ */ r.jsx("span", { className: "font-medium text-gray-500", children: K(je, e.lang, e.lang) })
3628
+ ] })
3629
+ ] })
3630
+ ] }),
3631
+ /* @__PURE__ */ r.jsxs(lt, { children: [
3632
+ /* @__PURE__ */ r.jsx(V, { variant: "outline", onClick: t, children: "Cancel" }),
3633
+ /* @__PURE__ */ r.jsx(
3634
+ V,
3635
+ {
3636
+ variant: "destructive",
3637
+ disabled: i,
3638
+ onClick: a,
3639
+ children: i ? "Deleting..." : "Delete"
3640
+ }
3641
+ )
3642
+ ] })
3643
+ ] }) });
3644
+ }
3645
+ const Ar = ({
3646
+ page: e,
3647
+ onClose: t
3648
+ }) => {
3649
+ const { mutate: n, isPending: s } = Ro(), i = async () => {
3650
+ n(e, { onSuccess: t });
3651
+ };
3652
+ return /* @__PURE__ */ r.jsx(Ge, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ r.jsxs(De, { children: [
3653
+ /* @__PURE__ */ r.jsxs(Le, { children: [
3654
+ /* @__PURE__ */ r.jsx(Ue, { children: "Confirm action" }),
3655
+ /* @__PURE__ */ r.jsxs(ot, { children: [
3656
+ "Are you sure you want to take offline",
3657
+ " ",
3658
+ /* @__PURE__ */ r.jsx("b", { children: (e == null ? void 0 : e.name) ?? (e == null ? void 0 : e.slug) }),
3659
+ "?"
3660
+ ] })
3661
+ ] }),
3662
+ /* @__PURE__ */ r.jsxs(lt, { children: [
3663
+ /* @__PURE__ */ r.jsx(V, { variant: "outline", onClick: t, children: "Cancel" }),
3664
+ /* @__PURE__ */ r.jsx(
3665
+ V,
3666
+ {
3667
+ variant: "destructive",
3668
+ disabled: s,
3669
+ onClick: i,
3670
+ children: s ? "Updating..." : "Take offline"
3671
+ }
3672
+ )
3673
+ ] })
3674
+ ] }) });
3675
+ }, Uo = ({
3676
+ langProps: e,
3677
+ onClose: t,
3678
+ languages: n
3679
+ }) => {
3680
+ const { data: s } = ut(), [i, a] = $(e.name || ""), [o, l] = $(e.edit ? e.lang : ""), [u, f] = $(e.edit ? e.slug : ""), { mutate: h, isPending: d } = Sr(), { mutate: p, isPending: E } = Hn(), S = (e == null ? void 0 : e.collection) === "global", y = d || E, x = (v) => {
3681
+ v.preventDefault();
3682
+ const b = {
3683
+ name: i,
3684
+ lang: o,
3685
+ primaryPage: s == null ? void 0 : s.id,
3686
+ slug: u,
3687
+ collection: s == null ? void 0 : s.collection
3688
+ };
3689
+ b.collection = e.collection, e.edit && (b.id = e == null ? void 0 : e.id), e.edit ? p(b, { onSuccess: t }) : h(b, { onSuccess: t });
3690
+ };
3691
+ return /* @__PURE__ */ r.jsx(Ge, { open: !!e, onOpenChange: t, children: /* @__PURE__ */ r.jsxs(De, { className: "sm:max-w-[425px]", children: [
3692
+ /* @__PURE__ */ r.jsxs(Le, { children: [
3693
+ /* @__PURE__ */ r.jsx(Ue, { children: e.edit ? "Edit language" : "Add New language" }),
3694
+ /* @__PURE__ */ r.jsx(ot, { children: "Enter the details for the language" })
3695
+ ] }),
3696
+ /* @__PURE__ */ r.jsxs("form", { onSubmit: x, children: [
3697
+ /* @__PURE__ */ r.jsxs("div", { className: "grid gap-4 py-4", children: [
3698
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3699
+ /* @__PURE__ */ r.jsx(Z, { htmlFor: "lang", className: "text-right", children: "Language" }),
3700
+ /* @__PURE__ */ r.jsxs(
3701
+ "select",
3702
+ {
3703
+ value: o,
3704
+ disabled: e.edit || Y(n),
3705
+ onChange: (v) => {
3706
+ const b = v.target.value;
3707
+ l(b), !S && f(`/${b}`);
3708
+ },
3709
+ className: "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 col-span-3",
3710
+ children: [
3711
+ /* @__PURE__ */ r.jsx("option", { value: "", disabled: !0, selected: !0, children: e.edit ? K(je, e.lang, e.lang) : Y(n) ? "All available language page is created." : "Choose language" }),
3712
+ de(n, (v) => /* @__PURE__ */ r.jsx("option", { value: v, children: K(je, v, v) }, v))
3713
+ ]
3714
+ }
3715
+ )
3716
+ ] }),
3717
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3718
+ /* @__PURE__ */ r.jsx(Z, { htmlFor: "slug", className: "text-right", children: "Page Name" }),
3719
+ /* @__PURE__ */ r.jsx(
3720
+ le,
3721
+ {
3722
+ id: "name",
3723
+ value: i,
3724
+ onChange: (v) => a(v.target.value),
3725
+ className: "col-span-3",
3726
+ required: !0,
3727
+ placeholder: "Enter page name"
3728
+ }
3729
+ )
3730
+ ] }),
3731
+ !S && /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
3732
+ /* @__PURE__ */ r.jsxs(Z, { htmlFor: "slug", className: "text-right", children: [
3733
+ "Slug",
3734
+ " ",
3735
+ /* @__PURE__ */ r.jsx("small", { className: "font-light", children: e.edit ? "To update slug use 'Change slug' action" : " (Slug should start with /{lang})" })
3736
+ ] }),
3737
+ /* @__PURE__ */ r.jsx(
3738
+ le,
3739
+ {
3740
+ id: "slug",
3741
+ value: u,
3742
+ onChange: (v) => {
3743
+ const b = v.target.value;
3744
+ en(b, `/${o}`) && f(yt(di(b)));
3745
+ },
3746
+ className: "col-span-3",
3747
+ required: !0,
3748
+ pattern: "^/.*",
3749
+ disabled: Y(o) || (e == null ? void 0 : e.edit),
3750
+ title: "Slug must start with /",
3751
+ placeholder: Y(o) ? "Choose language to add slug" : "Enter page slug"
3752
+ }
3753
+ )
3754
+ ] })
3755
+ ] }),
3756
+ /* @__PURE__ */ r.jsx(lt, { children: /* @__PURE__ */ r.jsx(
3757
+ V,
3758
+ {
3759
+ type: "submit",
3760
+ disabled: y || !i || !o || !S && !en(u, `/${o}`),
3761
+ children: y ? e.edit ? "Updating..." : "Adding..." : e.edit ? "Update" : "Add new language"
3762
+ }
3763
+ ) })
3764
+ ] })
3765
+ ] }) });
3766
+ }, Fo = () => {
3767
+ const [e, t] = $(null), { selectedLang: n, fallbackLang: s, setSelectedLang: i } = cn(), { data: a, isFetching: o } = zn(), { data: l } = ut(), [u, f] = $(null), [h, d] = $(null), [p, E] = $(null), { data: S } = jr(), y = fe(
3768
+ K(S, "languages") || ["en"],
3769
+ (x) => !Ce(a, { lang: x }) && x !== K(S, "fallbackLang")
3770
+ );
3771
+ return /* @__PURE__ */ r.jsxs("div", { className: "space-y-4 pt-2", children: [
3772
+ /* @__PURE__ */ r.jsx("ul", { className: "space-y-2 mt-4", children: o ? /* @__PURE__ */ r.jsxs("div", { className: "w-full space-y-3 py-4", children: [
3773
+ /* @__PURE__ */ r.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
3774
+ /* @__PURE__ */ r.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
3775
+ /* @__PURE__ */ r.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
3776
+ ] }) : de(a, (x) => {
3777
+ const v = x.lang, b = x.slug, q = !x.primaryPage, H = v === n;
3778
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
3779
+ /* @__PURE__ */ r.jsxs(
3780
+ "li",
3781
+ {
3782
+ className: `text-slate-500 w-full p-2 rounded cursor-pointer flex items-center justify-between ${H ? "bg-gray-200" : "hover:bg-gray-100"}`,
3783
+ onClick: () => i(v),
3784
+ children: [
3785
+ /* @__PURE__ */ r.jsxs("div", { className: " flex-1 gap-x-3", children: [
3786
+ /* @__PURE__ */ r.jsxs("div", { className: "text-[13px] flex items-center gap-x-2", children: [
3787
+ K(je, q ? s : v, v),
3788
+ /* @__PURE__ */ r.jsx(
3789
+ "div",
3790
+ {
3791
+ style: {
3792
+ backgroundColor: x != null && x.online ? "lightgreen" : "lightgray"
3793
+ },
3794
+ className: "rounded-full w-2 h-2 mt-1"
3795
+ }
3796
+ )
3797
+ ] }),
3798
+ /* @__PURE__ */ r.jsxs("div", { children: [
3799
+ b && /* @__PURE__ */ r.jsxs("div", { className: "text-[11px] text-slate-500", children: [
3800
+ "Slug:",
3801
+ /* @__PURE__ */ r.jsxs("b", { children: [
3802
+ " ",
3803
+ b
3804
+ ] })
3805
+ ] }),
3806
+ /* @__PURE__ */ r.jsxs("div", { className: "text-[11px] text-slate-500", children: [
3807
+ "Name:",
3808
+ /* @__PURE__ */ r.jsxs("b", { children: [
3809
+ " ",
3810
+ x.name,
3811
+ " "
3812
+ ] })
3813
+ ] })
3814
+ ] })
3815
+ ] }),
3816
+ q ? /* @__PURE__ */ r.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
3817
+ /* @__PURE__ */ r.jsx(_i, { fill: "orange", className: "w-3 h-3" }),
3818
+ /* @__PURE__ */ r.jsx("b", { children: " Primary" })
3819
+ ] }) : /* @__PURE__ */ r.jsx("div", { className: "flex items-center gap-x-3", children: /* @__PURE__ */ r.jsxs(Mn, { children: [
3820
+ /* @__PURE__ */ r.jsx(
3821
+ $n,
3822
+ {
3823
+ asChild: !0,
3824
+ onClick: (O) => O.stopPropagation(),
3825
+ children: /* @__PURE__ */ r.jsx(
3826
+ V,
3827
+ {
3828
+ variant: "ghost",
3829
+ size: "sm",
3830
+ className: "h-8 w-8 p-0",
3831
+ children: /* @__PURE__ */ r.jsx(Oi, { className: "h-4 w-4" })
3832
+ }
3833
+ )
3834
+ }
3835
+ ),
3836
+ /* @__PURE__ */ r.jsxs(qn, { align: "end", className: "text-sm", children: [
3837
+ /* @__PURE__ */ r.jsxs(
3838
+ xe,
3839
+ {
3840
+ className: "flex items-center gap-2 cursor-pointer",
3841
+ onClick: (O) => {
3842
+ O.stopPropagation(), t({ ...x, edit: !0 });
3843
+ },
3844
+ children: [
3845
+ /* @__PURE__ */ r.jsx(Ii, { className: "size-3" }),
3846
+ "Edit"
3847
+ ]
3848
+ }
3849
+ ),
3850
+ (x == null ? void 0 : x.online) && /* @__PURE__ */ r.jsxs(
3851
+ xe,
3852
+ {
3853
+ className: "flex items-center gap-2 cursor-pointer",
3854
+ onClick: (O) => {
3855
+ O.stopPropagation(), d(x);
3856
+ },
3857
+ children: [
3858
+ /* @__PURE__ */ r.jsx(Fs, { className: "size-3" }),
3859
+ "Take offline"
3860
+ ]
3861
+ }
3862
+ ),
3863
+ (x == null ? void 0 : x.collection) !== "global" && /* @__PURE__ */ r.jsxs(
3864
+ xe,
3865
+ {
3866
+ className: "flex items-center gap-2 cursor-pointer",
3867
+ onClick: (O) => {
3868
+ O.stopPropagation(), E(x);
3869
+ },
3870
+ children: [
3871
+ /* @__PURE__ */ r.jsx(Bs, { className: "size-3" }),
3872
+ "Change slug"
3873
+ ]
3874
+ }
3875
+ ),
3876
+ /* @__PURE__ */ r.jsxs(
3877
+ xe,
3878
+ {
3879
+ className: "flex items-center gap-2 cursor-pointer",
3880
+ onClick: (O) => {
3881
+ O.stopPropagation(), f(x);
3882
+ },
3883
+ children: [
3884
+ /* @__PURE__ */ r.jsx(Ri, { className: "size-3" }),
3885
+ "Delete"
3886
+ ]
3887
+ }
3888
+ )
3889
+ ] })
3890
+ ] }) })
3891
+ ]
3892
+ },
3893
+ x.id
3894
+ ),
3895
+ /* @__PURE__ */ r.jsx("div", { className: "h-1 w-full border-b" })
3896
+ ] });
3897
+ }) }),
3898
+ /* @__PURE__ */ r.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ r.jsx(
3899
+ V,
3900
+ {
3901
+ variant: "default",
3902
+ size: "sm",
3903
+ disabled: Y(y),
3904
+ onClick: () => {
3905
+ t({
3906
+ name: l == null ? void 0 : l.name,
3907
+ collection: l == null ? void 0 : l.collection,
3908
+ lang: "",
3909
+ slug: "",
3910
+ edit: !1
3911
+ });
3912
+ },
3913
+ children: "+ Add new language"
3914
+ }
3915
+ ) }),
3916
+ e && /* @__PURE__ */ r.jsx(
3917
+ Uo,
3918
+ {
3919
+ languages: y,
3920
+ langProps: e,
3921
+ onClose: () => t(null)
3922
+ }
3923
+ ),
3924
+ u && /* @__PURE__ */ r.jsx(Tr, { page: u, onClose: () => f(null) }),
3925
+ h && /* @__PURE__ */ r.jsx(
3926
+ Ar,
3927
+ {
3928
+ page: h,
3929
+ onClose: () => d(null)
3930
+ }
3931
+ ),
3932
+ p && /* @__PURE__ */ r.jsx(
3933
+ Cr,
3934
+ {
3935
+ page: p,
3936
+ onClose: () => E(null)
3937
+ }
3938
+ )
3939
+ ] });
3940
+ }, Bo = () => {
3941
+ const e = J();
3942
+ return ve({
3943
+ queryKey: [T.GET_CHANGES],
3944
+ queryFn: async () => X(e, { action: T.GET_CHANGES })
3945
+ });
3946
+ };
3947
+ function Mo({
3948
+ onClose: e = () => console.log("Cancelled")
3949
+ }) {
3950
+ const [t, n] = $([]), { data: s, isFetching: i } = Bo(), { data: a } = Ut(), o = ce(
3951
+ () => fe(s, (y) => y.collection !== "global"),
3952
+ [s]
3953
+ ), l = ce(
3954
+ () => fe(s, { collection: "global" }),
3955
+ [s]
3956
+ ), { mutate: u, isPending: f } = Go();
3957
+ Se(() => {
3958
+ n(de(fe(s, { online: !0 }), "id"));
3959
+ }, [s]);
3960
+ const h = t.length === (s == null ? void 0 : s.length), d = (y) => {
3961
+ n(
3962
+ (x) => Ee(x, y) ? fe(x, (v) => v !== y) : gi(x, y)
3963
+ );
3964
+ }, p = () => {
3965
+ n(h ? [] : de(s, "id"));
3966
+ }, E = () => {
3967
+ u(
3968
+ { ids: t, theme: !1 },
3969
+ {
3970
+ onSuccess: () => {
3971
+ e();
3972
+ }
3973
+ }
3974
+ );
3975
+ }, S = (y) => {
3976
+ if (y === "global") return "Global Block";
3977
+ const x = Ce(a, { key: y });
3978
+ return x ? x == null ? void 0 : x.name : y;
3979
+ };
3980
+ return /* @__PURE__ */ r.jsx(Ge, { open: !0, onOpenChange: f ? () => {
3981
+ } : e, children: /* @__PURE__ */ r.jsxs(De, { className: "max-w-4xl", children: [
3982
+ /* @__PURE__ */ r.jsxs(Le, { children: [
3983
+ /* @__PURE__ */ r.jsx(Ue, { children: "Publish changes" }),
3984
+ /* @__PURE__ */ r.jsx(ot, { className: "text-xs", children: "Select the pages you want to publish. Click publish when you're done." })
3985
+ ] }),
3986
+ /* @__PURE__ */ r.jsx("div", { className: "relative overflow-x-auto -mx-4", children: i ? /* @__PURE__ */ r.jsxs("div", { className: "space-y-2 px-1", children: [
3987
+ /* @__PURE__ */ r.jsx("div", { className: "bg-gray-200 h-6 w-full rounded animate-pulse mt-2" }),
3988
+ /* @__PURE__ */ r.jsx("div", { className: "bg-gray-200 h-6 w-full rounded animate-pulse" }),
3989
+ /* @__PURE__ */ r.jsx("div", { className: "bg-gray-200 h-6 w-full rounded animate-pulse" }),
3990
+ /* @__PURE__ */ r.jsx("div", { className: "bg-gray-200 h-6 w-full rounded animate-pulse" })
3991
+ ] }) : /* @__PURE__ */ r.jsxs("table", { className: "max-h-96 w-full text-xs text-left rtl:text-right text-gray-500 dark:text-gray-400", children: [
3992
+ /* @__PURE__ */ r.jsx("thead", { className: "text-gray-700 border-b bg-gray-50 dark:bg-gray-700 dark:text-gray-400", children: /* @__PURE__ */ r.jsxs("tr", { children: [
3993
+ /* @__PURE__ */ r.jsxs(
3994
+ "th",
3995
+ {
3996
+ scope: "col",
3997
+ className: "px-6 py-3 flex items-center gap-x-2 w-[1 50px]",
3998
+ children: [
3999
+ /* @__PURE__ */ r.jsx(
4000
+ "input",
4001
+ {
4002
+ checked: h,
4003
+ onClick: (y) => {
4004
+ y.stopPropagation(), p();
4005
+ },
4006
+ type: "checkbox",
4007
+ className: "rounded focus:outline-none focus:ring-0 mt-1 cursor-pointer"
4008
+ }
4009
+ ),
4010
+ "Name"
4011
+ ]
4012
+ }
4013
+ ),
4014
+ /* @__PURE__ */ r.jsx("th", { scope: "col", className: "px-2 py-3 w-[100px]", children: "Type" }),
4015
+ /* @__PURE__ */ r.jsx("th", { scope: "col", className: "px-4 py-3 w-[150px] text-right", children: "Status" })
4016
+ ] }) }),
4017
+ /* @__PURE__ */ r.jsx("tbody", { children: de(
4018
+ [
4019
+ { label: "Updated Pages & Global Blocks", top: "pt-2" },
4020
+ ...xt(
4021
+ fe(o, { online: !0 }),
4022
+ "collection"
4023
+ ),
4024
+ ...xt(
4025
+ fe(l, { online: !0 }),
4026
+ "collection"
4027
+ ),
4028
+ { label: "Offline Pages & Global Blocks", top: "pt-6" },
4029
+ ...xt(
4030
+ fe(o, { online: !1 }),
4031
+ "collection"
4032
+ ),
4033
+ ...xt(
4034
+ fe(l, { online: !1 }),
4035
+ "collection"
4036
+ )
4037
+ ],
4038
+ (y) => y.label ? /* @__PURE__ */ r.jsx("tr", { children: /* @__PURE__ */ r.jsxs(
4039
+ "td",
4040
+ {
4041
+ colSpan: 4,
4042
+ className: `px-6 py-2 text-xs font-medium text-gray-800 relative ${y.top}`,
4043
+ children: [
4044
+ /* @__PURE__ */ r.jsx("div", { className: "absolute inset-0 left-6 flex items-center", children: /* @__PURE__ */ r.jsx("div", { className: "w-full order-gray-300" }) }),
4045
+ /* @__PURE__ */ r.jsx("div", { className: "relative flex justify-start", children: /* @__PURE__ */ r.jsx("span", { className: "bg-gray-50 pr-2", children: y.label }) })
4046
+ ]
4047
+ }
4048
+ ) }, "separator") : /* @__PURE__ */ r.jsxs(
4049
+ "tr",
4050
+ {
4051
+ className: "hover:bg-gray-50 border-b last:border-b-0",
4052
+ children: [
4053
+ /* @__PURE__ */ r.jsxs(
4054
+ "td",
4055
+ {
4056
+ scope: "row",
4057
+ className: "px-6 py-2 text-gray-900 whitespace-nowrap dark:text-white flex items-center gap-x-1",
4058
+ children: [
4059
+ /* @__PURE__ */ r.jsx(
4060
+ "input",
4061
+ {
4062
+ checked: Ee(t, y == null ? void 0 : y.id),
4063
+ onClick: (x) => {
4064
+ x.stopPropagation(), d(y == null ? void 0 : y.id);
4065
+ },
4066
+ type: "checkbox",
4067
+ className: "rounded focus:outline-none focus:ring-0 cursor-pointer"
4068
+ }
4069
+ ),
4070
+ " ",
4071
+ y.collection === "global" ? /* @__PURE__ */ r.jsx(Gi, { className: "h-4 w-4" }) : /* @__PURE__ */ r.jsx(Xt, { className: "h-4 w-4" }),
4072
+ y.name,
4073
+ y.slug && /* @__PURE__ */ r.jsxs("span", { className: "text-xs text-gray-500", children: [
4074
+ "(",
4075
+ y.slug,
4076
+ ")"
4077
+ ] })
4078
+ ]
4079
+ }
4080
+ ),
4081
+ /* @__PURE__ */ r.jsx("td", { className: "px-2", children: S(y == null ? void 0 : y.collection) }),
4082
+ /* @__PURE__ */ r.jsx("td", { className: "px-4 text-right", children: hi(y.changes) || "" })
4083
+ ]
4084
+ },
4085
+ y == null ? void 0 : y.id
4086
+ )
4087
+ ) })
4088
+ ] }) }),
4089
+ /* @__PURE__ */ r.jsxs(lt, { className: "mt-10", children: [
4090
+ /* @__PURE__ */ r.jsx(V, { disabled: f, variant: "outline", onClick: e, children: "Cancel" }),
4091
+ /* @__PURE__ */ r.jsx(
4092
+ V,
4093
+ {
4094
+ disabled: f || i || Y(s),
4095
+ onClick: E,
4096
+ children: f ? "Publishing..." : "Publish"
4097
+ }
4098
+ )
4099
+ ] })
4100
+ ] }) });
4101
+ }
4102
+ const $o = () => {
4103
+ const e = J();
4104
+ return ve({
4105
+ queryKey: [T.GET_WEBSITE_DATA],
4106
+ staleTime: 1e3 * 60 * 5,
4107
+ queryFn: async () => X(e, {
4108
+ action: T.GET_WEBSITE_DATA,
4109
+ data: { draft: !0 }
4110
+ })
4111
+ });
4112
+ }, qo = () => {
4113
+ const e = J(), t = ge(), { toast: n } = Te();
4114
+ return be({
4115
+ mutationFn: async (s) => X(e, {
4116
+ action: T.UPDATE_WEBSITE_SETTINGS,
4117
+ data: s
4118
+ }),
4119
+ onSuccess: () => {
4120
+ t.invalidateQueries({
4121
+ queryKey: [T.GET_WEBSITE_SETTINGS]
4122
+ }), n({ title: "Website settings updated successfully." });
4123
+ },
4124
+ onError: (s) => {
4125
+ n({
4126
+ variant: "destructive",
4127
+ title: "Failed to update website settings",
4128
+ description: s.message
4129
+ });
4130
+ }
4131
+ });
4132
+ }, Vo = () => {
4133
+ const e = J(), t = ge(), { toast: n } = Te();
4134
+ return be({
4135
+ mutationFn: async (s) => X(e, { action: T.UPDATE_WEBSITE_DATA, data: s }),
4136
+ onSuccess: () => {
4137
+ t.invalidateQueries({
4138
+ queryKey: [T.GET_WEBSITE_DATA]
4139
+ }), n({ title: "Website data updated successfully." });
4140
+ },
4141
+ onError: (s) => {
4142
+ n({
4143
+ variant: "destructive",
4144
+ title: "Failed to update website data",
4145
+ description: s.message
4146
+ });
4147
+ }
4148
+ });
4149
+ };
4150
+ function Ko({ onClose: e }) {
4151
+ const { data: t, isFetching: n } = $o(), { mutateAsync: s, isPending: i } = Vo(), a = Lt("settingComponent", null), o = mi(async (l) => (await s({ data: l }), !0), 300);
4152
+ return a ? /* @__PURE__ */ r.jsx(Ge, { open: !0, onOpenChange: e, children: /* @__PURE__ */ r.jsxs(De, { className: "w-full", children: [
4153
+ /* @__PURE__ */ r.jsx(Le, { children: /* @__PURE__ */ r.jsx(Ue, { children: "Website Settings" }) }),
4154
+ n ? /* @__PURE__ */ r.jsxs("div", { className: "w-full space-y-3 py-4", children: [
4155
+ /* @__PURE__ */ r.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
4156
+ /* @__PURE__ */ r.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
4157
+ /* @__PURE__ */ r.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
4158
+ /* @__PURE__ */ r.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
4159
+ /* @__PURE__ */ r.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
4160
+ /* @__PURE__ */ r.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
4161
+ ] }) : /* @__PURE__ */ r.jsx("div", { children: ln.createElement(a, {
4162
+ data: t || {},
4163
+ onSave: i ? () => {
4164
+ } : o,
4165
+ cancel: i ? () => {
4166
+ } : e
4167
+ }) })
4168
+ ] }) }) : null;
4169
+ }
4170
+ function gn({
4171
+ children: e,
4172
+ content: t
4173
+ }) {
4174
+ return /* @__PURE__ */ r.jsx(Si, { children: /* @__PURE__ */ r.jsxs(Ni, { children: [
4175
+ /* @__PURE__ */ r.jsx(Ci, { asChild: !0, children: e }),
4176
+ /* @__PURE__ */ r.jsx(Ti, { side: "bottom", sideOffset: 10, children: /* @__PURE__ */ r.jsx("p", { children: t }) })
4177
+ ] }) });
4178
+ }
4179
+ const Wo = () => {
4180
+ const e = Lt("getPreviewUrl", async (o) => o), [t, n] = $(""), { data: s, isFetching: i } = ut(), a = ce(() => s == null ? void 0 : s.slug, [s == null ? void 0 : s.slug]);
4181
+ return Se(() => {
4182
+ (async () => {
4183
+ if (a && typeof e == "function") {
4184
+ const o = await e(a || "");
4185
+ n(o);
4186
+ } else
4187
+ n("");
4188
+ })();
4189
+ }, [e, a]), !t || (s == null ? void 0 : s.collection) === "global" || i ? null : /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
4190
+ /* @__PURE__ */ r.jsx(gn, { content: "Preview", children: /* @__PURE__ */ r.jsx("a", { href: t, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ r.jsx(V, { variant: "ghost", size: "icon", className: "gap-2", children: /* @__PURE__ */ r.jsx(Di, { className: "w-4 h-4" }) }) }) }),
4191
+ /* @__PURE__ */ r.jsx("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
4192
+ ] });
4193
+ }, zo = () => {
4194
+ const [e, t] = ai();
4195
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
4196
+ /* @__PURE__ */ r.jsx(gn, { content: "Theme", children: /* @__PURE__ */ r.jsx(
4197
+ V,
4198
+ {
4199
+ variant: e === "theme" ? "outline" : "ghost",
4200
+ size: "icon",
4201
+ className: "gap-2",
4202
+ onClick: () => t(e === "theme" ? "block" : "theme"),
4203
+ children: /* @__PURE__ */ r.jsx(Li, { className: "w-4 h-4" })
4204
+ }
4205
+ ) }),
4206
+ /* @__PURE__ */ r.jsx("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" })
4207
+ ] });
4208
+ }, Ho = () => {
4209
+ const [e, t] = $(!1), { savePage: n, saveState: s } = oi();
4210
+ Se(() => {
4211
+ const f = (h) => {
4212
+ s === "UNSAVED" && (h.preventDefault(), h.returnValue = !1);
4213
+ };
4214
+ return s === "UNSAVED" && window.addEventListener("beforeunload", f), () => {
4215
+ window.removeEventListener("beforeunload", f);
4216
+ };
4217
+ }, [s]);
4218
+ const i = Dt(async () => {
4219
+ t(!0), await n(!1);
4220
+ }, [n]);
4221
+ Se(() => {
4222
+ s === "SAVED" && t(!1);
4223
+ }, [s]);
4224
+ const a = ce(() => {
4225
+ if (s === "SAVED" || s === "UNSAVED") return s;
4226
+ if (s === "SAVING") return e ? s : "SAVED";
4227
+ }, [e, s]), { buttonIcon: o, buttonClass: l, tooltipContent: u } = ce(() => {
4228
+ switch (a) {
4229
+ case "UNSAVED":
4230
+ return {
4231
+ tooltipContent: "Save changes",
4232
+ buttonIcon: /* @__PURE__ */ r.jsx(ws, { strokeWidth: 5, className: "w-4 h-4 transition eas-in" }),
4233
+ buttonClass: "bg-gray-300 text-gray-500 focus:ring-gray-400 duration-100 hover:text-gray-900"
4234
+ };
4235
+ case "SAVING":
4236
+ return {
4237
+ tooltipContent: "Saving...",
4238
+ buttonIcon: /* @__PURE__ */ r.jsx(
4239
+ Ms,
4240
+ {
4241
+ strokeWidth: 3,
4242
+ className: "w-5 h-5 animate-spin transition ease-in-out"
4243
+ }
4244
+ ),
4245
+ buttonClass: "bg-yellow-500 text-white focus:ring-yellow-400"
4246
+ };
4247
+ case "SAVED":
4248
+ return {
4249
+ tooltipContent: "Changes saved",
4250
+ buttonIcon: /* @__PURE__ */ r.jsx(ws, { strokeWidth: 5, className: "w-4 h-4 transition eas-in" }),
4251
+ buttonClass: "bg-green-500 text-white hover:bg-green-600 hover:text-white focus:ring-green-400"
4252
+ };
4253
+ }
4254
+ }, [a]);
4255
+ return /* @__PURE__ */ r.jsx(gn, { content: u, children: /* @__PURE__ */ r.jsx(
4256
+ "button",
4257
+ {
4258
+ className: `w-7 h-7 mx-3 flex items-center justify-center p-2 rounded-full shadow-sm transition-all duration-200 ease-in-out active:scale-95 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-opacity-50 ${l}`,
4259
+ onClick: i,
4260
+ disabled: a === "SAVING",
4261
+ "aria-label": u,
4262
+ children: o
4263
+ }
4264
+ ) });
4265
+ }, Qo = () => {
4266
+ const [e, t] = $(!1), [n, s] = $(!1);
4267
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
4268
+ /* @__PURE__ */ r.jsxs(
4269
+ V,
4270
+ {
4271
+ size: "sm",
4272
+ className: "relative overflow-hidden transition-all duration-300 ease-in-out from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white font-semibold shadow-md",
4273
+ onMouseEnter: () => s(!0),
4274
+ onMouseLeave: () => s(!1),
4275
+ onClick: () => t(!0),
4276
+ disabled: e,
4277
+ children: [
4278
+ /* @__PURE__ */ r.jsx(
4279
+ "span",
4280
+ {
4281
+ className: `flex items-center gap-2 transition-transform duration-300 ease-in-out ${n ? "-translate-y-10" : ""}`,
4282
+ children: /* @__PURE__ */ r.jsx(Ui, { className: "w-4 h-4 mr-2" })
4283
+ }
4284
+ ),
4285
+ /* @__PURE__ */ r.jsx(
4286
+ "span",
4287
+ {
4288
+ className: `absolute inset-0 flex items-center left-3 transition-transform duration-300 ease-in-out ${n ? "" : "translate-y-10"}`,
4289
+ children: /* @__PURE__ */ r.jsx(Fi, { className: "w-4 h-4 mr-2" })
4290
+ }
4291
+ ),
4292
+ "Publish"
4293
+ ]
4294
+ }
4295
+ ),
4296
+ e && /* @__PURE__ */ r.jsx(Mo, { onClose: () => t(!1) })
4297
+ ] });
4298
+ }, Yo = () => {
4299
+ const e = Lt("settingComponent", null), [t, n] = $(!1);
4300
+ return e ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
4301
+ /* @__PURE__ */ r.jsx(gn, { content: "Website data", children: /* @__PURE__ */ r.jsx(
4302
+ V,
4303
+ {
4304
+ variant: "ghost",
4305
+ size: "icon",
4306
+ className: "gap-2",
4307
+ onClick: () => n(!0),
4308
+ children: /* @__PURE__ */ r.jsx(Bi, { className: "w-4 h-4" })
4309
+ }
4310
+ ) }),
4311
+ /* @__PURE__ */ r.jsx("div", { className: "w-px h-4 bg-gray-200 dark:bg-gray-700" }),
4312
+ t && /* @__PURE__ */ r.jsx(Ko, { onClose: () => n(!1) })
4313
+ ] }) : null;
4314
+ };
4315
+ function Jo() {
4316
+ return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-end gap-1", children: [
4317
+ /* @__PURE__ */ r.jsx(Yo, {}),
4318
+ /* @__PURE__ */ r.jsx(Wo, {}),
4319
+ /* @__PURE__ */ r.jsx(zo, {}),
4320
+ /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
4321
+ /* @__PURE__ */ r.jsx(Ho, {}),
4322
+ /* @__PURE__ */ r.jsx(Qo, {})
4323
+ ] })
4324
+ ] });
4325
+ }
4326
+ const Xo = ({
4327
+ editPage: e,
4328
+ addEditPage: t,
4329
+ setAddEditPage: n
4330
+ }) => {
4331
+ const s = t.id, [i, a] = $(s && t.name || ""), [o, l] = $(s && t.slug || ""), [u, f] = $(
4332
+ s || !Y(t == null ? void 0 : t.collection) ? (t == null ? void 0 : t.collection) || "" : "page"
4333
+ ), { data: h = [] } = Ut(), { mutate: d, isPending: p } = Sr(), { mutate: E, isPending: S } = Hn(), y = p || S, x = (v) => {
4334
+ v.preventDefault(), s ? E(
4335
+ {
4336
+ name: i,
4337
+ slug: o,
4338
+ id: t.id,
4339
+ collection: t.global ? "global" : u
4340
+ },
4341
+ {
4342
+ onSuccess: () => {
4343
+ n(null);
4344
+ }
4345
+ }
4346
+ ) : d(
4347
+ {
4348
+ name: i,
4349
+ slug: o,
4350
+ collection: t.global ? "global" : u
4351
+ },
4352
+ {
4353
+ onSuccess: (b) => {
4354
+ n(null), e(b.page.id);
4355
+ }
4356
+ }
4357
+ );
4358
+ };
4359
+ return /* @__PURE__ */ r.jsx(Ge, { open: !!t, onOpenChange: () => n(void 0), children: /* @__PURE__ */ r.jsxs(De, { className: "sm:max-w-[425px]", children: [
4360
+ /* @__PURE__ */ r.jsxs(Le, { children: [
4361
+ /* @__PURE__ */ r.jsxs(Ue, { children: [
4362
+ s ? "Edit" : "Add New",
4363
+ " ",
4364
+ t.global ? "Global Block" : Pe(u)
4365
+ ] }),
4366
+ /* @__PURE__ */ r.jsxs(ot, { children: [
4367
+ "Enter the details for the new",
4368
+ " ",
4369
+ t.global ? "Global Block" : `${Pe(u)}. Slug must start with /`
4370
+ ] })
4371
+ ] }),
4372
+ /* @__PURE__ */ r.jsxs("form", { onSubmit: x, children: [
4373
+ /* @__PURE__ */ r.jsxs("div", { className: "grid gap-4 py-4", children: [
4374
+ !t.global && /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
4375
+ /* @__PURE__ */ r.jsx(Z, { htmlFor: "pageType", children: "Type" }),
4376
+ /* @__PURE__ */ r.jsx(
4377
+ "select",
4378
+ {
4379
+ value: u,
4380
+ disabled: s,
4381
+ onChange: (v) => f(v.target.value),
4382
+ className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
4383
+ children: h.map((v) => /* @__PURE__ */ r.jsx("option", { value: v.key, children: v.name }, v.key))
4384
+ }
4385
+ )
4386
+ ] }),
4387
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
4388
+ /* @__PURE__ */ r.jsx(Z, { htmlFor: "name", className: "text-right", children: "Name" }),
4389
+ /* @__PURE__ */ r.jsx(
4390
+ le,
4391
+ {
4392
+ id: "name",
4393
+ value: i,
4394
+ placeholder: `Enter ${t.global ? "global block" : "page"} name`,
4395
+ onChange: (v) => a(v.target.value),
4396
+ className: "col-span-3",
4397
+ required: !0
4398
+ }
4399
+ )
4400
+ ] }),
4401
+ !t.global && /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs("div", { className: "space-y-1", children: [
4402
+ /* @__PURE__ */ r.jsxs(Z, { htmlFor: "slug", className: "text-right", children: [
4403
+ t.global ? "Identifier" : "Slug",
4404
+ " ",
4405
+ s && /* @__PURE__ */ r.jsx("small", { className: "text-gray-400 font-light", children: "To update slug use 'Change slug' action" })
4406
+ ] }),
4407
+ /* @__PURE__ */ r.jsx(
4408
+ le,
4409
+ {
4410
+ id: "slug",
4411
+ value: o,
4412
+ disabled: s,
4413
+ onChange: (v) => {
4414
+ var b;
4415
+ return l((b = v.target.value) == null ? void 0 : b.trim().toLowerCase());
4416
+ },
4417
+ className: "col-span-3",
4418
+ required: !0,
4419
+ pattern: "^/.*",
4420
+ title: "Slug must start with /",
4421
+ placeholder: "Enter page slug"
4422
+ }
4423
+ )
4424
+ ] }) })
4425
+ ] }),
4426
+ /* @__PURE__ */ r.jsx(lt, { children: /* @__PURE__ */ r.jsx(
4427
+ V,
4428
+ {
4429
+ type: "submit",
4430
+ disabled: y || !i || !t.global && !o.startsWith("/") || Ve(t.name, i) && Ve(t.slug, o) && Ve(t.pageType, u),
4431
+ children: y ? s ? "Updating..." : "Adding..." : t.global ? `${s ? "Update" : "Add"} global block` : `${s ? "Update" : "Add"} Page`
4432
+ }
4433
+ ) })
4434
+ ] })
4435
+ ] }) });
4436
+ }, Zo = ({ close: e }) => {
4437
+ const [t, n] = $([]), [s, i] = $(""), [a, o] = $(null), [l, u] = $(null), [f, h] = $(null), [d, p] = $(null), { data: E } = Ut(), { data: S, isFetching: y } = Wn(), [x, v] = Fe(), b = x.get("page"), q = Dt(
4438
+ (j) => {
4439
+ window.history.pushState({}, "", `?page=${j}`), v(new URLSearchParams({ page: j })), window.dispatchEvent(new PopStateEvent("popstate")), e();
4440
+ },
4441
+ [e, v]
4442
+ ), H = (j) => {
4443
+ Ee(t, j) ? n(fe(t, (L) => L !== j)) : n([...t, j]);
4444
+ };
4445
+ Se(() => {
4446
+ if (b) {
4447
+ const j = Ce(S, { id: b });
4448
+ j && (j != null && j.collection) && n((L) => [...L, j == null ? void 0 : j.collection]);
4449
+ }
4450
+ }, [S, b]);
4451
+ const O = ce(() => {
4452
+ const j = fe(S, (w) => Y(s) ? !0 : Ee(yt(w == null ? void 0 : w.name), yt(s)) || Ee(yt(w == null ? void 0 : w.slug), yt(s)));
4453
+ Y(s) || n(de(j, "collection"));
4454
+ const L = yi(j, "collection"), he = [
4455
+ { key: "page", name: "Pages" },
4456
+ { key: "global", name: "Global Block" },
4457
+ ...E.filter((w) => w.key !== "page")
4458
+ ];
4459
+ return de(he, (w) => ({
4460
+ ...w,
4461
+ items: xt(K(L, w.key, []), "slug") || []
4462
+ }));
4463
+ }, [S, E, s]);
4464
+ return /* @__PURE__ */ r.jsxs("div", { className: "h-full flex flex-col justify-between", children: [
4465
+ /* @__PURE__ */ r.jsxs("div", { className: "space-y-6 flex flex-col h-full", children: [
4466
+ /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-2", children: [
4467
+ /* @__PURE__ */ r.jsx("div", { className: "rounded-md bg-primary p-2 text-primary-foreground", children: /* @__PURE__ */ r.jsx(Xt, { className: "h-6 w-6" }) }),
4468
+ /* @__PURE__ */ r.jsxs("div", { className: "flex flex-col", children: [
4469
+ /* @__PURE__ */ r.jsx("span", { className: "text-sm font-semibold", children: "Pages" }),
4470
+ /* @__PURE__ */ r.jsx("span", { className: "text-xs text-muted-foreground", children: "Manage your site structure" })
4471
+ ] })
4472
+ ] }),
4473
+ /* @__PURE__ */ r.jsxs("div", { className: "relative flex item-center gap-x-4", children: [
4474
+ /* @__PURE__ */ r.jsx(
4475
+ Mi,
4476
+ {
4477
+ strokeWidth: 2.5,
4478
+ className: "absolute left-3 top-2.5 h-4 w-4 text-gray-400"
4479
+ }
4480
+ ),
4481
+ /* @__PURE__ */ r.jsx(
4482
+ le,
4483
+ {
4484
+ placeholder: "Search pages...",
4485
+ className: "pl-9 text-xs font-medium placeholder:text-gray-400 leading-none text-gray-700",
4486
+ value: s,
4487
+ onChange: (j) => i(j.target.value)
4488
+ }
4489
+ )
4490
+ ] }),
4491
+ y ? /* @__PURE__ */ r.jsx("div", { className: "space-y-2", children: de([...Array(5).keys()], (j) => /* @__PURE__ */ r.jsx(
4492
+ "div",
4493
+ {
4494
+ className: "h-9 w-full rounded bg-gray-200 animate-pulse"
4495
+ },
4496
+ j
4497
+ )) }) : Y(O) ? /* @__PURE__ */ r.jsxs("div", { className: "h-[70vh] flex flex-col gap-y-1 items-center justify-center text-slate-500 text-sm font-medium", children: [
4498
+ /* @__PURE__ */ r.jsx(Xt, { className: "h-6 w-6 stroke-[1]" }),
4499
+ "Empty List!",
4500
+ /* @__PURE__ */ r.jsx("span", { className: "font-light", children: "Add new page to start" })
4501
+ ] }) : /* @__PURE__ */ r.jsx("div", { className: "text-sm text-slate-700 space-y-2 h-[70vh] overflow-y-auto", children: de(O, (j) => /* @__PURE__ */ r.jsxs("div", { className: "border-0 py-", children: [
4502
+ /* @__PURE__ */ r.jsxs(
4503
+ "div",
4504
+ {
4505
+ className: "group font-medium flex items-center leading-none gap-x-2 cursor-pointer hover:bg-slate-100 rounded duration-200 p-1.5",
4506
+ onClick: () => H(j.key),
4507
+ children: [
4508
+ Ee(t, j.key) ? /* @__PURE__ */ r.jsx($s, { className: "w-4 h-4 text-slate-400 ease-in transition-all" }) : /* @__PURE__ */ r.jsx($i, { className: "w-4 h-4 text-slate-400 ease-in" }),
4509
+ ["page", "global"].includes(j.key) ? /* @__PURE__ */ r.jsx(Vi, { className: "w-4 h-4" }) : /* @__PURE__ */ r.jsx(qi, { className: "w-4 h-4" }),
4510
+ /* @__PURE__ */ r.jsx("span", { className: "leading-none", children: Pe(j.name) || "Uncategorized" }),
4511
+ /* @__PURE__ */ r.jsx(
4512
+ bs,
4513
+ {
4514
+ variant: "outline",
4515
+ className: `ml-2 text-xs font-bold rounded-full leading-none text-slate-500 ${j.key === "global" || j.key === "page" ? "opacity-0" : ""}`,
4516
+ children: K(j, "baseSlug.FALLBACK") || "/"
4517
+ }
4518
+ ),
4519
+ /* @__PURE__ */ r.jsxs(
4520
+ V,
4521
+ {
4522
+ variant: "ghost",
4523
+ size: "sm",
4524
+ className: "h-6 opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-1 text-xs",
4525
+ onClick: (L) => {
4526
+ L.stopPropagation(), p({
4527
+ slug: "",
4528
+ name: "",
4529
+ collection: j.key,
4530
+ global: j.key === "global"
4531
+ });
4532
+ },
4533
+ children: [
4534
+ /* @__PURE__ */ r.jsx(Es, { className: "h-3 w-3" }),
4535
+ "Add ",
4536
+ Pe(j.name) || "Uncategorized"
4537
+ ]
4538
+ }
4539
+ )
4540
+ ]
4541
+ }
4542
+ ),
4543
+ Ee(t, j.key) && /* @__PURE__ */ r.jsxs("div", { className: "bg-white pl-6 pt-2", children: [
4544
+ Y(K(j, "items", [])) && /* @__PURE__ */ r.jsxs("div", { className: "text-xs font-light px-3 pb-1", children: [
4545
+ "No ",
4546
+ Pe(j.name) || "Uncategorized"
4547
+ ] }),
4548
+ de(K(j, "items", []), (L) => {
4549
+ const he = b === K(L, "id");
4550
+ return /* @__PURE__ */ r.jsxs(
4551
+ "div",
4552
+ {
4553
+ onClick: () => q(K(L, "id")),
4554
+ className: `rounded flex items-center justify-between leading-none duration-300 cursor-pointer px-3 py-1.5 ${he ? "bg-gray-200" : "hover:bg-gray-100"}`,
4555
+ children: [
4556
+ /* @__PURE__ */ r.jsxs("div", { className: "flex items-center gap-x-2", children: [
4557
+ j.key === "global" ? /* @__PURE__ */ r.jsx(Ki, { className: "w-4 h-4 text-slate-500 stroke-[1]" }) : /* @__PURE__ */ r.jsx(Xt, { className: "w-4 h-4 text-slate-500 stroke-[1]" }),
4558
+ /* @__PURE__ */ r.jsx(
4559
+ "div",
4560
+ {
4561
+ className: `w-2.5 h-2.5 rounded-full ${L.online ? "bg-green-300" : "bg-gray-300"}`
4562
+ }
4563
+ ),
4564
+ /* @__PURE__ */ r.jsx("span", { className: "leading-none text-slate-800 font-light", children: Pe(L.name) }),
4565
+ /* @__PURE__ */ r.jsx(
4566
+ bs,
4567
+ {
4568
+ variant: "outline",
4569
+ className: `ml-2 font-bold text-xs rounded-full leading-none text-slate-500 ${j.key === "global" ? "opacity-0" : ""}`,
4570
+ children: K(L, "slug") || "/"
4571
+ }
4572
+ )
4573
+ ] }),
4574
+ /* @__PURE__ */ r.jsx("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ r.jsxs(Mn, { children: [
4575
+ /* @__PURE__ */ r.jsx(
4576
+ $n,
4577
+ {
4578
+ asChild: !0,
4579
+ onClick: (w) => w.stopPropagation(),
4580
+ children: /* @__PURE__ */ r.jsx(Wi, { className: "h-4 w-4 hover:stroke-[3]" })
4581
+ }
4582
+ ),
4583
+ /* @__PURE__ */ r.jsxs(
4584
+ qn,
4585
+ {
4586
+ align: "end",
4587
+ className: "text-sm",
4588
+ children: [
4589
+ /* @__PURE__ */ r.jsxs(
4590
+ xe,
4591
+ {
4592
+ className: "flex items-center gap-2 cursor-pointer",
4593
+ onClick: (w) => {
4594
+ w.stopPropagation(), p({
4595
+ ...L,
4596
+ global: j.key === "global"
4597
+ });
4598
+ },
4599
+ children: [
4600
+ /* @__PURE__ */ r.jsx(zi, { className: "size-3" }),
4601
+ "Edit"
4602
+ ]
4603
+ }
4604
+ ),
4605
+ (L == null ? void 0 : L.online) && /* @__PURE__ */ r.jsxs(
4606
+ xe,
4607
+ {
4608
+ className: "flex items-center gap-2 cursor-pointer",
4609
+ onClick: (w) => {
4610
+ w.stopPropagation(), u(L);
4611
+ },
4612
+ children: [
4613
+ /* @__PURE__ */ r.jsx(Fs, { className: "size-3" }),
4614
+ "Take offline"
4615
+ ]
4616
+ }
4617
+ ),
4618
+ j.key !== "global" && /* @__PURE__ */ r.jsxs(
4619
+ xe,
4620
+ {
4621
+ className: "flex items-center gap-2 cursor-pointer",
4622
+ onClick: (w) => {
4623
+ w.stopPropagation(), h(L);
4624
+ },
4625
+ children: [
4626
+ /* @__PURE__ */ r.jsx(Bs, { className: "size-3" }),
4627
+ "Change slug"
4628
+ ]
4629
+ }
4630
+ ),
4631
+ /* @__PURE__ */ r.jsxs(
4632
+ xe,
4633
+ {
4634
+ className: "flex items-center gap-2 cursor-pointer",
4635
+ onClick: (w) => {
4636
+ w.stopPropagation(), o(L);
4637
+ },
4638
+ children: [
4639
+ /* @__PURE__ */ r.jsx(Hi, { className: "size-3" }),
4640
+ "Delete"
4641
+ ]
4642
+ }
4643
+ )
4644
+ ]
4645
+ }
4646
+ )
4647
+ ] }) })
4648
+ ]
4649
+ }
4650
+ );
4651
+ })
4652
+ ] })
4653
+ ] }, j.key)) })
4654
+ ] }),
4655
+ /* @__PURE__ */ r.jsxs(
4656
+ V,
4657
+ {
4658
+ className: "text-sm flex gap-x-2",
4659
+ onClick: () => {
4660
+ p({
4661
+ slug: "",
4662
+ name: "",
4663
+ collection: "page"
4664
+ });
4665
+ },
4666
+ children: [
4667
+ /* @__PURE__ */ r.jsx(Es, { className: "w-4 h-4" }),
4668
+ " Add New"
4669
+ ]
4670
+ }
4671
+ ),
4672
+ d && /* @__PURE__ */ r.jsx(
4673
+ Xo,
4674
+ {
4675
+ editPage: q,
4676
+ addEditPage: d,
4677
+ setAddEditPage: p
4678
+ }
4679
+ ),
4680
+ a && /* @__PURE__ */ r.jsx(Tr, { page: a, onClose: () => o(null) }),
4681
+ l && /* @__PURE__ */ r.jsx(
4682
+ Ar,
4683
+ {
4684
+ page: l,
4685
+ onClose: () => u(null)
4686
+ }
4687
+ ),
4688
+ f && /* @__PURE__ */ r.jsx(
4689
+ Cr,
4690
+ {
4691
+ page: f,
4692
+ onClose: () => h(null)
4693
+ }
4694
+ )
4695
+ ] });
4696
+ }, el = () => {
4697
+ const e = Lt("logo", null);
4698
+ return e ? /* @__PURE__ */ r.jsx("div", { className: "w-full max-h-9 overflow-hidden pr-2", children: ln.createElement(e, {}) }) : null;
4699
+ }, tl = () => {
4700
+ const [e] = Fe(), t = e.get("page"), { data: n, isFetching: s } = ut(), [i, a] = $(!1), o = !!t && !Y(n), l = !t || !s && Y(n) || i;
4701
+ return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
4702
+ /* @__PURE__ */ r.jsxs(
4703
+ V,
4704
+ {
4705
+ variant: "secondary",
4706
+ className: "flex items-center w-full space-x-2 py-1",
4707
+ onClick: () => a(!0),
4708
+ children: [
4709
+ /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsx(Qi, { className: "h-4 w-4" }) }),
4710
+ /* @__PURE__ */ r.jsxs("span", { className: "truncate leading-tight flex items-center max-w-[200px]", children: [
4711
+ /* @__PURE__ */ r.jsx("span", { className: "text-slate-600 pr-1 font-light", children: "Editing:" }),
4712
+ s ? /* @__PURE__ */ r.jsx(Ms, { className: "h-4 w-4 animate-spin text-slate-400 ml-2" }) : K(n, "name") ?? ""
4713
+ ] })
4714
+ ]
4715
+ },
4716
+ "template-viewer"
4717
+ ),
4718
+ /* @__PURE__ */ r.jsx(
4719
+ Ai,
4720
+ {
4721
+ open: l,
4722
+ onOpenChange: (u) => !u && o && a(!1),
4723
+ children: /* @__PURE__ */ r.jsx(
4724
+ ki,
4725
+ {
4726
+ side: "left",
4727
+ className: `!max-w-screen-sm border-border w-full ${o ? "" : "sheet-hide-close-btn"}`,
4728
+ children: /* @__PURE__ */ r.jsx(Zo, { close: () => a(!1) })
4729
+ }
4730
+ )
4731
+ }
4732
+ )
4733
+ ] });
4734
+ }, nl = () => {
4735
+ const { fallbackLang: e, languages: t, selectedLang: n, setSelectedLang: s } = cn(), i = Y(n) ? e : n, a = ce(() => xi([e, ...t]).map((o) => {
4736
+ const l = K(je, o);
4737
+ return l ? { key: o, value: l } : null;
4738
+ }).filter((o) => o && (o == null ? void 0 : o.value)), [e, t]);
4739
+ return Y(t) && i === e ? null : Y(t) && i !== e ? /* @__PURE__ */ r.jsxs(V, { variant: "ghost", size: "sm", className: "gap-2 hover:bg-transparent", children: [
4740
+ /* @__PURE__ */ r.jsx(An, { className: "w-4 h-4" }),
4741
+ K(je, i, i)
4742
+ ] }) : /* @__PURE__ */ r.jsxs(Mn, { children: [
4743
+ /* @__PURE__ */ r.jsx($n, { asChild: !0, className: "focus:outline-none", children: /* @__PURE__ */ r.jsxs(V, { variant: "ghost", size: "sm", className: "gap-2", children: [
4744
+ /* @__PURE__ */ r.jsx(An, { className: "w-4 h-4" }),
4745
+ K(je, i, i),
4746
+ /* @__PURE__ */ r.jsx($s, { className: "w-4 h-4" })
4747
+ ] }) }),
4748
+ /* @__PURE__ */ r.jsx(qn, { className: "border-border space-y-1", children: de(a, (o) => /* @__PURE__ */ r.jsxs(
4749
+ xe,
4750
+ {
4751
+ className: li(
4752
+ "flex cursor-pointer items-center justify-between text-xs font-medium text-gray-800",
4753
+ o.key === i && "!bg-gray-200 text-gray-700"
4754
+ ),
4755
+ onClick: () => s(o.key),
4756
+ children: [
4757
+ /* @__PURE__ */ r.jsx("div", { children: o.value }),
4758
+ o.key === e && /* @__PURE__ */ r.jsxs(
4759
+ "small",
4760
+ {
4761
+ className: "text-[9px] flex items-center gap-x-1 text-orange-500 leading-none",
4762
+ children: [
4763
+ /* @__PURE__ */ r.jsx(Yi, { fill: "orange", className: "w-2 h-2" }),
4764
+ "Primary"
4765
+ ]
4766
+ }
4767
+ )
4768
+ ]
4769
+ },
4770
+ o.value
4771
+ )) })
4772
+ ] });
4773
+ };
4774
+ function sl() {
4775
+ return /* @__PURE__ */ r.jsxs("div", { className: "flex items-center justify-end gap-1", children: [
4776
+ /* @__PURE__ */ r.jsx(el, {}),
4777
+ /* @__PURE__ */ r.jsx(tl, {}),
4778
+ /* @__PURE__ */ r.jsx(nl, {})
4779
+ ] });
4780
+ }
4781
+ ri();
4782
+ const rl = (e) => {
4783
+ const t = Ls([]), [n] = Fe(), s = n.get("page"), { data: i } = ut(), { data: a } = Ao(), { data: o, isFetching: l } = ko(), { blocks: u } = Po(o), { data: f } = jr(), { data: h } = Ut(), { data: d } = zn(), { mutateAsync: p } = qo(), E = Co(), { getUILibraryBlock: S, getUILibraryBlocks: y, onSave: x } = To(), { getGlobalBlocks: v, getGlobalBlockBlocks: b } = _o(), { aiContext: q, setAiContext: H } = Kn(), { mutateAsync: O } = Oo();
4784
+ t.current = u;
4785
+ const j = ce(() => {
4786
+ const P = {};
4787
+ return e.mediaManagerComponent && (P.mediaManagerComponent = e.mediaManagerComponent), P;
4788
+ }, [e.mediaManagerComponent]), L = ce(() => Array.isArray(e == null ? void 0 : e.uiLibraries) ? [...a, ...e == null ? void 0 : e.uiLibraries] : a, [a, e == null ? void 0 : e.uiLibraries]), he = Dt(
4789
+ async (P, D) => await O({ collection: P, query: D }),
4790
+ [O]
4791
+ ), w = ce(() => K(f, "theme", {}), [f]);
4792
+ return console.log("currentTheme", w), /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsx(
4793
+ ci,
4794
+ {
4795
+ loading: l,
4796
+ fallbackLang: f.fallbackLang || "en",
4797
+ languages: vi(de(d, "lang")) || [],
4798
+ brandingOptions: (f == null ? void 0 : f.theme) || {},
4799
+ translations: e.translations || {},
4800
+ locale: e.locale || "en",
4801
+ htmlDir: e.htmlDir || "ltr",
4802
+ autoSaveSupport: e.autoSaveSupport || !1,
4803
+ autoSaveInterval: e.autoSaveInterval || 15,
4804
+ onError: e.onError || console.error,
4805
+ getGlobalBlockBlocks: b,
4806
+ getGlobalBlocks: v,
4807
+ blocks: u,
4808
+ theme: w,
4809
+ getUILibraryBlock: S,
4810
+ getUILibraryBlocks: y,
4811
+ uiLibraries: L,
4812
+ collections: h,
4813
+ searchCollectionItems: he,
4814
+ saveAiContextCallback: async (P) => {
4815
+ if (!s) return !0;
4816
+ const D = t.current, oe = {
4817
+ _type: "@chai/ai-context",
4818
+ _value: vs(P) ? P : ""
4819
+ }, se = [...D, oe];
4820
+ return await x({ page: s, blocks: se }), H(P), !0;
4821
+ },
4822
+ aiContext: q,
4823
+ askAiCallBack: E,
4824
+ onSave: async ({ blocks: P, theme: D }) => {
4825
+ if (Ve(D, w) || await p({ settings: { theme: D } }), console.log("onSave", P, D), !s) return !0;
4826
+ t.current = P;
4827
+ const oe = {
4828
+ _type: "@chai/ai-context",
4829
+ _value: vs(q) ? q : ""
4830
+ }, se = [...P, oe];
4831
+ return await x({ page: s, blocks: se }), t.current = P, !0;
4832
+ },
4833
+ topBarComponents: {
4834
+ left: [sl],
4835
+ right: [Jo]
4836
+ },
4837
+ sideBarComponents: {
4838
+ top: [
4839
+ ...(i == null ? void 0 : i.collection) !== "global" ? [
4840
+ {
4841
+ label: "SEO Setting",
4842
+ component: Nr,
4843
+ icon: /* @__PURE__ */ r.jsx(r.Fragment, { children: /* @__PURE__ */ r.jsxs(
4844
+ "svg",
4845
+ {
4846
+ xmlns: "http://www.w3.org/2000/svg",
4847
+ viewBox: "0 0 21 21",
4848
+ fill: "currentColor",
4849
+ width: "21",
4850
+ height: "21",
4851
+ children: [
4852
+ /* @__PURE__ */ r.jsx("path", { d: "M9.931 6.818c-1.238 0-2.136.925-2.136 2.2 0 1.279.898 2.207 2.136 2.207.664 0 1.257-.246 1.67-.694a.15.15 0 0 0-.009-.213l-.311-.286a.15.15 0 0 0-.213.009c-.273.297-.677.46-1.137.46-.699 0-1.233-.444-1.375-1.12h3.295a.15.15 0 0 0 .151-.151v-.211c0-1.295-.852-2.2-2.072-2.2m0 .724c.697 0 1.188.422 1.315 1.113h-2.69c.142-.673.676-1.113 1.374-1.113m4.332-.724c-1.246 0-2.15.925-2.15 2.2 0 1.279.904 2.207 2.15 2.207.596 0 1.143-.223 1.538-.628s.612-.965.612-1.579c0-1.275-.904-2.2-2.15-2.2m0 3.683c-.826 0-1.426-.624-1.426-1.483 0-.855.6-1.475 1.426-1.475s1.426.621 1.426 1.476c0 .423-.144.804-.406 1.073-.258.264-.62.41-1.019.41M6.318 8.71c-.665-.206-.902-.335-.902-.645 0-.47.564-.521.806-.521.29 0 .552.07.801.215a.15.15 0 0 0 .206-.055l.212-.366a.15.15 0 0 0-.055-.206 2.27 2.27 0 0 0-1.165-.312c-.915 0-1.53.501-1.53 1.245 0 .899.816 1.152 1.411 1.336.655.203.812.307.804.53-.016.398-.567.429-.735.429-.386 0-.722-.129-.972-.374q-.043-.042-.107-.043a.15.15 0 0 0-.106.045l-.295.302a.15.15 0 0 0 .002.213c.383.374.908.58 1.478.58.859 0 1.432-.441 1.459-1.125.031-.833-.746-1.074-1.313-1.249" }),
4853
+ /* @__PURE__ */ r.jsx("path", { d: "M20.396 2.049H.604A.604.604 0 0 0 0 2.653v12.7c0 .333.27.604.604.604h6.941c-.266 1.296-.881 1.966-.886 1.971a.604.604 0 0 0 .434 1.024h6.815a.604.604 0 0 0 .434-1.024c-.007-.007-.621-.675-.886-1.971h6.941c.333 0 .604-.27.604-.604V2.652a.604.604 0 0 0-.604-.604m-.604 12.701h-.985v-.17a.604.604 0 0 0-1.208 0v.17h-.63v-.17a.604.604 0 0 0-1.208 0v.17H1.207V3.256h18.585z" })
4854
+ ]
4855
+ }
4856
+ ) })
4857
+ }
4858
+ ] : [],
4859
+ ...Y(f == null ? void 0 : f.languages) ? [] : [
4860
+ {
4861
+ label: `Language ${(i == null ? void 0 : i.collection) === "global" ? "" : "page"}`,
4862
+ component: Fo,
4863
+ icon: /* @__PURE__ */ r.jsx(An, { className: "w-5 h-5 stroke-[2]" })
4864
+ }
4865
+ ]
4866
+ ]
4867
+ },
4868
+ ...j
4869
+ }
4870
+ ) });
4871
+ }, il = new ni({
4872
+ defaultOptions: { queries: { refetchOnWindowFocus: !1 } }
4873
+ }), $l = (e) => {
4874
+ const [, t] = Er();
4875
+ return Se(() => {
4876
+ t(
4877
+ pi(e, ["apiUrl", "getPreviewUrl", "logo", "settingComponent"])
4878
+ );
4879
+ }, [e, t]), /* @__PURE__ */ r.jsxs(si, { client: il, children: [
4880
+ /* @__PURE__ */ r.jsx(rl, { ...e }),
4881
+ /* @__PURE__ */ r.jsx(So, {})
4882
+ ] });
4883
+ };
4884
+ export {
4885
+ qs as $,
4886
+ Ll as A,
4887
+ ml as B,
4888
+ Al as C,
4889
+ Pl as D,
4890
+ ee as E,
4891
+ El as F,
4892
+ Cs as G,
4893
+ yo as H,
4894
+ jl as I,
4895
+ Yt as J,
4896
+ Bl as K,
4897
+ Il as L,
4898
+ Ol as M,
4899
+ Ie as N,
4900
+ Pa as O,
4901
+ kl as P,
4902
+ _l as Q,
4903
+ Cl as R,
4904
+ Sl as S,
4905
+ Nl as T,
4906
+ Jt as U,
4907
+ pl as V,
4908
+ $l as W,
4909
+ Xs as a,
4910
+ z as b,
4911
+ ae as c,
4912
+ Ta as d,
4913
+ Ws as e,
4914
+ Zs as f,
4915
+ Ml as g,
4916
+ ma as h,
4917
+ vl as i,
4918
+ Re as j,
4919
+ Rn as k,
4920
+ wl as l,
4921
+ Fl as m,
4922
+ wt as n,
4923
+ yl as o,
4924
+ sa as p,
4925
+ Ra as q,
4926
+ Gn as r,
4927
+ Ul as s,
4928
+ Tl as t,
4929
+ bl as u,
4930
+ ka as v,
4931
+ Rl as w,
4932
+ Gl as x,
4933
+ Ia as y,
4934
+ Dl as z
4935
+ };