@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.
- package/LICENSE.md +201 -0
- package/THIRD_PARTY_NOTICES.md +15095 -0
- package/dist/.build-inputs.sha256 +1 -1
- package/dist/esm/SeamsWeb/signingSurface/BrowserSigningSurface.js +7 -14
- package/dist/esm/core/signingEngine/session/identity/exactWalletSessionReader.js +2 -27
- package/dist/esm/react/SeamsWeb/signingSurface/BrowserSigningSurface.js +7 -14
- package/dist/esm/react/core/signingEngine/session/identity/exactWalletSessionReader.js +2 -27
- package/dist/esm/sdk/export-private-key-viewer.js +1420 -1425
- package/dist/esm/sdk/halo-border.js +1424 -1429
- package/dist/esm/sdk/{host-BqwEYhX0.js → host-DNmO0eve.js} +2 -2
- package/dist/esm/sdk/passkey-halo-loading.js +1426 -1431
- package/dist/{public/sdk/registrationPreparationPreload-u3ruCmpF.js → esm/sdk/registrationPreparationPreload-CwUkRwVz.js} +1 -1
- package/dist/esm/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/{public/sdk/runtime-auth-Da9yQyaD.js → esm/sdk/runtime-auth-dpoaCtkK.js} +2 -2
- package/dist/esm/sdk/{runtime-device-link-DNlzlwrr.js → runtime-device-link-C75epnbj.js} +1 -1
- package/dist/{public/sdk/runtime-ecdsa-tempo-B7dBVcCI.js → esm/sdk/runtime-ecdsa-tempo-CV-E-iZG.js} +1 -1
- package/dist/{public/sdk/runtime-email-otp-CckVQZJC.js → esm/sdk/runtime-email-otp-V0mdMD_t.js} +1 -1
- package/dist/{public/sdk/runtime-export-WAiBwZL_.js → esm/sdk/runtime-export-C4HO5ysH.js} +1 -1
- package/dist/esm/sdk/{runtime-near-DBJ4KfFv.js → runtime-near-DlviFQWy.js} +1 -1
- package/dist/{public/sdk/runtime-preferences-DmH7eMHH.js → esm/sdk/runtime-preferences-DyJidFuf.js} +1 -1
- package/dist/esm/sdk/{runtime-recovery-kPgl9nTT.js → runtime-recovery-CHDE5gl0.js} +1 -1
- package/dist/esm/sdk/{runtimeContext-BorCgXo5.js → runtimeContext-D_TkUM6Z.js} +6 -38
- package/dist/esm/sdk/{runtimeLoader-BKQjNgXO.js → runtimeLoader-DxiLgXPm.js} +9 -9
- package/dist/esm/sdk/tx-confirm-ui.js +1400 -1407
- package/dist/esm/sdk/w3a-tx-confirmer.js +1442 -1447
- package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker.js +4 -4
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
- package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/headers.manifest.json +1 -1
- package/dist/public/sdk/export-private-key-viewer.js +1420 -1425
- package/dist/public/sdk/halo-border.js +1424 -1429
- package/dist/public/sdk/{host-BqwEYhX0.js → host-DNmO0eve.js} +2 -2
- package/dist/public/sdk/passkey-halo-loading.js +1426 -1431
- package/dist/{esm/sdk/registrationPreparationPreload-u3ruCmpF.js → public/sdk/registrationPreparationPreload-CwUkRwVz.js} +1 -1
- package/dist/public/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/{esm/sdk/runtime-auth-Da9yQyaD.js → public/sdk/runtime-auth-dpoaCtkK.js} +2 -2
- package/dist/public/sdk/{runtime-device-link-DNlzlwrr.js → runtime-device-link-C75epnbj.js} +1 -1
- package/dist/{esm/sdk/runtime-ecdsa-tempo-B7dBVcCI.js → public/sdk/runtime-ecdsa-tempo-CV-E-iZG.js} +1 -1
- package/dist/{esm/sdk/runtime-email-otp-CckVQZJC.js → public/sdk/runtime-email-otp-V0mdMD_t.js} +1 -1
- package/dist/{esm/sdk/runtime-export-WAiBwZL_.js → public/sdk/runtime-export-C4HO5ysH.js} +1 -1
- package/dist/public/sdk/{runtime-near-DBJ4KfFv.js → runtime-near-DlviFQWy.js} +1 -1
- package/dist/{esm/sdk/runtime-preferences-DmH7eMHH.js → public/sdk/runtime-preferences-DyJidFuf.js} +1 -1
- package/dist/public/sdk/{runtime-recovery-kPgl9nTT.js → runtime-recovery-CHDE5gl0.js} +1 -1
- package/dist/public/sdk/{runtimeContext-BorCgXo5.js → runtimeContext-D_TkUM6Z.js} +6 -38
- package/dist/public/sdk/{runtimeLoader-BKQjNgXO.js → runtimeLoader-DxiLgXPm.js} +9 -9
- package/dist/public/sdk/tx-confirm-ui.js +1400 -1407
- package/dist/public/sdk/w3a-tx-confirmer.js +1442 -1447
- package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/public/sdk/workers/device-linking-key.worker.js +133 -140
- package/dist/public/sdk/workers/ecdsa-derivation-client.worker.js +94 -188
- package/dist/public/sdk/workers/ecdsa-online-client.worker.js +6 -7
- package/dist/public/sdk/workers/ecdsa-presign-client.worker.js +6 -7
- package/dist/public/sdk/workers/email-otp.worker.js +39 -52
- package/dist/public/sdk/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/evm-crypto.worker.js +3 -3
- package/dist/public/sdk/workers/evm_crypto.wasm +0 -0
- package/dist/public/sdk/workers/evm_crypto_bg.wasm +0 -0
- package/dist/public/sdk/workers/near-signer.worker.js +9 -9
- package/dist/public/sdk/workers/near_signer.wasm +0 -0
- package/dist/public/sdk/workers/passkey-confirm.worker.js +4 -4
- package/dist/public/sdk/workers/passkey-mpc-export.worker.js +9 -19
- package/dist/public/sdk/workers/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/public/sdk/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/sdk/workers/shamir3pass.worker.js +3 -3
- package/dist/public/sdk/workers/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/tempo-signer.worker.js +3 -3
- package/dist/public/sdk/workers/tempo_signer.wasm +0 -0
- package/dist/public/sdk/workers/tempo_signer_bg.wasm +0 -0
- package/dist/public/sdk/workers/wallet-custody-ceremony.worker.js +55 -1244
- package/dist/public/sdk/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/public/sdk/workers/wasm_signer_worker_bg.wasm +0 -0
- package/dist/public/wallet-assets.manifest.json +32 -32
- package/dist/types/wallet/src/SeamsWeb/signingSurface/BrowserSigningSurface.d.ts +4 -4
- package/dist/types/wallet/src/core/signingEngine/session/identity/exactWalletSessionReader.d.ts +1 -9
- package/dist/workers/device-linking-key.worker.js +133 -140
- package/dist/workers/ecdsa-derivation-client.worker.js +94 -188
- package/dist/workers/ecdsa-online-client.worker.js +6 -7
- package/dist/workers/ecdsa-presign-client.worker.js +6 -7
- package/dist/workers/email-otp.worker.js +39 -52
- package/dist/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/workers/evm-crypto.worker.js +3 -3
- package/dist/workers/evm_crypto.wasm +0 -0
- package/dist/workers/evm_crypto_bg.wasm +0 -0
- package/dist/workers/near-signer.worker.js +9 -9
- package/dist/workers/near_signer.wasm +0 -0
- package/dist/workers/passkey-confirm.worker.js +4 -4
- package/dist/workers/passkey-mpc-export.worker.js +9 -19
- package/dist/workers/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/workers/shamir3pass.worker.js +3 -3
- package/dist/workers/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/workers/tempo-signer.worker.js +3 -3
- package/dist/workers/tempo_signer.wasm +0 -0
- package/dist/workers/tempo_signer_bg.wasm +0 -0
- package/dist/workers/wallet-custody-ceremony.worker.js +55 -1244
- package/dist/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/workers/wasm_signer_worker_bg.wasm +0 -0
- package/package.json +6 -3
- 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: (
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
9
13
|
});
|
|
10
14
|
};
|
|
11
|
-
var __esm = (fn, 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(
|
|
16
|
-
if (this._$cssResult$ = true,
|
|
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 =
|
|
32
|
+
this.cssText = t, this.t = e;
|
|
19
33
|
}
|
|
20
34
|
get styleSheet() {
|
|
21
|
-
let
|
|
22
|
-
const
|
|
23
|
-
if (e &&
|
|
24
|
-
const
|
|
25
|
-
|
|
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
|
|
41
|
+
return t;
|
|
28
42
|
}
|
|
29
43
|
toString() {
|
|
30
44
|
return this.cssText;
|
|
31
45
|
}
|
|
32
46
|
}
|
|
33
|
-
var t, e, s, o, r = (
|
|
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
|
-
|
|
49
|
+
s.adoptedStyleSheets = o.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
36
50
|
else
|
|
37
|
-
for (const
|
|
38
|
-
const
|
|
39
|
-
|
|
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 ? (
|
|
48
|
-
let
|
|
49
|
-
for (const
|
|
50
|
-
|
|
51
|
-
return r(
|
|
52
|
-
})(
|
|
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 = (
|
|
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(
|
|
66
|
-
switch (
|
|
79
|
+
u = { toAttribute(t, s) {
|
|
80
|
+
switch (s) {
|
|
67
81
|
case Boolean:
|
|
68
|
-
|
|
82
|
+
t = t ? l : null;
|
|
69
83
|
break;
|
|
70
84
|
case Object:
|
|
71
85
|
case Array:
|
|
72
|
-
|
|
86
|
+
t = t == null ? t : JSON.stringify(t);
|
|
73
87
|
}
|
|
74
|
-
return
|
|
75
|
-
}, fromAttribute(
|
|
76
|
-
let
|
|
77
|
-
switch (
|
|
88
|
+
return t;
|
|
89
|
+
}, fromAttribute(t, s) {
|
|
90
|
+
let i = t;
|
|
91
|
+
switch (s) {
|
|
78
92
|
case Boolean:
|
|
79
|
-
|
|
93
|
+
i = t !== null;
|
|
80
94
|
break;
|
|
81
95
|
case Number:
|
|
82
|
-
|
|
96
|
+
i = t === null ? null : Number(t);
|
|
83
97
|
break;
|
|
84
98
|
case Object:
|
|
85
99
|
case Array:
|
|
86
100
|
try {
|
|
87
|
-
|
|
88
|
-
} catch (
|
|
89
|
-
|
|
101
|
+
i = JSON.parse(t);
|
|
102
|
+
} catch (t) {
|
|
103
|
+
i = null;
|
|
90
104
|
}
|
|
91
105
|
}
|
|
92
|
-
return
|
|
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(
|
|
98
|
-
this._$Ei(), (this.l ??= []).push(
|
|
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(
|
|
104
|
-
if (
|
|
105
|
-
const
|
|
106
|
-
|
|
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(
|
|
110
|
-
const { get:
|
|
111
|
-
return this[
|
|
112
|
-
}, set(
|
|
113
|
-
this[
|
|
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:
|
|
116
|
-
const
|
|
117
|
-
|
|
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(
|
|
121
|
-
return this.elementProperties.get(
|
|
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
|
|
127
|
-
|
|
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
|
|
134
|
-
for (const
|
|
135
|
-
this.createProperty(
|
|
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
|
|
138
|
-
if (
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
for (const [
|
|
142
|
-
this.elementProperties.set(
|
|
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 [
|
|
146
|
-
const
|
|
147
|
-
|
|
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(
|
|
152
|
-
const
|
|
153
|
-
if (Array.isArray(
|
|
154
|
-
const
|
|
155
|
-
for (const
|
|
156
|
-
|
|
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
|
-
|
|
159
|
-
return
|
|
172
|
+
s !== undefined && i.push(c(s));
|
|
173
|
+
return i;
|
|
160
174
|
}
|
|
161
|
-
static _$Eu(
|
|
162
|
-
const
|
|
163
|
-
return
|
|
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((
|
|
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(
|
|
172
|
-
(this._$EO ??= new Set).add(
|
|
185
|
+
addController(t) {
|
|
186
|
+
(this._$EO ??= new Set).add(t), this.renderRoot !== undefined && this.isConnected && t.hostConnected?.();
|
|
173
187
|
}
|
|
174
|
-
removeController(
|
|
175
|
-
this._$EO?.delete(
|
|
188
|
+
removeController(t) {
|
|
189
|
+
this._$EO?.delete(t);
|
|
176
190
|
}
|
|
177
191
|
_$E_() {
|
|
178
|
-
const
|
|
179
|
-
for (const
|
|
180
|
-
this.hasOwnProperty(
|
|
181
|
-
|
|
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
|
|
185
|
-
return S(
|
|
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((
|
|
202
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t) => t.hostConnected?.());
|
|
189
203
|
}
|
|
190
|
-
enableUpdating(
|
|
204
|
+
enableUpdating(t) {}
|
|
191
205
|
disconnectedCallback() {
|
|
192
|
-
this._$EO?.forEach((
|
|
206
|
+
this._$EO?.forEach((t) => t.hostDisconnected?.());
|
|
193
207
|
}
|
|
194
|
-
attributeChangedCallback(
|
|
195
|
-
this._$AK(
|
|
208
|
+
attributeChangedCallback(t, s, i) {
|
|
209
|
+
this._$AK(t, i);
|
|
196
210
|
}
|
|
197
|
-
_$ET(
|
|
198
|
-
const
|
|
199
|
-
if (
|
|
200
|
-
const
|
|
201
|
-
this._$Em =
|
|
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(
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
207
|
-
const
|
|
208
|
-
this._$Em =
|
|
209
|
-
const
|
|
210
|
-
this[
|
|
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(
|
|
214
|
-
if (
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
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(
|
|
232
|
+
this.C(t, s, i);
|
|
219
233
|
}
|
|
220
234
|
this.isUpdatePending === false && (this._$ES = this._$EP());
|
|
221
235
|
}
|
|
222
|
-
C(
|
|
223
|
-
|
|
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 (
|
|
230
|
-
Promise.reject(
|
|
243
|
+
} catch (t) {
|
|
244
|
+
Promise.reject(t);
|
|
231
245
|
}
|
|
232
|
-
const
|
|
233
|
-
return
|
|
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 [
|
|
244
|
-
this[
|
|
257
|
+
for (const [t, s] of this._$Ep)
|
|
258
|
+
this[t] = s;
|
|
245
259
|
this._$Ep = undefined;
|
|
246
260
|
}
|
|
247
|
-
const
|
|
248
|
-
if (
|
|
249
|
-
for (const [
|
|
250
|
-
const { wrapped:
|
|
251
|
-
|
|
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
|
|
255
|
-
const
|
|
268
|
+
let t = false;
|
|
269
|
+
const s = this._$AL;
|
|
256
270
|
try {
|
|
257
|
-
|
|
258
|
-
} catch (
|
|
259
|
-
throw
|
|
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
|
-
|
|
275
|
+
t && this._$AE(s);
|
|
262
276
|
}
|
|
263
|
-
willUpdate(
|
|
264
|
-
_$AE(
|
|
265
|
-
this._$EO?.forEach((
|
|
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(
|
|
290
|
+
shouldUpdate(t) {
|
|
277
291
|
return true;
|
|
278
292
|
}
|
|
279
|
-
update(
|
|
280
|
-
this._$Eq &&= this._$Eq.forEach((
|
|
293
|
+
update(t) {
|
|
294
|
+
this._$Eq &&= this._$Eq.forEach((t) => this._$ET(t, this[t])), this._$EM();
|
|
281
295
|
}
|
|
282
|
-
updated(
|
|
283
|
-
firstUpdated(
|
|
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(
|
|
290
|
-
if (!a2(
|
|
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(
|
|
306
|
+
return s2 !== undefined ? s2.createHTML(i) : i;
|
|
293
307
|
}
|
|
294
308
|
|
|
295
309
|
class N {
|
|
296
|
-
constructor({ strings:
|
|
297
|
-
let
|
|
310
|
+
constructor({ strings: t, _$litType$: s }, n) {
|
|
311
|
+
let r;
|
|
298
312
|
this.parts = [];
|
|
299
|
-
let
|
|
300
|
-
const
|
|
301
|
-
if (this.el = N.createElement(
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
for (;(
|
|
306
|
-
if (
|
|
307
|
-
if (
|
|
308
|
-
for (const
|
|
309
|
-
if (
|
|
310
|
-
const
|
|
311
|
-
|
|
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
|
-
|
|
314
|
-
if ($.test(
|
|
315
|
-
const
|
|
316
|
-
if (
|
|
317
|
-
|
|
318
|
-
for (let
|
|
319
|
-
|
|
320
|
-
|
|
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 (
|
|
324
|
-
if (
|
|
325
|
-
|
|
337
|
+
} else if (r.nodeType === 8)
|
|
338
|
+
if (r.data === o3)
|
|
339
|
+
d.push({ type: 2, index: c });
|
|
326
340
|
else {
|
|
327
|
-
let
|
|
328
|
-
for (;(
|
|
329
|
-
|
|
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
|
-
|
|
345
|
+
c++;
|
|
332
346
|
}
|
|
333
347
|
}
|
|
334
|
-
static createElement(
|
|
335
|
-
const
|
|
336
|
-
return
|
|
348
|
+
static createElement(t, i) {
|
|
349
|
+
const s = r3.createElement("template");
|
|
350
|
+
return s.innerHTML = t, s;
|
|
337
351
|
}
|
|
338
352
|
}
|
|
339
|
-
function S2(
|
|
340
|
-
if (
|
|
341
|
-
return
|
|
342
|
-
let
|
|
343
|
-
const
|
|
344
|
-
return
|
|
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(
|
|
349
|
-
this._$AV = [], this._$AN = undefined, this._$AD =
|
|
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(
|
|
358
|
-
const { el: { content:
|
|
359
|
-
C.currentNode =
|
|
360
|
-
let
|
|
361
|
-
for (;
|
|
362
|
-
if (
|
|
363
|
-
let
|
|
364
|
-
|
|
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
|
-
|
|
380
|
+
o !== l?.index && (h = C.nextNode(), o++);
|
|
367
381
|
}
|
|
368
|
-
return C.currentNode = r3,
|
|
382
|
+
return C.currentNode = r3, e;
|
|
369
383
|
}
|
|
370
|
-
p(
|
|
371
|
-
let
|
|
372
|
-
for (const
|
|
373
|
-
|
|
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(
|
|
382
|
-
this.type = 2, this._$AH = E, this._$AN = undefined, this._$AA =
|
|
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
|
|
386
|
-
const
|
|
387
|
-
return
|
|
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(
|
|
396
|
-
|
|
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(
|
|
399
|
-
return this._$AA.parentNode.insertBefore(
|
|
412
|
+
O(t) {
|
|
413
|
+
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
400
414
|
}
|
|
401
|
-
T(
|
|
402
|
-
this._$AH !==
|
|
415
|
+
T(t) {
|
|
416
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
403
417
|
}
|
|
404
|
-
_(
|
|
405
|
-
this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data =
|
|
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
|
-
$(
|
|
408
|
-
const { values:
|
|
409
|
-
if (this._$AH?._$AD ===
|
|
410
|
-
this._$AH.p(
|
|
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
|
|
413
|
-
|
|
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(
|
|
417
|
-
let
|
|
418
|
-
return
|
|
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(
|
|
434
|
+
k(t) {
|
|
421
435
|
a2(this._$AH) || (this._$AH = [], this._$AR());
|
|
422
|
-
const
|
|
423
|
-
let
|
|
424
|
-
for (const
|
|
425
|
-
|
|
426
|
-
|
|
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(
|
|
429
|
-
for (this._$AP?.(false, true,
|
|
430
|
-
const
|
|
431
|
-
|
|
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(
|
|
435
|
-
this._$AM === undefined && (this._$Cv =
|
|
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(
|
|
447
|
-
this.type = 1, this._$AH = E, this._$AN = undefined, this.element =
|
|
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(
|
|
450
|
-
const
|
|
451
|
-
let
|
|
452
|
-
if (
|
|
453
|
-
|
|
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
|
|
456
|
-
let
|
|
457
|
-
for (
|
|
458
|
-
|
|
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
|
-
|
|
474
|
+
o && !e && this.j(t);
|
|
461
475
|
}
|
|
462
|
-
j(
|
|
463
|
-
|
|
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(
|
|
469
|
-
this.element =
|
|
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(
|
|
475
|
-
S2(this,
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
var t2, i3, s2, e3 = "$lit$", h2, o3, n3, r3, l2 = () => r3.createComment(""), c3 = (
|
|
479
|
-
\f\r]`, f2, v, _, m, p2, g, $, y2 = (
|
|
480
|
-
const
|
|
481
|
-
let
|
|
482
|
-
for (let
|
|
483
|
-
const
|
|
484
|
-
let
|
|
485
|
-
for (;
|
|
486
|
-
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
return [P(
|
|
491
|
-
}, H, I, L, Z, j, B = (
|
|
492
|
-
const
|
|
493
|
-
let
|
|
494
|
-
if (
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
}
|
|
498
|
-
return
|
|
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: (
|
|
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(
|
|
529
|
-
this.element[this.name] =
|
|
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(
|
|
537
|
-
this.element.toggleAttribute(this.name, !!
|
|
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(
|
|
542
|
-
super(
|
|
555
|
+
constructor(t, i, s, e, h) {
|
|
556
|
+
super(t, i, s, e, h), this.type = 5;
|
|
543
557
|
}
|
|
544
|
-
_$AI(
|
|
545
|
-
if ((
|
|
558
|
+
_$AI(t, i = this) {
|
|
559
|
+
if ((t = S2(this, t, i, 0) ?? E) === T)
|
|
546
560
|
return;
|
|
547
|
-
const
|
|
548
|
-
|
|
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(
|
|
551
|
-
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element,
|
|
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
|
|
573
|
-
return this.renderOptions.renderBefore ??=
|
|
586
|
+
const t = super.createRenderRoot();
|
|
587
|
+
return this.renderOptions.renderBefore ??= t.firstChild, t;
|
|
574
588
|
}
|
|
575
|
-
update(
|
|
576
|
-
const
|
|
577
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(
|
|
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);
|
|
@@ -608,16 +622,16 @@ function base(ALPHABET) {
|
|
|
608
622
|
throw new TypeError("Alphabet too long");
|
|
609
623
|
}
|
|
610
624
|
const BASE_MAP = new Uint8Array(256);
|
|
611
|
-
for (let
|
|
612
|
-
BASE_MAP[
|
|
625
|
+
for (let j = 0;j < BASE_MAP.length; j++) {
|
|
626
|
+
BASE_MAP[j] = 255;
|
|
613
627
|
}
|
|
614
|
-
for (let
|
|
615
|
-
const
|
|
616
|
-
const xc =
|
|
628
|
+
for (let i = 0;i < ALPHABET.length; i++) {
|
|
629
|
+
const x = ALPHABET.charAt(i);
|
|
630
|
+
const xc = x.charCodeAt(0);
|
|
617
631
|
if (BASE_MAP[xc] !== 255) {
|
|
618
|
-
throw new TypeError(
|
|
632
|
+
throw new TypeError(x + " is ambiguous");
|
|
619
633
|
}
|
|
620
|
-
BASE_MAP[xc] =
|
|
634
|
+
BASE_MAP[xc] = i;
|
|
621
635
|
}
|
|
622
636
|
const BASE = ALPHABET.length;
|
|
623
637
|
const LEADER = ALPHABET.charAt(0);
|
|
@@ -647,8 +661,8 @@ function base(ALPHABET) {
|
|
|
647
661
|
const b58 = new Uint8Array(size);
|
|
648
662
|
while (pbegin !== pend) {
|
|
649
663
|
let carry = source[pbegin];
|
|
650
|
-
let
|
|
651
|
-
for (let it1 = size - 1;(carry !== 0 ||
|
|
664
|
+
let i = 0;
|
|
665
|
+
for (let it1 = size - 1;(carry !== 0 || i < length) && it1 !== -1; it1--, i++) {
|
|
652
666
|
carry += 256 * b58[it1] >>> 0;
|
|
653
667
|
b58[it1] = carry % BASE >>> 0;
|
|
654
668
|
carry = carry / BASE >>> 0;
|
|
@@ -656,7 +670,7 @@ function base(ALPHABET) {
|
|
|
656
670
|
if (carry !== 0) {
|
|
657
671
|
throw new Error("Non-zero carry");
|
|
658
672
|
}
|
|
659
|
-
length =
|
|
673
|
+
length = i;
|
|
660
674
|
pbegin++;
|
|
661
675
|
}
|
|
662
676
|
let it2 = size - length;
|
|
@@ -694,8 +708,8 @@ function base(ALPHABET) {
|
|
|
694
708
|
if (carry === 255) {
|
|
695
709
|
return;
|
|
696
710
|
}
|
|
697
|
-
let
|
|
698
|
-
for (let it3 = size - 1;(carry !== 0 ||
|
|
711
|
+
let i = 0;
|
|
712
|
+
for (let it3 = size - 1;(carry !== 0 || i < length) && it3 !== -1; it3--, i++) {
|
|
699
713
|
carry += BASE * b256[it3] >>> 0;
|
|
700
714
|
b256[it3] = carry % 256 >>> 0;
|
|
701
715
|
carry = carry / 256 >>> 0;
|
|
@@ -703,7 +717,7 @@ function base(ALPHABET) {
|
|
|
703
717
|
if (carry !== 0) {
|
|
704
718
|
throw new Error("Non-zero carry");
|
|
705
719
|
}
|
|
706
|
-
length =
|
|
720
|
+
length = i;
|
|
707
721
|
psz++;
|
|
708
722
|
}
|
|
709
723
|
let it4 = size - length;
|
|
@@ -711,9 +725,9 @@ function base(ALPHABET) {
|
|
|
711
725
|
it4++;
|
|
712
726
|
}
|
|
713
727
|
const vch = new Uint8Array(zeroes + (size - it4));
|
|
714
|
-
let
|
|
728
|
+
let j = zeroes;
|
|
715
729
|
while (it4 !== size) {
|
|
716
|
-
vch[
|
|
730
|
+
vch[j++] = b256[it4++];
|
|
717
731
|
}
|
|
718
732
|
return vch;
|
|
719
733
|
}
|
|
@@ -753,14 +767,14 @@ var init_near = __esm(() => {
|
|
|
753
767
|
});
|
|
754
768
|
|
|
755
769
|
// ../shared-ts/src/utils/validation.ts
|
|
756
|
-
function isObject(
|
|
757
|
-
return
|
|
770
|
+
function isObject(x) {
|
|
771
|
+
return x !== null && typeof x === "object";
|
|
758
772
|
}
|
|
759
|
-
function isString(
|
|
760
|
-
return typeof
|
|
773
|
+
function isString(x) {
|
|
774
|
+
return typeof x === "string";
|
|
761
775
|
}
|
|
762
|
-
function isNumber(
|
|
763
|
-
return typeof
|
|
776
|
+
function isNumber(x) {
|
|
777
|
+
return typeof x === "number";
|
|
764
778
|
}
|
|
765
779
|
var init_validation = __esm(() => {
|
|
766
780
|
init_near();
|
|
@@ -806,11 +820,14 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
806
820
|
init_lit();
|
|
807
821
|
init_validation();
|
|
808
822
|
LitElementWithProps = class LitElementWithProps extends i4 {
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
823
|
+
constructor() {
|
|
824
|
+
super(...arguments);
|
|
825
|
+
this._varsSheet = null;
|
|
826
|
+
this._varsMap = {};
|
|
827
|
+
this._appearanceVarNames = new Set;
|
|
828
|
+
this._varsDocSheet = null;
|
|
829
|
+
this._varsClassName = null;
|
|
830
|
+
}
|
|
814
831
|
static keepDefinitions;
|
|
815
832
|
static requiredChildTags;
|
|
816
833
|
static strictChildDefinitions;
|
|
@@ -830,7 +847,6 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
830
847
|
propertyNames.forEach((prop) => this.upgradeProperty(prop));
|
|
831
848
|
}
|
|
832
849
|
}
|
|
833
|
-
styles;
|
|
834
850
|
connectedCallback() {
|
|
835
851
|
super.connectedCallback();
|
|
836
852
|
this.upgradeAllProperties();
|
|
@@ -842,7 +858,7 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
842
858
|
const { keepDefinitions, requiredChildTags, strictChildDefinitions } = ctor;
|
|
843
859
|
const defs = keepDefinitions;
|
|
844
860
|
if (defs && defs.length) {
|
|
845
|
-
for (const
|
|
861
|
+
for (const d of defs)
|
|
846
862
|
;
|
|
847
863
|
}
|
|
848
864
|
const req = requiredChildTags;
|
|
@@ -877,7 +893,7 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
877
893
|
const setVar = (name, val) => {
|
|
878
894
|
vars[name] = val;
|
|
879
895
|
};
|
|
880
|
-
const toKebab = (
|
|
896
|
+
const toKebab = (s) => this.camelToKebab(s);
|
|
881
897
|
const transformViewportUnits = (val) => {
|
|
882
898
|
if (!val || typeof val !== "string")
|
|
883
899
|
return val;
|
|
@@ -924,14 +940,14 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
924
940
|
setVar(colorMappings[key], maybeTransformed);
|
|
925
941
|
return;
|
|
926
942
|
}
|
|
927
|
-
const
|
|
928
|
-
if (
|
|
929
|
-
setVar(`--w3a-border-radius-${
|
|
943
|
+
const r = key.match(radiusMatcher);
|
|
944
|
+
if (r) {
|
|
945
|
+
setVar(`--w3a-border-radius-${r[1].toLowerCase()}`, maybeTransformed);
|
|
930
946
|
return;
|
|
931
947
|
}
|
|
932
|
-
const
|
|
933
|
-
if (
|
|
934
|
-
setVar(`--w3a-shadows-${
|
|
948
|
+
const s = key.match(shadowMatcher);
|
|
949
|
+
if (s) {
|
|
950
|
+
setVar(`--w3a-shadows-${s[1].toLowerCase()}`, maybeTransformed);
|
|
935
951
|
return;
|
|
936
952
|
}
|
|
937
953
|
setVar(`--w3a-${toKebab(key)}`, maybeTransformed);
|
|
@@ -942,8 +958,8 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
942
958
|
const kebabSection = toKebab(section);
|
|
943
959
|
const kebabProp = toKebab(prop);
|
|
944
960
|
const cssVarNew = `--w3a-${prefix}__${kebabSection}__${kebabProp}`;
|
|
945
|
-
const
|
|
946
|
-
vars[cssVarNew] =
|
|
961
|
+
const v = typeof value === "string" ? transformViewportUnits(value) : String(value);
|
|
962
|
+
vars[cssVarNew] = v;
|
|
947
963
|
});
|
|
948
964
|
}
|
|
949
965
|
});
|
|
@@ -954,12 +970,12 @@ var init_LitElementWithProps = __esm(() => {
|
|
|
954
970
|
}
|
|
955
971
|
setCssVars(vars) {
|
|
956
972
|
try {
|
|
957
|
-
for (const [
|
|
958
|
-
if (
|
|
973
|
+
for (const [k, v] of Object.entries(vars)) {
|
|
974
|
+
if (v == null)
|
|
959
975
|
continue;
|
|
960
|
-
this._varsMap[
|
|
976
|
+
this._varsMap[k] = String(v);
|
|
961
977
|
}
|
|
962
|
-
const decls = Object.entries(this._varsMap).map(([
|
|
978
|
+
const decls = Object.entries(this._varsMap).map(([k, v]) => `${k}: ${v};`).join(" ");
|
|
963
979
|
const cssTextShadow = `:host{ ${decls} }`;
|
|
964
980
|
const canUseConstructable = supportsConstructableStylesheets();
|
|
965
981
|
if (this.renderRoot instanceof ShadowRoot && canUseConstructable && hasAdoptedStyleSheets(this.renderRoot)) {
|
|
@@ -1049,16 +1065,16 @@ var init_lit_events = __esm(() => {
|
|
|
1049
1065
|
});
|
|
1050
1066
|
|
|
1051
1067
|
// src/core/signingEngine/uiConfirm/ui/lit-components/asset-base.ts
|
|
1052
|
-
function withTrailingSlash(
|
|
1053
|
-
return
|
|
1068
|
+
function withTrailingSlash(s) {
|
|
1069
|
+
return s.endsWith("/") ? s : s + "/";
|
|
1054
1070
|
}
|
|
1055
1071
|
function readGlobalEmbeddedBase() {
|
|
1056
1072
|
try {
|
|
1057
1073
|
if (typeof window === "undefined")
|
|
1058
1074
|
return;
|
|
1059
|
-
const
|
|
1060
|
-
if (typeof
|
|
1061
|
-
return withTrailingSlash(
|
|
1075
|
+
const v = window.__W3A_WALLET_SDK_BASE__;
|
|
1076
|
+
if (typeof v === "string" && v.length > 0)
|
|
1077
|
+
return withTrailingSlash(v);
|
|
1062
1078
|
} catch {}
|
|
1063
1079
|
return;
|
|
1064
1080
|
}
|
|
@@ -1067,14 +1083,14 @@ function deriveFromModuleUrl() {
|
|
|
1067
1083
|
const moduleUrl = String(import.meta.url || "").trim();
|
|
1068
1084
|
if (!moduleUrl)
|
|
1069
1085
|
return;
|
|
1070
|
-
const
|
|
1071
|
-
const
|
|
1072
|
-
const href =
|
|
1086
|
+
const base = typeof window !== "undefined" ? window.location.href : undefined;
|
|
1087
|
+
const u = base ? new URL(moduleUrl, base) : new URL(moduleUrl);
|
|
1088
|
+
const href = u.toString();
|
|
1073
1089
|
const idx = href.indexOf(SDK_SEGMENT);
|
|
1074
1090
|
if (idx > 0) {
|
|
1075
1091
|
return withTrailingSlash(href.slice(0, idx + SDK_SEGMENT.length));
|
|
1076
1092
|
}
|
|
1077
|
-
const origin =
|
|
1093
|
+
const origin = u.origin;
|
|
1078
1094
|
if (origin && /^https?:/i.test(origin)) {
|
|
1079
1095
|
return withTrailingSlash(origin + "/sdk");
|
|
1080
1096
|
}
|
|
@@ -1088,22 +1104,22 @@ var SDK_SEGMENT = "/sdk/";
|
|
|
1088
1104
|
|
|
1089
1105
|
// src/core/signingEngine/uiConfirm/ui/lit-components/css/css-loader.ts
|
|
1090
1106
|
function resolveStylesheetUrl(assetName) {
|
|
1091
|
-
const
|
|
1092
|
-
const join = (
|
|
1093
|
-
if (/^https?:/i.test(
|
|
1094
|
-
return `${join(
|
|
1107
|
+
const base = resolveEmbeddedBase();
|
|
1108
|
+
const join = (s) => s.endsWith("/") ? s : s + "/";
|
|
1109
|
+
if (/^https?:/i.test(base))
|
|
1110
|
+
return `${join(base)}${assetName}`;
|
|
1095
1111
|
try {
|
|
1096
1112
|
if (!warnedRelativeBaseOnce && typeof document !== "undefined" && document.URL === "about:srcdoc") {
|
|
1097
1113
|
warnedRelativeBaseOnce = true;
|
|
1098
|
-
console.warn(`[W3A][css-loader] Embedded SDK base is relative: "${
|
|
1114
|
+
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" } }, `);
|
|
1099
1115
|
}
|
|
1100
1116
|
} catch {}
|
|
1101
1117
|
const origin = typeof window !== "undefined" && window.location ? window.location.origin : "";
|
|
1102
1118
|
if (origin && origin !== "null" && /^https?:/i.test(origin)) {
|
|
1103
|
-
const prefix =
|
|
1119
|
+
const prefix = base.startsWith("/") ? base : `/${base}`;
|
|
1104
1120
|
return `${join(origin + prefix)}${assetName}`;
|
|
1105
1121
|
}
|
|
1106
|
-
const normalized =
|
|
1122
|
+
const normalized = base.startsWith("/") ? base : `/${base}`;
|
|
1107
1123
|
return `${join(normalized)}${assetName}`;
|
|
1108
1124
|
}
|
|
1109
1125
|
function getDoc(root) {
|
|
@@ -1149,9 +1165,9 @@ async function adoptConstructable(root, assetName) {
|
|
|
1149
1165
|
if (!res.ok)
|
|
1150
1166
|
return null;
|
|
1151
1167
|
const cssText = await res.text();
|
|
1152
|
-
const
|
|
1153
|
-
|
|
1154
|
-
return
|
|
1168
|
+
const sheet = new CSSStyleSheet;
|
|
1169
|
+
sheet.replaceSync(cssText);
|
|
1170
|
+
return sheet;
|
|
1155
1171
|
} catch {
|
|
1156
1172
|
return null;
|
|
1157
1173
|
}
|
|
@@ -1201,28 +1217,28 @@ var init_css_loader = __esm(() => {
|
|
|
1201
1217
|
});
|
|
1202
1218
|
|
|
1203
1219
|
// ../../node_modules/lit-html/directive-helpers.js
|
|
1204
|
-
var t3, f3 = (
|
|
1205
|
-
const
|
|
1206
|
-
if (
|
|
1207
|
-
const
|
|
1208
|
-
|
|
1220
|
+
var t3, f3 = (o) => o.strings === undefined, r4 = () => document.createComment(""), s4 = (o, i, n) => {
|
|
1221
|
+
const e = o._$AA.parentNode, l = i === undefined ? o._$AB : i._$AA;
|
|
1222
|
+
if (n === undefined) {
|
|
1223
|
+
const i = e.insertBefore(r4(), l), d = e.insertBefore(r4(), l);
|
|
1224
|
+
n = new t3(i, d, o, o.options);
|
|
1209
1225
|
} else {
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1212
|
-
let
|
|
1213
|
-
|
|
1226
|
+
const t = n._$AB.nextSibling, i = n._$AM, d = i !== o;
|
|
1227
|
+
if (d) {
|
|
1228
|
+
let t;
|
|
1229
|
+
n._$AQ?.(o), n._$AM = o, n._$AP !== undefined && (t = o._$AU) !== i._$AU && n._$AP(t);
|
|
1214
1230
|
}
|
|
1215
|
-
if (
|
|
1216
|
-
let
|
|
1217
|
-
for (;
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1231
|
+
if (t !== l || d) {
|
|
1232
|
+
let o = n._$AA;
|
|
1233
|
+
for (;o !== t; ) {
|
|
1234
|
+
const t = o.nextSibling;
|
|
1235
|
+
e.insertBefore(o, l), o = t;
|
|
1220
1236
|
}
|
|
1221
1237
|
}
|
|
1222
1238
|
}
|
|
1223
|
-
return
|
|
1224
|
-
}, v2 = (
|
|
1225
|
-
|
|
1239
|
+
return n;
|
|
1240
|
+
}, v2 = (o, t, i = o) => (o._$AI(t, i), o), u3, m2 = (o, t = u3) => o._$AH = t, p3 = (o) => o._$AH, M2 = (o) => {
|
|
1241
|
+
o._$AR(), o._$AA.remove();
|
|
1226
1242
|
};
|
|
1227
1243
|
var init_directive_helpers = __esm(() => {
|
|
1228
1244
|
init_lit_html();
|
|
@@ -1232,66 +1248,66 @@ var init_directive_helpers = __esm(() => {
|
|
|
1232
1248
|
|
|
1233
1249
|
// ../../node_modules/lit-html/directive.js
|
|
1234
1250
|
class i5 {
|
|
1235
|
-
constructor(
|
|
1251
|
+
constructor(t) {}
|
|
1236
1252
|
get _$AU() {
|
|
1237
1253
|
return this._$AM._$AU;
|
|
1238
1254
|
}
|
|
1239
|
-
_$AT(
|
|
1240
|
-
this._$Ct =
|
|
1255
|
+
_$AT(t, e, i) {
|
|
1256
|
+
this._$Ct = t, this._$AM = e, this._$Ci = i;
|
|
1241
1257
|
}
|
|
1242
|
-
_$AS(
|
|
1243
|
-
return this.update(
|
|
1258
|
+
_$AS(t, e) {
|
|
1259
|
+
return this.update(t, e);
|
|
1244
1260
|
}
|
|
1245
|
-
update(
|
|
1246
|
-
return this.render(...
|
|
1261
|
+
update(t, e) {
|
|
1262
|
+
return this.render(...e);
|
|
1247
1263
|
}
|
|
1248
1264
|
}
|
|
1249
|
-
var t4, e4 = (
|
|
1265
|
+
var t4, e4 = (t) => (...e) => ({ _$litDirective$: t, values: e });
|
|
1250
1266
|
var init_directive = __esm(() => {
|
|
1251
1267
|
t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
|
|
1252
1268
|
});
|
|
1253
1269
|
|
|
1254
1270
|
// ../../node_modules/lit-html/async-directive.js
|
|
1255
|
-
function h3(
|
|
1256
|
-
this._$AN !== undefined ? (o5(this), this._$AM =
|
|
1257
|
-
}
|
|
1258
|
-
function n4(
|
|
1259
|
-
const
|
|
1260
|
-
if (
|
|
1261
|
-
if (
|
|
1262
|
-
if (Array.isArray(
|
|
1263
|
-
for (let
|
|
1264
|
-
s5(
|
|
1271
|
+
function h3(i) {
|
|
1272
|
+
this._$AN !== undefined ? (o5(this), this._$AM = i, r5(this)) : this._$AM = i;
|
|
1273
|
+
}
|
|
1274
|
+
function n4(i, t = false, e = 0) {
|
|
1275
|
+
const r = this._$AH, h = this._$AN;
|
|
1276
|
+
if (h !== undefined && h.size !== 0)
|
|
1277
|
+
if (t)
|
|
1278
|
+
if (Array.isArray(r))
|
|
1279
|
+
for (let i = e;i < r.length; i++)
|
|
1280
|
+
s5(r[i], false), o5(r[i]);
|
|
1265
1281
|
else
|
|
1266
|
-
|
|
1282
|
+
r != null && (s5(r, false), o5(r));
|
|
1267
1283
|
else
|
|
1268
|
-
s5(this,
|
|
1284
|
+
s5(this, i);
|
|
1269
1285
|
}
|
|
1270
|
-
var s5 = (
|
|
1271
|
-
const
|
|
1272
|
-
if (
|
|
1286
|
+
var s5 = (i, t) => {
|
|
1287
|
+
const e = i._$AN;
|
|
1288
|
+
if (e === undefined)
|
|
1273
1289
|
return false;
|
|
1274
|
-
for (const
|
|
1275
|
-
|
|
1290
|
+
for (const i of e)
|
|
1291
|
+
i._$AO?.(t, false), s5(i, t);
|
|
1276
1292
|
return true;
|
|
1277
|
-
}, o5 = (
|
|
1278
|
-
let
|
|
1293
|
+
}, o5 = (i) => {
|
|
1294
|
+
let t, e;
|
|
1279
1295
|
do {
|
|
1280
|
-
if ((
|
|
1296
|
+
if ((t = i._$AM) === undefined)
|
|
1281
1297
|
break;
|
|
1282
|
-
|
|
1283
|
-
} while (
|
|
1284
|
-
}, r5 = (
|
|
1285
|
-
for (let
|
|
1286
|
-
let
|
|
1287
|
-
if (
|
|
1288
|
-
|
|
1289
|
-
else if (
|
|
1298
|
+
e = t._$AN, e.delete(i), i = t;
|
|
1299
|
+
} while (e?.size === 0);
|
|
1300
|
+
}, r5 = (i) => {
|
|
1301
|
+
for (let t;t = i._$AM; i = t) {
|
|
1302
|
+
let e = t._$AN;
|
|
1303
|
+
if (e === undefined)
|
|
1304
|
+
t._$AN = e = new Set;
|
|
1305
|
+
else if (e.has(i))
|
|
1290
1306
|
break;
|
|
1291
|
-
|
|
1307
|
+
e.add(i), c4(t);
|
|
1292
1308
|
}
|
|
1293
|
-
}, c4 = (
|
|
1294
|
-
|
|
1309
|
+
}, c4 = (i) => {
|
|
1310
|
+
i.type == t4.CHILD && (i._$AP ??= n4, i._$AQ ??= h3);
|
|
1295
1311
|
}, f4;
|
|
1296
1312
|
var init_async_directive = __esm(() => {
|
|
1297
1313
|
init_directive_helpers();
|
|
@@ -1301,18 +1317,18 @@ var init_async_directive = __esm(() => {
|
|
|
1301
1317
|
constructor() {
|
|
1302
1318
|
super(...arguments), this._$AN = undefined;
|
|
1303
1319
|
}
|
|
1304
|
-
_$AT(
|
|
1305
|
-
super._$AT(
|
|
1320
|
+
_$AT(i, t, e) {
|
|
1321
|
+
super._$AT(i, t, e), r5(this), this.isConnected = i._$AU;
|
|
1306
1322
|
}
|
|
1307
|
-
_$AO(
|
|
1308
|
-
|
|
1323
|
+
_$AO(i, t = true) {
|
|
1324
|
+
i !== this.isConnected && (this.isConnected = i, i ? this.reconnected?.() : this.disconnected?.()), t && (s5(this, i), o5(this));
|
|
1309
1325
|
}
|
|
1310
|
-
setValue(
|
|
1326
|
+
setValue(t) {
|
|
1311
1327
|
if (f3(this._$Ct))
|
|
1312
|
-
this._$Ct._$AI(
|
|
1328
|
+
this._$Ct._$AI(t, this);
|
|
1313
1329
|
else {
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1330
|
+
const i = [...this._$Ct._$AH];
|
|
1331
|
+
i[this._$Ci] = t, this._$Ct._$AI(i, this, 0);
|
|
1316
1332
|
}
|
|
1317
1333
|
}
|
|
1318
1334
|
disconnected() {}
|
|
@@ -1330,20 +1346,20 @@ var init_ref = __esm(() => {
|
|
|
1330
1346
|
init_directive();
|
|
1331
1347
|
o6 = new WeakMap;
|
|
1332
1348
|
n5 = e4(class extends f4 {
|
|
1333
|
-
render(
|
|
1349
|
+
render(i) {
|
|
1334
1350
|
return E;
|
|
1335
1351
|
}
|
|
1336
|
-
update(
|
|
1337
|
-
const
|
|
1338
|
-
return
|
|
1352
|
+
update(i, [s]) {
|
|
1353
|
+
const e = s !== this.G;
|
|
1354
|
+
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;
|
|
1339
1355
|
}
|
|
1340
|
-
rt(
|
|
1341
|
-
if (this.isConnected || (
|
|
1342
|
-
const
|
|
1343
|
-
let
|
|
1344
|
-
|
|
1356
|
+
rt(t) {
|
|
1357
|
+
if (this.isConnected || (t = undefined), typeof this.G == "function") {
|
|
1358
|
+
const i = this.ht ?? globalThis;
|
|
1359
|
+
let s = o6.get(i);
|
|
1360
|
+
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);
|
|
1345
1361
|
} else
|
|
1346
|
-
this.G.value =
|
|
1362
|
+
this.G.value = t;
|
|
1347
1363
|
}
|
|
1348
1364
|
get lt() {
|
|
1349
1365
|
return typeof this.G == "function" ? o6.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
@@ -1373,44 +1389,44 @@ var init_events = __esm(() => {
|
|
|
1373
1389
|
});
|
|
1374
1390
|
|
|
1375
1391
|
// ../shared-ts/src/near/actions.ts
|
|
1376
|
-
function fromActionArgsWasm(
|
|
1377
|
-
switch (
|
|
1392
|
+
function fromActionArgsWasm(a) {
|
|
1393
|
+
switch (a.action_type) {
|
|
1378
1394
|
case "FunctionCall" /* FunctionCall */: {
|
|
1379
1395
|
let parsedArgs = {};
|
|
1380
1396
|
try {
|
|
1381
|
-
parsedArgs = typeof
|
|
1397
|
+
parsedArgs = typeof a.args === "string" ? a.args ? JSON.parse(a.args) : {} : a.args || {};
|
|
1382
1398
|
} catch {
|
|
1383
1399
|
parsedArgs = {};
|
|
1384
1400
|
}
|
|
1385
1401
|
return {
|
|
1386
1402
|
type: "FunctionCall" /* FunctionCall */,
|
|
1387
|
-
methodName:
|
|
1403
|
+
methodName: a.method_name,
|
|
1388
1404
|
args: parsedArgs,
|
|
1389
|
-
gas:
|
|
1390
|
-
deposit:
|
|
1405
|
+
gas: a.gas,
|
|
1406
|
+
deposit: a.deposit
|
|
1391
1407
|
};
|
|
1392
1408
|
}
|
|
1393
1409
|
case "Transfer" /* Transfer */:
|
|
1394
|
-
return { type: "Transfer" /* Transfer */, amount:
|
|
1410
|
+
return { type: "Transfer" /* Transfer */, amount: a.deposit };
|
|
1395
1411
|
case "CreateAccount" /* CreateAccount */:
|
|
1396
1412
|
return { type: "CreateAccount" /* CreateAccount */ };
|
|
1397
1413
|
case "DeployContract" /* DeployContract */:
|
|
1398
1414
|
return {
|
|
1399
1415
|
type: "DeployContract" /* DeployContract */,
|
|
1400
|
-
code: Array.isArray(
|
|
1416
|
+
code: Array.isArray(a.code) ? new Uint8Array(a.code) : new Uint8Array
|
|
1401
1417
|
};
|
|
1402
1418
|
case "DeployGlobalContract" /* DeployGlobalContract */:
|
|
1403
1419
|
return {
|
|
1404
1420
|
type: "DeployGlobalContract" /* DeployGlobalContract */,
|
|
1405
|
-
code: Array.isArray(
|
|
1406
|
-
deployMode:
|
|
1421
|
+
code: Array.isArray(a.code) ? new Uint8Array(a.code) : new Uint8Array,
|
|
1422
|
+
deployMode: a.deploy_mode
|
|
1407
1423
|
};
|
|
1408
1424
|
case "Stake" /* Stake */:
|
|
1409
|
-
return { type: "Stake" /* Stake */, stake:
|
|
1425
|
+
return { type: "Stake" /* Stake */, stake: a.stake, publicKey: a.public_key };
|
|
1410
1426
|
case "AddKey" /* AddKey */: {
|
|
1411
1427
|
let accessKey;
|
|
1412
1428
|
try {
|
|
1413
|
-
accessKey = JSON.parse(
|
|
1429
|
+
accessKey = JSON.parse(a.access_key);
|
|
1414
1430
|
} catch {
|
|
1415
1431
|
accessKey = { nonce: BigInt(0), permission: "FullAccess" };
|
|
1416
1432
|
}
|
|
@@ -1432,7 +1448,7 @@ function fromActionArgsWasm(a3) {
|
|
|
1432
1448
|
}
|
|
1433
1449
|
return {
|
|
1434
1450
|
type: "AddKey" /* AddKey */,
|
|
1435
|
-
publicKey:
|
|
1451
|
+
publicKey: a.public_key,
|
|
1436
1452
|
accessKey: {
|
|
1437
1453
|
nonce: typeof accessKey?.nonce === "number" ? accessKey.nonce : 0,
|
|
1438
1454
|
permission: normalizedPermission
|
|
@@ -1440,13 +1456,13 @@ function fromActionArgsWasm(a3) {
|
|
|
1440
1456
|
};
|
|
1441
1457
|
}
|
|
1442
1458
|
case "DeleteKey" /* DeleteKey */:
|
|
1443
|
-
return { type: "DeleteKey" /* DeleteKey */, publicKey:
|
|
1459
|
+
return { type: "DeleteKey" /* DeleteKey */, publicKey: a.public_key };
|
|
1444
1460
|
case "DeleteAccount" /* DeleteAccount */:
|
|
1445
|
-
return { type: "DeleteAccount" /* DeleteAccount */, beneficiaryId:
|
|
1461
|
+
return { type: "DeleteAccount" /* DeleteAccount */, beneficiaryId: a.beneficiary_id };
|
|
1446
1462
|
case "UseGlobalContract" /* UseGlobalContract */:
|
|
1447
|
-
return { type: "UseGlobalContract" /* UseGlobalContract */, accountId:
|
|
1463
|
+
return { type: "UseGlobalContract" /* UseGlobalContract */, accountId: a.account_id, codeHash: a.code_hash };
|
|
1448
1464
|
default:
|
|
1449
|
-
throw new Error(`Unsupported wasm action_type: ${
|
|
1465
|
+
throw new Error(`Unsupported wasm action_type: ${a?.action_type}`);
|
|
1450
1466
|
}
|
|
1451
1467
|
}
|
|
1452
1468
|
function fromTransactionInputWasm(tx) {
|
|
@@ -1468,74 +1484,74 @@ var init_actions2 = __esm(() => {
|
|
|
1468
1484
|
});
|
|
1469
1485
|
|
|
1470
1486
|
// ../../node_modules/lit-html/directives/repeat.js
|
|
1471
|
-
var u4 = (
|
|
1472
|
-
const
|
|
1473
|
-
for (let
|
|
1474
|
-
|
|
1475
|
-
return
|
|
1487
|
+
var u4 = (e, s, t) => {
|
|
1488
|
+
const r = new Map;
|
|
1489
|
+
for (let l = s;l <= t; l++)
|
|
1490
|
+
r.set(e[l], l);
|
|
1491
|
+
return r;
|
|
1476
1492
|
}, c5;
|
|
1477
1493
|
var init_repeat = __esm(() => {
|
|
1478
1494
|
init_lit_html();
|
|
1479
1495
|
init_directive();
|
|
1480
1496
|
init_directive_helpers();
|
|
1481
1497
|
c5 = e4(class extends i5 {
|
|
1482
|
-
constructor(
|
|
1483
|
-
if (super(
|
|
1498
|
+
constructor(e) {
|
|
1499
|
+
if (super(e), e.type !== t4.CHILD)
|
|
1484
1500
|
throw Error("repeat() can only be used in text expressions");
|
|
1485
1501
|
}
|
|
1486
|
-
dt(
|
|
1487
|
-
let
|
|
1488
|
-
|
|
1489
|
-
const
|
|
1490
|
-
let
|
|
1491
|
-
for (const
|
|
1492
|
-
|
|
1493
|
-
return { values:
|
|
1494
|
-
}
|
|
1495
|
-
render(
|
|
1496
|
-
return this.dt(
|
|
1497
|
-
}
|
|
1498
|
-
update(
|
|
1499
|
-
const
|
|
1500
|
-
if (!Array.isArray(
|
|
1501
|
-
return this.ut =
|
|
1502
|
-
const
|
|
1503
|
-
let
|
|
1504
|
-
for (;
|
|
1505
|
-
if (
|
|
1506
|
-
|
|
1507
|
-
else if (
|
|
1508
|
-
|
|
1509
|
-
else if (
|
|
1510
|
-
|
|
1511
|
-
else if (
|
|
1512
|
-
|
|
1513
|
-
else if (
|
|
1514
|
-
|
|
1515
|
-
else if (
|
|
1516
|
-
|
|
1517
|
-
else if (
|
|
1518
|
-
if (
|
|
1519
|
-
const
|
|
1520
|
-
if (
|
|
1521
|
-
const
|
|
1522
|
-
v2(
|
|
1502
|
+
dt(e, s, t) {
|
|
1503
|
+
let r;
|
|
1504
|
+
t === undefined ? t = s : s !== undefined && (r = s);
|
|
1505
|
+
const l = [], o = [];
|
|
1506
|
+
let i = 0;
|
|
1507
|
+
for (const s of e)
|
|
1508
|
+
l[i] = r ? r(s, i) : i, o[i] = t(s, i), i++;
|
|
1509
|
+
return { values: o, keys: l };
|
|
1510
|
+
}
|
|
1511
|
+
render(e, s, t) {
|
|
1512
|
+
return this.dt(e, s, t).values;
|
|
1513
|
+
}
|
|
1514
|
+
update(s, [t, r, c]) {
|
|
1515
|
+
const d = p3(s), { values: p, keys: a } = this.dt(t, r, c);
|
|
1516
|
+
if (!Array.isArray(d))
|
|
1517
|
+
return this.ut = a, p;
|
|
1518
|
+
const h = this.ut ??= [], v = [];
|
|
1519
|
+
let m, y, x = 0, j = d.length - 1, k = 0, w = p.length - 1;
|
|
1520
|
+
for (;x <= j && k <= w; )
|
|
1521
|
+
if (d[x] === null)
|
|
1522
|
+
x++;
|
|
1523
|
+
else if (d[j] === null)
|
|
1524
|
+
j--;
|
|
1525
|
+
else if (h[x] === a[k])
|
|
1526
|
+
v[k] = v2(d[x], p[k]), x++, k++;
|
|
1527
|
+
else if (h[j] === a[w])
|
|
1528
|
+
v[w] = v2(d[j], p[w]), j--, w--;
|
|
1529
|
+
else if (h[x] === a[w])
|
|
1530
|
+
v[w] = v2(d[x], p[w]), s4(s, v[w + 1], d[x]), x++, w--;
|
|
1531
|
+
else if (h[j] === a[k])
|
|
1532
|
+
v[k] = v2(d[j], p[k]), s4(s, d[x], d[j]), j--, k++;
|
|
1533
|
+
else if (m === undefined && (m = u4(a, k, w), y = u4(h, x, j)), m.has(h[x]))
|
|
1534
|
+
if (m.has(h[j])) {
|
|
1535
|
+
const e = y.get(a[k]), t = e !== undefined ? d[e] : null;
|
|
1536
|
+
if (t === null) {
|
|
1537
|
+
const e = s4(s, d[x]);
|
|
1538
|
+
v2(e, p[k]), v[k] = e;
|
|
1523
1539
|
} else
|
|
1524
|
-
|
|
1525
|
-
|
|
1540
|
+
v[k] = v2(t, p[k]), s4(s, d[x], t), d[e] = null;
|
|
1541
|
+
k++;
|
|
1526
1542
|
} else
|
|
1527
|
-
M2(
|
|
1543
|
+
M2(d[j]), j--;
|
|
1528
1544
|
else
|
|
1529
|
-
M2(
|
|
1530
|
-
for (;
|
|
1531
|
-
const
|
|
1532
|
-
v2(
|
|
1545
|
+
M2(d[x]), x++;
|
|
1546
|
+
for (;k <= w; ) {
|
|
1547
|
+
const e = s4(s, v[w + 1]);
|
|
1548
|
+
v2(e, p[k]), v[k++] = e;
|
|
1533
1549
|
}
|
|
1534
|
-
for (;
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1550
|
+
for (;x <= j; ) {
|
|
1551
|
+
const e = d[x++];
|
|
1552
|
+
e !== null && M2(e);
|
|
1537
1553
|
}
|
|
1538
|
-
return this.ut =
|
|
1554
|
+
return this.ut = a, m2(s, v), T;
|
|
1539
1555
|
}
|
|
1540
1556
|
});
|
|
1541
1557
|
});
|
|
@@ -1959,8 +1975,8 @@ var fromScale = (prefix, scale) => {
|
|
|
1959
1975
|
if (!scale)
|
|
1960
1976
|
return {};
|
|
1961
1977
|
const out = {};
|
|
1962
|
-
for (const
|
|
1963
|
-
out[`${prefix}${
|
|
1978
|
+
for (const k of Object.keys(scale))
|
|
1979
|
+
out[`${prefix}${k}`] = scale[k];
|
|
1964
1980
|
return out;
|
|
1965
1981
|
};
|
|
1966
1982
|
var init_base_styles = () => {};
|
|
@@ -2215,7 +2231,7 @@ function formatArgs(args) {
|
|
|
2215
2231
|
if (typeof args === "string")
|
|
2216
2232
|
return args;
|
|
2217
2233
|
try {
|
|
2218
|
-
return JSON.stringify(args, (_k,
|
|
2234
|
+
return JSON.stringify(args, (_k, v) => typeof v === "bigint" ? v.toString() : v, 2);
|
|
2219
2235
|
} catch {
|
|
2220
2236
|
return String(args);
|
|
2221
2237
|
}
|
|
@@ -2290,6 +2306,98 @@ var init_TxTree = __esm(() => {
|
|
|
2290
2306
|
init_registry();
|
|
2291
2307
|
HEIGHT_DRIVEN_CLASSES = ["anim-h", "anim-h-active", "anim-h-driven"];
|
|
2292
2308
|
TxTree = class TxTree extends LitElementWithProps {
|
|
2309
|
+
constructor() {
|
|
2310
|
+
super(...arguments);
|
|
2311
|
+
this.showShadow = true;
|
|
2312
|
+
this._copied = new Set;
|
|
2313
|
+
this._copyTimers = new Map;
|
|
2314
|
+
this._fileContentModes = new Map;
|
|
2315
|
+
this._animating = new WeakSet;
|
|
2316
|
+
this.onFileContentToggleClick = (e, node) => {
|
|
2317
|
+
e.preventDefault();
|
|
2318
|
+
e.stopPropagation();
|
|
2319
|
+
if (!this.hasFileContentToggle(node))
|
|
2320
|
+
return;
|
|
2321
|
+
const shell = e.currentTarget?.closest(".file-content-shell") ?? null;
|
|
2322
|
+
const currentMode = this.resolveFileContentMode(node);
|
|
2323
|
+
const nextMode = currentMode === "decoded" ? "raw" : "decoded";
|
|
2324
|
+
const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
|
|
2325
|
+
if (shell) {
|
|
2326
|
+
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
2327
|
+
this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
|
|
2328
|
+
}
|
|
2329
|
+
this._fileContentModes.set(node.id, nextMode);
|
|
2330
|
+
this.requestUpdate();
|
|
2331
|
+
if (!shell)
|
|
2332
|
+
return;
|
|
2333
|
+
this.updateComplete.then(() => {
|
|
2334
|
+
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
2335
|
+
const toCssPx = shell.getBoundingClientRect().height;
|
|
2336
|
+
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
2337
|
+
const claimed = announceClampedSurfaceResize({
|
|
2338
|
+
reason: `${node.id}:file-content-mode`,
|
|
2339
|
+
element: shell,
|
|
2340
|
+
drivenClasses: HEIGHT_DRIVEN_CLASSES,
|
|
2341
|
+
fromCssPx,
|
|
2342
|
+
toCssPx,
|
|
2343
|
+
setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
|
|
2344
|
+
});
|
|
2345
|
+
if (!claimed)
|
|
2346
|
+
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
2347
|
+
});
|
|
2348
|
+
};
|
|
2349
|
+
this.onSummaryClick = (e) => {
|
|
2350
|
+
const summary = e.currentTarget;
|
|
2351
|
+
if (!summary)
|
|
2352
|
+
return;
|
|
2353
|
+
const path = typeof e.composedPath === "function" ? e.composedPath() : undefined;
|
|
2354
|
+
let clickedReceiverLink = null;
|
|
2355
|
+
if (Array.isArray(path)) {
|
|
2356
|
+
for (const t of path) {
|
|
2357
|
+
if (t instanceof Element && t.matches("a.highlight-receiver-id")) {
|
|
2358
|
+
clickedReceiverLink = t;
|
|
2359
|
+
break;
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
} else {
|
|
2363
|
+
const target = e.target;
|
|
2364
|
+
clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
|
|
2365
|
+
}
|
|
2366
|
+
if (clickedReceiverLink) {
|
|
2367
|
+
e.preventDefault();
|
|
2368
|
+
e.stopPropagation();
|
|
2369
|
+
dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
|
|
2370
|
+
try {
|
|
2371
|
+
window.open(clickedReceiverLink.href, "_blank", "noopener");
|
|
2372
|
+
} catch {}
|
|
2373
|
+
return;
|
|
2374
|
+
}
|
|
2375
|
+
e.preventDefault();
|
|
2376
|
+
e.stopPropagation();
|
|
2377
|
+
const details = summary.closest("details");
|
|
2378
|
+
if (!details || this._animating.has(details))
|
|
2379
|
+
return;
|
|
2380
|
+
const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
|
|
2381
|
+
if (!body) {
|
|
2382
|
+
details.open = !details.open;
|
|
2383
|
+
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
2384
|
+
return;
|
|
2385
|
+
}
|
|
2386
|
+
const reduceMotion = (() => {
|
|
2387
|
+
return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
|
|
2388
|
+
})();
|
|
2389
|
+
if (reduceMotion) {
|
|
2390
|
+
details.open = !details.open;
|
|
2391
|
+
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
2392
|
+
return;
|
|
2393
|
+
}
|
|
2394
|
+
if (!details.open) {
|
|
2395
|
+
this.animateOpen(details, body);
|
|
2396
|
+
} else {
|
|
2397
|
+
this.animateClose(details, body);
|
|
2398
|
+
}
|
|
2399
|
+
};
|
|
2400
|
+
}
|
|
2293
2401
|
static properties = {
|
|
2294
2402
|
node: { attribute: false },
|
|
2295
2403
|
depth: { type: Number, attribute: false },
|
|
@@ -2303,26 +2411,11 @@ var init_TxTree = __esm(() => {
|
|
|
2303
2411
|
evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
|
|
2304
2412
|
showShadow: { type: Boolean, attribute: "show-shadow" }
|
|
2305
2413
|
};
|
|
2306
|
-
node;
|
|
2307
|
-
depth;
|
|
2308
|
-
theme;
|
|
2309
|
-
appearance;
|
|
2310
|
-
class;
|
|
2311
|
-
width;
|
|
2312
|
-
shadowDom;
|
|
2313
|
-
nearExplorerUrl;
|
|
2314
|
-
tempoExplorerUrl;
|
|
2315
|
-
evmExplorerUrl;
|
|
2316
|
-
showShadow = true;
|
|
2317
|
-
_copied = new Set;
|
|
2318
|
-
_copyTimers = new Map;
|
|
2319
|
-
_fileContentModes = new Map;
|
|
2320
|
-
_animating = new WeakSet;
|
|
2321
2414
|
isCopied(id) {
|
|
2322
2415
|
return this._copied.has(id);
|
|
2323
2416
|
}
|
|
2324
|
-
async handleCopyClick(
|
|
2325
|
-
|
|
2417
|
+
async handleCopyClick(e, node) {
|
|
2418
|
+
e.stopPropagation();
|
|
2326
2419
|
const value = node.copyValue;
|
|
2327
2420
|
if (!value)
|
|
2328
2421
|
return;
|
|
@@ -2384,94 +2477,10 @@ var init_TxTree = __esm(() => {
|
|
|
2384
2477
|
const mode = this.resolveFileContentMode(node);
|
|
2385
2478
|
return mode === "raw" ? variants.raw : variants.decoded;
|
|
2386
2479
|
}
|
|
2387
|
-
onFileContentToggleClick = (e6, node) => {
|
|
2388
|
-
e6.preventDefault();
|
|
2389
|
-
e6.stopPropagation();
|
|
2390
|
-
if (!this.hasFileContentToggle(node))
|
|
2391
|
-
return;
|
|
2392
|
-
const shell = e6.currentTarget?.closest(".file-content-shell") ?? null;
|
|
2393
|
-
const currentMode = this.resolveFileContentMode(node);
|
|
2394
|
-
const nextMode = currentMode === "decoded" ? "raw" : "decoded";
|
|
2395
|
-
const fromCssPx = shell?.getBoundingClientRect().height ?? 0;
|
|
2396
|
-
if (shell) {
|
|
2397
|
-
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
2398
|
-
this.setCssVars({ "--w3a-tree__anim-target": `${fromCssPx}px` });
|
|
2399
|
-
}
|
|
2400
|
-
this._fileContentModes.set(node.id, nextMode);
|
|
2401
|
-
this.requestUpdate();
|
|
2402
|
-
if (!shell)
|
|
2403
|
-
return;
|
|
2404
|
-
this.updateComplete.then(() => {
|
|
2405
|
-
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
2406
|
-
const toCssPx = shell.getBoundingClientRect().height;
|
|
2407
|
-
shell.classList.add(...HEIGHT_DRIVEN_CLASSES);
|
|
2408
|
-
const claimed = announceClampedSurfaceResize({
|
|
2409
|
-
reason: `${node.id}:file-content-mode`,
|
|
2410
|
-
element: shell,
|
|
2411
|
-
drivenClasses: HEIGHT_DRIVEN_CLASSES,
|
|
2412
|
-
fromCssPx,
|
|
2413
|
-
toCssPx,
|
|
2414
|
-
setHeightCssPx: (px) => this.setCssVars({ "--w3a-tree__anim-target": `${px}px` })
|
|
2415
|
-
});
|
|
2416
|
-
if (!claimed)
|
|
2417
|
-
shell.classList.remove(...HEIGHT_DRIVEN_CLASSES);
|
|
2418
|
-
});
|
|
2419
|
-
};
|
|
2420
2480
|
handleToggle(detail) {
|
|
2421
2481
|
dispatchLitTreeToggled(this);
|
|
2422
2482
|
dispatchTxReviewToggleNode(this, detail);
|
|
2423
2483
|
}
|
|
2424
|
-
onSummaryClick = (e6) => {
|
|
2425
|
-
const summary = e6.currentTarget;
|
|
2426
|
-
if (!summary)
|
|
2427
|
-
return;
|
|
2428
|
-
const path = typeof e6.composedPath === "function" ? e6.composedPath() : undefined;
|
|
2429
|
-
let clickedReceiverLink = null;
|
|
2430
|
-
if (Array.isArray(path)) {
|
|
2431
|
-
for (const t5 of path) {
|
|
2432
|
-
if (t5 instanceof Element && t5.matches("a.highlight-receiver-id")) {
|
|
2433
|
-
clickedReceiverLink = t5;
|
|
2434
|
-
break;
|
|
2435
|
-
}
|
|
2436
|
-
}
|
|
2437
|
-
} else {
|
|
2438
|
-
const target = e6.target;
|
|
2439
|
-
clickedReceiverLink = target?.closest?.("a.highlight-receiver-id") ?? null;
|
|
2440
|
-
}
|
|
2441
|
-
if (clickedReceiverLink) {
|
|
2442
|
-
e6.preventDefault();
|
|
2443
|
-
e6.stopPropagation();
|
|
2444
|
-
dispatchTxReviewOpenLink(this, { href: clickedReceiverLink.href });
|
|
2445
|
-
try {
|
|
2446
|
-
window.open(clickedReceiverLink.href, "_blank", "noopener");
|
|
2447
|
-
} catch {}
|
|
2448
|
-
return;
|
|
2449
|
-
}
|
|
2450
|
-
e6.preventDefault();
|
|
2451
|
-
e6.stopPropagation();
|
|
2452
|
-
const details = summary.closest("details");
|
|
2453
|
-
if (!details || this._animating.has(details))
|
|
2454
|
-
return;
|
|
2455
|
-
const body = details.querySelector(":scope > .folder-children, :scope > .row.file-row");
|
|
2456
|
-
if (!body) {
|
|
2457
|
-
details.open = !details.open;
|
|
2458
|
-
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
2459
|
-
return;
|
|
2460
|
-
}
|
|
2461
|
-
const reduceMotion = (() => {
|
|
2462
|
-
return typeof window !== "undefined" && "matchMedia" in window ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : false;
|
|
2463
|
-
})();
|
|
2464
|
-
if (reduceMotion) {
|
|
2465
|
-
details.open = !details.open;
|
|
2466
|
-
this.handleToggle({ nodeId: details.dataset.nodeId, open: details.open });
|
|
2467
|
-
return;
|
|
2468
|
-
}
|
|
2469
|
-
if (!details.open) {
|
|
2470
|
-
this.animateOpen(details, body);
|
|
2471
|
-
} else {
|
|
2472
|
-
this.animateClose(details, body);
|
|
2473
|
-
}
|
|
2474
|
-
};
|
|
2475
2484
|
animateOpen(details, body) {
|
|
2476
2485
|
this._animating.add(details);
|
|
2477
2486
|
body.classList.add("anim-h", "anim-h-hold");
|
|
@@ -2567,9 +2576,9 @@ var init_TxTree = __esm(() => {
|
|
|
2567
2576
|
}
|
|
2568
2577
|
createRenderRoot() {
|
|
2569
2578
|
if (this.shadowDom) {
|
|
2570
|
-
const
|
|
2571
|
-
ensureExternalStyles(
|
|
2572
|
-
return
|
|
2579
|
+
const root = super.createRenderRoot();
|
|
2580
|
+
ensureExternalStyles(root, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
|
|
2581
|
+
return root;
|
|
2573
2582
|
}
|
|
2574
2583
|
ensureExternalStyles(this, "tx-tree.css", "data-w3a-tx-tree-css").catch(() => {});
|
|
2575
2584
|
const root = this.getRootNode ? this.getRootNode() : null;
|
|
@@ -2625,7 +2634,7 @@ var init_TxTree = __esm(() => {
|
|
|
2625
2634
|
}
|
|
2626
2635
|
resolveContractExplorerHref(treeNode, contractAddress) {
|
|
2627
2636
|
const chain = treeNode.chain;
|
|
2628
|
-
const
|
|
2637
|
+
const base = (() => {
|
|
2629
2638
|
if (chain === "tempo")
|
|
2630
2639
|
return this.normalizeExplorerBase(this.tempoExplorerUrl);
|
|
2631
2640
|
if (chain === "evm")
|
|
@@ -2634,9 +2643,9 @@ var init_TxTree = __esm(() => {
|
|
|
2634
2643
|
return this.normalizeExplorerBase(this.nearExplorerUrl || "https://testnet.nearblocks.io");
|
|
2635
2644
|
return;
|
|
2636
2645
|
})();
|
|
2637
|
-
if (!
|
|
2646
|
+
if (!base)
|
|
2638
2647
|
return;
|
|
2639
|
-
return `${
|
|
2648
|
+
return `${base}/address/${encodeURIComponent(contractAddress)}`;
|
|
2640
2649
|
}
|
|
2641
2650
|
renderContractTransactionLabel(treeNode) {
|
|
2642
2651
|
const contractAddress = String(treeNode.contractAddress || "").trim();
|
|
@@ -2678,17 +2687,17 @@ var init_TxTree = __esm(() => {
|
|
|
2678
2687
|
}
|
|
2679
2688
|
renderLabelWithSelectiveHighlight(treeNode) {
|
|
2680
2689
|
if (treeNode.action) {
|
|
2681
|
-
const
|
|
2682
|
-
switch (
|
|
2690
|
+
const a = treeNode.action;
|
|
2691
|
+
switch (a.type) {
|
|
2683
2692
|
case "FunctionCall": {
|
|
2684
|
-
const method =
|
|
2685
|
-
const gasStr = formatGas(
|
|
2686
|
-
const depositStr = formatDeposit(
|
|
2693
|
+
const method = a.methodName;
|
|
2694
|
+
const gasStr = formatGas(a.gas);
|
|
2695
|
+
const depositStr = formatDeposit(a.deposit);
|
|
2687
2696
|
return x`Calling <span class="highlight-method-name">${method}</span> ${depositStr !== "0 NEAR" ? x` with <span class="highlight-method-name">${depositStr}</span>` : ""}
|
|
2688
2697
|
${gasStr ? x` using <span class="highlight-method-name">${gasStr}</span>` : ""}`;
|
|
2689
2698
|
}
|
|
2690
2699
|
case "Transfer": {
|
|
2691
|
-
const amount = formatDeposit(
|
|
2700
|
+
const amount = formatDeposit(a.amount);
|
|
2692
2701
|
return x`Transfer <span class="highlight-amount">${amount}</span>`;
|
|
2693
2702
|
}
|
|
2694
2703
|
case "CreateAccount":
|
|
@@ -2696,26 +2705,26 @@ var init_TxTree = __esm(() => {
|
|
|
2696
2705
|
case "DeleteAccount":
|
|
2697
2706
|
return "Deleting Account";
|
|
2698
2707
|
case "Stake":
|
|
2699
|
-
return `Staking ${formatDeposit(
|
|
2708
|
+
return `Staking ${formatDeposit(a.stake)}`;
|
|
2700
2709
|
case "AddKey":
|
|
2701
2710
|
return "Adding Key";
|
|
2702
2711
|
case "DeleteKey":
|
|
2703
2712
|
return "Deleting Key";
|
|
2704
2713
|
case "DeployContract": {
|
|
2705
|
-
const codeSize = formatCodeSize(
|
|
2714
|
+
const codeSize = formatCodeSize(a.code);
|
|
2706
2715
|
return `Deploying WASM contract (${codeSize})`;
|
|
2707
2716
|
}
|
|
2708
2717
|
case "DeployGlobalContract": {
|
|
2709
|
-
const codeSize = formatCodeSize(
|
|
2710
|
-
const mode =
|
|
2718
|
+
const codeSize = formatCodeSize(a.code);
|
|
2719
|
+
const mode = a.deployMode || "Unknown";
|
|
2711
2720
|
return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
|
|
2712
2721
|
}
|
|
2713
2722
|
case "UseGlobalContract": {
|
|
2714
|
-
const accountId =
|
|
2715
|
-
const codeHash =
|
|
2723
|
+
const accountId = a.accountId;
|
|
2724
|
+
const codeHash = a.codeHash;
|
|
2716
2725
|
if (accountId) {
|
|
2717
|
-
const
|
|
2718
|
-
const href = `${
|
|
2726
|
+
const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
|
|
2727
|
+
const href = `${base}/address/${encodeURIComponent(String(accountId))}`;
|
|
2719
2728
|
return x`Use global contract
|
|
2720
2729
|
<a
|
|
2721
2730
|
class="highlight-receiver-id"
|
|
@@ -2734,7 +2743,7 @@ var init_TxTree = __esm(() => {
|
|
|
2734
2743
|
}
|
|
2735
2744
|
default: {
|
|
2736
2745
|
const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
|
|
2737
|
-
const typeText =
|
|
2746
|
+
const typeText = a.type || "Unknown";
|
|
2738
2747
|
return `Action${idxText}: ${typeText}`;
|
|
2739
2748
|
}
|
|
2740
2749
|
}
|
|
@@ -2744,8 +2753,8 @@ var init_TxTree = __esm(() => {
|
|
|
2744
2753
|
const idx = treeNode.transactionIndex ?? 0;
|
|
2745
2754
|
const prefix = total > 1 ? `Transaction ${idx + 1}: to ` : "Transaction to ";
|
|
2746
2755
|
const receiverId = treeNode.transaction.receiverId;
|
|
2747
|
-
const
|
|
2748
|
-
const href = `${
|
|
2756
|
+
const base = (this.nearExplorerUrl || "https://testnet.nearblocks.io").replace(/\/$/, "");
|
|
2757
|
+
const href = `${base}/address/${encodeURIComponent(receiverId)}`;
|
|
2749
2758
|
return x`${prefix}<a
|
|
2750
2759
|
class="highlight-receiver-id"
|
|
2751
2760
|
href=${href}
|
|
@@ -2764,22 +2773,22 @@ var init_TxTree = __esm(() => {
|
|
|
2764
2773
|
}
|
|
2765
2774
|
computePlainLabel(treeNode) {
|
|
2766
2775
|
if (treeNode.action) {
|
|
2767
|
-
const
|
|
2768
|
-
switch (
|
|
2776
|
+
const a = treeNode.action;
|
|
2777
|
+
switch (a.type) {
|
|
2769
2778
|
case "FunctionCall": {
|
|
2770
|
-
const method =
|
|
2771
|
-
const gasStr = formatGas(
|
|
2772
|
-
const depositStr = formatDeposit(
|
|
2779
|
+
const method = a.methodName;
|
|
2780
|
+
const gasStr = formatGas(a.gas);
|
|
2781
|
+
const depositStr = formatDeposit(a.deposit);
|
|
2773
2782
|
return `Calling ${method} with ${depositStr} using ${gasStr}`;
|
|
2774
2783
|
}
|
|
2775
2784
|
case "Transfer":
|
|
2776
|
-
return `Transfer ${formatDeposit(
|
|
2785
|
+
return `Transfer ${formatDeposit(a.amount)}`;
|
|
2777
2786
|
case "CreateAccount":
|
|
2778
2787
|
return "Creating Account";
|
|
2779
2788
|
case "DeleteAccount":
|
|
2780
2789
|
return "Deleting Account";
|
|
2781
2790
|
case "Stake":
|
|
2782
|
-
return `Staking ${formatDeposit(
|
|
2791
|
+
return `Staking ${formatDeposit(a.stake)}`;
|
|
2783
2792
|
case "AddKey":
|
|
2784
2793
|
return "Adding Key";
|
|
2785
2794
|
case "DeleteKey":
|
|
@@ -2787,13 +2796,13 @@ var init_TxTree = __esm(() => {
|
|
|
2787
2796
|
case "DeployContract":
|
|
2788
2797
|
return "Deploying WASM contract";
|
|
2789
2798
|
case "DeployGlobalContract": {
|
|
2790
|
-
const codeSize = formatCodeSize(
|
|
2791
|
-
const mode =
|
|
2799
|
+
const codeSize = formatCodeSize(a.code);
|
|
2800
|
+
const mode = a.deployMode || "Unknown";
|
|
2792
2801
|
return `Deploy global WASM contract (mode: ${String(mode)}, size ${codeSize})`;
|
|
2793
2802
|
}
|
|
2794
2803
|
case "UseGlobalContract": {
|
|
2795
|
-
const accountId =
|
|
2796
|
-
const codeHash =
|
|
2804
|
+
const accountId = a.accountId;
|
|
2805
|
+
const codeHash = a.codeHash;
|
|
2797
2806
|
if (accountId) {
|
|
2798
2807
|
return `Use global contract by account ${String(accountId)}`;
|
|
2799
2808
|
}
|
|
@@ -2804,7 +2813,7 @@ var init_TxTree = __esm(() => {
|
|
|
2804
2813
|
}
|
|
2805
2814
|
default: {
|
|
2806
2815
|
const idxText = isNumber(treeNode.actionIndex) ? ` ${treeNode.actionIndex + 1}` : "";
|
|
2807
|
-
const typeText =
|
|
2816
|
+
const typeText = a.type || "Unknown";
|
|
2808
2817
|
return `Action${idxText}: ${typeText}`;
|
|
2809
2818
|
}
|
|
2810
2819
|
}
|
|
@@ -2847,7 +2856,7 @@ var init_TxTree = __esm(() => {
|
|
|
2847
2856
|
${node.copyValue ? x` <span
|
|
2848
2857
|
class="copy-badge"
|
|
2849
2858
|
data-copied=${this.isCopied(node.id)}
|
|
2850
|
-
@click=${(
|
|
2859
|
+
@click=${(e) => this.handleCopyClick(e, node)}
|
|
2851
2860
|
title=${this.isCopied(node.id) ? "Copied" : "Copy"}
|
|
2852
2861
|
>
|
|
2853
2862
|
${this.isCopied(node.id) ? "copied" : "copy"}
|
|
@@ -2860,7 +2869,7 @@ var init_TxTree = __esm(() => {
|
|
|
2860
2869
|
class="file-content-mode-toggle"
|
|
2861
2870
|
title=${`Show ${toggleLabel}`}
|
|
2862
2871
|
aria-label=${`Show ${toggleLabel}`}
|
|
2863
|
-
@click=${(
|
|
2872
|
+
@click=${(e) => this.onFileContentToggleClick(e, node)}
|
|
2864
2873
|
>
|
|
2865
2874
|
${toggleLabel}
|
|
2866
2875
|
</button>` : ""}
|
|
@@ -2886,7 +2895,7 @@ var init_TxTree = __esm(() => {
|
|
|
2886
2895
|
<span
|
|
2887
2896
|
class="copy-badge"
|
|
2888
2897
|
data-copied=${this.isCopied(node.id)}
|
|
2889
|
-
@click=${(
|
|
2898
|
+
@click=${(e) => this.handleCopyClick(e, node)}
|
|
2890
2899
|
title=${this.isCopied(node.id) ? "Copied" : "Copy"}
|
|
2891
2900
|
>${this.isCopied(node.id) ? "copied" : "copy"}</span
|
|
2892
2901
|
>
|
|
@@ -2919,7 +2928,7 @@ var init_TxTree = __esm(() => {
|
|
|
2919
2928
|
</summary>
|
|
2920
2929
|
${nodeChildren && nodeChildren.length > 0 ? x`
|
|
2921
2930
|
<div class="folder-children">
|
|
2922
|
-
${c5(nodeChildren, (
|
|
2931
|
+
${c5(nodeChildren, (c) => c.id, (c) => this.renderAnyNode(c, depth + 1))}
|
|
2923
2932
|
</div>
|
|
2924
2933
|
` : x``}
|
|
2925
2934
|
</details>
|
|
@@ -3418,49 +3427,49 @@ function hexToBytes(hex) {
|
|
|
3418
3427
|
throw new Error(`Invalid hex (odd length): ${hex}`);
|
|
3419
3428
|
}
|
|
3420
3429
|
const bytes = new Uint8Array(normalized.length / 2);
|
|
3421
|
-
for (let
|
|
3422
|
-
const byte = normalized.slice(
|
|
3430
|
+
for (let i = 0;i < bytes.length; i++) {
|
|
3431
|
+
const byte = normalized.slice(i * 2, i * 2 + 2);
|
|
3423
3432
|
const value = Number.parseInt(byte, 16);
|
|
3424
3433
|
if (!Number.isFinite(value))
|
|
3425
3434
|
throw new Error(`Invalid hex: ${hex}`);
|
|
3426
|
-
bytes[
|
|
3435
|
+
bytes[i] = value;
|
|
3427
3436
|
}
|
|
3428
3437
|
return bytes;
|
|
3429
3438
|
}
|
|
3430
3439
|
function bytesToHex(bytes) {
|
|
3431
|
-
return `0x${Array.from(bytes).map((
|
|
3440
|
+
return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
|
|
3432
3441
|
}
|
|
3433
3442
|
|
|
3434
3443
|
// ../shared-ts/src/utils/keccak.ts
|
|
3435
3444
|
function rotateLeft64(value, shift) {
|
|
3436
|
-
const
|
|
3437
|
-
return (value <<
|
|
3445
|
+
const n = BigInt(shift);
|
|
3446
|
+
return (value << n | value >> 64n - n) & UINT64_MASK;
|
|
3438
3447
|
}
|
|
3439
3448
|
function keccakF1600(state) {
|
|
3440
|
-
const
|
|
3441
|
-
const
|
|
3449
|
+
const c = new Array(5);
|
|
3450
|
+
const d = new Array(5);
|
|
3442
3451
|
for (let round = 0;round < 24; round += 1) {
|
|
3443
|
-
for (let
|
|
3444
|
-
|
|
3452
|
+
for (let x = 0;x < 5; x += 1) {
|
|
3453
|
+
c[x] = state[x] ^ state[x + 5] ^ state[x + 10] ^ state[x + 15] ^ state[x + 20];
|
|
3445
3454
|
}
|
|
3446
|
-
for (let
|
|
3447
|
-
|
|
3455
|
+
for (let x = 0;x < 5; x += 1) {
|
|
3456
|
+
d[x] = c[(x + 4) % 5] ^ rotateLeft64(c[(x + 1) % 5], 1);
|
|
3448
3457
|
}
|
|
3449
|
-
for (let
|
|
3450
|
-
const rowOffset =
|
|
3451
|
-
for (let
|
|
3452
|
-
state[rowOffset +
|
|
3458
|
+
for (let y = 0;y < 5; y += 1) {
|
|
3459
|
+
const rowOffset = y * 5;
|
|
3460
|
+
for (let x = 0;x < 5; x += 1) {
|
|
3461
|
+
state[rowOffset + x] ^= d[x];
|
|
3453
3462
|
}
|
|
3454
3463
|
}
|
|
3455
3464
|
let lane = state[1];
|
|
3456
|
-
for (let
|
|
3457
|
-
const targetIndex = PI_LANE_INDEXES[
|
|
3465
|
+
for (let i = 0;i < 24; i += 1) {
|
|
3466
|
+
const targetIndex = PI_LANE_INDEXES[i];
|
|
3458
3467
|
const nextLane = state[targetIndex];
|
|
3459
|
-
state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[
|
|
3468
|
+
state[targetIndex] = rotateLeft64(lane, ROTATION_OFFSETS[i]);
|
|
3460
3469
|
lane = nextLane;
|
|
3461
3470
|
}
|
|
3462
|
-
for (let
|
|
3463
|
-
const rowOffset =
|
|
3471
|
+
for (let y = 0;y < 5; y += 1) {
|
|
3472
|
+
const rowOffset = y * 5;
|
|
3464
3473
|
const lane0 = state[rowOffset];
|
|
3465
3474
|
const lane1 = state[rowOffset + 1];
|
|
3466
3475
|
const lane2 = state[rowOffset + 2];
|
|
@@ -3483,8 +3492,8 @@ function absorbByte(state, offset, byte) {
|
|
|
3483
3492
|
function keccak256Bytes(input) {
|
|
3484
3493
|
const state = new Array(25).fill(0n);
|
|
3485
3494
|
let offset = 0;
|
|
3486
|
-
for (let
|
|
3487
|
-
absorbByte(state, offset, input[
|
|
3495
|
+
for (let i = 0;i < input.length; i += 1) {
|
|
3496
|
+
absorbByte(state, offset, input[i]);
|
|
3488
3497
|
offset += 1;
|
|
3489
3498
|
if (offset === KECCAK_RATE_BYTES) {
|
|
3490
3499
|
keccakF1600(state);
|
|
@@ -3495,10 +3504,10 @@ function keccak256Bytes(input) {
|
|
|
3495
3504
|
absorbByte(state, KECCAK_RATE_BYTES - 1, 128);
|
|
3496
3505
|
keccakF1600(state);
|
|
3497
3506
|
const out = new Uint8Array(KECCAK256_OUTPUT_BYTES);
|
|
3498
|
-
for (let
|
|
3499
|
-
const lane = state[Math.floor(
|
|
3500
|
-
const laneShift = BigInt(
|
|
3501
|
-
out[
|
|
3507
|
+
for (let i = 0;i < KECCAK256_OUTPUT_BYTES; i += 1) {
|
|
3508
|
+
const lane = state[Math.floor(i / 8)];
|
|
3509
|
+
const laneShift = BigInt(i % 8 * 8);
|
|
3510
|
+
out[i] = Number(lane >> laneShift & 0xffn);
|
|
3502
3511
|
}
|
|
3503
3512
|
return out;
|
|
3504
3513
|
}
|
|
@@ -3739,8 +3748,8 @@ function parseAbiTypeNode(args) {
|
|
|
3739
3748
|
dynamic: baseType === "bytes" || baseType === "string"
|
|
3740
3749
|
};
|
|
3741
3750
|
}
|
|
3742
|
-
for (let
|
|
3743
|
-
const length = arrayDimensions[
|
|
3751
|
+
for (let i = arrayDimensions.length - 1;i >= 0; i -= 1) {
|
|
3752
|
+
const length = arrayDimensions[i];
|
|
3744
3753
|
node = {
|
|
3745
3754
|
kind: "array",
|
|
3746
3755
|
canonicalType: `${node.canonicalType}[${length == null ? "" : String(length)}]`,
|
|
@@ -3867,16 +3876,16 @@ function decodeTypeAt(typeNode, bytes, offset) {
|
|
|
3867
3876
|
if (!decodedItems)
|
|
3868
3877
|
return null;
|
|
3869
3878
|
const out = {};
|
|
3870
|
-
for (let
|
|
3871
|
-
const component = typeNode.components[
|
|
3872
|
-
const baseName = String(component.name || "").trim() || `item${
|
|
3879
|
+
for (let i = 0;i < typeNode.components.length; i += 1) {
|
|
3880
|
+
const component = typeNode.components[i];
|
|
3881
|
+
const baseName = String(component.name || "").trim() || `item${i}`;
|
|
3873
3882
|
let name = baseName;
|
|
3874
3883
|
let counter = 1;
|
|
3875
3884
|
while (Object.prototype.hasOwnProperty.call(out, name)) {
|
|
3876
3885
|
counter += 1;
|
|
3877
3886
|
name = `${baseName}_${counter}`;
|
|
3878
3887
|
}
|
|
3879
|
-
out[name] = decodedItems[
|
|
3888
|
+
out[name] = decodedItems[i];
|
|
3880
3889
|
}
|
|
3881
3890
|
return out;
|
|
3882
3891
|
}
|
|
@@ -3890,8 +3899,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
|
|
|
3890
3899
|
const baseOffset = isDynamicArray ? offset + WORD_SIZE : offset;
|
|
3891
3900
|
const items = [];
|
|
3892
3901
|
if (typeNode.item.dynamic) {
|
|
3893
|
-
for (let
|
|
3894
|
-
const itemRelativeOffset = readWordNumber(bytes, baseOffset +
|
|
3902
|
+
for (let i = 0;i < arrayLength; i += 1) {
|
|
3903
|
+
const itemRelativeOffset = readWordNumber(bytes, baseOffset + i * WORD_SIZE);
|
|
3895
3904
|
if (itemRelativeOffset == null)
|
|
3896
3905
|
return null;
|
|
3897
3906
|
const decoded = decodeTypeAt(typeNode.item, bytes, baseOffset + itemRelativeOffset);
|
|
@@ -3902,8 +3911,8 @@ function decodeTypeAt(typeNode, bytes, offset) {
|
|
|
3902
3911
|
return items;
|
|
3903
3912
|
}
|
|
3904
3913
|
const itemWords = staticWordLength(typeNode.item);
|
|
3905
|
-
for (let
|
|
3906
|
-
const itemOffset = baseOffset +
|
|
3914
|
+
for (let i = 0;i < arrayLength; i += 1) {
|
|
3915
|
+
const itemOffset = baseOffset + i * itemWords * WORD_SIZE;
|
|
3907
3916
|
const decoded = decodeTypeAt(typeNode.item, bytes, itemOffset);
|
|
3908
3917
|
if (decoded == null)
|
|
3909
3918
|
return null;
|
|
@@ -3919,17 +3928,17 @@ function decodeTupleComponents(components, bytes, tupleOffset) {
|
|
|
3919
3928
|
cursorWords += component.typeNode.dynamic ? 1 : staticWordLength(component.typeNode);
|
|
3920
3929
|
}
|
|
3921
3930
|
const out = [];
|
|
3922
|
-
for (let
|
|
3923
|
-
const component = components[
|
|
3924
|
-
const headOffset = tupleOffset + headOffsets[
|
|
3931
|
+
for (let i = 0;i < components.length; i += 1) {
|
|
3932
|
+
const component = components[i];
|
|
3933
|
+
const headOffset = tupleOffset + headOffsets[i];
|
|
3925
3934
|
if (component.typeNode.dynamic) {
|
|
3926
3935
|
const relativeOffset = readWordNumber(bytes, headOffset);
|
|
3927
3936
|
if (relativeOffset == null)
|
|
3928
3937
|
return null;
|
|
3929
|
-
const
|
|
3930
|
-
if (
|
|
3938
|
+
const decoded = decodeTypeAt(component.typeNode, bytes, tupleOffset + relativeOffset);
|
|
3939
|
+
if (decoded == null)
|
|
3931
3940
|
return null;
|
|
3932
|
-
out.push(
|
|
3941
|
+
out.push(decoded);
|
|
3933
3942
|
continue;
|
|
3934
3943
|
}
|
|
3935
3944
|
const decoded = decodeTypeAt(component.typeNode, bytes, headOffset);
|
|
@@ -4012,10 +4021,6 @@ var init_abiDecode = __esm(() => {
|
|
|
4012
4021
|
});
|
|
4013
4022
|
|
|
4014
4023
|
// src/core/signingEngine/uiConfirm/ui/lit-components/TxTree/abi/enrichDisplayModelWithAbi.ts
|
|
4015
|
-
var exports_enrichDisplayModelWithAbi = {};
|
|
4016
|
-
__export(exports_enrichDisplayModelWithAbi, {
|
|
4017
|
-
enrichDisplayModelWithAbi: () => enrichDisplayModelWithAbi
|
|
4018
|
-
});
|
|
4019
4024
|
function isGenericContractCallOperation(operation) {
|
|
4020
4025
|
return operation.kind === "generic.contractCall";
|
|
4021
4026
|
}
|
|
@@ -4113,12 +4118,6 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
4113
4118
|
init_registry();
|
|
4114
4119
|
init_registry();
|
|
4115
4120
|
TxConfirmContentElement = class TxConfirmContentElement extends LitElementWithProps {
|
|
4116
|
-
_heightReflow = createSurfaceHeightReflow({
|
|
4117
|
-
reason: "tx-body",
|
|
4118
|
-
element: () => this.querySelector(".txc-root"),
|
|
4119
|
-
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
4120
|
-
settled: () => this.updateComplete
|
|
4121
|
-
});
|
|
4122
4121
|
static requiredChildTags = [W3A_TX_TREE_ID];
|
|
4123
4122
|
static keepDefinitions = [TxTree_default];
|
|
4124
4123
|
static properties = {
|
|
@@ -4141,22 +4140,39 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
4141
4140
|
evmExplorerUrl: { type: String, attribute: "evm-explorer-url" },
|
|
4142
4141
|
showShadow: { type: Boolean, attribute: "show-shadow" }
|
|
4143
4142
|
};
|
|
4144
|
-
_treeNode = null;
|
|
4145
|
-
_ensureTreeDefinition = TxTree_default;
|
|
4146
|
-
_stylesReady = false;
|
|
4147
|
-
_stylePromises = [];
|
|
4148
|
-
_stylesAwaiting = null;
|
|
4149
4143
|
static _STYLE_MARKERS = [
|
|
4150
4144
|
"data-w3a-tx-tree-css",
|
|
4151
4145
|
"data-w3a-tx-confirmer-css",
|
|
4152
4146
|
"data-w3a-components-css"
|
|
4153
4147
|
];
|
|
4154
|
-
_treeBuildVersion = 0;
|
|
4155
|
-
_confirmArmed = false;
|
|
4156
|
-
_confirmArmRaf1 = null;
|
|
4157
|
-
_confirmArmRaf2 = null;
|
|
4158
4148
|
constructor() {
|
|
4159
4149
|
super();
|
|
4150
|
+
this._heightReflow = createSurfaceHeightReflow({
|
|
4151
|
+
reason: "tx-body",
|
|
4152
|
+
element: () => this.querySelector(".txc-root"),
|
|
4153
|
+
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
4154
|
+
settled: () => this.updateComplete
|
|
4155
|
+
});
|
|
4156
|
+
this._treeNode = null;
|
|
4157
|
+
this._ensureTreeDefinition = TxTree_default;
|
|
4158
|
+
this._stylesReady = false;
|
|
4159
|
+
this._stylePromises = [];
|
|
4160
|
+
this._stylesAwaiting = null;
|
|
4161
|
+
this._treeBuildVersion = 0;
|
|
4162
|
+
this._confirmArmed = false;
|
|
4163
|
+
this._confirmArmRaf1 = null;
|
|
4164
|
+
this._confirmArmRaf2 = null;
|
|
4165
|
+
this._stopDragStart = (e) => {
|
|
4166
|
+
e.stopPropagation();
|
|
4167
|
+
};
|
|
4168
|
+
this.onConfirm = () => {
|
|
4169
|
+
if (this.loading || !this._confirmArmed)
|
|
4170
|
+
return;
|
|
4171
|
+
dispatchLitConfirm(this);
|
|
4172
|
+
};
|
|
4173
|
+
this.onCancel = () => {
|
|
4174
|
+
dispatchLitCancel(this);
|
|
4175
|
+
};
|
|
4160
4176
|
const root = document?.documentElement || null;
|
|
4161
4177
|
if (root) {
|
|
4162
4178
|
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"));
|
|
@@ -4206,8 +4222,8 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
4206
4222
|
return true;
|
|
4207
4223
|
}
|
|
4208
4224
|
if (!this._stylesAwaiting) {
|
|
4209
|
-
const
|
|
4210
|
-
this._stylesAwaiting =
|
|
4225
|
+
const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
4226
|
+
this._stylesAwaiting = p.then(() => {
|
|
4211
4227
|
this._stylesReady = true;
|
|
4212
4228
|
this._rebuildTree();
|
|
4213
4229
|
});
|
|
@@ -4247,17 +4263,17 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
4247
4263
|
}
|
|
4248
4264
|
}
|
|
4249
4265
|
_applyTooltipWidthVar() {
|
|
4250
|
-
const
|
|
4251
|
-
if (
|
|
4252
|
-
this.setCssVars({ "--tooltip-width":
|
|
4266
|
+
const w = this._normalizeWidth(this.tooltipWidth);
|
|
4267
|
+
if (w)
|
|
4268
|
+
this.setCssVars({ "--tooltip-width": w });
|
|
4253
4269
|
}
|
|
4254
4270
|
_normalizeWidth(val) {
|
|
4255
4271
|
if (val === undefined || val === null)
|
|
4256
4272
|
return;
|
|
4257
4273
|
if (typeof val === "number" && Number.isFinite(val))
|
|
4258
4274
|
return `${val}px`;
|
|
4259
|
-
const
|
|
4260
|
-
return
|
|
4275
|
+
const s = String(val).trim();
|
|
4276
|
+
return s.length ? s : undefined;
|
|
4261
4277
|
}
|
|
4262
4278
|
_operationHasAbiDecodeHint(operation) {
|
|
4263
4279
|
const hint = operation.abiDecodeHint;
|
|
@@ -4283,10 +4299,10 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
4283
4299
|
}
|
|
4284
4300
|
async _enrichTreeWithAbi(args) {
|
|
4285
4301
|
try {
|
|
4286
|
-
const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(),
|
|
4302
|
+
const module = await Promise.resolve().then(() => (init_enrichDisplayModelWithAbi(), {}));
|
|
4287
4303
|
if (args.buildVersion !== this._treeBuildVersion)
|
|
4288
4304
|
return;
|
|
4289
|
-
const enrichedModel =
|
|
4305
|
+
const enrichedModel = enrichDisplayModelWithAbi(args.model);
|
|
4290
4306
|
if (args.buildVersion !== this._treeBuildVersion)
|
|
4291
4307
|
return;
|
|
4292
4308
|
this._treeNode = buildDisplayTreeFromModel(enrichedModel);
|
|
@@ -4329,23 +4345,12 @@ var init_tx_confirm_content = __esm(() => {
|
|
|
4329
4345
|
return;
|
|
4330
4346
|
}
|
|
4331
4347
|
this._treeNode = null;
|
|
4332
|
-
} catch (
|
|
4333
|
-
console.warn("[TxConfirmContent] failed to build TxTree",
|
|
4348
|
+
} catch (e) {
|
|
4349
|
+
console.warn("[TxConfirmContent] failed to build TxTree", e);
|
|
4334
4350
|
this._treeNode = null;
|
|
4335
4351
|
}
|
|
4336
4352
|
maybeRequestUpdate();
|
|
4337
4353
|
}
|
|
4338
|
-
_stopDragStart = (e6) => {
|
|
4339
|
-
e6.stopPropagation();
|
|
4340
|
-
};
|
|
4341
|
-
onConfirm = () => {
|
|
4342
|
-
if (this.loading || !this._confirmArmed)
|
|
4343
|
-
return;
|
|
4344
|
-
dispatchLitConfirm(this);
|
|
4345
|
-
};
|
|
4346
|
-
onCancel = () => {
|
|
4347
|
-
dispatchLitCancel(this);
|
|
4348
|
-
};
|
|
4349
4354
|
render() {
|
|
4350
4355
|
const treeTheme = this.theme === "dark" ? "dark" : "light";
|
|
4351
4356
|
const nearExplorerBase = this.nearExplorerUrl || "https://testnet.nearblocks.io";
|
|
@@ -4469,6 +4474,26 @@ var init_HaloBorder = __esm(() => {
|
|
|
4469
4474
|
init_css_loader();
|
|
4470
4475
|
init_registry();
|
|
4471
4476
|
HaloBorderElement = class HaloBorderElement extends LitElementWithProps {
|
|
4477
|
+
constructor() {
|
|
4478
|
+
super(...arguments);
|
|
4479
|
+
this._stylesReady = false;
|
|
4480
|
+
this._stylePromises = [];
|
|
4481
|
+
this._stylesAwaiting = null;
|
|
4482
|
+
this._rafId = null;
|
|
4483
|
+
this._startTs = 0;
|
|
4484
|
+
this._running = false;
|
|
4485
|
+
this.tick = (ts) => {
|
|
4486
|
+
if (!this._running)
|
|
4487
|
+
return;
|
|
4488
|
+
if (!this._startTs)
|
|
4489
|
+
this._startTs = ts;
|
|
4490
|
+
const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
|
|
4491
|
+
const delta = (ts - this._startTs) % dur;
|
|
4492
|
+
const angle = delta / dur * 360;
|
|
4493
|
+
this.setCssVars({ "--halo-angle": `${angle}deg` });
|
|
4494
|
+
this._rafId = requestAnimationFrame(this.tick);
|
|
4495
|
+
};
|
|
4496
|
+
}
|
|
4472
4497
|
static properties = {
|
|
4473
4498
|
animated: { type: Boolean },
|
|
4474
4499
|
theme: { type: String },
|
|
@@ -4483,15 +4508,12 @@ var init_HaloBorder = __esm(() => {
|
|
|
4483
4508
|
innerPadding: { type: String, attribute: "inner-padding" },
|
|
4484
4509
|
innerBackground: { type: String, attribute: "inner-background" }
|
|
4485
4510
|
};
|
|
4486
|
-
_stylesReady = false;
|
|
4487
|
-
_stylePromises = [];
|
|
4488
|
-
_stylesAwaiting = null;
|
|
4489
4511
|
static _STYLE_MARKER = "data-w3a-halo-border-css";
|
|
4490
4512
|
createRenderRoot() {
|
|
4491
4513
|
const root = super.createRenderRoot();
|
|
4492
|
-
const
|
|
4493
|
-
this._stylePromises.push(
|
|
4494
|
-
|
|
4514
|
+
const p = ensureExternalStyles(root, "halo-border.css", HaloBorderElement._STYLE_MARKER);
|
|
4515
|
+
this._stylePromises.push(p);
|
|
4516
|
+
p.catch(() => {});
|
|
4495
4517
|
return root;
|
|
4496
4518
|
}
|
|
4497
4519
|
shouldUpdate(_changed) {
|
|
@@ -4502,7 +4524,7 @@ var init_HaloBorder = __esm(() => {
|
|
|
4502
4524
|
return true;
|
|
4503
4525
|
}
|
|
4504
4526
|
if (!this._stylesAwaiting) {
|
|
4505
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
4527
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
4506
4528
|
this._stylesAwaiting = settle.then(() => {
|
|
4507
4529
|
this._stylesReady = true;
|
|
4508
4530
|
this.requestUpdate();
|
|
@@ -4520,9 +4542,6 @@ var init_HaloBorder = __esm(() => {
|
|
|
4520
4542
|
const statefulLink = link;
|
|
4521
4543
|
return !!(statefulLink._w3aLoaded || link.sheet);
|
|
4522
4544
|
}
|
|
4523
|
-
_rafId = null;
|
|
4524
|
-
_startTs = 0;
|
|
4525
|
-
_running = false;
|
|
4526
4545
|
connectedCallback() {
|
|
4527
4546
|
super.connectedCallback();
|
|
4528
4547
|
this.applyCssVars();
|
|
@@ -4562,17 +4581,6 @@ var init_HaloBorder = __esm(() => {
|
|
|
4562
4581
|
this.stop();
|
|
4563
4582
|
super.disconnectedCallback();
|
|
4564
4583
|
}
|
|
4565
|
-
tick = (ts) => {
|
|
4566
|
-
if (!this._running)
|
|
4567
|
-
return;
|
|
4568
|
-
if (!this._startTs)
|
|
4569
|
-
this._startTs = ts;
|
|
4570
|
-
const dur = typeof this.durationMs === "number" && this.durationMs > 0 ? this.durationMs : 1150;
|
|
4571
|
-
const delta = (ts - this._startTs) % dur;
|
|
4572
|
-
const angle = delta / dur * 360;
|
|
4573
|
-
this.setCssVars({ "--halo-angle": `${angle}deg` });
|
|
4574
|
-
this._rafId = requestAnimationFrame(this.tick);
|
|
4575
|
-
};
|
|
4576
4584
|
start() {
|
|
4577
4585
|
if (this._running)
|
|
4578
4586
|
return;
|
|
@@ -4615,6 +4623,12 @@ var init_PasskeyHaloLoading = __esm(() => {
|
|
|
4615
4623
|
init_css_loader();
|
|
4616
4624
|
init_registry();
|
|
4617
4625
|
PasskeyHaloLoadingElement = class PasskeyHaloLoadingElement extends LitElementWithProps {
|
|
4626
|
+
constructor() {
|
|
4627
|
+
super(...arguments);
|
|
4628
|
+
this._stylesReady = false;
|
|
4629
|
+
this._stylePromises = [];
|
|
4630
|
+
this._stylesAwaiting = null;
|
|
4631
|
+
}
|
|
4618
4632
|
static properties = {
|
|
4619
4633
|
animated: { type: Boolean },
|
|
4620
4634
|
theme: { type: String },
|
|
@@ -4633,15 +4647,12 @@ var init_PasskeyHaloLoading = __esm(() => {
|
|
|
4633
4647
|
iconContainerBorderRadius: { type: String, attribute: "icon-container-border-radius" },
|
|
4634
4648
|
iconContainerBackgroundColor: { type: String, attribute: "icon-container-background-color" }
|
|
4635
4649
|
};
|
|
4636
|
-
_stylesReady = false;
|
|
4637
|
-
_stylePromises = [];
|
|
4638
|
-
_stylesAwaiting = null;
|
|
4639
4650
|
static _STYLE_MARKER = "data-w3a-passkey-halo-loading-css";
|
|
4640
4651
|
createRenderRoot() {
|
|
4641
4652
|
const root = super.createRenderRoot();
|
|
4642
|
-
const
|
|
4643
|
-
this._stylePromises.push(
|
|
4644
|
-
|
|
4653
|
+
const p = ensureExternalStyles(root, "passkey-halo-loading.css", PasskeyHaloLoadingElement._STYLE_MARKER);
|
|
4654
|
+
this._stylePromises.push(p);
|
|
4655
|
+
p.catch(() => {});
|
|
4645
4656
|
return root;
|
|
4646
4657
|
}
|
|
4647
4658
|
shouldUpdate(_changed) {
|
|
@@ -4652,7 +4663,7 @@ var init_PasskeyHaloLoading = __esm(() => {
|
|
|
4652
4663
|
return true;
|
|
4653
4664
|
}
|
|
4654
4665
|
if (!this._stylesAwaiting) {
|
|
4655
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
4666
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
4656
4667
|
this._stylesAwaiting = settle.then(() => {
|
|
4657
4668
|
this._stylesReady = true;
|
|
4658
4669
|
this.requestUpdate();
|
|
@@ -4914,50 +4925,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
4914
4925
|
otpResendStatus: { type: String, attribute: false },
|
|
4915
4926
|
otpSubmitAnimating: { type: Boolean, attribute: false }
|
|
4916
4927
|
};
|
|
4917
|
-
otpCode = "";
|
|
4918
|
-
otpError = "";
|
|
4919
|
-
otpResendBusy = false;
|
|
4920
|
-
otpResendUntilMs = 0;
|
|
4921
|
-
otpResendStatus = "";
|
|
4922
|
-
otpSubmitAnimating = false;
|
|
4923
|
-
_otpResendTimer = null;
|
|
4924
|
-
_otpSubmitTimer = null;
|
|
4925
|
-
_lastAutoOtpSubmitCode = "";
|
|
4926
|
-
_ensureDrawerDefinition = Drawer_default;
|
|
4927
|
-
_drawerEl = null;
|
|
4928
|
-
_open = false;
|
|
4929
|
-
_ownsThemeAttr = false;
|
|
4930
|
-
_onWindowMessage = (ev) => {
|
|
4931
|
-
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
4932
|
-
if (!data || typeof data.type !== "string")
|
|
4933
|
-
return;
|
|
4934
|
-
if (data.type === "MODAL_TIMEOUT") {
|
|
4935
|
-
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
4936
|
-
this.loading = false;
|
|
4937
|
-
this.errorMessage = msg;
|
|
4938
|
-
this._drawerEl?.handleClose?.();
|
|
4939
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
4940
|
-
bubbles: true,
|
|
4941
|
-
composed: true,
|
|
4942
|
-
detail: { confirmed: false }
|
|
4943
|
-
}));
|
|
4944
|
-
}
|
|
4945
|
-
};
|
|
4946
|
-
_onKeyDown = (e6) => {
|
|
4947
|
-
if (e6.key === "Escape" || e6.key === "Esc") {
|
|
4948
|
-
if (this.loading)
|
|
4949
|
-
return;
|
|
4950
|
-
e6.preventDefault();
|
|
4951
|
-
this._drawerEl?.handleClose();
|
|
4952
|
-
if (!this._drawerEl) {
|
|
4953
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
4954
|
-
bubbles: true,
|
|
4955
|
-
composed: true,
|
|
4956
|
-
detail: { confirmed: false }
|
|
4957
|
-
}));
|
|
4958
|
-
}
|
|
4959
|
-
}
|
|
4960
|
-
};
|
|
4961
4928
|
_chainLabelForModel() {
|
|
4962
4929
|
switch (this.model?.chain) {
|
|
4963
4930
|
case "tempo":
|
|
@@ -5050,24 +5017,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5050
5017
|
</div>
|
|
5051
5018
|
`;
|
|
5052
5019
|
}
|
|
5053
|
-
onPasskeyRegistrationConfirm = () => {
|
|
5054
|
-
this.finishContentConfirm();
|
|
5055
|
-
};
|
|
5056
|
-
_onOtpInput = (event) => {
|
|
5057
|
-
const input = event.currentTarget;
|
|
5058
|
-
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
5059
|
-
this.otpCode = code;
|
|
5060
|
-
this.otpError = "";
|
|
5061
|
-
if (code.length < 6) {
|
|
5062
|
-
this._lastAutoOtpSubmitCode = "";
|
|
5063
|
-
this._resetOtpSubmitAnimation();
|
|
5064
|
-
return;
|
|
5065
|
-
}
|
|
5066
|
-
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
5067
|
-
return;
|
|
5068
|
-
this._lastAutoOtpSubmitCode = code;
|
|
5069
|
-
this._submitEmailOtpAfterFade(code);
|
|
5070
|
-
};
|
|
5071
5020
|
_clearOtpSubmitTimer() {
|
|
5072
5021
|
if (this._otpSubmitTimer != null)
|
|
5073
5022
|
window.clearTimeout(this._otpSubmitTimer);
|
|
@@ -5111,40 +5060,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5111
5060
|
return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
|
|
5112
5061
|
return this.otpResendStatus || "Resend code";
|
|
5113
5062
|
}
|
|
5114
|
-
_onOtpResend = () => {
|
|
5115
|
-
const resend = this.emailOtpPrompt?.onResend;
|
|
5116
|
-
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
5117
|
-
return;
|
|
5118
|
-
if (this.otpResendUntilMs > Date.now())
|
|
5119
|
-
return;
|
|
5120
|
-
this.otpError = "";
|
|
5121
|
-
this.otpResendStatus = "";
|
|
5122
|
-
this._lastAutoOtpSubmitCode = "";
|
|
5123
|
-
this._resetOtpSubmitAnimation();
|
|
5124
|
-
this.otpResendBusy = true;
|
|
5125
|
-
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
5126
|
-
this.requestUpdate();
|
|
5127
|
-
(async () => {
|
|
5128
|
-
try {
|
|
5129
|
-
const result = await resend();
|
|
5130
|
-
const challengeId = String(result?.challengeId || "").trim();
|
|
5131
|
-
const emailHint = String(result?.emailHint || "").trim();
|
|
5132
|
-
if (challengeId) {
|
|
5133
|
-
this.emailOtpPrompt = {
|
|
5134
|
-
...this.emailOtpPrompt,
|
|
5135
|
-
challengeId,
|
|
5136
|
-
...emailHint ? { emailHint } : {}
|
|
5137
|
-
};
|
|
5138
|
-
}
|
|
5139
|
-
this.otpResendStatus = "Code sent";
|
|
5140
|
-
} catch (error) {
|
|
5141
|
-
this.otpError = formatEmailOtpResendError(error);
|
|
5142
|
-
} finally {
|
|
5143
|
-
this.otpResendBusy = false;
|
|
5144
|
-
this.requestUpdate();
|
|
5145
|
-
}
|
|
5146
|
-
})();
|
|
5147
|
-
};
|
|
5148
5063
|
_renderEmailOtpPrompt() {
|
|
5149
5064
|
if (!this._isEmailOtpMode())
|
|
5150
5065
|
return "";
|
|
@@ -5191,11 +5106,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5191
5106
|
</div>
|
|
5192
5107
|
`;
|
|
5193
5108
|
}
|
|
5194
|
-
_onFundingNoticeCopy = (event) => {
|
|
5195
|
-
const target = event.currentTarget;
|
|
5196
|
-
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
5197
|
-
copyTextToClipboard(accountId);
|
|
5198
|
-
};
|
|
5199
5109
|
_renderConfirmationBody() {
|
|
5200
5110
|
const body = String(this.body || "").trim();
|
|
5201
5111
|
if (!body)
|
|
@@ -5226,6 +5136,147 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5226
5136
|
}
|
|
5227
5137
|
constructor() {
|
|
5228
5138
|
super();
|
|
5139
|
+
this.otpCode = "";
|
|
5140
|
+
this.otpError = "";
|
|
5141
|
+
this.otpResendBusy = false;
|
|
5142
|
+
this.otpResendUntilMs = 0;
|
|
5143
|
+
this.otpResendStatus = "";
|
|
5144
|
+
this.otpSubmitAnimating = false;
|
|
5145
|
+
this._otpResendTimer = null;
|
|
5146
|
+
this._otpSubmitTimer = null;
|
|
5147
|
+
this._lastAutoOtpSubmitCode = "";
|
|
5148
|
+
this._ensureDrawerDefinition = Drawer_default;
|
|
5149
|
+
this._drawerEl = null;
|
|
5150
|
+
this._open = false;
|
|
5151
|
+
this._ownsThemeAttr = false;
|
|
5152
|
+
this._onWindowMessage = (ev) => {
|
|
5153
|
+
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
5154
|
+
if (!data || typeof data.type !== "string")
|
|
5155
|
+
return;
|
|
5156
|
+
if (data.type === "MODAL_TIMEOUT") {
|
|
5157
|
+
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
5158
|
+
this.loading = false;
|
|
5159
|
+
this.errorMessage = msg;
|
|
5160
|
+
this._drawerEl?.handleClose?.();
|
|
5161
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5162
|
+
bubbles: true,
|
|
5163
|
+
composed: true,
|
|
5164
|
+
detail: { confirmed: false }
|
|
5165
|
+
}));
|
|
5166
|
+
}
|
|
5167
|
+
};
|
|
5168
|
+
this._onKeyDown = (e) => {
|
|
5169
|
+
if (e.key === "Escape" || e.key === "Esc") {
|
|
5170
|
+
if (this.loading)
|
|
5171
|
+
return;
|
|
5172
|
+
e.preventDefault();
|
|
5173
|
+
this._drawerEl?.handleClose();
|
|
5174
|
+
if (!this._drawerEl) {
|
|
5175
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5176
|
+
bubbles: true,
|
|
5177
|
+
composed: true,
|
|
5178
|
+
detail: { confirmed: false }
|
|
5179
|
+
}));
|
|
5180
|
+
}
|
|
5181
|
+
}
|
|
5182
|
+
};
|
|
5183
|
+
this.onPasskeyRegistrationConfirm = () => {
|
|
5184
|
+
this.finishContentConfirm();
|
|
5185
|
+
};
|
|
5186
|
+
this._onOtpInput = (event) => {
|
|
5187
|
+
const input = event.currentTarget;
|
|
5188
|
+
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
5189
|
+
this.otpCode = code;
|
|
5190
|
+
this.otpError = "";
|
|
5191
|
+
if (code.length < 6) {
|
|
5192
|
+
this._lastAutoOtpSubmitCode = "";
|
|
5193
|
+
this._resetOtpSubmitAnimation();
|
|
5194
|
+
return;
|
|
5195
|
+
}
|
|
5196
|
+
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
5197
|
+
return;
|
|
5198
|
+
this._lastAutoOtpSubmitCode = code;
|
|
5199
|
+
this._submitEmailOtpAfterFade(code);
|
|
5200
|
+
};
|
|
5201
|
+
this._onOtpResend = () => {
|
|
5202
|
+
const resend = this.emailOtpPrompt?.onResend;
|
|
5203
|
+
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
5204
|
+
return;
|
|
5205
|
+
if (this.otpResendUntilMs > Date.now())
|
|
5206
|
+
return;
|
|
5207
|
+
this.otpError = "";
|
|
5208
|
+
this.otpResendStatus = "";
|
|
5209
|
+
this._lastAutoOtpSubmitCode = "";
|
|
5210
|
+
this._resetOtpSubmitAnimation();
|
|
5211
|
+
this.otpResendBusy = true;
|
|
5212
|
+
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
5213
|
+
this.requestUpdate();
|
|
5214
|
+
(async () => {
|
|
5215
|
+
try {
|
|
5216
|
+
const result = await resend();
|
|
5217
|
+
const challengeId = String(result?.challengeId || "").trim();
|
|
5218
|
+
const emailHint = String(result?.emailHint || "").trim();
|
|
5219
|
+
if (challengeId) {
|
|
5220
|
+
this.emailOtpPrompt = {
|
|
5221
|
+
...this.emailOtpPrompt,
|
|
5222
|
+
challengeId,
|
|
5223
|
+
...emailHint ? { emailHint } : {}
|
|
5224
|
+
};
|
|
5225
|
+
}
|
|
5226
|
+
this.otpResendStatus = "Code sent";
|
|
5227
|
+
} catch (error) {
|
|
5228
|
+
this.otpError = formatEmailOtpResendError(error);
|
|
5229
|
+
} finally {
|
|
5230
|
+
this.otpResendBusy = false;
|
|
5231
|
+
this.requestUpdate();
|
|
5232
|
+
}
|
|
5233
|
+
})();
|
|
5234
|
+
};
|
|
5235
|
+
this._onFundingNoticeCopy = (event) => {
|
|
5236
|
+
const target = event.currentTarget;
|
|
5237
|
+
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
5238
|
+
copyTextToClipboard(accountId);
|
|
5239
|
+
};
|
|
5240
|
+
this.onDrawerCancel = () => {
|
|
5241
|
+
if (this.loading)
|
|
5242
|
+
return;
|
|
5243
|
+
this._open = false;
|
|
5244
|
+
this.requestUpdate();
|
|
5245
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5246
|
+
bubbles: true,
|
|
5247
|
+
composed: true,
|
|
5248
|
+
detail: { confirmed: false }
|
|
5249
|
+
}));
|
|
5250
|
+
};
|
|
5251
|
+
this.onContentConfirm = () => {
|
|
5252
|
+
if (this.loading || this.otpSubmitAnimating)
|
|
5253
|
+
return;
|
|
5254
|
+
if (this._isEmailOtpMode()) {
|
|
5255
|
+
const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
|
|
5256
|
+
if (!/^\d{6}$/.test(code)) {
|
|
5257
|
+
this.otpCode = code;
|
|
5258
|
+
this.otpError = "Enter the 6-digit Email OTP code.";
|
|
5259
|
+
this.requestUpdate();
|
|
5260
|
+
return;
|
|
5261
|
+
}
|
|
5262
|
+
this.otpCode = code;
|
|
5263
|
+
this.otpError = "";
|
|
5264
|
+
this._lastAutoOtpSubmitCode = code;
|
|
5265
|
+
this._submitEmailOtpAfterFade(code);
|
|
5266
|
+
return;
|
|
5267
|
+
}
|
|
5268
|
+
this.finishContentConfirm();
|
|
5269
|
+
};
|
|
5270
|
+
this.onContentCancel = () => {
|
|
5271
|
+
this._drawerEl?.handleClose();
|
|
5272
|
+
this._open = false;
|
|
5273
|
+
this.requestUpdate();
|
|
5274
|
+
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5275
|
+
bubbles: true,
|
|
5276
|
+
composed: true,
|
|
5277
|
+
detail: { confirmed: false }
|
|
5278
|
+
}));
|
|
5279
|
+
};
|
|
5229
5280
|
this.nearAccountId = "";
|
|
5230
5281
|
this.txSigningRequests = undefined;
|
|
5231
5282
|
this.model = undefined;
|
|
@@ -5286,7 +5337,7 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5286
5337
|
ensureExternalStyles(root, "tx-confirmer.css", "data-w3a-tx-confirmer-css"),
|
|
5287
5338
|
ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css")
|
|
5288
5339
|
]);
|
|
5289
|
-
await new Promise((
|
|
5340
|
+
await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r())));
|
|
5290
5341
|
this._open = true;
|
|
5291
5342
|
this.requestUpdate();
|
|
5292
5343
|
}
|
|
@@ -5315,36 +5366,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5315
5366
|
}
|
|
5316
5367
|
}
|
|
5317
5368
|
}
|
|
5318
|
-
onDrawerCancel = () => {
|
|
5319
|
-
if (this.loading)
|
|
5320
|
-
return;
|
|
5321
|
-
this._open = false;
|
|
5322
|
-
this.requestUpdate();
|
|
5323
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5324
|
-
bubbles: true,
|
|
5325
|
-
composed: true,
|
|
5326
|
-
detail: { confirmed: false }
|
|
5327
|
-
}));
|
|
5328
|
-
};
|
|
5329
|
-
onContentConfirm = () => {
|
|
5330
|
-
if (this.loading || this.otpSubmitAnimating)
|
|
5331
|
-
return;
|
|
5332
|
-
if (this._isEmailOtpMode()) {
|
|
5333
|
-
const code = String(this.otpCode || "").replace(/\D/g, "").slice(0, 6);
|
|
5334
|
-
if (!/^\d{6}$/.test(code)) {
|
|
5335
|
-
this.otpCode = code;
|
|
5336
|
-
this.otpError = "Enter the 6-digit Email OTP code.";
|
|
5337
|
-
this.requestUpdate();
|
|
5338
|
-
return;
|
|
5339
|
-
}
|
|
5340
|
-
this.otpCode = code;
|
|
5341
|
-
this.otpError = "";
|
|
5342
|
-
this._lastAutoOtpSubmitCode = code;
|
|
5343
|
-
this._submitEmailOtpAfterFade(code);
|
|
5344
|
-
return;
|
|
5345
|
-
}
|
|
5346
|
-
this.finishContentConfirm();
|
|
5347
|
-
};
|
|
5348
5369
|
finishContentConfirm(opts) {
|
|
5349
5370
|
if (this.loading)
|
|
5350
5371
|
return;
|
|
@@ -5364,16 +5385,6 @@ var init_viewer_drawer = __esm(() => {
|
|
|
5364
5385
|
}
|
|
5365
5386
|
}));
|
|
5366
5387
|
}
|
|
5367
|
-
onContentCancel = () => {
|
|
5368
|
-
this._drawerEl?.handleClose();
|
|
5369
|
-
this._open = false;
|
|
5370
|
-
this.requestUpdate();
|
|
5371
|
-
this.dispatchEvent(new CustomEvent(WalletIframeDomEvents.TX_CONFIRMER_CANCEL, {
|
|
5372
|
-
bubbles: true,
|
|
5373
|
-
composed: true,
|
|
5374
|
-
detail: { confirmed: false }
|
|
5375
|
-
}));
|
|
5376
|
-
};
|
|
5377
5388
|
close(_confirmed) {
|
|
5378
5389
|
if (!this._open)
|
|
5379
5390
|
return;
|
|
@@ -5574,12 +5585,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
5574
5585
|
init_nearFundingNotice();
|
|
5575
5586
|
init_registry();
|
|
5576
5587
|
ModalTxConfirmElement = class ModalTxConfirmElement extends LitElementWithProps {
|
|
5577
|
-
_heightReflow = createSurfaceHeightReflow({
|
|
5578
|
-
reason: "confirm-body",
|
|
5579
|
-
element: () => this.querySelector(".modal-container-root"),
|
|
5580
|
-
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
5581
|
-
settled: () => this.updateComplete
|
|
5582
|
-
});
|
|
5583
5588
|
static requiredChildTags = ["w3a-tx-confirm-content"];
|
|
5584
5589
|
static strictChildDefinitions = true;
|
|
5585
5590
|
static keepDefinitions = [tx_confirm_content_default];
|
|
@@ -5612,57 +5617,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
5612
5617
|
otpResendStatus: { type: String, attribute: false },
|
|
5613
5618
|
otpSubmitAnimating: { type: Boolean, attribute: false }
|
|
5614
5619
|
};
|
|
5615
|
-
totalAmount = "";
|
|
5616
|
-
method = "";
|
|
5617
|
-
fingerprint = "";
|
|
5618
|
-
body = "";
|
|
5619
|
-
title = "";
|
|
5620
|
-
cancelText = "Cancel";
|
|
5621
|
-
confirmText = "Next";
|
|
5622
|
-
model;
|
|
5623
|
-
securityContext;
|
|
5624
|
-
loading = false;
|
|
5625
|
-
errorMessage = undefined;
|
|
5626
|
-
theme = "dark";
|
|
5627
|
-
appearance;
|
|
5628
|
-
nearExplorerUrl;
|
|
5629
|
-
tempoExplorerUrl;
|
|
5630
|
-
evmExplorerUrl;
|
|
5631
|
-
signingAuthMode;
|
|
5632
|
-
emailOtpPrompt;
|
|
5633
|
-
otpCode = "";
|
|
5634
|
-
otpError = "";
|
|
5635
|
-
otpResendBusy = false;
|
|
5636
|
-
otpResendUntilMs = 0;
|
|
5637
|
-
otpResendStatus = "";
|
|
5638
|
-
otpSubmitAnimating = false;
|
|
5639
|
-
_otpResendTimer = null;
|
|
5640
|
-
_otpSubmitTimer = null;
|
|
5641
|
-
_lastAutoOtpSubmitCode = "";
|
|
5642
|
-
intentDigest;
|
|
5643
|
-
deferClose = false;
|
|
5644
|
-
_stylesReady = false;
|
|
5645
|
-
_stylePromises = [];
|
|
5646
|
-
_stylesAwaiting = null;
|
|
5647
|
-
_ensureTreeDefinition = TxTree_default;
|
|
5648
|
-
_ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
|
|
5649
|
-
_onKeyDown = (e6) => {
|
|
5650
|
-
if (e6.key === "Escape" || e6.key === "Esc") {
|
|
5651
|
-
e6.preventDefault();
|
|
5652
|
-
this._handleCancel();
|
|
5653
|
-
}
|
|
5654
|
-
};
|
|
5655
|
-
_onWindowMessage = (ev) => {
|
|
5656
|
-
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
5657
|
-
if (!data || typeof data.type !== "string")
|
|
5658
|
-
return;
|
|
5659
|
-
if (data.type === "MODAL_TIMEOUT") {
|
|
5660
|
-
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
5661
|
-
this.loading = false;
|
|
5662
|
-
this.errorMessage = msg;
|
|
5663
|
-
this._handleCancel();
|
|
5664
|
-
}
|
|
5665
|
-
};
|
|
5666
5620
|
_chainLabelForModel() {
|
|
5667
5621
|
switch (this.model?.chain) {
|
|
5668
5622
|
case "tempo":
|
|
@@ -5700,12 +5654,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
5700
5654
|
_isStandaloneSurface() {
|
|
5701
5655
|
return this.closest("w3a-tx-confirmer")?.getAttribute("data-w3a-confirm-surface") === "standalone";
|
|
5702
5656
|
}
|
|
5703
|
-
_handleBackdropClick = (event) => {
|
|
5704
|
-
if (!this._isStandaloneSurface())
|
|
5705
|
-
return;
|
|
5706
|
-
event.stopPropagation();
|
|
5707
|
-
this._handleCancel();
|
|
5708
|
-
};
|
|
5709
5657
|
_authHeadingFallback() {
|
|
5710
5658
|
if (this._passkeyRegistrationDisplay())
|
|
5711
5659
|
return "Create your passkey";
|
|
@@ -5771,9 +5719,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
5771
5719
|
</div>
|
|
5772
5720
|
`;
|
|
5773
5721
|
}
|
|
5774
|
-
_onPasskeyRegistrationConfirm = () => {
|
|
5775
|
-
this._finishConfirm();
|
|
5776
|
-
};
|
|
5777
5722
|
_renderPasskeyRegistrationModal(display) {
|
|
5778
5723
|
return x`
|
|
5779
5724
|
${this._isStandaloneSurface() ? x`<div class="standalone-surface-backdrop" @click=${this._handleBackdropClick}></div>` : ""}
|
|
@@ -5808,21 +5753,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
5808
5753
|
</div>
|
|
5809
5754
|
`;
|
|
5810
5755
|
}
|
|
5811
|
-
_onOtpInput = (event) => {
|
|
5812
|
-
const input = event.currentTarget;
|
|
5813
|
-
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
5814
|
-
this.otpCode = code;
|
|
5815
|
-
this.otpError = "";
|
|
5816
|
-
if (code.length < 6) {
|
|
5817
|
-
this._lastAutoOtpSubmitCode = "";
|
|
5818
|
-
this._resetOtpSubmitAnimation();
|
|
5819
|
-
return;
|
|
5820
|
-
}
|
|
5821
|
-
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
5822
|
-
return;
|
|
5823
|
-
this._lastAutoOtpSubmitCode = code;
|
|
5824
|
-
this._submitEmailOtpAfterFade(code);
|
|
5825
|
-
};
|
|
5826
5756
|
_clearOtpSubmitTimer() {
|
|
5827
5757
|
if (this._otpSubmitTimer != null)
|
|
5828
5758
|
window.clearTimeout(this._otpSubmitTimer);
|
|
@@ -5866,40 +5796,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
5866
5796
|
return `Resend in ${Math.ceil(remainingMs / 1000)}s`;
|
|
5867
5797
|
return this.otpResendStatus || "Resend code";
|
|
5868
5798
|
}
|
|
5869
|
-
_onOtpResend = () => {
|
|
5870
|
-
const resend = this.emailOtpPrompt?.onResend;
|
|
5871
|
-
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
5872
|
-
return;
|
|
5873
|
-
if (this.otpResendUntilMs > Date.now())
|
|
5874
|
-
return;
|
|
5875
|
-
this.otpError = "";
|
|
5876
|
-
this.otpResendStatus = "";
|
|
5877
|
-
this._lastAutoOtpSubmitCode = "";
|
|
5878
|
-
this._resetOtpSubmitAnimation();
|
|
5879
|
-
this.otpResendBusy = true;
|
|
5880
|
-
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
5881
|
-
this.requestUpdate();
|
|
5882
|
-
(async () => {
|
|
5883
|
-
try {
|
|
5884
|
-
const result = await resend();
|
|
5885
|
-
const challengeId = String(result?.challengeId || "").trim();
|
|
5886
|
-
const emailHint = String(result?.emailHint || "").trim();
|
|
5887
|
-
if (challengeId) {
|
|
5888
|
-
this.emailOtpPrompt = {
|
|
5889
|
-
...this.emailOtpPrompt,
|
|
5890
|
-
challengeId,
|
|
5891
|
-
...emailHint ? { emailHint } : {}
|
|
5892
|
-
};
|
|
5893
|
-
}
|
|
5894
|
-
this.otpResendStatus = "Code sent";
|
|
5895
|
-
} catch (error) {
|
|
5896
|
-
this.otpError = formatEmailOtpResendError2(error);
|
|
5897
|
-
} finally {
|
|
5898
|
-
this.otpResendBusy = false;
|
|
5899
|
-
this.requestUpdate();
|
|
5900
|
-
}
|
|
5901
|
-
})();
|
|
5902
|
-
};
|
|
5903
5799
|
_renderEmailOtpPrompt() {
|
|
5904
5800
|
if (!this._isEmailOtpMode())
|
|
5905
5801
|
return "";
|
|
@@ -5944,11 +5840,6 @@ var init_viewer_modal = __esm(() => {
|
|
|
5944
5840
|
</div>
|
|
5945
5841
|
`;
|
|
5946
5842
|
}
|
|
5947
|
-
_onFundingNoticeCopy = (event) => {
|
|
5948
|
-
const target = event.currentTarget;
|
|
5949
|
-
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
5950
|
-
copyTextToClipboard(accountId);
|
|
5951
|
-
};
|
|
5952
5843
|
_renderConfirmationBody() {
|
|
5953
5844
|
const body = String(this.body || "").trim();
|
|
5954
5845
|
if (!body)
|
|
@@ -5979,12 +5870,123 @@ var init_viewer_modal = __esm(() => {
|
|
|
5979
5870
|
}
|
|
5980
5871
|
constructor() {
|
|
5981
5872
|
super();
|
|
5873
|
+
this._heightReflow = createSurfaceHeightReflow({
|
|
5874
|
+
reason: "confirm-body",
|
|
5875
|
+
element: () => this.querySelector(".modal-container-root"),
|
|
5876
|
+
setHeightCssPx: (px) => this.setCssVars({ [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${px}px` }),
|
|
5877
|
+
settled: () => this.updateComplete
|
|
5878
|
+
});
|
|
5879
|
+
this.totalAmount = "";
|
|
5880
|
+
this.method = "";
|
|
5881
|
+
this.fingerprint = "";
|
|
5882
|
+
this.body = "";
|
|
5883
|
+
this.title = "";
|
|
5884
|
+
this.cancelText = "Cancel";
|
|
5885
|
+
this.confirmText = "Next";
|
|
5886
|
+
this.loading = false;
|
|
5887
|
+
this.errorMessage = undefined;
|
|
5888
|
+
this.theme = "dark";
|
|
5889
|
+
this.otpCode = "";
|
|
5890
|
+
this.otpError = "";
|
|
5891
|
+
this.otpResendBusy = false;
|
|
5892
|
+
this.otpResendUntilMs = 0;
|
|
5893
|
+
this.otpResendStatus = "";
|
|
5894
|
+
this.otpSubmitAnimating = false;
|
|
5895
|
+
this._otpResendTimer = null;
|
|
5896
|
+
this._otpSubmitTimer = null;
|
|
5897
|
+
this._lastAutoOtpSubmitCode = "";
|
|
5898
|
+
this.deferClose = false;
|
|
5899
|
+
this._stylesReady = false;
|
|
5900
|
+
this._stylePromises = [];
|
|
5901
|
+
this._stylesAwaiting = null;
|
|
5902
|
+
this._ensureTreeDefinition = TxTree_default;
|
|
5903
|
+
this._ensureHaloElements = [HaloBorder_default, PasskeyHaloLoading_default];
|
|
5904
|
+
this._onKeyDown = (e) => {
|
|
5905
|
+
if (e.key === "Escape" || e.key === "Esc") {
|
|
5906
|
+
e.preventDefault();
|
|
5907
|
+
this._handleCancel();
|
|
5908
|
+
}
|
|
5909
|
+
};
|
|
5910
|
+
this._onWindowMessage = (ev) => {
|
|
5911
|
+
const data = ev && ev.data && typeof ev.data === "object" ? ev.data : undefined;
|
|
5912
|
+
if (!data || typeof data.type !== "string")
|
|
5913
|
+
return;
|
|
5914
|
+
if (data.type === "MODAL_TIMEOUT") {
|
|
5915
|
+
const msg = typeof data.payload === "string" && data.payload ? data.payload : "Operation timed out";
|
|
5916
|
+
this.loading = false;
|
|
5917
|
+
this.errorMessage = msg;
|
|
5918
|
+
this._handleCancel();
|
|
5919
|
+
}
|
|
5920
|
+
};
|
|
5921
|
+
this._handleBackdropClick = (event) => {
|
|
5922
|
+
if (!this._isStandaloneSurface())
|
|
5923
|
+
return;
|
|
5924
|
+
event.stopPropagation();
|
|
5925
|
+
this._handleCancel();
|
|
5926
|
+
};
|
|
5927
|
+
this._onPasskeyRegistrationConfirm = () => {
|
|
5928
|
+
this._finishConfirm();
|
|
5929
|
+
};
|
|
5930
|
+
this._onOtpInput = (event) => {
|
|
5931
|
+
const input = event.currentTarget;
|
|
5932
|
+
const code = String(input?.value || "").replace(/\D/g, "").slice(0, 6);
|
|
5933
|
+
this.otpCode = code;
|
|
5934
|
+
this.otpError = "";
|
|
5935
|
+
if (code.length < 6) {
|
|
5936
|
+
this._lastAutoOtpSubmitCode = "";
|
|
5937
|
+
this._resetOtpSubmitAnimation();
|
|
5938
|
+
return;
|
|
5939
|
+
}
|
|
5940
|
+
if (this.loading || this._lastAutoOtpSubmitCode === code)
|
|
5941
|
+
return;
|
|
5942
|
+
this._lastAutoOtpSubmitCode = code;
|
|
5943
|
+
this._submitEmailOtpAfterFade(code);
|
|
5944
|
+
};
|
|
5945
|
+
this._onOtpResend = () => {
|
|
5946
|
+
const resend = this.emailOtpPrompt?.onResend;
|
|
5947
|
+
if (typeof resend !== "function" || this.otpResendBusy || this.loading)
|
|
5948
|
+
return;
|
|
5949
|
+
if (this.otpResendUntilMs > Date.now())
|
|
5950
|
+
return;
|
|
5951
|
+
this.otpError = "";
|
|
5952
|
+
this.otpResendStatus = "";
|
|
5953
|
+
this._lastAutoOtpSubmitCode = "";
|
|
5954
|
+
this._resetOtpSubmitAnimation();
|
|
5955
|
+
this.otpResendBusy = true;
|
|
5956
|
+
this._startOtpResendCountdown(Number(this.emailOtpPrompt?.resendDebounceMs) || 1e4);
|
|
5957
|
+
this.requestUpdate();
|
|
5958
|
+
(async () => {
|
|
5959
|
+
try {
|
|
5960
|
+
const result = await resend();
|
|
5961
|
+
const challengeId = String(result?.challengeId || "").trim();
|
|
5962
|
+
const emailHint = String(result?.emailHint || "").trim();
|
|
5963
|
+
if (challengeId) {
|
|
5964
|
+
this.emailOtpPrompt = {
|
|
5965
|
+
...this.emailOtpPrompt,
|
|
5966
|
+
challengeId,
|
|
5967
|
+
...emailHint ? { emailHint } : {}
|
|
5968
|
+
};
|
|
5969
|
+
}
|
|
5970
|
+
this.otpResendStatus = "Code sent";
|
|
5971
|
+
} catch (error) {
|
|
5972
|
+
this.otpError = formatEmailOtpResendError2(error);
|
|
5973
|
+
} finally {
|
|
5974
|
+
this.otpResendBusy = false;
|
|
5975
|
+
this.requestUpdate();
|
|
5976
|
+
}
|
|
5977
|
+
})();
|
|
5978
|
+
};
|
|
5979
|
+
this._onFundingNoticeCopy = (event) => {
|
|
5980
|
+
const target = event.currentTarget;
|
|
5981
|
+
const accountId = String(target?.dataset.copyValue || "").trim();
|
|
5982
|
+
copyTextToClipboard(accountId);
|
|
5983
|
+
};
|
|
5984
|
+
this._ownsThemeAttr = false;
|
|
5982
5985
|
const root = document?.documentElement || null;
|
|
5983
5986
|
if (root) {
|
|
5984
5987
|
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"));
|
|
5985
5988
|
}
|
|
5986
5989
|
}
|
|
5987
|
-
_ownsThemeAttr = false;
|
|
5988
5990
|
willUpdate(changedProperties) {
|
|
5989
5991
|
super.willUpdate(changedProperties);
|
|
5990
5992
|
if (this.hasUpdated)
|
|
@@ -6056,8 +6058,8 @@ var init_viewer_modal = __esm(() => {
|
|
|
6056
6058
|
if (this._stylesReady)
|
|
6057
6059
|
return true;
|
|
6058
6060
|
if (!this._stylesAwaiting) {
|
|
6059
|
-
const
|
|
6060
|
-
this._stylesAwaiting =
|
|
6061
|
+
const p = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
6062
|
+
this._stylesAwaiting = p.then(() => {
|
|
6061
6063
|
this._stylesReady = true;
|
|
6062
6064
|
this.requestUpdate();
|
|
6063
6065
|
});
|
|
@@ -6296,18 +6298,18 @@ var init_tx_confirmer_wrapper = __esm(() => {
|
|
|
6296
6298
|
evmExplorerUrl: { type: String, attribute: "evm-explorer-url" }
|
|
6297
6299
|
};
|
|
6298
6300
|
static keepDefinitions = [ModalTxConfirmElement, DrawerTxConfirmerElement];
|
|
6299
|
-
childRef = e5();
|
|
6300
|
-
redispatchingEvent = false;
|
|
6301
|
-
interactiveAnnounced = false;
|
|
6302
|
-
currentChild = null;
|
|
6303
|
-
boundConfirmListener = (event) => {
|
|
6304
|
-
this.handleChildConfirm(event);
|
|
6305
|
-
};
|
|
6306
|
-
boundCancelListener = (_event) => {
|
|
6307
|
-
this.handleChildCancel();
|
|
6308
|
-
};
|
|
6309
6301
|
constructor() {
|
|
6310
6302
|
super();
|
|
6303
|
+
this.childRef = e5();
|
|
6304
|
+
this.redispatchingEvent = false;
|
|
6305
|
+
this.interactiveAnnounced = false;
|
|
6306
|
+
this.currentChild = null;
|
|
6307
|
+
this.boundConfirmListener = (event) => {
|
|
6308
|
+
this.handleChildConfirm(event);
|
|
6309
|
+
};
|
|
6310
|
+
this.boundCancelListener = (_event) => {
|
|
6311
|
+
this.handleChildCancel();
|
|
6312
|
+
};
|
|
6311
6313
|
this.variant = DEFAULT_VARIANT;
|
|
6312
6314
|
this.nearAccountId = "";
|
|
6313
6315
|
this.txSigningRequests = undefined;
|
|
@@ -6521,8 +6523,8 @@ function declarationsToCssText(selector, declarations) {
|
|
|
6521
6523
|
function getDefaultCspNonce() {
|
|
6522
6524
|
if (typeof window === "undefined")
|
|
6523
6525
|
return;
|
|
6524
|
-
const
|
|
6525
|
-
return
|
|
6526
|
+
const w = window;
|
|
6527
|
+
return w.w3aNonce || w.litNonce || undefined;
|
|
6526
6528
|
}
|
|
6527
6529
|
function createCspStylesheetManager(opts) {
|
|
6528
6530
|
const { doc, baseCss, baseStyleDataAttr, dynamicStyleDataAttr, nonce } = opts;
|
|
@@ -6541,7 +6543,7 @@ function createCspStylesheetManager(opts) {
|
|
|
6541
6543
|
return;
|
|
6542
6544
|
return typeof nonce === "function" ? nonce() : nonce;
|
|
6543
6545
|
};
|
|
6544
|
-
const
|
|
6546
|
+
const supportsConstructable = () => {
|
|
6545
6547
|
if (state.supportConstructable != null)
|
|
6546
6548
|
return state.supportConstructable;
|
|
6547
6549
|
state.supportConstructable = typeof CSSStyleSheet !== "undefined" && "adoptedStyleSheets" in doc;
|
|
@@ -6581,7 +6583,7 @@ function createCspStylesheetManager(opts) {
|
|
|
6581
6583
|
const ensureBase = () => {
|
|
6582
6584
|
if (state.baseSheet || state.baseStyleEl)
|
|
6583
6585
|
return;
|
|
6584
|
-
if (
|
|
6586
|
+
if (supportsConstructable()) {
|
|
6585
6587
|
try {
|
|
6586
6588
|
state.baseSheet = new CSSStyleSheet;
|
|
6587
6589
|
state.baseSheet.replaceSync(baseCss);
|
|
@@ -6599,7 +6601,7 @@ function createCspStylesheetManager(opts) {
|
|
|
6599
6601
|
const buildDynamicCss = () => Array.from(state.rules.values()).join(`
|
|
6600
6602
|
`);
|
|
6601
6603
|
const ensureDynamic = () => {
|
|
6602
|
-
if (
|
|
6604
|
+
if (supportsConstructable()) {
|
|
6603
6605
|
if (!state.dynamicSheet) {
|
|
6604
6606
|
state.dynamicSheet = new CSSStyleSheet;
|
|
6605
6607
|
adoptSheets([state.dynamicSheet]);
|
|
@@ -6614,7 +6616,7 @@ function createCspStylesheetManager(opts) {
|
|
|
6614
6616
|
};
|
|
6615
6617
|
const syncDynamic = () => {
|
|
6616
6618
|
const css = buildDynamicCss();
|
|
6617
|
-
if (
|
|
6619
|
+
if (supportsConstructable()) {
|
|
6618
6620
|
try {
|
|
6619
6621
|
ensureDynamic();
|
|
6620
6622
|
state.dynamicSheet?.replaceSync(css);
|
|
@@ -6633,7 +6635,7 @@ function createCspStylesheetManager(opts) {
|
|
|
6633
6635
|
const existing = state.declarationRules.get(id);
|
|
6634
6636
|
if (existing && existing.selector === selector)
|
|
6635
6637
|
return existing.rule;
|
|
6636
|
-
if (!
|
|
6638
|
+
if (!supportsConstructable())
|
|
6637
6639
|
return null;
|
|
6638
6640
|
try {
|
|
6639
6641
|
if (!state.declarationSheet) {
|
|
@@ -6642,9 +6644,9 @@ function createCspStylesheetManager(opts) {
|
|
|
6642
6644
|
}
|
|
6643
6645
|
const sheet = state.declarationSheet;
|
|
6644
6646
|
if (existing) {
|
|
6645
|
-
const
|
|
6646
|
-
if (
|
|
6647
|
-
sheet.deleteRule(
|
|
6647
|
+
const index = Array.prototype.indexOf.call(sheet.cssRules, existing.rule);
|
|
6648
|
+
if (index >= 0)
|
|
6649
|
+
sheet.deleteRule(index);
|
|
6648
6650
|
state.declarationRules.delete(id);
|
|
6649
6651
|
}
|
|
6650
6652
|
const index = sheet.insertRule(`${selector}{}`, sheet.cssRules.length);
|
|
@@ -6734,8 +6736,8 @@ function createCspStylesheetManager(opts) {
|
|
|
6734
6736
|
// src/core/signingEngine/uiConfirm/ui/lit-components/ExportPrivateKey/iframe-host.ts
|
|
6735
6737
|
var exports_iframe_host = {};
|
|
6736
6738
|
__export(exports_iframe_host, {
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
+
IframeExportHost: () => IframeExportHost,
|
|
6740
|
+
default: () => iframe_host_default
|
|
6739
6741
|
});
|
|
6740
6742
|
function getExportTokenStyleManager() {
|
|
6741
6743
|
if (!exportTokenStyleManager) {
|
|
@@ -6752,9 +6754,9 @@ function toStringRecord(value) {
|
|
|
6752
6754
|
if (!value || typeof value !== "object")
|
|
6753
6755
|
return {};
|
|
6754
6756
|
const out = {};
|
|
6755
|
-
for (const [
|
|
6756
|
-
if (typeof
|
|
6757
|
-
out[
|
|
6757
|
+
for (const [k, v] of Object.entries(value)) {
|
|
6758
|
+
if (typeof v === "string")
|
|
6759
|
+
out[k] = v;
|
|
6758
6760
|
}
|
|
6759
6761
|
return out;
|
|
6760
6762
|
}
|
|
@@ -6836,13 +6838,13 @@ var init_iframe_host = __esm(() => {
|
|
|
6836
6838
|
errorMessage: { type: String },
|
|
6837
6839
|
surface: { type: String, attribute: "data-w3a-export-surface", reflect: false }
|
|
6838
6840
|
};
|
|
6839
|
-
drawerEl = null;
|
|
6840
|
-
viewerEl = null;
|
|
6841
|
-
openFrame = null;
|
|
6842
|
-
stylesReady = false;
|
|
6843
|
-
stylePromise = null;
|
|
6844
6841
|
constructor() {
|
|
6845
6842
|
super();
|
|
6843
|
+
this.drawerEl = null;
|
|
6844
|
+
this.viewerEl = null;
|
|
6845
|
+
this.openFrame = null;
|
|
6846
|
+
this.stylesReady = false;
|
|
6847
|
+
this.stylePromise = null;
|
|
6846
6848
|
this.theme = "dark";
|
|
6847
6849
|
this.variant = "drawer";
|
|
6848
6850
|
this.accountId = "";
|
|
@@ -7063,13 +7065,98 @@ var init_viewer = __esm(() => {
|
|
|
7063
7065
|
statusMessage: { state: true },
|
|
7064
7066
|
copied: { state: true }
|
|
7065
7067
|
};
|
|
7066
|
-
experience = { kind: "unconfigured" };
|
|
7067
|
-
loadGeneration = 0;
|
|
7068
|
-
copiedResetTimer = null;
|
|
7069
|
-
stylesReady = false;
|
|
7070
|
-
stylePromise = null;
|
|
7071
7068
|
constructor() {
|
|
7072
7069
|
super();
|
|
7070
|
+
this.experience = { kind: "unconfigured" };
|
|
7071
|
+
this.loadGeneration = 0;
|
|
7072
|
+
this.copiedResetTimer = null;
|
|
7073
|
+
this.stylesReady = false;
|
|
7074
|
+
this.stylePromise = null;
|
|
7075
|
+
this.retryStatus = () => {
|
|
7076
|
+
if (this.experience.kind !== "account_menu")
|
|
7077
|
+
return;
|
|
7078
|
+
const generation = this.loadGeneration + 1;
|
|
7079
|
+
this.loadGeneration = generation;
|
|
7080
|
+
const current = this.viewState;
|
|
7081
|
+
if (current.kind !== "summary")
|
|
7082
|
+
return;
|
|
7083
|
+
this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
|
|
7084
|
+
this.loadSummaryStatus(this.experience, generation);
|
|
7085
|
+
};
|
|
7086
|
+
this.openRecoveryCodes = async () => {
|
|
7087
|
+
if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
|
|
7088
|
+
return;
|
|
7089
|
+
const generation = this.loadGeneration;
|
|
7090
|
+
const summary = this.viewState;
|
|
7091
|
+
this.viewState = { ...summary, kind: "opening", actionError: null };
|
|
7092
|
+
try {
|
|
7093
|
+
const request = await this.experience.loadPendingBackup();
|
|
7094
|
+
if (generation !== this.loadGeneration)
|
|
7095
|
+
return;
|
|
7096
|
+
if (!request) {
|
|
7097
|
+
this.viewState = {
|
|
7098
|
+
...summary,
|
|
7099
|
+
actionError: "Recovery codes are no longer available on this device."
|
|
7100
|
+
};
|
|
7101
|
+
return;
|
|
7102
|
+
}
|
|
7103
|
+
this.viewState = { kind: "recovery_codes", request };
|
|
7104
|
+
await this.updateComplete;
|
|
7105
|
+
await new Promise(requestAnimationFrame);
|
|
7106
|
+
this.querySelector("#w3a-wallet-recovery-title")?.focus();
|
|
7107
|
+
} catch (error) {
|
|
7108
|
+
if (generation !== this.loadGeneration)
|
|
7109
|
+
return;
|
|
7110
|
+
this.viewState = {
|
|
7111
|
+
...summary,
|
|
7112
|
+
actionError: errorMessage(error, "Could not open recovery codes")
|
|
7113
|
+
};
|
|
7114
|
+
}
|
|
7115
|
+
};
|
|
7116
|
+
this.closeSummary = () => {
|
|
7117
|
+
this.dispatchClose({ kind: "dismissed" });
|
|
7118
|
+
};
|
|
7119
|
+
this.download = () => {
|
|
7120
|
+
if (this.viewState.kind !== "recovery_codes")
|
|
7121
|
+
return;
|
|
7122
|
+
const { walletId, recoveryCodes } = this.viewState.request;
|
|
7123
|
+
try {
|
|
7124
|
+
const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
|
|
7125
|
+
type: "text/plain;charset=utf-8"
|
|
7126
|
+
}));
|
|
7127
|
+
const anchor = document.createElement("a");
|
|
7128
|
+
anchor.href = url;
|
|
7129
|
+
anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
|
|
7130
|
+
try {
|
|
7131
|
+
anchor.click();
|
|
7132
|
+
} finally {
|
|
7133
|
+
window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
|
|
7134
|
+
}
|
|
7135
|
+
this.statusMessage = "Recovery codes downloaded.";
|
|
7136
|
+
} catch {
|
|
7137
|
+
this.statusMessage = "Unable to download the codes. Copy them or try again.";
|
|
7138
|
+
}
|
|
7139
|
+
};
|
|
7140
|
+
this.copy = async () => {
|
|
7141
|
+
if (this.viewState.kind !== "recovery_codes")
|
|
7142
|
+
return;
|
|
7143
|
+
const { walletId, recoveryCodes } = this.viewState.request;
|
|
7144
|
+
try {
|
|
7145
|
+
await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
|
|
7146
|
+
this.statusMessage = "Recovery codes copied.";
|
|
7147
|
+
this.flashCopied();
|
|
7148
|
+
} catch {
|
|
7149
|
+
this.statusMessage = "Unable to copy the codes. Download them or try again.";
|
|
7150
|
+
}
|
|
7151
|
+
};
|
|
7152
|
+
this.onAcknowledgementChange = (event) => {
|
|
7153
|
+
const input = event.target;
|
|
7154
|
+
if (input instanceof HTMLInputElement)
|
|
7155
|
+
this.acknowledged = input.checked;
|
|
7156
|
+
};
|
|
7157
|
+
this.closeRecoveryCodes = () => {
|
|
7158
|
+
this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
|
|
7159
|
+
};
|
|
7073
7160
|
this.viewState = { kind: "unconfigured" };
|
|
7074
7161
|
this.acknowledged = false;
|
|
7075
7162
|
this.statusMessage = "";
|
|
@@ -7195,50 +7282,6 @@ var init_viewer = __esm(() => {
|
|
|
7195
7282
|
assertNever(this.viewState);
|
|
7196
7283
|
}
|
|
7197
7284
|
}
|
|
7198
|
-
retryStatus = () => {
|
|
7199
|
-
if (this.experience.kind !== "account_menu")
|
|
7200
|
-
return;
|
|
7201
|
-
const generation = this.loadGeneration + 1;
|
|
7202
|
-
this.loadGeneration = generation;
|
|
7203
|
-
const current = this.viewState;
|
|
7204
|
-
if (current.kind !== "summary")
|
|
7205
|
-
return;
|
|
7206
|
-
this.viewState = { ...current, loadState: { kind: "loading" }, actionError: null };
|
|
7207
|
-
this.loadSummaryStatus(this.experience, generation);
|
|
7208
|
-
};
|
|
7209
|
-
openRecoveryCodes = async () => {
|
|
7210
|
-
if (this.experience.kind !== "account_menu" || this.viewState.kind !== "summary")
|
|
7211
|
-
return;
|
|
7212
|
-
const generation = this.loadGeneration;
|
|
7213
|
-
const summary = this.viewState;
|
|
7214
|
-
this.viewState = { ...summary, kind: "opening", actionError: null };
|
|
7215
|
-
try {
|
|
7216
|
-
const request = await this.experience.loadPendingBackup();
|
|
7217
|
-
if (generation !== this.loadGeneration)
|
|
7218
|
-
return;
|
|
7219
|
-
if (!request) {
|
|
7220
|
-
this.viewState = {
|
|
7221
|
-
...summary,
|
|
7222
|
-
actionError: "Recovery codes are no longer available on this device."
|
|
7223
|
-
};
|
|
7224
|
-
return;
|
|
7225
|
-
}
|
|
7226
|
-
this.viewState = { kind: "recovery_codes", request };
|
|
7227
|
-
await this.updateComplete;
|
|
7228
|
-
await new Promise(requestAnimationFrame);
|
|
7229
|
-
this.querySelector("#w3a-wallet-recovery-title")?.focus();
|
|
7230
|
-
} catch (error) {
|
|
7231
|
-
if (generation !== this.loadGeneration)
|
|
7232
|
-
return;
|
|
7233
|
-
this.viewState = {
|
|
7234
|
-
...summary,
|
|
7235
|
-
actionError: errorMessage(error, "Could not open recovery codes")
|
|
7236
|
-
};
|
|
7237
|
-
}
|
|
7238
|
-
};
|
|
7239
|
-
closeSummary = () => {
|
|
7240
|
-
this.dispatchClose({ kind: "dismissed" });
|
|
7241
|
-
};
|
|
7242
7285
|
dispatchClose(detail) {
|
|
7243
7286
|
this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CLOSE_EVENT, {
|
|
7244
7287
|
detail,
|
|
@@ -7246,39 +7289,6 @@ var init_viewer = __esm(() => {
|
|
|
7246
7289
|
composed: true
|
|
7247
7290
|
}));
|
|
7248
7291
|
}
|
|
7249
|
-
download = () => {
|
|
7250
|
-
if (this.viewState.kind !== "recovery_codes")
|
|
7251
|
-
return;
|
|
7252
|
-
const { walletId, recoveryCodes } = this.viewState.request;
|
|
7253
|
-
try {
|
|
7254
|
-
const url = URL.createObjectURL(new Blob([backupText(walletId, recoveryCodes)], {
|
|
7255
|
-
type: "text/plain;charset=utf-8"
|
|
7256
|
-
}));
|
|
7257
|
-
const anchor = document.createElement("a");
|
|
7258
|
-
anchor.href = url;
|
|
7259
|
-
anchor.download = `seams-wallet-recovery-codes-${safeWalletId(walletId)}.txt`;
|
|
7260
|
-
try {
|
|
7261
|
-
anchor.click();
|
|
7262
|
-
} finally {
|
|
7263
|
-
window.setTimeout(URL.revokeObjectURL.bind(URL, url), 0);
|
|
7264
|
-
}
|
|
7265
|
-
this.statusMessage = "Recovery codes downloaded.";
|
|
7266
|
-
} catch {
|
|
7267
|
-
this.statusMessage = "Unable to download the codes. Copy them or try again.";
|
|
7268
|
-
}
|
|
7269
|
-
};
|
|
7270
|
-
copy = async () => {
|
|
7271
|
-
if (this.viewState.kind !== "recovery_codes")
|
|
7272
|
-
return;
|
|
7273
|
-
const { walletId, recoveryCodes } = this.viewState.request;
|
|
7274
|
-
try {
|
|
7275
|
-
await navigator.clipboard.writeText(backupText(walletId, recoveryCodes));
|
|
7276
|
-
this.statusMessage = "Recovery codes copied.";
|
|
7277
|
-
this.flashCopied();
|
|
7278
|
-
} catch {
|
|
7279
|
-
this.statusMessage = "Unable to copy the codes. Download them or try again.";
|
|
7280
|
-
}
|
|
7281
|
-
};
|
|
7282
7292
|
flashCopied() {
|
|
7283
7293
|
if (this.copiedResetTimer !== null)
|
|
7284
7294
|
window.clearTimeout(this.copiedResetTimer);
|
|
@@ -7288,14 +7298,6 @@ var init_viewer = __esm(() => {
|
|
|
7288
7298
|
this.copied = false;
|
|
7289
7299
|
}, COPIED_FLASH_MS);
|
|
7290
7300
|
}
|
|
7291
|
-
onAcknowledgementChange = (event) => {
|
|
7292
|
-
const input = event.target;
|
|
7293
|
-
if (input instanceof HTMLInputElement)
|
|
7294
|
-
this.acknowledged = input.checked;
|
|
7295
|
-
};
|
|
7296
|
-
closeRecoveryCodes = () => {
|
|
7297
|
-
this.dispatchClose({ kind: "recovery_codes", acknowledged: this.acknowledged });
|
|
7298
|
-
};
|
|
7299
7301
|
closeLabel(request) {
|
|
7300
7302
|
if (this.acknowledged)
|
|
7301
7303
|
return "Finish backup";
|
|
@@ -7443,8 +7445,8 @@ var init_viewer = __esm(() => {
|
|
|
7443
7445
|
// src/core/signingEngine/uiConfirm/ui/lit-components/RecoveryCodeBackup/host.ts
|
|
7444
7446
|
var exports_host = {};
|
|
7445
7447
|
__export(exports_host, {
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
+
RecoveryCodeBackupHost: () => RecoveryCodeBackupHost,
|
|
7449
|
+
default: () => host_default
|
|
7448
7450
|
});
|
|
7449
7451
|
var RecoveryCodeBackupHost, host_default;
|
|
7450
7452
|
var init_host = __esm(() => {
|
|
@@ -7460,24 +7462,22 @@ var init_host = __esm(() => {
|
|
|
7460
7462
|
experience: { attribute: false },
|
|
7461
7463
|
surface: { type: String }
|
|
7462
7464
|
};
|
|
7463
|
-
dialogEl = null;
|
|
7464
|
-
viewerEl = null;
|
|
7465
|
-
shown = false;
|
|
7466
|
-
dialogShown;
|
|
7467
|
-
resolveDialogShown;
|
|
7468
|
-
handleCancel = (event) => {
|
|
7469
|
-
event.preventDefault();
|
|
7470
|
-
this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
|
|
7471
|
-
};
|
|
7472
|
-
handleStageChange = (event) => {
|
|
7473
|
-
const dialog = event.currentTarget;
|
|
7474
|
-
if (!(dialog instanceof HTMLDialogElement))
|
|
7475
|
-
return;
|
|
7476
|
-
const detail = event.detail;
|
|
7477
|
-
dialog.dataset.w3aRecoveryStage = detail.stage;
|
|
7478
|
-
};
|
|
7479
7465
|
constructor() {
|
|
7480
7466
|
super();
|
|
7467
|
+
this.dialogEl = null;
|
|
7468
|
+
this.viewerEl = null;
|
|
7469
|
+
this.shown = false;
|
|
7470
|
+
this.handleCancel = (event) => {
|
|
7471
|
+
event.preventDefault();
|
|
7472
|
+
this.dispatchEvent(new CustomEvent(RECOVERY_BACKUP_CANCEL_EVENT, { bubbles: true, composed: true }));
|
|
7473
|
+
};
|
|
7474
|
+
this.handleStageChange = (event) => {
|
|
7475
|
+
const dialog = event.currentTarget;
|
|
7476
|
+
if (!(dialog instanceof HTMLDialogElement))
|
|
7477
|
+
return;
|
|
7478
|
+
const detail = event.detail;
|
|
7479
|
+
dialog.dataset.w3aRecoveryStage = detail.stage;
|
|
7480
|
+
};
|
|
7481
7481
|
this.experience = { kind: "unconfigured" };
|
|
7482
7482
|
this.surface = "standalone";
|
|
7483
7483
|
this.dialogShown = new Promise((resolve) => {
|
|
@@ -7567,8 +7567,8 @@ var init_registry = __esm(() => {
|
|
|
7567
7567
|
});
|
|
7568
7568
|
|
|
7569
7569
|
// src/core/signingEngine/uiConfirm/ui/lit-components/Drawer/index.ts
|
|
7570
|
-
function clamp(
|
|
7571
|
-
return Math.max(min, Math.min(max,
|
|
7570
|
+
function clamp(n, min, max) {
|
|
7571
|
+
return Math.max(min, Math.min(max, n));
|
|
7572
7572
|
}
|
|
7573
7573
|
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;
|
|
7574
7574
|
var init_Drawer = __esm(() => {
|
|
@@ -7590,44 +7590,185 @@ var init_Drawer = __esm(() => {
|
|
|
7590
7590
|
height: { type: String },
|
|
7591
7591
|
overpullPx: { type: Number, attribute: "overpull-px" }
|
|
7592
7592
|
};
|
|
7593
|
-
isDragging = false;
|
|
7594
|
-
pendingDrag = false;
|
|
7595
|
-
startY = 0;
|
|
7596
|
-
currentY = 0;
|
|
7597
|
-
dragDistance = 0;
|
|
7598
|
-
lastDragTime = 0;
|
|
7599
|
-
velocity = 0;
|
|
7600
|
-
drawerElement = null;
|
|
7601
|
-
overlayElement = null;
|
|
7602
|
-
bodyElement = null;
|
|
7603
|
-
drawerHeight = 0;
|
|
7604
|
-
startTranslateYPx = 0;
|
|
7605
|
-
openRestTranslateYPx = 0;
|
|
7606
|
-
dragStartTime = 0;
|
|
7607
|
-
isClosing = false;
|
|
7608
|
-
aboveFoldResizeObserver;
|
|
7609
|
-
drawerResizeObserver;
|
|
7610
|
-
detachViewportSync;
|
|
7611
|
-
_syncRAF = null;
|
|
7612
|
-
_lastOpenTranslatePct;
|
|
7613
|
-
_contentAnimRAF = null;
|
|
7614
|
-
_activeHeightTransitions = 0;
|
|
7615
|
-
detachContentAnimSync;
|
|
7616
|
-
_initialMount = true;
|
|
7617
|
-
_firstOpen = true;
|
|
7618
|
-
_stylesReady = false;
|
|
7619
|
-
_stylePromises = [];
|
|
7620
|
-
_stylesAwaiting = null;
|
|
7621
|
-
_childObserver = null;
|
|
7622
7593
|
createRenderRoot() {
|
|
7623
7594
|
const root = this;
|
|
7624
|
-
const
|
|
7625
|
-
this._stylePromises.push(
|
|
7626
|
-
|
|
7595
|
+
const p = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
|
|
7596
|
+
this._stylePromises.push(p);
|
|
7597
|
+
p.catch(() => {});
|
|
7627
7598
|
return root;
|
|
7628
7599
|
}
|
|
7629
7600
|
constructor() {
|
|
7630
7601
|
super();
|
|
7602
|
+
this.isDragging = false;
|
|
7603
|
+
this.pendingDrag = false;
|
|
7604
|
+
this.startY = 0;
|
|
7605
|
+
this.currentY = 0;
|
|
7606
|
+
this.dragDistance = 0;
|
|
7607
|
+
this.lastDragTime = 0;
|
|
7608
|
+
this.velocity = 0;
|
|
7609
|
+
this.drawerElement = null;
|
|
7610
|
+
this.overlayElement = null;
|
|
7611
|
+
this.bodyElement = null;
|
|
7612
|
+
this.drawerHeight = 0;
|
|
7613
|
+
this.startTranslateYPx = 0;
|
|
7614
|
+
this.openRestTranslateYPx = 0;
|
|
7615
|
+
this.dragStartTime = 0;
|
|
7616
|
+
this.isClosing = false;
|
|
7617
|
+
this._syncRAF = null;
|
|
7618
|
+
this._contentAnimRAF = null;
|
|
7619
|
+
this._activeHeightTransitions = 0;
|
|
7620
|
+
this._initialMount = true;
|
|
7621
|
+
this._firstOpen = true;
|
|
7622
|
+
this._stylesReady = false;
|
|
7623
|
+
this._stylePromises = [];
|
|
7624
|
+
this._stylesAwaiting = null;
|
|
7625
|
+
this._childObserver = null;
|
|
7626
|
+
this._initialChildren = null;
|
|
7627
|
+
this.handleTransitionEnd = (e) => {
|
|
7628
|
+
if (!this.drawerElement)
|
|
7629
|
+
return;
|
|
7630
|
+
if (e.target !== this.drawerElement)
|
|
7631
|
+
return;
|
|
7632
|
+
if (e.propertyName !== "transform")
|
|
7633
|
+
return;
|
|
7634
|
+
const type = this.open ? "w3a:drawer-open-end" : "w3a:drawer-close-end";
|
|
7635
|
+
this.dispatchEvent(new CustomEvent(type, { bubbles: true, composed: true }));
|
|
7636
|
+
};
|
|
7637
|
+
this.handlePointerDown = (e) => {
|
|
7638
|
+
if (this.loading || !this.open)
|
|
7639
|
+
return;
|
|
7640
|
+
if (e.pointerType === "mouse" && e.button !== 0)
|
|
7641
|
+
return;
|
|
7642
|
+
this.pendingDrag = true;
|
|
7643
|
+
this.startY = e.clientY;
|
|
7644
|
+
this.currentY = e.clientY;
|
|
7645
|
+
this.dragStartTime = Date.now();
|
|
7646
|
+
};
|
|
7647
|
+
this.handlePointerMove = (e) => {
|
|
7648
|
+
if (!this.pendingDrag && !this.isDragging)
|
|
7649
|
+
return;
|
|
7650
|
+
const y = e.clientY;
|
|
7651
|
+
if (this.pendingDrag) {
|
|
7652
|
+
const dy = y - this.startY;
|
|
7653
|
+
const absDy = Math.abs(dy);
|
|
7654
|
+
const ACTIVATE_PX = 8;
|
|
7655
|
+
const body = this.bodyElement;
|
|
7656
|
+
const atTop = !body || body.scrollTop <= 0;
|
|
7657
|
+
if (absDy >= ACTIVATE_PX && atTop) {
|
|
7658
|
+
this.pendingDrag = false;
|
|
7659
|
+
this.startDrag(this.startY);
|
|
7660
|
+
e.target?.setPointerCapture?.(e.pointerId);
|
|
7661
|
+
} else {
|
|
7662
|
+
return;
|
|
7663
|
+
}
|
|
7664
|
+
}
|
|
7665
|
+
if (this.isDragging) {
|
|
7666
|
+
this.updateDrag(y);
|
|
7667
|
+
e.preventDefault();
|
|
7668
|
+
}
|
|
7669
|
+
};
|
|
7670
|
+
this.handlePointerUp = (e) => {
|
|
7671
|
+
if (this.pendingDrag) {
|
|
7672
|
+
this.pendingDrag = false;
|
|
7673
|
+
}
|
|
7674
|
+
if (this.isDragging) {
|
|
7675
|
+
this.endDrag();
|
|
7676
|
+
e.preventDefault();
|
|
7677
|
+
}
|
|
7678
|
+
e.target?.releasePointerCapture?.(e.pointerId);
|
|
7679
|
+
};
|
|
7680
|
+
this.handlePointerCancel = (e) => {
|
|
7681
|
+
if (this.pendingDrag)
|
|
7682
|
+
this.pendingDrag = false;
|
|
7683
|
+
if (this.isDragging)
|
|
7684
|
+
this.endDrag();
|
|
7685
|
+
e.target?.releasePointerCapture?.(e.pointerId);
|
|
7686
|
+
};
|
|
7687
|
+
this.handleTouchStart = (e) => {
|
|
7688
|
+
if (this.loading || !this.open)
|
|
7689
|
+
return;
|
|
7690
|
+
const target = e.target;
|
|
7691
|
+
if (target && target.closest && target.closest(".close-btn")) {
|
|
7692
|
+
return;
|
|
7693
|
+
}
|
|
7694
|
+
const touch = e.touches[0];
|
|
7695
|
+
this.pendingDrag = true;
|
|
7696
|
+
this.startY = touch.clientY;
|
|
7697
|
+
this.currentY = touch.clientY;
|
|
7698
|
+
};
|
|
7699
|
+
this.handleTouchMove = (e) => {
|
|
7700
|
+
const touch = e.touches[0];
|
|
7701
|
+
if (this.pendingDrag && !this.isDragging) {
|
|
7702
|
+
const dy = touch.clientY - this.startY;
|
|
7703
|
+
const absDy = Math.abs(dy);
|
|
7704
|
+
const ACTIVATE_PX = 8;
|
|
7705
|
+
const body = this.bodyElement;
|
|
7706
|
+
const atTop = !body || body.scrollTop <= 0;
|
|
7707
|
+
if (absDy >= ACTIVATE_PX) {
|
|
7708
|
+
if (atTop) {
|
|
7709
|
+
this.startDrag(this.startY);
|
|
7710
|
+
this.isDragging = true;
|
|
7711
|
+
this.pendingDrag = false;
|
|
7712
|
+
}
|
|
7713
|
+
}
|
|
7714
|
+
}
|
|
7715
|
+
if (!this.isDragging)
|
|
7716
|
+
return;
|
|
7717
|
+
this.updateDrag(touch.clientY);
|
|
7718
|
+
e.preventDefault();
|
|
7719
|
+
};
|
|
7720
|
+
this.handleTouchEnd = (e) => {
|
|
7721
|
+
this.pendingDrag = false;
|
|
7722
|
+
if (!this.isDragging)
|
|
7723
|
+
return;
|
|
7724
|
+
this.endDrag();
|
|
7725
|
+
e.preventDefault();
|
|
7726
|
+
};
|
|
7727
|
+
this.handleMouseDown = (e) => {
|
|
7728
|
+
if (this.loading || !this.open)
|
|
7729
|
+
return;
|
|
7730
|
+
this.startDrag(e.clientY);
|
|
7731
|
+
e.preventDefault();
|
|
7732
|
+
};
|
|
7733
|
+
this.handleMouseMove = (e) => {
|
|
7734
|
+
if (!this.isDragging)
|
|
7735
|
+
return;
|
|
7736
|
+
this.updateDrag(e.clientY);
|
|
7737
|
+
e.preventDefault();
|
|
7738
|
+
};
|
|
7739
|
+
this.handleMouseUp = (e) => {
|
|
7740
|
+
if (!this.isDragging)
|
|
7741
|
+
return;
|
|
7742
|
+
this.endDrag();
|
|
7743
|
+
e.preventDefault();
|
|
7744
|
+
};
|
|
7745
|
+
this.onClose = () => {
|
|
7746
|
+
if (this.loading)
|
|
7747
|
+
return;
|
|
7748
|
+
if (this.isClosing)
|
|
7749
|
+
return;
|
|
7750
|
+
if (this.drawerElement) {
|
|
7751
|
+
this.drawerElement.classList.remove("dragging");
|
|
7752
|
+
}
|
|
7753
|
+
this.open = false;
|
|
7754
|
+
dispatchLitCancel(this);
|
|
7755
|
+
this.isClosing = true;
|
|
7756
|
+
setTimeout(() => {
|
|
7757
|
+
this.isClosing = false;
|
|
7758
|
+
}, 300);
|
|
7759
|
+
};
|
|
7760
|
+
this.onHandleClick = () => {
|
|
7761
|
+
if (!this.open) {
|
|
7762
|
+
this.show();
|
|
7763
|
+
} else {
|
|
7764
|
+
this.hide("handle");
|
|
7765
|
+
}
|
|
7766
|
+
};
|
|
7767
|
+
this.onOverlayClick = () => {
|
|
7768
|
+
if (!this.closeOnOverlayClick)
|
|
7769
|
+
return;
|
|
7770
|
+
this.onClose();
|
|
7771
|
+
};
|
|
7631
7772
|
this.open = false;
|
|
7632
7773
|
this.theme = "dark";
|
|
7633
7774
|
this.appearance = undefined;
|
|
@@ -7641,13 +7782,12 @@ var init_Drawer = __esm(() => {
|
|
|
7641
7782
|
getComponentPrefix() {
|
|
7642
7783
|
return "modal";
|
|
7643
7784
|
}
|
|
7644
|
-
_initialChildren = null;
|
|
7645
7785
|
connectedCallback() {
|
|
7646
7786
|
if (!this._initialChildren) {
|
|
7647
7787
|
this._initialChildren = Array.from(this.childNodes);
|
|
7648
7788
|
try {
|
|
7649
|
-
for (const
|
|
7650
|
-
this.removeChild(
|
|
7789
|
+
for (const n of this._initialChildren)
|
|
7790
|
+
this.removeChild(n);
|
|
7651
7791
|
} catch {}
|
|
7652
7792
|
}
|
|
7653
7793
|
super.connectedCallback();
|
|
@@ -7658,7 +7798,7 @@ var init_Drawer = __esm(() => {
|
|
|
7658
7798
|
if (this._stylesReady)
|
|
7659
7799
|
return true;
|
|
7660
7800
|
if (!this._stylesAwaiting) {
|
|
7661
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
7801
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
7662
7802
|
this._stylesAwaiting = settle.then(() => {
|
|
7663
7803
|
this._stylesReady = true;
|
|
7664
7804
|
this.requestUpdate();
|
|
@@ -7755,17 +7895,17 @@ var init_Drawer = __esm(() => {
|
|
|
7755
7895
|
return;
|
|
7756
7896
|
const host = this;
|
|
7757
7897
|
const toMove = [];
|
|
7758
|
-
host.childNodes.forEach((
|
|
7759
|
-
if (
|
|
7898
|
+
host.childNodes.forEach((n) => {
|
|
7899
|
+
if (n.nodeType !== Node.ELEMENT_NODE)
|
|
7760
7900
|
return;
|
|
7761
|
-
const el =
|
|
7901
|
+
const el = n;
|
|
7762
7902
|
if (el.classList?.contains("overlay"))
|
|
7763
7903
|
return;
|
|
7764
7904
|
if (el.classList?.contains("drawer"))
|
|
7765
7905
|
return;
|
|
7766
|
-
toMove.push(
|
|
7906
|
+
toMove.push(n);
|
|
7767
7907
|
});
|
|
7768
|
-
toMove.forEach((
|
|
7908
|
+
toMove.forEach((n) => above.appendChild(n));
|
|
7769
7909
|
this.syncCssVarsForOpenTranslate();
|
|
7770
7910
|
}
|
|
7771
7911
|
get contentRoot() {
|
|
@@ -7773,10 +7913,10 @@ var init_Drawer = __esm(() => {
|
|
|
7773
7913
|
return root && root.querySelector(".above-fold") || null;
|
|
7774
7914
|
}
|
|
7775
7915
|
getVisibleVh() {
|
|
7776
|
-
const
|
|
7777
|
-
const
|
|
7778
|
-
if (
|
|
7779
|
-
return clamp(parseFloat(
|
|
7916
|
+
const h = (this.height || "").trim();
|
|
7917
|
+
const m = h.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
|
|
7918
|
+
if (m)
|
|
7919
|
+
return clamp(parseFloat(m[1]), 0, 100);
|
|
7780
7920
|
return DEFAULT_VISIBLE_VH;
|
|
7781
7921
|
}
|
|
7782
7922
|
getOpenTranslateRatio() {
|
|
@@ -7789,15 +7929,15 @@ var init_Drawer = __esm(() => {
|
|
|
7789
7929
|
return;
|
|
7790
7930
|
if (this.isDragging || this.pendingDrag)
|
|
7791
7931
|
return;
|
|
7792
|
-
const
|
|
7793
|
-
const
|
|
7794
|
-
if (
|
|
7795
|
-
const
|
|
7796
|
-
const visibleVh = clamp(parseFloat(
|
|
7797
|
-
const
|
|
7798
|
-
this.setCssVars({ "--w3a-drawer__sheet-height": `100${
|
|
7932
|
+
const h = (this.height || "").trim();
|
|
7933
|
+
const m = h.match(/^([0-9]+(?:\.[0-9]+)?)\s*(d?vh|svh|lvh|vh)$/i);
|
|
7934
|
+
if (m) {
|
|
7935
|
+
const unit = (m[2] || "vh").toLowerCase();
|
|
7936
|
+
const visibleVh = clamp(parseFloat(m[1]), 0, 100);
|
|
7937
|
+
const pct = clamp(100 - visibleVh, 0, 100);
|
|
7938
|
+
this.setCssVars({ "--w3a-drawer__sheet-height": `100${unit}` });
|
|
7799
7939
|
if (!this.open) {
|
|
7800
|
-
this.setCssVars({ "--w3a-drawer__open-translate":
|
|
7940
|
+
this.setCssVars({ "--w3a-drawer__open-translate": pct + "%" });
|
|
7801
7941
|
}
|
|
7802
7942
|
return;
|
|
7803
7943
|
}
|
|
@@ -7830,16 +7970,6 @@ var init_Drawer = __esm(() => {
|
|
|
7830
7970
|
this._performSyncCssVarsForOpenTranslate();
|
|
7831
7971
|
});
|
|
7832
7972
|
}
|
|
7833
|
-
handleTransitionEnd = (e6) => {
|
|
7834
|
-
if (!this.drawerElement)
|
|
7835
|
-
return;
|
|
7836
|
-
if (e6.target !== this.drawerElement)
|
|
7837
|
-
return;
|
|
7838
|
-
if (e6.propertyName !== "transform")
|
|
7839
|
-
return;
|
|
7840
|
-
const type = this.open ? "w3a:drawer-open-end" : "w3a:drawer-close-end";
|
|
7841
|
-
this.dispatchEvent(new CustomEvent(type, { bubbles: true, composed: true }));
|
|
7842
|
-
};
|
|
7843
7973
|
setupAnimateWithContentSync() {
|
|
7844
7974
|
const root = this.renderRoot;
|
|
7845
7975
|
const host = root.querySelector(".drawer");
|
|
@@ -7864,12 +7994,12 @@ var init_Drawer = __esm(() => {
|
|
|
7864
7994
|
};
|
|
7865
7995
|
const syncTimingFromElement = (el) => {
|
|
7866
7996
|
const cs = getComputedStyle(el);
|
|
7867
|
-
const props = (cs.transitionProperty || "").split(",").map((
|
|
7868
|
-
const durations = (cs.transitionDuration || "").split(",").map((
|
|
7869
|
-
const easings = (cs.transitionTimingFunction || "").split(",").map((
|
|
7870
|
-
let idx = props.findIndex((
|
|
7997
|
+
const props = (cs.transitionProperty || "").split(",").map((s) => s.trim());
|
|
7998
|
+
const durations = (cs.transitionDuration || "").split(",").map((s) => s.trim());
|
|
7999
|
+
const easings = (cs.transitionTimingFunction || "").split(",").map((s) => s.trim());
|
|
8000
|
+
let idx = props.findIndex((p) => p === "height");
|
|
7871
8001
|
if (idx < 0)
|
|
7872
|
-
idx = props.findIndex((
|
|
8002
|
+
idx = props.findIndex((p) => p === "all");
|
|
7873
8003
|
if (idx < 0)
|
|
7874
8004
|
idx = 0;
|
|
7875
8005
|
const dur = durations[Math.min(idx, durations.length - 1)] || "100ms";
|
|
@@ -7880,28 +8010,28 @@ var init_Drawer = __esm(() => {
|
|
|
7880
8010
|
});
|
|
7881
8011
|
};
|
|
7882
8012
|
const onRun = (ev) => {
|
|
7883
|
-
const
|
|
8013
|
+
const e = ev;
|
|
7884
8014
|
if (!this.open)
|
|
7885
8015
|
return;
|
|
7886
|
-
if (
|
|
8016
|
+
if (e.propertyName !== "height")
|
|
7887
8017
|
return;
|
|
7888
8018
|
this._activeHeightTransitions++;
|
|
7889
8019
|
ensureLoop();
|
|
7890
8020
|
};
|
|
7891
8021
|
const onStart = (ev) => {
|
|
7892
|
-
const
|
|
8022
|
+
const e = ev;
|
|
7893
8023
|
if (!this.open)
|
|
7894
8024
|
return;
|
|
7895
|
-
if (
|
|
8025
|
+
if (e.propertyName !== "height")
|
|
7896
8026
|
return;
|
|
7897
|
-
if (
|
|
7898
|
-
syncTimingFromElement(
|
|
8027
|
+
if (e.target && e.target instanceof Element)
|
|
8028
|
+
syncTimingFromElement(e.target);
|
|
7899
8029
|
this._activeHeightTransitions++;
|
|
7900
8030
|
ensureLoop();
|
|
7901
8031
|
};
|
|
7902
8032
|
const onEnd = (ev) => {
|
|
7903
|
-
const
|
|
7904
|
-
if (
|
|
8033
|
+
const e = ev;
|
|
8034
|
+
if (e.propertyName !== "height")
|
|
7905
8035
|
return;
|
|
7906
8036
|
this._activeHeightTransitions = Math.max(0, this._activeHeightTransitions - 1);
|
|
7907
8037
|
if (this._activeHeightTransitions === 0)
|
|
@@ -7997,118 +8127,10 @@ var init_Drawer = __esm(() => {
|
|
|
7997
8127
|
document.removeEventListener("pointerup", this.handlePointerUp);
|
|
7998
8128
|
document.removeEventListener("pointercancel", this.handlePointerCancel);
|
|
7999
8129
|
}
|
|
8000
|
-
|
|
8001
|
-
if (this.loading || !this.open)
|
|
8002
|
-
return;
|
|
8003
|
-
if (e6.pointerType === "mouse" && e6.button !== 0)
|
|
8004
|
-
return;
|
|
8005
|
-
this.pendingDrag = true;
|
|
8006
|
-
this.startY = e6.clientY;
|
|
8007
|
-
this.currentY = e6.clientY;
|
|
8008
|
-
this.dragStartTime = Date.now();
|
|
8009
|
-
};
|
|
8010
|
-
handlePointerMove = (e6) => {
|
|
8011
|
-
if (!this.pendingDrag && !this.isDragging)
|
|
8012
|
-
return;
|
|
8013
|
-
const y3 = e6.clientY;
|
|
8014
|
-
if (this.pendingDrag) {
|
|
8015
|
-
const dy = y3 - this.startY;
|
|
8016
|
-
const absDy = Math.abs(dy);
|
|
8017
|
-
const ACTIVATE_PX = 8;
|
|
8018
|
-
const body = this.bodyElement;
|
|
8019
|
-
const atTop = !body || body.scrollTop <= 0;
|
|
8020
|
-
if (absDy >= ACTIVATE_PX && atTop) {
|
|
8021
|
-
this.pendingDrag = false;
|
|
8022
|
-
this.startDrag(this.startY);
|
|
8023
|
-
e6.target?.setPointerCapture?.(e6.pointerId);
|
|
8024
|
-
} else {
|
|
8025
|
-
return;
|
|
8026
|
-
}
|
|
8027
|
-
}
|
|
8028
|
-
if (this.isDragging) {
|
|
8029
|
-
this.updateDrag(y3);
|
|
8030
|
-
e6.preventDefault();
|
|
8031
|
-
}
|
|
8032
|
-
};
|
|
8033
|
-
handlePointerUp = (e6) => {
|
|
8034
|
-
if (this.pendingDrag) {
|
|
8035
|
-
this.pendingDrag = false;
|
|
8036
|
-
}
|
|
8037
|
-
if (this.isDragging) {
|
|
8038
|
-
this.endDrag();
|
|
8039
|
-
e6.preventDefault();
|
|
8040
|
-
}
|
|
8041
|
-
e6.target?.releasePointerCapture?.(e6.pointerId);
|
|
8042
|
-
};
|
|
8043
|
-
handlePointerCancel = (e6) => {
|
|
8044
|
-
if (this.pendingDrag)
|
|
8045
|
-
this.pendingDrag = false;
|
|
8046
|
-
if (this.isDragging)
|
|
8047
|
-
this.endDrag();
|
|
8048
|
-
e6.target?.releasePointerCapture?.(e6.pointerId);
|
|
8049
|
-
};
|
|
8050
|
-
handleTouchStart = (e6) => {
|
|
8051
|
-
if (this.loading || !this.open)
|
|
8052
|
-
return;
|
|
8053
|
-
const target = e6.target;
|
|
8054
|
-
if (target && target.closest && target.closest(".close-btn")) {
|
|
8055
|
-
return;
|
|
8056
|
-
}
|
|
8057
|
-
const touch = e6.touches[0];
|
|
8058
|
-
this.pendingDrag = true;
|
|
8059
|
-
this.startY = touch.clientY;
|
|
8060
|
-
this.currentY = touch.clientY;
|
|
8061
|
-
};
|
|
8062
|
-
handleTouchMove = (e6) => {
|
|
8063
|
-
const touch = e6.touches[0];
|
|
8064
|
-
if (this.pendingDrag && !this.isDragging) {
|
|
8065
|
-
const dy = touch.clientY - this.startY;
|
|
8066
|
-
const absDy = Math.abs(dy);
|
|
8067
|
-
const ACTIVATE_PX = 8;
|
|
8068
|
-
const body = this.bodyElement;
|
|
8069
|
-
const atTop = !body || body.scrollTop <= 0;
|
|
8070
|
-
if (absDy >= ACTIVATE_PX) {
|
|
8071
|
-
if (atTop) {
|
|
8072
|
-
this.startDrag(this.startY);
|
|
8073
|
-
this.isDragging = true;
|
|
8074
|
-
this.pendingDrag = false;
|
|
8075
|
-
} else {}
|
|
8076
|
-
}
|
|
8077
|
-
}
|
|
8078
|
-
if (!this.isDragging)
|
|
8079
|
-
return;
|
|
8080
|
-
this.updateDrag(touch.clientY);
|
|
8081
|
-
e6.preventDefault();
|
|
8082
|
-
};
|
|
8083
|
-
handleTouchEnd = (e6) => {
|
|
8084
|
-
this.pendingDrag = false;
|
|
8085
|
-
if (!this.isDragging)
|
|
8086
|
-
return;
|
|
8087
|
-
this.endDrag();
|
|
8088
|
-
e6.preventDefault();
|
|
8089
|
-
};
|
|
8090
|
-
handleMouseDown = (e6) => {
|
|
8091
|
-
if (this.loading || !this.open)
|
|
8092
|
-
return;
|
|
8093
|
-
this.startDrag(e6.clientY);
|
|
8094
|
-
e6.preventDefault();
|
|
8095
|
-
};
|
|
8096
|
-
handleMouseMove = (e6) => {
|
|
8097
|
-
if (!this.isDragging)
|
|
8098
|
-
return;
|
|
8099
|
-
this.updateDrag(e6.clientY);
|
|
8100
|
-
e6.preventDefault();
|
|
8101
|
-
};
|
|
8102
|
-
handleMouseUp = (e6) => {
|
|
8103
|
-
if (!this.isDragging)
|
|
8104
|
-
return;
|
|
8105
|
-
this.endDrag();
|
|
8106
|
-
e6.preventDefault();
|
|
8107
|
-
};
|
|
8108
|
-
startDrag(y3) {
|
|
8130
|
+
startDrag(y) {
|
|
8109
8131
|
this.isDragging = true;
|
|
8110
|
-
this.startY =
|
|
8111
|
-
this.currentY =
|
|
8132
|
+
this.startY = y;
|
|
8133
|
+
this.currentY = y;
|
|
8112
8134
|
this.dragDistance = 0;
|
|
8113
8135
|
this.dragStartTime = Date.now();
|
|
8114
8136
|
this.lastDragTime = this.dragStartTime;
|
|
@@ -8129,17 +8151,17 @@ var init_Drawer = __esm(() => {
|
|
|
8129
8151
|
this.drawerElement.classList.add("dragging");
|
|
8130
8152
|
}
|
|
8131
8153
|
}
|
|
8132
|
-
updateDrag(
|
|
8154
|
+
updateDrag(y) {
|
|
8133
8155
|
if (!this.isDragging || !this.drawerElement)
|
|
8134
8156
|
return;
|
|
8135
8157
|
const now = Date.now();
|
|
8136
8158
|
const deltaTime = now - this.lastDragTime;
|
|
8137
|
-
const deltaY =
|
|
8159
|
+
const deltaY = y - this.currentY;
|
|
8138
8160
|
if (deltaTime > 0) {
|
|
8139
8161
|
this.velocity = deltaY / deltaTime;
|
|
8140
8162
|
}
|
|
8141
|
-
this.currentY =
|
|
8142
|
-
this.dragDistance =
|
|
8163
|
+
this.currentY = y;
|
|
8164
|
+
this.dragDistance = y - this.startY;
|
|
8143
8165
|
const viewportHalf = typeof window !== "undefined" && window.innerHeight ? window.innerHeight * OVERPULL_VIEWPORT_FACTOR : 0;
|
|
8144
8166
|
const maxOverdragUpPx = Math.max(this.drawerHeight * OVERPULL_SHEET_FACTOR, viewportHalf, this.overpullPx);
|
|
8145
8167
|
const rawTargetTranslateY = this.startTranslateYPx + this.dragDistance;
|
|
@@ -8193,11 +8215,11 @@ var init_Drawer = __esm(() => {
|
|
|
8193
8215
|
if (!transform || transform === "none")
|
|
8194
8216
|
return NaN;
|
|
8195
8217
|
if (transform.startsWith("matrix(")) {
|
|
8196
|
-
const values = transform.slice(7, -1).split(",").map((
|
|
8218
|
+
const values = transform.slice(7, -1).split(",").map((v) => parseFloat(v.trim()));
|
|
8197
8219
|
return values.length === 6 ? values[5] : NaN;
|
|
8198
8220
|
}
|
|
8199
8221
|
if (transform.startsWith("matrix3d(")) {
|
|
8200
|
-
const values = transform.slice(9, -1).split(",").map((
|
|
8222
|
+
const values = transform.slice(9, -1).split(",").map((v) => parseFloat(v.trim()));
|
|
8201
8223
|
return values.length === 16 ? values[13] : NaN;
|
|
8202
8224
|
}
|
|
8203
8225
|
const match = transform.match(/translateY\(([-\d.]+)px\)/);
|
|
@@ -8218,28 +8240,6 @@ var init_Drawer = __esm(() => {
|
|
|
8218
8240
|
this.isClosing = false;
|
|
8219
8241
|
}, 300);
|
|
8220
8242
|
}
|
|
8221
|
-
onClose = () => {
|
|
8222
|
-
if (this.loading)
|
|
8223
|
-
return;
|
|
8224
|
-
if (this.isClosing)
|
|
8225
|
-
return;
|
|
8226
|
-
if (this.drawerElement) {
|
|
8227
|
-
this.drawerElement.classList.remove("dragging");
|
|
8228
|
-
}
|
|
8229
|
-
this.open = false;
|
|
8230
|
-
dispatchLitCancel(this);
|
|
8231
|
-
this.isClosing = true;
|
|
8232
|
-
setTimeout(() => {
|
|
8233
|
-
this.isClosing = false;
|
|
8234
|
-
}, 300);
|
|
8235
|
-
};
|
|
8236
|
-
onHandleClick = () => {
|
|
8237
|
-
if (!this.open) {
|
|
8238
|
-
this.show();
|
|
8239
|
-
} else {
|
|
8240
|
-
this.hide("handle");
|
|
8241
|
-
}
|
|
8242
|
-
};
|
|
8243
8243
|
show() {
|
|
8244
8244
|
if (this.drawerElement) {
|
|
8245
8245
|
this.drawerElement.classList.remove("dragging");
|
|
@@ -8289,11 +8289,6 @@ var init_Drawer = __esm(() => {
|
|
|
8289
8289
|
</section>
|
|
8290
8290
|
`;
|
|
8291
8291
|
}
|
|
8292
|
-
onOverlayClick = () => {
|
|
8293
|
-
if (!this.closeOnOverlayClick)
|
|
8294
|
-
return;
|
|
8295
|
-
this.onClose();
|
|
8296
|
-
};
|
|
8297
8292
|
};
|
|
8298
8293
|
Drawer_default = function ensureDefined() {
|
|
8299
8294
|
const TAG = W3A_DRAWER_ID;
|
|
@@ -8373,7 +8368,7 @@ function renderCopyStatusIcon() {
|
|
|
8373
8368
|
function settlingState(state, maskedTarget, startedAtMs) {
|
|
8374
8369
|
const prefix = maskedTarget.startsWith(state.prefix) ? state.prefix : "";
|
|
8375
8370
|
const targetSlots = Array.from(maskedTarget.slice(prefix.length));
|
|
8376
|
-
const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((
|
|
8371
|
+
const slots = targetSlots.length === state.slots.length ? state.slots : targetSlots.map((_, index) => ({
|
|
8377
8372
|
glyph: randomReelGlyph(state.alphabet),
|
|
8378
8373
|
nextChangeAtMs: startedAtMs + index * 37 % 90
|
|
8379
8374
|
}));
|
|
@@ -8499,15 +8494,38 @@ var init_viewer2 = __esm(() => {
|
|
|
8499
8494
|
errorMessage: { type: String },
|
|
8500
8495
|
showCloseButton: { type: Boolean, attribute: "show-close-button" }
|
|
8501
8496
|
};
|
|
8502
|
-
copiedFields = new Set;
|
|
8503
|
-
copyTimers = new Map;
|
|
8504
|
-
revealStates = new Map;
|
|
8505
|
-
revealAnimationFrame = null;
|
|
8506
|
-
_stylesReady = false;
|
|
8507
|
-
_stylePromises = [];
|
|
8508
|
-
_stylesAwaiting = null;
|
|
8509
8497
|
constructor() {
|
|
8510
8498
|
super();
|
|
8499
|
+
this.copiedFields = new Set;
|
|
8500
|
+
this.copyTimers = new Map;
|
|
8501
|
+
this.revealStates = new Map;
|
|
8502
|
+
this.revealAnimationFrame = null;
|
|
8503
|
+
this._stylesReady = false;
|
|
8504
|
+
this._stylePromises = [];
|
|
8505
|
+
this._stylesAwaiting = null;
|
|
8506
|
+
this.onRevealAnimationFrame = (now) => {
|
|
8507
|
+
this.revealAnimationFrame = null;
|
|
8508
|
+
if (this.ownerDocument?.hidden) {
|
|
8509
|
+
this.scheduleRevealAnimation();
|
|
8510
|
+
return;
|
|
8511
|
+
}
|
|
8512
|
+
let changed = false;
|
|
8513
|
+
for (const [entryKey, state] of this.revealStates) {
|
|
8514
|
+
if (state.kind === "settled")
|
|
8515
|
+
continue;
|
|
8516
|
+
const nextState = advanceRevealState(state, now);
|
|
8517
|
+
if (nextState !== state) {
|
|
8518
|
+
this.revealStates.set(entryKey, nextState);
|
|
8519
|
+
changed = true;
|
|
8520
|
+
}
|
|
8521
|
+
}
|
|
8522
|
+
if (changed)
|
|
8523
|
+
this.requestUpdate();
|
|
8524
|
+
this.scheduleRevealAnimation();
|
|
8525
|
+
};
|
|
8526
|
+
this._stopDragStart = (e) => {
|
|
8527
|
+
e.stopPropagation();
|
|
8528
|
+
};
|
|
8511
8529
|
this.theme = "dark";
|
|
8512
8530
|
this.variant = "drawer";
|
|
8513
8531
|
this.keys = undefined;
|
|
@@ -8519,27 +8537,27 @@ var init_viewer2 = __esm(() => {
|
|
|
8519
8537
|
return "export";
|
|
8520
8538
|
}
|
|
8521
8539
|
createRenderRoot() {
|
|
8522
|
-
const
|
|
8523
|
-
const root =
|
|
8540
|
+
const supportsConstructable = typeof ShadowRoot !== "undefined" && "adoptedStyleSheets" in ShadowRoot.prototype && typeof CSSStyleSheet !== "undefined" && "replaceSync" in CSSStyleSheet.prototype;
|
|
8541
|
+
const root = supportsConstructable ? super.createRenderRoot() : this;
|
|
8524
8542
|
const p1 = ensureExternalStyles(root, "export-viewer.css", "data-w3a-export-viewer-css");
|
|
8525
8543
|
this._stylePromises.push(p1);
|
|
8526
8544
|
p1.catch(() => {});
|
|
8527
8545
|
const pCopyIcon = ensureExternalStyles(root, "copy-icon.css", "data-w3a-copy-icon-css");
|
|
8528
8546
|
this._stylePromises.push(pCopyIcon);
|
|
8529
8547
|
pCopyIcon.catch(() => {});
|
|
8530
|
-
const
|
|
8531
|
-
this._stylePromises.push(
|
|
8532
|
-
|
|
8533
|
-
const
|
|
8534
|
-
this._stylePromises.push(
|
|
8535
|
-
|
|
8548
|
+
const p2 = ensureExternalStyles(root, "w3a-components.css", "data-w3a-components-css");
|
|
8549
|
+
this._stylePromises.push(p2);
|
|
8550
|
+
p2.catch(() => {});
|
|
8551
|
+
const p3 = ensureExternalStyles(root, "drawer.css", "data-w3a-drawer-css");
|
|
8552
|
+
this._stylePromises.push(p3);
|
|
8553
|
+
p3.catch(() => {});
|
|
8536
8554
|
return root;
|
|
8537
8555
|
}
|
|
8538
8556
|
shouldUpdate(_changed) {
|
|
8539
8557
|
if (this._stylesReady)
|
|
8540
8558
|
return true;
|
|
8541
8559
|
if (!this._stylesAwaiting) {
|
|
8542
|
-
const settle = Promise.all(this._stylePromises).then(() => new Promise((
|
|
8560
|
+
const settle = Promise.all(this._stylePromises).then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r()))));
|
|
8543
8561
|
this._stylesAwaiting = settle.then(() => {
|
|
8544
8562
|
this._stylesReady = true;
|
|
8545
8563
|
this.requestUpdate();
|
|
@@ -8574,26 +8592,6 @@ var init_viewer2 = __esm(() => {
|
|
|
8574
8592
|
this.resetRevealStates();
|
|
8575
8593
|
super.disconnectedCallback();
|
|
8576
8594
|
}
|
|
8577
|
-
onRevealAnimationFrame = (now) => {
|
|
8578
|
-
this.revealAnimationFrame = null;
|
|
8579
|
-
if (this.ownerDocument?.hidden) {
|
|
8580
|
-
this.scheduleRevealAnimation();
|
|
8581
|
-
return;
|
|
8582
|
-
}
|
|
8583
|
-
let changed = false;
|
|
8584
|
-
for (const [entryKey, state] of this.revealStates) {
|
|
8585
|
-
if (state.kind === "settled")
|
|
8586
|
-
continue;
|
|
8587
|
-
const nextState = advanceRevealState(state, now);
|
|
8588
|
-
if (nextState !== state) {
|
|
8589
|
-
this.revealStates.set(entryKey, nextState);
|
|
8590
|
-
changed = true;
|
|
8591
|
-
}
|
|
8592
|
-
}
|
|
8593
|
-
if (changed)
|
|
8594
|
-
this.requestUpdate();
|
|
8595
|
-
this.scheduleRevealAnimation();
|
|
8596
|
-
};
|
|
8597
8595
|
scheduleRevealAnimation() {
|
|
8598
8596
|
if (this.revealAnimationFrame !== null || prefersReducedMotion(this.ownerDocument))
|
|
8599
8597
|
return;
|
|
@@ -8650,9 +8648,6 @@ var init_viewer2 = __esm(() => {
|
|
|
8650
8648
|
}
|
|
8651
8649
|
this.scheduleRevealAnimation();
|
|
8652
8650
|
}
|
|
8653
|
-
_stopDragStart = (e6) => {
|
|
8654
|
-
e6.stopPropagation();
|
|
8655
|
-
};
|
|
8656
8651
|
updateTheme() {
|
|
8657
8652
|
try {
|
|
8658
8653
|
const docEl = this.ownerDocument?.documentElement;
|
|
@@ -8700,8 +8695,8 @@ var init_viewer2 = __esm(() => {
|
|
|
8700
8695
|
}
|
|
8701
8696
|
this.markCopied(index, type);
|
|
8702
8697
|
this.requestUpdate();
|
|
8703
|
-
} catch (
|
|
8704
|
-
console.warn("Copy failed",
|
|
8698
|
+
} catch (e) {
|
|
8699
|
+
console.warn("Copy failed", e);
|
|
8705
8700
|
}
|
|
8706
8701
|
}
|
|
8707
8702
|
copyViaTextareaFallback(text) {
|
|
@@ -8754,9 +8749,9 @@ var init_viewer2 = __esm(() => {
|
|
|
8754
8749
|
const provided = Array.isArray(this.keys) ? this.keys.filter((item) => {
|
|
8755
8750
|
if (!item || typeof item !== "object")
|
|
8756
8751
|
return false;
|
|
8757
|
-
const
|
|
8758
|
-
const
|
|
8759
|
-
return !!
|
|
8752
|
+
const publicKey = String(item.publicKey || "").trim();
|
|
8753
|
+
const privateKey = String(item.privateKey || "").trim();
|
|
8754
|
+
return !!publicKey || !!privateKey;
|
|
8760
8755
|
}) : [];
|
|
8761
8756
|
if (provided.length > 0)
|
|
8762
8757
|
return provided;
|
|
@@ -8779,7 +8774,7 @@ var init_viewer2 = __esm(() => {
|
|
|
8779
8774
|
const guidanceTitle = String(this.guidance?.title || "").trim();
|
|
8780
8775
|
const guidanceBody = String(this.guidance?.body || "").trim();
|
|
8781
8776
|
const guidanceSteps = Array.isArray(this.guidance?.steps) ? this.guidance.steps.map((entry) => String(entry || "").trim()).filter((entry) => entry.length > 0) : [];
|
|
8782
|
-
const
|
|
8777
|
+
const errorMessage = String(this.errorMessage || "").trim();
|
|
8783
8778
|
return x`
|
|
8784
8779
|
${this.showCloseButton ? x`<button
|
|
8785
8780
|
aria-label="Close"
|
|
@@ -8791,7 +8786,7 @@ var init_viewer2 = __esm(() => {
|
|
|
8791
8786
|
</button>` : null}
|
|
8792
8787
|
<div class="content">
|
|
8793
8788
|
<h2 class="title">Exported Keys</h2>
|
|
8794
|
-
${
|
|
8789
|
+
${errorMessage ? x`<div class="error-banner">${errorMessage}</div>` : null}
|
|
8795
8790
|
<div class="fields">
|
|
8796
8791
|
${showAccountId ? x`
|
|
8797
8792
|
<div class="field">
|
|
@@ -8893,6 +8888,6 @@ var init_viewer2 = __esm(() => {
|
|
|
8893
8888
|
init_viewer2();
|
|
8894
8889
|
|
|
8895
8890
|
export {
|
|
8896
|
-
|
|
8897
|
-
|
|
8891
|
+
ExportPrivateKeyViewer,
|
|
8892
|
+
viewer_default as default
|
|
8898
8893
|
};
|