@wsxjs/wsx-press 0.0.22 → 0.0.24

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/client.js CHANGED
@@ -1,107 +1,107 @@
1
- import { autoRegister as se, LightComponent as X, jsx as w } from "@wsxjs/wsx-core";
2
- import { c as ae } from "./index-RqS0LFTH.js";
1
+ import { autoRegister as oe, LightComponent as X, jsx as x } from "@wsxjs/wsx-core";
2
+ import { c as ne } from "./index-RqS0LFTH.js";
3
3
  import "@wsxjs/wsx-marked-components";
4
- import { RouterUtils as re } from "@wsxjs/wsx-router";
5
- import { DocumentLoadError as ie } from "./index.js";
4
+ import { RouterUtils as ie } from "@wsxjs/wsx-router";
5
+ import { DocumentLoadError as te } from "./index.js";
6
6
  import le from "fuse.js";
7
- const ue = ".wsx-doc-page{display:flex;flex-direction:column;min-height:100%}.doc-page{flex:1;padding:var(--doc-page-padding-y, 1rem) var(--doc-page-padding-x, 2rem);max-width:1200px;margin:0 auto;width:100%}.doc-loading,.doc-empty{text-align:center;padding:3rem;color:var(--wsx-press-text-secondary, #666)}.doc-error{padding:2rem;background:var(--wsx-press-error-bg, #fee);border:1px solid var(--wsx-press-error-border, #fcc);border-radius:4px;color:var(--wsx-press-error-text, #c33)}.doc-error h2{margin-top:0;color:var(--wsx-press-error-title, #a00)}.doc-header{margin-bottom:2rem;padding-bottom:1rem;border-bottom:1px solid var(--wsx-press-border, #ddd)}.doc-title{margin:0 0 .5rem;font-size:2rem;font-weight:600;color:var(--wsx-press-text-primary, #333)}.doc-description{margin:0;color:var(--wsx-press-text-secondary, #666);font-size:1.1rem}.doc-content{line-height:1.6}";
7
+ const de = ".wsx-doc-page{display:flex;flex-direction:column;min-height:100%}.doc-page{flex:1;padding:var(--doc-page-padding-y, 1rem) var(--doc-page-padding-x, 2rem);max-width:1200px;margin:0 auto;width:100%}.doc-loading,.doc-empty{text-align:center;padding:3rem;color:var(--wsx-press-text-secondary, #666)}.doc-error{padding:2rem;background:var(--wsx-press-error-bg, #fee);border:1px solid var(--wsx-press-error-border, #fcc);border-radius:4px;color:var(--wsx-press-error-text, #c33)}.doc-error h2{margin-top:0;color:var(--wsx-press-error-title, #a00)}.doc-header{margin-bottom:2rem;padding-bottom:1rem;border-bottom:1px solid var(--wsx-press-border, #ddd)}.doc-title{margin:0 0 .5rem;font-size:2rem;font-weight:600;color:var(--wsx-press-text-primary, #333)}.doc-description{margin:0;color:var(--wsx-press-text-secondary, #666);font-size:1.1rem}.doc-content{line-height:1.6}";
8
8
  var we;
9
9
  let Ce, Se;
