@cartridge/controller 0.12.2 → 0.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { WalletAccount as Qt, constants as Z, num as ct, shortString as Qe } from "starknet";
2
- import { R as T, t as Ht, i as jt, K as lt, B as Wt, N as A, p as Yt, v as Vt, A as qt, s as dt } from "./provider-B8OiOgBt.js";
3
- import { a as Ro, d as Uo, E as Mo, f as zo, e as Oo, F as Do, I as Fo, h as Qo, n as Ho, b as jo, c as Wo } from "./provider-B8OiOgBt.js";
4
- class He extends Qt {
1
+ import { WalletAccount as Ht, constants as ve, num as lt, shortString as He } from "starknet";
2
+ import { R, t as jt, i as Yt, K as dt, B as Wt, N as A, p as Vt, v as qt, A as Zt, s as ht } from "./provider-bC9cKItb.js";
3
+ import { a as Mo, d as zo, E as Oo, f as Do, e as Fo, F as Qo, I as Ho, h as jo, n as Yo, b as Wo, c as Vo } from "./provider-bC9cKItb.js";
4
+ class je extends Ht {
5
5
  keychain;
6
6
  modal;
7
7
  options;
@@ -25,7 +25,7 @@ class He extends Qt {
25
25
  * @returns response from addTransaction
26
26
  */
27
27
  async execute(e) {
28
- return e = Ht(e), new Promise(async (r, n) => {
28
+ return e = jt(e), new Promise(async (r, n) => {
29
29
  const o = await this.keychain.execute(
30
30
  e,
31
31
  void 0,
@@ -33,15 +33,15 @@ class He extends Qt {
33
33
  !1,
34
34
  this.options?.feeSource
35
35
  );
36
- if (o.code === T.SUCCESS) {
36
+ if (o.code === R.SUCCESS) {
37
37
  r(o);
38
38
  return;
39
39
  }
40
- if (this.options?.propagateSessionErrors && o.code !== T.USER_INTERACTION_REQUIRED) {
40
+ if (this.options?.propagateSessionErrors && o.code !== R.USER_INTERACTION_REQUIRED) {
41
41
  n(o.error);
42
42
  return;
43
43
  }
44
- const s = this.options?.errorDisplayMode || "modal", a = o.error, i = o.code === T.USER_INTERACTION_REQUIRED;
44
+ const s = this.options?.errorDisplayMode || "modal", a = o.error, i = o.code === R.USER_INTERACTION_REQUIRED;
45
45
  if (s === "silent" && !i) {
46
46
  console.warn(
47
47
  "[Cartridge Controller] Transaction failed silently:",
@@ -50,7 +50,7 @@ class He extends Qt {
50
50
  return;
51
51
  }
52
52
  if (s === "notification" && !i) {
53
- const { toast: c } = await Promise.resolve().then(() => xo);
53
+ const { toast: c } = await Promise.resolve().then(() => ko);
54
54
  let d = !1, h;
55
55
  h = c({
56
56
  variant: "error",
@@ -58,7 +58,7 @@ class He extends Qt {
58
58
  duration: 1e4,
59
59
  onClick: () => {
60
60
  d = !0, h && h(), this.modal.open(), this.keychain.execute(e, void 0, void 0, !0, a).then((f) => {
61
- f.code === T.SUCCESS ? (r(f), this.modal.close()) : n(f.error);
61
+ f.code === R.SUCCESS ? (r(f), this.modal.close()) : n(f.error);
62
62
  });
63
63
  }
64
64
  }), setTimeout(() => {
@@ -74,7 +74,7 @@ class He extends Qt {
74
74
  !0,
75
75
  a
76
76
  );
77
- if (l.code === T.SUCCESS) {
77
+ if (l.code === R.SUCCESS) {
78
78
  r(l), this.modal.close();
79
79
  return;
80
80
  }
@@ -102,27 +102,27 @@ class He extends Qt {
102
102
  });
103
103
  }
104
104
  }
105
- var B;
105
+ var P;
106
106
  (function(t) {
107
107
  t.Call = "call", t.Reply = "reply", t.Syn = "syn", t.SynAck = "synAck", t.Ack = "ack";
108
- })(B || (B = {}));
109
- var z;
108
+ })(P || (P = {}));
109
+ var O;
110
110
  (function(t) {
111
111
  t.Fulfilled = "fulfilled", t.Rejected = "rejected";
112
- })(z || (z = {}));
113
- var G;
112
+ })(O || (O = {}));
113
+ var X;
114
114
  (function(t) {
115
115
  t.ConnectionDestroyed = "ConnectionDestroyed", t.ConnectionTimeout = "ConnectionTimeout", t.NoIframeSrc = "NoIframeSrc";
116
- })(G || (G = {}));
117
- var ve;
116
+ })(X || (X = {}));
117
+ var ke;
118
118
  (function(t) {
119
119
  t.DataCloneError = "DataCloneError";
120
- })(ve || (ve = {}));
121
- var U;
120
+ })(ke || (ke = {}));
121
+ var M;
122
122
  (function(t) {
123
123
  t.Message = "message";
124
- })(U || (U = {}));
125
- const Zt = (t, e) => {
124
+ })(M || (M = {}));
125
+ const Kt = (t, e) => {
126
126
  const r = [];
127
127
  let n = !1;
128
128
  return {
@@ -135,133 +135,133 @@ const Zt = (t, e) => {
135
135
  n ? o() : r.push(o);
136
136
  }
137
137
  };
138
- }, Kt = (t) => (...e) => {
138
+ }, Gt = (t) => (...e) => {
139
139
  t && console.log("[Penpal]", ...e);
140
- }, Gt = {
140
+ }, Xt = {
141
141
  "http:": "80",
142
142
  "https:": "443"
143
- }, Xt = /^(https?:)?\/\/([^/:]+)?(:(\d+))?/, Jt = ["file:", "data:"], er = (t) => {
144
- if (t && Jt.find((i) => t.startsWith(i)))
143
+ }, Jt = /^(https?:)?\/\/([^/:]+)?(:(\d+))?/, er = ["file:", "data:"], tr = (t) => {
144
+ if (t && er.find((i) => t.startsWith(i)))
145
145
  return "null";
146
- const e = document.location, r = Xt.exec(t);
146
+ const e = document.location, r = Jt.exec(t);
147
147
  let n, o, s;
148
148
  r ? (n = r[1] ? r[1] : e.protocol, o = r[2], s = r[4]) : (n = e.protocol, o = e.hostname, s = e.port);
149
- const a = s && s !== Gt[n] ? `:${s}` : "";
149
+ const a = s && s !== Xt[n] ? `:${s}` : "";
150
150
  return `${n}//${o}${a}`;
151
- }, je = ({ name: t, message: e, stack: r }) => ({
151
+ }, Ye = ({ name: t, message: e, stack: r }) => ({
152
152
  name: t,
153
153
  message: e,
154
154
  stack: r
155
- }), tr = (t) => {
155
+ }), rr = (t) => {
156
156
  const e = new Error();
157
157
  return Object.keys(t).forEach((r) => e[r] = t[r]), e;
158
- }, rr = (t, e, r) => {
158
+ }, nr = (t, e, r) => {
159
159
  const { localName: n, local: o, remote: s, originForSending: a, originForReceiving: i } = t;
160
160
  let l = !1;
161
161
  const c = (d) => {
162
- if (d.source !== s || d.data.penpal !== B.Call)
162
+ if (d.source !== s || d.data.penpal !== P.Call)
163
163
  return;
164
164
  if (i !== "*" && d.origin !== i) {
165
165
  r(`${n} received message from origin ${d.origin} which did not match expected origin ${i}`);
166
166
  return;
167
167
  }
168
- const h = d.data, { methodName: f, args: u, id: g } = h;
168
+ const h = d.data, { methodName: f, args: u, id: p } = h;
169
169
  r(`${n}: Received ${f}() call`);
170
- const y = (w) => (_) => {
170
+ const C = (y) => (S) => {
171
171
  if (r(`${n}: Sending ${f}() reply`), l) {
172
172
  r(`${n}: Unable to send ${f}() reply due to destroyed connection`);
173
173
  return;
174
174
  }
175
- const C = {
176
- penpal: B.Reply,
177
- id: g,
178
- resolution: w,
179
- returnValue: _
175
+ const x = {
176
+ penpal: P.Reply,
177
+ id: p,
178
+ resolution: y,
179
+ returnValue: S
180
180
  };
181
- w === z.Rejected && _ instanceof Error && (C.returnValue = je(_), C.returnValueIsError = !0);
181
+ y === O.Rejected && S instanceof Error && (x.returnValue = Ye(S), x.returnValueIsError = !0);
182
182
  try {
183
- s.postMessage(C, a);
184
- } catch (p) {
185
- if (p.name === ve.DataCloneError) {
186
- const k = {
187
- penpal: B.Reply,
188
- id: g,
189
- resolution: z.Rejected,
190
- returnValue: je(p),
183
+ s.postMessage(x, a);
184
+ } catch (m) {
185
+ if (m.name === ke.DataCloneError) {
186
+ const E = {
187
+ penpal: P.Reply,
188
+ id: p,
189
+ resolution: O.Rejected,
190
+ returnValue: Ye(m),
191
191
  returnValueIsError: !0
192
192
  };
193
- s.postMessage(k, a);
193
+ s.postMessage(E, a);
194
194
  }
195
- throw p;
195
+ throw m;
196
196
  }
197
197
  };
198
- new Promise((w) => w(e[f].call(e, d.origin).apply(e, u))).then(y(z.Fulfilled), y(z.Rejected));
198
+ new Promise((y) => y(e[f].call(e, d.origin).apply(e, u))).then(C(O.Fulfilled), C(O.Rejected));
199
199
  };
200
- return o.addEventListener(U.Message, c), () => {
201
- l = !0, o.removeEventListener(U.Message, c);
200
+ return o.addEventListener(M.Message, c), () => {
201
+ l = !0, o.removeEventListener(M.Message, c);
202
202
  };
203
203
  };
204
- let nr = 0;
205
- const or = () => ++nr, ht = ".", ft = (t) => t ? t.split(ht) : [], sr = (t) => t.join(ht), ar = (t, e) => {
206
- const r = ft(e || "");
207
- return r.push(t), sr(r);
208
- }, ir = (t, e, r) => {
209
- const n = ft(e);
204
+ let or = 0;
205
+ const sr = () => ++or, ft = ".", ut = (t) => t ? t.split(ft) : [], ar = (t) => t.join(ft), ir = (t, e) => {
206
+ const r = ut(e || "");
207
+ return r.push(t), ar(r);
208
+ }, cr = (t, e, r) => {
209
+ const n = ut(e);
210
210
  return n.reduce((o, s, a) => (typeof o[s] > "u" && (o[s] = {}), a === n.length - 1 && (o[s] = r), o[s]), t), t;
211
- }, ut = (t, e) => {
211
+ }, pt = (t, e) => {
212
212
  const r = {};
213
213
  return Object.keys(t).forEach((n) => {
214
- const o = t[n], s = ar(n, e);
215
- typeof o == "object" && Object.assign(r, ut(o, s)), typeof o == "function" && (r[s] = o);
214
+ const o = t[n], s = ir(n, e);
215
+ typeof o == "object" && Object.assign(r, pt(o, s)), typeof o == "function" && (r[s] = o);
216
216
  }), r;
217
- }, cr = (t) => {
217
+ }, lr = (t) => {
218
218
  const e = {};
219
219
  for (const r in t)
220
- ir(e, r, t[r]);
220
+ cr(e, r, t[r]);
221
221
  return e;
222
- }, lr = (t, e, r, n, o) => {
222
+ }, dr = (t, e, r, n, o) => {
223
223
  const { localName: s, local: a, remote: i, originForSending: l, originForReceiving: c } = e;
224
224
  let d = !1;
225
225
  o(`${s}: Connecting call sender`);
226
- const h = (u) => (...g) => {
226
+ const h = (u) => (...p) => {
227
227
  o(`${s}: Sending ${u}() call`);
228
- let y;
228
+ let C;
229
229
  try {
230
- i.closed && (y = !0);
230
+ i.closed && (C = !0);
231
231
  } catch {
232
- y = !0;
232
+ C = !0;
233
233
  }
234
- if (y && n(), d) {
235
- const w = new Error(`Unable to send ${u}() call due to destroyed connection`);
236
- throw w.code = G.ConnectionDestroyed, w;
234
+ if (C && n(), d) {
235
+ const y = new Error(`Unable to send ${u}() call due to destroyed connection`);
236
+ throw y.code = X.ConnectionDestroyed, y;
237
237
  }
238
- return new Promise((w, _) => {
239
- const C = or(), p = (L) => {
240
- if (L.source !== i || L.data.penpal !== B.Reply || L.data.id !== C)
238
+ return new Promise((y, S) => {
239
+ const x = sr(), m = (w) => {
240
+ if (w.source !== i || w.data.penpal !== P.Reply || w.data.id !== x)
241
241
  return;
242
- if (c !== "*" && L.origin !== c) {
243
- o(`${s} received message from origin ${L.origin} which did not match expected origin ${c}`);
242
+ if (c !== "*" && w.origin !== c) {
243
+ o(`${s} received message from origin ${w.origin} which did not match expected origin ${c}`);
244
244
  return;
245
245
  }
246
- const ue = L.data;
247
- o(`${s}: Received ${u}() reply`), a.removeEventListener(U.Message, p);
248
- let pe = ue.returnValue;
249
- ue.returnValueIsError && (pe = tr(pe)), (ue.resolution === z.Fulfilled ? w : _)(pe);
246
+ const H = w.data;
247
+ o(`${s}: Received ${u}() reply`), a.removeEventListener(M.Message, m);
248
+ let T = H.returnValue;
249
+ H.returnValueIsError && (T = rr(T)), (H.resolution === O.Fulfilled ? y : S)(T);
250
250
  };
251
- a.addEventListener(U.Message, p);
252
- const k = {
253
- penpal: B.Call,
254
- id: C,
251
+ a.addEventListener(M.Message, m);
252
+ const E = {
253
+ penpal: P.Call,
254
+ id: x,
255
255
  methodName: u,
256
- args: g
256
+ args: p
257
257
  };
258
- i.postMessage(k, l);
258
+ i.postMessage(E, l);
259
259
  });
260
- }, f = r.reduce((u, g) => (u[g] = h(g), u), {});
261
- return Object.assign(t, cr(f)), () => {
260
+ }, f = r.reduce((u, p) => (u[p] = h(p), u), {});
261
+ return Object.assign(t, lr(f)), () => {
262
262
  d = !0;
263
263
  };
264
- }, dr = (t, e, r, n, o) => {
264
+ }, hr = (t, e, r, n, o) => {
265
265
  const { destroy: s, onDestroy: a } = n;
266
266
  let i, l;
267
267
  const c = {};
@@ -278,13 +278,13 @@ const or = () => ++nr, ht = ".", ft = (t) => t ? t.split(ht) : [], sr = (t) => t
278
278
  originForSending: r,
279
279
  originForReceiving: e
280
280
  };
281
- i && i(), i = rr(h, t, o), a(i), l && l.forEach((u) => {
281
+ i && i(), i = nr(h, t, o), a(i), l && l.forEach((u) => {
282
282
  delete c[u];
283
283
  }), l = d.data.methodNames;
284
- const f = lr(c, h, l, s, o);
284
+ const f = dr(c, h, l, s, o);
285
285
  return a(f), c;
286
286
  };
287
- }, hr = (t, e, r, n) => (o) => {
287
+ }, fr = (t, e, r, n) => (o) => {
288
288
  if (!o.source)
289
289
  return;
290
290
  if (r !== "*" && o.origin !== r) {
@@ -293,52 +293,52 @@ const or = () => ++nr, ht = ".", ft = (t) => t ? t.split(ht) : [], sr = (t) => t
293
293
  }
294
294
  t("Parent: Handshake - Received SYN, responding with SYN-ACK");
295
295
  const s = {
296
- penpal: B.SynAck,
296
+ penpal: P.SynAck,
297
297
  methodNames: Object.keys(e)
298
298
  };
299
299
  o.source.postMessage(s, n);
300
- }, fr = 6e4, ur = (t, e) => {
300
+ }, ur = 6e4, pr = (t, e) => {
301
301
  const { destroy: r, onDestroy: n } = e, o = setInterval(() => {
302
302
  t.isConnected || (clearInterval(o), r());
303
- }, fr);
303
+ }, ur);
304
304
  n(() => {
305
305
  clearInterval(o);
306
306
  });
307
- }, pr = (t, e) => {
307
+ }, gr = (t, e) => {
308
308
  let r;
309
309
  return t !== void 0 && (r = window.setTimeout(() => {
310
310
  const n = new Error(`Connection timed out after ${t}ms`);
311
- n.code = G.ConnectionTimeout, e(n);
311
+ n.code = X.ConnectionTimeout, e(n);
312
312
  }, t)), () => {
313
313
  clearTimeout(r);
314
314
  };
315
- }, gr = (t) => {
315
+ }, mr = (t) => {
316
316
  if (!t.src && !t.srcdoc) {
317
317
  const e = new Error("Iframe must have src or srcdoc property defined.");
318
- throw e.code = G.NoIframeSrc, e;
318
+ throw e.code = X.NoIframeSrc, e;
319
319
  }
320
- }, mr = (t) => {
320
+ }, wr = (t) => {
321
321
  let { iframe: e, methods: r = {}, childOrigin: n, timeout: o, debug: s = !1 } = t;
322
- const a = Kt(s), i = Zt("Parent", a), { onDestroy: l, destroy: c } = i;
323
- n || (gr(e), n = er(e.src));
324
- const d = n === "null" ? "*" : n, h = ut(r), f = hr(a, h, n, d), u = dr(h, n, d, i, a);
322
+ const a = Gt(s), i = Kt("Parent", a), { onDestroy: l, destroy: c } = i;
323
+ n || (mr(e), n = tr(e.src));
324
+ const d = n === "null" ? "*" : n, h = pt(r), f = fr(a, h, n, d), u = hr(h, n, d, i, a);
325
325
  return {
326
- promise: new Promise((y, w) => {
327
- const _ = pr(o, c), C = (p) => {
328
- if (!(p.source !== e.contentWindow || !p.data)) {
329
- if (p.data.penpal === B.Syn) {
330
- f(p);
326
+ promise: new Promise((C, y) => {
327
+ const S = gr(o, c), x = (m) => {
328
+ if (!(m.source !== e.contentWindow || !m.data)) {
329
+ if (m.data.penpal === P.Syn) {
330
+ f(m);
331
331
  return;
332
332
  }
333
- if (p.data.penpal === B.Ack) {
334
- const k = u(p);
335
- k && (_(), y(k));
333
+ if (m.data.penpal === P.Ack) {
334
+ const E = u(m);
335
+ E && (S(), C(E));
336
336
  return;
337
337
  }
338
338
  }
339
339
  };
340
- window.addEventListener(U.Message, C), a("Parent: Awaiting handshake"), ur(e, i), l((p) => {
341
- window.removeEventListener(U.Message, C), p && w(p);
340
+ window.addEventListener(M.Message, x), a("Parent: Awaiting handshake"), pr(e, i), l((m) => {
341
+ window.removeEventListener(M.Message, x), m && y(m);
342
342
  });
343
343
  }),
344
344
  destroy() {
@@ -346,7 +346,7 @@ const or = () => ++nr, ht = ".", ft = (t) => t ? t.split(ht) : [], sr = (t) => t
346
346
  }
347
347
  };
348
348
  };
349
- class wr {
349
+ class yr {
350
350
  url;
351
351
  iframe;
352
352
  container;
@@ -385,7 +385,7 @@ class wr {
385
385
  f.touches.length > 1 && f.preventDefault();
386
386
  },
387
387
  { passive: !1 }
388
- ), this.iframe = l, this.container = c, mr({
388
+ ), this.iframe = l, this.container = c, wr({
389
389
  iframe: this.iframe,
390
390
  methods: {
391
391
  close: (f) => () => this.close(),
@@ -434,18 +434,18 @@ class wr {
434
434
  return this.container?.style.display !== "none";
435
435
  }
436
436
  }
437
- const yr = "6.13.7";
437
+ const br = "6.13.7";
438
438
  function We(t, e, r) {
439
439
  for (let n in e) {
440
440
  let o = e[n];
441
441
  Object.defineProperty(t, n, { enumerable: !0, value: o, writable: !1 });
442
442
  }
443
443
  }
444
- function Q(t) {
444
+ function j(t) {
445
445
  if (t == null)
446
446
  return "null";
447
447
  if (Array.isArray(t))
448
- return "[ " + t.map(Q).join(", ") + " ]";
448
+ return "[ " + t.map(j).join(", ") + " ]";
449
449
  if (t instanceof Uint8Array) {
450
450
  const e = "0123456789abcdef";
451
451
  let r = "0x";
@@ -454,7 +454,7 @@ function Q(t) {
454
454
  return r;
455
455
  }
456
456
  if (typeof t == "object" && typeof t.toJSON == "function")
457
- return Q(t.toJSON());
457
+ return j(t.toJSON());
458
458
  switch (typeof t) {
459
459
  case "boolean":
460
460
  case "symbol":
@@ -467,26 +467,26 @@ function Q(t) {
467
467
  return JSON.stringify(t);
468
468
  case "object": {
469
469
  const e = Object.keys(t);
470
- return e.sort(), "{ " + e.map((r) => `${Q(r)}: ${Q(t[r])}`).join(", ") + " }";
470
+ return e.sort(), "{ " + e.map((r) => `${j(r)}: ${j(t[r])}`).join(", ") + " }";
471
471
  }
472
472
  }
473
473
  return "[ COULD NOT SERIALIZE ]";
474
474
  }
475
- function br(t, e, r) {
475
+ function Cr(t, e, r) {
476
476
  let n = t;
477
477
  {
478
478
  const s = [];
479
479
  if (r) {
480
480
  if ("message" in r || "code" in r || "name" in r)
481
- throw new Error(`value will overwrite populated values: ${Q(r)}`);
481
+ throw new Error(`value will overwrite populated values: ${j(r)}`);
482
482
  for (const a in r) {
483
483
  if (a === "shortMessage")
484
484
  continue;
485
485
  const i = r[a];
486
- s.push(a + "=" + Q(i));
486
+ s.push(a + "=" + j(i));
487
487
  }
488
488
  }
489
- s.push(`code=${e}`), s.push(`version=${yr}`), s.length && (t += " (" + s.join(", ") + ")");
489
+ s.push(`code=${e}`), s.push(`version=${br}`), s.length && (t += " (" + s.join(", ") + ")");
490
490
  }
491
491
  let o;
492
492
  switch (e) {
@@ -502,12 +502,12 @@ function br(t, e, r) {
502
502
  }
503
503
  return We(o, { code: e }), r && Object.assign(o, r), o.shortMessage == null && We(o, { shortMessage: n }), o;
504
504
  }
505
- function Cr(t, e, r, n) {
505
+ function xr(t, e, r, n) {
506
506
  if (!t)
507
- throw br(e, r, n);
507
+ throw Cr(e, r, n);
508
508
  }
509
- function Y(t, e, r, n) {
510
- Cr(t, e, "INVALID_ARGUMENT", { argument: r, value: n });
509
+ function q(t, e, r, n) {
510
+ xr(t, e, "INVALID_ARGUMENT", { argument: r, value: n });
511
511
  }
512
512
  ["NFD", "NFC", "NFKD", "NFKC"].reduce((t, e) => {
513
513
  try {
@@ -520,7 +520,7 @@ function Y(t, e, r, n) {
520
520
  }
521
521
  return t;
522
522
  }, []);
523
- function xr(t, e, r) {
523
+ function vr(t, e, r) {
524
524
  if (t instanceof Uint8Array)
525
525
  return t;
526
526
  if (typeof t == "string" && t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)) {
@@ -530,83 +530,83 @@ function xr(t, e, r) {
530
530
  n[s] = parseInt(t.substring(o, o + 2), 16), o += 2;
531
531
  return n;
532
532
  }
533
- Y(!1, "invalid BytesLike value", e || "value", t);
533
+ q(!1, "invalid BytesLike value", e || "value", t);
534
534
  }
535
- function $e(t, e) {
536
- return xr(t, e);
535
+ function Le(t, e) {
536
+ return vr(t, e);
537
537
  }
538
- const Ye = "0123456789abcdef";
539
- function vr(t) {
540
- const e = $e(t);
538
+ const Ve = "0123456789abcdef";
539
+ function kr(t) {
540
+ const e = Le(t);
541
541
  let r = "0x";
542
542
  for (let n = 0; n < e.length; n++) {
543
543
  const o = e[n];
544
- r += Ye[(o & 240) >> 4] + Ye[o & 15];
544
+ r += Ve[(o & 240) >> 4] + Ve[o & 15];
545
545
  }
546
546
  return r;
547
547
  }
548
548
  /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
549
- function kr(t) {
549
+ function Er(t) {
550
550
  return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
551
551
  }
552
- function Ve(t) {
552
+ function qe(t) {
553
553
  if (!Number.isSafeInteger(t) || t < 0)
554
554
  throw new Error("positive integer expected, got " + t);
555
555
  }
556
- function oe(t, ...e) {
557
- if (!kr(t))
556
+ function se(t, ...e) {
557
+ if (!Er(t))
558
558
  throw new Error("Uint8Array expected");
559
559
  if (e.length > 0 && !e.includes(t.length))
560
560
  throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
561
561
  }
562
- function qe(t, e = !0) {
562
+ function Ze(t, e = !0) {
563
563
  if (t.destroyed)
564
564
  throw new Error("Hash instance has been destroyed");
565
565
  if (e && t.finished)
566
566
  throw new Error("Hash#digest() has already been called");
567
567
  }
568
- function Er(t, e) {
569
- oe(t);
568
+ function _r(t, e) {
569
+ se(t);
570
570
  const r = e.outputLen;
571
571
  if (t.length < r)
572
572
  throw new Error("digestInto() expects output buffer of length at least " + r);
573
573
  }
574
- function _r(t) {
574
+ function Ar(t) {
575
575
  return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
576
576
  }
577
- function pt(...t) {
577
+ function gt(...t) {
578
578
  for (let e = 0; e < t.length; e++)
579
579
  t[e].fill(0);
580
580
  }
581
- const Ar = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
582
- function Ir(t) {
581
+ const Ir = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
582
+ function Sr(t) {
583
583
  return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
584
584
  }
585
- function Sr(t) {
585
+ function $r(t) {
586
586
  for (let e = 0; e < t.length; e++)
587
- t[e] = Ir(t[e]);
587
+ t[e] = Sr(t[e]);
588
588
  return t;
589
589
  }
590
- const Ze = Ar ? (t) => t : Sr;
591
- function $r(t) {
590
+ const Ke = Ir ? (t) => t : $r;
591
+ function Lr(t) {
592
592
  if (typeof t != "string")
593
593
  throw new Error("string expected");
594
594
  return new Uint8Array(new TextEncoder().encode(t));
595
595
  }
596
- function gt(t) {
597
- return typeof t == "string" && (t = $r(t)), oe(t), t;
596
+ function mt(t) {
597
+ return typeof t == "string" && (t = Lr(t)), se(t), t;
598
598
  }
599
- class Lr {
599
+ class Nr {
600
600
  }
601
- function Nr(t) {
602
- const e = (n) => t().update(gt(n)).digest(), r = t();
601
+ function Pr(t) {
602
+ const e = (n) => t().update(mt(n)).digest(), r = t();
603
603
  return e.outputLen = r.outputLen, e.blockLen = r.blockLen, e.create = () => t(), e;
604
604
  }
605
- const te = /* @__PURE__ */ BigInt(2 ** 32 - 1), Ke = /* @__PURE__ */ BigInt(32);
605
+ const re = /* @__PURE__ */ BigInt(2 ** 32 - 1), Ge = /* @__PURE__ */ BigInt(32);
606
606
  function Br(t, e = !1) {
607
- return e ? { h: Number(t & te), l: Number(t >> Ke & te) } : { h: Number(t >> Ke & te) | 0, l: Number(t & te) | 0 };
607
+ return e ? { h: Number(t & re), l: Number(t >> Ge & re) } : { h: Number(t >> Ge & re) | 0, l: Number(t & re) | 0 };
608
608
  }
609
- function Pr(t, e = !1) {
609
+ function Tr(t, e = !1) {
610
610
  const r = t.length;
611
611
  let n = new Uint32Array(r), o = new Uint32Array(r);
612
612
  for (let s = 0; s < r; s++) {
@@ -615,28 +615,28 @@ function Pr(t, e = !1) {
615
615
  }
616
616
  return [n, o];
617
617
  }
618
- const Tr = (t, e, r) => t << r | e >>> 32 - r, Rr = (t, e, r) => e << r | t >>> 32 - r, Ur = (t, e, r) => e << r - 32 | t >>> 64 - r, Mr = (t, e, r) => t << r - 32 | e >>> 64 - r, zr = BigInt(0), W = BigInt(1), Or = BigInt(2), Dr = BigInt(7), Fr = BigInt(256), Qr = BigInt(113), mt = [], wt = [], yt = [];
619
- for (let t = 0, e = W, r = 1, n = 0; t < 24; t++) {
620
- [r, n] = [n, (2 * r + 3 * n) % 5], mt.push(2 * (5 * n + r)), wt.push((t + 1) * (t + 2) / 2 % 64);
621
- let o = zr;
618
+ const Rr = (t, e, r) => t << r | e >>> 32 - r, Ur = (t, e, r) => e << r | t >>> 32 - r, Mr = (t, e, r) => e << r - 32 | t >>> 64 - r, zr = (t, e, r) => t << r - 32 | e >>> 64 - r, Or = BigInt(0), V = BigInt(1), Dr = BigInt(2), Fr = BigInt(7), Qr = BigInt(256), Hr = BigInt(113), wt = [], yt = [], bt = [];
619
+ for (let t = 0, e = V, r = 1, n = 0; t < 24; t++) {
620
+ [r, n] = [n, (2 * r + 3 * n) % 5], wt.push(2 * (5 * n + r)), yt.push((t + 1) * (t + 2) / 2 % 64);
621
+ let o = Or;
622
622
  for (let s = 0; s < 7; s++)
623
- e = (e << W ^ (e >> Dr) * Qr) % Fr, e & Or && (o ^= W << (W << /* @__PURE__ */ BigInt(s)) - W);
624
- yt.push(o);
623
+ e = (e << V ^ (e >> Fr) * Hr) % Qr, e & Dr && (o ^= V << (V << /* @__PURE__ */ BigInt(s)) - V);
624
+ bt.push(o);
625
625
  }
626
- const bt = Pr(yt, !0), Hr = bt[0], jr = bt[1], Ge = (t, e, r) => r > 32 ? Ur(t, e, r) : Tr(t, e, r), Xe = (t, e, r) => r > 32 ? Mr(t, e, r) : Rr(t, e, r);
626
+ const Ct = Tr(bt, !0), jr = Ct[0], Yr = Ct[1], Xe = (t, e, r) => r > 32 ? Mr(t, e, r) : Rr(t, e, r), Je = (t, e, r) => r > 32 ? zr(t, e, r) : Ur(t, e, r);
627
627
  function Wr(t, e = 24) {
628
628
  const r = new Uint32Array(10);
629
629
  for (let n = 24 - e; n < 24; n++) {
630
630
  for (let a = 0; a < 10; a++)
631
631
  r[a] = t[a] ^ t[a + 10] ^ t[a + 20] ^ t[a + 30] ^ t[a + 40];
632
632
  for (let a = 0; a < 10; a += 2) {
633
- const i = (a + 8) % 10, l = (a + 2) % 10, c = r[l], d = r[l + 1], h = Ge(c, d, 1) ^ r[i], f = Xe(c, d, 1) ^ r[i + 1];
633
+ const i = (a + 8) % 10, l = (a + 2) % 10, c = r[l], d = r[l + 1], h = Xe(c, d, 1) ^ r[i], f = Je(c, d, 1) ^ r[i + 1];
634
634
  for (let u = 0; u < 50; u += 10)
635
635
  t[a + u] ^= h, t[a + u + 1] ^= f;
636
636
  }
637
637
  let o = t[2], s = t[3];
638
638
  for (let a = 0; a < 24; a++) {
639
- const i = wt[a], l = Ge(o, s, i), c = Xe(o, s, i), d = mt[a];
639
+ const i = yt[a], l = Xe(o, s, i), c = Je(o, s, i), d = wt[a];
640
640
  o = t[d], s = t[d + 1], t[d] = l, t[d + 1] = c;
641
641
  }
642
642
  for (let a = 0; a < 50; a += 10) {
@@ -645,25 +645,25 @@ function Wr(t, e = 24) {
645
645
  for (let i = 0; i < 10; i++)
646
646
  t[a + i] ^= ~r[(i + 2) % 10] & r[(i + 4) % 10];
647
647
  }
648
- t[0] ^= Hr[n], t[1] ^= jr[n];
648
+ t[0] ^= jr[n], t[1] ^= Yr[n];
649
649
  }
650
- pt(r);
650
+ gt(r);
651
651
  }
652
- class Le extends Lr {
652
+ class Ne extends Nr {
653
653
  // NOTE: we accept arguments in bytes instead of bits here.
654
654
  constructor(e, r, n, o = !1, s = 24) {
655
- if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = r, this.outputLen = n, this.enableXOF = o, this.rounds = s, Ve(n), !(0 < e && e < 200))
655
+ if (super(), this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, this.enableXOF = !1, this.blockLen = e, this.suffix = r, this.outputLen = n, this.enableXOF = o, this.rounds = s, qe(n), !(0 < e && e < 200))
656
656
  throw new Error("only keccak-f1600 function is supported");
657
- this.state = new Uint8Array(200), this.state32 = _r(this.state);
657
+ this.state = new Uint8Array(200), this.state32 = Ar(this.state);
658
658
  }
659
659
  clone() {
660
660
  return this._cloneInto();
661
661
  }
662
662
  keccak() {
663
- Ze(this.state32), Wr(this.state32, this.rounds), Ze(this.state32), this.posOut = 0, this.pos = 0;
663
+ Ke(this.state32), Wr(this.state32, this.rounds), Ke(this.state32), this.posOut = 0, this.pos = 0;
664
664
  }
665
665
  update(e) {
666
- qe(this), e = gt(e), oe(e);
666
+ Ze(this), e = mt(e), se(e);
667
667
  const { blockLen: r, state: n } = this, o = e.length;
668
668
  for (let s = 0; s < o; ) {
669
669
  const a = Math.min(r - this.pos, o - s);
@@ -681,7 +681,7 @@ class Le extends Lr {
681
681
  e[n] ^= r, (r & 128) !== 0 && n === o - 1 && this.keccak(), e[o - 1] ^= 128, this.keccak();
682
682
  }
683
683
  writeInto(e) {
684
- qe(this, !1), oe(e), this.finish();
684
+ Ze(this, !1), se(e), this.finish();
685
685
  const r = this.state, { blockLen: n } = this;
686
686
  for (let o = 0, s = e.length; o < s; ) {
687
687
  this.posOut >= n && this.keccak();
@@ -696,10 +696,10 @@ class Le extends Lr {
696
696
  return this.writeInto(e);
697
697
  }
698
698
  xof(e) {
699
- return Ve(e), this.xofInto(new Uint8Array(e));
699
+ return qe(e), this.xofInto(new Uint8Array(e));
700
700
  }
701
701
  digestInto(e) {
702
- if (Er(e, this), this.finished)
702
+ if (_r(e, this), this.finished)
703
703
  throw new Error("digest() was already called");
704
704
  return this.writeInto(e), this.destroy(), e;
705
705
  }
@@ -707,55 +707,55 @@ class Le extends Lr {
707
707
  return this.digestInto(new Uint8Array(this.outputLen));
708
708
  }
709
709
  destroy() {
710
- this.destroyed = !0, pt(this.state);
710
+ this.destroyed = !0, gt(this.state);
711
711
  }
712
712
  _cloneInto(e) {
713
713
  const { blockLen: r, suffix: n, outputLen: o, rounds: s, enableXOF: a } = this;
714
- return e || (e = new Le(r, n, o, a, s)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = s, e.suffix = n, e.outputLen = o, e.enableXOF = a, e.destroyed = this.destroyed, e;
714
+ return e || (e = new Ne(r, n, o, a, s)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = s, e.suffix = n, e.outputLen = o, e.enableXOF = a, e.destroyed = this.destroyed, e;
715
715
  }
716
716
  }
717
- const Yr = (t, e, r) => Nr(() => new Le(e, t, r)), Vr = Yr(1, 136, 256 / 8);
718
- let Ct = !1;
719
- const xt = function(t) {
720
- return Vr(t);
717
+ const Vr = (t, e, r) => Pr(() => new Ne(e, t, r)), qr = Vr(1, 136, 256 / 8);
718
+ let xt = !1;
719
+ const vt = function(t) {
720
+ return qr(t);
721
721
  };
722
- let vt = xt;
723
- function X(t) {
724
- const e = $e(t, "data");
725
- return vr(vt(e));
722
+ let kt = vt;
723
+ function J(t) {
724
+ const e = Le(t, "data");
725
+ return kr(kt(e));
726
726
  }
727
- X._ = xt;
728
- X.lock = function() {
729
- Ct = !0;
727
+ J._ = vt;
728
+ J.lock = function() {
729
+ xt = !0;
730
730
  };
731
- X.register = function(t) {
732
- if (Ct)
731
+ J.register = function(t) {
732
+ if (xt)
733
733
  throw new TypeError("keccak256 is locked");
734
- vt = t;
734
+ kt = t;
735
735
  };
736
- Object.freeze(X);
737
- const qr = BigInt(0), Zr = BigInt(36);
738
- function Je(t) {
736
+ Object.freeze(J);
737
+ const Zr = BigInt(0), Kr = BigInt(36);
738
+ function et(t) {
739
739
  t = t.toLowerCase();
740
740
  const e = t.substring(2).split(""), r = new Uint8Array(40);
741
741
  for (let o = 0; o < 40; o++)
742
742
  r[o] = e[o].charCodeAt(0);
743
- const n = $e(X(r));
743
+ const n = Le(J(r));
744
744
  for (let o = 0; o < 40; o += 2)
745
745
  n[o >> 1] >> 4 >= 8 && (e[o] = e[o].toUpperCase()), (n[o >> 1] & 15) >= 8 && (e[o + 1] = e[o + 1].toUpperCase());
746
746
  return "0x" + e.join("");
747
747
  }
748
- const Ne = {};
748
+ const Pe = {};
749
749
  for (let t = 0; t < 10; t++)
750
- Ne[String(t)] = String(t);
750
+ Pe[String(t)] = String(t);
751
751
  for (let t = 0; t < 26; t++)
752
- Ne[String.fromCharCode(65 + t)] = String(10 + t);
753
- const et = 15;
754
- function Kr(t) {
752
+ Pe[String.fromCharCode(65 + t)] = String(10 + t);
753
+ const tt = 15;
754
+ function Gr(t) {
755
755
  t = t.toUpperCase(), t = t.substring(4) + t.substring(0, 2) + "00";
756
- let e = t.split("").map((n) => Ne[n]).join("");
757
- for (; e.length >= et; ) {
758
- let n = e.substring(0, et);
756
+ let e = t.split("").map((n) => Pe[n]).join("");
757
+ for (; e.length >= tt; ) {
758
+ let n = e.substring(0, tt);
759
759
  e = parseInt(n, 10) % 97 + e.substring(n.length);
760
760
  }
761
761
  let r = String(98 - parseInt(e, 10) % 97);
@@ -763,7 +763,7 @@ function Kr(t) {
763
763
  r = "0" + r;
764
764
  return r;
765
765
  }
766
- const Gr = function() {
766
+ const Xr = function() {
767
767
  const t = {};
768
768
  for (let e = 0; e < 36; e++) {
769
769
  const r = "0123456789abcdefghijklmnopqrstuvwxyz"[e];
@@ -771,29 +771,29 @@ const Gr = function() {
771
771
  }
772
772
  return t;
773
773
  }();
774
- function Xr(t) {
774
+ function Jr(t) {
775
775
  t = t.toLowerCase();
776
- let e = qr;
776
+ let e = Zr;
777
777
  for (let r = 0; r < t.length; r++)
778
- e = e * Zr + Gr[t[r]];
778
+ e = e * Kr + Xr[t[r]];
779
779
  return e;
780
780
  }
781
- function P(t) {
782
- if (Y(typeof t == "string", "invalid address", "address", t), t.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
781
+ function B(t) {
782
+ if (q(typeof t == "string", "invalid address", "address", t), t.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
783
783
  t.startsWith("0x") || (t = "0x" + t);
784
- const e = Je(t);
785
- return Y(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || e === t, "bad address checksum", "address", t), e;
784
+ const e = et(t);
785
+ return q(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || e === t, "bad address checksum", "address", t), e;
786
786
  }
787
787
  if (t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
788
- Y(t.substring(2, 4) === Kr(t), "bad icap checksum", "address", t);
789
- let e = Xr(t.substring(4)).toString(16);
788
+ q(t.substring(2, 4) === Gr(t), "bad icap checksum", "address", t);
789
+ let e = Jr(t.substring(4)).toString(16);
790
790
  for (; e.length < 40; )
791
791
  e = "0" + e;
792
- return Je("0x" + e);
792
+ return et("0x" + e);
793
793
  }
794
- Y(!1, "invalid address", "address", t);
794
+ q(!1, "invalid address", "address", t);
795
795
  }
796
- class Jr {
796
+ class en {
797
797
  type = "argent";
798
798
  platform = "starknet";
799
799
  wallet = void 0;
@@ -927,16 +927,16 @@ class Jr {
927
927
  this.removeAccountChangeListener(), this.wallet = void 0, this.account = void 0, this.connectedAccounts = [];
928
928
  }
929
929
  }
930
- function en(t) {
930
+ function tn(t) {
931
931
  if (typeof window > "u")
932
932
  return;
933
933
  const e = (r) => t(r.detail);
934
934
  return window.addEventListener("eip6963:announceProvider", e), window.dispatchEvent(new CustomEvent("eip6963:requestProvider")), () => window.removeEventListener("eip6963:announceProvider", e);
935
935
  }
936
- function tn() {
936
+ function rn() {
937
937
  const t = /* @__PURE__ */ new Set();
938
938
  let e = [];
939
- const r = () => en((o) => {
939
+ const r = () => tn((o) => {
940
940
  e.some(({ info: s }) => s.uuid === o.info.uuid) || (e = [...e, o], t.forEach((s) => s(e, { added: [o] })));
941
941
  });
942
942
  let n = r();
@@ -964,7 +964,7 @@ function tn() {
964
964
  }
965
965
  };
966
966
  }
967
- const rn = {
967
+ const nn = {
968
968
  "0x1": "ethereum",
969
969
  // ethereum mainnet
970
970
  "0xaa36a7": "ethereum",
@@ -981,16 +981,16 @@ const rn = {
981
981
  // op mainnet
982
982
  "0xaa37dc": "optimism",
983
983
  // op sepolia
984
- [Z.StarknetChainId.SN_MAIN]: "starknet",
985
- [Z.StarknetChainId.SN_SEPOLIA]: "starknet"
984
+ [ve.StarknetChainId.SN_MAIN]: "starknet",
985
+ [ve.StarknetChainId.SN_SEPOLIA]: "starknet"
986
986
  }, ge = (t) => {
987
- const e = ct.toHex(t), r = rn[e];
987
+ const e = lt.toHex(t), r = nn[e];
988
988
  return r || console.warn(`Unknown chain ID: ${e}`), r;
989
989
  };
990
- class de {
990
+ class he {
991
991
  platform;
992
992
  account = void 0;
993
- store = tn();
993
+ store = rn();
994
994
  provider;
995
995
  connectedAccounts = [];
996
996
  constructor() {
@@ -1012,7 +1012,7 @@ class de {
1012
1012
  e && (e.provider.request({
1013
1013
  method: "eth_accounts"
1014
1014
  }).then((r) => {
1015
- this.connectedAccounts = r.map(P), r.length > 0 && (this.account = P(r[0]));
1015
+ this.connectedAccounts = r.map(B), r.length > 0 && (this.account = B(r[0]));
1016
1016
  }).catch(console.error), e.provider.request({
1017
1017
  method: "eth_chainId"
1018
1018
  }).then((r) => {
@@ -1020,11 +1020,11 @@ class de {
1020
1020
  }).catch(console.error), e.provider?.on("chainChanged", (r) => {
1021
1021
  this.platform = ge(r);
1022
1022
  }), e.provider?.on("accountsChanged", (r) => {
1023
- r && (this.connectedAccounts = r.map((n) => P(n)), this.account = r.length > 0 ? P(r[0]) : void 0);
1023
+ r && (this.connectedAccounts = r.map((n) => B(n)), this.account = r.length > 0 ? B(r[0]) : void 0);
1024
1024
  }));
1025
1025
  }
1026
1026
  isAvailable() {
1027
- if (jt())
1027
+ if (Yt())
1028
1028
  return !1;
1029
1029
  const e = this.getProvider();
1030
1030
  return !e && this.rdns === "io.metamask" && typeof window < "u" ? !!window.ethereum?.isMetaMask : (e && !this.initialized && this.initializeIfAvailable(), typeof window < "u" && !!e);
@@ -1045,7 +1045,7 @@ class de {
1045
1045
  return this.connectedAccounts;
1046
1046
  }
1047
1047
  async connect(e) {
1048
- if (e && this.connectedAccounts.includes(P(e)) && (this.account = P(e)), this.account)
1048
+ if (e && this.connectedAccounts.includes(B(e)) && (this.account = B(e)), this.account)
1049
1049
  return { success: !0, wallet: this.type, account: this.account };
1050
1050
  try {
1051
1051
  if (!this.isAvailable())
@@ -1058,7 +1058,7 @@ class de {
1058
1058
  method: "eth_requestAccounts"
1059
1059
  });
1060
1060
  if (o && o.length > 0)
1061
- return this.account = P(o[0]), this.connectedAccounts = o.map(P), !n && this.rdns === "io.metamask" && (this.provider = {
1061
+ return this.account = B(o[0]), this.connectedAccounts = o.map(B), !n && this.rdns === "io.metamask" && (this.provider = {
1062
1062
  info: {
1063
1063
  uuid: "metamask-fallback",
1064
1064
  name: "MetaMask",
@@ -1246,12 +1246,12 @@ class de {
1246
1246
  }
1247
1247
  }
1248
1248
  }
1249
- class nn extends de {
1249
+ class on extends he {
1250
1250
  type = "base";
1251
1251
  rdns = "com.coinbase.wallet";
1252
1252
  displayName = "Base Wallet";
1253
1253
  }
1254
- class on extends de {
1254
+ class sn extends he {
1255
1255
  type = "metamask";
1256
1256
  rdns = "io.metamask";
1257
1257
  displayName = "MetaMask";
@@ -1260,59 +1260,59 @@ class on extends de {
1260
1260
  function Be(t) {
1261
1261
  return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
1262
1262
  }
1263
- function kt(t, ...e) {
1263
+ function Et(t, ...e) {
1264
1264
  if (!Be(t))
1265
1265
  throw new Error("Uint8Array expected");
1266
1266
  if (e.length > 0 && !e.includes(t.length))
1267
1267
  throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
1268
1268
  }
1269
- function Et(t, e) {
1269
+ function _t(t, e) {
1270
1270
  return Array.isArray(e) ? e.length === 0 ? !0 : t ? e.every((r) => typeof r == "string") : e.every((r) => Number.isSafeInteger(r)) : !1;
1271
1271
  }
1272
- function sn(t) {
1272
+ function an(t) {
1273
1273
  if (typeof t != "function")
1274
1274
  throw new Error("function expected");
1275
1275
  return !0;
1276
1276
  }
1277
- function j(t, e) {
1277
+ function W(t, e) {
1278
1278
  if (typeof e != "string")
1279
1279
  throw new Error(`${t}: string expected`);
1280
1280
  return !0;
1281
1281
  }
1282
- function J(t) {
1282
+ function ee(t) {
1283
1283
  if (!Number.isSafeInteger(t))
1284
1284
  throw new Error(`invalid integer: ${t}`);
1285
1285
  }
1286
- function se(t) {
1286
+ function ae(t) {
1287
1287
  if (!Array.isArray(t))
1288
1288
  throw new Error("array expected");
1289
1289
  }
1290
- function ae(t, e) {
1291
- if (!Et(!0, e))
1290
+ function ie(t, e) {
1291
+ if (!_t(!0, e))
1292
1292
  throw new Error(`${t}: array of strings expected`);
1293
1293
  }
1294
- function _t(t, e) {
1295
- if (!Et(!1, e))
1294
+ function At(t, e) {
1295
+ if (!_t(!1, e))
1296
1296
  throw new Error(`${t}: array of numbers expected`);
1297
1297
  }
1298
1298
  // @__NO_SIDE_EFFECTS__
1299
- function Pe(...t) {
1299
+ function Te(...t) {
1300
1300
  const e = (s) => s, r = (s, a) => (i) => s(a(i)), n = t.map((s) => s.encode).reduceRight(r, e), o = t.map((s) => s.decode).reduce(r, e);
1301
1301
  return { encode: n, decode: o };
1302
1302
  }
1303
1303
  // @__NO_SIDE_EFFECTS__
1304
- function Te(t) {
1304
+ function Re(t) {
1305
1305
  const e = typeof t == "string" ? t.split("") : t, r = e.length;
1306
- ae("alphabet", e);
1306
+ ie("alphabet", e);
1307
1307
  const n = new Map(e.map((o, s) => [o, s]));
1308
1308
  return {
1309
- encode: (o) => (se(o), o.map((s) => {
1309
+ encode: (o) => (ae(o), o.map((s) => {
1310
1310
  if (!Number.isSafeInteger(s) || s < 0 || s >= r)
1311
1311
  throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${t}`);
1312
1312
  return e[s];
1313
1313
  })),
1314
- decode: (o) => (se(o), o.map((s) => {
1315
- j("alphabet.decode", s);
1314
+ decode: (o) => (ae(o), o.map((s) => {
1315
+ W("alphabet.decode", s);
1316
1316
  const a = n.get(s);
1317
1317
  if (a === void 0)
1318
1318
  throw new Error(`Unknown letter: "${s}". Allowed: ${t}`);
@@ -1321,22 +1321,22 @@ function Te(t) {
1321
1321
  };
1322
1322
  }
1323
1323
  // @__NO_SIDE_EFFECTS__
1324
- function Re(t = "") {
1325
- return j("join", t), {
1326
- encode: (e) => (ae("join.decode", e), e.join(t)),
1327
- decode: (e) => (j("join.decode", e), e.split(t))
1324
+ function Ue(t = "") {
1325
+ return W("join", t), {
1326
+ encode: (e) => (ie("join.decode", e), e.join(t)),
1327
+ decode: (e) => (W("join.decode", e), e.split(t))
1328
1328
  };
1329
1329
  }
1330
1330
  // @__NO_SIDE_EFFECTS__
1331
- function an(t, e = "=") {
1332
- return J(t), j("padding", e), {
1331
+ function cn(t, e = "=") {
1332
+ return ee(t), W("padding", e), {
1333
1333
  encode(r) {
1334
- for (ae("padding.encode", r); r.length * t % 8; )
1334
+ for (ie("padding.encode", r); r.length * t % 8; )
1335
1335
  r.push(e);
1336
1336
  return r;
1337
1337
  },
1338
1338
  decode(r) {
1339
- ae("padding.decode", r);
1339
+ ie("padding.decode", r);
1340
1340
  let n = r.length;
1341
1341
  if (n * t % 8)
1342
1342
  throw new Error("padding: invalid, string should have whole number of bytes");
@@ -1348,19 +1348,19 @@ function an(t, e = "=") {
1348
1348
  };
1349
1349
  }
1350
1350
  // @__NO_SIDE_EFFECTS__
1351
- function cn(t) {
1352
- return sn(t), { encode: (e) => e, decode: (e) => t(e) };
1351
+ function ln(t) {
1352
+ return an(t), { encode: (e) => e, decode: (e) => t(e) };
1353
1353
  }
1354
- function tt(t, e, r) {
1354
+ function rt(t, e, r) {
1355
1355
  if (e < 2)
1356
1356
  throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);
1357
1357
  if (r < 2)
1358
1358
  throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);
1359
- if (se(t), !t.length)
1359
+ if (ae(t), !t.length)
1360
1360
  return [];
1361
1361
  let n = 0;
1362
1362
  const o = [], s = Array.from(t, (i) => {
1363
- if (J(i), i < 0 || i >= e)
1363
+ if (ee(i), i < 0 || i >= e)
1364
1364
  throw new Error(`invalid integer: ${i}`);
1365
1365
  return i;
1366
1366
  }), a = s.length;
@@ -1372,11 +1372,11 @@ function tt(t, e, r) {
1372
1372
  throw new Error("convertRadix: carry overflow");
1373
1373
  const u = f / r;
1374
1374
  i = f % r;
1375
- const g = Math.floor(u);
1376
- if (s[c] = g, !Number.isSafeInteger(g) || g * r + i !== f)
1375
+ const p = Math.floor(u);
1376
+ if (s[c] = p, !Number.isSafeInteger(p) || p * r + i !== f)
1377
1377
  throw new Error("convertRadix: carry overflow");
1378
1378
  if (l)
1379
- g ? l = !1 : n = c;
1379
+ p ? l = !1 : n = c;
1380
1380
  else continue;
1381
1381
  }
1382
1382
  if (o.push(i), l)
@@ -1386,23 +1386,23 @@ function tt(t, e, r) {
1386
1386
  o.push(0);
1387
1387
  return o.reverse();
1388
1388
  }
1389
- const At = (t, e) => e === 0 ? t : At(e, t % e), ie = /* @__NO_SIDE_EFFECTS__ */ (t, e) => t + (e - At(t, e)), me = /* @__PURE__ */ (() => {
1389
+ const It = (t, e) => e === 0 ? t : It(e, t % e), ce = /* @__NO_SIDE_EFFECTS__ */ (t, e) => t + (e - It(t, e)), me = /* @__PURE__ */ (() => {
1390
1390
  let t = [];
1391
1391
  for (let e = 0; e < 40; e++)
1392
1392
  t.push(2 ** e);
1393
1393
  return t;
1394
1394
  })();
1395
- function rt(t, e, r, n) {
1396
- if (se(t), e <= 0 || e > 32)
1395
+ function nt(t, e, r, n) {
1396
+ if (ae(t), e <= 0 || e > 32)
1397
1397
  throw new Error(`convertRadix2: wrong from=${e}`);
1398
1398
  if (r <= 0 || r > 32)
1399
1399
  throw new Error(`convertRadix2: wrong to=${r}`);
1400
- if (/* @__PURE__ */ ie(e, r) > 32)
1401
- throw new Error(`convertRadix2: carry overflow from=${e} to=${r} carryBits=${/* @__PURE__ */ ie(e, r)}`);
1400
+ if (/* @__PURE__ */ ce(e, r) > 32)
1401
+ throw new Error(`convertRadix2: carry overflow from=${e} to=${r} carryBits=${/* @__PURE__ */ ce(e, r)}`);
1402
1402
  let o = 0, s = 0;
1403
1403
  const a = me[e], i = me[r] - 1, l = [];
1404
1404
  for (const c of t) {
1405
- if (J(c), c >= a)
1405
+ if (ee(c), c >= a)
1406
1406
  throw new Error(`convertRadix2: invalid data word=${c} from=${e}`);
1407
1407
  if (o = o << e | c, s + e > 32)
1408
1408
  throw new Error(`convertRadix2: carry overflow pos=${s} from=${e}`);
@@ -1420,56 +1420,56 @@ function rt(t, e, r, n) {
1420
1420
  return n && s > 0 && l.push(o >>> 0), l;
1421
1421
  }
1422
1422
  // @__NO_SIDE_EFFECTS__
1423
- function ln(t) {
1424
- J(t);
1423
+ function dn(t) {
1424
+ ee(t);
1425
1425
  const e = 2 ** 8;
1426
1426
  return {
1427
1427
  encode: (r) => {
1428
1428
  if (!Be(r))
1429
1429
  throw new Error("radix.encode input should be Uint8Array");
1430
- return tt(Array.from(r), e, t);
1430
+ return rt(Array.from(r), e, t);
1431
1431
  },
1432
- decode: (r) => (_t("radix.decode", r), Uint8Array.from(tt(r, t, e)))
1432
+ decode: (r) => (At("radix.decode", r), Uint8Array.from(rt(r, t, e)))
1433
1433
  };
1434
1434
  }
1435
1435
  // @__NO_SIDE_EFFECTS__
1436
- function It(t, e = !1) {
1437
- if (J(t), t <= 0 || t > 32)
1436
+ function St(t, e = !1) {
1437
+ if (ee(t), t <= 0 || t > 32)
1438
1438
  throw new Error("radix2: bits should be in (0..32]");
1439
- if (/* @__PURE__ */ ie(8, t) > 32 || /* @__PURE__ */ ie(t, 8) > 32)
1439
+ if (/* @__PURE__ */ ce(8, t) > 32 || /* @__PURE__ */ ce(t, 8) > 32)
1440
1440
  throw new Error("radix2: carry overflow");
1441
1441
  return {
1442
1442
  encode: (r) => {
1443
1443
  if (!Be(r))
1444
1444
  throw new Error("radix2.encode input should be Uint8Array");
1445
- return rt(Array.from(r), 8, t, !e);
1445
+ return nt(Array.from(r), 8, t, !e);
1446
1446
  },
1447
- decode: (r) => (_t("radix2.decode", r), Uint8Array.from(rt(r, t, 8, e)))
1447
+ decode: (r) => (At("radix2.decode", r), Uint8Array.from(nt(r, t, 8, e)))
1448
1448
  };
1449
1449
  }
1450
- const dn = typeof Uint8Array.from([]).toBase64 == "function" && typeof Uint8Array.fromBase64 == "function", hn = dn ? {
1450
+ const hn = typeof Uint8Array.from([]).toBase64 == "function" && typeof Uint8Array.fromBase64 == "function", fn = hn ? {
1451
1451
  encode(t) {
1452
- return kt(t), t.toBase64();
1452
+ return Et(t), t.toBase64();
1453
1453
  },
1454
1454
  decode(t) {
1455
- return j("base64", t), Uint8Array.fromBase64(t, { lastChunkHandling: "strict" });
1455
+ return W("base64", t), Uint8Array.fromBase64(t, { lastChunkHandling: "strict" });
1456
1456
  }
1457
- } : /* @__PURE__ */ Pe(/* @__PURE__ */ It(6), /* @__PURE__ */ Te("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), /* @__PURE__ */ an(6), /* @__PURE__ */ Re("")), fn = /* @__NO_SIDE_EFFECTS__ */ (t) => /* @__PURE__ */ Pe(/* @__PURE__ */ ln(58), /* @__PURE__ */ Te(t), /* @__PURE__ */ Re("")), ke = /* @__PURE__ */ fn("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"), un = {
1457
+ } : /* @__PURE__ */ Te(/* @__PURE__ */ St(6), /* @__PURE__ */ Re("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), /* @__PURE__ */ cn(6), /* @__PURE__ */ Ue("")), un = /* @__NO_SIDE_EFFECTS__ */ (t) => /* @__PURE__ */ Te(/* @__PURE__ */ dn(58), /* @__PURE__ */ Re(t), /* @__PURE__ */ Ue("")), Ee = /* @__PURE__ */ un("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"), pn = {
1458
1458
  encode: (t) => new TextDecoder().decode(t),
1459
1459
  decode: (t) => new TextEncoder().encode(t)
1460
- }, pn = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", gn = {
1460
+ }, gn = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", mn = {
1461
1461
  encode(t) {
1462
- return kt(t), t.toHex();
1462
+ return Et(t), t.toHex();
1463
1463
  },
1464
1464
  decode(t) {
1465
- return j("hex", t), Uint8Array.fromHex(t);
1465
+ return W("hex", t), Uint8Array.fromHex(t);
1466
1466
  }
1467
- }, we = pn ? gn : /* @__PURE__ */ Pe(/* @__PURE__ */ It(4), /* @__PURE__ */ Te("0123456789abcdef"), /* @__PURE__ */ Re(""), /* @__PURE__ */ cn((t) => {
1467
+ }, we = gn ? mn : /* @__PURE__ */ Te(/* @__PURE__ */ St(4), /* @__PURE__ */ Re("0123456789abcdef"), /* @__PURE__ */ Ue(""), /* @__PURE__ */ ln((t) => {
1468
1468
  if (typeof t != "string" || t.length % 2 !== 0)
1469
1469
  throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);
1470
1470
  return t.toLowerCase();
1471
1471
  }));
1472
- function Ee(t, e) {
1472
+ function _e(t, e) {
1473
1473
  if (t.length !== e.length)
1474
1474
  return !1;
1475
1475
  for (let r = 0; r < t.length; r++)
@@ -1477,47 +1477,47 @@ function Ee(t, e) {
1477
1477
  return !1;
1478
1478
  return !0;
1479
1479
  }
1480
- function R(t) {
1480
+ function U(t) {
1481
1481
  return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
1482
1482
  }
1483
- const St = (t) => new DataView(t.buffer, t.byteOffset, t.byteLength);
1484
- function F(t) {
1483
+ const $t = (t) => new DataView(t.buffer, t.byteOffset, t.byteLength);
1484
+ function Q(t) {
1485
1485
  return Object.prototype.toString.call(t) === "[object Object]";
1486
1486
  }
1487
1487
  function N(t) {
1488
1488
  return Number.isSafeInteger(t);
1489
1489
  }
1490
- const $t = (t) => {
1491
- if (t !== null && typeof t != "string" && !$(t) && !R(t) && !N(t))
1490
+ const Lt = (t) => {
1491
+ if (t !== null && typeof t != "string" && !L(t) && !U(t) && !N(t))
1492
1492
  throw new Error(`lengthCoder: expected null | number | Uint8Array | CoderType, got ${t} (${typeof t})`);
1493
1493
  return {
1494
1494
  encodeStream(e, r) {
1495
1495
  if (t === null)
1496
1496
  return;
1497
- if ($(t))
1497
+ if (L(t))
1498
1498
  return t.encodeStream(e, r);
1499
1499
  let n;
1500
- if (typeof t == "number" ? n = t : typeof t == "string" && (n = D.resolve(e.stack, t)), typeof n == "bigint" && (n = Number(n)), n === void 0 || n !== r)
1500
+ if (typeof t == "number" ? n = t : typeof t == "string" && (n = F.resolve(e.stack, t)), typeof n == "bigint" && (n = Number(n)), n === void 0 || n !== r)
1501
1501
  throw e.err(`Wrong length: ${n} len=${t} exp=${r} (${typeof r})`);
1502
1502
  },
1503
1503
  decodeStream(e) {
1504
1504
  let r;
1505
- if ($(t) ? r = Number(t.decodeStream(e)) : typeof t == "number" ? r = t : typeof t == "string" && (r = D.resolve(e.stack, t)), typeof r == "bigint" && (r = Number(r)), typeof r != "number")
1505
+ if (L(t) ? r = Number(t.decodeStream(e)) : typeof t == "number" ? r = t : typeof t == "string" && (r = F.resolve(e.stack, t)), typeof r == "bigint" && (r = Number(r)), typeof r != "number")
1506
1506
  throw e.err(`Wrong length: ${r}`);
1507
1507
  return r;
1508
1508
  }
1509
1509
  };
1510
- }, E = {
1510
+ }, _ = {
1511
1511
  BITS: 32,
1512
1512
  FULL_MASK: -1 >>> 0,
1513
1513
  // 1<<32 will overflow
1514
1514
  len: (t) => Math.ceil(t / 32),
1515
- create: (t) => new Uint32Array(E.len(t)),
1515
+ create: (t) => new Uint32Array(_.len(t)),
1516
1516
  clean: (t) => t.fill(0),
1517
1517
  debug: (t) => Array.from(t).map((e) => (e >>> 0).toString(2).padStart(32, "0")),
1518
1518
  checkLen: (t, e) => {
1519
- if (E.len(e) !== t.length)
1520
- throw new Error(`wrong length=${t.length}. Expected: ${E.len(e)}`);
1519
+ if (_.len(e) !== t.length)
1520
+ throw new Error(`wrong length=${t.length}. Expected: ${_.len(e)}`);
1521
1521
  },
1522
1522
  chunkLen: (t, e, r) => {
1523
1523
  if (e < 0)
@@ -1531,8 +1531,8 @@ const $t = (t) => {
1531
1531
  mask: 1 << 32 - (t + e) % 32 - 1
1532
1532
  }),
1533
1533
  indices: (t, e, r = !1) => {
1534
- E.checkLen(t, e);
1535
- const { FULL_MASK: n, BITS: o } = E, s = o - e % o, a = s ? n >>> s << s : n, i = [];
1534
+ _.checkLen(t, e);
1535
+ const { FULL_MASK: n, BITS: o } = _, s = o - e % o, a = s ? n >>> s << s : n, i = [];
1536
1536
  for (let l = 0; l < t.length; l++) {
1537
1537
  let c = t[l];
1538
1538
  if (r && (c = ~c), l === t.length - 1 && (c &= a), c !== 0)
@@ -1550,21 +1550,21 @@ const $t = (t) => {
1550
1550
  r === void 0 || n !== r.pos + r.length ? e.push(r = { pos: n, length: 1 }) : r.length += 1;
1551
1551
  return e;
1552
1552
  },
1553
- rangeDebug: (t, e, r = !1) => `[${E.range(E.indices(t, e, r)).map((n) => `(${n.pos}/${n.length})`).join(", ")}]`,
1553
+ rangeDebug: (t, e, r = !1) => `[${_.range(_.indices(t, e, r)).map((n) => `(${n.pos}/${n.length})`).join(", ")}]`,
1554
1554
  setRange: (t, e, r, n, o = !0) => {
1555
- E.chunkLen(e, r, n);
1556
- const { FULL_MASK: s, BITS: a } = E, i = r % a ? Math.floor(r / a) : void 0, l = r + n, c = l % a ? Math.floor(l / a) : void 0;
1555
+ _.chunkLen(e, r, n);
1556
+ const { FULL_MASK: s, BITS: a } = _, i = r % a ? Math.floor(r / a) : void 0, l = r + n, c = l % a ? Math.floor(l / a) : void 0;
1557
1557
  if (i !== void 0 && i === c)
1558
- return E.set(t, i, s >>> a - n << a - n - r, o);
1559
- if (i !== void 0 && !E.set(t, i, s >>> r % a, o))
1558
+ return _.set(t, i, s >>> a - n << a - n - r, o);
1559
+ if (i !== void 0 && !_.set(t, i, s >>> r % a, o))
1560
1560
  return !1;
1561
1561
  const d = i !== void 0 ? i + 1 : r / a, h = c !== void 0 ? c : l / a;
1562
1562
  for (let f = d; f < h; f++)
1563
- if (!E.set(t, f, s, o))
1563
+ if (!_.set(t, f, s, o))
1564
1564
  return !1;
1565
- return !(c !== void 0 && i !== c && !E.set(t, c, s << a - l % a, o));
1565
+ return !(c !== void 0 && i !== c && !_.set(t, c, s << a - l % a, o));
1566
1566
  }
1567
- }, D = {
1567
+ }, F = {
1568
1568
  /**
1569
1569
  * Internal method for handling stack of paths (debug, errors, dynamic fields via path)
1570
1570
  * This is looks ugly (callback), but allows us to force stack cleaning by construction (.pop always after function).
@@ -1586,7 +1586,7 @@ const $t = (t) => {
1586
1586
  return e.join("/");
1587
1587
  },
1588
1588
  err: (t, e, r) => {
1589
- const n = new Error(`${t}(${D.path(e)}): ${typeof r == "string" ? r : r.message}`);
1589
+ const n = new Error(`${t}(${F.path(e)}): ${typeof r == "string" ? r : r.message}`);
1590
1590
  return r instanceof Error && r.stack && (n.stack = r.stack), n;
1591
1591
  },
1592
1592
  resolve: (t, e) => {
@@ -1603,18 +1603,18 @@ const $t = (t) => {
1603
1603
  return s;
1604
1604
  }
1605
1605
  };
1606
- class Ue {
1606
+ class Me {
1607
1607
  constructor(e, r = {}, n = [], o = void 0, s = 0) {
1608
- this.pos = 0, this.bitBuf = 0, this.bitPos = 0, this.data = e, this.opts = r, this.stack = n, this.parent = o, this.parentOffset = s, this.view = St(e);
1608
+ this.pos = 0, this.bitBuf = 0, this.bitPos = 0, this.data = e, this.opts = r, this.stack = n, this.parent = o, this.parentOffset = s, this.view = $t(e);
1609
1609
  }
1610
1610
  /** Internal method for pointers. */
1611
1611
  _enablePointers() {
1612
1612
  if (this.parent)
1613
1613
  return this.parent._enablePointers();
1614
- this.bs || (this.bs = E.create(this.data.length), E.setRange(this.bs, this.data.length, 0, this.pos, this.opts.allowMultipleReads));
1614
+ this.bs || (this.bs = _.create(this.data.length), _.setRange(this.bs, this.data.length, 0, this.pos, this.opts.allowMultipleReads));
1615
1615
  }
1616
1616
  markBytesBS(e, r) {
1617
- return this.parent ? this.parent.markBytesBS(this.parentOffset + e, r) : !r || !this.bs ? !0 : E.setRange(this.bs, this.data.length, e, r, !1);
1617
+ return this.parent ? this.parent.markBytesBS(this.parentOffset + e, r) : !r || !this.bs ? !0 : _.setRange(this.bs, this.data.length, e, r, !1);
1618
1618
  }
1619
1619
  markBytes(e) {
1620
1620
  const r = this.pos;
@@ -1625,7 +1625,7 @@ class Ue {
1625
1625
  return n;
1626
1626
  }
1627
1627
  pushObj(e, r) {
1628
- return D.pushObj(this.stack, e, r);
1628
+ return F.pushObj(this.stack, e, r);
1629
1629
  }
1630
1630
  readView(e, r) {
1631
1631
  if (!Number.isFinite(e))
@@ -1646,9 +1646,9 @@ class Ue {
1646
1646
  if (this.bitPos)
1647
1647
  throw this.err(`${this.bitPos} bits left after unpack: ${we.encode(this.data.slice(this.pos))}`);
1648
1648
  if (this.bs && !this.parent) {
1649
- const e = E.indices(this.bs, this.data.length, !0);
1649
+ const e = _.indices(this.bs, this.data.length, !0);
1650
1650
  if (e.length) {
1651
- const r = E.range(e).map(({ pos: n, length: o }) => `(${n}/${o})[${we.encode(this.data.subarray(n, n + o))}]`).join(", ");
1651
+ const r = _.range(e).map(({ pos: n, length: o }) => `(${n}/${o})[${we.encode(this.data.subarray(n, n + o))}]`).join(", ");
1652
1652
  throw this.err(`unread byte ranges: ${r} (total=${this.data.length})`);
1653
1653
  } else
1654
1654
  return;
@@ -1659,12 +1659,12 @@ class Ue {
1659
1659
  }
1660
1660
  // User methods
1661
1661
  err(e) {
1662
- return D.err("Reader", this.stack, e);
1662
+ return F.err("Reader", this.stack, e);
1663
1663
  }
1664
1664
  offsetReader(e) {
1665
1665
  if (e > this.data.length)
1666
1666
  throw this.err("offsetReader: Unexpected end of buffer");
1667
- return new Ue(this.absBytes(e), this.opts, this.stack, this, e);
1667
+ return new Me(this.absBytes(e), this.opts, this.stack, this, e);
1668
1668
  }
1669
1669
  bytes(e, r = !1) {
1670
1670
  if (this.bitPos)
@@ -1706,7 +1706,7 @@ class Ue {
1706
1706
  return r >>> 0;
1707
1707
  }
1708
1708
  find(e, r = this.pos) {
1709
- if (!R(e))
1709
+ if (!U(e))
1710
1710
  throw this.err(`find: needle is not bytes! ${e}`);
1711
1711
  if (this.bitPos)
1712
1712
  throw this.err("findByte: bitPos not empty");
@@ -1715,17 +1715,17 @@ class Ue {
1715
1715
  for (let n = r; (n = this.data.indexOf(e[0], n)) !== -1; n++) {
1716
1716
  if (n === -1 || this.data.length - n < e.length)
1717
1717
  return;
1718
- if (Ee(e, this.data.subarray(n, n + e.length)))
1718
+ if (_e(e, this.data.subarray(n, n + e.length)))
1719
1719
  return n;
1720
1720
  }
1721
1721
  }
1722
1722
  }
1723
- class mn {
1723
+ class wn {
1724
1724
  constructor(e = []) {
1725
- this.pos = 0, this.buffers = [], this.ptrs = [], this.bitBuf = 0, this.bitPos = 0, this.viewBuf = new Uint8Array(8), this.finished = !1, this.stack = e, this.view = St(this.viewBuf);
1725
+ this.pos = 0, this.buffers = [], this.ptrs = [], this.bitBuf = 0, this.bitPos = 0, this.viewBuf = new Uint8Array(8), this.finished = !1, this.stack = e, this.view = $t(this.viewBuf);
1726
1726
  }
1727
1727
  pushObj(e, r) {
1728
- return D.pushObj(this.stack, e, r);
1728
+ return F.pushObj(this.stack, e, r);
1729
1729
  }
1730
1730
  writeView(e, r) {
1731
1731
  if (this.finished)
@@ -1738,7 +1738,7 @@ class mn {
1738
1738
  err(e) {
1739
1739
  if (this.finished)
1740
1740
  throw this.err("buffer: finished");
1741
- return D.err("Reader", this.stack, e);
1741
+ return F.err("Reader", this.stack, e);
1742
1742
  }
1743
1743
  bytes(e) {
1744
1744
  if (this.finished)
@@ -1787,8 +1787,8 @@ class mn {
1787
1787
  }
1788
1788
  }
1789
1789
  }
1790
- const _e = (t) => Uint8Array.from(t).reverse();
1791
- function wn(t, e, r) {
1790
+ const Ae = (t) => Uint8Array.from(t).reverse();
1791
+ function yn(t, e, r) {
1792
1792
  if (r) {
1793
1793
  const n = 2n ** (e - 1n);
1794
1794
  if (t < -n || t >= n)
@@ -1796,28 +1796,28 @@ function wn(t, e, r) {
1796
1796
  } else if (0n > t || t >= 2n ** e)
1797
1797
  throw new Error(`value out of unsigned bounds. Expected 0 <= ${t} < ${2n ** e}`);
1798
1798
  }
1799
- function Lt(t) {
1799
+ function Nt(t) {
1800
1800
  return {
1801
1801
  // NOTE: we cannot export validate here, since it is likely mistake.
1802
1802
  encodeStream: t.encodeStream,
1803
1803
  decodeStream: t.decodeStream,
1804
1804
  size: t.size,
1805
1805
  encode: (e) => {
1806
- const r = new mn();
1806
+ const r = new wn();
1807
1807
  return t.encodeStream(r, e), r.finish();
1808
1808
  },
1809
1809
  decode: (e, r = {}) => {
1810
- const n = new Ue(e, r), o = t.decodeStream(n);
1810
+ const n = new Me(e, r), o = t.decodeStream(n);
1811
1811
  return n.finish(), o;
1812
1812
  }
1813
1813
  };
1814
1814
  }
1815
- function Nt(t, e) {
1816
- if (!$(t))
1815
+ function Pt(t, e) {
1816
+ if (!L(t))
1817
1817
  throw new Error(`validate: invalid inner value ${t}`);
1818
1818
  if (typeof e != "function")
1819
1819
  throw new Error("validate: fn should be function");
1820
- return Lt({
1820
+ return Nt({
1821
1821
  size: t.size,
1822
1822
  encodeStream: (r, n) => {
1823
1823
  let o;
@@ -1839,13 +1839,13 @@ function Nt(t, e) {
1839
1839
  });
1840
1840
  }
1841
1841
  const I = (t) => {
1842
- const e = Lt(t);
1843
- return t.validate ? Nt(e, t.validate) : e;
1844
- }, he = (t) => F(t) && typeof t.decode == "function" && typeof t.encode == "function";
1845
- function $(t) {
1846
- return F(t) && he(t) && typeof t.encodeStream == "function" && typeof t.decodeStream == "function" && (t.size === void 0 || N(t.size));
1842
+ const e = Nt(t);
1843
+ return t.validate ? Pt(e, t.validate) : e;
1844
+ }, fe = (t) => Q(t) && typeof t.decode == "function" && typeof t.encode == "function";
1845
+ function L(t) {
1846
+ return Q(t) && fe(t) && typeof t.encodeStream == "function" && typeof t.decodeStream == "function" && (t.size === void 0 || N(t.size));
1847
1847
  }
1848
- function yn() {
1848
+ function bn() {
1849
1849
  return {
1850
1850
  encode: (t) => {
1851
1851
  if (!Array.isArray(t))
@@ -1862,13 +1862,13 @@ function yn() {
1862
1862
  return e;
1863
1863
  },
1864
1864
  decode: (t) => {
1865
- if (!F(t))
1865
+ if (!Q(t))
1866
1866
  throw new Error(`expected plain object, got ${t}`);
1867
1867
  return Object.entries(t);
1868
1868
  }
1869
1869
  };
1870
1870
  }
1871
- const bn = {
1871
+ const Cn = {
1872
1872
  encode: (t) => {
1873
1873
  if (typeof t != "bigint")
1874
1874
  throw new Error(`expected bigint, got ${typeof t}`);
@@ -1882,8 +1882,8 @@ const bn = {
1882
1882
  return BigInt(t);
1883
1883
  }
1884
1884
  };
1885
- function Cn(t) {
1886
- if (!F(t))
1885
+ function xn(t) {
1886
+ if (!Q(t))
1887
1887
  throw new Error("plain object expected");
1888
1888
  return {
1889
1889
  encode: (e) => {
@@ -1898,7 +1898,7 @@ function Cn(t) {
1898
1898
  }
1899
1899
  };
1900
1900
  }
1901
- function xn(t, e = !1) {
1901
+ function vn(t, e = !1) {
1902
1902
  if (!N(t))
1903
1903
  throw new Error(`decimal/precision: wrong value ${t}`);
1904
1904
  if (typeof e != "boolean")
@@ -1934,11 +1934,11 @@ function xn(t, e = !1) {
1934
1934
  }
1935
1935
  };
1936
1936
  }
1937
- function vn(t) {
1937
+ function kn(t) {
1938
1938
  if (!Array.isArray(t))
1939
1939
  throw new Error(`expected array, got ${typeof t}`);
1940
1940
  for (const e of t)
1941
- if (!he(e))
1941
+ if (!fe(e))
1942
1942
  throw new Error(`wrong base coder ${e}`);
1943
1943
  return {
1944
1944
  encode: (e) => {
@@ -1959,11 +1959,11 @@ function vn(t) {
1959
1959
  }
1960
1960
  };
1961
1961
  }
1962
- const kn = (t) => {
1963
- if (!he(t))
1962
+ const En = (t) => {
1963
+ if (!fe(t))
1964
1964
  throw new Error("BaseCoder expected");
1965
1965
  return { encode: t.decode, decode: t.encode };
1966
- }, V = { dict: yn, numberBigint: bn, tsEnum: Cn, decimal: xn, match: vn, reverse: kn }, En = (t, e = !1, r = !1, n = !0) => {
1966
+ }, Z = { dict: bn, numberBigint: Cn, tsEnum: xn, decimal: vn, match: kn, reverse: En }, _n = (t, e = !1, r = !1, n = !0) => {
1967
1967
  if (!N(t))
1968
1968
  throw new Error(`bigint/size: wrong value ${t}`);
1969
1969
  if (typeof e != "boolean")
@@ -1990,7 +1990,7 @@ const kn = (t) => {
1990
1990
  a.bytes(e ? c.reverse() : c);
1991
1991
  },
1992
1992
  decodeStream: (a) => {
1993
- const i = a.bytes(n ? t : Math.min(t, a.leftBytes)), l = e ? i : _e(i);
1993
+ const i = a.bytes(n ? t : Math.min(t, a.leftBytes)), l = e ? i : Ae(i);
1994
1994
  let c = 0n;
1995
1995
  for (let d = 0; d < l.length; d++)
1996
1996
  c |= BigInt(l[d]) << 8n * BigInt(d);
@@ -1999,10 +1999,10 @@ const kn = (t) => {
1999
1999
  validate: (a) => {
2000
2000
  if (typeof a != "bigint")
2001
2001
  throw new Error(`bigint: invalid value: ${a}`);
2002
- return wn(a, 8n * o, !!r), a;
2002
+ return yn(a, 8n * o, !!r), a;
2003
2003
  }
2004
2004
  });
2005
- }, v = /* @__PURE__ */ En(8, !0), _n = (t, e) => I({
2005
+ }, k = /* @__PURE__ */ _n(8, !0), An = (t, e) => I({
2006
2006
  size: t,
2007
2007
  encodeStream: (r, n) => r.writeView(t, (o) => e.write(o, n)),
2008
2008
  decodeStream: (r) => r.readView(t, e.read),
@@ -2023,18 +2023,18 @@ const kn = (t) => {
2023
2023
  if (0 > l || l >= a)
2024
2024
  throw new Error(`uintView: value out of bounds. Expected 0 <= ${l} < ${a}`);
2025
2025
  };
2026
- return _n(t, {
2026
+ return An(t, {
2027
2027
  write: r.write,
2028
2028
  read: r.read,
2029
2029
  validate: e ? s : i
2030
2030
  });
2031
- }, ce = /* @__PURE__ */ Bt(4, !1, {
2031
+ }, le = /* @__PURE__ */ Bt(4, !1, {
2032
2032
  read: (t, e) => t.getUint32(e, !0),
2033
2033
  write: (t, e) => t.setUint32(0, e, !0)
2034
- }), S = /* @__PURE__ */ Bt(1, !1, {
2034
+ }), $ = /* @__PURE__ */ Bt(1, !1, {
2035
2035
  read: (t, e) => t.getUint8(e),
2036
2036
  write: (t, e) => t.setUint8(0, e)
2037
- }), Ae = /* @__PURE__ */ I({
2037
+ }), Ie = /* @__PURE__ */ I({
2038
2038
  size: 1,
2039
2039
  encodeStream: (t, e) => t.byte(e ? 1 : 0),
2040
2040
  decodeStream: (t) => {
@@ -2048,14 +2048,14 @@ const kn = (t) => {
2048
2048
  throw new Error(`bool: invalid value ${t}`);
2049
2049
  return t;
2050
2050
  }
2051
- }), fe = (t, e = !1) => {
2051
+ }), ue = (t, e = !1) => {
2052
2052
  if (typeof e != "boolean")
2053
2053
  throw new Error(`bytes/le: expected boolean, got ${typeof e}`);
2054
- const r = $t(t), n = R(t);
2054
+ const r = Lt(t), n = U(t);
2055
2055
  return I({
2056
2056
  size: typeof t == "number" ? t : void 0,
2057
2057
  encodeStream: (o, s) => {
2058
- n || r.encodeStream(o, s.length), o.bytes(e ? _e(s) : s), n && o.bytes(t);
2058
+ n || r.encodeStream(o, s.length), o.bytes(e ? Ae(s) : s), n && o.bytes(t);
2059
2059
  },
2060
2060
  decodeStream: (o) => {
2061
2061
  let s;
@@ -2066,23 +2066,23 @@ const kn = (t) => {
2066
2066
  s = o.bytes(a - o.pos), o.bytes(t.length);
2067
2067
  } else
2068
2068
  s = o.bytes(t === null ? o.leftBytes : r.decodeStream(o));
2069
- return e ? _e(s) : s;
2069
+ return e ? Ae(s) : s;
2070
2070
  },
2071
2071
  validate: (o) => {
2072
- if (!R(o))
2072
+ if (!U(o))
2073
2073
  throw new Error(`bytes: invalid value ${o}`);
2074
2074
  return o;
2075
2075
  }
2076
2076
  });
2077
- }, An = (t, e = !1) => Nt(In(fe(t, e), un), (r) => {
2077
+ }, In = (t, e = !1) => Pt(Sn(ue(t, e), pn), (r) => {
2078
2078
  if (typeof r != "string")
2079
2079
  throw new Error(`expected string, got ${typeof r}`);
2080
2080
  return r;
2081
2081
  });
2082
- function In(t, e) {
2083
- if (!$(t))
2082
+ function Sn(t, e) {
2083
+ if (!L(t))
2084
2084
  throw new Error(`apply: invalid inner value ${t}`);
2085
- if (!he(e))
2085
+ if (!fe(e))
2086
2086
  throw new Error(`apply: invalid base value ${t}`);
2087
2087
  return I({
2088
2088
  size: t.size,
@@ -2105,8 +2105,8 @@ function In(t, e) {
2105
2105
  }
2106
2106
  });
2107
2107
  }
2108
- function K(t, e, r) {
2109
- if (!$(t) || !$(e))
2108
+ function G(t, e, r) {
2109
+ if (!L(t) || !L(e))
2110
2110
  throw new Error(`optional: invalid flag or inner value flag=${t} inner=${e}`);
2111
2111
  return I({
2112
2112
  size: r !== void 0 && t.size && e.size ? t.size + e.size : void 0,
@@ -2120,7 +2120,7 @@ function K(t, e, r) {
2120
2120
  }
2121
2121
  });
2122
2122
  }
2123
- function Sn(t) {
2123
+ function $n(t) {
2124
2124
  return I({
2125
2125
  encodeStream: (e, r) => {
2126
2126
  if (r !== t)
@@ -2129,7 +2129,7 @@ function Sn(t) {
2129
2129
  decodeStream: (e) => t
2130
2130
  });
2131
2131
  }
2132
- function $n(t) {
2132
+ function Ln(t) {
2133
2133
  let e = 0;
2134
2134
  for (const r of t) {
2135
2135
  if (r.size === void 0)
@@ -2140,14 +2140,14 @@ function $n(t) {
2140
2140
  }
2141
2141
  return e;
2142
2142
  }
2143
- function m(t) {
2144
- if (!F(t))
2143
+ function g(t) {
2144
+ if (!Q(t))
2145
2145
  throw new Error(`struct: expected plain object, got ${t}`);
2146
2146
  for (const e in t)
2147
- if (!$(t[e]))
2147
+ if (!L(t[e]))
2148
2148
  throw new Error(`struct: field ${e} is not CoderType`);
2149
2149
  return I({
2150
- size: $n(Object.values(t)),
2150
+ size: Ln(Object.values(t)),
2151
2151
  encodeStream: (e, r) => {
2152
2152
  e.pushObj(r, (n) => {
2153
2153
  for (const o in t)
@@ -2168,28 +2168,28 @@ function m(t) {
2168
2168
  }
2169
2169
  });
2170
2170
  }
2171
- function ne(t, e) {
2172
- if (!$(e))
2171
+ function oe(t, e) {
2172
+ if (!L(e))
2173
2173
  throw new Error(`array: invalid inner value ${e}`);
2174
- const r = $t(typeof t == "string" ? `../${t}` : t);
2174
+ const r = Lt(typeof t == "string" ? `../${t}` : t);
2175
2175
  return I({
2176
2176
  size: typeof t == "number" && e.size ? t * e.size : void 0,
2177
2177
  encodeStream: (n, o) => {
2178
2178
  const s = n;
2179
2179
  s.pushObj(o, (a) => {
2180
- R(t) || r.encodeStream(n, o.length);
2180
+ U(t) || r.encodeStream(n, o.length);
2181
2181
  for (let i = 0; i < o.length; i++)
2182
2182
  a(`${i}`, () => {
2183
2183
  const l = o[i], c = n.pos;
2184
- if (e.encodeStream(n, l), R(t)) {
2184
+ if (e.encodeStream(n, l), U(t)) {
2185
2185
  if (t.length > s.pos - c)
2186
2186
  return;
2187
2187
  const d = s.finish(!1).subarray(c, s.pos);
2188
- if (Ee(d.subarray(0, t.length), t))
2188
+ if (_e(d.subarray(0, t.length), t))
2189
2189
  throw s.err(`array: inner element encoding same as separator. elm=${l} data=${d}`);
2190
2190
  }
2191
2191
  });
2192
- }), R(t) && n.bytes(t);
2192
+ }), U(t) && n.bytes(t);
2193
2193
  },
2194
2194
  decodeStream: (n) => {
2195
2195
  const o = [];
@@ -2197,9 +2197,9 @@ function ne(t, e) {
2197
2197
  if (t === null)
2198
2198
  for (let a = 0; !n.isEnd() && (s(`${a}`, () => o.push(e.decodeStream(n))), !(e.size && n.leftBytes < e.size)); a++)
2199
2199
  ;
2200
- else if (R(t))
2200
+ else if (U(t))
2201
2201
  for (let a = 0; ; a++) {
2202
- if (Ee(n.bytes(t.length, !0), t)) {
2202
+ if (_e(n.bytes(t.length, !0), t)) {
2203
2203
  n.bytes(t.length);
2204
2204
  break;
2205
2205
  }
@@ -2220,10 +2220,10 @@ function ne(t, e) {
2220
2220
  }
2221
2221
  });
2222
2222
  }
2223
- function Me(t, e) {
2224
- if (!$(t))
2223
+ function ze(t, e) {
2224
+ if (!L(t))
2225
2225
  throw new Error(`map: invalid inner value ${t}`);
2226
- if (!F(e))
2226
+ if (!Q(e))
2227
2227
  throw new Error("map: variants should be plain object");
2228
2228
  const r = /* @__PURE__ */ new Map();
2229
2229
  for (const n in e)
@@ -2246,13 +2246,13 @@ function Me(t, e) {
2246
2246
  }
2247
2247
  });
2248
2248
  }
2249
- function Ln(t, e) {
2250
- if (!$(t))
2249
+ function Nn(t, e) {
2250
+ if (!L(t))
2251
2251
  throw new Error(`tag: invalid tag value ${t}`);
2252
- if (!F(e))
2252
+ if (!Q(e))
2253
2253
  throw new Error("tag: variants should be plain object");
2254
2254
  for (const r in e)
2255
- if (!$(e[r]))
2255
+ if (!L(e[r]))
2256
2256
  throw new Error(`tag: variant ${r} is not CoderType`);
2257
2257
  return I({
2258
2258
  size: t.size,
@@ -2274,18 +2274,18 @@ function Ln(t, e) {
2274
2274
  }
2275
2275
  });
2276
2276
  }
2277
- const Nn = (t) => 0;
2277
+ const Pn = (t) => 0;
2278
2278
  function ye(t, e) {
2279
2279
  return e % t === 0 ? 0 : t - e % t;
2280
2280
  }
2281
- function Pt(t, e, r) {
2282
- if (!$(e))
2281
+ function Tt(t, e, r) {
2282
+ if (!L(e))
2283
2283
  throw new Error(`padRight: invalid inner value ${e}`);
2284
2284
  if (!N(t) || t <= 0)
2285
2285
  throw new Error(`padLeft: wrong blockSize=${t}`);
2286
2286
  if (r !== void 0 && typeof r != "function")
2287
2287
  throw new Error(`padRight: wrong padFn=${typeof r}`);
2288
- const n = r || Nn;
2288
+ const n = r || Pn;
2289
2289
  return I({
2290
2290
  size: e.size ? e.size + ye(t, e.size) : void 0,
2291
2291
  encodeStream: (o, s) => {
@@ -2301,7 +2301,7 @@ function Pt(t, e, r) {
2301
2301
  }
2302
2302
  });
2303
2303
  }
2304
- const Bn = 9, be = V.decimal(Bn), q = I({
2304
+ const Bn = 9, be = Z.decimal(Bn), K = I({
2305
2305
  encodeStream: (t, e) => {
2306
2306
  if (!e)
2307
2307
  return t.byte(0);
@@ -2317,36 +2317,36 @@ const Bn = 9, be = V.decimal(Bn), q = I({
2317
2317
  }
2318
2318
  return e;
2319
2319
  }
2320
- }), re = An(Pt(8, ce, void 0)), Pn = () => {
2321
- const t = fe(32);
2320
+ }), ne = In(Tt(8, le, void 0)), Tn = () => {
2321
+ const t = ue(32);
2322
2322
  return I({
2323
2323
  size: t.size,
2324
- encodeStream: (e, r) => t.encodeStream(e, ke.decode(r)),
2325
- decodeStream: (e) => ke.encode(t.decodeStream(e))
2324
+ encodeStream: (e, r) => t.encodeStream(e, Ee.decode(r)),
2325
+ decodeStream: (e) => Ee.encode(t.decodeStream(e))
2326
2326
  });
2327
- }, b = Pn(), Tn = m({
2328
- requiredSignatures: S,
2329
- readSigned: S,
2330
- readUnsigned: S,
2331
- keys: ne(q, b),
2327
+ }, b = Tn(), Rn = g({
2328
+ requiredSignatures: $,
2329
+ readSigned: $,
2330
+ readUnsigned: $,
2331
+ keys: oe(K, b),
2332
2332
  blockhash: b,
2333
- instructions: ne(q, m({ programIdx: S, keys: ne(q, S), data: fe(q) }))
2333
+ instructions: oe(K, g({ programIdx: $, keys: oe(K, $), data: ue(K) }))
2334
2334
  });
2335
- function Rn(t) {
2336
- if (ke.decode(t).length !== 32)
2335
+ function Un(t) {
2336
+ if (Ee.decode(t).length !== 32)
2337
2337
  throw new Error("Invalid Solana address");
2338
2338
  }
2339
- const Un = (t, e, r, n, o) => ({
2339
+ const Mn = (t, e, r, n, o) => ({
2340
2340
  sign: t < e,
2341
2341
  write: t < e - r || t >= e && t < o - n
2342
- }), nt = m({
2343
- signatures: ne(q, fe(64)),
2344
- msg: Tn
2345
- }), Ie = I({
2342
+ }), ot = g({
2343
+ signatures: oe(K, ue(64)),
2344
+ msg: Rn
2345
+ }), Se = I({
2346
2346
  encodeStream: (t, e) => {
2347
2347
  const { msg: r, signatures: n } = e, o = {}, s = (h, f, u) => {
2348
- let g = o[h] || (o[h] = { sign: !1, write: !1 });
2349
- g.write || (g.write = u), g.sign || (g.sign = f);
2348
+ let p = o[h] || (o[h] = { sign: !1, write: !1 });
2349
+ p.write || (p.write = u), p.sign || (p.sign = f);
2350
2350
  };
2351
2351
  s(r.feePayer, !0, !0);
2352
2352
  for (let h of r.instructions)
@@ -2364,7 +2364,7 @@ const Un = (t, e, r, n, o) => ({
2364
2364
  let l = 0, c = 0, d = 0;
2365
2365
  for (let h of i)
2366
2366
  o[h].sign && l++, !o[h].write && (o[h].sign ? c++ : d++);
2367
- nt.encodeStream(t, {
2367
+ ot.encodeStream(t, {
2368
2368
  signatures: i.filter((h) => o[h].sign).map((h) => n[h] || new Uint8Array(64)),
2369
2369
  msg: {
2370
2370
  requiredSignatures: l,
@@ -2382,7 +2382,7 @@ const Un = (t, e, r, n, o) => ({
2382
2382
  });
2383
2383
  },
2384
2384
  decodeStream: (t) => {
2385
- const { signatures: e, msg: r } = nt.decodeStream(t);
2385
+ const { signatures: e, msg: r } = ot.decodeStream(t);
2386
2386
  if (e.length !== r.requiredSignatures)
2387
2387
  throw new Error("SOL.tx: wrong signatures length");
2388
2388
  if (r.keys.length < e.length)
@@ -2394,7 +2394,7 @@ const Un = (t, e, r, n, o) => ({
2394
2394
  for (let s = 0; s < r.keys.length; s++)
2395
2395
  o.push({
2396
2396
  address: r.keys[s],
2397
- ...Un(s, r.requiredSignatures, r.readSigned, r.readUnsigned, r.keys.length)
2397
+ ...Mn(s, r.requiredSignatures, r.readSigned, r.readUnsigned, r.keys.length)
2398
2398
  });
2399
2399
  if (!o.length)
2400
2400
  throw new Error("SOL.tx: empty accounts array");
@@ -2411,22 +2411,22 @@ const Un = (t, e, r, n, o) => ({
2411
2411
  signatures: n
2412
2412
  };
2413
2413
  }
2414
- }), ot = {};
2415
- function ze(t, e, r) {
2416
- if (ot[t])
2414
+ }), st = {};
2415
+ function Oe(t, e, r) {
2416
+ if (st[t])
2417
2417
  throw new Error("SOL: program for this address already defined");
2418
- const n = Me(e, Object.keys(r).reduce((i, l, c) => ({ ...i, [l]: c }), {})), o = Object.keys(r).reduce((i, l) => ({ ...i, [l]: r[l].coder }), {}), s = Ln(n, o);
2419
- ot[t] = (i, l) => {
2418
+ const n = ze(e, Object.keys(r).reduce((i, l, c) => ({ ...i, [l]: c }), {})), o = Object.keys(r).reduce((i, l) => ({ ...i, [l]: r[l].coder }), {}), s = Nn(n, o);
2419
+ st[t] = (i, l) => {
2420
2420
  if (i.program !== t)
2421
2421
  throw new Error("SOL.parseInstruction: Wrong instruction program address");
2422
2422
  const { TAG: c, data: d } = s.decode(i.data), h = { type: c, info: d }, f = Object.keys(r[c].keys);
2423
2423
  if (f.length !== i.keys.length)
2424
2424
  throw new Error("SOL.parseInstruction: Keys length mismatch");
2425
2425
  for (let u = 0; u < f.length; u++) {
2426
- const g = f[u];
2427
- if (r[c].keys[g].address) {
2428
- if (r[c].keys[g].address !== i.keys[u].address)
2429
- throw new Error(`SOL.parseInstruction(${t}/${c}): Invalid constant address for key exp=${r[c].keys[g].address} got=${i.keys[u].address}`);
2426
+ const p = f[u];
2427
+ if (r[c].keys[p].address) {
2428
+ if (r[c].keys[p].address !== i.keys[u].address)
2429
+ throw new Error(`SOL.parseInstruction(${t}/${c}): Invalid constant address for key exp=${r[c].keys[p].address} got=${i.keys[u].address}`);
2430
2430
  continue;
2431
2431
  }
2432
2432
  h.info[f[u]] = i.keys[u].address;
@@ -2440,14 +2440,14 @@ function ze(t, e, r) {
2440
2440
  data: s.encode({ TAG: i, data: l }),
2441
2441
  keys: Object.keys(r[i].keys).map((c) => {
2442
2442
  let { sign: d, write: h, address: f } = r[i].keys[c];
2443
- return f || (f = l[c]), Rn(f), { address: f, sign: d, write: h };
2443
+ return f || (f = l[c]), Un(f), { address: f, sign: d, write: h };
2444
2444
  })
2445
2445
  });
2446
2446
  return a;
2447
2447
  }
2448
- const Ce = "SysvarRecentB1ockHashes11111111111111111111", O = "SysvarRent111111111111111111111111111111111", Tt = "11111111111111111111111111111111", Rt = ze(Tt, ce, {
2448
+ const Ce = "SysvarRecentB1ockHashes11111111111111111111", D = "SysvarRent111111111111111111111111111111111", Rt = "11111111111111111111111111111111", Ut = Oe(Rt, le, {
2449
2449
  createAccount: {
2450
- coder: m({ lamports: v, space: v, owner: b }),
2450
+ coder: g({ lamports: k, space: k, owner: b }),
2451
2451
  keys: {
2452
2452
  source: { sign: !0, write: !0 },
2453
2453
  newAccount: { sign: !0, write: !0 }
@@ -2455,21 +2455,21 @@ const Ce = "SysvarRecentB1ockHashes11111111111111111111", O = "SysvarRent1111111
2455
2455
  hint: (t) => `Create new account=${t.newAccount} with balance of ${be.encode(t.lamports)} and owner program ${t.owner}, using funding account ${t.source}`
2456
2456
  },
2457
2457
  assign: {
2458
- coder: m({ owner: b }),
2458
+ coder: g({ owner: b }),
2459
2459
  keys: { account: { sign: !0, write: !0 } },
2460
2460
  hint: (t) => `Assign account=${t.account} to owner program=${t.owner}`
2461
2461
  },
2462
2462
  transfer: {
2463
- coder: m({ lamports: v }),
2463
+ coder: g({ lamports: k }),
2464
2464
  keys: { source: { sign: !0, write: !0 }, destination: { sign: !1, write: !0 } },
2465
2465
  hint: (t) => `Transfer ${be.encode(t.lamports)} SOL from ${t.source} to ${t.destination}`
2466
2466
  },
2467
2467
  createAccountWithSeed: {
2468
- coder: m({
2468
+ coder: g({
2469
2469
  base: b,
2470
- seed: re,
2471
- lamports: v,
2472
- space: v,
2470
+ seed: ne,
2471
+ lamports: k,
2472
+ space: k,
2473
2473
  owner: b
2474
2474
  }),
2475
2475
  keys: {
@@ -2479,7 +2479,7 @@ const Ce = "SysvarRecentB1ockHashes11111111111111111111", O = "SysvarRent1111111
2479
2479
  }
2480
2480
  },
2481
2481
  advanceNonce: {
2482
- coder: m({}),
2482
+ coder: g({}),
2483
2483
  keys: {
2484
2484
  nonceAccount: { sign: !1, write: !0 },
2485
2485
  _recent_bh: { address: Ce, sign: !1, write: !1 },
@@ -2488,26 +2488,26 @@ const Ce = "SysvarRecentB1ockHashes11111111111111111111", O = "SysvarRent1111111
2488
2488
  hint: (t) => `Consume nonce in nonce account=${t.nonceAccount} (owner: ${t.nonceAuthority})`
2489
2489
  },
2490
2490
  withdrawFromNonce: {
2491
- coder: m({ lamports: v }),
2491
+ coder: g({ lamports: k }),
2492
2492
  keys: {
2493
2493
  nonceAccount: { sign: !1, write: !0 },
2494
2494
  destination: { sign: !1, write: !0 },
2495
2495
  _recent_bh: { address: Ce, sign: !1, write: !1 },
2496
- _rent: { address: O, sign: !1, write: !1 },
2496
+ _rent: { address: D, sign: !1, write: !1 },
2497
2497
  nonceAuthority: { sign: !0, write: !1 }
2498
2498
  },
2499
2499
  hint: (t) => `Withdraw ${be.encode(t.lamports)} SOL from nonce account=${t.nonceAccount} (owner: ${t.nonceAuthority}) to ${t.destination}`
2500
2500
  },
2501
2501
  initializeNonce: {
2502
- coder: m({ nonceAuthority: b }),
2502
+ coder: g({ nonceAuthority: b }),
2503
2503
  keys: {
2504
2504
  nonceAccount: { sign: !1, write: !0 },
2505
2505
  _recent_bh: { address: Ce, sign: !1, write: !1 },
2506
- _rent: { address: O, sign: !1, write: !1 }
2506
+ _rent: { address: D, sign: !1, write: !1 }
2507
2507
  }
2508
2508
  },
2509
2509
  authorizeNonce: {
2510
- coder: m({ newAuthorized: b }),
2510
+ coder: g({ newAuthorized: b }),
2511
2511
  keys: {
2512
2512
  nonceAccount: { sign: !1, write: !0 },
2513
2513
  nonceAuthority: { sign: !0, write: !1 }
@@ -2515,16 +2515,16 @@ const Ce = "SysvarRecentB1ockHashes11111111111111111111", O = "SysvarRent1111111
2515
2515
  hint: (t) => `Change owner of nonce account=${t.nonceAccount} from ${t.nonceAuthority} to ${t.newAuthorized}`
2516
2516
  },
2517
2517
  allocate: {
2518
- coder: m({ space: v }),
2518
+ coder: g({ space: k }),
2519
2519
  keys: {
2520
2520
  account: { sign: !0, write: !0 }
2521
2521
  }
2522
2522
  },
2523
2523
  allocateWithSeed: {
2524
- coder: m({
2524
+ coder: g({
2525
2525
  base: b,
2526
- seed: re,
2527
- space: v,
2526
+ seed: ne,
2527
+ space: k,
2528
2528
  owner: b
2529
2529
  }),
2530
2530
  keys: {
@@ -2533,9 +2533,9 @@ const Ce = "SysvarRecentB1ockHashes11111111111111111111", O = "SysvarRent1111111
2533
2533
  }
2534
2534
  },
2535
2535
  assignWithSeed: {
2536
- coder: m({
2536
+ coder: g({
2537
2537
  base: b,
2538
- seed: re,
2538
+ seed: ne,
2539
2539
  owner: b
2540
2540
  }),
2541
2541
  keys: {
@@ -2544,9 +2544,9 @@ const Ce = "SysvarRecentB1ockHashes11111111111111111111", O = "SysvarRent1111111
2544
2544
  }
2545
2545
  },
2546
2546
  transferWithSeed: {
2547
- coder: m({
2548
- lamports: v,
2549
- sourceSeed: re,
2547
+ coder: g({
2548
+ lamports: k,
2549
+ sourceSeed: ne,
2550
2550
  sourceOwner: b
2551
2551
  }),
2552
2552
  keys: {
@@ -2555,49 +2555,49 @@ const Ce = "SysvarRecentB1ockHashes11111111111111111111", O = "SysvarRent1111111
2555
2555
  destination: { sign: !1, write: !0 }
2556
2556
  }
2557
2557
  }
2558
- }), Ut = (t) => {
2558
+ }), Mt = (t) => {
2559
2559
  };
2560
- Ut(Rt.transfer);
2561
- Ut(Rt.advanceNonce);
2562
- const Mn = Me(S, {
2560
+ Mt(Ut.transfer);
2561
+ Mt(Ut.advanceNonce);
2562
+ const zn = ze($, {
2563
2563
  MintTokens: 0,
2564
2564
  FreezeAccount: 1,
2565
2565
  AccountOwner: 2,
2566
2566
  CloseAccount: 3
2567
- }), M = (t, e) => e[t]?.symbol || t, Mt = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
2568
- ze(Mt, S, {
2567
+ }), z = (t, e) => e[t]?.symbol || t, zt = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
2568
+ Oe(zt, $, {
2569
2569
  initializeMint: {
2570
- coder: m({
2571
- decimals: S,
2570
+ coder: g({
2571
+ decimals: $,
2572
2572
  mintAuthority: b,
2573
- freezeAuthority: K(Ae, b, "11111111111111111111111111111111")
2573
+ freezeAuthority: G(Ie, b, "11111111111111111111111111111111")
2574
2574
  }),
2575
2575
  keys: {
2576
2576
  mint: { sign: !1, write: !0 },
2577
- _rent: { address: O, sign: !1, write: !1 }
2577
+ _rent: { address: D, sign: !1, write: !1 }
2578
2578
  }
2579
2579
  },
2580
2580
  initializeAccount: {
2581
- coder: m({}),
2581
+ coder: g({}),
2582
2582
  keys: {
2583
2583
  account: { sign: !1, write: !0 },
2584
2584
  mint: { sign: !1, write: !1 },
2585
2585
  owner: { sign: !1, write: !1 },
2586
- _rent: { address: O, sign: !1, write: !1 }
2586
+ _rent: { address: D, sign: !1, write: !1 }
2587
2587
  },
2588
- hint: (t, e) => `Initialize token account=${t.account} with owner=${t.owner} token=${M(t.mint, e)}`
2588
+ hint: (t, e) => `Initialize token account=${t.account} with owner=${t.owner} token=${z(t.mint, e)}`
2589
2589
  },
2590
2590
  // TODO: multisig support?
2591
2591
  initializeMultisig: {
2592
- coder: m({ m: S }),
2592
+ coder: g({ m: $ }),
2593
2593
  keys: {
2594
2594
  account: { sign: !1, write: !0 },
2595
- _rent: { address: O, sign: !1, write: !1 }
2595
+ _rent: { address: D, sign: !1, write: !1 }
2596
2596
  },
2597
2597
  hint: (t, e) => `Initialize multi-sig token account=${t.account} with signatures=${t.m}`
2598
2598
  },
2599
2599
  transfer: {
2600
- coder: m({ amount: v }),
2600
+ coder: g({ amount: k }),
2601
2601
  keys: {
2602
2602
  source: { sign: !1, write: !0 },
2603
2603
  destination: { sign: !1, write: !0 },
@@ -2606,7 +2606,7 @@ ze(Mt, S, {
2606
2606
  hint: (t, e) => `Transfer ${t.amount} from token account=${t.source} of owner=${t.owner} to ${t.destination}`
2607
2607
  },
2608
2608
  approve: {
2609
- coder: m({ amount: v }),
2609
+ coder: g({ amount: k }),
2610
2610
  keys: {
2611
2611
  account: { sign: !1, write: !0 },
2612
2612
  delegate: { sign: !1, write: !1 },
@@ -2615,7 +2615,7 @@ ze(Mt, S, {
2615
2615
  hint: (t, e) => `Approve authority of delegate=${t.delegate} over tokens on account=${t.account} on behalf of owner=${t.owner}`
2616
2616
  },
2617
2617
  revoke: {
2618
- coder: m({}),
2618
+ coder: g({}),
2619
2619
  keys: {
2620
2620
  account: { sign: !1, write: !0 },
2621
2621
  owner: { sign: !0, write: !1 }
@@ -2623,9 +2623,9 @@ ze(Mt, S, {
2623
2623
  hint: (t, e) => `Revoke delegate's authority over tokens on account=${t.account} on behalf of owner=${t.owner}`
2624
2624
  },
2625
2625
  setAuthority: {
2626
- coder: m({
2627
- authorityType: Mn,
2628
- newAuthority: K(Ae, b, "11111111111111111111111111111111")
2626
+ coder: g({
2627
+ authorityType: zn,
2628
+ newAuthority: G(Ie, b, "11111111111111111111111111111111")
2629
2629
  }),
2630
2630
  keys: {
2631
2631
  account: { sign: !1, write: !0 },
@@ -2634,7 +2634,7 @@ ze(Mt, S, {
2634
2634
  hint: (t, e) => `Sets a new authority=${t.newAuthority} of a mint or account=${t.account}. Current authority=${t.currentAuthority}. Authority Type: ${t.authorityType}`
2635
2635
  },
2636
2636
  mintTo: {
2637
- coder: m({ amount: v }),
2637
+ coder: g({ amount: k }),
2638
2638
  keys: {
2639
2639
  mint: { sign: !1, write: !0 },
2640
2640
  dest: { sign: !1, write: !0 },
@@ -2642,7 +2642,7 @@ ze(Mt, S, {
2642
2642
  }
2643
2643
  },
2644
2644
  burn: {
2645
- coder: m({ amount: v }),
2645
+ coder: g({ amount: k }),
2646
2646
  keys: {
2647
2647
  account: { sign: !1, write: !0 },
2648
2648
  mint: { sign: !1, write: !0 },
@@ -2651,7 +2651,7 @@ ze(Mt, S, {
2651
2651
  hint: (t, e) => `Burn ${t.amount} tokens from account=${t.account} of owner=${t.owner} mint=${t.mint}`
2652
2652
  },
2653
2653
  closeAccount: {
2654
- coder: m({}),
2654
+ coder: g({}),
2655
2655
  keys: {
2656
2656
  account: { sign: !1, write: !0 },
2657
2657
  dest: { sign: !1, write: !0 },
@@ -2660,7 +2660,7 @@ ze(Mt, S, {
2660
2660
  hint: (t, e) => `Close token account=${t.account} of owner=${t.owner}, transferring all its SOL to destionation account=${t.dest}`
2661
2661
  },
2662
2662
  freezeAccount: {
2663
- coder: m({}),
2663
+ coder: g({}),
2664
2664
  keys: {
2665
2665
  account: { sign: !1, write: !0 },
2666
2666
  mint: { sign: !1, write: !0 },
@@ -2669,7 +2669,7 @@ ze(Mt, S, {
2669
2669
  hint: (t, e) => `Freeze token account=${t.account} of mint=${t.mint} using freeze_authority=${t.authority}`
2670
2670
  },
2671
2671
  thawAccount: {
2672
- coder: m({}),
2672
+ coder: g({}),
2673
2673
  keys: {
2674
2674
  account: { sign: !1, write: !0 },
2675
2675
  mint: { sign: !1, write: !1 },
@@ -2678,105 +2678,105 @@ ze(Mt, S, {
2678
2678
  hint: (t, e) => `Thaw a frozne token account=${t.account} of mint=${t.mint} using freeze_authority=${t.authority}`
2679
2679
  },
2680
2680
  transferChecked: {
2681
- coder: m({ amount: v, decimals: S }),
2681
+ coder: g({ amount: k, decimals: $ }),
2682
2682
  keys: {
2683
2683
  source: { sign: !1, write: !0 },
2684
2684
  mint: { sign: !1, write: !1 },
2685
2685
  destination: { sign: !1, write: !0 },
2686
2686
  owner: { sign: !0, write: !1 }
2687
2687
  },
2688
- hint: (t, e) => `Transfer ${V.decimal(t.decimals).encode(t.amount)} ${M(t.mint, e)} from token account=${t.source} of owner=${t.owner} to ${t.destination}`
2688
+ hint: (t, e) => `Transfer ${Z.decimal(t.decimals).encode(t.amount)} ${z(t.mint, e)} from token account=${t.source} of owner=${t.owner} to ${t.destination}`
2689
2689
  },
2690
2690
  approveChecked: {
2691
- coder: m({ amount: v, decimals: S }),
2691
+ coder: g({ amount: k, decimals: $ }),
2692
2692
  keys: {
2693
2693
  source: { sign: !1, write: !0 },
2694
2694
  mint: { sign: !1, write: !1 },
2695
2695
  delegate: { sign: !1, write: !1 },
2696
2696
  owner: { sign: !0, write: !1 }
2697
2697
  },
2698
- hint: (t, e) => `Approve delgate=${t.delegate} authority on behalf account=${t.source} owner=${t.owner} over ${V.decimal(t.decimals).encode(t.amount)} ${M(t.mint, e)}`
2698
+ hint: (t, e) => `Approve delgate=${t.delegate} authority on behalf account=${t.source} owner=${t.owner} over ${Z.decimal(t.decimals).encode(t.amount)} ${z(t.mint, e)}`
2699
2699
  },
2700
2700
  mintToChecked: {
2701
- coder: m({ amount: v, decimals: S }),
2701
+ coder: g({ amount: k, decimals: $ }),
2702
2702
  keys: {
2703
2703
  mint: { sign: !1, write: !0 },
2704
2704
  dest: { sign: !1, write: !0 },
2705
2705
  authority: { sign: !0, write: !1 }
2706
2706
  },
2707
- hint: (t, e) => `Mint new tokens (${V.decimal(t.decimals).encode(t.amount)} ${M(t.mint, e)}) to account=${t.dest} using authority=${t.authority}`
2707
+ hint: (t, e) => `Mint new tokens (${Z.decimal(t.decimals).encode(t.amount)} ${z(t.mint, e)}) to account=${t.dest} using authority=${t.authority}`
2708
2708
  },
2709
2709
  burnChecked: {
2710
- coder: m({ amount: v, decimals: S }),
2710
+ coder: g({ amount: k, decimals: $ }),
2711
2711
  keys: {
2712
2712
  mint: { sign: !1, write: !0 },
2713
2713
  account: { sign: !1, write: !0 },
2714
2714
  owner: { sign: !0, write: !1 }
2715
2715
  },
2716
- hint: (t, e) => `Burn tokens (${V.decimal(t.decimals).encode(t.amount)} ${M(t.mint, e)}) on account=${t.account} of owner=${t.owner}`
2716
+ hint: (t, e) => `Burn tokens (${Z.decimal(t.decimals).encode(t.amount)} ${z(t.mint, e)}) on account=${t.account} of owner=${t.owner}`
2717
2717
  },
2718
2718
  initializeAccount2: {
2719
- coder: m({ owner: b }),
2719
+ coder: g({ owner: b }),
2720
2720
  keys: {
2721
2721
  account: { sign: !1, write: !0 },
2722
2722
  mint: { sign: !1, write: !1 },
2723
- _rent: { address: O, sign: !1, write: !1 }
2723
+ _rent: { address: D, sign: !1, write: !1 }
2724
2724
  },
2725
- hint: (t, e) => `Initialize token account=${t.account} with owner=${t.owner} token=${M(t.mint, e)}`
2725
+ hint: (t, e) => `Initialize token account=${t.account} with owner=${t.owner} token=${z(t.mint, e)}`
2726
2726
  },
2727
2727
  syncNative: {
2728
- coder: m({}),
2728
+ coder: g({}),
2729
2729
  keys: { nativeAccount: { sign: !1, write: !0 } },
2730
2730
  hint: (t) => `Sync SOL balance for wrapped account ${t.nativeAccount}`
2731
2731
  }
2732
2732
  });
2733
- m({
2734
- version: ce,
2735
- state: ce,
2733
+ g({
2734
+ version: le,
2735
+ state: le,
2736
2736
  authority: b,
2737
2737
  nonce: b,
2738
- lamportPerSignature: v
2738
+ lamportPerSignature: k
2739
2739
  });
2740
- const zn = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
2741
- ze(zn, Sn(0), {
2740
+ const On = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
2741
+ Oe(On, $n(0), {
2742
2742
  create: {
2743
- coder: m({}),
2743
+ coder: g({}),
2744
2744
  keys: {
2745
2745
  source: { sign: !0, write: !0 },
2746
2746
  account: { sign: !1, write: !0 },
2747
2747
  wallet: { sign: !1, write: !1 },
2748
2748
  mint: { sign: !1, write: !1 },
2749
- _sys: { address: Tt, sign: !1, write: !1 },
2750
- _token: { address: Mt, sign: !1, write: !1 },
2751
- _rent: { address: O, sign: !1, write: !1 }
2749
+ _sys: { address: Rt, sign: !1, write: !1 },
2750
+ _token: { address: zt, sign: !1, write: !1 },
2751
+ _rent: { address: D, sign: !1, write: !1 }
2752
2752
  },
2753
- hint: (t, e) => `Initialize associated token account=${t.account} with owner=${t.wallet} for token=${M(t.mint, e)}, payed by ${t.source}`
2753
+ hint: (t, e) => `Initialize associated token account=${t.account} with owner=${t.wallet} for token=${z(t.mint, e)}, payed by ${t.source}`
2754
2754
  }
2755
2755
  });
2756
- const xe = Pt(4, Ae, () => 0);
2757
- m({
2756
+ const xe = Tt(4, Ie, () => 0);
2757
+ g({
2758
2758
  mint: b,
2759
2759
  owner: b,
2760
- amount: v,
2761
- delegate: K(xe, b, "11111111111111111111111111111111"),
2762
- state: Me(S, {
2760
+ amount: k,
2761
+ delegate: G(xe, b, "11111111111111111111111111111111"),
2762
+ state: ze($, {
2763
2763
  uninitialized: 0,
2764
2764
  initialized: 1,
2765
2765
  frozen: 2
2766
2766
  }),
2767
- isNative: K(xe, v, 0n),
2768
- delegateAmount: v,
2769
- closeAuthority: K(xe, b, "11111111111111111111111111111111")
2767
+ isNative: G(xe, k, 0n),
2768
+ delegateAmount: k,
2769
+ closeAuthority: G(xe, b, "11111111111111111111111111111111")
2770
2770
  });
2771
- function st(t, e, r) {
2771
+ function at(t, e, r) {
2772
2772
  if (!e.length)
2773
2773
  throw new Error("SOLPublic: empty instructions array");
2774
- return hn.encode(Ie.encode({
2774
+ return fn.encode(Se.encode({
2775
2775
  msg: { feePayer: t, blockhash: r, instructions: e },
2776
2776
  signatures: {}
2777
2777
  }));
2778
2778
  }
2779
- function On(t) {
2779
+ function Dn(t) {
2780
2780
  if (t.length >= 255)
2781
2781
  throw new TypeError("Alphabet too long");
2782
2782
  const e = new Uint8Array(256);
@@ -2798,22 +2798,22 @@ function On(t) {
2798
2798
  const u = c.length;
2799
2799
  for (; f !== u && c[f] === 0; )
2800
2800
  f++, d++;
2801
- const g = (u - f) * s + 1 >>> 0, y = new Uint8Array(g);
2801
+ const p = (u - f) * s + 1 >>> 0, C = new Uint8Array(p);
2802
2802
  for (; f !== u; ) {
2803
- let C = c[f], p = 0;
2804
- for (let k = g - 1; (C !== 0 || p < h) && k !== -1; k--, p++)
2805
- C += 256 * y[k] >>> 0, y[k] = C % r >>> 0, C = C / r >>> 0;
2806
- if (C !== 0)
2803
+ let x = c[f], m = 0;
2804
+ for (let E = p - 1; (x !== 0 || m < h) && E !== -1; E--, m++)
2805
+ x += 256 * C[E] >>> 0, C[E] = x % r >>> 0, x = x / r >>> 0;
2806
+ if (x !== 0)
2807
2807
  throw new Error("Non-zero carry");
2808
- h = p, f++;
2808
+ h = m, f++;
2809
2809
  }
2810
- let w = g - h;
2811
- for (; w !== g && y[w] === 0; )
2812
- w++;
2813
- let _ = n.repeat(d);
2814
- for (; w < g; ++w)
2815
- _ += t.charAt(y[w]);
2816
- return _;
2810
+ let y = p - h;
2811
+ for (; y !== p && C[y] === 0; )
2812
+ y++;
2813
+ let S = n.repeat(d);
2814
+ for (; y < p; ++y)
2815
+ S += t.charAt(C[y]);
2816
+ return S;
2817
2817
  }
2818
2818
  function i(c) {
2819
2819
  if (typeof c != "string")
@@ -2823,29 +2823,29 @@ function On(t) {
2823
2823
  let d = 0, h = 0, f = 0;
2824
2824
  for (; c[d] === n; )
2825
2825
  h++, d++;
2826
- const u = (c.length - d) * o + 1 >>> 0, g = new Uint8Array(u);
2826
+ const u = (c.length - d) * o + 1 >>> 0, p = new Uint8Array(u);
2827
2827
  for (; d < c.length; ) {
2828
- const C = c.charCodeAt(d);
2829
- if (C > 255)
2828
+ const x = c.charCodeAt(d);
2829
+ if (x > 255)
2830
2830
  return;
2831
- let p = e[C];
2832
- if (p === 255)
2831
+ let m = e[x];
2832
+ if (m === 255)
2833
2833
  return;
2834
- let k = 0;
2835
- for (let L = u - 1; (p !== 0 || k < f) && L !== -1; L--, k++)
2836
- p += r * g[L] >>> 0, g[L] = p % 256 >>> 0, p = p / 256 >>> 0;
2837
- if (p !== 0)
2834
+ let E = 0;
2835
+ for (let w = u - 1; (m !== 0 || E < f) && w !== -1; w--, E++)
2836
+ m += r * p[w] >>> 0, p[w] = m % 256 >>> 0, m = m / 256 >>> 0;
2837
+ if (m !== 0)
2838
2838
  throw new Error("Non-zero carry");
2839
- f = k, d++;
2839
+ f = E, d++;
2840
2840
  }
2841
- let y = u - f;
2842
- for (; y !== u && g[y] === 0; )
2843
- y++;
2844
- const w = new Uint8Array(h + (u - y));
2845
- let _ = h;
2846
- for (; y !== u; )
2847
- w[_++] = g[y++];
2848
- return w;
2841
+ let C = u - f;
2842
+ for (; C !== u && p[C] === 0; )
2843
+ C++;
2844
+ const y = new Uint8Array(h + (u - C));
2845
+ let S = h;
2846
+ for (; C !== u; )
2847
+ y[S++] = p[C++];
2848
+ return y;
2849
2849
  }
2850
2850
  function l(c) {
2851
2851
  const d = i(c);
@@ -2859,9 +2859,9 @@ function On(t) {
2859
2859
  decode: l
2860
2860
  };
2861
2861
  }
2862
- var Dn = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
2863
- On(Dn);
2864
- class Oe {
2862
+ var Fn = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
2863
+ Dn(Fn);
2864
+ class De {
2865
2865
  _transaction;
2866
2866
  signatures = [];
2867
2867
  feePayer;
@@ -2874,15 +2874,15 @@ class Oe {
2874
2874
  return this._instructions.push(...e), this;
2875
2875
  }
2876
2876
  static from(e) {
2877
- const r = e instanceof Uint8Array ? e : new Uint8Array(e), n = Ie.decode(r), o = new Oe();
2877
+ const r = e instanceof Uint8Array ? e : new Uint8Array(e), n = Se.decode(r), o = new De();
2878
2878
  return o._transaction = n, o;
2879
2879
  }
2880
2880
  serialize(e) {
2881
2881
  if (this._transaction)
2882
- return Buffer.from(Ie.encode(this._transaction));
2882
+ return Buffer.from(Se.encode(this._transaction));
2883
2883
  if (!this.feePayer || !this.recentBlockhash)
2884
2884
  throw new Error("Transaction requires feePayer and recentBlockhash");
2885
- const r = st(
2885
+ const r = at(
2886
2886
  this.feePayer.toString(),
2887
2887
  this._instructions,
2888
2888
  this.recentBlockhash
@@ -2892,7 +2892,7 @@ class Oe {
2892
2892
  serializeMessage() {
2893
2893
  if (!this.feePayer || !this.recentBlockhash)
2894
2894
  throw new Error("Transaction requires feePayer and recentBlockhash");
2895
- const e = st(
2895
+ const e = at(
2896
2896
  this.feePayer.toString(),
2897
2897
  this._instructions,
2898
2898
  this.recentBlockhash
@@ -2900,7 +2900,7 @@ class Oe {
2900
2900
  return Buffer.from(e, "hex");
2901
2901
  }
2902
2902
  }
2903
- class Fn {
2903
+ class Qn {
2904
2904
  type = "phantom";
2905
2905
  platform = "solana";
2906
2906
  account = void 0;
@@ -2968,7 +2968,7 @@ class Fn {
2968
2968
  if (!this.isAvailable() || !this.account)
2969
2969
  throw new Error("Phantom is not connected");
2970
2970
  try {
2971
- const r = Oe.from(e), o = await this.getProvider().signAndSendTransaction(r);
2971
+ const r = De.from(e), o = await this.getProvider().signAndSendTransaction(r);
2972
2972
  return {
2973
2973
  success: !0,
2974
2974
  wallet: this.type,
@@ -3010,17 +3010,17 @@ class Fn {
3010
3010
  };
3011
3011
  }
3012
3012
  }
3013
- class Qn extends de {
3013
+ class Hn extends he {
3014
3014
  type = "phantom-evm";
3015
3015
  rdns = "app.phantom";
3016
3016
  displayName = "Phantom";
3017
3017
  }
3018
- class Hn extends de {
3018
+ class jn extends he {
3019
3019
  type = "rabby";
3020
3020
  rdns = "io.rabby";
3021
3021
  displayName = "Rabby";
3022
3022
  }
3023
- class jn {
3023
+ class Yn {
3024
3024
  type = "braavos";
3025
3025
  platform = "starknet";
3026
3026
  wallet = void 0;
@@ -3159,19 +3159,19 @@ class Wn {
3159
3159
  constructor() {
3160
3160
  if (this.walletAdapters = /* @__PURE__ */ new Map(), typeof window > "u")
3161
3161
  return;
3162
- const e = new on();
3162
+ const e = new sn();
3163
3163
  this.walletAdapters.set("metamask", e);
3164
- const r = new Fn();
3164
+ const r = new Qn();
3165
3165
  this.walletAdapters.set("phantom", r);
3166
- const n = new Qn();
3166
+ const n = new Hn();
3167
3167
  this.walletAdapters.set("phantom-evm", n);
3168
- const o = new Jr();
3168
+ const o = new en();
3169
3169
  this.walletAdapters.set("argent", o);
3170
- const s = new jn();
3170
+ const s = new Yn();
3171
3171
  this.walletAdapters.set("braavos", s);
3172
- const a = new Hn();
3172
+ const a = new jn();
3173
3173
  this.walletAdapters.set("rabby", a);
3174
- const i = new nn();
3174
+ const i = new on();
3175
3175
  this.walletAdapters.set("base", i), window.wallet_bridge = this;
3176
3176
  }
3177
3177
  getIFrameMethods() {
@@ -3234,7 +3234,7 @@ class Wn {
3234
3234
  getConnectedWalletAdapter(e) {
3235
3235
  let r, n;
3236
3236
  try {
3237
- n = P(e);
3237
+ n = B(e);
3238
3238
  } catch {
3239
3239
  if (r = this.walletAdapters.get(e), !r)
3240
3240
  throw new Error(`Wallet ${e} is not connected or supported`);
@@ -3325,8 +3325,10 @@ class Wn {
3325
3325
  }
3326
3326
  }
3327
3327
  }
3328
- class Yn extends wr {
3328
+ const Vn = 200;
3329
+ class qn extends yr {
3329
3330
  walletBridge;
3331
+ onStarterpackPlay;
3330
3332
  constructor({
3331
3333
  url: e,
3332
3334
  policies: r,
@@ -3341,37 +3343,58 @@ class Yn extends wr {
3341
3343
  refGroup: h,
3342
3344
  needsSessionCreation: f,
3343
3345
  username: u,
3344
- onSessionCreated: g,
3346
+ onSessionCreated: p,
3347
+ onStarterpackPlay: C,
3345
3348
  encryptedBlob: y,
3346
- propagateSessionErrors: w,
3347
- errorDisplayMode: _,
3348
- ...C
3349
+ propagateSessionErrors: S,
3350
+ errorDisplayMode: x,
3351
+ ...m
3349
3352
  }) {
3350
- const p = new URL(e ?? lt), k = new Wn();
3351
- w && p.searchParams.set("propagate_error", "true"), _ && p.searchParams.set("error_display_mode", _), n && p.searchParams.set("v", encodeURIComponent(n)), o && p.searchParams.set("ps", encodeURIComponent(o)), s && p.searchParams.set("ns", encodeURIComponent(s)), a?.erc20 && p.searchParams.set(
3353
+ let E;
3354
+ const w = new URL(e ?? dt), H = new Wn();
3355
+ S && w.searchParams.set("propagate_error", "true"), x && w.searchParams.set("error_display_mode", x), n && w.searchParams.set("v", encodeURIComponent(n)), o && w.searchParams.set("ps", encodeURIComponent(o)), s && w.searchParams.set("ns", encodeURIComponent(s)), a?.erc20 && w.searchParams.set(
3352
3356
  "erc20",
3353
3357
  encodeURIComponent(a.erc20.toString())
3354
- ), c && p.searchParams.set("rpc_url", encodeURIComponent(c)), d && p.searchParams.set("ref", encodeURIComponent(d)), h && p.searchParams.set("ref_group", encodeURIComponent(h)), f && p.searchParams.set("needs_session_creation", "true"), u && p.searchParams.set("username", encodeURIComponent(u)), (!i || l) && r ? p.searchParams.set(
3358
+ ), c && w.searchParams.set("rpc_url", encodeURIComponent(c)), d && w.searchParams.set("ref", encodeURIComponent(d)), h && w.searchParams.set("ref_group", encodeURIComponent(h)), f && w.searchParams.set("needs_session_creation", "true"), u && w.searchParams.set("username", encodeURIComponent(u)), (!i || l) && r ? w.searchParams.set(
3355
3359
  "policies",
3356
3360
  encodeURIComponent(JSON.stringify(r))
3357
- ) : i && p.searchParams.set("preset", i), y && (p.hash = `kc=${encodeURIComponent(y)}`), super({
3358
- ...C,
3361
+ ) : i && w.searchParams.set("preset", i), y && (w.hash = `kc=${encodeURIComponent(y)}`), super({
3362
+ ...m,
3359
3363
  id: "controller-keychain",
3360
- url: p,
3364
+ url: w,
3361
3365
  methods: {
3362
- ...k.getIFrameMethods(),
3366
+ ...H.getIFrameMethods(),
3363
3367
  // Expose callback for keychain to notify parent that session was created and storage access granted
3364
- onSessionCreated: (L) => () => {
3365
- g && g();
3368
+ onSessionCreated: (T) => () => {
3369
+ p && p();
3370
+ },
3371
+ onStarterpackPlay: (T) => async () => {
3372
+ E && await E();
3373
+ }
3374
+ }
3375
+ }), this.walletBridge = H, this.onStarterpackPlay = C, E = async () => {
3376
+ this.close();
3377
+ const T = this.onStarterpackPlay;
3378
+ if (this.onStarterpackPlay = void 0, !!T) {
3379
+ await new Promise(
3380
+ (pe) => setTimeout(pe, Vn)
3381
+ );
3382
+ try {
3383
+ T();
3384
+ } catch (pe) {
3385
+ console.error("Failed to run starterpack play callback:", pe);
3366
3386
  }
3367
3387
  }
3368
- }), this.walletBridge = k, typeof window < "u" && (window.external_wallets = this.walletBridge);
3388
+ }, typeof window < "u" && (window.external_wallets = this.walletBridge);
3369
3389
  }
3370
3390
  getWalletBridge() {
3371
3391
  return this.walletBridge;
3372
3392
  }
3393
+ setOnStarterpackPlay(e) {
3394
+ this.onStarterpackPlay = e;
3395
+ }
3373
3396
  }
3374
- function Vn(t) {
3397
+ function Zn(t) {
3375
3398
  if (!t || t.trim() === "")
3376
3399
  return { isValid: !1, error: "Redirect URL is empty" };
3377
3400
  let e;
@@ -3403,7 +3426,7 @@ function Vn(t) {
3403
3426
  }
3404
3427
  return { isValid: !0 };
3405
3428
  }
3406
- class _o extends Wt {
3429
+ class Io extends Wt {
3407
3430
  keychain;
3408
3431
  options;
3409
3432
  iframes;
@@ -3419,7 +3442,7 @@ class _o extends Wt {
3419
3442
  const n = [...[
3420
3443
  { rpcUrl: "https://api.cartridge.gg/x/starknet/sepolia/rpc/v0_9" },
3421
3444
  { rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet/rpc/v0_9" }
3422
- ], ...e.chains || []], o = e.defaultChainId || Z.StarknetChainId.SN_MAIN;
3445
+ ], ...e.chains || []], o = e.defaultChainId || ve.StarknetChainId.SN_MAIN;
3423
3446
  this.selectedChain = o, this.chains = /* @__PURE__ */ new Map();
3424
3447
  const s = typeof window < "u" ? new URLSearchParams(window.location.search) : null;
3425
3448
  if (this.referral = {
@@ -3476,7 +3499,7 @@ class _o extends Wt {
3476
3499
  }
3477
3500
  const e = await this.keychain.probe(this.rpcUrl());
3478
3501
  let r = e?.rpcUrl || this.rpcUrl();
3479
- this.account = new He(
3502
+ this.account = new je(
3480
3503
  this,
3481
3504
  r,
3482
3505
  e.address,
@@ -3503,9 +3526,9 @@ class _o extends Wt {
3503
3526
  try {
3504
3527
  const r = e ?? this.options.signupOptions;
3505
3528
  let n = await this.keychain.connect(r);
3506
- if (n.code !== T.SUCCESS)
3529
+ if (n.code !== R.SUCCESS)
3507
3530
  throw new Error(n.message);
3508
- return n = n, this.account = new He(
3531
+ return n = n, this.account = new je(
3509
3532
  this,
3510
3533
  this.rpcUrl(),
3511
3534
  n.address,
@@ -3604,10 +3627,10 @@ class _o extends Wt {
3604
3627
  const e = this.chains.get(this.selectedChain);
3605
3628
  if (!e) {
3606
3629
  const r = Array.from(this.chains.keys()).map(
3607
- (n) => Qe.decodeShortString(n)
3630
+ (n) => He.decodeShortString(n)
3608
3631
  );
3609
3632
  throw new Error(
3610
- `Chain not found: ${Qe.decodeShortString(this.selectedChain)}. Available chains: ${r.join(", ")}`
3633
+ `Chain not found: ${He.decodeShortString(this.selectedChain)}. Available chains: ${r.join(", ")}`
3611
3634
  );
3612
3635
  }
3613
3636
  return e.rpcUrl;
@@ -3631,13 +3654,16 @@ class _o extends Wt {
3631
3654
  }
3632
3655
  }
3633
3656
  async openStarterPack(e, r) {
3634
- if (this.iframes) {
3635
- if (!this.keychain || !this.iframes.keychain) {
3636
- console.error(new A().message);
3637
- return;
3638
- }
3639
- await this.keychain.openStarterPack(e, r), this.iframes.keychain?.open();
3657
+ if (!this.iframes)
3658
+ return;
3659
+ if (!this.keychain || !this.iframes.keychain) {
3660
+ console.error(new A().message);
3661
+ return;
3640
3662
  }
3663
+ const { onPurchaseComplete: n, ...o } = r ?? {};
3664
+ this.iframes.keychain.setOnStarterpackPlay(n);
3665
+ const s = Object.keys(o).length > 0 ? o : void 0;
3666
+ await this.keychain.openStarterPack(e, s), this.iframes.keychain?.open();
3641
3667
  }
3642
3668
  async openExecute(e, r) {
3643
3669
  if (!this.iframes)
@@ -3650,7 +3676,7 @@ class _o extends Wt {
3650
3676
  r && this.switchStarknetChain(r), this.iframes.keychain.open();
3651
3677
  const o = await this.keychain.execute(e, void 0, void 0, !0);
3652
3678
  return this.iframes.keychain.close(), r && this.switchStarknetChain(n), {
3653
- status: !(o && (o.code === T.NOT_CONNECTED || o.code === T.CANCELED)),
3679
+ status: !(o && (o.code === R.NOT_CONNECTED || o.code === R.CANCELED)),
3654
3680
  transactionHash: o?.transaction_hash
3655
3681
  };
3656
3682
  }
@@ -3667,7 +3693,7 @@ class _o extends Wt {
3667
3693
  console.error("open can only be called in browser context");
3668
3694
  return;
3669
3695
  }
3670
- const r = new URL(this.options.url || lt), n = e.redirectUrl || window.location.href, o = Vn(n);
3696
+ const r = new URL(this.options.url || dt), n = e.redirectUrl || window.location.href, o = Zn(n);
3671
3697
  if (!o.isValid) {
3672
3698
  console.error(
3673
3699
  `Invalid redirect URL: ${o.error}`,
@@ -3683,11 +3709,7 @@ class _o extends Wt {
3683
3709
  initializeChains(e) {
3684
3710
  for (const r of e)
3685
3711
  try {
3686
- const n = new URL(r.rpcUrl), o = Yt(n), s = o === Z.StarknetChainId.SN_MAIN, a = o === Z.StarknetChainId.SN_SEPOLIA, i = n.hostname === "api.cartridge.gg", l = n.hostname === "localhost" || n.hostname === "127.0.0.1";
3687
- if ((s || a) && !(i || l))
3688
- throw new Error(
3689
- `Only Cartridge RPC providers are allowed for ${s ? "mainnet" : "sepolia"}. Please use: https://api.cartridge.gg/x/starknet/${s ? "mainnet" : "sepolia"}/rpc/v0_9`
3690
- );
3712
+ const n = new URL(r.rpcUrl), o = Vt(n);
3691
3713
  this.chains.set(o, r);
3692
3714
  } catch (n) {
3693
3715
  throw console.error(`Failed to parse chainId for ${r.rpcUrl}:`, n), n;
@@ -3699,14 +3721,14 @@ class _o extends Wt {
3699
3721
  createKeychainIframe() {
3700
3722
  const e = typeof window < "u" && typeof sessionStorage < "u" && sessionStorage.getItem("controller_standalone") === "1", n = (typeof window < "u" ? new URLSearchParams(window.location.search) : void 0)?.get("username") ?? void 0, o = this.encryptedBlob;
3701
3723
  e && sessionStorage.removeItem("controller_standalone"), o && (this.encryptedBlob = void 0);
3702
- const s = new Yn({
3724
+ const s = new qn({
3703
3725
  ...this.options,
3704
3726
  rpcUrl: this.rpcUrl(),
3705
3727
  onClose: this.keychain?.reset,
3706
3728
  onConnect: (a) => {
3707
3729
  this.keychain = a;
3708
3730
  },
3709
- version: Vt,
3731
+ version: qt,
3710
3732
  ref: this.referral.ref,
3711
3733
  refGroup: this.referral.refGroup,
3712
3734
  needsSessionCreation: e,
@@ -3735,11 +3757,11 @@ class _o extends Wt {
3735
3757
  });
3736
3758
  }
3737
3759
  }
3738
- const H = /* @__PURE__ */ new Map();
3739
- async function zt(t) {
3760
+ const Y = /* @__PURE__ */ new Map();
3761
+ async function Ot(t) {
3740
3762
  if (!t.addresses?.length && !t.usernames?.length)
3741
3763
  return { results: [] };
3742
- const e = await fetch(`${qt}/lookup`, {
3764
+ const e = await fetch(`${Zt}/lookup`, {
3743
3765
  method: "POST",
3744
3766
  headers: {
3745
3767
  "Content-Type": "application/json"
@@ -3750,37 +3772,37 @@ async function zt(t) {
3750
3772
  throw new Error(`HTTP error! status: ${e.status}`);
3751
3773
  return e.json();
3752
3774
  }
3753
- async function Ao(t) {
3754
- const e = t.filter((r) => !H.has(r));
3755
- return e.length > 0 && (await zt({ usernames: e })).results.forEach((n) => {
3756
- H.set(n.username, n.addresses[0]);
3775
+ async function So(t) {
3776
+ const e = t.filter((r) => !Y.has(r));
3777
+ return e.length > 0 && (await Ot({ usernames: e })).results.forEach((n) => {
3778
+ Y.set(n.username, n.addresses[0]);
3757
3779
  }), new Map(
3758
- t.map((r) => [r, H.get(r)]).filter((r) => r[1] !== void 0)
3780
+ t.map((r) => [r, Y.get(r)]).filter((r) => r[1] !== void 0)
3759
3781
  );
3760
3782
  }
3761
- async function Io(t) {
3762
- t = t.map(ct.toHex);
3763
- const e = t.filter((r) => !H.has(r));
3764
- return e.length > 0 && (await zt({
3783
+ async function $o(t) {
3784
+ t = t.map(lt.toHex);
3785
+ const e = t.filter((r) => !Y.has(r));
3786
+ return e.length > 0 && (await Ot({
3765
3787
  addresses: e
3766
3788
  })).results.forEach((n) => {
3767
- H.set(n.addresses[0], n.username);
3789
+ Y.set(n.addresses[0], n.username);
3768
3790
  }), new Map(
3769
- t.map((r) => [r, H.get(r)]).filter((r) => r[1] !== void 0)
3791
+ t.map((r) => [r, Y.get(r)]).filter((r) => r[1] !== void 0)
3770
3792
  );
3771
3793
  }
3772
- const x = "cartridge-toast-container", qn = 3e3, Zn = "bottom-right", Ot = "cartridge-toast-show";
3773
- function De() {
3794
+ const v = "cartridge-toast-container", Kn = 3e3, Gn = "bottom-right", Dt = "cartridge-toast-show";
3795
+ function Fe() {
3774
3796
  try {
3775
3797
  return typeof window < "u" && window.self !== window.top;
3776
3798
  } catch {
3777
3799
  return !0;
3778
3800
  }
3779
3801
  }
3780
- function Kn() {
3802
+ function Xn() {
3781
3803
  if (typeof document > "u")
3782
3804
  return null;
3783
- if (De())
3805
+ if (Fe())
3784
3806
  try {
3785
3807
  if (window.parent && window.parent.document)
3786
3808
  return window.parent.document;
@@ -3789,24 +3811,24 @@ function Kn() {
3789
3811
  }
3790
3812
  return document;
3791
3813
  }
3792
- function Gn(t, e) {
3793
- let r = t.getElementById(x);
3794
- return r || (r = t.createElement("div"), r.id = x, t.body && t.body.appendChild(r)), r.className = e, r;
3814
+ function Jn(t, e) {
3815
+ let r = t.getElementById(v);
3816
+ return r || (r = t.createElement("div"), r.id = v, t.body && t.body.appendChild(r)), r.className = e, r;
3795
3817
  }
3796
- function Xn(t) {
3818
+ function eo(t) {
3797
3819
  t.classList.add("closing"), setTimeout(() => {
3798
3820
  t.parentNode && t.parentNode.removeChild(t);
3799
3821
  }, 200);
3800
3822
  }
3801
- function Jn(t) {
3823
+ function to(t) {
3802
3824
  if (t.getElementById("cartridge-toast-styles"))
3803
3825
  return;
3804
3826
  const e = t.createElement("style");
3805
- e.id = "cartridge-toast-styles", e.textContent = eo(), t.head.appendChild(e);
3827
+ e.id = "cartridge-toast-styles", e.textContent = ro(), t.head.appendChild(e);
3806
3828
  }
3807
- function eo() {
3829
+ function ro() {
3808
3830
  return `
3809
- #${x} {
3831
+ #${v} {
3810
3832
  position: fixed;
3811
3833
  z-index: 999999;
3812
3834
  pointer-events: none;
@@ -3816,38 +3838,38 @@ function eo() {
3816
3838
  gap: 12px;
3817
3839
  }
3818
3840
 
3819
- #${x}.top-left {
3841
+ #${v}.top-left {
3820
3842
  top: 20px;
3821
3843
  left: 20px;
3822
3844
  align-items: flex-start;
3823
3845
  }
3824
3846
 
3825
- #${x}.top-right {
3847
+ #${v}.top-right {
3826
3848
  top: 20px;
3827
3849
  right: 20px;
3828
3850
  align-items: flex-end;
3829
3851
  }
3830
3852
 
3831
- #${x}.top-center {
3853
+ #${v}.top-center {
3832
3854
  top: 20px;
3833
3855
  left: 50%;
3834
3856
  transform: translateX(-50%);
3835
3857
  align-items: center;
3836
3858
  }
3837
3859
 
3838
- #${x}.bottom-left {
3860
+ #${v}.bottom-left {
3839
3861
  bottom: 20px;
3840
3862
  left: 20px;
3841
3863
  align-items: flex-start;
3842
3864
  }
3843
3865
 
3844
- #${x}.bottom-right {
3866
+ #${v}.bottom-right {
3845
3867
  bottom: 20px;
3846
3868
  right: 20px;
3847
3869
  align-items: flex-end;
3848
3870
  }
3849
3871
 
3850
- #${x}.bottom-center {
3872
+ #${v}.bottom-center {
3851
3873
  bottom: 20px;
3852
3874
  left: 50%;
3853
3875
  transform: translateX(-50%);
@@ -3863,18 +3885,18 @@ function eo() {
3863
3885
  pointer-events: auto;
3864
3886
  }
3865
3887
 
3866
- #${x}.top-right .cartridge-toast,
3867
- #${x}.bottom-right .cartridge-toast {
3888
+ #${v}.top-right .cartridge-toast,
3889
+ #${v}.bottom-right .cartridge-toast {
3868
3890
  align-self: flex-end;
3869
3891
  }
3870
3892
 
3871
- #${x}.top-left .cartridge-toast,
3872
- #${x}.bottom-left .cartridge-toast {
3893
+ #${v}.top-left .cartridge-toast,
3894
+ #${v}.bottom-left .cartridge-toast {
3873
3895
  align-self: flex-start;
3874
3896
  }
3875
3897
 
3876
- #${x}.top-center .cartridge-toast,
3877
- #${x}.bottom-center .cartridge-toast {
3898
+ #${v}.top-center .cartridge-toast,
3899
+ #${v}.bottom-center .cartridge-toast {
3878
3900
  align-self: center;
3879
3901
  }
3880
3902
 
@@ -3910,9 +3932,9 @@ function eo() {
3910
3932
  max-width: calc(100vw - 40px);
3911
3933
  }
3912
3934
 
3913
- #${x}.top-left,
3914
- #${x}.top-right,
3915
- #${x}.top-center {
3935
+ #${v}.top-left,
3936
+ #${v}.top-right,
3937
+ #${v}.top-center {
3916
3938
  top: 10px;
3917
3939
  left: 20px;
3918
3940
  right: 20px;
@@ -3920,9 +3942,9 @@ function eo() {
3920
3942
  align-items: stretch;
3921
3943
  }
3922
3944
 
3923
- #${x}.bottom-left,
3924
- #${x}.bottom-right,
3925
- #${x}.bottom-center {
3945
+ #${v}.bottom-left,
3946
+ #${v}.bottom-right,
3947
+ #${v}.bottom-center {
3926
3948
  bottom: 10px;
3927
3949
  left: 20px;
3928
3950
  right: 20px;
@@ -3932,7 +3954,7 @@ function eo() {
3932
3954
  }
3933
3955
  `;
3934
3956
  }
3935
- const ee = (t = !1) => {
3957
+ const te = (t = !1) => {
3936
3958
  const e = document.createElement("div");
3937
3959
  e.id = "close-button", e.style.display = "flex", e.style.alignItems = "center", e.style.justifyContent = "center";
3938
3960
  const r = document.createElement("button");
@@ -3980,7 +4002,7 @@ const ee = (t = !1) => {
3980
4002
  }
3981
4003
  return e.appendChild(r), e;
3982
4004
  };
3983
- function to(t) {
4005
+ function no(t) {
3984
4006
  if (t.getElementById("cartridge-toast-error-styles"))
3985
4007
  return;
3986
4008
  const e = t.createElement("style");
@@ -4054,7 +4076,7 @@ function to(t) {
4054
4076
  }
4055
4077
  `, t.head.appendChild(e);
4056
4078
  }
4057
- function ro(t) {
4079
+ function oo(t) {
4058
4080
  const e = document.createElement("div");
4059
4081
  e.className = "cartridge-toast error";
4060
4082
  const r = document.createElement("div");
@@ -4071,10 +4093,10 @@ function ro(t) {
4071
4093
  s.className = "content", s.textContent = t.message || "Error", n.appendChild(s);
4072
4094
  const a = document.createElement("div");
4073
4095
  a.className = "close-button-container";
4074
- const i = ee(!0);
4096
+ const i = te(!0);
4075
4097
  return a.appendChild(i), e.appendChild(a), e;
4076
4098
  }
4077
- function no(t) {
4099
+ function so(t) {
4078
4100
  if (t.getElementById("cartridge-toast-transaction-styles"))
4079
4101
  return;
4080
4102
  const e = t.createElement("style");
@@ -4211,7 +4233,7 @@ function no(t) {
4211
4233
  }
4212
4234
  `, t.head.appendChild(e);
4213
4235
  }
4214
- function oo(t) {
4236
+ function ao(t) {
4215
4237
  const e = document.createElement("div");
4216
4238
  if (e.className = `cartridge-toast transaction ${t.isExpanded ? "expanded" : "collapsed"}`, t.isExpanded) {
4217
4239
  const r = document.createElement("div");
@@ -4249,7 +4271,7 @@ function oo(t) {
4249
4271
  n.appendChild(o), r.appendChild(n);
4250
4272
  const i = document.createElement("div");
4251
4273
  i.className = "close-button-container";
4252
- const l = ee();
4274
+ const l = te();
4253
4275
  i.appendChild(l), r.appendChild(i), e.appendChild(r);
4254
4276
  } else {
4255
4277
  const r = document.createElement("div");
@@ -4266,7 +4288,7 @@ function oo(t) {
4266
4288
  }
4267
4289
  return e;
4268
4290
  }
4269
- function so(t) {
4291
+ function io(t) {
4270
4292
  if (t.getElementById("cartridge-toast-network-switch-styles"))
4271
4293
  return;
4272
4294
  const e = t.createElement("style");
@@ -4290,15 +4312,15 @@ function so(t) {
4290
4312
  }
4291
4313
  `, t.head.appendChild(e);
4292
4314
  }
4293
- function ao(t) {
4315
+ function co(t) {
4294
4316
  const e = document.createElement("div");
4295
4317
  e.className = "cartridge-toast network-switch";
4296
4318
  const r = document.createElement(t.networkIcon ? "img" : "div");
4297
- r.className = "icon", r.style.width = "24px", r.style.height = "24px", r.style.aspectRatio = "1/1", t.networkIcon ? (r.src = dt(t.networkIcon), r.alt = t.networkName) : (r.style.backgroundColor = "#161A17", r.innerHTML = t.networkName.charAt(0).toUpperCase(), r.style.color = "#ffffff", r.style.fontWeight = "600", r.style.fontSize = "12px", r.style.lineHeight = "16px", r.style.textAlign = "center", r.style.textTransform = "uppercase", r.style.borderRadius = "4px", r.style.padding = "4px");
4319
+ r.className = "icon", r.style.width = "24px", r.style.height = "24px", r.style.aspectRatio = "1/1", t.networkIcon ? (r.src = ht(t.networkIcon), r.alt = t.networkName) : (r.style.backgroundColor = "#161A17", r.innerHTML = t.networkName.charAt(0).toUpperCase(), r.style.color = "#ffffff", r.style.fontWeight = "600", r.style.fontSize = "12px", r.style.lineHeight = "16px", r.style.textAlign = "center", r.style.textTransform = "uppercase", r.style.borderRadius = "4px", r.style.padding = "4px");
4298
4320
  const n = document.createElement("p");
4299
4321
  return n.className = "content", n.textContent = `Switched to ${t.networkName}`, e.appendChild(r), e.appendChild(n), e;
4300
4322
  }
4301
- function io(t) {
4323
+ function lo(t) {
4302
4324
  if (t.getElementById("cartridge-toast-achievement-styles"))
4303
4325
  return;
4304
4326
  const e = t.createElement("style");
@@ -4401,14 +4423,14 @@ function io(t) {
4401
4423
  }
4402
4424
  `, t.head.appendChild(e);
4403
4425
  }
4404
- function co(t) {
4426
+ function ho(t) {
4405
4427
  const e = document.createElement("div");
4406
4428
  e.className = "cartridge-toast achievement";
4407
4429
  const r = document.createElement("div");
4408
4430
  r.className = "image-content-container";
4409
4431
  const n = document.createElement("div");
4410
4432
  n.className = "image-container";
4411
- const o = lo(t.isDraft);
4433
+ const o = fo(t.isDraft);
4412
4434
  o.className = "image", n.appendChild(o);
4413
4435
  const s = document.createElement("div");
4414
4436
  s.className = "content";
@@ -4420,14 +4442,14 @@ function co(t) {
4420
4442
  l.className = "xp-section-container";
4421
4443
  const c = document.createElement("div");
4422
4444
  c.className = "xp-section";
4423
- const d = ho(!t.isDraft);
4445
+ const d = uo(!t.isDraft);
4424
4446
  d.setAttribute("class", "xp-icon"), c.appendChild(d);
4425
4447
  const h = document.createElement("span");
4426
4448
  h.className = "xp-amount", h.textContent = `${t.xpAmount}`, c.appendChild(h), l.appendChild(c);
4427
- const f = ee(!1);
4449
+ const f = te(!1);
4428
4450
  return e.appendChild(r), e.appendChild(l), e.appendChild(f), e;
4429
4451
  }
4430
- const lo = (t = !1) => {
4452
+ const fo = (t = !1) => {
4431
4453
  const e = document.createElement("div"), r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4432
4454
  switch (r.setAttribute("width", "34"), r.setAttribute("height", "34"), r.setAttribute("viewBox", "0 0 30 30"), r.style.width = "100%", r.style.height = "100%", t) {
4433
4455
  case !0:
@@ -4441,7 +4463,7 @@ const lo = (t = !1) => {
4441
4463
  `;
4442
4464
  }
4443
4465
  return e.appendChild(r), e;
4444
- }, ho = (t) => {
4466
+ }, uo = (t) => {
4445
4467
  const e = document.createElementNS(
4446
4468
  "http://www.w3.org/2000/svg",
4447
4469
  "svg"
@@ -4477,7 +4499,7 @@ const lo = (t = !1) => {
4477
4499
  }
4478
4500
  return e;
4479
4501
  };
4480
- function fo(t) {
4502
+ function po(t) {
4481
4503
  if (t.getElementById("cartridge-toast-marketplace-styles"))
4482
4504
  return;
4483
4505
  const e = t.createElement("style");
@@ -4561,7 +4583,7 @@ function fo(t) {
4561
4583
  }
4562
4584
  `, t.head.appendChild(e);
4563
4585
  }
4564
- function uo(t) {
4586
+ function go(t) {
4565
4587
  const e = document.createElement("div");
4566
4588
  e.className = "cartridge-toast marketplace";
4567
4589
  const r = document.createElement("div");
@@ -4569,22 +4591,25 @@ function uo(t) {
4569
4591
  const n = document.createElement("div");
4570
4592
  n.className = "image-container";
4571
4593
  const o = document.createElement("img");
4572
- o.className = "image", o.src = dt(t.itemImage), o.alt = t.itemName, n.appendChild(o);
4594
+ o.className = "image", o.src = ht(t.itemImages[0]), o.alt = t.itemNames[0], n.appendChild(o);
4573
4595
  const s = document.createElement("div");
4574
4596
  s.className = "content";
4575
4597
  const a = {
4576
4598
  purchased: "Purchased!",
4577
- sold: "Sold!"
4599
+ sold: "Sold!",
4600
+ sent: "Sent!",
4601
+ listed: "Listed!",
4602
+ unlisted: "Unlisted!"
4578
4603
  }, i = document.createElement("p");
4579
4604
  i.className = "title", i.textContent = a[t.action];
4580
4605
  const l = document.createElement("p");
4581
- l.className = "item-name", l.textContent = t.itemName, s.appendChild(i), s.appendChild(l), r.appendChild(n), r.appendChild(s);
4606
+ l.className = "item-name", l.textContent = t.itemNames[0], s.appendChild(i), s.appendChild(l), r.appendChild(n), r.appendChild(s);
4582
4607
  const c = document.createElement("div");
4583
4608
  c.className = "close-button-container";
4584
- const d = ee(!1);
4609
+ const d = te(!1);
4585
4610
  return c.appendChild(d), e.appendChild(r), e.appendChild(c), e;
4586
4611
  }
4587
- function po(t) {
4612
+ function mo(t) {
4588
4613
  if (t.getElementById("cartridge-toast-quest-styles"))
4589
4614
  return;
4590
4615
  const e = t.createElement("style");
@@ -4687,14 +4712,14 @@ function po(t) {
4687
4712
  }
4688
4713
  `, t.head.appendChild(e);
4689
4714
  }
4690
- function go(t) {
4715
+ function wo(t) {
4691
4716
  const e = document.createElement("div");
4692
4717
  e.className = "cartridge-toast quest";
4693
4718
  const r = document.createElement("div");
4694
4719
  r.className = "image-content-container";
4695
4720
  const n = document.createElement("div");
4696
4721
  n.className = "image-container";
4697
- const o = mo();
4722
+ const o = yo();
4698
4723
  o.className = "image", n.appendChild(o);
4699
4724
  const s = document.createElement("div");
4700
4725
  s.className = "content";
@@ -4702,13 +4727,13 @@ function go(t) {
4702
4727
  a.className = "title", a.textContent = t.title;
4703
4728
  const i = document.createElement("p");
4704
4729
  i.className = "subtitle", i.textContent = t.subtitle || "Earned!", s.appendChild(a), s.appendChild(i), r.appendChild(n), r.appendChild(s);
4705
- const l = ee(!1);
4730
+ const l = te(!1);
4706
4731
  return e.appendChild(r), e.appendChild(l), e;
4707
4732
  }
4708
- const mo = () => {
4733
+ const yo = () => {
4709
4734
  const t = document.createElement("div"), e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4710
4735
  return e.setAttribute("width", "34"), e.setAttribute("height", "34"), e.setAttribute("viewBox", "0 0 30 30"), e.style.width = "100%", e.style.height = "100%", e.innerHTML = '<path d="M3 6.5V8C3 8.55312 3.44687 9 4 9H4.5H6V6.5C6 5.67188 5.32812 5 4.5 5C3.67188 5 3 5.67188 3 6.5ZM6.5 5C6.8125 5.41875 7 5.9375 7 6.5V16C7 17.1031 7.89687 18 9 18C10.1031 18 11 17.1031 11 16V15.8344C11 14.8219 11.8219 14 12.8344 14H18V8C18 6.34375 16.6562 5 15 5H6.5ZM17.5 19C19.4344 19 21 17.4344 21 15.5C21 15.225 20.775 15 20.5 15H12.8344C12.375 15 12 15.3719 12 15.8344V16C12 17.6562 10.6562 19 9 19H14.5H17.5Z" fill="white"/>', t.appendChild(e), t;
4711
- }, wo = (t) => {
4736
+ }, bo = (t) => {
4712
4737
  const e = t.borderRadius ?? 8, r = !isFinite(t.duration) || t.duration <= 0, n = document.createElement("div");
4713
4738
  n.className = "cartridge-toast-progress-bar", n.style.position = "absolute", n.style.bottom = "0", n.style.left = "0", n.style.right = "0", n.style.height = "4px", n.style.overflow = "hidden", n.style.borderBottomLeftRadius = `${e}px`, n.style.borderBottomRightRadius = `${e}px`, n.style.backgroundColor = "rgba(255, 255, 255, 0.2)";
4714
4739
  const o = document.createElement("div");
@@ -4720,55 +4745,55 @@ const mo = () => {
4720
4745
  t.onComplete?.();
4721
4746
  }, t.duration)), n.appendChild(o), n;
4722
4747
  };
4723
- function at(t, e, r, n) {
4724
- const o = wo({
4748
+ function it(t, e, r, n) {
4749
+ const o = bo({
4725
4750
  duration: e,
4726
4751
  onComplete: r,
4727
4752
  borderRadius: n
4728
4753
  });
4729
4754
  t.appendChild(o);
4730
4755
  }
4731
- function yo(t) {
4756
+ function Co(t) {
4732
4757
  switch (t.variant) {
4733
4758
  case "error":
4734
- return ro(t);
4735
- case "transaction":
4736
4759
  return oo(t);
4737
- case "network-switch":
4760
+ case "transaction":
4738
4761
  return ao(t);
4739
- case "achievement":
4762
+ case "network-switch":
4740
4763
  return co(t);
4764
+ case "achievement":
4765
+ return ho(t);
4741
4766
  case "quest":
4742
- return go(t);
4767
+ return wo(t);
4743
4768
  case "marketplace":
4744
- return uo(t);
4769
+ return go(t);
4745
4770
  }
4746
4771
  }
4747
- function bo(t, e) {
4772
+ function xo(t, e) {
4748
4773
  switch (e) {
4749
4774
  case "error":
4750
- to(t);
4775
+ no(t);
4751
4776
  break;
4752
4777
  case "transaction":
4753
- no(t);
4778
+ so(t);
4754
4779
  break;
4755
4780
  case "network-switch":
4756
- so(t);
4781
+ io(t);
4757
4782
  break;
4758
4783
  case "achievement":
4759
- io(t);
4784
+ lo(t);
4760
4785
  break;
4761
4786
  case "quest":
4762
- po(t);
4787
+ mo(t);
4763
4788
  break;
4764
4789
  case "marketplace":
4765
- fo(t);
4790
+ po(t);
4766
4791
  break;
4767
4792
  }
4768
4793
  }
4769
- function Se(t, e) {
4770
- Jn(t), bo(t, e.variant);
4771
- const r = e.position || Zn, n = Gn(t, r), o = yo(e), s = () => Xn(o);
4794
+ function $e(t, e) {
4795
+ to(t), xo(t, e.variant);
4796
+ const r = e.position || Gn, n = Jn(t, r), o = Co(e), s = () => eo(o);
4772
4797
  n.appendChild(o), e.onClick && (o.style.cursor = "pointer", o.addEventListener("click", (d) => {
4773
4798
  !d.target.closest("#close-button") && e.onClick && e.onClick();
4774
4799
  }));
@@ -4777,37 +4802,37 @@ function Se(t, e) {
4777
4802
  d.stopPropagation(), s();
4778
4803
  });
4779
4804
  let i = null;
4780
- const l = e.duration ?? qn, c = !isFinite(l) || l <= 0;
4805
+ const l = e.duration ?? Kn, c = !isFinite(l) || l <= 0;
4781
4806
  if (e.variant !== "network-switch") {
4782
4807
  const d = e.variant === "error" || e.variant === "transaction" ? 8 : 4;
4783
- c ? at(o, 1 / 0, () => {
4784
- }, d) : at(o, l, s, d);
4808
+ c ? it(o, 1 / 0, () => {
4809
+ }, d) : it(o, l, s, d);
4785
4810
  } else c || (i = setTimeout(s, l));
4786
4811
  return () => {
4787
4812
  i && clearTimeout(i), s();
4788
4813
  };
4789
4814
  }
4790
- let it = !1;
4791
- function Dt() {
4792
- it || typeof window > "u" || De() || (window.addEventListener("message", (t) => {
4793
- if (t.data?.type === Ot && t.data?.options) {
4815
+ let ct = !1;
4816
+ function Ft() {
4817
+ ct || typeof window > "u" || Fe() || (window.addEventListener("message", (t) => {
4818
+ if (t.data?.type === Dt && t.data?.options) {
4794
4819
  const e = document;
4795
- e && Se(e, t.data.options);
4820
+ e && $e(e, t.data.options);
4796
4821
  }
4797
- }), it = !0);
4822
+ }), ct = !0);
4798
4823
  }
4799
- function Co(t) {
4824
+ function vo(t) {
4800
4825
  if (typeof window > "u" || typeof document > "u")
4801
4826
  return console.warn("Toast can only be used in a browser environment"), () => {
4802
4827
  };
4803
- if (Dt(), De()) {
4804
- const e = Kn();
4828
+ if (Ft(), Fe()) {
4829
+ const e = Xn();
4805
4830
  if (e)
4806
- return Se(e, t);
4831
+ return $e(e, t);
4807
4832
  try {
4808
4833
  window.parent && window.parent.postMessage(
4809
4834
  {
4810
- type: Ot,
4835
+ type: Dt,
4811
4836
  options: t
4812
4837
  },
4813
4838
  "*"
@@ -4819,14 +4844,14 @@ function Co(t) {
4819
4844
  return () => {
4820
4845
  };
4821
4846
  } else
4822
- return Se(document, t);
4847
+ return $e(document, t);
4823
4848
  }
4824
- typeof window < "u" && Dt();
4825
- const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4849
+ typeof window < "u" && Ft();
4850
+ const ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4826
4851
  __proto__: null,
4827
- toast: Co
4852
+ toast: vo
4828
4853
  }, Symbol.toStringTag, { value: "Module" }));
4829
- var vo = [
4854
+ var Eo = [
4830
4855
  {
4831
4856
  name: "Wrapped BTC",
4832
4857
  symbol: "WBTC",
@@ -5408,28 +5433,28 @@ var vo = [
5408
5433
  total_supply: null,
5409
5434
  logo_url: " https://imagedelivery.net/0xPAQaDtnQhBs8IzYRIlNg/f96b51e2-e978-42e2-c67a-e84159015000/logo"
5410
5435
  }
5411
- ], Ft = {
5436
+ ], Qt = {
5412
5437
  theme: {
5413
5438
  name: "Cartridge",
5414
5439
  icon: "icon.svg"
5415
5440
  }
5416
- }, le = "https://static.cartridge.gg/presets";
5417
- async function Fe() {
5441
+ }, de = "https://static.cartridge.gg/presets";
5442
+ async function Qe() {
5418
5443
  try {
5419
- const t = await fetch(`${le}/index.json`);
5444
+ const t = await fetch(`${de}/index.json`);
5420
5445
  if (!t.ok)
5421
5446
  throw new Error(`Failed to load configs index: ${t.statusText}`);
5422
5447
  return await t.json();
5423
5448
  } catch (t) {
5424
- return console.error("Error loading configs index:", t), { configs: [], baseUrl: le };
5449
+ return console.error("Error loading configs index:", t), { configs: [], baseUrl: de };
5425
5450
  }
5426
5451
  }
5427
- async function So() {
5428
- return (await Fe()).configs;
5452
+ async function Lo() {
5453
+ return (await Qe()).configs;
5429
5454
  }
5430
- async function $o(t) {
5455
+ async function No(t) {
5431
5456
  try {
5432
- const n = `${(await Fe()).baseUrl || le}/${t}`, o = await fetch(`${n}/config.json`);
5457
+ const n = `${(await Qe()).baseUrl || de}/${t}`, o = await fetch(`${n}/config.json`);
5433
5458
  if (!o.ok)
5434
5459
  throw new Error(
5435
5460
  `Failed to load config ${t}: ${o.statusText}`
@@ -5459,8 +5484,8 @@ async function $o(t) {
5459
5484
  return console.error(`Error loading config ${t}:`, e), null;
5460
5485
  }
5461
5486
  }
5462
- async function Lo() {
5463
- const t = await Fe(), e = t.configs, r = t.baseUrl || le, n = {};
5487
+ async function Po() {
5488
+ const t = await Qe(), e = t.configs, r = t.baseUrl || de, n = {};
5464
5489
  return await Promise.all(
5465
5490
  e.map(async (o) => {
5466
5491
  try {
@@ -5475,45 +5500,45 @@ async function Lo() {
5475
5500
  })
5476
5501
  ), n;
5477
5502
  }
5478
- Ft.theme.icon = "https://static.cartridge.gg/presets/cartridge/icon.svg";
5479
- var No = vo, Bo = Ft.theme;
5503
+ Qt.theme.icon = "https://static.cartridge.gg/presets/cartridge/icon.svg";
5504
+ var Bo = Eo, To = Qt.theme;
5480
5505
  export {
5481
- Ro as ALL_AUTH_OPTIONS,
5482
- Uo as AUTH_EXTERNAL_WALLETS,
5483
- Jr as ArgentWallet,
5484
- nn as BaseWallet,
5485
- jn as BraavosWallet,
5486
- Mo as EMBEDDED_WALLETS,
5487
- zo as EXTERNAL_WALLETS,
5488
- Oo as EXTRA_EXTERNAL_WALLETS,
5489
- de as EthereumWalletBase,
5490
- Do as FeeSource,
5491
- Fo as IMPLEMENTED_AUTH_OPTIONS,
5492
- on as MetaMaskWallet,
5506
+ Mo as ALL_AUTH_OPTIONS,
5507
+ zo as AUTH_EXTERNAL_WALLETS,
5508
+ en as ArgentWallet,
5509
+ on as BaseWallet,
5510
+ Yn as BraavosWallet,
5511
+ Oo as EMBEDDED_WALLETS,
5512
+ Do as EXTERNAL_WALLETS,
5513
+ Fo as EXTRA_EXTERNAL_WALLETS,
5514
+ he as EthereumWalletBase,
5515
+ Qo as FeeSource,
5516
+ Ho as IMPLEMENTED_AUTH_OPTIONS,
5517
+ sn as MetaMaskWallet,
5493
5518
  A as NotReadyToConnect,
5494
- Qn as PhantomEVMWallet,
5495
- Fn as PhantomWallet,
5496
- Hn as RabbyWallet,
5497
- T as ResponseCodes,
5519
+ Hn as PhantomEVMWallet,
5520
+ Qn as PhantomWallet,
5521
+ jn as RabbyWallet,
5522
+ R as ResponseCodes,
5498
5523
  Wn as WalletBridge,
5499
5524
  ge as chainIdToPlatform,
5500
- _o as default,
5501
- Bo as defaultTheme,
5502
- No as erc20Metadata,
5503
- So as getAvailableConfigs,
5504
- Fe as getConfigsIndex,
5505
- Qo as humanizeString,
5506
- jt as isMobile,
5507
- Lo as loadAllConfigs,
5508
- $o as loadConfig,
5509
- Io as lookupAddresses,
5510
- Ao as lookupUsernames,
5511
- Ho as normalizeCalls,
5512
- Yt as parseChainId,
5513
- dt as sanitizeImageSrc,
5514
- Ht as toArray,
5515
- jo as toSessionPolicies,
5516
- Wo as toWasmPolicies,
5517
- Co as toast
5525
+ Io as default,
5526
+ To as defaultTheme,
5527
+ Bo as erc20Metadata,
5528
+ Lo as getAvailableConfigs,
5529
+ Qe as getConfigsIndex,
5530
+ jo as humanizeString,
5531
+ Yt as isMobile,
5532
+ Po as loadAllConfigs,
5533
+ No as loadConfig,
5534
+ $o as lookupAddresses,
5535
+ So as lookupUsernames,
5536
+ Yo as normalizeCalls,
5537
+ Vt as parseChainId,
5538
+ ht as sanitizeImageSrc,
5539
+ jt as toArray,
5540
+ Wo as toSessionPolicies,
5541
+ Vo as toWasmPolicies,
5542
+ vo as toast
5518
5543
  };
5519
5544
  //# sourceMappingURL=index.js.map