@seams/wallet 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/LICENSE.md +201 -0
  2. package/THIRD_PARTY_NOTICES.md +15095 -0
  3. package/dist/.build-inputs.sha256 +1 -1
  4. package/dist/esm/SeamsWeb/signingSurface/BrowserSigningSurface.js +7 -14
  5. package/dist/esm/core/signingEngine/session/identity/exactWalletSessionReader.js +2 -27
  6. package/dist/esm/react/SeamsWeb/signingSurface/BrowserSigningSurface.js +7 -14
  7. package/dist/esm/react/core/signingEngine/session/identity/exactWalletSessionReader.js +2 -27
  8. package/dist/esm/sdk/export-private-key-viewer.js +1420 -1425
  9. package/dist/esm/sdk/halo-border.js +1424 -1429
  10. package/dist/esm/sdk/{host-BqwEYhX0.js → host-DNmO0eve.js} +2 -2
  11. package/dist/esm/sdk/passkey-halo-loading.js +1426 -1431
  12. package/dist/{public/sdk/registrationPreparationPreload-u3ruCmpF.js → esm/sdk/registrationPreparationPreload-CwUkRwVz.js} +1 -1
  13. package/dist/esm/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
  14. package/dist/{public/sdk/runtime-auth-Da9yQyaD.js → esm/sdk/runtime-auth-dpoaCtkK.js} +2 -2
  15. package/dist/esm/sdk/{runtime-device-link-DNlzlwrr.js → runtime-device-link-C75epnbj.js} +1 -1
  16. package/dist/{public/sdk/runtime-ecdsa-tempo-B7dBVcCI.js → esm/sdk/runtime-ecdsa-tempo-CV-E-iZG.js} +1 -1
  17. package/dist/{public/sdk/runtime-email-otp-CckVQZJC.js → esm/sdk/runtime-email-otp-V0mdMD_t.js} +1 -1
  18. package/dist/{public/sdk/runtime-export-WAiBwZL_.js → esm/sdk/runtime-export-C4HO5ysH.js} +1 -1
  19. package/dist/esm/sdk/{runtime-near-DBJ4KfFv.js → runtime-near-DlviFQWy.js} +1 -1
  20. package/dist/{public/sdk/runtime-preferences-DmH7eMHH.js → esm/sdk/runtime-preferences-DyJidFuf.js} +1 -1
  21. package/dist/esm/sdk/{runtime-recovery-kPgl9nTT.js → runtime-recovery-CHDE5gl0.js} +1 -1
  22. package/dist/esm/sdk/{runtimeContext-BorCgXo5.js → runtimeContext-D_TkUM6Z.js} +6 -38
  23. package/dist/esm/sdk/{runtimeLoader-BKQjNgXO.js → runtimeLoader-DxiLgXPm.js} +9 -9
  24. package/dist/esm/sdk/tx-confirm-ui.js +1400 -1407
  25. package/dist/esm/sdk/w3a-tx-confirmer.js +1442 -1447
  26. package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
  27. package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
  28. package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
  29. package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
  30. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker.js +4 -4
  31. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
  32. package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client_bg.wasm +0 -0
  33. package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client_bg.wasm +0 -0
  34. package/dist/public/headers.manifest.json +1 -1
  35. package/dist/public/sdk/export-private-key-viewer.js +1420 -1425
  36. package/dist/public/sdk/halo-border.js +1424 -1429
  37. package/dist/public/sdk/{host-BqwEYhX0.js → host-DNmO0eve.js} +2 -2
  38. package/dist/public/sdk/passkey-halo-loading.js +1426 -1431
  39. package/dist/{esm/sdk/registrationPreparationPreload-u3ruCmpF.js → public/sdk/registrationPreparationPreload-CwUkRwVz.js} +1 -1
  40. package/dist/public/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
  41. package/dist/{esm/sdk/runtime-auth-Da9yQyaD.js → public/sdk/runtime-auth-dpoaCtkK.js} +2 -2
  42. package/dist/public/sdk/{runtime-device-link-DNlzlwrr.js → runtime-device-link-C75epnbj.js} +1 -1
  43. package/dist/{esm/sdk/runtime-ecdsa-tempo-B7dBVcCI.js → public/sdk/runtime-ecdsa-tempo-CV-E-iZG.js} +1 -1
  44. package/dist/{esm/sdk/runtime-email-otp-CckVQZJC.js → public/sdk/runtime-email-otp-V0mdMD_t.js} +1 -1
  45. package/dist/{esm/sdk/runtime-export-WAiBwZL_.js → public/sdk/runtime-export-C4HO5ysH.js} +1 -1
  46. package/dist/public/sdk/{runtime-near-DBJ4KfFv.js → runtime-near-DlviFQWy.js} +1 -1
  47. package/dist/{esm/sdk/runtime-preferences-DmH7eMHH.js → public/sdk/runtime-preferences-DyJidFuf.js} +1 -1
  48. package/dist/public/sdk/{runtime-recovery-kPgl9nTT.js → runtime-recovery-CHDE5gl0.js} +1 -1
  49. package/dist/public/sdk/{runtimeContext-BorCgXo5.js → runtimeContext-D_TkUM6Z.js} +6 -38
  50. package/dist/public/sdk/{runtimeLoader-BKQjNgXO.js → runtimeLoader-DxiLgXPm.js} +9 -9
  51. package/dist/public/sdk/tx-confirm-ui.js +1400 -1407
  52. package/dist/public/sdk/w3a-tx-confirmer.js +1442 -1447
  53. package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
  54. package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
  55. package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
  56. package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
  57. package/dist/public/sdk/workers/device-linking-key.worker.js +133 -140
  58. package/dist/public/sdk/workers/ecdsa-derivation-client.worker.js +94 -188
  59. package/dist/public/sdk/workers/ecdsa-online-client.worker.js +6 -7
  60. package/dist/public/sdk/workers/ecdsa-presign-client.worker.js +6 -7
  61. package/dist/public/sdk/workers/email-otp.worker.js +39 -52
  62. package/dist/public/sdk/workers/email_otp_runtime_bg.wasm +0 -0
  63. package/dist/public/sdk/workers/evm-crypto.worker.js +3 -3
  64. package/dist/public/sdk/workers/evm_crypto.wasm +0 -0
  65. package/dist/public/sdk/workers/evm_crypto_bg.wasm +0 -0
  66. package/dist/public/sdk/workers/near-signer.worker.js +9 -9
  67. package/dist/public/sdk/workers/near_signer.wasm +0 -0
  68. package/dist/public/sdk/workers/passkey-confirm.worker.js +4 -4
  69. package/dist/public/sdk/workers/passkey-mpc-export.worker.js +9 -19
  70. package/dist/public/sdk/workers/router_ab_ecdsa_client_bg.wasm +0 -0
  71. package/dist/public/sdk/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
  72. package/dist/public/sdk/workers/shamir3pass.worker.js +3 -3
  73. package/dist/public/sdk/workers/shamir3pass_runtime_bg.wasm +0 -0
  74. package/dist/public/sdk/workers/tempo-signer.worker.js +3 -3
  75. package/dist/public/sdk/workers/tempo_signer.wasm +0 -0
  76. package/dist/public/sdk/workers/tempo_signer_bg.wasm +0 -0
  77. package/dist/public/sdk/workers/wallet-custody-ceremony.worker.js +55 -1244
  78. package/dist/public/sdk/workers/wallet_custody_ceremony_bg.wasm +0 -0
  79. package/dist/public/sdk/workers/wasm_signer_worker_bg.wasm +0 -0
  80. package/dist/public/wallet-assets.manifest.json +32 -32
  81. package/dist/types/wallet/src/SeamsWeb/signingSurface/BrowserSigningSurface.d.ts +4 -4
  82. package/dist/types/wallet/src/core/signingEngine/session/identity/exactWalletSessionReader.d.ts +1 -9
  83. package/dist/workers/device-linking-key.worker.js +133 -140
  84. package/dist/workers/ecdsa-derivation-client.worker.js +94 -188
  85. package/dist/workers/ecdsa-online-client.worker.js +6 -7
  86. package/dist/workers/ecdsa-presign-client.worker.js +6 -7
  87. package/dist/workers/email-otp.worker.js +39 -52
  88. package/dist/workers/email_otp_runtime_bg.wasm +0 -0
  89. package/dist/workers/evm-crypto.worker.js +3 -3
  90. package/dist/workers/evm_crypto.wasm +0 -0
  91. package/dist/workers/evm_crypto_bg.wasm +0 -0
  92. package/dist/workers/near-signer.worker.js +9 -9
  93. package/dist/workers/near_signer.wasm +0 -0
  94. package/dist/workers/passkey-confirm.worker.js +4 -4
  95. package/dist/workers/passkey-mpc-export.worker.js +9 -19
  96. package/dist/workers/router_ab_ecdsa_client_bg.wasm +0 -0
  97. package/dist/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
  98. package/dist/workers/shamir3pass.worker.js +3 -3
  99. package/dist/workers/shamir3pass_runtime_bg.wasm +0 -0
  100. package/dist/workers/tempo-signer.worker.js +3 -3
  101. package/dist/workers/tempo_signer.wasm +0 -0
  102. package/dist/workers/tempo_signer_bg.wasm +0 -0
  103. package/dist/workers/wallet-custody-ceremony.worker.js +55 -1244
  104. package/dist/workers/wallet_custody_ceremony_bg.wasm +0 -0
  105. package/dist/workers/wasm_signer_worker_bg.wasm +0 -0
  106. package/package.json +6 -3
  107. package/LICENSE +0 -21
@@ -1,42 +1,56 @@
1
1
  var __defProp = Object.defineProperty;
2
+ var __returnValue = (v) => v;
3
+ function __exportSetter(name, newValue) {
4
+ this[name] = __returnValue.bind(null, newValue);
5
+ }
2
6
  var __export = (target, all) => {
3
7
  for (var name in all)
4
8
  __defProp(target, name, {
5
9
  get: all[name],
6
10
  enumerable: true,
7
11
  configurable: true,
8
- set: (newValue) => all[name] = () => newValue
12
+ set: __exportSetter.bind(all, name)
9
13
  });
10
14
  };
11
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
15
+ var __esm = (fn, res, err) => () => {
16
+ if (fn)
17
+ try {
18
+ res = fn(fn = 0);
19
+ } catch (e) {
20
+ err = [e];
21
+ }
22
+ if (err)
23
+ throw err[0];
24
+ return res;
25
+ };
12
26
 
13
27
  // ../../node_modules/@lit/reactive-element/css-tag.js
