@rinova/devtools 0.0.0-stage → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,3233 @@
1
+ // src/utils/format.ts
2
+ function e(e) {
3
+ if (!Number.isFinite(e) || e <= 0) return "0 B";
4
+ let t = [
5
+ "B",
6
+ "KB",
7
+ "MB",
8
+ "GB"
9
+ ], n = e, r = 0;
10
+ for (; n >= 1024 && r < t.length - 1;) n /= 1024, r++;
11
+ return `${n >= 100 || r === 0 ? Math.round(n) : n.toFixed(1)} ${t[r]}`;
12
+ }
13
+ function t(e) {
14
+ return !Number.isFinite(e) || e < 0 ? "—" : e < 1 ? "<1 ms" : e < 1e3 ? `${Math.round(e)} ms` : `${(e / 1e3).toFixed(2)} s`;
15
+ }
16
+ function n(e) {
17
+ let t = new Date(e), n = (e, t = 2) => String(e).padStart(t, "0");
18
+ return `${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}.${n(t.getMilliseconds(), 3)}`;
19
+ }
20
+ function r(e, t) {
21
+ return e.length > t ? `${e.slice(0, t)}…` : e;
22
+ }
23
+ function i(e, t = 400) {
24
+ let n = /* @__PURE__ */ new WeakSet();
25
+ try {
26
+ let i = JSON.stringify(e, (e, t) => {
27
+ if (typeof t == "function") return `[Function ${t.name || "anonymous"}]`;
28
+ if (typeof t == "bigint") return `${t}n`;
29
+ if (t && typeof t == "object") {
30
+ if (n.has(t)) return "[Circular]";
31
+ n.add(t);
32
+ }
33
+ return t;
34
+ }, 2);
35
+ return i === void 0 ? String(e) : r(i, t);
36
+ } catch {
37
+ return String(e);
38
+ }
39
+ }
40
+ function a(e) {
41
+ if (!e) return "";
42
+ try {
43
+ return JSON.stringify(JSON.parse(e), null, 2);
44
+ } catch {
45
+ return e;
46
+ }
47
+ }
48
+ function o(e) {
49
+ if (!e) return !1;
50
+ let t = e.trim();
51
+ if (!/^[[{]/.test(t)) return !1;
52
+ try {
53
+ return JSON.parse(t), !0;
54
+ } catch {
55
+ return !1;
56
+ }
57
+ }
58
+ function s(e = "rdt") {
59
+ return `${e}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
60
+ }
61
+ function c(e) {
62
+ return typeof e == "string" ? e : e instanceof URL ? e.toString() : e.url;
63
+ }
64
+ function l(e) {
65
+ let t = {};
66
+ if (!e) return t;
67
+ if (e instanceof Headers) e.forEach((e, n) => {
68
+ t[n] = e;
69
+ });
70
+ else if (Array.isArray(e)) for (let [n, r] of e) t[n] = r;
71
+ else Object.assign(t, e);
72
+ return t;
73
+ }
74
+ // src/core/console-capture.ts
75
+ var u = [
76
+ "log",
77
+ "info",
78
+ "warn",
79
+ "error",
80
+ "debug"
81
+ ];
82
+ function d(e) {
83
+ return e.map((e) => typeof e == "string" ? e : e instanceof Error ? `${e.name}: ${e.message}` : e instanceof Element ? `<${e.tagName.toLowerCase()}>` : i(e, 600)).join(" ");
84
+ }
85
+ var f = class {
86
+ maxEntries;
87
+ list = [];
88
+ listeners = /* @__PURE__ */ new Set();
89
+ changeListeners = /* @__PURE__ */ new Set();
90
+ originals = /* @__PURE__ */ new Map();
91
+ started = !1;
92
+ seq = 0;
93
+ onError = (e) => {
94
+ this.append("error", [`${e.message} (${e.filename}:${e.lineno})`]);
95
+ };
96
+ onRejection = (e) => {
97
+ this.append("error", ["Unhandled rejection:", e.reason]);
98
+ };
99
+ constructor(e = 300) {
100
+ this.maxEntries = e;
101
+ }
102
+ start() {
103
+ if (!(this.started || typeof window > "u")) {
104
+ this.started = !0;
105
+ for (let e of u) {
106
+ let t = console[e];
107
+ this.originals.set(e, t), console[e] = (...n) => {
108
+ t.apply(console, n), this.append(e, n);
109
+ };
110
+ }
111
+ window.addEventListener("error", this.onError), window.addEventListener("unhandledrejection", this.onRejection);
112
+ }
113
+ }
114
+ stop() {
115
+ if (this.started) {
116
+ this.started = !1;
117
+ for (let [e, t] of this.originals) console[e] = t;
118
+ this.originals.clear(), window.removeEventListener("error", this.onError), window.removeEventListener("unhandledrejection", this.onRejection);
119
+ }
120
+ }
121
+ entries() {
122
+ return this.list;
123
+ }
124
+ subscribe(e) {
125
+ return this.listeners.add(e), () => this.listeners.delete(e);
126
+ }
127
+ subscribeChange(e) {
128
+ return this.changeListeners.add(e), () => this.changeListeners.delete(e);
129
+ }
130
+ clear() {
131
+ this.list = [];
132
+ for (let e of this.changeListeners) e();
133
+ }
134
+ append(e, t) {
135
+ let n = d(t), r = this.list[0];
136
+ if (r && r.level === e && r.args === n && Date.now() - r.at < 1200) {
137
+ r.count += 1, r.at = Date.now();
138
+ for (let e of this.changeListeners) e();
139
+ return;
140
+ }
141
+ let i = {
142
+ id: ++this.seq,
143
+ level: e,
144
+ at: Date.now(),
145
+ args: n,
146
+ count: 1
147
+ };
148
+ this.list.unshift(i), this.list.length > this.maxEntries && (this.list.length = this.maxEntries);
149
+ for (let e of this.changeListeners) e();
150
+ for (let e of this.listeners) e(i);
151
+ }
152
+ }, p = "general";
153
+ function m(e) {
154
+ switch (e.type) {
155
+ case "select": return e.defaultValue ?? e.options[0]?.value ?? "";
156
+ case "number": return e.defaultValue ?? 0;
157
+ case "switch": return e.defaultValue ?? !1;
158
+ default: return e.defaultValue ?? "";
159
+ }
160
+ }
161
+ function h(e, t) {
162
+ switch (e.type) {
163
+ case "switch":
164
+ if (typeof t == "string") {
165
+ let e = t.trim().toLowerCase();
166
+ return e !== "false" && e !== "0" && e !== "" && e !== "off";
167
+ }
168
+ return !!t;
169
+ case "number": {
170
+ let n = typeof t == "number" ? t : Number(t);
171
+ if (!Number.isFinite(n)) return m(e);
172
+ let r = n;
173
+ return e.min !== void 0 && (r = Math.max(e.min, r)), e.max !== void 0 && (r = Math.min(e.max, r)), r;
174
+ }
175
+ case "select": {
176
+ let n = t == null ? "" : String(t);
177
+ return !e.allowCustom && e.options.length && !e.options.some((e) => e.value === n) ? e.defaultValue ?? e.options[0].value : n;
178
+ }
179
+ case "text":
180
+ case "textarea": return t == null ? "" : String(t);
181
+ default: return null;
182
+ }
183
+ }
184
+ var g = class {
185
+ storage;
186
+ fieldsMap = /* @__PURE__ */ new Map();
187
+ groupOrder = [];
188
+ state = {};
189
+ persisted = {};
190
+ listeners = /* @__PURE__ */ new Set();
191
+ constructor(e, t, n = [], r = {}) {
192
+ this.storage = t, this.groupOrder = [...n], e.forEach((e) => this.fieldsMap.set(e.key, e)), this.persisted = this.storage.getJSON("values", {}), this.state = this.buildState(r), this.persist();
193
+ }
194
+ buildState(e) {
195
+ let t = this.persisted, n = {};
196
+ for (let [r, i] of this.fieldsMap) {
197
+ let a = Object.prototype.hasOwnProperty.call(e, r);
198
+ n[r] = h(i, this.isPersistent(i) && Object.prototype.hasOwnProperty.call(t, r) ? t[r] : a ? e[r] : m(i));
199
+ }
200
+ return n;
201
+ }
202
+ isPersistent(e) {
203
+ return e.persist !== !1;
204
+ }
205
+ persist() {
206
+ let e = {};
207
+ for (let [t, n] of this.fieldsMap) this.isPersistent(n) && (e[t] = this.state[t]);
208
+ this.storage.setJSON("values", e);
209
+ }
210
+ get fields() {
211
+ return [...this.fieldsMap.values()];
212
+ }
213
+ get groups() {
214
+ let e = [...this.groupOrder], t = new Set(e.map((e) => e.id));
215
+ for (let n of this.fieldsMap.values()) {
216
+ let r = n.group ?? p;
217
+ t.has(r) || (t.add(r), e.push({
218
+ id: r,
219
+ label: r === p ? "常规" : r
220
+ }));
221
+ }
222
+ return e;
223
+ }
224
+ fieldsOf(e) {
225
+ return this.fields.filter((t) => (t.group ?? p) === e);
226
+ }
227
+ get() {
228
+ return { ...this.state };
229
+ }
230
+ getValue(e, t) {
231
+ let n = this.state[e];
232
+ return n === void 0 ? t : n;
233
+ }
234
+ registerField(e) {
235
+ return this.fieldsMap.has(e.key) ? () => {} : (this.fieldsMap.set(e.key, e), this.state[e.key] = h(e, this.isPersistent(e) && Object.prototype.hasOwnProperty.call(this.persisted, e.key) ? this.persisted[e.key] : m(e)), this.persist(), () => {
236
+ this.fieldsMap.delete(e.key), delete this.state[e.key], this.persist();
237
+ });
238
+ }
239
+ set(e, t, n = "user") {
240
+ let r = this.fieldsMap.get(e);
241
+ if (!r) return !1;
242
+ let i = h(r, t);
243
+ return this.state[e] !== i && (this.state[e] = i, this.persist(), this.emit({
244
+ values: this.get(),
245
+ changed: e,
246
+ source: n
247
+ }), !0);
248
+ }
249
+ setMany(e, t = "program") {
250
+ let n = "";
251
+ for (let [t, r] of Object.entries(e)) {
252
+ let e = this.fieldsMap.get(t);
253
+ if (!e) continue;
254
+ let i = h(e, r);
255
+ this.state[t] !== i && (this.state[t] = i, n = t);
256
+ }
257
+ return n ? (this.persist(), this.emit({
258
+ values: this.get(),
259
+ changed: n,
260
+ source: t
261
+ }), !0) : !1;
262
+ }
263
+ reset() {
264
+ for (let [e, t] of this.fieldsMap) this.state[e] = m(t);
265
+ this.persist(), this.emit({
266
+ values: this.get(),
267
+ changed: "*",
268
+ source: "reset"
269
+ });
270
+ }
271
+ subscribe(e) {
272
+ return this.listeners.add(e), () => this.listeners.delete(e);
273
+ }
274
+ emit(e) {
275
+ for (let t of [...this.listeners]) try {
276
+ t(e);
277
+ } catch (e) {
278
+ console.error("[rinova-devtools] config listener error", e);
279
+ }
280
+ }
281
+ }, _ = class {
282
+ map = /* @__PURE__ */ new Map();
283
+ on(e, t) {
284
+ let n = this.map.get(e);
285
+ return n || (n = /* @__PURE__ */ new Set(), this.map.set(e, n)), n.add(t), () => this.off(e, t);
286
+ }
287
+ off(e, t) {
288
+ this.map.get(e)?.delete(t);
289
+ }
290
+ emit(e, t) {
291
+ let n = this.map.get(e);
292
+ if (n) for (let e of [...n]) try {
293
+ e(t);
294
+ } catch (e) {
295
+ console.error("[rinova-devtools] listener error", e);
296
+ }
297
+ }
298
+ clear() {
299
+ this.map.clear();
300
+ }
301
+ }, v = /json|text|xml|javascript|graphql|x-www-form-urlencoded|html|plain/i;
302
+ function y(e, t) {
303
+ let n = Object.keys(e).find((e) => e.toLowerCase() === t);
304
+ return n ? e[n] : "";
305
+ }
306
+ function b(e) {
307
+ if (e != null) {
308
+ if (typeof e == "string") return e;
309
+ if (e instanceof URLSearchParams) return e.toString();
310
+ if (e instanceof FormData) {
311
+ let t = [];
312
+ return e.forEach((e, n) => {
313
+ t.push(`${n}=${typeof e == "string" ? e : "[File]"}`);
314
+ }), t.join("&");
315
+ }
316
+ return e instanceof Blob ? `[Blob ${e.size} bytes]` : e instanceof ArrayBuffer ? `[ArrayBuffer ${e.byteLength} bytes]` : "[binary body]";
317
+ }
318
+ }
319
+ async function x(e, t = 2e5) {
320
+ let n = e.headers.get("content-type") ?? "";
321
+ if (v.test(n)) try {
322
+ let n = await Promise.race([e.text(), new Promise((e) => setTimeout(() => e(""), 4e3))]);
323
+ return n.length > t ? `${n.slice(0, t)}\n… [truncated ${n.length - t} chars]` : n;
324
+ } catch {
325
+ return;
326
+ }
327
+ }
328
+ var ee = class {
329
+ list = [];
330
+ listeners = /* @__PURE__ */ new Set();
331
+ changeListeners = /* @__PURE__ */ new Set();
332
+ maxEntries;
333
+ captureResponseBody;
334
+ ignore;
335
+ started = !1;
336
+ originalFetch;
337
+ originalXhrOpen;
338
+ originalXhrSend;
339
+ enabled = !0;
340
+ changeScheduled = !1;
341
+ constructor(e = {}) {
342
+ this.maxEntries = e.maxEntries ?? 200, this.captureResponseBody = e.responseBody ?? !0, this.ignore = e.ignore ?? [];
343
+ }
344
+ start() {
345
+ this.started || typeof window > "u" || (this.started = !0, this.patchFetch(), this.patchXhr());
346
+ }
347
+ stop() {
348
+ this.started && (this.started = !1, this.originalFetch && (window.fetch = this.originalFetch), this.originalXhrOpen && (XMLHttpRequest.prototype.open = this.originalXhrOpen), this.originalXhrSend && (XMLHttpRequest.prototype.send = this.originalXhrSend));
349
+ }
350
+ capturing() {
351
+ return this.enabled;
352
+ }
353
+ setCapturing(e) {
354
+ this.enabled = e, this.notifyChange();
355
+ }
356
+ entries() {
357
+ return this.list;
358
+ }
359
+ clear() {
360
+ this.list = [], this.notifyChange();
361
+ }
362
+ subscribe(e) {
363
+ return this.listeners.add(e), () => this.listeners.delete(e);
364
+ }
365
+ subscribeChange(e) {
366
+ return this.changeListeners.add(e), () => this.changeListeners.delete(e);
367
+ }
368
+ shouldIgnore(e) {
369
+ return this.ignore.some((t) => t && e.includes(t));
370
+ }
371
+ push(e) {
372
+ this.list.unshift(e), this.list.length > this.maxEntries && (this.list.length = this.maxEntries), this.scheduleChange();
373
+ }
374
+ update(e) {
375
+ this.scheduleChange();
376
+ for (let t of [...this.listeners]) t(e);
377
+ }
378
+ scheduleChange() {
379
+ this.changeScheduled || (this.changeScheduled = !0, queueMicrotask(() => {
380
+ this.changeScheduled = !1, this.notifyChange();
381
+ }));
382
+ }
383
+ notifyChange() {
384
+ for (let e of [...this.changeListeners]) e();
385
+ }
386
+ patchFetch() {
387
+ let e = window.fetch;
388
+ if (!e) return;
389
+ this.originalFetch = e;
390
+ let t = this;
391
+ window.fetch = async function(n, r) {
392
+ if (!t.enabled) return e.call(window, n, r);
393
+ let i = c(n);
394
+ if (t.shouldIgnore(i)) return e.call(window, n, r);
395
+ let a = n instanceof Request ? n : void 0, o = (r?.method ?? a?.method ?? "GET").toUpperCase(), u = {
396
+ id: s("net"),
397
+ kind: "fetch",
398
+ method: o,
399
+ url: i,
400
+ status: 0,
401
+ statusText: "",
402
+ ok: !1,
403
+ pending: !0,
404
+ startAt: Date.now(),
405
+ duration: 0,
406
+ requestHeaders: l(r?.headers ?? a?.headers),
407
+ requestBody: b(r?.body),
408
+ responseHeaders: {},
409
+ responseSize: 0
410
+ };
411
+ !u.requestBody && a && o !== "GET" && o !== "HEAD" && a.clone().text().then((e) => {
412
+ u.requestBody = e, t.update(u);
413
+ }).catch(() => {}), t.push(u);
414
+ let d = performance.now(), f = e.call(window, n, r);
415
+ try {
416
+ let e = await f;
417
+ u.status = e.status, u.statusText = e.statusText, u.ok = e.ok, u.pending = !1, u.duration = performance.now() - d;
418
+ let n = {};
419
+ e.headers.forEach((e, t) => {
420
+ n[t] = e;
421
+ }), u.responseHeaders = n;
422
+ let r = Number(y(n, "content-length"));
423
+ return u.responseSize = Number.isFinite(r) && r > 0 ? r : 0, t.update(u), t.captureResponseBody && x(e.clone()).then((e) => {
424
+ e !== void 0 && (u.responseBody = e, u.responseSize ||= new Blob([e]).size, t.update(u));
425
+ }), e;
426
+ } catch (e) {
427
+ throw u.pending = !1, u.error = e instanceof Error ? e.message : String(e), u.duration = performance.now() - d, t.update(u), e;
428
+ }
429
+ };
430
+ }
431
+ patchXhr() {
432
+ if (typeof XMLHttpRequest > "u") return;
433
+ let e = this, t = XMLHttpRequest.prototype.open, n = XMLHttpRequest.prototype.send;
434
+ this.originalXhrOpen = t, this.originalXhrSend = n, XMLHttpRequest.prototype.open = function(e, n, ...r) {
435
+ return this.__rdt = {
436
+ method: String(e).toUpperCase(),
437
+ url: String(n)
438
+ }, t.call(this, e, n, ...r);
439
+ }, XMLHttpRequest.prototype.send = function(t) {
440
+ let r = this.__rdt;
441
+ if (!e.enabled || !r || e.shouldIgnore(r.url)) return n.call(this, t ?? null);
442
+ let i = {
443
+ id: s("net"),
444
+ kind: "xhr",
445
+ method: r.method,
446
+ url: r.url,
447
+ status: 0,
448
+ statusText: "",
449
+ ok: !1,
450
+ pending: !0,
451
+ startAt: Date.now(),
452
+ duration: 0,
453
+ requestHeaders: {},
454
+ requestBody: b(t),
455
+ responseHeaders: {},
456
+ responseSize: 0
457
+ };
458
+ e.push(i);
459
+ let a = performance.now();
460
+ return this.addEventListener("loadend", () => {
461
+ i.pending = !1, i.duration = performance.now() - a, i.status = this.status, i.statusText = this.statusText, i.ok = this.status >= 200 && this.status < 400, this.status === 0 && (i.error = "Network error");
462
+ try {
463
+ let e = this.getAllResponseHeaders(), t = {};
464
+ e.trim().split(/[\r\n]+/).filter(Boolean).forEach((e) => {
465
+ let n = e.indexOf(":");
466
+ n > 0 && (t[e.slice(0, n).trim().toLowerCase()] = e.slice(n + 1).trim());
467
+ }), i.responseHeaders = t;
468
+ } catch {}
469
+ try {
470
+ if (e.captureResponseBody && (this.responseType === "" || this.responseType === "text")) {
471
+ let t = this.responseText;
472
+ e.captureResponseBody && (i.responseBody = t.length > 2e5 ? `${t.slice(0, 2e5)}\n… [truncated]` : t, i.responseSize = new Blob([t]).size);
473
+ } else if (this.responseType === "json") {
474
+ let e = JSON.stringify(this.response);
475
+ i.responseBody = e, i.responseSize = new Blob([e]).size;
476
+ }
477
+ } catch {}
478
+ e.update(i);
479
+ }), n.call(this, t ?? null);
480
+ };
481
+ }
482
+ async replay(e) {
483
+ let t = this.list.find((t) => t.id === e);
484
+ if (t) {
485
+ this.list.length;
486
+ try {
487
+ await window.fetch(t.url, {
488
+ method: t.method,
489
+ headers: t.requestHeaders,
490
+ body: ["GET", "HEAD"].includes(t.method) ? void 0 : t.requestBody,
491
+ credentials: "same-origin"
492
+ });
493
+ } catch {}
494
+ return this.list.length, this.list[0];
495
+ }
496
+ }
497
+ }, S = class {
498
+ prefix;
499
+ memory = /* @__PURE__ */ new Map();
500
+ available = !0;
501
+ constructor(e) {
502
+ this.prefix = e;
503
+ try {
504
+ let t = `${e}:__probe__`;
505
+ window.localStorage.setItem(t, "1"), window.localStorage.removeItem(t);
506
+ } catch {
507
+ this.available = !1;
508
+ }
509
+ }
510
+ get store() {
511
+ if (this.available) try {
512
+ return window.localStorage;
513
+ } catch {
514
+ return;
515
+ }
516
+ }
517
+ full(e) {
518
+ return `${this.prefix}:${e}`;
519
+ }
520
+ get(e) {
521
+ let t = this.full(e), n = this.store;
522
+ if (n) try {
523
+ let e = n.getItem(t);
524
+ if (e !== null) return e;
525
+ } catch {}
526
+ return this.memory.get(t) ?? null;
527
+ }
528
+ set(e, t) {
529
+ let n = this.full(e);
530
+ this.memory.set(n, t);
531
+ try {
532
+ this.store?.setItem(n, t);
533
+ } catch {}
534
+ }
535
+ remove(e) {
536
+ this.memory.delete(this.full(e));
537
+ try {
538
+ this.store?.removeItem(this.full(e));
539
+ } catch {}
540
+ }
541
+ getJSON(e, t) {
542
+ let n = this.get(e);
543
+ if (!n) return t;
544
+ try {
545
+ return JSON.parse(n);
546
+ } catch {
547
+ return t;
548
+ }
549
+ }
550
+ setJSON(e, t) {
551
+ try {
552
+ this.set(e, JSON.stringify(t));
553
+ } catch {}
554
+ }
555
+ clearNamespace() {
556
+ let e = `${this.prefix}:`, t = [], n = this.store;
557
+ if (n) for (let r = 0; r < n.length; r++) {
558
+ let i = n.key(r);
559
+ i && i.startsWith(e) && t.push(i);
560
+ }
561
+ t.forEach((e) => n?.removeItem(e));
562
+ for (let t of [...this.memory.keys()]) t.startsWith(e) && this.memory.delete(t);
563
+ }
564
+ };
565
+ async function C(e) {
566
+ try {
567
+ if (navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
568
+ } catch {}
569
+ try {
570
+ let t = document.createElement("textarea");
571
+ t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.opacity = "0", document.body.appendChild(t), t.select();
572
+ let n = document.execCommand("copy");
573
+ return document.body.removeChild(t), n;
574
+ } catch {
575
+ return !1;
576
+ }
577
+ }
578
+ // src/utils/hotkey.ts
579
+ function w(e) {
580
+ let t = e.toLowerCase().split("+").map((e) => e.trim()).filter(Boolean);
581
+ if (t.length === 0) return null;
582
+ let n = {
583
+ key: "",
584
+ alt: !1,
585
+ ctrl: !1,
586
+ meta: !1,
587
+ shift: !1
588
+ };
589
+ for (let e of t) e === "alt" || e === "option" ? n.alt = !0 : e === "ctrl" || e === "control" ? n.ctrl = !0 : e === "meta" || e === "cmd" || e === "command" ? n.meta = !0 : e === "shift" ? n.shift = !0 : n.key = e;
590
+ return n.key ? n : null;
591
+ }
592
+ var T = {
593
+ meta: "⌘",
594
+ cmd: "⌘",
595
+ command: "⌘",
596
+ alt: "⌥",
597
+ option: "⌥",
598
+ shift: "⇧",
599
+ ctrl: "⌃",
600
+ control: "⌃"
601
+ }, E = [
602
+ "ctrl",
603
+ "meta",
604
+ "alt",
605
+ "shift"
606
+ ], D = /^[a-z0-9]$/, O = /^f([1-9]|1[0-2])$/;
607
+ function k(e) {
608
+ if (!e || typeof e != "string") return !1;
609
+ let t = w(e);
610
+ return !t || !(D.test(t.key) || O.test(t.key) || j.test(t.key)) ? !1 : t.alt || t.ctrl || t.meta || O.test(t.key);
611
+ }
612
+ function A(e) {
613
+ return k(e) ? e.split("+").map((e) => e.trim()).filter(Boolean).map((e) => {
614
+ let t = e.toLowerCase();
615
+ return T[t] ? T[t] : t === "space" ? "Space" : e.toUpperCase();
616
+ }).join("") : "未设置快捷键";
617
+ }
618
+ var j = /^(f([1-9]|1[0-2])|space|home|end|pageup|pagedown|insert|delete|arrowup|arrowdown|arrowleft|arrowright|enter|backspace)$/, M = /^f([1-9]|1[0-2])$/;
619
+ function N(e) {
620
+ let t = e.key;
621
+ if (!t) return null;
622
+ let n = t.toLowerCase();
623
+ if ([
624
+ "shift",
625
+ "control",
626
+ "alt",
627
+ "meta",
628
+ "capslock",
629
+ "escape",
630
+ "tab"
631
+ ].includes(n)) return null;
632
+ let r = n === " " ? "space" : n, i = [];
633
+ e.ctrlKey && i.push("ctrl"), e.metaKey && i.push("meta"), e.altKey && i.push("alt"), e.shiftKey && i.push("shift");
634
+ let a = e.ctrlKey || e.metaKey || e.altKey, o = j.test(r), s = M.test(r);
635
+ return !a && !s || r.length > 1 && !o ? null : [...E.filter((e) => i.includes(e)), r].join("+");
636
+ }
637
+ function P(e, t) {
638
+ return e.key.toLowerCase() === (t.key === "space" ? " " : t.key) && !!e.altKey === t.alt && !!e.ctrlKey === t.ctrl && !!e.metaKey === t.meta && !!e.shiftKey === t.shift;
639
+ }
640
+ function F(e) {
641
+ if (!(e instanceof HTMLElement)) return !1;
642
+ let t = e.tagName;
643
+ return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable;
644
+ }
645
+ // ../../node_modules/.pnpm/lucide@1.68.0/node_modules/lucide/dist/esm/defaultAttributes.mjs
646
+ var I = {
647
+ xmlns: "http://www.w3.org/2000/svg",
648
+ width: 24,
649
+ height: 24,
650
+ viewBox: "0 0 24 24",
651
+ fill: "none",
652
+ stroke: "currentColor",
653
+ "stroke-width": 2,
654
+ "stroke-linecap": "round",
655
+ "stroke-linejoin": "round"
656
+ }, L = ([e, t, n]) => {
657
+ let r = document.createElementNS("http://www.w3.org/2000/svg", e);
658
+ return Object.keys(t).forEach((e) => {
659
+ r.setAttribute(e, String(t[e]));
660
+ }), n?.length && n.forEach((e) => {
661
+ let t = L(e);
662
+ r.appendChild(t);
663
+ }), r;
664
+ }, R = (e, t = {}) => L([
665
+ "svg",
666
+ {
667
+ ...I,
668
+ ...t
669
+ },
670
+ e
671
+ ]), te = [["path", { d: "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" }]], z = [["path", { d: "m12 19-7-7 7-7" }], ["path", { d: "M19 12H5" }]], ne = [["path", { d: "M7 7h10v10" }], ["path", { d: "M7 17 17 7" }]], re = [
672
+ ["path", { d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z" }],
673
+ ["path", { d: "m3.3 7 8.7 5 8.7-5" }],
674
+ ["path", { d: "M12 22V12" }]
675
+ ], ie = [
676
+ ["path", { d: "M12 20v-9" }],
677
+ ["path", { d: "M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z" }],
678
+ ["path", { d: "M14.12 3.88 16 2" }],
679
+ ["path", { d: "M21 21a4 4 0 0 0-3.81-4" }],
680
+ ["path", { d: "M21 5a4 4 0 0 1-3.55 3.97" }],
681
+ ["path", { d: "M22 13h-4" }],
682
+ ["path", { d: "M3 21a4 4 0 0 1 3.81-4" }],
683
+ ["path", { d: "M3 5a4 4 0 0 0 3.55 3.97" }],
684
+ ["path", { d: "M6 13H2" }],
685
+ ["path", { d: "m8 2 1.88 1.88" }],
686
+ ["path", { d: "M9 7.13V6a3 3 0 1 1 6 0v1.13" }]
687
+ ], ae = [["path", { d: "M20 6 9 17l-5-5" }]], oe = [["path", { d: "m6 9 6 6 6-6" }]], se = [["path", { d: "m9 18 6-6-6-6" }]], ce = [["path", { d: "m18 15-6-6-6 6" }]], le = [
688
+ ["circle", {
689
+ cx: "12",
690
+ cy: "12",
691
+ r: "10"
692
+ }],
693
+ ["line", {
694
+ x1: "12",
695
+ x2: "12",
696
+ y1: "8",
697
+ y2: "12"
698
+ }],
699
+ ["line", {
700
+ x1: "12",
701
+ x2: "12.01",
702
+ y1: "16",
703
+ y2: "16"
704
+ }]
705
+ ], ue = [["circle", {
706
+ cx: "12",
707
+ cy: "12",
708
+ r: "10"
709
+ }]], de = {
710
+ activity: te,
711
+ "alert-circle": le,
712
+ "arrow-left": z,
713
+ "arrow-up-right": ne,
714
+ box: re,
715
+ bug: ie,
716
+ check: ae,
717
+ "chevron-down": oe,
718
+ "chevron-right": se,
719
+ "chevron-up": ce,
720
+ circle: ue,
721
+ clipboard: [["rect", {
722
+ width: "8",
723
+ height: "4",
724
+ x: "8",
725
+ y: "2",
726
+ rx: "1",
727
+ ry: "1"
728
+ }], ["path", { d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" }]],
729
+ copy: [["rect", {
730
+ width: "14",
731
+ height: "14",
732
+ x: "8",
733
+ y: "8",
734
+ rx: "2",
735
+ ry: "2"
736
+ }], ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }]],
737
+ database: [
738
+ ["ellipse", {
739
+ cx: "12",
740
+ cy: "5",
741
+ rx: "9",
742
+ ry: "3"
743
+ }],
744
+ ["path", { d: "M3 5V19A9 3 0 0 0 21 19V5" }],
745
+ ["path", { d: "M3 12A9 3 0 0 0 21 12" }]
746
+ ],
747
+ eraser: [["path", { d: "M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21" }], ["path", { d: "m5.082 11.09 8.828 8.828" }]],
748
+ "external-link": [
749
+ ["path", { d: "M15 3h6v6" }],
750
+ ["path", { d: "M10 14 21 3" }],
751
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]
752
+ ],
753
+ eye: [["path", { d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }], ["circle", {
754
+ cx: "12",
755
+ cy: "12",
756
+ r: "3"
757
+ }]],
758
+ "eye-off": [
759
+ ["path", { d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }],
760
+ ["path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242" }],
761
+ ["path", { d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }],
762
+ ["path", { d: "m2 2 20 20" }]
763
+ ],
764
+ filter: [["path", { d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" }]],
765
+ ghost: [
766
+ ["path", { d: "M15 10v1" }],
767
+ ["path", { d: "M7.528 20.472a1.6 1.6 0 012.277 0l1.057 1.056a1.6 1.6 0 002.276 0l1.057-1.056a1.6 1.6 0 012.277 0l1.114 1.114a1.4 1.4 0 002.414-1V10a8 8 0 00-16 0v10.586a1.4 1.4 0 002.414 1z" }],
768
+ ["path", { d: "M9 10v1" }]
769
+ ],
770
+ globe: [
771
+ ["circle", {
772
+ cx: "12",
773
+ cy: "12",
774
+ r: "10"
775
+ }],
776
+ ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" }],
777
+ ["path", { d: "M2 12h20" }]
778
+ ],
779
+ key: [
780
+ ["path", { d: "m2 21 9.6-9.6" }],
781
+ ["path", { d: "m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19" }],
782
+ ["circle", {
783
+ cx: "15.5",
784
+ cy: "7.5",
785
+ r: "5.5"
786
+ }]
787
+ ],
788
+ layers: [
789
+ ["path", { d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z" }],
790
+ ["path", { d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12" }],
791
+ ["path", { d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17" }]
792
+ ],
793
+ "list-filter": [
794
+ ["path", { d: "M2 5h20" }],
795
+ ["path", { d: "M6 12h12" }],
796
+ ["path", { d: "M9 19h6" }]
797
+ ],
798
+ "maximize-2": [
799
+ ["path", { d: "M15 3h6v6" }],
800
+ ["path", { d: "m21 3-7 7" }],
801
+ ["path", { d: "m3 21 7-7" }],
802
+ ["path", { d: "M9 21H3v-6" }]
803
+ ],
804
+ "minimize-2": [
805
+ ["path", { d: "m14 10 7-7" }],
806
+ ["path", { d: "M20 10h-6V4" }],
807
+ ["path", { d: "m3 21 7-7" }],
808
+ ["path", { d: "M4 14h6v6" }]
809
+ ],
810
+ minus: [["path", { d: "M5 12h14" }]],
811
+ moon: [["path", { d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" }]],
812
+ palette: [
813
+ ["path", { d: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z" }],
814
+ ["circle", {
815
+ cx: "13.5",
816
+ cy: "6.5",
817
+ r: ".5",
818
+ fill: "currentColor"
819
+ }],
820
+ ["circle", {
821
+ cx: "17.5",
822
+ cy: "10.5",
823
+ r: ".5",
824
+ fill: "currentColor"
825
+ }],
826
+ ["circle", {
827
+ cx: "6.5",
828
+ cy: "12.5",
829
+ r: ".5",
830
+ fill: "currentColor"
831
+ }],
832
+ ["circle", {
833
+ cx: "8.5",
834
+ cy: "7.5",
835
+ r: ".5",
836
+ fill: "currentColor"
837
+ }]
838
+ ],
839
+ "panel-bottom": [["rect", {
840
+ width: "18",
841
+ height: "18",
842
+ x: "3",
843
+ y: "3",
844
+ rx: "2"
845
+ }], ["path", { d: "M3 15h18" }]],
846
+ "panel-left": [["rect", {
847
+ width: "18",
848
+ height: "18",
849
+ x: "3",
850
+ y: "3",
851
+ rx: "2"
852
+ }], ["path", { d: "M9 3v18" }]],
853
+ "panel-right": [["rect", {
854
+ width: "18",
855
+ height: "18",
856
+ x: "3",
857
+ y: "3",
858
+ rx: "2"
859
+ }], ["path", { d: "M15 3v18" }]],
860
+ pip: [["path", { d: "M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" }], ["rect", {
861
+ width: "10",
862
+ height: "7",
863
+ x: "12",
864
+ y: "13",
865
+ rx: "2"
866
+ }]],
867
+ play: [["path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }]],
868
+ plus: [["path", { d: "M5 12h14" }], ["path", { d: "M12 5v14" }]],
869
+ radar: [
870
+ ["path", { d: "M19.07 4.93A10 10 0 0 0 6.99 3.34" }],
871
+ ["path", { d: "M4 6h.01" }],
872
+ ["path", { d: "M2.29 9.62A10 10 0 1 0 21.31 8.35" }],
873
+ ["path", { d: "M16.24 7.76A6 6 0 1 0 8.23 16.67" }],
874
+ ["path", { d: "M12 18h.01" }],
875
+ ["path", { d: "M17.99 11.66A6 6 0 0 1 15.77 16.67" }],
876
+ ["circle", {
877
+ cx: "12",
878
+ cy: "12",
879
+ r: "2"
880
+ }],
881
+ ["path", { d: "m13.41 10.59 5.66-5.66" }]
882
+ ],
883
+ "refresh-cw": [
884
+ ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }],
885
+ ["path", { d: "M21 3v5h-5" }],
886
+ ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }],
887
+ ["path", { d: "M8 16H3v5" }]
888
+ ],
889
+ "rotate-ccw": [["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { d: "M3 3v5h5" }]],
890
+ search: [["path", { d: "m21 21-4.34-4.34" }], ["circle", {
891
+ cx: "11",
892
+ cy: "11",
893
+ r: "8"
894
+ }]],
895
+ send: [["path", { d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z" }], ["path", { d: "m21.854 2.147-10.94 10.939" }]],
896
+ settings: [["path", { d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", {
897
+ cx: "12",
898
+ cy: "12",
899
+ r: "3"
900
+ }]],
901
+ "sliders-horizontal": [
902
+ ["path", { d: "M10 5H3" }],
903
+ ["path", { d: "M12 19H3" }],
904
+ ["path", { d: "M14 3v4" }],
905
+ ["path", { d: "M16 17v4" }],
906
+ ["path", { d: "M21 12h-9" }],
907
+ ["path", { d: "M21 19h-5" }],
908
+ ["path", { d: "M21 5h-7" }],
909
+ ["path", { d: "M8 10v4" }],
910
+ ["path", { d: "M8 12H3" }]
911
+ ],
912
+ sparkles: [
913
+ ["path", { d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" }],
914
+ ["path", { d: "M20 2v4" }],
915
+ ["path", { d: "M22 4h-4" }],
916
+ ["circle", {
917
+ cx: "4",
918
+ cy: "20",
919
+ r: "2"
920
+ }]
921
+ ],
922
+ "square-terminal": [
923
+ ["path", { d: "m7 11 2-2-2-2" }],
924
+ ["path", { d: "M11 13h4" }],
925
+ ["rect", {
926
+ width: "18",
927
+ height: "18",
928
+ x: "3",
929
+ y: "3",
930
+ rx: "2",
931
+ ry: "2"
932
+ }]
933
+ ],
934
+ sun: [
935
+ ["circle", {
936
+ cx: "12",
937
+ cy: "12",
938
+ r: "4"
939
+ }],
940
+ ["path", { d: "M12 2v2" }],
941
+ ["path", { d: "M12 20v2" }],
942
+ ["path", { d: "m4.93 4.93 1.41 1.41" }],
943
+ ["path", { d: "m17.66 17.66 1.41 1.41" }],
944
+ ["path", { d: "M2 12h2" }],
945
+ ["path", { d: "M20 12h2" }],
946
+ ["path", { d: "m6.34 17.66-1.41 1.41" }],
947
+ ["path", { d: "m19.07 4.93-1.41 1.41" }]
948
+ ],
949
+ terminal: [["path", { d: "M12 19h8" }], ["path", { d: "m4 17 6-6-6-6" }]],
950
+ trash: [
951
+ ["path", { d: "M10 11v6" }],
952
+ ["path", { d: "M14 11v6" }],
953
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }],
954
+ ["path", { d: "M3 6h18" }],
955
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }]
956
+ ],
957
+ x: [["path", { d: "M18 6 6 18" }], ["path", { d: "m6 6 12 12" }]],
958
+ zap: [["path", { d: "M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z" }]]
959
+ };
960
+ Object.keys(de);
961
+ function fe(e, t = 16, n = 1.8) {
962
+ let r = R(e && de[e] || ue, {
963
+ width: String(t),
964
+ height: String(t),
965
+ "stroke-width": String(n),
966
+ "aria-hidden": "true"
967
+ });
968
+ return r.classList.add("rdt-icon"), r;
969
+ }
970
+ // src/ui/dom.ts
971
+ function pe(e, t = {}) {
972
+ for (let [n, r] of Object.entries(t)) if (r != null && r !== !1) {
973
+ if (n === "class") e.setAttribute("class", String(r));
974
+ else if (n === "text") e.textContent = String(r);
975
+ else if (n === "html") e.innerHTML = String(r);
976
+ else if (n === "style") typeof r == "string" ? e.setAttribute("style", r) : Object.assign(e.style, r);
977
+ else if (n === "dataset") for (let [t, n] of Object.entries(r)) e.dataset[t] = n;
978
+ else n.startsWith("on") && typeof r == "function" ? e.addEventListener(n.slice(2).toLowerCase(), r) : r === !0 ? e.setAttribute(n, "") : e.setAttribute(n, String(r));
979
+ }
980
+ }
981
+ function B(e, t, n) {
982
+ let r = document.createElement(e);
983
+ return pe(r, t ?? {}), me(r, n), r;
984
+ }
985
+ function me(e, t) {
986
+ if (t != null && t !== !1) {
987
+ if (Array.isArray(t)) for (let n of t) me(e, n);
988
+ else e.appendChild(typeof t == "string" || typeof t == "number" ? document.createTextNode(String(t)) : t);
989
+ }
990
+ }
991
+ function V(e, t = 16, n = 1.8) {
992
+ return fe(e, t, n);
993
+ }
994
+ function H(e) {
995
+ for (; e.firstChild;) e.removeChild(e.firstChild);
996
+ }
997
+ function U(e, t = {}) {
998
+ let n = B("button", {
999
+ class: `rdt-btn rdt-btn--${t.tone ?? "default"}`,
1000
+ type: "button",
1001
+ title: t.title ?? e,
1002
+ onClick: t.onClick
1003
+ }, [t.icon ? V(t.icon, 13, 2) : null, e ? B("span", {
1004
+ class: "rdt-btn__label",
1005
+ text: e
1006
+ }) : null]);
1007
+ return e || n.classList.add("rdt-btn--icon-only"), n;
1008
+ }
1009
+ function W(e) {
1010
+ let t = e.querySelector("svg.rdt-icon");
1011
+ if (e.classList.add("is-copied"), t) {
1012
+ let n = V("check", 13, 2.2);
1013
+ t.replaceWith(n), setTimeout(() => {
1014
+ e.classList.remove("is-copied"), n.isConnected && n.replaceWith(t);
1015
+ }, 1200);
1016
+ } else setTimeout(() => e.classList.remove("is-copied"), 1200);
1017
+ }
1018
+ function he(e, t, n) {
1019
+ return B("label", { class: "rdt-field" }, [
1020
+ B("span", {
1021
+ class: "rdt-field__label",
1022
+ text: e
1023
+ }),
1024
+ t,
1025
+ n ? B("span", {
1026
+ class: "rdt-field__hint",
1027
+ text: n
1028
+ }) : null
1029
+ ]);
1030
+ }
1031
+ function G(e, t) {
1032
+ return B("div", { class: "rdt-empty" }, [t ? B("span", { class: "rdt-empty__icon" }, V(t, 22, 1.6)) : null, B("p", {
1033
+ class: "rdt-empty__text",
1034
+ text: e
1035
+ })]);
1036
+ }
1037
+ function ge(e, t = "neutral") {
1038
+ return B("span", {
1039
+ class: `rdt-tag rdt-tag--${t}`,
1040
+ text: e
1041
+ });
1042
+ }
1043
+ function K(e, t, n) {
1044
+ let r = B("div", {
1045
+ class: "rdt-segmented",
1046
+ role: "tablist"
1047
+ }), i = [], a = (e) => {
1048
+ i.forEach((t) => t.classList.toggle("is-active", t.dataset.value === e));
1049
+ };
1050
+ for (let t of e) {
1051
+ let e = B("button", {
1052
+ class: "rdt-segmented__item",
1053
+ type: "button",
1054
+ dataset: { value: t.value },
1055
+ onClick: () => {
1056
+ a(t.value), n(t.value);
1057
+ }
1058
+ }, [t.icon ? V(t.icon, 13, 2) : null, B("span", { text: t.label })]);
1059
+ i.push(e), r.appendChild(e);
1060
+ }
1061
+ return a(t), r;
1062
+ }
1063
+ // src/plugins/actions.ts
1064
+ function _e(e) {
1065
+ return {
1066
+ id: "actions",
1067
+ title: "快捷操作",
1068
+ icon: "zap",
1069
+ order: 50,
1070
+ subtitle: () => `${e.actions.length} 个操作 · 由接入方注册`,
1071
+ render(t, n) {
1072
+ let r = B("div", { class: "rdt-actions rdt-scroll" });
1073
+ t.appendChild(r);
1074
+ let i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = (e) => {
1075
+ let t = o.get(e.id), n = s.get(e.id);
1076
+ if (!t) return;
1077
+ let r = i.has(e.id), a = t.querySelector(".rdt-btn__label");
1078
+ a && (a.textContent = r ? "确认执行?" : "执行"), t.dataset.armed = String(r), n && (n.dataset.armed = String(r));
1079
+ let c = r || e.tone === "danger";
1080
+ t.classList.toggle("rdt-btn--danger", c), t.classList.toggle("rdt-btn--default", !c);
1081
+ }, l = async (e) => {
1082
+ if (e.confirm && !i.has(e.id)) {
1083
+ i.add(e.id), c(e);
1084
+ let t = setTimeout(() => {
1085
+ i.delete(e.id), c(e);
1086
+ }, 2600);
1087
+ a.set(e.id, t);
1088
+ return;
1089
+ }
1090
+ let t = a.get(e.id);
1091
+ t && clearTimeout(t), i.delete(e.id), c(e);
1092
+ try {
1093
+ await e.run({
1094
+ devtools: n.devtools,
1095
+ values: n.values,
1096
+ getValue: (e, t) => n.getValue(e, t),
1097
+ setValue: (e, t) => n.setValue(e, t),
1098
+ open: (e) => n.devtools.open(e),
1099
+ close: () => n.devtools.close(),
1100
+ toast: (e, t) => n.toast(e, t),
1101
+ copy: (e) => n.copy(e)
1102
+ });
1103
+ } catch (e) {
1104
+ n.toast(e instanceof Error ? e.message : String(e), "error"), console.error("[rinova-devtools] action failed", e);
1105
+ }
1106
+ }, u = () => {
1107
+ if (H(r), o.clear(), s.clear(), !e.actions.length) r.classList.remove("has-items"), r.appendChild(B("div", { class: "rdt-actions" }, [G("还没有注册快捷操作。通过 actions 选项或 devtools.registerAction() 添加。", "zap")]));
1108
+ else {
1109
+ r.classList.add("has-items");
1110
+ for (let t of e.actions) {
1111
+ let e = i.has(t.id), n = U(e ? "确认执行?" : "执行", {
1112
+ tone: e || t.tone === "danger" ? "danger" : "default",
1113
+ onClick: (e) => {
1114
+ e.stopPropagation(), l(t);
1115
+ }
1116
+ });
1117
+ n.dataset.armed = String(e), o.set(t.id, n);
1118
+ let a = B("div", {
1119
+ class: "rdt-action",
1120
+ dataset: {
1121
+ tone: t.tone ?? "default",
1122
+ action: t.id,
1123
+ armed: String(e)
1124
+ },
1125
+ role: "button",
1126
+ tabindex: "0",
1127
+ onClick: () => void l(t),
1128
+ onKeydown: (e) => {
1129
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), l(t));
1130
+ }
1131
+ }, [
1132
+ B("span", { class: "rdt-action__icon" }, V(t.icon ?? "play", 14, 1.9)),
1133
+ B("span", { class: "rdt-action__text" }, [B("span", {
1134
+ class: "rdt-action__label",
1135
+ text: t.label
1136
+ }), t.description ? B("span", {
1137
+ class: "rdt-action__desc",
1138
+ text: t.description
1139
+ }) : null]),
1140
+ B("span", { class: "rdt-action__run" }, [n])
1141
+ ]);
1142
+ s.set(t.id, a), r.appendChild(a);
1143
+ }
1144
+ }
1145
+ };
1146
+ u(), n.on("actions:change", () => u()), n.onDispose(() => {
1147
+ a.forEach((e) => clearTimeout(e));
1148
+ });
1149
+ }
1150
+ };
1151
+ }
1152
+ // src/plugins/config.ts
1153
+ function ve(e, t, n) {
1154
+ if (e.allowCustom) {
1155
+ let r = B("input", {
1156
+ class: "rdt-input rdt-mono",
1157
+ type: "text",
1158
+ value: String(t.getValue(e.key, e.defaultValue ?? "")),
1159
+ placeholder: e.placeholder ?? "输入或选择预设值",
1160
+ disabled: e.disabled
1161
+ });
1162
+ r.addEventListener("input", () => t.setValue(e.key, r.value));
1163
+ let i = B("div", { class: "rdt-menu" });
1164
+ i.style.display = "none";
1165
+ for (let n of e.options) i.appendChild(B("button", {
1166
+ class: "rdt-menu__item",
1167
+ type: "button",
1168
+ onClick: () => {
1169
+ r.value = n.value, t.setValue(e.key, n.value), i.style.display = "none";
1170
+ }
1171
+ }, [B("span", { text: n.label }), n.description ? B("span", {
1172
+ class: "rdt-menu__desc",
1173
+ text: n.description
1174
+ }) : null]));
1175
+ let a = B("div", { class: "rdt-combo" }, [B("div", { class: "rdt-combo__row" }, [r, B("button", {
1176
+ class: "rdt-input-addon",
1177
+ type: "button",
1178
+ title: "选择预设",
1179
+ "aria-label": "选择预设",
1180
+ disabled: e.disabled,
1181
+ onClick: (e) => {
1182
+ e.stopPropagation(), i.style.display = i.style.display === "none" ? "" : "none";
1183
+ }
1184
+ }, V("chevron-down", 13, 2))]), i]), o = (e) => {
1185
+ a.contains(e.target) || (i.style.display = "none");
1186
+ }, s = (e) => {
1187
+ e.key === "Escape" && (i.style.display = "none");
1188
+ };
1189
+ return document.addEventListener("pointerdown", o, !0), document.addEventListener("keydown", s, !0), t.onDispose(() => {
1190
+ document.removeEventListener("pointerdown", o, !0), document.removeEventListener("keydown", s, !0);
1191
+ }), n({ sync: () => {
1192
+ document.activeElement !== r && (r.value = String(t.getValue(e.key, "")));
1193
+ } }), a;
1194
+ }
1195
+ let r = B("select", { disabled: e.disabled });
1196
+ e.options.forEach((e) => {
1197
+ r.appendChild(B("option", {
1198
+ value: e.value,
1199
+ text: e.description ? `${e.label} · ${e.description}` : e.label
1200
+ }));
1201
+ }), r.value = String(t.getValue(e.key, e.defaultValue ?? "")), r.addEventListener("change", () => t.setValue(e.key, r.value));
1202
+ let i = B("div", { class: "rdt-select" }, [r, B("span", { class: "rdt-select__chevron" }, V("chevron-down", 13, 2))]);
1203
+ return n({ sync: () => {
1204
+ r.value = String(t.getValue(e.key, ""));
1205
+ } }), i;
1206
+ }
1207
+ function ye(e) {
1208
+ return B("span", { class: "rdt-field__label" }, [B("span", { text: e.label }), e.persist === !1 ? B("span", {
1209
+ class: "rdt-tag rdt-field__badge",
1210
+ text: "仅本页",
1211
+ title: "不写入 localStorage"
1212
+ }) : null]);
1213
+ }
1214
+ function be(e, t, n, r) {
1215
+ if (e.type === "switch") {
1216
+ let i = B("button", {
1217
+ class: "rdt-switch",
1218
+ type: "button",
1219
+ role: "switch",
1220
+ "aria-checked": String(!!t.getValue(e.key, e.defaultValue ?? !1)),
1221
+ "aria-label": e.label,
1222
+ disabled: e.disabled,
1223
+ onClick: () => {
1224
+ let n = i.getAttribute("aria-checked") !== "true";
1225
+ i.setAttribute("aria-checked", String(n)), t.setValue(e.key, n), r();
1226
+ }
1227
+ });
1228
+ return n({ sync: () => {
1229
+ i.setAttribute("aria-checked", String(!!t.getValue(e.key, !1)));
1230
+ } }), B("div", { class: "rdt-field rdt-field--row" }, [B("div", { class: "rdt-field__text" }, [ye(e), e.description ? B("span", {
1231
+ class: "rdt-field__hint",
1232
+ text: e.description
1233
+ }) : null]), i]);
1234
+ }
1235
+ let i;
1236
+ if (e.type === "select") i = ve(e, t, n);
1237
+ else if (e.type === "textarea") {
1238
+ let r = B("textarea", {
1239
+ class: `rdt-textarea${e.mono ? " rdt-mono" : ""}`,
1240
+ rows: e.rows ?? 4,
1241
+ placeholder: e.placeholder ?? "",
1242
+ disabled: e.disabled
1243
+ });
1244
+ r.value = String(t.getValue(e.key, "")), r.addEventListener("input", () => t.setValue(e.key, r.value)), n({ sync: () => {
1245
+ document.activeElement !== r && (r.value = String(t.getValue(e.key, "")));
1246
+ } }), i = r;
1247
+ } else if (e.type === "number") {
1248
+ let r = B("input", {
1249
+ class: "rdt-input rdt-mono",
1250
+ type: "number",
1251
+ min: e.min,
1252
+ max: e.max,
1253
+ step: e.step,
1254
+ disabled: e.disabled,
1255
+ value: String(t.getValue(e.key, e.defaultValue ?? 0))
1256
+ });
1257
+ r.addEventListener("change", () => {
1258
+ let n = Number(r.value);
1259
+ Number.isFinite(n) && t.setValue(e.key, n);
1260
+ }), n({ sync: () => {
1261
+ document.activeElement !== r && (r.value = String(t.getValue(e.key, "")));
1262
+ } }), i = r;
1263
+ } else {
1264
+ let r = B("input", {
1265
+ class: `rdt-input${e.mono ? " rdt-mono" : ""}`,
1266
+ type: "text",
1267
+ placeholder: e.placeholder ?? "",
1268
+ disabled: e.disabled,
1269
+ readonly: e.copyable,
1270
+ value: String(t.getValue(e.key, ""))
1271
+ });
1272
+ if (r.addEventListener("input", () => {
1273
+ e.copyable || t.setValue(e.key, r.value);
1274
+ }), n({ sync: () => {
1275
+ document.activeElement !== r && (r.value = String(t.getValue(e.key, "")));
1276
+ } }), e.copyable) {
1277
+ let n = U("复制", {
1278
+ icon: "copy",
1279
+ onClick: () => {
1280
+ W(n), t.copy(String(t.getValue(e.key, "")));
1281
+ }
1282
+ });
1283
+ i = B("div", { class: "rdt-input-group" }, [r, n]);
1284
+ } else i = r;
1285
+ }
1286
+ return B("div", { class: "rdt-field" }, [
1287
+ ye(e),
1288
+ i,
1289
+ e.description ? B("span", {
1290
+ class: "rdt-field__hint",
1291
+ text: e.description
1292
+ }) : null
1293
+ ]);
1294
+ }
1295
+ function xe(e) {
1296
+ return {
1297
+ id: "config",
1298
+ title: "配置",
1299
+ icon: "sliders-horizontal",
1300
+ order: 10,
1301
+ subtitle: () => `${e.config.fields.length} 项 · 修改即时生效`,
1302
+ render(t, n) {
1303
+ let r = B("div", { class: "rdt-scroll-body" }), i = B("div", { class: "rdt-config" }), a = /* @__PURE__ */ new Map(), o, s = B("span", { class: "rdt-field__saved" }), c = () => {
1304
+ s.textContent = "已保存", s.style.opacity = "1", o && clearTimeout(o), o = setTimeout(() => {
1305
+ s.style.opacity = "0";
1306
+ }, 1200);
1307
+ }, l = () => {
1308
+ a.clear(), i.replaceChildren();
1309
+ for (let t of e.config.groups) {
1310
+ let r = e.config.fieldsOf(t.id);
1311
+ if (!r.length) continue;
1312
+ let o = B("section", { class: "rdt-group" }, [B("div", { class: "rdt-group__head" }, [B("h3", {
1313
+ class: "rdt-group__title",
1314
+ text: t.label
1315
+ }), t.description ? B("span", {
1316
+ class: "rdt-group__desc",
1317
+ text: t.description
1318
+ }) : null])]);
1319
+ for (let e of r) o.appendChild(be(e, n, (t) => a.set(e.key, t), c));
1320
+ i.appendChild(o);
1321
+ }
1322
+ let t = e.config.fields.some((e) => e.persist === !1), r = B("div", { class: "rdt-config__footer" }, [
1323
+ U("恢复默认", {
1324
+ icon: "rotate-ccw",
1325
+ onClick: () => {
1326
+ e.config.reset(), a.forEach((e) => e.sync()), n.toast("已恢复默认配置", "success");
1327
+ }
1328
+ }),
1329
+ s,
1330
+ B("span", { class: "rdt-statusbar__spacer" }),
1331
+ B("span", { text: t ? "敏感字段仅本页,其余自动保存" : "自动保存到本地" })
1332
+ ]);
1333
+ i.appendChild(r);
1334
+ };
1335
+ l(), r.appendChild(i), t.appendChild(r), n.onChange(() => {
1336
+ a.forEach((e) => e.sync());
1337
+ }), n.on("config:fields", () => l()), n.on("plugin:activate", ({ id: e }) => {
1338
+ e === "config" && a.forEach((e) => e.sync());
1339
+ }), n.onDispose(() => {
1340
+ o && clearTimeout(o);
1341
+ });
1342
+ }
1343
+ };
1344
+ }
1345
+ // src/plugins/console.ts
1346
+ function Se(e) {
1347
+ return {
1348
+ id: "console",
1349
+ title: "日志",
1350
+ icon: "terminal",
1351
+ order: 40,
1352
+ subtitle: "console 与未捕获异常 · 双击复制",
1353
+ badge: () => e.logs.entries().filter((e) => e.level === "error").length || null,
1354
+ render(t, r) {
1355
+ let i = "all", a = "", o = B("input", {
1356
+ class: "rdt-input",
1357
+ type: "search",
1358
+ placeholder: "搜索日志",
1359
+ "aria-label": "搜索日志"
1360
+ });
1361
+ o.addEventListener("input", () => {
1362
+ a = o.value.trim().toLowerCase(), m();
1363
+ });
1364
+ let s = B("div", { class: "rdt-filterbar" }), c = B("div", { class: "rdt-loglist rdt-scroll" }), l = B("span", { class: "rdt-count" }), u = U("", {
1365
+ icon: "copy",
1366
+ tone: "ghost",
1367
+ title: "复制当前筛选结果",
1368
+ onClick: () => {
1369
+ W(u);
1370
+ let e = f().slice().reverse().map((e) => `[${n(e.at)}] ${e.level.toUpperCase()} ${e.args}`).join("\n");
1371
+ r.copy(e || "(空)");
1372
+ }
1373
+ }), d = B("div", { class: "rdt-toolbar" }, [
1374
+ B("div", { class: "rdt-search" }, [V("search", 12, 2), o]),
1375
+ l,
1376
+ s,
1377
+ B("div", { class: "rdt-toolbar__spacer" }),
1378
+ u,
1379
+ U("", {
1380
+ icon: "trash",
1381
+ tone: "ghost",
1382
+ title: "清空日志",
1383
+ onClick: () => {
1384
+ e.logs.clear(), h();
1385
+ }
1386
+ })
1387
+ ]);
1388
+ t.append(B("div", { class: "rdt-logs" }, [d, c]));
1389
+ let f = () => e.logs.entries().filter((e) => i === "info" && e.level !== "info" && e.level !== "log" || i !== "all" && i !== "info" && e.level !== i ? !1 : !a || e.args.toLowerCase().includes(a) || e.level.includes(a)), p = () => {
1390
+ let t = e.logs.entries(), n = [
1391
+ {
1392
+ id: "all",
1393
+ label: "全部",
1394
+ count: t.length
1395
+ },
1396
+ {
1397
+ id: "info",
1398
+ label: "信息",
1399
+ count: t.filter((e) => e.level === "info" || e.level === "log").length
1400
+ },
1401
+ {
1402
+ id: "warn",
1403
+ label: "警告",
1404
+ count: t.filter((e) => e.level === "warn").length
1405
+ },
1406
+ {
1407
+ id: "error",
1408
+ label: "错误",
1409
+ count: t.filter((e) => e.level === "error").length
1410
+ }
1411
+ ];
1412
+ H(s);
1413
+ for (let e of n) s.appendChild(B("button", {
1414
+ class: `rdt-chip${i === e.id ? " is-active" : ""}`,
1415
+ type: "button",
1416
+ onClick: () => {
1417
+ i = e.id, m();
1418
+ }
1419
+ }, [B("span", { text: e.label }), B("span", {
1420
+ class: "rdt-count",
1421
+ text: String(e.count)
1422
+ })]));
1423
+ }, m = () => {
1424
+ let t = f();
1425
+ if (H(c), l.textContent = `${t.length} / ${e.logs.entries().length}`, p(), !t.length) c.appendChild(G(e.logs.entries().length ? "没有匹配的日志。" : "还没有日志。console.log 输出会实时出现在这里。", "terminal"));
1426
+ else for (let e of t) {
1427
+ let t = B("div", {
1428
+ class: "rdt-logrow",
1429
+ dataset: { level: e.level },
1430
+ title: "双击复制这条日志",
1431
+ onDblclick: () => {
1432
+ r.copy(`[${n(e.at)}] ${e.level.toUpperCase()} ${e.args}`);
1433
+ }
1434
+ }, [
1435
+ B("span", {
1436
+ class: "rdt-logrow__time",
1437
+ text: n(e.at),
1438
+ title: n(e.at)
1439
+ }),
1440
+ B("span", {
1441
+ class: "rdt-logrow__level",
1442
+ text: e.level
1443
+ }),
1444
+ B("span", { class: "rdt-logrow__msg" }, [B("span", { text: e.args }), e.count > 1 ? B("span", {
1445
+ class: "rdt-logrow__count",
1446
+ text: String(e.count)
1447
+ }) : null])
1448
+ ]);
1449
+ c.appendChild(t);
1450
+ }
1451
+ }, h = () => {
1452
+ m();
1453
+ };
1454
+ h(), r.onDispose(e.logs.subscribeChange(() => h()));
1455
+ }
1456
+ };
1457
+ }
1458
+ // src/utils/curl.ts
1459
+ var Ce = /[^\w@%+=:,./-]/;
1460
+ function q(e) {
1461
+ return e === "" ? "''" : Ce.test(e) ? `'${e.replace(/'/g, "'\\''")}'` : e;
1462
+ }
1463
+ function we(e) {
1464
+ let t = [`curl ${q(e.url)}`];
1465
+ e.method && e.method !== "GET" && t.push(`-X ${e.method}`);
1466
+ for (let [n, r] of Object.entries(e.requestHeaders ?? {})) r && t.push(`-H ${q(`${n}: ${r}`)}`);
1467
+ if (e.requestBody) {
1468
+ let n = Object.keys(e.requestHeaders ?? {}).some((t) => t.toLowerCase() === "content-type" && /x-www-form-urlencoded/i.test(e.requestHeaders[t]));
1469
+ t.push(`${n ? "--data" : "--data-raw"} ${q(e.requestBody)}`);
1470
+ }
1471
+ return t.join(" \\\n ");
1472
+ }
1473
+ // src/styles/index.less?inline
1474
+ var Te = ".rdt-root{--rdt-accent:#3b82f6;--rdt-accent-hover:#60a5fa;--rdt-accent-active:#2563eb;--rdt-accent-soft:#3b82f624;--rdt-accent-soft-hover:#3b82f638;--rdt-accent-border:#3b82f67a;--rdt-accent-text:#60a5fa;--rdt-on-accent:#fff;--rdt-inset:#0b0f14;--rdt-inset-hover:#0f141b;--rdt-bg:#11161c;--rdt-bg-translucent:#11161ce0;--rdt-surface:#161c23;--rdt-surface-2:#1d242e;--rdt-surface-3:#262f3b;--rdt-surface-elevated:#1f2732;--rdt-overlay:#0000005c;--rdt-backdrop-header:linear-gradient(180deg, var(--rdt-surface), var(--rdt-bg));--rdt-highlight-top:#ffffff14;--rdt-highlight-subtle:#94b8ff2e;--rdt-border-subtle:#ffffff0e;--rdt-border:#27303c;--rdt-border-strong:#384454;--rdt-border-focus:var(--rdt-accent-border);--rdt-border-glass:#ffffff1c;--rdt-divider:var(--rdt-border);--rdt-ring-offset:var(--rdt-surface);--rdt-text:#e8eef5;--rdt-text-secondary:#9ba8b8;--rdt-text-tertiary:#6e7d8f;--rdt-text-disabled:#4b5664;--rdt-text-inverse:#0b0f14;--rdt-icon:#9ba8b8;--rdt-icon-hover:#e8eef5;--rdt-icon-active:var(--rdt-accent-text);--rdt-icon-muted:#5c6a7b;--rdt-placeholder:var(--rdt-text-tertiary);--rdt-ok:#3fb950;--rdt-ok-hover:#56d364;--rdt-ok-soft:#3fb95021;--rdt-ok-border:#3fb9505c;--rdt-on-ok:#fff;--rdt-warn:#e3a830;--rdt-warn-hover:#f2bc49;--rdt-warn-soft:#e3a83024;--rdt-warn-border:#e3a83061;--rdt-on-warn:#11161c;--rdt-error:#f85149;--rdt-error-hover:#ff7b72;--rdt-error-soft:#f8514921;--rdt-error-border:#f8514966;--rdt-on-error:#fff;--rdt-info:#58a6ff;--rdt-info-hover:#79c0ff;--rdt-info-soft:#58a6ff21;--rdt-info-border:#58a6ff5c;--rdt-on-info:#fff;--rdt-http-get:#60a5fa;--rdt-http-post:#3fb950;--rdt-http-put:#e3a830;--rdt-http-delete:#f85149;--rdt-http-other:#a371f7;--rdt-status-2xx:var(--rdt-ok);--rdt-status-3xx:var(--rdt-info);--rdt-status-4xx:var(--rdt-warn);--rdt-status-5xx:var(--rdt-error);--rdt-status-pending:var(--rdt-text-tertiary);--rdt-log-debug:#7e8c9e;--rdt-log-log:var(--rdt-text-secondary);--rdt-log-info:var(--rdt-info);--rdt-log-warn:var(--rdt-warn);--rdt-log-warn-bg:#e3a8300f;--rdt-log-error:var(--rdt-error);--rdt-log-error-bg:#f8514916;--rdt-env-local:var(--rdt-ok);--rdt-env-remote:var(--rdt-info);--rdt-env-warn:var(--rdt-warn);--rdt-syn-key:#79c0ff;--rdt-syn-string:#a5d6ff;--rdt-syn-number:#ffa657;--rdt-syn-boolean:#d2a8ff;--rdt-syn-null:#8b949e;--rdt-syn-punct:#6e7d8f;--rdt-hover:#ffffff0c;--rdt-active:#ffffff16;--rdt-selected:var(--rdt-accent-soft);--rdt-focus-ring:0 0 0 2px var(--rdt-accent-soft);--rdt-focus-outline:var(--rdt-accent-border);--rdt-selection-bg:#3b82f647;--rdt-scrollbar-thumb:#94a3b83d;--rdt-scrollbar-thumb-hover:#94a3b86b;--rdt-scrollbar-track:transparent;--rdt-resizer-active:var(--rdt-accent-border);--rdt-font-sans:ui-sans-serif, -apple-system, BlinkMacSystemFont, \"SF Pro Text\", \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif;--rdt-font-mono:ui-monospace, \"SF Mono\", SFMono-Regular, \"JetBrains Mono\", Menlo, Consolas, monospace;--rdt-font-base:14px;--rdt-text-2xs:11px;--rdt-text-xs:12px;--rdt-text-sm:14px;--rdt-text-base:15px;--rdt-text-md:16px;--rdt-leading-none:1;--rdt-leading-tight:1.35;--rdt-leading-normal:1.5;--rdt-leading-relaxed:1.6;--rdt-weight-regular:400;--rdt-weight-medium:500;--rdt-weight-semibold:600;--rdt-tracking-tight:-.01em;--rdt-tracking-normal:0;--rdt-tracking-wide:.05em;--rdt-space-0:0px;--rdt-space-1:2px;--rdt-space-2:4px;--rdt-space-3:6px;--rdt-space-4:8px;--rdt-space-5:10px;--rdt-space-6:12px;--rdt-space-7:16px;--rdt-space-8:24px;--rdt-panel-w:420px;--rdt-panel-h:460px;--rdt-panel-collapsed-w:264px;--rdt-header-h:38px;--rdt-toolbar-h:36px;--rdt-statusbar-h:24px;--rdt-rail-w:40px;--rdt-rail-top-h:28px;--rdt-rail-item-size:30px;--rdt-icon-sm:14px;--rdt-icon-md:16px;--rdt-iconbtn-size:26px;--rdt-brand-mark-size:20px;--rdt-row-h:32px;--rdt-tab-h:32px;--rdt-log-py:4.5px;--rdt-control-h-sm:25px;--rdt-control-h:30px;--rdt-tag-h:20px;--rdt-panel-gap:12px;--rdt-panel-pad-x:11px;--rdt-panel-pad-y:8px;--rdt-net-cols:46px 38px minmax(0, 1fr) 52px;--rdt-log-cols:62px 40px minmax(0, 1fr);--rdt-kv-key-w:76px;--rdt-shortcut-w:124px;--rdt-code-max-h:230px;--rdt-radius-xs:4px;--rdt-radius-sm:6px;--rdt-radius-md:8px;--rdt-radius-lg:12px;--rdt-radius-xl:16px;--rdt-radius-pill:9999px;--rdt-radius-full:50%;--rdt-shadow-xs:0 1px 2px #00000052;--rdt-shadow-sm:0 4px 12px #00000047;--rdt-shadow-md:0 10px 26px #00000070, 0 2px 6px #0000003d;--rdt-shadow-lg:0 22px 54px #0000008f, 0 4px 12px #00000057;--rdt-shadow-panel:0 18px 48px #00000080, 0 2px 8px #0000004d;--rdt-shadow-toast:0 10px 24px #00000061;--rdt-shadow-launcher:0 8px 22px #00000061, 0 2px 6px #00000038, inset 0 1px 0 #ffffff24;--rdt-shadow-launcher-hover:0 12px 28px #0000006b, 0 6px 20px #3b82f647, inset 0 1px 0 #ffffff38;--rdt-shadow-launcher-drag:0 18px 36px #00000080, 0 4px 12px #3b82f63d;--rdt-blur-sm:8px;--rdt-blur-panel:12px;--rdt-duration-instant:80ms;--rdt-duration-fast:.14s;--rdt-duration-normal:.18s;--rdt-duration-slow:.28s;--rdt-duration-pulse:.52s;--rdt-ease-standard:cubic-bezier(.2, 0, 0, 1);--rdt-ease-enter:cubic-bezier(.16, 1, .3, 1);--rdt-ease-exit:cubic-bezier(.4, 0, 1, 1);--rdt-ease-spring:cubic-bezier(.34, 1.56, .64, 1);--rdt-ease-spring-snappy:cubic-bezier(.22, 1.28, .36, 1);--rdt-scale-press:.95;--rdt-scale-drag:1.06;--rdt-z-base:1;--rdt-z-panel:10;--rdt-z-resizer:15;--rdt-z-launcher:20;--rdt-z-popover:30;--rdt-z-tooltip:40;--rdt-z-toast:50;--rdt-z-command:60;--rdt-launcher-size:36px;--rdt-launcher-radius:var(--rdt-radius-lg);--rdt-launcher-margin:12px;--rdt-launcher-bg:linear-gradient(155deg, #252e3a 0%, #171d26 52%, #11161d 100%);--rdt-launcher-fg:#e6f0ff;--rdt-launcher-border:#94b8ff38;--rdt-launcher-border-hover:#60a5fa8c;--rdt-launcher-glow:radial-gradient(120% 70% at 30% 0%, #60a5fa42, transparent 62%);--rdt-launcher-pulse-color:var(--rdt-accent);--rdt-launcher-idle-opacity:.72;--rdt-launcher-tuck-offset:32%;--rdt-launcher-pill-bg:var(--rdt-bg-translucent);--rdt-launcher-pill-border:var(--rdt-border-glass);--rdt-launcher-badge-bg:var(--rdt-error);--rdt-launcher-badge-fg:var(--rdt-on-error);--rdt-launcher-badge-ring:#11161d;--rdt-panel-bg:var(--rdt-bg);--rdt-panel-border:var(--rdt-border);--rdt-panel-radius:var(--rdt-radius-lg);--rdt-rail-bg:var(--rdt-surface);--rdt-rail-indicator:var(--rdt-accent);--rdt-rail-badge-bg:var(--rdt-error);--rdt-rail-badge-fg:var(--rdt-on-error);--rdt-switch-w:32px;--rdt-switch-h:18px;--rdt-switch-thumb-size:12px;--rdt-switch-shift:14px;--rdt-switch-track:var(--rdt-surface-3);--rdt-switch-track-on:var(--rdt-accent);--rdt-switch-thumb:var(--rdt-text-secondary);--rdt-switch-thumb-on:var(--rdt-on-accent);--rdt-code-bg:var(--rdt-inset);--rdt-code-border:var(--rdt-border);--rdt-toast-bg:var(--rdt-surface-elevated);--rdt-toast-border:var(--rdt-border-strong);--rdt-accent-strong:var(--rdt-accent-hover);--rdt-accent-line:var(--rdt-accent-border);--rdt-dim:var(--rdt-text-secondary);--rdt-faint:var(--rdt-text-tertiary);--rdt-font:var(--rdt-font-sans);--rdt-mono:var(--rdt-font-mono);--rdt-radius:var(--rdt-radius-lg);--rdt-shadow:var(--rdt-shadow-panel)}.rdt-root[data-theme=light],.rdt-root[data-theme-base=light]{--rdt-accent:#2563eb;--rdt-accent-hover:#1d4ed8;--rdt-accent-active:#1e40af;--rdt-accent-soft:#2563eb1a;--rdt-accent-soft-hover:#2563eb29;--rdt-accent-border:#2563eb5c;--rdt-accent-text:#1d4ed8;--rdt-on-accent:#fff;--rdt-inset:#f4f6f9;--rdt-inset-hover:#edf0f5;--rdt-bg:#f8f9fb;--rdt-bg-translucent:#f8f9fbe0;--rdt-surface:#fff;--rdt-surface-2:#f1f4f8;--rdt-surface-3:#e5eaf0;--rdt-surface-elevated:#fff;--rdt-overlay:#0f172a29;--rdt-highlight-top:#fffc;--rdt-highlight-subtle:#ffffffa6;--rdt-border-subtle:#0f172a0f;--rdt-border:#dfe4ec;--rdt-border-strong:#c5cedb;--rdt-border-glass:#0f172a1a;--rdt-text:#18202a;--rdt-text-secondary:#526071;--rdt-text-tertiary:#7d8a9a;--rdt-text-disabled:#adb7c4;--rdt-text-inverse:#fff;--rdt-icon:#526071;--rdt-icon-hover:#18202a;--rdt-icon-muted:#94a1b2;--rdt-ok:#1a7f37;--rdt-ok-hover:#15692c;--rdt-ok-soft:#1a7f371a;--rdt-ok-border:#1a7f3747;--rdt-on-ok:#fff;--rdt-warn:#9a6700;--rdt-warn-hover:#7d5300;--rdt-warn-soft:#9a67001a;--rdt-warn-border:#9a670047;--rdt-on-warn:#fff;--rdt-error:#d1242f;--rdt-error-hover:#b41d27;--rdt-error-soft:#d1242f14;--rdt-error-border:#d1242f4d;--rdt-on-error:#fff;--rdt-info:#0969da;--rdt-info-hover:#0757b8;--rdt-info-soft:#0969da1a;--rdt-info-border:#0969da47;--rdt-on-info:#fff;--rdt-http-get:#1d4ed8;--rdt-http-post:#1a7f37;--rdt-http-put:#9a6700;--rdt-http-delete:#d1242f;--rdt-http-other:#8250df;--rdt-log-debug:#6e7781;--rdt-log-warn-bg:#9a67000d;--rdt-log-error-bg:#d1242f0f;--rdt-syn-key:#0550ae;--rdt-syn-string:#0a3069;--rdt-syn-number:#953800;--rdt-syn-boolean:#8250df;--rdt-syn-null:#6e7781;--rdt-syn-punct:#8c959f;--rdt-hover:#0f172a0b;--rdt-active:#0f172a14;--rdt-selection-bg:#2563eb2e;--rdt-scrollbar-thumb:#0f172a2e;--rdt-scrollbar-thumb-hover:#0f172a57;--rdt-shadow-xs:0 1px 2px #0f172a14;--rdt-shadow-sm:0 4px 12px #0f172a14;--rdt-shadow-md:0 10px 26px #0f172a24, 0 2px 6px #0f172a0f;--rdt-shadow-lg:0 22px 54px #0f172a2e, 0 4px 12px #0f172a14;--rdt-shadow-panel:0 18px 48px #0f172a24, 0 2px 8px #0f172a0f;--rdt-shadow-toast:0 10px 24px #0f172a1f;--rdt-shadow-launcher:0 8px 22px #0f172a24, 0 2px 6px #0f172a14, inset 0 1px 0 #ffffffe6;--rdt-shadow-launcher-hover:0 12px 28px #0f172a29, 0 6px 20px #2563eb33, inset 0 1px 0 #fff;--rdt-shadow-launcher-drag:0 18px 36px #0f172a38, 0 4px 12px #2563eb2e;--rdt-launcher-bg:linear-gradient(155deg, #fff 0%, #f3f6fa 60%, #e9eef5 100%);--rdt-launcher-fg:#1e293b;--rdt-launcher-border:#0f172a24;--rdt-launcher-border-hover:#2563eb73;--rdt-launcher-glow:radial-gradient(120% 70% at 30% 0%, #2563eb1a, transparent 62%);--rdt-launcher-idle-opacity:.78;--rdt-launcher-badge-ring:#fff;--rdt-switch-thumb:#fff}.rdt-root[data-size=sm]{--rdt-font-base:12px;--rdt-text-2xs:10px;--rdt-text-xs:11px;--rdt-text-sm:12px;--rdt-text-base:13px;--rdt-text-md:14px;--rdt-panel-w:320px;--rdt-panel-h:360px;--rdt-panel-collapsed-w:228px;--rdt-header-h:32px;--rdt-toolbar-h:30px;--rdt-statusbar-h:20px;--rdt-rail-w:34px;--rdt-rail-top-h:28px;--rdt-rail-item-size:24px;--rdt-icon-sm:12px;--rdt-icon-md:14px;--rdt-iconbtn-size:22px;--rdt-brand-mark-size:17px;--rdt-row-h:26px;--rdt-tab-h:28px;--rdt-log-py:3px;--rdt-control-h-sm:21px;--rdt-control-h:26px;--rdt-tag-h:17px;--rdt-switch-w:28px;--rdt-switch-h:16px;--rdt-switch-thumb-size:10px;--rdt-switch-shift:12px;--rdt-panel-pad-x:8px;--rdt-panel-pad-y:6px;--rdt-net-cols:40px 32px minmax(0, 1fr) 44px;--rdt-log-cols:52px 34px minmax(0, 1fr);--rdt-kv-key-w:64px;--rdt-shortcut-w:106px;--rdt-code-max-h:170px}.rdt-root[data-size=lg]{--rdt-font-base:16px;--rdt-text-2xs:12px;--rdt-text-xs:14px;--rdt-text-sm:16px;--rdt-text-base:17px;--rdt-text-md:18px;--rdt-panel-w:640px;--rdt-panel-h:560px;--rdt-panel-collapsed-w:304px;--rdt-header-h:44px;--rdt-toolbar-h:42px;--rdt-statusbar-h:28px;--rdt-rail-w:46px;--rdt-rail-top-h:34px;--rdt-rail-item-size:34px;--rdt-icon-sm:16px;--rdt-icon-md:18px;--rdt-iconbtn-size:30px;--rdt-brand-mark-size:22px;--rdt-row-h:36px;--rdt-tab-h:38px;--rdt-log-py:6px;--rdt-control-h-sm:28px;--rdt-control-h:34px;--rdt-tag-h:22px;--rdt-switch-w:36px;--rdt-switch-h:20px;--rdt-switch-thumb-size:14px;--rdt-switch-shift:16px;--rdt-panel-pad-x:14px;--rdt-panel-pad-y:11px;--rdt-net-cols:54px 44px minmax(0, 1fr) 60px;--rdt-log-cols:72px 46px minmax(0, 1fr);--rdt-kv-key-w:90px;--rdt-shortcut-w:144px;--rdt-code-max-h:320px}*,:before,:after{box-sizing:border-box}.rdt-root{font-family:var(--rdt-font-sans);font-size:var(--rdt-font-base);line-height:var(--rdt-leading-normal);color:var(--rdt-text);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer}button:focus-visible,[role=button]:focus-visible,[role=tab]:focus-visible,[role=switch]:focus-visible{outline:2px solid var(--rdt-focus-outline);outline-offset:1px}.rdt-icon{flex:none;display:block}::selection{background:var(--rdt-selection-bg)}.rdt-scroll,.rdt-scroll-body{scrollbar-width:thin;scrollbar-color:var(--rdt-scrollbar-thumb) var(--rdt-scrollbar-track);overflow:auto}.rdt-scroll::-webkit-scrollbar{width:7px;height:7px}.rdt-scroll-body::-webkit-scrollbar{width:7px;height:7px}.rdt-scroll::-webkit-scrollbar-thumb{background:var(--rdt-scrollbar-thumb);border-radius:var(--rdt-radius-pill);background-clip:padding-box;border:1.5px solid #0000}.rdt-scroll-body::-webkit-scrollbar-thumb{background:var(--rdt-scrollbar-thumb);border-radius:var(--rdt-radius-pill);background-clip:padding-box;border:1.5px solid #0000}.rdt-scroll::-webkit-scrollbar-thumb:hover{background:var(--rdt-scrollbar-thumb-hover);background-clip:padding-box;border:1.5px solid #0000}.rdt-scroll-body::-webkit-scrollbar-thumb:hover{background:var(--rdt-scrollbar-thumb-hover);background-clip:padding-box;border:1.5px solid #0000}.rdt-scroll::-webkit-scrollbar-track{background:var(--rdt-scrollbar-track)}.rdt-scroll-body::-webkit-scrollbar-track{background:var(--rdt-scrollbar-track)}.rdt-mono{font-family:var(--rdt-font-mono);font-variant-ligatures:none}.rdt-muted{color:var(--rdt-text-secondary)}.rdt-faint{color:var(--rdt-text-tertiary)}.rdt-sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.rdt-root{--rdt-duration-instant:0s;--rdt-duration-fast:80ms;--rdt-duration-normal:80ms;--rdt-duration-slow:80ms;--rdt-duration-pulse:0s;--rdt-ease-spring:ease;--rdt-ease-spring-snappy:ease}.rdt-root *,.rdt-root :before,.rdt-root :after{animation-duration:.01ms!important;animation-iteration-count:1!important}}.rdt-launcher{right:var(--rdt-launcher-margin);bottom:var(--rdt-launcher-margin);z-index:var(--rdt-z-launcher);width:var(--rdt-launcher-size);height:var(--rdt-launcher-size);border-radius:var(--rdt-launcher-radius);border:1px solid var(--rdt-launcher-border);background:var(--rdt-launcher-bg);color:var(--rdt-launcher-fg);cursor:pointer;box-shadow:var(--rdt-shadow-launcher);backdrop-filter:blur(var(--rdt-blur-panel));transition:transform var(--rdt-duration-normal) var(--rdt-ease-spring-snappy), border-color var(--rdt-duration-fast) var(--rdt-ease-standard), box-shadow var(--rdt-duration-fast) var(--rdt-ease-standard), opacity var(--rdt-duration-fast) var(--rdt-ease-standard);touch-action:none;user-select:none;pointer-events:auto;animation:rdt-launcher-enter var(--rdt-duration-normal) var(--rdt-ease-spring);place-items:center;padding:0;display:grid;position:fixed}.rdt-launcher:before{content:\"\";border-radius:inherit;background:var(--rdt-launcher-glow);pointer-events:none;position:absolute;inset:0}.rdt-launcher__icon{transition:transform var(--rdt-duration-fast) var(--rdt-ease-spring-snappy);place-items:center;display:grid;position:relative}.rdt-launcher__status{border-radius:var(--rdt-radius-full);background:var(--rdt-ok);width:5px;height:5px;box-shadow:0 0 0 1.5px var(--rdt-launcher-badge-ring);transition:background var(--rdt-duration-fast) var(--rdt-ease-standard), transform var(--rdt-duration-fast) var(--rdt-ease-spring);pointer-events:none;position:absolute;bottom:5px;left:5px}.rdt-launcher__status[data-state=paused]{background:var(--rdt-text-tertiary)}.rdt-launcher__status[data-state=error]{background:var(--rdt-error)}.rdt-launcher__pulse{border-radius:inherit;border:1.5px solid var(--rdt-launcher-pulse-color);opacity:0;pointer-events:none;position:absolute;inset:-1px}.rdt-launcher__pulse.is-pulsing{animation:rdt-launcher-pulse var(--rdt-duration-pulse) var(--rdt-ease-enter)}.rdt-launcher[data-tucked=true]{opacity:var(--rdt-launcher-idle-opacity);transition:transform var(--rdt-duration-slow) var(--rdt-ease-standard), opacity var(--rdt-duration-slow) var(--rdt-ease-standard), border-color var(--rdt-duration-fast) var(--rdt-ease-standard), box-shadow var(--rdt-duration-fast) var(--rdt-ease-standard)}.rdt-launcher[data-edge=right][data-tucked=true]{transform:translate3d(var(--rdt-launcher-tuck-offset), 0, 0)}.rdt-launcher[data-edge=left][data-tucked=true]{transform:translate3d(calc(-1 * var(--rdt-launcher-tuck-offset)), 0, 0)}.rdt-launcher[data-edge=bottom][data-tucked=true]{transform:translate3d(0, var(--rdt-launcher-tuck-offset), 0)}.rdt-launcher:hover,.rdt-launcher:focus-visible,.rdt-launcher.is-pill-open{opacity:1;border-color:var(--rdt-launcher-border-hover);box-shadow:var(--rdt-shadow-launcher-hover);transform:translateY(-1px)scale(1.04)}.rdt-launcher:hover .rdt-launcher__icon{transform:scale(1.06)}.rdt-launcher:active{transform:translate3d(0, 0, 0) scale(var(--rdt-scale-press));transition-duration:var(--rdt-duration-instant)}.rdt-launcher:focus-visible{outline:2px solid var(--rdt-focus-outline);outline-offset:2px}.rdt-launcher.is-dragging{cursor:grabbing;opacity:1;transform:scale(var(--rdt-scale-drag)) rotate(var(--rdt-drag-tilt,0deg));border-color:var(--rdt-launcher-border-hover);box-shadow:var(--rdt-shadow-launcher-drag);transition:box-shadow var(--rdt-duration-fast) var(--rdt-ease-standard), border-color var(--rdt-duration-fast) var(--rdt-ease-standard)}.rdt-launcher.is-snapping{transition:left var(--rdt-duration-slow) var(--rdt-ease-spring), top var(--rdt-duration-slow) var(--rdt-ease-spring), transform var(--rdt-duration-normal) var(--rdt-ease-spring), box-shadow var(--rdt-duration-fast) var(--rdt-ease-standard)}.rdt-launcher.is-alerting{border-color:var(--rdt-error-border);animation:rdt-launcher-shake .22s var(--rdt-ease-spring)}.rdt-launcher[data-open=true]{opacity:1;pointer-events:auto;border-color:var(--rdt-accent-border);color:var(--rdt-accent-text);box-shadow:var(--rdt-shadow-launcher-hover)}.rdt-launcher__badge{border-radius:var(--rdt-radius-pill);background:var(--rdt-launcher-badge-bg);min-width:15px;height:15px;color:var(--rdt-launcher-badge-fg);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-2xs);font-weight:var(--rdt-weight-semibold);font-variant-numeric:tabular-nums;line-height:var(--rdt-leading-none);box-shadow:0 0 0 2px var(--rdt-launcher-badge-ring), var(--rdt-shadow-xs);place-items:center;padding:0 3.5px;display:grid;position:absolute;top:-5px;right:-5px}.rdt-launcher__badge.is-popping{animation:rdt-badge-pop var(--rdt-duration-normal) var(--rdt-ease-spring)}.rdt-launcher-pill{z-index:var(--rdt-z-launcher);height:var(--rdt-launcher-size);padding:0 var(--rdt-space-3);align-items:center;gap:var(--rdt-space-2);border:1px solid var(--rdt-launcher-pill-border);border-radius:var(--rdt-launcher-radius);background:var(--rdt-launcher-pill-bg);backdrop-filter:blur(var(--rdt-blur-panel));box-shadow:var(--rdt-shadow-md);color:var(--rdt-text);white-space:nowrap;opacity:0;pointer-events:none;transform-origin:100%;transition:opacity var(--rdt-duration-normal) var(--rdt-ease-exit), transform var(--rdt-duration-normal) var(--rdt-ease-exit);display:flex;position:fixed;transform:translate(6px)scale(.95)}.rdt-launcher-pill[data-edge=left]{transform-origin:0;transform:translate(-6px)scale(.95)}.rdt-launcher-pill[data-edge=bottom],.rdt-launcher-pill[data-edge=\"\"]{transform-origin:bottom;transform:translate(-50%,6px)scale(.95)}.rdt-launcher-pill.is-visible{opacity:1;pointer-events:auto;transition:opacity var(--rdt-duration-normal) var(--rdt-ease-enter), transform var(--rdt-duration-normal) var(--rdt-ease-spring-snappy);transform:translate(0,0)scale(1)}.rdt-launcher-pill[data-edge=bottom].is-visible,.rdt-launcher-pill[data-edge=\"\"].is-visible{transform:translate(-50%)scale(1)}.rdt-launcher-pill__env{align-items:center;gap:var(--rdt-space-2);padding-right:var(--rdt-space-2);border-right:1px solid var(--rdt-border);color:var(--rdt-text-secondary);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-2xs);display:inline-flex}.rdt-launcher-pill__dot{border-radius:var(--rdt-radius-full);background:var(--rdt-env-local);width:5px;height:5px}.rdt-launcher-pill__dot[data-local=false]{background:var(--rdt-env-remote)}.rdt-launcher-pill__nav{align-items:center;gap:var(--rdt-space-1);display:inline-flex}.rdt-launcher-pill__btn{border-radius:var(--rdt-radius-sm);width:26px;height:26px;color:var(--rdt-icon);transition:background var(--rdt-duration-fast) var(--rdt-ease-standard), color var(--rdt-duration-fast) var(--rdt-ease-standard), transform var(--rdt-duration-instant) var(--rdt-ease-standard);background:0 0;border:0;place-items:center;padding:0;display:grid;position:relative}.rdt-launcher-pill__btn:hover{background:var(--rdt-hover);color:var(--rdt-icon-hover)}.rdt-launcher-pill__btn:active{transform:scale(var(--rdt-scale-press))}.rdt-launcher-pill__btn.has-badge:after{content:\"\";border-radius:var(--rdt-radius-full);background:var(--rdt-error);width:5px;height:5px;position:absolute;top:4px;right:4px}.rdt-launcher-pill__kbd{padding-left:var(--rdt-space-2);border-left:1px solid var(--rdt-border);color:var(--rdt-text-tertiary);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-2xs)}@keyframes rdt-launcher-enter{0%{opacity:0;transform:scale(.6)}to{opacity:1;transform:scale(1)}}@keyframes rdt-launcher-pulse{0%{opacity:.55;transform:scale(1)}to{opacity:0;transform:scale(1.52)}}@keyframes rdt-launcher-shake{0%,to{transform:translate(0,0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}@keyframes rdt-badge-pop{0%{transform:scale(.5)}to{transform:scale(1)}}.rdt-panel{right:var(--rdt-panel-gap);z-index:var(--rdt-z-panel);width:var(--rdt-w,var(--rdt-panel-w));height:var(--rdt-h,var(--rdt-panel-h));background:var(--rdt-bg-translucent);min-width:0;max-width:calc(100vw - 16px);min-height:0;max-height:calc(100vh - 16px);backdrop-filter:blur(var(--rdt-blur-panel));border:1px solid var(--rdt-panel-border);border-radius:var(--rdt-panel-radius);box-shadow:var(--rdt-shadow-lg);opacity:0;pointer-events:none;transition:left var(--rdt-duration-fast) var(--rdt-ease-enter), top var(--rdt-duration-fast) var(--rdt-ease-enter), width var(--rdt-duration-fast) var(--rdt-ease-enter), height var(--rdt-duration-fast) var(--rdt-ease-enter), transform var(--rdt-duration-normal) var(--rdt-ease-exit), opacity var(--rdt-duration-fast) var(--rdt-ease-exit);flex-direction:column;display:flex;position:fixed;bottom:56px;overflow:hidden;transform:translateY(10px)scale(.96);container-type:inline-size}.rdt-panel.is-open{opacity:1;pointer-events:auto;transition:left var(--rdt-duration-fast) var(--rdt-ease-enter), top var(--rdt-duration-fast) var(--rdt-ease-enter), width var(--rdt-duration-fast) var(--rdt-ease-enter), height var(--rdt-duration-fast) var(--rdt-ease-enter), transform var(--rdt-duration-normal) var(--rdt-ease-enter), opacity var(--rdt-duration-fast) var(--rdt-ease-enter);transform:translate(0,0)scale(1)}.rdt-panel[data-positioned=true]{left:var(--rdt-x);top:var(--rdt-y);bottom:auto;right:auto}.rdt-panel.is-moving{transition:opacity var(--rdt-duration-fast) var(--rdt-ease-standard)!important}.rdt-panel[data-collapsed=true]{border-radius:var(--rdt-radius-pill);min-height:0;transition:transform var(--rdt-duration-fast) var(--rdt-ease-enter), opacity var(--rdt-duration-fast) var(--rdt-ease-standard);width:var(--rdt-panel-collapsed-w)!important;max-width:calc(100vw - 16px)!important;height:var(--rdt-header-h)!important}.rdt-panel[data-collapsed=true][data-has-collapsed-pos=true]{left:var(--rdt-collapsed-x)!important;top:var(--rdt-collapsed-y)!important;bottom:auto!important;right:auto!important}.rdt-panel[data-collapsed=true] .rdt-main,.rdt-panel[data-collapsed=true] .rdt-statusbar,.rdt-panel[data-collapsed=true] .rdt-brand__env,.rdt-panel[data-collapsed=true] .rdt-content__subtitle,.rdt-panel[data-collapsed=true] .rdt-header__theme-btn{display:none!important}.rdt-panel[data-collapsed=true] .rdt-panel__header{padding:0 var(--rdt-space-3);border-bottom-color:#0000}.rdt-panel__header{align-items:center;gap:var(--rdt-space-2);height:var(--rdt-header-h);padding:0 var(--rdt-space-2) 0 var(--rdt-space-4);border-bottom:1px solid var(--rdt-border);background:var(--rdt-backdrop-header);cursor:grab;touch-action:none;user-select:none;flex:none;display:flex}.rdt-panel.is-moving .rdt-panel__header{cursor:grabbing}.rdt-brand{align-items:center;gap:var(--rdt-space-2);flex:none;min-width:0;max-width:42%;display:inline-flex}.rdt-brand__mark{width:var(--rdt-brand-mark-size);height:var(--rdt-brand-mark-size);border-radius:var(--rdt-radius-xs);color:var(--rdt-on-accent);background:linear-gradient(150deg, var(--rdt-accent-hover), var(--rdt-accent));box-shadow:inset 0 1px 0 var(--rdt-highlight-top);flex:none;place-items:center;display:grid}.rdt-brand__name{font-size:var(--rdt-text-sm);font-weight:var(--rdt-weight-semibold);letter-spacing:var(--rdt-tracking-tight);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.rdt-brand__env{align-items:center;gap:var(--rdt-space-1);height:var(--rdt-tag-h);border:1px solid var(--rdt-border);border-radius:var(--rdt-radius-xs);background:var(--rdt-surface-2);color:var(--rdt-text-secondary);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-2xs);flex:none;padding:0 5px;display:inline-flex}.rdt-brand__env:before{content:\"\";border-radius:var(--rdt-radius-full);background:var(--rdt-env-local);width:4.5px;height:4.5px}.rdt-brand__env[data-local=false]:before{background:var(--rdt-env-remote)}.rdt-header__context{align-items:baseline;gap:var(--rdt-space-2);min-width:0;padding-left:var(--rdt-space-2);border-left:1px solid var(--rdt-border);flex:1;display:flex;overflow:hidden}.rdt-content__title{font-size:var(--rdt-text-sm);font-weight:var(--rdt-weight-semibold);color:var(--rdt-text);letter-spacing:var(--rdt-tracking-tight);white-space:nowrap;flex:none;margin:0}.rdt-content__subtitle{min-width:0;color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs);white-space:nowrap;text-overflow:ellipsis;margin:0;overflow:hidden}.rdt-header__actions{flex:none;align-items:center;gap:2px;display:flex}.rdt-iconbtn{width:var(--rdt-iconbtn-size);height:var(--rdt-iconbtn-size);border-radius:var(--rdt-radius-xs);color:var(--rdt-icon);transition:background var(--rdt-duration-fast) var(--rdt-ease-standard), color var(--rdt-duration-fast) var(--rdt-ease-standard), transform var(--rdt-duration-instant) var(--rdt-ease-standard);background:0 0;border:0;place-items:center;padding:0;display:grid}.rdt-iconbtn .rdt-icon{width:var(--rdt-icon-sm);height:var(--rdt-icon-sm)}.rdt-iconbtn:hover{background:var(--rdt-hover);color:var(--rdt-icon-hover)}.rdt-iconbtn:active{transform:scale(var(--rdt-scale-press))}.rdt-iconbtn.is-active{background:var(--rdt-accent-soft);color:var(--rdt-icon-active)}.rdt-main{flex:1;min-height:0;display:flex}.rdt-rail{width:var(--rdt-rail-w);padding:var(--rdt-space-2) var(--rdt-space-1);border-right:1px solid var(--rdt-border);background:var(--rdt-rail-bg);flex-direction:column;flex:none;align-items:center;gap:2px;display:flex;position:relative}.rdt-rail__indicator{border-radius:0 var(--rdt-radius-xs) var(--rdt-radius-xs) 0;background:var(--rdt-rail-indicator);pointer-events:none;opacity:0;width:2px;height:14px;transition:transform var(--rdt-duration-normal) var(--rdt-ease-spring-snappy), opacity var(--rdt-duration-fast) var(--rdt-ease-standard);position:absolute;top:0;left:0}.rdt-rail__indicator.is-ready{opacity:1}.rdt-rail__item{width:var(--rdt-rail-item-size);height:var(--rdt-rail-item-size);border-radius:var(--rdt-radius-sm);color:var(--rdt-icon);transition:background var(--rdt-duration-fast) var(--rdt-ease-standard), color var(--rdt-duration-fast) var(--rdt-ease-standard), transform var(--rdt-duration-instant) var(--rdt-ease-standard);background:0 0;border:0;flex:none;place-items:center;padding:0;display:grid;position:relative}.rdt-rail__item .rdt-icon{width:var(--rdt-icon-md);height:var(--rdt-icon-md)}.rdt-rail__item:hover{background:var(--rdt-hover);color:var(--rdt-icon-hover)}.rdt-rail__item:active{transform:scale(var(--rdt-scale-press))}.rdt-rail__item.is-active{background:var(--rdt-accent-soft);color:var(--rdt-icon-active)}.rdt-rail__badge{border-radius:var(--rdt-radius-pill);background:var(--rdt-rail-badge-bg);min-width:12px;height:12px;color:var(--rdt-rail-badge-fg);font-family:var(--rdt-font-mono);font-size:8px;font-weight:var(--rdt-weight-semibold);font-variant-numeric:tabular-nums;line-height:var(--rdt-leading-none);box-shadow:0 0 0 1.5px var(--rdt-rail-bg);place-items:center;padding:0 2.5px;display:grid;position:absolute;top:0;right:0}.rdt-rail__spacer{flex:1}.rdt-rail__version{text-align:center;color:var(--rdt-text-tertiary);font-family:var(--rdt-font-mono);letter-spacing:var(--rdt-tracking-normal);font-size:8px}.rdt-root[data-size=sm] .rdt-main{flex-direction:column}.rdt-root[data-size=sm] .rdt-rail{width:100%;height:var(--rdt-rail-top-h);padding:0 var(--rdt-space-2);border-right:0;border-bottom:1px solid var(--rdt-border);scrollbar-width:none;flex-direction:row;overflow-x:auto}.rdt-root[data-size=sm] .rdt-rail::-webkit-scrollbar{display:none}.rdt-root[data-size=sm] .rdt-rail__indicator,.rdt-root[data-size=sm] .rdt-rail__version,.rdt-root[data-size=sm] .rdt-brand__env,.rdt-root[data-size=sm] .rdt-content__subtitle,.rdt-root[data-size=sm] .rdt-header__theme-btn,.rdt-root[data-size=sm] .rdt-statusbar__shortcut{display:none!important}.rdt-root[data-size=sm] .rdt-rail__item{width:26px;height:22px}.rdt-root[data-size=sm] .rdt-rail__item.is-active:after{content:\"\";border-radius:var(--rdt-radius-xs);background:var(--rdt-rail-indicator);height:2px;position:absolute;bottom:-3px;left:4px;right:4px}@container (width<=340px){.rdt-content__subtitle,.rdt-brand__env{display:none!important}}.rdt-content{background:var(--rdt-bg);flex-direction:column;flex:1;min-width:0;min-height:0;display:flex}.rdt-content__body{flex:1;min-height:0;position:relative}.rdt-plugin-view{flex-direction:column;min-height:0;display:none;position:absolute;inset:0}.rdt-plugin-view.is-active{animation:rdt-view-in var(--rdt-duration-fast) var(--rdt-ease-enter);display:flex}.rdt-statusbar{align-items:center;gap:var(--rdt-space-3);height:var(--rdt-statusbar-h);padding:0 var(--rdt-space-4);border-top:1px solid var(--rdt-border);background:var(--rdt-surface);color:var(--rdt-text-tertiary);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-xs);white-space:nowrap;flex:none;display:flex}.rdt-statusbar__item{align-items:center;gap:var(--rdt-space-1);display:inline-flex}.rdt-statusbar__capture{color:inherit;font:inherit;cursor:pointer;transition:color var(--rdt-duration-fast) var(--rdt-ease-standard);background:0 0;border:0;padding:0}.rdt-statusbar__capture:hover{color:var(--rdt-text)}.rdt-statusbar__dot{border-radius:var(--rdt-radius-full);background:var(--rdt-ok);width:5px;height:5px}.rdt-statusbar__dot.is-off{background:var(--rdt-text-tertiary)}.rdt-statusbar__spacer{flex:1}@keyframes rdt-view-in{0%{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translate(0,0)}}.rdt-btn{justify-content:center;align-items:center;gap:var(--rdt-space-2);height:var(--rdt-control-h);padding:0 var(--rdt-space-4);border:1px solid var(--rdt-border);border-radius:var(--rdt-radius-sm);background:var(--rdt-surface-2);color:var(--rdt-text);font-size:var(--rdt-text-sm);font-weight:var(--rdt-weight-medium);white-space:nowrap;transition:background var(--rdt-duration-fast) var(--rdt-ease-standard), border-color var(--rdt-duration-fast) var(--rdt-ease-standard), color var(--rdt-duration-fast) var(--rdt-ease-standard), transform var(--rdt-duration-instant) var(--rdt-ease-standard);display:inline-flex;position:relative;overflow:hidden}.rdt-btn .rdt-icon{width:var(--rdt-icon-sm);height:var(--rdt-icon-sm)}.rdt-btn:hover{background:var(--rdt-surface-3);border-color:var(--rdt-border-strong)}.rdt-btn:active{transform:scale(var(--rdt-scale-press))}.rdt-btn--primary{background:var(--rdt-accent);border-color:var(--rdt-accent);color:var(--rdt-on-accent)}.rdt-btn--primary:hover{background:var(--rdt-accent-hover);border-color:var(--rdt-accent-hover)}.rdt-btn--danger{color:var(--rdt-error)}.rdt-btn--danger:hover{background:var(--rdt-error-soft);border-color:var(--rdt-error-border)}.rdt-btn--ghost{color:var(--rdt-text-secondary);background:0 0;border-color:#0000}.rdt-btn--ghost:hover{background:var(--rdt-hover);color:var(--rdt-text)}.rdt-btn--icon-only{width:var(--rdt-control-h);padding:0}.rdt-btn.is-copied{color:var(--rdt-ok);border-color:var(--rdt-ok-border);background:var(--rdt-ok-soft)}.rdt-btn.is-copied .rdt-icon{animation:rdt-pop-in var(--rdt-duration-fast) var(--rdt-ease-spring)}.rdt-btn[data-armed=true]{border-color:var(--rdt-error-border);background:var(--rdt-error-soft);color:var(--rdt-error)}.rdt-btn[data-armed=true]:after{content:\"\";background:var(--rdt-error);transform-origin:0;height:2px;animation:rdt-countdown var(--rdt-confirm-ms,2.6s) linear forwards;position:absolute;bottom:0;left:0;right:0}.rdt-btn:disabled{opacity:.45;cursor:not-allowed}.rdt-input,.rdt-select select,.rdt-textarea{width:100%;height:var(--rdt-control-h);padding:0 var(--rdt-space-4);border:1px solid var(--rdt-border);border-radius:var(--rdt-radius-sm);background:var(--rdt-inset);color:var(--rdt-text);font-size:var(--rdt-text-sm);transition:border-color var(--rdt-duration-fast) var(--rdt-ease-standard), background var(--rdt-duration-fast) var(--rdt-ease-standard), box-shadow var(--rdt-duration-fast) var(--rdt-ease-standard);outline:none}.rdt-input:hover,.rdt-select select:hover,.rdt-textarea:hover{background:var(--rdt-inset-hover)}.rdt-input::placeholder,.rdt-textarea::placeholder{color:var(--rdt-placeholder)}.rdt-input:focus,.rdt-select select:focus,.rdt-textarea:focus{border-color:var(--rdt-border-focus);box-shadow:var(--rdt-focus-ring)}.rdt-textarea{height:auto;min-height:68px;padding:var(--rdt-space-3) var(--rdt-space-4);resize:vertical;line-height:var(--rdt-leading-relaxed)}.rdt-input[readonly]{color:var(--rdt-text-secondary)}.rdt-select{display:block;position:relative}.rdt-select select{appearance:none;cursor:pointer;padding-right:24px}.rdt-select__chevron{right:var(--rdt-space-4);color:var(--rdt-text-tertiary);pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.rdt-input-group{gap:var(--rdt-space-2);display:flex}.rdt-input-group .rdt-input{flex:1;min-width:0}.rdt-combo{position:relative}.rdt-combo__row{gap:var(--rdt-space-2);display:flex}.rdt-combo__row .rdt-input{flex:1;min-width:0}.rdt-input-addon{width:var(--rdt-control-h);height:var(--rdt-control-h);border:1px solid var(--rdt-border);border-radius:var(--rdt-radius-sm);background:var(--rdt-surface-2);color:var(--rdt-icon);transition:background var(--rdt-duration-fast) var(--rdt-ease-standard), color var(--rdt-duration-fast) var(--rdt-ease-standard);flex:none;place-items:center;padding:0;display:grid}.rdt-input-addon:hover{background:var(--rdt-surface-3);color:var(--rdt-icon-hover)}.rdt-menu{top:calc(100% + var(--rdt-space-2));z-index:var(--rdt-z-popover);padding:var(--rdt-space-2);border:1px solid var(--rdt-border-strong);border-radius:var(--rdt-radius-md);background:var(--rdt-surface-elevated);box-shadow:var(--rdt-shadow-md);max-height:200px;animation:rdt-menu-in var(--rdt-duration-fast) var(--rdt-ease-enter);position:absolute;left:0;right:0;overflow:auto}.rdt-menu__item{justify-content:space-between;align-items:center;gap:var(--rdt-space-4);width:100%;padding:5px var(--rdt-space-4);border-radius:var(--rdt-radius-sm);color:var(--rdt-text);font-size:var(--rdt-text-sm);text-align:left;transition:background var(--rdt-duration-instant) var(--rdt-ease-standard);background:0 0;border:0;display:flex}.rdt-menu__item:hover{background:var(--rdt-hover)}.rdt-menu__desc{color:var(--rdt-text-tertiary);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-2xs)}.rdt-search{flex:120px;min-width:96px;position:relative}.rdt-search .rdt-icon{color:var(--rdt-text-tertiary);pointer-events:none;position:absolute;top:50%;left:7px;transform:translateY(-50%)}.rdt-search .rdt-input{height:var(--rdt-control-h-sm);font-size:var(--rdt-text-xs);padding-left:24px}.rdt-switch{width:var(--rdt-switch-w);height:var(--rdt-switch-h);border:1px solid var(--rdt-border-strong);border-radius:var(--rdt-radius-pill);background:var(--rdt-switch-track);transition:background var(--rdt-duration-normal) var(--rdt-ease-standard), border-color var(--rdt-duration-normal) var(--rdt-ease-standard);flex:none;padding:0;display:inline-flex;position:relative}.rdt-switch:after{content:\"\";width:var(--rdt-switch-thumb-size);height:var(--rdt-switch-thumb-size);border-radius:var(--rdt-radius-full);background:var(--rdt-switch-thumb);transition:transform var(--rdt-duration-normal) var(--rdt-ease-spring-snappy), width var(--rdt-duration-instant) var(--rdt-ease-standard), background var(--rdt-duration-normal) var(--rdt-ease-standard);position:absolute;top:2px;left:2px}.rdt-switch:active:after{width:calc(var(--rdt-switch-thumb-size) + 3px)}.rdt-switch[aria-checked=true]{background:var(--rdt-switch-track-on);border-color:var(--rdt-switch-track-on)}.rdt-switch[aria-checked=true]:after{transform:translateX(var(--rdt-switch-shift));background:var(--rdt-switch-thumb-on)}.rdt-switch[aria-checked=true]:active:after{transform:translateX(calc(var(--rdt-switch-shift) - 3px));width:calc(var(--rdt-switch-thumb-size) + 3px)}.rdt-tag{height:var(--rdt-tag-h);border-radius:var(--rdt-radius-xs);background:var(--rdt-surface-3);color:var(--rdt-text-secondary);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-2xs);font-weight:var(--rdt-weight-medium);white-space:nowrap;align-items:center;padding:0 6px;display:inline-flex}.rdt-tag--ok{background:var(--rdt-ok-soft);color:var(--rdt-ok)}.rdt-tag--warn{background:var(--rdt-warn-soft);color:var(--rdt-warn)}.rdt-tag--error{background:var(--rdt-error-soft);color:var(--rdt-error)}.rdt-tag--info{background:var(--rdt-accent-soft);color:var(--rdt-accent-text)}.rdt-chip{height:var(--rdt-control-h-sm);border:1px solid var(--rdt-border);border-radius:var(--rdt-radius-sm);color:var(--rdt-text-secondary);font-size:var(--rdt-text-xs);white-space:nowrap;transition:background var(--rdt-duration-fast) var(--rdt-ease-standard), border-color var(--rdt-duration-fast) var(--rdt-ease-standard), color var(--rdt-duration-fast) var(--rdt-ease-standard);background:0 0;align-items:center;gap:4px;padding:0 7px;display:inline-flex}.rdt-chip:hover{color:var(--rdt-text);background:var(--rdt-hover)}.rdt-chip.is-active{background:var(--rdt-accent-soft);border-color:var(--rdt-accent-border);color:var(--rdt-accent-text)}.rdt-segmented{padding:var(--rdt-space-1);border:1px solid var(--rdt-border);border-radius:var(--rdt-radius-sm);background:var(--rdt-inset);flex-wrap:wrap;gap:1px;display:inline-flex}.rdt-segmented__item{align-items:center;gap:var(--rdt-space-2);height:var(--rdt-control-h-sm);border-radius:var(--rdt-radius-xs);color:var(--rdt-text-secondary);font-size:var(--rdt-text-xs);transition:background var(--rdt-duration-fast) var(--rdt-ease-standard), color var(--rdt-duration-fast) var(--rdt-ease-standard), transform var(--rdt-duration-instant) var(--rdt-ease-standard);background:0 0;border:0;padding:0 8px;display:inline-flex}.rdt-segmented__item:hover{color:var(--rdt-text)}.rdt-segmented__item:active{transform:scale(var(--rdt-scale-press))}.rdt-segmented__item.is-active{background:var(--rdt-surface-3);color:var(--rdt-text);box-shadow:inset 0 0 0 1px var(--rdt-border-strong), var(--rdt-shadow-xs)}.rdt-empty{justify-content:center;align-items:center;gap:var(--rdt-space-3);height:100%;min-height:130px;padding:var(--rdt-space-8);color:var(--rdt-text-tertiary);text-align:center;flex-direction:column;display:flex}.rdt-empty__icon{color:var(--rdt-icon-muted)}.rdt-empty__text{font-size:var(--rdt-text-sm);line-height:var(--rdt-leading-relaxed);max-width:240px;margin:0}.rdt-code{padding:var(--rdt-space-4) var(--rdt-space-5);border:1px solid var(--rdt-code-border);border-radius:var(--rdt-radius-md);background:var(--rdt-code-bg);color:var(--rdt-text);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-xs);line-height:var(--rdt-leading-relaxed);white-space:pre-wrap;word-break:break-word;max-height:var(--rdt-code-max-h);margin:0;overflow:auto}.rdt-kv{grid-template-columns:minmax(var(--rdt-kv-key-w), auto) 1fr;gap:3px var(--rdt-space-5);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-xs);line-height:var(--rdt-leading-relaxed);word-break:break-all;display:grid}.rdt-kv__key{color:var(--rdt-text-tertiary)}.rdt-kv__value{color:var(--rdt-text)}.rdt-divider{background:var(--rdt-divider);height:1px;margin:var(--rdt-space-4) 0}.rdt-scroll-body{height:100%;overflow:auto}.rdt-config{padding:var(--rdt-space-1) 0 var(--rdt-space-7)}.rdt-group{padding:var(--rdt-panel-pad-y) var(--rdt-panel-pad-x) var(--rdt-space-1)}.rdt-group+.rdt-group{border-top:1px solid var(--rdt-border);margin-top:var(--rdt-space-2)}.rdt-group__head{align-items:baseline;gap:var(--rdt-space-3);padding:0 0 var(--rdt-space-3);display:flex}.rdt-group__title{color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs);font-weight:var(--rdt-weight-semibold);letter-spacing:var(--rdt-tracking-wide);text-transform:uppercase;margin:0}.rdt-group__desc{color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs)}.rdt-field{gap:var(--rdt-space-2);padding:var(--rdt-space-2) 0 var(--rdt-space-3);flex-direction:column;display:flex}.rdt-field__label{align-items:center;gap:var(--rdt-space-3);color:var(--rdt-text-secondary);font-size:var(--rdt-text-sm);font-weight:var(--rdt-weight-medium);display:inline-flex}.rdt-field__badge{background:var(--rdt-warn-soft);height:14px;color:var(--rdt-warn);font-size:var(--rdt-text-2xs);padding:0 4px}.rdt-field__hint{color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs);line-height:var(--rdt-leading-normal)}.rdt-field--row{justify-content:space-between;align-items:center;gap:var(--rdt-space-5);flex-direction:row;padding:5px 0}.rdt-field--row .rdt-field__text{flex-direction:column;gap:1px;min-width:0;display:flex}.rdt-field__saved{align-items:center;gap:var(--rdt-space-2);color:var(--rdt-ok);font-size:var(--rdt-text-2xs);transition:opacity var(--rdt-duration-fast) var(--rdt-ease-standard);display:inline-flex}.rdt-config__footer{align-items:center;gap:var(--rdt-space-4);padding:var(--rdt-space-5) var(--rdt-panel-pad-x) 0;color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs);flex-wrap:wrap;display:flex}.rdt-net,.rdt-logs{flex-direction:column;height:100%;min-height:0;display:flex}.rdt-toolbar{align-items:center;gap:var(--rdt-space-2);min-height:var(--rdt-toolbar-h);padding:5px var(--rdt-space-4);border-bottom:1px solid var(--rdt-border);background:var(--rdt-bg);flex-wrap:wrap;flex:none;display:flex}.rdt-toolbar__spacer{flex:1}.rdt-filterbar{scrollbar-width:none;align-items:center;gap:3px;max-width:100%;display:inline-flex;overflow-x:auto}.rdt-filterbar::-webkit-scrollbar{display:none}.rdt-count{color:var(--rdt-text-tertiary);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-2xs);font-variant-numeric:tabular-nums;white-space:nowrap}.rdt-net__body{flex:1;min-height:0;display:flex;position:relative}.rdt-netlist{flex:1;min-height:0;position:relative;overflow:auto}.rdt-netlist__spacer{width:100%;position:relative}.rdt-netlist__window{position:absolute;top:0;left:0;right:0}.rdt-netrow{grid-template-columns:var(--rdt-net-cols);align-items:center;gap:var(--rdt-space-3);height:var(--rdt-row-h);padding:0 var(--rdt-panel-pad-x);border-bottom:1px solid var(--rdt-border-subtle);cursor:pointer;transition:background var(--rdt-duration-instant) var(--rdt-ease-standard);display:grid}.rdt-netrow:hover{background:var(--rdt-hover)}.rdt-netrow.is-active{background:var(--rdt-selected)}.rdt-netrow[data-failed=true]{box-shadow:inset 2px 0 0 var(--rdt-error)}.rdt-netrow__method{font-family:var(--rdt-font-mono);font-size:var(--rdt-text-xs);font-weight:var(--rdt-weight-semibold);color:var(--rdt-http-other)}.rdt-netrow__method[data-method=GET],.rdt-netrow__method[data-method=HEAD]{color:var(--rdt-http-get)}.rdt-netrow__method[data-method=POST]{color:var(--rdt-http-post)}.rdt-netrow__method[data-method=PUT],.rdt-netrow__method[data-method=PATCH]{color:var(--rdt-http-put)}.rdt-netrow__method[data-method=DELETE]{color:var(--rdt-http-delete)}.rdt-netrow__status{font-family:var(--rdt-font-mono);font-size:var(--rdt-text-xs);color:var(--rdt-status-2xx);font-variant-numeric:tabular-nums}.rdt-netrow__status[data-error=true]{color:var(--rdt-status-5xx)}.rdt-netrow__status[data-pending=true]{color:var(--rdt-status-pending)}.rdt-netrow__url{font-family:var(--rdt-font-mono);font-size:var(--rdt-text-sm);color:var(--rdt-text);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.rdt-netrow__url em{color:var(--rdt-text-tertiary);margin-right:2px;font-style:normal}.rdt-netrow__time{font-family:var(--rdt-font-mono);font-size:var(--rdt-text-xs);color:var(--rdt-text-tertiary);text-align:right;font-variant-numeric:tabular-nums}.rdt-detail{min-width:0;min-height:0;padding:var(--rdt-panel-pad-y) var(--rdt-panel-pad-x) var(--rdt-space-7);animation:rdt-drawer-in var(--rdt-duration-normal) var(--rdt-ease-enter);flex:1;overflow:auto}@container (width>=500px){.rdt-root[data-size=lg] .rdt-net.has-detail .rdt-netlist{border-right:1px solid var(--rdt-border);flex:0 0 43%;display:block!important}}.rdt-detail__head{align-items:center;gap:var(--rdt-space-3);margin-bottom:var(--rdt-space-4);flex-wrap:wrap;display:flex}.rdt-detail__url{min-width:0;font-family:var(--rdt-font-mono);font-size:var(--rdt-text-xs);word-break:break-all;line-height:var(--rdt-leading-normal);flex:1}.rdt-detail__section{margin-top:var(--rdt-space-5)}.rdt-detail__title{justify-content:space-between;align-items:center;gap:var(--rdt-space-3);margin:0 0 var(--rdt-space-2);color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs);font-weight:var(--rdt-weight-semibold);letter-spacing:var(--rdt-tracking-wide);text-transform:uppercase;display:flex}.rdt-spinner{border:1.5px solid var(--rdt-border-strong);border-top-color:var(--rdt-accent);border-radius:var(--rdt-radius-full);width:11px;height:11px;animation:.75s linear infinite rdt-spin;display:inline-block}.rdt-tabs{gap:var(--rdt-space-6);padding:0 var(--rdt-panel-pad-x);border-bottom:1px solid var(--rdt-border);flex:none;display:flex}.rdt-tab{height:var(--rdt-tab-h);color:var(--rdt-text-secondary);font-size:var(--rdt-text-sm);font-weight:var(--rdt-weight-medium);transition:color var(--rdt-duration-fast) var(--rdt-ease-standard);background:0 0;border:0;padding:0;position:relative}.rdt-tab:hover,.rdt-tab.is-active{color:var(--rdt-text)}.rdt-tab.is-active:after{content:\"\";border-radius:var(--rdt-radius-xs) var(--rdt-radius-xs) 0 0;background:var(--rdt-accent);height:2px;position:absolute;bottom:-1px;left:0;right:0}.rdt-tab__count{color:var(--rdt-text-tertiary);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-2xs);margin-left:3px}.rdt-store-row{align-items:center;gap:var(--rdt-space-3);height:var(--rdt-row-h);padding:0 var(--rdt-panel-pad-x);border-bottom:1px solid var(--rdt-border-subtle);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-sm);cursor:pointer;transition:background var(--rdt-duration-instant) var(--rdt-ease-standard);grid-template-columns:minmax(84px,.9fr) minmax(0,1.4fr) auto;display:grid}.rdt-store-row:hover{background:var(--rdt-hover)}.rdt-store-row__key{color:var(--rdt-text);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.rdt-store-row__value{color:var(--rdt-text-secondary);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.rdt-store-row__meta{align-items:center;gap:var(--rdt-space-1);display:inline-flex}.rdt-store-row__size{color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs);text-align:right}.rdt-store-row__quick{opacity:0;border-radius:var(--rdt-radius-xs);width:20px;height:20px;color:var(--rdt-icon);transition:opacity var(--rdt-duration-fast) var(--rdt-ease-standard), background var(--rdt-duration-fast) var(--rdt-ease-standard), color var(--rdt-duration-fast) var(--rdt-ease-standard);background:0 0;border:0;place-items:center;padding:0;display:grid}.rdt-store-row:hover .rdt-store-row__quick,.rdt-store-row__quick:focus-visible{opacity:1}.rdt-store-row__quick:hover{background:var(--rdt-surface-3);color:var(--rdt-icon-hover)}.rdt-store__body{flex:1;min-height:0;display:flex;position:relative}.rdt-store__body>.rdt-list{flex:1;min-width:0;height:100%}.rdt-store-edit{min-width:0;height:100%;padding:var(--rdt-panel-pad-y) var(--rdt-panel-pad-x);animation:rdt-drawer-in var(--rdt-duration-normal) var(--rdt-ease-enter);flex:1}@container (width>=500px){.rdt-root[data-size=lg] .rdt-store.has-editor .rdt-list{border-right:1px solid var(--rdt-border);flex:0 0 42%;display:block!important}}.rdt-store-row.is-active{background:var(--rdt-selected)}.rdt-store-edit__head{align-items:center;gap:var(--rdt-space-3);margin-bottom:var(--rdt-space-3);display:flex}.rdt-store-edit__key{min-width:0;font-family:var(--rdt-font-mono);font-size:var(--rdt-text-sm);word-break:break-all;flex:1}.rdt-store-edit .rdt-textarea{min-height:130px;font-family:var(--rdt-font-mono);font-size:var(--rdt-text-xs)}.rdt-store-edit__actions{gap:var(--rdt-space-3);margin-top:var(--rdt-space-4);display:flex}.rdt-loglist{flex:1;min-height:0;overflow:auto}.rdt-logrow{grid-template-columns:var(--rdt-log-cols);gap:var(--rdt-space-3);padding:var(--rdt-log-py) var(--rdt-panel-pad-x);border-bottom:1px solid var(--rdt-border-subtle);font-family:var(--rdt-font-mono);font-size:var(--rdt-text-sm);line-height:var(--rdt-leading-normal);transition:background var(--rdt-duration-instant) var(--rdt-ease-standard);display:grid}.rdt-logrow:hover{background:var(--rdt-hover)}.rdt-logrow__time{color:var(--rdt-text-tertiary);font-size:var(--rdt-text-xs);font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:clip;overflow:hidden}.rdt-logrow__level{font-size:var(--rdt-text-xs);font-weight:var(--rdt-weight-semibold);text-transform:uppercase;color:var(--rdt-log-log)}.rdt-logrow[data-level=debug] .rdt-logrow__level{color:var(--rdt-log-debug)}.rdt-logrow[data-level=info] .rdt-logrow__level{color:var(--rdt-log-info)}.rdt-logrow[data-level=warn]{background:var(--rdt-log-warn-bg);box-shadow:inset 2px 0 0 var(--rdt-log-warn)}.rdt-logrow[data-level=warn] .rdt-logrow__level{color:var(--rdt-log-warn)}.rdt-logrow[data-level=error]{background:var(--rdt-log-error-bg);box-shadow:inset 2px 0 0 var(--rdt-log-error)}.rdt-logrow[data-level=error] .rdt-logrow__level{color:var(--rdt-log-error)}.rdt-logrow__msg{color:var(--rdt-text);white-space:pre-wrap;word-break:break-word}.rdt-logrow__count{min-width:14px;height:14px;margin-left:var(--rdt-space-3);border-radius:var(--rdt-radius-pill);background:var(--rdt-surface-3);color:var(--rdt-text-secondary);font-size:var(--rdt-text-2xs);vertical-align:1px;place-items:center;padding:0 4px;display:inline-grid}.rdt-actions{height:100%;padding:var(--rdt-panel-pad-y) var(--rdt-panel-pad-x);gap:var(--rdt-space-3);flex-direction:column;display:flex;overflow:auto}@container (width>=500px){.rdt-root[data-size=lg] .rdt-actions.has-items{grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;display:grid}}.rdt-action{align-items:center;gap:var(--rdt-space-4);padding:7px var(--rdt-space-5);border:1px solid var(--rdt-border);border-radius:var(--rdt-radius-md);background:var(--rdt-surface);text-align:left;cursor:pointer;transition:border-color var(--rdt-duration-fast) var(--rdt-ease-standard), background var(--rdt-duration-fast) var(--rdt-ease-standard), transform var(--rdt-duration-instant) var(--rdt-ease-standard);display:flex;position:relative;overflow:hidden}.rdt-action:hover{border-color:var(--rdt-border-strong);background:var(--rdt-surface-2)}.rdt-action[data-armed=true]{border-color:var(--rdt-error-border)}.rdt-action__icon{border-radius:var(--rdt-radius-sm);background:var(--rdt-surface-2);width:26px;height:26px;color:var(--rdt-icon);transition:color var(--rdt-duration-fast) var(--rdt-ease-standard), background var(--rdt-duration-fast) var(--rdt-ease-standard);flex:none;place-items:center;display:grid}.rdt-action:hover .rdt-action__icon{color:var(--rdt-icon-active);background:var(--rdt-accent-soft)}.rdt-action[data-tone=danger] .rdt-action__icon{color:var(--rdt-error);background:var(--rdt-error-soft)}.rdt-action__text{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.rdt-action__label{font-size:var(--rdt-text-sm);font-weight:var(--rdt-weight-medium)}.rdt-action__desc{color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs);line-height:var(--rdt-leading-normal)}.rdt-action__run{flex:none}.rdt-settings{height:100%;padding:var(--rdt-space-1) 0 var(--rdt-space-7);overflow:auto}.rdt-setting__range{align-items:center;gap:var(--rdt-space-3);display:flex}.rdt-range{appearance:none;border-radius:var(--rdt-radius-pill);background:var(--rdt-surface-3);outline:none;width:92px;height:4px}.rdt-range::-webkit-slider-thumb{appearance:none;border-radius:var(--rdt-radius-full);background:var(--rdt-accent);border:2px solid var(--rdt-surface);width:12px;height:12px;box-shadow:0 0 0 1px var(--rdt-accent-border);cursor:pointer;transition:transform var(--rdt-duration-instant) var(--rdt-ease-spring)}.rdt-range::-webkit-slider-thumb:hover{transform:scale(1.15)}.rdt-range::-moz-range-thumb{border:2px solid var(--rdt-surface);border-radius:var(--rdt-radius-full);background:var(--rdt-accent);cursor:pointer;width:12px;height:12px}.rdt-shortcut{width:var(--rdt-shortcut-w);text-align:center;cursor:pointer;caret-color:#0000;font-size:var(--rdt-text-xs)}.rdt-shortcut[data-recording=true]{border-color:var(--rdt-border-focus);box-shadow:var(--rdt-focus-ring);color:var(--rdt-accent-text)}.rdt-setting{justify-content:space-between;align-items:center;gap:var(--rdt-space-3) var(--rdt-space-5);padding:8px var(--rdt-panel-pad-x);border-bottom:1px solid var(--rdt-border-subtle);flex-wrap:wrap;display:flex}.rdt-setting__text{flex:130px;min-width:0}.rdt-setting__label{font-size:var(--rdt-text-sm);font-weight:var(--rdt-weight-medium)}.rdt-setting__desc{color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs);line-height:var(--rdt-leading-normal);margin-top:1px}.rdt-setting__control{align-items:center;gap:var(--rdt-space-2);flex-wrap:wrap;flex:none;display:flex}.rdt-theme-presets{gap:var(--rdt-space-2);padding:6px var(--rdt-panel-pad-x) 8px;border-bottom:1px solid var(--rdt-border-subtle);flex-wrap:wrap;display:flex}.rdt-theme-swatch{height:var(--rdt-control-h-sm);border:1px solid var(--rdt-border);border-radius:var(--rdt-radius-pill);background:var(--rdt-surface);color:var(--rdt-text-secondary);font-size:var(--rdt-text-2xs);transition:border-color var(--rdt-duration-fast) var(--rdt-ease-standard), color var(--rdt-duration-fast) var(--rdt-ease-standard), background var(--rdt-duration-fast) var(--rdt-ease-standard);align-items:center;gap:5px;padding:0 7px;display:inline-flex}.rdt-theme-swatch:hover{color:var(--rdt-text);border-color:var(--rdt-border-strong)}.rdt-theme-swatch.is-active{border-color:var(--rdt-accent-border);background:var(--rdt-accent-soft);color:var(--rdt-accent-text)}.rdt-theme-swatch__dot{border-radius:var(--rdt-radius-full);border:1px solid var(--rdt-border-strong);width:8px;height:8px}.rdt-about{padding:var(--rdt-space-5) var(--rdt-panel-pad-x);color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs);line-height:var(--rdt-leading-relaxed)}.rdt-toasts{z-index:var(--rdt-z-toast);align-items:flex-end;gap:var(--rdt-space-2);pointer-events:none;flex-direction:column;display:flex;position:fixed;bottom:62px;right:18px}.rdt-toast{align-items:center;gap:var(--rdt-space-3);max-width:280px;padding:6px var(--rdt-space-5);border:1px solid var(--rdt-toast-border);border-radius:var(--rdt-radius-md);background:var(--rdt-toast-bg);color:var(--rdt-text);font-size:var(--rdt-text-xs);box-shadow:var(--rdt-shadow-toast);animation:rdt-toast-in var(--rdt-duration-normal) var(--rdt-ease-enter);transition:opacity var(--rdt-duration-fast) var(--rdt-ease-exit), transform var(--rdt-duration-fast) var(--rdt-ease-exit);display:flex}.rdt-toast.is-leaving{opacity:0;transform:translate(8px)scale(.96)}.rdt-toast__dot{border-radius:var(--rdt-radius-full);background:var(--rdt-ok);flex:none;width:6px;height:6px}.rdt-toast[data-tone=error] .rdt-toast__dot{background:var(--rdt-error)}.rdt-toast[data-tone=warning] .rdt-toast__dot{background:var(--rdt-warn)}.rdt-toast[data-tone=info] .rdt-toast__dot{background:var(--rdt-info)}.rdt-list{padding:0}.rdt-selectall{align-items:center;gap:var(--rdt-space-2);color:var(--rdt-text-tertiary);font-size:var(--rdt-text-2xs);white-space:nowrap;display:inline-flex}@keyframes rdt-spin{to{transform:rotate(360deg)}}@keyframes rdt-toast-in{0%{opacity:0;transform:translateY(6px)scale(.96)}to{opacity:1;transform:translate(0,0)scale(1)}}@keyframes rdt-drawer-in{0%{opacity:0;transform:translate(10px)}to{opacity:1;transform:translate(0,0)}}@keyframes rdt-menu-in{0%{opacity:0;transform:translateY(-4px)scale(.98)}to{opacity:1;transform:translate(0,0)scale(1)}}@keyframes rdt-pop-in{0%{transform:scale(.55)}to{transform:scale(1)}}@keyframes rdt-countdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@media (width<=720px){.rdt-statusbar__shortcut,.rdt-brand__env{display:none}.rdt-statusbar{padding:0 var(--rdt-space-4);gap:var(--rdt-space-3)}}", Ee = {
1475
+ sm: {
1476
+ fontSize: 12,
1477
+ width: 320,
1478
+ height: 360,
1479
+ collapsedWidth: 228,
1480
+ collapsedHeight: 32,
1481
+ rowHeight: 26
1482
+ },
1483
+ md: {
1484
+ fontSize: 14,
1485
+ width: 420,
1486
+ height: 460,
1487
+ collapsedWidth: 264,
1488
+ collapsedHeight: 38,
1489
+ rowHeight: 32
1490
+ },
1491
+ lg: {
1492
+ fontSize: 16,
1493
+ width: 640,
1494
+ height: 560,
1495
+ collapsedWidth: 304,
1496
+ collapsedHeight: 44,
1497
+ rowHeight: 36
1498
+ }
1499
+ }, De = 12, J = 56, Y = 8, X = 12, Z = 36, Q = 46, Oe = 4e3, ke = 600;
1500
+ function Ae(e) {
1501
+ let t = e.startsWith("--rdt-") ? e : e.startsWith("--") ? null : `--rdt-${e}`;
1502
+ return !t || !/^--rdt-[a-zA-Z0-9_-]+$/.test(t) ? null : t;
1503
+ }
1504
+ function je(e) {
1505
+ return String(e).replace(/[{}<>\\;]/g, "").trim();
1506
+ }
1507
+ var Me = class {
1508
+ shadow;
1509
+ rt;
1510
+ ui;
1511
+ saveUi;
1512
+ root;
1513
+ styleEl;
1514
+ launcher;
1515
+ launcherPulse;
1516
+ launcherStatus;
1517
+ launcherBadge;
1518
+ launcherPill;
1519
+ pillNav;
1520
+ pillKbd;
1521
+ panel;
1522
+ headerEl;
1523
+ rail;
1524
+ railIndicator;
1525
+ titleEl;
1526
+ subtitleEl;
1527
+ bodyEl;
1528
+ collapseButton;
1529
+ themeButton;
1530
+ statusShortcut;
1531
+ toastsEl;
1532
+ statusNet;
1533
+ statusLogs;
1534
+ statusCapture;
1535
+ entries = /* @__PURE__ */ new Map();
1536
+ emptyView = null;
1537
+ openState = !1;
1538
+ activeId = "";
1539
+ listeners = [];
1540
+ timers = /* @__PURE__ */ new Set();
1541
+ tuckTimer = null;
1542
+ pillOpenTimer = null;
1543
+ pillCloseTimer = null;
1544
+ pillVisible = !1;
1545
+ lastNetTotal = 0;
1546
+ lastErrorCount = 0;
1547
+ lastPulseAt = 0;
1548
+ mediaQuery;
1549
+ onMediaChange = () => this.applyTheme();
1550
+ suppressedClick = !1;
1551
+ suppressedHeaderDblClick = !1;
1552
+ constructor(e, t, n, r) {
1553
+ this.shadow = e, this.rt = t, this.ui = n, this.saveUi = r, this.styleEl = document.createElement("style");
1554
+ let i = this.resolveNonce();
1555
+ i && (this.styleEl.nonce = i, this.styleEl.setAttribute("nonce", i)), this.syncCustomThemeStyles(), e.appendChild(this.styleEl), this.root = B("div", {
1556
+ class: "rdt-root",
1557
+ dataset: { size: n.size }
1558
+ }), e.appendChild(this.root);
1559
+ let a = this.envLabel();
1560
+ this.collapseButton = B("button", {
1561
+ class: `rdt-iconbtn${n.collapsed ? " is-active" : ""}`,
1562
+ type: "button",
1563
+ "aria-label": n.collapsed ? "展开面板" : "折叠面板",
1564
+ onClick: () => this.rt.ui.setCollapsed(!this.ui.collapsed)
1565
+ }), this.themeButton = B("button", {
1566
+ class: "rdt-iconbtn rdt-header__theme-btn",
1567
+ type: "button",
1568
+ title: "切换主题",
1569
+ "aria-label": "切换主题",
1570
+ onClick: () => this.toggleTheme()
1571
+ }), this.launcherPulse = B("span", {
1572
+ class: "rdt-launcher__pulse",
1573
+ "aria-hidden": "true"
1574
+ }), this.launcherStatus = B("span", {
1575
+ class: "rdt-launcher__status",
1576
+ dataset: { state: "capturing" },
1577
+ "aria-hidden": "true"
1578
+ }), this.launcherBadge = B("span", { class: "rdt-launcher__badge" }), this.launcherBadge.style.display = "none", this.launcher = B("button", {
1579
+ class: "rdt-launcher",
1580
+ type: "button",
1581
+ title: `${this.rt.options.appName} · 开发者工具`,
1582
+ "aria-label": "打开 Rinova 开发者工具",
1583
+ "aria-expanded": "false",
1584
+ "data-open": "false",
1585
+ "data-tucked": "false",
1586
+ ...this.ariaShortcut() ? { "aria-keyshortcuts": this.ariaShortcut() } : {}
1587
+ }, [
1588
+ this.launcherPulse,
1589
+ B("span", { class: "rdt-launcher__icon" }, V("terminal", 15, 2)),
1590
+ this.launcherStatus,
1591
+ this.launcherBadge
1592
+ ]), this.pillNav = B("div", { class: "rdt-launcher-pill__nav" }), this.pillKbd = B("span", { class: "rdt-launcher-pill__kbd" }), this.launcherPill = B("div", {
1593
+ class: "rdt-launcher-pill",
1594
+ role: "toolbar",
1595
+ "aria-label": "开发者工具快捷入口"
1596
+ }, [
1597
+ B("span", { class: "rdt-launcher-pill__env" }, [B("span", {
1598
+ class: "rdt-launcher-pill__dot",
1599
+ dataset: { local: a.local ? "true" : "false" }
1600
+ }), B("span", { text: a.label })]),
1601
+ this.pillNav,
1602
+ this.pillKbd
1603
+ ]), this.railIndicator = B("span", {
1604
+ class: "rdt-rail__indicator",
1605
+ "aria-hidden": "true"
1606
+ }), this.rail = B("nav", {
1607
+ class: "rdt-rail",
1608
+ role: "tablist",
1609
+ "aria-label": "调试工具面板"
1610
+ }), this.titleEl = B("h2", {
1611
+ class: "rdt-content__title",
1612
+ text: ""
1613
+ }), this.subtitleEl = B("p", {
1614
+ class: "rdt-content__subtitle",
1615
+ text: ""
1616
+ }), this.bodyEl = B("div", { class: "rdt-content__body" }), this.statusNet = B("span", { class: "rdt-statusbar__item" }), this.statusLogs = B("span", { class: "rdt-statusbar__item" }), this.statusCapture = B("button", {
1617
+ class: "rdt-statusbar__item rdt-statusbar__capture",
1618
+ type: "button",
1619
+ title: "暂停 / 恢复网络采集",
1620
+ onClick: () => {
1621
+ this.rt.network.setCapturing(!this.rt.network.capturing()), this.refreshBadges();
1622
+ }
1623
+ }), this.toastsEl = B("div", {
1624
+ class: "rdt-toasts",
1625
+ role: "status",
1626
+ "aria-live": "polite"
1627
+ }), this.statusShortcut = B("span", {
1628
+ class: "rdt-statusbar__item rdt-statusbar__shortcut",
1629
+ text: this.shortcutHint()
1630
+ }), this.headerEl = B("header", {
1631
+ class: "rdt-panel__header",
1632
+ title: "按住可任意拖拽位置 · 双击收起/展开",
1633
+ onDblclick: (e) => {
1634
+ this.suppressedHeaderDblClick || e.target?.closest("button") || this.rt.ui.setCollapsed(!this.ui.collapsed);
1635
+ }
1636
+ }, [
1637
+ B("div", { class: "rdt-brand" }, [
1638
+ B("span", { class: "rdt-brand__mark" }, V("terminal", 11, 2.3)),
1639
+ B("span", {
1640
+ class: "rdt-brand__name",
1641
+ text: this.rt.options.appName
1642
+ }),
1643
+ B("span", {
1644
+ class: "rdt-brand__env",
1645
+ text: a.label,
1646
+ dataset: { local: a.local ? "true" : "false" }
1647
+ })
1648
+ ]),
1649
+ B("div", { class: "rdt-header__context" }, [this.titleEl, this.subtitleEl]),
1650
+ B("div", { class: "rdt-header__actions" }, [
1651
+ this.collapseButton,
1652
+ this.themeButton,
1653
+ B("button", {
1654
+ class: "rdt-iconbtn",
1655
+ type: "button",
1656
+ title: "关闭 (Esc)",
1657
+ "aria-label": "关闭",
1658
+ onClick: () => this.close()
1659
+ }, V("x", 13, 2))
1660
+ ])
1661
+ ]), this.panel = B("section", {
1662
+ class: "rdt-panel",
1663
+ role: "region",
1664
+ "data-size": n.size,
1665
+ "data-collapsed": String(n.collapsed),
1666
+ "aria-label": "Rinova 开发者工具"
1667
+ }, [
1668
+ this.headerEl,
1669
+ B("div", { class: "rdt-main" }, [this.rail, B("div", { class: "rdt-content" }, [this.bodyEl])]),
1670
+ B("footer", { class: "rdt-statusbar" }, [
1671
+ this.statusCapture,
1672
+ this.statusNet,
1673
+ this.statusLogs,
1674
+ B("span", { class: "rdt-statusbar__spacer" }),
1675
+ this.statusShortcut
1676
+ ])
1677
+ ]), this.root.append(this.panel, this.launcherPill, this.launcher, this.toastsEl), this.lastNetTotal = this.rt.network.entries().length, this.lastErrorCount = this.computeErrorCount(), this.applyPanelGeometry(), this.applyTheme(), this.syncCollapseButton(), this.refreshShortcut(), this.bindLauncher(), this.bindPanelDrag(), this.bindGlobal(), this.listeners.push(t.network.subscribeChange(() => {
1678
+ this.onNetworkActivity(), this.refreshBadges();
1679
+ }), t.logs.subscribeChange(() => this.refreshBadges()), t.bus.on("network:change", () => this.refreshBadges()), t.bus.on("log:change", () => this.refreshBadges()), t.bus.on("ui:themes", () => {
1680
+ this.syncCustomThemeStyles(), this.applyTheme();
1681
+ }), t.bus.on("ui:theme", () => this.applyTheme()), t.bus.on("ui:size", ({ size: e, prev: t }) => {
1682
+ this.onSizeTransition(e, t);
1683
+ }), t.bus.on("ui:collapsed", ({ collapsed: e }) => {
1684
+ this.onCollapsedTransition(e);
1685
+ }), t.bus.on("ui:autotuck", ({ autoTuck: e }) => {
1686
+ this.ui.autoTuck = e, e ? this.scheduleTuck() : this.wakeLauncher(0);
1687
+ }), t.bus.on("ui:pos", () => {
1688
+ this.ui.panelPos || (this.ui.collapsedPos = null, this.saveUi({ collapsedPos: null })), this.applyPanelGeometry();
1689
+ }), t.bus.on("ui:shortcut", () => this.refreshShortcut()), t.bus.on("ui:reset", () => this.applyReset()), t.bus.on("ui:launcher-reset", () => this.applyLauncherPosition())), this.refreshBadges(!0), this.applyLauncherPosition();
1690
+ }
1691
+ schedule(e, t) {
1692
+ let n = setTimeout(() => {
1693
+ this.timers.delete(n), e();
1694
+ }, t);
1695
+ return this.timers.add(n), n;
1696
+ }
1697
+ clearTimer(e) {
1698
+ return e && (clearTimeout(e), this.timers.delete(e)), null;
1699
+ }
1700
+ resolveDimensions(e = this.ui.size, t = !!this.ui.panelPos) {
1701
+ let n = Ee[e];
1702
+ if (typeof window > "u") return {
1703
+ width: n.width,
1704
+ height: n.height,
1705
+ collapsedWidth: n.collapsedWidth,
1706
+ collapsedHeight: n.collapsedHeight
1707
+ };
1708
+ let r = Math.max(180, window.innerWidth - 16), i = t ? Y : J, a = Math.max(150, window.innerHeight - i - Y);
1709
+ return {
1710
+ width: Math.min(n.width, r),
1711
+ height: Math.min(n.height, a),
1712
+ collapsedWidth: Math.min(n.collapsedWidth, r),
1713
+ collapsedHeight: n.collapsedHeight
1714
+ };
1715
+ }
1716
+ clampCollapsedPos(e, t) {
1717
+ if (typeof window > "u") return {
1718
+ x: Math.round(e),
1719
+ y: Math.round(t)
1720
+ };
1721
+ let { collapsedWidth: n, collapsedHeight: r } = this.resolveDimensions(this.ui.size, !0), i = Math.max(Y, window.innerWidth - n - Y), a = Math.max(Y, window.innerHeight - r - Y);
1722
+ return {
1723
+ x: Math.max(Y, Math.min(i, Math.round(e))),
1724
+ y: Math.max(Y, Math.min(a, Math.round(t)))
1725
+ };
1726
+ }
1727
+ clampExpandedPos(e, t, n = this.ui.size) {
1728
+ if (typeof window > "u") return {
1729
+ x: Math.round(e),
1730
+ y: Math.round(t)
1731
+ };
1732
+ let { width: r, height: i } = this.resolveDimensions(n, !0), a = Math.max(Y, window.innerWidth - r - Y), o = Math.max(Y, window.innerHeight - i - Y);
1733
+ return {
1734
+ x: Math.max(Y, Math.min(a, Math.round(e))),
1735
+ y: Math.max(Y, Math.min(o, Math.round(t)))
1736
+ };
1737
+ }
1738
+ onSizeTransition(e, t) {
1739
+ if (this.ui.panelPos && typeof window < "u") {
1740
+ let n = this.resolveDimensions(t, !0), r = this.resolveDimensions(e, !0), i = this.ui.panelPos.x + n.width / 2 >= window.innerWidth / 2 ? this.ui.panelPos.x + n.width - r.width : this.ui.panelPos.x;
1741
+ this.ui.panelPos = this.clampExpandedPos(i, this.ui.panelPos.y, e), this.saveUi({ panelPos: this.ui.panelPos });
1742
+ }
1743
+ this.ui.size = e, this.root.dataset.size = e, this.panel.dataset.size = e, this.applyPanelGeometry(), this.schedule(() => this.syncRailIndicator(), 20);
1744
+ }
1745
+ onCollapsedTransition(e) {
1746
+ if (e) {
1747
+ if (this.ui.panelPos && !this.ui.collapsedPos) {
1748
+ let e = this.resolveDimensions(this.ui.size, !0), t = this.clampCollapsedPos(this.ui.panelPos.x + e.width - e.collapsedWidth, this.ui.panelPos.y);
1749
+ this.ui.collapsedPos = t, this.saveUi({ collapsedPos: t });
1750
+ }
1751
+ } else if (this.ui.collapsedPos) {
1752
+ let e = this.resolveDimensions(this.ui.size, !0), t = this.clampExpandedPos(this.ui.collapsedPos.x + e.collapsedWidth - e.width, this.ui.collapsedPos.y, this.ui.size);
1753
+ this.ui.panelPos = t, this.ui.collapsedPos = null, this.saveUi({
1754
+ panelPos: t,
1755
+ collapsedPos: null
1756
+ });
1757
+ }
1758
+ this.ui.collapsed = e, this.panel.dataset.collapsed = String(e), this.syncCollapseButton(), this.applyPanelGeometry(), e || this.schedule(() => this.syncRailIndicator(), 20);
1759
+ }
1760
+ applyPanelGeometry() {
1761
+ let e = !!this.ui.panelPos, t = this.resolveDimensions(this.ui.size, e);
1762
+ if (this.root.style.setProperty("--rdt-w", `${t.width}px`), this.root.style.setProperty("--rdt-h", `${t.height}px`), this.ui.collapsed && this.ui.collapsedPos) {
1763
+ let e = this.clampCollapsedPos(this.ui.collapsedPos.x, this.ui.collapsedPos.y);
1764
+ this.ui.collapsedPos = e, this.root.style.setProperty("--rdt-collapsed-x", `${e.x}px`), this.root.style.setProperty("--rdt-collapsed-y", `${e.y}px`), this.panel.dataset.hasCollapsedPos = "true";
1765
+ } else this.root.style.removeProperty("--rdt-collapsed-x"), this.root.style.removeProperty("--rdt-collapsed-y"), delete this.panel.dataset.hasCollapsedPos;
1766
+ if (!this.ui.panelPos) {
1767
+ this.root.style.removeProperty("--rdt-x"), this.root.style.removeProperty("--rdt-y"), delete this.panel.dataset.positioned;
1768
+ return;
1769
+ }
1770
+ let n = this.clampExpandedPos(this.ui.panelPos.x, this.ui.panelPos.y, this.ui.size);
1771
+ this.ui.panelPos = n, this.root.style.setProperty("--rdt-x", `${n.x}px`), this.root.style.setProperty("--rdt-y", `${n.y}px`), this.panel.dataset.positioned = "true";
1772
+ }
1773
+ envLabel() {
1774
+ let e = typeof location > "u" ? "" : location.hostname, t = !e || e === "localhost" || e === "127.0.0.1" || e === "::1";
1775
+ return {
1776
+ label: t ? "local" : e.replace(/^www\./, ""),
1777
+ local: t
1778
+ };
1779
+ }
1780
+ resolveNonce() {
1781
+ let e = this.rt.options.styleNonce;
1782
+ if (!e) return "";
1783
+ try {
1784
+ return typeof e == "function" ? e() : e;
1785
+ } catch {
1786
+ return "";
1787
+ }
1788
+ }
1789
+ ariaShortcut() {
1790
+ let e = this.rt.ui.getShortcut();
1791
+ return e ? e.split("+").map((e) => e.trim()).filter(Boolean).map((e) => e.toLowerCase() === "space" ? "Space" : e.charAt(0).toUpperCase() + e.slice(1)).join("+") : "";
1792
+ }
1793
+ shortcutHint() {
1794
+ return A(this.rt.ui.getShortcut());
1795
+ }
1796
+ refreshShortcut() {
1797
+ let e = this.rt.ui.getShortcut(), t = this.shortcutHint();
1798
+ this.statusShortcut && (this.statusShortcut.textContent = t), this.pillKbd.textContent = t, this.pillKbd.style.display = e ? "" : "none";
1799
+ let n = this.ariaShortcut();
1800
+ n ? this.launcher.setAttribute("aria-keyshortcuts", n) : this.launcher.removeAttribute("aria-keyshortcuts");
1801
+ }
1802
+ syncCollapseButton() {
1803
+ H(this.collapseButton), this.collapseButton.appendChild(V(this.ui.collapsed ? "chevron-up" : "minus", 13, 2)), this.collapseButton.classList.toggle("is-active", this.ui.collapsed), this.collapseButton.title = this.ui.collapsed ? "展开面板(自动适配可视区域)" : "收起为可拖拽胶囊(双击顶栏同效)", this.collapseButton.setAttribute("aria-label", this.ui.collapsed ? "展开面板" : "折叠面板");
1804
+ }
1805
+ syncCustomThemeStyles() {
1806
+ let e = [];
1807
+ for (let t of this.rt.themes.values()) {
1808
+ let n = t.id.replace(/[^a-zA-Z0-9_-]/g, "");
1809
+ if (!n) continue;
1810
+ let r = [];
1811
+ for (let [e, n] of Object.entries(t.tokens)) {
1812
+ let t = Ae(e), i = je(n);
1813
+ t && i && r.push(` ${t}: ${i};`);
1814
+ }
1815
+ r.length && e.push(`.rdt-root[data-theme='${n}'] {\n${r.join("\n")}\n}`);
1816
+ }
1817
+ this.styleEl.textContent = e.length ? `${Te}\n${e.join("\n")}` : Te;
1818
+ }
1819
+ resolvedBaseTheme() {
1820
+ let e = this.rt.themes.get(this.ui.theme);
1821
+ return e ? e.base : this.ui.theme === "dark" ? "dark" : this.ui.theme === "light" ? "light" : typeof window > "u" || !window.matchMedia || window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1822
+ }
1823
+ applyTheme() {
1824
+ let e = this.rt.themes.get(this.ui.theme), t = this.resolvedBaseTheme();
1825
+ e ? (this.root.dataset.theme = e.id, this.root.dataset.themeBase = e.base) : (this.root.dataset.theme = t, delete this.root.dataset.themeBase), H(this.themeButton), this.themeButton.appendChild(V(t === "dark" ? "sun" : "moon", 13, 1.9)), this.themeButton.title = t === "dark" ? "切换到浅色主题" : "切换到深色主题", !this.mediaQuery && typeof window < "u" && window.matchMedia && (this.mediaQuery = window.matchMedia("(prefers-color-scheme: dark)"), this.mediaQuery.addEventListener("change", this.onMediaChange));
1826
+ }
1827
+ toggleTheme() {
1828
+ this.rt.ui.setTheme(this.resolvedBaseTheme() === "dark" ? "light" : "dark");
1829
+ }
1830
+ mountPlugins(e) {
1831
+ if (e.forEach((e) => this.registerPlugin(e)), this.syncEmptyState(), !this.entries.size) return;
1832
+ let t = this.ui.activePlugin || e[0]?.id;
1833
+ this.activate(this.entries.has(t) ? t : this.entries.keys().next().value ?? "");
1834
+ }
1835
+ syncEmptyState() {
1836
+ if (this.entries.size === 0) {
1837
+ if (this.emptyView) return;
1838
+ this.emptyView = B("div", {
1839
+ class: "rdt-plugin-view is-active",
1840
+ dataset: { plugin: "__empty__" }
1841
+ }, [B("div", { class: "rdt-empty" }, [
1842
+ V("layers", 20, 1.6),
1843
+ B("p", {
1844
+ class: "rdt-empty__text",
1845
+ text: "还没有可用的调试面板"
1846
+ }),
1847
+ B("p", {
1848
+ class: "rdt-empty__text",
1849
+ text: "通过 options.plugins 或 devtools.registerPlugin() 注册第一个面板。"
1850
+ })
1851
+ ])]), this.bodyEl.appendChild(this.emptyView), this.titleEl.textContent = "开发者工具", this.subtitleEl.textContent = "暂无面板", this.subtitleEl.style.display = "";
1852
+ } else this.emptyView &&= (this.emptyView.remove(), null);
1853
+ }
1854
+ registerPlugin(e) {
1855
+ this.entries.has(e.id) && this.unregisterPlugin(e.id);
1856
+ let t = B("div", {
1857
+ class: "rdt-plugin-view",
1858
+ dataset: { plugin: e.id }
1859
+ });
1860
+ this.bodyEl.appendChild(t);
1861
+ let n = B("span", { class: "rdt-rail__badge" });
1862
+ n.style.display = "none";
1863
+ let r = {
1864
+ plugin: e,
1865
+ view: t,
1866
+ railButton: B("button", {
1867
+ class: "rdt-rail__item",
1868
+ type: "button",
1869
+ role: "tab",
1870
+ "aria-selected": "false",
1871
+ title: e.title,
1872
+ "aria-label": e.title,
1873
+ dataset: { plugin: e.id },
1874
+ onClick: () => {
1875
+ this.ui.collapsed && this.rt.ui.setCollapsed(!1), this.open(e.id);
1876
+ }
1877
+ }, [V(e.icon ?? "circle", 15, 1.85), n]),
1878
+ badgeEl: n,
1879
+ disposers: [],
1880
+ mounted: !1
1881
+ }, i = this.emptyView !== null;
1882
+ this.entries.set(e.id, r), this.syncEmptyState(), this.renderRail();
1883
+ let a = this.createContext(e, t, r);
1884
+ try {
1885
+ e.render(t, a), r.mounted = !0;
1886
+ } catch (n) {
1887
+ t.appendChild(B("div", { class: "rdt-empty" }, [B("p", {
1888
+ class: "rdt-empty__text",
1889
+ text: `面板「${e.title}」渲染失败:${String(n)}`
1890
+ })])), console.error(`[rinova-devtools] plugin "${e.id}" failed to render`, n);
1891
+ }
1892
+ i && !this.activeId ? this.activate(e.id) : this.activeId === e.id && this.applyActive(this.activeId), this.refreshBadges(!0);
1893
+ }
1894
+ unregisterPlugin(e) {
1895
+ let t = this.entries.get(e);
1896
+ if (t) {
1897
+ if (t.disposers.forEach((e) => {
1898
+ try {
1899
+ e();
1900
+ } catch {}
1901
+ }), t.view.remove(), t.railButton.remove(), this.entries.delete(e), this.syncEmptyState(), this.activeId === e) {
1902
+ let e = [...this.entries.keys()][0];
1903
+ e && this.activate(e), this.activeId = e ?? "";
1904
+ }
1905
+ this.renderRail(), this.renderQuickPill();
1906
+ }
1907
+ }
1908
+ sortedEntries() {
1909
+ return [...this.entries.values()].sort((e, t) => {
1910
+ let n = e.plugin.order ?? 100, r = t.plugin.order ?? 100;
1911
+ return n === r ? e.plugin.title.localeCompare(t.plugin.title) : n - r;
1912
+ });
1913
+ }
1914
+ renderRail() {
1915
+ H(this.rail), this.rail.appendChild(this.railIndicator);
1916
+ let e = this.sortedEntries(), t = e.find((e) => e.plugin.id === "settings");
1917
+ for (let n of e) {
1918
+ if (n === t) continue;
1919
+ let e = n.plugin.id === this.activeId;
1920
+ n.railButton.classList.toggle("is-active", e), n.railButton.setAttribute("aria-selected", String(e)), this.rail.appendChild(n.railButton);
1921
+ }
1922
+ if (this.rail.appendChild(B("div", { class: "rdt-rail__spacer" })), t) {
1923
+ let e = t.plugin.id === this.activeId;
1924
+ t.railButton.classList.toggle("is-active", e), t.railButton.setAttribute("aria-selected", String(e)), this.rail.appendChild(t.railButton);
1925
+ }
1926
+ let n = this.rt.options.version.match(/(\d+\.\d+)/)?.[1] ?? this.rt.options.version;
1927
+ this.rail.appendChild(B("div", {
1928
+ class: "rdt-rail__version",
1929
+ text: `v${n}`
1930
+ })), this.syncRailIndicator(), this.renderQuickPill();
1931
+ }
1932
+ syncRailIndicator() {
1933
+ let e = this.entries.get(this.activeId);
1934
+ if (!e || this.ui.size === "sm") {
1935
+ this.railIndicator.classList.remove("is-ready");
1936
+ return;
1937
+ }
1938
+ let t = e.railButton, n = t.offsetHeight;
1939
+ if (n > 0) {
1940
+ let e = t.offsetTop + Math.round((n - 14) / 2);
1941
+ this.railIndicator.style.transform = `translate3d(0, ${e}px, 0)`, this.railIndicator.classList.add("is-ready");
1942
+ } else {
1943
+ let e = [...this.rail.querySelectorAll(".rdt-rail__item")].indexOf(t);
1944
+ e >= 0 && (this.railIndicator.style.transform = `translate3d(0, ${4 + e * 32 + 8}px, 0)`, this.railIndicator.classList.add("is-ready"));
1945
+ }
1946
+ }
1947
+ renderQuickPill() {
1948
+ H(this.pillNav);
1949
+ let e = this.sortedEntries().slice(0, 5);
1950
+ for (let t of e) this.pillNav.appendChild(B("button", {
1951
+ class: "rdt-launcher-pill__btn",
1952
+ type: "button",
1953
+ title: `打开「${t.plugin.title}」`,
1954
+ "aria-label": `打开${t.plugin.title}`,
1955
+ dataset: { quickPlugin: t.plugin.id },
1956
+ onClick: () => {
1957
+ this.hidePill(!0), this.ui.collapsed && this.rt.ui.setCollapsed(!1), this.open(t.plugin.id);
1958
+ }
1959
+ }, V(t.plugin.icon ?? "circle", 13, 1.9)));
1960
+ this.syncQuickPillBadges();
1961
+ }
1962
+ syncQuickPillBadges() {
1963
+ let e = this.pillNav.querySelectorAll(".rdt-launcher-pill__btn");
1964
+ for (let t of e) {
1965
+ let e = t.dataset.quickPlugin ?? "", n = this.entries.get(e), r = !1;
1966
+ if (n) try {
1967
+ let e = n.plugin.badge?.();
1968
+ r = !!(e && e !== 0 && e !== "");
1969
+ } catch {
1970
+ r = !1;
1971
+ }
1972
+ t.classList.toggle("has-badge", r);
1973
+ }
1974
+ }
1975
+ createContext(e, t, n) {
1976
+ let r = this.rt, i = n.disposers, a = (t) => `plugin:${e.id}:${t}`;
1977
+ return {
1978
+ id: e.id,
1979
+ root: this.shadow,
1980
+ container: t,
1981
+ app: {
1982
+ name: this.rt.options.appName,
1983
+ version: this.rt.options.version
1984
+ },
1985
+ get values() {
1986
+ return r.config.get();
1987
+ },
1988
+ getValue(e, t) {
1989
+ return r.config.getValue(e, t);
1990
+ },
1991
+ setValue(e, t) {
1992
+ r.config.set(e, t, "program");
1993
+ },
1994
+ onChange(e) {
1995
+ let t = r.config.subscribe(e);
1996
+ return i.push(t), t;
1997
+ },
1998
+ on(e, t) {
1999
+ let n = r.bus.on(e, t);
2000
+ return i.push(n), n;
2001
+ },
2002
+ emit(e, t) {
2003
+ r.bus.emit(e, t);
2004
+ },
2005
+ storage: {
2006
+ get(e, t) {
2007
+ return r.storage.getJSON(a(e), t);
2008
+ },
2009
+ set(e, t) {
2010
+ r.storage.setJSON(a(e), t);
2011
+ },
2012
+ remove(e) {
2013
+ r.storage.remove(a(e));
2014
+ }
2015
+ },
2016
+ network: {
2017
+ entries: () => r.network.entries(),
2018
+ clear: () => r.network.clear(),
2019
+ replay: (e) => r.network.replay(e),
2020
+ capturing: () => r.network.capturing(),
2021
+ setCapturing: (e) => r.network.setCapturing(e)
2022
+ },
2023
+ toast: (e, t) => r.toast(e, t),
2024
+ copy: async (e) => {
2025
+ let t = await C(e);
2026
+ return r.toast(t ? "已复制到剪贴板" : "复制失败,请手动选择", t ? "success" : "error"), t;
2027
+ },
2028
+ onDispose(e) {
2029
+ i.push(e);
2030
+ },
2031
+ devtools: r.getInstance()
2032
+ };
2033
+ }
2034
+ activate(e) {
2035
+ this.entries.has(e) && (this.activeId = e, this.saveUi({ activePlugin: e }), this.applyActive(e), this.renderRail(), this.rt.bus.emit("plugin:activate", { id: e }));
2036
+ }
2037
+ applyActive(e) {
2038
+ for (let t of this.entries.values()) {
2039
+ let n = t.plugin.id === e;
2040
+ t.view.classList.toggle("is-active", n), t.railButton.classList.toggle("is-active", n), t.railButton.setAttribute("aria-selected", String(n));
2041
+ }
2042
+ let t = this.entries.get(e);
2043
+ t && (this.titleEl.textContent = t.plugin.title, this.updateSubtitle(), this.syncRailIndicator());
2044
+ }
2045
+ updateSubtitle() {
2046
+ let e = this.entries.get(this.activeId);
2047
+ if (!e) return;
2048
+ let t = typeof e.plugin.subtitle == "function" ? e.plugin.subtitle() : e.plugin.subtitle ?? "";
2049
+ this.subtitleEl.textContent = t, this.subtitleEl.style.display = t ? "" : "none";
2050
+ }
2051
+ computeErrorCount() {
2052
+ return this.rt.network.entries().filter((e) => !e.pending && (!e.ok || e.error)).length + this.rt.logs.entries().filter((e) => e.level === "error").length;
2053
+ }
2054
+ onNetworkActivity() {
2055
+ let e = this.rt.network.entries().length;
2056
+ if (e > this.lastNetTotal) {
2057
+ let e = Date.now();
2058
+ e - this.lastPulseAt >= ke && (this.lastPulseAt = e, this.launcherPulse.classList.remove("is-pulsing"), this.launcherPulse.offsetWidth, this.launcherPulse.classList.add("is-pulsing"));
2059
+ }
2060
+ this.lastNetTotal = e;
2061
+ }
2062
+ refreshBadges(e = !1) {
2063
+ for (let e of this.entries.values()) {
2064
+ let t = null;
2065
+ try {
2066
+ t = e.plugin.badge?.() ?? null;
2067
+ } catch {
2068
+ t = null;
2069
+ }
2070
+ let n = e.badgeEl;
2071
+ n && (t === null || t === "" || t === 0 ? n.style.display = "none" : (n.style.display = "", n.textContent = String(t)));
2072
+ }
2073
+ let t = this.rt.network.entries(), n = this.rt.network.capturing(), r = this.computeErrorCount();
2074
+ r > 0 ? (this.launcherBadge.style.display = "", this.launcherBadge.textContent = r > 99 ? "99+" : String(r), this.launcherStatus.dataset.state = "error", !e && r > this.lastErrorCount && (this.wakeLauncher(6e3), this.launcher.classList.remove("is-alerting"), this.launcherBadge.classList.remove("is-popping"), this.launcher.offsetWidth, this.launcher.classList.add("is-alerting"), this.launcherBadge.classList.add("is-popping"))) : (this.launcherBadge.style.display = "none", this.launcherStatus.dataset.state = n ? "capturing" : "paused"), this.lastErrorCount = r, H(this.statusNet), this.statusNet.appendChild(B("span", { text: `${t.length} 请求` })), H(this.statusLogs), this.statusLogs.appendChild(B("span", { text: `${this.rt.logs.entries().length} 日志` })), H(this.statusCapture);
2075
+ let i = B("span", { class: `rdt-statusbar__dot${n ? "" : " is-off"}` });
2076
+ this.statusCapture.append(i, B("span", { text: n ? "capturing" : "paused" })), this.updateSubtitle(), this.syncQuickPillBadges();
2077
+ }
2078
+ open(e) {
2079
+ if (e) this.activate(e);
2080
+ else if (!this.activeId) {
2081
+ let e = [...this.entries.keys()][0];
2082
+ e && this.activate(e);
2083
+ }
2084
+ this.openState = !0, this.hidePill(!0), this.tuckTimer = this.clearTimer(this.tuckTimer), this.launcher.dataset.tucked = "false", this.applyPanelGeometry(), this.panel.classList.add("is-open"), this.launcher.dataset.open = "true", this.launcher.setAttribute("aria-expanded", "true"), this.schedule(() => this.syncRailIndicator(), 20), this.rt.bus.emit("open", { plugin: this.activeId }), this.rt.options.onOpen?.();
2085
+ }
2086
+ close() {
2087
+ this.openState && (this.openState = !1, this.panel.classList.remove("is-open"), this.launcher.dataset.open = "false", this.launcher.setAttribute("aria-expanded", "false"), this.scheduleTuck(), this.rt.bus.emit("close", void 0), this.rt.options.onClose?.());
2088
+ }
2089
+ toggle() {
2090
+ this.openState ? this.close() : this.open();
2091
+ }
2092
+ isOpen() {
2093
+ return this.openState;
2094
+ }
2095
+ wakeLauncher(e = Oe) {
2096
+ this.tuckTimer = this.clearTimer(this.tuckTimer), this.launcher.dataset.tucked = "false", e > 0 && this.scheduleTuck(e);
2097
+ }
2098
+ scheduleTuck(e = Oe) {
2099
+ this.tuckTimer = this.clearTimer(this.tuckTimer), !this.ui.autoTuck || this.openState || this.pillVisible || this.launcher.dataset.edge && (this.tuckTimer = this.schedule(() => {
2100
+ !this.ui.autoTuck || this.openState || this.pillVisible || (this.launcher.dataset.tucked = "true");
2101
+ }, e));
2102
+ }
2103
+ syncPillPosition() {
2104
+ let e = Number.parseFloat(this.launcher.style.left) || 0, t = Number.parseFloat(this.launcher.style.top) || 0, n = this.launcher.dataset.edge || "";
2105
+ this.launcherPill.dataset.edge = n, n === "left" ? (this.launcherPill.style.left = `${e + Z + 8}px`, this.launcherPill.style.top = `${t}px`, this.launcherPill.style.right = "auto", this.launcherPill.style.bottom = "auto") : n === "right" ? (this.launcherPill.style.right = `${Math.max(8, window.innerWidth - e + 8)}px`, this.launcherPill.style.top = `${t}px`, this.launcherPill.style.left = "auto", this.launcherPill.style.bottom = "auto") : (this.launcherPill.style.left = `${e + Z / 2}px`, this.launcherPill.style.bottom = `${Math.max(8, window.innerHeight - t + 8)}px`, this.launcherPill.style.right = "auto", this.launcherPill.style.top = "auto");
2106
+ }
2107
+ showPill() {
2108
+ this.rt.options.launcher !== !1 && this.entries.size && (this.pillCloseTimer = this.clearTimer(this.pillCloseTimer), this.wakeLauncher(0), this.syncPillPosition(), this.pillVisible = !0, this.launcher.classList.add("is-pill-open"), this.launcherPill.classList.add("is-visible"));
2109
+ }
2110
+ hidePill(e = !1) {
2111
+ this.pillOpenTimer = this.clearTimer(this.pillOpenTimer), this.pillCloseTimer = this.clearTimer(this.pillCloseTimer);
2112
+ let t = () => {
2113
+ this.pillVisible = !1, this.launcher.classList.remove("is-pill-open"), this.launcherPill.classList.remove("is-visible"), this.scheduleTuck();
2114
+ };
2115
+ e ? t() : this.pillCloseTimer = this.schedule(t, 180);
2116
+ }
2117
+ bindLauncher() {
2118
+ let e = this.launcher, t = this.launcherPill, n = this.rt.options.launcher === !1 ? !1 : typeof this.rt.options.launcher != "object" || this.rt.options.launcher.draggable !== !1, r = 0, i = 0, a = 0, o = 0, s = 0, c = 0, l = 0, u = !1, d = null, f = () => {
2119
+ this.pillCloseTimer = this.clearTimer(this.pillCloseTimer), this.wakeLauncher(0), !this.pillVisible && !u && (this.pillOpenTimer = this.clearTimer(this.pillOpenTimer), this.pillOpenTimer = this.schedule(() => this.showPill(), 220));
2120
+ }, p = () => {
2121
+ this.pillOpenTimer = this.clearTimer(this.pillOpenTimer), u || this.hidePill(!1);
2122
+ };
2123
+ e.addEventListener("pointerenter", f), e.addEventListener("pointerleave", p), t.addEventListener("pointerenter", () => {
2124
+ this.pillCloseTimer = this.clearTimer(this.pillCloseTimer);
2125
+ }), t.addEventListener("pointerleave", p), e.addEventListener("focus", () => this.wakeLauncher(6e3));
2126
+ let m = (t) => {
2127
+ if (d === null || t.pointerId !== d) return;
2128
+ let n = t.clientX - r, f = t.clientY - i;
2129
+ if (!u && Math.hypot(n, f) > 4 && (u = !0, this.hidePill(!0), e.classList.remove("is-snapping"), e.classList.add("is-dragging")), !u) return;
2130
+ let p = performance.now(), m = p - c;
2131
+ if (m > 4) {
2132
+ l = (t.clientX - s) / m;
2133
+ let n = Math.max(-7, Math.min(7, l * 16));
2134
+ e.style.setProperty("--rdt-drag-tilt", `${n.toFixed(1)}deg`), s = t.clientX, c = p;
2135
+ }
2136
+ let h = this.clampLauncher(a + n, o + f);
2137
+ this.positionLauncher(h.x, h.y);
2138
+ }, h = (t) => {
2139
+ if (d !== null && t.pointerId === d) {
2140
+ d = null;
2141
+ try {
2142
+ e.hasPointerCapture(t.pointerId) && e.releasePointerCapture(t.pointerId);
2143
+ } catch {}
2144
+ if (this.shadow.removeEventListener("pointermove", m), this.shadow.removeEventListener("pointerup", h), this.shadow.removeEventListener("pointercancel", h), u) {
2145
+ e.classList.remove("is-dragging"), e.style.removeProperty("--rdt-drag-tilt"), e.classList.add("is-snapping"), this.schedule(() => e.classList.remove("is-snapping"), 300);
2146
+ let t = Number.parseFloat(e.style.left) || 0, n = Number.parseFloat(e.style.top) || 0, r = Math.abs(l) > .25 ? t + l * 55 : t, i = this.snapLauncher(r, n);
2147
+ this.positionLauncher(i.x, i.y), this.saveUi({ launcher: i }), this.scheduleTuck(), this.suppressedClick = !0, this.schedule(() => {
2148
+ this.suppressedClick = !1;
2149
+ }, 0);
2150
+ }
2151
+ l = 0, u = !1;
2152
+ }
2153
+ };
2154
+ e.addEventListener("pointerdown", (t) => {
2155
+ if (t.button !== 0 || !n) return;
2156
+ d = t.pointerId, this.pillOpenTimer = this.clearTimer(this.pillOpenTimer), this.wakeLauncher(0);
2157
+ let u = e.getBoundingClientRect();
2158
+ r = t.clientX, i = t.clientY, s = t.clientX, c = performance.now(), l = 0, a = Number.parseFloat(e.style.left) || u.left, o = Number.parseFloat(e.style.top) || u.top;
2159
+ try {
2160
+ e.setPointerCapture(t.pointerId);
2161
+ } catch {}
2162
+ this.shadow.addEventListener("pointermove", m), this.shadow.addEventListener("pointerup", h), this.shadow.addEventListener("pointercancel", h);
2163
+ }), e.addEventListener("click", () => {
2164
+ this.suppressedClick || this.toggle();
2165
+ }), this.listeners.push(() => {
2166
+ this.shadow.removeEventListener("pointermove", m), this.shadow.removeEventListener("pointerup", h), this.shadow.removeEventListener("pointercancel", h);
2167
+ });
2168
+ }
2169
+ clampLauncher(e, t) {
2170
+ return {
2171
+ x: Math.max(4, Math.min(window.innerWidth - Z - 4, Math.round(e))),
2172
+ y: Math.max(4, Math.min(window.innerHeight - Z - 4, Math.round(t)))
2173
+ };
2174
+ }
2175
+ snapLauncher(e, t) {
2176
+ let n = window.innerWidth - Z, r = window.innerHeight - Z, i = e, a = t, o = "";
2177
+ return e < Q ? (i = X, o = "left") : n - e < Q && (i = n - X, o = "right"), r - t < Q && (a = r - X, o ||= "bottom"), this.launcher.dataset.edge = o, this.clampLauncher(i, a);
2178
+ }
2179
+ positionLauncher(e, t) {
2180
+ this.launcher.style.left = `${e}px`, this.launcher.style.top = `${t}px`, this.launcher.style.right = "auto", this.launcher.style.bottom = "auto", this.pillVisible && this.syncPillPosition();
2181
+ }
2182
+ applyLauncherPosition() {
2183
+ if (this.rt.options.launcher === !1) {
2184
+ this.launcher.style.display = "none", this.launcherPill.style.display = "none";
2185
+ return;
2186
+ }
2187
+ this.launcher.style.display = "", this.launcherPill.style.display = "", this.launcher.dataset.tucked = "false";
2188
+ let e = this.ui.launcher;
2189
+ if (e) {
2190
+ let t = this.snapLauncher(e.x, e.y);
2191
+ this.positionLauncher(t.x, t.y), this.scheduleTuck();
2192
+ return;
2193
+ }
2194
+ let t = window.innerWidth - Z - X, n = window.innerHeight - Z - X;
2195
+ this.positionLauncher(t, n), this.launcher.dataset.edge = "right", this.scheduleTuck();
2196
+ }
2197
+ bindPanelDrag() {
2198
+ let e = !1, t = !1, n = 0, r = 0, i = 0, a = 0, o = () => {
2199
+ let e = this.panel.getBoundingClientRect(), t = this.resolveDimensions(this.ui.size, !0);
2200
+ if (this.ui.collapsed) {
2201
+ if (this.ui.collapsedPos) {
2202
+ i = this.ui.collapsedPos.x, a = this.ui.collapsedPos.y;
2203
+ return;
2204
+ }
2205
+ if (e.width > 0 && e.height > 0) {
2206
+ i = Math.round(e.left), a = Math.round(e.top);
2207
+ return;
2208
+ }
2209
+ i = window.innerWidth - t.collapsedWidth - De, a = window.innerHeight - t.collapsedHeight - J;
2210
+ } else this.ui.panelPos ? (i = this.ui.panelPos.x, a = this.ui.panelPos.y) : e.width > 0 && e.height > 0 ? (i = Math.round(e.left), a = Math.round(e.top)) : (i = window.innerWidth - t.width - De, a = window.innerHeight - t.height - J);
2211
+ }, s = (s) => {
2212
+ if (!e) return;
2213
+ let c = s.clientX - n, l = s.clientY - r;
2214
+ if (!t && Math.hypot(c, l) > 3 && (t = !0, o(), this.panel.classList.add("is-moving")), t) {
2215
+ if (this.ui.collapsed) {
2216
+ let e = this.clampCollapsedPos(i + c, a + l), t = this.resolveDimensions(this.ui.size, !0);
2217
+ this.ui.collapsedPos = e, this.ui.panelPos = this.clampExpandedPos(e.x + t.collapsedWidth - t.width, e.y, this.ui.size);
2218
+ } else this.ui.collapsedPos = null, this.ui.panelPos = this.clampExpandedPos(i + c, a + l, this.ui.size);
2219
+ this.applyPanelGeometry();
2220
+ }
2221
+ }, c = (n) => {
2222
+ if (e) {
2223
+ e = !1;
2224
+ try {
2225
+ this.headerEl.hasPointerCapture(n.pointerId) && this.headerEl.releasePointerCapture(n.pointerId);
2226
+ } catch {}
2227
+ this.shadow.removeEventListener("pointermove", s), this.shadow.removeEventListener("pointerup", c), this.shadow.removeEventListener("pointercancel", c), t && (t = !1, this.panel.classList.remove("is-moving"), this.saveUi({
2228
+ panelPos: this.ui.panelPos,
2229
+ collapsedPos: this.ui.collapsedPos ?? null
2230
+ }), this.suppressedHeaderDblClick = !0, this.schedule(() => {
2231
+ this.suppressedHeaderDblClick = !1;
2232
+ }, 120));
2233
+ }
2234
+ };
2235
+ this.headerEl.addEventListener("pointerdown", (i) => {
2236
+ if (i.button === 0 && !i.target?.closest("button")) {
2237
+ e = !0, t = !1, n = i.clientX, r = i.clientY;
2238
+ try {
2239
+ this.headerEl.setPointerCapture(i.pointerId);
2240
+ } catch {}
2241
+ this.shadow.addEventListener("pointermove", s), this.shadow.addEventListener("pointerup", c), this.shadow.addEventListener("pointercancel", c);
2242
+ }
2243
+ });
2244
+ }
2245
+ isShortcutRecorder(e) {
2246
+ return e instanceof Element && !!e.closest("[data-rdt-shortcut-recorder]");
2247
+ }
2248
+ bindGlobal() {
2249
+ let e = (e) => {
2250
+ if (this.isShortcutRecorder(e.target)) return;
2251
+ if (e.key === "Escape" && this.openState) {
2252
+ e.stopPropagation(), this.close();
2253
+ return;
2254
+ }
2255
+ let t = this.rt.ui.getShortcut();
2256
+ if (!t) return;
2257
+ let n = w(t);
2258
+ n && (!F(e.target) || n.alt || n.meta || n.ctrl) && P(e, n) && (e.preventDefault(), this.toggle());
2259
+ }, t = () => {
2260
+ if (this.applyPanelGeometry(), !this.launcher.style.left) return;
2261
+ let e = this.clampLauncher(Number.parseFloat(this.launcher.style.left) || 0, Number.parseFloat(this.launcher.style.top) || 0);
2262
+ this.positionLauncher(e.x, e.y);
2263
+ };
2264
+ window.addEventListener("keydown", e, !0), window.addEventListener("resize", t), this.listeners.push(() => {
2265
+ window.removeEventListener("keydown", e, !0), window.removeEventListener("resize", t);
2266
+ });
2267
+ }
2268
+ positionToasts() {
2269
+ let e = this.toastsEl.style, t = this.openState ? this.panel.getBoundingClientRect() : null;
2270
+ !t || !t.width ? e.cssText = "" : (e.left = `${Math.round(t.left + t.width / 2)}px`, e.right = "auto", e.transform = "translateX(-50%)", e.alignItems = "center", this.ui.collapsed ? (e.top = `${Math.round(t.bottom + 8)}px`, e.bottom = "auto") : (e.top = "auto", e.bottom = `${Math.round(window.innerHeight - t.bottom + 40)}px`));
2271
+ }
2272
+ addToast(e, t = "info") {
2273
+ let n = B("div", {
2274
+ class: "rdt-toast",
2275
+ dataset: { tone: t },
2276
+ role: "status"
2277
+ }, [B("span", { class: "rdt-toast__dot" }), B("span", { text: e })]);
2278
+ this.positionToasts(), this.toastsEl.appendChild(n), this.schedule(() => {
2279
+ n.classList.add("is-leaving"), this.schedule(() => n.remove(), 160);
2280
+ }, 2100);
2281
+ }
2282
+ applyReset() {
2283
+ this.ui.launcher = null, this.ui.size = this.rt.options.size, this.ui.collapsed = !1, this.ui.collapsedPos = null, this.ui.panelPos = null, this.root.dataset.size = this.ui.size, this.panel.dataset.size = this.ui.size, this.panel.dataset.collapsed = "false", this.applyPanelGeometry(), this.syncCollapseButton(), this.refreshShortcut(), this.applyLauncherPosition();
2284
+ let e = [...this.entries.keys()][0];
2285
+ e && this.activate(e);
2286
+ }
2287
+ dispose() {
2288
+ this.timers.forEach((e) => clearTimeout(e)), this.timers.clear(), this.tuckTimer = null, this.pillOpenTimer = null, this.pillCloseTimer = null, this.listeners.forEach((e) => e()), this.listeners = [], this.mediaQuery && this.mediaQuery.removeEventListener("change", this.onMediaChange);
2289
+ for (let e of this.entries.values()) e.disposers.forEach((e) => {
2290
+ try {
2291
+ e();
2292
+ } catch {}
2293
+ });
2294
+ this.entries.clear(), this.root.remove();
2295
+ }
2296
+ };
2297
+ // src/plugins/network.ts
2298
+ function Ne(e) {
2299
+ return e.pending ? "···" : e.error ? "ERR" : String(e.status || "—");
2300
+ }
2301
+ function Pe(e) {
2302
+ return e.pending ? "neutral" : e.error || !e.ok ? "error" : "ok";
2303
+ }
2304
+ function Fe(r) {
2305
+ return {
2306
+ id: "network",
2307
+ title: "网络",
2308
+ icon: "activity",
2309
+ order: 20,
2310
+ subtitle: () => {
2311
+ let e = r.network.entries(), t = e.filter((e) => !e.pending && (e.error || !e.ok)).length;
2312
+ return `${e.length} 条记录${t ? ` · ${t} 个异常` : ""}`;
2313
+ },
2314
+ badge: () => r.network.entries().filter((e) => !e.pending && (e.error || !e.ok)).length || null,
2315
+ render(i, s) {
2316
+ let c = "all", l = "", u = null, d = B("input", {
2317
+ class: "rdt-input",
2318
+ type: "search",
2319
+ placeholder: "过滤 URL / 方法 / 状态",
2320
+ "aria-label": "过滤请求"
2321
+ });
2322
+ d.addEventListener("input", () => {
2323
+ l = d.value.trim().toLowerCase(), A(!0);
2324
+ });
2325
+ let f = B("span", { class: "rdt-count" }), p = B("div", { class: "rdt-netlist rdt-scroll" }), m = B("div", { class: "rdt-netlist__spacer" }), h = B("div", { class: "rdt-netlist__window" });
2326
+ m.appendChild(h), p.appendChild(m);
2327
+ let g = B("div", { class: "rdt-filterbar" }), _ = () => Ee[r.ui.getSize()].rowHeight, v = [], y = -1, b = "", x = B("button", {
2328
+ class: "rdt-switch",
2329
+ type: "button",
2330
+ role: "switch",
2331
+ "aria-checked": String(s.network.capturing()),
2332
+ "aria-label": "网络采集",
2333
+ title: "暂停 / 恢复采集",
2334
+ onClick: () => {
2335
+ let e = x.getAttribute("aria-checked") !== "true";
2336
+ s.network.setCapturing(e), x.setAttribute("aria-checked", String(e)), A(!0);
2337
+ }
2338
+ }), ee = B("div", { class: "rdt-toolbar" }, [
2339
+ B("div", { class: "rdt-search" }, [V("search", 12, 2), d]),
2340
+ f,
2341
+ g,
2342
+ B("div", { class: "rdt-toolbar__spacer" }),
2343
+ B("label", { class: "rdt-selectall" }, [B("span", { text: "采集" }), x]),
2344
+ U("", {
2345
+ icon: "trash",
2346
+ title: "清空记录",
2347
+ tone: "ghost",
2348
+ onClick: () => {
2349
+ s.network.clear(), u = null, b = "", I(!0);
2350
+ }
2351
+ })
2352
+ ]), S = B("div", { class: "rdt-detail rdt-scroll" }), C = B("div", { class: "rdt-net" }, [ee, B("div", { class: "rdt-net__body" }, [p, S])]);
2353
+ i.append(C);
2354
+ let w = (e) => c === "error" && (e.pending || !e.error && e.ok) || c === "fetch" && e.kind !== "fetch" || c === "xhr" && e.kind !== "xhr" ? !1 : !l || e.url.toLowerCase().includes(l) || e.method.toLowerCase().includes(l) || Ne(e).toLowerCase().includes(l), T = () => {
2355
+ let e = r.network.entries(), t = [
2356
+ {
2357
+ id: "all",
2358
+ label: "全部",
2359
+ count: e.length
2360
+ },
2361
+ {
2362
+ id: "error",
2363
+ label: "异常",
2364
+ count: e.filter((e) => !e.pending && (e.error || !e.ok)).length
2365
+ },
2366
+ {
2367
+ id: "fetch",
2368
+ label: "Fetch",
2369
+ count: e.filter((e) => e.kind === "fetch").length
2370
+ },
2371
+ {
2372
+ id: "xhr",
2373
+ label: "XHR",
2374
+ count: e.filter((e) => e.kind === "xhr").length
2375
+ }
2376
+ ];
2377
+ H(g);
2378
+ for (let e of t) {
2379
+ let t = B("button", {
2380
+ class: `rdt-chip${c === e.id ? " is-active" : ""}`,
2381
+ type: "button",
2382
+ onClick: () => {
2383
+ c = e.id, A(!0);
2384
+ }
2385
+ }, [B("span", { text: e.label }), B("span", {
2386
+ class: "rdt-count",
2387
+ text: String(e.count)
2388
+ })]);
2389
+ g.appendChild(t);
2390
+ }
2391
+ }, E = (e, n) => {
2392
+ let r = !e.pending && (!e.ok || !!e.error);
2393
+ return B("div", {
2394
+ class: `rdt-netrow${u === e.id ? " is-active" : ""}`,
2395
+ role: "button",
2396
+ tabindex: "0",
2397
+ dataset: {
2398
+ index: String(n),
2399
+ id: e.id,
2400
+ failed: String(r)
2401
+ },
2402
+ onClick: () => P(e.id),
2403
+ onKeydown: (t) => {
2404
+ (t.key === "Enter" || t.key === " ") && P(e.id);
2405
+ }
2406
+ }, [
2407
+ B("span", {
2408
+ class: "rdt-netrow__method",
2409
+ text: e.method,
2410
+ dataset: { method: e.method }
2411
+ }),
2412
+ B("span", {
2413
+ class: "rdt-netrow__status",
2414
+ text: Ne(e),
2415
+ dataset: {
2416
+ error: String(r),
2417
+ pending: String(e.pending)
2418
+ }
2419
+ }),
2420
+ B("span", {
2421
+ class: "rdt-netrow__url",
2422
+ title: e.url
2423
+ }, j(e.url)),
2424
+ B("span", {
2425
+ class: "rdt-netrow__time",
2426
+ text: e.pending ? "…" : t(e.duration)
2427
+ })
2428
+ ]);
2429
+ }, D = (e) => {
2430
+ let t = v.length;
2431
+ if (!t) return;
2432
+ let n = _(), r = p.clientHeight || 12 * n, i = Math.ceil(r / n) + 12, a = Math.max(0, t - i), o = Math.min(a, Math.max(0, Math.floor(p.scrollTop / n) - 6)), s = Math.min(t, o + i);
2433
+ if (e || o !== y || h.childElementCount !== s - o) {
2434
+ y = o, H(h);
2435
+ for (let e = o; e < s; e++) h.appendChild(E(v[e], e));
2436
+ h.style.transform = `translateY(${o * n}px)`;
2437
+ }
2438
+ }, O = null, k = () => {
2439
+ O &&= (O.remove(), null);
2440
+ }, A = (e = !1) => {
2441
+ let t = r.network.entries(), n = _();
2442
+ k(), f.textContent = `${t.filter(w).length} / ${t.length}`, T(), t.length ? (v = t.filter(w), y = -1, H(h), v.length ? (m.style.height = `${v.length * n}px`, (e || p.scrollTop > v.length * n) && (p.scrollTop = 0), D(!0)) : (m.style.height = "0px", p.scrollTop = 0, O = G("没有匹配当前条件的请求。", "search"), p.appendChild(O))) : (v = [], y = -1, H(h), m.style.height = "0px", p.scrollTop = 0, O = G("还没有请求记录。触发一次接口调用后,这里会自动出现。", "activity"), p.appendChild(O));
2443
+ };
2444
+ p.addEventListener("scroll", () => D(!1));
2445
+ let j = (e) => {
2446
+ let t;
2447
+ try {
2448
+ t = new URL(e, location.href);
2449
+ } catch {
2450
+ return B("span", { text: e });
2451
+ }
2452
+ return B("span", {}, [t.origin === location.origin ? null : B("em", { text: t.host }), B("span", { text: `${t.pathname}${t.search}` })]);
2453
+ }, M = (e, t) => {
2454
+ let n = U("", {
2455
+ icon: "copy",
2456
+ tone: "ghost",
2457
+ title: `复制${e}`,
2458
+ onClick: () => {
2459
+ W(n), s.copy(t);
2460
+ }
2461
+ });
2462
+ return B("div", { class: "rdt-detail__title" }, [B("span", { text: e }), n]);
2463
+ }, N = (e) => B("div", { class: "rdt-kv" }, Object.entries(e).map(([e, t]) => [B("span", {
2464
+ class: "rdt-kv__key",
2465
+ text: e
2466
+ }), B("span", {
2467
+ class: "rdt-kv__value",
2468
+ text: t
2469
+ })])), P = (e) => {
2470
+ u = e, b = "", A(), F(!0);
2471
+ }, F = (i = !1) => {
2472
+ let c = r.network.entries().find((e) => e.id === u), l = c ? [
2473
+ c.id,
2474
+ String(c.pending),
2475
+ c.status,
2476
+ c.statusText,
2477
+ c.error ?? "",
2478
+ String(c.requestBody?.length ?? -1),
2479
+ String(c.responseBody?.length ?? -1),
2480
+ String(c.responseSize),
2481
+ String(Object.keys(c.responseHeaders).length)
2482
+ ].join("|") : "none";
2483
+ if (!i && l === b) return;
2484
+ if (b = l, H(S), !c) {
2485
+ let e = u !== null;
2486
+ u = null, C.classList.remove("has-detail"), S.style.display = "none", p.style.display = "", e && A();
2487
+ return;
2488
+ }
2489
+ C.classList.add("has-detail"), p.style.display = "none", S.style.display = "";
2490
+ let d = B("div", { class: "rdt-detail__head" }, [
2491
+ U("", {
2492
+ icon: "arrow-left",
2493
+ tone: "ghost",
2494
+ title: "返回列表",
2495
+ onClick: () => {
2496
+ u = null, b = "", C.classList.remove("has-detail"), S.style.display = "none", p.style.display = "", A();
2497
+ }
2498
+ }),
2499
+ B("span", {
2500
+ class: "rdt-tag",
2501
+ text: c.method
2502
+ }),
2503
+ B("span", {
2504
+ class: "rdt-detail__url",
2505
+ text: c.url
2506
+ })
2507
+ ]), f = U("复制 cURL", {
2508
+ icon: "copy",
2509
+ onClick: () => {
2510
+ W(f), s.copy(we(c));
2511
+ }
2512
+ }), m = B("div", { class: "rdt-detail__head" }, [f, U("重放", {
2513
+ icon: "refresh-cw",
2514
+ onClick: async () => {
2515
+ let e = await s.network.replay(c.id);
2516
+ e ? (u = e.id, I(), s.toast("已重放请求", "success")) : s.toast("重放失败", "error");
2517
+ }
2518
+ })]), h = B("div", { class: "rdt-kv" }, [
2519
+ B("span", {
2520
+ class: "rdt-kv__key",
2521
+ text: "状态"
2522
+ }),
2523
+ B("span", { class: "rdt-kv__value" }, [B("span", {
2524
+ class: `rdt-tag rdt-tag--${Pe(c)}`,
2525
+ text: c.pending ? "pending" : `${c.status} ${c.statusText}`.trim()
2526
+ })]),
2527
+ B("span", {
2528
+ class: "rdt-kv__key",
2529
+ text: "耗时"
2530
+ }),
2531
+ B("span", {
2532
+ class: "rdt-kv__value",
2533
+ text: c.pending ? "进行中" : t(c.duration)
2534
+ }),
2535
+ B("span", {
2536
+ class: "rdt-kv__key",
2537
+ text: "大小"
2538
+ }),
2539
+ B("span", {
2540
+ class: "rdt-kv__value",
2541
+ text: c.responseSize ? e(c.responseSize) : "—"
2542
+ }),
2543
+ B("span", {
2544
+ class: "rdt-kv__key",
2545
+ text: "类型"
2546
+ }),
2547
+ B("span", {
2548
+ class: "rdt-kv__value",
2549
+ text: `${c.kind} · ${n(c.startAt)}`
2550
+ })
2551
+ ]);
2552
+ S.append(d, m, h), c.error && S.appendChild(B("div", { class: "rdt-detail__section" }, [B("div", {
2553
+ class: "rdt-detail__title",
2554
+ text: "错误"
2555
+ }), B("pre", {
2556
+ class: "rdt-code",
2557
+ text: c.error
2558
+ })]));
2559
+ let g = B("div", { class: "rdt-detail__section" }, [B("div", {
2560
+ class: "rdt-detail__title",
2561
+ text: "请求头"
2562
+ }), Object.keys(c.requestHeaders).length ? N(c.requestHeaders) : B("div", {
2563
+ class: "rdt-faint rdt-mono",
2564
+ text: "无"
2565
+ })]);
2566
+ if (c.requestBody) {
2567
+ let e = o(c.requestBody);
2568
+ g.appendChild(M("请求体", c.requestBody)), g.appendChild(B("pre", {
2569
+ class: "rdt-code",
2570
+ text: e ? a(c.requestBody) : c.requestBody
2571
+ }));
2572
+ }
2573
+ S.appendChild(g);
2574
+ let _ = B("div", { class: "rdt-detail__section" }, [B("div", {
2575
+ class: "rdt-detail__title",
2576
+ text: "响应头"
2577
+ }), Object.keys(c.responseHeaders).length ? N(c.responseHeaders) : B("div", {
2578
+ class: "rdt-faint rdt-mono",
2579
+ text: "无"
2580
+ })]);
2581
+ c.pending ? _.appendChild(B("div", { class: "rdt-detail__section rdt-muted rdt-mono" }, [B("span", { class: "rdt-spinner" }), B("span", { text: " 请求进行中…" })])) : c.responseBody && (_.appendChild(M("响应体", c.responseBody)), _.appendChild(B("pre", {
2582
+ class: "rdt-code",
2583
+ text: o(c.responseBody) ? a(c.responseBody) : c.responseBody
2584
+ }))), S.appendChild(_);
2585
+ }, I = (e = !1) => {
2586
+ if (u && r.ui.getSize() !== "lg") {
2587
+ let e = r.network.entries();
2588
+ f.textContent = `${e.filter(w).length} / ${e.length}`, T(), F();
2589
+ } else A(e), F();
2590
+ }, L = !1, R = () => s.devtools.isOpen() && r.ui.activePlugin() === "network";
2591
+ I();
2592
+ let te = r.network.subscribeChange(() => {
2593
+ R() ? (L = !1, I()) : L = !0;
2594
+ });
2595
+ s.onDispose(te), s.on("open", () => {
2596
+ L && r.ui.activePlugin() === "network" && (L = !1, I());
2597
+ }), s.on("plugin:activate", ({ id: e }) => {
2598
+ e === "network" && (L = !1, I());
2599
+ }), s.on("ui:size", () => {
2600
+ R() ? I(!1) : L = !0;
2601
+ });
2602
+ let z = () => D(!0);
2603
+ window.addEventListener("resize", z), s.onDispose(() => window.removeEventListener("resize", z));
2604
+ }
2605
+ };
2606
+ }
2607
+ // src/plugins/settings.ts
2608
+ function Ie(e) {
2609
+ return {
2610
+ id: "settings",
2611
+ title: "设置",
2612
+ icon: "settings",
2613
+ order: 90,
2614
+ subtitle: "视图大小、主题与本地数据",
2615
+ render(t, n) {
2616
+ let r = B("div", { class: "rdt-settings rdt-scroll" });
2617
+ t.appendChild(r);
2618
+ let i = (e, t, n) => B("div", { class: "rdt-setting" }, [B("div", { class: "rdt-setting__text" }, [B("div", {
2619
+ class: "rdt-setting__label",
2620
+ text: e
2621
+ }), B("div", {
2622
+ class: "rdt-setting__desc",
2623
+ text: t
2624
+ })]), B("div", { class: "rdt-setting__control" }, n)]), a = (e, t, n) => B("button", {
2625
+ class: "rdt-switch",
2626
+ type: "button",
2627
+ role: "switch",
2628
+ "aria-checked": String(t),
2629
+ "aria-label": e,
2630
+ onClick: () => n(!t)
2631
+ }), o, s = () => {
2632
+ r.replaceChildren();
2633
+ let t = e.ui.getSize(), s = e.ui.getTheme(), c = e.ui.getThemes(), l = e.ui.getAutoTuck();
2634
+ if (r.appendChild(i("视图大小", "小(12px 极简)· 默认(14px 标准)· 大(16px 双栏排障)", K([
2635
+ {
2636
+ value: "sm",
2637
+ label: "小"
2638
+ },
2639
+ {
2640
+ value: "md",
2641
+ label: "默认"
2642
+ },
2643
+ {
2644
+ value: "lg",
2645
+ label: "大"
2646
+ }
2647
+ ], t, (t) => e.ui.setSize(t)))), r.appendChild(i("主题", "跟随系统时会实时响应外观变化", K([
2648
+ {
2649
+ value: "dark",
2650
+ label: "深色",
2651
+ icon: "moon"
2652
+ },
2653
+ {
2654
+ value: "light",
2655
+ label: "浅色",
2656
+ icon: "sun"
2657
+ },
2658
+ {
2659
+ value: "auto",
2660
+ label: "跟随系统"
2661
+ }
2662
+ ], s === "dark" || s === "light" || s === "auto" ? s : "dark", (t) => e.ui.setTheme(t)))), c.length > 0) {
2663
+ let t = B("div", {
2664
+ class: "rdt-theme-presets",
2665
+ role: "group",
2666
+ "aria-label": "扩展主题预设"
2667
+ });
2668
+ for (let n of c) {
2669
+ let r = B("span", { class: "rdt-theme-swatch__dot" });
2670
+ n.preview ? r.style.background = `linear-gradient(135deg, ${n.preview[0]} 50%, ${n.preview[1]} 50%)` : r.style.background = n.tokens["--rdt-accent"] ?? n.tokens.accent ?? "var(--rdt-accent)";
2671
+ let i = B("button", {
2672
+ class: `rdt-theme-swatch${s === n.id ? " is-active" : ""}`,
2673
+ type: "button",
2674
+ dataset: { themeId: n.id },
2675
+ onClick: () => e.ui.setTheme(n.id)
2676
+ }, [r, B("span", { text: n.label })]);
2677
+ t.appendChild(i);
2678
+ }
2679
+ r.appendChild(t);
2680
+ }
2681
+ r.appendChild(i("面板与悬浮球位置", "面板顶栏与悬浮球均可任意拖拽;空闲 4 秒悬浮球轻度贴边", B("div", { class: "rdt-setting__range" }, [a("悬浮球贴边隐匿", l, (t) => e.ui.setAutoTuck(t)), U("复位位置", {
2682
+ icon: "rotate-ccw",
2683
+ onClick: () => {
2684
+ e.ui.setPanelPos(null), e.ui.resetLauncher(), n.toast("面板与悬浮球已复位", "success");
2685
+ }
2686
+ })])));
2687
+ let u = e.ui.getShortcut(), d = B("input", {
2688
+ class: "rdt-input rdt-mono rdt-shortcut",
2689
+ type: "text",
2690
+ readonly: !0,
2691
+ value: u ? A(u) : "已关闭",
2692
+ title: "点击后按下组合键,Backspace 关闭、Esc 取消",
2693
+ "aria-label": "打开 / 关闭面板的快捷键",
2694
+ "data-rdt-shortcut-recorder": "true"
2695
+ }), f = !1, p = () => {
2696
+ let t = e.ui.getShortcut();
2697
+ d.value = t ? A(t) : "已关闭";
2698
+ };
2699
+ d.addEventListener("focus", () => {
2700
+ f = !0, d.dataset.recording = "true", d.value = "按下快捷键…";
2701
+ }), d.addEventListener("blur", () => {
2702
+ f = !1, delete d.dataset.recording, p();
2703
+ }), d.addEventListener("keydown", (t) => {
2704
+ if (!f) return;
2705
+ if (t.preventDefault(), t.stopPropagation(), t.key === "Escape") {
2706
+ d.blur();
2707
+ return;
2708
+ }
2709
+ if (t.key === "Backspace" || t.key === "Delete") {
2710
+ e.ui.setShortcut(!1), d.blur(), n.toast("快捷键已关闭", "success");
2711
+ return;
2712
+ }
2713
+ let r = N(t);
2714
+ r ? (e.ui.setShortcut(r), d.blur(), n.toast(`快捷键已改为 ${A(r)}`, "success")) : n.toast("需要至少一个修饰键", "warning");
2715
+ }), r.appendChild(i("快捷键", "点击输入框后直接按组合键;Backspace 关闭,Esc 取消", B("div", { class: "rdt-setting__range" }, [d, U("默认", {
2716
+ tone: "ghost",
2717
+ title: `恢复为 ${A(e.options.shortcut)}`,
2718
+ onClick: () => {
2719
+ e.ui.setShortcut(null), p(), n.toast("已恢复默认快捷键", "success");
2720
+ }
2721
+ })])));
2722
+ let m = U("清除本工具数据", {
2723
+ icon: "trash",
2724
+ tone: "danger",
2725
+ onClick: () => {
2726
+ m.dataset.armed === "true" ? (e.ui.resetAll(), n.toast("已清除本地数据并恢复默认", "success")) : (m.dataset.armed = "true", m.style.setProperty("--rdt-confirm-ms", "3000ms"), m.querySelector(".rdt-btn__label").textContent = "再次点击确认", o = setTimeout(() => {
2727
+ m.dataset.armed = "false";
2728
+ let e = m.querySelector(".rdt-btn__label");
2729
+ e && (e.textContent = "清除本工具数据");
2730
+ }, 3e3));
2731
+ }
2732
+ });
2733
+ r.appendChild(i("本地数据", "清除配置值、界面偏好与插件存储;不影响业务自身的存储", m)), r.appendChild(B("div", { class: "rdt-about" }, [
2734
+ B("div", { text: `Rinova Devtools v${e.options.version}` }),
2735
+ B("div", { text: "框架无关内核 · 任意技术栈通过 DOM 挂载" }),
2736
+ B("div", { text: `快捷键:${A(e.ui.getShortcut())}` }),
2737
+ B("div", { text: `存储命名空间:${e.options.storagePrefix}` })
2738
+ ]));
2739
+ };
2740
+ s(), n.on("ui:size", () => s()), n.on("ui:theme", () => s()), n.on("ui:themes", () => s()), n.on("ui:autotuck", () => s()), n.on("ui:shortcut", () => s()), n.onDispose(() => {
2741
+ o && clearTimeout(o);
2742
+ });
2743
+ }
2744
+ };
2745
+ }
2746
+ // src/plugins/storage.ts
2747
+ function Le(e) {
2748
+ try {
2749
+ if (e === "cookie") return document.cookie.split(";").map((e) => e.trim()).filter(Boolean).map((e) => {
2750
+ let t = e.indexOf("="), n = t < 0 ? e : e.slice(0, t);
2751
+ return {
2752
+ key: decodeURIComponent(n),
2753
+ value: t < 0 ? "" : e.slice(t + 1)
2754
+ };
2755
+ });
2756
+ let t = e === "local" ? window.localStorage : window.sessionStorage, n = [];
2757
+ for (let e = 0; e < t.length; e++) {
2758
+ let r = t.key(e);
2759
+ r !== null && n.push({
2760
+ key: r,
2761
+ value: t.getItem(r) ?? ""
2762
+ });
2763
+ }
2764
+ return n.sort((e, t) => e.key.localeCompare(t.key));
2765
+ } catch {
2766
+ return [];
2767
+ }
2768
+ }
2769
+ function Re(e) {
2770
+ return new Blob([e]).size;
2771
+ }
2772
+ function ze(t) {
2773
+ return {
2774
+ id: "storage",
2775
+ title: "存储",
2776
+ icon: "database",
2777
+ order: 30,
2778
+ subtitle: "localStorage / sessionStorage / Cookie,可直接编辑",
2779
+ render(t, n) {
2780
+ let r = "local", i = "", a = null, o = !1, s = B("div", { class: "rdt-tabs" }), c = B("input", {
2781
+ class: "rdt-input",
2782
+ type: "search",
2783
+ placeholder: "按 key 过滤",
2784
+ "aria-label": "过滤存储项"
2785
+ }), l = B("div", { class: "rdt-scroll rdt-list" }), u = B("div", { class: "rdt-store-edit rdt-scroll" }), d = B("div", { class: "rdt-store__body" }), f = [
2786
+ {
2787
+ id: "local",
2788
+ label: "Local"
2789
+ },
2790
+ {
2791
+ id: "session",
2792
+ label: "Session"
2793
+ },
2794
+ {
2795
+ id: "cookie",
2796
+ label: "Cookie"
2797
+ }
2798
+ ];
2799
+ c.addEventListener("input", () => {
2800
+ i = c.value.trim().toLowerCase(), g();
2801
+ });
2802
+ let p = U("新增", {
2803
+ icon: "plus",
2804
+ onClick: () => {
2805
+ o = !0, a = {
2806
+ key: "",
2807
+ value: ""
2808
+ }, _();
2809
+ }
2810
+ }), m = B("div", { class: "rdt-net rdt-store" }, [
2811
+ s,
2812
+ B("div", { class: "rdt-toolbar" }, [
2813
+ B("div", { class: "rdt-search" }, [V("search", 13, 2), c]),
2814
+ B("div", { class: "rdt-toolbar__spacer" }),
2815
+ p,
2816
+ U("", {
2817
+ icon: "refresh-cw",
2818
+ tone: "ghost",
2819
+ title: "刷新",
2820
+ onClick: () => v()
2821
+ })
2822
+ ]),
2823
+ d
2824
+ ]);
2825
+ t.append(m), u.style.display = "none", d.append(l, u);
2826
+ let h = () => {
2827
+ H(s);
2828
+ for (let e of f) {
2829
+ let t = Le(e.id).length;
2830
+ s.appendChild(B("button", {
2831
+ class: `rdt-tab${r === e.id ? " is-active" : ""}`,
2832
+ type: "button",
2833
+ onClick: () => {
2834
+ r = e.id, a = null, o = !1, p.style.display = e.id === "cookie" ? "none" : "", v();
2835
+ }
2836
+ }, [B("span", { text: e.label }), B("span", {
2837
+ class: "rdt-tab__count",
2838
+ text: String(t)
2839
+ })]));
2840
+ }
2841
+ }, g = () => {
2842
+ let t = Le(r).filter((e) => !i || e.key.toLowerCase().includes(i));
2843
+ if (H(l), !t.length) l.appendChild(G(i ? "没有匹配的 key。" : r === "cookie" ? "当前页面没有可读取的 Cookie(HttpOnly 不可见)。" : "这个存储空间是空的。", "database"));
2844
+ else for (let r of t) {
2845
+ let t = B("button", {
2846
+ class: "rdt-store-row__quick",
2847
+ type: "button",
2848
+ title: "复制值",
2849
+ "aria-label": `复制 ${r.key} 的值`,
2850
+ onClick: (e) => {
2851
+ e.stopPropagation(), W(t), n.copy(r.value);
2852
+ }
2853
+ }, V("copy", 11, 2));
2854
+ l.appendChild(B("div", {
2855
+ class: `rdt-store-row${a && !o && a.key === r.key ? " is-active" : ""}`,
2856
+ role: "button",
2857
+ tabindex: "0",
2858
+ onClick: () => {
2859
+ a = r, o = !1, g(), _();
2860
+ }
2861
+ }, [
2862
+ B("span", {
2863
+ class: "rdt-store-row__key",
2864
+ text: r.key,
2865
+ title: r.key
2866
+ }),
2867
+ B("span", {
2868
+ class: "rdt-store-row__value",
2869
+ text: r.value || "—",
2870
+ title: r.value
2871
+ }),
2872
+ B("span", { class: "rdt-store-row__meta" }, [t, B("span", {
2873
+ class: "rdt-store-row__size",
2874
+ text: e(Re(r.value))
2875
+ })])
2876
+ ]));
2877
+ }
2878
+ }, _ = () => {
2879
+ if (!a) {
2880
+ m.classList.remove("has-editor"), u.style.display = "none", l.style.display = "";
2881
+ return;
2882
+ }
2883
+ m.classList.add("has-editor"), l.style.display = "none", u.style.display = "", H(u);
2884
+ let e = B("input", {
2885
+ class: "rdt-input rdt-mono",
2886
+ type: "text",
2887
+ placeholder: "key",
2888
+ value: a.key,
2889
+ readonly: !o
2890
+ }), t = B("textarea", {
2891
+ class: "rdt-textarea rdt-mono",
2892
+ placeholder: "value"
2893
+ });
2894
+ t.value = a.value;
2895
+ let i = B("div", { class: "rdt-store-edit__actions" });
2896
+ i.appendChild(U("返回", {
2897
+ icon: "arrow-left",
2898
+ tone: "ghost",
2899
+ onClick: () => {
2900
+ a = null, o = !1, _(), g();
2901
+ }
2902
+ })), i.appendChild(B("div", { class: "rdt-toolbar__spacer" })), r === "cookie" ? i.appendChild(U("删除 Cookie", {
2903
+ icon: "trash",
2904
+ tone: "danger",
2905
+ onClick: () => {
2906
+ if (!a) return;
2907
+ let e = a.key;
2908
+ document.cookie = `${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`, document.cookie = `${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=${location.pathname}`, n.toast(`已删除 Cookie ${e}`, "success"), a = null, v();
2909
+ }
2910
+ })) : (i.appendChild(U("删除", {
2911
+ icon: "trash",
2912
+ tone: "danger",
2913
+ onClick: () => {
2914
+ if (!a) return;
2915
+ let e = r === "local" ? window.localStorage : window.sessionStorage;
2916
+ try {
2917
+ e.removeItem(a.key), n.toast(`已删除 ${a.key}`, "success");
2918
+ } catch {
2919
+ n.toast("删除失败", "error");
2920
+ }
2921
+ a = null, o = !1, v();
2922
+ }
2923
+ })), i.appendChild(U("保存", {
2924
+ icon: "check",
2925
+ tone: "primary",
2926
+ onClick: () => {
2927
+ let i = e.value.trim();
2928
+ if (!i) {
2929
+ n.toast("key 不能为空", "error");
2930
+ return;
2931
+ }
2932
+ let s = r === "local" ? window.localStorage : window.sessionStorage;
2933
+ try {
2934
+ s.setItem(i, t.value), n.toast("已保存", "success");
2935
+ } catch {
2936
+ n.toast("写入失败(可能超出配额)", "error");
2937
+ return;
2938
+ }
2939
+ a = null, o = !1, v();
2940
+ }
2941
+ }))), u.append(B("div", { class: "rdt-store-edit__head" }, [B("span", {
2942
+ class: "rdt-store-edit__key",
2943
+ text: r === "cookie" ? "Cookie" : r === "local" ? "localStorage" : "sessionStorage"
2944
+ })]), B("div", { class: "rdt-field" }, [B("span", {
2945
+ class: "rdt-field__label",
2946
+ text: "Key"
2947
+ }), e]), B("div", { class: "rdt-field" }, [B("span", {
2948
+ class: "rdt-field__label",
2949
+ text: "Value"
2950
+ }), t]), i);
2951
+ }, v = () => {
2952
+ p.style.display = r === "cookie" ? "none" : "", h(), g(), _();
2953
+ };
2954
+ v(), n.on("plugin:activate", ({ id: e }) => {
2955
+ e === "storage" && (a || v());
2956
+ });
2957
+ }
2958
+ };
2959
+ }
2960
+ // src/plugins/index.ts
2961
+ function Be(e) {
2962
+ return [
2963
+ xe(e),
2964
+ Fe(e),
2965
+ ze(e),
2966
+ Se(e),
2967
+ _e(e),
2968
+ Ie(e)
2969
+ ];
2970
+ }
2971
+ // src/version.ts
2972
+ var Ve = "0.10.0", He = "rinova-devtools";
2973
+ function Ue(e) {
2974
+ return e === "dark" || e === "light" || e === "auto";
2975
+ }
2976
+ function $(e) {
2977
+ return e === "sm" || e === "md" || e === "lg";
2978
+ }
2979
+ function We(e) {
2980
+ if (!e || typeof e != "object") return !1;
2981
+ let t = e;
2982
+ return typeof t.x == "number" && Number.isFinite(t.x) && typeof t.y == "number" && Number.isFinite(t.y);
2983
+ }
2984
+ function Ge(e) {
2985
+ let t = e.enabled;
2986
+ if (typeof t == "function") try {
2987
+ return t();
2988
+ } catch {
2989
+ return !1;
2990
+ }
2991
+ return t !== !1;
2992
+ }
2993
+ function Ke(e = {}) {
2994
+ let t = /* @__PURE__ */ new Map();
2995
+ for (let n of e.themes ?? []) n && n.id && t.set(n.id, n);
2996
+ let n = (e) => Ue(e) || typeof e == "string" && t.has(e), r = typeof e.launcher != "object" || e.launcher.autoTuck !== !1, i = e.appName ?? (typeof document < "u" && document.title ? document.title.trim() : "Application"), a = {
2997
+ ...e,
2998
+ appName: i,
2999
+ version: e.version ?? "0.10.0",
3000
+ theme: n(e.theme) ? e.theme : "dark",
3001
+ size: $(e.size) ? e.size : "md",
3002
+ shortcut: e.shortcut === void 0 ? "alt+shift+d" : e.shortcut,
3003
+ storagePrefix: e.storagePrefix ?? He
3004
+ }, o = new S(a.storagePrefix), s = new _(), c = new ee({
3005
+ maxEntries: e.network?.maxEntries ?? 200,
3006
+ responseBody: e.network?.responseBody ?? !0,
3007
+ ignore: e.network?.ignore ?? []
3008
+ }), l = new f(e.maxLogEntries ?? 300), u = [...e.actions ?? []], d = new g(e.config ?? [], o, e.groups ?? [], e.values ?? {}), p = () => {
3009
+ c.stop(), l.stop();
3010
+ }, m = o.getJSON("ui", {}), h = typeof m.theme == "string" && !n(m.theme) ? m.theme : null, v = {
3011
+ theme: n(m.theme) ? m.theme : a.theme,
3012
+ size: $(m.size) ? m.size : a.size,
3013
+ collapsed: typeof m.collapsed == "boolean" && m.collapsed,
3014
+ collapsedPos: We(m.collapsedPos) ? m.collapsedPos : null,
3015
+ panelPos: We(m.panelPos) ? m.panelPos : null,
3016
+ autoTuck: typeof m.autoTuck == "boolean" ? m.autoTuck : r,
3017
+ shortcut: m.shortcut === !1 || k(m.shortcut) ? m.shortcut : void 0,
3018
+ activePlugin: typeof m.activePlugin == "string" ? m.activePlugin : "",
3019
+ launcher: We(m.launcher) ? m.launcher : null
3020
+ }, y = (e) => {
3021
+ Object.assign(v, e), o.setJSON("ui", v);
3022
+ }, b = !1, x = null, w = null, T = null, E = /* @__PURE__ */ new Map(), D = e.builtinPlugins, O = () => s.emit("actions:change", u), A = {
3023
+ options: a,
3024
+ storage: o,
3025
+ config: d,
3026
+ network: c,
3027
+ logs: l,
3028
+ bus: s,
3029
+ actions: u,
3030
+ themes: t,
3031
+ app: {
3032
+ name: i,
3033
+ version: a.version,
3034
+ mode: typeof location < "u" && [
3035
+ "localhost",
3036
+ "127.0.0.1",
3037
+ "::1"
3038
+ ].includes(location.hostname) ? "local" : "remote"
3039
+ },
3040
+ ui: {
3041
+ getTheme: () => v.theme,
3042
+ getThemes: () => [...t.values()],
3043
+ getSize: () => v.size,
3044
+ getCollapsed: () => v.collapsed,
3045
+ getAutoTuck: () => v.autoTuck,
3046
+ getPanelPos: () => v.panelPos,
3047
+ getShortcut: () => {
3048
+ let e = v.shortcut === void 0 ? a.shortcut : v.shortcut;
3049
+ return e === !1 || k(e) ? e : !1;
3050
+ },
3051
+ setTheme: (e) => {
3052
+ n(e) && (h = null, v.theme !== e && (v.theme = e, y({ theme: e }), s.emit("ui:theme", { theme: e })));
3053
+ },
3054
+ setSize: (e) => {
3055
+ if (!$(e) || v.size === e) return;
3056
+ let t = v.size;
3057
+ v.size = e, y({ size: e }), s.emit("ui:size", {
3058
+ size: e,
3059
+ prev: t
3060
+ });
3061
+ },
3062
+ setCollapsed: (e) => {
3063
+ v.collapsed !== e && (v.collapsed = e, y({ collapsed: e }), s.emit("ui:collapsed", { collapsed: e }));
3064
+ },
3065
+ setAutoTuck: (e) => {
3066
+ v.autoTuck !== e && (v.autoTuck = e, y({ autoTuck: e }), s.emit("ui:autotuck", { autoTuck: e }));
3067
+ },
3068
+ setPanelPos: (e) => {
3069
+ v.panelPos = e, y({ panelPos: e }), s.emit("ui:pos", { pos: e });
3070
+ },
3071
+ setShortcut: (e) => {
3072
+ let t = e === null ? void 0 : e;
3073
+ v.shortcut !== t && (v.shortcut = t, y({ shortcut: t }), s.emit("ui:shortcut", { shortcut: t === void 0 ? a.shortcut : t }));
3074
+ },
3075
+ resetLauncher: () => {
3076
+ v.launcher = null, y({ launcher: null }), s.emit("ui:launcher-reset", void 0);
3077
+ },
3078
+ resetAll: () => {
3079
+ o.clearNamespace(), d.reset(), v.theme = a.theme, v.size = a.size, v.collapsed = !1, v.collapsedPos = null, v.panelPos = null, v.autoTuck = r, v.shortcut = void 0, v.activePlugin = "", v.launcher = null, y({}), s.emit("ui:theme", { theme: v.theme }), s.emit("ui:size", {
3080
+ size: v.size,
3081
+ prev: v.size
3082
+ }), s.emit("ui:collapsed", { collapsed: !1 }), s.emit("ui:autotuck", { autoTuck: r }), s.emit("ui:pos", { pos: null }), s.emit("ui:shortcut", { shortcut: a.shortcut }), s.emit("ui:reset", void 0);
3083
+ },
3084
+ activePlugin: () => v.activePlugin,
3085
+ activate: (e) => w?.open(e)
3086
+ },
3087
+ getInstance: () => M,
3088
+ toast: (e, t) => {
3089
+ w ? w.addToast(e, t) : console.info(`[rinova-devtools] ${e}`);
3090
+ },
3091
+ copy: async (e) => {
3092
+ let t = await C(e);
3093
+ return w && w.addToast(t ? "已复制到剪贴板" : "复制失败,请手动选择", t ? "success" : "error"), t;
3094
+ },
3095
+ open: (e) => M.open(e),
3096
+ close: () => M.close()
3097
+ };
3098
+ (() => {
3099
+ let t = /* @__PURE__ */ new Map();
3100
+ if (D !== !1) {
3101
+ let e = Be(A);
3102
+ for (let n of e) (!D || D.includes(n.id)) && t.set(n.id, n);
3103
+ }
3104
+ for (let n of e.plugins ?? []) t.set(n.id, n);
3105
+ return [...t.values()].filter((e) => {
3106
+ if (typeof e.enabled == "function") try {
3107
+ return e.enabled();
3108
+ } catch {
3109
+ return !1;
3110
+ }
3111
+ return e.enabled !== !1;
3112
+ });
3113
+ })().forEach((e) => E.set(e.id, e)), d.subscribe((t) => {
3114
+ s.emit("config:change", t), e.onConfigChange?.(t);
3115
+ });
3116
+ let j = () => (b || !Ge(e) || typeof document > "u" || (x = document.createElement("rinova-devtools"), x.setAttribute("data-rinova-devtools", ""), Object.assign(x.style, {
3117
+ position: "fixed",
3118
+ inset: "0",
3119
+ zIndex: "2147483600",
3120
+ display: "block",
3121
+ pointerEvents: "none"
3122
+ }), document.body.appendChild(x), e.captureNetwork !== !1 && c.start(), e.captureConsole !== !1 && l.start(), w = new Me(x.attachShadow({ mode: "open" }), A, v, y), w.mountPlugins([...E.values()]), b = !0, e.exposeGlobal !== !1 && (T = typeof e.exposeGlobal == "string" ? e.exposeGlobal : "__RINOVA_DEVTOOLS__", window[T] = M), s.emit("mount", void 0)), M), M = {
3123
+ get version() {
3124
+ return a.version;
3125
+ },
3126
+ get appName() {
3127
+ return i;
3128
+ },
3129
+ get mounted() {
3130
+ return b;
3131
+ },
3132
+ mount: j,
3133
+ destroy: () => {
3134
+ if (b) {
3135
+ if (w?.dispose(), w = null, c.stop(), l.stop(), x?.remove(), x = null, b = !1, typeof window < "u" && window.removeEventListener("pagehide", p), T) {
3136
+ let e = window;
3137
+ e[T] === M && delete e[T], T = null;
3138
+ }
3139
+ s.emit("destroy", void 0);
3140
+ }
3141
+ },
3142
+ open(e) {
3143
+ b || j(), b && w?.open(e);
3144
+ },
3145
+ close() {
3146
+ w?.close();
3147
+ },
3148
+ toggle() {
3149
+ b ? w?.toggle() : (j(), w?.open());
3150
+ },
3151
+ isOpen() {
3152
+ return w?.isOpen() ?? !1;
3153
+ },
3154
+ registerPlugin(e) {
3155
+ if (e.enabled === !1) return () => {};
3156
+ if (typeof e.enabled == "function") try {
3157
+ if (!e.enabled()) return () => {};
3158
+ } catch {
3159
+ return () => {};
3160
+ }
3161
+ return E.set(e.id, e), w && w.registerPlugin(e), s.emit("plugins:change", [...E.values()]), () => M.removePlugin(e.id);
3162
+ },
3163
+ removePlugin(e) {
3164
+ E.delete(e), w?.unregisterPlugin(e), s.emit("plugins:change", [...E.values()]);
3165
+ },
3166
+ listPlugins() {
3167
+ return [...E.values()];
3168
+ },
3169
+ registerAction(e) {
3170
+ let t = u.findIndex((t) => t.id === e.id);
3171
+ return t >= 0 ? u[t] = e : u.push(e), O(), () => {
3172
+ let t = u.findIndex((t) => t.id === e.id);
3173
+ t >= 0 && u.splice(t, 1), O();
3174
+ };
3175
+ },
3176
+ registerConfigField(e) {
3177
+ let t = d.registerField(e);
3178
+ return s.emit("config:fields", d.fields), () => {
3179
+ t(), s.emit("config:fields", d.fields);
3180
+ };
3181
+ },
3182
+ registerTheme(e) {
3183
+ return !e.id || Ue(e.id) ? () => {} : (t.set(e.id, e), h === e.id && (h = null, v.theme = e.id), s.emit("ui:themes", [...t.values()]), v.theme === e.id && s.emit("ui:theme", { theme: v.theme }), () => {
3184
+ t.delete(e.id), v.theme === e.id && (v.theme = e.base, y({ theme: v.theme }), s.emit("ui:theme", { theme: v.theme })), s.emit("ui:themes", [...t.values()]);
3185
+ });
3186
+ },
3187
+ listThemes() {
3188
+ return [...t.values()];
3189
+ },
3190
+ getValues() {
3191
+ return d.get();
3192
+ },
3193
+ getValue(e, t) {
3194
+ return d.getValue(e, t);
3195
+ },
3196
+ setValue(e, t) {
3197
+ d.set(e, t, "program");
3198
+ },
3199
+ setValues(e) {
3200
+ d.setMany(e, "program");
3201
+ },
3202
+ resetConfig() {
3203
+ d.reset();
3204
+ },
3205
+ on(e, t) {
3206
+ return s.on(e, t);
3207
+ },
3208
+ off(e, t) {
3209
+ s.off(e, t);
3210
+ },
3211
+ toast(e, t) {
3212
+ A.toast(e, t);
3213
+ },
3214
+ network: {
3215
+ entries: () => c.entries(),
3216
+ clear: () => c.clear(),
3217
+ replay: (e) => c.replay(e),
3218
+ capturing: () => c.capturing(),
3219
+ setCapturing: (e) => c.setCapturing(e)
3220
+ }
3221
+ };
3222
+ return typeof window < "u" && window.addEventListener("pagehide", p), M;
3223
+ }
3224
+ // src/index.ts
3225
+ function qe(e) {
3226
+ return e;
3227
+ }
3228
+ function Je(e) {
3229
+ return e;
3230
+ }
3231
+ export { Ve as VERSION, U as button, Ke as createDevtools, Je as defineConfig, qe as definePlugin, G as empty, he as field, e as formatBytes, n as formatClock, t as formatDuration, B as h, V as icon, a as prettyJSON, i as previewValue, K as segmented, ge as tag, we as toCurl };
3232
+
3233
+ //# sourceMappingURL=index.js.map