@web-mods/articles 1.1.2 → 1.1.4

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.
package/dist/index.js CHANGED
@@ -1,109 +1,109 @@
1
- import { jsx as a, jsxs as l, Fragment as pe } from "react/jsx-runtime";
2
- import ie, { createContext as Le, useContext as _e, useState as A, useEffect as K, forwardRef as Je, createElement as Se, useRef as Y, memo as Te, useCallback as je } from "react";
3
- import { defaultArticleService as ht } from "./server.js";
4
- import { createArticleService as Cn, renderArticleByPathname as Sn } from "./server.js";
5
- import { useNavigate as ft, useParams as mt, useLocation as pt } from "react-router";
6
- import { createPortal as gt } from "react-dom";
7
- const Ae = Le({
1
+ import { jsx as n, jsxs as s, Fragment as ue } from "react/jsx-runtime";
2
+ import ce, { createContext as Ae, useContext as He, useState as _, useEffect as K, forwardRef as nt, createElement as Le, useRef as Y, useId as Ie, useCallback as xe, memo as We, useLayoutEffect as Mt } from "react";
3
+ import { defaultArticleService as Ct } from "./server.js";
4
+ import { ArticleServiceError as ea, createArticleService as ta, renderArticleByPathname as ra } from "./server.js";
5
+ import { useNavigate as St, useParams as jt, useLocation as Ot, useMatch as qe } from "react-router";
6
+ import { createPortal as at } from "react-dom";
7
+ const Re = Ae({
8
8
  navigate: () => {
9
9
  },
10
10
  params: {},
11
11
  locationState: null
12
12
  });
13
- function Ee() {
14
- return _e(Ae);
13
+ function Ve() {
14
+ return He(Re);
15
15
  }
16
- let ne = [];
17
- const Oe = /* @__PURE__ */ new Set();
18
- function He() {
19
- Oe.forEach((e) => e([...ne]));
16
+ let se = [];
17
+ const Te = /* @__PURE__ */ new Set();
18
+ function Be() {
19
+ Te.forEach((e) => e([...se]));
20
20
  }
21
- function xe(e, t) {
21
+ function $e(e, t) {
22
22
  const r = Math.random().toString(36).slice(2);
23
- ne = [...ne, { id: r, type: e, content: t }], He(), setTimeout(() => {
24
- ne = ne.filter((n) => n.id !== r), He();
23
+ se = [...se, { id: r, type: e, content: t }], Be(), setTimeout(() => {
24
+ se = se.filter((a) => a.id !== r), Be();
25
25
  }, 3e3);
26
26
  }
27
- const Z = {
28
- success: (e) => xe("success", e),
29
- error: (e) => xe("error", e),
30
- warning: (e) => xe("warning", e)
27
+ const J = {
28
+ success: (e) => $e("success", e),
29
+ error: (e) => $e("error", e),
30
+ warning: (e) => $e("warning", e)
31
31
  };
32
- function yt(e) {
33
- return Oe.add(e), () => {
34
- Oe.delete(e);
32
+ function Pt(e) {
33
+ return Te.add(e), () => {
34
+ Te.delete(e);
35
35
  };
36
36
  }
37
- function bt() {
38
- return ne;
37
+ function Et() {
38
+ return se;
39
39
  }
40
- const xt = {
40
+ const Lt = {
41
41
  success: "bg-emerald-500",
42
42
  error: "bg-red-500",
43
43
  warning: "bg-amber-500"
44
- }, vt = {
44
+ }, Tt = {
45
45
  success: "✓",
46
46
  error: "✕",
47
47
  warning: "⚠"
48
48
  };
49
- function wt() {
50
- const [e, t] = A(bt());
51
- return K(() => yt(t), []), e.length === 0 ? null : /* @__PURE__ */ a("div", { className: "fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none", children: e.map((r) => /* @__PURE__ */ l(
49
+ function _t() {
50
+ const [e, t] = _(Et());
51
+ return K(() => Pt(t), []), e.length === 0 ? null : /* @__PURE__ */ n("div", { className: "fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none", children: e.map((r) => /* @__PURE__ */ s(
52
52
  "div",
53
53
  {
54
- className: `flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-sm text-white font-medium pointer-events-auto ${xt[r.type]}`,
54
+ className: `flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-sm text-white font-medium pointer-events-auto ${Lt[r.type]}`,
55
55
  children: [
56
- /* @__PURE__ */ a("span", { className: "shrink-0 font-bold", children: vt[r.type] }),
56
+ /* @__PURE__ */ n("span", { className: "shrink-0 font-bold", children: Tt[r.type] }),
57
57
  r.content
58
58
  ]
59
59
  },
60
60
  r.id
61
61
  )) });
62
62
  }
63
- const Ke = Le(null);
64
- function xn({
63
+ const it = Ae(null);
64
+ function Un({
65
65
  children: e,
66
66
  basePath: t,
67
- service: r = ht,
68
- previewBaseUrl: n,
69
- previewTailwind: s,
70
- navigate: u
67
+ service: r = Ct,
68
+ previewBaseUrl: a,
69
+ previewTailwind: o,
70
+ navigate: l
71
71
  }) {
72
- const y = /* @__PURE__ */ l(
73
- Ke.Provider,
72
+ const f = /* @__PURE__ */ s(
73
+ it.Provider,
74
74
  {
75
- value: { basePath: t, service: r, previewBaseUrl: n, previewTailwind: s },
75
+ value: { basePath: t, service: r, previewBaseUrl: a, previewTailwind: o },
76
76
  children: [
77
77
  e,
78
- /* @__PURE__ */ a(wt, {})
78
+ /* @__PURE__ */ n(_t, {})
79
79
  ]
80
80
  }
81
81
  );
82
- return u ? /* @__PURE__ */ a(
83
- Ae.Provider,
82
+ return l ? /* @__PURE__ */ n(
83
+ Re.Provider,
84
84
  {
85
- value: { navigate: u, params: {}, locationState: null },
86
- children: y
85
+ value: { navigate: l, params: {}, locationState: null },
86
+ children: f
87
87
  }
88
- ) : y;
88
+ ) : f;
89
89
  }
90
- function ze() {
91
- const e = _e(Ke);
90
+ function ve() {
91
+ const e = He(it);
92
92
  if (!e)
93
93
  throw new Error(
94
94
  "useArticlesConfig must be used within ArticlesProvider"
95
95
  );
96
96
  return e;
97
97
  }
98
- function vn({ children: e }) {
99
- const t = ft(), r = mt(), n = pt();
100
- return /* @__PURE__ */ a(
101
- Ae.Provider,
98
+ function Gn({ children: e }) {
99
+ const t = St(), r = jt(), a = Ot(), { basePath: o } = ve(), l = o.replace(/\/+$/, ""), f = qe(`${l}/:id/edit`), g = qe(`${l}/:id/detail`), y = f ?? g;
100
+ return /* @__PURE__ */ n(
101
+ Re.Provider,
102
102
  {
103
103
  value: {
104
- navigate: (s, u) => t(s, u),
105
- params: r,
106
- locationState: n.state
104
+ navigate: (k, p) => t(k, p),
105
+ params: { ...r, ...y == null ? void 0 : y.params },
106
+ locationState: a.state
107
107
  },
108
108
  children: e
109
109
  }
@@ -115,23 +115,23 @@ function vn({ children: e }) {
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
117
  */
118
- const Ge = (...e) => e.filter((t, r, n) => !!t && t.trim() !== "" && n.indexOf(t) === r).join(" ").trim();
118
+ const st = (...e) => e.filter((t, r, a) => !!t && t.trim() !== "" && a.indexOf(t) === r).join(" ").trim();
119
119
  /**
120
120
  * @license lucide-react v1.11.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
124
  */
125
- const Nt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
125
+ const Dt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
126
126
  /**
127
127
  * @license lucide-react v1.11.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
130
130
  * See the LICENSE file in the root directory of this source tree.
131
131
  */
132
- const kt = (e) => e.replace(
132
+ const zt = (e) => e.replace(
133
133
  /^([A-Z])|[\s-_]+(\w)/g,
134
- (t, r, n) => n ? n.toUpperCase() : r.toLowerCase()
134
+ (t, r, a) => a ? a.toUpperCase() : r.toLowerCase()
135
135
  );
136
136
  /**
137
137
  * @license lucide-react v1.11.0 - ISC
@@ -139,8 +139,8 @@ const kt = (e) => e.replace(
139
139
  * This source code is licensed under the ISC license.
140
140
  * See the LICENSE file in the root directory of this source tree.
141
141
  */
142
- const Ie = (e) => {
143
- const t = kt(e);
142
+ const Fe = (e) => {
143
+ const t = zt(e);
144
144
  return t.charAt(0).toUpperCase() + t.slice(1);
145
145
  };
146
146
  /**
@@ -149,7 +149,7 @@ const Ie = (e) => {
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
151
  */
152
- var ve = {
152
+ var Me = {
153
153
  xmlns: "http://www.w3.org/2000/svg",
154
154
  width: 24,
155
155
  height: 24,
@@ -166,36 +166,36 @@ var ve = {
166
166
  * This source code is licensed under the ISC license.
167
167
  * See the LICENSE file in the root directory of this source tree.
168
168
  */
169
- const $t = (e) => {
169
+ const At = (e) => {
170
170
  for (const t in e)
171
171
  if (t.startsWith("aria-") || t === "role" || t === "title")
172
172
  return !0;
173
173
  return !1;
174
- }, Mt = Le({}), Ct = () => _e(Mt), St = Je(
175
- ({ color: e, size: t, strokeWidth: r, absoluteStrokeWidth: n, className: s = "", children: u, iconNode: y, ...$ }, M) => {
174
+ }, Ht = Ae({}), It = () => He(Ht), Wt = nt(
175
+ ({ color: e, size: t, strokeWidth: r, absoluteStrokeWidth: a, className: o = "", children: l, iconNode: f, ...g }, y) => {
176
176
  const {
177
- size: j = 24,
178
- strokeWidth: m = 2,
179
- absoluteStrokeWidth: S = !1,
180
- color: W = "currentColor",
181
- className: P = ""
182
- } = Ct() ?? {}, E = n ?? S ? Number(r ?? m) * 24 / Number(t ?? j) : r ?? m;
183
- return Se(
177
+ size: k = 24,
178
+ strokeWidth: p = 2,
179
+ absoluteStrokeWidth: v = !1,
180
+ color: P = "currentColor",
181
+ className: A = ""
182
+ } = It() ?? {}, H = a ?? v ? Number(r ?? p) * 24 / Number(t ?? k) : r ?? p;
183
+ return Le(
184
184
  "svg",
185
185
  {
186
- ref: M,
187
- ...ve,
188
- width: t ?? j ?? ve.width,
189
- height: t ?? j ?? ve.height,
190
- stroke: e ?? W,
191
- strokeWidth: E,
192
- className: Ge("lucide", P, s),
193
- ...!u && !$t($) && { "aria-hidden": "true" },
194
- ...$
186
+ ref: y,
187
+ ...Me,
188
+ width: t ?? k ?? Me.width,
189
+ height: t ?? k ?? Me.height,
190
+ stroke: e ?? P,
191
+ strokeWidth: H,
192
+ className: st("lucide", A, o),
193
+ ...!l && !At(g) && { "aria-hidden": "true" },
194
+ ...g
195
195
  },
196
196
  [
197
- ...y.map(([I, H]) => Se(I, H)),
198
- ...Array.isArray(u) ? u : [u]
197
+ ...f.map(([T, W]) => Le(T, W)),
198
+ ...Array.isArray(l) ? l : [l]
199
199
  ]
200
200
  );
201
201
  }
@@ -206,20 +206,20 @@ const $t = (e) => {
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
208
  */
209
- const U = (e, t) => {
210
- const r = Je(
211
- ({ className: n, ...s }, u) => Se(St, {
212
- ref: u,
209
+ const B = (e, t) => {
210
+ const r = nt(
211
+ ({ className: a, ...o }, l) => Le(Wt, {
212
+ ref: l,
213
213
  iconNode: t,
214
- className: Ge(
215
- `lucide-${Nt(Ie(e))}`,
214
+ className: st(
215
+ `lucide-${Dt(Fe(e))}`,
216
216
  `lucide-${e}`,
217
- n
217
+ a
218
218
  ),
219
- ...s
219
+ ...o
220
220
  })
221
221
  );
222
- return r.displayName = Ie(e), r;
222
+ return r.displayName = Fe(e), r;
223
223
  };
224
224
  /**
225
225
  * @license lucide-react v1.11.0 - ISC
@@ -227,48 +227,80 @@ const U = (e, t) => {
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
- const jt = [
230
+ const Rt = [
231
231
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
232
232
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
233
- ], Qe = U("arrow-left", jt);
233
+ ], ot = B("arrow-left", Rt);
234
234
  /**
235
235
  * @license lucide-react v1.11.0 - ISC
236
236
  *
237
237
  * This source code is licensed under the ISC license.
238
238
  * See the LICENSE file in the root directory of this source tree.
239
239
  */
240
- const Ot = [
240
+ const Vt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Yt = B("check", Vt);
241
+ /**
242
+ * @license lucide-react v1.11.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */
247
+ const qt = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Bt = B("chevron-down", qt);
248
+ /**
249
+ * @license lucide-react v1.11.0 - ISC
250
+ *
251
+ * This source code is licensed under the ISC license.
252
+ * See the LICENSE file in the root directory of this source tree.
253
+ */
254
+ const Ft = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ue = B("chevron-right", Ft);
255
+ /**
256
+ * @license lucide-react v1.11.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */
261
+ const Ut = [
262
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
263
+ ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
264
+ ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
265
+ ], Gt = B("circle-alert", Ut);
266
+ /**
267
+ * @license lucide-react v1.11.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */
272
+ const Zt = [
241
273
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
242
274
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
243
- ], Xe = U("code", Ot);
275
+ ], Ye = B("code", Zt);
244
276
  /**
245
277
  * @license lucide-react v1.11.0 - ISC
246
278
  *
247
279
  * This source code is licensed under the ISC license.
248
280
  * See the LICENSE file in the root directory of this source tree.
249
281
  */
250
- const Pt = [
282
+ const Kt = [
251
283
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
252
284
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
253
- ], Dt = U("copy", Pt);
285
+ ], Jt = B("copy", Kt);
254
286
  /**
255
287
  * @license lucide-react v1.11.0 - ISC
256
288
  *
257
289
  * This source code is licensed under the ISC license.
258
290
  * See the LICENSE file in the root directory of this source tree.
259
291
  */
260
- const Lt = [
292
+ const Qt = [
261
293
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
262
294
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
263
295
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
264
- ], _t = U("external-link", Lt);
296
+ ], Xt = B("external-link", Qt);
265
297
  /**
266
298
  * @license lucide-react v1.11.0 - ISC
267
299
  *
268
300
  * This source code is licensed under the ISC license.
269
301
  * See the LICENSE file in the root directory of this source tree.
270
302
  */
271
- const Tt = [
303
+ const er = [
272
304
  [
273
305
  "path",
274
306
  {
@@ -277,14 +309,14 @@ const Tt = [
277
309
  }
278
310
  ],
279
311
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
280
- ], Pe = U("eye", Tt);
312
+ ], _e = B("eye", er);
281
313
  /**
282
314
  * @license lucide-react v1.11.0 - ISC
283
315
  *
284
316
  * This source code is licensed under the ISC license.
285
317
  * See the LICENSE file in the root directory of this source tree.
286
318
  */
287
- const At = [
319
+ const tr = [
288
320
  [
289
321
  "path",
290
322
  {
@@ -296,14 +328,14 @@ const At = [
296
328
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
297
329
  ["path", { d: "M16 13H8", key: "t4e002" }],
298
330
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
299
- ], Et = U("file-text", At);
331
+ ], rr = B("file-text", tr);
300
332
  /**
301
333
  * @license lucide-react v1.11.0 - ISC
302
334
  *
303
335
  * This source code is licensed under the ISC license.
304
336
  * See the LICENSE file in the root directory of this source tree.
305
337
  */
306
- const zt = [
338
+ const nr = [
307
339
  ["polyline", { points: "22 12 16 12 14 15 10 15 8 12 2 12", key: "o97t9d" }],
308
340
  [
309
341
  "path",
@@ -312,42 +344,63 @@ const zt = [
312
344
  key: "oot6mr"
313
345
  }
314
346
  ]
315
- ], Ht = U("inbox", zt);
347
+ ], ar = B("inbox", nr);
316
348
  /**
317
349
  * @license lucide-react v1.11.0 - ISC
318
350
  *
319
351
  * This source code is licensed under the ISC license.
320
352
  * See the LICENSE file in the root directory of this source tree.
321
353
  */
322
- const It = [
354
+ const ir = [
355
+ ["rect", { width: "18", height: "7", x: "3", y: "3", rx: "1", key: "f1a2em" }],
356
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }],
357
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }]
358
+ ], ct = B("layout-panel-top", ir);
359
+ /**
360
+ * @license lucide-react v1.11.0 - ISC
361
+ *
362
+ * This source code is licensed under the ISC license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */
365
+ const sr = [
323
366
  ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
324
367
  ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
325
- ], Wt = U("link", It);
368
+ ], or = B("link", sr);
326
369
  /**
327
370
  * @license lucide-react v1.11.0 - ISC
328
371
  *
329
372
  * This source code is licensed under the ISC license.
330
373
  * See the LICENSE file in the root directory of this source tree.
331
374
  */
332
- const Rt = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Vt = U("loader-circle", Rt);
375
+ const cr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], lt = B("loader-circle", cr);
333
376
  /**
334
377
  * @license lucide-react v1.11.0 - ISC
335
378
  *
336
379
  * This source code is licensed under the ISC license.
337
380
  * See the LICENSE file in the root directory of this source tree.
338
381
  */
339
- const Yt = [
382
+ const lr = [
340
383
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
341
384
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
342
385
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
343
- ], et = U("monitor", Yt);
386
+ ], dt = B("monitor", lr);
344
387
  /**
345
388
  * @license lucide-react v1.11.0 - ISC
346
389
  *
347
390
  * This source code is licensed under the ISC license.
348
391
  * See the LICENSE file in the root directory of this source tree.
349
392
  */
350
- const Ut = [
393
+ const dr = [
394
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
395
+ ["path", { d: "M3 15h18", key: "5xshup" }]
396
+ ], ut = B("panel-bottom", dr);
397
+ /**
398
+ * @license lucide-react v1.11.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */
403
+ const ur = [
351
404
  [
352
405
  "path",
353
406
  {
@@ -356,44 +409,44 @@ const Ut = [
356
409
  }
357
410
  ],
358
411
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
359
- ], qt = U("pencil", Ut);
412
+ ], hr = B("pencil", ur);
360
413
  /**
361
414
  * @license lucide-react v1.11.0 - ISC
362
415
  *
363
416
  * This source code is licensed under the ISC license.
364
417
  * See the LICENSE file in the root directory of this source tree.
365
418
  */
366
- const Bt = [
419
+ const mr = [
367
420
  ["path", { d: "M5 12h14", key: "1ays0h" }],
368
421
  ["path", { d: "M12 5v14", key: "s699le" }]
369
- ], Ft = U("plus", Bt);
422
+ ], ht = B("plus", mr);
370
423
  /**
371
424
  * @license lucide-react v1.11.0 - ISC
372
425
  *
373
426
  * This source code is licensed under the ISC license.
374
427
  * See the LICENSE file in the root directory of this source tree.
375
428
  */
376
- const Zt = [
429
+ const pr = [
377
430
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
378
431
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
379
- ], Jt = U("rotate-ccw", Zt);
432
+ ], fr = B("rotate-ccw", pr);
380
433
  /**
381
434
  * @license lucide-react v1.11.0 - ISC
382
435
  *
383
436
  * This source code is licensed under the ISC license.
384
437
  * See the LICENSE file in the root directory of this source tree.
385
438
  */
386
- const Kt = [
439
+ const gr = [
387
440
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
388
441
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
389
- ], we = U("search", Kt);
442
+ ], Ce = B("search", gr);
390
443
  /**
391
444
  * @license lucide-react v1.11.0 - ISC
392
445
  *
393
446
  * This source code is licensed under the ISC license.
394
447
  * See the LICENSE file in the root directory of this source tree.
395
448
  */
396
- const Gt = [
449
+ const xr = [
397
450
  [
398
451
  "path",
399
452
  {
@@ -402,286 +455,296 @@ const Gt = [
402
455
  }
403
456
  ],
404
457
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
405
- ], We = U("shield-check", Gt);
458
+ ], Ge = B("shield-check", xr);
406
459
  /**
407
460
  * @license lucide-react v1.11.0 - ISC
408
461
  *
409
462
  * This source code is licensed under the ISC license.
410
463
  * See the LICENSE file in the root directory of this source tree.
411
464
  */
412
- const Qt = [
465
+ const br = [
413
466
  ["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
414
467
  ["path", { d: "M12 18h.01", key: "mhygvu" }]
415
- ], tt = U("smartphone", Qt);
468
+ ], mt = B("smartphone", br);
416
469
  /**
417
470
  * @license lucide-react v1.11.0 - ISC
418
471
  *
419
472
  * This source code is licensed under the ISC license.
420
473
  * See the LICENSE file in the root directory of this source tree.
421
474
  */
422
- const Xt = [
475
+ const yr = [
423
476
  ["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
424
477
  ["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
425
- ], rt = U("tablet", Xt);
426
- function er(e) {
478
+ ], pt = B("tablet", yr);
479
+ /**
480
+ * @license lucide-react v1.11.0 - ISC
481
+ *
482
+ * This source code is licensed under the ISC license.
483
+ * See the LICENSE file in the root directory of this source tree.
484
+ */
485
+ const vr = [
486
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
487
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
488
+ ], wr = B("x", vr);
489
+ function Nr(e) {
427
490
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
428
491
  }
429
- var me = { exports: {} }, tr = me.exports, Re;
430
- function rr() {
431
- return Re || (Re = 1, (function(e, t) {
432
- (function(r, n) {
433
- e.exports = n();
434
- })(tr, (function() {
435
- var r = 1e3, n = 6e4, s = 36e5, u = "millisecond", y = "second", $ = "minute", M = "hour", j = "day", m = "week", S = "month", W = "quarter", P = "year", E = "date", I = "Invalid Date", H = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, B = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, z = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(x) {
436
- var i = ["th", "st", "nd", "rd"], o = x % 100;
437
- return "[" + x + (i[(o - 20) % 10] || i[o] || i[0]) + "]";
438
- } }, p = function(x, i, o) {
439
- var d = String(x);
440
- return !d || d.length >= i ? x : "" + Array(i + 1 - d.length).join(o) + x;
441
- }, T = { s: p, z: function(x) {
442
- var i = -x.utcOffset(), o = Math.abs(i), d = Math.floor(o / 60), c = o % 60;
443
- return (i <= 0 ? "+" : "-") + p(d, 2, "0") + ":" + p(c, 2, "0");
444
- }, m: function x(i, o) {
445
- if (i.date() < o.date()) return -x(o, i);
446
- var d = 12 * (o.year() - i.year()) + (o.month() - i.month()), c = i.clone().add(d, S), v = o - c < 0, k = i.clone().add(d + (v ? -1 : 1), S);
447
- return +(-(d + (o - c) / (v ? c - k : k - c)) || 0);
448
- }, a: function(x) {
449
- return x < 0 ? Math.ceil(x) || 0 : Math.floor(x);
450
- }, p: function(x) {
451
- return { M: S, y: P, w: m, d: j, D: E, h: M, m: $, s: y, ms: u, Q: W }[x] || String(x || "").toLowerCase().replace(/s$/, "");
452
- }, u: function(x) {
453
- return x === void 0;
454
- } }, O = "en", b = {};
455
- b[O] = z;
456
- var w = "$isDayjsObject", R = function(x) {
457
- return x instanceof q || !(!x || !x[w]);
458
- }, L = function x(i, o, d) {
459
- var c;
460
- if (!i) return O;
492
+ var ge = { exports: {} }, kr = ge.exports, Ze;
493
+ function $r() {
494
+ return Ze || (Ze = 1, (function(e, t) {
495
+ (function(r, a) {
496
+ e.exports = a();
497
+ })(kr, (function() {
498
+ var r = 1e3, a = 6e4, o = 36e5, l = "millisecond", f = "second", g = "minute", y = "hour", k = "day", p = "week", v = "month", P = "quarter", A = "year", H = "date", T = "Invalid Date", W = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, D = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, R = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(d) {
499
+ var i = ["th", "st", "nd", "rd"], c = d % 100;
500
+ return "[" + d + (i[(c - 20) % 10] || i[c] || i[0]) + "]";
501
+ } }, V = function(d, i, c) {
502
+ var m = String(d);
503
+ return !m || m.length >= i ? d : "" + Array(i + 1 - m.length).join(c) + d;
504
+ }, j = { s: V, z: function(d) {
505
+ var i = -d.utcOffset(), c = Math.abs(i), m = Math.floor(c / 60), u = c % 60;
506
+ return (i <= 0 ? "+" : "-") + V(m, 2, "0") + ":" + V(u, 2, "0");
507
+ }, m: function d(i, c) {
508
+ if (i.date() < c.date()) return -d(c, i);
509
+ var m = 12 * (c.year() - i.year()) + (c.month() - i.month()), u = i.clone().add(m, v), C = c - u < 0, O = i.clone().add(m + (C ? -1 : 1), v);
510
+ return +(-(m + (c - u) / (C ? u - O : O - u)) || 0);
511
+ }, a: function(d) {
512
+ return d < 0 ? Math.ceil(d) || 0 : Math.floor(d);
513
+ }, p: function(d) {
514
+ return { M: v, y: A, w: p, d: k, D: H, h: y, m: g, s: f, ms: l, Q: P }[d] || String(d || "").toLowerCase().replace(/s$/, "");
515
+ }, u: function(d) {
516
+ return d === void 0;
517
+ } }, E = "en", b = {};
518
+ b[E] = R;
519
+ var h = "$isDayjsObject", z = function(d) {
520
+ return d instanceof L || !(!d || !d[h]);
521
+ }, M = function d(i, c, m) {
522
+ var u;
523
+ if (!i) return E;
461
524
  if (typeof i == "string") {
462
- var v = i.toLowerCase();
463
- b[v] && (c = v), o && (b[v] = o, c = v);
464
- var k = i.split("-");
465
- if (!c && k.length > 1) return x(k[0]);
525
+ var C = i.toLowerCase();
526
+ b[C] && (u = C), c && (b[C] = c, u = C);
527
+ var O = i.split("-");
528
+ if (!u && O.length > 1) return d(O[0]);
466
529
  } else {
467
- var f = i.name;
468
- b[f] = i, c = f;
530
+ var N = i.name;
531
+ b[N] = i, u = N;
469
532
  }
470
- return !d && c && (O = c), c || !d && O;
471
- }, g = function(x, i) {
472
- if (R(x)) return x.clone();
473
- var o = typeof i == "object" ? i : {};
474
- return o.date = x, o.args = arguments, new q(o);
475
- }, C = T;
476
- C.l = L, C.i = R, C.w = function(x, i) {
477
- return g(x, { locale: i.$L, utc: i.$u, x: i.$x, $offset: i.$offset });
533
+ return !m && u && (E = u), u || !m && E;
534
+ }, x = function(d, i) {
535
+ if (z(d)) return d.clone();
536
+ var c = typeof i == "object" ? i : {};
537
+ return c.date = d, c.args = arguments, new L(c);
538
+ }, w = j;
539
+ w.l = M, w.i = z, w.w = function(d, i) {
540
+ return x(d, { locale: i.$L, utc: i.$u, x: i.$x, $offset: i.$offset });
478
541
  };
479
- var q = (function() {
480
- function x(o) {
481
- this.$L = L(o.locale, null, !0), this.parse(o), this.$x = this.$x || o.x || {}, this[w] = !0;
542
+ var L = (function() {
543
+ function d(c) {
544
+ this.$L = M(c.locale, null, !0), this.parse(c), this.$x = this.$x || c.x || {}, this[h] = !0;
482
545
  }
483
- var i = x.prototype;
484
- return i.parse = function(o) {
485
- this.$d = (function(d) {
486
- var c = d.date, v = d.utc;
487
- if (c === null) return /* @__PURE__ */ new Date(NaN);
488
- if (C.u(c)) return /* @__PURE__ */ new Date();
489
- if (c instanceof Date) return new Date(c);
490
- if (typeof c == "string" && !/Z$/i.test(c)) {
491
- var k = c.match(H);
492
- if (k) {
493
- var f = k[2] - 1 || 0, N = (k[7] || "0").substring(0, 3);
494
- return v ? new Date(Date.UTC(k[1], f, k[3] || 1, k[4] || 0, k[5] || 0, k[6] || 0, N)) : new Date(k[1], f, k[3] || 1, k[4] || 0, k[5] || 0, k[6] || 0, N);
546
+ var i = d.prototype;
547
+ return i.parse = function(c) {
548
+ this.$d = (function(m) {
549
+ var u = m.date, C = m.utc;
550
+ if (u === null) return /* @__PURE__ */ new Date(NaN);
551
+ if (w.u(u)) return /* @__PURE__ */ new Date();
552
+ if (u instanceof Date) return new Date(u);
553
+ if (typeof u == "string" && !/Z$/i.test(u)) {
554
+ var O = u.match(W);
555
+ if (O) {
556
+ var N = O[2] - 1 || 0, S = (O[7] || "0").substring(0, 3);
557
+ return C ? new Date(Date.UTC(O[1], N, O[3] || 1, O[4] || 0, O[5] || 0, O[6] || 0, S)) : new Date(O[1], N, O[3] || 1, O[4] || 0, O[5] || 0, O[6] || 0, S);
495
558
  }
496
559
  }
497
- return new Date(c);
498
- })(o), this.init();
560
+ return new Date(u);
561
+ })(c), this.init();
499
562
  }, i.init = function() {
500
- var o = this.$d;
501
- this.$y = o.getFullYear(), this.$M = o.getMonth(), this.$D = o.getDate(), this.$W = o.getDay(), this.$H = o.getHours(), this.$m = o.getMinutes(), this.$s = o.getSeconds(), this.$ms = o.getMilliseconds();
563
+ var c = this.$d;
564
+ this.$y = c.getFullYear(), this.$M = c.getMonth(), this.$D = c.getDate(), this.$W = c.getDay(), this.$H = c.getHours(), this.$m = c.getMinutes(), this.$s = c.getSeconds(), this.$ms = c.getMilliseconds();
502
565
  }, i.$utils = function() {
503
- return C;
566
+ return w;
504
567
  }, i.isValid = function() {
505
- return this.$d.toString() !== I;
506
- }, i.isSame = function(o, d) {
507
- var c = g(o);
508
- return this.startOf(d) <= c && c <= this.endOf(d);
509
- }, i.isAfter = function(o, d) {
510
- return g(o) < this.startOf(d);
511
- }, i.isBefore = function(o, d) {
512
- return this.endOf(d) < g(o);
513
- }, i.$g = function(o, d, c) {
514
- return C.u(o) ? this[d] : this.set(c, o);
568
+ return this.$d.toString() !== T;
569
+ }, i.isSame = function(c, m) {
570
+ var u = x(c);
571
+ return this.startOf(m) <= u && u <= this.endOf(m);
572
+ }, i.isAfter = function(c, m) {
573
+ return x(c) < this.startOf(m);
574
+ }, i.isBefore = function(c, m) {
575
+ return this.endOf(m) < x(c);
576
+ }, i.$g = function(c, m, u) {
577
+ return w.u(c) ? this[m] : this.set(u, c);
515
578
  }, i.unix = function() {
516
579
  return Math.floor(this.valueOf() / 1e3);
517
580
  }, i.valueOf = function() {
518
581
  return this.$d.getTime();
519
- }, i.startOf = function(o, d) {
520
- var c = this, v = !!C.u(d) || d, k = C.p(o), f = function(ee, V) {
521
- var te = C.w(c.$u ? Date.UTC(c.$y, V, ee) : new Date(c.$y, V, ee), c);
522
- return v ? te : te.endOf(j);
523
- }, N = function(ee, V) {
524
- return C.w(c.toDate()[ee].apply(c.toDate("s"), (v ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(V)), c);
525
- }, D = this.$W, h = this.$M, _ = this.$D, Q = "set" + (this.$u ? "UTC" : "");
526
- switch (k) {
527
- case P:
528
- return v ? f(1, 0) : f(31, 11);
529
- case S:
530
- return v ? f(1, h) : f(0, h + 1);
531
- case m:
532
- var F = this.$locale().weekStart || 0, X = (D < F ? D + 7 : D) - F;
533
- return f(v ? _ - X : _ + (6 - X), h);
534
- case j:
535
- case E:
536
- return N(Q + "Hours", 0);
537
- case M:
538
- return N(Q + "Minutes", 1);
539
- case $:
540
- return N(Q + "Seconds", 2);
582
+ }, i.startOf = function(c, m) {
583
+ var u = this, C = !!w.u(m) || m, O = w.p(c), N = function(re, $) {
584
+ var Z = w.w(u.$u ? Date.UTC(u.$y, $, re) : new Date(u.$y, $, re), u);
585
+ return C ? Z : Z.endOf(k);
586
+ }, S = function(re, $) {
587
+ return w.w(u.toDate()[re].apply(u.toDate("s"), (C ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice($)), u);
588
+ }, I = this.$W, q = this.$M, G = this.$D, ee = "set" + (this.$u ? "UTC" : "");
589
+ switch (O) {
590
+ case A:
591
+ return C ? N(1, 0) : N(31, 11);
592
+ case v:
593
+ return C ? N(1, q) : N(0, q + 1);
594
+ case p:
595
+ var te = this.$locale().weekStart || 0, ae = (I < te ? I + 7 : I) - te;
596
+ return N(C ? G - ae : G + (6 - ae), q);
597
+ case k:
598
+ case H:
599
+ return S(ee + "Hours", 0);
541
600
  case y:
542
- return N(Q + "Milliseconds", 3);
601
+ return S(ee + "Minutes", 1);
602
+ case g:
603
+ return S(ee + "Seconds", 2);
604
+ case f:
605
+ return S(ee + "Milliseconds", 3);
543
606
  default:
544
607
  return this.clone();
545
608
  }
546
- }, i.endOf = function(o) {
547
- return this.startOf(o, !1);
548
- }, i.$set = function(o, d) {
549
- var c, v = C.p(o), k = "set" + (this.$u ? "UTC" : ""), f = (c = {}, c[j] = k + "Date", c[E] = k + "Date", c[S] = k + "Month", c[P] = k + "FullYear", c[M] = k + "Hours", c[$] = k + "Minutes", c[y] = k + "Seconds", c[u] = k + "Milliseconds", c)[v], N = v === j ? this.$D + (d - this.$W) : d;
550
- if (v === S || v === P) {
551
- var D = this.clone().set(E, 1);
552
- D.$d[f](N), D.init(), this.$d = D.set(E, Math.min(this.$D, D.daysInMonth())).$d;
553
- } else f && this.$d[f](N);
609
+ }, i.endOf = function(c) {
610
+ return this.startOf(c, !1);
611
+ }, i.$set = function(c, m) {
612
+ var u, C = w.p(c), O = "set" + (this.$u ? "UTC" : ""), N = (u = {}, u[k] = O + "Date", u[H] = O + "Date", u[v] = O + "Month", u[A] = O + "FullYear", u[y] = O + "Hours", u[g] = O + "Minutes", u[f] = O + "Seconds", u[l] = O + "Milliseconds", u)[C], S = C === k ? this.$D + (m - this.$W) : m;
613
+ if (C === v || C === A) {
614
+ var I = this.clone().set(H, 1);
615
+ I.$d[N](S), I.init(), this.$d = I.set(H, Math.min(this.$D, I.daysInMonth())).$d;
616
+ } else N && this.$d[N](S);
554
617
  return this.init(), this;
555
- }, i.set = function(o, d) {
556
- return this.clone().$set(o, d);
557
- }, i.get = function(o) {
558
- return this[C.p(o)]();
559
- }, i.add = function(o, d) {
560
- var c, v = this;
561
- o = Number(o);
562
- var k = C.p(d), f = function(h) {
563
- var _ = g(v);
564
- return C.w(_.date(_.date() + Math.round(h * o)), v);
618
+ }, i.set = function(c, m) {
619
+ return this.clone().$set(c, m);
620
+ }, i.get = function(c) {
621
+ return this[w.p(c)]();
622
+ }, i.add = function(c, m) {
623
+ var u, C = this;
624
+ c = Number(c);
625
+ var O = w.p(m), N = function(q) {
626
+ var G = x(C);
627
+ return w.w(G.date(G.date() + Math.round(q * c)), C);
565
628
  };
566
- if (k === S) return this.set(S, this.$M + o);
567
- if (k === P) return this.set(P, this.$y + o);
568
- if (k === j) return f(1);
569
- if (k === m) return f(7);
570
- var N = (c = {}, c[$] = n, c[M] = s, c[y] = r, c)[k] || 1, D = this.$d.getTime() + o * N;
571
- return C.w(D, this);
572
- }, i.subtract = function(o, d) {
573
- return this.add(-1 * o, d);
574
- }, i.format = function(o) {
575
- var d = this, c = this.$locale();
576
- if (!this.isValid()) return c.invalidDate || I;
577
- var v = o || "YYYY-MM-DDTHH:mm:ssZ", k = C.z(this), f = this.$H, N = this.$m, D = this.$M, h = c.weekdays, _ = c.months, Q = c.meridiem, F = function(V, te, oe, de) {
578
- return V && (V[te] || V(d, v)) || oe[te].slice(0, de);
579
- }, X = function(V) {
580
- return C.s(f % 12 || 12, V, "0");
581
- }, ee = Q || function(V, te, oe) {
582
- var de = V < 12 ? "AM" : "PM";
583
- return oe ? de.toLowerCase() : de;
629
+ if (O === v) return this.set(v, this.$M + c);
630
+ if (O === A) return this.set(A, this.$y + c);
631
+ if (O === k) return N(1);
632
+ if (O === p) return N(7);
633
+ var S = (u = {}, u[g] = a, u[y] = o, u[f] = r, u)[O] || 1, I = this.$d.getTime() + c * S;
634
+ return w.w(I, this);
635
+ }, i.subtract = function(c, m) {
636
+ return this.add(-1 * c, m);
637
+ }, i.format = function(c) {
638
+ var m = this, u = this.$locale();
639
+ if (!this.isValid()) return u.invalidDate || T;
640
+ var C = c || "YYYY-MM-DDTHH:mm:ssZ", O = w.z(this), N = this.$H, S = this.$m, I = this.$M, q = u.weekdays, G = u.months, ee = u.meridiem, te = function($, Z, U, Q) {
641
+ return $ && ($[Z] || $(m, C)) || U[Z].slice(0, Q);
642
+ }, ae = function($) {
643
+ return w.s(N % 12 || 12, $, "0");
644
+ }, re = ee || function($, Z, U) {
645
+ var Q = $ < 12 ? "AM" : "PM";
646
+ return U ? Q.toLowerCase() : Q;
584
647
  };
585
- return v.replace(B, (function(V, te) {
586
- return te || (function(oe) {
587
- switch (oe) {
648
+ return C.replace(D, (function($, Z) {
649
+ return Z || (function(U) {
650
+ switch (U) {
588
651
  case "YY":
589
- return String(d.$y).slice(-2);
652
+ return String(m.$y).slice(-2);
590
653
  case "YYYY":
591
- return C.s(d.$y, 4, "0");
654
+ return w.s(m.$y, 4, "0");
592
655
  case "M":
593
- return D + 1;
656
+ return I + 1;
594
657
  case "MM":
595
- return C.s(D + 1, 2, "0");
658
+ return w.s(I + 1, 2, "0");
596
659
  case "MMM":
597
- return F(c.monthsShort, D, _, 3);
660
+ return te(u.monthsShort, I, G, 3);
598
661
  case "MMMM":
599
- return F(_, D);
662
+ return te(G, I);
600
663
  case "D":
601
- return d.$D;
664
+ return m.$D;
602
665
  case "DD":
603
- return C.s(d.$D, 2, "0");
666
+ return w.s(m.$D, 2, "0");
604
667
  case "d":
605
- return String(d.$W);
668
+ return String(m.$W);
606
669
  case "dd":
607
- return F(c.weekdaysMin, d.$W, h, 2);
670
+ return te(u.weekdaysMin, m.$W, q, 2);
608
671
  case "ddd":
609
- return F(c.weekdaysShort, d.$W, h, 3);
672
+ return te(u.weekdaysShort, m.$W, q, 3);
610
673
  case "dddd":
611
- return h[d.$W];
674
+ return q[m.$W];
612
675
  case "H":
613
- return String(f);
676
+ return String(N);
614
677
  case "HH":
615
- return C.s(f, 2, "0");
678
+ return w.s(N, 2, "0");
616
679
  case "h":
617
- return X(1);
680
+ return ae(1);
618
681
  case "hh":
619
- return X(2);
682
+ return ae(2);
620
683
  case "a":
621
- return ee(f, N, !0);
684
+ return re(N, S, !0);
622
685
  case "A":
623
- return ee(f, N, !1);
686
+ return re(N, S, !1);
624
687
  case "m":
625
- return String(N);
688
+ return String(S);
626
689
  case "mm":
627
- return C.s(N, 2, "0");
690
+ return w.s(S, 2, "0");
628
691
  case "s":
629
- return String(d.$s);
692
+ return String(m.$s);
630
693
  case "ss":
631
- return C.s(d.$s, 2, "0");
694
+ return w.s(m.$s, 2, "0");
632
695
  case "SSS":
633
- return C.s(d.$ms, 3, "0");
696
+ return w.s(m.$ms, 3, "0");
634
697
  case "Z":
635
- return k;
698
+ return O;
636
699
  }
637
700
  return null;
638
- })(V) || k.replace(":", "");
701
+ })($) || O.replace(":", "");
639
702
  }));
640
703
  }, i.utcOffset = function() {
641
704
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
642
- }, i.diff = function(o, d, c) {
643
- var v, k = this, f = C.p(d), N = g(o), D = (N.utcOffset() - this.utcOffset()) * n, h = this - N, _ = function() {
644
- return C.m(k, N);
705
+ }, i.diff = function(c, m, u) {
706
+ var C, O = this, N = w.p(m), S = x(c), I = (S.utcOffset() - this.utcOffset()) * a, q = this - S, G = function() {
707
+ return w.m(O, S);
645
708
  };
646
- switch (f) {
647
- case P:
648
- v = _() / 12;
709
+ switch (N) {
710
+ case A:
711
+ C = G() / 12;
649
712
  break;
650
- case S:
651
- v = _();
713
+ case v:
714
+ C = G();
652
715
  break;
653
- case W:
654
- v = _() / 3;
716
+ case P:
717
+ C = G() / 3;
655
718
  break;
656
- case m:
657
- v = (h - D) / 6048e5;
719
+ case p:
720
+ C = (q - I) / 6048e5;
658
721
  break;
659
- case j:
660
- v = (h - D) / 864e5;
722
+ case k:
723
+ C = (q - I) / 864e5;
661
724
  break;
662
- case M:
663
- v = h / s;
725
+ case y:
726
+ C = q / o;
664
727
  break;
665
- case $:
666
- v = h / n;
728
+ case g:
729
+ C = q / a;
667
730
  break;
668
- case y:
669
- v = h / r;
731
+ case f:
732
+ C = q / r;
670
733
  break;
671
734
  default:
672
- v = h;
735
+ C = q;
673
736
  }
674
- return c ? v : C.a(v);
737
+ return u ? C : w.a(C);
675
738
  }, i.daysInMonth = function() {
676
- return this.endOf(S).$D;
739
+ return this.endOf(v).$D;
677
740
  }, i.$locale = function() {
678
741
  return b[this.$L];
679
- }, i.locale = function(o, d) {
680
- if (!o) return this.$L;
681
- var c = this.clone(), v = L(o, d, !0);
682
- return v && (c.$L = v), c;
742
+ }, i.locale = function(c, m) {
743
+ if (!c) return this.$L;
744
+ var u = this.clone(), C = M(c, m, !0);
745
+ return C && (u.$L = C), u;
683
746
  }, i.clone = function() {
684
- return C.w(this.$d, this);
747
+ return w.w(this.$d, this);
685
748
  }, i.toDate = function() {
686
749
  return new Date(this.valueOf());
687
750
  }, i.toJSON = function() {
@@ -690,66 +753,66 @@ function rr() {
690
753
  return this.$d.toISOString();
691
754
  }, i.toString = function() {
692
755
  return this.$d.toUTCString();
693
- }, x;
694
- })(), G = q.prototype;
695
- return g.prototype = G, [["$ms", u], ["$s", y], ["$m", $], ["$H", M], ["$W", j], ["$M", S], ["$y", P], ["$D", E]].forEach((function(x) {
696
- G[x[1]] = function(i) {
697
- return this.$g(i, x[0], x[1]);
756
+ }, d;
757
+ })(), F = L.prototype;
758
+ return x.prototype = F, [["$ms", l], ["$s", f], ["$m", g], ["$H", y], ["$W", k], ["$M", v], ["$y", A], ["$D", H]].forEach((function(d) {
759
+ F[d[1]] = function(i) {
760
+ return this.$g(i, d[0], d[1]);
698
761
  };
699
- })), g.extend = function(x, i) {
700
- return x.$i || (x(i, q, g), x.$i = !0), g;
701
- }, g.locale = L, g.isDayjs = R, g.unix = function(x) {
702
- return g(1e3 * x);
703
- }, g.en = b[O], g.Ls = b, g.p = {}, g;
762
+ })), x.extend = function(d, i) {
763
+ return d.$i || (d(i, L, x), d.$i = !0), x;
764
+ }, x.locale = M, x.isDayjs = z, x.unix = function(d) {
765
+ return x(1e3 * d);
766
+ }, x.en = b[E], x.Ls = b, x.p = {}, x;
704
767
  }));
705
- })(me)), me.exports;
706
- }
707
- var nr = rr();
708
- const De = /* @__PURE__ */ er(nr);
709
- function nt() {
710
- const [e, t] = A(!1), [r, n] = A(!1), s = Y({ title: "" }), u = {
711
- confirm: (S) => {
712
- s.current = S, n(!1), t(!0);
768
+ })(ge)), ge.exports;
769
+ }
770
+ var Mr = $r();
771
+ const De = /* @__PURE__ */ Nr(Mr);
772
+ function ft() {
773
+ const [e, t] = _(!1), [r, a] = _(!1), o = Y({ title: "" }), l = {
774
+ confirm: (v) => {
775
+ o.current = v, a(!1), t(!0);
713
776
  }
714
- }, y = async () => {
715
- var S, W;
716
- n(!0);
777
+ }, f = async () => {
778
+ var v, P;
779
+ a(!0);
717
780
  try {
718
- await ((W = (S = s.current).onOk) == null ? void 0 : W.call(S)), t(!1);
781
+ await ((P = (v = o.current).onOk) == null ? void 0 : P.call(v)), t(!1);
719
782
  } finally {
720
- n(!1);
783
+ a(!1);
721
784
  }
722
- }, $ = () => {
723
- var S, W;
724
- (W = (S = s.current).onCancel) == null || W.call(S), t(!1);
725
- }, M = s.current, j = M.okType === "danger", m = e ? gt(
726
- /* @__PURE__ */ l("div", { className: "fixed inset-0 z-[9998] flex items-center justify-center", children: [
727
- /* @__PURE__ */ a(
785
+ }, g = () => {
786
+ var v, P;
787
+ (P = (v = o.current).onCancel) == null || P.call(v), t(!1);
788
+ }, y = o.current, k = y.okType === "danger", p = e ? at(
789
+ /* @__PURE__ */ s("div", { className: "fixed inset-0 z-[9998] flex items-center justify-center", children: [
790
+ /* @__PURE__ */ n(
728
791
  "div",
729
792
  {
730
793
  className: "absolute inset-0 bg-black/40",
731
- onClick: $
794
+ onClick: g
732
795
  }
733
796
  ),
734
- /* @__PURE__ */ l("div", { className: "relative bg-white rounded-2xl shadow-xl w-full max-w-md mx-4 p-6", children: [
735
- /* @__PURE__ */ a("div", { className: "text-base font-semibold text-gray-800 mb-2", children: M.title }),
736
- M.content && /* @__PURE__ */ a("div", { className: "text-sm text-gray-600 mt-3", children: M.content }),
737
- /* @__PURE__ */ l("div", { className: "flex justify-end gap-2 mt-5", children: [
738
- /* @__PURE__ */ a(
797
+ /* @__PURE__ */ s("div", { className: "relative bg-white rounded-2xl shadow-xl w-full max-w-md mx-4 p-6", children: [
798
+ /* @__PURE__ */ n("div", { className: "text-base font-semibold text-gray-800 mb-2", children: y.title }),
799
+ y.content && /* @__PURE__ */ n("div", { className: "text-sm text-gray-600 mt-3", children: y.content }),
800
+ /* @__PURE__ */ s("div", { className: "flex justify-end gap-2 mt-5", children: [
801
+ /* @__PURE__ */ n(
739
802
  "button",
740
803
  {
741
804
  className: "px-4 py-1.5 rounded-lg border border-gray-200 text-sm text-gray-600 hover:bg-gray-50 transition-colors cursor-pointer",
742
- onClick: $,
743
- children: M.cancelText ?? "取消"
805
+ onClick: g,
806
+ children: y.cancelText ?? "取消"
744
807
  }
745
808
  ),
746
- /* @__PURE__ */ a(
809
+ /* @__PURE__ */ n(
747
810
  "button",
748
811
  {
749
812
  disabled: r,
750
- className: `px-4 py-1.5 rounded-lg text-white text-sm font-medium transition-colors disabled:opacity-50 cursor-pointer ${j ? "bg-red-500 hover:bg-red-600" : "bg-blue-500 hover:bg-blue-600"}`,
751
- onClick: y,
752
- children: r ? "处理中…" : M.okText ?? "确定"
813
+ className: `px-4 py-1.5 rounded-lg text-white text-sm font-medium transition-colors disabled:opacity-50 cursor-pointer ${k ? "bg-red-500 hover:bg-red-600" : "bg-blue-500 hover:bg-blue-600"}`,
814
+ onClick: f,
815
+ children: r ? "处理中…" : y.okText ?? "确定"
753
816
  }
754
817
  )
755
818
  ] })
@@ -757,282 +820,633 @@ function nt() {
757
820
  ] }),
758
821
  document.body
759
822
  ) : null;
760
- return [u, m];
823
+ return [l, p];
824
+ }
825
+ const gt = (e, t) => JSON.stringify([e.trim().replace(/\/+$/, ""), t]);
826
+ function Cr({ article: e, groups: t, canLoadGroups: r, onRetry: a }) {
827
+ var f;
828
+ const o = e.navPlacements ?? [], l = (f = e.navname) == null ? void 0 : f.trim();
829
+ return !e.navEnabled && !l && !o.length ? /* @__PURE__ */ n("span", { className: "text-xs text-gray-400", children: "未加入网站导航" }) : /* @__PURE__ */ s("div", { className: "min-w-0 space-y-2.5 py-0.5", children: [
830
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2", children: [
831
+ /* @__PURE__ */ n("span", { className: "min-w-0 break-words text-sm font-semibold text-gray-800", children: l || "未命名导航" }),
832
+ /* @__PURE__ */ s(
833
+ "span",
834
+ {
835
+ className: `inline-flex shrink-0 items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium ${e.navEnabled ? "bg-emerald-50 text-emerald-700" : "bg-gray-100 text-gray-500"}`,
836
+ title: e.navEnabled ? "已在以下位置展示" : "导航已关闭,保留以下位置配置",
837
+ children: [
838
+ /* @__PURE__ */ n("span", { "aria-hidden": "true", className: `h-1.5 w-1.5 rounded-full ${e.navEnabled ? "bg-emerald-500" : "bg-gray-400"}` }),
839
+ e.navEnabled ? "展示中" : "已关闭"
840
+ ]
841
+ }
842
+ )
843
+ ] }),
844
+ /* @__PURE__ */ s("div", { className: `space-y-1.5 ${e.navEnabled ? "" : "opacity-60"}`, children: [
845
+ ["header", "footer"].map((g) => {
846
+ const y = o.find((D) => D.position === g);
847
+ if (!y) return null;
848
+ const k = g === "header", p = k ? ct : ut, v = k ? "页眉" : "页尾", P = t[gt(e.host ?? "", g)], A = y.parentNavId ? P == null ? void 0 : P.names[y.parentNavId] : void 0, H = r && e.host && (!P || P.status === "loading"), T = A || (H ? "加载中…" : (P == null ? void 0 : P.status) === "error" ? "加载失败" : "父导航名称不可用"), W = [v, ...y.parentNavId ? [T] : [], l || "未命名导航"].join(" → ");
849
+ return /* @__PURE__ */ s("div", { className: "flex min-w-0 items-start gap-2", "aria-label": W, title: W, children: [
850
+ /* @__PURE__ */ s("span", { className: `inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium leading-none ${k ? "bg-blue-50 text-blue-600" : "bg-violet-50 text-violet-600"}`, children: [
851
+ /* @__PURE__ */ n(p, { size: 12, "aria-hidden": "true" }),
852
+ v
853
+ ] }),
854
+ /* @__PURE__ */ n(Ue, { size: 12, className: "mt-0.5 shrink-0 text-gray-300", "aria-hidden": "true" }),
855
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-wrap items-center gap-x-1 gap-y-1 pt-0.5 text-xs leading-4", children: [
856
+ y.parentNavId && /* @__PURE__ */ s(ue, { children: [
857
+ /* @__PURE__ */ n("span", { className: `break-all ${A ? "text-gray-600" : "text-gray-400"}`, children: T }),
858
+ (P == null ? void 0 : P.status) === "error" && /* @__PURE__ */ n("button", { type: "button", onClick: a, className: "cursor-pointer text-blue-500 hover:text-blue-600", children: "重试" }),
859
+ /* @__PURE__ */ n(Ue, { size: 12, className: "shrink-0 text-gray-300", "aria-hidden": "true" })
860
+ ] }),
861
+ /* @__PURE__ */ n("span", { className: "break-all text-gray-700", children: l || "未命名导航" })
862
+ ] })
863
+ ] }, g);
864
+ }),
865
+ !o.length && /* @__PURE__ */ n("p", { className: "text-xs text-gray-400", children: "尚未设置展示位置" })
866
+ ] })
867
+ ] });
761
868
  }
762
- const wn = () => {
763
- const { navigate: e } = Ee(), { basePath: t, service: r } = ze(), [n, s] = nt(), [u, y] = A(""), [$, M] = A(""), [j, m] = A(!1), [S, W] = A([]), [P, E] = A({
869
+ const Zn = () => {
870
+ const { navigate: e } = Ve(), { basePath: t, service: r } = ve(), [a, o] = ft(), [l, f] = _(""), [g, y] = _(""), [k, p] = _(!1), [v, P] = _([]), [A, H] = _({}), [T, W] = _(0), [D, R] = _({
764
871
  current: 1,
765
872
  size: 15,
766
873
  total: 0
767
- }), I = (p) => {
768
- const T = p.trim();
769
- if (!T) return "";
874
+ }), V = (h) => {
875
+ const z = h.trim();
876
+ if (!z) return "";
770
877
  try {
771
878
  return new URL(
772
- T.startsWith("http") ? T : `https://${T}`
879
+ z.startsWith("http") ? z : `https://${z}`
773
880
  ).origin;
774
881
  } catch {
775
- return T;
882
+ return z;
776
883
  }
777
- }, H = async (p = P.current, T = P.size, O = u, b = $) => {
778
- m(!0);
884
+ }, j = async (h = D.current, z = D.size, M = l, x = g) => {
885
+ p(!0);
779
886
  try {
780
- const w = { page: p, size: T };
781
- O && (w.pathname = O);
782
- const R = I(b);
783
- R && (w.host = R);
784
- const L = await r.getList(w);
785
- W(L.items), E((g) => ({
786
- ...g,
787
- current: p,
788
- size: T,
789
- total: L.total ?? g.total
887
+ const w = { page: h, size: z };
888
+ M && (w.pathname = M);
889
+ const L = V(x);
890
+ L && (w.host = L);
891
+ const F = await r.getList(w);
892
+ P(F.items), R((d) => ({
893
+ ...d,
894
+ current: h,
895
+ size: z,
896
+ total: F.total ?? d.total
790
897
  }));
791
898
  } catch (w) {
792
- Z.error(w.message || "获取数据失败");
899
+ J.error(w.message || "获取文章失败");
793
900
  } finally {
794
- m(!1);
901
+ p(!1);
795
902
  }
796
903
  };
797
904
  K(() => {
798
- H(1);
799
- }, []);
800
- const B = (p) => {
801
- n.confirm({
802
- title: "确认删除",
803
- content: `确认删除 /${p.pathname}?`,
905
+ j(1);
906
+ }, []), K(() => {
907
+ if (!r.getNavigationGroups) return;
908
+ let h = !0;
909
+ const z = /* @__PURE__ */ new Map();
910
+ for (const M of v)
911
+ if (M.host)
912
+ for (const x of M.navPlacements ?? []) {
913
+ if (!x.parentNavId) continue;
914
+ const w = M.host.trim().replace(/\/+$/, "");
915
+ z.set(gt(w, x.position), { host: w, position: x.position });
916
+ }
917
+ H(Object.fromEntries([...z.keys()].map((M) => [M, { status: "loading", names: {} }])));
918
+ for (const [M, x] of z)
919
+ (async () => {
920
+ try {
921
+ const w = await r.getNavigationGroups(x);
922
+ if (!h) return;
923
+ H((L) => ({ ...L, [M]: { status: "loaded", names: Object.fromEntries(w.map((F) => [F.id, F.name])) } }));
924
+ } catch {
925
+ if (!h) return;
926
+ H((w) => ({ ...w, [M]: { status: "error", names: {} } }));
927
+ }
928
+ })();
929
+ return () => {
930
+ h = !1;
931
+ };
932
+ }, [v, r, T]);
933
+ const E = (h) => {
934
+ a.confirm({
935
+ title: "删除文章",
936
+ content: `确认删除 /${h.pathname}?`,
804
937
  okText: "删除",
805
938
  okType: "danger",
806
939
  cancelText: "取消",
807
940
  onOk: async () => {
808
- await r.delete(p.id), Z.success("删除成功"), H(1);
941
+ await r.delete(h.id), J.success("删除成功"), j(1);
809
942
  }
810
943
  });
811
- }, z = Math.ceil(P.total / P.size) || 1;
812
- return /* @__PURE__ */ l("div", { className: "bg-white rounded-xl shadow-sm border border-gray-100 p-5", children: [
813
- s,
814
- /* @__PURE__ */ l(
944
+ }, b = Math.ceil(D.total / D.size) || 1;
945
+ return /* @__PURE__ */ s("div", { className: "min-w-0 bg-white rounded-xl shadow-sm border border-gray-100 p-5", children: [
946
+ o,
947
+ /* @__PURE__ */ s(
815
948
  "form",
816
949
  {
817
- className: "flex items-center gap-2 mb-5",
818
- onSubmit: (p) => {
819
- p.preventDefault(), H(1);
950
+ className: "flex flex-wrap items-center gap-2 mb-5",
951
+ onSubmit: (h) => {
952
+ h.preventDefault(), j(1);
820
953
  },
821
954
  children: [
822
- /* @__PURE__ */ l("div", { className: "relative w-52", children: [
823
- /* @__PURE__ */ a(we, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
824
- /* @__PURE__ */ a(
955
+ /* @__PURE__ */ s("div", { className: "relative w-full sm:w-52", children: [
956
+ /* @__PURE__ */ n(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
957
+ /* @__PURE__ */ n(
825
958
  "input",
826
959
  {
827
960
  className: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
828
- placeholder: "搜索 Pathname",
829
- value: u,
830
- onChange: (p) => y(p.target.value)
961
+ "aria-label": "搜索访问路径",
962
+ placeholder: "搜索访问路径",
963
+ value: l,
964
+ onChange: (h) => f(h.target.value)
831
965
  }
832
966
  )
833
967
  ] }),
834
- /* @__PURE__ */ l("div", { className: "relative w-52", children: [
835
- /* @__PURE__ */ a(we, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
836
- /* @__PURE__ */ a(
968
+ /* @__PURE__ */ s("div", { className: "relative w-full sm:w-52", children: [
969
+ /* @__PURE__ */ n(Ce, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
970
+ /* @__PURE__ */ n(
837
971
  "input",
838
972
  {
839
973
  className: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
840
- placeholder: "搜索 Website URL",
841
- value: $,
842
- onChange: (p) => M(p.target.value)
974
+ "aria-label": "搜索网站地址",
975
+ placeholder: "搜索网站地址",
976
+ value: g,
977
+ onChange: (h) => y(h.target.value)
843
978
  }
844
979
  )
845
980
  ] }),
846
- /* @__PURE__ */ l(
981
+ /* @__PURE__ */ s(
847
982
  "button",
848
983
  {
849
984
  type: "submit",
850
985
  className: "flex items-center gap-1.5 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition cursor-pointer",
851
986
  children: [
852
- /* @__PURE__ */ a(we, { className: "w-3.5 h-3.5" }),
987
+ /* @__PURE__ */ n(Ce, { className: "w-3.5 h-3.5" }),
853
988
  "搜索"
854
989
  ]
855
990
  }
856
991
  ),
857
- /* @__PURE__ */ l(
992
+ /* @__PURE__ */ s(
858
993
  "button",
859
994
  {
860
995
  type: "button",
861
996
  className: "flex items-center gap-1.5 px-3 py-1.5 border border-gray-200 hover:bg-gray-50 text-gray-600 text-sm rounded-lg transition cursor-pointer",
862
997
  onClick: () => {
863
- y(""), M(""), H(1, P.size, "", "");
998
+ f(""), y(""), j(1, D.size, "", "");
864
999
  },
865
1000
  children: [
866
- /* @__PURE__ */ a(Jt, { className: "w-3.5 h-3.5" }),
1001
+ /* @__PURE__ */ n(fr, { className: "w-3.5 h-3.5" }),
867
1002
  "重置"
868
1003
  ]
869
1004
  }
870
1005
  ),
871
- /* @__PURE__ */ a("div", { className: "flex-1" }),
872
- /* @__PURE__ */ l(
1006
+ /* @__PURE__ */ n("div", { className: "flex-1" }),
1007
+ /* @__PURE__ */ s(
873
1008
  "button",
874
1009
  {
875
1010
  type: "button",
876
1011
  className: "flex items-center gap-1.5 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition cursor-pointer",
877
1012
  onClick: () => e(`${t}/create`),
878
1013
  children: [
879
- /* @__PURE__ */ a(Ft, { className: "w-3.5 h-3.5" }),
880
- "新增"
1014
+ /* @__PURE__ */ n(ht, { className: "w-3.5 h-3.5" }),
1015
+ "新增文章"
881
1016
  ]
882
1017
  }
883
1018
  )
884
1019
  ]
885
1020
  }
886
1021
  ),
887
- /* @__PURE__ */ a("div", { className: "relative", children: /* @__PURE__ */ l("table", { className: "w-full text-sm", children: [
888
- /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ l("tr", { className: "border-b border-gray-100", children: [
889
- /* @__PURE__ */ a("th", { className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-44", children: "Pathname" }),
890
- /* @__PURE__ */ a("th", { className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-44", children: "Website URL" }),
891
- /* @__PURE__ */ a("th", { className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide", children: "HTML 摘要" }),
892
- /* @__PURE__ */ a("th", { className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-44", children: "创建时间" }),
893
- /* @__PURE__ */ a("th", { className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-56", children: "操作" })
1022
+ /* @__PURE__ */ n("div", { className: "relative overflow-x-auto", role: "region", "aria-label": "文章列表", tabIndex: 0, children: /* @__PURE__ */ s("table", { className: "w-full min-w-[1120px] table-fixed text-sm", children: [
1023
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ s("tr", { className: "border-b border-gray-100", children: [
1024
+ /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-36", children: "访问路径" }),
1025
+ /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-32", children: "网站地址" }),
1026
+ /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-80", children: "网站导航" }),
1027
+ /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide", children: "HTML 摘要" }),
1028
+ /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-36", children: "创建时间" }),
1029
+ /* @__PURE__ */ n("th", { scope: "col", className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-60", children: "操作" })
894
1030
  ] }) }),
895
- /* @__PURE__ */ a("tbody", { children: j ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: 5, className: "py-16 text-center", children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2 text-gray-400", children: [
896
- /* @__PURE__ */ a(Vt, { className: "w-6 h-6 text-blue-400 animate-spin" }),
897
- /* @__PURE__ */ a("span", { className: "text-sm", children: "加载中…" })
898
- ] }) }) }) : S.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: 5, className: "py-16 text-center", children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: [
899
- /* @__PURE__ */ a(Ht, { className: "w-10 h-10" }),
900
- /* @__PURE__ */ a("span", { className: "text-sm", children: "暂无数据" })
901
- ] }) }) }) : S.map((p) => {
902
- const T = (p.content || "").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim().slice(0, 80);
903
- return /* @__PURE__ */ l(
1031
+ /* @__PURE__ */ n("tbody", { children: k ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: 6, className: "py-16 text-center", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 text-gray-400", children: [
1032
+ /* @__PURE__ */ n(lt, { className: "w-6 h-6 text-blue-400 animate-spin" }),
1033
+ /* @__PURE__ */ n("span", { className: "text-sm", children: "加载中…" })
1034
+ ] }) }) }) : v.length === 0 ? /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: 6, className: "py-16 text-center", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: [
1035
+ /* @__PURE__ */ n(ar, { className: "w-10 h-10" }),
1036
+ /* @__PURE__ */ n("span", { className: "text-sm", children: "暂无文章" })
1037
+ ] }) }) }) : v.map((h) => {
1038
+ const z = (h.content || "").replace(/<(style|script)\b[^>]*>[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim().slice(0, 80);
1039
+ return /* @__PURE__ */ s(
904
1040
  "tr",
905
1041
  {
906
1042
  className: "border-b border-gray-50 hover:bg-gray-50/60 transition-colors",
907
1043
  children: [
908
- /* @__PURE__ */ a("td", { className: "py-3 px-3", children: /* @__PURE__ */ l("span", { className: "font-mono text-xs text-gray-700", children: [
1044
+ /* @__PURE__ */ n("td", { className: "py-3 px-3", children: /* @__PURE__ */ s("span", { className: "block break-words font-mono text-xs text-gray-700", children: [
909
1045
  "/",
910
- p.pathname
1046
+ h.pathname
911
1047
  ] }) }),
912
- /* @__PURE__ */ a("td", { className: "py-3 px-3", children: p.host ? /* @__PURE__ */ l(
1048
+ /* @__PURE__ */ n("td", { className: "py-3 px-3", children: h.host ? /* @__PURE__ */ s(
913
1049
  "a",
914
1050
  {
915
- href: p.host,
1051
+ href: h.host,
916
1052
  target: "_blank",
917
1053
  rel: "noopener noreferrer",
918
- className: "inline-flex items-center gap-1 max-w-[160px] text-xs text-blue-600 underline underline-offset-2 hover:text-blue-800 transition-colors",
919
- title: p.host,
1054
+ className: "inline-flex max-w-full items-center gap-1 text-xs text-blue-600 underline underline-offset-2 hover:text-blue-800 transition-colors",
1055
+ title: h.host,
920
1056
  children: [
921
- /* @__PURE__ */ a("span", { className: "truncate", children: p.host.replace(/^https?:\/\//, "") }),
922
- /* @__PURE__ */ a(_t, { className: "w-3 h-3 shrink-0" })
1057
+ /* @__PURE__ */ n("span", { className: "truncate", children: h.host.replace(/^https?:\/\//, "") }),
1058
+ /* @__PURE__ */ n(Xt, { className: "w-3 h-3 shrink-0" })
923
1059
  ]
924
1060
  }
925
- ) : /* @__PURE__ */ a("span", { className: "text-xs text-gray-300", children: "—" }) }),
926
- /* @__PURE__ */ a("td", { className: "py-3 px-3", children: T ? /* @__PURE__ */ a(
1061
+ ) : /* @__PURE__ */ n("span", { className: "text-xs text-gray-300", children: "—" }) }),
1062
+ /* @__PURE__ */ n("td", { className: "py-3 px-3", children: /* @__PURE__ */ n(Cr, { article: h, groups: A, canLoadGroups: !!r.getNavigationGroups, onRetry: () => W((M) => M + 1) }) }),
1063
+ /* @__PURE__ */ n("td", { className: "py-3 px-3", children: z ? /* @__PURE__ */ n(
927
1064
  "span",
928
1065
  {
929
1066
  className: "text-sm text-gray-500 truncate block max-w-sm",
930
- title: T,
931
- children: T
1067
+ title: z,
1068
+ children: z
932
1069
  }
933
- ) : /* @__PURE__ */ a("span", { className: "text-xs text-gray-300", children: "暂无内容" }) }),
934
- /* @__PURE__ */ a("td", { className: "py-3 px-3 text-xs text-gray-400", children: p.createdAt ? De(p.createdAt).format(
1070
+ ) : /* @__PURE__ */ n("span", { className: "text-xs text-gray-300", children: "暂无内容" }) }),
1071
+ /* @__PURE__ */ n("td", { className: "py-3 px-3 text-xs whitespace-nowrap text-gray-400", children: h.createdAt ? De(h.createdAt).format(
935
1072
  "YYYY/MM/DD HH:mm"
936
1073
  ) : "—" }),
937
- /* @__PURE__ */ a("td", { className: "py-3 px-3", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
938
- p.host && /* @__PURE__ */ a(
1074
+ /* @__PURE__ */ n("td", { className: "py-3 px-3", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
1075
+ h.host && /* @__PURE__ */ n(
939
1076
  "button",
940
1077
  {
941
1078
  className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 text-gray-600 transition cursor-pointer",
942
1079
  onClick: () => window.open(
943
- `${p.host.replace(/\/$/, "")}/${p.pathname}`,
1080
+ `${h.host.replace(/\/$/, "")}/${h.pathname}`,
944
1081
  "_blank"
945
1082
  ),
946
1083
  children: "跳转"
947
1084
  }
948
1085
  ),
949
- /* @__PURE__ */ a(
1086
+ /* @__PURE__ */ n(
950
1087
  "button",
951
1088
  {
952
1089
  className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 text-gray-600 transition cursor-pointer",
953
1090
  onClick: () => e(
954
- `${t}/${p.id}/detail`,
955
- { state: { record: p } }
1091
+ `${t}/${h.id}/detail`,
1092
+ { state: { record: h } }
956
1093
  ),
957
1094
  children: "详情"
958
1095
  }
959
1096
  ),
960
- /* @__PURE__ */ a(
1097
+ /* @__PURE__ */ n(
961
1098
  "button",
962
1099
  {
963
1100
  className: "px-2.5 py-1 text-xs bg-blue-500 hover:bg-blue-600 text-white rounded-md transition cursor-pointer",
964
1101
  onClick: () => e(
965
- `${t}/${p.id}/edit`,
966
- { state: { record: p } }
1102
+ `${t}/${h.id}/edit`,
1103
+ { state: { record: h } }
967
1104
  ),
968
1105
  children: "编辑"
969
1106
  }
970
1107
  ),
971
- /* @__PURE__ */ a(
1108
+ /* @__PURE__ */ n(
972
1109
  "button",
973
1110
  {
974
1111
  className: "px-2.5 py-1 text-xs bg-red-500 hover:bg-red-600 text-white rounded-md transition cursor-pointer",
975
- onClick: () => B(p),
1112
+ onClick: () => E(h),
976
1113
  children: "删除"
977
1114
  }
978
1115
  )
979
1116
  ] }) })
980
1117
  ]
981
1118
  },
982
- p.id
1119
+ h.id
983
1120
  );
984
1121
  }) })
985
1122
  ] }) }),
986
- P.total > 0 && /* @__PURE__ */ l("div", { className: "flex items-center justify-between pt-4 mt-2 border-t border-gray-100", children: [
987
- /* @__PURE__ */ l("span", { className: "text-xs text-gray-400", children: [
1123
+ D.total > 0 && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-3 pt-4 mt-2 border-t border-gray-100", children: [
1124
+ /* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
988
1125
  "共 ",
989
- P.total,
990
- " 条"
1126
+ D.total,
1127
+ " 篇文章"
991
1128
  ] }),
992
- /* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
993
- /* @__PURE__ */ a(
1129
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-1", children: [
1130
+ /* @__PURE__ */ n(
994
1131
  "button",
995
1132
  {
996
1133
  className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed text-gray-600 transition cursor-pointer",
997
- disabled: P.current <= 1,
998
- onClick: () => H(P.current - 1),
1134
+ disabled: D.current <= 1,
1135
+ onClick: () => j(D.current - 1),
999
1136
  children: "上一页"
1000
1137
  }
1001
1138
  ),
1002
- /* @__PURE__ */ l("span", { className: "px-3 py-1 text-xs text-gray-500", children: [
1003
- P.current,
1139
+ /* @__PURE__ */ s("span", { className: "px-3 py-1 text-xs text-gray-500", children: [
1140
+ D.current,
1004
1141
  " / ",
1005
- z
1142
+ b
1006
1143
  ] }),
1007
- /* @__PURE__ */ a(
1144
+ /* @__PURE__ */ n(
1008
1145
  "button",
1009
1146
  {
1010
1147
  className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed text-gray-600 transition cursor-pointer",
1011
- disabled: P.current >= z,
1012
- onClick: () => H(P.current + 1),
1148
+ disabled: D.current >= b,
1149
+ onClick: () => j(D.current + 1),
1013
1150
  children: "下一页"
1014
1151
  }
1015
1152
  ),
1016
- /* @__PURE__ */ a(
1153
+ /* @__PURE__ */ n(
1017
1154
  "select",
1018
1155
  {
1156
+ "aria-label": "每页条数",
1019
1157
  className: "ml-2 text-xs border border-gray-200 rounded-md px-1.5 py-1 text-gray-600 focus:outline-none focus:ring-1 focus:ring-blue-400 cursor-pointer",
1020
- value: P.size,
1021
- onChange: (p) => H(1, Number(p.target.value)),
1022
- children: [10, 15, 20, 50].map((p) => /* @__PURE__ */ l("option", { value: p, children: [
1023
- p,
1158
+ value: D.size,
1159
+ onChange: (h) => j(1, Number(h.target.value)),
1160
+ children: [10, 15, 20, 50].map((h) => /* @__PURE__ */ s("option", { value: h, children: [
1161
+ h,
1024
1162
  " 条/页"
1025
- ] }, p))
1163
+ ] }, h))
1026
1164
  }
1027
1165
  )
1028
1166
  ] })
1029
1167
  ] })
1030
1168
  ] });
1031
- };
1032
- async function Ve(e) {
1169
+ }, Sr = [
1170
+ { position: "header", label: "页眉", icon: ct, parentEnabled: !1 },
1171
+ { position: "footer", label: "页尾", icon: ut, parentEnabled: !0 }
1172
+ ], ze = "w-full min-w-0 rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm text-gray-700 outline-none transition focus:border-blue-400 focus:ring-2 focus:ring-blue-500/20";
1173
+ function jr({ host: e, position: t, label: r, parentEnabled: a, service: o, parentNavId: l, onSelect: f }) {
1174
+ const g = Ie(), [y, k] = _([]), [p, v] = _(!1), [P, A] = _(""), [H, T] = _(!1), [W, D] = _(""), [R, V] = _(""), [j, E] = _(!1), b = Y(0), h = Y(0), z = Y(f);
1175
+ z.current = f;
1176
+ const M = o.getNavigationGroups, x = o.createNavigationGroup, w = xe(async () => {
1177
+ if (!e || !M) return;
1178
+ const d = ++h.current;
1179
+ v(!0), A("");
1180
+ try {
1181
+ const i = await M({ host: e, position: t });
1182
+ return d !== h.current ? void 0 : (k(i), i);
1183
+ } catch (i) {
1184
+ d === h.current && A(i instanceof Error ? i.message : "父导航加载失败");
1185
+ } finally {
1186
+ d === h.current && v(!1);
1187
+ }
1188
+ }, [e, t, M]);
1189
+ K(() => (b.current++, w(), () => {
1190
+ b.current++, h.current++;
1191
+ }), [w]);
1192
+ const L = async () => {
1193
+ if (j || !x || !a) return;
1194
+ const d = W.trim();
1195
+ if (!d) {
1196
+ V("请输入父导航名称");
1197
+ return;
1198
+ }
1199
+ const i = y.find((m) => m.name === d);
1200
+ if (i) {
1201
+ z.current(i.id), T(!1);
1202
+ return;
1203
+ }
1204
+ const c = b.current;
1205
+ E(!0), V("");
1206
+ try {
1207
+ const m = await x({ host: e, position: t, name: d });
1208
+ if (c !== b.current) return;
1209
+ k((u) => [...u.filter((C) => C.id !== m.id), m]), z.current(m.id), T(!1), D(""), w();
1210
+ } catch (m) {
1211
+ if (c !== b.current) return;
1212
+ if ((m == null ? void 0 : m.status) === 409) {
1213
+ const u = await w();
1214
+ if (c !== b.current) return;
1215
+ const C = u == null ? void 0 : u.find((O) => O.name === d);
1216
+ if (C) {
1217
+ z.current(C.id), T(!1), D("");
1218
+ return;
1219
+ }
1220
+ }
1221
+ V(m instanceof Error ? m.message : "新增父导航失败");
1222
+ } finally {
1223
+ c === b.current && E(!1);
1224
+ }
1225
+ }, F = !!l && !y.some((d) => d.id === l);
1226
+ return /* @__PURE__ */ s("div", { className: "mt-3", children: [
1227
+ /* @__PURE__ */ s("label", { htmlFor: g, className: "mb-1.5 block text-xs text-gray-500", children: [
1228
+ "所属父导航 ",
1229
+ /* @__PURE__ */ n("span", { className: "text-gray-400", children: "(可选)" })
1230
+ ] }),
1231
+ /* @__PURE__ */ s(
1232
+ "select",
1233
+ {
1234
+ id: g,
1235
+ "aria-label": `${r}父导航`,
1236
+ disabled: !a || !e || p || j,
1237
+ value: l ?? "",
1238
+ onChange: (d) => f(d.target.value || null),
1239
+ className: `${ze} disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-400`,
1240
+ children: [
1241
+ /* @__PURE__ */ n("option", { value: "", children: "无(顶级导航)" }),
1242
+ y.map((d) => /* @__PURE__ */ n("option", { value: d.id, children: d.name }, d.id)),
1243
+ F && /* @__PURE__ */ s("option", { value: l, children: [
1244
+ "已选父导航(",
1245
+ l,
1246
+ ")"
1247
+ ] })
1248
+ ]
1249
+ }
1250
+ ),
1251
+ p && /* @__PURE__ */ n("p", { role: "status", className: "mt-2 text-xs text-gray-500", children: "加载父导航中…" }),
1252
+ P && /* @__PURE__ */ s("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: [
1253
+ P,
1254
+ /* @__PURE__ */ n("button", { type: "button", onClick: () => void w(), className: "ml-2 cursor-pointer text-blue-500", children: "重试" })
1255
+ ] }),
1256
+ a ? e ? H ? /* @__PURE__ */ s("div", { className: "mt-3", children: [
1257
+ /* @__PURE__ */ s("label", { htmlFor: `${g}-new`, className: "mb-1.5 block text-xs text-gray-500", children: [
1258
+ "新增",
1259
+ r,
1260
+ "父导航"
1261
+ ] }),
1262
+ /* @__PURE__ */ n(
1263
+ "input",
1264
+ {
1265
+ id: `${g}-new`,
1266
+ autoFocus: !0,
1267
+ maxLength: 100,
1268
+ value: W,
1269
+ disabled: j,
1270
+ placeholder: "输入父导航名称",
1271
+ "aria-invalid": !!R,
1272
+ "aria-describedby": R ? `${g}-error` : void 0,
1273
+ onChange: (d) => {
1274
+ D(d.target.value), V("");
1275
+ },
1276
+ onKeyDown: (d) => {
1277
+ d.key === "Enter" && !d.nativeEvent.isComposing && (d.preventDefault(), L()), d.key === "Escape" && !j && T(!1);
1278
+ },
1279
+ className: ze
1280
+ }
1281
+ ),
1282
+ R && /* @__PURE__ */ n("p", { id: `${g}-error`, role: "alert", className: "mt-1.5 text-xs text-red-500", children: R }),
1283
+ /* @__PURE__ */ s("div", { className: "mt-2 flex flex-wrap gap-2", children: [
1284
+ /* @__PURE__ */ s("button", { type: "button", disabled: j, onClick: () => void L(), className: "flex cursor-pointer items-center gap-1 rounded-lg bg-blue-500 px-2.5 py-1.5 text-xs text-white hover:bg-blue-600 disabled:opacity-50", children: [
1285
+ j ? /* @__PURE__ */ n(lt, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ n(Yt, { size: 12, "aria-hidden": "true" }),
1286
+ j ? "添加中…" : "添加并选中"
1287
+ ] }),
1288
+ /* @__PURE__ */ s("button", { type: "button", disabled: j, onClick: () => T(!1), className: "flex cursor-pointer items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs text-gray-500 hover:bg-gray-100 disabled:opacity-50", children: [
1289
+ /* @__PURE__ */ n(wr, { size: 12, "aria-hidden": "true" }),
1290
+ "取消"
1291
+ ] })
1292
+ ] })
1293
+ ] }) : x ? /* @__PURE__ */ s("button", { type: "button", disabled: p, "aria-label": `新增${r}父导航`, onClick: () => {
1294
+ T(!0), D(""), V("");
1295
+ }, className: "mt-2.5 flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-50", children: [
1296
+ /* @__PURE__ */ n(ht, { size: 13, "aria-hidden": "true" }),
1297
+ "新增父导航"
1298
+ ] }) : null : /* @__PURE__ */ n("p", { className: "mt-2 text-xs text-gray-500", children: "请先填写网站地址" }) : /* @__PURE__ */ n("p", { className: "mt-2 text-xs text-gray-500", children: "页眉暂不支持设置父导航。" })
1299
+ ] });
1300
+ }
1301
+ function Or({ host: e, service: t, value: r, onChange: a }) {
1302
+ const o = Ie(), l = e.trim().replace(/\/+$/, ""), [f, g] = _(!1), y = !!t.getNavigationGroups, k = (v) => a({ ...r, ...v }), p = (v, P) => {
1303
+ k({
1304
+ navPlacements: P ? [...r.navPlacements, { position: v, parentNavId: null }] : r.navPlacements.filter((A) => A.position !== v)
1305
+ });
1306
+ };
1307
+ return /* @__PURE__ */ s("section", { "aria-label": "导航设置", className: "mt-5 border-t border-gray-100 pt-4", children: [
1308
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
1309
+ /* @__PURE__ */ n("span", { className: "text-sm font-medium text-gray-700", children: "导航设置" }),
1310
+ /* @__PURE__ */ s("label", { htmlFor: `${o}-enabled`, className: "flex cursor-pointer items-center gap-2 text-sm text-gray-600", children: [
1311
+ /* @__PURE__ */ n("span", { children: "启用导航" }),
1312
+ /* @__PURE__ */ s("span", { className: "relative inline-flex h-5 w-9 shrink-0 items-center", children: [
1313
+ /* @__PURE__ */ n(
1314
+ "input",
1315
+ {
1316
+ id: `${o}-enabled`,
1317
+ type: "checkbox",
1318
+ role: "switch",
1319
+ checked: r.navEnabled,
1320
+ disabled: !y,
1321
+ "aria-controls": `${o}-fields`,
1322
+ onChange: (v) => k({ navEnabled: v.target.checked }),
1323
+ className: "peer absolute inset-0 z-10 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed"
1324
+ }
1325
+ ),
1326
+ /* @__PURE__ */ n("span", { "aria-hidden": "true", className: "absolute inset-0 rounded-full bg-gray-200 transition peer-checked:bg-blue-500 peer-disabled:opacity-50 peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-blue-500" }),
1327
+ /* @__PURE__ */ n("span", { "aria-hidden": "true", className: "pointer-events-none relative ml-0.5 h-4 w-4 rounded-full bg-white shadow-sm transition-transform peer-checked:translate-x-4" })
1328
+ ] })
1329
+ ] })
1330
+ ] }),
1331
+ y ? r.navEnabled ? /* @__PURE__ */ s("div", { id: `${o}-fields`, className: "mt-4 space-y-4", children: [
1332
+ /* @__PURE__ */ s("div", { className: "max-w-md", children: [
1333
+ /* @__PURE__ */ s("label", { htmlFor: `${o}-name`, className: "mb-1.5 block text-sm font-medium text-gray-700", children: [
1334
+ "导航名称 ",
1335
+ /* @__PURE__ */ n("span", { className: "text-red-500", children: "*" })
1336
+ ] }),
1337
+ /* @__PURE__ */ n(
1338
+ "input",
1339
+ {
1340
+ id: `${o}-name`,
1341
+ value: r.navname,
1342
+ maxLength: 100,
1343
+ placeholder: "输入导航名称",
1344
+ required: !0,
1345
+ "aria-invalid": f && !r.navname.trim(),
1346
+ "aria-describedby": f && !r.navname.trim() ? `${o}-name-error` : void 0,
1347
+ onChange: (v) => k({ navname: v.target.value }),
1348
+ onBlur: () => g(!0),
1349
+ className: ze
1350
+ }
1351
+ ),
1352
+ f && !r.navname.trim() && /* @__PURE__ */ n("p", { id: `${o}-name-error`, role: "alert", className: "mt-1.5 text-xs text-red-500", children: "开启导航后,请填写导航名称" })
1353
+ ] }),
1354
+ /* @__PURE__ */ s("fieldset", { "aria-describedby": `${o}-placements-hint`, children: [
1355
+ /* @__PURE__ */ s("legend", { className: "mb-2 text-sm font-medium text-gray-700", children: [
1356
+ "展示位置 ",
1357
+ /* @__PURE__ */ n("span", { className: "text-red-500", children: "*" })
1358
+ ] }),
1359
+ /* @__PURE__ */ n("p", { id: `${o}-placements-hint`, className: "mb-3 text-xs text-gray-500", children: "可同时选择页眉和页尾,页尾可设置父导航。" }),
1360
+ /* @__PURE__ */ n("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: Sr.map(({ position: v, label: P, icon: A, parentEnabled: H }) => {
1361
+ const T = r.navPlacements.find((W) => W.position === v);
1362
+ return /* @__PURE__ */ s("div", { className: `min-w-0 rounded-xl border p-3.5 transition-colors ${T ? "border-blue-200 bg-blue-50/30" : "border-gray-200 bg-gray-50/50"}`, children: [
1363
+ /* @__PURE__ */ s("label", { className: "flex cursor-pointer items-center gap-2.5 text-sm text-gray-700", children: [
1364
+ /* @__PURE__ */ n("input", { type: "checkbox", checked: !!T, onChange: (W) => p(v, W.target.checked), className: "h-4 w-4 shrink-0 accent-blue-500" }),
1365
+ /* @__PURE__ */ n(A, { size: 15, className: "shrink-0 text-gray-400", "aria-hidden": "true" }),
1366
+ /* @__PURE__ */ n("span", { className: "font-medium", children: P })
1367
+ ] }),
1368
+ T && /* @__PURE__ */ n(
1369
+ jr,
1370
+ {
1371
+ host: l,
1372
+ position: v,
1373
+ label: P,
1374
+ parentEnabled: H,
1375
+ service: t,
1376
+ parentNavId: T.parentNavId,
1377
+ onSelect: (W) => k({ navPlacements: r.navPlacements.map((D) => D.position === v ? { ...D, parentNavId: W } : D) })
1378
+ },
1379
+ `${l}:${v}`
1380
+ )
1381
+ ] }, v);
1382
+ }) }),
1383
+ r.navPlacements.length === 0 && /* @__PURE__ */ n("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: "请至少选择一个展示位置" })
1384
+ ] })
1385
+ ] }) : /* @__PURE__ */ n("p", { className: "mt-1.5 text-xs text-gray-500", children: "开启后可将文章加入页眉、页尾或同时加入两处。" }) : /* @__PURE__ */ n("p", { className: "mt-1.5 text-xs text-gray-500", children: "当前服务尚未接入导航配置" })
1386
+ ] });
1387
+ }
1388
+ function Pr(e) {
1389
+ return e.split(/(“[^”]+”|"[^"]+")/g).map(
1390
+ (t, r) => /^(“.*”|".*")$/.test(t) ? /* @__PURE__ */ n("code", { className: "rounded bg-gray-100 px-1 py-0.5 font-mono text-[11px] text-gray-800", children: t.slice(1, -1) }, r) : t
1391
+ );
1392
+ }
1393
+ function Er({ errors: e, source: t }) {
1394
+ const [r, a] = _(null), o = t.split(`
1395
+ `);
1396
+ return /* @__PURE__ */ s("div", { children: [
1397
+ /* @__PURE__ */ s("div", { className: "sticky top-0 z-10 flex items-center gap-3 border-b border-gray-100 bg-white px-4 py-3.5", children: [
1398
+ /* @__PURE__ */ n("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-red-50 text-red-500", children: /* @__PURE__ */ n(Gt, { size: 18, strokeWidth: 1.75 }) }),
1399
+ /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
1400
+ /* @__PURE__ */ n("div", { className: "text-sm font-semibold text-gray-900", children: "HTML 校验" }),
1401
+ /* @__PURE__ */ n("div", { className: "mt-0.5 text-xs text-gray-500", children: "点击问题查看详情" })
1402
+ ] }),
1403
+ /* @__PURE__ */ s("span", { className: "shrink-0 rounded-full bg-red-50 px-2.5 py-1 text-xs font-medium text-red-600", children: [
1404
+ e.length,
1405
+ " 个问题"
1406
+ ] })
1407
+ ] }),
1408
+ /* @__PURE__ */ n("ol", { className: "m-0 list-none divide-y divide-gray-100 p-0", children: e.map((l, f) => {
1409
+ var k, p;
1410
+ const g = (l.lastLine ? (k = o[l.lastLine - 1]) == null ? void 0 : k.trim() : "") || ((p = l.extract) == null ? void 0 : p.trim()), y = r === f;
1411
+ return /* @__PURE__ */ s("li", { children: [
1412
+ /* @__PURE__ */ s(
1413
+ "button",
1414
+ {
1415
+ type: "button",
1416
+ "aria-expanded": y,
1417
+ onClick: () => a(y ? null : f),
1418
+ className: `flex w-full cursor-pointer items-center gap-2.5 px-4 py-3 text-left transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 ${y ? "bg-gray-50" : ""}`,
1419
+ children: [
1420
+ /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-red-400" }),
1421
+ /* @__PURE__ */ n("span", { className: "w-16 shrink-0 font-mono text-[11px] text-gray-500", children: l.lastLine != null ? `第 ${l.lastLine} 行` : `问题 ${f + 1}` }),
1422
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-xs leading-5 text-gray-700", children: l.message.replace(/[“”"]/g, "") }),
1423
+ /* @__PURE__ */ n(Bt, { size: 14, className: `shrink-0 text-gray-400 transition-transform ${y ? "rotate-180" : ""}` })
1424
+ ]
1425
+ }
1426
+ ),
1427
+ y && /* @__PURE__ */ s("div", { className: "border-t border-gray-100 px-4 pb-4 pt-3", children: [
1428
+ l.lastColumn != null && /* @__PURE__ */ s("div", { className: "mb-2 font-mono text-[11px] text-gray-400", children: [
1429
+ "第 ",
1430
+ l.lastColumn,
1431
+ " 列"
1432
+ ] }),
1433
+ /* @__PURE__ */ n("p", { className: "m-0 text-[13px] leading-6 text-gray-600", children: Pr(l.message) }),
1434
+ g && /* @__PURE__ */ s("div", { className: "mt-3 overflow-hidden rounded-lg border border-gray-100 bg-gray-50", children: [
1435
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5 border-b border-gray-100 px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider text-gray-400", children: [
1436
+ /* @__PURE__ */ n(Ye, { size: 11 }),
1437
+ " 源代码"
1438
+ ] }),
1439
+ /* @__PURE__ */ n("pre", { className: "m-0 whitespace-pre-wrap break-words px-3 py-2.5 font-mono text-[11px] leading-5 text-gray-600", children: g })
1440
+ ] })
1441
+ ] })
1442
+ ] }, f);
1443
+ }) })
1444
+ ] });
1445
+ }
1446
+ async function Ke(e) {
1033
1447
  const t = new AbortController(), r = setTimeout(() => t.abort(), 1e4);
1034
1448
  try {
1035
- const n = await fetch("https://validator.w3.org/nu/?out=json", {
1449
+ const a = await fetch("https://validator.w3.org/nu/?out=json", {
1036
1450
  method: "POST",
1037
1451
  headers: {
1038
1452
  "Content-Type": "text/html; charset=utf-8",
@@ -1041,117 +1455,117 @@ async function Ve(e) {
1041
1455
  body: e,
1042
1456
  signal: t.signal
1043
1457
  });
1044
- if (!n.ok) throw new Error(`W3C validator responded with ${n.status}`);
1045
- const y = ((await n.json()).messages || []).filter(($) => $.type === "error");
1046
- return { isValid: y.length === 0, errors: y };
1047
- } catch (n) {
1048
- return console.error("W3C 校验请求失败:", n), { isValid: !0, errors: [], networkError: !0 };
1458
+ if (!a.ok) throw new Error(`W3C validator responded with ${a.status}`);
1459
+ const f = ((await a.json()).messages || []).filter((g) => g.type === "error");
1460
+ return { isValid: f.length === 0, errors: f };
1461
+ } catch (a) {
1462
+ return console.error("W3C 校验请求失败:", a), { isValid: !0, errors: [], networkError: !0 };
1049
1463
  } finally {
1050
1464
  clearTimeout(r);
1051
1465
  }
1052
1466
  }
1053
- function Ye(e, t) {
1467
+ function Je(e, t) {
1054
1468
  (t == null || t > e.length) && (t = e.length);
1055
- for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
1056
- return n;
1469
+ for (var r = 0, a = Array(t); r < t; r++) a[r] = e[r];
1470
+ return a;
1057
1471
  }
1058
- function ar(e) {
1472
+ function Lr(e) {
1059
1473
  if (Array.isArray(e)) return e;
1060
1474
  }
1061
- function ir(e, t, r) {
1062
- return (t = hr(t)) in e ? Object.defineProperty(e, t, {
1475
+ function Tr(e, t, r) {
1476
+ return (t = Wr(t)) in e ? Object.defineProperty(e, t, {
1063
1477
  value: r,
1064
1478
  enumerable: !0,
1065
1479
  configurable: !0,
1066
1480
  writable: !0
1067
1481
  }) : e[t] = r, e;
1068
1482
  }
1069
- function or(e, t) {
1483
+ function _r(e, t) {
1070
1484
  var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1071
1485
  if (r != null) {
1072
- var n, s, u, y, $ = [], M = !0, j = !1;
1486
+ var a, o, l, f, g = [], y = !0, k = !1;
1073
1487
  try {
1074
- if (u = (r = r.call(e)).next, t !== 0) for (; !(M = (n = u.call(r)).done) && ($.push(n.value), $.length !== t); M = !0) ;
1075
- } catch (m) {
1076
- j = !0, s = m;
1488
+ if (l = (r = r.call(e)).next, t !== 0) for (; !(y = (a = l.call(r)).done) && (g.push(a.value), g.length !== t); y = !0) ;
1489
+ } catch (p) {
1490
+ k = !0, o = p;
1077
1491
  } finally {
1078
1492
  try {
1079
- if (!M && r.return != null && (y = r.return(), Object(y) !== y)) return;
1493
+ if (!y && r.return != null && (f = r.return(), Object(f) !== f)) return;
1080
1494
  } finally {
1081
- if (j) throw s;
1495
+ if (k) throw o;
1082
1496
  }
1083
1497
  }
1084
- return $;
1498
+ return g;
1085
1499
  }
1086
1500
  }
1087
- function sr() {
1501
+ function Dr() {
1088
1502
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1089
1503
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1090
1504
  }
1091
- function Ue(e, t) {
1505
+ function Qe(e, t) {
1092
1506
  var r = Object.keys(e);
1093
1507
  if (Object.getOwnPropertySymbols) {
1094
- var n = Object.getOwnPropertySymbols(e);
1095
- t && (n = n.filter(function(s) {
1096
- return Object.getOwnPropertyDescriptor(e, s).enumerable;
1097
- })), r.push.apply(r, n);
1508
+ var a = Object.getOwnPropertySymbols(e);
1509
+ t && (a = a.filter(function(o) {
1510
+ return Object.getOwnPropertyDescriptor(e, o).enumerable;
1511
+ })), r.push.apply(r, a);
1098
1512
  }
1099
1513
  return r;
1100
1514
  }
1101
- function qe(e) {
1515
+ function Xe(e) {
1102
1516
  for (var t = 1; t < arguments.length; t++) {
1103
1517
  var r = arguments[t] != null ? arguments[t] : {};
1104
- t % 2 ? Ue(Object(r), !0).forEach(function(n) {
1105
- ir(e, n, r[n]);
1106
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ue(Object(r)).forEach(function(n) {
1107
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
1518
+ t % 2 ? Qe(Object(r), !0).forEach(function(a) {
1519
+ Tr(e, a, r[a]);
1520
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Qe(Object(r)).forEach(function(a) {
1521
+ Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
1108
1522
  });
1109
1523
  }
1110
1524
  return e;
1111
1525
  }
1112
- function cr(e, t) {
1526
+ function zr(e, t) {
1113
1527
  if (e == null) return {};
1114
- var r, n, s = lr(e, t);
1528
+ var r, a, o = Ar(e, t);
1115
1529
  if (Object.getOwnPropertySymbols) {
1116
- var u = Object.getOwnPropertySymbols(e);
1117
- for (n = 0; n < u.length; n++) r = u[n], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (s[r] = e[r]);
1530
+ var l = Object.getOwnPropertySymbols(e);
1531
+ for (a = 0; a < l.length; a++) r = l[a], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
1118
1532
  }
1119
- return s;
1533
+ return o;
1120
1534
  }
1121
- function lr(e, t) {
1535
+ function Ar(e, t) {
1122
1536
  if (e == null) return {};
1123
1537
  var r = {};
1124
- for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
1125
- if (t.indexOf(n) !== -1) continue;
1126
- r[n] = e[n];
1538
+ for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
1539
+ if (t.indexOf(a) !== -1) continue;
1540
+ r[a] = e[a];
1127
1541
  }
1128
1542
  return r;
1129
1543
  }
1130
- function ur(e, t) {
1131
- return ar(e) || or(e, t) || fr(e, t) || sr();
1544
+ function Hr(e, t) {
1545
+ return Lr(e) || _r(e, t) || Rr(e, t) || Dr();
1132
1546
  }
1133
- function dr(e, t) {
1547
+ function Ir(e, t) {
1134
1548
  if (typeof e != "object" || !e) return e;
1135
1549
  var r = e[Symbol.toPrimitive];
1136
1550
  if (r !== void 0) {
1137
- var n = r.call(e, t);
1138
- if (typeof n != "object") return n;
1551
+ var a = r.call(e, t);
1552
+ if (typeof a != "object") return a;
1139
1553
  throw new TypeError("@@toPrimitive must return a primitive value.");
1140
1554
  }
1141
1555
  return (t === "string" ? String : Number)(e);
1142
1556
  }
1143
- function hr(e) {
1144
- var t = dr(e, "string");
1557
+ function Wr(e) {
1558
+ var t = Ir(e, "string");
1145
1559
  return typeof t == "symbol" ? t : t + "";
1146
1560
  }
1147
- function fr(e, t) {
1561
+ function Rr(e, t) {
1148
1562
  if (e) {
1149
- if (typeof e == "string") return Ye(e, t);
1563
+ if (typeof e == "string") return Je(e, t);
1150
1564
  var r = {}.toString.call(e).slice(8, -1);
1151
- return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Ye(e, t) : void 0;
1565
+ return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Je(e, t) : void 0;
1152
1566
  }
1153
1567
  }
1154
- function mr(e, t, r) {
1568
+ function Vr(e, t, r) {
1155
1569
  return t in e ? Object.defineProperty(e, t, {
1156
1570
  value: r,
1157
1571
  enumerable: !0,
@@ -1159,79 +1573,79 @@ function mr(e, t, r) {
1159
1573
  writable: !0
1160
1574
  }) : e[t] = r, e;
1161
1575
  }
1162
- function Be(e, t) {
1576
+ function et(e, t) {
1163
1577
  var r = Object.keys(e);
1164
1578
  if (Object.getOwnPropertySymbols) {
1165
- var n = Object.getOwnPropertySymbols(e);
1166
- t && (n = n.filter(function(s) {
1167
- return Object.getOwnPropertyDescriptor(e, s).enumerable;
1168
- })), r.push.apply(r, n);
1579
+ var a = Object.getOwnPropertySymbols(e);
1580
+ t && (a = a.filter(function(o) {
1581
+ return Object.getOwnPropertyDescriptor(e, o).enumerable;
1582
+ })), r.push.apply(r, a);
1169
1583
  }
1170
1584
  return r;
1171
1585
  }
1172
- function Fe(e) {
1586
+ function tt(e) {
1173
1587
  for (var t = 1; t < arguments.length; t++) {
1174
1588
  var r = arguments[t] != null ? arguments[t] : {};
1175
- t % 2 ? Be(Object(r), !0).forEach(function(n) {
1176
- mr(e, n, r[n]);
1177
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Be(Object(r)).forEach(function(n) {
1178
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
1589
+ t % 2 ? et(Object(r), !0).forEach(function(a) {
1590
+ Vr(e, a, r[a]);
1591
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : et(Object(r)).forEach(function(a) {
1592
+ Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
1179
1593
  });
1180
1594
  }
1181
1595
  return e;
1182
1596
  }
1183
- function pr() {
1597
+ function Yr() {
1184
1598
  for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
1185
1599
  t[r] = arguments[r];
1186
- return function(n) {
1187
- return t.reduceRight(function(s, u) {
1188
- return u(s);
1189
- }, n);
1600
+ return function(a) {
1601
+ return t.reduceRight(function(o, l) {
1602
+ return l(o);
1603
+ }, a);
1190
1604
  };
1191
1605
  }
1192
- function se(e) {
1606
+ function le(e) {
1193
1607
  return function t() {
1194
- for (var r = this, n = arguments.length, s = new Array(n), u = 0; u < n; u++)
1195
- s[u] = arguments[u];
1196
- return s.length >= e.length ? e.apply(this, s) : function() {
1197
- for (var y = arguments.length, $ = new Array(y), M = 0; M < y; M++)
1198
- $[M] = arguments[M];
1199
- return t.apply(r, [].concat(s, $));
1608
+ for (var r = this, a = arguments.length, o = new Array(a), l = 0; l < a; l++)
1609
+ o[l] = arguments[l];
1610
+ return o.length >= e.length ? e.apply(this, o) : function() {
1611
+ for (var f = arguments.length, g = new Array(f), y = 0; y < f; y++)
1612
+ g[y] = arguments[y];
1613
+ return t.apply(r, [].concat(o, g));
1200
1614
  };
1201
1615
  };
1202
1616
  }
1203
- function ge(e) {
1617
+ function be(e) {
1204
1618
  return {}.toString.call(e).includes("Object");
1205
1619
  }
1206
- function gr(e) {
1620
+ function qr(e) {
1207
1621
  return !Object.keys(e).length;
1208
1622
  }
1209
- function le(e) {
1623
+ function he(e) {
1210
1624
  return typeof e == "function";
1211
1625
  }
1212
- function yr(e, t) {
1626
+ function Br(e, t) {
1213
1627
  return Object.prototype.hasOwnProperty.call(e, t);
1214
1628
  }
1215
- function br(e, t) {
1216
- return ge(t) || re("changeType"), Object.keys(t).some(function(r) {
1217
- return !yr(e, r);
1218
- }) && re("changeField"), t;
1629
+ function Fr(e, t) {
1630
+ return be(t) || ne("changeType"), Object.keys(t).some(function(r) {
1631
+ return !Br(e, r);
1632
+ }) && ne("changeField"), t;
1219
1633
  }
1220
- function xr(e) {
1221
- le(e) || re("selectorType");
1634
+ function Ur(e) {
1635
+ he(e) || ne("selectorType");
1222
1636
  }
1223
- function vr(e) {
1224
- le(e) || ge(e) || re("handlerType"), ge(e) && Object.values(e).some(function(t) {
1225
- return !le(t);
1226
- }) && re("handlersType");
1637
+ function Gr(e) {
1638
+ he(e) || be(e) || ne("handlerType"), be(e) && Object.values(e).some(function(t) {
1639
+ return !he(t);
1640
+ }) && ne("handlersType");
1227
1641
  }
1228
- function wr(e) {
1229
- e || re("initialIsRequired"), ge(e) || re("initialType"), gr(e) && re("initialContent");
1642
+ function Zr(e) {
1643
+ e || ne("initialIsRequired"), be(e) || ne("initialType"), qr(e) && ne("initialContent");
1230
1644
  }
1231
- function Nr(e, t) {
1645
+ function Kr(e, t) {
1232
1646
  throw new Error(e[t] || e.default);
1233
1647
  }
1234
- var kr = {
1648
+ var Jr = {
1235
1649
  initialIsRequired: "initial state is required",
1236
1650
  initialType: "initial state should be an object",
1237
1651
  initialContent: "initial state shouldn't be an empty object",
@@ -1241,76 +1655,76 @@ var kr = {
1241
1655
  changeType: "provided value of changes should be an object",
1242
1656
  changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
1243
1657
  default: "an unknown error accured in `state-local` package"
1244
- }, re = se(Nr)(kr), he = {
1245
- changes: br,
1246
- selector: xr,
1247
- handler: vr,
1248
- initial: wr
1658
+ }, ne = le(Kr)(Jr), pe = {
1659
+ changes: Fr,
1660
+ selector: Ur,
1661
+ handler: Gr,
1662
+ initial: Zr
1249
1663
  };
1250
- function $r(e) {
1664
+ function Qr(e) {
1251
1665
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1252
- he.initial(e), he.handler(t);
1666
+ pe.initial(e), pe.handler(t);
1253
1667
  var r = {
1254
1668
  current: e
1255
- }, n = se(Sr)(r, t), s = se(Cr)(r), u = se(he.changes)(e), y = se(Mr)(r);
1256
- function $() {
1257
- var j = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(m) {
1258
- return m;
1669
+ }, a = le(tn)(r, t), o = le(en)(r), l = le(pe.changes)(e), f = le(Xr)(r);
1670
+ function g() {
1671
+ var k = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(p) {
1672
+ return p;
1259
1673
  };
1260
- return he.selector(j), j(r.current);
1674
+ return pe.selector(k), k(r.current);
1261
1675
  }
1262
- function M(j) {
1263
- pr(n, s, u, y)(j);
1676
+ function y(k) {
1677
+ Yr(a, o, l, f)(k);
1264
1678
  }
1265
- return [$, M];
1679
+ return [g, y];
1266
1680
  }
1267
- function Mr(e, t) {
1268
- return le(t) ? t(e.current) : t;
1681
+ function Xr(e, t) {
1682
+ return he(t) ? t(e.current) : t;
1269
1683
  }
1270
- function Cr(e, t) {
1271
- return e.current = Fe(Fe({}, e.current), t), t;
1684
+ function en(e, t) {
1685
+ return e.current = tt(tt({}, e.current), t), t;
1272
1686
  }
1273
- function Sr(e, t, r) {
1274
- return le(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
1275
- var s;
1276
- return (s = t[n]) === null || s === void 0 ? void 0 : s.call(t, e.current[n]);
1687
+ function tn(e, t, r) {
1688
+ return he(t) ? t(e.current) : Object.keys(r).forEach(function(a) {
1689
+ var o;
1690
+ return (o = t[a]) === null || o === void 0 ? void 0 : o.call(t, e.current[a]);
1277
1691
  }), r;
1278
1692
  }
1279
- var jr = {
1280
- create: $r
1281
- }, Or = {
1693
+ var rn = {
1694
+ create: Qr
1695
+ }, nn = {
1282
1696
  paths: {
1283
1697
  vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
1284
1698
  }
1285
1699
  };
1286
- function Pr(e) {
1700
+ function an(e) {
1287
1701
  return function t() {
1288
- for (var r = this, n = arguments.length, s = new Array(n), u = 0; u < n; u++)
1289
- s[u] = arguments[u];
1290
- return s.length >= e.length ? e.apply(this, s) : function() {
1291
- for (var y = arguments.length, $ = new Array(y), M = 0; M < y; M++)
1292
- $[M] = arguments[M];
1293
- return t.apply(r, [].concat(s, $));
1702
+ for (var r = this, a = arguments.length, o = new Array(a), l = 0; l < a; l++)
1703
+ o[l] = arguments[l];
1704
+ return o.length >= e.length ? e.apply(this, o) : function() {
1705
+ for (var f = arguments.length, g = new Array(f), y = 0; y < f; y++)
1706
+ g[y] = arguments[y];
1707
+ return t.apply(r, [].concat(o, g));
1294
1708
  };
1295
1709
  };
1296
1710
  }
1297
- function Dr(e) {
1711
+ function sn(e) {
1298
1712
  return {}.toString.call(e).includes("Object");
1299
1713
  }
1300
- function Lr(e) {
1301
- return e || Ze("configIsRequired"), Dr(e) || Ze("configType"), e.urls ? (_r(), {
1714
+ function on(e) {
1715
+ return e || rt("configIsRequired"), sn(e) || rt("configType"), e.urls ? (cn(), {
1302
1716
  paths: {
1303
1717
  vs: e.urls.monacoBase
1304
1718
  }
1305
1719
  }) : e;
1306
1720
  }
1307
- function _r() {
1308
- console.warn(at.deprecation);
1721
+ function cn() {
1722
+ console.warn(xt.deprecation);
1309
1723
  }
1310
- function Tr(e, t) {
1724
+ function ln(e, t) {
1311
1725
  throw new Error(e[t] || e.default);
1312
1726
  }
1313
- var at = {
1727
+ var xt = {
1314
1728
  configIsRequired: "the configuration object is required",
1315
1729
  configType: "the configuration object should be an object",
1316
1730
  default: "an unknown error accured in `@monaco-editor/loader` package",
@@ -1324,376 +1738,483 @@ var at = {
1324
1738
 
1325
1739
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
1326
1740
  `
1327
- }, Ze = Pr(Tr)(at), Ar = {
1328
- config: Lr
1329
- }, Er = function() {
1330
- for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
1331
- r[n] = arguments[n];
1332
- return function(s) {
1333
- return r.reduceRight(function(u, y) {
1334
- return y(u);
1335
- }, s);
1741
+ }, rt = an(ln)(xt), dn = {
1742
+ config: on
1743
+ }, un = function() {
1744
+ for (var t = arguments.length, r = new Array(t), a = 0; a < t; a++)
1745
+ r[a] = arguments[a];
1746
+ return function(o) {
1747
+ return r.reduceRight(function(l, f) {
1748
+ return f(l);
1749
+ }, o);
1336
1750
  };
1337
1751
  };
1338
- function it(e, t) {
1752
+ function bt(e, t) {
1339
1753
  return Object.keys(t).forEach(function(r) {
1340
- t[r] instanceof Object && e[r] && Object.assign(t[r], it(e[r], t[r]));
1341
- }), qe(qe({}, e), t);
1754
+ t[r] instanceof Object && e[r] && Object.assign(t[r], bt(e[r], t[r]));
1755
+ }), Xe(Xe({}, e), t);
1342
1756
  }
1343
- var zr = {
1757
+ var hn = {
1344
1758
  type: "cancelation",
1345
1759
  msg: "operation is manually canceled"
1346
1760
  };
1347
- function Ne(e) {
1348
- var t = !1, r = new Promise(function(n, s) {
1349
- e.then(function(u) {
1350
- return t ? s(zr) : n(u);
1351
- }), e.catch(s);
1761
+ function Se(e) {
1762
+ var t = !1, r = new Promise(function(a, o) {
1763
+ e.then(function(l) {
1764
+ return t ? o(hn) : a(l);
1765
+ }), e.catch(o);
1352
1766
  });
1353
1767
  return r.cancel = function() {
1354
1768
  return t = !0;
1355
1769
  }, r;
1356
1770
  }
1357
- var Hr = ["monaco"], Ir = jr.create({
1358
- config: Or,
1771
+ var mn = ["monaco"], pn = rn.create({
1772
+ config: nn,
1359
1773
  isInitialized: !1,
1360
1774
  resolve: null,
1361
1775
  reject: null,
1362
1776
  monaco: null
1363
- }), ot = ur(Ir, 2), ue = ot[0], be = ot[1];
1364
- function Wr(e) {
1365
- var t = Ar.config(e), r = t.monaco, n = cr(t, Hr);
1366
- be(function(s) {
1777
+ }), yt = Hr(pn, 2), me = yt[0], we = yt[1];
1778
+ function fn(e) {
1779
+ var t = dn.config(e), r = t.monaco, a = zr(t, mn);
1780
+ we(function(o) {
1367
1781
  return {
1368
- config: it(s.config, n),
1782
+ config: bt(o.config, a),
1369
1783
  monaco: r
1370
1784
  };
1371
1785
  });
1372
1786
  }
1373
- function Rr() {
1374
- var e = ue(function(t) {
1375
- var r = t.monaco, n = t.isInitialized, s = t.resolve;
1787
+ function gn() {
1788
+ var e = me(function(t) {
1789
+ var r = t.monaco, a = t.isInitialized, o = t.resolve;
1376
1790
  return {
1377
1791
  monaco: r,
1378
- isInitialized: n,
1379
- resolve: s
1792
+ isInitialized: a,
1793
+ resolve: o
1380
1794
  };
1381
1795
  });
1382
1796
  if (!e.isInitialized) {
1383
- if (be({
1797
+ if (we({
1384
1798
  isInitialized: !0
1385
1799
  }), e.monaco)
1386
- return e.resolve(e.monaco), Ne(ke);
1800
+ return e.resolve(e.monaco), Se(je);
1387
1801
  if (window.monaco && window.monaco.editor)
1388
- return st(window.monaco), e.resolve(window.monaco), Ne(ke);
1389
- Er(Vr, Ur)(qr);
1802
+ return vt(window.monaco), e.resolve(window.monaco), Se(je);
1803
+ un(xn, yn)(vn);
1390
1804
  }
1391
- return Ne(ke);
1805
+ return Se(je);
1392
1806
  }
1393
- function Vr(e) {
1807
+ function xn(e) {
1394
1808
  return document.body.appendChild(e);
1395
1809
  }
1396
- function Yr(e) {
1810
+ function bn(e) {
1397
1811
  var t = document.createElement("script");
1398
1812
  return e && (t.src = e), t;
1399
1813
  }
1400
- function Ur(e) {
1401
- var t = ue(function(n) {
1402
- var s = n.config, u = n.reject;
1814
+ function yn(e) {
1815
+ var t = me(function(a) {
1816
+ var o = a.config, l = a.reject;
1403
1817
  return {
1404
- config: s,
1405
- reject: u
1818
+ config: o,
1819
+ reject: l
1406
1820
  };
1407
- }), r = Yr("".concat(t.config.paths.vs, "/loader.js"));
1821
+ }), r = bn("".concat(t.config.paths.vs, "/loader.js"));
1408
1822
  return r.onload = function() {
1409
1823
  return e();
1410
1824
  }, r.onerror = t.reject, r;
1411
1825
  }
1412
- function qr() {
1413
- var e = ue(function(r) {
1414
- var n = r.config, s = r.resolve, u = r.reject;
1826
+ function vn() {
1827
+ var e = me(function(r) {
1828
+ var a = r.config, o = r.resolve, l = r.reject;
1415
1829
  return {
1416
- config: n,
1417
- resolve: s,
1418
- reject: u
1830
+ config: a,
1831
+ resolve: o,
1832
+ reject: l
1419
1833
  };
1420
1834
  }), t = window.require;
1421
1835
  t.config(e.config), t(["vs/editor/editor.main"], function(r) {
1422
- var n = r.m || r;
1423
- st(n), e.resolve(n);
1836
+ var a = r.m || r;
1837
+ vt(a), e.resolve(a);
1424
1838
  }, function(r) {
1425
1839
  e.reject(r);
1426
1840
  });
1427
1841
  }
1428
- function st(e) {
1429
- ue().monaco || be({
1842
+ function vt(e) {
1843
+ me().monaco || we({
1430
1844
  monaco: e
1431
1845
  });
1432
1846
  }
1433
- function Br() {
1434
- return ue(function(e) {
1847
+ function wn() {
1848
+ return me(function(e) {
1435
1849
  var t = e.monaco;
1436
1850
  return t;
1437
1851
  });
1438
1852
  }
1439
- var ke = new Promise(function(e, t) {
1440
- return be({
1853
+ var je = new Promise(function(e, t) {
1854
+ return we({
1441
1855
  resolve: e,
1442
1856
  reject: t
1443
1857
  });
1444
- }), ct = {
1445
- config: Wr,
1446
- init: Rr,
1447
- __getMonacoInstance: Br
1448
- }, Fr = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, $e = Fr, Zr = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Jr = Zr;
1449
- function Kr({ children: e }) {
1450
- return ie.createElement("div", { style: Jr.container }, e);
1451
- }
1452
- var Gr = Kr, Qr = Gr;
1453
- function Xr({ width: e, height: t, isEditorReady: r, loading: n, _ref: s, className: u, wrapperProps: y }) {
1454
- return ie.createElement("section", { style: { ...$e.wrapper, width: e, height: t }, ...y }, !r && ie.createElement(Qr, null, n), ie.createElement("div", { ref: s, style: { ...$e.fullWidth, ...!r && $e.hide }, className: u }));
1455
- }
1456
- var en = Xr, lt = Te(en);
1457
- function tn(e) {
1858
+ }), wt = {
1859
+ config: fn,
1860
+ init: gn,
1861
+ __getMonacoInstance: wn
1862
+ }, Nn = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, Oe = Nn, kn = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, $n = kn;
1863
+ function Mn({ children: e }) {
1864
+ return ce.createElement("div", { style: $n.container }, e);
1865
+ }
1866
+ var Cn = Mn, Sn = Cn;
1867
+ function jn({ width: e, height: t, isEditorReady: r, loading: a, _ref: o, className: l, wrapperProps: f }) {
1868
+ return ce.createElement("section", { style: { ...Oe.wrapper, width: e, height: t }, ...f }, !r && ce.createElement(Sn, null, a), ce.createElement("div", { ref: o, style: { ...Oe.fullWidth, ...!r && Oe.hide }, className: l }));
1869
+ }
1870
+ var On = jn, Nt = We(On);
1871
+ function Pn(e) {
1458
1872
  K(e, []);
1459
1873
  }
1460
- var ut = tn;
1461
- function rn(e, t, r = !0) {
1462
- let n = Y(!0);
1463
- K(n.current || !r ? () => {
1464
- n.current = !1;
1874
+ var kt = Pn;
1875
+ function En(e, t, r = !0) {
1876
+ let a = Y(!0);
1877
+ K(a.current || !r ? () => {
1878
+ a.current = !1;
1465
1879
  } : e, t);
1466
1880
  }
1467
- var J = rn;
1468
- function ce() {
1881
+ var X = En;
1882
+ function de() {
1469
1883
  }
1470
- function ae(e, t, r, n) {
1471
- return nn(e, n) || an(e, t, r, n);
1884
+ function oe(e, t, r, a) {
1885
+ return Ln(e, a) || Tn(e, t, r, a);
1472
1886
  }
1473
- function nn(e, t) {
1474
- return e.editor.getModel(dt(e, t));
1887
+ function Ln(e, t) {
1888
+ return e.editor.getModel($t(e, t));
1475
1889
  }
1476
- function an(e, t, r, n) {
1477
- return e.editor.createModel(t, r, n ? dt(e, n) : void 0);
1890
+ function Tn(e, t, r, a) {
1891
+ return e.editor.createModel(t, r, a ? $t(e, a) : void 0);
1478
1892
  }
1479
- function dt(e, t) {
1893
+ function $t(e, t) {
1480
1894
  return e.Uri.parse(t);
1481
1895
  }
1482
- function on({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: s, originalModelPath: u, modifiedModelPath: y, keepCurrentOriginalModel: $ = !1, keepCurrentModifiedModel: M = !1, theme: j = "light", loading: m = "Loading...", options: S = {}, height: W = "100%", width: P = "100%", className: E, wrapperProps: I = {}, beforeMount: H = ce, onMount: B = ce }) {
1483
- let [z, p] = A(!1), [T, O] = A(!0), b = Y(null), w = Y(null), R = Y(null), L = Y(B), g = Y(H), C = Y(!1);
1484
- ut(() => {
1485
- let i = ct.init();
1486
- return i.then((o) => (w.current = o) && O(!1)).catch((o) => (o == null ? void 0 : o.type) !== "cancelation" && console.error("Monaco initialization: error:", o)), () => b.current ? x() : i.cancel();
1487
- }), J(() => {
1488
- if (b.current && w.current) {
1489
- let i = b.current.getOriginalEditor(), o = ae(w.current, e || "", n || r || "text", u || "");
1490
- o !== i.getModel() && i.setModel(o);
1896
+ function _n({ original: e, modified: t, language: r, originalLanguage: a, modifiedLanguage: o, originalModelPath: l, modifiedModelPath: f, keepCurrentOriginalModel: g = !1, keepCurrentModifiedModel: y = !1, theme: k = "light", loading: p = "Loading...", options: v = {}, height: P = "100%", width: A = "100%", className: H, wrapperProps: T = {}, beforeMount: W = de, onMount: D = de }) {
1897
+ let [R, V] = _(!1), [j, E] = _(!0), b = Y(null), h = Y(null), z = Y(null), M = Y(D), x = Y(W), w = Y(!1);
1898
+ kt(() => {
1899
+ let i = wt.init();
1900
+ return i.then((c) => (h.current = c) && E(!1)).catch((c) => (c == null ? void 0 : c.type) !== "cancelation" && console.error("Monaco initialization: error:", c)), () => b.current ? d() : i.cancel();
1901
+ }), X(() => {
1902
+ if (b.current && h.current) {
1903
+ let i = b.current.getOriginalEditor(), c = oe(h.current, e || "", a || r || "text", l || "");
1904
+ c !== i.getModel() && i.setModel(c);
1491
1905
  }
1492
- }, [u], z), J(() => {
1493
- if (b.current && w.current) {
1494
- let i = b.current.getModifiedEditor(), o = ae(w.current, t || "", s || r || "text", y || "");
1495
- o !== i.getModel() && i.setModel(o);
1906
+ }, [l], R), X(() => {
1907
+ if (b.current && h.current) {
1908
+ let i = b.current.getModifiedEditor(), c = oe(h.current, t || "", o || r || "text", f || "");
1909
+ c !== i.getModel() && i.setModel(c);
1496
1910
  }
1497
- }, [y], z), J(() => {
1911
+ }, [f], R), X(() => {
1498
1912
  let i = b.current.getModifiedEditor();
1499
- i.getOption(w.current.editor.EditorOption.readOnly) ? i.setValue(t || "") : t !== i.getValue() && (i.executeEdits("", [{ range: i.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), i.pushUndoStop());
1500
- }, [t], z), J(() => {
1501
- var i, o;
1502
- (o = (i = b.current) == null ? void 0 : i.getModel()) == null || o.original.setValue(e || "");
1503
- }, [e], z), J(() => {
1504
- let { original: i, modified: o } = b.current.getModel();
1505
- w.current.editor.setModelLanguage(i, n || r || "text"), w.current.editor.setModelLanguage(o, s || r || "text");
1506
- }, [r, n, s], z), J(() => {
1913
+ i.getOption(h.current.editor.EditorOption.readOnly) ? i.setValue(t || "") : t !== i.getValue() && (i.executeEdits("", [{ range: i.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), i.pushUndoStop());
1914
+ }, [t], R), X(() => {
1915
+ var i, c;
1916
+ (c = (i = b.current) == null ? void 0 : i.getModel()) == null || c.original.setValue(e || "");
1917
+ }, [e], R), X(() => {
1918
+ let { original: i, modified: c } = b.current.getModel();
1919
+ h.current.editor.setModelLanguage(i, a || r || "text"), h.current.editor.setModelLanguage(c, o || r || "text");
1920
+ }, [r, a, o], R), X(() => {
1507
1921
  var i;
1508
- (i = w.current) == null || i.editor.setTheme(j);
1509
- }, [j], z), J(() => {
1922
+ (i = h.current) == null || i.editor.setTheme(k);
1923
+ }, [k], R), X(() => {
1510
1924
  var i;
1511
- (i = b.current) == null || i.updateOptions(S);
1512
- }, [S], z);
1513
- let q = je(() => {
1514
- var d;
1515
- if (!w.current) return;
1516
- g.current(w.current);
1517
- let i = ae(w.current, e || "", n || r || "text", u || ""), o = ae(w.current, t || "", s || r || "text", y || "");
1518
- (d = b.current) == null || d.setModel({ original: i, modified: o });
1519
- }, [r, t, s, e, n, u, y]), G = je(() => {
1925
+ (i = b.current) == null || i.updateOptions(v);
1926
+ }, [v], R);
1927
+ let L = xe(() => {
1928
+ var m;
1929
+ if (!h.current) return;
1930
+ x.current(h.current);
1931
+ let i = oe(h.current, e || "", a || r || "text", l || ""), c = oe(h.current, t || "", o || r || "text", f || "");
1932
+ (m = b.current) == null || m.setModel({ original: i, modified: c });
1933
+ }, [r, t, o, e, a, l, f]), F = xe(() => {
1520
1934
  var i;
1521
- !C.current && R.current && (b.current = w.current.editor.createDiffEditor(R.current, { automaticLayout: !0, ...S }), q(), (i = w.current) == null || i.editor.setTheme(j), p(!0), C.current = !0);
1522
- }, [S, j, q]);
1935
+ !w.current && z.current && (b.current = h.current.editor.createDiffEditor(z.current, { automaticLayout: !0, ...v }), L(), (i = h.current) == null || i.editor.setTheme(k), V(!0), w.current = !0);
1936
+ }, [v, k, L]);
1523
1937
  K(() => {
1524
- z && L.current(b.current, w.current);
1525
- }, [z]), K(() => {
1526
- !T && !z && G();
1527
- }, [T, z, G]);
1528
- function x() {
1529
- var o, d, c, v;
1530
- let i = (o = b.current) == null ? void 0 : o.getModel();
1531
- $ || ((d = i == null ? void 0 : i.original) == null || d.dispose()), M || ((c = i == null ? void 0 : i.modified) == null || c.dispose()), (v = b.current) == null || v.dispose();
1938
+ R && M.current(b.current, h.current);
1939
+ }, [R]), K(() => {
1940
+ !j && !R && F();
1941
+ }, [j, R, F]);
1942
+ function d() {
1943
+ var c, m, u, C;
1944
+ let i = (c = b.current) == null ? void 0 : c.getModel();
1945
+ g || ((m = i == null ? void 0 : i.original) == null || m.dispose()), y || ((u = i == null ? void 0 : i.modified) == null || u.dispose()), (C = b.current) == null || C.dispose();
1532
1946
  }
1533
- return ie.createElement(lt, { width: P, height: W, isEditorReady: z, loading: m, _ref: R, className: E, wrapperProps: I });
1947
+ return ce.createElement(Nt, { width: A, height: P, isEditorReady: R, loading: p, _ref: z, className: H, wrapperProps: T });
1534
1948
  }
1535
- var sn = on;
1536
- Te(sn);
1537
- function cn(e) {
1949
+ var Dn = _n;
1950
+ We(Dn);
1951
+ function zn(e) {
1538
1952
  let t = Y();
1539
1953
  return K(() => {
1540
1954
  t.current = e;
1541
1955
  }, [e]), t.current;
1542
1956
  }
1543
- var ln = cn, fe = /* @__PURE__ */ new Map();
1544
- function un({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: s, path: u, theme: y = "light", line: $, loading: M = "Loading...", options: j = {}, overrideServices: m = {}, saveViewState: S = !0, keepCurrentModel: W = !1, width: P = "100%", height: E = "100%", className: I, wrapperProps: H = {}, beforeMount: B = ce, onMount: z = ce, onChange: p, onValidate: T = ce }) {
1545
- let [O, b] = A(!1), [w, R] = A(!0), L = Y(null), g = Y(null), C = Y(null), q = Y(z), G = Y(B), x = Y(), i = Y(n), o = ln(u), d = Y(!1), c = Y(!1);
1546
- ut(() => {
1547
- let f = ct.init();
1548
- return f.then((N) => (L.current = N) && R(!1)).catch((N) => (N == null ? void 0 : N.type) !== "cancelation" && console.error("Monaco initialization: error:", N)), () => g.current ? k() : f.cancel();
1549
- }), J(() => {
1550
- var N, D, h, _;
1551
- let f = ae(L.current, e || n || "", t || s || "", u || r || "");
1552
- f !== ((N = g.current) == null ? void 0 : N.getModel()) && (S && fe.set(o, (D = g.current) == null ? void 0 : D.saveViewState()), (h = g.current) == null || h.setModel(f), S && ((_ = g.current) == null || _.restoreViewState(fe.get(u))));
1553
- }, [u], O), J(() => {
1554
- var f;
1555
- (f = g.current) == null || f.updateOptions(j);
1556
- }, [j], O), J(() => {
1557
- !g.current || n === void 0 || (g.current.getOption(L.current.editor.EditorOption.readOnly) ? g.current.setValue(n) : n !== g.current.getValue() && (c.current = !0, g.current.executeEdits("", [{ range: g.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), g.current.pushUndoStop(), c.current = !1));
1558
- }, [n], O), J(() => {
1559
- var N, D;
1560
- let f = (N = g.current) == null ? void 0 : N.getModel();
1561
- f && s && ((D = L.current) == null || D.editor.setModelLanguage(f, s));
1562
- }, [s], O), J(() => {
1563
- var f;
1564
- $ !== void 0 && ((f = g.current) == null || f.revealLine($));
1565
- }, [$], O), J(() => {
1566
- var f;
1567
- (f = L.current) == null || f.editor.setTheme(y);
1568
- }, [y], O);
1569
- let v = je(() => {
1570
- var f;
1571
- if (!(!C.current || !L.current) && !d.current) {
1572
- G.current(L.current);
1573
- let N = u || r, D = ae(L.current, n || e || "", t || s || "", N || "");
1574
- g.current = (f = L.current) == null ? void 0 : f.editor.create(C.current, { model: D, automaticLayout: !0, ...j }, m), S && g.current.restoreViewState(fe.get(N)), L.current.editor.setTheme(y), $ !== void 0 && g.current.revealLine($), b(!0), d.current = !0;
1957
+ var An = zn, fe = /* @__PURE__ */ new Map();
1958
+ function Hn({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: a, language: o, path: l, theme: f = "light", line: g, loading: y = "Loading...", options: k = {}, overrideServices: p = {}, saveViewState: v = !0, keepCurrentModel: P = !1, width: A = "100%", height: H = "100%", className: T, wrapperProps: W = {}, beforeMount: D = de, onMount: R = de, onChange: V, onValidate: j = de }) {
1959
+ let [E, b] = _(!1), [h, z] = _(!0), M = Y(null), x = Y(null), w = Y(null), L = Y(R), F = Y(D), d = Y(), i = Y(a), c = An(l), m = Y(!1), u = Y(!1);
1960
+ kt(() => {
1961
+ let N = wt.init();
1962
+ return N.then((S) => (M.current = S) && z(!1)).catch((S) => (S == null ? void 0 : S.type) !== "cancelation" && console.error("Monaco initialization: error:", S)), () => x.current ? O() : N.cancel();
1963
+ }), X(() => {
1964
+ var S, I, q, G;
1965
+ let N = oe(M.current, e || a || "", t || o || "", l || r || "");
1966
+ N !== ((S = x.current) == null ? void 0 : S.getModel()) && (v && fe.set(c, (I = x.current) == null ? void 0 : I.saveViewState()), (q = x.current) == null || q.setModel(N), v && ((G = x.current) == null || G.restoreViewState(fe.get(l))));
1967
+ }, [l], E), X(() => {
1968
+ var N;
1969
+ (N = x.current) == null || N.updateOptions(k);
1970
+ }, [k], E), X(() => {
1971
+ !x.current || a === void 0 || (x.current.getOption(M.current.editor.EditorOption.readOnly) ? x.current.setValue(a) : a !== x.current.getValue() && (u.current = !0, x.current.executeEdits("", [{ range: x.current.getModel().getFullModelRange(), text: a, forceMoveMarkers: !0 }]), x.current.pushUndoStop(), u.current = !1));
1972
+ }, [a], E), X(() => {
1973
+ var S, I;
1974
+ let N = (S = x.current) == null ? void 0 : S.getModel();
1975
+ N && o && ((I = M.current) == null || I.editor.setModelLanguage(N, o));
1976
+ }, [o], E), X(() => {
1977
+ var N;
1978
+ g !== void 0 && ((N = x.current) == null || N.revealLine(g));
1979
+ }, [g], E), X(() => {
1980
+ var N;
1981
+ (N = M.current) == null || N.editor.setTheme(f);
1982
+ }, [f], E);
1983
+ let C = xe(() => {
1984
+ var N;
1985
+ if (!(!w.current || !M.current) && !m.current) {
1986
+ F.current(M.current);
1987
+ let S = l || r, I = oe(M.current, a || e || "", t || o || "", S || "");
1988
+ x.current = (N = M.current) == null ? void 0 : N.editor.create(w.current, { model: I, automaticLayout: !0, ...k }, p), v && x.current.restoreViewState(fe.get(S)), M.current.editor.setTheme(f), g !== void 0 && x.current.revealLine(g), b(!0), m.current = !0;
1575
1989
  }
1576
- }, [e, t, r, n, s, u, j, m, S, y, $]);
1990
+ }, [e, t, r, a, o, l, k, p, v, f, g]);
1577
1991
  K(() => {
1578
- O && q.current(g.current, L.current);
1579
- }, [O]), K(() => {
1580
- !w && !O && v();
1581
- }, [w, O, v]), i.current = n, K(() => {
1582
- var f, N;
1583
- O && p && ((f = x.current) == null || f.dispose(), x.current = (N = g.current) == null ? void 0 : N.onDidChangeModelContent((D) => {
1584
- c.current || p(g.current.getValue(), D);
1992
+ E && L.current(x.current, M.current);
1993
+ }, [E]), K(() => {
1994
+ !h && !E && C();
1995
+ }, [h, E, C]), i.current = a, K(() => {
1996
+ var N, S;
1997
+ E && V && ((N = d.current) == null || N.dispose(), d.current = (S = x.current) == null ? void 0 : S.onDidChangeModelContent((I) => {
1998
+ u.current || V(x.current.getValue(), I);
1585
1999
  }));
1586
- }, [O, p]), K(() => {
1587
- if (O) {
1588
- let f = L.current.editor.onDidChangeMarkers((N) => {
1589
- var h;
1590
- let D = (h = g.current.getModel()) == null ? void 0 : h.uri;
1591
- if (D && N.find((_) => _.path === D.path)) {
1592
- let _ = L.current.editor.getModelMarkers({ resource: D });
1593
- T == null || T(_);
2000
+ }, [E, V]), K(() => {
2001
+ if (E) {
2002
+ let N = M.current.editor.onDidChangeMarkers((S) => {
2003
+ var q;
2004
+ let I = (q = x.current.getModel()) == null ? void 0 : q.uri;
2005
+ if (I && S.find((G) => G.path === I.path)) {
2006
+ let G = M.current.editor.getModelMarkers({ resource: I });
2007
+ j == null || j(G);
1594
2008
  }
1595
2009
  });
1596
2010
  return () => {
1597
- f == null || f.dispose();
2011
+ N == null || N.dispose();
1598
2012
  };
1599
2013
  }
1600
2014
  return () => {
1601
2015
  };
1602
- }, [O, T]);
1603
- function k() {
1604
- var f, N;
1605
- (f = x.current) == null || f.dispose(), W ? S && fe.set(u, g.current.saveViewState()) : (N = g.current.getModel()) == null || N.dispose(), g.current.dispose();
2016
+ }, [E, j]);
2017
+ function O() {
2018
+ var N, S;
2019
+ (N = d.current) == null || N.dispose(), P ? v && fe.set(l, x.current.saveViewState()) : (S = x.current.getModel()) == null || S.dispose(), x.current.dispose();
1606
2020
  }
1607
- return ie.createElement(lt, { width: P, height: E, isEditorReady: O, loading: M, _ref: C, className: I, wrapperProps: H });
1608
- }
1609
- var dn = un, hn = Te(dn), fn = hn;
1610
- function ye({ title: e, children: t, placement: r = "top" }) {
1611
- const [n, s] = A(!1);
1612
- return e ? /* @__PURE__ */ l(
2021
+ return ce.createElement(Nt, { width: A, height: H, isEditorReady: E, loading: y, _ref: w, className: T, wrapperProps: W });
2022
+ }
2023
+ var In = Hn, Wn = We(In), Rn = Wn;
2024
+ function ye({ title: e, children: t, placement: r = "top", align: a = "center", variant: o = "default" }) {
2025
+ const [l, f] = _(!1), [g, y] = _(null), k = Y(null), p = Y(null), v = Y(void 0), P = Y(!1), A = Y(null), H = Ie(), T = () => {
2026
+ clearTimeout(v.current), P.current = !1, A.current = null, f(!1), y(null);
2027
+ }, W = () => {
2028
+ clearTimeout(v.current), f(!0);
2029
+ }, D = () => {
2030
+ clearTimeout(v.current), !P.current && (v.current = setTimeout(() => {
2031
+ P.current || T();
2032
+ }, 150));
2033
+ }, R = () => {
2034
+ o === "card" && (P.current = !0, W());
2035
+ }, V = (j) => {
2036
+ var E, b;
2037
+ return j instanceof Node && (((E = k.current) == null ? void 0 : E.contains(j)) || ((b = p.current) == null ? void 0 : b.contains(j)));
2038
+ };
2039
+ return K(() => () => clearTimeout(v.current), []), K(() => {
2040
+ if (!l) return;
2041
+ const j = (b) => {
2042
+ V(b.target) || T();
2043
+ }, E = (b) => {
2044
+ b.key === "Escape" && T();
2045
+ };
2046
+ return document.addEventListener("pointerdown", j), document.addEventListener("keydown", E), () => {
2047
+ document.removeEventListener("pointerdown", j), document.removeEventListener("keydown", E);
2048
+ };
2049
+ }, [l]), Mt(() => {
2050
+ if (!l || !e) return;
2051
+ const j = () => {
2052
+ const b = k.current, h = p.current;
2053
+ if (!b || !h) return;
2054
+ const z = 12, M = 6, x = b.getBoundingClientRect(), w = Math.max(0, x.top - z - M), L = Math.max(0, window.innerHeight - x.bottom - z - M), F = o === "card" ? 420 : 320;
2055
+ if (!A.current) {
2056
+ const m = o === "card" ? F : Math.min(F, h.getBoundingClientRect().height), u = r === "top" ? w >= m || w >= L : !(L >= m || L >= w);
2057
+ A.current = u ? "top" : "bottom";
2058
+ }
2059
+ const d = A.current === "top";
2060
+ h.style.maxHeight = `${Math.min(F, d ? w : L)}px`;
2061
+ const { width: i, height: c } = h.getBoundingClientRect();
2062
+ y({
2063
+ left: Math.max(z, Math.min(
2064
+ a === "end" ? x.right - i : x.left + (x.width - i) / 2,
2065
+ window.innerWidth - i - z
2066
+ )),
2067
+ top: d ? x.top - c - M : x.bottom + M
2068
+ });
2069
+ };
2070
+ j();
2071
+ const E = new ResizeObserver(j);
2072
+ return p.current && E.observe(p.current), window.addEventListener("resize", j), window.addEventListener("scroll", j, !0), () => {
2073
+ E.disconnect(), window.removeEventListener("resize", j), window.removeEventListener("scroll", j, !0);
2074
+ };
2075
+ }, [l, e, r, a, o]), e ? /* @__PURE__ */ s(
1613
2076
  "div",
1614
2077
  {
1615
- className: "relative inline-flex",
1616
- onMouseEnter: () => s(!0),
1617
- onMouseLeave: () => s(!1),
2078
+ ref: k,
2079
+ className: "inline-flex",
2080
+ "aria-describedby": l && o === "default" ? H : void 0,
2081
+ onMouseEnter: W,
2082
+ onMouseLeave: D,
2083
+ onPointerDown: R,
2084
+ onClick: () => {
2085
+ o === "default" && T();
2086
+ },
2087
+ onFocus: W,
2088
+ onBlur: (j) => {
2089
+ V(j.relatedTarget) || (j.relatedTarget ? T() : D());
2090
+ },
1618
2091
  children: [
1619
2092
  t,
1620
- n && /* @__PURE__ */ a(
1621
- "div",
1622
- {
1623
- className: `absolute left-1/2 -translate-x-1/2 z-50 px-2 py-1 bg-gray-800/90 text-white text-xs rounded-md whitespace-nowrap pointer-events-none ${r === "top" ? "bottom-full mb-1.5" : "top-full mt-1.5"}`,
1624
- children: e
1625
- }
2093
+ l && at(
2094
+ /* @__PURE__ */ n(
2095
+ "div",
2096
+ {
2097
+ ref: p,
2098
+ id: H,
2099
+ role: o === "card" ? "dialog" : "tooltip",
2100
+ "aria-label": o === "card" ? "校验问题" : void 0,
2101
+ className: `aisee-articles-tooltip aisee-articles-tooltip--${o}`,
2102
+ style: {
2103
+ width: o === "card" ? 480 : "max-content",
2104
+ maxWidth: "min(480px, calc(100vw - 24px))",
2105
+ overflowWrap: "anywhere",
2106
+ scrollbarWidth: "thin",
2107
+ left: (g == null ? void 0 : g.left) ?? 0,
2108
+ top: (g == null ? void 0 : g.top) ?? 0,
2109
+ visibility: g ? "visible" : "hidden"
2110
+ },
2111
+ onMouseEnter: W,
2112
+ onMouseLeave: D,
2113
+ onPointerDown: R,
2114
+ onFocus: W,
2115
+ children: e
2116
+ }
2117
+ ),
2118
+ document.body
1626
2119
  )
1627
2120
  ]
1628
2121
  }
1629
- ) : /* @__PURE__ */ a(pe, { children: t });
1630
- }
1631
- const Me = [
1632
- { key: "desktop", icon: /* @__PURE__ */ a(et, { size: 13 }), label: "Desktop", width: null },
1633
- { key: "tablet", icon: /* @__PURE__ */ a(rt, { size: 13 }), label: "Tablet", width: 768 },
1634
- { key: "mobile", icon: /* @__PURE__ */ a(tt, { size: 13 }), label: "Mobile", width: 390 }
1635
- ], Nn = ({ id: e, record: t }) => {
1636
- const { navigate: r, params: n, locationState: s } = Ee(), u = e ?? n.id, { basePath: y, service: $, previewBaseUrl: M, previewTailwind: j } = ze(), m = !!u, [S, W] = nt(), [P, E] = A(!1), [I, H] = A(t ?? (s == null ? void 0 : s.record) ?? null), [B, z] = A(""), [p, T] = A(m ? "" : "https://aisee.live"), [O, b] = A(""), [w, R] = A(""), [L, g] = A("code"), [C, q] = A(!1), [G, x] = A("desktop"), [i, o] = A(!1), [d, c] = A(null), v = (h, _) => {
1637
- const Q = M ? `<base href="${M}">` : "", F = _ ? `<meta name="viewport" content="width=${_}, initial-scale=1">` : "", X = _ ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", ee = j && !h.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", V = Q + F + X + ee;
1638
- return V ? h.includes("</head>") ? h.replace("</head>", `${V}
1639
- </head>`) : V + h : h;
1640
- }, k = async () => {
1641
- if (!w.trim()) {
1642
- Z.warning("请先输入 HTML 代码");
2122
+ ) : /* @__PURE__ */ n(ue, { children: t });
2123
+ }
2124
+ const Pe = [
2125
+ { key: "desktop", icon: /* @__PURE__ */ n(dt, { size: 13 }), label: "桌面", width: null },
2126
+ { key: "tablet", icon: /* @__PURE__ */ n(pt, { size: 13 }), label: "平板", width: 768 },
2127
+ { key: "mobile", icon: /* @__PURE__ */ n(mt, { size: 13 }), label: "手机", width: 390 }
2128
+ ], Kn = ({ id: e, record: t }) => {
2129
+ const { navigate: r, params: a, locationState: o } = Ve(), l = e ?? a.id, { basePath: f, service: g, previewBaseUrl: y, previewTailwind: k } = ve(), p = !!l, [v, P] = ft(), [A, H] = _(!1), [T, W] = _(t ?? (o == null ? void 0 : o.record) ?? null), [D, R] = _(""), [V, j] = _(p ? "" : "https://aisee.live"), [E, b] = _(""), [h, z] = _(""), [M, x] = _({
2130
+ navEnabled: !1,
2131
+ navname: "",
2132
+ navPlacements: []
2133
+ }), w = ($) => x({
2134
+ navEnabled: $.navEnabled ?? !1,
2135
+ navname: $.navname ?? "",
2136
+ navPlacements: $.navPlacements ?? []
2137
+ }), [L, F] = _(""), [d, i] = _("code"), [c, m] = _(!1), [u, C] = _("desktop"), [O, N] = _(!1), [S, I] = _(null), q = ($, Z) => {
2138
+ const U = y ? `<base href="${y}">` : "", Q = Z ? `<meta name="viewport" content="width=${Z}, initial-scale=1">` : "", ie = Z ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", Ne = k && !$.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", ke = U + Q + ie + Ne;
2139
+ return ke ? $.includes("</head>") ? $.replace("</head>", `${ke}
2140
+ </head>`) : ke + $ : $;
2141
+ }, G = async () => {
2142
+ if (!L.trim()) {
2143
+ J.warning("请先输入 HTML 代码");
1643
2144
  return;
1644
2145
  }
1645
- o(!0), c(null);
2146
+ N(!0), I(null);
1646
2147
  try {
1647
- const h = await Ve(w);
1648
- c(h), h.networkError ? Z.warning("W3C 校验服务不可用") : h.isValid && Z.success("W3C 校验通过");
2148
+ const $ = await Ke(L);
2149
+ I($), $.networkError ? J.warning("W3C 校验服务不可用") : $.isValid && J.success("HTML 校验通过");
1649
2150
  } finally {
1650
- o(!1);
2151
+ N(!1);
1651
2152
  }
1652
2153
  };
1653
2154
  K(() => {
1654
- m && (I ? (z(I.pathname || ""), T(I.host || ""), R(I.content || "")) : $.getById(u).then((h) => {
1655
- H(h), z(h.pathname || ""), T(h.host || ""), R(h.content || "");
1656
- }).catch((h) => {
1657
- Z.error(h.message || "获取数据失败"), r(y);
2155
+ p && (T ? (R(T.pathname || ""), j(T.host || ""), F(T.content || ""), w(T)) : g.getById(l).then(($) => {
2156
+ W($), R($.pathname || ""), j($.host || ""), F($.content || ""), w($);
2157
+ }).catch(($) => {
2158
+ J.error($.message || "获取文章失败"), r(f);
1658
2159
  }));
1659
- }, [u]);
1660
- const f = () => r(y), N = !B.trim(), D = async () => {
1661
- if (!B.trim()) {
1662
- b("请输入 pathname");
2160
+ }, [l]);
2161
+ const ee = () => r(f), te = !D.trim(), ae = L.split(`
2162
+ `).length, re = async () => {
2163
+ if (A) return;
2164
+ if (!D.trim()) {
2165
+ z("请输入访问路径");
1663
2166
  return;
1664
2167
  }
1665
- if (!w.trim()) {
1666
- q(!0), Z.error("请输入 HTML 代码");
2168
+ if (!L.trim()) {
2169
+ m(!0), J.error("请先输入 HTML 代码");
1667
2170
  return;
1668
2171
  }
1669
- E(!0);
1670
- const h = await Ve(w);
1671
- if (E(!1), h.networkError)
1672
- Z.warning("W3C 校验服务不可用,已跳过校验");
1673
- else if (!h.isValid && !await new Promise((Q) => {
1674
- S.confirm({
1675
- title: "W3C 校验发现问题",
1676
- content: /* @__PURE__ */ l("div", { className: "mt-1", children: [
1677
- /* @__PURE__ */ a("p", { className: "text-gray-600 mb-2", children: "检测到以下 W3C 标准问题,仍要保存吗?" }),
1678
- /* @__PURE__ */ l("ul", { className: "space-y-1", children: [
1679
- h.errors.slice(0, 5).map((F, X) => /* @__PURE__ */ l(
2172
+ const $ = V.trim().replace(/\/+$/, "");
2173
+ try {
2174
+ const U = new URL($);
2175
+ if (!["http:", "https:"].includes(U.protocol) || U.search || U.hash || U.username || U.password) throw new Error();
2176
+ } catch {
2177
+ b("请输入有效的网站地址,需以 http:// 或 https:// 开头");
2178
+ return;
2179
+ }
2180
+ if (g.getNavigationGroups && M.navEnabled) {
2181
+ if (!M.navname.trim()) {
2182
+ J.error("开启导航后,请填写导航名称");
2183
+ return;
2184
+ }
2185
+ if (!M.navPlacements.length) {
2186
+ J.error("请至少选择一个展示位置");
2187
+ return;
2188
+ }
2189
+ }
2190
+ H(!0);
2191
+ const Z = await Ke(L);
2192
+ if (H(!1), Z.networkError)
2193
+ J.warning("W3C 校验服务不可用,已跳过校验");
2194
+ else if (!Z.isValid && !await new Promise((Q) => {
2195
+ v.confirm({
2196
+ title: "HTML 校验发现问题",
2197
+ content: /* @__PURE__ */ s("div", { className: "mt-1", children: [
2198
+ /* @__PURE__ */ n("p", { className: "text-gray-600 mb-2", children: "检测到以下 W3C 标准问题,仍要保存吗?" }),
2199
+ /* @__PURE__ */ s("ul", { className: "space-y-1", children: [
2200
+ Z.errors.slice(0, 5).map((ie, Ne) => /* @__PURE__ */ s(
1680
2201
  "li",
1681
2202
  {
1682
2203
  className: "flex items-start gap-1.5 text-red-500 text-sm",
1683
2204
  children: [
1684
- /* @__PURE__ */ a("span", { className: "shrink-0", children: "✕" }),
1685
- /* @__PURE__ */ l("span", { children: [
1686
- F.lastLine ? `第 ${F.lastLine} 行:` : "",
1687
- F.message
2205
+ /* @__PURE__ */ n("span", { className: "shrink-0", children: "✕" }),
2206
+ /* @__PURE__ */ s("span", { children: [
2207
+ ie.lastLine ? `第 ${ie.lastLine} 行:` : "",
2208
+ ie.message
1688
2209
  ] })
1689
2210
  ]
1690
2211
  },
1691
- X
2212
+ Ne
1692
2213
  )),
1693
- h.errors.length > 5 && /* @__PURE__ */ l("li", { className: "text-gray-400 text-xs mt-1", children: [
1694
- "还有 ",
1695
- h.errors.length - 5,
1696
- " 个问题…"
2214
+ Z.errors.length > 5 && /* @__PURE__ */ s("li", { className: "text-gray-400 text-xs mt-1", children: [
2215
+ "另有 ",
2216
+ Z.errors.length - 5,
2217
+ " 个问题"
1697
2218
  ] })
1698
2219
  ] })
1699
2220
  ] }),
@@ -1704,400 +2225,413 @@ const Me = [
1704
2225
  });
1705
2226
  }))
1706
2227
  return;
1707
- E(!0);
2228
+ H(!0);
1708
2229
  try {
1709
- const _ = {
1710
- pathname: B.trim(),
1711
- content: w,
1712
- host: (p == null ? void 0 : p.trim()) || void 0
2230
+ const U = {
2231
+ pathname: D.trim(),
2232
+ content: L,
2233
+ host: $,
2234
+ ...g.getNavigationGroups ? {
2235
+ navEnabled: M.navEnabled,
2236
+ navname: M.navname.trim() || null,
2237
+ navPlacements: M.navPlacements.map(({ position: Q, parentNavId: ie }) => ({
2238
+ position: Q,
2239
+ parentNavId: ie || null
2240
+ }))
2241
+ } : {}
1713
2242
  };
1714
- m && I ? (await $.update(I.id, _), Z.success("编辑成功")) : (await $.create(_), Z.success("添加成功")), r(y);
1715
- } catch (_) {
1716
- Z.error(_.message || "保存失败");
2243
+ p && T ? (await g.update(T.id, U), J.success("编辑成功")) : (await g.create(U), J.success("新增成功")), r(f);
2244
+ } catch (U) {
2245
+ J.error(U.message || "保存失败");
1717
2246
  } finally {
1718
- E(!1);
2247
+ H(!1);
1719
2248
  }
1720
2249
  };
1721
- return /* @__PURE__ */ l(pe, { children: [
1722
- W,
1723
- /* @__PURE__ */ l(
2250
+ return /* @__PURE__ */ s(ue, { children: [
2251
+ P,
2252
+ /* @__PURE__ */ s(
1724
2253
  "div",
1725
2254
  {
1726
2255
  className: "w-full bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden flex flex-col",
1727
2256
  style: { height: "calc(100vh - 90px)" },
1728
2257
  children: [
1729
- /* @__PURE__ */ l("div", { className: "shrink-0 flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-gray-50/60", children: [
1730
- /* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
1731
- /* @__PURE__ */ a(
2258
+ /* @__PURE__ */ s("div", { className: "shrink-0 flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-gray-50/60", children: [
2259
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
2260
+ /* @__PURE__ */ n(
1732
2261
  "button",
1733
2262
  {
2263
+ "aria-label": "返回文章列表",
1734
2264
  className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-200 transition -ml-1 cursor-pointer",
1735
- onClick: f,
1736
- children: /* @__PURE__ */ a(Qe, { size: 15 })
2265
+ onClick: ee,
2266
+ children: /* @__PURE__ */ n(ot, { size: 15 })
1737
2267
  }
1738
2268
  ),
1739
- /* @__PURE__ */ l("div", { children: [
1740
- /* @__PURE__ */ a("div", { className: "text-base font-semibold text-gray-800 leading-tight", children: m ? "编辑 Article" : "新增 Article" }),
1741
- m && I && /* @__PURE__ */ l("div", { className: "text-xs text-gray-400 mt-0.5 font-mono", children: [
2269
+ /* @__PURE__ */ s("div", { children: [
2270
+ /* @__PURE__ */ n("div", { className: "text-base font-semibold text-gray-800 leading-tight", children: p ? "编辑文章" : "新增文章" }),
2271
+ p && T && /* @__PURE__ */ s("div", { className: "text-xs text-gray-400 mt-0.5 font-mono", children: [
1742
2272
  "/",
1743
- I.pathname
2273
+ T.pathname
1744
2274
  ] })
1745
2275
  ] })
1746
2276
  ] }),
1747
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
1748
- /* @__PURE__ */ a(
2277
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
2278
+ /* @__PURE__ */ n(
1749
2279
  "button",
1750
2280
  {
1751
2281
  className: "px-4 py-1.5 border border-gray-200 rounded-lg text-sm text-gray-600 hover:bg-gray-50 transition cursor-pointer",
1752
- onClick: f,
2282
+ onClick: ee,
1753
2283
  children: "取消"
1754
2284
  }
1755
2285
  ),
1756
- /* @__PURE__ */ a(
2286
+ /* @__PURE__ */ n(
1757
2287
  "button",
1758
2288
  {
1759
- disabled: N || P,
2289
+ disabled: te || A,
1760
2290
  className: "px-4 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",
1761
- onClick: D,
1762
- children: P ? "保存中…" : "保存"
2291
+ onClick: re,
2292
+ children: A ? "保存中…" : "保存"
1763
2293
  }
1764
2294
  )
1765
2295
  ] })
1766
2296
  ] }),
1767
- /* @__PURE__ */ a("div", { className: "shrink-0 px-6 pt-5 pb-4 border-b border-gray-100", children: /* @__PURE__ */ l("div", { className: "flex gap-4", children: [
1768
- /* @__PURE__ */ l("div", { className: "flex-1", children: [
1769
- /* @__PURE__ */ l("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
1770
- "Pathname",
1771
- /* @__PURE__ */ a("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "前台网站路径" })
1772
- ] }),
1773
- /* @__PURE__ */ l(
1774
- "div",
1775
- {
1776
- className: `flex items-center border rounded-lg transition focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-400 ${O ? "border-red-400 ring-2 ring-red-500/20" : "border-gray-200"}`,
1777
- children: [
1778
- /* @__PURE__ */ a("span", { className: "pl-3 text-gray-400 select-none text-sm shrink-0", children: "/" }),
1779
- /* @__PURE__ */ a(
1780
- "input",
1781
- {
1782
- className: "flex-1 pr-3 py-1.5 text-sm bg-transparent focus:outline-none",
1783
- placeholder: "例如 about-us",
1784
- value: B,
1785
- onChange: (h) => {
1786
- z(h.target.value), O && b("");
1787
- }
2297
+ /* @__PURE__ */ s("div", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children: [
2298
+ /* @__PURE__ */ s("div", { className: "shrink-0 px-6 pt-5 pb-4 border-b border-gray-100", children: [
2299
+ /* @__PURE__ */ s("div", { className: "flex flex-col gap-4 sm:flex-row", children: [
2300
+ /* @__PURE__ */ s("div", { className: "flex-1", children: [
2301
+ /* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
2302
+ "访问路径",
2303
+ /* @__PURE__ */ n("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "前台页面路径" })
2304
+ ] }),
2305
+ /* @__PURE__ */ s(
2306
+ "div",
2307
+ {
2308
+ className: `flex items-center border rounded-lg transition focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-400 ${h ? "border-red-400 ring-2 ring-red-500/20" : "border-gray-200"}`,
2309
+ children: [
2310
+ /* @__PURE__ */ n("span", { className: "pl-3 text-gray-400 select-none text-sm shrink-0", children: "/" }),
2311
+ /* @__PURE__ */ n(
2312
+ "input",
2313
+ {
2314
+ className: "flex-1 pr-3 py-1.5 text-sm bg-transparent focus:outline-none",
2315
+ placeholder: "例如 about-us",
2316
+ value: D,
2317
+ onChange: ($) => {
2318
+ R($.target.value), h && z("");
2319
+ }
2320
+ }
2321
+ )
2322
+ ]
2323
+ }
2324
+ ),
2325
+ /* @__PURE__ */ n("p", { className: "text-xs text-gray-500 mt-1.5", children: "建议使用小写字母,不能包含空格,例如 about-us。" }),
2326
+ h && /* @__PURE__ */ n("p", { className: "text-red-500 text-xs mt-1", children: h })
2327
+ ] }),
2328
+ /* @__PURE__ */ s("div", { className: "flex-1", children: [
2329
+ /* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
2330
+ "网站地址",
2331
+ /* @__PURE__ */ n("span", { className: "text-red-500 ml-1", children: "*" }),
2332
+ /* @__PURE__ */ n("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "网站基础地址" })
2333
+ ] }),
2334
+ /* @__PURE__ */ n(
2335
+ "input",
2336
+ {
2337
+ className: "w-full px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
2338
+ placeholder: "例如 https://aisee.live",
2339
+ value: V,
2340
+ "aria-label": "网站地址",
2341
+ "aria-invalid": !!E,
2342
+ onChange: ($) => {
2343
+ const Z = $.target.value;
2344
+ Z.trim().replace(/\/+$/, "") !== V.trim().replace(/\/+$/, "") && x((U) => ({
2345
+ ...U,
2346
+ navPlacements: U.navPlacements.map((Q) => ({ ...Q, parentNavId: null }))
2347
+ })), j(Z), b("");
1788
2348
  }
1789
- )
1790
- ]
1791
- }
1792
- ),
1793
- O && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-1", children: O })
1794
- ] }),
1795
- /* @__PURE__ */ l("div", { className: "flex-1", children: [
1796
- /* @__PURE__ */ l("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
1797
- "Website URL",
1798
- /* @__PURE__ */ a("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "可跳转的网站地址" })
2349
+ }
2350
+ ),
2351
+ E && /* @__PURE__ */ n("p", { role: "alert", className: "mt-1 text-xs text-red-500", children: E })
2352
+ ] })
1799
2353
  ] }),
1800
- /* @__PURE__ */ a(
1801
- "input",
2354
+ /* @__PURE__ */ n(
2355
+ Or,
1802
2356
  {
1803
- className: "w-full px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
1804
- placeholder: "例如 https://aisee.live",
1805
- value: p,
1806
- onChange: (h) => T(h.target.value)
2357
+ host: V,
2358
+ service: g,
2359
+ value: M,
2360
+ onChange: x
1807
2361
  }
1808
2362
  )
1809
- ] })
1810
- ] }) }),
1811
- /* @__PURE__ */ a("div", { className: "shrink-0 border-b border-gray-100 bg-gray-50/40", children: /* @__PURE__ */ l("div", { className: "flex items-center justify-between px-6 py-2", children: [
1812
- /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ l("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: [
1813
- /* @__PURE__ */ l(
1814
- "button",
1815
- {
1816
- className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${L === "code" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
1817
- onClick: () => g("code"),
1818
- children: [
1819
- /* @__PURE__ */ a(Xe, { size: 11 }),
1820
- " Code"
1821
- ]
1822
- }
1823
- ),
1824
- /* @__PURE__ */ l(
2363
+ ] }),
2364
+ /* @__PURE__ */ n("div", { className: "shrink-0 border-b border-gray-100 bg-gray-50/40", children: /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-2 px-6 py-2", children: [
2365
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ s("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: [
2366
+ /* @__PURE__ */ s(
2367
+ "button",
2368
+ {
2369
+ className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${d === "code" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2370
+ onClick: () => i("code"),
2371
+ children: [
2372
+ /* @__PURE__ */ n(Ye, { size: 11 }),
2373
+ " 代码"
2374
+ ]
2375
+ }
2376
+ ),
2377
+ /* @__PURE__ */ s(
2378
+ "button",
2379
+ {
2380
+ className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none ${d === "preview" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50 cursor-pointer" : L ? "text-gray-400 hover:text-gray-600 hover:bg-white/50 cursor-pointer" : "text-gray-300 cursor-not-allowed"}`,
2381
+ onClick: () => i("preview"),
2382
+ disabled: !L,
2383
+ children: [
2384
+ /* @__PURE__ */ n(_e, { size: 11 }),
2385
+ " 预览"
2386
+ ]
2387
+ }
2388
+ )
2389
+ ] }) }),
2390
+ d === "preview" && L && /* @__PURE__ */ n("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Pe.map(($) => /* @__PURE__ */ n(ye, { title: $.label, children: /* @__PURE__ */ n(
1825
2391
  "button",
1826
2392
  {
1827
- className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none ${L === "preview" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50 cursor-pointer" : w ? "text-gray-400 hover:text-gray-600 hover:bg-white/50 cursor-pointer" : "text-gray-300 cursor-not-allowed"}`,
1828
- onClick: () => g("preview"),
1829
- disabled: !w,
1830
- children: [
1831
- /* @__PURE__ */ a(Pe, { size: 11 }),
1832
- " 预览"
1833
- ]
2393
+ className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${u === $.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2394
+ onClick: () => C($.key),
2395
+ children: $.icon
1834
2396
  }
1835
- )
1836
- ] }) }),
1837
- L === "preview" && w && /* @__PURE__ */ a("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Me.map((h) => /* @__PURE__ */ a(ye, { title: h.label, children: /* @__PURE__ */ a(
1838
- "button",
1839
- {
1840
- className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${G === h.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
1841
- onClick: () => x(h.key),
1842
- children: h.icon
1843
- }
1844
- ) }, h.key)) }),
1845
- L === "code" && /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
1846
- w && /* @__PURE__ */ l("span", { className: "text-xs text-gray-400", children: [
1847
- w.split(`
1848
- `).length,
1849
- " 行 ·",
1850
- " ",
1851
- w.length,
1852
- " 字符"
1853
- ] }),
1854
- d && !d.networkError && (d.isValid ? /* @__PURE__ */ l("span", { className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-50 border border-green-200 text-green-600 text-xs", children: [
1855
- /* @__PURE__ */ a(We, { size: 11 }),
1856
- " 校验通过"
1857
- ] }) : /* @__PURE__ */ a(
1858
- ye,
1859
- {
1860
- title: /* @__PURE__ */ l("ul", { className: "m-0 pl-0 list-none space-y-1 max-w-xs", children: [
1861
- d.errors.slice(0, 5).map(
1862
- (h, _) => /* @__PURE__ */ l(
1863
- "li",
1864
- {
1865
- className: "text-xs",
1866
- children: [
1867
- h.lastLine ? `第 ${h.lastLine} 行:` : "",
1868
- h.message
1869
- ]
1870
- },
1871
- _
1872
- )
1873
- ),
1874
- d.errors.length > 5 && /* @__PURE__ */ l("li", { className: "text-gray-400 text-xs", children: [
1875
- "还有",
1876
- " ",
1877
- d.errors.length - 5,
2397
+ ) }, $.key)) }),
2398
+ d === "code" && /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
2399
+ L && /* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
2400
+ ae,
2401
+ " 行 · ",
2402
+ L.length,
2403
+ " 字符"
2404
+ ] }),
2405
+ S && !S.networkError && (S.isValid ? /* @__PURE__ */ s("span", { className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-50 border border-green-200 text-green-600 text-xs", children: [
2406
+ /* @__PURE__ */ n(Ge, { size: 11 }),
2407
+ " 校验通过"
2408
+ ] }) : /* @__PURE__ */ n(
2409
+ ye,
2410
+ {
2411
+ variant: "card",
2412
+ align: "end",
2413
+ title: /* @__PURE__ */ n(Er, { errors: S.errors, source: L }),
2414
+ children: /* @__PURE__ */ s("span", { tabIndex: 0, className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-50 border border-red-200 text-red-500 text-xs cursor-default", children: [
2415
+ "✕",
1878
2416
  " ",
1879
- "个问题…"
2417
+ S.errors.length,
2418
+ " 个问题"
1880
2419
  ] })
1881
- ] }),
1882
- children: /* @__PURE__ */ l("span", { className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-50 border border-red-200 text-red-500 text-xs cursor-default", children: [
1883
- "✕",
1884
- " ",
1885
- d.errors.length,
1886
- " ",
1887
- "个问题"
1888
- ] })
1889
- }
1890
- )),
1891
- /* @__PURE__ */ l(
1892
- "button",
2420
+ }
2421
+ )),
2422
+ /* @__PURE__ */ s(
2423
+ "button",
2424
+ {
2425
+ disabled: !L || O,
2426
+ className: "flex items-center gap-1.5 px-2.5 py-1 text-xs border border-gray-200 rounded-lg hover:bg-gray-50 text-gray-600 transition disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer",
2427
+ onClick: G,
2428
+ children: [
2429
+ /* @__PURE__ */ n(Ge, { size: 12 }),
2430
+ O ? "校验中…" : "W3C 校验"
2431
+ ]
2432
+ }
2433
+ )
2434
+ ] })
2435
+ ] }) }),
2436
+ /* @__PURE__ */ s("div", { className: "relative min-h-[320px] flex-1 shrink-0", children: [
2437
+ /* @__PURE__ */ n(
2438
+ "div",
1893
2439
  {
1894
- disabled: !w || i,
1895
- className: "flex items-center gap-1.5 px-2.5 py-1 text-xs border border-gray-200 rounded-lg hover:bg-gray-50 text-gray-600 transition disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer",
1896
- onClick: k,
1897
- children: [
1898
- /* @__PURE__ */ a(We, { size: 12 }),
1899
- i ? "校验中…" : "W3C 校验"
1900
- ]
2440
+ className: "absolute inset-0",
2441
+ style: {
2442
+ display: d === "code" ? "block" : "none",
2443
+ outline: c ? "2px solid #ff4d4f" : "none"
2444
+ },
2445
+ children: /* @__PURE__ */ n(
2446
+ Rn,
2447
+ {
2448
+ height: "100%",
2449
+ language: "html",
2450
+ theme: "vs-dark",
2451
+ value: L,
2452
+ onChange: ($) => {
2453
+ F($ ?? ""), c && m(!1), S && I(null);
2454
+ },
2455
+ options: {
2456
+ fontSize: 13,
2457
+ minimap: { enabled: !1 },
2458
+ wordWrap: "on",
2459
+ scrollBeyondLastLine: !1,
2460
+ automaticLayout: !0,
2461
+ tabSize: 2,
2462
+ formatOnPaste: !0,
2463
+ lineNumbers: "on",
2464
+ renderWhitespace: "none",
2465
+ smoothScrolling: !0,
2466
+ cursorBlinking: "smooth",
2467
+ padding: { top: 12, bottom: 12 }
2468
+ }
2469
+ }
2470
+ )
1901
2471
  }
1902
- )
1903
- ] })
1904
- ] }) }),
1905
- /* @__PURE__ */ l("div", { className: "flex-1 min-h-0 relative", children: [
1906
- /* @__PURE__ */ a(
1907
- "div",
1908
- {
1909
- className: "absolute inset-0",
1910
- style: {
1911
- display: L === "code" ? "block" : "none",
1912
- outline: C ? "2px solid #ff4d4f" : "none"
1913
- },
1914
- children: /* @__PURE__ */ a(
1915
- fn,
1916
- {
2472
+ ),
2473
+ d === "preview" && (L ? /* @__PURE__ */ n("div", { className: "absolute inset-0 overflow-auto bg-gray-100/60 flex justify-center", children: u !== "desktop" ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ n(
2474
+ "iframe",
2475
+ {
2476
+ srcDoc: q(
2477
+ L,
2478
+ Pe.find(
2479
+ ($) => $.key === u
2480
+ ).width
2481
+ ),
2482
+ sandbox: "allow-same-origin allow-scripts",
2483
+ title: "HTML 预览",
2484
+ style: {
2485
+ width: `${Pe.find(
2486
+ ($) => $.key === u
2487
+ ).width}px`,
1917
2488
  height: "100%",
1918
- language: "html",
1919
- theme: "vs-dark",
1920
- value: w,
1921
- onChange: (h) => {
1922
- R(h ?? ""), C && q(!1), d && c(null);
1923
- },
1924
- options: {
1925
- fontSize: 13,
1926
- minimap: { enabled: !1 },
1927
- wordWrap: "on",
1928
- scrollBeyondLastLine: !1,
1929
- automaticLayout: !0,
1930
- tabSize: 2,
1931
- formatOnPaste: !0,
1932
- lineNumbers: "on",
1933
- renderWhitespace: "none",
1934
- smoothScrolling: !0,
1935
- cursorBlinking: "smooth",
1936
- padding: { top: 12, bottom: 12 }
1937
- }
2489
+ minHeight: 0,
2490
+ border: "1px solid #e5e7eb",
2491
+ borderRadius: 10,
2492
+ background: "#fff",
2493
+ boxShadow: "0 4px 24px 0 rgba(0,0,0,0.10)",
2494
+ flexShrink: 0
1938
2495
  }
1939
- )
1940
- }
1941
- ),
1942
- L === "preview" && (w ? /* @__PURE__ */ a("div", { className: "absolute inset-0 overflow-auto bg-gray-100/60 flex justify-center", children: G !== "desktop" ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ a(
1943
- "iframe",
1944
- {
1945
- srcDoc: v(
1946
- w,
1947
- Me.find(
1948
- (h) => h.key === G
1949
- ).width
1950
- ),
1951
- sandbox: "allow-same-origin allow-scripts",
1952
- title: "HTML 预览",
1953
- style: {
1954
- width: `${Me.find(
1955
- (h) => h.key === G
1956
- ).width}px`,
1957
- height: "100%",
1958
- minHeight: 0,
1959
- border: "1px solid #e5e7eb",
1960
- borderRadius: 10,
1961
- background: "#fff",
1962
- boxShadow: "0 4px 24px 0 rgba(0,0,0,0.10)",
1963
- flexShrink: 0
1964
2496
  }
1965
- }
1966
- ) }) : /* @__PURE__ */ a(
1967
- "iframe",
1968
- {
1969
- srcDoc: v(
1970
- w
1971
- ),
1972
- sandbox: "allow-same-origin allow-scripts",
1973
- title: "HTML 预览",
1974
- style: {
1975
- width: "100%",
1976
- height: "100%",
1977
- border: "none",
1978
- background: "#fff",
1979
- display: "block"
2497
+ ) }) : /* @__PURE__ */ n(
2498
+ "iframe",
2499
+ {
2500
+ srcDoc: q(
2501
+ L
2502
+ ),
2503
+ sandbox: "allow-same-origin allow-scripts",
2504
+ title: "HTML 预览",
2505
+ style: {
2506
+ width: "100%",
2507
+ height: "100%",
2508
+ border: "none",
2509
+ background: "#fff",
2510
+ display: "block"
2511
+ }
1980
2512
  }
1981
- }
1982
- ) }) : /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center h-full text-gray-300 gap-3 select-none", children: [
1983
- /* @__PURE__ */ a(Pe, { size: 36 }),
1984
- /* @__PURE__ */ a("span", { className: "text-sm", children: "请先输入 HTML 代码" })
1985
- ] }))
2513
+ ) }) : /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center h-full text-gray-300 gap-3 select-none", children: [
2514
+ /* @__PURE__ */ n(_e, { size: 36 }),
2515
+ /* @__PURE__ */ n("span", { className: "text-sm", children: "请先输入 HTML 代码以预览" })
2516
+ ] }))
2517
+ ] })
1986
2518
  ] })
1987
2519
  ]
1988
2520
  }
1989
2521
  )
1990
2522
  ] });
1991
- }, Ce = [
1992
- { key: "desktop", icon: /* @__PURE__ */ a(et, { size: 13 }), label: "Desktop", width: null },
1993
- { key: "tablet", icon: /* @__PURE__ */ a(rt, { size: 13 }), label: "Tablet", width: 768 },
1994
- { key: "mobile", icon: /* @__PURE__ */ a(tt, { size: 13 }), label: "Mobile", width: 390 }
1995
- ], kn = ({
2523
+ }, Ee = [
2524
+ { key: "desktop", icon: /* @__PURE__ */ n(dt, { size: 13 }), label: "Desktop", width: null },
2525
+ { key: "tablet", icon: /* @__PURE__ */ n(pt, { size: 13 }), label: "Tablet", width: 768 },
2526
+ { key: "mobile", icon: /* @__PURE__ */ n(mt, { size: 13 }), label: "Mobile", width: 390 }
2527
+ ], Jn = ({
1996
2528
  id: e,
1997
2529
  record: t
1998
2530
  }) => {
1999
- const { navigate: r, params: n, locationState: s } = Ee(), u = e ?? n.id, { basePath: y, service: $, previewBaseUrl: M, previewTailwind: j } = ze(), [m, S] = A(
2000
- t ?? (s == null ? void 0 : s.record) ?? null
2001
- ), [W, P] = A(!1), [E, I] = A("preview"), [H, B] = A("desktop");
2531
+ const { navigate: r, params: a, locationState: o } = Ve(), l = e ?? a.id, { basePath: f, service: g, previewBaseUrl: y, previewTailwind: k } = ve(), [p, v] = _(
2532
+ t ?? (o == null ? void 0 : o.record) ?? null
2533
+ ), [P, A] = _(!1), [H, T] = _("preview"), [W, D] = _("desktop");
2002
2534
  K(() => {
2003
- !m && u && (P(!0), $.getById(u).then(S).catch((b) => {
2004
- Z.error(b.message || "获取数据失败"), r(y);
2005
- }).finally(() => P(!1)));
2006
- }, [u]);
2007
- const z = () => r(y), p = () => r(`${y}/${u}/edit`, { state: { record: m } }), T = () => {
2008
- m != null && m.content && (navigator.clipboard.writeText(m.content), Z.success("已复制到剪贴板"));
2009
- }, O = (b, w) => {
2010
- const R = M ? `<base href="${M}">` : "", L = w ? `<meta name="viewport" content="width=${w}, initial-scale=1">` : "", g = w ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", C = j && !b.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", q = R + L + g + C;
2011
- return q ? b.includes("</head>") ? b.replace("</head>", `${q}
2012
- </head>`) : q + b : b;
2535
+ !p && l && (A(!0), g.getById(l).then(v).catch((b) => {
2536
+ J.error(b.message || "获取数据失败"), r(f);
2537
+ }).finally(() => A(!1)));
2538
+ }, [l]);
2539
+ const R = () => r(f), V = () => r(`${f}/${l}/edit`, { state: { record: p } }), j = () => {
2540
+ p != null && p.content && (navigator.clipboard.writeText(p.content), J.success("已复制到剪贴板"));
2541
+ }, E = (b, h) => {
2542
+ const z = y ? `<base href="${y}">` : "", M = h ? `<meta name="viewport" content="width=${h}, initial-scale=1">` : "", x = h ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", w = k && !b.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", L = z + M + x + w;
2543
+ return L ? b.includes("</head>") ? b.replace("</head>", `${L}
2544
+ </head>`) : L + b : b;
2013
2545
  };
2014
- return W ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center h-64 text-gray-400 text-sm", children: "加载中…" }) : /* @__PURE__ */ l(
2546
+ return P ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center h-64 text-gray-400 text-sm", children: "加载中…" }) : /* @__PURE__ */ s(
2015
2547
  "div",
2016
2548
  {
2017
2549
  className: "w-full bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden flex flex-col",
2018
2550
  style: { height: "calc(100vh - 90px)" },
2019
2551
  children: [
2020
- /* @__PURE__ */ l("div", { className: "flex items-center justify-between px-5 py-3.5 border-b border-gray-100 bg-white shrink-0", children: [
2021
- /* @__PURE__ */ l("div", { className: "flex items-center gap-3 min-w-0", children: [
2022
- /* @__PURE__ */ a(
2552
+ /* @__PURE__ */ s("div", { className: "flex items-center justify-between px-5 py-3.5 border-b border-gray-100 bg-white shrink-0", children: [
2553
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-3 min-w-0", children: [
2554
+ /* @__PURE__ */ n(
2023
2555
  "button",
2024
2556
  {
2025
2557
  className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100 transition -ml-1 shrink-0 cursor-pointer",
2026
- onClick: z,
2027
- children: /* @__PURE__ */ a(Qe, { size: 15 })
2558
+ onClick: R,
2559
+ children: /* @__PURE__ */ n(ot, { size: 15 })
2028
2560
  }
2029
2561
  ),
2030
- /* @__PURE__ */ a(
2562
+ /* @__PURE__ */ n(
2031
2563
  "div",
2032
2564
  {
2033
2565
  className: "flex items-center justify-center w-8 h-8 rounded-lg shrink-0",
2034
2566
  style: {
2035
2567
  background: "linear-gradient(135deg, #60a5fa, #818cf8)"
2036
2568
  },
2037
- children: /* @__PURE__ */ a(Et, { size: 13, className: "text-white" })
2569
+ children: /* @__PURE__ */ n(rr, { size: 13, className: "text-white" })
2038
2570
  }
2039
2571
  ),
2040
- /* @__PURE__ */ l("div", { className: "min-w-0", children: [
2041
- /* @__PURE__ */ a("div", { className: "font-semibold text-gray-800 text-sm leading-tight", children: "Article 详情" }),
2042
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1 mt-0.5", children: /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1 px-1.5 py-0 rounded bg-blue-50 border border-blue-100 text-blue-600 font-mono text-xs leading-5 truncate max-w-[300px]", children: [
2043
- /* @__PURE__ */ a(Wt, { size: 9 }),
2572
+ /* @__PURE__ */ s("div", { className: "min-w-0", children: [
2573
+ /* @__PURE__ */ n("div", { className: "font-semibold text-gray-800 text-sm leading-tight", children: "Article 详情" }),
2574
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-1 mt-0.5", children: /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1 px-1.5 py-0 rounded bg-blue-50 border border-blue-100 text-blue-600 font-mono text-xs leading-5 truncate max-w-[300px]", children: [
2575
+ /* @__PURE__ */ n(or, { size: 9 }),
2044
2576
  "/",
2045
- m == null ? void 0 : m.pathname
2577
+ p == null ? void 0 : p.pathname
2046
2578
  ] }) })
2047
2579
  ] })
2048
2580
  ] }),
2049
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2 shrink-0", children: [
2050
- E === "preview" && /* @__PURE__ */ a("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Ce.map((b) => /* @__PURE__ */ a(ye, { title: b.label, children: /* @__PURE__ */ a(
2581
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2 shrink-0", children: [
2582
+ H === "preview" && /* @__PURE__ */ n("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Ee.map((b) => /* @__PURE__ */ n(ye, { title: b.label, children: /* @__PURE__ */ n(
2051
2583
  "button",
2052
2584
  {
2053
- className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${H === b.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2054
- onClick: () => B(b.key),
2585
+ className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${W === b.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2586
+ onClick: () => D(b.key),
2055
2587
  children: b.icon
2056
2588
  }
2057
2589
  ) }, b.key)) }),
2058
- /* @__PURE__ */ a("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: ["preview", "code"].map((b) => /* @__PURE__ */ a(
2590
+ /* @__PURE__ */ n("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: ["preview", "code"].map((b) => /* @__PURE__ */ n(
2059
2591
  "button",
2060
2592
  {
2061
- className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${E === b ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2062
- onClick: () => I(b),
2063
- children: b === "preview" ? /* @__PURE__ */ l(pe, { children: [
2064
- /* @__PURE__ */ a(Pe, { size: 11 }),
2593
+ className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${H === b ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2594
+ onClick: () => T(b),
2595
+ children: b === "preview" ? /* @__PURE__ */ s(ue, { children: [
2596
+ /* @__PURE__ */ n(_e, { size: 11 }),
2065
2597
  " 预览"
2066
- ] }) : /* @__PURE__ */ l(pe, { children: [
2067
- /* @__PURE__ */ a(Xe, { size: 11 }),
2598
+ ] }) : /* @__PURE__ */ s(ue, { children: [
2599
+ /* @__PURE__ */ n(Ye, { size: 11 }),
2068
2600
  " Code"
2069
2601
  ] })
2070
2602
  },
2071
2603
  b
2072
2604
  )) }),
2073
- E === "code" && /* @__PURE__ */ a(ye, { title: "复制代码", children: /* @__PURE__ */ a(
2605
+ H === "code" && /* @__PURE__ */ n(ye, { title: "复制代码", children: /* @__PURE__ */ n(
2074
2606
  "button",
2075
2607
  {
2608
+ type: "button",
2609
+ "aria-label": "复制代码",
2076
2610
  className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-blue-500 hover:bg-blue-50 transition cursor-pointer",
2077
- onClick: T,
2078
- children: /* @__PURE__ */ a(Dt, { size: 14 })
2611
+ onClick: j,
2612
+ children: /* @__PURE__ */ n(Jt, { size: 14 })
2079
2613
  }
2080
2614
  ) })
2081
2615
  ] })
2082
2616
  ] }),
2083
- /* @__PURE__ */ a(
2617
+ /* @__PURE__ */ n(
2084
2618
  "div",
2085
2619
  {
2086
- className: `flex-1 min-h-0 ${E === "preview" ? "bg-gray-100/70" : ""}`,
2087
- children: E === "preview" ? /* @__PURE__ */ a("div", { className: "w-full h-full flex justify-center overflow-auto py-0", children: H !== "desktop" ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ a(
2620
+ className: `flex-1 min-h-0 ${H === "preview" ? "bg-gray-100/70" : ""}`,
2621
+ children: H === "preview" ? /* @__PURE__ */ n("div", { className: "w-full h-full flex justify-center overflow-auto py-0", children: W !== "desktop" ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ n(
2088
2622
  "iframe",
2089
2623
  {
2090
- srcDoc: O(
2091
- (m == null ? void 0 : m.content) || "",
2092
- Ce.find(
2093
- (b) => b.key === H
2624
+ srcDoc: E(
2625
+ (p == null ? void 0 : p.content) || "",
2626
+ Ee.find(
2627
+ (b) => b.key === W
2094
2628
  ).width
2095
2629
  ),
2096
2630
  sandbox: "allow-same-origin allow-scripts",
2097
2631
  title: "HTML 预览",
2098
2632
  style: {
2099
- width: `${Ce.find(
2100
- (b) => b.key === H
2633
+ width: `${Ee.find(
2634
+ (b) => b.key === W
2101
2635
  ).width}px`,
2102
2636
  height: "100%",
2103
2637
  minHeight: 0,
@@ -2108,11 +2642,11 @@ const Me = [
2108
2642
  flexShrink: 0
2109
2643
  }
2110
2644
  }
2111
- ) }) : /* @__PURE__ */ a(
2645
+ ) }) : /* @__PURE__ */ n(
2112
2646
  "iframe",
2113
2647
  {
2114
- srcDoc: O(
2115
- (m == null ? void 0 : m.content) || ""
2648
+ srcDoc: E(
2649
+ (p == null ? void 0 : p.content) || ""
2116
2650
  ),
2117
2651
  sandbox: "allow-same-origin allow-scripts",
2118
2652
  title: "HTML 预览",
@@ -2124,13 +2658,13 @@ const Me = [
2124
2658
  display: "block"
2125
2659
  }
2126
2660
  }
2127
- ) }) : /* @__PURE__ */ l(
2661
+ ) }) : /* @__PURE__ */ s(
2128
2662
  "div",
2129
2663
  {
2130
2664
  className: "h-full flex flex-col",
2131
2665
  style: { background: "#1e1e2e" },
2132
2666
  children: [
2133
- /* @__PURE__ */ l(
2667
+ /* @__PURE__ */ s(
2134
2668
  "div",
2135
2669
  {
2136
2670
  className: "shrink-0 flex items-center justify-between px-4 py-2 border-b",
@@ -2139,13 +2673,13 @@ const Me = [
2139
2673
  background: "#252536"
2140
2674
  },
2141
2675
  children: [
2142
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
2143
- /* @__PURE__ */ l("div", { className: "flex gap-1.5", children: [
2144
- /* @__PURE__ */ a("span", { className: "w-3 h-3 rounded-full bg-red-400/80 inline-block" }),
2145
- /* @__PURE__ */ a("span", { className: "w-3 h-3 rounded-full bg-yellow-400/80 inline-block" }),
2146
- /* @__PURE__ */ a("span", { className: "w-3 h-3 rounded-full bg-green-400/80 inline-block" })
2676
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
2677
+ /* @__PURE__ */ s("div", { className: "flex gap-1.5", children: [
2678
+ /* @__PURE__ */ n("span", { className: "w-3 h-3 rounded-full bg-red-400/80 inline-block" }),
2679
+ /* @__PURE__ */ n("span", { className: "w-3 h-3 rounded-full bg-yellow-400/80 inline-block" }),
2680
+ /* @__PURE__ */ n("span", { className: "w-3 h-3 rounded-full bg-green-400/80 inline-block" })
2147
2681
  ] }),
2148
- /* @__PURE__ */ a(
2682
+ /* @__PURE__ */ n(
2149
2683
  "span",
2150
2684
  {
2151
2685
  className: "text-xs font-mono ml-2",
@@ -2154,24 +2688,24 @@ const Me = [
2154
2688
  }
2155
2689
  )
2156
2690
  ] }),
2157
- /* @__PURE__ */ a(
2691
+ /* @__PURE__ */ n(
2158
2692
  "span",
2159
2693
  {
2160
2694
  className: "text-xs font-mono",
2161
2695
  style: { color: "#6c7086" },
2162
- children: m != null && m.content ? `${m.content.split(`
2163
- `).length} 行 · ${m.content.length} 字符` : "空"
2696
+ children: p != null && p.content ? `${p.content.split(`
2697
+ `).length} 行 · ${p.content.length} 字符` : "空"
2164
2698
  }
2165
2699
  )
2166
2700
  ]
2167
2701
  }
2168
2702
  ),
2169
- /* @__PURE__ */ a("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ a(
2703
+ /* @__PURE__ */ n("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ n(
2170
2704
  "pre",
2171
2705
  {
2172
2706
  className: "m-0 p-5 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed",
2173
2707
  style: { color: "#cdd6f4" },
2174
- children: (m == null ? void 0 : m.content) || /* @__PURE__ */ a("span", { style: { color: "#585b70" }, children: "// 暂无内容" })
2708
+ children: (p == null ? void 0 : p.content) || /* @__PURE__ */ n("span", { style: { color: "#585b70" }, children: "// 暂无内容" })
2175
2709
  }
2176
2710
  ) })
2177
2711
  ]
@@ -2179,26 +2713,26 @@ const Me = [
2179
2713
  )
2180
2714
  }
2181
2715
  ),
2182
- /* @__PURE__ */ l("div", { className: "shrink-0 flex items-center justify-between px-5 py-2.5 border-t border-gray-100 bg-gray-50/60", children: [
2183
- /* @__PURE__ */ l("div", { className: "flex items-center gap-4 text-xs text-gray-400", children: [
2184
- (m == null ? void 0 : m.createdAt) && /* @__PURE__ */ l("span", { children: [
2716
+ /* @__PURE__ */ s("div", { className: "shrink-0 flex items-center justify-between px-5 py-2.5 border-t border-gray-100 bg-gray-50/60", children: [
2717
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-4 text-xs text-gray-400", children: [
2718
+ (p == null ? void 0 : p.createdAt) && /* @__PURE__ */ s("span", { children: [
2185
2719
  "创建于",
2186
2720
  " ",
2187
- De(m.createdAt).format("YYYY/MM/DD HH:mm")
2721
+ De(p.createdAt).format("YYYY/MM/DD HH:mm")
2188
2722
  ] }),
2189
- (m == null ? void 0 : m.updatedAt) && /* @__PURE__ */ l("span", { children: [
2723
+ (p == null ? void 0 : p.updatedAt) && /* @__PURE__ */ s("span", { children: [
2190
2724
  "更新于",
2191
2725
  " ",
2192
- De(m.updatedAt).format("YYYY/MM/DD HH:mm")
2726
+ De(p.updatedAt).format("YYYY/MM/DD HH:mm")
2193
2727
  ] })
2194
2728
  ] }),
2195
- /* @__PURE__ */ l(
2729
+ /* @__PURE__ */ s(
2196
2730
  "button",
2197
2731
  {
2198
2732
  className: "flex items-center gap-1.5 px-3 py-1.5 text-xs border border-gray-200 rounded-lg hover:bg-gray-50 text-gray-600 transition cursor-pointer",
2199
- onClick: p,
2733
+ onClick: V,
2200
2734
  children: [
2201
- /* @__PURE__ */ a(qt, { size: 12 }),
2735
+ /* @__PURE__ */ n(hr, { size: 12 }),
2202
2736
  "编辑"
2203
2737
  ]
2204
2738
  }
@@ -2209,12 +2743,13 @@ const Me = [
2209
2743
  );
2210
2744
  };
2211
2745
  export {
2212
- kn as ArticleDetail,
2213
- Nn as ArticleEdit,
2214
- wn as ArticleList,
2215
- xn as ArticlesProvider,
2216
- vn as ReactRouterAdapter,
2217
- Cn as createArticleService,
2218
- ht as defaultArticleService,
2219
- Sn as renderArticleByPathname
2746
+ Jn as ArticleDetail,
2747
+ Kn as ArticleEdit,
2748
+ Zn as ArticleList,
2749
+ ea as ArticleServiceError,
2750
+ Un as ArticlesProvider,
2751
+ Gn as ReactRouterAdapter,
2752
+ ta as createArticleService,
2753
+ Ct as defaultArticleService,
2754
+ ra as renderArticleByPathname
2220
2755
  };