14
28
  class n {
15
- constructor(t2, e2, o2) {
16
- if (this._$cssResult$ = true, o2 !== s)
29
+ constructor(t, e, o) {
30
+ if (this._$cssResult$ = true, o !== s)
17
31
  throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
18
- this.cssText = t2, this.t = e2;
32
+ this.cssText = t, this.t = e;
19
33
  }
20
34
  get styleSheet() {
21
- let t2 = this.o;
22
- const s2 = this.t;
23
- if (e && t2 === undefined) {
24
- const e2 = s2 !== undefined && s2.length === 1;
25
- e2 && (t2 = o.get(s2)), t2 === undefined && ((this.o = t2 = new CSSStyleSheet).replaceSync(this.cssText), e2 && o.set(s2, t2));
35
+ let t = this.o;
36
+ const s = this.t;
37
+ if (e && t === undefined) {
38
+ const e = s !== undefined && s.length === 1;
39
+ e && (t = o.get(s)), t === undefined && ((this.o = t = new CSSStyleSheet).replaceSync(this.cssText), e && o.set(s, t));
26
40
  }
27
- return t2;
41
+ return t;
28
42
  }
29
43
  toString() {
30
44
  return this.cssText;
31
45
  }
32
46
  }
33
- var t, e, s, o, r = (t2) => new n(typeof t2 == "string" ? t2 : t2 + "", undefined, s), S = (s2, o2) => {
47
+ var t, e, s, o, r = (t) => new n(typeof t == "string" ? t : t + "", undefined, s), S = (s, o) => {
34
48
  if (e)
35
- s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet);
49
+ s.adoptedStyleSheets = o.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
36
50
  else
37
- for (const e2 of o2) {
38
- const o3 = document.createElement("style"), n2 = t.litNonce;
39
- n2 !== undefined && o3.setAttribute("nonce", n2), o3.textContent = e2.cssText, s2.appendChild(o3);
51
+ for (const e of o) {
52
+ const o = document.createElement("style"), n = t.litNonce;
53
+ n !== undefined && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
40
54
  }
41
55
  }, c;
42
56
  var init_css_tag = __esm(() => {
@@ -44,16 +58,16 @@ var init_css_tag = __esm(() => {
44
58
  e = t.ShadowRoot && (t.ShadyCSS === undefined || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
45
59
  s = Symbol();
46
60
  o = new WeakMap;
47
- c = e ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => {
48
- let e2 = "";
49
- for (const s2 of t3.cssRules)
50
- e2 += s2.cssText;
51
- return r(e2);
52
- })(t2) : t2;
61
+ c = e ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((t) => {
62
+ let e = "";
63
+ for (const s of t.cssRules)
64
+ e += s.cssText;
65
+ return r(e);
66
+ })(t) : t;
53
67
  });
54
68
 
55
69
  // ../../node_modules/@lit/reactive-element/reactive-element.js
56
- var i2, e2, h, r2, o2, n2, a, c2, l, p, d = (t2, s2) => t2, u, f = (t2, s2) => !i2(t2, s2), b, y;
70
+ var i2, e2, h, r2, o2, n2, a, c2, l, p, d = (t, s) => t, u, f = (t, s) => !i2(t, s), b, y;
57
71
  var init_reactive_element = __esm(() => {
58
72
  init_css_tag();
59
73
  init_css_tag();
@@ -62,175 +76,175 @@ var init_reactive_element = __esm(() => {
62
76
  c2 = a.trustedTypes;
63
77
  l = c2 ? c2.emptyScript : "";
64
78
  p = a.reactiveElementPolyfillSupport;
65
- u = { toAttribute(t2, s2) {
66
- switch (s2) {
79
+ u = { toAttribute(t, s) {
80
+ switch (s) {
67
81
  case Boolean:
68
- t2 = t2 ? l : null;
82
+ t = t ? l : null;
69
83
  break;
70
84
  case Object:
71
85
  case Array:
72
- t2 = t2 == null ? t2 : JSON.stringify(t2);
86
+ t = t == null ? t : JSON.stringify(t);
73
87
  }
74
- return t2;
75
- }, fromAttribute(t2, s2) {
76
- let i3 = t2;
77
- switch (s2) {
88
+ return t;
89
+ }, fromAttribute(t, s) {
90
+ let i = t;
91
+ switch (s) {
78
92
  case Boolean:
79
- i3 = t2 !== null;
93
+ i = t !== null;
80
94
  break;
81
95
  case Number:
82
- i3 = t2 === null ? null : Number(t2);
96
+ i = t === null ? null : Number(t);
83
97
  break;
84
98
  case Object:
85
99
  case Array:
86
100
  try {
87
- i3 = JSON.parse(t2);
88
- } catch (t3) {
89
- i3 = null;
101
+ i = JSON.parse(t);
102
+ } catch (t) {
103
+ i = null;
90
104
  }
91
105
  }
92
- return i3;
106
+ return i;
93
107
  } };
94
108
  b = { attribute: true, type: String, converter: u, reflect: false, useDefault: false, hasChanged: f };
95
109
  Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= new WeakMap;
96
110
  y = class y extends HTMLElement {
97
- static addInitializer(t2) {
98
- this._$Ei(), (this.l ??= []).push(t2);
111
+ static addInitializer(t) {
112
+ this._$Ei(), (this.l ??= []).push(t);
99
113
  }
100
114
  static get observedAttributes() {
101
115
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
102
116
  }
103
- static createProperty(t2, s2 = b) {
104
- if (s2.state && (s2.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t2) && ((s2 = Object.create(s2)).wrapped = true), this.elementProperties.set(t2, s2), !s2.noAccessor) {
105
- const i3 = Symbol(), h2 = this.getPropertyDescriptor(t2, i3, s2);
106
- h2 !== undefined && e2(this.prototype, t2, h2);
117
+ static createProperty(t, s = b) {
118
+ if (s.state && (s.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = true), this.elementProperties.set(t, s), !s.noAccessor) {
119
+ const i = Symbol(), h = this.getPropertyDescriptor(t, i, s);
120
+ h !== undefined && e2(this.prototype, t, h);
107
121
  }
108
122
  }
109
- static getPropertyDescriptor(t2, s2, i3) {
110
- const { get: e3, set: r3 } = h(this.prototype, t2) ?? { get() {
111
- return this[s2];
112
- }, set(t3) {
113
- this[s2] = t3;
123
+ static getPropertyDescriptor(t, s, i) {
124
+ const { get: e, set: r } = h(this.prototype, t) ?? { get() {
125
+ return this[s];
126
+ }, set(t) {
127
+ this[s] = t;
114
128
  } };
115
- return { get: e3, set(s3) {
116
- const h2 = e3?.call(this);
117
- r3?.call(this, s3), this.requestUpdate(t2, h2, i3);
129
+ return { get: e, set(s) {
130
+ const h = e?.call(this);
131
+ r?.call(this, s), this.requestUpdate(t, h, i);
118
132
  }, configurable: true, enumerable: true };
119
133
  }
120
- static getPropertyOptions(t2) {
121
- return this.elementProperties.get(t2) ?? b;
134
+ static getPropertyOptions(t) {
135
+ return this.elementProperties.get(t) ?? b;
122
136
  }
123
137
  static _$Ei() {
124
138
  if (this.hasOwnProperty(d("elementProperties")))
125
139
  return;
126
- const t2 = n2(this);
127
- t2.finalize(), t2.l !== undefined && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties);
140
+ const t = n2(this);
141
+ t.finalize(), t.l !== undefined && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
128
142
  }
129
143
  static finalize() {
130
144
  if (this.hasOwnProperty(d("finalized")))
131
145
  return;
132
146
  if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) {
133
- const t3 = this.properties, s2 = [...r2(t3), ...o2(t3)];
134
- for (const i3 of s2)
135
- this.createProperty(i3, t3[i3]);
147
+ const t = this.properties, s = [...r2(t), ...o2(t)];
148
+ for (const i of s)
149
+ this.createProperty(i, t[i]);
136
150
  }
137
- const t2 = this[Symbol.metadata];
138
- if (t2 !== null) {
139
- const s2 = litPropertyMetadata.get(t2);
140
- if (s2 !== undefined)
141
- for (const [t3, i3] of s2)
142
- this.elementProperties.set(t3, i3);
151
+ const t = this[Symbol.metadata];
152
+ if (t !== null) {
153
+ const s = litPropertyMetadata.get(t);
154
+ if (s !== undefined)
155
+ for (const [t, i] of s)
156
+ this.elementProperties.set(t, i);
143
157
  }
144
158
  this._$Eh = new Map;
145
- for (const [t3, s2] of this.elementProperties) {
146
- const i3 = this._$Eu(t3, s2);
147
- i3 !== undefined && this._$Eh.set(i3, t3);
159
+ for (const [t, s] of this.elementProperties) {
160
+ const i = this._$Eu(t, s);
161
+ i !== undefined && this._$Eh.set(i, t);
148
162
  }
149
163
  this.elementStyles = this.finalizeStyles(this.styles);
150
164
  }
151
- static finalizeStyles(s2) {
152
- const i3 = [];
153
- if (Array.isArray(s2)) {
154
- const e3 = new Set(s2.flat(1 / 0).reverse());
155
- for (const s3 of e3)
156
- i3.unshift(c(s3));
165
+ static finalizeStyles(s) {
166
+ const i = [];
167
+ if (Array.isArray(s)) {
168
+ const e = new Set(s.flat(1 / 0).reverse());
169
+ for (const s of e)
170
+ i.unshift(c(s));
157
171
  } else
158
- s2 !== undefined && i3.push(c(s2));
159
- return i3;
172
+ s !== undefined && i.push(c(s));
173
+ return i;
160
174
  }
161
- static _$Eu(t2, s2) {
162
- const i3 = s2.attribute;
163
- return i3 === false ? undefined : typeof i3 == "string" ? i3 : typeof t2 == "string" ? t2.toLowerCase() : undefined;
175
+ static _$Eu(t, s) {
176
+ const i = s.attribute;
177
+ return i === false ? undefined : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : undefined;
164
178
  }
165
179
  constructor() {
166
180
  super(), this._$Ep = undefined, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
167
181
  }
168
182
  _$Ev() {
169
- this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = new Map, this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this));
183
+ this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = new Map, this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t) => t(this));
170
184
  }
171
- addController(t2) {
172
- (this._$EO ??= new Set).add(t2), this.renderRoot !== undefined && this.isConnected && t2.hostConnected?.();
185
+ addController(t) {
186
+ (this._$EO ??= new Set).add(t), this.renderRoot !== undefined && this.isConnected && t.hostConnected?.();
173
187
  }
174
- removeController(t2) {
175
- this._$EO?.delete(t2);
188
+ removeController(t) {
189
+ this._$EO?.delete(t);
176
190
  }
177
191
  _$E_() {
178
- const t2 = new Map, s2 = this.constructor.elementProperties;
179
- for (const i3 of s2.keys())
180
- this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]);
181
- t2.size > 0 && (this._$Ep = t2);
192
+ const t = new Map, s = this.constructor.elementProperties;
193
+ for (const i of s.keys())
194
+ this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
195
+ t.size > 0 && (this._$Ep = t);
182
196
  }
183
197
  createRenderRoot() {
184
- const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
185
- return S(t2, this.constructor.elementStyles), t2;
198
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
199
+ return S(t, this.constructor.elementStyles), t;
186
200
  }
187
201
  connectedCallback() {
188
- this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.());
202
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t) => t.hostConnected?.());
189
203
  }
190
- enableUpdating(t2) {}
204
+ enableUpdating(t) {}
191
205
  disconnectedCallback() {
192
- this._$EO?.forEach((t2) => t2.hostDisconnected?.());
206
+ this._$EO?.forEach((t) => t.hostDisconnected?.());
193
207
  }
194
- attributeChangedCallback(t2, s2, i3) {
195
- this._$AK(t2, i3);
208
+ attributeChangedCallback(t, s, i) {
209
+ this._$AK(t, i);
196
210
  }
197
- _$ET(t2, s2) {
198
- const i3 = this.constructor.elementProperties.get(t2), e3 = this.constructor._$Eu(t2, i3);
199
- if (e3 !== undefined && i3.reflect === true) {
200
- const h2 = (i3.converter?.toAttribute !== undefined ? i3.converter : u).toAttribute(s2, i3.type);
201
- this._$Em = t2, h2 == null ? this.removeAttribute(e3) : this.setAttribute(e3, h2), this._$Em = null;
211
+ _$ET(t, s) {
212
+ const i = this.constructor.elementProperties.get(t), e = this.constructor._$Eu(t, i);
213
+ if (e !== undefined && i.reflect === true) {
214
+ const h = (i.converter?.toAttribute !== undefined ? i.converter : u).toAttribute(s, i.type);
215
+ this._$Em = t, h == null ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
202
216
  }
203
217
  }
204
- _$AK(t2, s2) {
205
- const i3 = this.constructor, e3 = i3._$Eh.get(t2);
206
- if (e3 !== undefined && this._$Em !== e3) {
207
- const t3 = i3.getPropertyOptions(e3), h2 = typeof t3.converter == "function" ? { fromAttribute: t3.converter } : t3.converter?.fromAttribute !== undefined ? t3.converter : u;
208
- this._$Em = e3;
209
- const r3 = h2.fromAttribute(s2, t3.type);
210
- this[e3] = r3 ?? this._$Ej?.get(e3) ?? r3, this._$Em = null;
218
+ _$AK(t, s) {
219
+ const i = this.constructor, e = i._$Eh.get(t);
220
+ if (e !== undefined && this._$Em !== e) {
221
+ const t = i.getPropertyOptions(e), h = typeof t.converter == "function" ? { fromAttribute: t.converter } : t.converter?.fromAttribute !== undefined ? t.converter : u;
222
+ this._$Em = e;
223
+ const r = h.fromAttribute(s, t.type);
224
+ this[e] = r ?? this._$Ej?.get(e) ?? r, this._$Em = null;
211
225
  }
212
226
  }
213
- requestUpdate(t2, s2, i3) {
214
- if (t2 !== undefined) {
215
- const e3 = this.constructor, h2 = this[t2];
216
- if (i3 ??= e3.getPropertyOptions(t2), !((i3.hasChanged ?? f)(h2, s2) || i3.useDefault && i3.reflect && h2 === this._$Ej?.get(t2) && !this.hasAttribute(e3._$Eu(t2, i3))))
227
+ requestUpdate(t, s, i) {
228
+ if (t !== undefined) {
229
+ const e = this.constructor, h = this[t];
230
+ if (i ??= e.getPropertyOptions(t), !((i.hasChanged ?? f)(h, s) || i.useDefault && i.reflect && h === this._$Ej?.get(t) && !this.hasAttribute(e._$Eu(t, i))))
217
231
  return;
218
- this.C(t2, s2, i3);
232
+ this.C(t, s, i);
219
233
  }
220
234
  this.isUpdatePending === false && (this._$ES = this._$EP());
221
235
  }
222
- C(t2, s2, { useDefault: i3, reflect: e3, wrapped: h2 }, r3) {
223
- i3 && !(this._$Ej ??= new Map).has(t2) && (this._$Ej.set(t2, r3 ?? s2 ?? this[t2]), h2 !== true || r3 !== undefined) || (this._$AL.has(t2) || (this.hasUpdated || i3 || (s2 = undefined), this._$AL.set(t2, s2)), e3 === true && this._$Em !== t2 && (this._$Eq ??= new Set).add(t2));
236
+ C(t, s, { useDefault: i, reflect: e, wrapped: h }, r) {
237
+ i && !(this._$Ej ??= new Map).has(t) && (this._$Ej.set(t, r ?? s ?? this[t]), h !== true || r !== undefined) || (this._$AL.has(t) || (this.hasUpdated || i || (s = undefined), this._$AL.set(t, s)), e === true && this._$Em !== t && (this._$Eq ??= new Set).add(t));
224
238
  }
225
239
  async _$EP() {
226
240
  this.isUpdatePending = true;
227
241
  try {
228
242
  await this._$ES;
229
- } catch (t3) {
230
- Promise.reject(t3);
243
+ } catch (t) {
244
+ Promise.reject(t);
231
245
  }
232
- const t2 = this.scheduleUpdate();
233
- return t2 != null && await t2, !this.isUpdatePending;
246
+ const t = this.scheduleUpdate();
247
+ return t != null && await t, !this.isUpdatePending;
234
248
  }
235
249
  scheduleUpdate() {
236
250
  return this.performUpdate();
@@ -240,29 +254,29 @@ var init_reactive_element = __esm(() => {
240
254
  return;
241
255
  if (!this.hasUpdated) {
242
256
  if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
243
- for (const [t4, s3] of this._$Ep)
244
- this[t4] = s3;
257
+ for (const [t, s] of this._$Ep)
258
+ this[t] = s;
245
259
  this._$Ep = undefined;
246
260
  }
247
- const t3 = this.constructor.elementProperties;
248
- if (t3.size > 0)
249
- for (const [s3, i3] of t3) {
250
- const { wrapped: t4 } = i3, e3 = this[s3];
251
- t4 !== true || this._$AL.has(s3) || e3 === undefined || this.C(s3, undefined, i3, e3);
261
+ const t = this.constructor.elementProperties;
262
+ if (t.size > 0)
263
+ for (const [s, i] of t) {
264
+ const { wrapped: t } = i, e = this[s];
265
+ t !== true || this._$AL.has(s) || e === undefined || this.C(s, undefined, i, e);
252
266
  }
253
267
  }
254
- let t2 = false;
255
- const s2 = this._$AL;
268
+ let t = false;
269
+ const s = this._$AL;
256
270
  try {
257
- t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EM();
258
- } catch (s3) {
259
- throw t2 = false, this._$EM(), s3;
271
+ t = this.shouldUpdate(s), t ? (this.willUpdate(s), this._$EO?.forEach((t) => t.hostUpdate?.()), this.update(s)) : this._$EM();
272
+ } catch (s) {
273
+ throw t = false, this._$EM(), s;
260
274
  }
261
- t2 && this._$AE(s2);
275
+ t && this._$AE(s);
262
276
  }
263
- willUpdate(t2) {}
264
- _$AE(t2) {
265
- this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2);
277
+ willUpdate(t) {}
278
+ _$AE(t) {
279
+ this._$EO?.forEach((t) => t.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t)), this.updated(t);
266
280
  }
267
281
  _$EM() {
268
282
  this._$AL = new Map, this.isUpdatePending = false;
@@ -273,80 +287,80 @@ var init_reactive_element = __esm(() => {
273
287
  getUpdateComplete() {
274
288
  return this._$ES;
275
289
  }
276
- shouldUpdate(t2) {
290
+ shouldUpdate(t) {
277
291
  return true;
278
292
  }
279
- update(t2) {
280
- this._$Eq &&= this._$Eq.forEach((t3) => this._$ET(t3, this[t3])), this._$EM();
293
+ update(t) {
294
+ this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM();
281
295
  }
282
- updated(t2) {}
283
- firstUpdated(t2) {}
296
+ updated(t) {}
297
+ firstUpdated(t) {}
284
298
  };
285
299
  y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[d("elementProperties")] = new Map, y[d("finalized")] = new Map, p?.({ ReactiveElement: y }), (a.reactiveElementVersions ??= []).push("2.1.1");
286
300
  });
287
301
 
288
302
  // ../../node_modules/lit-html/lit-html.js
289
- function P(t3, i4) {
290
- if (!a2(t3) || !t3.hasOwnProperty("raw"))
303
+ function P(t, i) {
304
+ if (!a2(t) || !t.hasOwnProperty("raw"))
291
305
  throw Error("invalid template strings array");
292
- return s2 !== undefined ? s2.createHTML(i4) : i4;
306
+ return s2 !== undefined ? s2.createHTML(i) : i;
293
307
  }
294
308
 
295
309
  class N {
296
- constructor({ strings: t3, _$litType$: s3 }, n4) {
297
- let r4;
310
+ constructor({ strings: t, _$litType$: s }, n) {
311
+ let r;
298
312
  this.parts = [];
299
- let c4 = 0, a3 = 0;
300
- const u3 = t3.length - 1, d3 = this.parts, [f3, v2] = V(t3, s3);
301
- if (this.el = N.createElement(f3, n4), C.currentNode = this.el.content, s3 === 2 || s3 === 3) {
302
- const t4 = this.el.content.firstChild;
303
- t4.replaceWith(...t4.childNodes);
304
- }
305
- for (;(r4 = C.nextNode()) !== null && d3.length < u3; ) {
306
- if (r4.nodeType === 1) {
307
- if (r4.hasAttributes())
308
- for (const t4 of r4.getAttributeNames())
309
- if (t4.endsWith(e3)) {
310
- const i4 = v2[a3++], s4 = r4.getAttribute(t4).split(h2), e4 = /([.?@])?(.*)/.exec(i4);
311
- d3.push({ type: 1, index: c4, name: e4[2], strings: s4, ctor: e4[1] === "." ? H : e4[1] === "?" ? I : e4[1] === "@" ? L : k }), r4.removeAttribute(t4);
313
+ let c = 0, a = 0;
314
+ const u = t.length - 1, d = this.parts, [f, v] = V(t, s);
315
+ if (this.el = N.createElement(f, n), C.currentNode = this.el.content, s === 2 || s === 3) {
316
+ const t = this.el.content.firstChild;
317
+ t.replaceWith(...t.childNodes);
318
+ }
319
+ for (;(r = C.nextNode()) !== null && d.length < u; ) {
320
+ if (r.nodeType === 1) {
321
+ if (r.hasAttributes())
322
+ for (const t of r.getAttributeNames())
323
+ if (t.endsWith(e3)) {
324
+ const i = v[a++], s = r.getAttribute(t).split(h2), e = /([.?@])?(.*)/.exec(i);
325
+ d.push({ type: 1, index: c, name: e[2], strings: s, ctor: e[1] === "." ? H : e[1] === "?" ? I : e[1] === "@" ? L : k }), r.removeAttribute(t);
312
326
  } else
313
- t4.startsWith(h2) && (d3.push({ type: 6, index: c4 }), r4.removeAttribute(t4));
314
- if ($.test(r4.tagName)) {
315
- const t4 = r4.textContent.split(h2), s4 = t4.length - 1;
316
- if (s4 > 0) {
317
- r4.textContent = i3 ? i3.emptyScript : "";
318
- for (let i4 = 0;i4 < s4; i4++)
319
- r4.append(t4[i4], l2()), C.nextNode(), d3.push({ type: 2, index: ++c4 });
320
- r4.append(t4[s4], l2());
327
+ t.startsWith(h2) && (d.push({ type: 6, index: c }), r.removeAttribute(t));
328
+ if ($.test(r.tagName)) {
329
+ const t = r.textContent.split(h2), s = t.length - 1;
330
+ if (s > 0) {
331
+ r.textContent = i3 ? i3.emptyScript : "";
332
+ for (let i = 0;i < s; i++)
333
+ r.append(t[i], l2()), C.nextNode(), d.push({ type: 2, index: ++c });
334
+ r.append(t[s], l2());
321
335
  }
322
336
  }
323
- } else if (r4.nodeType === 8)
324
- if (r4.data === o3)
325
- d3.push({ type: 2, index: c4 });
337
+ } else if (r.nodeType === 8)
338
+ if (r.data === o3)
339
+ d.push({ type: 2, index: c });
326
340
  else {
327
- let t4 = -1;
328
- for (;(t4 = r4.data.indexOf(h2, t4 + 1)) !== -1; )
329
- d3.push({ type: 7, index: c4 }), t4 += h2.length - 1;
341
+ let t = -1;
342
+ for (;(t = r.data.indexOf(h2, t + 1)) !== -1; )
343
+ d.push({ type: 7, index: c }), t += h2.length - 1;
330
344
  }
331
- c4++;
345
+ c++;
332
346
  }
333
347
  }
334
- static createElement(t3, i4) {
335
- const s3 = r3.createElement("template");
336
- return s3.innerHTML = t3, s3;
348
+ static createElement(t, i) {
349
+ const s = r3.createElement("template");
350
+ return s.innerHTML = t, s;
337
351
  }
338
352
  }
339
- function S2(t3, i4, s3 = t3, e4) {
340
- if (i4 === T)
341
- return i4;
342
- let h3 = e4 !== undefined ? s3._$Co?.[e4] : s3._$Cl;
343
- const o4 = c3(i4) ? undefined : i4._$litDirective$;
344
- return h3?.constructor !== o4 && (h3?._$AO?.(false), o4 === undefined ? h3 = undefined : (h3 = new o4(t3), h3._$AT(t3, s3, e4)), e4 !== undefined ? (s3._$Co ??= [])[e4] = h3 : s3._$Cl = h3), h3 !== undefined && (i4 = S2(t3, h3._$AS(t3, i4.values), h3, e4)), i4;
353
+ function S2(t, i, s = t, e) {
354
+ if (i === T)
355
+ return i;
356
+ let h = e !== undefined ? s._$Co?.[e] : s._$Cl;
357
+ const o = c3(i) ? undefined : i._$litDirective$;
358
+ return h?.constructor !== o && (h?._$AO?.(false), o === undefined ? h = undefined : (h = new o(t), h._$AT(t, s, e)), e !== undefined ? (s._$Co ??= [])[e] = h : s._$Cl = h), h !== undefined && (i = S2(t, h._$AS(t, i.values), h, e)), i;
345
359
  }
346
360
 
347
361
  class M {
348
- constructor(t3, i4) {
349
- this._$AV = [], this._$AN = undefined, this._$AD = t3, this._$AM = i4;
362
+ constructor(t, i) {
363
+ this._$AV = [], this._$AN = undefined, this._$AD = t, this._$AM = i;
350
364
  }
351
365
  get parentNode() {
352
366
  return this._$AM.parentNode;
@@ -354,23 +368,23 @@ class M {
354
368
  get _$AU() {
355
369
  return this._$AM._$AU;
356
370
  }
357
- u(t3) {
358
- const { el: { content: i4 }, parts: s3 } = this._$AD, e4 = (t3?.creationScope ?? r3).importNode(i4, true);
359
- C.currentNode = e4;
360
- let h3 = C.nextNode(), o4 = 0, n4 = 0, l3 = s3[0];
361
- for (;l3 !== undefined; ) {
362
- if (o4 === l3.index) {
363
- let i5;
364
- l3.type === 2 ? i5 = new R(h3, h3.nextSibling, this, t3) : l3.type === 1 ? i5 = new l3.ctor(h3, l3.name, l3.strings, this, t3) : l3.type === 6 && (i5 = new z(h3, this, t3)), this._$AV.push(i5), l3 = s3[++n4];
371
+ u(t) {
372
+ const { el: { content: i }, parts: s } = this._$AD, e = (t?.creationScope ?? r3).importNode(i, true);
373
+ C.currentNode = e;
374
+ let h = C.nextNode(), o = 0, n = 0, l = s[0];
375
+ for (;l !== undefined; ) {
376
+ if (o === l.index) {
377
+ let i;
378
+ l.type === 2 ? i = new R(h, h.nextSibling, this, t) : l.type === 1 ? i = new l.ctor(h, l.name, l.strings, this, t) : l.type === 6 && (i = new z(h, this, t)), this._$AV.push(i), l = s[++n];
365
379
  }
366
- o4 !== l3?.index && (h3 = C.nextNode(), o4++);
380
+ o !== l?.index && (h = C.nextNode(), o++);
367
381
  }
368
- return C.currentNode = r3, e4;
382
+ return C.currentNode = r3, e;
369
383
  }
370
- p(t3) {
371
- let i4 = 0;
372
- for (const s3 of this._$AV)
373
- s3 !== undefined && (s3.strings !== undefined ? (s3._$AI(t3, s3, i4), i4 += s3.strings.length - 2) : s3._$AI(t3[i4])), i4++;
384
+ p(t) {
385
+ let i = 0;
386
+ for (const s of this._$AV)
387
+ s !== undefined && (s.strings !== undefined ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
374
388
  }
375
389
  }
376
390
 
@@ -378,13 +392,13 @@ class R {
378
392
  get _$AU() {
379
393
  return this._$AM?._$AU ?? this._$Cv;
380
394
  }
381
- constructor(t3, i4, s3, e4) {
382
- this.type = 2, this._$AH = E, this._$AN = undefined, this._$AA = t3, this._$AB = i4, this._$AM = s3, this.options = e4, this._$Cv = e4?.isConnected ?? true;
395
+ constructor(t, i, s, e) {
396
+ this.type = 2, this._$AH = E, this._$AN = undefined, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = e?.isConnected ?? true;
383
397
  }
384
398
  get parentNode() {
385
- let t3 = this._$AA.parentNode;
386
- const i4 = this._$AM;
387
- return i4 !== undefined && t3?.nodeType === 11 && (t3 = i4.parentNode), t3;
399
+ let t = this._$AA.parentNode;
400
+ const i = this._$AM;
401
+ return i !== undefined && t?.nodeType === 11 && (t = i.parentNode), t;
388
402
  }
389
403
  get startNode() {
390
404
  return this._$AA;
@@ -392,47 +406,47 @@ class R {
392
406
  get endNode() {
393
407
  return this._$AB;
394
408
  }
395
- _$AI(t3, i4 = this) {
396
- t3 = S2(this, t3, i4), c3(t3) ? t3 === E || t3 == null || t3 === "" ? (this._$AH !== E && this._$AR(), this._$AH = E) : t3 !== this._$AH && t3 !== T && this._(t3) : t3._$litType$ !== undefined ? this.$(t3) : t3.nodeType !== undefined ? this.T(t3) : u2(t3) ? this.k(t3) : this._(t3);
409
+ _$AI(t, i = this) {
410
+ t = S2(this, t, i), c3(t) ? t === E || t == null || t === "" ? (this._$AH !== E && this._$AR(), this._$AH = E) : t !== this._$AH && t !== T && this._(t) : t._$litType$ !== undefined ? this.$(t) : t.nodeType !== undefined ? this.T(t) : u2(t) ? this.k(t) : this._(t);
397
411
  }
398
- O(t3) {
399
- return this._$AA.parentNode.insertBefore(t3, this._$AB);
412
+ O(t) {
413
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
400
414
  }
401
- T(t3) {
402
- this._$AH !== t3 && (this._$AR(), this._$AH = this.O(t3));
415
+ T(t) {
416
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
403
417
  }
404
- _(t3) {
405
- this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data = t3 : this.T(r3.createTextNode(t3)), this._$AH = t3;
418
+ _(t) {
419
+ this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data = t : this.T(r3.createTextNode(t)), this._$AH = t;
406
420
  }
407
- $(t3) {
408
- const { values: i4, _$litType$: s3 } = t3, e4 = typeof s3 == "number" ? this._$AC(t3) : (s3.el === undefined && (s3.el = N.createElement(P(s3.h, s3.h[0]), this.options)), s3);
409
- if (this._$AH?._$AD === e4)
410
- this._$AH.p(i4);
421
+ $(t) {
422
+ const { values: i, _$litType$: s } = t, e = typeof s == "number" ? this._$AC(t) : (s.el === undefined && (s.el = N.createElement(P(s.h, s.h[0]), this.options)), s);
423
+ if (this._$AH?._$AD === e)
424
+ this._$AH.p(i);
411
425
  else {
412
- const t4 = new M(e4, this), s4 = t4.u(this.options);
413
- t4.p(i4), this.T(s4), this._$AH = t4;
426
+ const t = new M(e, this), s = t.u(this.options);
427
+ t.p(i), this.T(s), this._$AH = t;
414
428
  }
415
429
  }
416
- _$AC(t3) {
417
- let i4 = A.get(t3.strings);
418
- return i4 === undefined && A.set(t3.strings, i4 = new N(t3)), i4;
430
+ _$AC(t) {
431
+ let i = A.get(t.strings);
432
+ return i === undefined && A.set(t.strings, i = new N(t)), i;
419
433
  }
420
- k(t3) {
434
+ k(t) {
421
435
  a2(this._$AH) || (this._$AH = [], this._$AR());
422
- const i4 = this._$AH;
423
- let s3, e4 = 0;
424
- for (const h3 of t3)
425
- e4 === i4.length ? i4.push(s3 = new R(this.O(l2()), this.O(l2()), this, this.options)) : s3 = i4[e4], s3._$AI(h3), e4++;
426
- e4 < i4.length && (this._$AR(s3 && s3._$AB.nextSibling, e4), i4.length = e4);
436
+ const i = this._$AH;
437
+ let s, e = 0;
438
+ for (const h of t)
439
+ e === i.length ? i.push(s = new R(this.O(l2()), this.O(l2()), this, this.options)) : s = i[e], s._$AI(h), e++;
440
+ e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
427
441
  }
428
- _$AR(t3 = this._$AA.nextSibling, i4) {
429
- for (this._$AP?.(false, true, i4);t3 !== this._$AB; ) {
430
- const i5 = t3.nextSibling;
431
- t3.remove(), t3 = i5;
442
+ _$AR(t = this._$AA.nextSibling, i) {
443
+ for (this._$AP?.(false, true, i);t !== this._$AB; ) {
444
+ const i = t.nextSibling;
445
+ t.remove(), t = i;
432
446
  }
433
447
  }
434
- setConnected(t3) {
435
- this._$AM === undefined && (this._$Cv = t3, this._$AP?.(t3));
448
+ setConnected(t) {
449
+ this._$AM === undefined && (this._$Cv = t, this._$AP?.(t));
436
450
  }
437
451
  }
438
452
 
@@ -443,64 +457,64 @@ class k {
443
457
  get _$AU() {
444
458
  return this._$AM._$AU;
445
459
  }
446
- constructor(t3, i4, s3, e4, h3) {
447
- this.type = 1, this._$AH = E, this._$AN = undefined, this.element = t3, this.name = i4, this._$AM = e4, this.options = h3, s3.length > 2 || s3[0] !== "" || s3[1] !== "" ? (this._$AH = Array(s3.length - 1).fill(new String), this.strings = s3) : this._$AH = E;
460
+ constructor(t, i, s, e, h) {
461
+ this.type = 1, this._$AH = E, this._$AN = undefined, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String), this.strings = s) : this._$AH = E;
448
462
  }
449
- _$AI(t3, i4 = this, s3, e4) {
450
- const h3 = this.strings;
451
- let o4 = false;
452
- if (h3 === undefined)
453
- t3 = S2(this, t3, i4, 0), o4 = !c3(t3) || t3 !== this._$AH && t3 !== T, o4 && (this._$AH = t3);
463
+ _$AI(t, i = this, s, e) {
464
+ const h = this.strings;
465
+ let o = false;
466
+ if (h === undefined)
467
+ t = S2(this, t, i, 0), o = !c3(t) || t !== this._$AH && t !== T, o && (this._$AH = t);
454
468
  else {
455
- const e5 = t3;
456
- let n4, r4;
457
- for (t3 = h3[0], n4 = 0;n4 < h3.length - 1; n4++)
458
- r4 = S2(this, e5[s3 + n4], i4, n4), r4 === T && (r4 = this._$AH[n4]), o4 ||= !c3(r4) || r4 !== this._$AH[n4], r4 === E ? t3 = E : t3 !== E && (t3 += (r4 ?? "") + h3[n4 + 1]), this._$AH[n4] = r4;
469
+ const e = t;
470
+ let n, r;
471
+ for (t = h[0], n = 0;n < h.length - 1; n++)
472
+ r = S2(this, e[s + n], i, n), r === T && (r = this._$AH[n]), o ||= !c3(r) || r !== this._$AH[n], r === E ? t = E : t !== E && (t += (r ?? "") + h[n + 1]), this._$AH[n] = r;
459
473
  }
460
- o4 && !e4 && this.j(t3);
474
+ o && !e && this.j(t);
461
475
  }
462
- j(t3) {
463
- t3 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t3 ?? "");
476
+ j(t) {
477
+ t === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
464
478
  }
465
479
  }
466
480
 
467
481
  class z {
468
- constructor(t3, i4, s3) {
469
- this.element = t3, this.type = 6, this._$AN = undefined, this._$AM = i4, this.options = s3;
482
+ constructor(t, i, s) {
483
+ this.element = t, this.type = 6, this._$AN = undefined, this._$AM = i, this.options = s;
470
484
  }
471
485
  get _$AU() {
472
486
  return this._$AM._$AU;
473
487
  }
474
- _$AI(t3) {
475
- S2(this, t3);
476
- }
477
- }
478
- var t2, i3, s2, e3 = "$lit$", h2, o3, n3, r3, l2 = () => r3.createComment(""), c3 = (t3) => t3 === null || typeof t3 != "object" && typeof t3 != "function", a2, u2 = (t3) => a2(t3) || typeof t3?.[Symbol.iterator] == "function", d2 = `[
479
- \f\r]`, f2, v, _, m, p2, g, $, y2 = (t3) => (i4, ...s3) => ({ _$litType$: t3, strings: i4, values: s3 }), x, b2, w, T, E, A, C, V = (t3, i4) => {
480
- const s3 = t3.length - 1, o4 = [];
481
- let r4, l3 = i4 === 2 ? "<svg>" : i4 === 3 ? "<math>" : "", c4 = f2;
482
- for (let i5 = 0;i5 < s3; i5++) {
483
- const s4 = t3[i5];
484
- let a3, u3, d3 = -1, y3 = 0;
485
- for (;y3 < s4.length && (c4.lastIndex = y3, u3 = c4.exec(s4), u3 !== null); )
486
- y3 = c4.lastIndex, c4 === f2 ? u3[1] === "!--" ? c4 = v : u3[1] !== undefined ? c4 = _ : u3[2] !== undefined ? ($.test(u3[2]) && (r4 = RegExp("</" + u3[2], "g")), c4 = m) : u3[3] !== undefined && (c4 = m) : c4 === m ? u3[0] === ">" ? (c4 = r4 ?? f2, d3 = -1) : u3[1] === undefined ? d3 = -2 : (d3 = c4.lastIndex - u3[2].length, a3 = u3[1], c4 = u3[3] === undefined ? m : u3[3] === '"' ? g : p2) : c4 === g || c4 === p2 ? c4 = m : c4 === v || c4 === _ ? c4 = f2 : (c4 = m, r4 = undefined);
487
- const x2 = c4 === m && t3[i5 + 1].startsWith("/>") ? " " : "";
488
- l3 += c4 === f2 ? s4 + n3 : d3 >= 0 ? (o4.push(a3), s4.slice(0, d3) + e3 + s4.slice(d3) + h2 + x2) : s4 + h2 + (d3 === -2 ? i5 : x2);
489
- }
490
- return [P(t3, l3 + (t3[s3] || "<?>") + (i4 === 2 ? "</svg>" : i4 === 3 ? "</math>" : "")), o4];
491
- }, H, I, L, Z, j, B = (t3, i4, s3) => {
492
- const e4 = s3?.renderBefore ?? i4;
493
- let h3 = e4._$litPart$;
494
- if (h3 === undefined) {
495
- const t4 = s3?.renderBefore ?? null;
496
- e4._$litPart$ = h3 = new R(i4.insertBefore(l2(), t4), t4, undefined, s3 ?? {});
497
- }
498
- return h3._$AI(t3), h3;
488
+ _$AI(t) {
489
+ S2(this, t);
490
+ }
491
+ }
492
+ var t2, i3, s2, e3 = "$lit$", h2, o3, n3, r3, l2 = () => r3.createComment(""), c3 = (t) => t === null || typeof t != "object" && typeof t != "function", a2, u2 = (t) => a2(t) || typeof t?.[Symbol.iterator] == "function", d2 = `[
493
+ \f\r]`, f2, v, _, m, p2, g, $, y2 = (t) => (i, ...s) => ({ _$litType$: t, strings: i, values: s }), x, b2, w, T, E, A, C, V = (t, i) => {
494
+ const s = t.length - 1, o = [];
495
+ let r, l = i === 2 ? "<svg>" : i === 3 ? "<math>" : "", c = f2;
496
+ for (let i = 0;i < s; i++) {
497
+ const s = t[i];
498
+ let a, u, d = -1, y = 0;
499
+ for (;y < s.length && (c.lastIndex = y, u = c.exec(s), u !== null); )
500
+ y = c.lastIndex, c === f2 ? u[1] === "!--" ? c = v : u[1] !== undefined ? c = _ : u[2] !== undefined ? ($.test(u[2]) && (r = RegExp("</" + u[2], "g")), c = m) : u[3] !== undefined && (c = m) : c === m ? u[0] === ">" ? (c = r ?? f2, d = -1) : u[1] === undefined ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = u[3] === undefined ? m : u[3] === '"' ? g : p2) : c === g || c === p2 ? c = m : c === v || c === _ ? c = f2 : (c = m, r = undefined);
501
+ const x = c === m && t[i + 1].startsWith("/>") ? " " : "";
502
+ l += c === f2 ? s + n3 : d >= 0 ? (o.push(a), s.slice(0, d) + e3 + s.slice(d) + h2 + x) : s + h2 + (d === -2 ? i : x);
503
+ }
504
+ return [P(t, l + (t[s] || "<?>") + (i === 2 ? "</svg>" : i === 3 ? "</math>" : "")), o];
505
+ }, H, I, L, Z, j, B = (t, i, s) => {
506
+ const e = s?.renderBefore ?? i;
507
+ let h = e._$litPart$;
508
+ if (h === undefined) {
509
+ const t = s?.renderBefore ?? null;
510
+ e._$litPart$ = h = new R(i.insertBefore(l2(), t), t, undefined, s ?? {});
511
+ }
512
+ return h._$AI(t), h;
499
513
  };
500
514
  var init_lit_html = __esm(() => {
501
515
  t2 = globalThis;
502
516
  i3 = t2.trustedTypes;
503
- s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t3) => t3 }) : undefined;
517
+ s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t) => t }) : undefined;
504
518
  h2 = `lit$${Math.random().toFixed(9).slice(2)}$`;
505
519
  o3 = "?" + h2;
506
520
  n3 = `<${o3}>`;
@@ -525,30 +539,30 @@ var init_lit_html = __esm(() => {
525
539
  constructor() {
526
540
  super(...arguments), this.type = 3;
527
541
  }
528
- j(t3) {
529
- this.element[this.name] = t3 === E ? undefined : t3;
542
+ j(t) {
543
+ this.element[this.name] = t === E ? undefined : t;
530
544
  }
531
545
  };
532
546
  I = class I extends k {
533
547
  constructor() {
534
548
  super(...arguments), this.type = 4;
535
549
  }
536
- j(t3) {
537
- this.element.toggleAttribute(this.name, !!t3 && t3 !== E);
550
+ j(t) {
551
+ this.element.toggleAttribute(this.name, !!t && t !== E);
538
552
  }
539
553
  };
540
554
  L = class L extends k {
541
- constructor(t3, i4, s3, e4, h3) {
542
- super(t3, i4, s3, e4, h3), this.type = 5;
555
+ constructor(t, i, s, e, h) {
556
+ super(t, i, s, e, h), this.type = 5;
543
557
  }
544
- _$AI(t3, i4 = this) {
545
- if ((t3 = S2(this, t3, i4, 0) ?? E) === T)
558
+ _$AI(t, i = this) {
559
+ if ((t = S2(this, t, i, 0) ?? E) === T)
546
560
  return;
547
- const s3 = this._$AH, e4 = t3 === E && s3 !== E || t3.capture !== s3.capture || t3.once !== s3.once || t3.passive !== s3.passive, h3 = t3 !== E && (s3 === E || e4);
548
- e4 && this.element.removeEventListener(this.name, this, s3), h3 && this.element.addEventListener(this.name, this, t3), this._$AH = t3;
561
+ const s = this._$AH, e = t === E && s !== E || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, h = t !== E && (s === E || e);
562
+ e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
549
563
  }
550
- handleEvent(t3) {
551
- typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t3) : this._$AH.handleEvent(t3);
564
+ handleEvent(t) {
565
+ typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
552
566
  }
553
567
  };
554
568
  Z = { M: e3, P: h2, A: o3, C: 1, L: V, R: M, D: u2, V: S2, I: R, H: k, N: I, U: L, B: H, F: z };
@@ -559,9 +573,9 @@ var init_lit_html = __esm(() => {
559
573
  // ../../node_modules/lit-element/lit-element.js
560
574
  var s3, i4, o4;
561
575
  var init_lit_element = __esm(() => {
562
- init_reactive_element();
563
576
  init_reactive_element();
564
577
  init_lit_html();
578
+ init_reactive_element();
565
579
  init_lit_html();
566
580
  s3 = globalThis;
567
581
  i4 = class i4 extends y {
@@ -569,12 +583,12 @@ var init_lit_element = __esm(() => {
569
583
  super(...arguments), this.renderOptions = { host: this }, this._$Do = undefined;
570
584
  }
571
585
  createRenderRoot() {
572
- const t3 = super.createRenderRoot();
573
- return this.renderOptions.renderBefore ??= t3.firstChild, t3;
586
+ const t = super.createRenderRoot();
587
+ return this.renderOptions.renderBefore ??= t.firstChild, t;
574
588
  }
575
- update(t3) {
576
- const r4 = this.render();
577
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t3), this._$Do = B(r4, this.renderRoot, this.renderOptions);
589
+ update(t) {
590
+ const r = this.render();
591
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = B(r, this.renderRoot, this.renderOptions);
578
592
  }
579
593
  connectedCallback() {
580
594
  super.connectedCallback(), this._$Do?.setConnected(true);
@@ -604,28 +618,28 @@ var init_lit = __esm(() => {
604
618
  });
605
619
 
606
620
  // ../../node_modules/lit-html/directive-helpers.js
607
- var t3, f3 = (o5) => o5.strings === undefined, r4 = () => document.createComment(""), s4 = (o5, i5, n4) => {
608
- const e4 = o5._$AA.parentNode, l3 = i5 === undefined ? o5._$AB : i5._$AA;
609
- if (n4 === undefined) {
610
- const i6 = e4.insertBefore(r4(), l3), d3 = e4.insertBefore(r4(), l3);
611
- n4 = new t3(i6, d3, o5, o5.options);
621
+ var t3, f3 = (o) => o.strings === undefined, r4 = () => document.createComment(""), s4 = (o, i, n) => {
622
+ const e = o._$AA.parentNode, l = i === undefined ? o._$AB : i._$AA;
623
+ if (n === undefined) {
624
+ const i = e.insertBefore(r4(), l), d = e.insertBefore(r4(), l);
625
+ n = new t3(i, d, o, o.options);
612
626
  } else {
613
- const t4 = n4._$AB.nextSibling, i6 = n4._$AM, d3 = i6 !== o5;
614
- if (d3) {
615
- let t5;
616
- n4._$AQ?.(o5), n4._$AM = o5, n4._$AP !== undefined && (t5 = o5._$AU) !== i6._$AU && n4._$AP(t5);
627
+ const t = n._$AB.nextSibling, i = n._$AM, d = i !== o;
628
+ if (d) {
629
+ let t;
630
+ n._$AQ?.(o), n._$AM = o, n._$AP !== undefined && (t = o._$AU) !== i._$AU && n._$AP(t);
617
631
  }
618
- if (t4 !== l3 || d3) {
619
- let o6 = n4._$AA;
620
- for (;o6 !== t4; ) {
621
- const t5 = o6.nextSibling;
622
- e4.insertBefore(o6, l3), o6 = t5;
632
+ if (t !== l || d) {
633
+ let o = n._$AA;
634
+ for (;o !== t; ) {
635
+ const t = o.nextSibling;
636
+ e.insertBefore(o, l), o = t;
623
637
  }
624
638
  }
625
639
  }
626
- return n4;
627
- }, v2 = (o5, t4, i5 = o5) => (o5._$AI(t4, i5), o5), u3, m2 = (o5, t4 = u3) => o5._$AH = t4, p3 = (o5) => o5._$AH, M2 = (o5) => {
628
- o5._$AR(), o5._$AA.remove();
640
+ return n;
641
+ }, v2 = (o, t, i = o) => (o._$AI(t, i), o), u3, m2 = (o, t = u3) => o._$AH = t, p3 = (o) => o._$AH, M2 = (o) => {
642
+ o._$AR(), o._$AA.remove();
629
643
  };
630
644
  var init_directive_helpers = __esm(() => {
631
645
  init_lit_html();
@@ -635,66 +649,66 @@ var init_directive_helpers = __esm(() => {
635
649
 
636
650
  // ../../node_modules/lit-html/directive.js
637
651
  class i5 {
638
- constructor(t5) {}
652
+ constructor(t) {}
639
653
  get _$AU() {
640
654
  return this._$AM._$AU;
641
655
  }
642
- _$AT(t5, e5, i6) {
643
- this._$Ct = t5, this._$AM = e5, this._$Ci = i6;
656
+ _$AT(t, e, i) {
657
+ this._$Ct = t, this._$AM = e, this._$Ci = i;
644
658
  }
645
- _$AS(t5, e5) {
646
- return this.update(t5, e5);
659
+ _$AS(t, e) {
660
+ return this.update(t, e);
647
661
  }
648
- update(t5, e5) {
649
- return this.render(...e5);
662
+ update(t, e) {
663
+ return this.render(...e);
650
664
  }
651
665
  }
652
- var t4, e4 = (t5) => (...e5) => ({ _$litDirective$: t5, values: e5 });
666
+ var t4, e4 = (t) => (...e) => ({ _$litDirective$: t, values: e });
653
667
  var init_directive = __esm(() => {
654
668
  t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
655
669
  });
656
670
 
657
671
  // ../../node_modules/lit-html/async-directive.js
658
- function h3(i6) {
659
- this._$AN !== undefined ? (o5(this), this._$AM = i6, r5(this)) : this._$AM = i6;
660
- }
661
- function n4(i6, t5 = false, e5 = 0) {
662
- const r6 = this._$AH, h4 = this._$AN;
663
- if (h4 !== undefined && h4.size !== 0)
664
- if (t5)
665
- if (Array.isArray(r6))
666
- for (let i7 = e5;i7 < r6.length; i7++)
667
- s5(r6[i7], false), o5(r6[i7]);
672
+ function h3(i) {
673
+ this._$AN !== undefined ? (o5(this), this._$AM = i, r5(this)) : this._$AM = i;
674
+ }
675
+ function n4(i, t = false, e = 0) {
676
+ const r = this._$AH, h = this._$AN;
677
+ if (h !== undefined && h.size !== 0)
678
+ if (t)
679
+ if (Array.isArray(r))
680
+ for (let i = e;i < r.length; i++)
681
+ s5(r[i], false), o5(r[i]);
668
682
  else
669
- r6 != null && (s5(r6, false), o5(r6));
683
+ r != null && (s5(r, false), o5(r));
670
684
  else
671
- s5(this, i6);
685
+ s5(this, i);
672
686
  }
673
- var s5 = (i6, t5) => {
674
- const e5 = i6._$AN;
675
- if (e5 === undefined)
687
+ var s5 = (i, t) => {
688
+ const e = i._$AN;
689
+ if (e === undefined)
676
690
  return false;
677
- for (const i7 of e5)
678
- i7._$AO?.(t5, false), s5(i7, t5);
691
+ for (const i of e)
692
+ i._$AO?.(t, false), s5(i, t);
679
693
  return true;
680
- }, o5 = (i6) => {
681
- let t5, e5;
694
+ }, o5 = (i) => {
695
+ let t, e;
682
696
  do {
683
- if ((t5 = i6._$AM) === undefined)
697
+ if ((t = i._$AM) === undefined)
684
698
  break;
685
- e5 = t5._$AN, e5.delete(i6), i6 = t5;
686
- } while (e5?.size === 0);
687
- }, r5 = (i6) => {
688
- for (let t5;t5 = i6._$AM; i6 = t5) {
689
- let e5 = t5._$AN;
690
- if (e5 === undefined)
691
- t5._$AN = e5 = new Set;
692
- else if (e5.has(i6))
699
+ e = t._$AN, e.delete(i), i = t;
700
+ } while (e?.size === 0);
701
+ }, r5 = (i) => {
702
+ for (let t;t = i._$AM; i = t) {
703
+ let e = t._$AN;
704
+ if (e === undefined)
705
+ t._$AN = e = new Set;
706
+ else if (e.has(i))
693
707
  break;
694
- e5.add(i6), c4(t5);
708
+ e.add(i), c4(t);
695
709
  }
696
- }, c4 = (i6) => {
697
- i6.type == t4.CHILD && (i6._$AP ??= n4, i6._$AQ ??= h3);
710
+ }, c4 = (i) => {
711
+ i.type == t4.CHILD && (i._$AP ??= n4, i._$AQ ??= h3);
698
712
  }, f4;
699
713
  var init_async_directive = __esm(() => {
700
714
  init_directive_helpers();
@@ -704,18 +718,18 @@ var init_async_directive = __esm(() => {
704
718
  constructor() {
705
719
  super(...arguments), this._$AN = undefined;
706
720
  }
707
- _$AT(i6, t5, e5) {
708
- super._$AT(i6, t5, e5), r5(this), this.isConnected = i6._$AU;
721
+ _$AT(i, t, e) {
722
+ super._$AT(i, t, e), r5(this), this.isConnected = i._$AU;
709
723
  }
710
- _$AO(i6, t5 = true) {
711
- i6 !== this.isConnected && (this.isConnected = i6, i6 ? this.reconnected?.() : this.disconnected?.()), t5 && (s5(this, i6), o5(this));
724
+ _$AO(i, t = true) {
725
+ i !== this.isConnected && (this.isConnected = i, i ? this.reconnected?.() : this.disconnected?.()), t && (s5(this, i), o5(this));
712
726
  }
713
- setValue(t5) {
727
+ setValue(t) {
714
728
  if (f3(this._$Ct))
715
- this._$Ct._$AI(t5, this);
729
+ this._$Ct._$AI(t, this);
716
730
  else {
717
- const i6 = [...this._$Ct._$AH];
718
- i6[this._$Ci] = t5, this._$Ct._$AI(i6, this, 0);
731
+ const i = [...this._$Ct._$AH];
732
+ i[this._$Ci] = t, this._$Ct._$AI(i, this, 0);
719
733
  }
720
734
  }
721
735
  disconnected() {}
@@ -733,20 +747,20 @@ var init_ref = __esm(() => {
733
747
  init_directive();
734
748
  o6 = new WeakMap;
735
749
  n5 = e4(class extends f4 {
736
- render(i6) {
750
+ render(i) {
737
751
  return E;
738
752
  }
739
- update(i6, [s6]) {
740
- const e6 = s6 !== this.G;
741
- return e6 && this.G !== undefined && this.rt(undefined), (e6 || this.lt !== this.ct) && (this.G = s6, this.ht = i6.options?.host, this.rt(this.ct = i6.element)), E;
753
+ update(i, [s]) {
754
+ const e = s !== this.G;
755
+ return e && this.G !== undefined && this.rt(undefined), (e || this.lt !== this.ct) && (this.G = s, this.ht = i.options?.host, this.rt(this.ct = i.element)), E;
742
756
  }
743
- rt(t5) {
744
- if (this.isConnected || (t5 = undefined), typeof this.G == "function") {
745
- const i6 = this.ht ?? globalThis;
746
- let s6 = o6.get(i6);
747
- s6 === undefined && (s6 = new WeakMap, o6.set(i6, s6)), s6.get(this.G) !== undefined && this.G.call(this.ht, undefined), s6.set(this.G, t5), t5 !== undefined && this.G.call(this.ht, t5);
757
+ rt(t) {
758
+ if (this.isConnected || (t = undefined), typeof this.G == "function") {
759
+ const i = this.ht ?? globalThis;
760
+ let s = o6.get(i);
761
+ s === undefined && (s = new WeakMap, o6.set(i, s)), s.get(this.G) !== undefined && this.G.call(this.ht, undefined), s.set(this.G, t), t !== undefined && this.G.call(this.ht, t);
748
762
  } else
749
- this.G.value = t5;
763
+ this.G.value = t;
750
764
  }
751
765
  get lt() {
752
766
  return typeof this.G == "function" ? o6.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
@@ -770,16 +784,16 @@ function base(ALPHABET) {
770
784
  throw new TypeError("Alphabet too long");
771
785
  }
772
786
  const BASE_MAP = new Uint8Array(256);
773
- for (let j2 = 0;j2 < BASE_MAP.length; j2++) {
774
- BASE_MAP[j2] = 255;
787
+ for (let j = 0;j < BASE_MAP.length; j++) {
788
+ BASE_MAP[j] = 255;
775
789
  }
776
- for (let i6 = 0;i6 < ALPHABET.length; i6++) {
777
- const x2 = ALPHABET.charAt(i6);
778
- const xc = x2.charCodeAt(0);
790
+ for (let i = 0;i < ALPHABET.length; i++) {
791
+ const x = ALPHABET.charAt(i);
792
+ const xc = x.charCodeAt(0);
779
793
  if (BASE_MAP[xc] !== 255) {
780
- throw new TypeError(x2 + " is ambiguous");
794
+ throw new TypeError(x + " is ambiguous");
781
795
  }
782
- BASE_MAP[xc] = i6;
796
+ BASE_MAP[xc] = i;
783
797
  }
784
798
  const BASE = ALPHABET.length;
785
799
  const LEADER = ALPHABET.charAt(0);
@@ -809,8 +823,8 @@ function base(ALPHABET) {
809
823
  const b58 = new Uint8Array(size);
810
824
  while (pbegin !== pend) {
811
825
  let carry = source[pbegin];
812
- let i6 = 0;
813
- for (let it1 = size - 1;(carry !== 0 || i6 < length) && it1 !== -1; it1--, i6++) {
826
+ let i = 0;
827
+ for (let it1 = size - 1;(carry !== 0 || i < length) && it1 !== -1; it1--, i++) {
814
828
  carry += 256 * b58[it1] >>> 0;
815
829
  b58[it1] = carry % BASE >>> 0;
816
830
  carry = carry / BASE >>> 0;
@@ -818,7 +832,7 @@ function base(ALPHABET) {
818
832
  if (carry !== 0) {
819
833
  throw new Error("Non-zero carry");
820
834
  }
821
- length = i6;
835
+ length = i;
822
836
  pbegin++;
823
837
  }
824
838
  let it2 = size - length;
@@ -856,8 +870,8 @@ function base(ALPHABET) {
856
870
  if (carry === 255) {
857
871
  return;
858
872
  }
859
- let i6 = 0;
860
- for (let it3 = size - 1;(carry !== 0 || i6 < length) && it3 !== -1; it3--, i6++) {
873
+ let i = 0;
874
+ for (let it3 = size - 1;(carry !== 0 || i < length) && it3 !== -1; it3--, i++) {
861
875
  carry += BASE * b256[it3] >>> 0;
862
876
  b256[it3] = carry % 256 >>> 0;
863
877
  carry = carry / 256 >>> 0;
@@ -865,7 +879,7 @@ function base(ALPHABET) {
865
879
  if (carry !== 0) {
866
880
  throw new Error("Non-zero carry");
867
881
  }
868
- length = i6;
882
+ length = i;
869
883
  psz++;
870
884
  }
871
885
  let it4 = size - length;
@@ -873,9 +887,9 @@ function base(ALPHABET) {
873
887
  it4++;
874
888
  }
875
889
  const vch = new Uint8Array(zeroes + (size - it4));
876
- let j2 = zeroes;
890
+ let j = zeroes;
877
891
  while (it4 !== size) {
878
- vch[j2++] = b256[it4++];
892
+ vch[j++] = b256[it4++];
879
893
  }
880
894
  return vch;
881
895
  }
@@ -915,14 +929,14 @@ var init_near = __esm(() => {
915
929
  });
916
930
 
917
931
  // ../shared-ts/src/utils/validation.ts
918
- function isObject(x2) {
919
- return x2 !== null && typeof x2 === "object";
932
+ function isObject(x) {
933
+ return x !== null && typeof x === "object";
920
934
  }
921
- function isString(x2) {
922
- return typeof x2 === "string";
935
+ function isString(x) {
936
+ return typeof x === "string";
923
937
  }
924
- function isNumber(x2) {
925
- return typeof x2 === "number";
938
+ function isNumber(x) {
939
+ return typeof x === "number";
926
940
  }
927
941
  var init_validation = __esm(() => {
928
942
  init_near();
@@ -968,11 +982,14 @@ var init_LitElementWithProps = __esm(() => {
968
982
  init_lit();
969
983
  init_validation();
970
984
  LitElementWithProps = class LitElementWithProps extends i4 {
971
- _varsSheet = null;
972
- _varsMap = {};
973
- _appearanceVarNames = new Set;
974
- _varsDocSheet = null;
975
- _varsClassName = null;
985
+ constructor() {
986
+ super(...arguments);
987
+ this._varsSheet = null;
988
+ this._varsMap = {};
989
+ this._appearanceVarNames = new Set;
990
+ this._varsDocSheet = null;
991
+ this._varsClassName = null;
992
+ }
976
993
  static keepDefinitions;
977
994
  static requiredChildTags;
978
995
  static strictChildDefinitions;
@@ -992,7 +1009,6 @@ var init_LitElementWithProps = __esm(() => {
992
1009
  propertyNames.forEach((prop) => this.upgradeProperty(prop));
993
1010
  }
994
1011
  }
995
- styles;
996
1012
  connectedCallback() {
997
1013
  super.connectedCallback();
998
1014
  this.upgradeAllProperties();
@@ -1004,7 +1020,7 @@ var init_LitElementWithProps = __esm(() => {
1004
1020
  const { keepDefinitions, requiredChildTags, strictChildDefinitions } = ctor;
1005
1021
  const defs = keepDefinitions;
1006
1022
  if (defs && defs.length) {
1007
- for (const d3 of defs)
1023
+ for (const d of defs)
1008
1024
  ;
1009
1025
  }
1010
1026
  const req = requiredChildTags;
@@ -1039,7 +1055,7 @@ var init_LitElementWithProps = __esm(() => {
1039
1055
  const setVar = (name, val) => {
1040
1056
  vars[name] = val;
1041
1057
  };
1042
- const toKebab = (s6) => this.camelToKebab(s6);
1058
+ const toKebab = (s) => this.camelToKebab(s);
1043
1059
  const transformViewportUnits = (val) => {
1044
1060
  if (!val || typeof val !== "string")
1045
1061
  return val;
@@ -1086,14 +1102,14 @@ var init_LitElementWithProps = __esm(() => {
1086
1102
  setVar(colorMappings[key], maybeTransformed);
1087
1103
  return;
1088
1104
  }
1089
- const r6 = key.match(radiusMatcher);
1090
- if (r6) {
1091
- setVar(`--w3a-border-radius-${r6[1].toLowerCase()}`, maybeTransformed);
1105
+ const r = key.match(radiusMatcher);
1106
+ if (r) {
1107
+ setVar(`--w3a-border-radius-${r[1].toLowerCase()}`, maybeTransformed);
1092
1108
  return;
1093
1109
  }
1094
- const s6 = key.match(shadowMatcher);
1095
- if (s6) {
1096
- setVar(`--w3a-shadows-${s6[1].toLowerCase()}`, maybeTransformed);
1110
+ const s = key.match(shadowMatcher);
1111
+ if (s) {
1112
+ setVar(`--w3a-shadows-${s[1].toLowerCase()}`, maybeTransformed);
1097
1113
  return;
1098
1114
  }
1099
1115
  setVar(`--w3a-${toKebab(key)}`, maybeTransformed);
@@ -1104,8 +1120,8 @@ var init_LitElementWithProps = __esm(() => {
1104
1120
  const kebabSection = toKebab(section);
1105
1121
  const kebabProp = toKebab(prop);
1106
1122
  const cssVarNew = `--w3a-${prefix}__${kebabSection}__${kebabProp}`;
1107
- const v3 = typeof value === "string" ? transformViewportUnits(value) : String(value);
1108
- vars[cssVarNew] = v3;
1123
+ const v = typeof value === "string" ? transformViewportUnits(value) : String(value);
1124
+ vars[cssVarNew] = v;
1109
1125
  });
1110
1126
  }
1111
1127
  });
@@ -1116,12 +1132,12 @@ var init_LitElementWithProps = __esm(() => {
1116
1132
  }
1117
1133
  setCssVars(vars) {
1118
1134
  try {
1119
- for (const [k2, v3] of Object.entries(vars)) {
1120
- if (v3 == null)
1135
+ for (const [k, v] of Object.entries(vars)) {
1136
+ if (v == null)
1121
1137
  continue;
1122
- this._varsMap[k2] = String(v3);
1138
+ this._varsMap[k] = String(v);
1123
1139
  }
1124
- const decls = Object.entries(this._varsMap).map(([k2, v3]) => `${k2}: ${v3};`).join(" ");
1140
+ const decls = Object.entries(this._varsMap).map(([k, v]) => `${k}: ${v};`).join(" ");
1125
1141
  const cssTextShadow = `:host{ ${decls} }`;
1126
1142
  const canUseConstructable = supportsConstructableStylesheets();
1127
1143
  if (this.renderRoot instanceof ShadowRoot && canUseConstructable && hasAdoptedStyleSheets(this.renderRoot)) {
@@ -1221,16 +1237,16 @@ var init_lit_events = __esm(() => {
1221
1237
  });
1222
1238
 
1223
1239
  // src/core/signingEngine/uiConfirm/ui/lit-components/asset-base.ts
1224
- function withTrailingSlash(s6) {
1225
- return s6.endsWith("/") ? s6 : s6 + "/";
1240
+ function withTrailingSlash(s) {
1241
+ return s.endsWith("/") ? s : s + "/";
1226
1242
  }
1227
1243
  function readGlobalEmbeddedBase() {
1228
1244
  try {
1229
1245
  if (typeof window === "undefined")
1230
1246
  return;
1231
- const v3 = window.__W3A_WALLET_SDK_BASE__;
1232
- if (typeof v3 === "string" && v3.length > 0)
1233
- return withTrailingSlash(v3);
1247
+ const v = window.__W3A_WALLET_SDK_BASE__;
1248
+ if (typeof v === "string" && v.length > 0)
1249
+ return withTrailingSlash(v);
1234
1250
  } catch {}
1235
1251
  return;
1236
1252
  }
@@ -1239,14 +1255,14 @@ function deriveFromModuleUrl() {
1239
1255
  const moduleUrl = String(import.meta.url || "").trim();
1240
1256
  if (!moduleUrl)
1241
1257
  return;
1242
- const base2 = typeof window !== "undefined" ? window.location.href : undefined;
1243
- const u4 = base2 ? new URL(moduleUrl, base2) : new URL(moduleUrl);
1244
- const href = u4.toString();
1258
+ const base = typeof window !== "undefined" ? window.location.href : undefined;
1259
+ const u = base ? new URL(moduleUrl, base) : new URL(moduleUrl);
1260
+ const href = u.toString();
1245
1261
  const idx = href.indexOf(SDK_SEGMENT);
1246
1262
  if (idx > 0) {
1247
1263
  return withTrailingSlash(href.slice(0, idx + SDK_SEGMENT.length));
1248
1264
  }
1249
- const origin = u4.origin;
1265
+ const origin = u.origin;
1250
1266
  if (origin && /^https?:/i.test(origin)) {
1251
1267
  return withTrailingSlash(origin + "/sdk");
1252
1268
  }
@@ -1260,22 +1276,22 @@ var SDK_SEGMENT = "/sdk/";
1260
1276
 
1261
1277
  // src/core/signingEngine/uiConfirm/ui/lit-components/css/css-loader.ts
1262
1278
  function resolveStylesheetUrl(assetName) {
1263
- const base2 = resolveEmbeddedBase();
1264
- const join = (s6) => s6.endsWith("/") ? s6 : s6 + "/";
1265
- if (/^https?:/i.test(base2))
1266
- return `${join(base2)}${assetName}`;
1279
+ const base = resolveEmbeddedBase();
1280
+ const join = (s) => s.endsWith("/") ? s : s + "/";
1281
+ if (/^https?:/i.test(base))
1282
+ return `${join(base)}${assetName}`;
1267
1283
  try {
1268
1284
  if (!warnedRelativeBaseOnce && typeof document !== "undefined" && document.URL === "about:srcdoc") {
1269
1285
  warnedRelativeBaseOnce = true;
1270
- console.warn(`[W3A][css-loader] Embedded SDK base is relative: "${base2}". ` + `In production, configure an absolute base so iframe assets resolve: ` + `set SeamsWebProvider config { iframeWallet: { walletOrigin: "https://wallet.example.com", sdkBasePath: "/sdk" } }, `);
1286
+ console.warn(`[W3A][css-loader] Embedded SDK base is relative: "${base}". ` + `In production, configure an absolute base so iframe assets resolve: ` + `set SeamsWebProvider config { iframeWallet: { walletOrigin: "https://wallet.example.com", sdkBasePath: "/sdk" } }, `);
1271
1287
  }
1272
1288
  } catch {}
1273
1289
  const origin = typeof window !== "undefined" && window.location ? window.location.origin : "";
1274
1290
  if (origin && origin !== "null" && /^https?:/i.test(origin)) {
1275
- const prefix = base2.startsWith("/") ? base2 : `/${base2}`;
1291
+ const prefix = base.startsWith("/") ? base : `/${base}`;
1276
1292
  return `${join(origin + prefix)}${assetName}`;
1277
1293
  }
1278
- const normalized = base2.startsWith("/") ? base2 : `/${base2}`;
1294
+ const normalized = base.startsWith("/") ? base : `/${base}`;
1279
1295
  return `${join(normalized)}${assetName}`;
1280
1296
  }
1281
1297
  function getDoc(root) {
@@ -1321,9 +1337,9 @@ async function adoptConstructable(root, assetName) {
1321
1337
  if (!res.ok)
1322
1338
  return null;
1323
1339
  const cssText = await res.text();
1324
- const sheet2 = new CSSStyleSheet;
1325
- sheet2.replaceSync(cssText);
1326
- return sheet2;
1340
+ const sheet = new CSSStyleSheet;
1341
+ sheet.replaceSync(cssText);
1342
+ return sheet;
1327
1343
  } catch {
1328
1344
  return null;
1329
1345
  }
@@ -1373,8 +1389,8 @@ var init_css_loader = __esm(() => {
1373
1389
  });
1374
1390
 
1375
1391
  // src/core/signingEngine/uiConfirm/ui/lit-components/Drawer/index.ts
1376
- function clamp(n6, min, max) {
1377
- return Math.max(min, Math.min(max, n6));
1392
+ function clamp(n, min, max) {
1393
+ return Math.max(min, Math.min(max, n));
1378
1394
  }
1379
1395
  var SHEET_HEIGHT_VH = 100, DEFAULT_VISIBLE_VH = 50, FLICK_UP_CLOSE_THRESHOLD = -0.6, FLICK_DOWN_CLOSE_THRESHOLD = 0.7, NEAR_CLOSED_PX = 50, OVERPULL_SHEET_FACTOR = 0.5, OVERPULL_VIEWPORT_FACTOR = 0.5, DrawerElement, Drawer_default;
1380
1396
  var init_Drawer = __esm(() => {
@@ -1396,44 +1412,185 @@ var init_Drawer = __esm(() => {
1396
1412
  height: { type: String },
1397
1413
  overpullPx: { type: Number, attribute: "overpull-px" }
1398
1414
  };
1399
- isDragging = false;
1400
- pendingDrag = false;
1401
- startY = 0;
1402
- currentY = 0;
1403
- dragDistance = 0;
1404
- lastDragTime = 0;
1405
- velocity = 0;
1406
- drawerElement = null;
1407
- overlayElement = null;
1408
- bodyElement = null;
1409
- drawerHeight = 0;
1410
- startTranslateYPx = 0;
1411
- openRestTranslateYPx = 0;
1412
- dragStartTime = 0;
1413
- isClosing = false;
1414
- aboveFoldResizeObserver;
1415
- drawerResizeObserver;
1416
- detachViewportSync;
1417
- _syncRAF = null;
1418
- _lastOpenTranslatePct;
1419
- _contentAnimRAF = null;
1420
- _activeHeightTransitions = 0;
1421
- detachContentAnimSync;
1422
- _initialMount = true;
1423
- _firstOpen = true;
1424
- _stylesReady = false;
1425
- _stylePromises = [];
1426
- _stylesAwaiting = null;
1427
- _childObserver = null;
1428
1415
  createRenderRoot() {
1429
1416
  const root = this;
1430
- const p4 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
1431
- this._stylePromises.push(p4);
1432
- p4.catch(() => {});
1417
+ const p = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
1418
+ this._stylePromises.push(p);
1419
+ p.catch(() => {});
1433
1420
  return root;
1434
1421
  }
1435
1422
  constructor() {
1436
1423
  super();
1424
+ this.isDragging = false;
1425
+ this.pendingDrag = false;
1426
+ this.startY = 0;
1427
+ this.currentY = 0;
1428
+ this.dragDistance = 0;
1429
+ this.lastDragTime = 0;
1430
+ this.velocity = 0;
1431
+ this.drawerElement = null;
1432
+ this.overlayElement = null;
1433
+ this.bodyElement = null;
1434
+ this.drawerHeight = 0;
1435
+ this.startTranslateYPx = 0;
1436
+ this.openRestTranslateYPx = 0;
1437
+ this.dragStartTime = 0;
1438
+ this.isClosing = false;
1439
+ this._syncRAF = null;
1440
+ this._contentAnimRAF = null;
1441
+ this._activeHeightTransitions = 0;
1442
+ this._initialMount = true;
1443
+ this._firstOpen = true;
1444
+ this._stylesReady = false;
1445
+ this._stylePromises = [];
1446
+ this._stylesAwaiting = null;
1447
+ this._childObserver = null;
1448
+ this._initialChildren = null;
1449
+ this.handleTransitionEnd = (e) => {
1450
+ if (!this.drawerElement)
1451
+ return;
1452
+ if (e.target !== this.drawerElement)
1453
+ return;
1454
+ if (e.propertyName !== "transform")
1455
+ return;
1456
+ const type = this.open ? "w3a:drawer-open-end" : "w3a:drawer-close-end";
1457
+ this.dispatchEvent(new CustomEvent(type, { bubbles: true, composed: true }));
1458
+ };
1459
+ this.handlePointerDown = (e) => {
1460
+ if (this.loading || !this.open)
1461
+ return;
1462
+ if (e.pointerType === "mouse" && e.button !== 0)
1463
+ return;
1464
+ this.pendingDrag = true;
1465
+ this.startY = e.clientY;
1466
+ this.currentY = e.clientY;
1467
+ this.dragStartTime = Date.now();
1468
+ };
1469
+ this.handlePointerMove = (e) => {
1470
+ if (!this.pendingDrag && !this.isDragging)
1471
+ return;
1472
+ const y = e.clientY;
1473
+ if (this.pendingDrag) {
1474
+ const dy = y - this.startY;
1475
+ const absDy = Math.abs(dy);
1476
+ const ACTIVATE_PX = 8;
1477
+ const body = this.bodyElement;
1478
+ const atTop = !body || body.scrollTop <= 0;
1479
+ if (absDy >= ACTIVATE_PX && atTop) {
1480
+ this.pendingDrag = false;
1481
+ this.startDrag(this.startY);
1482
+ e.target?.setPointerCapture?.(e.pointerId);
1483
+ } else {
1484
+ return;
1485
+ }
1486
+ }
1487
+ if (this.isDragging) {
1488
+ this.updateDrag(y);
1489
+ e.preventDefault();
1490
+ }
1491
+ };
1492
+ this.handlePointerUp = (e) => {
1493
+ if (this.pendingDrag) {
1494
+ this.pendingDrag = false;
1495
+ }
1496
+ if (this.isDragging) {
1497
+ this.endDrag();
1498
+ e.preventDefault();
1499
+ }
1500
+ e.target?.releasePointerCapture?.(e.pointerId);
1501
+ };
1502
+ this.handlePointerCancel = (e) => {
1503
+ if (this.pendingDrag)
1504
+ this.pendingDrag = false;
1505
+ if (this.isDragging)
1506
+ this.endDrag();
1507
+ e.target?.releasePointerCapture?.(e.pointerId);
1508
+ };
1509
+ this.handleTouchStart = (e) => {
1510
+ if (this.loading || !this.open)
1511
+ return;
1512
+ const target = e.target;
1513
+ if (target && target.closest && target.closest(".close-btn")) {
1514
+ return;
1515
+ }
1516
+ const touch = e.touches[0];
1517
+ this.pendingDrag = true;
1518
+ this.startY = touch.clientY;
1519
+ this.currentY = touch.clientY;
1520
+ };
1521
+ this.handleTouchMove = (e) => {
1522
+ const touch = e.touches[0];
1523
+ if (this.pendingDrag && !this.isDragging) {
1524
+ const dy = touch.clientY - this.startY;
1525
+ const absDy = Math.abs(dy);
1526
+ const ACTIVATE_PX = 8;
1527
+ const body = this.bodyElement;
1528
+ const atTop = !body || body.scrollTop <= 0;
1529
+ if (absDy >= ACTIVATE_PX) {
1530
+ if (atTop) {
1531
+ this.startDrag(this.startY);
1532
+ this.isDragging = true;
1533
+ this.pendingDrag = false;
1534
+ }
1535
+ }
1536
+ }
1537
+ if (!this.isDragging)
1538
+ return;
1539
+ this.updateDrag(touch.clientY);
1540
+ e.preventDefault();
1541
+ };
1542
+ this.handleTouchEnd = (e) => {
1543
+ this.pendingDrag = false;
1544
+ if (!this.isDragging)
1545
+ return;
1546
+ this.endDrag();
1547
+ e.preventDefault();
1548
+ };
1549
+ this.handleMouseDown = (e) => {
1550
+ if (this.loading || !this.open)
1551
+ return;
1552
+ this.startDrag(e.clientY);
1553
+ e.preventDefault();
1554
+ };
1555
+ this.handleMouseMove = (e) => {
1556
+ if (!this.isDragging)
1557
+ return;
1558
+ this.updateDrag(e.clientY);
1559
+ e.preventDefault();
1560
+ };
1561
+ this.handleMouseUp = (e) => {
1562
+ if (!this.isDragging)
1563
+ return;
1564
+ this.endDrag();
1565
+ e.preventDefault();
1566
+ };
1567
+ this.onClose = () => {
1568
+ if (this.loading)
1569
+ return;
1570
+ if (this.isClosing)
1571
+ return;
1572
+ if (this.drawerElement) {
1573
+ this.drawerElement.classList.remove("dragging");
1574
+ }
1575
+ this.open = false;
1576
+ dispatchLitCancel(this);
1577
+ this.isClosing = true;
1578
+ setTimeout(() => {
1579
+ this.isClosing = false;
1580
+ }, 300);
1581
+ };
1582
+ this.onHandleClick = () => {
1583
+ if (!this.open) {
1584
+ this.show();
1585
+ } else {
1586
+ this.hide("handle");
1587
+ }
1588
+ };
1589
+ this.onOverlayClick = () => {
1590
+ if (!this.closeOnOverlayClick)
1591
+ return;
1592
+ this.onClose();
1593
+ };
1437
1594
  this.open = false;
1438
1595
  this.theme = "dark";
1439
1596
  this.appearance = undefined;
@@ -1447,13 +1604,12 @@ var init_Drawer = __esm(() => {
1447
1604
  getComponentPrefix() {
1448
1605
  return "modal";
1449
1606
  }
1450
- _initialChildren = null;
1451
1607
  connectedCallback() {
1452
1608
  if (!this._initialChildren) {
1453
1609
  this._initialChildren = Array.from(this.childNodes);
1454
1610
  try {
1455
- for (const n6 of this._initialChildren)
1456
- this.removeChild(n6);
1611
+ for (const n of this._initialChildren)
1612
+ this.removeChild(n);
1457
1613
  } catch {}
1458
1614
  }
1459
1615
  super.connectedCallback();
@@ -1464,7 +1620,7 @@ var init_Drawer = __esm(() => {
1464
1620
  if (this._stylesReady)
1465
1621
  return true;
1466
1622
  if (!this._stylesAwaiting) {
1467
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
1623
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
1468
1624
  this._stylesAwaiting = settle.then(() => {
1469
1625
  this._stylesReady = true;
1470
1626
  this.requestUpdate();
@@ -1561,17 +1717,17 @@ var init_Drawer = __esm(() => {
1561
1717
  return;
1562
1718
  const host = this;
1563
1719
  const toMove = [];
1564
- host.childNodes.forEach((n6) => {
1565
- if (n6.nodeType !== Node.ELEMENT_NODE)
1720
+ host.childNodes.forEach((n) => {
1721
+ if (n.nodeType !== Node.ELEMENT_NODE)
1566
1722
  return;
1567
- const el = n6;
1723
+ const el = n;
1568
1724
  if (el.classList?.contains("overlay"))
1569
1725
  return;
1570
1726
  if (el.classList?.contains("drawer"))
1571
1727
  return;
1572
- toMove.push(n6);
1728
+ toMove.push(n);
1573
1729
  });
1574
- toMove.forEach((n6) => above.appendChild(n6));
1730
+ toMove.forEach((n) => above.appendChild(n));
1575
1731
  this.syncCssVarsForOpenTranslate();
1576
1732
  }
1577
1733
  get contentRoot() {
@@ -1579,10 +1735,10 @@ var init_Drawer = __esm(() => {
1579
1735
  return root && root.querySelector(".above-fold") || null;
1580
1736
  }
1581
1737
  getVisibleVh() {
1582
- const h5 = (this.height || "").trim();
1583
- const m3 = h5.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1584
- if (m3)
1585
- return clamp(parseFloat(m3[1]), 0, 100);
1738
+ const h = (this.height || "").trim();
1739
+ const m = h.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1740
+ if (m)
1741
+ return clamp(parseFloat(m[1]), 0, 100);
1586
1742
  return DEFAULT_VISIBLE_VH;
1587
1743
  }
1588
1744
  getOpenTranslateRatio() {
@@ -1595,15 +1751,15 @@ var init_Drawer = __esm(() => {
1595
1751
  return;
1596
1752
  if (this.isDragging || this.pendingDrag)
1597
1753
  return;
1598
- const h5 = (this.height || "").trim();
1599
- const m3 = h5.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1600
- if (m3) {
1601
- const unit2 = (m3[2] || "vh").toLowerCase();
1602
- const visibleVh = clamp(parseFloat(m3[1]), 0, 100);
1603
- const pct2 = clamp(100 - visibleVh, 0, 100);
1604
- this.setCssVars({ "--w3a-drawer__sheet-height": `100${unit2}` });
1754
+ const h = (this.height || "").trim();
1755
+ const m = h.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
1756
+ if (m) {
1757
+ const unit = (m[2] || "vh").toLowerCase();
1758
+ const visibleVh = clamp(parseFloat(m[1]), 0, 100);
1759
+ const pct = clamp(100 - visibleVh, 0, 100);
1760
+ this.setCssVars({ "--w3a-drawer__sheet-height": `100${unit}` });
1605
1761
  if (!this.open) {
1606
- this.setCssVars({ "--w3a-drawer__open-translate": pct2 + "%" });
1762
+ this.setCssVars({ "--w3a-drawer__open-translate": pct + "%" });
1607
1763
  }
1608
1764
  return;
1609
1765
  }
@@ -1636,16 +1792,6 @@ var init_Drawer = __esm(() => {
1636
1792
  this._performSyncCssVarsForOpenTranslate();
1637
1793
  });
1638
1794
  }
1639
- handleTransitionEnd = (e6) => {
1640
- if (!this.drawerElement)
1641
- return;
1642
- if (e6.target !== this.drawerElement)
1643
- return;
1644
- if (e6.propertyName !== "transform")
1645
- return;
1646
- const type = this.open ? "w3a:drawer-open-end" : "w3a:drawer-close-end";
1647
- this.dispatchEvent(new CustomEvent(type, { bubbles: true, composed: true }));
1648
- };
1649
1795
  setupAnimateWithContentSync() {
1650
1796
  const root = this.renderRoot;
1651
1797
  const host = root.querySelector(".drawer");
@@ -1670,12 +1816,12 @@ var init_Drawer = __esm(() => {
1670
1816
  };
1671
1817
  const syncTimingFromElement = (el) => {
1672
1818
  const cs = getComputedStyle(el);
1673
- const props = (cs.transitionProperty || "").split(",").map((s6) => s6.trim());
1674
- const durations = (cs.transitionDuration || "").split(",").map((s6) => s6.trim());
1675
- const easings = (cs.transitionTimingFunction || "").split(",").map((s6) => s6.trim());
1676
- let idx = props.findIndex((p4) => p4 === "height");
1819
+ const props = (cs.transitionProperty || "").split(",").map((s) => s.trim());
1820
+ const durations = (cs.transitionDuration || "").split(",").map((s) => s.trim());
1821
+ const easings = (cs.transitionTimingFunction || "").split(",").map((s) => s.trim());
1822
+ let idx = props.findIndex((p) => p === "height");
1677
1823
  if (idx < 0)
1678
- idx = props.findIndex((p4) => p4 === "all");
1824
+ idx = props.findIndex((p) => p === "all");
1679
1825
  if (idx < 0)
1680
1826
  idx = 0;
1681
1827
  const dur = durations[Math.min(idx, durations.length - 1)] || "100ms";
@@ -1686,28 +1832,28 @@ var init_Drawer = __esm(() => {
1686
1832
  });
1687
1833
  };
1688
1834
  const onRun = (ev) => {
1689
- const e6 = ev;
1835
+ const e = ev;
1690
1836
  if (!this.open)
1691
1837
  return;
1692
- if (e6.propertyName !== "height")
1838
+ if (e.propertyName !== "height")
1693
1839
  return;
1694
1840
  this._activeHeightTransitions++;
1695
1841
  ensureLoop();
1696
1842
  };
1697
1843
  const onStart = (ev) => {
1698
- const e6 = ev;
1844
+ const e = ev;
1699
1845
  if (!this.open)
1700
1846
  return;
1701
- if (e6.propertyName !== "height")
1847
+ if (e.propertyName !== "height")
1702
1848
  return;
1703
- if (e6.target && e6.target instanceof Element)
1704
- syncTimingFromElement(e6.target);
1849
+ if (e.target && e.target instanceof Element)
1850
+ syncTimingFromElement(e.target);
1705
1851
  this._activeHeightTransitions++;
1706
1852
  ensureLoop();
1707
1853
  };
1708
1854
  const onEnd = (ev) => {
1709
- const e6 = ev;
1710
- if (e6.propertyName !== "height")
1855
+ const e = ev;
1856
+ if (e.propertyName !== "height")
1711
1857
  return;
1712
1858
  this._activeHeightTransitions = Math.max(0, this._activeHeightTransitions - 1);
1713
1859
  if (this._activeHeightTransitions === 0)
@@ -1803,118 +1949,10 @@ var init_Drawer = __esm(() => {
1803
1949
  document.removeEventListener("pointerup", this.handlePointerUp);
1804
1950
  document.removeEventListener("pointercancel", this.handlePointerCancel);
1805
1951
  }
1806
- handlePointerDown = (e6) => {
1807
- if (this.loading || !this.open)
1808
- return;
1809
- if (e6.pointerType === "mouse" && e6.button !== 0)
1810
- return;
1811
- this.pendingDrag = true;
1812
- this.startY = e6.clientY;
1813
- this.currentY = e6.clientY;
1814
- this.dragStartTime = Date.now();
1815
- };
1816
- handlePointerMove = (e6) => {
1817
- if (!this.pendingDrag && !this.isDragging)
1818
- return;
1819
- const y3 = e6.clientY;
1820
- if (this.pendingDrag) {
1821
- const dy = y3 - this.startY;
1822
- const absDy = Math.abs(dy);
1823
- const ACTIVATE_PX = 8;
1824
- const body = this.bodyElement;
1825
- const atTop = !body || body.scrollTop <= 0;
1826
- if (absDy >= ACTIVATE_PX && atTop) {
1827
- this.pendingDrag = false;
1828
- this.startDrag(this.startY);
1829
- e6.target?.setPointerCapture?.(e6.pointerId);
1830
- } else {
1831
- return;
1832
- }
1833
- }
1834
- if (this.isDragging) {
1835
- this.updateDrag(y3);
1836
- e6.preventDefault();
1837
- }
1838
- };
1839
- handlePointerUp = (e6) => {
1840
- if (this.pendingDrag) {
1841
- this.pendingDrag = false;
1842
- }
1843
- if (this.isDragging) {
1844
- this.endDrag();
1845
- e6.preventDefault();
1846
- }
1847
- e6.target?.releasePointerCapture?.(e6.pointerId);
1848
- };
1849
- handlePointerCancel = (e6) => {
1850
- if (this.pendingDrag)
1851
- this.pendingDrag = false;
1852
- if (this.isDragging)
1853
- this.endDrag();
1854
- e6.target?.releasePointerCapture?.(e6.pointerId);
1855
- };
1856
- handleTouchStart = (e6) => {
1857
- if (this.loading || !this.open)
1858
- return;
1859
- const target = e6.target;
1860
- if (target && target.closest && target.closest(".close-btn")) {
1861
- return;
1862
- }
1863
- const touch = e6.touches[0];
1864
- this.pendingDrag = true;
1865
- this.startY = touch.clientY;
1866
- this.currentY = touch.clientY;
1867
- };
1868
- handleTouchMove = (e6) => {
1869
- const touch = e6.touches[0];
1870
- if (this.pendingDrag && !this.isDragging) {
1871
- const dy = touch.clientY - this.startY;
1872
- const absDy = Math.abs(dy);
1873
- const ACTIVATE_PX = 8;
1874
- const body = this.bodyElement;
1875
- const atTop = !body || body.scrollTop <= 0;
1876
- if (absDy >= ACTIVATE_PX) {
1877
- if (atTop) {
1878
- this.startDrag(this.startY);
1879
- this.isDragging = true;
1880
- this.pendingDrag = false;
1881
- } else {}
1882
- }
1883
- }
1884
- if (!this.isDragging)
1885
- return;
1886
- this.updateDrag(touch.clientY);
1887
- e6.preventDefault();
1888
- };
1889
- handleTouchEnd = (e6) => {
1890
- this.pendingDrag = false;
1891
- if (!this.isDragging)
1892
- return;
1893
- this.endDrag();
1894
- e6.preventDefault();
1895
- };
1896
- handleMouseDown = (e6) => {
1897
- if (this.loading || !this.open)
1898
- return;
1899
- this.startDrag(e6.clientY);
1900
- e6.preventDefault();
1901
- };
1902
- handleMouseMove = (e6) => {
1903
- if (!this.isDragging)
1904
- return;
1905
- this.updateDrag(e6.clientY);
1906
- e6.preventDefault();
1907
- };
1908
- handleMouseUp = (e6) => {
1909
- if (!this.isDragging)
1910
- return;
1911
- this.endDrag();
1912
- e6.preventDefault();
1913
- };
1914
- startDrag(y3) {
1952
+ startDrag(y) {
1915
1953
  this.isDragging = true;
1916
- this.startY = y3;
1917
- this.currentY = y3;
1954
+ this.startY = y;
1955
+ this.currentY = y;
1918
1956
  this.dragDistance = 0;
1919
1957
  this.dragStartTime = Date.now();
1920
1958
  this.lastDragTime = this.dragStartTime;
@@ -1935,17 +1973,17 @@ var init_Drawer = __esm(() => {
1935
1973
  this.drawerElement.classList.add("dragging");
1936
1974
  }
1937
1975
  }
1938
- updateDrag(y3) {
1976
+ updateDrag(y) {
1939
1977
  if (!this.isDragging || !this.drawerElement)
1940
1978
  return;
1941
1979
  const now = Date.now();
1942
1980
  const deltaTime = now - this.lastDragTime;
1943
- const deltaY = y3 - this.currentY;
1981
+ const deltaY = y - this.currentY;
1944
1982
  if (deltaTime > 0) {
1945
1983
  this.velocity = deltaY / deltaTime;
1946
1984
  }
1947
- this.currentY = y3;
1948
- this.dragDistance = y3 - this.startY;
1985
+ this.currentY = y;
1986
+ this.dragDistance = y - this.startY;
1949
1987
  const viewportHalf = typeof window !== "undefined" && window.innerHeight ? window.innerHeight * OVERPULL_VIEWPORT_FACTOR : 0;
1950
1988
  const maxOverdragUpPx = Math.max(this.drawerHeight * OVERPULL_SHEET_FACTOR, viewportHalf, this.overpullPx);
1951
1989
  const rawTargetTranslateY = this.startTranslateYPx + this.dragDistance;
@@ -1999,11 +2037,11 @@ var init_Drawer = __esm(() => {
1999
2037
  if (!transform || transform === "none")
2000
2038
  return NaN;
2001
2039
  if (transform.startsWith("matrix(")) {
2002
- const values = transform.slice(7, -1).split(",").map((v3) => parseFloat(v3.trim()));
2040
+ const values = transform.slice(7, -1).split(",").map((v) => parseFloat(v.trim()));
2003
2041
  return values.length === 6 ? values[5] : NaN;
2004
2042
  }
2005
2043
  if (transform.startsWith("matrix3d(")) {
2006
- const values = transform.slice(9, -1).split(",").map((v3) => parseFloat(v3.trim()));
2044
+ const values = transform.slice(9, -1).split(",").map((v) => parseFloat(v.trim()));
2007
2045
  return values.length === 16 ? values[13] : NaN;
2008
2046
  }
2009
2047
  const match = transform.match(/translateY\(([-\d.]+)px\)/);
@@ -2024,28 +2062,6 @@ var init_Drawer = __esm(() => {
2024
2062
  this.isClosing = false;
2025
2063
  }, 300);
2026
2064
  }
2027
- onClose = () => {
2028
- if (this.loading)
2029
- return;
2030
- if (this.isClosing)
2031
- return;
2032
- if (this.drawerElement) {
2033
- this.drawerElement.classList.remove("dragging");
2034
- }
2035
- this.open = false;
2036
- dispatchLitCancel(this);
2037
- this.isClosing = true;
2038
- setTimeout(() => {
2039
- this.isClosing = false;
2040
- }, 300);
2041
- };
2042
- onHandleClick = () => {
2043
- if (!this.open) {
2044
- this.show();
2045
- } else {
2046
- this.hide("handle");
2047
- }
2048
- };
2049
2065
  show() {
2050
2066
  if (this.drawerElement) {
2051
2067
  this.drawerElement.classList.remove("dragging");
@@ -2095,11 +2111,6 @@ var init_Drawer = __esm(() => {
2095
2111
  </section>
2096
2112
  `;
2097
2113
  }
2098
- onOverlayClick = () => {
2099
- if (!this.closeOnOverlayClick)
2100
- return;
2101
- this.onClose();
2102
- };
2103
2114
  };
2104
2115
  Drawer_default = function ensureDefined() {
2105
2116
  const TAG = W3A_DRAWER_ID;
@@ -2179,7 +2190,7 @@ function renderCopyStatusIcon() {
2179
2190
  function settlingState(state, maskedTarget, startedAtMs) {
2180
2191
  const prefix = maskedTarget.startsWith(state.prefix) ? state.prefix : "";
2181
2192
  const targetSlots = Array.from(maskedTarget.slice(prefix.length));
2182
- const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((_2, index) => ({
2193
+ const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((_, index) => ({
2183
2194
  glyph: randomReelGlyph(state.alphabet),
2184
2195
  nextChangeAtMs: startedAtMs + index * 37 % 90
2185
2196
  }));
@@ -2305,15 +2316,38 @@ var init_viewer = __esm(() => {
2305
2316
  errorMessage: { type: String },
2306
2317
  showCloseButton: { type: Boolean, attribute: "show-close-button" }
2307
2318
  };
2308
- copiedFields = new Set;
2309
- copyTimers = new Map;
2310
- revealStates = new Map;
2311
- revealAnimationFrame = null;
2312
- _stylesReady = false;
2313
- _stylePromises = [];
2314
- _stylesAwaiting = null;
2315
2319
  constructor() {
2316
2320
  super();
2321
+ this.copiedFields = new Set;
2322
+ this.copyTimers = new Map;
2323
+ this.revealStates = new Map;
2324
+ this.revealAnimationFrame = null;
2325
+ this._stylesReady = false;
2326
+ this._stylePromises = [];
2327
+ this._stylesAwaiting = null;
2328
+ this.onRevealAnimationFrame = (now) => {
2329
+ this.revealAnimationFrame = null;
2330
+ if (this.ownerDocument?.hidden) {
2331
+ this.scheduleRevealAnimation();
2332
+ return;
2333
+ }
2334
+ let changed = false;
2335
+ for (const [entryKey, state] of this.revealStates) {
2336
+ if (state.kind === "settled")
2337
+ continue;
2338
+ const nextState = advanceRevealState(state, now);
2339
+ if (nextState !== state) {
2340
+ this.revealStates.set(entryKey, nextState);
2341
+ changed = true;
2342
+ }
2343
+ }
2344
+ if (changed)
2345
+ this.requestUpdate();
2346
+ this.scheduleRevealAnimation();
2347
+ };
2348
+ this._stopDragStart = (e) => {
2349
+ e.stopPropagation();
2350
+ };
2317
2351
  this.theme = "dark";
2318
2352
  this.variant = "drawer";
2319
2353
  this.keys = undefined;
@@ -2325,27 +2359,27 @@ var init_viewer = __esm(() => {
2325
2359
  return "export";
2326
2360
  }
2327
2361
  createRenderRoot() {
2328
- const supportsConstructable2 = typeof ShadowRoot !== "undefined" && "adoptedStyleSheets" in ShadowRoot.prototype && typeof CSSStyleSheet !== "undefined" && "replaceSync" in CSSStyleSheet.prototype;
2329
- const root = supportsConstructable2 ? super.createRenderRoot() : this;
2362
+ const supportsConstructable = typeof ShadowRoot !== "undefined" && "adoptedStyleSheets" in ShadowRoot.prototype && typeof CSSStyleSheet !== "undefined" && "replaceSync" in CSSStyleSheet.prototype;
2363
+ const root = supportsConstructable ? super.createRenderRoot() : this;
2330
2364
  const p1 = ensureExternalStyles(root, "export-viewer.css", "data-w3a-export-viewer-css");
2331
2365
  this._stylePromises.push(p1);
2332
2366
  p1.catch(() => {});
2333
2367
  const pCopyIcon = ensureExternalStyles(root, "copy-icon.css", "data-w3a-copy-icon-css");
2334
2368
  this._stylePromises.push(pCopyIcon);
2335
2369
  pCopyIcon.catch(() => {});
2336
- const p22 = ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css");
2337
- this._stylePromises.push(p22);
2338
- p22.catch(() => {});
2339
- const p32 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
2340
- this._stylePromises.push(p32);
2341
- p32.catch(() => {});
2370
+ const p2 = ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css");
2371
+ this._stylePromises.push(p2);
2372
+ p2.catch(() => {});
2373
+ const p3 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
2374
+ this._stylePromises.push(p3);
2375
+ p3.catch(() => {});
2342
2376
  return root;
2343
2377
  }
2344
2378
  shouldUpdate(_changed) {
2345
2379
  if (this._stylesReady)
2346
2380
  return true;
2347
2381
  if (!this._stylesAwaiting) {
2348
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
2382
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
2349
2383
  this._stylesAwaiting = settle.then(() => {
2350
2384
  this._stylesReady = true;
2351
2385
  this.requestUpdate();
@@ -2380,26 +2414,6 @@ var init_viewer = __esm(() => {
2380
2414
  this.resetRevealStates();
2381
2415
  super.disconnectedCallback();
2382
2416
  }
2383
- onRevealAnimationFrame = (now) => {
2384
- this.revealAnimationFrame = null;
2385
- if (this.ownerDocument?.hidden) {
2386
- this.scheduleRevealAnimation();
2387
- return;
2388
- }
2389
- let changed = false;
2390
- for (const [entryKey, state] of this.revealStates) {
2391
- if (state.kind === "settled")
2392
- continue;
2393
- const nextState = advanceRevealState(state, now);
2394
- if (nextState !== state) {
2395
- this.revealStates.set(entryKey, nextState);
2396
- changed = true;
2397
- }
2398
- }
2399
- if (changed)
2400
- this.requestUpdate();
2401
- this.scheduleRevealAnimation();
2402
- };
2403
2417
  scheduleRevealAnimation() {
2404
2418
  if (this.revealAnimationFrame !== null || prefersReducedMotion(this.ownerDocument))
2405
2419
  return;
@@ -2456,9 +2470,6 @@ var init_viewer = __esm(() => {
2456
2470
  }
2457
2471
  this.scheduleRevealAnimation();
2458
2472
  }
2459
- _stopDragStart = (e6) => {
2460
- e6.stopPropagation();
2461
- };
2462
2473
  updateTheme() {
2463
2474
  try {
2464
2475
  const docEl = this.ownerDocument?.documentElement;
@@ -2506,8 +2517,8 @@ var init_viewer = __esm(() => {
2506
2517
  }
2507
2518
  this.markCopied(index, type);
2508
2519
  this.requestUpdate();
2509
- } catch (e6) {
2510
- console.warn("Copy failed", e6);
2520
+ } catch (e) {
2521
+ console.warn("Copy failed", e);
2511
2522
  }
2512
2523
  }
2513
2524
  copyViaTextareaFallback(text) {
@@ -2560,9 +2571,9 @@ var init_viewer = __esm(() => {
2560
2571
  const provided = Array.isArray(this.keys) ? this.keys.filter((item) => {
2561
2572
  if (!item || typeof item !== "object")
2562
2573
  return false;
2563
- const publicKey2 = String(item.publicKey || "").trim();
2564
- const privateKey2 = String(item.privateKey || "").trim();
2565
- return !!publicKey2 || !!privateKey2;
2574
+ const publicKey = String(item.publicKey || "").trim();
2575
+ const privateKey = String(item.privateKey || "").trim();
2576
+ return !!publicKey || !!privateKey;
2566
2577
  }) : [];
2567
2578
  if (provided.length > 0)
2568
2579
  return provided;
@@ -2705,8 +2716,8 @@ function declarationsToCssText(selector, declarations) {
2705
2716
  function getDefaultCspNonce() {
2706
2717
  if (typeof window === "undefined")
2707
2718
  return;
2708
- const w2 = window;
2709
- return w2.w3aNonce || w2.litNonce || undefined;
2719
+ const w = window;
2720
+ return w.w3aNonce || w.litNonce || undefined;
2710
2721
  }
2711
2722
  function createCspStylesheetManager(opts) {
2712
2723
  const { doc, baseCss, baseStyleDataAttr, dynamicStyleDataAttr, nonce } = opts;
@@ -2725,7 +2736,7 @@ function createCspStylesheetManager(opts) {
2725
2736
  return;
2726
2737
  return typeof nonce === "function" ? nonce() : nonce;
2727
2738
  };
2728
- const supportsConstructable2 = () => {
2739
+ const supportsConstructable = () => {
2729
2740
  if (state.supportConstructable != null)
2730
2741
  return state.supportConstructable;
2731
2742
  state.supportConstructable = typeof CSSStyleSheet !== "undefined" && "adoptedStyleSheets" in doc;
@@ -2765,7 +2776,7 @@ function createCspStylesheetManager(opts) {
2765
2776
  const ensureBase = () => {
2766
2777
  if (state.baseSheet || state.baseStyleEl)
2767
2778
  return;
2768
- if (supportsConstructable2()) {
2779
+ if (supportsConstructable()) {
2769
2780
  try {
2770
2781
  state.baseSheet = new CSSStyleSheet;
2771
2782
  state.baseSheet.replaceSync(baseCss);
@@ -2783,7 +2794,7 @@ function createCspStylesheetManager(opts) {
2783
2794
  const buildDynamicCss = () => Array.from(state.rules.values()).join(`
2784
2795
  `);
2785
2796
  const ensureDynamic = () => {
2786
- if (supportsConstructable2()) {
2797
+ if (supportsConstructable()) {
2787
2798
  if (!state.dynamicSheet) {
2788
2799
  state.dynamicSheet = new CSSStyleSheet;
2789
2800
  adoptSheets([state.dynamicSheet]);
@@ -2798,7 +2809,7 @@ function createCspStylesheetManager(opts) {
2798
2809
  };
2799
2810
  const syncDynamic = () => {
2800
2811
  const css = buildDynamicCss();
2801
- if (supportsConstructable2()) {
2812
+ if (supportsConstructable()) {
2802
2813
  try {
2803
2814
  ensureDynamic();
2804
2815
  state.dynamicSheet?.replaceSync(css);
@@ -2817,7 +2828,7 @@ function createCspStylesheetManager(opts) {
2817
2828
  const existing = state.declarationRules.get(id);
2818
2829
  if (existing && existing.selector === selector)
2819
2830
  return existing.rule;
2820
- if (!supportsConstructable2())
2831
+ if (!supportsConstructable())
2821
2832
  return null;
2822
2833
  try {
2823
2834
  if (!state.declarationSheet) {
@@ -2826,9 +2837,9 @@ function createCspStylesheetManager(opts) {
2826
2837
  }
2827
2838
  const sheet = state.declarationSheet;
2828
2839
  if (existing) {
2829
- const index2 = Array.prototype.indexOf.call(sheet.cssRules, existing.rule);
2830
- if (index2 >= 0)
2831
- sheet.deleteRule(index2);
2840
+ const index = Array.prototype.indexOf.call(sheet.cssRules, existing.rule);
2841
+ if (index >= 0)
2842
+ sheet.deleteRule(index);
2832
2843
  state.declarationRules.delete(id);
2833
2844
  }
2834
2845
  const index = sheet.insertRule(`${selector}{}`, sheet.cssRules.length);
@@ -2918,8 +2929,8 @@ function createCspStylesheetManager(opts) {
2918
2929
  // src/core/signingEngine/uiConfirm/ui/lit-components/ExportPrivateKey/iframe-host.ts
2919
2930
  var exports_iframe_host = {};
2920
2931
  __export(exports_iframe_host, {
2921
- default: () => iframe_host_default,
2922
- IframeExportHost: () => IframeExportHost
2932
+ IframeExportHost: () => IframeExportHost,
2933
+ default: () => iframe_host_default
2923
2934
  });
2924
2935
  function getExportTokenStyleManager() {
2925
2936
  if (!exportTokenStyleManager) {
@@ -2936,9 +2947,9 @@ function toStringRecord(value) {
2936
2947
  if (!value || typeof value !== "object")
2937
2948
  return {};
2938
2949
  const out = {};
2939
- for (const [k2, v3] of Object.entries(value)) {
2940
- if (typeof v3 === "string")
2941
- out[k2] = v3;
2950
+ for (const [k, v] of Object.entries(value)) {
2951
+ if (typeof v === "string")
2952
+ out[k] = v;
2942
2953
  }
2943
2954
  return out;
2944
2955
  }
@@ -3020,13 +3031,13 @@ var init_iframe_host = __esm(() => {
3020
3031
  errorMessage: { type: String },
3021
3032
  surface: { type: String, attribute: "data-w3a-export-surface", reflect: false }
3022
3033
  };
3023
- drawerEl = null;
3024
- viewerEl = null;
3025
- openFrame = null;
3026
- stylesReady = false;
3027
- stylePromise = null;
3028
3034
  constructor() {
3029
3035
  super();
3036
+ this.drawerEl = null;
3037
+ this.viewerEl = null;
3038
+ this.openFrame = null;
3039
+ this.stylesReady = false;
3040
+ this.stylePromise = null;
3030
3041
  this.theme = "dark";
3031
3042
  this.variant = "drawer";
3032
3043
  this.accountId = "";
@@ -3247,13 +3258,98 @@ var init_viewer2 = __esm(() => {
3247
3258
  statusMessage: { state: true },
3248
3259
  copied: { state: true }
3249
3260
  };
3250
- experience = { kind: "unconfigured" };
3251
- loadGeneration = 0;
3252
- copiedResetTimer = null;
3253
- stylesReady = false;
3254
- stylePromise = null;
3255
3261
  constructor() {
3256
3262
  super();
3263
+ this.experience = { kind: "unconfigured" };
3264
+ this.loadGeneration = 0;
3265
+ this.copiedResetTimer = null;
3266
+ this.stylesReady = false;
3267
+ this.stylePromise = null;
3268
+ this.retryStatus = () => {
3269
+ if (this.experience.kind !== "account_menu")
3270
+ return;
3271
+ const generation = this.loadGeneration + 1;
3272
+ this.loadGeneration = generation;
3273
+ const current = this.viewState;
3274
+ if (current.kind !== "summary")
3275
+ return;
3276
+ this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
3277
+ this.loadSummaryStatus(this.experience, generation);
3278
+ };
3279
+ this.openRecoveryCodes = async () => {
3280
+ if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
3281
+ return;
3282
+ const generation = this.loadGeneration;
3283
+ const summary = this.viewState;
3284
+ this.viewState = { ...summary, kind: "opening", actionError: null };
3285
+ try {
3286
+ const request = await this.experience.loadPendingBackup();
3287
+ if (generation !== this.loadGeneration)
3288
+ return;
3289
+ if (!request) {
3290
+ this.viewState = {
3291
+ ...summary,
3292
+ actionError: "Recovery codes are no longer available on this device."
3293
+ };
3294
+ return;
3295
+ }
3296
+ this.viewState = { kind: "recovery_codes", request };
3297
+ await this.updateComplete;
3298
+ await new Promise(requestAnimationFrame);
3299
+ this.querySelector("#w3a-wallet-recovery-title")?.focus();
3300
+ } catch (error) {
3301
+ if (generation !== this.loadGeneration)
3302
+ return;
3303
+ this.viewState = {
3304
+ ...summary,
3305
+ actionError: errorMessage(error, "Could not open recovery codes")
3306
+ };
3307
+ }
3308
+ };
3309
+ this.closeSummary = () => {
3310
+ this.dispatchClose({ kind: "dismissed" });
3311
+ };
3312
+ this.download = () => {
3313
+ if (this.viewState.kind !== "recovery_codes")
3314
+ return;
3315
+ const { walletId, recoveryCodes } = this.viewState.request;
3316
+ try {
3317
+ const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
3318
+ type: "text/plain;charset=utf-8"
3319
+ }));
3320
+ const anchor = document.createElement("a");
3321
+ anchor.href = url;
3322
+ anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
3323
+ try {
3324
+ anchor.click();
3325
+ } finally {
3326
+ window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
3327
+ }
3328
+ this.statusMessage = "Recovery codes downloaded.";
3329
+ } catch {
3330
+ this.statusMessage = "Unable to download the codes. Copy them or try again.";
3331
+ }
3332
+ };
3333
+ this.copy = async () => {
3334
+ if (this.viewState.kind !== "recovery_codes")
3335
+ return;
3336
+ const { walletId, recoveryCodes } = this.viewState.request;
3337
+ try {
3338
+ await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
3339
+ this.statusMessage = "Recovery codes copied.";
3340
+ this.flashCopied();
3341
+ } catch {
3342
+ this.statusMessage = "Unable to copy the codes. Download them or try again.";
3343
+ }
3344
+ };
3345
+ this.onAcknowledgementChange = (event) => {
3346
+ const input = event.target;
3347
+ if (input instanceof HTMLInputElement)
3348
+ this.acknowledged = input.checked;
3349
+ };
3350
+ this.closeRecoveryCodes = () => {
3351
+ this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
3352
+ };
3257
3353
  this.viewState = { kind: "unconfigured" };
3258
3354
  this.acknowledged = false;
3259
3355
  this.statusMessage = "";
@@ -3379,50 +3475,6 @@ var init_viewer2 = __esm(() => {
3379
3475
  assertNever2(this.viewState);
3380
3476
  }
3381
3477
  }
3382
- retryStatus = () => {
3383
- if (this.experience.kind !== "account_menu")
3384
- return;
3385
- const generation = this.loadGeneration + 1;
3386
- this.loadGeneration = generation;
3387
- const current = this.viewState;
3388
- if (current.kind !== "summary")
3389
- return;
3390
- this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
3391
- this.loadSummaryStatus(this.experience, generation);
3392
- };
3393
- openRecoveryCodes = async () => {
3394
- if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
3395
- return;
3396
- const generation = this.loadGeneration;
3397
- const summary = this.viewState;
3398
- this.viewState = { ...summary, kind: "opening", actionError: null };
3399
- try {
3400
- const request = await this.experience.loadPendingBackup();
3401
- if (generation !== this.loadGeneration)
3402
- return;
3403
- if (!request) {
3404
- this.viewState = {
3405
- ...summary,
3406
- actionError: "Recovery codes are no longer available on this device."
3407
- };
3408
- return;
3409
- }
3410
- this.viewState = { kind: "recovery_codes", request };
3411
- await this.updateComplete;
3412
- await new Promise(requestAnimationFrame);
3413
- this.querySelector("#w3a-wallet-recovery-title")?.focus();
3414
- } catch (error) {
3415
- if (generation !== this.loadGeneration)
3416
- return;
3417
- this.viewState = {
3418
- ...summary,
3419
- actionError: errorMessage(error, "Could not open recovery codes")
3420
- };
3421
- }
3422
- };
3423
- closeSummary = () => {
3424
- this.dispatchClose({ kind: "dismissed" });
3425
- };
3426
3478
  dispatchClose(detail) {
3427
3479
  this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CLOSE_EVENT, {
3428
3480
  detail,
@@ -3430,39 +3482,6 @@ var init_viewer2 = __esm(() => {
3430
3482
  composed: true
3431
3483
  }));
3432
3484
  }
3433
- download = () => {
3434
- if (this.viewState.kind !== "recovery_codes")
3435
- return;
3436
- const { walletId, recoveryCodes } = this.viewState.request;
3437
- try {
3438
- const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
3439
- type: "text/plain;charset=utf-8"
3440
- }));
3441
- const anchor = document.createElement("a");
3442
- anchor.href = url;
3443
- anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
3444
- try {
3445
- anchor.click();
3446
- } finally {
3447
- window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
3448
- }
3449
- this.statusMessage = "Recovery codes downloaded.";
3450
- } catch {
3451
- this.statusMessage = "Unable to download the codes. Copy them or try again.";
3452
- }
3453
- };
3454
- copy = async () => {
3455
- if (this.viewState.kind !== "recovery_codes")
3456
- return;
3457
- const { walletId, recoveryCodes } = this.viewState.request;
3458
- try {
3459
- await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
3460
- this.statusMessage = "Recovery codes copied.";
3461
- this.flashCopied();
3462
- } catch {
3463
- this.statusMessage = "Unable to copy the codes. Download them or try again.";
3464
- }
3465
- };
3466
3485
  flashCopied() {
3467
3486
  if (this.copiedResetTimer !== null)
3468
3487
  window.clearTimeout(this.copiedResetTimer);
@@ -3472,14 +3491,6 @@ var init_viewer2 = __esm(() => {
3472
3491
  this.copied = false;
3473
3492
  }, COPIED_FLASH_MS);
3474
3493
  }
3475
- onAcknowledgementChange = (event) => {
3476
- const input = event.target;
3477
- if (input instanceof HTMLInputElement)
3478
- this.acknowledged = input.checked;
3479
- };
3480
- closeRecoveryCodes = () => {
3481
- this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
3482
- };
3483
3494
  closeLabel(request) {
3484
3495
  if (this.acknowledged)
3485
3496
  return "Finish backup";
@@ -3627,8 +3638,8 @@ var init_viewer2 = __esm(() => {
3627
3638
  // src/core/signingEngine/uiConfirm/ui/lit-components/RecoveryCodeBackup/host.ts
3628
3639
  var exports_host = {};
3629
3640
  __export(exports_host, {
3630
- default: () => host_default,
3631
- RecoveryCodeBackupHost: () => RecoveryCodeBackupHost
3641
+ RecoveryCodeBackupHost: () => RecoveryCodeBackupHost,
3642
+ default: () => host_default
3632
3643
  });
3633
3644
  var RecoveryCodeBackupHost, host_default;
3634
3645
  var init_host = __esm(() => {
@@ -3644,24 +3655,22 @@ var init_host = __esm(() => {
3644
3655
  experience: { attribute: false },
3645
3656
  surface: { type: String }
3646
3657
  };
3647
- dialogEl = null;
3648
- viewerEl = null;
3649
- shown = false;
3650
- dialogShown;
3651
- resolveDialogShown;
3652
- handleCancel = (event) => {
3653
- event.preventDefault();
3654
- this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
3655
- };
3656
- handleStageChange = (event) => {
3657
- const dialog = event.currentTarget;
3658
- if (!(dialog instanceof HTMLDialogElement))
3659
- return;
3660
- const detail = event.detail;
3661
- dialog.dataset.w3aRecoveryStage = detail.stage;
3662
- };
3663
3658
  constructor() {
3664
3659
  super();
3660
+ this.dialogEl = null;
3661
+ this.viewerEl = null;
3662
+ this.shown = false;
3663
+ this.handleCancel = (event) => {
3664
+ event.preventDefault();
3665
+ this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
3666
+ };
3667
+ this.handleStageChange = (event) => {
3668
+ const dialog = event.currentTarget;
3669
+ if (!(dialog instanceof HTMLDialogElement))
3670
+ return;
3671
+ const detail = event.detail;
3672
+ dialog.dataset.w3aRecoveryStage = detail.stage;
3673
+ };
3665
3674
  this.experience = { kind: "unconfigured" };
3666
3675
  this.surface = "standalone";
3667
3676
  this.dialogShown = new Promise((resolve) => {
@@ -3751,44 +3760,44 @@ var init_registry = __esm(() => {
3751
3760
  });
3752
3761
 
3753
3762
  // ../shared-ts/src/near/actions.ts
3754
- function fromActionArgsWasm(a3) {
3755
- switch (a3.action_type) {
3763
+ function fromActionArgsWasm(a) {
3764
+ switch (a.action_type) {
3756
3765
  case "FunctionCall" /* FunctionCall */: {
3757
3766
  let parsedArgs = {};
3758
3767
  try {
3759
- parsedArgs = typeof a3.args === "string" ? a3.args ? JSON.parse(a3.args) : {} : a3.args || {};
3768
+ parsedArgs = typeof a.args === "string" ? a.args ? JSON.parse(a.args) : {} : a.args || {};
3760
3769
  } catch {
3761
3770
  parsedArgs = {};
3762
3771
  }
3763
3772
  return {
3764
3773
  type: "FunctionCall" /* FunctionCall */,
3765
- methodName: a3.method_name,
3774
+ methodName: a.method_name,
3766
3775
  args: parsedArgs,
3767
- gas: a3.gas,
3768
- deposit: a3.deposit
3776
+ gas: a.gas,
3777
+ deposit: a.deposit
3769
3778
  };
3770
3779
  }
3771
3780
  case "Transfer" /* Transfer */:
3772
- return { type: "Transfer" /* Transfer */, amount: a3.deposit };
3781
+ return { type: "Transfer" /* Transfer */, amount: a.deposit };
3773
3782
  case "CreateAccount" /* CreateAccount */:
3774
3783
  return { type: "CreateAccount" /* CreateAccount */ };
3775
3784
  case "DeployContract" /* DeployContract */:
3776
3785
  return {
3777
3786
  type: "DeployContract" /* DeployContract */,
3778
- code: Array.isArray(a3.code) ? new Uint8Array(a3.code) : new Uint8Array
3787
+ code: Array.isArray(a.code) ? new Uint8Array(a.code) : new Uint8Array
3779
3788
  };
3780
3789
  case "DeployGlobalContract" /* DeployGlobalContract */:
3781
3790
  return {
3782
3791
  type: "DeployGlobalContract" /* DeployGlobalContract */,
3783
- code: Array.isArray(a3.code) ? new Uint8Array(a3.code) : new Uint8Array,
3784
- deployMode: a3.deploy_mode
3792
+ code: Array.isArray(a.code) ? new Uint8Array(a.code) : new Uint8Array,
3793
+ deployMode: a.deploy_mode
3785
3794
  };
3786
3795
  case "Stake" /* Stake */:
3787
- return { type: "Stake" /* Stake */, stake: a3.stake, publicKey: a3.public_key };
3796
+ return { type: "Stake" /* Stake */, stake: a.stake, publicKey: a.public_key };
3788
3797
  case "AddKey" /* AddKey */: {
3789
3798
  let accessKey;
3790
3799
  try {
3791
- accessKey = JSON.parse(a3.access_key);
3800
+ accessKey = JSON.parse(a.access_key);
3792
3801
  } catch {
3793
3802
  accessKey = { nonce: BigInt(0), permission: "FullAccess" };
3794
3803
  }
@@ -3810,7 +3819,7 @@ function fromActionArgsWasm(a3) {
3810
3819
  }
3811
3820
  return {
3812
3821
  type: "AddKey" /* AddKey */,
3813
- publicKey: a3.public_key,
3822
+ publicKey: a.public_key,
3814
3823
  accessKey: {
3815
3824
  nonce: typeof accessKey?.nonce === "number" ? accessKey.nonce : 0,
3816
3825
  permission: normalizedPermission
@@ -3818,13 +3827,13 @@ function fromActionArgsWasm(a3) {
3818
3827
  };
3819
3828
  }
3820
3829
  case "DeleteKey" /* DeleteKey */:
3821
- return { type: "DeleteKey" /* DeleteKey */, publicKey: a3.public_key };
3830
+ return { type: "DeleteKey" /* DeleteKey */, publicKey: a.public_key };
3822
3831
  case "DeleteAccount" /* DeleteAccount */:
3823
- return { type: "DeleteAccount" /* DeleteAccount */, beneficiaryId: a3.beneficiary_id };
3832
+ return { type: "DeleteAccount" /* DeleteAccount */, beneficiaryId: a.beneficiary_id };
3824
3833
  case "UseGlobalContract" /* UseGlobalContract */:
3825
- return { type: "UseGlobalContract" /* UseGlobalContract */, accountId: a3.account_id, codeHash: a3.code_hash };
3834
+ return { type: "UseGlobalContract" /* UseGlobalContract */, accountId: a.account_id, codeHash: a.code_hash };
3826
3835
  default:
3827
- throw new Error(`Unsupported wasm action_type: ${a3?.action_type}`);
3836
+ throw new Error(`Unsupported wasm action_type: ${a?.action_type}`);
3828
3837
  }
3829
3838
  }
3830
3839
  function fromTransactionInputWasm(tx) {
@@ -3846,74 +3855,74 @@ var init_actions2 = __esm(() => {
3846
3855
  });
3847
3856
 
3848
3857
  // ../../node_modules/lit-html/directives/repeat.js
3849
- var u4 = (e6, s6, t5) => {
3850
- const r6 = new Map;
3851
- for (let l3 = s6;l3 <= t5; l3++)
3852
- r6.set(e6[l3], l3);
3853
- return r6;
3858
+ var u4 = (e, s, t) => {
3859
+ const r = new Map;
3860
+ for (let l = s;l <= t; l++)
3861
+ r.set(e[l], l);
3862
+ return r;
3854
3863
  }, c5;
3855
3864
  var init_repeat = __esm(() => {
3856
3865
  init_lit_html();
3857
3866
  init_directive();
3858
3867
  init_directive_helpers();
3859
3868
  c5 = e4(class extends i5 {
3860
- constructor(e6) {
3861
- if (super(e6), e6.type !== t4.CHILD)
3869
+ constructor(e) {
3870
+ if (super(e), e.type !== t4.CHILD)
3862
3871
  throw Error("repeat() can only be used in text expressions");
3863
3872
  }
3864
- dt(e6, s6, t5) {
3865
- let r6;
3866
- t5 === undefined ? t5 = s6 : s6 !== undefined && (r6 = s6);
3867
- const l3 = [], o7 = [];
3868
- let i6 = 0;
3869
- for (const s7 of e6)
3870
- l3[i6] = r6 ? r6(s7, i6) : i6, o7[i6] = t5(s7, i6), i6++;
3871
- return { values: o7, keys: l3 };
3872
- }
3873
- render(e6, s6, t5) {
3874
- return this.dt(e6, s6, t5).values;
3875
- }
3876
- update(s6, [t5, r6, c6]) {
3877
- const d3 = p3(s6), { values: p4, keys: a3 } = this.dt(t5, r6, c6);
3878
- if (!Array.isArray(d3))
3879
- return this.ut = a3, p4;
3880
- const h5 = this.ut ??= [], v3 = [];
3881
- let m3, y3, x2 = 0, j2 = d3.length - 1, k2 = 0, w2 = p4.length - 1;
3882
- for (;x2 <= j2 && k2 <= w2; )
3883
- if (d3[x2] === null)
3884
- x2++;
3885
- else if (d3[j2] === null)
3886
- j2--;
3887
- else if (h5[x2] === a3[k2])
3888
- v3[k2] = v2(d3[x2], p4[k2]), x2++, k2++;
3889
- else if (h5[j2] === a3[w2])
3890
- v3[w2] = v2(d3[j2], p4[w2]), j2--, w2--;
3891
- else if (h5[x2] === a3[w2])
3892
- v3[w2] = v2(d3[x2], p4[w2]), s4(s6, v3[w2 + 1], d3[x2]), x2++, w2--;
3893
- else if (h5[j2] === a3[k2])
3894
- v3[k2] = v2(d3[j2], p4[k2]), s4(s6, d3[x2], d3[j2]), j2--, k2++;
3895
- else if (m3 === undefined && (m3 = u4(a3, k2, w2), y3 = u4(h5, x2, j2)), m3.has(h5[x2]))
3896
- if (m3.has(h5[j2])) {
3897
- const e6 = y3.get(a3[k2]), t6 = e6 !== undefined ? d3[e6] : null;
3898
- if (t6 === null) {
3899
- const e7 = s4(s6, d3[x2]);
3900
- v2(e7, p4[k2]), v3[k2] = e7;
3873
+ dt(e, s, t) {
3874
+ let r;
3875
+ t === undefined ? t = s : s !== undefined && (r = s);
3876
+ const l = [], o = [];
3877
+ let i = 0;
3878
+ for (const s of e)
3879
+ l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
3880
+ return { values: o, keys: l };
3881
+ }
3882
+ render(e, s, t) {
3883
+ return this.dt(e, s, t).values;
3884
+ }
3885
+ update(s, [t, r, c]) {
3886
+ const d = p3(s), { values: p, keys: a } = this.dt(t, r, c);
3887
+ if (!Array.isArray(d))
3888
+ return this.ut = a, p;
3889
+ const h = this.ut ??= [], v = [];
3890
+ let m, y, x = 0, j = d.length - 1, k = 0, w = p.length - 1;
3891
+ for (;x <= j && k <= w; )
3892
+ if (d[x] === null)
3893
+ x++;
3894
+ else if (d[j] === null)
3895
+ j--;
3896
+ else if (h[x] === a[k])
3897
+ v[k] = v2(d[x], p[k]), x++, k++;
3898
+ else if (h[j] === a[w])
3899
+ v[w] = v2(d[j], p[w]), j--, w--;
3900
+ else if (h[x] === a[w])
3901
+ v[w] = v2(d[x], p[w]), s4(s, v[w + 1], d[x]), x++, w--;
3902
+ else if (h[j] === a[k])
3903
+ v[k] = v2(d[j], p[k]), s4(s, d[x], d[j]), j--, k++;
3904
+ else if (m === undefined && (m = u4(a, k, w), y = u4(h, x, j)), m.has(h[x]))
3905
+ if (m.has(h[j])) {
3906
+ const e = y.get(a[k]), t = e !== undefined ? d[e] : null;
3907
+ if (t === null) {
3908
+ const e = s4(s, d[x]);
3909
+ v2(e, p[k]), v[k] = e;
3901
3910
  } else
3902
- v3[k2] = v2(t6, p4[k2]), s4(s6, d3[x2], t6), d3[e6] = null;
3903
- k2++;
3911
+ v[k] = v2(t, p[k]), s4(s, d[x], t), d[e] = null;
3912
+ k++;
3904
3913
  } else
3905
- M2(d3[j2]), j2--;
3914
+ M2(d[j]), j--;
3906
3915
  else
3907
- M2(d3[x2]), x2++;
3908
- for (;k2 <= w2; ) {
3909
- const e6 = s4(s6, v3[w2 + 1]);
3910
- v2(e6, p4[k2]), v3[k2++] = e6;
3916
+ M2(d[x]), x++;
3917
+ for (;k <= w; ) {
3918
+ const e = s4(s, v[w + 1]);
3919
+ v2(e, p[k]), v[k++] = e;
3911
3920
  }
3912
- for (;x2 <= j2; ) {
3913
- const e6 = d3[x2++];
3914
- e6 !== null && M2(e6);
3921
+ for (;x <= j; ) {
3922
+ const e = d[x++];
3923
+ e !== null && M2(e);
3915
3924
  }
3916
- return this.ut = a3, m2(s6, v3), T;
3925
+ return this.ut = a, m2(s, v), T;
3917
3926
  }
3918
3927
  });
3919
3928
  });
@@ -4337,8 +4346,8 @@ var fromScale = (prefix, scale) => {
4337
4346
  if (!scale)
4338
4347
  return {};
4339
4348
  const out = {};
4340
- for (const k2 of Object.keys(scale))
4341
- out[`${prefix}${k2}`] = scale[k2];
4349
+ for (const k of Object.keys(scale))
4350
+ out[`${prefix}${k}`] = scale[k];
4342
4351
  return out;
4343
4352
  };
4344
4353
  var init_base_styles = () => {};
@@ -4593,7 +4602,7 @@ function formatArgs(args) {
4593
4602
  if (typeof args === "string")
4594
4603
  return args;
4595
4604
  try {
4596
- return JSON.stringify(args, (_k, v3) => typeof v3 === "bigint" ? v3.toString() : v3, 2);
4605
+ return JSON.stringify(args, (_k, v) => typeof v === "bigint" ? v.toString() : v, 2);
4597
4606
  } catch {
4598
4607
  return String(args);
4599
4608
  }
@@ -4668,49 +4677,126 @@ var init_TxTree = __esm(() => {
4668
4677
  init_registry();
4669
4678
  HEIGHT_DRIVEN_CLASSES = ["anim-h", "anim-h-active", "anim-h-driven"];
4670
4679
  TxTree = class TxTree extends LitElementWithProps {
4671
- static properties = {
4672
- node: { attribute: false },
4673
- depth: { type: Number, attribute: false },
4674
- styles: { attribute: false, state: true },
4675
- theme: { type: String, reflect: true },
4676
- appearance: { attribute: false },
4677
- width: { type: String },
4678
- shadowDom: { type: Boolean, attribute: "shadow-dom" },
4679
- nearExplorerUrl: { type: String, attribute: "near-explorer-url" },
4680
- tempoExplorerUrl: { type: String, attribute: "tempo-explorer-url" },
4681
- evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
4682
- showShadow: { type: Boolean, attribute: "show-shadow" }
4683
- };
4684
- node;
4685
- depth;
4686
- theme;
4687
- appearance;
4688
- class;
4689
- width;
4690
- shadowDom;
4691
- nearExplorerUrl;
4692
- tempoExplorerUrl;
4693
- evmExplorerUrl;
4694
- showShadow = true;
4695
- _copied = new Set;
4696
- _copyTimers = new Map;
4697
- _fileContentModes = new Map;
4698
- _animating = new WeakSet;
4699
- isCopied(id) {
4700
- return this._copied.has(id);
4701
- }
4702
- async handleCopyClick(e6, node) {
4703
- e6.stopPropagation();
4704
- const value = node.copyValue;
4705
- if (!value)
4706
- return;
4707
- try {
4708
- if (navigator.clipboard && navigator.clipboard.writeText) {
4709
- await navigator.clipboard.writeText(value);
4710
- } else {
4711
- const ta = document.createElement("textarea");
4712
- ta.value = value;
4713
- ta.setAttribute("readonly", "");
4680
+ constructor() {
4681
+ super(...arguments);
4682
+ this.showShadow = true;
4683
+ this._copied = new Set;
4684
+ this._copyTimers = new Map;
4685
+ this._fileContentModes = new Map;
4686
+ this._animating = new WeakSet;
4687
+ this.onFileContentToggleClick = (e, node) => {
4688
+ e.preventDefault();
4689
+ e.stopPropagation();
4690
+ if (!this.hasFileContentToggle(node))
4691
+ return;
4692
+ const shell = e.currentTarget?.closest(".file-content-shell") ?? null;
4693
+ const currentMode = this.resolveFileContentMode(node);
4694
+ const nextMode = currentMode === "decoded" ? "raw" : "decoded";
4695
+ const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
4696
+ if (shell) {
4697
+ shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
4698
+ this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
4699
+ }
4700
+ this._fileContentModes.set(node.id, nextMode);
4701
+ this.requestUpdate();
4702
+ if (!shell)
4703
+ return;
4704
+ this.updateComplete.then(() => {
4705
+ shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
4706
+ const toCssPx = shell.getBoundingClientRect().height;
4707
+ shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
4708
+ const claimed = announceClampedSurfaceResize({
4709
+ reason: `${node.id}:file-content-mode`,
4710
+ element: shell,
4711
+ drivenClasses: HEIGHT_DRIVEN_CLASSES,
4712
+ fromCssPx,
4713
+ toCssPx,
4714
+ setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
4715
+ });
4716
+ if (!claimed)
4717
+ shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
4718
+ });
4719
+ };
4720
+ this.onSummaryClick = (e) => {
4721
+ const summary = e.currentTarget;
4722
+ if (!summary)
4723
+ return;
4724
+ const path = typeof e.composedPath === "function" ? e.composedPath() : undefined;
4725
+ let clickedReceiverLink = null;
4726
+ if (Array.isArray(path)) {
4727
+ for (const t of path) {
4728
+ if (t instanceof Element && t.matches("a.highlight-receiver-id")) {
4729
+ clickedReceiverLink = t;
4730
+ break;
4731
+ }
4732
+ }
4733
+ } else {
4734
+ const target = e.target;
4735
+ clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
4736
+ }
4737
+ if (clickedReceiverLink) {
4738
+ e.preventDefault();
4739
+ e.stopPropagation();
4740
+ dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
4741
+ try {
4742
+ window.open(clickedReceiverLink.href, "_blank", "noopener");
4743
+ } catch {}
4744
+ return;
4745
+ }
4746
+ e.preventDefault();
4747
+ e.stopPropagation();
4748
+ const details = summary.closest("details");
4749
+ if (!details || this._animating.has(details))
4750
+ return;
4751
+ const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
4752
+ if (!body) {
4753
+ details.open = !details.open;
4754
+ this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
4755
+ return;
4756
+ }
4757
+ const reduceMotion = (() => {
4758
+ return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
4759
+ })();
4760
+ if (reduceMotion) {
4761
+ details.open = !details.open;
4762
+ this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
4763
+ return;
4764
+ }
4765
+ if (!details.open) {
4766
+ this.animateOpen(details, body);
4767
+ } else {
4768
+ this.animateClose(details, body);
4769
+ }
4770
+ };
4771
+ }
4772
+ static properties = {
4773
+ node: { attribute: false },
4774
+ depth: { type: Number, attribute: false },
4775
+ styles: { attribute: false, state: true },
4776
+ theme: { type: String, reflect: true },
4777
+ appearance: { attribute: false },
4778
+ width: { type: String },
4779
+ shadowDom: { type: Boolean, attribute: "shadow-dom" },
4780
+ nearExplorerUrl: { type: String, attribute: "near-explorer-url" },
4781
+ tempoExplorerUrl: { type: String, attribute: "tempo-explorer-url" },
4782
+ evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
4783
+ showShadow: { type: Boolean, attribute: "show-shadow" }
4784
+ };
4785
+ isCopied(id) {
4786
+ return this._copied.has(id);
4787
+ }
4788
+ async handleCopyClick(e, node) {
4789
+ e.stopPropagation();
4790
+ const value = node.copyValue;
4791
+ if (!value)
4792
+ return;
4793
+ try {
4794
+ if (navigator.clipboard && navigator.clipboard.writeText) {
4795
+ await navigator.clipboard.writeText(value);
4796
+ } else {
4797
+ const ta = document.createElement("textarea");
4798
+ ta.value = value;
4799
+ ta.setAttribute("readonly", "");
4714
4800
  ta.className = "w3a-offscreen";
4715
4801
  document.body.appendChild(ta);
4716
4802
  ta.select();
@@ -4762,94 +4848,10 @@ var init_TxTree = __esm(() => {
4762
4848
  const mode = this.resolveFileContentMode(node);
4763
4849
  return mode === "raw" ? variants.raw : variants.decoded;
4764
4850
  }
4765
- onFileContentToggleClick = (e6, node) => {
4766
- e6.preventDefault();
4767
- e6.stopPropagation();
4768
- if (!this.hasFileContentToggle(node))
4769
- return;
4770
- const shell = e6.currentTarget?.closest(".file-content-shell") ?? null;
4771
- const currentMode = this.resolveFileContentMode(node);
4772
- const nextMode = currentMode === "decoded" ? "raw" : "decoded";
4773
- const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
4774
- if (shell) {
4775
- shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
4776
- this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
4777
- }
4778
- this._fileContentModes.set(node.id, nextMode);
4779
- this.requestUpdate();
4780
- if (!shell)
4781
- return;
4782
- this.updateComplete.then(() => {
4783
- shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
4784
- const toCssPx = shell.getBoundingClientRect().height;
4785
- shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
4786
- const claimed = announceClampedSurfaceResize({
4787
- reason: `${node.id}:file-content-mode`,
4788
- element: shell,
4789
- drivenClasses: HEIGHT_DRIVEN_CLASSES,
4790
- fromCssPx,
4791
- toCssPx,
4792
- setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
4793
- });
4794
- if (!claimed)
4795
- shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
4796
- });
4797
- };
4798
4851
  handleToggle(detail) {
4799
4852
  dispatchLitTreeToggled(this);
4800
4853
  dispatchTxReviewToggleNode(this, detail);
4801
4854
  }
4802
- onSummaryClick = (e6) => {
4803
- const summary = e6.currentTarget;
4804
- if (!summary)
4805
- return;
4806
- const path = typeof e6.composedPath === "function" ? e6.composedPath() : undefined;
4807
- let clickedReceiverLink = null;
4808
- if (Array.isArray(path)) {
4809
- for (const t5 of path) {
4810
- if (t5 instanceof Element && t5.matches("a.highlight-receiver-id")) {
4811
- clickedReceiverLink = t5;
4812
- break;
4813
- }
4814
- }
4815
- } else {
4816
- const target = e6.target;
4817
- clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
4818
- }
4819
- if (clickedReceiverLink) {
4820
- e6.preventDefault();
4821
- e6.stopPropagation();
4822
- dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
4823
- try {
4824
- window.open(clickedReceiverLink.href, "_blank", "noopener");
4825
- } catch {}
4826
- return;
4827
- }
4828
- e6.preventDefault();
4829
- e6.stopPropagation();
4830
- const details = summary.closest("details");
4831
- if (!details || this._animating.has(details))
4832
- return;
4833
- const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
4834
- if (!body) {
4835
- details.open = !details.open;
4836
- this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
4837
- return;
4838
- }
4839
- const reduceMotion = (() => {
4840
- return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
4841
- })();
4842
- if (reduceMotion) {
4843
- details.open = !details.open;
4844
- this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
4845
- return;
4846
- }
4847
- if (!details.open) {
4848
- this.animateOpen(details, body);
4849
- } else {
4850
- this.animateClose(details, body);
4851
- }
4852
- };
4853
4855
  animateOpen(details, body) {
4854
4856
  this._animating.add(details);
4855
4857
  body.classList.add("anim-h", "anim-h-hold");
@@ -4945,9 +4947,9 @@ var init_TxTree = __esm(() => {
4945
4947
  }
4946
4948
  createRenderRoot() {
4947
4949
  if (this.shadowDom) {
4948
- const root2 = super.createRenderRoot();
4949
- ensureExternalStyles(root2, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
4950
- return root2;
4950
+ const root = super.createRenderRoot();
4951
+ ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
4952
+ return root;
4951
4953
  }
4952
4954
  ensureExternalStyles(this, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
4953
4955
  const root = this.getRootNode ? this.getRootNode() : null;
@@ -5003,7 +5005,7 @@ var init_TxTree = __esm(() => {
5003
5005
  }
5004
5006
  resolveContractExplorerHref(treeNode, contractAddress) {
5005
5007
  const chain = treeNode.chain;
5006
- const base2 = (() => {
5008
+ const base = (() => {
5007
5009
  if (chain === "tempo")
5008
5010
  return this.normalizeExplorerBase(this.tempoExplorerUrl);
5009
5011
  if (chain === "evm")
@@ -5012,9 +5014,9 @@ var init_TxTree = __esm(() => {
5012
5014
  return this.normalizeExplorerBase(this.nearExplorerUrl || "https://testnet.nearblocks.io");
5013
5015
  return;
5014
5016
  })();
5015
- if (!base2)
5017
+ if (!base)
5016
5018
  return;
5017
- return `${base2}/address/${encodeURIComponent(contractAddress)}`;
5019
+ return `${base}/address/${encodeURIComponent(contractAddress)}`;
5018
5020
  }
5019
5021
  renderContractTransactionLabel(treeNode) {
5020
5022
  const contractAddress = String(treeNode.contractAddress || "").trim();
@@ -5056,17 +5058,17 @@ var init_TxTree = __esm(() => {
5056
5058
  }
5057
5059
  renderLabelWithSelectiveHighlight(treeNode) {
5058
5060
  if (treeNode.action) {
5059
- const a3 = treeNode.action;
5060
- switch (a3.type) {
5061
+ const a = treeNode.action;
5062
+ switch (a.type) {
5061
5063
  case "FunctionCall": {
5062
- const method = a3.methodName;
5063
- const gasStr = formatGas(a3.gas);
5064
- const depositStr = formatDeposit(a3.deposit);
5064
+ const method = a.methodName;
5065
+ const gasStr = formatGas(a.gas);
5066
+ const depositStr = formatDeposit(a.deposit);
5065
5067
  return x`Calling <span class="highlight-method-name">${method}</span> ${depositStr !== "0 NEAR" ? x` with <span class="highlight-method-name">${depositStr}</span>` : ""}
5066
5068
  ${gasStr ? x` using <span class="highlight-method-name">${gasStr}</span>` : ""}`;
5067
5069
  }
5068
5070
  case "Transfer": {
5069
- const amount = formatDeposit(a3.amount);
5071
+ const amount = formatDeposit(a.amount);
5070
5072
  return x`Transfer <span class="highlight-amount">${amount}</span>`;
5071
5073
  }
5072
5074
  case "CreateAccount":
@@ -5074,26 +5076,26 @@ var init_TxTree = __esm(() => {
5074
5076
  case "DeleteAccount":
5075
5077
  return "Deleting Account";
5076
5078
  case "Stake":
5077
- return `Staking ${formatDeposit(a3.stake)}`;
5079
+ return `Staking ${formatDeposit(a.stake)}`;
5078
5080
  case "AddKey":
5079
5081
  return "Adding Key";
5080
5082
  case "DeleteKey":
5081
5083
  return "Deleting Key";
5082
5084
  case "DeployContract": {
5083
- const codeSize = formatCodeSize(a3.code);
5085
+ const codeSize = formatCodeSize(a.code);
5084
5086
  return `Deploying WASM contract (${codeSize})`;
5085
5087
  }
5086
5088
  case "DeployGlobalContract": {
5087
- const codeSize = formatCodeSize(a3.code);
5088
- const mode = a3.deployMode || "Unknown";
5089
+ const codeSize = formatCodeSize(a.code);
5090
+ const mode = a.deployMode || "Unknown";
5089
5091
  return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
5090
5092
  }
5091
5093
  case "UseGlobalContract": {
5092
- const accountId = a3.accountId;
5093
- const codeHash = a3.codeHash;
5094
+ const accountId = a.accountId;
5095
+ const codeHash = a.codeHash;
5094
5096
  if (accountId) {
5095
- const base2 = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
5096
- const href = `${base2}/address/${encodeURIComponent(String(accountId))}`;
5097
+ const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
5098
+ const href = `${base}/address/${encodeURIComponent(String(accountId))}`;
5097
5099
  return x`Use global contract
5098
5100
  <a
5099
5101
  class="highlight-receiver-id"
@@ -5112,7 +5114,7 @@ var init_TxTree = __esm(() => {
5112
5114
  }
5113
5115
  default: {
5114
5116
  const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
5115
- const typeText = a3.type || "Unknown";
5117
+ const typeText = a.type || "Unknown";
5116
5118
  return `Action${idxText}: ${typeText}`;
5117
5119
  }
5118
5120
  }
@@ -5122,8 +5124,8 @@ var init_TxTree = __esm(() => {
5122
5124
  const idx = treeNode.transactionIndex ?? 0;
5123
5125
  const prefix = total > 1 ? `Transaction ${idx + 1}: to ` : "Transaction to ";
5124
5126
  const receiverId = treeNode.transaction.receiverId;
5125
- const base2 = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
5126
- const href = `${base2}/address/${encodeURIComponent(receiverId)}`;
5127
+ const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
5128
+ const href = `${base}/address/${encodeURIComponent(receiverId)}`;
5127
5129
  return x`${prefix}<a
5128
5130
  class="highlight-receiver-id"
5129
5131
  href=${href}
@@ -5142,22 +5144,22 @@ var init_TxTree = __esm(() => {
5142
5144
  }
5143
5145
  computePlainLabel(treeNode) {
5144
5146
  if (treeNode.action) {
5145
- const a3 = treeNode.action;
5146
- switch (a3.type) {
5147
+ const a = treeNode.action;
5148
+ switch (a.type) {
5147
5149
  case "FunctionCall": {
5148
- const method = a3.methodName;
5149
- const gasStr = formatGas(a3.gas);
5150
- const depositStr = formatDeposit(a3.deposit);
5150
+ const method = a.methodName;
5151
+ const gasStr = formatGas(a.gas);
5152
+ const depositStr = formatDeposit(a.deposit);
5151
5153
  return `Calling ${method} with ${depositStr} using ${gasStr}`;
5152
5154
  }
5153
5155
  case "Transfer":
5154
- return `Transfer ${formatDeposit(a3.amount)}`;
5156
+ return `Transfer ${formatDeposit(a.amount)}`;
5155
5157
  case "CreateAccount":
5156
5158
  return "Creating Account";
5157
5159
  case "DeleteAccount":
5158
5160
  return "Deleting Account";
5159
5161
  case "Stake":
5160
- return `Staking ${formatDeposit(a3.stake)}`;
5162
+ return `Staking ${formatDeposit(a.stake)}`;
5161
5163
  case "AddKey":
5162
5164
  return "Adding Key";
5163
5165
  case "DeleteKey":
@@ -5165,13 +5167,13 @@ var init_TxTree = __esm(() => {
5165
5167
  case "DeployContract":
5166
5168
  return "Deploying WASM contract";
5167
5169
  case "DeployGlobalContract": {
5168
- const codeSize = formatCodeSize(a3.code);
5169
- const mode = a3.deployMode || "Unknown";
5170
+ const codeSize = formatCodeSize(a.code);
5171
+ const mode = a.deployMode || "Unknown";
5170
5172
  return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
5171
5173
  }
5172
5174
  case "UseGlobalContract": {
5173
- const accountId = a3.accountId;
5174
- const codeHash = a3.codeHash;
5175
+ const accountId = a.accountId;
5176
+ const codeHash = a.codeHash;
5175
5177
  if (accountId) {
5176
5178
  return `Use global contract by account ${String(accountId)}`;
5177
5179
  }
@@ -5182,7 +5184,7 @@ var init_TxTree = __esm(() => {
5182
5184
  }
5183
5185
  default: {
5184
5186
  const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
5185
- const typeText = a3.type || "Unknown";
5187
+ const typeText = a.type || "Unknown";
5186
5188
  return `Action${idxText}: ${typeText}`;
5187
5189
  }
5188
5190
  }
@@ -5225,7 +5227,7 @@ var init_TxTree = __esm(() => {
5225
5227
  ${node.copyValue ? x` <span
5226
5228
  class="copy-badge"
5227
5229
  data-copied=${this.isCopied(node.id)}
5228
- @click=${(e6) => this.handleCopyClick(e6, node)}
5230
+ @click=${(e) => this.handleCopyClick(e, node)}
5229
5231
  title=${this.isCopied(node.id) ? "Copied" : "Copy"}
5230
5232
  >
5231
5233
  ${this.isCopied(node.id) ? "copied" : "copy"}
@@ -5238,7 +5240,7 @@ var init_TxTree = __esm(() => {
5238
5240
  class="file-content-mode-toggle"
5239
5241
  title=${`Show ${toggleLabel}`}
5240
5242
  aria-label=${`Show ${toggleLabel}`}
5241
- @click=${(e6) => this.onFileContentToggleClick(e6, node)}
5243
+ @click=${(e) => this.onFileContentToggleClick(e, node)}
5242
5244
  >
5243
5245
  ${toggleLabel}
5244
5246
  </button>` : ""}
@@ -5264,7 +5266,7 @@ var init_TxTree = __esm(() => {
5264
5266
  <span
5265
5267
  class="copy-badge"
5266
5268
  data-copied=${this.isCopied(node.id)}
5267
- @click=${(e6) => this.handleCopyClick(e6, node)}
5269
+ @click=${(e) => this.handleCopyClick(e, node)}
5268
5270
  title=${this.isCopied(node.id) ? "Copied" : "Copy"}
5269
5271
  >${this.isCopied(node.id) ? "copied" : "copy"}</span
5270
5272
  >
@@ -5297,7 +5299,7 @@ var init_TxTree = __esm(() => {
5297
5299
  </summary>
5298
5300
  ${nodeChildren && nodeChildren.length > 0 ? x`
5299
5301
  <div class="folder-children">
5300
- ${c5(nodeChildren, (c6) => c6.id, (c6) => this.renderAnyNode(c6, depth + 1))}
5302
+ ${c5(nodeChildren, (c) => c.id, (c) => this.renderAnyNode(c, depth + 1))}
5301
5303
  </div>
5302
5304
  ` : x``}
5303
5305
  </details>
@@ -5796,49 +5798,49 @@ function hexToBytes(hex) {
5796
5798
  throw new Error(`Invalid hex (odd length): ${hex}`);
5797
5799
  }
5798
5800
  const bytes = new Uint8Array(normalized.length / 2);
5799
- for (let i6 = 0;i6 < bytes.length; i6++) {
5800
- const byte = normalized.slice(i6 * 2, i6 * 2 + 2);
5801
+ for (let i = 0;i < bytes.length; i++) {
5802
+ const byte = normalized.slice(i * 2, i * 2 + 2);
5801
5803
  const value = Number.parseInt(byte, 16);
5802
5804
  if (!Number.isFinite(value))
5803
5805
  throw new Error(`Invalid hex: ${hex}`);
5804
- bytes[i6] = value;
5806
+ bytes[i] = value;
5805
5807
  }
5806
5808
  return bytes;
5807
5809
  }
5808
5810
  function bytesToHex(bytes) {
5809
- return `0x${Array.from(bytes).map((b3) => b3.toString(16).padStart(2, "0")).join("")}`;
5811
+ return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
5810
5812
  }
5811
5813
 
5812
5814
  // ../shared-ts/src/utils/keccak.ts
5813
5815
  function rotateLeft64(value, shift) {
5814
- const n6 = BigInt(shift);
5815
- return (value << n6 | value >> 64n - n6) & UINT64_MASK;
5816
+ const n = BigInt(shift);
5817
+ return (value << n | value >> 64n - n) & UINT64_MASK;
5816
5818
  }
5817
5819
  function keccakF1600(state) {
5818
- const c6 = new Array(5);
5819
- const d3 = new Array(5);
5820
+ const c = new Array(5);
5821
+ const d = new Array(5);
5820
5822
  for (let round = 0;round < 24; round += 1) {
5821
- for (let x2 = 0;x2 < 5; x2 += 1) {
5822
- c6[x2] = state[x2] ^ state[x2 + 5] ^ state[x2 + 10] ^ state[x2 + 15] ^ state[x2 + 20];
5823
+ for (let x = 0;x < 5; x += 1) {
5824
+ c[x] = state[x] ^ state[x + 5] ^ state[x + 10] ^ state[x + 15] ^ state[x + 20];
5823
5825
  }
5824
- for (let x2 = 0;x2 < 5; x2 += 1) {
5825
- d3[x2] = c6[(x2 + 4) % 5] ^ rotateLeft64(c6[(x2 + 1) % 5], 1);
5826
+ for (let x = 0;x < 5; x += 1) {
5827
+ d[x] = c[(x + 4) % 5] ^ rotateLeft64(c[(x + 1) % 5], 1);
5826
5828
  }
5827
- for (let y3 = 0;y3 < 5; y3 += 1) {
5828
- const rowOffset = y3 * 5;
5829
- for (let x2 = 0;x2 < 5; x2 += 1) {
5830
- state[rowOffset + x2] ^= d3[x2];
5829
+ for (let y = 0;y < 5; y += 1) {
5830
+ const rowOffset = y * 5;
5831
+ for (let x = 0;x < 5; x += 1) {
5832
+ state[rowOffset + x] ^= d[x];
5831
5833
  }
5832
5834
  }
5833
5835
  let lane = state[1];
5834
- for (let i6 = 0;i6 < 24; i6 += 1) {
5835
- const targetIndex = PI_LANE_INDEXES[i6];
5836
+ for (let i = 0;i < 24; i += 1) {
5837
+ const targetIndex = PI_LANE_INDEXES[i];
5836
5838
  const nextLane = state[targetIndex];
5837
- state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[i6]);
5839
+ state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[i]);
5838
5840
  lane = nextLane;
5839
5841
  }
5840
- for (let y3 = 0;y3 < 5; y3 += 1) {
5841
- const rowOffset = y3 * 5;
5842
+ for (let y = 0;y < 5; y += 1) {
5843
+ const rowOffset = y * 5;
5842
5844
  const lane0 = state[rowOffset];
5843
5845
  const lane1 = state[rowOffset + 1];
5844
5846
  const lane2 = state[rowOffset + 2];
@@ -5861,8 +5863,8 @@ function absorbByte(state, offset, byte) {
5861
5863
  function keccak256Bytes(input) {
5862
5864
  const state = new Array(25).fill(0n);
5863
5865
  let offset = 0;
5864
- for (let i6 = 0;i6 < input.length; i6 += 1) {
5865
- absorbByte(state, offset, input[i6]);
5866
+ for (let i = 0;i < input.length; i += 1) {
5867
+ absorbByte(state, offset, input[i]);
5866
5868
  offset += 1;
5867
5869
  if (offset === KECCAK_RATE_BYTES) {
5868
5870
  keccakF1600(state);
@@ -5873,10 +5875,10 @@ function keccak256Bytes(input) {
5873
5875
  absorbByte(state, KECCAK_RATE_BYTES - 1, 128);
5874
5876
  keccakF1600(state);
5875
5877
  const out = new Uint8Array(KECCAK256_OUTPUT_BYTES);
5876
- for (let i6 = 0;i6 < KECCAK256_OUTPUT_BYTES; i6 += 1) {
5877
- const lane = state[Math.floor(i6 / 8)];
5878
- const laneShift = BigInt(i6 % 8 * 8);
5879
- out[i6] = Number(lane >> laneShift & 0xffn);
5878
+ for (let i = 0;i < KECCAK256_OUTPUT_BYTES; i += 1) {
5879
+ const lane = state[Math.floor(i / 8)];
5880
+ const laneShift = BigInt(i % 8 * 8);
5881
+ out[i] = Number(lane >> laneShift & 0xffn);
5880
5882
  }
5881
5883
  return out;
5882
5884
  }
@@ -6117,8 +6119,8 @@ function parseAbiTypeNode(args) {
6117
6119
  dynamic: baseType === "bytes" || baseType === "string"
6118
6120
  };
6119
6121
  }
6120
- for (let i6 = arrayDimensions.length - 1;i6 >= 0; i6 -= 1) {
6121
- const length = arrayDimensions[i6];
6122
+ for (let i = arrayDimensions.length - 1;i >= 0; i -= 1) {
6123
+ const length = arrayDimensions[i];
6122
6124
  node = {
6123
6125
  kind: "array",
6124
6126
  canonicalType: `${node.canonicalType}[${length == null ? "" : String(length)}]`,
@@ -6245,16 +6247,16 @@ function decodeTypeAt(typeNode, bytes, offset) {
6245
6247
  if (!decodedItems)
6246
6248
  return null;
6247
6249
  const out = {};
6248
- for (let i6 = 0;i6 < typeNode.components.length; i6 += 1) {
6249
- const component = typeNode.components[i6];
6250
- const baseName = String(component.name || "").trim() || `item${i6}`;
6250
+ for (let i = 0;i < typeNode.components.length; i += 1) {
6251
+ const component = typeNode.components[i];
6252
+ const baseName = String(component.name || "").trim() || `item${i}`;
6251
6253
  let name = baseName;
6252
6254
  let counter = 1;
6253
6255
  while (Object.prototype.hasOwnProperty.call(out, name)) {
6254
6256
  counter += 1;
6255
6257
  name = `${baseName}_${counter}`;
6256
6258
  }
6257
- out[name] = decodedItems[i6];
6259
+ out[name] = decodedItems[i];
6258
6260
  }
6259
6261
  return out;
6260
6262
  }
@@ -6268,8 +6270,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
6268
6270
  const baseOffset = isDynamicArray ? offset + WORD_SIZE : offset;
6269
6271
  const items = [];
6270
6272
  if (typeNode.item.dynamic) {
6271
- for (let i6 = 0;i6 < arrayLength; i6 += 1) {
6272
- const itemRelativeOffset = readWordNumber(bytes, baseOffset + i6 * WORD_SIZE);
6273
+ for (let i = 0;i < arrayLength; i += 1) {
6274
+ const itemRelativeOffset = readWordNumber(bytes, baseOffset + i * WORD_SIZE);
6273
6275
  if (itemRelativeOffset == null)
6274
6276
  return null;
6275
6277
  const decoded = decodeTypeAt(typeNode.item, bytes, baseOffset + itemRelativeOffset);
@@ -6280,8 +6282,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
6280
6282
  return items;
6281
6283
  }
6282
6284
  const itemWords = staticWordLength(typeNode.item);
6283
- for (let i6 = 0;i6 < arrayLength; i6 += 1) {
6284
- const itemOffset = baseOffset + i6 * itemWords * WORD_SIZE;
6285
+ for (let i = 0;i < arrayLength; i += 1) {
6286
+ const itemOffset = baseOffset + i * itemWords * WORD_SIZE;
6285
6287
  const decoded = decodeTypeAt(typeNode.item, bytes, itemOffset);
6286
6288
  if (decoded == null)
6287
6289
  return null;
@@ -6297,17 +6299,17 @@ function decodeTupleComponents(components, bytes, tupleOffset) {
6297
6299
  cursorWords += component.typeNode.dynamic ? 1 : staticWordLength(component.typeNode);
6298
6300
  }
6299
6301
  const out = [];
6300
- for (let i6 = 0;i6 < components.length; i6 += 1) {
6301
- const component = components[i6];
6302
- const headOffset = tupleOffset + headOffsets[i6];
6302
+ for (let i = 0;i < components.length; i += 1) {
6303
+ const component = components[i];
6304
+ const headOffset = tupleOffset + headOffsets[i];
6303
6305
  if (component.typeNode.dynamic) {
6304
6306
  const relativeOffset = readWordNumber(bytes, headOffset);
6305
6307
  if (relativeOffset == null)
6306
6308
  return null;
6307
- const decoded2 = decodeTypeAt(component.typeNode, bytes, tupleOffset + relativeOffset);
6308
- if (decoded2 == null)
6309
+ const decoded = decodeTypeAt(component.typeNode, bytes, tupleOffset + relativeOffset);
6310
+ if (decoded == null)
6309
6311
  return null;
6310
- out.push(decoded2);
6312
+ out.push(decoded);
6311
6313
  continue;
6312
6314
  }
6313
6315
  const decoded = decodeTypeAt(component.typeNode, bytes, headOffset);
@@ -6390,10 +6392,6 @@ var init_abiDecode = __esm(() => {
6390
6392
  });
6391
6393
 
6392
6394
  // src/core/signingEngine/uiConfirm/ui/lit-components/TxTree/abi/enrichDisplayModelWithAbi.ts
6393
- var exports_enrichDisplayModelWithAbi = {};
6394
- __export(exports_enrichDisplayModelWithAbi, {
6395
- enrichDisplayModelWithAbi: () => enrichDisplayModelWithAbi
6396
- });
6397
6395
  function isGenericContractCallOperation(operation) {
6398
6396
  return operation.kind === "generic.contractCall";
6399
6397
  }
@@ -6491,12 +6489,6 @@ var init_tx_confirm_content = __esm(() => {
6491
6489
  init_registry();
6492
6490
  init_registry();
6493
6491
  TxConfirmContentElement = class TxConfirmContentElement extends LitElementWithProps {
6494
- _heightReflow = createSurfaceHeightReflow({
6495
- reason: "tx-body",
6496
- element: () => this.querySelector(".txc-root"),
6497
- setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
6498
- settled: () => this.updateComplete
6499
- });
6500
6492
  static requiredChildTags = [W3A_TX_TREE_ID];
6501
6493
  static keepDefinitions = [TxTree_default];
6502
6494
  static properties = {
@@ -6519,22 +6511,39 @@ var init_tx_confirm_content = __esm(() => {
6519
6511
  evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
6520
6512
  showShadow: { type: Boolean, attribute: "show-shadow" }
6521
6513
  };
6522
- _treeNode = null;
6523
- _ensureTreeDefinition = TxTree_default;
6524
- _stylesReady = false;
6525
- _stylePromises = [];
6526
- _stylesAwaiting = null;
6527
6514
  static _STYLE_MARKERS = [
6528
6515
  "data-w3a-tx-tree-css",
6529
6516
  "data-w3a-tx-confirmer-css",
6530
6517
  "data-w3a-components-css"
6531
6518
  ];
6532
- _treeBuildVersion = 0;
6533
- _confirmArmed = false;
6534
- _confirmArmRaf1 = null;
6535
- _confirmArmRaf2 = null;
6536
6519
  constructor() {
6537
6520
  super();
6521
+ this._heightReflow = createSurfaceHeightReflow({
6522
+ reason: "tx-body",
6523
+ element: () => this.querySelector(".txc-root"),
6524
+ setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
6525
+ settled: () => this.updateComplete
6526
+ });
6527
+ this._treeNode = null;
6528
+ this._ensureTreeDefinition = TxTree_default;
6529
+ this._stylesReady = false;
6530
+ this._stylePromises = [];
6531
+ this._stylesAwaiting = null;
6532
+ this._treeBuildVersion = 0;
6533
+ this._confirmArmed = false;
6534
+ this._confirmArmRaf1 = null;
6535
+ this._confirmArmRaf2 = null;
6536
+ this._stopDragStart = (e) => {
6537
+ e.stopPropagation();
6538
+ };
6539
+ this.onConfirm = () => {
6540
+ if (this.loading || !this._confirmArmed)
6541
+ return;
6542
+ dispatchLitConfirm(this);
6543
+ };
6544
+ this.onCancel = () => {
6545
+ dispatchLitCancel(this);
6546
+ };
6538
6547
  const root = document?.documentElement || null;
6539
6548
  if (root) {
6540
6549
  this._stylePromises.push(ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css"), ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"), ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css"));
@@ -6584,8 +6593,8 @@ var init_tx_confirm_content = __esm(() => {
6584
6593
  return true;
6585
6594
  }
6586
6595
  if (!this._stylesAwaiting) {
6587
- const p4 = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
6588
- this._stylesAwaiting = p4.then(() => {
6596
+ const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
6597
+ this._stylesAwaiting = p.then(() => {
6589
6598
  this._stylesReady = true;
6590
6599
  this._rebuildTree();
6591
6600
  });
@@ -6625,17 +6634,17 @@ var init_tx_confirm_content = __esm(() => {
6625
6634
  }
6626
6635
  }
6627
6636
  _applyTooltipWidthVar() {
6628
- const w2 = this._normalizeWidth(this.tooltipWidth);
6629
- if (w2)
6630
- this.setCssVars({ "--tooltip-width": w2 });
6637
+ const w = this._normalizeWidth(this.tooltipWidth);
6638
+ if (w)
6639
+ this.setCssVars({ "--tooltip-width": w });
6631
6640
  }
6632
6641
  _normalizeWidth(val) {
6633
6642
  if (val === undefined || val === null)
6634
6643
  return;
6635
6644
  if (typeof val === "number" && Number.isFinite(val))
6636
6645
  return `${val}px`;
6637
- const s6 = String(val).trim();
6638
- return s6.length ? s6 : undefined;
6646
+ const s = String(val).trim();
6647
+ return s.length ? s : undefined;
6639
6648
  }
6640
6649
  _operationHasAbiDecodeHint(operation) {
6641
6650
  const hint = operation.abiDecodeHint;
@@ -6661,10 +6670,10 @@ var init_tx_confirm_content = __esm(() => {
6661
6670
  }
6662
6671
  async _enrichTreeWithAbi(args) {
6663
6672
  try {
6664
- const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(), exports_enrichDisplayModelWithAbi));
6673
+ const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(), {}));
6665
6674
  if (args.buildVersion !== this._treeBuildVersion)
6666
6675
  return;
6667
- const enrichedModel = module.enrichDisplayModelWithAbi(args.model);
6676
+ const enrichedModel = enrichDisplayModelWithAbi(args.model);
6668
6677
  if (args.buildVersion !== this._treeBuildVersion)
6669
6678
  return;
6670
6679
  this._treeNode = buildDisplayTreeFromModel(enrichedModel);
@@ -6707,23 +6716,12 @@ var init_tx_confirm_content = __esm(() => {
6707
6716
  return;
6708
6717
  }
6709
6718
  this._treeNode = null;
6710
- } catch (e6) {
6711
- console.warn("[TxConfirmContent] failed to build TxTree", e6);
6719
+ } catch (e) {
6720
+ console.warn("[TxConfirmContent] failed to build TxTree", e);
6712
6721
  this._treeNode = null;
6713
6722
  }
6714
6723
  maybeRequestUpdate();
6715
6724
  }
6716
- _stopDragStart = (e6) => {
6717
- e6.stopPropagation();
6718
- };
6719
- onConfirm = () => {
6720
- if (this.loading || !this._confirmArmed)
6721
- return;
6722
- dispatchLitConfirm(this);
6723
- };
6724
- onCancel = () => {
6725
- dispatchLitCancel(this);
6726
- };
6727
6725
  render() {
6728
6726
  const treeTheme = this.theme === "dark" ? "dark" : "light";
6729
6727
  const nearExplorerBase = this.nearExplorerUrl || "https://testnet.nearblocks.io";
@@ -6847,6 +6845,26 @@ var init_HaloBorder = __esm(() => {
6847
6845
  init_css_loader();
6848
6846
  init_registry();
6849
6847
  HaloBorderElement = class HaloBorderElement extends LitElementWithProps {
6848
+ constructor() {
6849
+ super(...arguments);
6850
+ this._stylesReady = false;
6851
+ this._stylePromises = [];
6852
+ this._stylesAwaiting = null;
6853
+ this._rafId = null;
6854
+ this._startTs = 0;
6855
+ this._running = false;
6856
+ this.tick = (ts) => {
6857
+ if (!this._running)
6858
+ return;
6859
+ if (!this._startTs)
6860
+ this._startTs = ts;
6861
+ const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
6862
+ const delta = (ts - this._startTs) % dur;
6863
+ const angle = delta / dur * 360;
6864
+ this.setCssVars({ "--halo-angle": `${angle}deg` });
6865
+ this._rafId = requestAnimationFrame(this.tick);
6866
+ };
6867
+ }
6850
6868
  static properties = {
6851
6869
  animated: { type: Boolean },
6852
6870
  theme: { type: String },
@@ -6861,15 +6879,12 @@ var init_HaloBorder = __esm(() => {
6861
6879
  innerPadding: { type: String, attribute: "inner-padding" },
6862
6880
  innerBackground: { type: String, attribute: "inner-background" }
6863
6881
  };
6864
- _stylesReady = false;
6865
- _stylePromises = [];
6866
- _stylesAwaiting = null;
6867
6882
  static _STYLE_MARKER = "data-w3a-halo-border-css";
6868
6883
  createRenderRoot() {
6869
6884
  const root = super.createRenderRoot();
6870
- const p4 = ensureExternalStyles(root, "halo-border.css", HaloBorderElement._STYLE_MARKER);
6871
- this._stylePromises.push(p4);
6872
- p4.catch(() => {});
6885
+ const p = ensureExternalStyles(root, "halo-border.css", HaloBorderElement._STYLE_MARKER);
6886
+ this._stylePromises.push(p);
6887
+ p.catch(() => {});
6873
6888
  return root;
6874
6889
  }
6875
6890
  shouldUpdate(_changed) {
@@ -6880,7 +6895,7 @@ var init_HaloBorder = __esm(() => {
6880
6895
  return true;
6881
6896
  }
6882
6897
  if (!this._stylesAwaiting) {
6883
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
6898
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
6884
6899
  this._stylesAwaiting = settle.then(() => {
6885
6900
  this._stylesReady = true;
6886
6901
  this.requestUpdate();
@@ -6898,9 +6913,6 @@ var init_HaloBorder = __esm(() => {
6898
6913
  const statefulLink = link;
6899
6914
  return !!(statefulLink._w3aLoaded || link.sheet);
6900
6915
  }
6901
- _rafId = null;
6902
- _startTs = 0;
6903
- _running = false;
6904
6916
  connectedCallback() {
6905
6917
  super.connectedCallback();
6906
6918
  this.applyCssVars();
@@ -6940,17 +6952,6 @@ var init_HaloBorder = __esm(() => {
6940
6952
  this.stop();
6941
6953
  super.disconnectedCallback();
6942
6954
  }
6943
- tick = (ts) => {
6944
- if (!this._running)
6945
- return;
6946
- if (!this._startTs)
6947
- this._startTs = ts;
6948
- const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
6949
- const delta = (ts - this._startTs) % dur;
6950
- const angle = delta / dur * 360;
6951
- this.setCssVars({ "--halo-angle": `${angle}deg` });
6952
- this._rafId = requestAnimationFrame(this.tick);
6953
- };
6954
6955
  start() {
6955
6956
  if (this._running)
6956
6957
  return;
@@ -6993,6 +6994,12 @@ var init_PasskeyHaloLoading = __esm(() => {
6993
6994
  init_css_loader();
6994
6995
  init_registry();
6995
6996
  PasskeyHaloLoadingElement = class PasskeyHaloLoadingElement extends LitElementWithProps {
6997
+ constructor() {
6998
+ super(...arguments);
6999
+ this._stylesReady = false;
7000
+ this._stylePromises = [];
7001
+ this._stylesAwaiting = null;
7002
+ }
6996
7003
  static properties = {
6997
7004
  animated: { type: Boolean },
6998
7005
  theme: { type: String },
@@ -7011,15 +7018,12 @@ var init_PasskeyHaloLoading = __esm(() => {
7011
7018
  iconContainerBorderRadius: { type: String, attribute: "icon-container-border-radius" },
7012
7019
  iconContainerBackgroundColor: { type: String, attribute: "icon-container-background-color" }
7013
7020
  };
7014
- _stylesReady = false;
7015
- _stylePromises = [];
7016
- _stylesAwaiting = null;
7017
7021
  static _STYLE_MARKER = "data-w3a-passkey-halo-loading-css";
7018
7022
  createRenderRoot() {
7019
7023
  const root = super.createRenderRoot();
7020
- const p4 = ensureExternalStyles(root, "passkey-halo-loading.css", PasskeyHaloLoadingElement._STYLE_MARKER);
7021
- this._stylePromises.push(p4);
7022
- p4.catch(() => {});
7024
+ const p = ensureExternalStyles(root, "passkey-halo-loading.css", PasskeyHaloLoadingElement._STYLE_MARKER);
7025
+ this._stylePromises.push(p);
7026
+ p.catch(() => {});
7023
7027
  return root;
7024
7028
  }
7025
7029
  shouldUpdate(_changed) {
@@ -7030,7 +7034,7 @@ var init_PasskeyHaloLoading = __esm(() => {
7030
7034
  return true;
7031
7035
  }
7032
7036
  if (!this._stylesAwaiting) {
7033
- const settle = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
7037
+ const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
7034
7038
  this._stylesAwaiting = settle.then(() => {
7035
7039
  this._stylesReady = true;
7036
7040
  this.requestUpdate();
@@ -7292,50 +7296,6 @@ var init_viewer_drawer = __esm(() => {
7292
7296
  otpResendStatus: { type: String, attribute: false },
7293
7297
  otpSubmitAnimating: { type: Boolean, attribute: false }
7294
7298
  };
7295
- otpCode = "";
7296
- otpError = "";
7297
- otpResendBusy = false;
7298
- otpResendUntilMs = 0;
7299
- otpResendStatus = "";
7300
- otpSubmitAnimating = false;
7301
- _otpResendTimer = null;
7302
- _otpSubmitTimer = null;
7303
- _lastAutoOtpSubmitCode = "";
7304
- _ensureDrawerDefinition = Drawer_default;
7305
- _drawerEl = null;
7306
- _open = false;
7307
- _ownsThemeAttr = false;
7308
- _onWindowMessage = (ev) => {
7309
- const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
7310
- if (!data || typeof data.type !== "string")
7311
- return;
7312
- if (data.type === "MODAL_TIMEOUT") {
7313
- const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
7314
- this.loading = false;
7315
- this.errorMessage = msg;
7316
- this._drawerEl?.handleClose?.();
7317
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
7318
- bubbles: true,
7319
- composed: true,
7320
- detail: { confirmed: false }
7321
- }));
7322
- }
7323
- };
7324
- _onKeyDown = (e6) => {
7325
- if (e6.key === "Escape" || e6.key === "Esc") {
7326
- if (this.loading)
7327
- return;
7328
- e6.preventDefault();
7329
- this._drawerEl?.handleClose();
7330
- if (!this._drawerEl) {
7331
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
7332
- bubbles: true,
7333
- composed: true,
7334
- detail: { confirmed: false }
7335
- }));
7336
- }
7337
- }
7338
- };
7339
7299
  _chainLabelForModel() {
7340
7300
  switch (this.model?.chain) {
7341
7301
  case "tempo":
@@ -7428,24 +7388,6 @@ var init_viewer_drawer = __esm(() => {
7428
7388
  </div>
7429
7389
  `;
7430
7390
  }
7431
- onPasskeyRegistrationConfirm = () => {
7432
- this.finishContentConfirm();
7433
- };
7434
- _onOtpInput = (event) => {
7435
- const input = event.currentTarget;
7436
- const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
7437
- this.otpCode = code;
7438
- this.otpError = "";
7439
- if (code.length < 6) {
7440
- this._lastAutoOtpSubmitCode = "";
7441
- this._resetOtpSubmitAnimation();
7442
- return;
7443
- }
7444
- if (this.loading || this._lastAutoOtpSubmitCode === code)
7445
- return;
7446
- this._lastAutoOtpSubmitCode = code;
7447
- this._submitEmailOtpAfterFade(code);
7448
- };
7449
7391
  _clearOtpSubmitTimer() {
7450
7392
  if (this._otpSubmitTimer != null)
7451
7393
  window.clearTimeout(this._otpSubmitTimer);
@@ -7489,40 +7431,6 @@ var init_viewer_drawer = __esm(() => {
7489
7431
  return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
7490
7432
  return this.otpResendStatus || "Resend code";
7491
7433
  }
7492
- _onOtpResend = () => {
7493
- const resend = this.emailOtpPrompt?.onResend;
7494
- if (typeof resend !== "function" || this.otpResendBusy || this.loading)
7495
- return;
7496
- if (this.otpResendUntilMs > Date.now())
7497
- return;
7498
- this.otpError = "";
7499
- this.otpResendStatus = "";
7500
- this._lastAutoOtpSubmitCode = "";
7501
- this._resetOtpSubmitAnimation();
7502
- this.otpResendBusy = true;
7503
- this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
7504
- this.requestUpdate();
7505
- (async () => {
7506
- try {
7507
- const result = await resend();
7508
- const challengeId = String(result?.challengeId || "").trim();
7509
- const emailHint = String(result?.emailHint || "").trim();
7510
- if (challengeId) {
7511
- this.emailOtpPrompt = {
7512
- ...this.emailOtpPrompt,
7513
- challengeId,
7514
- ...emailHint ? { emailHint } : {}
7515
- };
7516
- }
7517
- this.otpResendStatus = "Code sent";
7518
- } catch (error) {
7519
- this.otpError = formatEmailOtpResendError(error);
7520
- } finally {
7521
- this.otpResendBusy = false;
7522
- this.requestUpdate();
7523
- }
7524
- })();
7525
- };
7526
7434
  _renderEmailOtpPrompt() {
7527
7435
  if (!this._isEmailOtpMode())
7528
7436
  return "";
@@ -7569,11 +7477,6 @@ var init_viewer_drawer = __esm(() => {
7569
7477
  </div>
7570
7478
  `;
7571
7479
  }
7572
- _onFundingNoticeCopy = (event) => {
7573
- const target = event.currentTarget;
7574
- const accountId = String(target?.dataset.copyValue || "").trim();
7575
- copyTextToClipboard(accountId);
7576
- };
7577
7480
  _renderConfirmationBody() {
7578
7481
  const body = String(this.body || "").trim();
7579
7482
  if (!body)
@@ -7604,6 +7507,147 @@ var init_viewer_drawer = __esm(() => {
7604
7507
  }
7605
7508
  constructor() {
7606
7509
  super();
7510
+ this.otpCode = "";
7511
+ this.otpError = "";
7512
+ this.otpResendBusy = false;
7513
+ this.otpResendUntilMs = 0;
7514
+ this.otpResendStatus = "";
7515
+ this.otpSubmitAnimating = false;
7516
+ this._otpResendTimer = null;
7517
+ this._otpSubmitTimer = null;
7518
+ this._lastAutoOtpSubmitCode = "";
7519
+ this._ensureDrawerDefinition = Drawer_default;
7520
+ this._drawerEl = null;
7521
+ this._open = false;
7522
+ this._ownsThemeAttr = false;
7523
+ this._onWindowMessage = (ev) => {
7524
+ const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
7525
+ if (!data || typeof data.type !== "string")
7526
+ return;
7527
+ if (data.type === "MODAL_TIMEOUT") {
7528
+ const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
7529
+ this.loading = false;
7530
+ this.errorMessage = msg;
7531
+ this._drawerEl?.handleClose?.();
7532
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
7533
+ bubbles: true,
7534
+ composed: true,
7535
+ detail: { confirmed: false }
7536
+ }));
7537
+ }
7538
+ };
7539
+ this._onKeyDown = (e) => {
7540
+ if (e.key === "Escape" || e.key === "Esc") {
7541
+ if (this.loading)
7542
+ return;
7543
+ e.preventDefault();
7544
+ this._drawerEl?.handleClose();
7545
+ if (!this._drawerEl) {
7546
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
7547
+ bubbles: true,
7548
+ composed: true,
7549
+ detail: { confirmed: false }
7550
+ }));
7551
+ }
7552
+ }
7553
+ };
7554
+ this.onPasskeyRegistrationConfirm = () => {
7555
+ this.finishContentConfirm();
7556
+ };
7557
+ this._onOtpInput = (event) => {
7558
+ const input = event.currentTarget;
7559
+ const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
7560
+ this.otpCode = code;
7561
+ this.otpError = "";
7562
+ if (code.length < 6) {
7563
+ this._lastAutoOtpSubmitCode = "";
7564
+ this._resetOtpSubmitAnimation();
7565
+ return;
7566
+ }
7567
+ if (this.loading || this._lastAutoOtpSubmitCode === code)
7568
+ return;
7569
+ this._lastAutoOtpSubmitCode = code;
7570
+ this._submitEmailOtpAfterFade(code);
7571
+ };
7572
+ this._onOtpResend = () => {
7573
+ const resend = this.emailOtpPrompt?.onResend;
7574
+ if (typeof resend !== "function" || this.otpResendBusy || this.loading)
7575
+ return;
7576
+ if (this.otpResendUntilMs > Date.now())
7577
+ return;
7578
+ this.otpError = "";
7579
+ this.otpResendStatus = "";
7580
+ this._lastAutoOtpSubmitCode = "";
7581
+ this._resetOtpSubmitAnimation();
7582
+ this.otpResendBusy = true;
7583
+ this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
7584
+ this.requestUpdate();
7585
+ (async () => {
7586
+ try {
7587
+ const result = await resend();
7588
+ const challengeId = String(result?.challengeId || "").trim();
7589
+ const emailHint = String(result?.emailHint || "").trim();
7590
+ if (challengeId) {
7591
+ this.emailOtpPrompt = {
7592
+ ...this.emailOtpPrompt,
7593
+ challengeId,
7594
+ ...emailHint ? { emailHint } : {}
7595
+ };
7596
+ }
7597
+ this.otpResendStatus = "Code sent";
7598
+ } catch (error) {
7599
+ this.otpError = formatEmailOtpResendError(error);
7600
+ } finally {
7601
+ this.otpResendBusy = false;
7602
+ this.requestUpdate();
7603
+ }
7604
+ })();
7605
+ };
7606
+ this._onFundingNoticeCopy = (event) => {
7607
+ const target = event.currentTarget;
7608
+ const accountId = String(target?.dataset.copyValue || "").trim();
7609
+ copyTextToClipboard(accountId);
7610
+ };
7611
+ this.onDrawerCancel = () => {
7612
+ if (this.loading)
7613
+ return;
7614
+ this._open = false;
7615
+ this.requestUpdate();
7616
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
7617
+ bubbles: true,
7618
+ composed: true,
7619
+ detail: { confirmed: false }
7620
+ }));
7621
+ };
7622
+ this.onContentConfirm = () => {
7623
+ if (this.loading || this.otpSubmitAnimating)
7624
+ return;
7625
+ if (this._isEmailOtpMode()) {
7626
+ const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
7627
+ if (!/^\d{6}$/.test(code)) {
7628
+ this.otpCode = code;
7629
+ this.otpError = "Enter the 6-digit Email OTP code.";
7630
+ this.requestUpdate();
7631
+ return;
7632
+ }
7633
+ this.otpCode = code;
7634
+ this.otpError = "";
7635
+ this._lastAutoOtpSubmitCode = code;
7636
+ this._submitEmailOtpAfterFade(code);
7637
+ return;
7638
+ }
7639
+ this.finishContentConfirm();
7640
+ };
7641
+ this.onContentCancel = () => {
7642
+ this._drawerEl?.handleClose();
7643
+ this._open = false;
7644
+ this.requestUpdate();
7645
+ this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
7646
+ bubbles: true,
7647
+ composed: true,
7648
+ detail: { confirmed: false }
7649
+ }));
7650
+ };
7607
7651
  this.nearAccountId = "";
7608
7652
  this.txSigningRequests = undefined;
7609
7653
  this.model = undefined;
@@ -7664,7 +7708,7 @@ var init_viewer_drawer = __esm(() => {
7664
7708
  ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"),
7665
7709
  ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css")
7666
7710
  ]);
7667
- await new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6())));
7711
+ await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r())));
7668
7712
  this._open = true;
7669
7713
  this.requestUpdate();
7670
7714
  }
@@ -7693,36 +7737,6 @@ var init_viewer_drawer = __esm(() => {
7693
7737
  }
7694
7738
  }
7695
7739
  }
7696
- onDrawerCancel = () => {
7697
- if (this.loading)
7698
- return;
7699
- this._open = false;
7700
- this.requestUpdate();
7701
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
7702
- bubbles: true,
7703
- composed: true,
7704
- detail: { confirmed: false }
7705
- }));
7706
- };
7707
- onContentConfirm = () => {
7708
- if (this.loading || this.otpSubmitAnimating)
7709
- return;
7710
- if (this._isEmailOtpMode()) {
7711
- const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
7712
- if (!/^\d{6}$/.test(code)) {
7713
- this.otpCode = code;
7714
- this.otpError = "Enter the 6-digit Email OTP code.";
7715
- this.requestUpdate();
7716
- return;
7717
- }
7718
- this.otpCode = code;
7719
- this.otpError = "";
7720
- this._lastAutoOtpSubmitCode = code;
7721
- this._submitEmailOtpAfterFade(code);
7722
- return;
7723
- }
7724
- this.finishContentConfirm();
7725
- };
7726
7740
  finishContentConfirm(opts) {
7727
7741
  if (this.loading)
7728
7742
  return;
@@ -7742,16 +7756,6 @@ var init_viewer_drawer = __esm(() => {
7742
7756
  }
7743
7757
  }));
7744
7758
  }
7745
- onContentCancel = () => {
7746
- this._drawerEl?.handleClose();
7747
- this._open = false;
7748
- this.requestUpdate();
7749
- this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
7750
- bubbles: true,
7751
- composed: true,
7752
- detail: { confirmed: false }
7753
- }));
7754
- };
7755
7759
  close(_confirmed) {
7756
7760
  if (!this._open)
7757
7761
  return;
@@ -7952,12 +7956,6 @@ var init_viewer_modal = __esm(() => {
7952
7956
  init_nearFundingNotice();
7953
7957
  init_registry();
7954
7958
  ModalTxConfirmElement = class ModalTxConfirmElement extends LitElementWithProps {
7955
- _heightReflow = createSurfaceHeightReflow({
7956
- reason: "confirm-body",
7957
- element: () => this.querySelector(".modal-container-root"),
7958
- setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
7959
- settled: () => this.updateComplete
7960
- });
7961
7959
  static requiredChildTags = ["w3a-tx-confirm-content"];
7962
7960
  static strictChildDefinitions = true;
7963
7961
  static keepDefinitions = [tx_confirm_content_default];
@@ -7990,57 +7988,6 @@ var init_viewer_modal = __esm(() => {
7990
7988
  otpResendStatus: { type: String, attribute: false },
7991
7989
  otpSubmitAnimating: { type: Boolean, attribute: false }
7992
7990
  };
7993
- totalAmount = "";
7994
- method = "";
7995
- fingerprint = "";
7996
- body = "";
7997
- title = "";
7998
- cancelText = "Cancel";
7999
- confirmText = "Next";
8000
- model;
8001
- securityContext;
8002
- loading = false;
8003
- errorMessage = undefined;
8004
- theme = "dark";
8005
- appearance;
8006
- nearExplorerUrl;
8007
- tempoExplorerUrl;
8008
- evmExplorerUrl;
8009
- signingAuthMode;
8010
- emailOtpPrompt;
8011
- otpCode = "";
8012
- otpError = "";
8013
- otpResendBusy = false;
8014
- otpResendUntilMs = 0;
8015
- otpResendStatus = "";
8016
- otpSubmitAnimating = false;
8017
- _otpResendTimer = null;
8018
- _otpSubmitTimer = null;
8019
- _lastAutoOtpSubmitCode = "";
8020
- intentDigest;
8021
- deferClose = false;
8022
- _stylesReady = false;
8023
- _stylePromises = [];
8024
- _stylesAwaiting = null;
8025
- _ensureTreeDefinition = TxTree_default;
8026
- _ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
8027
- _onKeyDown = (e6) => {
8028
- if (e6.key === "Escape" || e6.key === "Esc") {
8029
- e6.preventDefault();
8030
- this._handleCancel();
8031
- }
8032
- };
8033
- _onWindowMessage = (ev) => {
8034
- const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
8035
- if (!data || typeof data.type !== "string")
8036
- return;
8037
- if (data.type === "MODAL_TIMEOUT") {
8038
- const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
8039
- this.loading = false;
8040
- this.errorMessage = msg;
8041
- this._handleCancel();
8042
- }
8043
- };
8044
7991
  _chainLabelForModel() {
8045
7992
  switch (this.model?.chain) {
8046
7993
  case "tempo":
@@ -8078,12 +8025,6 @@ var init_viewer_modal = __esm(() => {
8078
8025
  _isStandaloneSurface() {
8079
8026
  return this.closest("w3a-tx-confirmer")?.getAttribute("data-w3a-confirm-surface") === "standalone";
8080
8027
  }
8081
- _handleBackdropClick = (event) => {
8082
- if (!this._isStandaloneSurface())
8083
- return;
8084
- event.stopPropagation();
8085
- this._handleCancel();
8086
- };
8087
8028
  _authHeadingFallback() {
8088
8029
  if (this._passkeyRegistrationDisplay())
8089
8030
  return "Create your passkey";
@@ -8149,9 +8090,6 @@ var init_viewer_modal = __esm(() => {
8149
8090
  </div>
8150
8091
  `;
8151
8092
  }
8152
- _onPasskeyRegistrationConfirm = () => {
8153
- this._finishConfirm();
8154
- };
8155
8093
  _renderPasskeyRegistrationModal(display) {
8156
8094
  return x`
8157
8095
  ${this._isStandaloneSurface() ? x`<div class="standalone-surface-backdrop" @click=${this._handleBackdropClick}></div>` : ""}
@@ -8186,21 +8124,6 @@ var init_viewer_modal = __esm(() => {
8186
8124
  </div>
8187
8125
  `;
8188
8126
  }
8189
- _onOtpInput = (event) => {
8190
- const input = event.currentTarget;
8191
- const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
8192
- this.otpCode = code;
8193
- this.otpError = "";
8194
- if (code.length < 6) {
8195
- this._lastAutoOtpSubmitCode = "";
8196
- this._resetOtpSubmitAnimation();
8197
- return;
8198
- }
8199
- if (this.loading || this._lastAutoOtpSubmitCode === code)
8200
- return;
8201
- this._lastAutoOtpSubmitCode = code;
8202
- this._submitEmailOtpAfterFade(code);
8203
- };
8204
8127
  _clearOtpSubmitTimer() {
8205
8128
  if (this._otpSubmitTimer != null)
8206
8129
  window.clearTimeout(this._otpSubmitTimer);
@@ -8244,40 +8167,6 @@ var init_viewer_modal = __esm(() => {
8244
8167
  return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
8245
8168
  return this.otpResendStatus || "Resend code";
8246
8169
  }
8247
- _onOtpResend = () => {
8248
- const resend = this.emailOtpPrompt?.onResend;
8249
- if (typeof resend !== "function" || this.otpResendBusy || this.loading)
8250
- return;
8251
- if (this.otpResendUntilMs > Date.now())
8252
- return;
8253
- this.otpError = "";
8254
- this.otpResendStatus = "";
8255
- this._lastAutoOtpSubmitCode = "";
8256
- this._resetOtpSubmitAnimation();
8257
- this.otpResendBusy = true;
8258
- this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
8259
- this.requestUpdate();
8260
- (async () => {
8261
- try {
8262
- const result = await resend();
8263
- const challengeId = String(result?.challengeId || "").trim();
8264
- const emailHint = String(result?.emailHint || "").trim();
8265
- if (challengeId) {
8266
- this.emailOtpPrompt = {
8267
- ...this.emailOtpPrompt,
8268
- challengeId,
8269
- ...emailHint ? { emailHint } : {}
8270
- };
8271
- }
8272
- this.otpResendStatus = "Code sent";
8273
- } catch (error) {
8274
- this.otpError = formatEmailOtpResendError2(error);
8275
- } finally {
8276
- this.otpResendBusy = false;
8277
- this.requestUpdate();
8278
- }
8279
- })();
8280
- };
8281
8170
  _renderEmailOtpPrompt() {
8282
8171
  if (!this._isEmailOtpMode())
8283
8172
  return "";
@@ -8322,11 +8211,6 @@ var init_viewer_modal = __esm(() => {
8322
8211
  </div>
8323
8212
  `;
8324
8213
  }
8325
- _onFundingNoticeCopy = (event) => {
8326
- const target = event.currentTarget;
8327
- const accountId = String(target?.dataset.copyValue || "").trim();
8328
- copyTextToClipboard(accountId);
8329
- };
8330
8214
  _renderConfirmationBody() {
8331
8215
  const body = String(this.body || "").trim();
8332
8216
  if (!body)
@@ -8357,12 +8241,123 @@ var init_viewer_modal = __esm(() => {
8357
8241
  }
8358
8242
  constructor() {
8359
8243
  super();
8244
+ this._heightReflow = createSurfaceHeightReflow({
8245
+ reason: "confirm-body",
8246
+ element: () => this.querySelector(".modal-container-root"),
8247
+ setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
8248
+ settled: () => this.updateComplete
8249
+ });
8250
+ this.totalAmount = "";
8251
+ this.method = "";
8252
+ this.fingerprint = "";
8253
+ this.body = "";
8254
+ this.title = "";
8255
+ this.cancelText = "Cancel";
8256
+ this.confirmText = "Next";
8257
+ this.loading = false;
8258
+ this.errorMessage = undefined;
8259
+ this.theme = "dark";
8260
+ this.otpCode = "";
8261
+ this.otpError = "";
8262
+ this.otpResendBusy = false;
8263
+ this.otpResendUntilMs = 0;
8264
+ this.otpResendStatus = "";
8265
+ this.otpSubmitAnimating = false;
8266
+ this._otpResendTimer = null;
8267
+ this._otpSubmitTimer = null;
8268
+ this._lastAutoOtpSubmitCode = "";
8269
+ this.deferClose = false;
8270
+ this._stylesReady = false;
8271
+ this._stylePromises = [];
8272
+ this._stylesAwaiting = null;
8273
+ this._ensureTreeDefinition = TxTree_default;
8274
+ this._ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
8275
+ this._onKeyDown = (e) => {
8276
+ if (e.key === "Escape" || e.key === "Esc") {
8277
+ e.preventDefault();
8278
+ this._handleCancel();
8279
+ }
8280
+ };
8281
+ this._onWindowMessage = (ev) => {
8282
+ const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
8283
+ if (!data || typeof data.type !== "string")
8284
+ return;
8285
+ if (data.type === "MODAL_TIMEOUT") {
8286
+ const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
8287
+ this.loading = false;
8288
+ this.errorMessage = msg;
8289
+ this._handleCancel();
8290
+ }
8291
+ };
8292
+ this._handleBackdropClick = (event) => {
8293
+ if (!this._isStandaloneSurface())
8294
+ return;
8295
+ event.stopPropagation();
8296
+ this._handleCancel();
8297
+ };
8298
+ this._onPasskeyRegistrationConfirm = () => {
8299
+ this._finishConfirm();
8300
+ };
8301
+ this._onOtpInput = (event) => {
8302
+ const input = event.currentTarget;
8303
+ const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
8304
+ this.otpCode = code;
8305
+ this.otpError = "";
8306
+ if (code.length < 6) {
8307
+ this._lastAutoOtpSubmitCode = "";
8308
+ this._resetOtpSubmitAnimation();
8309
+ return;
8310
+ }
8311
+ if (this.loading || this._lastAutoOtpSubmitCode === code)
8312
+ return;
8313
+ this._lastAutoOtpSubmitCode = code;
8314
+ this._submitEmailOtpAfterFade(code);
8315
+ };
8316
+ this._onOtpResend = () => {
8317
+ const resend = this.emailOtpPrompt?.onResend;
8318
+ if (typeof resend !== "function" || this.otpResendBusy || this.loading)
8319
+ return;
8320
+ if (this.otpResendUntilMs > Date.now())
8321
+ return;
8322
+ this.otpError = "";
8323
+ this.otpResendStatus = "";
8324
+ this._lastAutoOtpSubmitCode = "";
8325
+ this._resetOtpSubmitAnimation();
8326
+ this.otpResendBusy = true;
8327
+ this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
8328
+ this.requestUpdate();
8329
+ (async () => {
8330
+ try {
8331
+ const result = await resend();
8332
+ const challengeId = String(result?.challengeId || "").trim();
8333
+ const emailHint = String(result?.emailHint || "").trim();
8334
+ if (challengeId) {
8335
+ this.emailOtpPrompt = {
8336
+ ...this.emailOtpPrompt,
8337
+ challengeId,
8338
+ ...emailHint ? { emailHint } : {}
8339
+ };
8340
+ }
8341
+ this.otpResendStatus = "Code sent";
8342
+ } catch (error) {
8343
+ this.otpError = formatEmailOtpResendError2(error);
8344
+ } finally {
8345
+ this.otpResendBusy = false;
8346
+ this.requestUpdate();
8347
+ }
8348
+ })();
8349
+ };
8350
+ this._onFundingNoticeCopy = (event) => {
8351
+ const target = event.currentTarget;
8352
+ const accountId = String(target?.dataset.copyValue || "").trim();
8353
+ copyTextToClipboard(accountId);
8354
+ };
8355
+ this._ownsThemeAttr = false;
8360
8356
  const root = document?.documentElement || null;
8361
8357
  if (root) {
8362
8358
  this._stylePromises.push(ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css"), ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css"), ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"), ensureExternalStyles(root, "halo-border.css", "data-w3a-halo-border-css"), ensureExternalStyles(root, "passkey-halo-loading.css", "data-w3a-passkey-halo-loading-css"));
8363
8359
  }
8364
8360
  }
8365
- _ownsThemeAttr = false;
8366
8361
  willUpdate(changedProperties) {
8367
8362
  super.willUpdate(changedProperties);
8368
8363
  if (this.hasUpdated)
@@ -8434,8 +8429,8 @@ var init_viewer_modal = __esm(() => {
8434
8429
  if (this._stylesReady)
8435
8430
  return true;
8436
8431
  if (!this._stylesAwaiting) {
8437
- const p4 = Promise.all(this._stylePromises).then(() => new Promise((r6) => requestAnimationFrame(() => requestAnimationFrame(() => r6()))));
8438
- this._stylesAwaiting = p4.then(() => {
8432
+ const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
8433
+ this._stylesAwaiting = p.then(() => {
8439
8434
  this._stylesReady = true;
8440
8435
  this.requestUpdate();
8441
8436
  });
@@ -8674,18 +8669,18 @@ var init_tx_confirmer_wrapper = __esm(() => {
8674
8669
  evmExplorerUrl: { type: String, attribute: "evm-explorer-url" }
8675
8670
  };
8676
8671
  static keepDefinitions = [ModalTxConfirmElement, DrawerTxConfirmerElement];
8677
- childRef = e5();
8678
- redispatchingEvent = false;
8679
- interactiveAnnounced = false;
8680
- currentChild = null;
8681
- boundConfirmListener = (event) => {
8682
- this.handleChildConfirm(event);
8683
- };
8684
- boundCancelListener = (_event) => {
8685
- this.handleChildCancel();
8686
- };
8687
8672
  constructor() {
8688
8673
  super();
8674
+ this.childRef = e5();
8675
+ this.redispatchingEvent = false;
8676
+ this.interactiveAnnounced = false;
8677
+ this.currentChild = null;
8678
+ this.boundConfirmListener = (event) => {
8679
+ this.handleChildConfirm(event);
8680
+ };
8681
+ this.boundCancelListener = (_event) => {
8682
+ this.handleChildCancel();
8683
+ };
8689
8684
  this.variant = DEFAULT_VARIANT;
8690
8685
  this.nearAccountId = "";
8691
8686
  this.txSigningRequests = undefined;