aegis-swap-widget 0.3.1 → 0.3.2

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.
@@ -1,19 +1,19 @@
1
- import { jsxs as p, jsx as i, Fragment as gn } from "react/jsx-runtime";
2
- import { memo as ut, useState as P, useSyncExternalStore as ot, useRef as W, useEffect as U, useLayoutEffect as Za, useCallback as O, useMemo as J, useId as $e } from "react";
3
- import { Box as Ja, Flame as ei, Gauge as ti, Coins as ni } from "lucide-react";
4
- import { a3 as ai, T as Ve, a9 as ii, R as $n, w as ri, W as si, s as oi, D as li, S as Wn, Z as ci, v as ui, u as di, O as qe, a7 as pi, a0 as Hn, H as Vn, a1 as fi, G as Ne, $ as Nt, J as qn, r as hi, _ as Gn, aa as xe, a5 as gi, a4 as mn, ab as It, I as mi, L as St, a6 as wi, Y as bi, a2 as yi, N as vi, b as wn, z as _i, a as Ii, B as Si, k as Ai, f as bn, F as Ei, X as xi, n as yn, a8 as Ni } from "./polling-BI4pZg8Z.js";
5
- import { A as Bs, c as ks, d as Ls, e as Fs, g as Us, h as $s, i as Ws, j as Hs, l as Vs, m as qs, o as Gs, M as zs, p as Ks, q as js, P as Xs, U as Ys, t as Qs, x as Zs, y as Js, C as eo, E as to, K as no, Q as ao, V as io } from "./polling-BI4pZg8Z.js";
6
- import { createPortal as Pi } from "react-dom";
7
- import { parseUnits as Ti, formatUnits as Ot, formatEther as Ci, formatGwei as Mi, createWalletClient as Ri, custom as Di, WaitForTransactionReceiptTimeoutError as vn, erc20Abi as zn } from "viem";
8
- const Oi = {
1
+ import { jsxs as p, jsx as i, Fragment as yn } from "react/jsx-runtime";
2
+ import { memo as ft, useState as T, useSyncExternalStore as ut, useRef as $, useEffect as F, useLayoutEffect as ai, useCallback as D, useMemo as J, useId as Ve } from "react";
3
+ import { Box as ii, Flame as ri, Gauge as si, Coins as oi } from "lucide-react";
4
+ import { a3 as li, T as ze, a9 as ci, R as qn, w as ui, W as di, s as pi, D as fi, S as Gn, Z as hi, v as gi, u as mi, O as Ke, a7 as wi, a0 as zn, H as Kn, a1 as bi, G as Re, $ as Tt, J as jn, r as yi, _ as Xn, aa as Me, a5 as vi, a4 as vn, ab as At, I as _i, L as Et, a6 as Ii, Y as Si, a2 as Ai, N as Ei, b as _n, z as xi, a as Ni, B as Pi, k as Ti, f as In, F as Ci, X as Mi, n as Sn, a8 as Ri } from "./polling-BI4pZg8Z.js";
5
+ import { A as $s, c as Ws, d as Hs, e as Vs, g as qs, h as Gs, i as zs, j as Ks, l as js, m as Xs, o as Ys, M as Qs, p as Zs, q as Js, P as eo, U as to, t as no, x as ao, y as io, C as ro, E as so, K as oo, Q as lo, V as co } from "./polling-BI4pZg8Z.js";
6
+ import { createPortal as Di } from "react-dom";
7
+ import { parseUnits as Oi, formatUnits as kt, formatEther as Bi, formatGwei as ki, createWalletClient as Li, custom as Fi, WaitForTransactionReceiptTimeoutError as An, erc20Abi as Yn } from "viem";
8
+ const Ui = {
9
9
  USDC: { primary: "#d7ecff", secondary: "#2775ca", text: "#06111f" },
10
10
  WATER: { primary: "#87dcff", secondary: "#0f5d96", text: "#051621" },
11
11
  WOOD: { primary: "#c79a62", secondary: "#45633d", text: "#171008" },
12
12
  GRASS: { primary: "#76e28a", secondary: "#244f32", text: "#061508" },
13
13
  STONE: { primary: "#d7d1c3", secondary: "#5a6366", text: "#111416" }
14
14
  };
15
- function Bi(t) {
16
- const e = Oi[t] ?? {
15
+ function $i(t) {
16
+ const e = Ui[t] ?? {
17
17
  primary: "#eef3f0",
18
18
  secondary: "#75827c",
19
19
  text: "#111815"
@@ -24,13 +24,13 @@ function Bi(t) {
24
24
  "--aegis-token-text": e.text
25
25
  };
26
26
  }
27
- const Pt = ut(function({
27
+ const Ct = ft(function({
28
28
  token: e,
29
29
  metadataByAddress: n,
30
30
  className: a
31
31
  }) {
32
- const r = ai(e, n), [s, o] = P(null), l = r && s !== r ? r : null;
33
- return /* @__PURE__ */ i("span", { className: a, style: Bi(e.symbol), "aria-hidden": "true", children: l ? /* @__PURE__ */ i(
32
+ const r = li(e, n), [s, o] = T(null), l = r && s !== r ? r : null;
33
+ return /* @__PURE__ */ i("span", { className: a, style: $i(e.symbol), "aria-hidden": "true", children: l ? /* @__PURE__ */ i(
34
34
  "img",
35
35
  {
36
36
  src: l,
@@ -40,14 +40,14 @@ const Pt = ut(function({
40
40
  onError: () => o(l)
41
41
  }
42
42
  ) : e.symbol.slice(0, 1) });
43
- }), Kn = ut(function({
43
+ }), Qn = ft(function({
44
44
  market: e,
45
45
  metadataByAddress: n,
46
46
  className: a
47
47
  }) {
48
48
  return /* @__PURE__ */ p("span", { className: a, "aria-hidden": "true", children: [
49
49
  /* @__PURE__ */ i(
50
- Pt,
50
+ Ct,
51
51
  {
52
52
  token: e.counterToken,
53
53
  metadataByAddress: n,
@@ -55,7 +55,7 @@ const Pt = ut(function({
55
55
  }
56
56
  ),
57
57
  /* @__PURE__ */ i(
58
- Pt,
58
+ Ct,
59
59
  {
60
60
  token: e.token,
61
61
  metadataByAddress: n,
@@ -64,7 +64,7 @@ const Pt = ut(function({
64
64
  )
65
65
  ] });
66
66
  });
67
- function ki() {
67
+ function Wi() {
68
68
  return /* @__PURE__ */ p("svg", { viewBox: "0 0 150 151", "aria-hidden": "true", focusable: "false", children: [
69
69
  /* @__PURE__ */ i(
70
70
  "path",
@@ -84,7 +84,7 @@ function ki() {
84
84
  )
85
85
  ] });
86
86
  }
87
- function Li({ className: t }) {
87
+ function Hi({ className: t }) {
88
88
  return /* @__PURE__ */ p(
89
89
  "svg",
90
90
  {
@@ -103,7 +103,7 @@ function Li({ className: t }) {
103
103
  }
104
104
  );
105
105
  }
106
- function Fi({ className: t }) {
106
+ function Vi({ className: t }) {
107
107
  return /* @__PURE__ */ p(
108
108
  "svg",
109
109
  {
@@ -124,7 +124,7 @@ function Fi({ className: t }) {
124
124
  }
125
125
  );
126
126
  }
127
- function Ui() {
127
+ function qi() {
128
128
  return /* @__PURE__ */ p("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
129
129
  /* @__PURE__ */ i("path", { d: "m3 16 4 4 4-4" }),
130
130
  /* @__PURE__ */ i("path", { d: "M7 20V4" }),
@@ -132,26 +132,26 @@ function Ui() {
132
132
  /* @__PURE__ */ i("path", { d: "M17 4v16" })
133
133
  ] });
134
134
  }
135
- function Tt() {
135
+ function Mt() {
136
136
  return /* @__PURE__ */ p("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
137
137
  /* @__PURE__ */ i("path", { d: "M14 5h5v5" }),
138
138
  /* @__PURE__ */ i("path", { d: "m13 11 6-6" }),
139
139
  /* @__PURE__ */ i("path", { d: "M19 14v4.5A1.5 1.5 0 0 1 17.5 20h-12A1.5 1.5 0 0 1 4 18.5v-12A1.5 1.5 0 0 1 5.5 5H10" })
140
140
  ] });
141
141
  }
142
- function $i() {
142
+ function Gi() {
143
143
  return /* @__PURE__ */ p("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
144
144
  /* @__PURE__ */ i("rect", { x: "8", y: "8", width: "12", height: "12", rx: "2" }),
145
145
  /* @__PURE__ */ i("path", { d: "M4 14V6a2 2 0 0 1 2-2h8" })
146
146
  ] });
147
147
  }
148
- function lt() {
148
+ function dt() {
149
149
  return /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ i("path", { d: "M20 6 9 17l-5-5" }) });
150
150
  }
151
- function jn() {
151
+ function Zn() {
152
152
  return /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ i("path", { d: "m6 9 6 6 6-6" }) });
153
153
  }
154
- function Wi() {
154
+ function zi() {
155
155
  return /* @__PURE__ */ p("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
156
156
  /* @__PURE__ */ i("path", { d: "M5 7h5" }),
157
157
  /* @__PURE__ */ i("path", { d: "M14 7h5" }),
@@ -161,46 +161,46 @@ function Wi() {
161
161
  /* @__PURE__ */ i("circle", { cx: "16", cy: "17", r: "2" })
162
162
  ] });
163
163
  }
164
- function Hi() {
165
- return /* @__PURE__ */ i(ni, { "aria-hidden": "true", focusable: "false" });
164
+ function Ki() {
165
+ return /* @__PURE__ */ i(oi, { "aria-hidden": "true", focusable: "false" });
166
166
  }
167
- function Vi() {
168
- return /* @__PURE__ */ i(ti, { "aria-hidden": "true", focusable: "false" });
167
+ function ji() {
168
+ return /* @__PURE__ */ i(si, { "aria-hidden": "true", focusable: "false" });
169
169
  }
170
- function qi() {
171
- return /* @__PURE__ */ i(ei, { "aria-hidden": "true", focusable: "false" });
170
+ function Xi() {
171
+ return /* @__PURE__ */ i(ri, { "aria-hidden": "true", focusable: "false" });
172
172
  }
173
- function Gi() {
174
- return /* @__PURE__ */ i(Ja, { "aria-hidden": "true", focusable: "false" });
173
+ function Yi() {
174
+ return /* @__PURE__ */ i(ii, { "aria-hidden": "true", focusable: "false" });
175
175
  }
176
- function zi() {
176
+ function Qi() {
177
177
  return /* @__PURE__ */ i("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ i("circle", { cx: "12", cy: "12", r: "9" }) });
178
178
  }
179
- function Ki() {
179
+ function Zi() {
180
180
  return /* @__PURE__ */ p("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
181
181
  /* @__PURE__ */ i("circle", { cx: "12", cy: "12", r: "9" }),
182
182
  /* @__PURE__ */ i("path", { d: "M12 8v4" }),
183
183
  /* @__PURE__ */ i("path", { d: "M12 16h.01" })
184
184
  ] });
185
185
  }
186
- function Xn() {
186
+ function Jn() {
187
187
  return /* @__PURE__ */ p("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
188
188
  /* @__PURE__ */ i("circle", { cx: "12", cy: "12", r: "9" }),
189
189
  /* @__PURE__ */ i("path", { d: "M12 11v5" }),
190
190
  /* @__PURE__ */ i("path", { d: "M12 8h.01" })
191
191
  ] });
192
192
  }
193
- function ji() {
193
+ function Ji() {
194
194
  return /* @__PURE__ */ p("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", children: [
195
195
  /* @__PURE__ */ i("path", { d: "M18 6 6 18" }),
196
196
  /* @__PURE__ */ i("path", { d: "m6 6 12 12" })
197
197
  ] });
198
198
  }
199
- const _n = "#06120c", In = "#f4f8f5";
200
- function Pe(t) {
199
+ const En = "#06120c", xn = "#f4f8f5";
200
+ function De(t) {
201
201
  return Math.min(255, Math.max(0, Math.round(t)));
202
202
  }
203
- function Sn(t) {
203
+ function Nn(t) {
204
204
  const e = t.replace(/^#/, "");
205
205
  if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(e)) return null;
206
206
  const n = e.length === 3 ? e.split("").map((a) => a + a).join("") : e;
@@ -210,30 +210,30 @@ function Sn(t) {
210
210
  b: Number.parseInt(n.slice(4, 6), 16)
211
211
  };
212
212
  }
213
- function Xi(t) {
213
+ function er(t) {
214
214
  return t.endsWith("%") ? Number.parseFloat(t) * 255 / 100 : Number.parseFloat(t);
215
215
  }
216
- function An(t) {
216
+ function Pn(t) {
217
217
  const e = t.match(/^rgba?\(\s*([\d.]+%?)\s*[,\s]\s*([\d.]+%?)\s*[,\s]\s*([\d.]+%?)/i);
218
218
  if (!e) return null;
219
- const [n, a, r] = [e[1], e[2], e[3]].map(Xi);
220
- return [n, a, r].some((s) => Number.isNaN(s)) ? null : { r: Pe(n), g: Pe(a), b: Pe(r) };
219
+ const [n, a, r] = [e[1], e[2], e[3]].map(er);
220
+ return [n, a, r].some((s) => Number.isNaN(s)) ? null : { r: De(n), g: De(a), b: De(r) };
221
221
  }
222
- function Yi(t, e, n) {
222
+ function tr(t, e, n) {
223
223
  const a = e / 100, r = n / 100, s = (1 - Math.abs(2 * r - 1)) * a, o = (t % 360 + 360) % 360 / 60, l = s * (1 - Math.abs(o % 2 - 1)), u = r - s / 2, [c, f, m] = o < 1 ? [s, l, 0] : o < 2 ? [l, s, 0] : o < 3 ? [0, s, l] : o < 4 ? [0, l, s] : o < 5 ? [l, 0, s] : [s, 0, l];
224
224
  return {
225
- r: Pe((c + u) * 255),
226
- g: Pe((f + u) * 255),
227
- b: Pe((m + u) * 255)
225
+ r: De((c + u) * 255),
226
+ g: De((f + u) * 255),
227
+ b: De((m + u) * 255)
228
228
  };
229
229
  }
230
- function Qi(t) {
230
+ function nr(t) {
231
231
  const e = t.match(/^hsla?\(\s*([\d.]+)(?:deg)?\s*[,\s]\s*([\d.]+)%\s*[,\s]\s*([\d.]+)%/i);
232
232
  if (!e) return null;
233
233
  const [n, a, r] = [e[1], e[2], e[3]].map(Number.parseFloat);
234
- return [n, a, r].some((s) => Number.isNaN(s)) ? null : Yi(n, a, r);
234
+ return [n, a, r].some((s) => Number.isNaN(s)) ? null : tr(n, a, r);
235
235
  }
236
- function Zi(t) {
236
+ function ar(t) {
237
237
  if (typeof document > "u") return null;
238
238
  const e = document.createElement("canvas").getContext("2d");
239
239
  if (!e) return null;
@@ -243,55 +243,55 @@ function Zi(t) {
243
243
  const a = e.fillStyle;
244
244
  return n === a ? n : null;
245
245
  }
246
- function Ji(t) {
247
- const e = t.trim(), n = Sn(e) ?? An(e) ?? Qi(e);
246
+ function ir(t) {
247
+ const e = t.trim(), n = Nn(e) ?? Pn(e) ?? nr(e);
248
248
  if (n) return n;
249
- const a = Zi(e);
250
- return a ? Sn(a) ?? An(a) : null;
249
+ const a = ar(e);
250
+ return a ? Nn(a) ?? Pn(a) : null;
251
251
  }
252
- function At(t) {
252
+ function xt(t) {
253
253
  const e = t / 255;
254
254
  return e <= 0.03928 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
255
255
  }
256
- function Et(t) {
257
- const e = Ji(t);
258
- return e ? 0.2126 * At(e.r) + 0.7152 * At(e.g) + 0.0722 * At(e.b) : null;
256
+ function Nt(t) {
257
+ const e = ir(t);
258
+ return e ? 0.2126 * xt(e.r) + 0.7152 * xt(e.g) + 0.0722 * xt(e.b) : null;
259
259
  }
260
- function En(t, e) {
260
+ function Tn(t, e) {
261
261
  return (Math.max(t, e) + 0.05) / (Math.min(t, e) + 0.05);
262
262
  }
263
- function Yn(t) {
264
- const e = Et(t);
263
+ function ea(t) {
264
+ const e = Nt(t);
265
265
  if (e === null) return null;
266
- const n = Et(_n) ?? 0, a = Et(In) ?? 1;
267
- return En(e, n) >= En(e, a) ? _n : In;
266
+ const n = Nt(En) ?? 0, a = Nt(xn) ?? 1;
267
+ return Tn(e, n) >= Tn(e, a) ? En : xn;
268
268
  }
269
- const Qn = "(prefers-color-scheme: light)";
270
- function er() {
271
- return typeof window > "u" || !window.matchMedia ? "dark" : window.matchMedia(Qn).matches ? "light" : "dark";
269
+ const ta = "(prefers-color-scheme: light)";
270
+ function rr() {
271
+ return typeof window > "u" || !window.matchMedia ? "dark" : window.matchMedia(ta).matches ? "light" : "dark";
272
272
  }
273
- function tr() {
273
+ function sr() {
274
274
  return "dark";
275
275
  }
276
- function nr(t) {
276
+ function or(t) {
277
277
  if (typeof window > "u" || !window.matchMedia) return () => {
278
278
  };
279
- const e = window.matchMedia(Qn);
279
+ const e = window.matchMedia(ta);
280
280
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
281
281
  }
282
- function ar() {
282
+ function lr() {
283
283
  return () => {
284
284
  };
285
285
  }
286
- function Zn(t) {
287
- const e = t === "auto", n = ot(
288
- e ? nr : ar,
289
- er,
290
- tr
286
+ function na(t) {
287
+ const e = t === "auto", n = ut(
288
+ e ? or : lr,
289
+ rr,
290
+ sr
291
291
  );
292
292
  return t === "light" ? "light" : t === "dark" ? "dark" : e ? n : "dark";
293
293
  }
294
- function ir(t, e, n, a) {
294
+ function cr(t, e, n, a) {
295
295
  const r = /* @__PURE__ */ new Map();
296
296
  let s = 0, o = 0;
297
297
  return t.forEach((l, u) => {
@@ -304,40 +304,40 @@ function ir(t, e, n, a) {
304
304
  }), l.dismissed || (s += (e[l.id] ?? 0) + n, o += 1);
305
305
  }), r;
306
306
  }
307
- function rr(t) {
307
+ function ur(t) {
308
308
  const e = t.style.height, n = t.style.transition;
309
309
  t.style.transition = "none", t.style.height = "auto";
310
310
  const a = t.getBoundingClientRect().height;
311
311
  return t.style.height = e, t.getBoundingClientRect(), t.style.transition = n, a;
312
312
  }
313
- const dt = Object.freeze([]), sr = 32;
314
- let ie = dt;
315
- const Ct = /* @__PURE__ */ new Set();
316
- let Fe = 0, xn = 0;
317
- function Ge(t) {
318
- ie = t.length === 0 ? dt : t;
319
- for (const e of Ct) e();
313
+ const ht = Object.freeze([]), dr = 32;
314
+ let re = ht;
315
+ const Rt = /* @__PURE__ */ new Set();
316
+ let We = 0, Cn = 0;
317
+ function je(t) {
318
+ re = t.length === 0 ? ht : t;
319
+ for (const e of Rt) e();
320
320
  }
321
- function or() {
322
- return ie;
321
+ function pr() {
322
+ return re;
323
323
  }
324
- function lr(t) {
325
- return Ct.add(t), () => {
326
- Ct.delete(t);
324
+ function fr(t) {
325
+ return Rt.add(t), () => {
326
+ Rt.delete(t);
327
327
  };
328
328
  }
329
- function cr() {
330
- return xn += 1, `aegis-toast-${xn}`;
329
+ function hr() {
330
+ return Cn += 1, `aegis-toast-${Cn}`;
331
331
  }
332
- function ur(t, e) {
332
+ function gr(t, e) {
333
333
  return !t || !e ? t === e : t.label === e.label && t.href === e.href && t.onClick === e.onClick;
334
334
  }
335
- function We(t) {
336
- const e = t.id ?? cr(), n = ie.find((o) => o.id === e), a = t.dismissible ?? !0;
335
+ function qe(t) {
336
+ const e = t.id ?? hr(), n = re.find((o) => o.id === e), a = t.dismissible ?? !0;
337
337
  if (n) {
338
- if (n.type === t.type && n.title === t.title && n.description === t.description && ur(n.action, t.action) && n.duration === t.duration && n.dismissible === a && !n.dismissed)
338
+ if (n.type === t.type && n.title === t.title && n.description === t.description && gr(n.action, t.action) && n.duration === t.duration && n.dismissible === a && !n.dismissed)
339
339
  return e;
340
- Fe += 1;
340
+ We += 1;
341
341
  const o = {
342
342
  id: e,
343
343
  type: t.type,
@@ -347,12 +347,12 @@ function We(t) {
347
347
  duration: t.duration,
348
348
  dismissible: a,
349
349
  createdAt: n.createdAt,
350
- updatedAt: Fe,
350
+ updatedAt: We,
351
351
  dismissed: !1
352
352
  };
353
- return Ge(ie.map((l) => l.id === e ? o : l)), e;
353
+ return je(re.map((l) => l.id === e ? o : l)), e;
354
354
  }
355
- Fe += 1;
355
+ We += 1;
356
356
  const r = {
357
357
  id: e,
358
358
  type: t.type,
@@ -361,66 +361,66 @@ function We(t) {
361
361
  action: t.action,
362
362
  duration: t.duration,
363
363
  dismissible: a,
364
- createdAt: Fe,
365
- updatedAt: Fe,
364
+ createdAt: We,
365
+ updatedAt: We,
366
366
  dismissed: !1
367
- }, s = ie.length >= sr ? ie.slice(1) : ie;
368
- return Ge([...s, r]), e;
367
+ }, s = re.length >= dr ? re.slice(1) : re;
368
+ return je([...s, r]), e;
369
369
  }
370
370
  function ve(t) {
371
- if (ct.size === 0) {
372
- const r = t === void 0 ? dt : ie.filter((s) => s.id !== t);
373
- r.length !== ie.length && Ge(r);
371
+ if (pt.size === 0) {
372
+ const r = t === void 0 ? ht : re.filter((s) => s.id !== t);
373
+ r.length !== re.length && je(r);
374
374
  return;
375
375
  }
376
376
  let n = !1;
377
- const a = ie.map((r) => r.dismissed || t !== void 0 && r.id !== t ? r : (n = !0, { ...r, dismissed: !0 }));
378
- n && Ge(a);
379
- }
380
- function dr(t) {
381
- const e = ie.filter((n) => n.id !== t);
382
- e.length !== ie.length && Ge(e);
383
- }
384
- const ct = /* @__PURE__ */ new Map(), Mt = /* @__PURE__ */ new WeakMap();
385
- let pr = 0;
386
- const Rt = /* @__PURE__ */ new Set();
387
- function Nn() {
388
- for (const t of Rt) t();
389
- }
390
- function fr(t, e) {
391
- return Mt.has(t) || Mt.set(t, pr++), ct.set(t, e), Nn(), () => {
392
- ct.delete(t), Nn();
377
+ const a = re.map((r) => r.dismissed || t !== void 0 && r.id !== t ? r : (n = !0, { ...r, dismissed: !0 }));
378
+ n && je(a);
379
+ }
380
+ function mr(t) {
381
+ const e = re.filter((n) => n.id !== t);
382
+ e.length !== re.length && je(e);
383
+ }
384
+ const pt = /* @__PURE__ */ new Map(), Dt = /* @__PURE__ */ new WeakMap();
385
+ let wr = 0;
386
+ const Ot = /* @__PURE__ */ new Set();
387
+ function Mn() {
388
+ for (const t of Ot) t();
389
+ }
390
+ function br(t, e) {
391
+ return Dt.has(t) || Dt.set(t, wr++), pt.set(t, e), Mn(), () => {
392
+ pt.delete(t), Mn();
393
393
  };
394
394
  }
395
- function hr(t) {
396
- return Rt.add(t), () => {
397
- Rt.delete(t);
395
+ function yr(t) {
396
+ return Ot.add(t), () => {
397
+ Ot.delete(t);
398
398
  };
399
399
  }
400
- function gr(t) {
400
+ function vr(t) {
401
401
  let e = null, n = null, a = 1 / 0;
402
- for (const [r, s] of ct) {
403
- const o = Mt.get(r) ?? 1 / 0;
402
+ for (const [r, s] of pt) {
403
+ const o = Dt.get(r) ?? 1 / 0;
404
404
  (e === null || s === "host" && n !== "host" || s === n && o < a) && (e = r, n = s, a = o);
405
405
  }
406
406
  return e === t;
407
407
  }
408
- const mr = 45, wr = 0.11;
409
- function br(t) {
408
+ const _r = 45, Ir = 0.11;
409
+ function Sr(t) {
410
410
  return t === "bottom" ? 1 : -1;
411
411
  }
412
- function yr(t, e) {
412
+ function Ar(t, e) {
413
413
  const n = Math.abs(t);
414
- return n >= mr ? !0 : e > 0 && n / e > wr;
414
+ return n >= _r ? !0 : e > 0 && n / e > Ir;
415
415
  }
416
- function vr(t, e) {
416
+ function Er(t, e) {
417
417
  return t * e >= 0 ? t : t / (1.5 + Math.abs(t) / 20);
418
418
  }
419
- function _r(t, e, n) {
419
+ function xr(t, e, n) {
420
420
  const a = n === "touch" ? 10 : 2;
421
421
  return Math.max(Math.abs(t), Math.abs(e)) < a ? "pending" : Math.abs(e) >= Math.abs(t) ? "swipe" : "abort";
422
422
  }
423
- function Ir(t, e, n = {}) {
423
+ function Nr(t, e, n = {}) {
424
424
  const a = n.now ?? (() => Date.now()), r = n.set ?? ((f, m) => setTimeout(f, m)), s = n.clear ?? ((f) => clearTimeout(f));
425
425
  let o = e, l = 0, u = null, c = !1;
426
426
  return {
@@ -440,36 +440,36 @@ function Ir(t, e, n = {}) {
440
440
  }
441
441
  };
442
442
  }
443
- function Sr({
443
+ function Pr({
444
444
  durationMs: t,
445
445
  epoch: e,
446
446
  paused: n,
447
447
  onExpire: a
448
448
  }) {
449
- const r = W(a);
449
+ const r = $(a);
450
450
  r.current = a;
451
- const s = W(null);
452
- U(() => {
451
+ const s = $(null);
452
+ F(() => {
453
453
  if (t === null || !Number.isFinite(t)) return;
454
- const o = Ir(() => r.current(), t);
454
+ const o = Nr(() => r.current(), t);
455
455
  return s.current = o, () => {
456
456
  s.current = null, o.cancel();
457
457
  };
458
- }, [t, e]), U(() => {
458
+ }, [t, e]), F(() => {
459
459
  const o = s.current;
460
460
  o && (n ? o.pause() : o.start());
461
461
  }, [t, e, n]);
462
462
  }
463
- const Ar = 260, Jn = 8e3, Er = {
464
- loading: zi,
465
- success: lt,
466
- error: Ki,
467
- info: Xn
463
+ const Tr = 260, aa = 8e3, Cr = {
464
+ loading: Qi,
465
+ success: dt,
466
+ error: Zi,
467
+ info: Jn
468
468
  };
469
- function xr(t, e) {
470
- return t.duration !== void 0 ? Number.isFinite(t.duration) ? t.duration : null : t.type === "loading" ? null : t.type === "error" ? Jn : e;
469
+ function Mr(t, e) {
470
+ return t.duration !== void 0 ? Number.isFinite(t.duration) ? t.duration : null : t.type === "loading" ? null : t.type === "error" ? aa : e;
471
471
  }
472
- const Nr = ut(function({
472
+ const Rr = ft(function({
473
473
  toast: e,
474
474
  index: n,
475
475
  zIndex: a,
@@ -486,8 +486,8 @@ const Nr = ut(function({
486
486
  swipeStateRef: v
487
487
  }) {
488
488
  var K;
489
- const w = W(null), b = W(null), [x, R] = P(!1), [D, B] = P(!1), [S, h] = P(!1);
490
- U(() => {
489
+ const w = $(null), b = $(null), [x, R] = T(!1), [O, B] = T(!1), [S, h] = T(!1);
490
+ F(() => {
491
491
  let d = 0;
492
492
  const _ = requestAnimationFrame(() => {
493
493
  d = requestAnimationFrame(() => R(!0));
@@ -495,10 +495,10 @@ const Nr = ut(function({
495
495
  return () => {
496
496
  cancelAnimationFrame(_), cancelAnimationFrame(d);
497
497
  };
498
- }, []), Za(() => {
498
+ }, []), ai(() => {
499
499
  if (e.dismissed) return;
500
500
  const d = w.current;
501
- d && I(e.id, rr(d));
501
+ d && I(e.id, ur(d));
502
502
  }, [
503
503
  I,
504
504
  (K = e.action) == null ? void 0 : K.label,
@@ -507,30 +507,30 @@ const Nr = ut(function({
507
507
  e.id,
508
508
  e.title
509
509
  ]);
510
- const A = W(r);
510
+ const A = $(r);
511
511
  e.dismissed || (A.current = r);
512
512
  const y = e.dismissed ? A.current : r;
513
- U(() => {
513
+ F(() => {
514
514
  if (!e.dismissed) {
515
515
  h(!1);
516
516
  return;
517
517
  }
518
518
  E(e.id);
519
- const d = window.setTimeout(() => dr(e.id), Ar);
519
+ const d = window.setTimeout(() => mr(e.id), Tr);
520
520
  return () => window.clearTimeout(d);
521
- }, [e.dismissed, e.id, E]), U(() => () => E(e.id), [e.id, E]), Sr({
522
- durationMs: xr(e, c),
521
+ }, [e.dismissed, e.id, E]), F(() => () => E(e.id), [e.id, E]), Pr({
522
+ durationMs: Mr(e, c),
523
523
  epoch: e.updatedAt,
524
- paused: l || D || o || e.dismissed,
524
+ paused: l || O || o || e.dismissed,
525
525
  onExpire: () => ve(e.id)
526
526
  });
527
527
  const M = (d, _) => {
528
- const q = b.current;
529
- if (!q || d.pointerId !== q.pointerId || (b.current = null, q.intent !== "swipe")) return;
528
+ const V = b.current;
529
+ if (!V || d.pointerId !== V.pointerId || (b.current = null, V.intent !== "swipe")) return;
530
530
  B(!1), v.current = !1;
531
- const k = w.current, ne = k && Number.parseFloat(k.style.getPropertyValue("--swipe-y")) || 0;
532
- !_ && yr(ne, Date.now() - q.startedAt) ? (h(!0), ve(e.id)) : k == null || k.style.setProperty("--swipe-y", "0px");
533
- }, V = (d) => {
531
+ const L = w.current, X = L && Number.parseFloat(L.style.getPropertyValue("--swipe-y")) || 0;
532
+ !_ && Ar(X, Date.now() - V.startedAt) ? (h(!0), ve(e.id)) : L == null || L.style.setProperty("--swipe-y", "0px");
533
+ }, H = (d) => {
534
534
  !e.dismissible || e.dismissed || d.target.closest("button, a") || (b.current = {
535
535
  pointerId: d.pointerId,
536
536
  startX: d.clientX,
@@ -539,14 +539,14 @@ const Nr = ut(function({
539
539
  intent: "pending"
540
540
  }, d.currentTarget.setPointerCapture(d.pointerId));
541
541
  }, z = (d) => {
542
- var re;
542
+ var ne;
543
543
  const _ = b.current;
544
544
  if (!_ || d.pointerId !== _.pointerId) return;
545
- const q = d.clientX - _.startX, k = d.clientY - _.startY;
546
- if (_.intent === "pending" && (_.intent = _r(q, k, d.pointerType || "mouse"), _.intent === "swipe" && (B(!0), v.current = !0)), _.intent !== "swipe") return;
547
- const ne = vr(k, br(u));
548
- (re = w.current) == null || re.style.setProperty("--swipe-y", `${ne}px`);
549
- }, N = Er[e.type], te = {
545
+ const V = d.clientX - _.startX, L = d.clientY - _.startY;
546
+ if (_.intent === "pending" && (_.intent = xr(V, L, d.pointerType || "mouse"), _.intent === "swipe" && (B(!0), v.current = !0)), _.intent !== "swipe") return;
547
+ const X = Er(L, Sr(u));
548
+ (ne = w.current) == null || ne.style.setProperty("--swipe-y", `${X}px`);
549
+ }, N = Cr[e.type], te = {
550
550
  "--index": n,
551
551
  "--z": a,
552
552
  "--offset": `${y}px`,
@@ -562,7 +562,7 @@ const Nr = ut(function({
562
562
  "data-front": s ? "" : void 0,
563
563
  "data-removing": e.dismissed && !S ? "" : void 0,
564
564
  "data-swipe-out": S ? "" : void 0,
565
- "data-swiping": D ? "" : void 0,
565
+ "data-swiping": O ? "" : void 0,
566
566
  "data-hidden": o ? "" : void 0,
567
567
  "data-dismissible": e.dismissible ? "" : void 0,
568
568
  role: e.type === "error" ? "alert" : "status",
@@ -570,7 +570,7 @@ const Nr = ut(function({
570
570
  "aria-atomic": "true",
571
571
  "aria-hidden": o ? !0 : void 0,
572
572
  style: te,
573
- onPointerDown: V,
573
+ onPointerDown: H,
574
574
  onPointerMove: z,
575
575
  onPointerUp: (d) => M(d, !1),
576
576
  onPointerCancel: (d) => M(d, !0),
@@ -619,72 +619,72 @@ const Nr = ut(function({
619
619
  className: "aegis-swap-toast__close",
620
620
  "aria-label": "Dismiss notification",
621
621
  onClick: () => ve(e.id),
622
- children: /* @__PURE__ */ i(ji, {})
622
+ children: /* @__PURE__ */ i(Ji, {})
623
623
  }
624
624
  ) : null
625
625
  ]
626
626
  }
627
627
  );
628
628
  });
629
- function Pr(t) {
629
+ function Dr(t) {
630
630
  return document.addEventListener("visibilitychange", t), () => document.removeEventListener("visibilitychange", t);
631
631
  }
632
- const Tr = () => !0;
633
- function Cr() {
634
- return ot(Pr, Ve, Tr);
632
+ const Or = () => !0;
633
+ function Br() {
634
+ return ut(Dr, ze, Or);
635
635
  }
636
- const Mr = 12, Rr = 5e3, Dr = 3, Or = () => dt, Br = () => !1;
637
- function ea({
636
+ const kr = 12, Lr = 5e3, Fr = 3, Ur = () => ht, $r = () => !1;
637
+ function ia({
638
638
  kind: t,
639
639
  position: e = "bottom-right",
640
640
  theme: n,
641
641
  accentColor: a,
642
642
  accentTextColor: r,
643
- duration: s = Rr,
644
- visibleToasts: o = Dr,
643
+ duration: s = Lr,
644
+ visibleToasts: o = Fr,
645
645
  closeButton: l = !1,
646
646
  expand: u = !1,
647
647
  offset: c,
648
648
  className: f,
649
649
  style: m
650
650
  }) {
651
- const I = ot(lr, or, Or), E = W({}).current;
652
- U(() => fr(E, t), [t, E]);
653
- const v = ot(
654
- hr,
655
- () => gr(E),
656
- Br
657
- ), [w, b] = P(!1);
658
- U(() => b(!0), []);
659
- const x = Zn(n), R = Cr(), [D, B] = P(!1), [S, h] = P(!1), [A, y] = P({}), M = W(!1), V = O((L, g) => {
660
- y((T) => T[L] === g ? T : { ...T, [L]: g });
661
- }, []), z = O((L) => {
651
+ const I = ut(fr, pr, Ur), E = $({}).current;
652
+ F(() => br(E, t), [t, E]);
653
+ const v = ut(
654
+ yr,
655
+ () => vr(E),
656
+ $r
657
+ ), [w, b] = T(!1);
658
+ F(() => b(!0), []);
659
+ const x = na(n), R = Br(), [O, B] = T(!1), [S, h] = T(!1), [A, y] = T({}), M = $(!1), H = D((k, g) => {
660
+ y((C) => C[k] === g ? C : { ...C, [k]: g });
661
+ }, []), z = D((k) => {
662
662
  y((g) => {
663
- if (!(L in g)) return g;
664
- const T = { ...g };
665
- return delete T[L], T;
663
+ if (!(k in g)) return g;
664
+ const C = { ...g };
665
+ return delete C[k], C;
666
666
  });
667
667
  }, []), N = J(() => [...I].reverse(), [I]), te = J(
668
- () => ir(N, A, Mr, o),
668
+ () => cr(N, A, kr, o),
669
669
  [A, N, o]
670
- ), K = N.find((L) => !L.dismissed) ?? N[0], d = K ? A[K.id] ?? 0 : 0;
671
- U(() => {
670
+ ), K = N.find((k) => !k.dismissed) ?? N[0], d = K ? A[K.id] ?? 0 : 0;
671
+ F(() => {
672
672
  N.length > 0 || (B(!1), h(!1));
673
673
  }, [N.length]);
674
- const [_, q] = e.split("-"), k = u || D || S, ne = D || S || !R, re = J(() => {
675
- const L = { ...m };
674
+ const [_, V] = e.split("-"), L = u || O || S, X = O || S || !R, ne = J(() => {
675
+ const k = { ...m };
676
676
  if (a) {
677
- L["--aegis-swap-accent"] = a;
678
- const g = r ?? Yn(a);
679
- g && (L["--aegis-swap-accent-text"] = g);
680
- } else r && (L["--aegis-swap-accent-text"] = r);
677
+ k["--aegis-swap-accent"] = a;
678
+ const g = r ?? ea(a);
679
+ g && (k["--aegis-swap-accent-text"] = g);
680
+ } else r && (k["--aegis-swap-accent-text"] = r);
681
681
  if (c !== void 0) {
682
682
  const g = typeof c == "number" ? `${c}px` : c;
683
- L["--aegis-swap-toast-offset-x"] = g, L["--aegis-swap-toast-offset-y"] = g;
683
+ k["--aegis-swap-toast-offset-x"] = g, k["--aegis-swap-toast-offset-y"] = g;
684
684
  }
685
- return L["--aegis-swap-toast-front-height"] = `${d}px`, L;
685
+ return k["--aegis-swap-toast-front-height"] = `${d}px`, k;
686
686
  }, [a, r, d, c, m]);
687
- return !w || !v || N.length === 0 ? null : Pi(
687
+ return !w || !v || N.length === 0 ? null : Di(
688
688
  /* @__PURE__ */ i(
689
689
  "ol",
690
690
  {
@@ -694,40 +694,40 @@ function ea({
694
694
  f ?? ""
695
695
  ].join(" ").trim(),
696
696
  "data-y-position": _,
697
- "data-x-position": q,
698
- "data-expanded": k ? "" : void 0,
697
+ "data-x-position": V,
698
+ "data-expanded": L ? "" : void 0,
699
699
  "aria-label": "Notifications",
700
- style: re,
700
+ style: ne,
701
701
  onMouseEnter: () => B(!0),
702
702
  onMouseMove: () => B(!0),
703
703
  onMouseLeave: () => {
704
704
  M.current || B(!1);
705
705
  },
706
706
  onFocus: () => h(!0),
707
- onBlur: (L) => {
708
- L.currentTarget.contains(L.relatedTarget) || h(!1);
707
+ onBlur: (k) => {
708
+ k.currentTarget.contains(k.relatedTarget) || h(!1);
709
709
  },
710
- children: N.map((L) => {
711
- const g = te.get(L.id);
710
+ children: N.map((k) => {
711
+ const g = te.get(k.id);
712
712
  return g ? /* @__PURE__ */ i(
713
- Nr,
713
+ Rr,
714
714
  {
715
- toast: L,
715
+ toast: k,
716
716
  index: g.index,
717
717
  zIndex: g.zIndex,
718
718
  offset: g.offset,
719
719
  front: g.front,
720
720
  hidden: g.hidden,
721
- regionPaused: ne,
721
+ regionPaused: X,
722
722
  yPosition: _,
723
723
  defaultDurationMs: s,
724
724
  closeButton: l,
725
- height: A[L.id],
726
- registerHeight: V,
725
+ height: A[k.id],
726
+ registerHeight: H,
727
727
  unregisterHeight: z,
728
728
  swipeStateRef: M
729
729
  },
730
- L.id
730
+ k.id
731
731
  ) : null;
732
732
  })
733
733
  }
@@ -735,101 +735,101 @@ function ea({
735
735
  document.body
736
736
  );
737
737
  }
738
- function Ms(t) {
739
- return /* @__PURE__ */ i(ea, { kind: "host", ...t });
738
+ function ks(t) {
739
+ return /* @__PURE__ */ i(ia, { kind: "host", ...t });
740
740
  }
741
- function kr(t) {
742
- return /* @__PURE__ */ i(ea, { kind: "internal", ...t });
741
+ function Wr(t) {
742
+ return /* @__PURE__ */ i(ia, { kind: "internal", ...t });
743
743
  }
744
- function He(t) {
744
+ function Ge(t) {
745
745
  const a = ((t.match(/,/g) ?? []).length === 1 && !t.includes(".") ? t.replace(",", ".") : t).replace(/[^\d.]/g, ""), [r = "", ...s] = a.split("."), o = s.length > 0 ? `${r}.${s.join("")}` : r;
746
746
  return o === "." ? "0." : o;
747
747
  }
748
- function Pn(t) {
749
- const e = He(t);
748
+ function Rn(t) {
749
+ const e = Ge(t);
750
750
  if (!e) return "";
751
751
  const n = Number(e);
752
752
  return Number.isFinite(n) && n > 20 ? "20" : e;
753
753
  }
754
- function Lr(t, e) {
754
+ function Hr(t, e) {
755
755
  const n = t.trim();
756
756
  if (!n || n === ".") return null;
757
757
  try {
758
- return Ti(n, e);
758
+ return Oi(n, e);
759
759
  } catch {
760
760
  return null;
761
761
  }
762
762
  }
763
- function Tn(t) {
763
+ function Dn(t) {
764
764
  const e = t.trim();
765
765
  if (!e) return null;
766
766
  const n = Number(e);
767
767
  return !Number.isFinite(n) || n < 0 || n > 20 ? null : Math.round(n * 100);
768
768
  }
769
- function pt(t, e, n = "half-up") {
769
+ function gt(t, e, n = "half-up") {
770
770
  if (t === 0n || e <= 0) return t;
771
771
  const a = t < 0n ? -1n : 1n, r = t < 0n ? -t : t, o = r.toString().length - e;
772
772
  if (o <= 0) return t;
773
773
  const l = 10n ** BigInt(o);
774
774
  return (n === "floor" ? r / l * l : (r + l / 2n) / l * l) * a;
775
775
  }
776
- function ze(t) {
776
+ function Xe(t) {
777
777
  return t.includes(".") ? t.replace(/\.?0+$/, "") : t;
778
778
  }
779
779
  function _e(t, e, n = 4) {
780
- return t == null ? "--" : ze(Ot(pt(t, n), e));
780
+ return t == null ? "--" : Xe(kt(gt(t, n), e));
781
781
  }
782
- function Fr(t, e, n = 4) {
783
- return t == null ? "--" : ze(
784
- Ot(pt(t, n, "floor"), e)
782
+ function Vr(t, e, n = 4) {
783
+ return t == null ? "--" : Xe(
784
+ kt(gt(t, n, "floor"), e)
785
785
  );
786
786
  }
787
- function Cn(t, e) {
787
+ function On(t, e) {
788
788
  return t == null ? "" : _e(t, e);
789
789
  }
790
- function Ur(t, e) {
791
- return t == null ? "" : ze(Ot(t, e));
790
+ function qr(t, e) {
791
+ return t == null ? "" : Xe(kt(t, e));
792
792
  }
793
- function $r(t, e = 4) {
794
- return t == null ? "--" : ze(Ci(pt(t, e)));
793
+ function Gr(t, e = 4) {
794
+ return t == null ? "--" : Xe(Bi(gt(t, e)));
795
795
  }
796
- function Wr(t, e = 4) {
797
- return t == null ? "--" : ze(Mi(pt(t, e)));
796
+ function zr(t, e = 4) {
797
+ return t == null ? "--" : Xe(ki(gt(t, e)));
798
798
  }
799
- function Ue(t) {
800
- return (e, n) => We({ ...n, type: t, title: e });
799
+ function He(t) {
800
+ return (e, n) => qe({ ...n, type: t, title: e });
801
801
  }
802
- function xt(t, e) {
802
+ function Pt(t, e) {
803
803
  const n = typeof t == "function" ? t(e) : t;
804
804
  return typeof n == "string" ? { title: n } : n;
805
805
  }
806
- const ye = Object.assign(Ue("info"), {
807
- info: Ue("info"),
808
- success: Ue("success"),
809
- error: Ue("error"),
810
- loading: Ue("loading"),
806
+ const ye = Object.assign(He("info"), {
807
+ info: He("info"),
808
+ success: He("success"),
809
+ error: He("error"),
810
+ loading: He("loading"),
811
811
  dismiss(t) {
812
812
  ve(t);
813
813
  },
814
814
  promise(t, e) {
815
- const n = typeof e.loading == "string" ? { title: e.loading } : e.loading, a = We({ ...n, id: e.id, type: "loading" });
815
+ const n = typeof e.loading == "string" ? { title: e.loading } : e.loading, a = qe({ ...n, id: e.id, type: "loading" });
816
816
  let r;
817
817
  try {
818
818
  r = typeof t == "function" ? t() : t;
819
819
  } catch (s) {
820
- throw We({ ...xt(e.error, s), id: a, type: "error" }), s;
820
+ throw qe({ ...Pt(e.error, s), id: a, type: "error" }), s;
821
821
  }
822
822
  return r.then(
823
823
  (s) => {
824
- We({ ...xt(e.success, s), id: a, type: "success" });
824
+ qe({ ...Pt(e.success, s), id: a, type: "success" });
825
825
  },
826
826
  (s) => {
827
- We({ ...xt(e.error, s), id: a, type: "error" });
827
+ qe({ ...Pt(e.error, s), id: a, type: "error" });
828
828
  }
829
829
  ), a;
830
830
  }
831
- }), Hr = 4e3;
832
- function Vr({
831
+ }), Kr = 4e3;
832
+ function jr({
833
833
  enabled: t,
834
834
  status: e,
835
835
  progress: n,
@@ -837,8 +837,8 @@ function Vr({
837
837
  explorerUrl: r,
838
838
  successDescription: s
839
839
  }) {
840
- const o = W({ currentId: null, terminal: !1, lastId: null }), l = (n == null ? void 0 : n.state) ?? null, u = (n == null ? void 0 : n.label) ?? null;
841
- U(() => {
840
+ const o = $({ currentId: null, terminal: !1, lastId: null }), l = (n == null ? void 0 : n.state) ?? null, u = (n == null ? void 0 : n.label) ?? null;
841
+ F(() => {
842
842
  const c = o.current;
843
843
  if (!t) {
844
844
  c.currentId && !c.terminal && ye.dismiss(c.currentId), c.currentId = null, c.terminal = !1;
@@ -849,7 +849,7 @@ function Vr({
849
849
  c.currentId = ye.error(u, {
850
850
  id: c.currentId ?? void 0,
851
851
  action: f,
852
- duration: u === ii ? Hr : Jn
852
+ duration: u === ci ? Kr : aa
853
853
  }), c.terminal = !0, c.lastId = c.currentId;
854
854
  return;
855
855
  }
@@ -861,14 +861,14 @@ function Vr({
861
861
  }), c.terminal = !0, c.lastId = c.currentId;
862
862
  return;
863
863
  }
864
- if ((l === "pending" || l === "mining") && $n(e) && u) {
864
+ if ((l === "pending" || l === "mining") && qn(e) && u) {
865
865
  (!c.currentId || c.terminal) && (c.lastId && ye.dismiss(c.lastId), c.currentId = null, c.terminal = !1), c.currentId = ye.loading(u, {
866
866
  id: c.currentId ?? void 0
867
867
  }), c.lastId = c.currentId;
868
868
  return;
869
869
  }
870
870
  c.currentId && !c.terminal && (ye.dismiss(c.currentId), c.currentId = null);
871
- }, [t, r, u, l, e, s, a]), U(
871
+ }, [t, r, u, l, e, s, a]), F(
872
872
  () => () => {
873
873
  const c = o.current;
874
874
  c.currentId && !c.terminal && ye.dismiss(c.currentId);
@@ -876,11 +876,11 @@ function Vr({
876
876
  []
877
877
  );
878
878
  }
879
- function ta(t, e, { initial: n, label: a, equals: r = Object.is }) {
880
- const s = W(t);
879
+ function ra(t, e, { initial: n, label: a, equals: r = Object.is }) {
880
+ const s = $(t);
881
881
  s.current = t;
882
- const o = W(n);
883
- U(() => {
882
+ const o = $(n);
883
+ F(() => {
884
884
  var l;
885
885
  if (!r(o.current, e)) {
886
886
  o.current = e;
@@ -892,35 +892,35 @@ function ta(t, e, { initial: n, label: a, equals: r = Object.is }) {
892
892
  }
893
893
  });
894
894
  }
895
- function qr(t, e) {
896
- ta(t ? (a) => {
895
+ function Xr(t, e) {
896
+ ra(t ? (a) => {
897
897
  a !== void 0 && t(a);
898
898
  } : void 0, e, { initial: e, label: "onPoolChange" });
899
899
  }
900
- function na(t, e) {
901
- return Dt(t, e, /* @__PURE__ */ new WeakSet());
900
+ function sa(t, e) {
901
+ return Bt(t, e, /* @__PURE__ */ new WeakSet());
902
902
  }
903
- function Dt(t, e, n) {
903
+ function Bt(t, e, n) {
904
904
  if (t === e) return !0;
905
905
  if (typeof t != typeof e || typeof t != "object" || t === null || e === null || n.has(t)) return !1;
906
906
  n.add(t);
907
907
  try {
908
908
  if (Array.isArray(t))
909
- return !Array.isArray(e) || t.length !== e.length ? !1 : t.every((o, l) => Dt(o, e[l], n));
909
+ return !Array.isArray(e) || t.length !== e.length ? !1 : t.every((o, l) => Bt(o, e[l], n));
910
910
  if (Array.isArray(e)) return !1;
911
911
  const a = t, r = e, s = Object.keys(a);
912
912
  return s.length !== Object.keys(r).length ? !1 : s.every(
913
- (o) => Object.prototype.hasOwnProperty.call(r, o) && Dt(a[o], r[o], n)
913
+ (o) => Object.prototype.hasOwnProperty.call(r, o) && Bt(a[o], r[o], n)
914
914
  );
915
915
  } finally {
916
916
  n.delete(t);
917
917
  }
918
918
  }
919
- function Ee(t) {
920
- const e = W(t);
921
- return na(e.current, t) || (e.current = t), e.current;
919
+ function Ce(t) {
920
+ const e = $(t);
921
+ return sa(e.current, t) || (e.current = t), e.current;
922
922
  }
923
- const Gr = {
923
+ const Yr = {
924
924
  status: "idle",
925
925
  progress: null,
926
926
  label: null,
@@ -930,14 +930,14 @@ const Gr = {
930
930
  txHash: null,
931
931
  error: null
932
932
  };
933
- function zr(t, e) {
934
- ta(t, e, {
935
- initial: Gr,
933
+ function Qr(t, e) {
934
+ ra(t, e, {
935
+ initial: Yr,
936
936
  label: "onStatusChange",
937
- equals: na
937
+ equals: sa
938
938
  });
939
939
  }
940
- async function Kr({
940
+ async function Zr({
941
941
  wallet: t,
942
942
  publicClient: e,
943
943
  activeChain: n,
@@ -950,7 +950,7 @@ async function Kr({
950
950
  setStatus: c
951
951
  }) {
952
952
  try {
953
- return await ri({
953
+ return await ui({
954
954
  provider: t.provider,
955
955
  publicClient: e,
956
956
  account: t.account,
@@ -964,8 +964,8 @@ async function Kr({
964
964
  allowanceRead: u
965
965
  });
966
966
  } catch (f) {
967
- if (si(f)) throw f;
968
- return c("approving"), await oi({
967
+ if (di(f)) throw f;
968
+ return c("approving"), await pi({
969
969
  provider: t.provider,
970
970
  publicClient: e,
971
971
  account: t.account,
@@ -975,11 +975,11 @@ async function Kr({
975
975
  router: r,
976
976
  // undefined -> MAX_UINT160, mirroring the 'max' permit sizing above.
977
977
  amount: l === "max" ? void 0 : o,
978
- expiration: Math.floor(Date.now() / 1e3) + li
978
+ expiration: Math.floor(Date.now() / 1e3) + fi
979
979
  }), null;
980
980
  }
981
981
  }
982
- async function jr({
982
+ async function Jr({
983
983
  wallet: t,
984
984
  publicClient: e,
985
985
  activeChain: n,
@@ -992,7 +992,7 @@ async function jr({
992
992
  setTxHash: c,
993
993
  onSubmitted: f
994
994
  }) {
995
- const m = BigInt(Math.floor(Date.now() / 1e3) + Wn), I = ci(o), E = o.mode === "exactOut" ? ui({
995
+ const m = BigInt(Math.floor(Date.now() / 1e3) + Gn), I = hi(o), E = o.mode === "exactOut" ? gi({
996
996
  poolKey: o.poolKey,
997
997
  zeroForOne: o.zeroForOne,
998
998
  amountOut: o.grossAmountOut,
@@ -1001,7 +1001,7 @@ async function jr({
1001
1001
  deadline: m,
1002
1002
  permit: l,
1003
1003
  fee: I
1004
- }) : di({
1004
+ }) : mi({
1005
1005
  poolKey: o.poolKey,
1006
1006
  zeroForOne: o.zeroForOne,
1007
1007
  amountIn: o.amountIn,
@@ -1012,10 +1012,10 @@ async function jr({
1012
1012
  fee: I
1013
1013
  });
1014
1014
  u("submitting");
1015
- const v = Ri({
1015
+ const v = Li({
1016
1016
  account: t.account,
1017
1017
  chain: n.chain,
1018
- transport: Di(t.provider)
1018
+ transport: Fi(t.provider)
1019
1019
  }), w = await e.estimateGas({
1020
1020
  account: t.account,
1021
1021
  to: a.router,
@@ -1042,35 +1042,35 @@ async function jr({
1042
1042
  console.warn("[AegisSwapWidget] onSubmitted callback failed", A);
1043
1043
  }
1044
1044
  let R = null;
1045
- const D = await e.waitForTransactionReceipt({
1045
+ const O = await e.waitForTransactionReceipt({
1046
1046
  hash: b,
1047
1047
  onReplaced: (A) => {
1048
1048
  R = A.reason, c(A.transaction.hash);
1049
1049
  }
1050
1050
  });
1051
1051
  if (R === "cancelled") throw new Error("Swap was cancelled in the wallet.");
1052
- if (D.status === "reverted") throw new Error("Swap reverted on-chain.");
1053
- const B = D.gasUsed ?? 0n, S = D.effectiveGasPrice ?? 0n, h = {
1054
- transactionHash: D.transactionHash,
1055
- blockNumber: D.blockNumber ?? 0n,
1052
+ if (O.status === "reverted") throw new Error("Swap reverted on-chain.");
1053
+ const B = O.gasUsed ?? 0n, S = O.effectiveGasPrice ?? 0n, h = {
1054
+ transactionHash: O.transactionHash,
1055
+ blockNumber: O.blockNumber ?? 0n,
1056
1056
  gasUsed: B,
1057
1057
  effectiveGasPrice: S,
1058
1058
  feeWei: B * S
1059
1059
  };
1060
- return { receipt: D, summary: h, swapDetails: x };
1060
+ return { receipt: O, summary: h, swapDetails: x };
1061
1061
  }
1062
- async function Xr(t, e) {
1063
- return await Gn(
1064
- () => qe(t),
1062
+ async function es(t, e) {
1063
+ return await Xn(
1064
+ () => Ke(t),
1065
1065
  (a) => a === e,
1066
1066
  12,
1067
1067
  250
1068
1068
  ) === e;
1069
1069
  }
1070
- function Yr(t, e) {
1071
- return Gn(t, (n) => n >= e, 5, 300);
1070
+ function ts(t, e) {
1071
+ return Xn(t, (n) => n >= e, 5, 300);
1072
1072
  }
1073
- function Qr({
1073
+ function ns({
1074
1074
  publicClient: t,
1075
1075
  activeChain: e,
1076
1076
  market: n,
@@ -1090,52 +1090,52 @@ function Qr({
1090
1090
  commitAllowance: b,
1091
1091
  approvalMode: x,
1092
1092
  refreshBalances: R,
1093
- refreshAllowances: D,
1093
+ refreshAllowances: O,
1094
1094
  onSubmitted: B,
1095
1095
  onSuccess: S,
1096
1096
  onError: h
1097
1097
  }) {
1098
- const [A, y] = P("idle"), [M, V] = P(null), [z, N] = P(null), [te, K] = P({
1098
+ const [A, y] = T("idle"), [M, H] = T(null), [z, N] = T(null), [te, K] = T({
1099
1099
  required: !1,
1100
1100
  done: !1
1101
- }), [d, _] = P(null), q = O(() => {
1102
- y("idle"), V(null), N(null), K({ required: !1, done: !1 }), _(null);
1103
- }, []), k = O(async () => {
1104
- let g = await I(), T = m;
1105
- if (!g || !T) {
1106
- const $ = await E();
1107
- g = ($ == null ? void 0 : $.provider) ?? g, T = T ?? ($ == null ? void 0 : $.account) ?? null;
1101
+ }), [d, _] = T(null), V = D(() => {
1102
+ y("idle"), H(null), N(null), K({ required: !1, done: !1 }), _(null);
1103
+ }, []), L = D(async () => {
1104
+ let g = await I(), C = m;
1105
+ if (!g || !C) {
1106
+ const U = await E();
1107
+ g = (U == null ? void 0 : U.provider) ?? g, C = C ?? (U == null ? void 0 : U.account) ?? null;
1108
1108
  }
1109
1109
  if (!g)
1110
1110
  return N("No wallet provider found."), null;
1111
- if (!T)
1111
+ if (!C)
1112
1112
  return N("Wallet connection was not completed."), null;
1113
- const H = await qe(g);
1114
- if (v(H), H !== e.chainId) {
1115
- await pi(g, e);
1116
- const $ = await Xr(g, e.chainId);
1117
- if (v($ ? e.chainId : await qe(g)), !$)
1113
+ const W = await Ke(g);
1114
+ if (v(W), W !== e.chainId) {
1115
+ await wi(g, e);
1116
+ const U = await es(g, e.chainId);
1117
+ if (v(U ? e.chainId : await Ke(g)), !U)
1118
1118
  return N("Network switch did not complete. Switch to the correct network and try again."), null;
1119
1119
  }
1120
- return { provider: g, account: T };
1121
- }, [e, E, I, m, v]), ne = O(
1122
- async (g, T) => {
1120
+ return { provider: g, account: C };
1121
+ }, [e, E, I, m, v]), X = D(
1122
+ async (g, C) => {
1123
1123
  if (!n || l === null || !o || o <= 0n) {
1124
1124
  N("Enter a valid amount and slippage, then try again."), y("idle");
1125
1125
  return;
1126
1126
  }
1127
- const H = T !== void 0 ? Promise.resolve(T) : w(g.account, n).catch(() => null), $ = Hn({
1127
+ const W = C !== void 0 ? Promise.resolve(C) : w(g.account, n).catch(() => null), U = zn({
1128
1128
  publicClient: t,
1129
1129
  permit2: n.permit2,
1130
1130
  account: g.account,
1131
1131
  token: a.address,
1132
1132
  router: n.router
1133
1133
  });
1134
- $.catch(() => {
1134
+ U.catch(() => {
1135
1135
  });
1136
- let Y;
1136
+ let Ie;
1137
1137
  try {
1138
- const F = await Vn({
1138
+ const pe = await Kn({
1139
1139
  publicClient: t,
1140
1140
  account: g.account,
1141
1141
  market: n,
@@ -1145,66 +1145,66 @@ function Qr({
1145
1145
  amount: o,
1146
1146
  slippageBps: l,
1147
1147
  fee: u
1148
- }), Ce = fi(c, F);
1149
- if (Ce.priceMovedBeyondTolerance) {
1150
- f(F), N(
1148
+ }), Ee = bi(c, pe);
1149
+ if (Ee.priceMovedBeyondTolerance) {
1150
+ f(pe), N(
1151
1151
  "Price moved beyond your slippage tolerance. Review the updated quote and try again."
1152
1152
  ), y("idle");
1153
1153
  return;
1154
1154
  }
1155
- Y = Ce.quote;
1156
- } catch (F) {
1157
- N(Ne(F, "Quote unavailable. Try again.")), y("idle");
1155
+ Ie = Ee.quote;
1156
+ } catch (pe) {
1157
+ N(Re(pe, "Quote unavailable. Try again.")), y("idle");
1158
1158
  return;
1159
1159
  }
1160
- f(Y);
1161
- const pe = Nt(Y);
1162
- if (pe <= 0n) {
1160
+ f(Ie);
1161
+ const Se = Tt(Ie);
1162
+ if (Se <= 0n) {
1163
1163
  N("Quote returned an empty amount. Try again."), y("idle");
1164
1164
  return;
1165
1165
  }
1166
- const ue = await H ?? await w(g.account, n);
1167
- if (b(g.account, n, ue), ue < pe) {
1166
+ const ae = await W ?? await w(g.account, n);
1167
+ if (b(g.account, n, ae), ae < Se) {
1168
1168
  K({ required: !0, done: !1 }), N(`Approve ${a.symbol} before swapping.`), y("idle");
1169
1169
  return;
1170
1170
  }
1171
1171
  y("signing");
1172
- const Ke = await Kr({
1172
+ const Ae = await Zr({
1173
1173
  wallet: g,
1174
1174
  publicClient: t,
1175
1175
  activeChain: e,
1176
1176
  permit2: n.permit2,
1177
1177
  router: n.router,
1178
1178
  token: a.address,
1179
- amount: pe,
1179
+ amount: Se,
1180
1180
  approvalMode: x,
1181
- allowanceRead: $,
1181
+ allowanceRead: U,
1182
1182
  setStatus: y
1183
- }), { receipt: je, summary: ft, swapDetails: Te } = await jr({
1183
+ }), { receipt: ue, summary: Ye, swapDetails: mt } = await Jr({
1184
1184
  wallet: g,
1185
1185
  publicClient: t,
1186
1186
  activeChain: e,
1187
1187
  market: n,
1188
1188
  inputToken: a,
1189
1189
  outputToken: r,
1190
- swapQuote: Y,
1191
- permit: Ke,
1190
+ swapQuote: Ie,
1191
+ permit: Ae,
1192
1192
  setStatus: y,
1193
- setTxHash: V,
1193
+ setTxHash: H,
1194
1194
  onSubmitted: B
1195
1195
  });
1196
- _(ft), y("success");
1196
+ _(Ye), y("success");
1197
1197
  try {
1198
1198
  S == null || S({
1199
- hash: je.transactionHash,
1200
- explorerUrl: qn(je.transactionHash, e),
1201
- swap: Te
1199
+ hash: ue.transactionHash,
1200
+ explorerUrl: jn(ue.transactionHash, e),
1201
+ swap: mt
1202
1202
  }), await Promise.all([
1203
1203
  R(g.account),
1204
- D(g.account, n)
1204
+ O(g.account, n)
1205
1205
  ]);
1206
- } catch (F) {
1207
- console.warn("[AegisSwapWidget] Post-success refresh failed", F);
1206
+ } catch (pe) {
1207
+ console.warn("[AegisSwapWidget] Post-success refresh failed", pe);
1208
1208
  }
1209
1209
  },
1210
1210
  [
@@ -1222,95 +1222,95 @@ function Qr({
1222
1222
  c,
1223
1223
  s,
1224
1224
  w,
1225
- D,
1225
+ O,
1226
1226
  R,
1227
1227
  f,
1228
1228
  l
1229
1229
  ]
1230
- ), re = O(async () => {
1231
- N(null), V(null), _(null);
1230
+ ), ne = D(async () => {
1231
+ N(null), H(null), _(null);
1232
1232
  try {
1233
- const g = await k();
1233
+ const g = await L();
1234
1234
  if (!g) return;
1235
- await ne(g);
1235
+ await X(g);
1236
1236
  } catch (g) {
1237
- if (g instanceof vn) {
1237
+ if (g instanceof An) {
1238
1238
  N("Transaction is still pending. Check its status via the transaction link."), y("idle");
1239
1239
  return;
1240
1240
  }
1241
- const T = Ne(g, "Swap failed."), H = g instanceof Error ? g : new Error(T);
1242
- N(T), y("idle"), h == null || h(H);
1241
+ const C = Re(g, "Swap failed."), W = g instanceof Error ? g : new Error(C);
1242
+ N(C), y("idle"), h == null || h(W);
1243
1243
  }
1244
- }, [k, h, ne]), L = O(async () => {
1245
- N(null), V(null), _(null), K({ required: !0, done: !1 });
1244
+ }, [L, h, X]), k = D(async () => {
1245
+ N(null), H(null), _(null), K({ required: !0, done: !1 });
1246
1246
  let g = !1;
1247
1247
  try {
1248
- const T = await k();
1249
- if (!T) return;
1248
+ const C = await L();
1249
+ if (!C) return;
1250
1250
  if (!n || !c || o === null || o <= 0n) {
1251
1251
  N("Enter a valid amount before approving.");
1252
1252
  return;
1253
1253
  }
1254
- const H = Nt(c);
1255
- if (H <= 0n) {
1254
+ const W = Tt(c);
1255
+ if (W <= 0n) {
1256
1256
  N("Enter a valid amount before approving.");
1257
1257
  return;
1258
1258
  }
1259
- let $ = await w(T.account, n);
1260
- if (b(T.account, n, $), $ < H && (y("approving"), await hi({
1261
- provider: T.provider,
1259
+ let U = await w(C.account, n);
1260
+ if (b(C.account, n, U), U < W && (y("approving"), await yi({
1261
+ provider: C.provider,
1262
1262
  publicClient: t,
1263
- account: T.account,
1263
+ account: C.account,
1264
1264
  chain: e.chain,
1265
1265
  token: a.address,
1266
1266
  permit2: n.permit2,
1267
- amount: x === "exact" ? H : void 0
1268
- }), $ = await Yr(
1269
- () => w(T.account, n),
1270
- H
1271
- ), b(T.account, n, $), $ < H)) {
1267
+ amount: x === "exact" ? W : void 0
1268
+ }), U = await ts(
1269
+ () => w(C.account, n),
1270
+ W
1271
+ ), b(C.account, n, U), U < W)) {
1272
1272
  N("Approval confirmed, but allowance is still below this quote. Try again."), y("idle");
1273
1273
  return;
1274
1274
  }
1275
- K({ required: !0, done: !0 }), g = !0, await ne(T, $);
1276
- } catch (T) {
1277
- if (T instanceof vn) {
1275
+ K({ required: !0, done: !0 }), g = !0, await X(C, U);
1276
+ } catch (C) {
1277
+ if (C instanceof An) {
1278
1278
  N(
1279
1279
  g ? "Transaction is still pending. Check its status via the transaction link." : "Approval is still pending. Wait for it to confirm, then try again."
1280
1280
  ), y("idle");
1281
1281
  return;
1282
1282
  }
1283
- const H = Ne(T, g ? "Swap failed." : "Approval failed."), $ = T instanceof Error ? T : new Error(H);
1284
- N(H), y("idle"), h == null || h($);
1283
+ const W = Re(C, g ? "Swap failed." : "Approval failed."), U = C instanceof Error ? C : new Error(W);
1284
+ N(W), y("idle"), h == null || h(U);
1285
1285
  }
1286
1286
  }, [
1287
1287
  o,
1288
1288
  e.chain,
1289
1289
  x,
1290
1290
  b,
1291
- k,
1291
+ L,
1292
1292
  a.address,
1293
1293
  n,
1294
1294
  h,
1295
- ne,
1295
+ X,
1296
1296
  t,
1297
1297
  c,
1298
1298
  w
1299
1299
  ]);
1300
1300
  return {
1301
- submit: re,
1302
- approveInputToken: L,
1303
- reset: q,
1301
+ submit: ne,
1302
+ approveInputToken: k,
1303
+ reset: V,
1304
1304
  status: A,
1305
- busy: $n(A),
1305
+ busy: qn(A),
1306
1306
  txHash: M,
1307
1307
  actionError: z,
1308
1308
  approvalProgress: te,
1309
1309
  receiptSummary: d
1310
1310
  };
1311
1311
  }
1312
- const Zr = 250, Jr = 5e3;
1313
- function es({
1312
+ const as = 250, is = 5e3;
1313
+ function rs({
1314
1314
  owner: t,
1315
1315
  market: e,
1316
1316
  inputToken: n,
@@ -1321,19 +1321,19 @@ function es({
1321
1321
  feeConfig: l
1322
1322
  }) {
1323
1323
  return [
1324
- xe(t),
1324
+ Me(t),
1325
1325
  (e == null ? void 0 : e.chainId) ?? "",
1326
1326
  (e == null ? void 0 : e.poolId.toLowerCase()) ?? "",
1327
- xe(n.address),
1328
- xe(a.address),
1327
+ Me(n.address),
1328
+ Me(a.address),
1329
1329
  r,
1330
1330
  (s == null ? void 0 : s.toString()) ?? "",
1331
1331
  o ?? "",
1332
1332
  (l == null ? void 0 : l.bps) ?? "",
1333
- xe(l == null ? void 0 : l.recipient)
1333
+ Me(l == null ? void 0 : l.recipient)
1334
1334
  ].join("|");
1335
1335
  }
1336
- function ts({
1336
+ function ss({
1337
1337
  publicClient: t,
1338
1338
  owner: e,
1339
1339
  market: n,
@@ -1346,8 +1346,8 @@ function ts({
1346
1346
  onQuote: c,
1347
1347
  pausedRef: f
1348
1348
  }) {
1349
- const [m, I] = P(null), [E, v] = P(!1), [w, b] = P(null), x = J(
1350
- () => es({
1349
+ const [m, I] = T(null), [E, v] = T(!1), [w, b] = T(null), x = J(
1350
+ () => rs({
1351
1351
  owner: e,
1352
1352
  market: n,
1353
1353
  inputToken: a,
@@ -1358,30 +1358,30 @@ function ts({
1358
1358
  feeConfig: u
1359
1359
  }),
1360
1360
  [o, u, a, n, r, e, s, l]
1361
- ), R = (m == null ? void 0 : m.key) === x ? m.quote : null, D = O(
1361
+ ), R = (m == null ? void 0 : m.key) === x ? m.quote : null, O = D(
1362
1362
  (h) => {
1363
1363
  I(h ? { key: x, quote: h } : null);
1364
1364
  },
1365
1365
  [x]
1366
- ), B = W(c);
1366
+ ), B = $(c);
1367
1367
  B.current = c;
1368
- const S = O(() => {
1368
+ const S = D(() => {
1369
1369
  I(null), b(null);
1370
1370
  }, []);
1371
- return U(() => {
1371
+ return F(() => {
1372
1372
  const h = new AbortController();
1373
1373
  let A = !1, y = !1, M;
1374
1374
  I(null), b(null);
1375
- const V = e, z = n, N = o, te = l;
1376
- if (!V || !z || !N || N <= 0n || te === null)
1375
+ const H = e, z = n, N = o, te = l;
1376
+ if (!H || !z || !N || N <= 0n || te === null)
1377
1377
  return v(!1), () => h.abort();
1378
- const K = V, d = z, _ = N, q = te;
1379
- async function k(L) {
1378
+ const K = H, d = z, _ = N, V = te;
1379
+ async function L(k) {
1380
1380
  var g;
1381
1381
  if (!(y || h.signal.aborted)) {
1382
- y = !0, L && v(!0);
1382
+ y = !0, k && v(!0);
1383
1383
  try {
1384
- const T = await Vn({
1384
+ const C = await Kn({
1385
1385
  publicClient: t,
1386
1386
  account: K,
1387
1387
  market: d,
@@ -1389,31 +1389,31 @@ function ts({
1389
1389
  tokenOut: r,
1390
1390
  mode: s,
1391
1391
  amount: _,
1392
- slippageBps: q,
1392
+ slippageBps: V,
1393
1393
  fee: u,
1394
1394
  signal: h.signal
1395
1395
  });
1396
1396
  if (A || h.signal.aborted) return;
1397
1397
  I(
1398
- (H) => H && H.key === x && gi(H.quote, T) ? H : { key: x, quote: T }
1399
- ), b(null), (g = B.current) == null || g.call(B, T);
1400
- } catch (T) {
1398
+ (W) => W && W.key === x && vi(W.quote, C) ? W : { key: x, quote: C }
1399
+ ), b(null), (g = B.current) == null || g.call(B, C);
1400
+ } catch (C) {
1401
1401
  if (A || h.signal.aborted) return;
1402
- b(Ne(T, "Quote unavailable."));
1402
+ b(Re(C, "Quote unavailable."));
1403
1403
  } finally {
1404
1404
  y = !1, !A && !h.signal.aborted && v(!1);
1405
1405
  }
1406
1406
  }
1407
1407
  }
1408
- const ne = window.setTimeout(() => {
1409
- k(!0), M = window.setInterval(() => {
1410
- !(f != null && f.current) && Ve() && k(!1);
1411
- }, Jr);
1412
- }, Zr), re = () => {
1413
- !(f != null && f.current) && Ve() && k(!1);
1408
+ const X = window.setTimeout(() => {
1409
+ L(!0), M = window.setInterval(() => {
1410
+ !(f != null && f.current) && ze() && L(!1);
1411
+ }, is);
1412
+ }, as), ne = () => {
1413
+ !(f != null && f.current) && ze() && L(!1);
1414
1414
  };
1415
- return document.addEventListener("visibilitychange", re), () => {
1416
- A = !0, window.clearTimeout(ne), M !== void 0 && window.clearInterval(M), document.removeEventListener("visibilitychange", re), h.abort();
1415
+ return document.addEventListener("visibilitychange", ne), () => {
1416
+ A = !0, window.clearTimeout(X), M !== void 0 && window.clearInterval(M), document.removeEventListener("visibilitychange", ne), h.abort();
1417
1417
  };
1418
1418
  }, [
1419
1419
  o,
@@ -1426,17 +1426,17 @@ function ts({
1426
1426
  s,
1427
1427
  x,
1428
1428
  l
1429
- ]), { quote: R, quoteLoading: E, quoteError: w, setQuote: D, clearQuote: S };
1429
+ ]), { quote: R, quoteLoading: E, quoteError: w, setQuote: O, clearQuote: S };
1430
1430
  }
1431
- function Mn(t, e, n, a) {
1432
- return !t || !e || !It(t.owner, e) || !It(t.token, n) || !It(t.spender, a) ? null : t;
1431
+ function Bn(t, e, n, a) {
1432
+ return !t || !e || !At(t.owner, e) || !At(t.token, n) || !At(t.spender, a) ? null : t;
1433
1433
  }
1434
- function Rn(t, e) {
1434
+ function kn(t, e) {
1435
1435
  if (!t || e === void 0 || e <= 0n) return !1;
1436
1436
  const n = Math.floor(Date.now() / 1e3);
1437
- return t.amount >= e && t.expiration > n + Wn;
1437
+ return t.amount >= e && t.expiration > n + Gn;
1438
1438
  }
1439
- function ns({
1439
+ function os({
1440
1440
  publicClient: t,
1441
1441
  owner: e,
1442
1442
  market: n,
@@ -1444,27 +1444,27 @@ function ns({
1444
1444
  spendAmount: r
1445
1445
  }) {
1446
1446
  var K;
1447
- const [s, o] = P(null), [l, u] = P(null), [c, f] = P(!1), [m, I] = P(!1), [E, v] = P(null), [w, b] = P(null), x = O(
1447
+ const [s, o] = T(null), [l, u] = T(null), [c, f] = T(!1), [m, I] = T(!1), [E, v] = T(null), [w, b] = T(null), x = D(
1448
1448
  async (d, _) => t.readContract({
1449
1449
  address: a.address,
1450
- abi: zn,
1450
+ abi: Yn,
1451
1451
  functionName: "allowance",
1452
1452
  args: [d, _.permit2]
1453
1453
  }),
1454
1454
  [a.address, t]
1455
- ), R = O(
1456
- (d, _, q) => {
1455
+ ), R = D(
1456
+ (d, _, V) => {
1457
1457
  o({
1458
1458
  owner: d,
1459
1459
  token: a.address,
1460
1460
  spender: _.permit2,
1461
- amount: q
1461
+ amount: V
1462
1462
  }), v(null);
1463
1463
  },
1464
1464
  [a.address]
1465
- ), D = O(
1465
+ ), O = D(
1466
1466
  async (d, _) => {
1467
- const [q, k] = await Hn({
1467
+ const [V, L] = await zn({
1468
1468
  publicClient: t,
1469
1469
  permit2: _.permit2,
1470
1470
  account: d,
@@ -1475,56 +1475,56 @@ function ns({
1475
1475
  owner: d,
1476
1476
  token: a.address,
1477
1477
  spender: _.router,
1478
- amount: q,
1479
- expiration: Number(k)
1478
+ amount: V,
1479
+ expiration: Number(L)
1480
1480
  };
1481
1481
  },
1482
1482
  [a.address, t]
1483
- ), B = O(
1483
+ ), B = D(
1484
1484
  async (d, _) => {
1485
- const [q, k] = await Promise.allSettled([
1485
+ const [V, L] = await Promise.allSettled([
1486
1486
  x(d, _),
1487
- D(d, _)
1487
+ O(d, _)
1488
1488
  ]);
1489
- d !== e || _.id !== (n == null ? void 0 : n.id) || (q.status === "fulfilled" && R(d, _, q.value), k.status === "fulfilled" && (u(k.value), b(null)));
1489
+ d !== e || _.id !== (n == null ? void 0 : n.id) || (V.status === "fulfilled" && R(d, _, V.value), L.status === "fulfilled" && (u(L.value), b(null)));
1490
1490
  },
1491
- [R, x, D, e, n]
1491
+ [R, x, O, e, n]
1492
1492
  ), S = r !== void 0 && r > 0n ? r : null, h = S !== null;
1493
- U(() => {
1493
+ F(() => {
1494
1494
  let d = !1;
1495
1495
  return v(null), !e || !n || !h ? (o(null), f(!1), () => {
1496
1496
  d = !0;
1497
- }) : (f(!0), mn(() => x(e, n), 3, 300, () => d).then((_) => {
1497
+ }) : (f(!0), vn(() => x(e, n), 3, 300, () => d).then((_) => {
1498
1498
  d || R(e, n, _);
1499
1499
  }).catch((_) => {
1500
- d || (o(null), v(Ne(_, "Approval check unavailable.")));
1500
+ d || (o(null), v(Re(_, "Approval check unavailable.")));
1501
1501
  }).finally(() => {
1502
1502
  d || f(!1);
1503
1503
  }), () => {
1504
1504
  d = !0;
1505
1505
  });
1506
- }, [R, h, n, e, x]), U(() => {
1506
+ }, [R, h, n, e, x]), F(() => {
1507
1507
  let d = !1;
1508
1508
  return b(null), !e || !n || !h ? (u(null), I(!1), () => {
1509
1509
  d = !0;
1510
- }) : (I(!0), mn(() => D(e, n), 3, 300, () => d).then((_) => {
1510
+ }) : (I(!0), vn(() => O(e, n), 3, 300, () => d).then((_) => {
1511
1511
  d || u(_);
1512
1512
  }).catch((_) => {
1513
1513
  d || (u(null), b(
1514
- Ne(_, "Authorization check unavailable.")
1514
+ Re(_, "Authorization check unavailable.")
1515
1515
  ));
1516
1516
  }).finally(() => {
1517
1517
  d || I(!1);
1518
1518
  }), () => {
1519
1519
  d = !0;
1520
1520
  });
1521
- }, [h, n, e, D]);
1522
- const A = n ? ((K = Mn(s, e, a.address, n.permit2)) == null ? void 0 : K.amount) ?? null : null, y = n ? Mn(l, e, a.address, n.router) : null, M = !!(e && n && h && !E && (c || A === null)), V = !!(e && n && S !== null && A !== null && A < S), z = !!(e && n && h && !V && !w && (m || y === null)), N = !!(e && n && h && !V && (w || y !== null && !Rn(y, r))), te = !!(e && n && h && !Rn(y, r));
1521
+ }, [h, n, e, O]);
1522
+ const A = n ? ((K = Bn(s, e, a.address, n.permit2)) == null ? void 0 : K.amount) ?? null : null, y = n ? Bn(l, e, a.address, n.router) : null, M = !!(e && n && h && !E && (c || A === null)), H = !!(e && n && S !== null && A !== null && A < S), z = !!(e && n && h && !H && !w && (m || y === null)), N = !!(e && n && h && !H && (w || y !== null && !kn(y, r))), te = !!(e && n && h && !kn(y, r));
1523
1523
  return {
1524
1524
  allowanceAmount: A,
1525
1525
  allowanceError: E,
1526
1526
  approvalCheckPending: M,
1527
- approvalRequired: V,
1527
+ approvalRequired: H,
1528
1528
  authorizationCheckPending: z,
1529
1529
  authorizationRequired: N,
1530
1530
  authorizationPromptExpected: te,
@@ -1533,52 +1533,52 @@ function ns({
1533
1533
  refreshAllowances: B
1534
1534
  };
1535
1535
  }
1536
- const as = 5e3, is = { input: null, output: null };
1537
- function st(t, e, n) {
1538
- return [t ?? "", xe(e), xe(n.address)].join("|");
1536
+ const ls = 5e3, cs = { input: null, output: null };
1537
+ function ct(t, e, n) {
1538
+ return [t ?? "", Me(e), Me(n.address)].join("|");
1539
1539
  }
1540
- function rs(t, e, n, a, r) {
1540
+ function us(t, e, n, a, r) {
1541
1541
  return t[e] === n && t[a] === r ? t : { ...t, [e]: n, [a]: r };
1542
1542
  }
1543
- function Dn(t, e, n) {
1543
+ function Ln(t, e, n) {
1544
1544
  return t.readContract({
1545
1545
  address: e.address,
1546
- abi: zn,
1546
+ abi: Yn,
1547
1547
  functionName: "balanceOf",
1548
1548
  args: [n]
1549
1549
  });
1550
1550
  }
1551
- function ss({
1551
+ function ds({
1552
1552
  publicClient: t,
1553
1553
  owner: e,
1554
1554
  inputToken: n,
1555
1555
  outputToken: a
1556
1556
  }) {
1557
1557
  var m;
1558
- const [r, s] = P({}), o = W(0), l = (m = t.chain) == null ? void 0 : m.id, u = J(
1558
+ const [r, s] = T({}), o = $(0), l = (m = t.chain) == null ? void 0 : m.id, u = J(
1559
1559
  () => e ? {
1560
- input: r[st(l, e, n)] ?? null,
1561
- output: r[st(l, e, a)] ?? null
1562
- } : is,
1560
+ input: r[ct(l, e, n)] ?? null,
1561
+ output: r[ct(l, e, a)] ?? null
1562
+ } : cs,
1563
1563
  [r, l, n, a, e]
1564
- ), c = O(
1564
+ ), c = D(
1565
1565
  async (I, E) => {
1566
- const v = ++o.current, w = st(l, I, n), b = st(l, I, a);
1566
+ const v = ++o.current, w = ct(l, I, n), b = ct(l, I, a);
1567
1567
  try {
1568
1568
  const [x, R] = await Promise.all([
1569
- Dn(t, n, I),
1570
- Dn(t, a, I)
1569
+ Ln(t, n, I),
1570
+ Ln(t, a, I)
1571
1571
  ]);
1572
- v === o.current && !(E != null && E()) && s((D) => rs(D, w, x, b, R));
1572
+ v === o.current && !(E != null && E()) && s((O) => us(O, w, x, b, R));
1573
1573
  } catch {
1574
1574
  }
1575
1575
  },
1576
1576
  [l, n, a, t]
1577
- ), f = O(
1577
+ ), f = D(
1578
1578
  (I) => c(I),
1579
1579
  [c]
1580
1580
  );
1581
- return U(() => {
1581
+ return F(() => {
1582
1582
  let I = !1;
1583
1583
  if (!e)
1584
1584
  return o.current += 1, s({}), () => {
@@ -1598,25 +1598,25 @@ function ss({
1598
1598
  }
1599
1599
  w();
1600
1600
  const b = window.setInterval(() => {
1601
- Ve() && w();
1602
- }, as), x = () => {
1603
- Ve() && w();
1601
+ ze() && w();
1602
+ }, ls), x = () => {
1603
+ ze() && w();
1604
1604
  };
1605
1605
  return document.addEventListener("visibilitychange", x), () => {
1606
1606
  I = !0, window.clearInterval(b), document.removeEventListener("visibilitychange", x);
1607
1607
  };
1608
1608
  }, [c, e]), { balances: u, refreshBalances: f };
1609
1609
  }
1610
- function os({
1610
+ function ps({
1611
1611
  endpoint: t,
1612
1612
  chainId: e,
1613
1613
  addresses: n
1614
1614
  }) {
1615
- const [a, r] = P({});
1616
- return U(() => {
1615
+ const [a, r] = T({});
1616
+ return F(() => {
1617
1617
  if (!t || !n.length) return;
1618
1618
  const s = new AbortController();
1619
- return mi({
1619
+ return _i({
1620
1620
  endpoint: t,
1621
1621
  chainId: e,
1622
1622
  addresses: n,
@@ -1635,37 +1635,37 @@ function os({
1635
1635
  }), () => s.abort();
1636
1636
  }, [n, e, t]), a;
1637
1637
  }
1638
- function ls({
1638
+ function fs({
1639
1639
  provider: t,
1640
1640
  controlledAccount: e,
1641
1641
  getProvider: n,
1642
1642
  onConnectWallet: a
1643
1643
  }) {
1644
- const [r, s] = P(null), [o, l] = P(null), [u, c] = P(null), f = O(async () => {
1644
+ const [r, s] = T(null), [o, l] = T(null), [u, c] = T(null), f = D(async () => {
1645
1645
  if (t) return t;
1646
1646
  if (n) {
1647
1647
  const v = await n();
1648
1648
  if (v) return v;
1649
1649
  }
1650
- return St();
1651
- }, [n, t]), m = t ?? u ?? St(), I = e ?? r;
1652
- U(() => {
1650
+ return Et();
1651
+ }, [n, t]), m = t ?? u ?? Et(), I = e ?? r;
1652
+ F(() => {
1653
1653
  let v = !1;
1654
1654
  return f().then((w) => {
1655
1655
  v || c(w);
1656
1656
  }).catch((w) => {
1657
- v || (console.warn("[AegisSwapWidget] Provider resolver unavailable", w), c(St()));
1657
+ v || (console.warn("[AegisSwapWidget] Provider resolver unavailable", w), c(Et()));
1658
1658
  }), () => {
1659
1659
  v = !0;
1660
1660
  };
1661
- }, [f]), U(() => {
1661
+ }, [f]), F(() => {
1662
1662
  if (!m) return;
1663
1663
  let v = !1;
1664
1664
  const w = async () => {
1665
1665
  try {
1666
1666
  const [x, R] = await Promise.all([
1667
- e ? Promise.resolve(e) : vi(m),
1668
- qe(m)
1667
+ e ? Promise.resolve(e) : Ei(m),
1668
+ Ke(m)
1669
1669
  ]);
1670
1670
  if (v) return;
1671
1671
  s(x), l(R);
@@ -1674,7 +1674,7 @@ function ls({
1674
1674
  }
1675
1675
  };
1676
1676
  w();
1677
- const b = wi(m, {
1677
+ const b = Ii(m, {
1678
1678
  onAccountsChanged: w,
1679
1679
  onChainChanged: w
1680
1680
  });
@@ -1682,24 +1682,24 @@ function ls({
1682
1682
  v = !0, b();
1683
1683
  };
1684
1684
  }, [e, m]);
1685
- const E = O(async () => {
1686
- const v = bi(
1685
+ const E = D(async () => {
1686
+ const v = Si(
1687
1687
  a ? await a() : void 0
1688
1688
  ), w = v.provider ?? await f();
1689
1689
  if (!w) return null;
1690
1690
  c(w);
1691
- const b = v.account ?? await yi(w), x = await qe(w);
1691
+ const b = v.account ?? await Ai(w), x = await Ke(w);
1692
1692
  return s(b), l(x), { provider: w, account: b };
1693
1693
  }, [f, a]);
1694
1694
  return { owner: I, walletChainId: o, setWalletChainId: l, getActiveProvider: f, connectWallet: E };
1695
1695
  }
1696
- function cs(t) {
1696
+ function hs(t) {
1697
1697
  return t === "sell" ? "sell" : "buy";
1698
1698
  }
1699
- function us(t) {
1699
+ function gs(t) {
1700
1700
  return `${t.slice(0, 6)}...${t.slice(-4)}`;
1701
1701
  }
1702
- function aa(t, e, n) {
1702
+ function oa(t, e, n) {
1703
1703
  switch (t) {
1704
1704
  case "ArrowRight":
1705
1705
  case "ArrowDown":
@@ -1715,7 +1715,7 @@ function aa(t, e, n) {
1715
1715
  return null;
1716
1716
  }
1717
1717
  }
1718
- function ds({
1718
+ function ms({
1719
1719
  busy: t,
1720
1720
  status: e,
1721
1721
  hasMarket: n,
@@ -1735,17 +1735,17 @@ function ds({
1735
1735
  approvalRequired: b,
1736
1736
  authorizationCheckPending: x,
1737
1737
  authorizationRequired: R,
1738
- inputSymbol: D,
1738
+ inputSymbol: O,
1739
1739
  targetSymbol: B,
1740
1740
  counterSymbol: S,
1741
1741
  direction: h
1742
1742
  }) {
1743
- const A = !r, y = r && s, M = !!(r && !s && l.trim() && !u && c && !f && m && !v), V = !!(M && b), z = !!(M && !w && !b && !x && R), N = !!(M && !w && !b && !x && !R), te = !!(!t && n && (A || y || V || z || N)), K = e === "approving" ? `Approving ${D}` : e === "signing" ? "Signing permit" : e === "submitting" ? "Swapping" : e === "success" ? "Swapped" : n ? A ? "Connect wallet" : y ? `Switch to ${o}` : l.trim() ? u ? "Invalid amount" : c ? f ? `Insufficient ${D}` : I ? "Fetching quote" : E ? "Quote unavailable" : v ? "Approval unavailable" : w ? "Checking approval" : b ? `Approve ${D} & swap` : x ? "Checking authorization" : R ? h === "buy" ? `Approve & swap to ${B}` : `Approve & swap to ${S}` : h === "buy" ? `Swap to ${B}` : `Swap to ${S}` : "Invalid slippage" : "Enter amount" : a ? "Pool unavailable" : "No pools available";
1743
+ const A = !r, y = r && s, M = !!(r && !s && l.trim() && !u && c && !f && m && !v), H = !!(M && b), z = !!(M && !w && !b && !x && R), N = !!(M && !w && !b && !x && !R), te = !!(!t && n && (A || y || H || z || N)), K = e === "approving" ? `Approving ${O}` : e === "signing" ? "Signing permit" : e === "submitting" ? "Swapping" : e === "success" ? "Swapped" : n ? A ? "Connect wallet" : y ? `Switch to ${o}` : l.trim() ? u ? "Invalid amount" : c ? f ? `Insufficient ${O}` : I ? "Fetching quote" : E ? "Quote unavailable" : v ? "Approval unavailable" : w ? "Checking approval" : b ? `Approve ${O} & swap` : x ? "Checking authorization" : R ? h === "buy" ? `Approve & swap to ${B}` : `Approve & swap to ${S}` : h === "buy" ? `Swap to ${B}` : `Swap to ${S}` : "Invalid slippage" : "Enter amount" : a ? "Pool unavailable" : "No pools available";
1744
1744
  return {
1745
1745
  canConnectWallet: A,
1746
1746
  canSwitchChain: y,
1747
1747
  validEntry: M,
1748
- canApprove: V,
1748
+ canApprove: H,
1749
1749
  canAuthorize: z,
1750
1750
  canSwap: N,
1751
1751
  canSubmit: te,
@@ -1753,7 +1753,7 @@ function ds({
1753
1753
  ctaLabel: K
1754
1754
  };
1755
1755
  }
1756
- function ps({
1756
+ function ws({
1757
1757
  quote: t,
1758
1758
  inputSymbol: e,
1759
1759
  inputDecimals: n,
@@ -1773,21 +1773,21 @@ function ps({
1773
1773
  value: `${_e(t.userAmountOutMinimum, r)} ${a}`
1774
1774
  }), s;
1775
1775
  }
1776
- const On = 3e3, Bn = 420, kn = 30;
1777
- function Ln(t) {
1776
+ const Fn = 3e3, Un = 420, $n = 30;
1777
+ function Wn(t) {
1778
1778
  const e = t.trim().match(/^(\d*\.?\d+)(ms|s)$/);
1779
1779
  if (!e) return null;
1780
1780
  const n = Number(e[1]);
1781
1781
  return Number.isFinite(n) ? e[2] === "s" ? n * 1e3 : n : null;
1782
1782
  }
1783
- function fs(t) {
1784
- const e = On + Bn + kn, n = t == null ? void 0 : t.ownerDocument.defaultView;
1783
+ function bs(t) {
1784
+ const e = Fn + Un + $n, n = t == null ? void 0 : t.ownerDocument.defaultView;
1785
1785
  if (!t || !n) return e;
1786
- const a = n.getComputedStyle(t), r = Ln(a.getPropertyValue("--aegis-rail-hold")) ?? On, s = Ln(a.getPropertyValue("--aegis-rail-fade")) ?? Bn;
1787
- return r + s + kn;
1786
+ const a = n.getComputedStyle(t), r = Wn(a.getPropertyValue("--aegis-rail-hold")) ?? Fn, s = Wn(a.getPropertyValue("--aegis-rail-fade")) ?? Un;
1787
+ return r + s + $n;
1788
1788
  }
1789
- function hs(t) {
1790
- var dn, pn;
1789
+ function ys(t) {
1790
+ var gn, mn;
1791
1791
  const {
1792
1792
  provider: e,
1793
1793
  account: n,
@@ -1799,7 +1799,7 @@ function hs(t) {
1799
1799
  onQuote: u,
1800
1800
  onStatusChange: c,
1801
1801
  onPoolChange: f,
1802
- chainId: m = wn,
1802
+ chainId: m = _n,
1803
1803
  chains: I,
1804
1804
  networkOptions: E,
1805
1805
  pools: v,
@@ -1807,416 +1807,427 @@ function hs(t) {
1807
1807
  poolIds: b,
1808
1808
  defaultDirection: x,
1809
1809
  defaultSlippagePercent: R = 1,
1810
- rpcUrls: D,
1810
+ rpcUrls: O,
1811
1811
  metadataEndpoint: B,
1812
1812
  className: S,
1813
1813
  style: h,
1814
1814
  title: A = "",
1815
1815
  subtitle: y = "",
1816
1816
  ariaLabel: M = "Aegis direct pool swap",
1817
- theme: V,
1817
+ theme: H,
1818
1818
  accentColor: z,
1819
1819
  accentTextColor: N,
1820
1820
  showPoolLink: te = !0,
1821
1821
  defaultApprovalMode: K = "exact",
1822
1822
  showApprovalMode: d = !0,
1823
1823
  showExecutionDetails: _ = !0,
1824
- defaultExecutionDetailsOpen: q = !1,
1825
- statusSurface: k = "rail",
1826
- toastPosition: ne = "bottom-right"
1827
- } = t, re = Zn(V), L = $e(), g = $e(), T = $e(), H = $e(), $ = Ee(I), Y = Ee(v), pe = Ee(b), ue = Ee(D), Ke = Ee(h), je = Ee(E), ft = J(() => {
1828
- const C = { ...Ke };
1824
+ defaultExecutionDetailsOpen: V = !1,
1825
+ executionDetailsOpen: L,
1826
+ onExecutionDetailsOpenChange: X,
1827
+ statusSurface: ne = "rail",
1828
+ toastPosition: k = "bottom-right"
1829
+ } = t, g = na(H), C = Ve(), W = Ve(), U = Ve(), Ie = Ve(), Se = Ce(I), ae = Ce(v), Ae = Ce(b), ue = Ce(O), Ye = Ce(h), mt = Ce(E), pe = J(() => {
1830
+ const P = { ...Ye };
1829
1831
  if (z) {
1830
- C["--aegis-swap-accent"] = z;
1831
- const X = N ?? Yn(z);
1832
- X && (C["--aegis-swap-accent-text"] = X);
1833
- } else N && (C["--aegis-swap-accent-text"] = N);
1834
- return C;
1835
- }, [z, N, Ke]), Te = J(() => _i($), [$]), F = Te[m] ?? Ii[wn], Ce = F.fee ?? null, Bt = J(
1836
- () => Si(Y, Te),
1837
- [Te, Y]
1838
- ), Ie = J(
1832
+ P["--aegis-swap-accent"] = z;
1833
+ const q = N ?? ea(z);
1834
+ q && (P["--aegis-swap-accent-text"] = q);
1835
+ } else N && (P["--aegis-swap-accent-text"] = N);
1836
+ return P;
1837
+ }, [z, N, Ye]), Ee = J(() => xi(Se), [Se]), j = Ee[m] ?? Ni[_n], Lt = j.fee ?? null, Ft = J(
1838
+ () => Pi(ae, Ee),
1839
+ [Ee, ae]
1840
+ ), xe = J(
1839
1841
  () => ({
1840
- ...Y != null && Y.length ? {} : Ai,
1841
- ...Bt
1842
+ ...ae != null && ae.length ? {} : Ti,
1843
+ ...Ft
1842
1844
  }),
1843
- [Bt, Y]
1844
- ), se = J(() => (pe && pe.length > 0 ? pe : Y != null && Y.length ? Y.map((X) => X.id) : bn).filter((X) => {
1845
+ [Ft, ae]
1846
+ ), se = J(() => (Ae && Ae.length > 0 ? Ae : ae != null && ae.length ? ae.map((q) => q.id) : In).filter((q) => {
1845
1847
  var ge;
1846
- return ((ge = Ie[X]) == null ? void 0 : ge.chainId) === F.chainId;
1847
- }), [F.chainId, Y, Ie, pe]), kt = J(() => Array.isArray(ue) ? ue : (ue == null ? void 0 : ue[F.chainId]) ?? F.rpcUrls, [F, ue]), ia = B === void 0 ? F.metadataEndpoint : B, ra = kt.join(","), Xe = J(
1848
- () => Ei(F.chain, kt),
1849
- [F.chainId, ra]
1848
+ return ((ge = xe[q]) == null ? void 0 : ge.chainId) === j.chainId;
1849
+ }), [j.chainId, ae, xe, Ae]), Ut = J(() => Array.isArray(ue) ? ue : (ue == null ? void 0 : ue[j.chainId]) ?? j.rpcUrls, [j, ue]), la = B === void 0 ? j.metadataEndpoint : B, ca = Ut.join(","), Qe = J(
1850
+ () => Ci(j.chain, Ut),
1851
+ [j.chainId, ca]
1850
1852
  // not activeChain.chain/resolvedRpcUrls identity
1851
- ), sa = xi(n), [Lt, oa] = P(
1852
- w ?? bn[0]
1853
- ), [Ye, la] = P(
1854
- () => cs(x)
1855
- ), [le, Me] = P("exactIn"), [Ft, Re] = P(""), [Ut, De] = P(""), ht = Pn(String(R)) || "1", [Se, $t] = P(ht), [ca, gt] = P(null), [Wt, ua] = P(K), [da, mt] = P(q), [pa, Ht] = P("trade"), [Oe, fa] = P(null), Vt = W(null), qt = W(/* @__PURE__ */ new Map()), wt = W(void 0);
1856
- U(() => () => window.clearTimeout(wt.current), []);
1857
- const { owner: Be, walletChainId: Gt, setWalletChainId: ha, getActiveProvider: ga, connectWallet: ma } = ls({ provider: e, controlledAccount: sa, getProvider: a, onConnectWallet: r }), me = se.includes(Lt) ? Lt : se[0];
1858
- qr(f, me);
1859
- const G = me ? Ie[me] ?? null : null, Qe = (G == null ? void 0 : G.token) ?? yn.WATER, Ze = (G == null ? void 0 : G.counterToken) ?? yn.USDC, Q = Ye === "buy" ? Ze : Qe, ae = Ye === "buy" ? Qe : Ze, Je = le === "exactOut" ? Ut : Ft, zt = le === "exactOut" ? ae : Q, bt = J(
1860
- () => Lr(Je, zt.decimals),
1861
- [Je, zt.decimals]
1862
- ), et = J(() => Tn(Se), [Se]), { balances: fe, refreshBalances: wa } = ss({
1863
- publicClient: Xe,
1864
- owner: Be,
1853
+ ), ua = Mi(n), [$t, da] = T(
1854
+ w ?? In[0]
1855
+ ), [Ze, pa] = T(
1856
+ () => hs(x)
1857
+ ), [le, Oe] = T("exactIn"), [Wt, Be] = T(""), [Ht, ke] = T(""), wt = Rn(String(R)) || "1", [Ne, Vt] = T(wt), [fa, bt] = T(null), [qt, ha] = T(K), [ga, ma] = T(V), [wa, Gt] = T("trade"), [Le, ba] = T(null), zt = $(null), Kt = $(/* @__PURE__ */ new Map()), yt = $(void 0);
1858
+ F(() => () => window.clearTimeout(yt.current), []);
1859
+ const { owner: Fe, walletChainId: jt, setWalletChainId: ya, getActiveProvider: va, connectWallet: _a } = fs({ provider: e, controlledAccount: ua, getProvider: a, onConnectWallet: r }), me = se.includes($t) ? $t : se[0];
1860
+ Xr(f, me);
1861
+ const G = me ? xe[me] ?? null : null, Je = (G == null ? void 0 : G.token) ?? Sn.WATER, et = (G == null ? void 0 : G.counterToken) ?? Sn.USDC, Q = Ze === "buy" ? et : Je, ie = Ze === "buy" ? Je : et, tt = le === "exactOut" ? Ht : Wt, Xt = le === "exactOut" ? ie : Q, vt = J(
1862
+ () => Hr(tt, Xt.decimals),
1863
+ [tt, Xt.decimals]
1864
+ ), nt = J(() => Dn(Ne), [Ne]), { balances: fe, refreshBalances: Ia } = ds({
1865
+ publicClient: Qe,
1866
+ owner: Fe,
1865
1867
  inputToken: Q,
1866
- outputToken: ae
1867
- }), Kt = W(!1), { quote: Z, quoteLoading: jt, quoteError: Xt, setQuote: ba, clearQuote: tt } = ts({
1868
- publicClient: Xe,
1869
- owner: Be,
1868
+ outputToken: ie
1869
+ }), Yt = $(!1), { quote: Z, quoteLoading: Qt, quoteError: Zt, setQuote: Sa, clearQuote: at } = ss({
1870
+ publicClient: Qe,
1871
+ owner: Fe,
1870
1872
  market: G,
1871
1873
  inputToken: Q,
1872
- outputToken: ae,
1874
+ outputToken: ie,
1873
1875
  quoteMode: le,
1874
- activeAmount: bt,
1875
- slippageBps: et,
1876
- feeConfig: Ce,
1876
+ activeAmount: vt,
1877
+ slippageBps: nt,
1878
+ feeConfig: Lt,
1877
1879
  onQuote: u,
1878
- pausedRef: Kt
1879
- }), de = Z ? Nt(Z) : void 0, {
1880
- allowanceAmount: Yt,
1881
- allowanceError: Qt,
1882
- approvalCheckPending: ya,
1883
- approvalRequired: va,
1884
- authorizationCheckPending: _a,
1885
- authorizationRequired: Zt,
1886
- authorizationPromptExpected: nt,
1887
- readAllowance: Ia,
1888
- commitAllowance: Sa,
1889
- refreshAllowances: Aa
1890
- } = ns({ publicClient: Xe, owner: Be, market: G, inputToken: Q, spendAmount: de }), {
1891
- submit: Jt,
1892
- approveInputToken: en,
1880
+ pausedRef: Yt
1881
+ }), de = Z ? Tt(Z) : void 0, {
1882
+ allowanceAmount: Jt,
1883
+ allowanceError: en,
1884
+ approvalCheckPending: Aa,
1885
+ approvalRequired: Ea,
1886
+ authorizationCheckPending: xa,
1887
+ authorizationRequired: tn,
1888
+ authorizationPromptExpected: it,
1889
+ readAllowance: Na,
1890
+ commitAllowance: Pa,
1891
+ refreshAllowances: Ta
1892
+ } = os({ publicClient: Qe, owner: Fe, market: G, inputToken: Q, spendAmount: de }), {
1893
+ submit: nn,
1894
+ approveInputToken: an,
1893
1895
  reset: ce,
1894
1896
  status: ee,
1895
1897
  busy: we,
1896
1898
  txHash: he,
1897
1899
  actionError: be,
1898
- approvalProgress: tn,
1900
+ approvalProgress: rn,
1899
1901
  receiptSummary: oe
1900
- } = Qr({
1901
- publicClient: Xe,
1902
- activeChain: F,
1902
+ } = ns({
1903
+ publicClient: Qe,
1904
+ activeChain: j,
1903
1905
  market: G,
1904
1906
  inputToken: Q,
1905
- outputToken: ae,
1907
+ outputToken: ie,
1906
1908
  quoteMode: le,
1907
- activeAmount: bt,
1908
- slippageBps: et,
1909
- feeConfig: Ce,
1909
+ activeAmount: vt,
1910
+ slippageBps: nt,
1911
+ feeConfig: Lt,
1910
1912
  quote: Z,
1911
- setQuote: ba,
1912
- owner: Be,
1913
- getActiveProvider: ga,
1914
- connectWallet: ma,
1915
- setWalletChainId: ha,
1916
- readAllowance: Ia,
1917
- commitAllowance: Sa,
1918
- refreshAllowances: Aa,
1919
- approvalMode: Wt,
1920
- refreshBalances: wa,
1913
+ setQuote: Sa,
1914
+ owner: Fe,
1915
+ getActiveProvider: va,
1916
+ connectWallet: _a,
1917
+ setWalletChainId: ya,
1918
+ readAllowance: Na,
1919
+ commitAllowance: Pa,
1920
+ refreshAllowances: Ta,
1921
+ approvalMode: qt,
1922
+ refreshBalances: Ia,
1921
1923
  onSubmitted: s,
1922
1924
  onSuccess: o,
1923
1925
  onError: l
1924
1926
  });
1925
- U(() => {
1926
- Kt.current = we;
1927
- }, [we]), U(() => {
1927
+ F(() => {
1928
+ Yt.current = we;
1929
+ }, [we]), F(() => {
1928
1930
  if (ee !== "success") return;
1929
- const C = window.setTimeout(() => ce(), fs(Vt.current));
1930
- return () => window.clearTimeout(C);
1931
+ const P = window.setTimeout(() => ce(), bs(zt.current));
1932
+ return () => window.clearTimeout(P);
1931
1933
  }, [ee, ce]);
1932
- const Ea = J(() => {
1933
- const C = /* @__PURE__ */ new Set();
1934
- for (const X of se) {
1935
- const ge = Ie[X];
1936
- C.add(ge.token.address), C.add(ge.counterToken.address);
1934
+ const Ca = J(() => {
1935
+ const P = /* @__PURE__ */ new Set();
1936
+ for (const q of se) {
1937
+ const ge = xe[q];
1938
+ P.add(ge.token.address), P.add(ge.counterToken.address);
1937
1939
  }
1938
- return [...C];
1939
- }, [Ie, se]), xa = os({
1940
- endpoint: ia,
1941
- chainId: F.chainId,
1942
- addresses: Ea
1943
- }), Na = Gt !== null && Gt !== F.chainId, yt = Je.trim().length > 0 && bt === null, nn = se.length > 0, Pa = de !== void 0 && fe.input !== null && de > fe.input, Ta = G ? ((dn = F.poolExplorerUrl) == null ? void 0 : dn.call(F, G.poolId, G)) ?? null : null, Ca = !!(G && ca === G.poolId), ke = le === "exactOut" && Z ? Cn(Z.amountIn, Q.decimals) : Ft, vt = le === "exactIn" && Z ? Cn(Z.amountOut, ae.decimals) : Ut, Ma = O(async () => {
1944
- var C;
1945
- if (!(!G || !((C = navigator.clipboard) != null && C.writeText)))
1940
+ return [...P];
1941
+ }, [xe, se]), Ma = ps({
1942
+ endpoint: la,
1943
+ chainId: j.chainId,
1944
+ addresses: Ca
1945
+ }), Ra = jt !== null && jt !== j.chainId, _t = tt.trim().length > 0 && vt === null, sn = se.length > 0, Da = de !== void 0 && fe.input !== null && de > fe.input, Oa = G ? ((gn = j.poolExplorerUrl) == null ? void 0 : gn.call(j, G.poolId, G)) ?? null : null, Ba = !!(G && fa === G.poolId), Ue = le === "exactOut" && Z ? On(Z.amountIn, Q.decimals) : Wt, It = le === "exactIn" && Z ? On(Z.amountOut, ie.decimals) : Ht, ka = D(async () => {
1946
+ var P;
1947
+ if (!(!G || !((P = navigator.clipboard) != null && P.writeText)))
1946
1948
  try {
1947
- await navigator.clipboard.writeText(G.poolId), gt(G.poolId), window.clearTimeout(wt.current), wt.current = window.setTimeout(() => gt(null), 1e3);
1949
+ await navigator.clipboard.writeText(G.poolId), bt(G.poolId), window.clearTimeout(yt.current), yt.current = window.setTimeout(() => bt(null), 1e3);
1948
1950
  } catch {
1949
- gt(null);
1951
+ bt(null);
1950
1952
  }
1951
- }, [G]), at = O(
1952
- (C) => {
1953
- C !== null && (Me("exactIn"), Re(Ur(C, Q.decimals)), De(""), ce());
1953
+ }, [G]), rt = D(
1954
+ (P) => {
1955
+ P !== null && (Oe("exactIn"), Be(qr(P, Q.decimals)), ke(""), ce());
1954
1956
  },
1955
1957
  [Q.decimals, ce]
1956
- ), Ra = O(
1957
- () => at(fe.input === null ? null : fe.input / 2n),
1958
- [fe.input, at]
1959
- ), Da = O(() => at(fe.input), [fe.input, at]), Oa = O(() => {
1960
- const C = He(vt || ke);
1961
- la((X) => X === "buy" ? "sell" : "buy"), Me("exactIn"), Re(C), De(""), tt(), ce();
1962
- }, [vt, tt, ce, ke]), _t = O(
1963
- (C) => {
1964
- const X = He(ke);
1965
- oa(C), Me("exactIn"), Re(X), De(""), tt(), ce();
1958
+ ), La = D(
1959
+ () => rt(fe.input === null ? null : fe.input / 2n),
1960
+ [fe.input, rt]
1961
+ ), Fa = D(() => rt(fe.input), [fe.input, rt]), Ua = D(() => {
1962
+ const P = Ge(It || Ue);
1963
+ pa((q) => q === "buy" ? "sell" : "buy"), Oe("exactIn"), Be(P), ke(""), at(), ce();
1964
+ }, [It, at, ce, Ue]), St = D(
1965
+ (P) => {
1966
+ const q = Ge(Ue);
1967
+ da(P), Oe("exactIn"), Be(q), ke(""), at(), ce();
1966
1968
  },
1967
- [tt, ce, ke]
1968
- ), Ba = O(
1969
- (C) => {
1970
- var hn;
1969
+ [at, ce, Ue]
1970
+ ), $a = D(
1971
+ (P) => {
1972
+ var bn;
1971
1973
  if (se.length === 0 || !me) return;
1972
- const X = Math.max(se.indexOf(me), 0), ge = aa(C.key, X, se.length);
1974
+ const q = Math.max(se.indexOf(me), 0), ge = oa(P.key, q, se.length);
1973
1975
  if (ge === null) return;
1974
- C.preventDefault();
1975
- const fn = se[ge];
1976
- _t(fn), (hn = qt.current.get(fn)) == null || hn.focus();
1976
+ P.preventDefault();
1977
+ const wn = se[ge];
1978
+ St(wn), (bn = Kt.current.get(wn)) == null || bn.focus();
1977
1979
  },
1978
- [me, se, _t]
1979
- ), it = O(
1980
- (C, X) => {
1981
- C === "exactIn" ? (Me("exactIn"), Re(He(X)), De("")) : (Me("exactOut"), De(He(X)), Re("")), ce();
1980
+ [me, se, St]
1981
+ ), st = D(
1982
+ (P, q) => {
1983
+ P === "exactIn" ? (Oe("exactIn"), Be(Ge(q)), ke("")) : (Oe("exactOut"), ke(Ge(q)), Be("")), ce();
1982
1984
  },
1983
1985
  [ce]
1984
- ), ka = O(
1985
- (C) => it("exactIn", C),
1986
- [it]
1987
- ), La = O(
1988
- (C) => it("exactOut", C),
1989
- [it]
1990
- ), { canSubmit: an, primaryAction: rt, ctaLabel: Fa } = ds({
1986
+ ), Wa = D(
1987
+ (P) => st("exactIn", P),
1988
+ [st]
1989
+ ), Ha = D(
1990
+ (P) => st("exactOut", P),
1991
+ [st]
1992
+ ), { canSubmit: on, primaryAction: ot, ctaLabel: Va } = ms({
1991
1993
  busy: we,
1992
1994
  status: ee,
1993
1995
  hasMarket: !!G,
1994
- hasAvailablePools: nn,
1995
- ownerConnected: !!Be,
1996
- wrongChain: Na,
1997
- activeChainName: F.name,
1998
- activeInput: Je,
1999
- amountInvalid: yt,
2000
- slippageValid: et !== null,
2001
- insufficientBalance: Pa,
1996
+ hasAvailablePools: sn,
1997
+ ownerConnected: !!Fe,
1998
+ wrongChain: Ra,
1999
+ activeChainName: j.name,
2000
+ activeInput: tt,
2001
+ amountInvalid: _t,
2002
+ slippageValid: nt !== null,
2003
+ insufficientBalance: Da,
2002
2004
  hasQuote: !!Z,
2003
- quoteLoading: jt,
2004
- quoteUnavailable: !!(Xt && !Z),
2005
- allowanceError: !!Qt,
2006
- approvalCheckPending: ya,
2007
- approvalRequired: va,
2008
- authorizationCheckPending: _a,
2009
- authorizationRequired: Zt,
2005
+ quoteLoading: Qt,
2006
+ quoteUnavailable: !!(Zt && !Z),
2007
+ allowanceError: !!en,
2008
+ approvalCheckPending: Aa,
2009
+ approvalRequired: Ea,
2010
+ authorizationCheckPending: xa,
2011
+ authorizationRequired: tn,
2010
2012
  inputSymbol: Q.symbol,
2011
- targetSymbol: Qe.symbol,
2012
- counterSymbol: Ze.symbol,
2013
- direction: Ye
2014
- }), Ua = !!(tn.done && de !== void 0 && de > 0n && Yt !== null && Yt >= de), rn = W(nt);
2015
- U(() => {
2016
- ee === "idle" && !be && (rn.current = nt);
2017
- }, [be, nt, ee]);
2018
- const $a = ee === "idle" && !be ? nt : rn.current, j = Ni({
2013
+ targetSymbol: Je.symbol,
2014
+ counterSymbol: et.symbol,
2015
+ direction: Ze
2016
+ }), qa = !!(rn.done && de !== void 0 && de > 0n && Jt !== null && Jt >= de), ln = $(it);
2017
+ F(() => {
2018
+ ee === "idle" && !be && (ln.current = it);
2019
+ }, [be, it, ee]);
2020
+ const Ga = ee === "idle" && !be ? it : ln.current, Y = Ri({
2019
2021
  status: ee,
2020
2022
  inputSymbol: Q.symbol,
2021
2023
  txHash: he,
2022
2024
  actionError: be,
2023
- approvalRequired: tn.required,
2024
- approvalDone: Ua,
2025
- authorizationRequired: $a
2026
- }), sn = (j == null ? void 0 : j.state) ?? null;
2027
- zr(c, {
2025
+ approvalRequired: rn.required,
2026
+ approvalDone: qa,
2027
+ authorizationRequired: Ga
2028
+ }), cn = (Y == null ? void 0 : Y.state) ?? null;
2029
+ Qr(c, {
2028
2030
  status: ee,
2029
- progress: sn,
2030
- label: (j == null ? void 0 : j.label) ?? null,
2031
- walletPrompts: (j == null ? void 0 : j.walletPrompts) ?? { total: 0, completed: 0, active: null },
2032
- completePct: (j == null ? void 0 : j.completePct) ?? null,
2033
- activeWidthPct: (j == null ? void 0 : j.activeWidthPct) ?? null,
2031
+ progress: cn,
2032
+ label: (Y == null ? void 0 : Y.label) ?? null,
2033
+ walletPrompts: (Y == null ? void 0 : Y.walletPrompts) ?? { total: 0, completed: 0, active: null },
2034
+ completePct: (Y == null ? void 0 : Y.completePct) ?? null,
2035
+ activeWidthPct: (Y == null ? void 0 : Y.activeWidthPct) ?? null,
2034
2036
  txHash: he,
2035
2037
  error: be
2036
2038
  });
2037
- const Wa = k === "rail" || k === "both", on = k === "toast" || k === "both", ln = he ? qn(he, F) : null, Ae = ln === "#" ? null : ln;
2038
- Vr({
2039
- enabled: on,
2039
+ const za = ne === "rail" || ne === "both", un = ne === "toast" || ne === "both", dn = he ? jn(he, j) : null, Pe = dn === "#" ? null : dn;
2040
+ jr({
2041
+ enabled: un,
2040
2042
  status: ee,
2041
- progress: j,
2043
+ progress: Y,
2042
2044
  txHash: he,
2043
- explorerUrl: Ae,
2044
- successDescription: Z ? `Received ~${_e(Z.amountOut, ae.decimals)} ${ae.symbol}` : null
2045
+ explorerUrl: Pe,
2046
+ successDescription: Z ? `Received ~${_e(Z.amountOut, ie.decimals)} ${ie.symbol}` : null
2045
2047
  });
2046
- const Ha = O(() => {
2047
- rt === "approve" ? en() : Jt();
2048
- }, [en, rt, Jt]), Va = O(() => mt((C) => !C), []), qa = O(
2049
- (C) => $t(Pn(C)),
2048
+ const Ka = D(() => {
2049
+ ot === "approve" ? an() : nn();
2050
+ }, [an, ot, nn]), lt = L ?? ga, pn = L !== void 0, Te = D(
2051
+ (P) => {
2052
+ const q = typeof P == "function" ? P(lt) : P;
2053
+ q !== lt && (pn || ma(q), X == null || X(q));
2054
+ },
2055
+ [lt, pn, X]
2056
+ ), ja = D(
2057
+ () => Te((P) => !P),
2058
+ [Te]
2059
+ ), Xa = D(
2060
+ (P) => Vt(Rn(P)),
2050
2061
  []
2051
- ), Ga = O(() => {
2052
- Tn(Se) === null && $t(ht);
2053
- }, [ht, Se]), za = ps({
2062
+ ), Ya = D(() => {
2063
+ Dn(Ne) === null && Vt(wt);
2064
+ }, [wt, Ne]), Qa = ws({
2054
2065
  quote: Z,
2055
2066
  inputSymbol: Q.symbol,
2056
2067
  inputDecimals: Q.decimals,
2057
- outputSymbol: ae.symbol,
2058
- outputDecimals: ae.decimals
2059
- }), cn = de !== void 0 && de > 0n ? _e(de, Q.decimals) : null, Ka = be || ee === "success" || !cn || !an && !we ? null : rt === "approve" ? `To swap, approve ${cn} ${Q.symbol} in your wallet` : Zt ? `To swap, sign the ${Q.symbol} permit in your wallet — no gas` : null, un = ((pn = F.chain.nativeCurrency) == null ? void 0 : pn.symbol) ?? "ETH", Le = J(() => oe ? {
2068
+ outputSymbol: ie.symbol,
2069
+ outputDecimals: ie.decimals
2070
+ }), fn = de !== void 0 && de > 0n ? _e(de, Q.decimals) : null, Za = be || ee === "success" || !fn || !on && !we ? null : ot === "approve" ? `To swap, approve ${fn} ${Q.symbol} in your wallet` : tn ? `To swap, sign the ${Q.symbol} permit in your wallet — no gas` : null, hn = ((mn = j.chain.nativeCurrency) == null ? void 0 : mn.symbol) ?? "ETH", $e = J(() => oe ? {
2060
2071
  transactionHash: oe.transactionHash,
2061
- received: Z && ee === "success" ? `${_e(Z.amountOut, ae.decimals)} ${ae.symbol}` : null,
2062
- txExplorerHref: Ae,
2072
+ received: Z && ee === "success" ? `${_e(Z.amountOut, ie.decimals)} ${ie.symbol}` : null,
2073
+ txExplorerHref: Pe,
2063
2074
  rows: [
2064
2075
  oe.feeWei > 0n ? {
2065
2076
  kind: "network-fee",
2066
2077
  label: "Network fee",
2067
- value: `${$r(oe.feeWei)} ${un}`
2078
+ value: `${Gr(oe.feeWei)} ${hn}`
2068
2079
  } : null,
2069
2080
  oe.effectiveGasPrice > 0n ? {
2070
2081
  kind: "gas-price",
2071
2082
  label: "Gas price",
2072
- value: `${Wr(oe.effectiveGasPrice)} gwei`
2083
+ value: `${zr(oe.effectiveGasPrice)} gwei`
2073
2084
  } : null,
2074
2085
  oe.gasUsed > 0n ? { kind: "gas-used", label: "Gas used", value: oe.gasUsed.toString() } : null,
2075
2086
  oe.blockNumber > 0n ? { kind: "block", label: "Block", value: `#${oe.blockNumber.toString()}` } : null
2076
- ].filter((C) => C !== null)
2087
+ ].filter((P) => P !== null)
2077
2088
  } : null, [
2078
- Ae,
2079
- un,
2080
- ae.decimals,
2081
- ae.symbol,
2089
+ Pe,
2090
+ hn,
2091
+ ie.decimals,
2092
+ ie.symbol,
2082
2093
  Z,
2083
2094
  oe,
2084
2095
  ee
2085
2096
  ]);
2086
- U(() => {
2087
- ee !== "success" || !Le || (fa(Le), Ht("transaction"), mt(!0));
2088
- }, [ee, Le]);
2089
- const ja = !!(A || y), Xa = Oe ? pa : "trade", Ya = O((C) => {
2090
- Ht(C), mt(!0);
2091
- }, []), Qa = he && Ae && !Le && (Oe == null ? void 0 : Oe.transactionHash) !== he ? Ae : null;
2097
+ F(() => {
2098
+ ee !== "success" || !$e || (ba($e), Gt("transaction"), Te(!0));
2099
+ }, [Te, ee, $e]);
2100
+ const Ja = !!(A || y), ei = Le ? wa : "trade", ti = D((P) => {
2101
+ Gt(P), Te(!0);
2102
+ }, [Te]), ni = he && Pe && !$e && (Le == null ? void 0 : Le.transactionHash) !== he ? Pe : null;
2092
2103
  return {
2093
2104
  // identity / layout
2094
- rootRef: Vt,
2095
- resolvedThemeMode: re,
2096
- widgetStyle: ft,
2105
+ rootRef: zt,
2106
+ resolvedThemeMode: g,
2107
+ widgetStyle: pe,
2097
2108
  className: S,
2098
2109
  ariaLabel: M,
2099
2110
  title: A,
2100
2111
  subtitle: y,
2101
- hasBrandText: ja,
2112
+ hasBrandText: Ja,
2102
2113
  // toaster + surfaces
2103
- theme: V,
2114
+ theme: H,
2104
2115
  accentColor: z,
2105
2116
  accentTextColor: N,
2106
- toastPosition: ne,
2107
- showRail: Wa,
2108
- showToast: on,
2117
+ toastPosition: k,
2118
+ showRail: za,
2119
+ showToast: un,
2109
2120
  showExecutionDetails: _,
2110
2121
  showPoolLink: te,
2111
2122
  showApprovalMode: d,
2112
2123
  // progress
2113
- progress: j,
2114
- progressState: sn,
2124
+ progress: Y,
2125
+ progressState: cn,
2115
2126
  // pools / network
2116
2127
  poolIds: se,
2117
2128
  activePoolId: me,
2118
- marketMap: Ie,
2119
- metadataByAddress: xa,
2120
- poolButtonRefs: qt,
2121
- onSelectPool: _t,
2122
- onPoolKeyDown: Ba,
2123
- activeChain: F,
2124
- networkOptions: je,
2125
- hasAvailablePools: nn,
2129
+ marketMap: xe,
2130
+ metadataByAddress: Ma,
2131
+ poolButtonRefs: Kt,
2132
+ onSelectPool: St,
2133
+ onPoolKeyDown: $a,
2134
+ activeChain: j,
2135
+ networkOptions: mt,
2136
+ hasAvailablePools: sn,
2126
2137
  // form: sell side
2127
2138
  balances: fe,
2128
- sellInputId: L,
2139
+ sellInputId: C,
2129
2140
  inputToken: Q,
2130
- sellFieldValue: ke,
2131
- sellInvalid: le === "exactIn" && yt,
2141
+ sellFieldValue: Ue,
2142
+ sellInvalid: le === "exactIn" && _t,
2132
2143
  sellRefreshEnabled: le === "exactOut" && !we,
2133
- onSellChange: ka,
2134
- onHalf: Ra,
2135
- onMax: Da,
2144
+ onSellChange: Wa,
2145
+ onHalf: La,
2146
+ onMax: Fa,
2136
2147
  // form: flip
2137
- direction: Ye,
2148
+ direction: Ze,
2138
2149
  market: G,
2139
- onFlipDirection: Oa,
2150
+ onFlipDirection: Ua,
2140
2151
  // form: buy side
2141
- buyInputId: g,
2142
- outputToken: ae,
2143
- buyFieldValue: vt,
2144
- buyInvalid: le === "exactOut" && yt,
2152
+ buyInputId: W,
2153
+ outputToken: ie,
2154
+ buyFieldValue: It,
2155
+ buyInvalid: le === "exactOut" && _t,
2145
2156
  buyRefreshEnabled: le === "exactIn" && !we,
2146
- onBuyChange: La,
2157
+ onBuyChange: Ha,
2147
2158
  // submit
2148
2159
  busy: we,
2149
- canSubmit: an,
2150
- primaryAction: rt,
2151
- ctaLabel: Fa,
2152
- onPrimaryAction: Ha,
2160
+ canSubmit: on,
2161
+ primaryAction: ot,
2162
+ ctaLabel: Va,
2163
+ onPrimaryAction: Ka,
2153
2164
  // execution details
2154
- executionDetailsOpen: da,
2155
- executionDetailsView: Xa,
2156
- executionDetailsId: H,
2157
- onToggleExecutionDetails: Va,
2158
- onExecutionDetailsViewChange: Ya,
2159
- latestTxSummary: Oe,
2160
- tradeDetailRows: za,
2161
- slippageInputId: T,
2162
- slippageInput: Se,
2163
- slippageInvalid: !!(Se.trim() && et === null),
2164
- onSlippageChange: qa,
2165
- onSlippageBlur: Ga,
2166
- approvalMode: Wt,
2167
- onApprovalModeChange: ua,
2168
- counterToken: Ze,
2169
- targetToken: Qe,
2170
- poolUrl: Ta,
2171
- onCopyPoolId: Ma,
2172
- routePoolCopied: Ca,
2165
+ executionDetailsOpen: lt,
2166
+ executionDetailsView: ei,
2167
+ executionDetailsId: Ie,
2168
+ onToggleExecutionDetails: ja,
2169
+ onExecutionDetailsViewChange: ti,
2170
+ latestTxSummary: Le,
2171
+ tradeDetailRows: Qa,
2172
+ slippageInputId: U,
2173
+ slippageInput: Ne,
2174
+ slippageInvalid: !!(Ne.trim() && nt === null),
2175
+ onSlippageChange: Xa,
2176
+ onSlippageBlur: Ya,
2177
+ approvalMode: qt,
2178
+ onApprovalModeChange: ha,
2179
+ counterToken: et,
2180
+ targetToken: Je,
2181
+ poolUrl: Oa,
2182
+ onCopyPoolId: ka,
2183
+ routePoolCopied: Ba,
2173
2184
  // status / result
2174
2185
  status: ee,
2175
2186
  txHash: he,
2176
2187
  quote: Z,
2177
- quoteError: Xt,
2178
- quoteLoading: jt,
2188
+ quoteError: Zt,
2189
+ quoteLoading: Qt,
2179
2190
  actionError: be,
2180
- allowanceError: Qt,
2181
- inlineTxExplorerHref: Qa,
2182
- txExplorerHref: Ae,
2183
- approvalHint: Ka,
2184
- txSummary: Le
2191
+ allowanceError: en,
2192
+ inlineTxExplorerHref: ni,
2193
+ txExplorerHref: Pe,
2194
+ approvalHint: Za,
2195
+ txSummary: $e
2185
2196
  };
2186
2197
  }
2187
- const gs = 150;
2188
- function Fn({ icon: t = "ethereum" }) {
2189
- return t === "base" ? /* @__PURE__ */ i(Fi, { className: "aegis-swap-widget__chain-logo" }) : /* @__PURE__ */ i(Li, { className: "aegis-swap-widget__chain-logo" });
2198
+ const vs = 150;
2199
+ function Hn({ icon: t = "ethereum" }) {
2200
+ return t === "base" ? /* @__PURE__ */ i(Vi, { className: "aegis-swap-widget__chain-logo" }) : /* @__PURE__ */ i(Hi, { className: "aegis-swap-widget__chain-logo" });
2190
2201
  }
2191
- const ms = {
2202
+ const _s = {
2192
2203
  1: "ethereum",
2193
2204
  8453: "base"
2194
- }, ws = ut(function({
2205
+ }, Is = ft(function({
2195
2206
  activeChainName: e,
2196
2207
  activeChainId: n,
2197
2208
  options: a
2198
2209
  }) {
2199
- const [r, s] = P(!1), [o, l] = P(!1), u = W(null), c = W(null), f = W(null), m = W(), I = $e(), E = a != null && a.length ? a : [], v = E.find((S) => S.id === n) ?? E.find((S) => S.name === e), w = {
2210
+ const [r, s] = T(!1), [o, l] = T(!1), u = $(null), c = $(null), f = $(null), m = $(), I = Ve(), E = a != null && a.length ? a : [], v = E.find((S) => S.id === n) ?? E.find((S) => S.name === e), w = {
2200
2211
  id: n,
2201
2212
  name: e,
2202
- icon: ms[n]
2203
- }, b = v ? E : [w, ...E], x = v ?? w, R = O((S = !1) => {
2213
+ icon: _s[n]
2214
+ }, b = v ? E : [w, ...E], x = v ?? w, R = D((S = !1) => {
2204
2215
  var h;
2205
- s(!1), l(!0), window.clearTimeout(m.current), m.current = window.setTimeout(() => l(!1), gs), S && ((h = c.current) == null || h.focus());
2206
- }, []), D = O(() => {
2216
+ s(!1), l(!0), window.clearTimeout(m.current), m.current = window.setTimeout(() => l(!1), vs), S && ((h = c.current) == null || h.focus());
2217
+ }, []), O = D(() => {
2207
2218
  window.clearTimeout(m.current), l(!1), s(!0);
2208
2219
  }, []);
2209
- U(() => () => window.clearTimeout(m.current), []);
2220
+ F(() => () => window.clearTimeout(m.current), []);
2210
2221
  const B = (S) => {
2211
2222
  var M;
2212
2223
  const h = Array.from(
2213
2224
  ((M = f.current) == null ? void 0 : M.querySelectorAll('[role="option"]:not(:disabled)')) ?? []
2214
2225
  );
2215
2226
  if (h.length === 0) return;
2216
- const A = h.indexOf(document.activeElement), y = aa(S.key, A, h.length);
2227
+ const A = h.indexOf(document.activeElement), y = oa(S.key, A, h.length);
2217
2228
  y !== null && (S.preventDefault(), h[y].focus());
2218
2229
  };
2219
- return U(() => {
2230
+ return F(() => {
2220
2231
  if (!r) return;
2221
2232
  const S = (A) => {
2222
2233
  var y;
@@ -2239,10 +2250,10 @@ const ms = {
2239
2250
  "aria-controls": I,
2240
2251
  "aria-label": `Network: ${x.name}. Change network`,
2241
2252
  "data-open": r || void 0,
2242
- onClick: () => r ? R() : D(),
2253
+ onClick: () => r ? R() : O(),
2243
2254
  children: [
2244
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__chain-mark", "aria-hidden": "true", children: /* @__PURE__ */ i(Fn, { icon: x.icon }) }),
2245
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__chain-caret", "aria-hidden": "true", children: /* @__PURE__ */ i(jn, {}) })
2255
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__chain-mark", "aria-hidden": "true", children: /* @__PURE__ */ i(Hn, { icon: x.icon }) }),
2256
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__chain-caret", "aria-hidden": "true", children: /* @__PURE__ */ i(Zn, {}) })
2246
2257
  ]
2247
2258
  }
2248
2259
  ),
@@ -2274,12 +2285,12 @@ const ms = {
2274
2285
  className: "aegis-swap-widget__network-option",
2275
2286
  onClick: () => R(!0),
2276
2287
  children: [
2277
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__network-mark", "aria-hidden": "true", children: /* @__PURE__ */ i(Fn, { icon: S.icon }) }),
2288
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__network-mark", "aria-hidden": "true", children: /* @__PURE__ */ i(Hn, { icon: S.icon }) }),
2278
2289
  /* @__PURE__ */ p("span", { className: "aegis-swap-widget__network-label", children: [
2279
2290
  /* @__PURE__ */ i("span", { className: "aegis-swap-widget__network-name", children: S.name }),
2280
2291
  S.status ? /* @__PURE__ */ i("span", { className: "aegis-swap-widget__network-status", children: S.status }) : null
2281
2292
  ] }),
2282
- h ? /* @__PURE__ */ i("span", { className: "aegis-swap-widget__network-check", "aria-hidden": "true", children: /* @__PURE__ */ i(lt, {}) }) : null
2293
+ h ? /* @__PURE__ */ i("span", { className: "aegis-swap-widget__network-check", "aria-hidden": "true", children: /* @__PURE__ */ i(dt, {}) }) : null
2283
2294
  ]
2284
2295
  },
2285
2296
  S.id
@@ -2293,7 +2304,7 @@ const ms = {
2293
2304
  )
2294
2305
  ] });
2295
2306
  });
2296
- function bs({
2307
+ function Ss({
2297
2308
  poolIds: t,
2298
2309
  activePoolId: e,
2299
2310
  marketMap: n,
@@ -2331,7 +2342,7 @@ function bs({
2331
2342
  onClick: () => s(u),
2332
2343
  children: [
2333
2344
  /* @__PURE__ */ i(
2334
- Kn,
2345
+ Qn,
2335
2346
  {
2336
2347
  market: c,
2337
2348
  metadataByAddress: a,
@@ -2347,9 +2358,9 @@ function bs({
2347
2358
  }
2348
2359
  );
2349
2360
  }
2350
- function ys(t, e) {
2351
- const [n, a] = P(!1), r = W(t);
2352
- return U(() => {
2361
+ function As(t, e) {
2362
+ const [n, a] = T(!1), r = $(t);
2363
+ return F(() => {
2353
2364
  const s = r.current !== t;
2354
2365
  if (r.current = t, !e || !s || t === "") return;
2355
2366
  a(!0);
@@ -2359,7 +2370,7 @@ function ys(t, e) {
2359
2370
  };
2360
2371
  }, [e, t]), n;
2361
2372
  }
2362
- function Un({
2373
+ function Vn({
2363
2374
  inputId: t,
2364
2375
  label: e,
2365
2376
  token: n,
@@ -2373,7 +2384,7 @@ function Un({
2373
2384
  onChange: f,
2374
2385
  quickActions: m
2375
2386
  }) {
2376
- const I = ys(a, l ?? !1);
2387
+ const I = As(a, l ?? !1);
2377
2388
  return /* @__PURE__ */ p(
2378
2389
  "div",
2379
2390
  {
@@ -2424,7 +2435,7 @@ function Un({
2424
2435
  ),
2425
2436
  /* @__PURE__ */ p("span", { className: "aegis-swap-widget__token", children: [
2426
2437
  /* @__PURE__ */ i(
2427
- Pt,
2438
+ Ct,
2428
2439
  {
2429
2440
  token: n,
2430
2441
  metadataByAddress: c,
@@ -2436,7 +2447,7 @@ function Un({
2436
2447
  ] }),
2437
2448
  /* @__PURE__ */ p("span", { className: "aegis-swap-widget__meta", children: [
2438
2449
  "Balance ",
2439
- Fr(r, n.decimals),
2450
+ Vr(r, n.decimals),
2440
2451
  " ",
2441
2452
  n.symbol
2442
2453
  ] })
@@ -2444,19 +2455,19 @@ function Un({
2444
2455
  }
2445
2456
  );
2446
2457
  }
2447
- function vs({ kind: t }) {
2458
+ function Es({ kind: t }) {
2448
2459
  switch (t) {
2449
2460
  case "network-fee":
2450
- return /* @__PURE__ */ i(Hi, {});
2461
+ return /* @__PURE__ */ i(Ki, {});
2451
2462
  case "gas-price":
2452
- return /* @__PURE__ */ i(Vi, {});
2463
+ return /* @__PURE__ */ i(ji, {});
2453
2464
  case "gas-used":
2454
- return /* @__PURE__ */ i(qi, {});
2465
+ return /* @__PURE__ */ i(Xi, {});
2455
2466
  case "block":
2456
- return /* @__PURE__ */ i(Gi, {});
2467
+ return /* @__PURE__ */ i(Yi, {});
2457
2468
  }
2458
2469
  }
2459
- function _s({
2470
+ function xs({
2460
2471
  open: t,
2461
2472
  panelId: e,
2462
2473
  onToggle: n,
@@ -2476,7 +2487,7 @@ function _s({
2476
2487
  market: b,
2477
2488
  metadataByAddress: x,
2478
2489
  counterToken: R,
2479
- targetToken: D,
2490
+ targetToken: O,
2480
2491
  showPoolLink: B,
2481
2492
  poolUrl: S,
2482
2493
  onCopyPoolId: h,
@@ -2496,10 +2507,10 @@ function _s({
2496
2507
  onClick: n,
2497
2508
  children: [
2498
2509
  /* @__PURE__ */ p("span", { className: "aegis-swap-widget__execution-toggle-label", children: [
2499
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__execution-toggle-icon", children: /* @__PURE__ */ i(Wi, {}) }),
2510
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__execution-toggle-icon", children: /* @__PURE__ */ i(zi, {}) }),
2500
2511
  /* @__PURE__ */ i("span", { children: "Trade details" })
2501
2512
  ] }),
2502
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__execution-chevron", children: /* @__PURE__ */ i(jn, {}) })
2513
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__execution-chevron", children: /* @__PURE__ */ i(Zn, {}) })
2503
2514
  ]
2504
2515
  }
2505
2516
  ),
@@ -2537,12 +2548,12 @@ function _s({
2537
2548
  ] }),
2538
2549
  /* @__PURE__ */ i("div", { id: e, className: "aegis-swap-widget__execution-panel", children: /* @__PURE__ */ i("div", { className: "aegis-swap-widget__execution-panel-inner", children: y === "transaction" && s ? /* @__PURE__ */ p("div", { className: "aegis-swap-widget__receipt", role: "status", children: [
2539
2550
  /* @__PURE__ */ p("div", { className: "aegis-swap-widget__receipt-head", children: [
2540
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__success-check", "aria-hidden": "true", children: /* @__PURE__ */ i(lt, {}) }),
2551
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__success-check", "aria-hidden": "true", children: /* @__PURE__ */ i(dt, {}) }),
2541
2552
  /* @__PURE__ */ p("span", { children: [
2542
2553
  /* @__PURE__ */ i("span", { className: "aegis-swap-widget__receipt-title", children: "Latest transaction" }),
2543
2554
  /* @__PURE__ */ p("span", { className: "aegis-swap-widget__receipt-subtitle", children: [
2544
2555
  "Swap complete",
2545
- s.received ? /* @__PURE__ */ p(gn, { children: [
2556
+ s.received ? /* @__PURE__ */ p(yn, { children: [
2546
2557
  " · received ",
2547
2558
  /* @__PURE__ */ i("strong", { children: s.received })
2548
2559
  ] }) : null
@@ -2550,7 +2561,7 @@ function _s({
2550
2561
  ] })
2551
2562
  ] }),
2552
2563
  s.rows.length > 0 ? /* @__PURE__ */ i("dl", { className: "aegis-swap-widget__receipt-list", children: s.rows.map((M) => /* @__PURE__ */ p("div", { className: "aegis-swap-widget__receipt-row", "data-kind": M.kind, children: [
2553
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__receipt-metric-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(vs, { kind: M.kind }) }),
2564
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__receipt-metric-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(Es, { kind: M.kind }) }),
2554
2565
  /* @__PURE__ */ p("div", { className: "aegis-swap-widget__receipt-row-copy", children: [
2555
2566
  /* @__PURE__ */ i("dt", { children: M.label }),
2556
2567
  /* @__PURE__ */ i("dd", { children: M.value })
@@ -2565,11 +2576,11 @@ function _s({
2565
2576
  rel: "noreferrer",
2566
2577
  children: [
2567
2578
  "View transaction",
2568
- /* @__PURE__ */ i(Tt, {})
2579
+ /* @__PURE__ */ i(Mt, {})
2569
2580
  ]
2570
2581
  }
2571
2582
  ) : null
2572
- ] }) : /* @__PURE__ */ p(gn, { children: [
2583
+ ] }) : /* @__PURE__ */ p(yn, { children: [
2573
2584
  o.length > 0 ? /* @__PURE__ */ i("div", { className: "aegis-swap-widget__quote-summary", children: o.map((M) => /* @__PURE__ */ p("div", { className: "aegis-swap-widget__detail-row", children: [
2574
2585
  /* @__PURE__ */ i("span", { children: M.label }),
2575
2586
  /* @__PURE__ */ i("strong", { children: M.value }, M.value)
@@ -2628,7 +2639,7 @@ function _s({
2628
2639
  b ? /* @__PURE__ */ i("div", { className: "aegis-swap-widget__details", children: /* @__PURE__ */ p("div", { className: "aegis-swap-widget__pool", children: [
2629
2640
  /* @__PURE__ */ p("span", { className: "aegis-swap-widget__pool-label", children: [
2630
2641
  /* @__PURE__ */ i(
2631
- Kn,
2642
+ Qn,
2632
2643
  {
2633
2644
  market: b,
2634
2645
  metadataByAddress: x,
@@ -2642,13 +2653,13 @@ function _s({
2642
2653
  {
2643
2654
  className: "aegis-swap-widget__route-chip",
2644
2655
  "aria-label": `Uniswap v4 pool ${b.poolId}`,
2645
- title: `${b.label ?? `${R.symbol} / ${D.symbol}`}: ${b.poolId}`,
2656
+ title: `${b.label ?? `${R.symbol} / ${O.symbol}`}: ${b.poolId}`,
2646
2657
  children: [
2647
2658
  /* @__PURE__ */ p("span", { className: "aegis-swap-widget__route-protocol", children: [
2648
2659
  /* @__PURE__ */ i("span", { className: "aegis-swap-widget__route-version", children: "v4" }),
2649
2660
  /* @__PURE__ */ i("span", { className: "aegis-swap-widget__route-kind", children: "Pool" })
2650
2661
  ] }),
2651
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__route-id", children: us(b.poolId) }),
2662
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__route-id", children: gs(b.poolId) }),
2652
2663
  /* @__PURE__ */ p("span", { className: "aegis-swap-widget__route-actions", children: [
2653
2664
  B && S ? /* @__PURE__ */ i(
2654
2665
  "a",
@@ -2658,7 +2669,7 @@ function _s({
2658
2669
  target: "_blank",
2659
2670
  rel: "noreferrer",
2660
2671
  "aria-label": "Open pool",
2661
- children: /* @__PURE__ */ i(Tt, {})
2672
+ children: /* @__PURE__ */ i(Mt, {})
2662
2673
  }
2663
2674
  ) : null,
2664
2675
  /* @__PURE__ */ p(
@@ -2670,8 +2681,8 @@ function _s({
2670
2681
  onClick: h,
2671
2682
  "aria-label": A ? "Pool id copied" : "Copy pool id",
2672
2683
  children: [
2673
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__copy-icon", "data-icon": "copy", "aria-hidden": "true", children: /* @__PURE__ */ i($i, {}) }),
2674
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__copy-icon", "data-icon": "check", "aria-hidden": "true", children: /* @__PURE__ */ i(lt, {}) })
2684
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__copy-icon", "data-icon": "copy", "aria-hidden": "true", children: /* @__PURE__ */ i(Gi, {}) }),
2685
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__copy-icon", "data-icon": "check", "aria-hidden": "true", children: /* @__PURE__ */ i(dt, {}) })
2675
2686
  ]
2676
2687
  }
2677
2688
  )
@@ -2683,13 +2694,13 @@ function _s({
2683
2694
  ] }) }) })
2684
2695
  ] });
2685
2696
  }
2686
- const Is = {
2697
+ const Ns = {
2687
2698
  pending: { completePct: 0, activeWidthPct: 100 },
2688
2699
  mining: { completePct: 0, activeWidthPct: 100 },
2689
2700
  success: { completePct: 100, activeWidthPct: 0 },
2690
2701
  error: { completePct: 100, activeWidthPct: 0 }
2691
2702
  };
2692
- function Ss({
2703
+ function Ps({
2693
2704
  state: t,
2694
2705
  label: e,
2695
2706
  completePct: n,
@@ -2697,7 +2708,7 @@ function Ss({
2697
2708
  className: r
2698
2709
  }) {
2699
2710
  if (!t) return null;
2700
- const s = Is[t];
2711
+ const s = Ns[t];
2701
2712
  if (!s) return null;
2702
2713
  const o = n ?? s.completePct, l = a ?? s.activeWidthPct;
2703
2714
  return /* @__PURE__ */ p(
@@ -2718,10 +2729,10 @@ function Ss({
2718
2729
  }
2719
2730
  );
2720
2731
  }
2721
- function As(t) {
2732
+ function Ts(t) {
2722
2733
  var r, s, o;
2723
- const e = hs(t), n = /* @__PURE__ */ i(
2724
- bs,
2734
+ const e = ys(t), n = /* @__PURE__ */ i(
2735
+ Ss,
2725
2736
  {
2726
2737
  poolIds: e.poolIds,
2727
2738
  activePoolId: e.activePoolId,
@@ -2733,7 +2744,7 @@ function As(t) {
2733
2744
  buttonRefs: e.poolButtonRefs
2734
2745
  }
2735
2746
  ), a = /* @__PURE__ */ i(
2736
- ws,
2747
+ Is,
2737
2748
  {
2738
2749
  activeChainName: e.activeChain.name,
2739
2750
  activeChainId: e.activeChain.chainId,
@@ -2752,7 +2763,7 @@ function As(t) {
2752
2763
  "aria-label": e.ariaLabel,
2753
2764
  children: [
2754
2765
  e.showRail ? /* @__PURE__ */ i(
2755
- Ss,
2766
+ Ps,
2756
2767
  {
2757
2768
  state: e.progressState,
2758
2769
  label: (r = e.progress) == null ? void 0 : r.label,
@@ -2765,7 +2776,7 @@ function As(t) {
2765
2776
  // would trap position: fixed) and yields to any host-mounted
2766
2777
  // AegisSwapToaster via the toaster election.
2767
2778
  /* @__PURE__ */ i(
2768
- kr,
2779
+ Wr,
2769
2780
  {
2770
2781
  position: e.toastPosition,
2771
2782
  theme: e.theme,
@@ -2799,7 +2810,7 @@ function As(t) {
2799
2810
  children: [
2800
2811
  /* @__PURE__ */ p("div", { className: "aegis-swap-widget__panel", children: [
2801
2812
  /* @__PURE__ */ i(
2802
- Un,
2813
+ Vn,
2803
2814
  {
2804
2815
  inputId: e.sellInputId,
2805
2816
  label: "Sell",
@@ -2824,11 +2835,11 @@ function As(t) {
2824
2835
  onClick: e.onFlipDirection,
2825
2836
  disabled: !e.market || e.busy,
2826
2837
  "aria-label": "Switch swap direction",
2827
- children: /* @__PURE__ */ i(Ui, {})
2838
+ children: /* @__PURE__ */ i(qi, {})
2828
2839
  }
2829
2840
  ),
2830
2841
  /* @__PURE__ */ i(
2831
- Un,
2842
+ Vn,
2832
2843
  {
2833
2844
  inputId: e.buyInputId,
2834
2845
  label: "Buy",
@@ -2845,7 +2856,7 @@ function As(t) {
2845
2856
  )
2846
2857
  ] }),
2847
2858
  e.showExecutionDetails ? /* @__PURE__ */ i(
2848
- _s,
2859
+ xs,
2849
2860
  {
2850
2861
  open: e.executionDetailsOpen,
2851
2862
  panelId: e.executionDetailsId,
@@ -2889,7 +2900,7 @@ function As(t) {
2889
2900
  // Aave-style caption to the CTA: names the exact wallet step the
2890
2901
  // user is about to take. Keyed so a phase change replays the enter.
2891
2902
  /* @__PURE__ */ p("p", { className: "aegis-swap-widget__hint", role: "note", children: [
2892
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__hint-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(Xn, {}) }),
2903
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__hint-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(Jn, {}) }),
2893
2904
  e.approvalHint
2894
2905
  ] }, e.approvalHint)
2895
2906
  ) : null,
@@ -2916,7 +2927,7 @@ function As(t) {
2916
2927
  rel: "noreferrer",
2917
2928
  children: [
2918
2929
  "View transaction",
2919
- /* @__PURE__ */ i(Tt, {})
2930
+ /* @__PURE__ */ i(Mt, {})
2920
2931
  ]
2921
2932
  }
2922
2933
  ) : null,
@@ -2930,7 +2941,7 @@ function As(t) {
2930
2941
  target: "_blank",
2931
2942
  rel: "noreferrer",
2932
2943
  children: [
2933
- /* @__PURE__ */ i("span", { className: "aegis-swap-widget__powered-mark", children: /* @__PURE__ */ i(ki, {}) }),
2944
+ /* @__PURE__ */ i("span", { className: "aegis-swap-widget__powered-mark", children: /* @__PURE__ */ i(Wi, {}) }),
2934
2945
  /* @__PURE__ */ i("span", { className: "aegis-swap-widget__powered-brand", children: "AEGIS" })
2935
2946
  ]
2936
2947
  }
@@ -2940,75 +2951,75 @@ function As(t) {
2940
2951
  }
2941
2952
  );
2942
2953
  }
2943
- const Rs = As;
2954
+ const Ls = Ts;
2944
2955
  export {
2945
- Bs as AEGIS_DYNAMIC_FEE_FLAG,
2946
- Ii as AEGIS_SWAP_CHAINS,
2947
- wn as AEGIS_SWAP_CHAIN_ID,
2948
- ks as AEGIS_SWAP_DEFAULT_FEE_BPS,
2949
- Ls as AEGIS_SWAP_DEFAULT_FEE_RECIPIENT,
2950
- Fs as AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT,
2951
- bn as AEGIS_SWAP_DEFAULT_POOL_IDS,
2952
- Us as AEGIS_SWAP_DEFAULT_RPC_URLS,
2953
- $s as AEGIS_SWAP_HOOK,
2954
- Ws as AEGIS_SWAP_MAINNET_CHAIN,
2955
- Hs as AEGIS_SWAP_MAINNET_UNISWAP_V4_CONTRACTS,
2956
- Ai as AEGIS_SWAP_MARKETS,
2957
- Vs as AEGIS_SWAP_PERMIT2,
2958
- qs as AEGIS_SWAP_ROUTER,
2959
- yn as AEGIS_SWAP_TOKENS,
2960
- Gs as AEGIS_SWAP_V4_QUOTER,
2961
- As as AegisDirectSwapWidget,
2962
- Ss as AegisSwapProgressRail,
2963
- Ms as AegisSwapToaster,
2964
- Rs as AegisSwapWidget,
2965
- li as DEFAULT_PERMIT_EXPIRATION_SECONDS,
2966
- zs as MAX_UINT128,
2967
- Ks as MAX_UINT160,
2968
- js as MAX_UINT256,
2969
- Xs as PERMIT2_FAR_FUTURE_EXPIRATION,
2970
- Wn as SWAP_TX_DEADLINE_SECONDS,
2971
- Ys as UNISWAP_V4_CONTRACTS_BY_CHAIN,
2956
+ $s as AEGIS_DYNAMIC_FEE_FLAG,
2957
+ Ni as AEGIS_SWAP_CHAINS,
2958
+ _n as AEGIS_SWAP_CHAIN_ID,
2959
+ Ws as AEGIS_SWAP_DEFAULT_FEE_BPS,
2960
+ Hs as AEGIS_SWAP_DEFAULT_FEE_RECIPIENT,
2961
+ Vs as AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT,
2962
+ In as AEGIS_SWAP_DEFAULT_POOL_IDS,
2963
+ qs as AEGIS_SWAP_DEFAULT_RPC_URLS,
2964
+ Gs as AEGIS_SWAP_HOOK,
2965
+ zs as AEGIS_SWAP_MAINNET_CHAIN,
2966
+ Ks as AEGIS_SWAP_MAINNET_UNISWAP_V4_CONTRACTS,
2967
+ Ti as AEGIS_SWAP_MARKETS,
2968
+ js as AEGIS_SWAP_PERMIT2,
2969
+ Xs as AEGIS_SWAP_ROUTER,
2970
+ Sn as AEGIS_SWAP_TOKENS,
2971
+ Ys as AEGIS_SWAP_V4_QUOTER,
2972
+ Ts as AegisDirectSwapWidget,
2973
+ Ps as AegisSwapProgressRail,
2974
+ ks as AegisSwapToaster,
2975
+ Ls as AegisSwapWidget,
2976
+ fi as DEFAULT_PERMIT_EXPIRATION_SECONDS,
2977
+ Qs as MAX_UINT128,
2978
+ Zs as MAX_UINT160,
2979
+ Js as MAX_UINT256,
2980
+ eo as PERMIT2_FAR_FUTURE_EXPIRATION,
2981
+ Gn as SWAP_TX_DEADLINE_SECONDS,
2982
+ to as UNISWAP_V4_CONTRACTS_BY_CHAIN,
2972
2983
  ye as aegisToast,
2973
- hi as approveErc20ToPermit2,
2974
- oi as approvePermit2ToRouter,
2975
- Qs as assertUint128,
2976
- di as buildExactInSwapTransaction,
2977
- ui as buildExactOutSwapTransaction,
2978
- ri as buildSignedPermitBatch,
2979
- Zs as computePoolId,
2980
- Js as createAegisSwapChainConfig,
2981
- _i as createAegisSwapChains,
2982
- Si as createAegisSwapMarketsFromPools,
2983
- eo as createAegisSwapPoolMarket,
2984
- to as createAegisSwapUniswapV4Contracts,
2985
- Ei as createSwapPublicClient,
2986
- As as default,
2987
- Ne as errorMessage,
2988
- Vn as fetchDirectSwapQuote,
2989
- mi as fetchGlobalTokenMetadata,
2990
- qn as getExplorerUrl,
2991
- no as getIchiIconGuess,
2992
- St as getInjectedProvider,
2993
- vi as getProviderAccount,
2994
- qe as getProviderChainId,
2995
- ao as getZeroForOne,
2996
- $n as isBusy,
2997
- Ve as isDocumentVisible,
2998
- io as isEip1193Provider,
2999
- si as isUserRejectedError,
3000
- xi as normalizeAccount,
3001
- bi as normalizeWalletConnection,
3002
- ci as outputFeeForQuote,
3003
- Gn as pollUntil,
3004
- Nt as quoteSpendAmount,
3005
- Hn as readPermit2RouterAllowance,
3006
- fi as reconcileSubmitQuote,
3007
- yi as requestProviderAccount,
3008
- ai as resolveTokenIconUrl,
3009
- mn as retryOnError,
3010
- gi as sameQuote,
3011
- wi as subscribeProvider,
3012
- pi as switchProviderChain,
3013
- Ni as transactionProgressView
2984
+ yi as approveErc20ToPermit2,
2985
+ pi as approvePermit2ToRouter,
2986
+ no as assertUint128,
2987
+ mi as buildExactInSwapTransaction,
2988
+ gi as buildExactOutSwapTransaction,
2989
+ ui as buildSignedPermitBatch,
2990
+ ao as computePoolId,
2991
+ io as createAegisSwapChainConfig,
2992
+ xi as createAegisSwapChains,
2993
+ Pi as createAegisSwapMarketsFromPools,
2994
+ ro as createAegisSwapPoolMarket,
2995
+ so as createAegisSwapUniswapV4Contracts,
2996
+ Ci as createSwapPublicClient,
2997
+ Ts as default,
2998
+ Re as errorMessage,
2999
+ Kn as fetchDirectSwapQuote,
3000
+ _i as fetchGlobalTokenMetadata,
3001
+ jn as getExplorerUrl,
3002
+ oo as getIchiIconGuess,
3003
+ Et as getInjectedProvider,
3004
+ Ei as getProviderAccount,
3005
+ Ke as getProviderChainId,
3006
+ lo as getZeroForOne,
3007
+ qn as isBusy,
3008
+ ze as isDocumentVisible,
3009
+ co as isEip1193Provider,
3010
+ di as isUserRejectedError,
3011
+ Mi as normalizeAccount,
3012
+ Si as normalizeWalletConnection,
3013
+ hi as outputFeeForQuote,
3014
+ Xn as pollUntil,
3015
+ Tt as quoteSpendAmount,
3016
+ zn as readPermit2RouterAllowance,
3017
+ bi as reconcileSubmitQuote,
3018
+ Ai as requestProviderAccount,
3019
+ li as resolveTokenIconUrl,
3020
+ vn as retryOnError,
3021
+ vi as sameQuote,
3022
+ Ii as subscribeProvider,
3023
+ wi as switchProviderChain,
3024
+ Ri as transactionProgressView
3014
3025
  };