@bereasoftware/nexa 1.7.0 → 1.8.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/nexa.es.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Nexa v1.7.0 | (c) 2026 Berea-Soft | MIT License | https://github.com/Berea-Soft/Nexa */
1
+ /*! Nexa v1.8.0 | (c) 2026 Berea-Soft | MIT License | https://github.com/Berea-Soft/Nexa */
2
2
  //#region src/types/index.ts
3
3
  var e = (e) => ({
4
4
  ok: !0,
@@ -11,6 +11,10 @@ var e = (e) => ({
11
11
  //#region src/utils/index.ts
12
12
  function n(n) {
13
13
  return { validate(r) {
14
+ if (typeof r != "object" || !r) return t({
15
+ message: "Validation failed: expected an object",
16
+ code: "VALIDATION_ERROR"
17
+ });
14
18
  let i = r;
15
19
  for (let [e, r] of Object.entries(n)) if (!r(i[e])) return t({
16
20
  message: `Validation failed: field "${e}" is invalid`,
@@ -21,6 +25,10 @@ function n(n) {
21
25
  }
22
26
  function r(n) {
23
27
  return { validate(r) {
28
+ if (typeof r != "object" || !r) return t({
29
+ message: "Validation failed: expected an object",
30
+ code: "VALIDATION_ERROR"
31
+ });
24
32
  let i = r, a = n.filter((e) => !(e in i));
25
33
  return a.length > 0 ? t({
26
34
  message: `Validation failed: missing fields: ${a.join(", ")}`,
@@ -39,9 +47,9 @@ var i = { validate(n) {
39
47
  code: "VALIDATION_ERROR"
40
48
  });
41
49
  } }, o = { transform(e) {
42
- return h(e, ee);
43
- } }, s = { transform(e) {
44
50
  return h(e, m);
51
+ } }, s = { transform(e) {
52
+ return h(e, ee);
45
53
  } }, c = { transform(e) {
46
54
  return g(e);
47
55
  } };
@@ -104,10 +112,10 @@ var d = class {
104
112
  this.failureCount = 0, this.lastFailureTime = 0;
105
113
  }
106
114
  };
107
- function ee(e) {
115
+ function m(e) {
108
116
  return e.replace(/_([a-z])/g, (e, t) => t.toUpperCase());
109
117
  }
110
- function m(e) {
118
+ function ee(e) {
111
119
  return e.replace(/[A-Z]/g, (e) => `_${e.toLowerCase()}`);
112
120
  }
113
121
  function h(e, t) {
@@ -125,7 +133,7 @@ function g(e, t = "") {
125
133
  });
126
134
  else if (e && typeof e == "object") for (let [r, i] of Object.entries(e)) {
127
135
  let e = t ? `${t}.${r}` : r;
128
- i && typeof i == "object" && !Array.isArray(i) ? Object.assign(n, g(i, e)) : n[e] = i;
136
+ i && typeof i == "object" ? Object.assign(n, g(i, e)) : n[e] = i;
129
137
  }
130
138
  return n;
131
139
  }
@@ -277,9 +285,13 @@ function T(e) {
277
285
  case "DELETE":
278
286
  i = await t.delete(r);
279
287
  break;
288
+ case "QUERY":
289
+ i = await t.query(r, n);
290
+ break;
280
291
  default: throw Error(`Unsupported method: ${e.method}`);
281
292
  }
282
- return i;
293
+ if (!i.ok) throw Error(i.error.message);
294
+ return i.value.data;
283
295
  };
284
296
  }
285
297
  function ae(e) {
@@ -288,7 +300,7 @@ function ae(e) {
288
300
  return await T(i)(t, r);
289
301
  } };
290
302
  }
291
- var E = class e {
303
+ var oe = class e {
292
304
  subscribers = [];
293
305
  errorSubscribers = [];
294
306
  completeSubscribers = [];
@@ -317,19 +329,19 @@ var E = class e {
317
329
  }, (e) => n.error(e), () => n.complete()), n;
318
330
  }
319
331
  };
320
- function D(e) {
332
+ function se(e) {
321
333
  return (t) => {
322
334
  if (!e(t)) throw TypeError("Value does not match expected type");
323
335
  return t;
324
336
  };
325
337
  }
326
- function O(e) {
338
+ function E(e) {
327
339
  return e;
328
340
  }
329
- function k(e) {
330
- return O(e);
341
+ function ce(e) {
342
+ return E(e);
331
343
  }
332
- var oe = class {
344
+ var D = class {
333
345
  _promise;
334
346
  resolveFunc;
335
347
  rejectFunc;
@@ -351,7 +363,7 @@ var oe = class {
351
363
  return this._promise;
352
364
  }
353
365
  };
354
- async function A(e, t = {}) {
366
+ async function O(e, t = {}) {
355
367
  let n = e.body?.getReader();
356
368
  if (!n) throw Error("Response body is not readable");
357
369
  let r = [], i = 0, a = parseInt(e.headers.get("content-length") || "0", 10);
@@ -360,22 +372,22 @@ async function A(e, t = {}) {
360
372
  if (e) break;
361
373
  r.push(o), i += o.length, t.onChunk && await t.onChunk(o), t.onProgress && a > 0 && t.onProgress(i, a);
362
374
  }
363
- return j(r, i);
375
+ return k(r, i);
364
376
  }
365
- function j(e, t) {
377
+ function k(e, t) {
366
378
  let n = new Uint8Array(t), r = 0;
367
379
  for (let t of e) n.set(t, r), r += t.byteLength;
368
380
  return n;
369
381
  }
370
- async function se(e, t) {
371
- let n = await A(e);
382
+ async function A(e, t) {
383
+ let n = await O(e);
372
384
  if (typeof window > "u") await (await import("fs").then((e) => e.promises)).writeFile(t, n);
373
385
  else {
374
386
  let e = new Blob([n.buffer], { type: "application/octet-stream" }), r = URL.createObjectURL(e), i = document.createElement("a");
375
387
  i.href = r, i.download = t, i.click(), URL.revokeObjectURL(r);
376
388
  }
377
389
  }
378
- function M(e = {}) {
390
+ function j(e = {}) {
379
391
  return async (t, n) => {
380
392
  if (await n(), t.response && t.response.body && typeof t.response.body == "object" && "getReader" in t.response.body) {
381
393
  let n = t.response.body.getReader(), r = [], i = 0, a = parseInt(t.response.headers?.["content-length"] || "0", 10);
@@ -385,7 +397,7 @@ function M(e = {}) {
385
397
  if (o) break;
386
398
  r.push(s), i += s.length, e.onChunk && await e.onChunk(s), e.onProgress && a > 0 && e.onProgress(i, a), t.state.streamedChunks = t.state.streamedChunks || [], t.state.streamedChunks.push(s);
387
399
  }
388
- let o = j(r, i);
400
+ let o = k(r, i);
389
401
  t.response.body = o, t.state.streaming = !0, t.state.streamedBytes = i;
390
402
  } finally {
391
403
  n.releaseLock();
@@ -393,12 +405,12 @@ function M(e = {}) {
393
405
  }
394
406
  };
395
407
  }
396
- var ce = M({ onProgress: (e, t) => {
408
+ var le = j({ onProgress: (e, t) => {
397
409
  if (t > 0) {
398
410
  let n = Math.round(e / t * 100);
399
411
  console.warn(`Streaming: ${n}% (${e}/${t} bytes)`);
400
412
  }
401
- } }), N = class {
413
+ } }), M = class {
402
414
  plugins = [];
403
415
  cache = new y();
404
416
  deduplicator = new S();
@@ -440,7 +452,7 @@ var ce = M({ onProgress: (e, t) => {
440
452
  clear() {
441
453
  this.plugins = [], this.middlewares = [], this.listeners.clear(), this.cache.clear(), this.deduplicator.clear();
442
454
  }
443
- }, le = {
455
+ }, ue = {
444
456
  name: "logger",
445
457
  setup(e) {
446
458
  e.on("request:start", (...e) => {
@@ -454,7 +466,7 @@ var ce = M({ onProgress: (e, t) => {
454
466
  console.error(`❌ Request failed: ${t}`, n);
455
467
  });
456
468
  }
457
- }, ue = class {
469
+ }, de = class {
458
470
  name = "metrics";
459
471
  metrics = {
460
472
  requests: 0,
@@ -471,7 +483,7 @@ var ce = M({ onProgress: (e, t) => {
471
483
  getMetrics() {
472
484
  return { ...this.metrics };
473
485
  }
474
- }, de = class {
486
+ }, fe = class {
475
487
  name = "cache";
476
488
  ttlMs;
477
489
  constructor(e = 6e4) {
@@ -480,12 +492,12 @@ var ce = M({ onProgress: (e, t) => {
480
492
  setup(e) {
481
493
  e.addMiddleware(b({ ttlMs: this.ttlMs }));
482
494
  }
483
- }, fe = class {
495
+ }, pe = class {
484
496
  name = "dedupe";
485
497
  setup(e) {
486
498
  e.addMiddleware(C());
487
499
  }
488
- }, pe = class {
500
+ }, me = class {
489
501
  store = new y();
490
502
  get(e) {
491
503
  return this.store.get(e);
@@ -499,7 +511,7 @@ var ce = M({ onProgress: (e, t) => {
499
511
  clear() {
500
512
  this.store.clear();
501
513
  }
502
- }, P = class {
514
+ }, he = class {
503
515
  maxAttempts;
504
516
  baseDelayMs;
505
517
  constructor(e = 3, t = 100) {
@@ -513,7 +525,7 @@ var ce = M({ onProgress: (e, t) => {
513
525
  let t = this.baseDelayMs * 2 ** (e - 1), n = Math.random() * t * .1;
514
526
  return Math.min(t + n, 3e4);
515
527
  }
516
- }, F = class {
528
+ }, ge = class {
517
529
  running = 0;
518
530
  queue = [];
519
531
  maxConcurrent;
@@ -543,7 +555,7 @@ var ce = M({ onProgress: (e, t) => {
543
555
  return this.running;
544
556
  }
545
557
  };
546
- function I(e) {
558
+ function N(e) {
547
559
  return e == null ? {
548
560
  serialized: void 0,
549
561
  contentType: null
@@ -567,14 +579,21 @@ function I(e) {
567
579
  contentType: "application/json"
568
580
  };
569
581
  }
570
- function L(e, t) {
582
+ function P(e, t) {
571
583
  return t ? e.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g, (e, n) => {
572
584
  let r = t[n];
573
585
  if (r === void 0) throw Error(`Missing path parameter: :${n}`);
574
586
  return encodeURIComponent(String(r));
575
587
  }) : e;
576
588
  }
577
- var R = class n {
589
+ function F(e) {
590
+ let t = new URLSearchParams();
591
+ for (let [n, r] of Object.entries(e)) if (r != null) if (Array.isArray(r)) for (let e of r) t.append(n, String(e));
592
+ else if (typeof r == "object") for (let [e, i] of Object.entries(r)) i != null && t.append(`${n}[${e}]`, String(i));
593
+ else t.append(n, String(r));
594
+ return t.toString();
595
+ }
596
+ var I = class n {
578
597
  requestInterceptors = [];
579
598
  responseInterceptors = [];
580
599
  cache;
@@ -588,12 +607,12 @@ var R = class n {
588
607
  defaultHeaders: e.defaultHeaders ?? { "Content-Type": "application/json" },
589
608
  defaultTimeout: e.defaultTimeout ?? 3e4,
590
609
  validateStatus: e.validateStatus ?? ((e) => e >= 200 && e < 300),
591
- cacheStrategy: e.cacheStrategy ?? new pe(),
610
+ cacheStrategy: e.cacheStrategy ?? new me(),
592
611
  maxConcurrent: e.maxConcurrent ?? 0,
593
612
  defaultResponseType: e.defaultResponseType ?? "auto",
594
613
  defaultHooks: e.defaultHooks ?? {},
595
614
  adapter: e.adapter
596
- }, this.cache = this.config.cacheStrategy, this.requestQueue = this.config.maxConcurrent > 0 ? new F(this.config.maxConcurrent) : null, this.devTracker = e.devTracker ?? null;
615
+ }, this.cache = this.config.cacheStrategy, this.requestQueue = this.config.maxConcurrent > 0 ? new ge(this.config.maxConcurrent) : null, this.devTracker = e.devTracker ?? null;
597
616
  }
598
617
  async request(n) {
599
618
  if (!this.requestInterceptors.length && !this.responseInterceptors.length && !n.cache?.enabled && !n.hooks && !Object.keys(this.config.defaultHooks).length && !n.retry && !n.validate && !n.transform && !this.requestQueue && !n.onDownloadProgress && !n.signal) return this.fastPath(n);
@@ -604,9 +623,9 @@ var R = class n {
604
623
  r.onStart?.(o), this.requestQueue && await this.requestQueue.acquire();
605
624
  try {
606
625
  for (let s = 1; s <= i; s++) {
607
- let c;
626
+ let c, l;
608
627
  try {
609
- if ((n.method === "GET" || !n.method) && n.cache?.enabled) {
628
+ if (this.isCacheableMethod(n.method) && n.cache?.enabled) {
610
629
  let t = this.getCacheKey(n), i = this.cache.get(t);
611
630
  if (i) {
612
631
  let t = i;
@@ -625,38 +644,38 @@ var R = class n {
625
644
  }
626
645
  let t = o;
627
646
  for (let e of this.requestInterceptors) t = await e.onRequest(t);
628
- c = new AbortController(), this.pendingRequests.add(c), n.signal && n.signal.addEventListener("abort", () => c.abort(), { once: !0 });
629
- let i = performance.now(), a = await this.fetchWithTimeout(t, this.resolveTimeoutMs(n.timeout ?? this.config.defaultTimeout), c), l = performance.now() - i, u = a;
630
- n.onDownloadProgress && a.body && (u = this.trackDownloadProgress(a, n.onDownloadProgress));
631
- let d = n.responseType ?? this.config.defaultResponseType, f = await this.parseResponse(u, t, l, d);
632
- if (!this.config.validateStatus(f.status)) throw {
633
- message: `Request failed with status ${f.status}`,
634
- status: f.status,
635
- statusText: f.statusText,
647
+ c = new AbortController(), this.pendingRequests.add(c), n.signal && (l = () => c.abort(), n.signal.addEventListener("abort", l, { once: !0 }));
648
+ let i = performance.now(), a = await this.fetchWithTimeout(t, this.resolveTimeoutMs(n.timeout ?? this.config.defaultTimeout), c), u = performance.now() - i, d = a;
649
+ n.onDownloadProgress && a.body && (d = this.trackDownloadProgress(a, n.onDownloadProgress));
650
+ let f = n.responseType ?? this.config.defaultResponseType, p = await this.parseResponse(d, t, u, f);
651
+ if (!this.config.validateStatus(p.status)) throw {
652
+ message: `Request failed with status ${p.status}`,
653
+ status: p.status,
654
+ statusText: p.statusText,
636
655
  code: "HTTP_ERROR"
637
656
  };
638
657
  if (n.validate) {
639
- let e = n.validate.validate(f.data);
658
+ let e = n.validate.validate(p.data);
640
659
  if (!e.ok) return e;
641
660
  }
642
- n.transform && (f.data = n.transform.transform(f.data));
643
- let p = f;
644
- for (let e of this.responseInterceptors) p = await e.onResponse(p);
645
- if ((n.method === "GET" || !n.method) && n.cache?.enabled) {
661
+ n.transform && (p.data = n.transform.transform(p.data));
662
+ let m = p;
663
+ for (let e of this.responseInterceptors) m = await e.onResponse(m);
664
+ if (this.isCacheableMethod(n.method) && n.cache?.enabled) {
646
665
  let e = this.getCacheKey(n);
647
- this.cache.set(e, p, n.cache.ttlMs);
666
+ this.cache.set(e, m, n.cache.ttlMs);
648
667
  }
649
- return r.onSuccess?.(p), this.pendingRequests.delete(c), this.trackDev({
668
+ return r.onSuccess?.(m), this.pendingRequests.delete(c), this.trackDev({
650
669
  method: n.method ?? "GET",
651
670
  url: o.url,
652
- status: p.status,
653
- duration: p.duration,
671
+ status: m.status,
672
+ duration: m.duration,
654
673
  cached: !1,
655
674
  ok: !0,
656
675
  headers: { ...o.headers },
657
676
  body: n.body,
658
677
  retryCount: s - 1
659
- }), e(p);
678
+ }), e(m);
660
679
  } catch (e) {
661
680
  let l;
662
681
  if (l = e instanceof DOMException ? e.name === "TimeoutError" ? {
@@ -689,6 +708,8 @@ var R = class n {
689
708
  body: n.body,
690
709
  retryCount: s - 1
691
710
  }), t(u);
711
+ } finally {
712
+ n.signal && l && n.signal.removeEventListener("abort", l);
692
713
  }
693
714
  }
694
715
  let s = {
@@ -711,33 +732,34 @@ var R = class n {
711
732
  }
712
733
  }
713
734
  async fastPath(n) {
714
- let r = L(n.url, n.params), i = this.buildUrl(r, n.query), { serialized: a, contentType: o } = I(n.body), s = {
735
+ let r = P(n.url, n.params), i = this.buildUrl(r, n.query), { serialized: a, contentType: o } = N(n.body), s = {
715
736
  ...this.config.defaultHeaders,
716
737
  ...n.headers
717
738
  };
718
739
  o ? s["Content-Type"] = o : a instanceof FormData && delete s["Content-Type"];
719
740
  let c = new AbortController(), l = this.resolveTimeoutMs(n.timeout ?? this.config.defaultTimeout);
720
741
  this.pendingRequests.add(c);
742
+ let u = performance.now();
721
743
  try {
722
- let r = performance.now(), a = await this.fetchWithTimeout({
744
+ let r = await this.fetchWithTimeout({
723
745
  url: i,
724
746
  method: n.method ?? "GET",
725
747
  headers: s,
726
748
  body: n.body,
727
749
  params: n.params
728
- }, l, c), o = performance.now() - r, u = await this.parseBody(a, n.responseType ?? this.config.defaultResponseType);
729
- if (!this.config.validateStatus(a.status)) {
750
+ }, l, c), a = performance.now() - u, o = await this.parseBody(r, n.responseType ?? this.config.defaultResponseType);
751
+ if (!this.config.validateStatus(r.status)) {
730
752
  let e = t({
731
- message: `Request failed with status ${a.status}`,
732
- status: a.status,
733
- statusText: a.statusText,
753
+ message: `Request failed with status ${r.status}`,
754
+ status: r.status,
755
+ statusText: r.statusText,
734
756
  code: "HTTP_ERROR"
735
757
  });
736
758
  return this.trackDev({
737
759
  method: n.method ?? "GET",
738
760
  url: i,
739
- status: a.status,
740
- duration: o,
761
+ status: r.status,
762
+ duration: a,
741
763
  cached: !1,
742
764
  ok: !1,
743
765
  code: "HTTP_ERROR",
@@ -749,18 +771,18 @@ var R = class n {
749
771
  return this.pendingRequests.delete(c), this.trackDev({
750
772
  method: n.method ?? "GET",
751
773
  url: i,
752
- status: a.status,
753
- duration: o,
774
+ status: r.status,
775
+ duration: a,
754
776
  cached: !1,
755
777
  ok: !0,
756
778
  headers: s,
757
779
  body: n.body,
758
780
  retryCount: 0
759
781
  }), e({
760
- status: a.status,
761
- statusText: a.statusText,
762
- headers: a.headers,
763
- data: u,
782
+ status: r.status,
783
+ statusText: r.statusText,
784
+ headers: r.headers,
785
+ data: o,
764
786
  request: {
765
787
  url: i,
766
788
  method: n.method ?? "GET",
@@ -768,7 +790,7 @@ var R = class n {
768
790
  body: n.body,
769
791
  params: n.params
770
792
  },
771
- duration: o
793
+ duration: a
772
794
  });
773
795
  } catch (e) {
774
796
  this.pendingRequests.delete(c);
@@ -776,7 +798,7 @@ var R = class n {
776
798
  if (e instanceof DOMException ? e.name === "TimeoutError" ? r = "TIMEOUT" : e.name === "AbortError" && (r = "ABORTED") : e instanceof Error && (e.name === "TimeoutError" ? r = "TIMEOUT" : e.name === "AbortError" || e.message.includes("abort") ? r = "ABORTED" : e.name === "TypeError" && (r = "NETWORK_ERROR")), this.trackDev({
777
799
  method: n.method ?? "GET",
778
800
  url: i,
779
- duration: performance.now() - (performance.now() - 0),
801
+ duration: performance.now() - u,
780
802
  cached: !1,
781
803
  ok: !1,
782
804
  code: r,
@@ -839,6 +861,14 @@ var R = class n {
839
861
  body: t
840
862
  });
841
863
  }
864
+ query(e, t, n) {
865
+ return this.request({
866
+ ...n,
867
+ url: e,
868
+ method: "QUERY",
869
+ body: t
870
+ });
871
+ }
842
872
  delete(e, t) {
843
873
  return this.request({
844
874
  ...t,
@@ -938,7 +968,7 @@ var R = class n {
938
968
  });
939
969
  }
940
970
  buildRequest(e) {
941
- let t = L(e.url, e.params);
971
+ let t = P(e.url, e.params);
942
972
  return {
943
973
  url: this.buildUrl(t, e.query),
944
974
  method: e.method ?? "GET",
@@ -952,22 +982,21 @@ var R = class n {
952
982
  }
953
983
  buildUrl(e, t) {
954
984
  let n = this.config.baseURL + e;
955
- if (t) {
956
- let e = Object.keys(t);
957
- if (e.length > 0) {
958
- let r = new URLSearchParams();
959
- for (let n = 0; n < e.length; n++) r.append(e[n], String(t[e[n]]));
960
- n += `?${r.toString()}`;
961
- }
985
+ if (t && Object.keys(t).length > 0) {
986
+ let e = F(t);
987
+ e && (n += `?${e}`);
962
988
  }
963
989
  return n;
964
990
  }
991
+ isCacheableMethod(e) {
992
+ return e === "GET" || e === "QUERY" || !e;
993
+ }
965
994
  getCacheKey(e) {
966
- let t = L(e.url, e.params), n = e.query ? JSON.stringify(e.query) : "";
967
- return `${e.method ?? "GET"}:${t}${n ? ":" + n : ""}`;
995
+ let t = P(e.url, e.params), n = e.query ? JSON.stringify(e.query) : "", r = e.method === "QUERY" && e.body !== void 0 ? JSON.stringify(e.body) : "";
996
+ return `${e.method ?? "GET"}:${t}${n ? ":" + n : ""}${r ? ":" + r : ""}`;
968
997
  }
969
998
  fetchWithTimeout(e, t, n) {
970
- let { serialized: r, contentType: i } = I(e.body), a = { ...e.headers };
999
+ let { serialized: r, contentType: i } = N(e.body), a = { ...e.headers };
971
1000
  return i ? a["Content-Type"] = i : r instanceof FormData && delete a["Content-Type"], new Promise((i, o) => {
972
1001
  let s = setTimeout(() => {
973
1002
  n.abort(), o(new DOMException("Request timed out", "TimeoutError"));
@@ -1072,7 +1101,7 @@ var R = class n {
1072
1101
  return e ? "maxAttempts" in e ? e.maxAttempts ?? 1 : 100 : 1;
1073
1102
  }
1074
1103
  getRetryStrategy(e) {
1075
- return e ? "shouldRetry" in e ? e : new P(e.maxAttempts, e.backoffMs) : {
1104
+ return e ? "shouldRetry" in e ? e : new he(e.maxAttempts, e.backoffMs) : {
1076
1105
  shouldRetry: () => !1,
1077
1106
  delayMs: () => 0
1078
1107
  };
@@ -1086,7 +1115,7 @@ var R = class n {
1086
1115
  trackDev(e) {
1087
1116
  this.devTracker && this.devTracker.track(e);
1088
1117
  }
1089
- }, z = class extends Error {
1118
+ }, L = class extends Error {
1090
1119
  status;
1091
1120
  code;
1092
1121
  response;
@@ -1094,18 +1123,18 @@ var R = class n {
1094
1123
  super(e), this.name = "HttpError", this.status = t, this.code = n, this.response = r;
1095
1124
  }
1096
1125
  };
1097
- function B(e) {
1098
- return e instanceof z;
1126
+ function _e(e) {
1127
+ return e instanceof L;
1099
1128
  }
1100
- function me(e) {
1101
- return new R(e);
1129
+ function ve(e) {
1130
+ return new I(e);
1102
1131
  }
1103
1132
  //#endregion
1104
1133
  //#region src/realtime/websocket-client.ts
1105
- function V() {
1134
+ function R() {
1106
1135
  return typeof window > "u" && typeof process < "u" && process.versions?.node !== void 0;
1107
1136
  }
1108
- var he = class {
1137
+ var ye = class {
1109
1138
  url;
1110
1139
  options;
1111
1140
  pluginManager;
@@ -1113,6 +1142,7 @@ var he = class {
1113
1142
  reconnectAttempt = 0;
1114
1143
  reconnectTimer = null;
1115
1144
  heartbeatTimer = null;
1145
+ stopHeartbeatMessageListener = null;
1116
1146
  stats = {
1117
1147
  messagesSent: 0,
1118
1148
  messagesReceived: 0,
@@ -1127,7 +1157,7 @@ var he = class {
1127
1157
  message: /* @__PURE__ */ new Set()
1128
1158
  };
1129
1159
  constructor(e, t = {}) {
1130
- this.url = e, this.options = t, this.pluginManager = new N();
1160
+ this.url = e, this.options = t, this.pluginManager = new M();
1131
1161
  }
1132
1162
  updateStatus(e) {
1133
1163
  this.status = e, e === "open" ? this.connectionStartTime = Date.now() : e === "closed" && this.connectionStartTime > 0 && (this.stats.connectionTime += Date.now() - this.connectionStartTime, this.connectionStartTime = 0);
@@ -1177,12 +1207,12 @@ var he = class {
1177
1207
  this.pluginManager.emit("websocket:reconnect:failed", this.url, this.reconnectAttempt);
1178
1208
  return;
1179
1209
  }
1180
- let t = this.options.reconnect?.baseDelay ?? 1e3, n = this.options.reconnect?.maxDelay ?? 3e4, r = Math.min(n, t * 2 ** this.reconnectAttempt);
1181
- this.reconnectAttempt++, this.stats.reconnectAttempts = this.reconnectAttempt, this.options.reconnect?.onReconnecting?.(this.reconnectAttempt, r), this.pluginManager.emit("websocket:reconnecting", this.url, this.reconnectAttempt, r), this.reconnectTimer = setTimeout(() => {
1210
+ let t = this.options.reconnect?.baseDelay ?? 1e3, n = this.options.reconnect?.maxDelay ?? 3e4, r = t * 2 ** this.reconnectAttempt, i = Math.random() * r * .1, a = Math.min(n, r + i);
1211
+ this.reconnectAttempt++, this.stats.reconnectAttempts = this.reconnectAttempt, this.options.reconnect?.onReconnecting?.(this.reconnectAttempt, a), this.pluginManager.emit("websocket:reconnecting", this.url, this.reconnectAttempt, a), this.reconnectTimer = setTimeout(() => {
1182
1212
  this.connect().catch((e) => {
1183
1213
  this.emitError(e instanceof Error ? e : Error(String(e)));
1184
1214
  });
1185
- }, r);
1215
+ }, a);
1186
1216
  }
1187
1217
  startHeartbeat() {
1188
1218
  if (!this.options.heartbeat) return;
@@ -1191,20 +1221,22 @@ var he = class {
1191
1221
  this.pluginManager.emit("websocket:heartbeat:timeout", this.url), this.disconnect();
1192
1222
  return;
1193
1223
  }
1194
- r = !1, this.send(t), this.heartbeatTimer = setTimeout(i, e);
1195
- };
1196
- this.onMessage((e) => {
1224
+ r = !1;
1225
+ let n = this.send(t);
1226
+ n.ok || this.pluginManager.emit("websocket:heartbeat:send-failed", this.url, n.error), this.heartbeatTimer = setTimeout(i, e);
1227
+ }, a = (e) => {
1197
1228
  let t = e.raw;
1198
1229
  typeof t == "string" && t === n && (r = !0);
1199
- }), this.heartbeatTimer = setTimeout(i, e);
1230
+ };
1231
+ this.stopHeartbeatMessageListener?.(), this.stopHeartbeatMessageListener = this.onMessage(a), this.heartbeatTimer = setTimeout(i, e);
1200
1232
  }
1201
1233
  stopHeartbeat() {
1202
- this.heartbeatTimer &&= (clearTimeout(this.heartbeatTimer), null);
1234
+ this.heartbeatTimer &&= (clearTimeout(this.heartbeatTimer), null), this.stopHeartbeatMessageListener?.(), this.stopHeartbeatMessageListener = null;
1203
1235
  }
1204
1236
  cleanup() {
1205
1237
  this.reconnectTimer &&= (clearTimeout(this.reconnectTimer), null), this.stopHeartbeat();
1206
1238
  }
1207
- }, H = class extends he {
1239
+ }, z = class extends ye {
1208
1240
  socket = null;
1209
1241
  messageTypeListeners = /* @__PURE__ */ new Map();
1210
1242
  constructor(e, t = {}) {
@@ -1242,12 +1274,23 @@ var he = class {
1242
1274
  disconnect() {
1243
1275
  this.cleanup(), this.socket && (this.updateStatus("closing"), this.socket.close(1e3, "Client disconnected"), this.socket = null, this.updateStatus("closed"));
1244
1276
  }
1245
- send(e) {
1246
- if (!this.socket || this.socket.readyState !== WebSocket.OPEN) throw Error("WebSocket is not connected");
1247
- this.socket.send(e), this.stats.messagesSent++, this.pluginManager.emit("websocket:message:sent", this.url, e);
1277
+ send(n) {
1278
+ if (!this.socket || this.socket.readyState !== WebSocket.OPEN) return t({
1279
+ message: "WebSocket is not connected",
1280
+ code: "NOT_CONNECTED"
1281
+ });
1282
+ try {
1283
+ this.socket.send(n);
1284
+ } catch (e) {
1285
+ return t({
1286
+ message: e instanceof Error ? e.message : "Failed to send WebSocket message",
1287
+ code: "SEND_FAILED"
1288
+ });
1289
+ }
1290
+ return this.stats.messagesSent++, this.pluginManager.emit("websocket:message:sent", this.url, n), e(void 0);
1248
1291
  }
1249
1292
  sendJson(e) {
1250
- this.send(JSON.stringify(e));
1293
+ return this.send(JSON.stringify(e));
1251
1294
  }
1252
1295
  onMessageType(e, t) {
1253
1296
  return this.messageTypeListeners.has(e) || this.messageTypeListeners.set(e, /* @__PURE__ */ new Set()), this.messageTypeListeners.get(e).add(t), () => {
@@ -1263,9 +1306,9 @@ var he = class {
1263
1306
  }
1264
1307
  return e;
1265
1308
  }
1266
- }, ge = class extends H {
1309
+ }, be = class extends z {
1267
1310
  async connect() {
1268
- if (V()) try {
1311
+ if (R()) try {
1269
1312
  let { default: e } = await import("ws");
1270
1313
  return super.connect();
1271
1314
  } catch {
@@ -1274,15 +1317,15 @@ var he = class {
1274
1317
  return super.connect();
1275
1318
  }
1276
1319
  };
1277
- function _e(e, t = {}) {
1278
- return V() ? new ge(e, t) : new H(e, t);
1320
+ function xe(e, t = {}) {
1321
+ return R() ? new be(e, t) : new z(e, t);
1279
1322
  }
1280
1323
  //#endregion
1281
1324
  //#region src/realtime/sse-client.ts
1282
- function U() {
1325
+ function Se() {
1283
1326
  return typeof window > "u" && typeof process < "u" && process.versions?.node !== void 0;
1284
1327
  }
1285
- var W = class {
1328
+ var B = class {
1286
1329
  url;
1287
1330
  options;
1288
1331
  _source = null;
@@ -1305,8 +1348,9 @@ var W = class {
1305
1348
  event: /* @__PURE__ */ new Map()
1306
1349
  };
1307
1350
  _lastEventId = null;
1351
+ nativeEventListeners = /* @__PURE__ */ new Map();
1308
1352
  constructor(e, t = {}) {
1309
- this.url = e, this.options = t, this.pluginManager = new N();
1353
+ this.url = e, this.options = t, this.pluginManager = new M();
1310
1354
  }
1311
1355
  updateStatus(e) {
1312
1356
  this.status = e, e === "open" ? this.connectionStartTime = Date.now() : e === "closed" && this.connectionStartTime > 0 && (this.stats.connectionTime += Date.now() - this.connectionStartTime, this.connectionStartTime = 0);
@@ -1314,7 +1358,7 @@ var W = class {
1314
1358
  async connect() {
1315
1359
  if (!(this.status === "connecting" || this.status === "open")) return this.updateStatus("connecting"), this.pluginManager.emit("sse:connect:start", this.url), new Promise((e, t) => {
1316
1360
  let n = this.options.timeout ?? 1e4, r = setTimeout(() => {
1317
- this.updateStatus("closed"), this._source?.close(), this._source = null;
1361
+ this.updateStatus("closed"), this._source?.close(), this._source = null, this.nativeEventListeners.clear();
1318
1362
  let e = /* @__PURE__ */ Error(`SSE connection timeout after ${n}ms`);
1319
1363
  this.emitError(e), t(e);
1320
1364
  }, n);
@@ -1334,17 +1378,20 @@ var W = class {
1334
1378
  this.emitMessage(t), this.pluginManager.emit("sse:message:received", this.url, t);
1335
1379
  let n = e.type || "message", r = this.listeners.event.get(n);
1336
1380
  if (r) for (let e of r) e(t.data);
1337
- }, this._source.addEventListener = this._source.addEventListener.bind(this._source);
1381
+ }, this.attachAllNamedListeners();
1338
1382
  } catch (e) {
1339
1383
  clearTimeout(r), this.updateStatus("closed"), this.pluginManager.emit("sse:connect:error", this.url, e), t(e);
1340
1384
  }
1341
1385
  });
1342
1386
  }
1343
1387
  disconnect() {
1344
- this.cleanup(), this._source && (this.updateStatus("closing"), this._source.close(), this._source = null, this.updateStatus("closed"), this.emitClose(), this.options.onClose?.());
1388
+ this.cleanup(), this._source && (this.updateStatus("closing"), this._source.close(), this._source = null, this.nativeEventListeners.clear(), this.updateStatus("closed"), this.emitClose(), this.options.onClose?.());
1345
1389
  }
1346
1390
  send(e) {
1347
- throw Error("SSE is a receive-only protocol. Use HTTP requests to send data to server.");
1391
+ return t({
1392
+ message: "SSE is a receive-only protocol. Use HTTP requests to send data to server.",
1393
+ code: "UNSUPPORTED"
1394
+ });
1348
1395
  }
1349
1396
  onMessage(e) {
1350
1397
  return this.listeners.message.add(e), () => this.listeners.message.delete(e);
@@ -1358,17 +1405,30 @@ var W = class {
1358
1405
  onError(e) {
1359
1406
  return this.listeners.error.add(e), () => this.listeners.error.delete(e);
1360
1407
  }
1361
- onEvent(e, t) {
1362
- return this.listeners.event.has(e) || this.listeners.event.set(e, /* @__PURE__ */ new Set()), this.listeners.event.get(e).add(t), this._source && !this._source[`on${e}`] && this._source.addEventListener(e, (n) => {
1408
+ attachNamedListener(e, t) {
1409
+ if (!this._source) return;
1410
+ let n = (n) => {
1363
1411
  t({
1364
1412
  data: this.tryParseData(n.data),
1365
1413
  raw: n.data,
1366
1414
  type: e,
1367
1415
  timestamp: Date.now()
1368
1416
  }.data);
1369
- }), () => {
1417
+ };
1418
+ this._source.addEventListener(e, n), this.nativeEventListeners.has(e) || this.nativeEventListeners.set(e, /* @__PURE__ */ new Map()), this.nativeEventListeners.get(e).set(t, n);
1419
+ }
1420
+ detachNamedListener(e, t) {
1421
+ let n = this.nativeEventListeners.get(e)?.get(t);
1422
+ n && (this._source?.removeEventListener(e, n), this.nativeEventListeners.get(e).delete(t), this.nativeEventListeners.get(e).size === 0 && this.nativeEventListeners.delete(e));
1423
+ }
1424
+ attachAllNamedListeners() {
1425
+ this.nativeEventListeners.clear();
1426
+ for (let [e, t] of this.listeners.event) for (let n of t) this.attachNamedListener(e, n);
1427
+ }
1428
+ onEvent(e, t) {
1429
+ return this.listeners.event.has(e) || this.listeners.event.set(e, /* @__PURE__ */ new Set()), this.listeners.event.get(e).add(t), this.attachNamedListener(e, t), () => {
1370
1430
  let n = this.listeners.event.get(e);
1371
- n && (n.delete(t), n.size === 0 && this.listeners.event.delete(e));
1431
+ n && (n.delete(t), n.size === 0 && this.listeners.event.delete(e)), this.detachNamedListener(e, t);
1372
1432
  };
1373
1433
  }
1374
1434
  getStatus() {
@@ -1410,12 +1470,12 @@ var W = class {
1410
1470
  this.pluginManager.emit("sse:reconnect:failed", this.url, this.reconnectAttempt);
1411
1471
  return;
1412
1472
  }
1413
- let t = this.options.reconnect?.baseDelay ?? 1e3, n = this.options.reconnect?.maxDelay ?? 3e4, r = Math.min(n, t * 2 ** this.reconnectAttempt);
1414
- this.reconnectAttempt++, this.stats.reconnectAttempts = this.reconnectAttempt, this.options.reconnect?.onReconnecting?.(this.reconnectAttempt, r), this.pluginManager.emit("sse:reconnecting", this.url, this.reconnectAttempt, r), this.reconnectTimer = setTimeout(() => {
1473
+ let t = this.options.reconnect?.baseDelay ?? 1e3, n = this.options.reconnect?.maxDelay ?? 3e4, r = t * 2 ** this.reconnectAttempt, i = Math.random() * r * .1, a = Math.min(n, r + i);
1474
+ this.reconnectAttempt++, this.stats.reconnectAttempts = this.reconnectAttempt, this.options.reconnect?.onReconnecting?.(this.reconnectAttempt, a), this.pluginManager.emit("sse:reconnecting", this.url, this.reconnectAttempt, a), this.reconnectTimer = setTimeout(() => {
1415
1475
  this.connect().catch((e) => {
1416
1476
  this.emitError(e instanceof Error ? e : Error(String(e)));
1417
1477
  });
1418
- }, r);
1478
+ }, a);
1419
1479
  }
1420
1480
  cleanup() {
1421
1481
  this.reconnectTimer &&= (clearTimeout(this.reconnectTimer), null);
@@ -1427,18 +1487,17 @@ var W = class {
1427
1487
  return e;
1428
1488
  }
1429
1489
  }
1430
- }, ve = class extends W {
1431
- async connect() {
1432
- if (U()) throw Error("SSE client for Node.js requires a polyfill or custom implementation. Consider using a library like \"eventsource\" or implement using fetch with streaming.");
1433
- return super.connect();
1490
+ }, Ce = class extends B {
1491
+ constructor(e, t = {}) {
1492
+ throw super(e, t), Error("Nexa's SSE client is browser-only (it relies on the native EventSource API). Node.js has no built-in EventSource. Use a polyfill (e.g. the \"eventsource\" package) and pass it via a custom implementation, or run this client in a browser environment.");
1434
1493
  }
1435
1494
  };
1436
- function ye(e, t = {}) {
1437
- return U() ? new ve(e, t) : new W(e, t);
1495
+ function we(e, t = {}) {
1496
+ return Se() ? new Ce(e, t) : new B(e, t);
1438
1497
  }
1439
1498
  //#endregion
1440
1499
  //#region src/realtime/plugin.ts
1441
- var be = class {
1500
+ var Te = class {
1442
1501
  name = "realtime";
1443
1502
  setup(e) {
1444
1503
  e.on("websocket:connect:start", (...t) => {
@@ -1462,35 +1521,37 @@ var be = class {
1462
1521
  });
1463
1522
  }
1464
1523
  };
1465
- function xe() {
1466
- return new be();
1524
+ function Ee() {
1525
+ return new Te();
1467
1526
  }
1468
1527
  //#endregion
1469
1528
  //#region src/dev-overlay/tracker.ts
1470
- var G = "nexa.devOverlay.config";
1471
- function K() {
1529
+ var V = "nexa.devOverlay.config";
1530
+ function H() {
1472
1531
  try {
1473
1532
  if (typeof localStorage > "u") return {};
1474
- let e = localStorage.getItem(G);
1533
+ let e = localStorage.getItem(V);
1475
1534
  return e ? JSON.parse(e) : {};
1476
1535
  } catch {
1477
1536
  return {};
1478
1537
  }
1479
1538
  }
1480
- function Se(e) {
1539
+ function De(e) {
1481
1540
  try {
1482
1541
  if (typeof localStorage > "u") return;
1483
- localStorage.setItem(G, JSON.stringify(e));
1542
+ localStorage.setItem(V, JSON.stringify(e));
1484
1543
  } catch {}
1485
1544
  }
1486
- var q = class {
1487
- history = [];
1545
+ var U = class {
1546
+ buffer = [];
1547
+ writeIndex = 0;
1548
+ count = 0;
1488
1549
  maxHistory;
1489
1550
  listeners = /* @__PURE__ */ new Set();
1490
1551
  startTime = Date.now();
1491
1552
  config;
1492
1553
  constructor(e = {}) {
1493
- this.maxHistory = e.maxHistory ?? 500, this.config = {
1554
+ this.maxHistory = Math.max(1, e.maxHistory ?? 500), this.buffer = Array(this.maxHistory), this.config = {
1494
1555
  enabled: e.enabled ?? !0,
1495
1556
  maxHistory: this.maxHistory,
1496
1557
  keyboardShortcut: e.keyboardShortcut ?? "ctrl+shift+n",
@@ -1510,29 +1571,34 @@ var q = class {
1510
1571
  id: this.generateId(),
1511
1572
  timestamp: Date.now()
1512
1573
  };
1513
- this.history.unshift(t), this.history.length > this.maxHistory && this.history.pop();
1574
+ this.buffer[this.writeIndex] = t, this.writeIndex = (this.writeIndex + 1) % this.maxHistory, this.count = Math.min(this.count + 1, this.maxHistory);
1514
1575
  for (let e of this.listeners) e(t);
1515
1576
  return t;
1516
1577
  }
1517
1578
  getHistory() {
1518
- return this.history;
1579
+ let e = [];
1580
+ for (let t = 0; t < this.count; t++) {
1581
+ let n = ((this.writeIndex - 1 - t) % this.maxHistory + this.maxHistory) % this.maxHistory;
1582
+ e.push(this.buffer[n]);
1583
+ }
1584
+ return e;
1519
1585
  }
1520
1586
  getMetrics() {
1521
- let e = this.history.map((e) => e.duration), t = (Date.now() - this.startTime) / 1e3;
1587
+ let e = this.getHistory(), t = e.map((e) => e.duration), n = (Date.now() - this.startTime) / 1e3;
1522
1588
  return {
1523
- totalRequests: this.history.length,
1524
- successfulRequests: this.history.filter((e) => e.ok).length,
1525
- failedRequests: this.history.filter((e) => !e.ok).length,
1526
- cachedRequests: this.history.filter((e) => e.cached).length,
1527
- avgDuration: e.length ? e.reduce((e, t) => e + t, 0) / e.length : 0,
1528
- maxDuration: e.length ? Math.max(...e) : 0,
1529
- minDuration: e.length ? Math.min(...e) : 0,
1530
- requestsPerSecond: t > 0 ? this.history.length / t : 0,
1531
- slowestRequests: [...this.history].sort((e, t) => t.duration - e.duration).slice(0, 5)
1589
+ totalRequests: e.length,
1590
+ successfulRequests: e.filter((e) => e.ok).length,
1591
+ failedRequests: e.filter((e) => !e.ok).length,
1592
+ cachedRequests: e.filter((e) => e.cached).length,
1593
+ avgDuration: t.length ? t.reduce((e, t) => e + t, 0) / t.length : 0,
1594
+ maxDuration: t.length ? Math.max(...t) : 0,
1595
+ minDuration: t.length ? Math.min(...t) : 0,
1596
+ requestsPerSecond: n > 0 ? e.length / n : 0,
1597
+ slowestRequests: e.sort((e, t) => t.duration - e.duration).slice(0, 5)
1532
1598
  };
1533
1599
  }
1534
1600
  clear() {
1535
- this.history = [], this.startTime = Date.now();
1601
+ this.buffer = Array(this.maxHistory), this.writeIndex = 0, this.count = 0, this.startTime = Date.now();
1536
1602
  }
1537
1603
  onChange(e) {
1538
1604
  return this.listeners.add(e), () => this.listeners.delete(e);
@@ -1544,16 +1610,23 @@ var q = class {
1544
1610
  this.config = {
1545
1611
  ...this.config,
1546
1612
  ...e
1547
- }, this.maxHistory = this.config.maxHistory;
1613
+ };
1614
+ let t = Math.max(1, this.config.maxHistory);
1615
+ t !== this.maxHistory && this.resizeHistory(t);
1548
1616
  try {
1549
- Se(this.config);
1617
+ De(this.config);
1550
1618
  } catch {}
1551
1619
  return this.config;
1552
1620
  }
1621
+ resizeHistory(e) {
1622
+ let t = this.getHistory().slice(0, e);
1623
+ this.maxHistory = e, this.buffer = Array(e), this.writeIndex = 0, this.count = 0;
1624
+ for (let e = t.length - 1; e >= 0; e--) this.buffer[this.writeIndex] = t[e], this.writeIndex = (this.writeIndex + 1) % this.maxHistory, this.count++;
1625
+ }
1553
1626
  generateId() {
1554
1627
  return `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
1555
1628
  }
1556
- }, J = {
1629
+ }, W = {
1557
1630
  gear: "<svg width=\"16\" height=\"16\" viewBox=\"0 0 48 48\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M 24 4 C 22.423103 4 20.902664 4.1994284 19.451172 4.5371094 A 1.50015 1.50015 0 0 0 18.300781 5.8359375 L 17.982422 8.7382812 C 17.878304 9.6893592 17.328913 10.530853 16.5 11.009766 C 15.672739 11.487724 14.66862 11.540667 13.792969 11.15625 L 13.791016 11.15625 L 11.125 9.9824219 A 1.50015 1.50015 0 0 0 9.4257812 10.330078 C 7.3532865 12.539588 5.7626807 15.215064 4.859375 18.201172 A 1.50015 1.50015 0 0 0 5.4082031 19.845703 L 7.7734375 21.580078 C 8.5457929 22.147918 9 23.042801 9 24 C 9 24.95771 8.5458041 25.853342 7.7734375 26.419922 L 5.4082031 28.152344 A 1.50015 1.50015 0 0 0 4.859375 29.796875 C 5.7625845 32.782665 7.3519262 35.460112 9.4257812 37.669922 A 1.50015 1.50015 0 0 0 11.125 38.015625 L 13.791016 36.841797 C 14.667094 36.456509 15.672169 36.511947 16.5 36.990234 C 17.328913 37.469147 17.878304 38.310641 17.982422 39.261719 L 18.300781 42.164062 A 1.50015 1.50015 0 0 0 19.449219 43.460938 C 20.901371 43.799844 22.423103 44 24 44 C 25.576897 44 27.097336 43.800572 28.548828 43.462891 A 1.50015 1.50015 0 0 0 29.699219 42.164062 L 30.017578 39.261719 C 30.121696 38.310641 30.671087 37.469147 31.5 36.990234 C 32.327261 36.512276 33.33138 36.45738 34.207031 36.841797 L 36.875 38.015625 A 1.50015 1.50015 0 0 0 38.574219 37.669922 C 40.646713 35.460412 42.237319 32.782983 43.140625 29.796875 A 1.50015 1.50015 0 0 0 42.591797 28.152344 L 40.226562 26.419922 C 39.454197 25.853342 39 24.95771 39 24 C 39 23.04229 39.454197 22.146658 40.226562 21.580078 L 42.591797 19.847656 A 1.50015 1.50015 0 0 0 43.140625 18.203125 C 42.237319 15.217017 40.646713 12.539588 38.574219 10.330078 A 1.50015 1.50015 0 0 0 36.875 9.984375 L 34.207031 11.158203 C 33.33138 11.54262 32.327261 11.487724 31.5 11.009766 C 30.671087 10.530853 30.121696 9.6893592 30.017578 8.7382812 L 29.699219 5.8359375 A 1.50015 1.50015 0 0 0 28.550781 4.5390625 C 27.098629 4.2001555 25.576897 4 24 4 z M 24 7 C 24.974302 7 25.90992 7.1748796 26.847656 7.3398438 L 27.035156 9.0644531 C 27.243038 10.963375 28.346913 12.652335 30 13.607422 C 31.654169 14.563134 33.668094 14.673009 35.416016 13.904297 L 37.001953 13.207031 C 38.219788 14.669402 39.183985 16.321182 39.857422 18.130859 L 38.451172 19.162109 C 36.911538 20.291529 36 22.08971 36 24 C 36 25.91029 36.911538 27.708471 38.451172 28.837891 L 39.857422 29.869141 C 39.183985 31.678818 38.219788 33.330598 37.001953 34.792969 L 35.416016 34.095703 C 33.668094 33.326991 31.654169 33.436866 30 34.392578 C 28.346913 35.347665 27.243038 37.036625 27.035156 38.935547 L 26.847656 40.660156 C 25.910002 40.82466 24.973817 41 24 41 C 23.025698 41 22.09008 40.82512 21.152344 40.660156 L 20.964844 38.935547 C 20.756962 37.036625 19.653087 35.347665 18 34.392578 C 16.345831 33.436866 14.331906 33.326991 12.583984 34.095703 L 10.998047 34.792969 C 9.7799772 33.330806 8.8159425 31.678964 8.1425781 29.869141 L 9.5488281 28.837891 C 11.088462 27.708471 12 25.91029 12 24 C 12 22.08971 11.087719 20.290363 9.5488281 19.160156 L 8.1425781 18.128906 C 8.8163325 16.318532 9.7814501 14.667839 11 13.205078 L 12.583984 13.902344 C 14.331906 14.671056 16.345831 14.563134 18 13.607422 C 19.653087 12.652335 20.756962 10.963375 20.964844 9.0644531 L 21.152344 7.3398438 C 22.089998 7.1753403 23.026183 7 24 7 z M 24 16 C 19.599487 16 16 19.59949 16 24 C 16 28.40051 19.599487 32 24 32 C 28.400513 32 32 28.40051 32 24 C 32 19.59949 28.400513 16 24 16 z M 24 19 C 26.779194 19 29 21.220808 29 24 C 29 26.779192 26.779194 29 24 29 C 21.220806 29 19 26.779192 19 24 C 19 21.220808 21.220806 19 24 19 z\"></path>\n</svg>",
1558
1631
  close: "<svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M18 6L6 18M6 6l12 12\"/></svg>",
1559
1632
  chevron: "<svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M9 18l6-6-6-6\"/></svg>",
@@ -1565,7 +1638,7 @@ var q = class {
1565
1638
  zap: "<svg width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polygon points=\"13 2 3 14 12 14 11 22 21 10 12 10 13 2\"/></svg>",
1566
1639
  download: "<svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v4\"/><polyline points=\"7 10 12 15 17 10\"/><line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"/></svg>",
1567
1640
  copy: "<svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"/><path d=\"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1\"/></svg>"
1568
- }, Y = {
1641
+ }, G = {
1569
1642
  bg: "#0b1120",
1570
1643
  bgElevated: "#111827",
1571
1644
  bgSurface: "#172033",
@@ -1590,13 +1663,13 @@ var q = class {
1590
1663
  put: "#fbbf24",
1591
1664
  patch: "#a78bfa",
1592
1665
  delete: "#fb7185"
1593
- }, Ce = `
1666
+ }, Oe = `
1594
1667
  #nexa-dev-overlay * { margin: 0; padding: 0; box-sizing: border-box; }
1595
1668
  #nexa-dev-overlay {
1596
1669
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
1597
- background: ${Y.bg};
1598
- color: ${Y.text};
1599
- border: 1px solid ${Y.border};
1670
+ background: ${G.bg};
1671
+ color: ${G.text};
1672
+ border: 1px solid ${G.border};
1600
1673
  border-radius: 16px;
1601
1674
  box-shadow: 0 28px 60px -24px rgba(2, 6, 23, 0.78), 0 0 0 1px rgba(148, 163, 184, 0.08);
1602
1675
  overflow: hidden;
@@ -1606,8 +1679,8 @@ var q = class {
1606
1679
  align-items: center;
1607
1680
  justify-content: space-between;
1608
1681
  padding: 16px 20px;
1609
- border-bottom: 1px solid ${Y.border};
1610
- background: ${Y.bgElevated};
1682
+ border-bottom: 1px solid ${G.border};
1683
+ background: ${G.bgElevated};
1611
1684
  }
1612
1685
  #nexa-dev-overlay .nexa-header-left {
1613
1686
  display: flex;
@@ -1620,7 +1693,7 @@ var q = class {
1620
1693
  display: flex;
1621
1694
  align-items: center;
1622
1695
  justify-content: center;
1623
- background: linear-gradient(135deg, ${Y.accentSoft}, rgba(255,255,255,0.02));
1696
+ background: linear-gradient(135deg, ${G.accentSoft}, rgba(255,255,255,0.02));
1624
1697
  border-radius: 8px;
1625
1698
  overflow: hidden;
1626
1699
  }
@@ -1642,20 +1715,20 @@ var q = class {
1642
1715
  background: transparent;
1643
1716
  border: none;
1644
1717
  border-radius: 8px;
1645
- color: ${Y.textMuted};
1718
+ color: ${G.textMuted};
1646
1719
  cursor: pointer;
1647
1720
  transition: all 0.15s;
1648
1721
  }
1649
1722
  #nexa-dev-overlay .nexa-icon-btn:hover {
1650
- background: ${Y.bgSurface};
1651
- color: ${Y.text};
1723
+ background: ${G.bgSurface};
1724
+ color: ${G.text};
1652
1725
  }
1653
1726
  #nexa-dev-overlay .nexa-metrics-bar {
1654
1727
  display: flex;
1655
1728
  gap: 4px;
1656
1729
  padding: 12px 16px;
1657
- background: ${Y.bg};
1658
- border-bottom: 1px solid ${Y.border};
1730
+ background: ${G.bg};
1731
+ border-bottom: 1px solid ${G.border};
1659
1732
  }
1660
1733
  #nexa-dev-overlay .nexa-metric {
1661
1734
  flex: 1;
@@ -1664,7 +1737,7 @@ var q = class {
1664
1737
  align-items: center;
1665
1738
  gap: 2px;
1666
1739
  padding: 8px 12px;
1667
- background: ${Y.bgSurface};
1740
+ background: ${G.bgSurface};
1668
1741
  border-radius: 10px;
1669
1742
  transition: all 0.2s;
1670
1743
  }
@@ -1675,19 +1748,19 @@ var q = class {
1675
1748
  font-size: 18px;
1676
1749
  font-weight: 700;
1677
1750
  letter-spacing: -0.03em;
1678
- color: ${Y.text};
1751
+ color: ${G.text};
1679
1752
  }
1680
- #nexa-dev-overlay .nexa-metric-ok .nexa-metric-value { color: ${Y.success}; }
1681
- #nexa-dev-overlay .nexa-metric-err .nexa-metric-value { color: ${Y.error}; }
1753
+ #nexa-dev-overlay .nexa-metric-ok .nexa-metric-value { color: ${G.success}; }
1754
+ #nexa-dev-overlay .nexa-metric-err .nexa-metric-value { color: ${G.error}; }
1682
1755
  #nexa-dev-overlay .nexa-metric-label {
1683
1756
  font-size: 11px;
1684
- color: ${Y.textDim};
1757
+ color: ${G.textDim};
1685
1758
  text-transform: uppercase;
1686
1759
  letter-spacing: 0.05em;
1687
1760
  }
1688
1761
  #nexa-dev-overlay .nexa-search {
1689
1762
  padding: 12px 16px;
1690
- border-bottom: 1px solid ${Y.border};
1763
+ border-bottom: 1px solid ${G.border};
1691
1764
  position: relative;
1692
1765
  }
1693
1766
  #nexa-dev-overlay .nexa-search-icon {
@@ -1695,29 +1768,29 @@ var q = class {
1695
1768
  left: 28px;
1696
1769
  top: 50%;
1697
1770
  transform: translateY(-50%);
1698
- color: ${Y.textDim};
1771
+ color: ${G.textDim};
1699
1772
  }
1700
1773
  #nexa-dev-overlay .nexa-search-input {
1701
1774
  width: 100%;
1702
1775
  padding: 10px 12px 10px 38px;
1703
- background: ${Y.bg};
1704
- border: 1px solid ${Y.border};
1776
+ background: ${G.bg};
1777
+ border: 1px solid ${G.border};
1705
1778
  border-radius: 10px;
1706
- color: ${Y.text};
1779
+ color: ${G.text};
1707
1780
  font-size: 13px;
1708
1781
  outline: none;
1709
1782
  transition: all 0.15s;
1710
1783
  }
1711
1784
  #nexa-dev-overlay .nexa-search-input:focus {
1712
- border-color: ${Y.accent};
1713
- box-shadow: 0 0 0 3px ${Y.accentSoft};
1785
+ border-color: ${G.accent};
1786
+ box-shadow: 0 0 0 3px ${G.accentSoft};
1714
1787
  }
1715
- #nexa-dev-overlay .nexa-search-input::placeholder { color: ${Y.textDim}; }
1788
+ #nexa-dev-overlay .nexa-search-input::placeholder { color: ${G.textDim}; }
1716
1789
  #nexa-dev-overlay .nexa-filters {
1717
1790
  display: flex;
1718
1791
  gap: 6px;
1719
1792
  padding: 12px 16px 12px 16px;
1720
- border-bottom: 1px solid ${Y.border};
1793
+ border-bottom: 1px solid ${G.border};
1721
1794
  overflow-x: auto;
1722
1795
  scrollbar-width: none;
1723
1796
  min-height: 50px;
@@ -1725,27 +1798,27 @@ var q = class {
1725
1798
  #nexa-dev-overlay .nexa-filters::-webkit-scrollbar { display: none; }
1726
1799
  #nexa-dev-overlay .nexa-filter-chip {
1727
1800
  padding: 4px 10px;
1728
- background: ${Y.bgSurface};
1729
- border: 1px solid ${Y.border};
1801
+ background: ${G.bgSurface};
1802
+ border: 1px solid ${G.border};
1730
1803
  border-radius: 20px;
1731
- color: ${Y.textDim};
1804
+ color: ${G.textDim};
1732
1805
  font-size: 11px;
1733
1806
  font-weight: 600;
1734
1807
  white-space: nowrap;
1735
1808
  cursor: pointer;
1736
1809
  transition: all 0.15s;
1737
1810
  }
1738
- #nexa-dev-overlay .nexa-filter-chip:hover { border-color: ${Y.borderFocus}; color: ${Y.textMuted}; }
1811
+ #nexa-dev-overlay .nexa-filter-chip:hover { border-color: ${G.borderFocus}; color: ${G.textMuted}; }
1739
1812
  #nexa-dev-overlay .nexa-filter-chip-active {
1740
- background: ${Y.accentSoft};
1741
- border-color: ${Y.accent};
1742
- color: ${Y.accent};
1813
+ background: ${G.accentSoft};
1814
+ border-color: ${G.accent};
1815
+ color: ${G.accent};
1743
1816
  }
1744
1817
  #nexa-dev-overlay .nexa-tabs {
1745
1818
  display: flex;
1746
1819
  gap: 4px;
1747
1820
  padding: 8px 16px;
1748
- border-bottom: 1px solid ${Y.border};
1821
+ border-bottom: 1px solid ${G.border};
1749
1822
  }
1750
1823
  #nexa-dev-overlay .nexa-tab {
1751
1824
  display: flex;
@@ -1755,14 +1828,14 @@ var q = class {
1755
1828
  background: transparent;
1756
1829
  border: none;
1757
1830
  border-radius: 8px;
1758
- color: ${Y.textMuted};
1831
+ color: ${G.textMuted};
1759
1832
  font-size: 13px;
1760
1833
  font-weight: 500;
1761
1834
  cursor: pointer;
1762
1835
  transition: all 0.15s;
1763
1836
  }
1764
- #nexa-dev-overlay .nexa-tab:hover { color: ${Y.text}; background: ${Y.bgElevated}; }
1765
- #nexa-dev-overlay .nexa-tab-active { color: ${Y.text}; background: ${Y.accent} !important; }
1837
+ #nexa-dev-overlay .nexa-tab:hover { color: ${G.text}; background: ${G.bgElevated}; }
1838
+ #nexa-dev-overlay .nexa-tab-active { color: ${G.text}; background: ${G.accent} !important; }
1766
1839
  #nexa-dev-overlay .nexa-tab-count {
1767
1840
  font-size: 11px;
1768
1841
  padding: 2px 6px;
@@ -1783,7 +1856,7 @@ var q = class {
1783
1856
  align-items: center;
1784
1857
  justify-content: space-between;
1785
1858
  padding: 12px 14px;
1786
- background: ${Y.bgSurface};
1859
+ background: ${G.bgSurface};
1787
1860
  border: 1px solid transparent;
1788
1861
  border-radius: 12px;
1789
1862
  cursor: pointer;
@@ -1794,7 +1867,7 @@ var q = class {
1794
1867
  @keyframes nexaFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
1795
1868
  #nexa-dev-overlay .nexa-request-item:hover {
1796
1869
  background: rgba(23, 32, 51, 0.92);
1797
- border-color: ${Y.borderFocus};
1870
+ border-color: ${G.borderFocus};
1798
1871
  transform: translateX(2px);
1799
1872
  }
1800
1873
  #nexa-dev-overlay .nexa-req-left {
@@ -1810,11 +1883,11 @@ var q = class {
1810
1883
  text-transform: uppercase;
1811
1884
  letter-spacing: 0.03em;
1812
1885
  }
1813
- #nexa-dev-overlay .nexa-method-get { background: ${Y.successBg}; color: ${Y.get}; }
1814
- #nexa-dev-overlay .nexa-method-post { background: ${Y.accentSoft}; color: ${Y.post}; }
1815
- #nexa-dev-overlay .nexa-method-put { background: ${Y.warningBg}; color: ${Y.put}; }
1816
- #nexa-dev-overlay .nexa-method-patch { background: ${Y.infoBg}; color: ${Y.patch}; }
1817
- #nexa-dev-overlay .nexa-method-delete { background: ${Y.errorBg}; color: ${Y.delete}; }
1886
+ #nexa-dev-overlay .nexa-method-get { background: ${G.successBg}; color: ${G.get}; }
1887
+ #nexa-dev-overlay .nexa-method-post { background: ${G.accentSoft}; color: ${G.post}; }
1888
+ #nexa-dev-overlay .nexa-method-put { background: ${G.warningBg}; color: ${G.put}; }
1889
+ #nexa-dev-overlay .nexa-method-patch { background: ${G.infoBg}; color: ${G.patch}; }
1890
+ #nexa-dev-overlay .nexa-method-delete { background: ${G.errorBg}; color: ${G.delete}; }
1818
1891
  #nexa-dev-overlay .nexa-status {
1819
1892
  font-size: 12px;
1820
1893
  font-weight: 600;
@@ -1823,11 +1896,11 @@ var q = class {
1823
1896
  min-width: 36px;
1824
1897
  text-align: center;
1825
1898
  }
1826
- #nexa-dev-overlay .nexa-ok { background: ${Y.successBg}; color: ${Y.success}; }
1827
- #nexa-dev-overlay .nexa-err { background: ${Y.errorBg}; color: ${Y.error}; }
1899
+ #nexa-dev-overlay .nexa-ok { background: ${G.successBg}; color: ${G.success}; }
1900
+ #nexa-dev-overlay .nexa-err { background: ${G.errorBg}; color: ${G.error}; }
1828
1901
  #nexa-dev-overlay .nexa-url {
1829
1902
  font-size: 13px;
1830
- color: ${Y.textMuted};
1903
+ color: ${G.textMuted};
1831
1904
  max-width: 180px;
1832
1905
  overflow: hidden;
1833
1906
  text-overflow: ellipsis;
@@ -1846,15 +1919,15 @@ var q = class {
1846
1919
  text-transform: uppercase;
1847
1920
  letter-spacing: 0.03em;
1848
1921
  }
1849
- #nexa-dev-overlay .nexa-badge-cache { background: ${Y.infoBg}; color: ${Y.info}; }
1850
- #nexa-dev-overlay .nexa-badge-retry { background: ${Y.warningBg}; color: ${Y.warning}; }
1922
+ #nexa-dev-overlay .nexa-badge-cache { background: ${G.infoBg}; color: ${G.info}; }
1923
+ #nexa-dev-overlay .nexa-badge-retry { background: ${G.warningBg}; color: ${G.warning}; }
1851
1924
  #nexa-dev-overlay .nexa-duration {
1852
1925
  font-size: 12px;
1853
1926
  font-weight: 600;
1854
- color: ${Y.textDim};
1927
+ color: ${G.textDim};
1855
1928
  font-variant-numeric: tabular-nums;
1856
1929
  }
1857
- #nexa-dev-overlay .nexa-slow { color: ${Y.warning}; }
1930
+ #nexa-dev-overlay .nexa-slow { color: ${G.warning}; }
1858
1931
  #nexa-dev-overlay .nexa-empty {
1859
1932
  display: flex;
1860
1933
  flex-direction: column;
@@ -1862,11 +1935,11 @@ var q = class {
1862
1935
  justify-content: center;
1863
1936
  padding: 48px 24px;
1864
1937
  text-align: center;
1865
- color: ${Y.textDim};
1938
+ color: ${G.textDim};
1866
1939
  }
1867
1940
  #nexa-dev-overlay .nexa-empty svg { margin-bottom: 16px; opacity: 0.4; }
1868
- #nexa-dev-overlay .nexa-empty p { font-size: 14px; color: ${Y.textMuted}; margin-bottom: 4px; }
1869
- #nexa-dev-overlay .nexa-empty span { font-size: 12px; color: ${Y.textDim}; }
1941
+ #nexa-dev-overlay .nexa-empty p { font-size: 14px; color: ${G.textMuted}; margin-bottom: 4px; }
1942
+ #nexa-dev-overlay .nexa-empty span { font-size: 12px; color: ${G.textDim}; }
1870
1943
  #nexa-dev-overlay .nexa-detail {
1871
1944
  flex-direction: column;
1872
1945
  padding: 16px;
@@ -1890,23 +1963,23 @@ var q = class {
1890
1963
  align-items: center;
1891
1964
  gap: 6px;
1892
1965
  padding: 8px 14px;
1893
- background: ${Y.bgSurface};
1894
- border: 1px solid ${Y.border};
1966
+ background: ${G.bgSurface};
1967
+ border: 1px solid ${G.border};
1895
1968
  border-radius: 8px;
1896
- color: ${Y.textMuted};
1969
+ color: ${G.textMuted};
1897
1970
  font-size: 13px;
1898
1971
  font-weight: 500;
1899
1972
  cursor: pointer;
1900
1973
  transition: all 0.15s;
1901
1974
  }
1902
- #nexa-dev-overlay .nexa-btn:hover { background: rgba(53, 80, 122, 0.24); color: ${Y.text}; }
1903
- #nexa-dev-overlay .nexa-btn-retry { background: ${Y.successBg}; border-color: transparent; color: ${Y.success}; }
1904
- #nexa-dev-overlay .nexa-btn-retry:hover { background: ${Y.success}; color: #052e26; }
1905
- #nexa-dev-overlay .nexa-btn-copy { background: ${Y.accentSoft}; border-color: transparent; color: ${Y.accent}; }
1906
- #nexa-dev-overlay .nexa-btn-copy:hover { background: ${Y.accent}; color: #ffffff; }
1975
+ #nexa-dev-overlay .nexa-btn:hover { background: rgba(53, 80, 122, 0.24); color: ${G.text}; }
1976
+ #nexa-dev-overlay .nexa-btn-retry { background: ${G.successBg}; border-color: transparent; color: ${G.success}; }
1977
+ #nexa-dev-overlay .nexa-btn-retry:hover { background: ${G.success}; color: #052e26; }
1978
+ #nexa-dev-overlay .nexa-btn-copy { background: ${G.accentSoft}; border-color: transparent; color: ${G.accent}; }
1979
+ #nexa-dev-overlay .nexa-btn-copy:hover { background: ${G.accent}; color: #ffffff; }
1907
1980
  #nexa-dev-overlay .nexa-card {
1908
- background: ${Y.bgSurface};
1909
- border: 1px solid ${Y.border};
1981
+ background: ${G.bgSurface};
1982
+ border: 1px solid ${G.border};
1910
1983
  border-radius: 12px;
1911
1984
  padding: 16px;
1912
1985
  margin-bottom: 12px;
@@ -1914,7 +1987,7 @@ var q = class {
1914
1987
  #nexa-dev-overlay .nexa-card h3 {
1915
1988
  font-size: 12px;
1916
1989
  font-weight: 600;
1917
- color: ${Y.textDim};
1990
+ color: ${G.textDim};
1918
1991
  text-transform: uppercase;
1919
1992
  letter-spacing: 0.05em;
1920
1993
  margin-bottom: 12px;
@@ -1924,11 +1997,11 @@ var q = class {
1924
1997
  bottom: 24px;
1925
1998
  left: 50%;
1926
1999
  transform: translateX(-50%) translateY(20px);
1927
- background: ${Y.bgElevated};
1928
- color: ${Y.text};
2000
+ background: ${G.bgElevated};
2001
+ color: ${G.text};
1929
2002
  padding: 10px 18px;
1930
2003
  border-radius: 12px;
1931
- border: 1px solid ${Y.borderFocus};
2004
+ border: 1px solid ${G.borderFocus};
1932
2005
  font-size: 13px;
1933
2006
  font-weight: 500;
1934
2007
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
@@ -1947,20 +2020,20 @@ var q = class {
1947
2020
  align-items: center;
1948
2021
  padding: 6px 0;
1949
2022
  font-size: 13px;
1950
- border-bottom: 1px solid ${Y.border};
2023
+ border-bottom: 1px solid ${G.border};
1951
2024
  }
1952
2025
  #nexa-dev-overlay .nexa-row:last-child { border-bottom: none; }
1953
- #nexa-dev-overlay .nexa-row span { color: ${Y.textMuted}; }
1954
- #nexa-dev-overlay .nexa-row strong { color: ${Y.text}; font-weight: 500; font-variant-numeric: tabular-nums; }
1955
- #nexa-dev-overlay .nexa-row .nexa-ok { color: ${Y.success}; }
1956
- #nexa-dev-overlay .nexa-row .nexa-err { color: ${Y.error}; }
2026
+ #nexa-dev-overlay .nexa-row span { color: ${G.textMuted}; }
2027
+ #nexa-dev-overlay .nexa-row strong { color: ${G.text}; font-weight: 500; font-variant-numeric: tabular-nums; }
2028
+ #nexa-dev-overlay .nexa-row .nexa-ok { color: ${G.success}; }
2029
+ #nexa-dev-overlay .nexa-row .nexa-err { color: ${G.error}; }
1957
2030
  #nexa-dev-overlay .nexa-code {
1958
- background: ${Y.bg};
2031
+ background: ${G.bg};
1959
2032
  border-radius: 8px;
1960
2033
  padding: 12px;
1961
2034
  font-size: 11px;
1962
2035
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
1963
- color: ${Y.textMuted};
2036
+ color: ${G.textMuted};
1964
2037
  overflow-x: auto;
1965
2038
  white-space: pre;
1966
2039
  max-height: 200px;
@@ -1969,7 +2042,7 @@ var q = class {
1969
2042
  #nexa-dev-overlay .nexa-url-full {
1970
2043
  font-size: 12px;
1971
2044
  word-break: break-all;
1972
- color: ${Y.accent};
2045
+ color: ${G.accent};
1973
2046
  }
1974
2047
  #nexa-dev-overlay .nexa-metrics-content {
1975
2048
  padding: 16px;
@@ -1989,14 +2062,14 @@ var q = class {
1989
2062
  gap: 12px;
1990
2063
  padding: 16px;
1991
2064
  border-radius: 12px;
1992
- background: ${Y.bgElevated};
1993
- border: 1px solid ${Y.border};
2065
+ background: ${G.bgElevated};
2066
+ border: 1px solid ${G.border};
1994
2067
  box-shadow: 0 28px 60px -24px rgba(2, 6, 23, 0.76);
1995
2068
  overflow: auto;
1996
2069
  }
1997
2070
  #nexa-dev-overlay .nexa-settings-row { display:flex;align-items:center;gap:8px;margin-bottom:8px }
1998
- #nexa-dev-overlay .nexa-settings-row label{font-size:13px;color:${Y.textDim};min-width:70px}
1999
- #nexa-dev-overlay .nexa-settings-row select{padding:6px 8px;border-radius:8px;border:1px solid ${Y.border};background:${Y.bg};color:${Y.text}}
2071
+ #nexa-dev-overlay .nexa-settings-row label{font-size:13px;color:${G.textDim};min-width:70px}
2072
+ #nexa-dev-overlay .nexa-settings-row select{padding:6px 8px;border-radius:8px;border:1px solid ${G.border};background:${G.bg};color:${G.text}}
2000
2073
 
2001
2074
  #nexa-dev-overlay.nexa-theme-light {
2002
2075
  background: #f8fbff;
@@ -2095,7 +2168,9 @@ var q = class {
2095
2168
  display: none !important;
2096
2169
  }
2097
2170
  `;
2098
- function X() {
2171
+ //#endregion
2172
+ //#region src/dev-overlay/env.ts
2173
+ function K() {
2099
2174
  try {
2100
2175
  if (typeof process < "u") {
2101
2176
  let e = process;
@@ -2110,7 +2185,114 @@ function X() {
2110
2185
  } catch {}
2111
2186
  return !1;
2112
2187
  }
2113
- var we = class {
2188
+ //#endregion
2189
+ //#region src/dev-overlay/format.ts
2190
+ function q(e) {
2191
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
2192
+ }
2193
+ function J(e, t = 35) {
2194
+ try {
2195
+ let t = new URL(e);
2196
+ return t.pathname + (t.search || "");
2197
+ } catch {
2198
+ return e.length > t ? e.slice(0, t) + "..." : e;
2199
+ }
2200
+ }
2201
+ function Y(e) {
2202
+ try {
2203
+ return JSON.stringify(e, null, 2);
2204
+ } catch {
2205
+ return String(e);
2206
+ }
2207
+ }
2208
+ //#endregion
2209
+ //#region src/dev-overlay/render.ts
2210
+ function ke(e, t, n) {
2211
+ let r = e;
2212
+ return t === "err" ? r = r.filter((e) => !e.ok) : t === "xhr" ? r = r.filter((e) => e.headers["content-type"] && e.headers["content-type"].includes("json") || e.responseHeaders && e.responseHeaders["content-type"] && e.responseHeaders["content-type"].includes("json")) : t === "slow" && (r = r.filter((e) => e.duration > 500)), n && (r = r.filter((e) => e.url.toLowerCase().includes(n) || e.method.toLowerCase().includes(n) || String(e.status).includes(n))), r;
2213
+ }
2214
+ function X(e, t) {
2215
+ return e.length === 0 ? `
2216
+ <div class="nexa-empty">
2217
+ <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
2218
+ <circle cx="12" cy="12" r="10"/><path d="M8 12h8M12 8v8"/>
2219
+ </svg>
2220
+ <p>${t ? "No matching requests" : "No requests yet"}</p>
2221
+ <span>${t ? "Try a different search term" : "Make a request to see it here"}</span>
2222
+ </div>` : e.map((e, t) => `
2223
+ <div class="nexa-request-item" data-id="${e.id}" style="animation-delay: ${Math.min(t * 20, 300)}ms">
2224
+ <div class="nexa-req-left">
2225
+ <span class="nexa-method nexa-method-${e.method.toLowerCase()}">${e.method}</span>
2226
+ <span class="nexa-status ${e.ok ? "nexa-ok" : "nexa-err"}">${e.status || "ERR"}</span>
2227
+ <span class="nexa-url" title="${q(e.url)}">${q(J(e.url))}</span>
2228
+ </div>
2229
+ <div class="nexa-req-right">
2230
+ ${e.cached ? "<span class=\"nexa-badge nexa-badge-cache\">Cache</span>" : ""}
2231
+ ${e.retryCount > 0 ? `<span class="nexa-badge nexa-badge-retry">${e.retryCount}R</span>` : ""}
2232
+ <span class="nexa-duration ${e.duration > 500 ? "nexa-slow" : ""}">${e.duration.toFixed(0)}ms</span>
2233
+ ${W.chevron}
2234
+ </div>
2235
+ </div>
2236
+ `).join("");
2237
+ }
2238
+ function Ae(e) {
2239
+ let t = e.totalRequests > 0 ? (e.successfulRequests / e.totalRequests * 100).toFixed(1) : "0";
2240
+ return `
2241
+ <div class="nexa-card">
2242
+ <h3>Overview</h3>
2243
+ <div class="nexa-row"><span>Total Requests</span><strong>${e.totalRequests}</strong></div>
2244
+ <div class="nexa-row"><span>Successful</span><strong class="nexa-ok">${e.successfulRequests}</strong></div>
2245
+ <div class="nexa-row"><span>Failed</span><strong class="nexa-err">${e.failedRequests}</strong></div>
2246
+ <div class="nexa-row"><span>Cached</span><strong>${e.cachedRequests}</strong></div>
2247
+ <div class="nexa-row"><span>Success Rate</span><strong>${t}%</strong></div>
2248
+ </div>
2249
+ <div class="nexa-card">
2250
+ <h3>Performance</h3>
2251
+ <div class="nexa-row"><span>Average</span><strong>${e.avgDuration.toFixed(1)}ms</strong></div>
2252
+ <div class="nexa-row"><span>Fastest</span><strong class="nexa-ok">${e.minDuration.toFixed(1)}ms</strong></div>
2253
+ <div class="nexa-row"><span>Slowest</span><strong class="nexa-err">${e.maxDuration.toFixed(1)}ms</strong></div>
2254
+ <div class="nexa-row"><span>Throughput</span><strong>${e.requestsPerSecond.toFixed(2)} req/s</strong></div>
2255
+ </div>
2256
+ ${e.slowestRequests.length > 0 ? `
2257
+ <div class="nexa-card">
2258
+ <h3>Slowest Requests</h3>
2259
+ ${e.slowestRequests.map((e) => `
2260
+ <div class="nexa-row nexa-slow-req">
2261
+ <span><span class="nexa-method nexa-method-${e.method.toLowerCase()}" style="font-size:10px;padding:2px 5px;">${e.method}</span> ${q(J(e.url, 25))}</span>
2262
+ <strong class="nexa-err">${e.duration.toFixed(0)}ms</strong>
2263
+ </div>
2264
+ `).join("")}
2265
+ </div>
2266
+ ` : ""}`;
2267
+ }
2268
+ function je(e) {
2269
+ return `
2270
+ <div class="nexa-card">
2271
+ <h3>Request</h3>
2272
+ <div class="nexa-row"><span>Method</span><strong style="color:${e.method === "GET" ? G.get : e.method === "POST" ? G.post : e.method === "DELETE" ? G.delete : G.warning}">${e.method}</strong></div>
2273
+ <div class="nexa-row"><span>URL</span><span class="nexa-url-full">${q(e.url)}</span></div>
2274
+ <div class="nexa-row"><span>Status</span><strong class="${e.ok ? "nexa-ok" : "nexa-err"}">${e.status || "N/A"}</strong></div>
2275
+ <div class="nexa-row"><span>Duration</span><strong>${e.duration.toFixed(1)}ms</strong></div>
2276
+ <div class="nexa-row"><span>Cached</span><strong>${e.cached ? "Yes" : "No"}</strong></div>
2277
+ <div class="nexa-row"><span>Retries</span><strong>${e.retryCount}</strong></div>
2278
+ <div class="nexa-row"><span>Timestamp</span><strong>${new Date(e.timestamp).toLocaleTimeString()}</strong></div>
2279
+ </div>
2280
+ ${e.body === void 0 ? "" : `
2281
+ <div class="nexa-card">
2282
+ <h3>Request Body</h3>
2283
+ <pre class="nexa-code">${q(Y(e.body))}</pre>
2284
+ </div>
2285
+ `}
2286
+ ${Object.keys(e.headers).length > 0 ? `
2287
+ <div class="nexa-card">
2288
+ <h3>Headers</h3>
2289
+ <pre class="nexa-code">${q(Y(e.headers))}</pre>
2290
+ </div>
2291
+ ` : ""}`;
2292
+ }
2293
+ //#endregion
2294
+ //#region src/dev-overlay/overlay.ts
2295
+ var Me = class {
2114
2296
  panel = null;
2115
2297
  floatingIcon = null;
2116
2298
  tracker;
@@ -2133,7 +2315,7 @@ var we = class {
2133
2315
  hide() {
2134
2316
  this.panel && (this.panel.style.transition = "all 0.15s ease-out", this.panel.style.opacity = "0", this.panel.style.transform = "scale(0.96) translateY(8px)", setTimeout(() => {
2135
2317
  this.panel && (this.panel.style.display = "none");
2136
- }, 150), this.visible = !1, this.config.enabled && (!this.config.devOnly || X()) && this.showFloatingIcon());
2318
+ }, 150), this.visible = !1, this.config.enabled && (!this.config.devOnly || K()) && this.showFloatingIcon());
2137
2319
  }
2138
2320
  toggle() {
2139
2321
  this.visible ? this.hide() : this.show();
@@ -2172,7 +2354,7 @@ var we = class {
2172
2354
  display: flex;
2173
2355
  flex-direction: column;
2174
2356
  overflow: hidden;
2175
- `, this.panel.innerHTML = `<style>${Ce}</style>
2357
+ `, this.panel.innerHTML = `<style>${Oe}</style>
2176
2358
 
2177
2359
  <div class="nexa-header">
2178
2360
  <div class="nexa-header-left">
@@ -2182,10 +2364,10 @@ var we = class {
2182
2364
  <span class="nexa-title">${i}</span>
2183
2365
  </div>
2184
2366
  <div class="nexa-header-actions">
2185
- <button class="nexa-icon-btn nexa-btn-export" title="Export history (JSON)">${J.download}</button>
2186
- <button class="nexa-icon-btn nexa-btn-settings" title="Settings">${J.gear}</button>
2187
- <button class="nexa-icon-btn nexa-btn-clear" title="Clear history">${J.clear}</button>
2188
- <button class="nexa-icon-btn nexa-btn-close" title="Close (Esc)">${J.close}</button>
2367
+ <button class="nexa-icon-btn nexa-btn-export" title="Export history (JSON)">${W.download}</button>
2368
+ <button class="nexa-icon-btn nexa-btn-settings" title="Settings">${W.gear}</button>
2369
+ <button class="nexa-icon-btn nexa-btn-clear" title="Clear history">${W.clear}</button>
2370
+ <button class="nexa-icon-btn nexa-btn-close" title="Close (Esc)">${W.close}</button>
2189
2371
  </div>
2190
2372
  </div>
2191
2373
 
@@ -2223,7 +2405,7 @@ var we = class {
2223
2405
  </div>
2224
2406
 
2225
2407
  <div class="nexa-search">
2226
- <span class="nexa-search-icon">${J.search}</span>
2408
+ <span class="nexa-search-icon">${W.search}</span>
2227
2409
  <input type="text" class="nexa-search-input" placeholder="Filter by URL, method, or status..." />
2228
2410
  </div>
2229
2411
 
@@ -2246,16 +2428,16 @@ var we = class {
2246
2428
 
2247
2429
  <div class="nexa-detail" style="display:none">
2248
2430
  <div class="nexa-detail-header">
2249
- <button class="nexa-btn nexa-btn-back">${J.back} Back</button>
2431
+ <button class="nexa-btn nexa-btn-back">${W.back} Back</button>
2250
2432
  <div class="nexa-btn-group">
2251
- <button class="nexa-btn nexa-btn-copy">${J.copy} Copy as fetch</button>
2252
- <button class="nexa-btn nexa-btn-retry">${J.retry} Retry</button>
2433
+ <button class="nexa-btn nexa-btn-copy">${W.copy} Copy as fetch</button>
2434
+ <button class="nexa-btn nexa-btn-retry">${W.retry} Retry</button>
2253
2435
  </div>
2254
2436
  </div>
2255
2437
  <div class="nexa-detail-body"></div>
2256
2438
  </div>
2257
2439
  `, document.body.appendChild(this.panel), this.config.theme === "light" ? this.panel.classList.add("nexa-theme-light") : this.panel.classList.remove("nexa-theme-light"), this.bindEvents(), this.removeTrackerListener = this.tracker.onChange(() => this.render());
2258
- let o = !this.config.devOnly || X();
2440
+ let o = !this.config.devOnly || K();
2259
2441
  this.config.enabled && o && this.createFloatingIcon(), this.updateHeaderActionsVisibility(), this.hide(), this.globalKeyboardHandler = (e) => {
2260
2442
  if (e.key === "Escape" && this.visible) {
2261
2443
  this.hide();
@@ -2312,33 +2494,8 @@ var we = class {
2312
2494
  renderRequestList() {
2313
2495
  let e = this.panel?.querySelector(".nexa-request-list");
2314
2496
  if (!e) return;
2315
- let t = this.tracker.getHistory();
2316
- if (this.filterType === "err" ? t = t.filter((e) => !e.ok) : this.filterType === "xhr" ? t = t.filter((e) => e.headers["content-type"] && e.headers["content-type"].includes("json") || e.responseHeaders && e.responseHeaders["content-type"] && e.responseHeaders["content-type"].includes("json")) : this.filterType === "slow" && (t = t.filter((e) => e.duration > 500)), this.searchQuery && (t = t.filter((e) => e.url.toLowerCase().includes(this.searchQuery) || e.method.toLowerCase().includes(this.searchQuery) || String(e.status).includes(this.searchQuery))), t.length === 0) {
2317
- e.innerHTML = `
2318
- <div class="nexa-empty">
2319
- <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
2320
- <circle cx="12" cy="12" r="10"/><path d="M8 12h8M12 8v8"/>
2321
- </svg>
2322
- <p>${this.searchQuery ? "No matching requests" : "No requests yet"}</p>
2323
- <span>${this.searchQuery ? "Try a different search term" : "Make a request to see it here"}</span>
2324
- </div>`;
2325
- return;
2326
- }
2327
- e.innerHTML = t.map((e, t) => `
2328
- <div class="nexa-request-item" data-id="${e.id}" style="animation-delay: ${Math.min(t * 20, 300)}ms">
2329
- <div class="nexa-req-left">
2330
- <span class="nexa-method nexa-method-${e.method.toLowerCase()}">${e.method}</span>
2331
- <span class="nexa-status ${e.ok ? "nexa-ok" : "nexa-err"}">${e.status || "ERR"}</span>
2332
- <span class="nexa-url" title="${e.url}">${this.truncateUrl(e.url)}</span>
2333
- </div>
2334
- <div class="nexa-req-right">
2335
- ${e.cached ? "<span class=\"nexa-badge nexa-badge-cache\">Cache</span>" : ""}
2336
- ${e.retryCount > 0 ? `<span class="nexa-badge nexa-badge-retry">${e.retryCount}R</span>` : ""}
2337
- <span class="nexa-duration ${e.duration > 500 ? "nexa-slow" : ""}">${e.duration.toFixed(0)}ms</span>
2338
- ${J.chevron}
2339
- </div>
2340
- </div>
2341
- `).join(""), e.querySelectorAll(".nexa-request-item").forEach((e) => {
2497
+ let t = ke(this.tracker.getHistory(), this.filterType, this.searchQuery);
2498
+ e.innerHTML = X(t, this.searchQuery), e.querySelectorAll(".nexa-request-item").forEach((e) => {
2342
2499
  e.addEventListener("click", () => {
2343
2500
  let n = e.dataset.id, r = t.find((e) => e.id === n);
2344
2501
  r && this.showDetail(r);
@@ -2346,63 +2503,13 @@ var we = class {
2346
2503
  });
2347
2504
  }
2348
2505
  renderMetrics() {
2349
- let e = this.tracker.getMetrics(), t = this.panel?.querySelector(".nexa-metrics-content");
2350
- if (!t) return;
2351
- let n = e.totalRequests > 0 ? (e.successfulRequests / e.totalRequests * 100).toFixed(1) : "0";
2352
- t.innerHTML = `
2353
- <div class="nexa-card">
2354
- <h3>Overview</h3>
2355
- <div class="nexa-row"><span>Total Requests</span><strong>${e.totalRequests}</strong></div>
2356
- <div class="nexa-row"><span>Successful</span><strong class="nexa-ok">${e.successfulRequests}</strong></div>
2357
- <div class="nexa-row"><span>Failed</span><strong class="nexa-err">${e.failedRequests}</strong></div>
2358
- <div class="nexa-row"><span>Cached</span><strong>${e.cachedRequests}</strong></div>
2359
- <div class="nexa-row"><span>Success Rate</span><strong>${n}%</strong></div>
2360
- </div>
2361
- <div class="nexa-card">
2362
- <h3>Performance</h3>
2363
- <div class="nexa-row"><span>Average</span><strong>${e.avgDuration.toFixed(1)}ms</strong></div>
2364
- <div class="nexa-row"><span>Fastest</span><strong class="nexa-ok">${e.minDuration.toFixed(1)}ms</strong></div>
2365
- <div class="nexa-row"><span>Slowest</span><strong class="nexa-err">${e.maxDuration.toFixed(1)}ms</strong></div>
2366
- <div class="nexa-row"><span>Throughput</span><strong>${e.requestsPerSecond.toFixed(2)} req/s</strong></div>
2367
- </div>
2368
- ${e.slowestRequests.length > 0 ? `
2369
- <div class="nexa-card">
2370
- <h3>Slowest Requests</h3>
2371
- ${e.slowestRequests.map((e) => `
2372
- <div class="nexa-row nexa-slow-req">
2373
- <span><span class="nexa-method nexa-method-${e.method.toLowerCase()}" style="font-size:10px;padding:2px 5px;">${e.method}</span> ${this.truncateUrl(e.url, 25)}</span>
2374
- <strong class="nexa-err">${e.duration.toFixed(0)}ms</strong>
2375
- </div>
2376
- `).join("")}
2377
- </div>
2378
- ` : ""}`;
2506
+ let e = this.panel?.querySelector(".nexa-metrics-content");
2507
+ e && (e.innerHTML = Ae(this.tracker.getMetrics()));
2379
2508
  }
2380
2509
  showDetail(e) {
2381
2510
  if (this.selectedRequest = e, !this.panel) return;
2382
2511
  let t = this.panel.querySelector(".nexa-body"), n = this.panel.querySelector(".nexa-detail"), r = this.panel.querySelector(".nexa-detail-body");
2383
- !t || !n || !r || (this.panel.classList.add("nexa-view-detail"), t.style.display = "none", n.style.display = "flex", r.innerHTML = `
2384
- <div class="nexa-card">
2385
- <h3>Request</h3>
2386
- <div class="nexa-row"><span>Method</span><strong style="color:${e.method === "GET" ? Y.get : e.method === "POST" ? Y.post : e.method === "DELETE" ? Y.delete : Y.warning}">${e.method}</strong></div>
2387
- <div class="nexa-row"><span>URL</span><span class="nexa-url-full">${e.url}</span></div>
2388
- <div class="nexa-row"><span>Status</span><strong class="${e.ok ? "nexa-ok" : "nexa-err"}">${e.status || "N/A"}</strong></div>
2389
- <div class="nexa-row"><span>Duration</span><strong>${e.duration.toFixed(1)}ms</strong></div>
2390
- <div class="nexa-row"><span>Cached</span><strong>${e.cached ? "Yes" : "No"}</strong></div>
2391
- <div class="nexa-row"><span>Retries</span><strong>${e.retryCount}</strong></div>
2392
- <div class="nexa-row"><span>Timestamp</span><strong>${new Date(e.timestamp).toLocaleTimeString()}</strong></div>
2393
- </div>
2394
- ${e.body === void 0 ? "" : `
2395
- <div class="nexa-card">
2396
- <h3>Request Body</h3>
2397
- <pre class="nexa-code">${this.formatJson(e.body)}</pre>
2398
- </div>
2399
- `}
2400
- ${Object.keys(e.headers).length > 0 ? `
2401
- <div class="nexa-card">
2402
- <h3>Headers</h3>
2403
- <pre class="nexa-code">${this.formatJson(e.headers)}</pre>
2404
- </div>
2405
- ` : ""}`);
2512
+ !t || !n || !r || (this.panel.classList.add("nexa-view-detail"), t.style.display = "none", n.style.display = "flex", r.innerHTML = je(e));
2406
2513
  }
2407
2514
  showMainView() {
2408
2515
  this.panel && this.panel.classList.remove("nexa-view-detail");
@@ -2411,20 +2518,38 @@ var we = class {
2411
2518
  }
2412
2519
  retrySelected() {
2413
2520
  if (!this.selectedRequest) return;
2414
- let { method: e, url: t, body: n, headers: r } = this.selectedRequest;
2521
+ let { method: e, url: t, body: n, headers: r } = this.selectedRequest, i = performance.now();
2415
2522
  fetch(t, {
2416
2523
  method: e,
2417
2524
  headers: r,
2418
2525
  body: n ? JSON.stringify(n) : void 0
2419
- }).then(async (e) => {
2420
- this.selectedRequest && (this.selectedRequest = {
2421
- ...this.selectedRequest,
2422
- status: e.status,
2423
- ok: e.ok,
2424
- duration: this.selectedRequest.duration,
2425
- timestamp: Date.now()
2426
- }, this.showDetail(this.selectedRequest));
2427
- }).catch(() => {});
2526
+ }).then((a) => {
2527
+ let o = this.tracker.track({
2528
+ method: e,
2529
+ url: t,
2530
+ status: a.status,
2531
+ duration: performance.now() - i,
2532
+ cached: !1,
2533
+ ok: a.ok,
2534
+ headers: r,
2535
+ body: n,
2536
+ retryCount: 0
2537
+ });
2538
+ this.showDetail(o);
2539
+ }).catch(() => {
2540
+ let a = this.tracker.track({
2541
+ method: e,
2542
+ url: t,
2543
+ duration: performance.now() - i,
2544
+ cached: !1,
2545
+ ok: !1,
2546
+ code: "NETWORK_ERROR",
2547
+ headers: r,
2548
+ body: n,
2549
+ retryCount: 0
2550
+ });
2551
+ this.showDetail(a);
2552
+ });
2428
2553
  }
2429
2554
  exportHistory() {
2430
2555
  let e = this.tracker.getHistory(), t = JSON.stringify(e, null, 2), n = new Blob([t], { type: "application/json" }), r = URL.createObjectURL(n), i = document.createElement("a");
@@ -2447,21 +2572,6 @@ var we = class {
2447
2572
  t.classList.remove("nexa-notification-show");
2448
2573
  }, 2500));
2449
2574
  }
2450
- truncateUrl(e, t = 35) {
2451
- try {
2452
- let t = new URL(e);
2453
- return t.pathname + (t.search || "");
2454
- } catch {
2455
- return e.length > t ? e.slice(0, t) + "..." : e;
2456
- }
2457
- }
2458
- formatJson(e) {
2459
- try {
2460
- return JSON.stringify(e, null, 2);
2461
- } catch {
2462
- return String(e);
2463
- }
2464
- }
2465
2575
  canUseDOM() {
2466
2576
  return typeof document < "u" && typeof document.createElement == "function" && !!document.body;
2467
2577
  }
@@ -2516,7 +2626,7 @@ var we = class {
2516
2626
  let e = this.panel.querySelector(".nexa-logo img"), t = this.panel.querySelector(".nexa-title"), a = this.config.branding || "Nexa DevTools", o = this.config.icon || "https://raw.githubusercontent.com/Berea-Soft/nexa/refs/heads/main/src/assets/faviconNew.png";
2517
2627
  e && (e.src = o, e.alt = a), t && (t.textContent = a);
2518
2628
  }
2519
- this.floatingIcon &&= (this.floatingIcon.remove(), null), this.config.enabled && (!this.config.devOnly || X()) && this.createFloatingIcon();
2629
+ this.floatingIcon &&= (this.floatingIcon.remove(), null), this.config.enabled && (!this.config.devOnly || K()) && this.createFloatingIcon();
2520
2630
  }
2521
2631
  refreshConfig(e) {
2522
2632
  this.applyConfigToUI(e);
@@ -2534,9 +2644,9 @@ var we = class {
2534
2644
  branding: "Nexa DevTools",
2535
2645
  icon: "https://raw.githubusercontent.com/Berea-Soft/nexa/refs/heads/main/src/assets/faviconNew.png"
2536
2646
  };
2537
- function Te(e = {}) {
2647
+ function Ne(e = {}) {
2538
2648
  if (Z && Q) {
2539
- let t = K(), n = {
2649
+ let t = H(), n = {
2540
2650
  ...$,
2541
2651
  ...e,
2542
2652
  ...t
@@ -2550,27 +2660,27 @@ function Te(e = {}) {
2550
2660
  config: r
2551
2661
  };
2552
2662
  }
2553
- let t = K();
2554
- return Q = new q({
2663
+ let t = H();
2664
+ return Q = new U({
2555
2665
  ...$,
2556
2666
  ...e,
2557
2667
  ...t
2558
- }), Z = new we(Q), {
2668
+ }), Z = new Me(Q), {
2559
2669
  tracker: Q,
2560
2670
  ui: Z,
2561
2671
  config: Q.getConfig()
2562
2672
  };
2563
2673
  }
2564
- function Ee() {
2674
+ function Pe() {
2565
2675
  return {
2566
2676
  tracker: Q,
2567
2677
  ui: Z
2568
2678
  };
2569
2679
  }
2570
- function De() {
2680
+ function Fe() {
2571
2681
  Z?.destroy(), Z = null, Q = null;
2572
2682
  }
2573
2683
  //#endregion
2574
- export { d as AggressiveRetry, de as CachePlugin, y as CacheStore, p as CircuitBreakerRetry, f as ConservativeRetry, fe as DedupePlugin, oe as Defer, t as Err, R as HttpClient, z as HttpError, le as LoggerPlugin, ue as MetricsPlugin, re as MiddlewarePipeline, e as Ok, N as PluginManager, S as RequestDeduplicator, q as RequestTracker, E as TypedObservable, x as cacheMiddleware, k as createApiUrl, b as createCacheMiddleware, C as createDedupeMiddleware, Te as createDevOverlay, me as createHttpClient, w as createPipeline, l as createProjectionTransformer, xe as createRealtimePlugin, r as createRequiredFieldsValidator, ye as createSSEClient, n as createSchemaValidator, M as createStreamingMiddleware, D as createTypeGuard, ae as createTypedApiClient, T as createTypedRequest, ie as createTypedResponse, O as createUrl, _e as createWebSocketClient, u as createWrapperTransformer, ne as dedupeMiddleware, De as destroyDevOverlay, Ee as getDevOverlay, A as handleStream, B as isHttpError, v as retry, se as streamToFile, ce as streamingMiddleware, s as transformCamelToSnake, c as transformFlatten, o as transformSnakeToCamel, i as validatorIsArray, a as validatorIsObject, te as withTimeout };
2684
+ export { d as AggressiveRetry, fe as CachePlugin, y as CacheStore, p as CircuitBreakerRetry, f as ConservativeRetry, pe as DedupePlugin, D as Defer, t as Err, I as HttpClient, L as HttpError, ue as LoggerPlugin, de as MetricsPlugin, re as MiddlewarePipeline, e as Ok, M as PluginManager, S as RequestDeduplicator, U as RequestTracker, oe as TypedObservable, x as cacheMiddleware, ce as createApiUrl, b as createCacheMiddleware, C as createDedupeMiddleware, Ne as createDevOverlay, ve as createHttpClient, w as createPipeline, l as createProjectionTransformer, Ee as createRealtimePlugin, r as createRequiredFieldsValidator, we as createSSEClient, n as createSchemaValidator, j as createStreamingMiddleware, se as createTypeGuard, ae as createTypedApiClient, T as createTypedRequest, ie as createTypedResponse, E as createUrl, xe as createWebSocketClient, u as createWrapperTransformer, ne as dedupeMiddleware, Fe as destroyDevOverlay, Pe as getDevOverlay, O as handleStream, _e as isHttpError, v as retry, A as streamToFile, le as streamingMiddleware, s as transformCamelToSnake, c as transformFlatten, o as transformSnakeToCamel, i as validatorIsArray, a as validatorIsObject, te as withTimeout };
2575
2685
 
2576
2686
  //# sourceMappingURL=nexa.es.js.map