10
- function G(t, e, r) {
11
- return (e = De(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
10
+ function J(t, e, r) {
11
+ return (e = ke(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
12
12
  }
13
- function Ue(t, e, r, s, d, I) {
14
- function g(i, c, u) {
15
- return function(n, a) {
16
- return u && u(n), i[c].call(n, a);
13
+ function Ue(t, e, r, n, u, C) {
14
+ function g(i, c, d) {
15
+ return function(o, a) {
16
+ return d && d(o), i[c].call(o, a);
17
17
  };
18
18
  }
19
- function x(i, c) {
20
- for (var u = 0; u < i.length; u++) i[u].call(c);
19
+ function w(i, c) {
20
+ for (var d = 0; d < i.length; d++) i[d].call(c);
21
21
  return c;
22
22
  }
23
- function v(i, c, u, n) {
24
- if (typeof i != "function" && (n || i !== void 0)) throw new TypeError(c + " must " + (u || "be") + " a function" + (n ? "" : " or undefined"));
23
+ function y(i, c, d, o) {
24
+ if (typeof i != "function" && (o || i !== void 0)) throw new TypeError(c + " must " + (d || "be") + " a function" + (o ? "" : " or undefined"));
25
25
  return i;
26
26
  }
27
- function M(i, c, u, n, a, L, k, T, z, C, y, m, p) {
28
- function S(l) {
27
+ function N(i, c, d, o, a, L, $, O, z, S, v, m, p) {
28
+ function k(l) {
29
29
  if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
30
30
  }
31
- var h, D = c[0], E = c[3], j = !T;
32
- if (!j) {
33
- u || Array.isArray(D) || (D = [D]);
34
- var o = {}, _ = [], b = a === 3 ? "get" : a === 4 || m ? "set" : "value";
35
- C ? (y || m ? o = { get: de(function() {
31
+ var h, D = c[0], E = c[3], T = !O;
32
+ if (!T) {
33
+ d || Array.isArray(D) || (D = [D]);
34
+ var s = {}, _ = [], b = a === 3 ? "get" : a === 4 || m ? "set" : "value";
35
+ S ? (v || m ? s = { get: ue(function() {
36
36
  return E(this);
37
- }, n, "get"), set: function(l) {
37
+ }, o, "get"), set: function(l) {
38
38
  c[4](this, l);
39
- } } : o[b] = E, y || de(o[b], n, a === 2 ? "" : b)) : y || (o = Object.getOwnPropertyDescriptor(i, n));
39
+ } } : s[b] = E, v || ue(s[b], o, a === 2 ? "" : b)) : v || (s = Object.getOwnPropertyDescriptor(i, o));
40
40
  }
41
- for (var f = i, q = D.length - 1; q >= 0; q -= u ? 2 : 1) {
42
- var H = D[q], K = u ? D[q - 1] : void 0, B = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: n, metadata: L, addInitializer: (function(l, O) {
41
+ for (var f = i, q = D.length - 1; q >= 0; q -= d ? 2 : 1) {
42
+ var H = D[q], K = d ? D[q - 1] : void 0, W = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: o, metadata: L, addInitializer: (function(l, I) {
43
43
  if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
44
- v(O, "An initializer", "be", !0), k.push(O);
45
- }).bind(null, B) };
44
+ y(I, "An initializer", "be", !0), $.push(I);
45
+ }).bind(null, W) };
46
46
  try {
47
- if (j) (h = v(H.call(K, f, R), "class decorators", "return")) && (f = h);
47
+ if (T) (h = y(H.call(K, f, R), "class decorators", "return")) && (f = h);
48
48
  else {
49
49
  var A, F;
50
- R.static = z, R.private = C, C ? a === 2 ? A = function(l) {
51
- return S(l), o.value;
52
- } : (a < 4 && (A = g(o, "get", S)), a !== 3 && (F = g(o, "set", S))) : (A = function(l) {
53
- return l[n];
54
- }, (a < 2 || a === 4) && (F = function(l, O) {
55
- l[n] = O;
50
+ R.static = z, R.private = S, S ? a === 2 ? A = function(l) {
51
+ return k(l), s.value;
52
+ } : (a < 4 && (A = g(s, "get", k)), a !== 3 && (F = g(s, "set", k))) : (A = function(l) {
53
+ return l[o];
54
+ }, (a < 2 || a === 4) && (F = function(l, I) {
55
+ l[o] = I;
56
56
  }));
57
- var W = R.access = { has: C ? p.bind() : function(l) {
58
- return n in l;
57
+ var B = R.access = { has: S ? p.bind() : function(l) {
58
+ return o in l;
59
59
  } };
60
- if (A && (W.get = A), F && (W.set = F), f = H.call(K, m ? { get: o.get, set: o.set } : o[b], R), m) {
61
- if (typeof f == "object" && f) (h = v(f.get, "accessor.get")) && (o.get = h), (h = v(f.set, "accessor.set")) && (o.set = h), (h = v(f.init, "accessor.init")) && _.push(h);
60
+ if (A && (B.get = A), F && (B.set = F), f = H.call(K, m ? { get: s.get, set: s.set } : s[b], R), m) {
61
+ if (typeof f == "object" && f) (h = y(f.get, "accessor.get")) && (s.get = h), (h = y(f.set, "accessor.set")) && (s.set = h), (h = y(f.init, "accessor.init")) && _.push(h);
62
62
  else if (f !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
63
- } else v(f, (y ? "field" : "method") + " decorators", "return") && (y ? _.push(f) : o[b] = f);
63
+ } else y(f, (v ? "field" : "method") + " decorators", "return") && (v ? _.push(f) : s[b] = f);
64
64
  }
65
65
  } finally {
66
- B.v = !0;
66
+ W.v = !0;
67
67
  }
68
68
  }
69
- return (y || m) && T.push(function(l, O) {
70
- for (var N = _.length - 1; N >= 0; N--) O = _[N].call(l, O);
71
- return O;
72
- }), y || j || (C ? m ? T.push(g(o, "get"), g(o, "set")) : T.push(a === 2 ? o[b] : g.call.bind(o[b])) : Object.defineProperty(i, n, o)), f;
69
+ return (v || m) && O.push(function(l, I) {
70
+ for (var M = _.length - 1; M >= 0; M--) I = _[M].call(l, I);
71
+ return I;
72
+ }), v || T || (S ? m ? O.push(g(s, "get"), g(s, "set")) : O.push(a === 2 ? s[b] : g.call.bind(s[b])) : Object.defineProperty(i, o, s)), f;
73
73
  }
74
- function $(i, c) {
74
+ function j(i, c) {
75
75
  return Object.defineProperty(i, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: c });
76
76
  }
77
- if (arguments.length >= 6) var U = I[Symbol.metadata || Symbol.for("Symbol.metadata")];
78
- var P = Object.create(U ?? null), Z = function(i, c, u, n) {
79
- var a, L, k = [], T = function(b) {
77
+ if (arguments.length >= 6) var U = C[Symbol.metadata || Symbol.for("Symbol.metadata")];
78
+ var P = Object.create(U ?? null), Z = function(i, c, d, o) {
79
+ var a, L, $ = [], O = function(b) {
80
80
  return Ke(b) === i;
81
81
  }, z = /* @__PURE__ */ new Map();
82
- function C(b) {
83
- b && k.push(x.bind(null, b));
82
+ function S(b) {
83
+ b && $.push(w.bind(null, b));
84
84
  }
85
- for (var y = 0; y < c.length; y++) {
86
- var m = c[y];
85
+ for (var v = 0; v < c.length; v++) {
86
+ var m = c[v];
87
87
  if (Array.isArray(m)) {
88
- var p = m[1], S = m[2], h = m.length > 3, D = 16 & p, E = !!(8 & p), j = (p &= 7) == 0, o = S + "/" + E;
89
- if (!j && !h) {
90
- var _ = z.get(o);
91
- if (_ === !0 || _ === 3 && p !== 4 || _ === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + S);
92
- z.set(o, !(p > 2) || p);
88
+ var p = m[1], k = m[2], h = m.length > 3, D = 16 & p, E = !!(8 & p), T = (p &= 7) == 0, s = k + "/" + E;
89
+ if (!T && !h) {
90
+ var _ = z.get(s);
91
+ if (_ === !0 || _ === 3 && p !== 4 || _ === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + k);
92
+ z.set(s, !(p > 2) || p);
93
93
  }
94
- M(E ? i : i.prototype, m, D, h ? "#" + S : De(S), p, n, E ? L = L || [] : a = a || [], k, E, h, j, p === 1, E && h ? T : u);
94
+ N(E ? i : i.prototype, m, D, h ? "#" + k : ke(k), p, o, E ? L = L || [] : a = a || [], $, E, h, T, p === 1, E && h ? O : d);
95
95
  }
96
96
  }
97
- return C(a), C(L), k;
98
- }(t, e, d, P);
99
- return r.length || $(t, P), { e: Z, get c() {
97
+ return S(a), S(L), $;
98
+ }(t, e, u, P);
99
+ return r.length || j(t, P), { e: Z, get c() {
100
100
  var i = [];
101
- return r.length && [$(M(t, [r], s, t.name, 5, P, i), P), x.bind(null, i, t)];
101
+ return r.length && [j(N(t, [r], n, t.name, 5, P, i), P), w.bind(null, i, t)];
102
102
  } };
103
103
  }
104
- function De(t) {
104
+ function ke(t) {
105
105
  var e = He(t, "string");
106
106
  return typeof e == "symbol" ? e : e + "";
107
107
  }
@@ -109,13 +109,13 @@ function He(t, e) {
109
109
  if (typeof t != "object" || !t) return t;
110
110
  var r = t[Symbol.toPrimitive];
111
111
  if (r !== void 0) {
112
- var s = r.call(t, e);
113
- if (typeof s != "object") return s;
112
+ var n = r.call(t, e);
113
+ if (typeof n != "object") return n;
114
114
  throw new TypeError("@@toPrimitive must return a primitive value.");
115
115
  }
116
116
  return String(t);
117
117
  }
118
- function de(t, e, r) {
118
+ function ue(t, e, r) {
119
119
  typeof e == "symbol" && (e = (e = e.description) ? "[" + e + "]" : "");
120
120
  try {
121
121
  Object.defineProperty(t, "name", { configurable: !0, value: r ? r + " " + e : e });
@@ -127,60 +127,60 @@ function Ke(t) {
127
127
  if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
128
128
  return t;
129
129
  }
130
- const J = ae("DocPage"), Y = {
130
+ const Y = ne("DocPage"), G = {
131
131
  data: null,
132
132
  promise: null
133
133
  };
134
- async function Ee(t, e = {}, r = 1e4) {
134
+ async function De(t, e = {}, r = 1e4) {
135
135
  var g;
136
- const s = new AbortController(), d = setTimeout(() => s.abort(), r);
137
- let I;
136
+ const n = new AbortController(), u = setTimeout(() => n.abort(), r);
137
+ let C;
138
138
  if (e.signal) {
139
- const x = new AbortController();
140
- e.signal.aborted ? x.abort() : e.signal.addEventListener("abort", () => {
141
- x.abort();
142
- }), s.signal.addEventListener("abort", () => {
143
- x.abort();
144
- }), I = x.signal;
139
+ const w = new AbortController();
140
+ e.signal.aborted ? w.abort() : e.signal.addEventListener("abort", () => {
141
+ w.abort();
142
+ }), n.signal.addEventListener("abort", () => {
143
+ w.abort();
144
+ }), C = w.signal;
145
145
  } else
146
- I = s.signal;
146
+ C = n.signal;
147
147
  try {
148
- const x = await fetch(t, {
148
+ const w = await fetch(t, {
149
149
  ...e,
150
- signal: I
150
+ signal: C
151
151
  });
152
- return clearTimeout(d), x;
153
- } catch (x) {
154
- if (clearTimeout(d), x instanceof Error && x.name === "AbortError") {
155
- const v = s.signal.aborted;
156
- throw ((g = e.signal) == null ? void 0 : g.aborted) ? new Error("Request was cancelled") : v ? new Error(`Request timeout after ${r}ms`) : new Error("Request was aborted");
152
+ return clearTimeout(u), w;
153
+ } catch (w) {
154
+ if (clearTimeout(u), w instanceof Error && w.name === "AbortError") {
155
+ const y = n.signal.aborted;
156
+ throw ((g = e.signal) == null ? void 0 : g.aborted) ? new Error("Request was cancelled") : y ? new Error(`Request timeout after ${r}ms`) : new Error("Request was aborted");
157
157
  }
158
- throw x;
158
+ throw w;
159
159
  }
160
160
  }
161
- async function Be() {
162
- return Y.data ? Y.data : (Y.promise || (Y.promise = (async () => {
161
+ async function We() {
162
+ return G.data ? G.data : (G.promise || (G.promise = (async () => {
163
163
  try {
164
- const t = await Ee("/.wsx-press/docs-meta.json", {}, 5e3);
164
+ const t = await De("/.wsx-press/docs-meta.json", {}, 5e3);
165
165
  if (!t.ok)
166
166
  throw new Error(`Failed to load metadata: ${t.statusText}`);
167
167
  const e = await t.json();
168
- return Y.data = e, Y.promise = null, e;
168
+ return G.data = e, G.promise = null, e;
169
169
  } catch (t) {
170
- throw Y.promise = null, t;
170
+ throw G.promise = null, t;
171
171
  }
172
- })()), Y.promise);
172
+ })()), G.promise);
173
173
  }
174
- Se = [se({
174
+ Se = [oe({
175
175
  tagName: "wsx-doc-page"
176
176
  })];
177
- let We;
177
+ let Be;
178
178
  class Ye extends X {
179
179
  constructor() {
180
180
  super({
181
- styles: ue,
181
+ styles: de,
182
182
  styleName: "wsx-doc-page"
183
- }), G(this, "_autoStyles", ue), G(this, "loadingState", void 0), G(this, "markdown", void 0), G(this, "metadata", void 0), G(this, "error", void 0), G(this, "currentLoadingPath", null), G(this, "routeChangeUnsubscribe", null), G(this, "loadingAbortController", null), G(this, "isLoading", !1), G(this, "visibilityChangeHandler", null), J.debug("DocPage initialized");
183
+ }), J(this, "_autoStyles", de), J(this, "loadingState", void 0), J(this, "markdown", void 0), J(this, "metadata", void 0), J(this, "error", void 0), J(this, "currentLoadingPath", null), J(this, "routeChangeUnsubscribe", null), J(this, "loadingAbortController", null), J(this, "isLoading", !1), J(this, "visibilityChangeHandler", null), Y.debug("DocPage initialized");
184
184
  const [e, r] = this.useState("loadingState", "idle");
185
185
  Object.defineProperty(this, "loadingState", {
186
186
  get: e,
@@ -188,34 +188,34 @@ class Ye extends X {
188
188
  enumerable: !0,
189
189
  configurable: !0
190
190
  });
191
- const [s, d] = this.useState("markdown", "");
191
+ const [n, u] = this.useState("markdown", "");
192
192
  Object.defineProperty(this, "markdown", {
193
- get: s,
194
- set: d,
193
+ get: n,
194
+ set: u,
195
195
  enumerable: !0,
196
196
  configurable: !0
197
197
  });
198
- const [I, g] = this.useState("metadata", null);
198
+ const [C, g] = this.useState("metadata", null);
199
199
  Object.defineProperty(this, "metadata", {
200
- get: I,
200
+ get: C,
201
201
  set: g,
202
202
  enumerable: !0,
203
203
  configurable: !0
204
204
  });
205
- const [x, v] = this.useState("error", null);
205
+ const [w, y] = this.useState("error", null);
206
206
  Object.defineProperty(this, "error", {
207
- get: x,
208
- set: v,
207
+ get: w,
208
+ set: y,
209
209
  enumerable: !0,
210
210
  configurable: !0
211
211
  });
212
212
  }
213
213
  onConnected() {
214
214
  var e;
215
- (e = super.onConnected) == null || e.call(this), this.routeChangeUnsubscribe = re.onRouteChange(() => {
215
+ (e = super.onConnected) == null || e.call(this), this.routeChangeUnsubscribe = ie.onRouteChange(() => {
216
216
  this.cancelLoading(), this.loadDocument();
217
217
  }), this.visibilityChangeHandler = () => {
218
- document.hidden ? this.cancelLoading() : this.loadingState === "loading" && this.currentLoadingPath && (J.debug("Tab became visible, reloading document"), this.loadDocument());
218
+ document.hidden ? this.cancelLoading() : this.loadingState === "loading" && this.currentLoadingPath && (Y.debug("Tab became visible, reloading document"), this.loadDocument());
219
219
  }, document.addEventListener("visibilitychange", this.visibilityChangeHandler), requestAnimationFrame(() => {
220
220
  requestAnimationFrame(() => {
221
221
  this.loadDocument();
@@ -232,14 +232,14 @@ class Ye extends X {
232
232
  cancelLoading() {
233
233
  this.loadingAbortController && (this.loadingAbortController.abort(), this.loadingAbortController = null), this.isLoading = !1, this.loadingState === "loading" && (this.loadingState = "idle"), this.currentLoadingPath = null;
234
234
  }
235
- onAttributeChanged(e, r, s) {
235
+ onAttributeChanged(e, r, n) {
236
236
  e === "params" && this.loadDocument();
237
237
  }
238
238
  /**
239
239
  * 创建带超时的 fetch 请求(实例方法)
240
240
  */
241
- async fetchWithTimeout(e, r = {}, s = 1e4) {
242
- return Ee(e, r, s);
241
+ async fetchWithTimeout(e, r = {}, n = 1e4) {
242
+ return De(e, r, n);
243
243
  }
244
244
  /**
245
245
  * 从 RouterUtils 获取当前路由参数并加载文档
@@ -248,65 +248,78 @@ class Ye extends X {
248
248
  this.cancelLoading();
249
249
  try {
250
250
  this.loadingAbortController = new AbortController();
251
- const e = re.getCurrentRoute(), r = e.params;
252
- if (!r.category || !r.page) {
253
- if (J.warn("Missing route parameters:", {
254
- params: r,
255
- routeInfo: e
256
- }), Object.keys(r).length === 0) {
257
- J.debug("Route params not yet initialized, keeping idle state"), this.loadingState = "idle";
251
+ const e = ie.getCurrentRoute();
252
+ let r;
253
+ if (e.path.startsWith("/docs/"))
254
+ r = e.path.slice(6);
255
+ else {
256
+ const y = e.params;
257
+ if (y.category && y.page)
258
+ r = `${y.category}/${y.page}`;
259
+ else {
260
+ if (Y.warn("Invalid document path:", {
261
+ path: e.path,
262
+ params: y
263
+ }), Object.keys(y).length === 0) {
264
+ Y.debug("Route params not yet initialized, keeping idle state"), this.loadingState = "idle";
265
+ return;
266
+ }
267
+ this.loadingState = "error", this.error = new te("Invalid document path: path must start with /docs/", "INVALID_PARAMS");
258
268
  return;
259
269
  }
260
- this.loadingState = "error", this.error = new ie("Missing route parameters: category and page are required", "INVALID_PARAMS");
270
+ }
271
+ if (!r || r.trim() === "") {
272
+ Y.warn("Empty document path:", {
273
+ path: e.path
274
+ }), this.loadingState = "error", this.error = new te("Document path is empty", "INVALID_PARAMS");
261
275
  return;
262
276
  }
263
- const s = `${r.category}/${r.page}`;
264
- this.currentLoadingPath = s, this.isLoading = !0, this.loadingState = "loading", this.markdown = "", this.error = null, this.metadata = null;
265
- const d = await Be();
266
- if (this.currentLoadingPath !== s || this.loadingAbortController.signal.aborted) {
267
- J.debug(`Document switched after metadata, ignoring result for ${s}`), this.isLoading = !1, this.loadingState = "idle";
277
+ this.currentLoadingPath = r, this.isLoading = !0, this.loadingState = "loading", this.markdown = "", this.error = null, this.metadata = null;
278
+ const n = await We();
279
+ if (this.currentLoadingPath !== r || this.loadingAbortController.signal.aborted) {
280
+ Y.debug(`Document switched after metadata, ignoring result for ${r}`), this.isLoading = !1, this.loadingState = "idle";
268
281
  return;
269
282
  }
270
- const I = d[s];
271
- if (!I) {
272
- if (this.currentLoadingPath !== s || this.loadingAbortController.signal.aborted) {
283
+ const u = n[r];
284
+ if (!u) {
285
+ if (this.currentLoadingPath !== r || this.loadingAbortController.signal.aborted) {
273
286
  this.isLoading = !1, this.loadingState = "idle";
274
287
  return;
275
288
  }
276
- this.loadingState = "error", this.error = new ie(`Document not found: ${s}`, "NOT_FOUND"), this.isLoading = !1;
289
+ this.loadingState = "error", this.error = new te(`Document not found: ${r}`, "NOT_FOUND"), this.isLoading = !1;
277
290
  return;
278
291
  }
279
- this.metadata = I;
280
- const g = `/docs/${s}.md`, x = await this.fetchWithTimeout(g, {
292
+ this.metadata = u;
293
+ const C = `/docs/${r}.md`, g = await this.fetchWithTimeout(C, {
281
294
  signal: this.loadingAbortController.signal
282
295
  }, 1e4);
283
- if (this.currentLoadingPath !== s || this.loadingAbortController.signal.aborted) {
284
- J.debug(`Document switched during fetch, ignoring result for ${s}`), this.isLoading = !1, this.loadingState = "idle";
296
+ if (this.currentLoadingPath !== r || this.loadingAbortController.signal.aborted) {
297
+ Y.debug(`Document switched during fetch, ignoring result for ${r}`), this.isLoading = !1, this.loadingState = "idle";
285
298
  return;
286
299
  }
287
- if (!x.ok) {
288
- x.status === 404 ? (this.loadingState = "error", this.error = new ie(`Document file not found: ${g}`, "NOT_FOUND")) : (this.loadingState = "error", this.error = new ie(`Failed to load document: ${x.statusText}`, "NETWORK_ERROR", {
289
- status: x.status
300
+ if (!g.ok) {
301
+ g.status === 404 ? (this.loadingState = "error", this.error = new te(`Document file not found: ${C}`, "NOT_FOUND")) : (this.loadingState = "error", this.error = new te(`Failed to load document: ${g.statusText}`, "NETWORK_ERROR", {
302
+ status: g.status
290
303
  })), this.isLoading = !1;
291
304
  return;
292
305
  }
293
- const v = await x.text();
294
- if (this.currentLoadingPath !== s || this.loadingAbortController.signal.aborted) {
295
- J.debug(`Document switched after fetch, ignoring result for ${s}`), this.isLoading = !1, this.loadingState = "idle";
306
+ const w = await g.text();
307
+ if (this.currentLoadingPath !== r || this.loadingAbortController.signal.aborted) {
308
+ Y.debug(`Document switched after fetch, ignoring result for ${r}`), this.isLoading = !1, this.loadingState = "idle";
296
309
  return;
297
310
  }
298
- this.markdown = v, this.loadingState = "success", this.isLoading = !1, requestAnimationFrame(() => {
311
+ this.markdown = w, this.loadingState = "success", this.isLoading = !1, requestAnimationFrame(() => {
299
312
  requestAnimationFrame(() => {
300
313
  this.connected && this.scheduleRerender();
301
314
  });
302
315
  });
303
316
  } catch (e) {
304
317
  if (this.isLoading = !1, e instanceof Error && e.name === "AbortError") {
305
- J.debug("Document loading was cancelled"), this.currentLoadingPath && (this.loadingState = "idle", this.currentLoadingPath = null);
318
+ Y.debug("Document loading was cancelled"), this.currentLoadingPath && (this.loadingState = "idle", this.currentLoadingPath = null);
306
319
  return;
307
320
  }
308
321
  if (!this.currentLoadingPath) {
309
- this.loadingState = "error", this.error = new ie(`Failed to load document: ${e instanceof Error ? e.message : String(e)}`, "NETWORK_ERROR", e), J.error("Failed to load document (no current path):", e);
322
+ this.loadingState = "error", this.error = new te(`Failed to load document: ${e instanceof Error ? e.message : String(e)}`, "NETWORK_ERROR", e), Y.error("Failed to load document (no current path):", e);
310
323
  return;
311
324
  }
312
325
  const r = this.currentLoadingPath;
@@ -314,7 +327,7 @@ class Ye extends X {
314
327
  this.loadingState = "idle";
315
328
  return;
316
329
  }
317
- this.loadingState = "error", this.error = new ie(`Failed to load document: ${e instanceof Error ? e.message : String(e)}`, "NETWORK_ERROR", e), J.error("Failed to load document", e), requestAnimationFrame(() => {
330
+ this.loadingState = "error", this.error = new te(`Failed to load document: ${e instanceof Error ? e.message : String(e)}`, "NETWORK_ERROR", e), Y.error("Failed to load document", e), requestAnimationFrame(() => {
318
331
  requestAnimationFrame(() => {
319
332
  this.connected && this.scheduleRerender();
320
333
  });
@@ -323,110 +336,110 @@ class Ye extends X {
323
336
  }
324
337
  render() {
325
338
  var e, r;
326
- return this.loadingState === "loading" ? /* @__PURE__ */ w("div", { class: "doc-page" }, /* @__PURE__ */ w("div", { class: "doc-loading" }, "加载文档中...")) : this.loadingState === "error" ? /* @__PURE__ */ w("div", { class: "doc-page" }, /* @__PURE__ */ w("div", { class: "doc-error" }, /* @__PURE__ */ w("h2", null, "加载失败"), /* @__PURE__ */ w("p", null, ((e = this.error) == null ? void 0 : e.message) || "未知错误"), ((r = this.error) == null ? void 0 : r.code) === "NOT_FOUND" && /* @__PURE__ */ w("p", null, "文档不存在,请检查路径是否正确。"))) : this.loadingState === "success" && this.markdown ? /* @__PURE__ */ w("div", { class: "doc-page" }, this.metadata && /* @__PURE__ */ w("div", { class: "doc-header" }, /* @__PURE__ */ w("h1", { class: "doc-title" }, this.metadata.title), this.metadata.description && /* @__PURE__ */ w("p", { class: "doc-description" }, this.metadata.description)), /* @__PURE__ */ w("div", { class: "doc-content" }, /* @__PURE__ */ w("wsx-markdown", { markdown: this.markdown }))) : /* @__PURE__ */ w("div", { class: "doc-page" }, /* @__PURE__ */ w("div", { class: "doc-empty" }, "请选择文档"));
339
+ return this.loadingState === "loading" ? /* @__PURE__ */ x("div", { class: "doc-page" }, /* @__PURE__ */ x("div", { class: "doc-loading" }, "加载文档中...")) : this.loadingState === "error" ? /* @__PURE__ */ x("div", { class: "doc-page" }, /* @__PURE__ */ x("div", { class: "doc-error" }, /* @__PURE__ */ x("h2", null, "加载失败"), /* @__PURE__ */ x("p", null, ((e = this.error) == null ? void 0 : e.message) || "未知错误"), ((r = this.error) == null ? void 0 : r.code) === "NOT_FOUND" && /* @__PURE__ */ x("p", null, "文档不存在,请检查路径是否正确。"))) : this.loadingState === "success" && this.markdown ? /* @__PURE__ */ x("div", { class: "doc-page" }, this.metadata && /* @__PURE__ */ x("div", { class: "doc-header" }, /* @__PURE__ */ x("h1", { class: "doc-title" }, this.metadata.title), this.metadata.description && /* @__PURE__ */ x("p", { class: "doc-description" }, this.metadata.description)), /* @__PURE__ */ x("div", { class: "doc-content" }, /* @__PURE__ */ x("wsx-markdown", { markdown: this.markdown }))) : /* @__PURE__ */ x("div", { class: "doc-page" }, /* @__PURE__ */ x("div", { class: "doc-empty" }, "请选择文档"));
327
340
  }
328
341
  }
329
342
  we = Ye;
330
- [We, Ce] = Ue(we, [], Se, 0, void 0, X).c;
343
+ [Be, Ce] = Ue(we, [], Se, 0, void 0, X).c;
331
344
  Ce();
332
345
  const he = ".wsx-doc-search{position:relative;width:100%;max-width:600px}.search-input-wrapper{position:relative}.search-input{width:100%;padding:.75rem 1rem;font-size:1rem;border:1px solid var(--wsx-press-border, #ddd);border-radius:4px;outline:none;transition:border-color .2s}.search-input:focus{border-color:var(--wsx-press-primary, #007bff);box-shadow:0 0 0 3px var(--wsx-press-primary-alpha, rgba(0, 123, 255, .1))}.search-loading{position:absolute;right:1rem;top:50%;transform:translateY(-50%);color:var(--wsx-press-text-secondary, #666);font-size:.875rem}.search-results{position:absolute;top:100%;left:0;right:0;margin-top:.5rem;background:var(--wsx-press-bg, #fff);border:1px solid var(--wsx-press-border, #ddd);border-radius:4px;box-shadow:0 4px 6px #0000001a;max-height:400px;overflow-y:auto;z-index:1000}.search-result{padding:1rem;border-bottom:1px solid var(--wsx-press-border-light, #f0f0f0);cursor:pointer;transition:background-color .2s}.search-result:last-child{border-bottom:none}.search-result:hover,.search-result.selected{background-color:var(--wsx-press-hover-bg, #f5f5f5)}.result-title{font-weight:600;color:var(--wsx-press-text-primary, #333);margin-bottom:.25rem}.result-title mark{background-color:var(--wsx-press-highlight-bg, #ffeb3b);color:var(--wsx-press-highlight-text, #000);padding:0 2px;border-radius:2px}.result-category{font-size:.875rem;color:var(--wsx-press-text-secondary, #666);margin-bottom:.5rem}.result-snippet{font-size:.875rem;color:var(--wsx-press-text-secondary, #666);line-height:1.4}.result-snippet mark{background-color:var(--wsx-press-highlight-bg, #ffeb3b);color:var(--wsx-press-highlight-text, #000);padding:0 2px;border-radius:2px}.search-no-results{position:absolute;top:100%;left:0;right:0;margin-top:.5rem;padding:1rem;background:var(--wsx-press-bg, #fff);border:1px solid var(--wsx-press-border, #ddd);border-radius:4px;box-shadow:0 4px 6px #0000001a;text-align:center;color:var(--wsx-press-text-secondary, #666);z-index:1000}";
333
- var _e;
334
- let Oe, Ie;
346
+ var Ee;
347
+ let _e, Ie;
335
348
  function Q(t, e, r) {
336
- return (e = Te(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
349
+ return (e = Oe(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
337
350
  }
338
- function Ge(t, e, r, s, d, I) {
339
- function g(i, c, u) {
340
- return function(n, a) {
341
- return u && u(n), i[c].call(n, a);
351
+ function Ge(t, e, r, n, u, C) {
352
+ function g(i, c, d) {
353
+ return function(o, a) {
354
+ return d && d(o), i[c].call(o, a);
342
355
  };
343
356
  }
344
- function x(i, c) {
345
- for (var u = 0; u < i.length; u++) i[u].call(c);
357
+ function w(i, c) {
358
+ for (var d = 0; d < i.length; d++) i[d].call(c);
346
359
  return c;
347
360
  }
348
- function v(i, c, u, n) {
349
- if (typeof i != "function" && (n || i !== void 0)) throw new TypeError(c + " must " + (u || "be") + " a function" + (n ? "" : " or undefined"));
361
+ function y(i, c, d, o) {
362
+ if (typeof i != "function" && (o || i !== void 0)) throw new TypeError(c + " must " + (d || "be") + " a function" + (o ? "" : " or undefined"));
350
363
  return i;
351
364
  }
352
- function M(i, c, u, n, a, L, k, T, z, C, y, m, p) {
353
- function S(l) {
365
+ function N(i, c, d, o, a, L, $, O, z, S, v, m, p) {
366
+ function k(l) {
354
367
  if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
355
368
  }
356
- var h, D = c[0], E = c[3], j = !T;
357
- if (!j) {
358
- u || Array.isArray(D) || (D = [D]);
359
- var o = {}, _ = [], b = a === 3 ? "get" : a === 4 || m ? "set" : "value";
360
- C ? (y || m ? o = { get: fe(function() {
369
+ var h, D = c[0], E = c[3], T = !O;
370
+ if (!T) {
371
+ d || Array.isArray(D) || (D = [D]);
372
+ var s = {}, _ = [], b = a === 3 ? "get" : a === 4 || m ? "set" : "value";
373
+ S ? (v || m ? s = { get: fe(function() {
361
374
  return E(this);
362
- }, n, "get"), set: function(l) {
375
+ }, o, "get"), set: function(l) {
363
376
  c[4](this, l);
364
- } } : o[b] = E, y || fe(o[b], n, a === 2 ? "" : b)) : y || (o = Object.getOwnPropertyDescriptor(i, n));
377
+ } } : s[b] = E, v || fe(s[b], o, a === 2 ? "" : b)) : v || (s = Object.getOwnPropertyDescriptor(i, o));
365
378
  }
366
- for (var f = i, q = D.length - 1; q >= 0; q -= u ? 2 : 1) {
367
- var H = D[q], K = u ? D[q - 1] : void 0, B = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: n, metadata: L, addInitializer: (function(l, O) {
379
+ for (var f = i, q = D.length - 1; q >= 0; q -= d ? 2 : 1) {
380
+ var H = D[q], K = d ? D[q - 1] : void 0, W = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: o, metadata: L, addInitializer: (function(l, I) {
368
381
  if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
369
- v(O, "An initializer", "be", !0), k.push(O);
370
- }).bind(null, B) };
382
+ y(I, "An initializer", "be", !0), $.push(I);
383
+ }).bind(null, W) };
371
384
  try {
372
- if (j) (h = v(H.call(K, f, R), "class decorators", "return")) && (f = h);
385
+ if (T) (h = y(H.call(K, f, R), "class decorators", "return")) && (f = h);
373
386
  else {
374
387
  var A, F;
375
- R.static = z, R.private = C, C ? a === 2 ? A = function(l) {
376
- return S(l), o.value;
377
- } : (a < 4 && (A = g(o, "get", S)), a !== 3 && (F = g(o, "set", S))) : (A = function(l) {
378
- return l[n];
379
- }, (a < 2 || a === 4) && (F = function(l, O) {
380
- l[n] = O;
388
+ R.static = z, R.private = S, S ? a === 2 ? A = function(l) {
389
+ return k(l), s.value;
390
+ } : (a < 4 && (A = g(s, "get", k)), a !== 3 && (F = g(s, "set", k))) : (A = function(l) {
391
+ return l[o];
392
+ }, (a < 2 || a === 4) && (F = function(l, I) {
393
+ l[o] = I;
381
394
  }));
382
- var W = R.access = { has: C ? p.bind() : function(l) {
383
- return n in l;
395
+ var B = R.access = { has: S ? p.bind() : function(l) {
396
+ return o in l;
384
397
  } };
385
- if (A && (W.get = A), F && (W.set = F), f = H.call(K, m ? { get: o.get, set: o.set } : o[b], R), m) {
386
- if (typeof f == "object" && f) (h = v(f.get, "accessor.get")) && (o.get = h), (h = v(f.set, "accessor.set")) && (o.set = h), (h = v(f.init, "accessor.init")) && _.push(h);
398
+ if (A && (B.get = A), F && (B.set = F), f = H.call(K, m ? { get: s.get, set: s.set } : s[b], R), m) {
399
+ if (typeof f == "object" && f) (h = y(f.get, "accessor.get")) && (s.get = h), (h = y(f.set, "accessor.set")) && (s.set = h), (h = y(f.init, "accessor.init")) && _.push(h);
387
400
  else if (f !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
388
- } else v(f, (y ? "field" : "method") + " decorators", "return") && (y ? _.push(f) : o[b] = f);
401
+ } else y(f, (v ? "field" : "method") + " decorators", "return") && (v ? _.push(f) : s[b] = f);
389
402
  }
390
403
  } finally {
391
- B.v = !0;
404
+ W.v = !0;
392
405
  }
393
406
  }
394
- return (y || m) && T.push(function(l, O) {
395
- for (var N = _.length - 1; N >= 0; N--) O = _[N].call(l, O);
396
- return O;
397
- }), y || j || (C ? m ? T.push(g(o, "get"), g(o, "set")) : T.push(a === 2 ? o[b] : g.call.bind(o[b])) : Object.defineProperty(i, n, o)), f;
407
+ return (v || m) && O.push(function(l, I) {
408
+ for (var M = _.length - 1; M >= 0; M--) I = _[M].call(l, I);
409
+ return I;
410
+ }), v || T || (S ? m ? O.push(g(s, "get"), g(s, "set")) : O.push(a === 2 ? s[b] : g.call.bind(s[b])) : Object.defineProperty(i, o, s)), f;
398
411
  }
399
- function $(i, c) {
412
+ function j(i, c) {
400
413
  return Object.defineProperty(i, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: c });
401
414
  }
402
- if (arguments.length >= 6) var U = I[Symbol.metadata || Symbol.for("Symbol.metadata")];
403
- var P = Object.create(U ?? null), Z = function(i, c, u, n) {
404
- var a, L, k = [], T = function(b) {
415
+ if (arguments.length >= 6) var U = C[Symbol.metadata || Symbol.for("Symbol.metadata")];
416
+ var P = Object.create(U ?? null), Z = function(i, c, d, o) {
417
+ var a, L, $ = [], O = function(b) {
405
418
  return Qe(b) === i;
406
419
  }, z = /* @__PURE__ */ new Map();
407
- function C(b) {
408
- b && k.push(x.bind(null, b));
420
+ function S(b) {
421
+ b && $.push(w.bind(null, b));
409
422
  }
410
- for (var y = 0; y < c.length; y++) {
411
- var m = c[y];
423
+ for (var v = 0; v < c.length; v++) {
424
+ var m = c[v];
412
425
  if (Array.isArray(m)) {
413
- var p = m[1], S = m[2], h = m.length > 3, D = 16 & p, E = !!(8 & p), j = (p &= 7) == 0, o = S + "/" + E;
414
- if (!j && !h) {
415
- var _ = z.get(o);
416
- if (_ === !0 || _ === 3 && p !== 4 || _ === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + S);
417
- z.set(o, !(p > 2) || p);
426
+ var p = m[1], k = m[2], h = m.length > 3, D = 16 & p, E = !!(8 & p), T = (p &= 7) == 0, s = k + "/" + E;
427
+ if (!T && !h) {
428
+ var _ = z.get(s);
429
+ if (_ === !0 || _ === 3 && p !== 4 || _ === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + k);
430
+ z.set(s, !(p > 2) || p);
418
431
  }
419
- M(E ? i : i.prototype, m, D, h ? "#" + S : Te(S), p, n, E ? L = L || [] : a = a || [], k, E, h, j, p === 1, E && h ? T : u);
432
+ N(E ? i : i.prototype, m, D, h ? "#" + k : Oe(k), p, o, E ? L = L || [] : a = a || [], $, E, h, T, p === 1, E && h ? O : d);
420
433
  }
421
434
  }
422
- return C(a), C(L), k;
423
- }(t, e, d, P);
424
- return r.length || $(t, P), { e: Z, get c() {
435
+ return S(a), S(L), $;
436
+ }(t, e, u, P);
437
+ return r.length || j(t, P), { e: Z, get c() {
425
438
  var i = [];
426
- return r.length && [$(M(t, [r], s, t.name, 5, P, i), P), x.bind(null, i, t)];
439
+ return r.length && [j(N(t, [r], n, t.name, 5, P, i), P), w.bind(null, i, t)];
427
440
  } };
428
441
  }
429
- function Te(t) {
442
+ function Oe(t) {
430
443
  var e = Je(t, "string");
431
444
  return typeof e == "symbol" ? e : e + "";
432
445
  }
@@ -434,8 +447,8 @@ function Je(t, e) {
434
447
  if (typeof t != "object" || !t) return t;
435
448
  var r = t[Symbol.toPrimitive];
436
449
  if (r !== void 0) {
437
- var s = r.call(t, e);
438
- if (typeof s != "object") return s;
450
+ var n = r.call(t, e);
451
+ if (typeof n != "object") return n;
439
452
  throw new TypeError("@@toPrimitive must return a primitive value.");
440
453
  }
441
454
  return String(t);
@@ -452,7 +465,7 @@ function Qe(t) {
452
465
  if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
453
466
  return t;
454
467
  }
455
- const ce = ae("DocSearch"), V = {
468
+ const ce = ne("DocSearch"), V = {
456
469
  data: null,
457
470
  promise: null
458
471
  };
@@ -469,7 +482,7 @@ async function ge() {
469
482
  }
470
483
  })()), V.promise);
471
484
  }
472
- Ie = [se({
485
+ Ie = [oe({
473
486
  tagName: "wsx-doc-search"
474
487
  })];
475
488
  let Xe;
@@ -478,8 +491,8 @@ class Ze extends X {
478
491
  super({
479
492
  styles: he,
480
493
  styleName: "wsx-doc-search"
481
- }), Q(this, "_autoStyles", he), Q(this, "query", void 0), Q(this, "results", void 0), Q(this, "isOpen", void 0), Q(this, "isLoading", void 0), Q(this, "selectedIndex", void 0), Q(this, "fuse", null), Q(this, "searchTimeout", null), Q(this, "handleInput", ($) => {
482
- const U = $.target;
494
+ }), Q(this, "_autoStyles", he), Q(this, "query", void 0), Q(this, "results", void 0), Q(this, "isOpen", void 0), Q(this, "isLoading", void 0), Q(this, "selectedIndex", void 0), Q(this, "fuse", null), Q(this, "searchTimeout", null), Q(this, "handleInput", (j) => {
495
+ const U = j.target;
483
496
  if (this.query = U.value, this.searchTimeout !== null && clearTimeout(this.searchTimeout), !this.query.trim()) {
484
497
  this.results = [], this.selectedIndex = -1, this.isOpen = !1;
485
498
  return;
@@ -487,20 +500,20 @@ class Ze extends X {
487
500
  this.searchTimeout = window.setTimeout(() => {
488
501
  this.performSearch();
489
502
  }, 300);
490
- }), Q(this, "handleKeyDown", ($) => {
503
+ }), Q(this, "handleKeyDown", (j) => {
491
504
  if (!(!this.isOpen || this.results.length === 0))
492
- switch ($.key) {
505
+ switch (j.key) {
493
506
  case "ArrowDown":
494
- $.preventDefault(), this.selectedIndex = Math.min(this.selectedIndex + 1, this.results.length - 1);
507
+ j.preventDefault(), this.selectedIndex = Math.min(this.selectedIndex + 1, this.results.length - 1);
495
508
  break;
496
509
  case "ArrowUp":
497
- $.preventDefault(), this.selectedIndex = Math.max(this.selectedIndex - 1, -1);
510
+ j.preventDefault(), this.selectedIndex = Math.max(this.selectedIndex - 1, -1);
498
511
  break;
499
512
  case "Enter":
500
- $.preventDefault(), this.selectedIndex >= 0 && this.selectedIndex < this.results.length ? this.selectResult(this.results[this.selectedIndex]) : this.results.length > 0 && this.selectResult(this.results[0]);
513
+ j.preventDefault(), this.selectedIndex >= 0 && this.selectedIndex < this.results.length ? this.selectResult(this.results[this.selectedIndex]) : this.results.length > 0 && this.selectResult(this.results[0]);
501
514
  break;
502
515
  case "Escape":
503
- $.preventDefault(), this.isOpen = !1, this.query = "", this.results = [], this.selectedIndex = -1;
516
+ j.preventDefault(), this.isOpen = !1, this.query = "", this.results = [], this.selectedIndex = -1;
504
517
  break;
505
518
  }
506
519
  }), ce.info("DocSearch initialized");
@@ -511,33 +524,33 @@ class Ze extends X {
511
524
  enumerable: !0,
512
525
  configurable: !0
513
526
  });
514
- let s = this.reactive([]);
527
+ let n = this.reactive([]);
515
528
  Object.defineProperty(this, "results", {
516
- get: () => s,
517
- set: ($) => {
518
- s = $ !== null && typeof $ < "u" && (Array.isArray($) || typeof $ == "object") ? this.reactive($) : $, this.scheduleRerender();
529
+ get: () => n,
530
+ set: (j) => {
531
+ n = j !== null && typeof j < "u" && (Array.isArray(j) || typeof j == "object") ? this.reactive(j) : j, this.scheduleRerender();
519
532
  },
520
533
  enumerable: !0,
521
534
  configurable: !0
522
535
  });
523
- const [d, I] = this.useState("isOpen", !1);
536
+ const [u, C] = this.useState("isOpen", !1);
524
537
  Object.defineProperty(this, "isOpen", {
525
- get: d,
526
- set: I,
538
+ get: u,
539
+ set: C,
527
540
  enumerable: !0,
528
541
  configurable: !0
529
542
  });
530
- const [g, x] = this.useState("isLoading", !1);
543
+ const [g, w] = this.useState("isLoading", !1);
531
544
  Object.defineProperty(this, "isLoading", {
532
545
  get: g,
533
- set: x,
546
+ set: w,
534
547
  enumerable: !0,
535
548
  configurable: !0
536
549
  });
537
- const [v, M] = this.useState("selectedIndex", -1);
550
+ const [y, N] = this.useState("selectedIndex", -1);
538
551
  Object.defineProperty(this, "selectedIndex", {
539
- get: v,
540
- set: M,
552
+ get: y,
553
+ set: N,
541
554
  enumerable: !0,
542
555
  configurable: !0
543
556
  });
@@ -590,135 +603,135 @@ class Ze extends X {
590
603
  highlightTextNodes(e, r) {
591
604
  if (!r || r.length === 0)
592
605
  return [e];
593
- const s = [];
594
- for (const x of r)
595
- x.indices && s.push(...x.indices);
596
- s.sort((x, v) => x[0] - v[0]);
597
- const d = [];
598
- for (const [x, v] of s)
599
- d.length === 0 || d[d.length - 1][1] < x ? d.push([x, v + 1]) : d[d.length - 1][1] = Math.max(d[d.length - 1][1], v + 1);
600
- const I = [];
606
+ const n = [];
607
+ for (const w of r)
608
+ w.indices && n.push(...w.indices);
609
+ n.sort((w, y) => w[0] - y[0]);
610
+ const u = [];
611
+ for (const [w, y] of n)
612
+ u.length === 0 || u[u.length - 1][1] < w ? u.push([w, y + 1]) : u[u.length - 1][1] = Math.max(u[u.length - 1][1], y + 1);
613
+ const C = [];
601
614
  let g = 0;
602
- for (const [x, v] of d) {
603
- x > g && I.push(e.substring(g, x));
604
- const M = document.createElement("mark");
605
- M.textContent = e.substring(x, v), I.push(M), g = v;
615
+ for (const [w, y] of u) {
616
+ w > g && C.push(e.substring(g, w));
617
+ const N = document.createElement("mark");
618
+ N.textContent = e.substring(w, y), C.push(N), g = y;
606
619
  }
607
- return g < e.length && I.push(e.substring(g)), I;
620
+ return g < e.length && C.push(e.substring(g)), C;
608
621
  }
609
622
  render() {
610
- return /* @__PURE__ */ w("div", { class: "doc-search" }, /* @__PURE__ */ w("div", { class: "search-input-wrapper" }, /* @__PURE__ */ w("input", { type: "text", class: "search-input", placeholder: "搜索文档...", value: this.query, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: () => {
623
+ return /* @__PURE__ */ x("div", { class: "doc-search" }, /* @__PURE__ */ x("div", { class: "search-input-wrapper" }, /* @__PURE__ */ x("input", { type: "text", class: "search-input", placeholder: "搜索文档...", value: this.query, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: () => {
611
624
  this.results.length > 0 && (this.isOpen = !0);
612
- }, "data-wsx-key": "DocSearch-input-text-1-1" }), this.isLoading && /* @__PURE__ */ w("div", { class: "search-loading" }, "加载中...")), this.isOpen && this.results.length > 0 && /* @__PURE__ */ w("div", { class: "search-results" }, this.results.map((e, r) => {
613
- var g, x;
614
- const s = r === this.selectedIndex, d = (g = e.matches) == null ? void 0 : g.find((v) => v.key === "title"), I = (x = e.matches) == null ? void 0 : x.find((v) => v.key === "content");
615
- return /* @__PURE__ */ w("div", { key: e.item.id, class: `search-result ${s ? "selected" : ""}`, onClick: () => this.selectResult(e), onMouseEnter: () => {
625
+ }, "data-wsx-key": "DocSearch-input-text-1-1" }), this.isLoading && /* @__PURE__ */ x("div", { class: "search-loading" }, "加载中...")), this.isOpen && this.results.length > 0 && /* @__PURE__ */ x("div", { class: "search-results" }, this.results.map((e, r) => {
626
+ var g, w;
627
+ const n = r === this.selectedIndex, u = (g = e.matches) == null ? void 0 : g.find((y) => y.key === "title"), C = (w = e.matches) == null ? void 0 : w.find((y) => y.key === "content");
628
+ return /* @__PURE__ */ x("div", { key: e.item.id, class: `search-result ${n ? "selected" : ""}`, onClick: () => this.selectResult(e), onMouseEnter: () => {
616
629
  this.selectedIndex = r;
617
- } }, /* @__PURE__ */ w("div", { class: "result-title" }, d ? this.highlightTextNodes(e.item.title, [d]) : e.item.title), /* @__PURE__ */ w("div", { class: "result-category" }, e.item.category), I && /* @__PURE__ */ w("div", { class: "result-snippet" }, this.highlightTextNodes(e.item.content.substring(0, 100), [I])));
618
- })), this.isOpen && this.query.trim() && this.results.length === 0 && !this.isLoading && /* @__PURE__ */ w("div", { class: "search-no-results" }, "未找到匹配的文档"));
630
+ } }, /* @__PURE__ */ x("div", { class: "result-title" }, u ? this.highlightTextNodes(e.item.title, [u]) : e.item.title), /* @__PURE__ */ x("div", { class: "result-category" }, e.item.category), C && /* @__PURE__ */ x("div", { class: "result-snippet" }, this.highlightTextNodes(e.item.content.substring(0, 100), [C])));
631
+ })), this.isOpen && this.query.trim() && this.results.length === 0 && !this.isLoading && /* @__PURE__ */ x("div", { class: "search-no-results" }, "未找到匹配的文档"));
619
632
  }
620
633
  }
621
- _e = Ze;
622
- [Xe, Oe] = Ge(_e, [], Ie, 0, void 0, X).c;
623
- Oe();
634
+ Ee = Ze;
635
+ [Xe, _e] = Ge(Ee, [], Ie, 0, void 0, X).c;
636
+ _e();
624
637
  const me = "wsx-doc-layout{display:flex;flex-direction:row;width:100%;min-height:calc(100vh - var(--nav-height, 70px))}.doc-layout{display:flex;flex-direction:row;width:100%;max-width:1600px;margin:0 auto;gap:0}.doc-layout-sidebar{flex-shrink:0}.doc-layout-main{flex:1;min-width:0;padding:var(--doc-layout-main-padding-y, 1.5rem) var(--doc-layout-main-padding-x, 2rem);max-width:100%}.doc-layout-toc{flex-shrink:0}@media (max-width: 1280px){.doc-layout-toc{display:none}}@media (max-width: 1024px){.doc-layout-sidebar{display:none}.doc-layout-main{padding:var(--doc-layout-main-padding-y, 1.5rem)}}";
625
- var je;
626
- let $e, Le;
627
- function ne(t, e, r) {
628
- return (e = ke(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
638
+ var Te;
639
+ let je, Le;
640
+ function ae(t, e, r) {
641
+ return (e = $e(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
629
642
  }
630
- function Ve(t, e, r, s, d, I) {
631
- function g(i, c, u) {
632
- return function(n, a) {
633
- return u && u(n), i[c].call(n, a);
643
+ function Ve(t, e, r, n, u, C) {
644
+ function g(i, c, d) {
645
+ return function(o, a) {
646
+ return d && d(o), i[c].call(o, a);
634
647
  };
635
648
  }
636
- function x(i, c) {
637
- for (var u = 0; u < i.length; u++) i[u].call(c);
649
+ function w(i, c) {
650
+ for (var d = 0; d < i.length; d++) i[d].call(c);
638
651
  return c;
639
652
  }
640
- function v(i, c, u, n) {
641
- if (typeof i != "function" && (n || i !== void 0)) throw new TypeError(c + " must " + (u || "be") + " a function" + (n ? "" : " or undefined"));
653
+ function y(i, c, d, o) {
654
+ if (typeof i != "function" && (o || i !== void 0)) throw new TypeError(c + " must " + (d || "be") + " a function" + (o ? "" : " or undefined"));
642
655
  return i;
643
656
  }
644
- function M(i, c, u, n, a, L, k, T, z, C, y, m, p) {
645
- function S(l) {
657
+ function N(i, c, d, o, a, L, $, O, z, S, v, m, p) {
658
+ function k(l) {
646
659
  if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
647
660
  }
648
- var h, D = c[0], E = c[3], j = !T;
649
- if (!j) {
650
- u || Array.isArray(D) || (D = [D]);
651
- var o = {}, _ = [], b = a === 3 ? "get" : a === 4 || m ? "set" : "value";
652
- C ? (y || m ? o = { get: pe(function() {
661
+ var h, D = c[0], E = c[3], T = !O;
662
+ if (!T) {
663
+ d || Array.isArray(D) || (D = [D]);
664
+ var s = {}, _ = [], b = a === 3 ? "get" : a === 4 || m ? "set" : "value";
665
+ S ? (v || m ? s = { get: pe(function() {
653
666
  return E(this);
654
- }, n, "get"), set: function(l) {
667
+ }, o, "get"), set: function(l) {
655
668
  c[4](this, l);
656
- } } : o[b] = E, y || pe(o[b], n, a === 2 ? "" : b)) : y || (o = Object.getOwnPropertyDescriptor(i, n));
669
+ } } : s[b] = E, v || pe(s[b], o, a === 2 ? "" : b)) : v || (s = Object.getOwnPropertyDescriptor(i, o));
657
670
  }
658
- for (var f = i, q = D.length - 1; q >= 0; q -= u ? 2 : 1) {
659
- var H = D[q], K = u ? D[q - 1] : void 0, B = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: n, metadata: L, addInitializer: (function(l, O) {
671
+ for (var f = i, q = D.length - 1; q >= 0; q -= d ? 2 : 1) {
672
+ var H = D[q], K = d ? D[q - 1] : void 0, W = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: o, metadata: L, addInitializer: (function(l, I) {
660
673
  if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
661
- v(O, "An initializer", "be", !0), k.push(O);
662
- }).bind(null, B) };
674
+ y(I, "An initializer", "be", !0), $.push(I);
675
+ }).bind(null, W) };
663
676
  try {
664
- if (j) (h = v(H.call(K, f, R), "class decorators", "return")) && (f = h);
677
+ if (T) (h = y(H.call(K, f, R), "class decorators", "return")) && (f = h);
665
678
  else {
666
679
  var A, F;
667
- R.static = z, R.private = C, C ? a === 2 ? A = function(l) {
668
- return S(l), o.value;
669
- } : (a < 4 && (A = g(o, "get", S)), a !== 3 && (F = g(o, "set", S))) : (A = function(l) {
670
- return l[n];
671
- }, (a < 2 || a === 4) && (F = function(l, O) {
672
- l[n] = O;
680
+ R.static = z, R.private = S, S ? a === 2 ? A = function(l) {
681
+ return k(l), s.value;
682
+ } : (a < 4 && (A = g(s, "get", k)), a !== 3 && (F = g(s, "set", k))) : (A = function(l) {
683
+ return l[o];
684
+ }, (a < 2 || a === 4) && (F = function(l, I) {
685
+ l[o] = I;
673
686
  }));
674
- var W = R.access = { has: C ? p.bind() : function(l) {
675
- return n in l;
687
+ var B = R.access = { has: S ? p.bind() : function(l) {
688
+ return o in l;
676
689
  } };
677
- if (A && (W.get = A), F && (W.set = F), f = H.call(K, m ? { get: o.get, set: o.set } : o[b], R), m) {
678
- if (typeof f == "object" && f) (h = v(f.get, "accessor.get")) && (o.get = h), (h = v(f.set, "accessor.set")) && (o.set = h), (h = v(f.init, "accessor.init")) && _.push(h);
690
+ if (A && (B.get = A), F && (B.set = F), f = H.call(K, m ? { get: s.get, set: s.set } : s[b], R), m) {
691
+ if (typeof f == "object" && f) (h = y(f.get, "accessor.get")) && (s.get = h), (h = y(f.set, "accessor.set")) && (s.set = h), (h = y(f.init, "accessor.init")) && _.push(h);
679
692
  else if (f !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
680
- } else v(f, (y ? "field" : "method") + " decorators", "return") && (y ? _.push(f) : o[b] = f);
693
+ } else y(f, (v ? "field" : "method") + " decorators", "return") && (v ? _.push(f) : s[b] = f);
681
694
  }
682
695
  } finally {
683
- B.v = !0;
696
+ W.v = !0;
684
697
  }
685
698
  }
686
- return (y || m) && T.push(function(l, O) {
687
- for (var N = _.length - 1; N >= 0; N--) O = _[N].call(l, O);
688
- return O;
689
- }), y || j || (C ? m ? T.push(g(o, "get"), g(o, "set")) : T.push(a === 2 ? o[b] : g.call.bind(o[b])) : Object.defineProperty(i, n, o)), f;
699
+ return (v || m) && O.push(function(l, I) {
700
+ for (var M = _.length - 1; M >= 0; M--) I = _[M].call(l, I);
701
+ return I;
702
+ }), v || T || (S ? m ? O.push(g(s, "get"), g(s, "set")) : O.push(a === 2 ? s[b] : g.call.bind(s[b])) : Object.defineProperty(i, o, s)), f;
690
703
  }
691
- function $(i, c) {
704
+ function j(i, c) {
692
705
  return Object.defineProperty(i, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: c });
693
706
  }
694
- if (arguments.length >= 6) var U = I[Symbol.metadata || Symbol.for("Symbol.metadata")];
695
- var P = Object.create(U ?? null), Z = function(i, c, u, n) {
696
- var a, L, k = [], T = function(b) {
707
+ if (arguments.length >= 6) var U = C[Symbol.metadata || Symbol.for("Symbol.metadata")];
708
+ var P = Object.create(U ?? null), Z = function(i, c, d, o) {
709
+ var a, L, $ = [], O = function(b) {
697
710
  return tt(b) === i;
698
711
  }, z = /* @__PURE__ */ new Map();
699
- function C(b) {
700
- b && k.push(x.bind(null, b));
712
+ function S(b) {
713
+ b && $.push(w.bind(null, b));
701
714
  }
702
- for (var y = 0; y < c.length; y++) {
703
- var m = c[y];
715
+ for (var v = 0; v < c.length; v++) {
716
+ var m = c[v];
704
717
  if (Array.isArray(m)) {
705
- var p = m[1], S = m[2], h = m.length > 3, D = 16 & p, E = !!(8 & p), j = (p &= 7) == 0, o = S + "/" + E;
706
- if (!j && !h) {
707
- var _ = z.get(o);
708
- if (_ === !0 || _ === 3 && p !== 4 || _ === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + S);
709
- z.set(o, !(p > 2) || p);
718
+ var p = m[1], k = m[2], h = m.length > 3, D = 16 & p, E = !!(8 & p), T = (p &= 7) == 0, s = k + "/" + E;
719
+ if (!T && !h) {
720
+ var _ = z.get(s);
721
+ if (_ === !0 || _ === 3 && p !== 4 || _ === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + k);
722
+ z.set(s, !(p > 2) || p);
710
723
  }
711
- M(E ? i : i.prototype, m, D, h ? "#" + S : ke(S), p, n, E ? L = L || [] : a = a || [], k, E, h, j, p === 1, E && h ? T : u);
724
+ N(E ? i : i.prototype, m, D, h ? "#" + k : $e(k), p, o, E ? L = L || [] : a = a || [], $, E, h, T, p === 1, E && h ? O : d);
712
725
  }
713
726
  }
714
- return C(a), C(L), k;
715
- }(t, e, d, P);
716
- return r.length || $(t, P), { e: Z, get c() {
727
+ return S(a), S(L), $;
728
+ }(t, e, u, P);
729
+ return r.length || j(t, P), { e: Z, get c() {
717
730
  var i = [];
718
- return r.length && [$(M(t, [r], s, t.name, 5, P, i), P), x.bind(null, i, t)];
731
+ return r.length && [j(N(t, [r], n, t.name, 5, P, i), P), w.bind(null, i, t)];
719
732
  } };
720
733
  }
721
- function ke(t) {
734
+ function $e(t) {
722
735
  var e = et(t, "string");
723
736
  return typeof e == "symbol" ? e : e + "";
724
737
  }
@@ -726,8 +739,8 @@ function et(t, e) {
726
739
  if (typeof t != "object" || !t) return t;
727
740
  var r = t[Symbol.toPrimitive];
728
741
  if (r !== void 0) {
729
- var s = r.call(t, e);
730
- if (typeof s != "object") return s;
742
+ var n = r.call(t, e);
743
+ if (typeof n != "object") return n;
731
744
  throw new TypeError("@@toPrimitive must return a primitive value.");
732
745
  }
733
746
  return String(t);
@@ -744,7 +757,7 @@ function tt(t) {
744
757
  if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
745
758
  return t;
746
759
  }
747
- Le = [se({
760
+ Le = [oe({
748
761
  tagName: "wsx-doc-layout"
749
762
  })];
750
763
  let rt;
@@ -753,7 +766,7 @@ class it extends X {
753
766
  super({
754
767
  styles: me,
755
768
  styleName: "wsx-doc-layout"
756
- }), ne(this, "_autoStyles", me), ne(this, "sidebarInstance", null), ne(this, "docPageInstance", null), ne(this, "tocInstance", null);
769
+ }), ae(this, "_autoStyles", me), ae(this, "sidebarInstance", null), ae(this, "docPageInstance", null), ae(this, "tocInstance", null);
757
770
  }
758
771
  onConnected() {
759
772
  var e;
@@ -761,10 +774,10 @@ class it extends X {
761
774
  if (this.connected) {
762
775
  const r = this.querySelector(".doc-layout-sidebar");
763
776
  r && !this.sidebarInstance && (this.sidebarInstance = document.createElement("wsx-doc-sidebar"), r.appendChild(this.sidebarInstance));
764
- const s = this.querySelector(".doc-layout-main");
765
- s && !this.docPageInstance && (this.docPageInstance = document.createElement("wsx-doc-page"), s.appendChild(this.docPageInstance));
766
- const d = this.querySelector(".doc-layout-toc");
767
- d && !this.tocInstance && (this.tocInstance = document.createElement("wsx-doc-toc"), d.appendChild(this.tocInstance));
777
+ const n = this.querySelector(".doc-layout-main");
778
+ n && !this.docPageInstance && (this.docPageInstance = document.createElement("wsx-doc-page"), n.appendChild(this.docPageInstance));
779
+ const u = this.querySelector(".doc-layout-toc");
780
+ u && !this.tocInstance && (this.tocInstance = document.createElement("wsx-doc-toc"), u.appendChild(this.tocInstance));
768
781
  }
769
782
  });
770
783
  }
@@ -773,119 +786,119 @@ class it extends X {
773
786
  (e = super.onDisconnected) == null || e.call(this), this.sidebarInstance && (this.sidebarInstance.remove(), this.sidebarInstance = null), this.docPageInstance && (this.docPageInstance.remove(), this.docPageInstance = null), this.tocInstance && (this.tocInstance.remove(), this.tocInstance = null);
774
787
  }
775
788
  render() {
776
- return /* @__PURE__ */ w("div", { class: "doc-layout" }, /* @__PURE__ */ w("aside", { class: "doc-layout-sidebar" }), /* @__PURE__ */ w("main", { class: "doc-layout-main" }), /* @__PURE__ */ w("aside", { class: "doc-layout-toc" }));
789
+ return /* @__PURE__ */ x("div", { class: "doc-layout" }, /* @__PURE__ */ x("aside", { class: "doc-layout-sidebar" }), /* @__PURE__ */ x("main", { class: "doc-layout-main" }), /* @__PURE__ */ x("aside", { class: "doc-layout-toc" }));
777
790
  }
778
791
  }
779
- je = it;
780
- [rt, $e] = Ve(je, [], Le, 0, void 0, X).c;
781
- $e();
782
- const be = "wsx-doc-sidebar{display:flex;flex-direction:column;width:280px;min-width:280px;height:100%;background:var(--wsx-press-sidebar-bg, #f9fafb);border-right:1px solid var(--wsx-press-border, #e5e7eb);overflow-y:auto;position:sticky;top:70px;max-height:calc(100vh - 70px)}.doc-sidebar{display:flex;flex-direction:column;width:100%;height:100%}.doc-sidebar-loading,.doc-sidebar-empty{padding:2rem;text-align:center;color:var(--wsx-press-text-secondary, #6b7280)}.doc-sidebar-nav{padding:1.5rem 0}.doc-sidebar-category{margin-bottom:2rem}.doc-sidebar-category:last-child{margin-bottom:0}.doc-sidebar-category-title{font-size:.875rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--wsx-press-text-secondary, #6b7280);padding:.5rem 1.5rem;margin:0 0 .5rem}.doc-sidebar-list{list-style:none;margin:0;padding:0}.doc-sidebar-item{margin:0}.doc-sidebar-link{display:block;padding:.5rem 1.5rem;color:var(--wsx-press-text-primary, #111827);text-decoration:none;font-size:.875rem;line-height:1.5;transition:all .2s ease;border-left:3px solid transparent}.doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #f3f4f6);color:var(--wsx-press-text-primary, #111827)}.doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, #eff6ff);color:var(--wsx-press-sidebar-active-color, #2563eb);border-left-color:var(--wsx-press-sidebar-active-color, #2563eb);font-weight:500}@media (max-width: 1024px){wsx-doc-sidebar{width:240px;min-width:240px}}@media (max-width: 768px){wsx-doc-sidebar{display:none}}";
792
+ Te = it;
793
+ [rt, je] = Ve(Te, [], Le, 0, void 0, X).c;
794
+ je();
795
+ const be = "wsx-doc-sidebar{display:flex;flex-direction:column;width:280px;min-width:280px;height:100%;background:var(--wsx-press-sidebar-bg, #f9fafb);border-right:1px solid var(--wsx-press-border, #e5e7eb);overflow-y:auto;position:sticky;top:70px;max-height:calc(100vh - 70px)}.light wsx-doc-sidebar,[data-theme=light] wsx-doc-sidebar{background:var(--wsx-press-sidebar-bg, #f9fafb);border-right-color:var(--wsx-press-border, #e5e7eb)}.dark wsx-doc-sidebar,[data-theme=dark] wsx-doc-sidebar{background:var(--wsx-press-sidebar-bg, #1f2937);border-right-color:var(--wsx-press-border, #374151)}@media (prefers-color-scheme: dark){html:not(.light):not([data-theme=light]) wsx-doc-sidebar{background:var(--wsx-press-sidebar-bg, #1f2937);border-right-color:var(--wsx-press-border, #374151)}}.doc-sidebar{display:flex;flex-direction:column;width:100%;height:100%}.doc-sidebar-loading,.doc-sidebar-empty{padding:2rem;text-align:center;color:var(--wsx-press-text-secondary, #6b7280)}.doc-sidebar-nav{padding:1.5rem 0}.doc-sidebar-category{margin-bottom:2rem}.doc-sidebar-category:last-child{margin-bottom:0}.doc-sidebar-category-title{font-size:.875rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--wsx-press-text-secondary, #6b7280);padding:.5rem 1.5rem;margin:0 0 .5rem}.light .doc-sidebar-category-title,[data-theme=light] .doc-sidebar-category-title{color:var(--wsx-press-text-secondary, #6b7280)}.dark .doc-sidebar-category-title,[data-theme=dark] .doc-sidebar-category-title{color:var(--wsx-press-text-secondary, #9ca3af)}@media (prefers-color-scheme: dark){html:not(.light):not([data-theme=light]) .doc-sidebar-category-title{color:var(--wsx-press-text-secondary, #9ca3af)}}.doc-sidebar-list{list-style:none;margin:0;padding:0}.doc-sidebar-item{margin:0}.doc-sidebar-link{display:block;padding:.5rem 1.5rem;color:var(--wsx-press-text-primary, #111827);text-decoration:none;font-size:.875rem;line-height:1.5;transition:all .2s ease;border-left:3px solid transparent}.doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #f3f4f6);color:var(--wsx-press-text-primary, #111827)}.doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, #fef2f2);color:var(--wsx-press-sidebar-active-color, #dc2626);border-left-color:var(--wsx-press-sidebar-active-color, #dc2626);font-weight:500}.light .doc-sidebar-link,[data-theme=light] .doc-sidebar-link{color:var(--wsx-press-text-primary, #111827)}.light .doc-sidebar-link:hover,[data-theme=light] .doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #f3f4f6);color:var(--wsx-press-text-primary, #111827)}.light .doc-sidebar-link.active,[data-theme=light] .doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, #fef2f2);color:var(--wsx-press-sidebar-active-color, #dc2626);border-left-color:var(--wsx-press-sidebar-active-color, #dc2626)}.dark .doc-sidebar-link,[data-theme=dark] .doc-sidebar-link{color:var(--wsx-press-text-primary, #e5e7eb)}.dark .doc-sidebar-link:hover,[data-theme=dark] .doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #374151);color:var(--wsx-press-text-primary, #f3f4f6)}.dark .doc-sidebar-link.active,[data-theme=dark] .doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, rgba(220, 38, 38, .15));color:var(--wsx-press-sidebar-active-color, #f87171);border-left-color:var(--wsx-press-sidebar-active-color, #f87171)}@media (prefers-color-scheme: dark){html:not(.light):not([data-theme=light]) .doc-sidebar-link{color:var(--wsx-press-text-primary, #e5e7eb)}html:not(.light):not([data-theme=light]) .doc-sidebar-link:hover{background:var(--wsx-press-sidebar-hover-bg, #374151);color:var(--wsx-press-text-primary, #f3f4f6)}html:not(.light):not([data-theme=light]) .doc-sidebar-link.active{background:var(--wsx-press-sidebar-active-bg, rgba(220, 38, 38, .15));color:var(--wsx-press-sidebar-active-color, #f87171);border-left-color:var(--wsx-press-sidebar-active-color, #f87171)}}@media (max-width: 1024px){wsx-doc-sidebar{width:240px;min-width:240px}}@media (max-width: 768px){wsx-doc-sidebar{display:none}}";
783
796
  var Re;
784
797
  let Ae, Pe;
785
- function oe(t, e, r) {
798
+ function se(t, e, r) {
786
799
  return (e = ze(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
787
800
  }
788
- function ot(t, e, r, s, d, I) {
789
- function g(i, c, u) {
790
- return function(n, a) {
791
- return u && u(n), i[c].call(n, a);
801
+ function st(t, e, r, n, u, C) {
802
+ function g(i, c, d) {
803
+ return function(o, a) {
804
+ return d && d(o), i[c].call(o, a);
792
805
  };
793
806
  }
794
- function x(i, c) {
795
- for (var u = 0; u < i.length; u++) i[u].call(c);
807
+ function w(i, c) {
808
+ for (var d = 0; d < i.length; d++) i[d].call(c);
796
809
  return c;
797
810
  }
798
- function v(i, c, u, n) {
799
- if (typeof i != "function" && (n || i !== void 0)) throw new TypeError(c + " must " + (u || "be") + " a function" + (n ? "" : " or undefined"));
811
+ function y(i, c, d, o) {
812
+ if (typeof i != "function" && (o || i !== void 0)) throw new TypeError(c + " must " + (d || "be") + " a function" + (o ? "" : " or undefined"));
800
813
  return i;
801
814
  }
802
- function M(i, c, u, n, a, L, k, T, z, C, y, m, p) {
803
- function S(l) {
815
+ function N(i, c, d, o, a, L, $, O, z, S, v, m, p) {
816
+ function k(l) {
804
817
  if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
805
818
  }
806
- var h, D = c[0], E = c[3], j = !T;
807
- if (!j) {
808
- u || Array.isArray(D) || (D = [D]);
809
- var o = {}, _ = [], b = a === 3 ? "get" : a === 4 || m ? "set" : "value";
810
- C ? (y || m ? o = { get: ye(function() {
819
+ var h, D = c[0], E = c[3], T = !O;
820
+ if (!T) {
821
+ d || Array.isArray(D) || (D = [D]);
822
+ var s = {}, _ = [], b = a === 3 ? "get" : a === 4 || m ? "set" : "value";
823
+ S ? (v || m ? s = { get: ye(function() {
811
824
  return E(this);
812
- }, n, "get"), set: function(l) {
825
+ }, o, "get"), set: function(l) {
813
826
  c[4](this, l);
814
- } } : o[b] = E, y || ye(o[b], n, a === 2 ? "" : b)) : y || (o = Object.getOwnPropertyDescriptor(i, n));
827
+ } } : s[b] = E, v || ye(s[b], o, a === 2 ? "" : b)) : v || (s = Object.getOwnPropertyDescriptor(i, o));
815
828
  }
816
- for (var f = i, q = D.length - 1; q >= 0; q -= u ? 2 : 1) {
817
- var H = D[q], K = u ? D[q - 1] : void 0, B = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: n, metadata: L, addInitializer: (function(l, O) {
829
+ for (var f = i, q = D.length - 1; q >= 0; q -= d ? 2 : 1) {
830
+ var H = D[q], K = d ? D[q - 1] : void 0, W = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: o, metadata: L, addInitializer: (function(l, I) {
818
831
  if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
819
- v(O, "An initializer", "be", !0), k.push(O);
820
- }).bind(null, B) };
832
+ y(I, "An initializer", "be", !0), $.push(I);
833
+ }).bind(null, W) };
821
834
  try {
822
- if (j) (h = v(H.call(K, f, R), "class decorators", "return")) && (f = h);
835
+ if (T) (h = y(H.call(K, f, R), "class decorators", "return")) && (f = h);
823
836
  else {
824
837
  var A, F;
825
- R.static = z, R.private = C, C ? a === 2 ? A = function(l) {
826
- return S(l), o.value;
827
- } : (a < 4 && (A = g(o, "get", S)), a !== 3 && (F = g(o, "set", S))) : (A = function(l) {
828
- return l[n];
829
- }, (a < 2 || a === 4) && (F = function(l, O) {
830
- l[n] = O;
838
+ R.static = z, R.private = S, S ? a === 2 ? A = function(l) {
839
+ return k(l), s.value;
840
+ } : (a < 4 && (A = g(s, "get", k)), a !== 3 && (F = g(s, "set", k))) : (A = function(l) {
841
+ return l[o];
842
+ }, (a < 2 || a === 4) && (F = function(l, I) {
843
+ l[o] = I;
831
844
  }));
832
- var W = R.access = { has: C ? p.bind() : function(l) {
833
- return n in l;
845
+ var B = R.access = { has: S ? p.bind() : function(l) {
846
+ return o in l;
834
847
  } };
835
- if (A && (W.get = A), F && (W.set = F), f = H.call(K, m ? { get: o.get, set: o.set } : o[b], R), m) {
836
- if (typeof f == "object" && f) (h = v(f.get, "accessor.get")) && (o.get = h), (h = v(f.set, "accessor.set")) && (o.set = h), (h = v(f.init, "accessor.init")) && _.push(h);
848
+ if (A && (B.get = A), F && (B.set = F), f = H.call(K, m ? { get: s.get, set: s.set } : s[b], R), m) {
849
+ if (typeof f == "object" && f) (h = y(f.get, "accessor.get")) && (s.get = h), (h = y(f.set, "accessor.set")) && (s.set = h), (h = y(f.init, "accessor.init")) && _.push(h);
837
850
  else if (f !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
838
- } else v(f, (y ? "field" : "method") + " decorators", "return") && (y ? _.push(f) : o[b] = f);
851
+ } else y(f, (v ? "field" : "method") + " decorators", "return") && (v ? _.push(f) : s[b] = f);
839
852
  }
840
853
  } finally {
841
- B.v = !0;
854
+ W.v = !0;
842
855
  }
843
856
  }
844
- return (y || m) && T.push(function(l, O) {
845
- for (var N = _.length - 1; N >= 0; N--) O = _[N].call(l, O);
846
- return O;
847
- }), y || j || (C ? m ? T.push(g(o, "get"), g(o, "set")) : T.push(a === 2 ? o[b] : g.call.bind(o[b])) : Object.defineProperty(i, n, o)), f;
857
+ return (v || m) && O.push(function(l, I) {
858
+ for (var M = _.length - 1; M >= 0; M--) I = _[M].call(l, I);
859
+ return I;
860
+ }), v || T || (S ? m ? O.push(g(s, "get"), g(s, "set")) : O.push(a === 2 ? s[b] : g.call.bind(s[b])) : Object.defineProperty(i, o, s)), f;
848
861
  }
849
- function $(i, c) {
862
+ function j(i, c) {
850
863
  return Object.defineProperty(i, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: c });
851
864
  }
852
- if (arguments.length >= 6) var U = I[Symbol.metadata || Symbol.for("Symbol.metadata")];
853
- var P = Object.create(U ?? null), Z = function(i, c, u, n) {
854
- var a, L, k = [], T = function(b) {
855
- return nt(b) === i;
865
+ if (arguments.length >= 6) var U = C[Symbol.metadata || Symbol.for("Symbol.metadata")];
866
+ var P = Object.create(U ?? null), Z = function(i, c, d, o) {
867
+ var a, L, $ = [], O = function(b) {
868
+ return at(b) === i;
856
869
  }, z = /* @__PURE__ */ new Map();
857
- function C(b) {
858
- b && k.push(x.bind(null, b));
870
+ function S(b) {
871
+ b && $.push(w.bind(null, b));
859
872
  }
860
- for (var y = 0; y < c.length; y++) {
861
- var m = c[y];
873
+ for (var v = 0; v < c.length; v++) {
874
+ var m = c[v];
862
875
  if (Array.isArray(m)) {
863
- var p = m[1], S = m[2], h = m.length > 3, D = 16 & p, E = !!(8 & p), j = (p &= 7) == 0, o = S + "/" + E;
864
- if (!j && !h) {
865
- var _ = z.get(o);
866
- if (_ === !0 || _ === 3 && p !== 4 || _ === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + S);
867
- z.set(o, !(p > 2) || p);
876
+ var p = m[1], k = m[2], h = m.length > 3, D = 16 & p, E = !!(8 & p), T = (p &= 7) == 0, s = k + "/" + E;
877
+ if (!T && !h) {
878
+ var _ = z.get(s);
879
+ if (_ === !0 || _ === 3 && p !== 4 || _ === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + k);
880
+ z.set(s, !(p > 2) || p);
868
881
  }
869
- M(E ? i : i.prototype, m, D, h ? "#" + S : ze(S), p, n, E ? L = L || [] : a = a || [], k, E, h, j, p === 1, E && h ? T : u);
882
+ N(E ? i : i.prototype, m, D, h ? "#" + k : ze(k), p, o, E ? L = L || [] : a = a || [], $, E, h, T, p === 1, E && h ? O : d);
870
883
  }
871
884
  }
872
- return C(a), C(L), k;
873
- }(t, e, d, P);
874
- return r.length || $(t, P), { e: Z, get c() {
885
+ return S(a), S(L), $;
886
+ }(t, e, u, P);
887
+ return r.length || j(t, P), { e: Z, get c() {
875
888
  var i = [];
876
- return r.length && [$(M(t, [r], s, t.name, 5, P, i), P), x.bind(null, i, t)];
889
+ return r.length && [j(N(t, [r], n, t.name, 5, P, i), P), w.bind(null, i, t)];
877
890
  } };
878
891
  }
879
892
  function ze(t) {
880
- var e = st(t, "string");
893
+ var e = ot(t, "string");
881
894
  return typeof e == "symbol" ? e : e + "";
882
895
  }
883
- function st(t, e) {
896
+ function ot(t, e) {
884
897
  if (typeof t != "object" || !t) return t;
885
898
  var r = t[Symbol.toPrimitive];
886
899
  if (r !== void 0) {
887
- var s = r.call(t, e);
888
- if (typeof s != "object") return s;
900
+ var n = r.call(t, e);
901
+ if (typeof n != "object") return n;
889
902
  throw new TypeError("@@toPrimitive must return a primitive value.");
890
903
  }
891
904
  return String(t);
@@ -898,12 +911,12 @@ function ye(t, e, r) {
898
911
  }
899
912
  return t;
900
913
  }
901
- function nt(t) {
914
+ function at(t) {
902
915
  if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
903
916
  return t;
904
917
  }
905
- const at = ae("DocSidebar");
906
- Pe = [se({
918
+ const nt = ne("DocSidebar");
919
+ Pe = [oe({
907
920
  tagName: "wsx-doc-sidebar"
908
921
  })];
909
922
  let ct;
@@ -912,8 +925,8 @@ class lt extends X {
912
925
  super({
913
926
  styles: be,
914
927
  styleName: "wsx-doc-sidebar"
915
- }), oe(this, "_autoStyles", be), oe(this, "metadata", void 0), oe(this, "currentRoute", void 0), oe(this, "isLoading", void 0), oe(this, "routeChangeUnsubscribe", null), oe(this, "handleDocClick", (g, x) => {
916
- x.preventDefault(), re.navigate(g);
928
+ }), se(this, "_autoStyles", be), se(this, "metadata", void 0), se(this, "currentRoute", void 0), se(this, "isLoading", void 0), se(this, "routeChangeUnsubscribe", null), se(this, "handleDocClick", (g, w) => {
929
+ w.preventDefault(), ie.navigate(g);
917
930
  });
918
931
  let e = this.reactive({});
919
932
  Object.defineProperty(this, "metadata", {
@@ -924,24 +937,24 @@ class lt extends X {
924
937
  enumerable: !0,
925
938
  configurable: !0
926
939
  });
927
- const [r, s] = this.useState("currentRoute", "");
940
+ const [r, n] = this.useState("currentRoute", "");
928
941
  Object.defineProperty(this, "currentRoute", {
929
942
  get: r,
930
- set: s,
943
+ set: n,
931
944
  enumerable: !0,
932
945
  configurable: !0
933
946
  });
934
- const [d, I] = this.useState("isLoading", !0);
947
+ const [u, C] = this.useState("isLoading", !0);
935
948
  Object.defineProperty(this, "isLoading", {
936
- get: d,
937
- set: I,
949
+ get: u,
950
+ set: C,
938
951
  enumerable: !0,
939
952
  configurable: !0
940
953
  });
941
954
  }
942
955
  async onConnected() {
943
956
  var e;
944
- (e = super.onConnected) == null || e.call(this), await this.loadMetadata(), this.routeChangeUnsubscribe = re.onRouteChange(() => {
957
+ (e = super.onConnected) == null || e.call(this), await this.loadMetadata(), this.routeChangeUnsubscribe = ie.onRouteChange(() => {
945
958
  this.updateCurrentRoute();
946
959
  }), this.updateCurrentRoute();
947
960
  }
@@ -954,14 +967,14 @@ class lt extends X {
954
967
  */
955
968
  async loadMetadata() {
956
969
  try {
957
- if (this.isLoading = !0, Y.data)
958
- this.metadata = Y.data;
970
+ if (this.isLoading = !0, G.data)
971
+ this.metadata = G.data;
959
972
  else {
960
973
  const e = await fetch("/.wsx-press/docs-meta.json");
961
974
  e.ok && (this.metadata = await e.json());
962
975
  }
963
976
  } catch (e) {
964
- at.error("Failed to load metadata", e);
977
+ nt.error("Failed to load metadata", e);
965
978
  } finally {
966
979
  this.isLoading = !1;
967
980
  }
@@ -970,7 +983,7 @@ class lt extends X {
970
983
  * 更新当前路由
971
984
  */
972
985
  updateCurrentRoute() {
973
- const e = re.getCurrentRoute();
986
+ const e = ie.getCurrentRoute();
974
987
  this.currentRoute = e.path;
975
988
  }
976
989
  /**
@@ -978,11 +991,11 @@ class lt extends X {
978
991
  */
979
992
  organizeByCategory() {
980
993
  const e = {};
981
- return Object.values(this.metadata).forEach((s) => {
982
- const d = s.category || "other";
983
- e[d] || (e[d] = []), e[d].push(s);
984
- }), Object.keys(e).sort().forEach((s) => {
985
- e[s].sort((d, I) => d.title.localeCompare(I.title));
994
+ return Object.values(this.metadata).forEach((n) => {
995
+ const u = n.category || "other";
996
+ e[u] || (e[u] = []), e[u].push(n);
997
+ }), Object.keys(e).sort().forEach((n) => {
998
+ e[n].sort((u, C) => u.order !== void 0 && C.order !== void 0 ? u.order - C.order : u.order !== void 0 ? -1 : C.order !== void 0 ? 1 : u.title.localeCompare(C.title));
986
999
  }), e;
987
1000
  }
988
1001
  /**
@@ -993,121 +1006,121 @@ class lt extends X {
993
1006
  }
994
1007
  render() {
995
1008
  if (this.isLoading)
996
- return /* @__PURE__ */ w("aside", { class: "doc-sidebar" }, /* @__PURE__ */ w("div", { class: "doc-sidebar-loading" }, "加载中..."));
1009
+ return /* @__PURE__ */ x("aside", { class: "doc-sidebar" }, /* @__PURE__ */ x("div", { class: "doc-sidebar-loading" }, "加载中..."));
997
1010
  const e = this.organizeByCategory(), r = Object.keys(e);
998
- return r.length === 0 ? /* @__PURE__ */ w("aside", { class: "doc-sidebar" }, /* @__PURE__ */ w("div", { class: "doc-sidebar-empty" }, "暂无文档")) : /* @__PURE__ */ w("aside", { class: "doc-sidebar" }, /* @__PURE__ */ w("nav", { class: "doc-sidebar-nav" }, r.map((s) => /* @__PURE__ */ w("div", { key: s, class: "doc-sidebar-category" }, /* @__PURE__ */ w("h3", { class: "doc-sidebar-category-title" }, s), /* @__PURE__ */ w("ul", { class: "doc-sidebar-list" }, e[s].map((d) => /* @__PURE__ */ w("li", { key: d.route, class: "doc-sidebar-item" }, /* @__PURE__ */ w("a", { href: d.route, class: `doc-sidebar-link ${this.isCurrentDoc(d.route) ? "active" : ""}`, onClick: (I) => this.handleDocClick(d.route, I) }, d.title))))))));
1011
+ return r.length === 0 ? /* @__PURE__ */ x("aside", { class: "doc-sidebar" }, /* @__PURE__ */ x("div", { class: "doc-sidebar-empty" }, "暂无文档")) : /* @__PURE__ */ x("aside", { class: "doc-sidebar" }, /* @__PURE__ */ x("nav", { class: "doc-sidebar-nav" }, r.map((n) => /* @__PURE__ */ x("div", { key: n, class: "doc-sidebar-category" }, /* @__PURE__ */ x("h3", { class: "doc-sidebar-category-title" }, n), /* @__PURE__ */ x("ul", { class: "doc-sidebar-list" }, e[n].map((u) => /* @__PURE__ */ x("li", { key: u.route, class: "doc-sidebar-item" }, /* @__PURE__ */ x("a", { href: u.route, class: `doc-sidebar-link ${this.isCurrentDoc(u.route) ? "active" : ""}`, onClick: (C) => this.handleDocClick(u.route, C) }, u.title))))))));
999
1012
  }
1000
1013
  }
1001
1014
  Re = lt;
1002
- [ct, Ae] = ot(Re, [], Pe, 0, void 0, X).c;
1015
+ [ct, Ae] = st(Re, [], Pe, 0, void 0, X).c;
1003
1016
  Ae();
1004
1017
  const ve = "wsx-doc-toc{display:flex;flex-direction:column;width:240px;min-width:240px;height:100%;overflow-y:auto;position:sticky;top:70px;max-height:calc(100vh - 70px)}.doc-toc{display:flex;flex-direction:column;width:100%;padding:1.5rem 1rem}.doc-toc-empty{padding:1rem;text-align:center;color:var(--wsx-press-text-secondary, #6b7280);font-size:.875rem}.doc-toc-title{font-size:.875rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--wsx-press-text-secondary, #6b7280);margin:0 0 1rem;padding:0}.doc-toc-nav{width:100%}.doc-toc-list{list-style:none;margin:0;padding:0}.doc-toc-sublist{margin-top:.25rem;padding-left:1rem}.doc-toc-item{margin:0;line-height:1.6}.doc-toc-item-level-1{margin-bottom:.5rem}.doc-toc-item-level-2{margin-bottom:.375rem;font-size:.875rem}.doc-toc-item-level-3{margin-bottom:.25rem;font-size:.8125rem}.doc-toc-item-level-4,.doc-toc-item-level-5,.doc-toc-item-level-6{margin-bottom:.25rem;font-size:.75rem}.doc-toc-link{display:block;color:var(--wsx-press-text-secondary, #6b7280);text-decoration:none;transition:color .2s ease;border-left:2px solid transparent;padding:.25rem 0 .25rem .5rem;margin-left:-.5rem}.doc-toc-link:hover{color:var(--wsx-press-text-primary, #111827)}.doc-toc-link.active{color:var(--wsx-press-toc-active-color, #2563eb);border-left-color:var(--wsx-press-toc-active-color, #2563eb);font-weight:500}@media (max-width: 1280px){wsx-doc-toc{display:none}}";
1005
1018
  var qe;
1006
- let Fe, Me;
1007
- function te(t, e, r) {
1008
- return (e = Ne(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
1019
+ let Fe, Ne;
1020
+ function re(t, e, r) {
1021
+ return (e = Me(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
1009
1022
  }
1010
- function ut(t, e, r, s, d, I) {
1011
- function g(i, c, u) {
1012
- return function(n, a) {
1013
- return u && u(n), i[c].call(n, a);
1023
+ function dt(t, e, r, n, u, C) {
1024
+ function g(i, c, d) {
1025
+ return function(o, a) {
1026
+ return d && d(o), i[c].call(o, a);
1014
1027
  };
1015
1028
  }
1016
- function x(i, c) {
1017
- for (var u = 0; u < i.length; u++) i[u].call(c);
1029
+ function w(i, c) {
1030
+ for (var d = 0; d < i.length; d++) i[d].call(c);
1018
1031
  return c;
1019
1032
  }
1020
- function v(i, c, u, n) {
1021
- if (typeof i != "function" && (n || i !== void 0)) throw new TypeError(c + " must " + (u || "be") + " a function" + (n ? "" : " or undefined"));
1033
+ function y(i, c, d, o) {
1034
+ if (typeof i != "function" && (o || i !== void 0)) throw new TypeError(c + " must " + (d || "be") + " a function" + (o ? "" : " or undefined"));
1022
1035
  return i;
1023
1036
  }
1024
- function M(i, c, u, n, a, L, k, T, z, C, y, m, p) {
1025
- function S(l) {
1037
+ function N(i, c, d, o, a, L, $, O, z, S, v, m, p) {
1038
+ function k(l) {
1026
1039
  if (!p(l)) throw new TypeError("Attempted to access private element on non-instance");
1027
1040
  }
1028
- var h, D = c[0], E = c[3], j = !T;
1029
- if (!j) {
1030
- u || Array.isArray(D) || (D = [D]);
1031
- var o = {}, _ = [], b = a === 3 ? "get" : a === 4 || m ? "set" : "value";
1032
- C ? (y || m ? o = { get: xe(function() {
1041
+ var h, D = c[0], E = c[3], T = !O;
1042
+ if (!T) {
1043
+ d || Array.isArray(D) || (D = [D]);
1044
+ var s = {}, _ = [], b = a === 3 ? "get" : a === 4 || m ? "set" : "value";
1045
+ S ? (v || m ? s = { get: xe(function() {
1033
1046
  return E(this);
1034
- }, n, "get"), set: function(l) {
1047
+ }, o, "get"), set: function(l) {
1035
1048
  c[4](this, l);
1036
- } } : o[b] = E, y || xe(o[b], n, a === 2 ? "" : b)) : y || (o = Object.getOwnPropertyDescriptor(i, n));
1049
+ } } : s[b] = E, v || xe(s[b], o, a === 2 ? "" : b)) : v || (s = Object.getOwnPropertyDescriptor(i, o));
1037
1050
  }
1038
- for (var f = i, q = D.length - 1; q >= 0; q -= u ? 2 : 1) {
1039
- var H = D[q], K = u ? D[q - 1] : void 0, B = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: n, metadata: L, addInitializer: (function(l, O) {
1051
+ for (var f = i, q = D.length - 1; q >= 0; q -= d ? 2 : 1) {
1052
+ var H = D[q], K = d ? D[q - 1] : void 0, W = {}, R = { kind: ["field", "accessor", "method", "getter", "setter", "class"][a], name: o, metadata: L, addInitializer: (function(l, I) {
1040
1053
  if (l.v) throw Error("attempted to call addInitializer after decoration was finished");
1041
- v(O, "An initializer", "be", !0), k.push(O);
1042
- }).bind(null, B) };
1054
+ y(I, "An initializer", "be", !0), $.push(I);
1055
+ }).bind(null, W) };
1043
1056
  try {
1044
- if (j) (h = v(H.call(K, f, R), "class decorators", "return")) && (f = h);
1057
+ if (T) (h = y(H.call(K, f, R), "class decorators", "return")) && (f = h);
1045
1058
  else {
1046
1059
  var A, F;
1047
- R.static = z, R.private = C, C ? a === 2 ? A = function(l) {
1048
- return S(l), o.value;
1049
- } : (a < 4 && (A = g(o, "get", S)), a !== 3 && (F = g(o, "set", S))) : (A = function(l) {
1050
- return l[n];
1051
- }, (a < 2 || a === 4) && (F = function(l, O) {
1052
- l[n] = O;
1060
+ R.static = z, R.private = S, S ? a === 2 ? A = function(l) {
1061
+ return k(l), s.value;
1062
+ } : (a < 4 && (A = g(s, "get", k)), a !== 3 && (F = g(s, "set", k))) : (A = function(l) {
1063
+ return l[o];
1064
+ }, (a < 2 || a === 4) && (F = function(l, I) {
1065
+ l[o] = I;
1053
1066
  }));
1054
- var W = R.access = { has: C ? p.bind() : function(l) {
1055
- return n in l;
1067
+ var B = R.access = { has: S ? p.bind() : function(l) {
1068
+ return o in l;
1056
1069
  } };
1057
- if (A && (W.get = A), F && (W.set = F), f = H.call(K, m ? { get: o.get, set: o.set } : o[b], R), m) {
1058
- if (typeof f == "object" && f) (h = v(f.get, "accessor.get")) && (o.get = h), (h = v(f.set, "accessor.set")) && (o.set = h), (h = v(f.init, "accessor.init")) && _.push(h);
1070
+ if (A && (B.get = A), F && (B.set = F), f = H.call(K, m ? { get: s.get, set: s.set } : s[b], R), m) {
1071
+ if (typeof f == "object" && f) (h = y(f.get, "accessor.get")) && (s.get = h), (h = y(f.set, "accessor.set")) && (s.set = h), (h = y(f.init, "accessor.init")) && _.push(h);
1059
1072
  else if (f !== void 0) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
1060
- } else v(f, (y ? "field" : "method") + " decorators", "return") && (y ? _.push(f) : o[b] = f);
1073
+ } else y(f, (v ? "field" : "method") + " decorators", "return") && (v ? _.push(f) : s[b] = f);
1061
1074
  }
1062
1075
  } finally {
1063
- B.v = !0;
1076
+ W.v = !0;
1064
1077
  }
1065
1078
  }
1066
- return (y || m) && T.push(function(l, O) {
1067
- for (var N = _.length - 1; N >= 0; N--) O = _[N].call(l, O);
1068
- return O;
1069
- }), y || j || (C ? m ? T.push(g(o, "get"), g(o, "set")) : T.push(a === 2 ? o[b] : g.call.bind(o[b])) : Object.defineProperty(i, n, o)), f;
1079
+ return (v || m) && O.push(function(l, I) {
1080
+ for (var M = _.length - 1; M >= 0; M--) I = _[M].call(l, I);
1081
+ return I;
1082
+ }), v || T || (S ? m ? O.push(g(s, "get"), g(s, "set")) : O.push(a === 2 ? s[b] : g.call.bind(s[b])) : Object.defineProperty(i, o, s)), f;
1070
1083
  }
1071
- function $(i, c) {
1084
+ function j(i, c) {
1072
1085
  return Object.defineProperty(i, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: c });
1073
1086
  }
1074
- if (arguments.length >= 6) var U = I[Symbol.metadata || Symbol.for("Symbol.metadata")];
1075
- var P = Object.create(U ?? null), Z = function(i, c, u, n) {
1076
- var a, L, k = [], T = function(b) {
1087
+ if (arguments.length >= 6) var U = C[Symbol.metadata || Symbol.for("Symbol.metadata")];
1088
+ var P = Object.create(U ?? null), Z = function(i, c, d, o) {
1089
+ var a, L, $ = [], O = function(b) {
1077
1090
  return ht(b) === i;
1078
1091
  }, z = /* @__PURE__ */ new Map();
1079
- function C(b) {
1080
- b && k.push(x.bind(null, b));
1092
+ function S(b) {
1093
+ b && $.push(w.bind(null, b));
1081
1094
  }
1082
- for (var y = 0; y < c.length; y++) {
1083
- var m = c[y];
1095
+ for (var v = 0; v < c.length; v++) {
1096
+ var m = c[v];
1084
1097
  if (Array.isArray(m)) {
1085
- var p = m[1], S = m[2], h = m.length > 3, D = 16 & p, E = !!(8 & p), j = (p &= 7) == 0, o = S + "/" + E;
1086
- if (!j && !h) {
1087
- var _ = z.get(o);
1088
- if (_ === !0 || _ === 3 && p !== 4 || _ === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + S);
1089
- z.set(o, !(p > 2) || p);
1098
+ var p = m[1], k = m[2], h = m.length > 3, D = 16 & p, E = !!(8 & p), T = (p &= 7) == 0, s = k + "/" + E;
1099
+ if (!T && !h) {
1100
+ var _ = z.get(s);
1101
+ if (_ === !0 || _ === 3 && p !== 4 || _ === 4 && p !== 3) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + k);
1102
+ z.set(s, !(p > 2) || p);
1090
1103
  }
1091
- M(E ? i : i.prototype, m, D, h ? "#" + S : Ne(S), p, n, E ? L = L || [] : a = a || [], k, E, h, j, p === 1, E && h ? T : u);
1104
+ N(E ? i : i.prototype, m, D, h ? "#" + k : Me(k), p, o, E ? L = L || [] : a = a || [], $, E, h, T, p === 1, E && h ? O : d);
1092
1105
  }
1093
1106
  }
1094
- return C(a), C(L), k;
1095
- }(t, e, d, P);
1096
- return r.length || $(t, P), { e: Z, get c() {
1107
+ return S(a), S(L), $;
1108
+ }(t, e, u, P);
1109
+ return r.length || j(t, P), { e: Z, get c() {
1097
1110
  var i = [];
1098
- return r.length && [$(M(t, [r], s, t.name, 5, P, i), P), x.bind(null, i, t)];
1111
+ return r.length && [j(N(t, [r], n, t.name, 5, P, i), P), w.bind(null, i, t)];
1099
1112
  } };
1100
1113
  }
1101
- function Ne(t) {
1102
- var e = dt(t, "string");
1114
+ function Me(t) {
1115
+ var e = ut(t, "string");
1103
1116
  return typeof e == "symbol" ? e : e + "";
1104
1117
  }
1105
- function dt(t, e) {
1118
+ function ut(t, e) {
1106
1119
  if (typeof t != "object" || !t) return t;
1107
1120
  var r = t[Symbol.toPrimitive];
1108
1121
  if (r !== void 0) {
1109
- var s = r.call(t, e);
1110
- if (typeof s != "object") return s;
1122
+ var n = r.call(t, e);
1123
+ if (typeof n != "object") return n;
1111
1124
  throw new TypeError("@@toPrimitive must return a primitive value.");
1112
1125
  }
1113
1126
  return String(t);
@@ -1124,7 +1137,7 @@ function ht(t) {
1124
1137
  if (Object(t) !== t) throw TypeError("right-hand side of 'in' should be an object, got " + (t !== null ? typeof t : "null"));
1125
1138
  return t;
1126
1139
  }
1127
- const ft = ae("DocTOC"), ee = {
1140
+ const ft = ne("DocTOC"), ee = {
1128
1141
  data: null,
1129
1142
  promise: null
1130
1143
  };
@@ -1141,7 +1154,7 @@ async function gt() {
1141
1154
  }
1142
1155
  })()), ee.promise);
1143
1156
  }
1144
- Me = [se({
1157
+ Ne = [oe({
1145
1158
  tagName: "wsx-doc-toc"
1146
1159
  })];
1147
1160
  let mt;
@@ -1150,34 +1163,34 @@ class pt extends X {
1150
1163
  super({
1151
1164
  styles: ve,
1152
1165
  styleName: "wsx-doc-toc"
1153
- }), te(this, "_autoStyles", ve), te(this, "items", void 0), te(this, "activeId", void 0), te(this, "observer", null), te(this, "headingElements", /* @__PURE__ */ new Map()), te(this, "routeChangeUnsubscribe", null), te(this, "handleTOCClick", (d, I) => {
1154
- I.preventDefault();
1155
- const g = this.headingElements.get(d);
1166
+ }), re(this, "_autoStyles", ve), re(this, "items", void 0), re(this, "activeId", void 0), re(this, "observer", null), re(this, "headingElements", /* @__PURE__ */ new Map()), re(this, "routeChangeUnsubscribe", null), re(this, "handleTOCClick", (u, C) => {
1167
+ C.preventDefault();
1168
+ const g = this.headingElements.get(u);
1156
1169
  g && (g.scrollIntoView({
1157
1170
  behavior: "smooth",
1158
1171
  block: "start"
1159
- }), window.history.replaceState(null, "", `#${d}`));
1172
+ }), window.history.replaceState(null, "", `#${u}`));
1160
1173
  });
1161
1174
  let e = this.reactive([]);
1162
1175
  Object.defineProperty(this, "items", {
1163
1176
  get: () => e,
1164
- set: (d) => {
1165
- e = d !== null && typeof d < "u" && (Array.isArray(d) || typeof d == "object") ? this.reactive(d) : d, this.scheduleRerender();
1177
+ set: (u) => {
1178
+ e = u !== null && typeof u < "u" && (Array.isArray(u) || typeof u == "object") ? this.reactive(u) : u, this.scheduleRerender();
1166
1179
  },
1167
1180
  enumerable: !0,
1168
1181
  configurable: !0
1169
1182
  });
1170
- const [r, s] = this.useState("activeId", "");
1183
+ const [r, n] = this.useState("activeId", "");
1171
1184
  Object.defineProperty(this, "activeId", {
1172
1185
  get: r,
1173
- set: s,
1186
+ set: n,
1174
1187
  enumerable: !0,
1175
1188
  configurable: !0
1176
1189
  });
1177
1190
  }
1178
1191
  async onConnected() {
1179
1192
  var e;
1180
- (e = super.onConnected) == null || e.call(this), await this.loadTOC(), this.routeChangeUnsubscribe = re.onRouteChange(() => {
1193
+ (e = super.onConnected) == null || e.call(this), await this.loadTOC(), this.routeChangeUnsubscribe = ie.onRouteChange(() => {
1181
1194
  this.loadTOC();
1182
1195
  });
1183
1196
  }
@@ -1190,13 +1203,20 @@ class pt extends X {
1190
1203
  */
1191
1204
  async loadTOC() {
1192
1205
  try {
1193
- const r = re.getCurrentRoute().params;
1194
- if (!r.category || !r.page) {
1206
+ const e = ie.getCurrentRoute();
1207
+ let r;
1208
+ if (e.path.startsWith("/docs/"))
1209
+ r = e.path.slice(6);
1210
+ else {
1211
+ this.items = [];
1212
+ return;
1213
+ }
1214
+ if (!r || r.trim() === "") {
1195
1215
  this.items = [];
1196
1216
  return;
1197
1217
  }
1198
- const s = `${r.category}/${r.page}`, d = await gt();
1199
- this.items = d[s] || [], requestAnimationFrame(() => {
1218
+ const n = await gt();
1219
+ this.items = n[r] || [], requestAnimationFrame(() => {
1200
1220
  this.setupHeadingIds(), this.setupScrollObserver();
1201
1221
  });
1202
1222
  } catch (e) {
@@ -1211,12 +1231,12 @@ class pt extends X {
1211
1231
  if (!e)
1212
1232
  return;
1213
1233
  const r = e.querySelectorAll("h1, h2, h3, h4, h5, h6, wsx-marked-heading");
1214
- this.headingElements.clear(), r.forEach((s) => {
1234
+ this.headingElements.clear(), r.forEach((n) => {
1215
1235
  var g;
1216
- const d = ((g = s.textContent) == null ? void 0 : g.trim()) || "";
1217
- if (!d) return;
1218
- const I = this.generateId(d);
1219
- s instanceof HTMLElement && (s.id = I, this.headingElements.set(I, s));
1236
+ const u = ((g = n.textContent) == null ? void 0 : g.trim()) || "";
1237
+ if (!u) return;
1238
+ const C = this.generateId(u);
1239
+ n instanceof HTMLElement && (n.id = C, this.headingElements.set(C, n));
1220
1240
  });
1221
1241
  }
1222
1242
  /**
@@ -1230,10 +1250,10 @@ class pt extends X {
1230
1250
  */
1231
1251
  setupScrollObserver() {
1232
1252
  "IntersectionObserver" in window && (this.observer = new IntersectionObserver((e) => {
1233
- const r = e.filter((s) => s.isIntersecting);
1234
- r.length > 0 && (r.sort((s, d) => {
1235
- const I = s.boundingClientRect.top, g = d.boundingClientRect.top;
1236
- return Math.abs(I) - Math.abs(g);
1253
+ const r = e.filter((n) => n.isIntersecting);
1254
+ r.length > 0 && (r.sort((n, u) => {
1255
+ const C = n.boundingClientRect.top, g = u.boundingClientRect.top;
1256
+ return Math.abs(C) - Math.abs(g);
1237
1257
  }), this.activeId = r[0].target.id);
1238
1258
  }, {
1239
1259
  rootMargin: "-100px 0px -80% 0px",
@@ -1247,19 +1267,19 @@ class pt extends X {
1247
1267
  * 渲染 TOC 项
1248
1268
  */
1249
1269
  renderTOCItem(e) {
1250
- const r = this.activeId === e.id, s = e.children.length > 0;
1251
- return /* @__PURE__ */ w("li", { class: `doc-toc-item doc-toc-item-level-${e.level}` }, /* @__PURE__ */ w("a", { href: `#${e.id}`, class: `doc-toc-link ${r ? "active" : ""}`, onClick: (d) => this.handleTOCClick(e.id, d) }, e.text), s && /* @__PURE__ */ w("ul", { class: "doc-toc-list doc-toc-sublist" }, e.children.map((d) => this.renderTOCItem(d))));
1270
+ const r = this.activeId === e.id, n = e.children.length > 0;
1271
+ return /* @__PURE__ */ x("li", { class: `doc-toc-item doc-toc-item-level-${e.level}` }, /* @__PURE__ */ x("a", { href: `#${e.id}`, class: `doc-toc-link ${r ? "active" : ""}`, onClick: (u) => this.handleTOCClick(e.id, u) }, e.text), n && /* @__PURE__ */ x("ul", { class: "doc-toc-list doc-toc-sublist" }, e.children.map((u) => this.renderTOCItem(u))));
1252
1272
  }
1253
1273
  render() {
1254
- return this.items.length === 0 ? /* @__PURE__ */ w("aside", { class: "doc-toc" }, /* @__PURE__ */ w("div", { class: "doc-toc-empty" }, "暂无目录")) : /* @__PURE__ */ w("aside", { class: "doc-toc" }, /* @__PURE__ */ w("h3", { class: "doc-toc-title" }, "目录"), /* @__PURE__ */ w("nav", { class: "doc-toc-nav" }, /* @__PURE__ */ w("ul", { class: "doc-toc-list" }, this.items.map((e) => this.renderTOCItem(e)))));
1274
+ return this.items.length === 0 ? /* @__PURE__ */ x("aside", { class: "doc-toc" }, /* @__PURE__ */ x("div", { class: "doc-toc-empty" }, "暂无目录")) : /* @__PURE__ */ x("aside", { class: "doc-toc" }, /* @__PURE__ */ x("h3", { class: "doc-toc-title" }, "目录"), /* @__PURE__ */ x("nav", { class: "doc-toc-nav" }, /* @__PURE__ */ x("ul", { class: "doc-toc-list" }, this.items.map((e) => this.renderTOCItem(e)))));
1255
1275
  }
1256
1276
  }
1257
1277
  qe = pt;
1258
- [mt, Fe] = ut(qe, [], Me, 0, void 0, X).c;
1278
+ [mt, Fe] = dt(qe, [], Ne, 0, void 0, X).c;
1259
1279
  Fe();
1260
1280
  export {
1261
1281
  rt as DocLayout,
1262
- We as DocPage,
1282
+ Be as DocPage,
1263
1283
  Xe as DocSearch,
1264
1284
  ct as DocSidebar,
1265
1285
  mt as DocTOC