@autogames/sdk 1.1.1
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/README.md +732 -0
- package/dist/PhArrowCircleDown-Db_5u1DC.js +73 -0
- package/dist/PhArrowClockwise-D5uNEUen.js +73 -0
- package/dist/PhArrowDown-CKkl0Ow8.js +73 -0
- package/dist/PhArrowLeft-5Y_-c8ih.js +73 -0
- package/dist/PhArrowRight-BAENQRa7.js +73 -0
- package/dist/PhArrowSquareOut-DlfAcw2e.js +73 -0
- package/dist/PhArrowUp-8KZkS1Bo.js +73 -0
- package/dist/PhArrowUpRight-DU3GSwzb.js +73 -0
- package/dist/PhArrowsClockwise-CShJ-Teu.js +73 -0
- package/dist/PhArrowsDownUp-BL_LzwqW.js +73 -0
- package/dist/PhArrowsLeftRight-B8vh7AsL.js +73 -0
- package/dist/PhBank-CP_QveNf.js +73 -0
- package/dist/PhBrowser-CCSpUQte.js +73 -0
- package/dist/PhCaretDown-C4u7yn0j.js +73 -0
- package/dist/PhCaretLeft-BSbx9BBc.js +73 -0
- package/dist/PhCaretRight-B1CumbxI.js +73 -0
- package/dist/PhCaretUp-CqiATiNS.js +73 -0
- package/dist/PhCheck-DNkwyplN.js +73 -0
- package/dist/PhCircleHalf-D4fgYYPo.js +73 -0
- package/dist/PhClock-DkIJeKoF.js +73 -0
- package/dist/PhCompass-CwVX0Z1y.js +73 -0
- package/dist/PhCopy-C0BiDhpw.js +73 -0
- package/dist/PhCreditCard-Bv5P9lrI.js +73 -0
- package/dist/PhCurrencyDollar-BCl4tAtz.js +73 -0
- package/dist/PhDesktop-DREPgw1q.js +73 -0
- package/dist/PhDeviceMobile-CM6lQlUa.js +73 -0
- package/dist/PhDotsThree-dmgI5Eht.js +73 -0
- package/dist/PhEnvelope-D7EatbfP.js +73 -0
- package/dist/PhFunnelSimple-Bs-Zsz_A.js +73 -0
- package/dist/PhGlobe-Azwq0DDw.js +73 -0
- package/dist/PhIdentificationCard-BZpHUHrg.js +73 -0
- package/dist/PhImage-CuSFzxM3.js +73 -0
- package/dist/PhInfo-B4SBturW.js +73 -0
- package/dist/PhLightbulb-79sWB45x.js +73 -0
- package/dist/PhMagnifyingGlass-CojwRGSu.js +73 -0
- package/dist/PhPaperPlaneRight-C3krm3eP.js +73 -0
- package/dist/PhPlus-DDYz48cV.js +73 -0
- package/dist/PhPower-CZWV02MF.js +73 -0
- package/dist/PhPuzzlePiece-fazdHBSU.js +73 -0
- package/dist/PhQrCode-BbBdb_ct.js +73 -0
- package/dist/PhQuestion-B6cc25Dw.js +73 -0
- package/dist/PhQuestionMark-TmZ4Sxa8.js +73 -0
- package/dist/PhSealCheck-CdKeNk5K.js +73 -0
- package/dist/PhSignOut-BBNQiKWI.js +73 -0
- package/dist/PhSpinner-BwqRA0He.js +73 -0
- package/dist/PhTrash-CXtQYiKu.js +73 -0
- package/dist/PhUser-DVV5XCqw.js +73 -0
- package/dist/PhVault-B73IPDB0.js +73 -0
- package/dist/PhWarning-BEhs8fc4.js +73 -0
- package/dist/PhWarningCircle-BA0Qvc1c.js +73 -0
- package/dist/PhX-CifUIiFs.js +73 -0
- package/dist/autogames-sdk.esm.js +5 -0
- package/dist/autogames-sdk.js +5247 -0
- package/dist/basic-R2aK52rX.js +4875 -0
- package/dist/bridge-mount-Bhf05oeO.js +89817 -0
- package/dist/ccip-Bg_nydEz.js +145 -0
- package/dist/ccip-CjgrAp_t.js +147 -0
- package/dist/core-CnCeDQAm.js +17712 -0
- package/dist/features-BrlR4_0m.js +268 -0
- package/dist/index-C9RsDt_J.js +8044 -0
- package/dist/index-Chq42DrS.js +2010 -0
- package/dist/index-HQNbtrlg.js +341 -0
- package/dist/index-zA8BVXWW.js +264 -0
- package/dist/main-oRLGGL0R.js +2284 -0
- package/dist/main.d.ts +342 -0
- package/dist/parseSignature-DFDCc7FD.js +131 -0
- package/dist/property-DkPmFHg2.js +587 -0
- package/dist/secp256k1-UpZfvHa8.js +1347 -0
- package/dist/stats-confirm.html +4949 -0
- package/dist/w3m-modal-ClvdQLsb.js +2822 -0
- package/package.json +48 -0
|
@@ -0,0 +1,4875 @@
|
|
|
1
|
+
import { x as M, o as H, A as N, O as q, i as P, e as L, a as Ge, y as u, E as F, R as B, u as j, G as Gt, X as ve, F as we, Y as Jn, v as G, z as he, T as Nt, d as je, M as kn, Z as An, _ as Bn, m as Pn, U as Me, C as ge, $ as Xn, a0 as Zn, Q as Qt, I as Ln, a1 as Ot } from "./core-CnCeDQAm.js";
|
|
2
|
+
import { n as d, r as _, c as O, o as z, U as ce, i as ei, t as ti, e as ni } from "./index-Chq42DrS.js";
|
|
3
|
+
import { dl as ii, dm as ri } from "./bridge-mount-Bhf05oeO.js";
|
|
4
|
+
var Le = function(e, t, i, r) {
|
|
5
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
6
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
7
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
8
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
9
|
+
};
|
|
10
|
+
let Ce = class extends M {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = H.state.connectors, this.count = N.state.count, this.filteredCount = N.state.filteredWallets.length, this.isFetchingRecommendedWallets = N.state.isFetchingRecommendedWallets, this.unsubscribe.push(H.subscribeKey("connectors", (t) => this.connectors = t), N.subscribeKey("count", (t) => this.count = t), N.subscribeKey("filteredWallets", (t) => this.filteredCount = t.length), N.subscribeKey("isFetchingRecommendedWallets", (t) => this.isFetchingRecommendedWallets = t));
|
|
13
|
+
}
|
|
14
|
+
disconnectedCallback() {
|
|
15
|
+
this.unsubscribe.forEach((t) => t());
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
const t = this.connectors.find((c) => c.id === "walletConnect"), { allWallets: i } = q.state;
|
|
19
|
+
if (!t || i === "HIDE" || i === "ONLY_MOBILE" && !P.isMobile())
|
|
20
|
+
return null;
|
|
21
|
+
const r = N.state.featured.length, o = this.count + r, n = o < 10 ? o : Math.floor(o / 10) * 10, s = this.filteredCount > 0 ? this.filteredCount : n;
|
|
22
|
+
let a = `${s}`;
|
|
23
|
+
this.filteredCount > 0 ? a = `${this.filteredCount}` : s < o && (a = `${s}+`);
|
|
24
|
+
const l = L.hasAnyConnection(Ge.CONNECTOR_ID.WALLET_CONNECT);
|
|
25
|
+
return u`
|
|
26
|
+
<wui-list-wallet
|
|
27
|
+
name="Search Wallet"
|
|
28
|
+
walletIcon="search"
|
|
29
|
+
showAllWallets
|
|
30
|
+
@click=${this.onAllWallets.bind(this)}
|
|
31
|
+
tagLabel=${a}
|
|
32
|
+
tagVariant="info"
|
|
33
|
+
data-testid="all-wallets"
|
|
34
|
+
tabIdx=${z(this.tabIdx)}
|
|
35
|
+
.loading=${this.isFetchingRecommendedWallets}
|
|
36
|
+
?disabled=${l}
|
|
37
|
+
size="sm"
|
|
38
|
+
></wui-list-wallet>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
onAllWallets() {
|
|
42
|
+
F.sendEvent({ type: "track", event: "CLICK_ALL_WALLETS" }), B.push("AllWallets", { redirectView: B.state.data?.redirectView });
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
Le([
|
|
46
|
+
d()
|
|
47
|
+
], Ce.prototype, "tabIdx", void 0);
|
|
48
|
+
Le([
|
|
49
|
+
_()
|
|
50
|
+
], Ce.prototype, "connectors", void 0);
|
|
51
|
+
Le([
|
|
52
|
+
_()
|
|
53
|
+
], Ce.prototype, "count", void 0);
|
|
54
|
+
Le([
|
|
55
|
+
_()
|
|
56
|
+
], Ce.prototype, "filteredCount", void 0);
|
|
57
|
+
Le([
|
|
58
|
+
_()
|
|
59
|
+
], Ce.prototype, "isFetchingRecommendedWallets", void 0);
|
|
60
|
+
Ce = Le([
|
|
61
|
+
O("w3m-all-wallets-widget")
|
|
62
|
+
], Ce);
|
|
63
|
+
const oi = j`
|
|
64
|
+
:host {
|
|
65
|
+
margin-top: ${({ spacing: e }) => e[1]};
|
|
66
|
+
}
|
|
67
|
+
wui-separator {
|
|
68
|
+
margin: ${({ spacing: e }) => e[3]} calc(${({ spacing: e }) => e[3]} * -1)
|
|
69
|
+
${({ spacing: e }) => e[2]} calc(${({ spacing: e }) => e[3]} * -1);
|
|
70
|
+
width: calc(100% + ${({ spacing: e }) => e[3]} * 2);
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
var fe = function(e, t, i, r) {
|
|
74
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
75
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
76
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
77
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
78
|
+
};
|
|
79
|
+
let Z = class extends M {
|
|
80
|
+
constructor() {
|
|
81
|
+
super(), this.unsubscribe = [], this.connectors = H.state.connectors, this.recommended = N.state.recommended, this.featured = N.state.featured, this.explorerWallets = N.state.explorerWallets, this.connections = L.state.connections, this.connectorImages = Gt.state.connectorImages, this.loadingTelegram = !1, this.unsubscribe.push(H.subscribeKey("connectors", (t) => this.connectors = t), L.subscribeKey("connections", (t) => this.connections = t), Gt.subscribeKey("connectorImages", (t) => this.connectorImages = t), N.subscribeKey("recommended", (t) => this.recommended = t), N.subscribeKey("featured", (t) => this.featured = t), N.subscribeKey("explorerFilteredWallets", (t) => {
|
|
82
|
+
this.explorerWallets = t?.length ? t : N.state.explorerWallets;
|
|
83
|
+
}), N.subscribeKey("explorerWallets", (t) => {
|
|
84
|
+
this.explorerWallets?.length || (this.explorerWallets = t);
|
|
85
|
+
})), P.isTelegram() && P.isIos() && (this.loadingTelegram = !L.state.wcUri, this.unsubscribe.push(L.subscribeKey("wcUri", (t) => this.loadingTelegram = !t)));
|
|
86
|
+
}
|
|
87
|
+
disconnectedCallback() {
|
|
88
|
+
this.unsubscribe.forEach((t) => t());
|
|
89
|
+
}
|
|
90
|
+
render() {
|
|
91
|
+
return u`
|
|
92
|
+
<wui-flex flexDirection="column" gap="2"> ${this.connectorListTemplate()} </wui-flex>
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
mapConnectorsToExplorerWallets(t, i) {
|
|
96
|
+
return t.map((r) => {
|
|
97
|
+
if (r.type === "MULTI_CHAIN" && r.connectors) {
|
|
98
|
+
const n = r.connectors.map((c) => c.id), s = r.connectors.map((c) => c.name), a = r.connectors.map((c) => c.info?.rdns), l = i?.find((c) => n.includes(c.id) || s.includes(c.name) || c.rdns && (a.includes(c.rdns) || n.includes(c.rdns)));
|
|
99
|
+
return r.explorerWallet = l ?? r.explorerWallet, r;
|
|
100
|
+
}
|
|
101
|
+
const o = i?.find((n) => n.id === r.id || n.rdns === r.info?.rdns || n.name === r.name);
|
|
102
|
+
return r.explorerWallet = o ?? r.explorerWallet, r;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
processConnectorsByType(t, i = !0) {
|
|
106
|
+
const r = ve.sortConnectorsByExplorerWallet([...t]);
|
|
107
|
+
return i ? r.filter(ve.showConnector) : r;
|
|
108
|
+
}
|
|
109
|
+
connectorListTemplate() {
|
|
110
|
+
const t = this.mapConnectorsToExplorerWallets(this.connectors, this.explorerWallets ?? []), i = ve.getConnectorsByType(t, this.recommended, this.featured), r = this.processConnectorsByType(i.announced.filter((h) => h.id !== "walletConnect")), o = this.processConnectorsByType(i.injected), n = this.processConnectorsByType(i.multiChain.filter((h) => h.name !== "WalletConnect"), !1), s = i.custom, a = i.recent, l = this.processConnectorsByType(i.external.filter((h) => h.id !== Ge.CONNECTOR_ID.COINBASE_SDK)), c = i.recommended, w = i.featured, E = ve.getConnectorTypeOrder({
|
|
111
|
+
custom: s,
|
|
112
|
+
recent: a,
|
|
113
|
+
announced: r,
|
|
114
|
+
injected: o,
|
|
115
|
+
multiChain: n,
|
|
116
|
+
recommended: c,
|
|
117
|
+
featured: w,
|
|
118
|
+
external: l
|
|
119
|
+
}), $ = this.connectors.find((h) => h.id === "walletConnect"), m = P.isMobile(), x = [];
|
|
120
|
+
for (const h of E)
|
|
121
|
+
switch (h) {
|
|
122
|
+
case "walletConnect": {
|
|
123
|
+
!m && $ && x.push({ kind: "connector", subtype: "walletConnect", connector: $ });
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
case "recent": {
|
|
127
|
+
ve.getFilteredRecentWallets().forEach((p) => x.push({ kind: "wallet", subtype: "recent", wallet: p }));
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
case "injected": {
|
|
131
|
+
n.forEach((b) => x.push({ kind: "connector", subtype: "multiChain", connector: b })), r.forEach((b) => x.push({ kind: "connector", subtype: "announced", connector: b })), o.forEach((b) => x.push({ kind: "connector", subtype: "injected", connector: b }));
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case "featured": {
|
|
135
|
+
w.forEach((b) => x.push({ kind: "wallet", subtype: "featured", wallet: b }));
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
case "custom": {
|
|
139
|
+
ve.getFilteredCustomWallets(s ?? []).forEach((p) => x.push({ kind: "wallet", subtype: "custom", wallet: p }));
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
case "external": {
|
|
143
|
+
l.forEach((b) => x.push({ kind: "connector", subtype: "external", connector: b }));
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
case "recommended": {
|
|
147
|
+
ve.getCappedRecommendedWallets(c).forEach((p) => x.push({ kind: "wallet", subtype: "recommended", wallet: p }));
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
default:
|
|
151
|
+
console.warn(`Unknown connector type: ${h}`);
|
|
152
|
+
}
|
|
153
|
+
return x.map((h, b) => h.kind === "connector" ? this.renderConnector(h, b) : this.renderWallet(h, b));
|
|
154
|
+
}
|
|
155
|
+
renderConnector(t, i) {
|
|
156
|
+
const r = t.connector, o = we.getConnectorImage(r) || this.connectorImages[r?.imageId ?? ""], s = (this.connections.get(r.chain) ?? []).some((E) => Jn.isLowerCaseMatch(E.connectorId, r.id));
|
|
157
|
+
let a, l;
|
|
158
|
+
t.subtype === "multiChain" ? (a = "multichain", l = "info") : t.subtype === "walletConnect" ? (a = "qr code", l = "accent") : t.subtype === "injected" || t.subtype === "announced" ? (a = s ? "connected" : "installed", l = s ? "info" : "success") : (a = void 0, l = void 0);
|
|
159
|
+
const c = L.hasAnyConnection(Ge.CONNECTOR_ID.WALLET_CONNECT), w = t.subtype === "walletConnect" || t.subtype === "external" ? c : !1;
|
|
160
|
+
return u`
|
|
161
|
+
<w3m-list-wallet
|
|
162
|
+
displayIndex=${i}
|
|
163
|
+
imageSrc=${z(o)}
|
|
164
|
+
.installed=${!0}
|
|
165
|
+
name=${r.name ?? "Unknown"}
|
|
166
|
+
.tagVariant=${l}
|
|
167
|
+
tagLabel=${z(a)}
|
|
168
|
+
data-testid=${`wallet-selector-${r.id.toLowerCase()}`}
|
|
169
|
+
size="sm"
|
|
170
|
+
@click=${() => this.onClickConnector(t)}
|
|
171
|
+
tabIdx=${z(this.tabIdx)}
|
|
172
|
+
?disabled=${w}
|
|
173
|
+
rdnsId=${z(r.explorerWallet?.rdns || void 0)}
|
|
174
|
+
walletRank=${z(r.explorerWallet?.order)}
|
|
175
|
+
>
|
|
176
|
+
</w3m-list-wallet>
|
|
177
|
+
`;
|
|
178
|
+
}
|
|
179
|
+
onClickConnector(t) {
|
|
180
|
+
const i = B.state.data?.redirectView;
|
|
181
|
+
if (t.subtype === "walletConnect") {
|
|
182
|
+
H.setActiveConnector(t.connector), P.isMobile() ? B.push("AllWallets") : B.push("ConnectingWalletConnect", { redirectView: i });
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (t.subtype === "multiChain") {
|
|
186
|
+
H.setActiveConnector(t.connector), B.push("ConnectingMultiChain", { redirectView: i });
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (t.subtype === "injected") {
|
|
190
|
+
H.setActiveConnector(t.connector), B.push("ConnectingExternal", {
|
|
191
|
+
connector: t.connector,
|
|
192
|
+
redirectView: i,
|
|
193
|
+
wallet: t.connector.explorerWallet
|
|
194
|
+
});
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (t.subtype === "announced") {
|
|
198
|
+
if (t.connector.id === "walletConnect") {
|
|
199
|
+
P.isMobile() ? B.push("AllWallets") : B.push("ConnectingWalletConnect", { redirectView: i });
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
B.push("ConnectingExternal", {
|
|
203
|
+
connector: t.connector,
|
|
204
|
+
redirectView: i,
|
|
205
|
+
wallet: t.connector.explorerWallet
|
|
206
|
+
});
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
B.push("ConnectingExternal", {
|
|
210
|
+
connector: t.connector,
|
|
211
|
+
redirectView: i
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
renderWallet(t, i) {
|
|
215
|
+
const r = t.wallet, o = we.getWalletImage(r), s = L.hasAnyConnection(Ge.CONNECTOR_ID.WALLET_CONNECT), a = this.loadingTelegram, l = t.subtype === "recent" ? "recent" : void 0, c = t.subtype === "recent" ? "info" : void 0;
|
|
216
|
+
return u`
|
|
217
|
+
<w3m-list-wallet
|
|
218
|
+
displayIndex=${i}
|
|
219
|
+
imageSrc=${z(o)}
|
|
220
|
+
name=${r.name ?? "Unknown"}
|
|
221
|
+
@click=${() => this.onClickWallet(t)}
|
|
222
|
+
size="sm"
|
|
223
|
+
data-testid=${`wallet-selector-${r.id}`}
|
|
224
|
+
tabIdx=${z(this.tabIdx)}
|
|
225
|
+
?loading=${a}
|
|
226
|
+
?disabled=${s}
|
|
227
|
+
rdnsId=${z(r.rdns || void 0)}
|
|
228
|
+
walletRank=${z(r.order)}
|
|
229
|
+
tagLabel=${z(l)}
|
|
230
|
+
.tagVariant=${c}
|
|
231
|
+
>
|
|
232
|
+
</w3m-list-wallet>
|
|
233
|
+
`;
|
|
234
|
+
}
|
|
235
|
+
onClickWallet(t) {
|
|
236
|
+
const i = B.state.data?.redirectView;
|
|
237
|
+
if (t.subtype === "featured") {
|
|
238
|
+
H.selectWalletConnector(t.wallet);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (t.subtype === "recent") {
|
|
242
|
+
if (this.loadingTelegram)
|
|
243
|
+
return;
|
|
244
|
+
H.selectWalletConnector(t.wallet);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
if (t.subtype === "custom") {
|
|
248
|
+
if (this.loadingTelegram)
|
|
249
|
+
return;
|
|
250
|
+
B.push("ConnectingWalletConnect", { wallet: t.wallet, redirectView: i });
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
if (this.loadingTelegram)
|
|
254
|
+
return;
|
|
255
|
+
const r = H.getConnector({
|
|
256
|
+
id: t.wallet.id,
|
|
257
|
+
rdns: t.wallet.rdns
|
|
258
|
+
});
|
|
259
|
+
r ? B.push("ConnectingExternal", { connector: r, redirectView: i }) : B.push("ConnectingWalletConnect", { wallet: t.wallet, redirectView: i });
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
Z.styles = oi;
|
|
263
|
+
fe([
|
|
264
|
+
d({ type: Number })
|
|
265
|
+
], Z.prototype, "tabIdx", void 0);
|
|
266
|
+
fe([
|
|
267
|
+
_()
|
|
268
|
+
], Z.prototype, "connectors", void 0);
|
|
269
|
+
fe([
|
|
270
|
+
_()
|
|
271
|
+
], Z.prototype, "recommended", void 0);
|
|
272
|
+
fe([
|
|
273
|
+
_()
|
|
274
|
+
], Z.prototype, "featured", void 0);
|
|
275
|
+
fe([
|
|
276
|
+
_()
|
|
277
|
+
], Z.prototype, "explorerWallets", void 0);
|
|
278
|
+
fe([
|
|
279
|
+
_()
|
|
280
|
+
], Z.prototype, "connections", void 0);
|
|
281
|
+
fe([
|
|
282
|
+
_()
|
|
283
|
+
], Z.prototype, "connectorImages", void 0);
|
|
284
|
+
fe([
|
|
285
|
+
_()
|
|
286
|
+
], Z.prototype, "loadingTelegram", void 0);
|
|
287
|
+
Z = fe([
|
|
288
|
+
O("w3m-connector-list")
|
|
289
|
+
], Z);
|
|
290
|
+
const si = j`
|
|
291
|
+
:host {
|
|
292
|
+
flex: 1;
|
|
293
|
+
height: 100%;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
button {
|
|
297
|
+
width: 100%;
|
|
298
|
+
height: 100%;
|
|
299
|
+
display: inline-flex;
|
|
300
|
+
align-items: center;
|
|
301
|
+
padding: ${({ spacing: e }) => e[1]} ${({ spacing: e }) => e[2]};
|
|
302
|
+
column-gap: ${({ spacing: e }) => e[1]};
|
|
303
|
+
color: ${({ tokens: e }) => e.theme.textSecondary};
|
|
304
|
+
border-radius: ${({ borderRadius: e }) => e[20]};
|
|
305
|
+
background-color: transparent;
|
|
306
|
+
transition: background-color ${({ durations: e }) => e.lg}
|
|
307
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
308
|
+
will-change: background-color;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
312
|
+
button[data-active='true'] {
|
|
313
|
+
color: ${({ tokens: e }) => e.theme.textPrimary};
|
|
314
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundTertiary};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
button:hover:enabled:not([data-active='true']),
|
|
318
|
+
button:active:enabled:not([data-active='true']) {
|
|
319
|
+
wui-text,
|
|
320
|
+
wui-icon {
|
|
321
|
+
color: ${({ tokens: e }) => e.theme.textPrimary};
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
`;
|
|
325
|
+
var Ue = function(e, t, i, r) {
|
|
326
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
327
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
328
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
329
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
330
|
+
};
|
|
331
|
+
const ai = {
|
|
332
|
+
lg: "lg-regular",
|
|
333
|
+
md: "md-regular",
|
|
334
|
+
sm: "sm-regular"
|
|
335
|
+
}, li = {
|
|
336
|
+
lg: "md",
|
|
337
|
+
md: "sm",
|
|
338
|
+
sm: "sm"
|
|
339
|
+
};
|
|
340
|
+
let $e = class extends M {
|
|
341
|
+
constructor() {
|
|
342
|
+
super(...arguments), this.icon = "mobile", this.size = "md", this.label = "", this.active = !1;
|
|
343
|
+
}
|
|
344
|
+
render() {
|
|
345
|
+
return u`
|
|
346
|
+
<button data-active=${this.active}>
|
|
347
|
+
${this.icon ? u`<wui-icon size=${li[this.size]} name=${this.icon}></wui-icon>` : ""}
|
|
348
|
+
<wui-text variant=${ai[this.size]}> ${this.label} </wui-text>
|
|
349
|
+
</button>
|
|
350
|
+
`;
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
$e.styles = [G, he, si];
|
|
354
|
+
Ue([
|
|
355
|
+
d()
|
|
356
|
+
], $e.prototype, "icon", void 0);
|
|
357
|
+
Ue([
|
|
358
|
+
d()
|
|
359
|
+
], $e.prototype, "size", void 0);
|
|
360
|
+
Ue([
|
|
361
|
+
d()
|
|
362
|
+
], $e.prototype, "label", void 0);
|
|
363
|
+
Ue([
|
|
364
|
+
d({ type: Boolean })
|
|
365
|
+
], $e.prototype, "active", void 0);
|
|
366
|
+
$e = Ue([
|
|
367
|
+
O("wui-tab-item")
|
|
368
|
+
], $e);
|
|
369
|
+
const ci = j`
|
|
370
|
+
:host {
|
|
371
|
+
display: inline-flex;
|
|
372
|
+
align-items: center;
|
|
373
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
374
|
+
border-radius: ${({ borderRadius: e }) => e[32]};
|
|
375
|
+
padding: ${({ spacing: e }) => e["01"]};
|
|
376
|
+
box-sizing: border-box;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
:host([data-size='sm']) {
|
|
380
|
+
height: 26px;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
:host([data-size='md']) {
|
|
384
|
+
height: 36px;
|
|
385
|
+
}
|
|
386
|
+
`;
|
|
387
|
+
var qe = function(e, t, i, r) {
|
|
388
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
389
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
390
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
391
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
392
|
+
};
|
|
393
|
+
let xe = class extends M {
|
|
394
|
+
constructor() {
|
|
395
|
+
super(...arguments), this.tabs = [], this.onTabChange = () => null, this.size = "md", this.activeTab = 0;
|
|
396
|
+
}
|
|
397
|
+
render() {
|
|
398
|
+
return this.dataset.size = this.size, this.tabs.map((t, i) => {
|
|
399
|
+
const r = i === this.activeTab;
|
|
400
|
+
return u`
|
|
401
|
+
<wui-tab-item
|
|
402
|
+
@click=${() => this.onTabClick(i)}
|
|
403
|
+
icon=${t.icon}
|
|
404
|
+
size=${this.size}
|
|
405
|
+
label=${t.label}
|
|
406
|
+
?active=${r}
|
|
407
|
+
data-active=${r}
|
|
408
|
+
data-testid="tab-${t.label?.toLowerCase()}"
|
|
409
|
+
></wui-tab-item>
|
|
410
|
+
`;
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
onTabClick(t) {
|
|
414
|
+
this.activeTab = t, this.onTabChange(t);
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
xe.styles = [G, he, ci];
|
|
418
|
+
qe([
|
|
419
|
+
d({ type: Array })
|
|
420
|
+
], xe.prototype, "tabs", void 0);
|
|
421
|
+
qe([
|
|
422
|
+
d()
|
|
423
|
+
], xe.prototype, "onTabChange", void 0);
|
|
424
|
+
qe([
|
|
425
|
+
d()
|
|
426
|
+
], xe.prototype, "size", void 0);
|
|
427
|
+
qe([
|
|
428
|
+
_()
|
|
429
|
+
], xe.prototype, "activeTab", void 0);
|
|
430
|
+
xe = qe([
|
|
431
|
+
O("wui-tabs")
|
|
432
|
+
], xe);
|
|
433
|
+
var Mt = function(e, t, i, r) {
|
|
434
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
435
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
436
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
437
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
438
|
+
};
|
|
439
|
+
let Qe = class extends M {
|
|
440
|
+
constructor() {
|
|
441
|
+
super(...arguments), this.platformTabs = [], this.unsubscribe = [], this.platforms = [], this.onSelectPlatfrom = void 0;
|
|
442
|
+
}
|
|
443
|
+
disconnectCallback() {
|
|
444
|
+
this.unsubscribe.forEach((t) => t());
|
|
445
|
+
}
|
|
446
|
+
render() {
|
|
447
|
+
const t = this.generateTabs();
|
|
448
|
+
return u`
|
|
449
|
+
<wui-flex justifyContent="center" .padding=${["0", "0", "4", "0"]}>
|
|
450
|
+
<wui-tabs .tabs=${t} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
|
|
451
|
+
</wui-flex>
|
|
452
|
+
`;
|
|
453
|
+
}
|
|
454
|
+
generateTabs() {
|
|
455
|
+
const t = this.platforms.map((i) => i === "browser" ? { label: "Browser", icon: "extension", platform: "browser" } : i === "mobile" ? { label: "Mobile", icon: "mobile", platform: "mobile" } : i === "qrcode" ? { label: "Mobile", icon: "mobile", platform: "qrcode" } : i === "web" ? { label: "Webapp", icon: "browser", platform: "web" } : i === "desktop" ? { label: "Desktop", icon: "desktop", platform: "desktop" } : { label: "Browser", icon: "extension", platform: "unsupported" });
|
|
456
|
+
return this.platformTabs = t.map(({ platform: i }) => i), t;
|
|
457
|
+
}
|
|
458
|
+
onTabChange(t) {
|
|
459
|
+
const i = this.platformTabs[t];
|
|
460
|
+
i && this.onSelectPlatfrom?.(i);
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
Mt([
|
|
464
|
+
d({ type: Array })
|
|
465
|
+
], Qe.prototype, "platforms", void 0);
|
|
466
|
+
Mt([
|
|
467
|
+
d()
|
|
468
|
+
], Qe.prototype, "onSelectPlatfrom", void 0);
|
|
469
|
+
Qe = Mt([
|
|
470
|
+
O("w3m-connecting-header")
|
|
471
|
+
], Qe);
|
|
472
|
+
const ui = j`
|
|
473
|
+
:host {
|
|
474
|
+
width: var(--local-width);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
button {
|
|
478
|
+
width: var(--local-width);
|
|
479
|
+
white-space: nowrap;
|
|
480
|
+
column-gap: ${({ spacing: e }) => e[2]};
|
|
481
|
+
transition:
|
|
482
|
+
scale ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-1"]},
|
|
483
|
+
background-color ${({ durations: e }) => e.lg}
|
|
484
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
485
|
+
border-radius ${({ durations: e }) => e.lg}
|
|
486
|
+
${({ easings: e }) => e["ease-out-power-1"]};
|
|
487
|
+
will-change: scale, background-color, border-radius;
|
|
488
|
+
cursor: pointer;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/* -- Sizes --------------------------------------------------- */
|
|
492
|
+
button[data-size='sm'] {
|
|
493
|
+
border-radius: ${({ borderRadius: e }) => e[2]};
|
|
494
|
+
padding: 0 ${({ spacing: e }) => e[2]};
|
|
495
|
+
height: 28px;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
button[data-size='md'] {
|
|
499
|
+
border-radius: ${({ borderRadius: e }) => e[3]};
|
|
500
|
+
padding: 0 ${({ spacing: e }) => e[4]};
|
|
501
|
+
height: 38px;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
button[data-size='lg'] {
|
|
505
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
506
|
+
padding: 0 ${({ spacing: e }) => e[5]};
|
|
507
|
+
height: 48px;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/* -- Variants --------------------------------------------------------- */
|
|
511
|
+
button[data-variant='accent-primary'] {
|
|
512
|
+
background-color: ${({ tokens: e }) => e.core.backgroundAccentPrimary};
|
|
513
|
+
color: ${({ tokens: e }) => e.theme.textInvert};
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
button[data-variant='accent-secondary'] {
|
|
517
|
+
background-color: ${({ tokens: e }) => e.core.foregroundAccent010};
|
|
518
|
+
color: ${({ tokens: e }) => e.core.textAccentPrimary};
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
button[data-variant='neutral-primary'] {
|
|
522
|
+
background-color: ${({ tokens: e }) => e.theme.backgroundInvert};
|
|
523
|
+
color: ${({ tokens: e }) => e.theme.textInvert};
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
button[data-variant='neutral-secondary'] {
|
|
527
|
+
background-color: transparent;
|
|
528
|
+
border: 1px solid ${({ tokens: e }) => e.theme.borderSecondary};
|
|
529
|
+
color: ${({ tokens: e }) => e.theme.textPrimary};
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
button[data-variant='neutral-tertiary'] {
|
|
533
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
534
|
+
color: ${({ tokens: e }) => e.theme.textPrimary};
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
button[data-variant='error-primary'] {
|
|
538
|
+
background-color: ${({ tokens: e }) => e.core.textError};
|
|
539
|
+
color: ${({ tokens: e }) => e.theme.textInvert};
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
button[data-variant='error-secondary'] {
|
|
543
|
+
background-color: ${({ tokens: e }) => e.core.backgroundError};
|
|
544
|
+
color: ${({ tokens: e }) => e.core.textError};
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
button[data-variant='shade'] {
|
|
548
|
+
background: var(--wui-color-gray-glass-002);
|
|
549
|
+
color: var(--wui-color-fg-200);
|
|
550
|
+
border: none;
|
|
551
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
/* -- Focus states --------------------------------------------------- */
|
|
555
|
+
button[data-size='sm']:focus-visible:enabled {
|
|
556
|
+
border-radius: 28px;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
button[data-size='md']:focus-visible:enabled {
|
|
560
|
+
border-radius: 38px;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
button[data-size='lg']:focus-visible:enabled {
|
|
564
|
+
border-radius: 48px;
|
|
565
|
+
}
|
|
566
|
+
button[data-variant='shade']:focus-visible:enabled {
|
|
567
|
+
background: var(--wui-color-gray-glass-005);
|
|
568
|
+
box-shadow:
|
|
569
|
+
inset 0 0 0 1px var(--wui-color-gray-glass-010),
|
|
570
|
+
0 0 0 4px var(--wui-color-gray-glass-002);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
574
|
+
@media (hover: hover) {
|
|
575
|
+
button[data-size='sm']:hover:enabled {
|
|
576
|
+
border-radius: 28px;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
button[data-size='md']:hover:enabled {
|
|
580
|
+
border-radius: 38px;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
button[data-size='lg']:hover:enabled {
|
|
584
|
+
border-radius: 48px;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
button[data-variant='shade']:hover:enabled {
|
|
588
|
+
background: var(--wui-color-gray-glass-002);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
button[data-variant='shade']:active:enabled {
|
|
592
|
+
background: var(--wui-color-gray-glass-005);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
button[data-size='sm']:active:enabled {
|
|
597
|
+
border-radius: 28px;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
button[data-size='md']:active:enabled {
|
|
601
|
+
border-radius: 38px;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
button[data-size='lg']:active:enabled {
|
|
605
|
+
border-radius: 48px;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/* -- Disabled states --------------------------------------------------- */
|
|
609
|
+
button:disabled {
|
|
610
|
+
opacity: 0.3;
|
|
611
|
+
}
|
|
612
|
+
`;
|
|
613
|
+
var Te = function(e, t, i, r) {
|
|
614
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
615
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
616
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
617
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
618
|
+
};
|
|
619
|
+
const di = {
|
|
620
|
+
lg: "lg-regular-mono",
|
|
621
|
+
md: "md-regular-mono",
|
|
622
|
+
sm: "sm-regular-mono"
|
|
623
|
+
}, hi = {
|
|
624
|
+
lg: "md",
|
|
625
|
+
md: "md",
|
|
626
|
+
sm: "sm"
|
|
627
|
+
};
|
|
628
|
+
let ue = class extends M {
|
|
629
|
+
constructor() {
|
|
630
|
+
super(...arguments), this.size = "lg", this.disabled = !1, this.fullWidth = !1, this.loading = !1, this.variant = "accent-primary";
|
|
631
|
+
}
|
|
632
|
+
render() {
|
|
633
|
+
this.style.cssText = `
|
|
634
|
+
--local-width: ${this.fullWidth ? "100%" : "auto"};
|
|
635
|
+
`;
|
|
636
|
+
const t = this.textVariant ?? di[this.size];
|
|
637
|
+
return u`
|
|
638
|
+
<button data-variant=${this.variant} data-size=${this.size} ?disabled=${this.disabled}>
|
|
639
|
+
${this.loadingTemplate()}
|
|
640
|
+
<slot name="iconLeft"></slot>
|
|
641
|
+
<wui-text variant=${t} color="inherit">
|
|
642
|
+
<slot></slot>
|
|
643
|
+
</wui-text>
|
|
644
|
+
<slot name="iconRight"></slot>
|
|
645
|
+
</button>
|
|
646
|
+
`;
|
|
647
|
+
}
|
|
648
|
+
loadingTemplate() {
|
|
649
|
+
if (this.loading) {
|
|
650
|
+
const t = hi[this.size], i = this.variant === "neutral-primary" || this.variant === "accent-primary" ? "invert" : "primary";
|
|
651
|
+
return u`<wui-loading-spinner color=${i} size=${t}></wui-loading-spinner>`;
|
|
652
|
+
}
|
|
653
|
+
return null;
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
ue.styles = [G, he, ui];
|
|
657
|
+
Te([
|
|
658
|
+
d()
|
|
659
|
+
], ue.prototype, "size", void 0);
|
|
660
|
+
Te([
|
|
661
|
+
d({ type: Boolean })
|
|
662
|
+
], ue.prototype, "disabled", void 0);
|
|
663
|
+
Te([
|
|
664
|
+
d({ type: Boolean })
|
|
665
|
+
], ue.prototype, "fullWidth", void 0);
|
|
666
|
+
Te([
|
|
667
|
+
d({ type: Boolean })
|
|
668
|
+
], ue.prototype, "loading", void 0);
|
|
669
|
+
Te([
|
|
670
|
+
d()
|
|
671
|
+
], ue.prototype, "variant", void 0);
|
|
672
|
+
Te([
|
|
673
|
+
d()
|
|
674
|
+
], ue.prototype, "textVariant", void 0);
|
|
675
|
+
ue = Te([
|
|
676
|
+
O("wui-button")
|
|
677
|
+
], ue);
|
|
678
|
+
const fi = j`
|
|
679
|
+
:host {
|
|
680
|
+
display: block;
|
|
681
|
+
width: 100px;
|
|
682
|
+
height: 100px;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
svg {
|
|
686
|
+
width: 100px;
|
|
687
|
+
height: 100px;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
rect {
|
|
691
|
+
fill: none;
|
|
692
|
+
stroke: ${(e) => e.colors.accent100};
|
|
693
|
+
stroke-width: 3px;
|
|
694
|
+
stroke-linecap: round;
|
|
695
|
+
animation: dash 1s linear infinite;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
@keyframes dash {
|
|
699
|
+
to {
|
|
700
|
+
stroke-dashoffset: 0px;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
`;
|
|
704
|
+
var Nn = function(e, t, i, r) {
|
|
705
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
706
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
707
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
708
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
709
|
+
};
|
|
710
|
+
let Ye = class extends M {
|
|
711
|
+
constructor() {
|
|
712
|
+
super(...arguments), this.radius = 36;
|
|
713
|
+
}
|
|
714
|
+
render() {
|
|
715
|
+
return this.svgLoaderTemplate();
|
|
716
|
+
}
|
|
717
|
+
svgLoaderTemplate() {
|
|
718
|
+
const t = this.radius > 50 ? 50 : this.radius, r = 36 - t, o = 116 + r, n = 245 + r, s = 360 + r * 1.75;
|
|
719
|
+
return u`
|
|
720
|
+
<svg viewBox="0 0 110 110" width="110" height="110">
|
|
721
|
+
<rect
|
|
722
|
+
x="2"
|
|
723
|
+
y="2"
|
|
724
|
+
width="106"
|
|
725
|
+
height="106"
|
|
726
|
+
rx=${t}
|
|
727
|
+
stroke-dasharray="${o} ${n}"
|
|
728
|
+
stroke-dashoffset=${s}
|
|
729
|
+
/>
|
|
730
|
+
</svg>
|
|
731
|
+
`;
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
Ye.styles = [G, fi];
|
|
735
|
+
Nn([
|
|
736
|
+
d({ type: Number })
|
|
737
|
+
], Ye.prototype, "radius", void 0);
|
|
738
|
+
Ye = Nn([
|
|
739
|
+
O("wui-loading-thumbnail")
|
|
740
|
+
], Ye);
|
|
741
|
+
const pi = j`
|
|
742
|
+
wui-flex {
|
|
743
|
+
width: 100%;
|
|
744
|
+
height: 52px;
|
|
745
|
+
box-sizing: border-box;
|
|
746
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
747
|
+
border-radius: ${({ borderRadius: e }) => e[5]};
|
|
748
|
+
padding-left: ${({ spacing: e }) => e[3]};
|
|
749
|
+
padding-right: ${({ spacing: e }) => e[3]};
|
|
750
|
+
display: flex;
|
|
751
|
+
align-items: center;
|
|
752
|
+
justify-content: space-between;
|
|
753
|
+
gap: ${({ spacing: e }) => e[6]};
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
wui-text {
|
|
757
|
+
color: ${({ tokens: e }) => e.theme.textSecondary};
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
wui-icon {
|
|
761
|
+
width: 12px;
|
|
762
|
+
height: 12px;
|
|
763
|
+
}
|
|
764
|
+
`;
|
|
765
|
+
var ot = function(e, t, i, r) {
|
|
766
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
767
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
768
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
769
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
770
|
+
};
|
|
771
|
+
let Be = class extends M {
|
|
772
|
+
constructor() {
|
|
773
|
+
super(...arguments), this.disabled = !1, this.label = "", this.buttonLabel = "";
|
|
774
|
+
}
|
|
775
|
+
render() {
|
|
776
|
+
return u`
|
|
777
|
+
<wui-flex justifyContent="space-between" alignItems="center">
|
|
778
|
+
<wui-text variant="lg-regular" color="inherit">${this.label}</wui-text>
|
|
779
|
+
<wui-button variant="accent-secondary" size="sm">
|
|
780
|
+
${this.buttonLabel}
|
|
781
|
+
<wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon>
|
|
782
|
+
</wui-button>
|
|
783
|
+
</wui-flex>
|
|
784
|
+
`;
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
Be.styles = [G, he, pi];
|
|
788
|
+
ot([
|
|
789
|
+
d({ type: Boolean })
|
|
790
|
+
], Be.prototype, "disabled", void 0);
|
|
791
|
+
ot([
|
|
792
|
+
d()
|
|
793
|
+
], Be.prototype, "label", void 0);
|
|
794
|
+
ot([
|
|
795
|
+
d()
|
|
796
|
+
], Be.prototype, "buttonLabel", void 0);
|
|
797
|
+
Be = ot([
|
|
798
|
+
O("wui-cta-button")
|
|
799
|
+
], Be);
|
|
800
|
+
const gi = j`
|
|
801
|
+
:host {
|
|
802
|
+
display: block;
|
|
803
|
+
padding: 0 ${({ spacing: e }) => e[5]} ${({ spacing: e }) => e[5]};
|
|
804
|
+
}
|
|
805
|
+
`;
|
|
806
|
+
var On = function(e, t, i, r) {
|
|
807
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
808
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
809
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
810
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
811
|
+
};
|
|
812
|
+
let Je = class extends M {
|
|
813
|
+
constructor() {
|
|
814
|
+
super(...arguments), this.wallet = void 0;
|
|
815
|
+
}
|
|
816
|
+
render() {
|
|
817
|
+
if (!this.wallet)
|
|
818
|
+
return this.style.display = "none", null;
|
|
819
|
+
const { name: t, app_store: i, play_store: r, chrome_store: o, homepage: n } = this.wallet, s = P.isMobile(), a = P.isIos(), l = P.isAndroid(), c = [i, r, n, o].filter(Boolean).length > 1, w = ce.getTruncateString({
|
|
820
|
+
string: t,
|
|
821
|
+
charsStart: 12,
|
|
822
|
+
charsEnd: 0,
|
|
823
|
+
truncate: "end"
|
|
824
|
+
});
|
|
825
|
+
return c && !s ? u`
|
|
826
|
+
<wui-cta-button
|
|
827
|
+
label=${`Don't have ${w}?`}
|
|
828
|
+
buttonLabel="Get"
|
|
829
|
+
@click=${() => B.push("Downloads", { wallet: this.wallet })}
|
|
830
|
+
></wui-cta-button>
|
|
831
|
+
` : !c && n ? u`
|
|
832
|
+
<wui-cta-button
|
|
833
|
+
label=${`Don't have ${w}?`}
|
|
834
|
+
buttonLabel="Get"
|
|
835
|
+
@click=${this.onHomePage.bind(this)}
|
|
836
|
+
></wui-cta-button>
|
|
837
|
+
` : i && a ? u`
|
|
838
|
+
<wui-cta-button
|
|
839
|
+
label=${`Don't have ${w}?`}
|
|
840
|
+
buttonLabel="Get"
|
|
841
|
+
@click=${this.onAppStore.bind(this)}
|
|
842
|
+
></wui-cta-button>
|
|
843
|
+
` : r && l ? u`
|
|
844
|
+
<wui-cta-button
|
|
845
|
+
label=${`Don't have ${w}?`}
|
|
846
|
+
buttonLabel="Get"
|
|
847
|
+
@click=${this.onPlayStore.bind(this)}
|
|
848
|
+
></wui-cta-button>
|
|
849
|
+
` : (this.style.display = "none", null);
|
|
850
|
+
}
|
|
851
|
+
onAppStore() {
|
|
852
|
+
this.wallet?.app_store && P.openHref(this.wallet.app_store, "_blank");
|
|
853
|
+
}
|
|
854
|
+
onPlayStore() {
|
|
855
|
+
this.wallet?.play_store && P.openHref(this.wallet.play_store, "_blank");
|
|
856
|
+
}
|
|
857
|
+
onHomePage() {
|
|
858
|
+
this.wallet?.homepage && P.openHref(this.wallet.homepage, "_blank");
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
Je.styles = [gi];
|
|
862
|
+
On([
|
|
863
|
+
d({ type: Object })
|
|
864
|
+
], Je.prototype, "wallet", void 0);
|
|
865
|
+
Je = On([
|
|
866
|
+
O("w3m-mobile-download-links")
|
|
867
|
+
], Je);
|
|
868
|
+
const mi = j`
|
|
869
|
+
@keyframes shake {
|
|
870
|
+
0% {
|
|
871
|
+
transform: translateX(0);
|
|
872
|
+
}
|
|
873
|
+
25% {
|
|
874
|
+
transform: translateX(3px);
|
|
875
|
+
}
|
|
876
|
+
50% {
|
|
877
|
+
transform: translateX(-3px);
|
|
878
|
+
}
|
|
879
|
+
75% {
|
|
880
|
+
transform: translateX(3px);
|
|
881
|
+
}
|
|
882
|
+
100% {
|
|
883
|
+
transform: translateX(0);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
wui-flex:first-child:not(:only-child) {
|
|
888
|
+
position: relative;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
wui-wallet-image {
|
|
892
|
+
width: 56px;
|
|
893
|
+
height: 56px;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
wui-loading-thumbnail {
|
|
897
|
+
position: absolute;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
wui-icon-box {
|
|
901
|
+
position: absolute;
|
|
902
|
+
right: calc(${({ spacing: e }) => e[1]} * -1);
|
|
903
|
+
bottom: calc(${({ spacing: e }) => e[1]} * -1);
|
|
904
|
+
opacity: 0;
|
|
905
|
+
transform: scale(0.5);
|
|
906
|
+
transition-property: opacity, transform;
|
|
907
|
+
transition-duration: ${({ durations: e }) => e.lg};
|
|
908
|
+
transition-timing-function: ${({ easings: e }) => e["ease-out-power-2"]};
|
|
909
|
+
will-change: opacity, transform;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
wui-text[align='center'] {
|
|
913
|
+
width: 100%;
|
|
914
|
+
padding: 0px ${({ spacing: e }) => e[4]};
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
[data-error='true'] wui-icon-box {
|
|
918
|
+
opacity: 1;
|
|
919
|
+
transform: scale(1);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
[data-error='true'] > wui-flex:first-child {
|
|
923
|
+
animation: shake 250ms ${({ easings: e }) => e["ease-out-power-2"]} both;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
[data-retry='false'] wui-link {
|
|
927
|
+
display: none;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
[data-retry='true'] wui-link {
|
|
931
|
+
display: block;
|
|
932
|
+
opacity: 1;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
w3m-mobile-download-links {
|
|
936
|
+
padding: 0px;
|
|
937
|
+
width: 100%;
|
|
938
|
+
}
|
|
939
|
+
`;
|
|
940
|
+
var ee = function(e, t, i, r) {
|
|
941
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
942
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
943
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
944
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
945
|
+
};
|
|
946
|
+
class U extends M {
|
|
947
|
+
constructor() {
|
|
948
|
+
super(), this.wallet = B.state.data?.wallet, this.connector = B.state.data?.connector, this.timeout = void 0, this.secondaryBtnIcon = "refresh", this.onConnect = void 0, this.onRender = void 0, this.onAutoConnect = void 0, this.isWalletConnect = !0, this.unsubscribe = [], this.imageSrc = we.getConnectorImage(this.connector) ?? we.getWalletImage(this.wallet), this.name = this.wallet?.name ?? this.connector?.name ?? "Wallet", this.isRetrying = !1, this.uri = L.state.wcUri, this.error = L.state.wcError, this.ready = !1, this.showRetry = !1, this.label = void 0, this.secondaryBtnLabel = "Try again", this.secondaryLabel = "Accept connection request in the wallet", this.isLoading = !1, this.isMobile = !1, this.onRetry = void 0, this.unsubscribe.push(L.subscribeKey("wcUri", (t) => {
|
|
949
|
+
this.uri = t, this.isRetrying && this.onRetry && (this.isRetrying = !1, this.onConnect?.());
|
|
950
|
+
}), L.subscribeKey("wcError", (t) => this.error = t)), (P.isTelegram() || P.isSafari()) && P.isIos() && L.state.wcUri && this.onConnect?.();
|
|
951
|
+
}
|
|
952
|
+
firstUpdated() {
|
|
953
|
+
this.onAutoConnect?.(), this.showRetry = !this.onAutoConnect;
|
|
954
|
+
}
|
|
955
|
+
disconnectedCallback() {
|
|
956
|
+
this.unsubscribe.forEach((t) => t()), L.setWcError(!1), clearTimeout(this.timeout);
|
|
957
|
+
}
|
|
958
|
+
render() {
|
|
959
|
+
this.onRender?.(), this.onShowRetry();
|
|
960
|
+
const t = this.error ? "Connection can be declined if a previous request is still active" : this.secondaryLabel;
|
|
961
|
+
let i = "";
|
|
962
|
+
return this.label ? i = this.label : (i = `Continue in ${this.name}`, this.error && (i = "Connection declined")), u`
|
|
963
|
+
<wui-flex
|
|
964
|
+
data-error=${z(this.error)}
|
|
965
|
+
data-retry=${this.showRetry}
|
|
966
|
+
flexDirection="column"
|
|
967
|
+
alignItems="center"
|
|
968
|
+
.padding=${["10", "5", "5", "5"]}
|
|
969
|
+
gap="6"
|
|
970
|
+
>
|
|
971
|
+
<wui-flex gap="2" justifyContent="center" alignItems="center">
|
|
972
|
+
<wui-wallet-image size="lg" imageSrc=${z(this.imageSrc)}></wui-wallet-image>
|
|
973
|
+
|
|
974
|
+
${this.error ? null : this.loaderTemplate()}
|
|
975
|
+
|
|
976
|
+
<wui-icon-box
|
|
977
|
+
color="error"
|
|
978
|
+
icon="close"
|
|
979
|
+
size="sm"
|
|
980
|
+
border
|
|
981
|
+
borderColor="wui-color-bg-125"
|
|
982
|
+
></wui-icon-box>
|
|
983
|
+
</wui-flex>
|
|
984
|
+
|
|
985
|
+
<wui-flex flexDirection="column" alignItems="center" gap="6"> <wui-flex
|
|
986
|
+
flexDirection="column"
|
|
987
|
+
alignItems="center"
|
|
988
|
+
gap="2"
|
|
989
|
+
.padding=${["2", "0", "0", "0"]}
|
|
990
|
+
>
|
|
991
|
+
<wui-text align="center" variant="lg-medium" color=${this.error ? "error" : "primary"}>
|
|
992
|
+
${i}
|
|
993
|
+
</wui-text>
|
|
994
|
+
<wui-text align="center" variant="lg-regular" color="secondary">${t}</wui-text>
|
|
995
|
+
</wui-flex>
|
|
996
|
+
|
|
997
|
+
${this.secondaryBtnLabel ? u`
|
|
998
|
+
<wui-button
|
|
999
|
+
variant="neutral-secondary"
|
|
1000
|
+
size="md"
|
|
1001
|
+
?disabled=${this.isRetrying || this.isLoading}
|
|
1002
|
+
@click=${this.onTryAgain.bind(this)}
|
|
1003
|
+
data-testid="w3m-connecting-widget-secondary-button"
|
|
1004
|
+
>
|
|
1005
|
+
<wui-icon
|
|
1006
|
+
color="inherit"
|
|
1007
|
+
slot="iconLeft"
|
|
1008
|
+
name=${this.secondaryBtnIcon}
|
|
1009
|
+
></wui-icon>
|
|
1010
|
+
${this.secondaryBtnLabel}
|
|
1011
|
+
</wui-button>
|
|
1012
|
+
` : null}
|
|
1013
|
+
</wui-flex>
|
|
1014
|
+
|
|
1015
|
+
${this.isWalletConnect ? u`
|
|
1016
|
+
<wui-flex .padding=${["0", "5", "5", "5"]} justifyContent="center">
|
|
1017
|
+
<wui-link
|
|
1018
|
+
@click=${this.onCopyUri}
|
|
1019
|
+
variant="secondary"
|
|
1020
|
+
icon="copy"
|
|
1021
|
+
data-testid="wui-link-copy"
|
|
1022
|
+
>
|
|
1023
|
+
Copy link
|
|
1024
|
+
</wui-link>
|
|
1025
|
+
</wui-flex>
|
|
1026
|
+
` : null}
|
|
1027
|
+
|
|
1028
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links></wui-flex>
|
|
1029
|
+
</wui-flex>
|
|
1030
|
+
`;
|
|
1031
|
+
}
|
|
1032
|
+
onShowRetry() {
|
|
1033
|
+
this.error && !this.showRetry && (this.showRetry = !0, this.shadowRoot?.querySelector("wui-button")?.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
1034
|
+
fill: "forwards",
|
|
1035
|
+
easing: "ease"
|
|
1036
|
+
}));
|
|
1037
|
+
}
|
|
1038
|
+
onTryAgain() {
|
|
1039
|
+
L.setWcError(!1), this.onRetry ? (this.isRetrying = !0, this.onRetry?.()) : this.onConnect?.();
|
|
1040
|
+
}
|
|
1041
|
+
loaderTemplate() {
|
|
1042
|
+
const t = Nt.state.themeVariables["--w3m-border-radius-master"], i = t ? parseInt(t.replace("px", ""), 10) : 4;
|
|
1043
|
+
return u`<wui-loading-thumbnail radius=${i * 9}></wui-loading-thumbnail>`;
|
|
1044
|
+
}
|
|
1045
|
+
onCopyUri() {
|
|
1046
|
+
try {
|
|
1047
|
+
this.uri && (P.copyToClopboard(this.uri), je.showSuccess("Link copied"));
|
|
1048
|
+
} catch {
|
|
1049
|
+
je.showError("Failed to copy");
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
U.styles = mi;
|
|
1054
|
+
ee([
|
|
1055
|
+
_()
|
|
1056
|
+
], U.prototype, "isRetrying", void 0);
|
|
1057
|
+
ee([
|
|
1058
|
+
_()
|
|
1059
|
+
], U.prototype, "uri", void 0);
|
|
1060
|
+
ee([
|
|
1061
|
+
_()
|
|
1062
|
+
], U.prototype, "error", void 0);
|
|
1063
|
+
ee([
|
|
1064
|
+
_()
|
|
1065
|
+
], U.prototype, "ready", void 0);
|
|
1066
|
+
ee([
|
|
1067
|
+
_()
|
|
1068
|
+
], U.prototype, "showRetry", void 0);
|
|
1069
|
+
ee([
|
|
1070
|
+
_()
|
|
1071
|
+
], U.prototype, "label", void 0);
|
|
1072
|
+
ee([
|
|
1073
|
+
_()
|
|
1074
|
+
], U.prototype, "secondaryBtnLabel", void 0);
|
|
1075
|
+
ee([
|
|
1076
|
+
_()
|
|
1077
|
+
], U.prototype, "secondaryLabel", void 0);
|
|
1078
|
+
ee([
|
|
1079
|
+
_()
|
|
1080
|
+
], U.prototype, "isLoading", void 0);
|
|
1081
|
+
ee([
|
|
1082
|
+
d({ type: Boolean })
|
|
1083
|
+
], U.prototype, "isMobile", void 0);
|
|
1084
|
+
ee([
|
|
1085
|
+
d()
|
|
1086
|
+
], U.prototype, "onRetry", void 0);
|
|
1087
|
+
var wi = function(e, t, i, r) {
|
|
1088
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
1089
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
1090
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
1091
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
1092
|
+
};
|
|
1093
|
+
let Yt = class extends U {
|
|
1094
|
+
constructor() {
|
|
1095
|
+
if (super(), !this.wallet)
|
|
1096
|
+
throw new Error("w3m-connecting-wc-browser: No wallet provided");
|
|
1097
|
+
this.onConnect = this.onConnectProxy.bind(this), this.onAutoConnect = this.onConnectProxy.bind(this), F.sendEvent({
|
|
1098
|
+
type: "track",
|
|
1099
|
+
event: "SELECT_WALLET",
|
|
1100
|
+
properties: {
|
|
1101
|
+
name: this.wallet.name,
|
|
1102
|
+
platform: "browser",
|
|
1103
|
+
displayIndex: this.wallet?.display_index,
|
|
1104
|
+
walletRank: this.wallet.order,
|
|
1105
|
+
view: B.state.view
|
|
1106
|
+
}
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
async onConnectProxy() {
|
|
1110
|
+
try {
|
|
1111
|
+
this.error = !1;
|
|
1112
|
+
const { connectors: t } = H.state, i = t.find((r) => r.type === "ANNOUNCED" && r.info?.rdns === this.wallet?.rdns || r.type === "INJECTED" || r.name === this.wallet?.name);
|
|
1113
|
+
if (i)
|
|
1114
|
+
await L.connectExternal(i, i.chain);
|
|
1115
|
+
else
|
|
1116
|
+
throw new Error("w3m-connecting-wc-browser: No connector found");
|
|
1117
|
+
kn.close(), F.sendEvent({
|
|
1118
|
+
type: "track",
|
|
1119
|
+
event: "CONNECT_SUCCESS",
|
|
1120
|
+
properties: {
|
|
1121
|
+
method: "browser",
|
|
1122
|
+
name: this.wallet?.name || "Unknown",
|
|
1123
|
+
view: B.state.view,
|
|
1124
|
+
walletRank: this.wallet?.order
|
|
1125
|
+
}
|
|
1126
|
+
});
|
|
1127
|
+
} catch (t) {
|
|
1128
|
+
t instanceof An && t.originalName === Bn.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST ? F.sendEvent({
|
|
1129
|
+
type: "track",
|
|
1130
|
+
event: "USER_REJECTED",
|
|
1131
|
+
properties: { message: t.message }
|
|
1132
|
+
}) : F.sendEvent({
|
|
1133
|
+
type: "track",
|
|
1134
|
+
event: "CONNECT_ERROR",
|
|
1135
|
+
properties: { message: t?.message ?? "Unknown" }
|
|
1136
|
+
}), this.error = !0;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
Yt = wi([
|
|
1141
|
+
O("w3m-connecting-wc-browser")
|
|
1142
|
+
], Yt);
|
|
1143
|
+
var bi = function(e, t, i, r) {
|
|
1144
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
1145
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
1146
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
1147
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
1148
|
+
};
|
|
1149
|
+
let Jt = class extends U {
|
|
1150
|
+
constructor() {
|
|
1151
|
+
if (super(), !this.wallet)
|
|
1152
|
+
throw new Error("w3m-connecting-wc-desktop: No wallet provided");
|
|
1153
|
+
this.onConnect = this.onConnectProxy.bind(this), this.onRender = this.onRenderProxy.bind(this), F.sendEvent({
|
|
1154
|
+
type: "track",
|
|
1155
|
+
event: "SELECT_WALLET",
|
|
1156
|
+
properties: {
|
|
1157
|
+
name: this.wallet.name,
|
|
1158
|
+
platform: "desktop",
|
|
1159
|
+
displayIndex: this.wallet?.display_index,
|
|
1160
|
+
walletRank: this.wallet.order,
|
|
1161
|
+
view: B.state.view
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
onRenderProxy() {
|
|
1166
|
+
!this.ready && this.uri && (this.ready = !0, this.onConnect?.());
|
|
1167
|
+
}
|
|
1168
|
+
onConnectProxy() {
|
|
1169
|
+
if (this.wallet?.desktop_link && this.uri)
|
|
1170
|
+
try {
|
|
1171
|
+
this.error = !1;
|
|
1172
|
+
const { desktop_link: t, name: i } = this.wallet, { redirect: r, href: o } = P.formatNativeUrl(t, this.uri);
|
|
1173
|
+
L.setWcLinking({ name: i, href: o }), L.setRecentWallet(this.wallet), P.openHref(r, "_blank");
|
|
1174
|
+
} catch {
|
|
1175
|
+
this.error = !0;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
};
|
|
1179
|
+
Jt = bi([
|
|
1180
|
+
O("w3m-connecting-wc-desktop")
|
|
1181
|
+
], Jt);
|
|
1182
|
+
var Ne = function(e, t, i, r) {
|
|
1183
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
1184
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
1185
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
1186
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
1187
|
+
};
|
|
1188
|
+
let Ee = class extends U {
|
|
1189
|
+
constructor() {
|
|
1190
|
+
if (super(), this.btnLabelTimeout = void 0, this.redirectDeeplink = void 0, this.redirectUniversalLink = void 0, this.target = void 0, this.preferUniversalLinks = q.state.experimental_preferUniversalLinks, this.isLoading = !0, this.onConnect = () => {
|
|
1191
|
+
if (this.wallet?.mobile_link && this.uri)
|
|
1192
|
+
try {
|
|
1193
|
+
this.error = !1;
|
|
1194
|
+
const { mobile_link: t, link_mode: i, name: r } = this.wallet, { redirect: o, redirectUniversalLink: n, href: s } = P.formatNativeUrl(t, this.uri, i);
|
|
1195
|
+
this.redirectDeeplink = o, this.redirectUniversalLink = n, this.target = P.isIframe() ? "_top" : "_self", L.setWcLinking({ name: r, href: s }), L.setRecentWallet(this.wallet), this.preferUniversalLinks && this.redirectUniversalLink ? P.openHref(this.redirectUniversalLink, this.target) : P.openHref(this.redirectDeeplink, this.target);
|
|
1196
|
+
} catch (t) {
|
|
1197
|
+
F.sendEvent({
|
|
1198
|
+
type: "track",
|
|
1199
|
+
event: "CONNECT_PROXY_ERROR",
|
|
1200
|
+
properties: {
|
|
1201
|
+
message: t instanceof Error ? t.message : "Error parsing the deeplink",
|
|
1202
|
+
uri: this.uri,
|
|
1203
|
+
mobile_link: this.wallet.mobile_link,
|
|
1204
|
+
name: this.wallet.name
|
|
1205
|
+
}
|
|
1206
|
+
}), this.error = !0;
|
|
1207
|
+
}
|
|
1208
|
+
}, !this.wallet)
|
|
1209
|
+
throw new Error("w3m-connecting-wc-mobile: No wallet provided");
|
|
1210
|
+
this.secondaryBtnLabel = "Open", this.secondaryLabel = Pn.CONNECT_LABELS.MOBILE, this.secondaryBtnIcon = "externalLink", this.onHandleURI(), this.unsubscribe.push(L.subscribeKey("wcUri", () => {
|
|
1211
|
+
this.onHandleURI();
|
|
1212
|
+
})), F.sendEvent({
|
|
1213
|
+
type: "track",
|
|
1214
|
+
event: "SELECT_WALLET",
|
|
1215
|
+
properties: {
|
|
1216
|
+
name: this.wallet.name,
|
|
1217
|
+
platform: "mobile",
|
|
1218
|
+
displayIndex: this.wallet?.display_index,
|
|
1219
|
+
walletRank: this.wallet.order,
|
|
1220
|
+
view: B.state.view
|
|
1221
|
+
}
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
disconnectedCallback() {
|
|
1225
|
+
super.disconnectedCallback(), clearTimeout(this.btnLabelTimeout);
|
|
1226
|
+
}
|
|
1227
|
+
onHandleURI() {
|
|
1228
|
+
this.isLoading = !this.uri, !this.ready && this.uri && (this.ready = !0, this.onConnect?.());
|
|
1229
|
+
}
|
|
1230
|
+
onTryAgain() {
|
|
1231
|
+
L.setWcError(!1), this.onConnect?.();
|
|
1232
|
+
}
|
|
1233
|
+
};
|
|
1234
|
+
Ne([
|
|
1235
|
+
_()
|
|
1236
|
+
], Ee.prototype, "redirectDeeplink", void 0);
|
|
1237
|
+
Ne([
|
|
1238
|
+
_()
|
|
1239
|
+
], Ee.prototype, "redirectUniversalLink", void 0);
|
|
1240
|
+
Ne([
|
|
1241
|
+
_()
|
|
1242
|
+
], Ee.prototype, "target", void 0);
|
|
1243
|
+
Ne([
|
|
1244
|
+
_()
|
|
1245
|
+
], Ee.prototype, "preferUniversalLinks", void 0);
|
|
1246
|
+
Ne([
|
|
1247
|
+
_()
|
|
1248
|
+
], Ee.prototype, "isLoading", void 0);
|
|
1249
|
+
Ee = Ne([
|
|
1250
|
+
O("w3m-connecting-wc-mobile")
|
|
1251
|
+
], Ee);
|
|
1252
|
+
var Ae = {}, dt, Xt;
|
|
1253
|
+
function yi() {
|
|
1254
|
+
return Xt || (Xt = 1, dt = function() {
|
|
1255
|
+
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
1256
|
+
}), dt;
|
|
1257
|
+
}
|
|
1258
|
+
var ht = {}, me = {}, Zt;
|
|
1259
|
+
function _e() {
|
|
1260
|
+
if (Zt) return me;
|
|
1261
|
+
Zt = 1;
|
|
1262
|
+
let e;
|
|
1263
|
+
const t = [
|
|
1264
|
+
0,
|
|
1265
|
+
// Not used
|
|
1266
|
+
26,
|
|
1267
|
+
44,
|
|
1268
|
+
70,
|
|
1269
|
+
100,
|
|
1270
|
+
134,
|
|
1271
|
+
172,
|
|
1272
|
+
196,
|
|
1273
|
+
242,
|
|
1274
|
+
292,
|
|
1275
|
+
346,
|
|
1276
|
+
404,
|
|
1277
|
+
466,
|
|
1278
|
+
532,
|
|
1279
|
+
581,
|
|
1280
|
+
655,
|
|
1281
|
+
733,
|
|
1282
|
+
815,
|
|
1283
|
+
901,
|
|
1284
|
+
991,
|
|
1285
|
+
1085,
|
|
1286
|
+
1156,
|
|
1287
|
+
1258,
|
|
1288
|
+
1364,
|
|
1289
|
+
1474,
|
|
1290
|
+
1588,
|
|
1291
|
+
1706,
|
|
1292
|
+
1828,
|
|
1293
|
+
1921,
|
|
1294
|
+
2051,
|
|
1295
|
+
2185,
|
|
1296
|
+
2323,
|
|
1297
|
+
2465,
|
|
1298
|
+
2611,
|
|
1299
|
+
2761,
|
|
1300
|
+
2876,
|
|
1301
|
+
3034,
|
|
1302
|
+
3196,
|
|
1303
|
+
3362,
|
|
1304
|
+
3532,
|
|
1305
|
+
3706
|
|
1306
|
+
];
|
|
1307
|
+
return me.getSymbolSize = function(r) {
|
|
1308
|
+
if (!r) throw new Error('"version" cannot be null or undefined');
|
|
1309
|
+
if (r < 1 || r > 40) throw new Error('"version" should be in range from 1 to 40');
|
|
1310
|
+
return r * 4 + 17;
|
|
1311
|
+
}, me.getSymbolTotalCodewords = function(r) {
|
|
1312
|
+
return t[r];
|
|
1313
|
+
}, me.getBCHDigit = function(i) {
|
|
1314
|
+
let r = 0;
|
|
1315
|
+
for (; i !== 0; )
|
|
1316
|
+
r++, i >>>= 1;
|
|
1317
|
+
return r;
|
|
1318
|
+
}, me.setToSJISFunction = function(r) {
|
|
1319
|
+
if (typeof r != "function")
|
|
1320
|
+
throw new Error('"toSJISFunc" is not a valid function.');
|
|
1321
|
+
e = r;
|
|
1322
|
+
}, me.isKanjiModeEnabled = function() {
|
|
1323
|
+
return typeof e < "u";
|
|
1324
|
+
}, me.toSJIS = function(r) {
|
|
1325
|
+
return e(r);
|
|
1326
|
+
}, me;
|
|
1327
|
+
}
|
|
1328
|
+
var ft = {}, en;
|
|
1329
|
+
function zt() {
|
|
1330
|
+
return en || (en = 1, (function(e) {
|
|
1331
|
+
e.L = { bit: 1 }, e.M = { bit: 0 }, e.Q = { bit: 3 }, e.H = { bit: 2 };
|
|
1332
|
+
function t(i) {
|
|
1333
|
+
if (typeof i != "string")
|
|
1334
|
+
throw new Error("Param is not a string");
|
|
1335
|
+
switch (i.toLowerCase()) {
|
|
1336
|
+
case "l":
|
|
1337
|
+
case "low":
|
|
1338
|
+
return e.L;
|
|
1339
|
+
case "m":
|
|
1340
|
+
case "medium":
|
|
1341
|
+
return e.M;
|
|
1342
|
+
case "q":
|
|
1343
|
+
case "quartile":
|
|
1344
|
+
return e.Q;
|
|
1345
|
+
case "h":
|
|
1346
|
+
case "high":
|
|
1347
|
+
return e.H;
|
|
1348
|
+
default:
|
|
1349
|
+
throw new Error("Unknown EC Level: " + i);
|
|
1350
|
+
}
|
|
1351
|
+
}
|
|
1352
|
+
e.isValid = function(r) {
|
|
1353
|
+
return r && typeof r.bit < "u" && r.bit >= 0 && r.bit < 4;
|
|
1354
|
+
}, e.from = function(r, o) {
|
|
1355
|
+
if (e.isValid(r))
|
|
1356
|
+
return r;
|
|
1357
|
+
try {
|
|
1358
|
+
return t(r);
|
|
1359
|
+
} catch {
|
|
1360
|
+
return o;
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
})(ft)), ft;
|
|
1364
|
+
}
|
|
1365
|
+
var pt, tn;
|
|
1366
|
+
function vi() {
|
|
1367
|
+
if (tn) return pt;
|
|
1368
|
+
tn = 1;
|
|
1369
|
+
function e() {
|
|
1370
|
+
this.buffer = [], this.length = 0;
|
|
1371
|
+
}
|
|
1372
|
+
return e.prototype = {
|
|
1373
|
+
get: function(t) {
|
|
1374
|
+
const i = Math.floor(t / 8);
|
|
1375
|
+
return (this.buffer[i] >>> 7 - t % 8 & 1) === 1;
|
|
1376
|
+
},
|
|
1377
|
+
put: function(t, i) {
|
|
1378
|
+
for (let r = 0; r < i; r++)
|
|
1379
|
+
this.putBit((t >>> i - r - 1 & 1) === 1);
|
|
1380
|
+
},
|
|
1381
|
+
getLengthInBits: function() {
|
|
1382
|
+
return this.length;
|
|
1383
|
+
},
|
|
1384
|
+
putBit: function(t) {
|
|
1385
|
+
const i = Math.floor(this.length / 8);
|
|
1386
|
+
this.buffer.length <= i && this.buffer.push(0), t && (this.buffer[i] |= 128 >>> this.length % 8), this.length++;
|
|
1387
|
+
}
|
|
1388
|
+
}, pt = e, pt;
|
|
1389
|
+
}
|
|
1390
|
+
var gt, nn;
|
|
1391
|
+
function Ci() {
|
|
1392
|
+
if (nn) return gt;
|
|
1393
|
+
nn = 1;
|
|
1394
|
+
function e(t) {
|
|
1395
|
+
if (!t || t < 1)
|
|
1396
|
+
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
1397
|
+
this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
|
|
1398
|
+
}
|
|
1399
|
+
return e.prototype.set = function(t, i, r, o) {
|
|
1400
|
+
const n = t * this.size + i;
|
|
1401
|
+
this.data[n] = r, o && (this.reservedBit[n] = !0);
|
|
1402
|
+
}, e.prototype.get = function(t, i) {
|
|
1403
|
+
return this.data[t * this.size + i];
|
|
1404
|
+
}, e.prototype.xor = function(t, i, r) {
|
|
1405
|
+
this.data[t * this.size + i] ^= r;
|
|
1406
|
+
}, e.prototype.isReserved = function(t, i) {
|
|
1407
|
+
return this.reservedBit[t * this.size + i];
|
|
1408
|
+
}, gt = e, gt;
|
|
1409
|
+
}
|
|
1410
|
+
var mt = {}, rn;
|
|
1411
|
+
function $i() {
|
|
1412
|
+
return rn || (rn = 1, (function(e) {
|
|
1413
|
+
const t = _e().getSymbolSize;
|
|
1414
|
+
e.getRowColCoords = function(r) {
|
|
1415
|
+
if (r === 1) return [];
|
|
1416
|
+
const o = Math.floor(r / 7) + 2, n = t(r), s = n === 145 ? 26 : Math.ceil((n - 13) / (2 * o - 2)) * 2, a = [n - 7];
|
|
1417
|
+
for (let l = 1; l < o - 1; l++)
|
|
1418
|
+
a[l] = a[l - 1] - s;
|
|
1419
|
+
return a.push(6), a.reverse();
|
|
1420
|
+
}, e.getPositions = function(r) {
|
|
1421
|
+
const o = [], n = e.getRowColCoords(r), s = n.length;
|
|
1422
|
+
for (let a = 0; a < s; a++)
|
|
1423
|
+
for (let l = 0; l < s; l++)
|
|
1424
|
+
a === 0 && l === 0 || // top-left
|
|
1425
|
+
a === 0 && l === s - 1 || // bottom-left
|
|
1426
|
+
a === s - 1 && l === 0 || o.push([n[a], n[l]]);
|
|
1427
|
+
return o;
|
|
1428
|
+
};
|
|
1429
|
+
})(mt)), mt;
|
|
1430
|
+
}
|
|
1431
|
+
var wt = {}, on;
|
|
1432
|
+
function xi() {
|
|
1433
|
+
if (on) return wt;
|
|
1434
|
+
on = 1;
|
|
1435
|
+
const e = _e().getSymbolSize, t = 7;
|
|
1436
|
+
return wt.getPositions = function(r) {
|
|
1437
|
+
const o = e(r);
|
|
1438
|
+
return [
|
|
1439
|
+
// top-left
|
|
1440
|
+
[0, 0],
|
|
1441
|
+
// top-right
|
|
1442
|
+
[o - t, 0],
|
|
1443
|
+
// bottom-left
|
|
1444
|
+
[0, o - t]
|
|
1445
|
+
];
|
|
1446
|
+
}, wt;
|
|
1447
|
+
}
|
|
1448
|
+
var bt = {}, sn;
|
|
1449
|
+
function Ei() {
|
|
1450
|
+
return sn || (sn = 1, (function(e) {
|
|
1451
|
+
e.Patterns = {
|
|
1452
|
+
PATTERN000: 0,
|
|
1453
|
+
PATTERN001: 1,
|
|
1454
|
+
PATTERN010: 2,
|
|
1455
|
+
PATTERN011: 3,
|
|
1456
|
+
PATTERN100: 4,
|
|
1457
|
+
PATTERN101: 5,
|
|
1458
|
+
PATTERN110: 6,
|
|
1459
|
+
PATTERN111: 7
|
|
1460
|
+
};
|
|
1461
|
+
const t = {
|
|
1462
|
+
N1: 3,
|
|
1463
|
+
N2: 3,
|
|
1464
|
+
N3: 40,
|
|
1465
|
+
N4: 10
|
|
1466
|
+
};
|
|
1467
|
+
e.isValid = function(o) {
|
|
1468
|
+
return o != null && o !== "" && !isNaN(o) && o >= 0 && o <= 7;
|
|
1469
|
+
}, e.from = function(o) {
|
|
1470
|
+
return e.isValid(o) ? parseInt(o, 10) : void 0;
|
|
1471
|
+
}, e.getPenaltyN1 = function(o) {
|
|
1472
|
+
const n = o.size;
|
|
1473
|
+
let s = 0, a = 0, l = 0, c = null, w = null;
|
|
1474
|
+
for (let E = 0; E < n; E++) {
|
|
1475
|
+
a = l = 0, c = w = null;
|
|
1476
|
+
for (let $ = 0; $ < n; $++) {
|
|
1477
|
+
let m = o.get(E, $);
|
|
1478
|
+
m === c ? a++ : (a >= 5 && (s += t.N1 + (a - 5)), c = m, a = 1), m = o.get($, E), m === w ? l++ : (l >= 5 && (s += t.N1 + (l - 5)), w = m, l = 1);
|
|
1479
|
+
}
|
|
1480
|
+
a >= 5 && (s += t.N1 + (a - 5)), l >= 5 && (s += t.N1 + (l - 5));
|
|
1481
|
+
}
|
|
1482
|
+
return s;
|
|
1483
|
+
}, e.getPenaltyN2 = function(o) {
|
|
1484
|
+
const n = o.size;
|
|
1485
|
+
let s = 0;
|
|
1486
|
+
for (let a = 0; a < n - 1; a++)
|
|
1487
|
+
for (let l = 0; l < n - 1; l++) {
|
|
1488
|
+
const c = o.get(a, l) + o.get(a, l + 1) + o.get(a + 1, l) + o.get(a + 1, l + 1);
|
|
1489
|
+
(c === 4 || c === 0) && s++;
|
|
1490
|
+
}
|
|
1491
|
+
return s * t.N2;
|
|
1492
|
+
}, e.getPenaltyN3 = function(o) {
|
|
1493
|
+
const n = o.size;
|
|
1494
|
+
let s = 0, a = 0, l = 0;
|
|
1495
|
+
for (let c = 0; c < n; c++) {
|
|
1496
|
+
a = l = 0;
|
|
1497
|
+
for (let w = 0; w < n; w++)
|
|
1498
|
+
a = a << 1 & 2047 | o.get(c, w), w >= 10 && (a === 1488 || a === 93) && s++, l = l << 1 & 2047 | o.get(w, c), w >= 10 && (l === 1488 || l === 93) && s++;
|
|
1499
|
+
}
|
|
1500
|
+
return s * t.N3;
|
|
1501
|
+
}, e.getPenaltyN4 = function(o) {
|
|
1502
|
+
let n = 0;
|
|
1503
|
+
const s = o.data.length;
|
|
1504
|
+
for (let l = 0; l < s; l++) n += o.data[l];
|
|
1505
|
+
return Math.abs(Math.ceil(n * 100 / s / 5) - 10) * t.N4;
|
|
1506
|
+
};
|
|
1507
|
+
function i(r, o, n) {
|
|
1508
|
+
switch (r) {
|
|
1509
|
+
case e.Patterns.PATTERN000:
|
|
1510
|
+
return (o + n) % 2 === 0;
|
|
1511
|
+
case e.Patterns.PATTERN001:
|
|
1512
|
+
return o % 2 === 0;
|
|
1513
|
+
case e.Patterns.PATTERN010:
|
|
1514
|
+
return n % 3 === 0;
|
|
1515
|
+
case e.Patterns.PATTERN011:
|
|
1516
|
+
return (o + n) % 3 === 0;
|
|
1517
|
+
case e.Patterns.PATTERN100:
|
|
1518
|
+
return (Math.floor(o / 2) + Math.floor(n / 3)) % 2 === 0;
|
|
1519
|
+
case e.Patterns.PATTERN101:
|
|
1520
|
+
return o * n % 2 + o * n % 3 === 0;
|
|
1521
|
+
case e.Patterns.PATTERN110:
|
|
1522
|
+
return (o * n % 2 + o * n % 3) % 2 === 0;
|
|
1523
|
+
case e.Patterns.PATTERN111:
|
|
1524
|
+
return (o * n % 3 + (o + n) % 2) % 2 === 0;
|
|
1525
|
+
default:
|
|
1526
|
+
throw new Error("bad maskPattern:" + r);
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
e.applyMask = function(o, n) {
|
|
1530
|
+
const s = n.size;
|
|
1531
|
+
for (let a = 0; a < s; a++)
|
|
1532
|
+
for (let l = 0; l < s; l++)
|
|
1533
|
+
n.isReserved(l, a) || n.xor(l, a, i(o, l, a));
|
|
1534
|
+
}, e.getBestMask = function(o, n) {
|
|
1535
|
+
const s = Object.keys(e.Patterns).length;
|
|
1536
|
+
let a = 0, l = 1 / 0;
|
|
1537
|
+
for (let c = 0; c < s; c++) {
|
|
1538
|
+
n(c), e.applyMask(c, o);
|
|
1539
|
+
const w = e.getPenaltyN1(o) + e.getPenaltyN2(o) + e.getPenaltyN3(o) + e.getPenaltyN4(o);
|
|
1540
|
+
e.applyMask(c, o), w < l && (l = w, a = c);
|
|
1541
|
+
}
|
|
1542
|
+
return a;
|
|
1543
|
+
};
|
|
1544
|
+
})(bt)), bt;
|
|
1545
|
+
}
|
|
1546
|
+
var He = {}, an;
|
|
1547
|
+
function Dn() {
|
|
1548
|
+
if (an) return He;
|
|
1549
|
+
an = 1;
|
|
1550
|
+
const e = zt(), t = [
|
|
1551
|
+
// L M Q H
|
|
1552
|
+
1,
|
|
1553
|
+
1,
|
|
1554
|
+
1,
|
|
1555
|
+
1,
|
|
1556
|
+
1,
|
|
1557
|
+
1,
|
|
1558
|
+
1,
|
|
1559
|
+
1,
|
|
1560
|
+
1,
|
|
1561
|
+
1,
|
|
1562
|
+
2,
|
|
1563
|
+
2,
|
|
1564
|
+
1,
|
|
1565
|
+
2,
|
|
1566
|
+
2,
|
|
1567
|
+
4,
|
|
1568
|
+
1,
|
|
1569
|
+
2,
|
|
1570
|
+
4,
|
|
1571
|
+
4,
|
|
1572
|
+
2,
|
|
1573
|
+
4,
|
|
1574
|
+
4,
|
|
1575
|
+
4,
|
|
1576
|
+
2,
|
|
1577
|
+
4,
|
|
1578
|
+
6,
|
|
1579
|
+
5,
|
|
1580
|
+
2,
|
|
1581
|
+
4,
|
|
1582
|
+
6,
|
|
1583
|
+
6,
|
|
1584
|
+
2,
|
|
1585
|
+
5,
|
|
1586
|
+
8,
|
|
1587
|
+
8,
|
|
1588
|
+
4,
|
|
1589
|
+
5,
|
|
1590
|
+
8,
|
|
1591
|
+
8,
|
|
1592
|
+
4,
|
|
1593
|
+
5,
|
|
1594
|
+
8,
|
|
1595
|
+
11,
|
|
1596
|
+
4,
|
|
1597
|
+
8,
|
|
1598
|
+
10,
|
|
1599
|
+
11,
|
|
1600
|
+
4,
|
|
1601
|
+
9,
|
|
1602
|
+
12,
|
|
1603
|
+
16,
|
|
1604
|
+
4,
|
|
1605
|
+
9,
|
|
1606
|
+
16,
|
|
1607
|
+
16,
|
|
1608
|
+
6,
|
|
1609
|
+
10,
|
|
1610
|
+
12,
|
|
1611
|
+
18,
|
|
1612
|
+
6,
|
|
1613
|
+
10,
|
|
1614
|
+
17,
|
|
1615
|
+
16,
|
|
1616
|
+
6,
|
|
1617
|
+
11,
|
|
1618
|
+
16,
|
|
1619
|
+
19,
|
|
1620
|
+
6,
|
|
1621
|
+
13,
|
|
1622
|
+
18,
|
|
1623
|
+
21,
|
|
1624
|
+
7,
|
|
1625
|
+
14,
|
|
1626
|
+
21,
|
|
1627
|
+
25,
|
|
1628
|
+
8,
|
|
1629
|
+
16,
|
|
1630
|
+
20,
|
|
1631
|
+
25,
|
|
1632
|
+
8,
|
|
1633
|
+
17,
|
|
1634
|
+
23,
|
|
1635
|
+
25,
|
|
1636
|
+
9,
|
|
1637
|
+
17,
|
|
1638
|
+
23,
|
|
1639
|
+
34,
|
|
1640
|
+
9,
|
|
1641
|
+
18,
|
|
1642
|
+
25,
|
|
1643
|
+
30,
|
|
1644
|
+
10,
|
|
1645
|
+
20,
|
|
1646
|
+
27,
|
|
1647
|
+
32,
|
|
1648
|
+
12,
|
|
1649
|
+
21,
|
|
1650
|
+
29,
|
|
1651
|
+
35,
|
|
1652
|
+
12,
|
|
1653
|
+
23,
|
|
1654
|
+
34,
|
|
1655
|
+
37,
|
|
1656
|
+
12,
|
|
1657
|
+
25,
|
|
1658
|
+
34,
|
|
1659
|
+
40,
|
|
1660
|
+
13,
|
|
1661
|
+
26,
|
|
1662
|
+
35,
|
|
1663
|
+
42,
|
|
1664
|
+
14,
|
|
1665
|
+
28,
|
|
1666
|
+
38,
|
|
1667
|
+
45,
|
|
1668
|
+
15,
|
|
1669
|
+
29,
|
|
1670
|
+
40,
|
|
1671
|
+
48,
|
|
1672
|
+
16,
|
|
1673
|
+
31,
|
|
1674
|
+
43,
|
|
1675
|
+
51,
|
|
1676
|
+
17,
|
|
1677
|
+
33,
|
|
1678
|
+
45,
|
|
1679
|
+
54,
|
|
1680
|
+
18,
|
|
1681
|
+
35,
|
|
1682
|
+
48,
|
|
1683
|
+
57,
|
|
1684
|
+
19,
|
|
1685
|
+
37,
|
|
1686
|
+
51,
|
|
1687
|
+
60,
|
|
1688
|
+
19,
|
|
1689
|
+
38,
|
|
1690
|
+
53,
|
|
1691
|
+
63,
|
|
1692
|
+
20,
|
|
1693
|
+
40,
|
|
1694
|
+
56,
|
|
1695
|
+
66,
|
|
1696
|
+
21,
|
|
1697
|
+
43,
|
|
1698
|
+
59,
|
|
1699
|
+
70,
|
|
1700
|
+
22,
|
|
1701
|
+
45,
|
|
1702
|
+
62,
|
|
1703
|
+
74,
|
|
1704
|
+
24,
|
|
1705
|
+
47,
|
|
1706
|
+
65,
|
|
1707
|
+
77,
|
|
1708
|
+
25,
|
|
1709
|
+
49,
|
|
1710
|
+
68,
|
|
1711
|
+
81
|
|
1712
|
+
], i = [
|
|
1713
|
+
// L M Q H
|
|
1714
|
+
7,
|
|
1715
|
+
10,
|
|
1716
|
+
13,
|
|
1717
|
+
17,
|
|
1718
|
+
10,
|
|
1719
|
+
16,
|
|
1720
|
+
22,
|
|
1721
|
+
28,
|
|
1722
|
+
15,
|
|
1723
|
+
26,
|
|
1724
|
+
36,
|
|
1725
|
+
44,
|
|
1726
|
+
20,
|
|
1727
|
+
36,
|
|
1728
|
+
52,
|
|
1729
|
+
64,
|
|
1730
|
+
26,
|
|
1731
|
+
48,
|
|
1732
|
+
72,
|
|
1733
|
+
88,
|
|
1734
|
+
36,
|
|
1735
|
+
64,
|
|
1736
|
+
96,
|
|
1737
|
+
112,
|
|
1738
|
+
40,
|
|
1739
|
+
72,
|
|
1740
|
+
108,
|
|
1741
|
+
130,
|
|
1742
|
+
48,
|
|
1743
|
+
88,
|
|
1744
|
+
132,
|
|
1745
|
+
156,
|
|
1746
|
+
60,
|
|
1747
|
+
110,
|
|
1748
|
+
160,
|
|
1749
|
+
192,
|
|
1750
|
+
72,
|
|
1751
|
+
130,
|
|
1752
|
+
192,
|
|
1753
|
+
224,
|
|
1754
|
+
80,
|
|
1755
|
+
150,
|
|
1756
|
+
224,
|
|
1757
|
+
264,
|
|
1758
|
+
96,
|
|
1759
|
+
176,
|
|
1760
|
+
260,
|
|
1761
|
+
308,
|
|
1762
|
+
104,
|
|
1763
|
+
198,
|
|
1764
|
+
288,
|
|
1765
|
+
352,
|
|
1766
|
+
120,
|
|
1767
|
+
216,
|
|
1768
|
+
320,
|
|
1769
|
+
384,
|
|
1770
|
+
132,
|
|
1771
|
+
240,
|
|
1772
|
+
360,
|
|
1773
|
+
432,
|
|
1774
|
+
144,
|
|
1775
|
+
280,
|
|
1776
|
+
408,
|
|
1777
|
+
480,
|
|
1778
|
+
168,
|
|
1779
|
+
308,
|
|
1780
|
+
448,
|
|
1781
|
+
532,
|
|
1782
|
+
180,
|
|
1783
|
+
338,
|
|
1784
|
+
504,
|
|
1785
|
+
588,
|
|
1786
|
+
196,
|
|
1787
|
+
364,
|
|
1788
|
+
546,
|
|
1789
|
+
650,
|
|
1790
|
+
224,
|
|
1791
|
+
416,
|
|
1792
|
+
600,
|
|
1793
|
+
700,
|
|
1794
|
+
224,
|
|
1795
|
+
442,
|
|
1796
|
+
644,
|
|
1797
|
+
750,
|
|
1798
|
+
252,
|
|
1799
|
+
476,
|
|
1800
|
+
690,
|
|
1801
|
+
816,
|
|
1802
|
+
270,
|
|
1803
|
+
504,
|
|
1804
|
+
750,
|
|
1805
|
+
900,
|
|
1806
|
+
300,
|
|
1807
|
+
560,
|
|
1808
|
+
810,
|
|
1809
|
+
960,
|
|
1810
|
+
312,
|
|
1811
|
+
588,
|
|
1812
|
+
870,
|
|
1813
|
+
1050,
|
|
1814
|
+
336,
|
|
1815
|
+
644,
|
|
1816
|
+
952,
|
|
1817
|
+
1110,
|
|
1818
|
+
360,
|
|
1819
|
+
700,
|
|
1820
|
+
1020,
|
|
1821
|
+
1200,
|
|
1822
|
+
390,
|
|
1823
|
+
728,
|
|
1824
|
+
1050,
|
|
1825
|
+
1260,
|
|
1826
|
+
420,
|
|
1827
|
+
784,
|
|
1828
|
+
1140,
|
|
1829
|
+
1350,
|
|
1830
|
+
450,
|
|
1831
|
+
812,
|
|
1832
|
+
1200,
|
|
1833
|
+
1440,
|
|
1834
|
+
480,
|
|
1835
|
+
868,
|
|
1836
|
+
1290,
|
|
1837
|
+
1530,
|
|
1838
|
+
510,
|
|
1839
|
+
924,
|
|
1840
|
+
1350,
|
|
1841
|
+
1620,
|
|
1842
|
+
540,
|
|
1843
|
+
980,
|
|
1844
|
+
1440,
|
|
1845
|
+
1710,
|
|
1846
|
+
570,
|
|
1847
|
+
1036,
|
|
1848
|
+
1530,
|
|
1849
|
+
1800,
|
|
1850
|
+
570,
|
|
1851
|
+
1064,
|
|
1852
|
+
1590,
|
|
1853
|
+
1890,
|
|
1854
|
+
600,
|
|
1855
|
+
1120,
|
|
1856
|
+
1680,
|
|
1857
|
+
1980,
|
|
1858
|
+
630,
|
|
1859
|
+
1204,
|
|
1860
|
+
1770,
|
|
1861
|
+
2100,
|
|
1862
|
+
660,
|
|
1863
|
+
1260,
|
|
1864
|
+
1860,
|
|
1865
|
+
2220,
|
|
1866
|
+
720,
|
|
1867
|
+
1316,
|
|
1868
|
+
1950,
|
|
1869
|
+
2310,
|
|
1870
|
+
750,
|
|
1871
|
+
1372,
|
|
1872
|
+
2040,
|
|
1873
|
+
2430
|
|
1874
|
+
];
|
|
1875
|
+
return He.getBlocksCount = function(o, n) {
|
|
1876
|
+
switch (n) {
|
|
1877
|
+
case e.L:
|
|
1878
|
+
return t[(o - 1) * 4 + 0];
|
|
1879
|
+
case e.M:
|
|
1880
|
+
return t[(o - 1) * 4 + 1];
|
|
1881
|
+
case e.Q:
|
|
1882
|
+
return t[(o - 1) * 4 + 2];
|
|
1883
|
+
case e.H:
|
|
1884
|
+
return t[(o - 1) * 4 + 3];
|
|
1885
|
+
default:
|
|
1886
|
+
return;
|
|
1887
|
+
}
|
|
1888
|
+
}, He.getTotalCodewordsCount = function(o, n) {
|
|
1889
|
+
switch (n) {
|
|
1890
|
+
case e.L:
|
|
1891
|
+
return i[(o - 1) * 4 + 0];
|
|
1892
|
+
case e.M:
|
|
1893
|
+
return i[(o - 1) * 4 + 1];
|
|
1894
|
+
case e.Q:
|
|
1895
|
+
return i[(o - 1) * 4 + 2];
|
|
1896
|
+
case e.H:
|
|
1897
|
+
return i[(o - 1) * 4 + 3];
|
|
1898
|
+
default:
|
|
1899
|
+
return;
|
|
1900
|
+
}
|
|
1901
|
+
}, He;
|
|
1902
|
+
}
|
|
1903
|
+
var yt = {}, De = {}, ln;
|
|
1904
|
+
function Ri() {
|
|
1905
|
+
if (ln) return De;
|
|
1906
|
+
ln = 1;
|
|
1907
|
+
const e = new Uint8Array(512), t = new Uint8Array(256);
|
|
1908
|
+
return (function() {
|
|
1909
|
+
let r = 1;
|
|
1910
|
+
for (let o = 0; o < 255; o++)
|
|
1911
|
+
e[o] = r, t[r] = o, r <<= 1, r & 256 && (r ^= 285);
|
|
1912
|
+
for (let o = 255; o < 512; o++)
|
|
1913
|
+
e[o] = e[o - 255];
|
|
1914
|
+
})(), De.log = function(r) {
|
|
1915
|
+
if (r < 1) throw new Error("log(" + r + ")");
|
|
1916
|
+
return t[r];
|
|
1917
|
+
}, De.exp = function(r) {
|
|
1918
|
+
return e[r];
|
|
1919
|
+
}, De.mul = function(r, o) {
|
|
1920
|
+
return r === 0 || o === 0 ? 0 : e[t[r] + t[o]];
|
|
1921
|
+
}, De;
|
|
1922
|
+
}
|
|
1923
|
+
var cn;
|
|
1924
|
+
function Si() {
|
|
1925
|
+
return cn || (cn = 1, (function(e) {
|
|
1926
|
+
const t = Ri();
|
|
1927
|
+
e.mul = function(r, o) {
|
|
1928
|
+
const n = new Uint8Array(r.length + o.length - 1);
|
|
1929
|
+
for (let s = 0; s < r.length; s++)
|
|
1930
|
+
for (let a = 0; a < o.length; a++)
|
|
1931
|
+
n[s + a] ^= t.mul(r[s], o[a]);
|
|
1932
|
+
return n;
|
|
1933
|
+
}, e.mod = function(r, o) {
|
|
1934
|
+
let n = new Uint8Array(r);
|
|
1935
|
+
for (; n.length - o.length >= 0; ) {
|
|
1936
|
+
const s = n[0];
|
|
1937
|
+
for (let l = 0; l < o.length; l++)
|
|
1938
|
+
n[l] ^= t.mul(o[l], s);
|
|
1939
|
+
let a = 0;
|
|
1940
|
+
for (; a < n.length && n[a] === 0; ) a++;
|
|
1941
|
+
n = n.slice(a);
|
|
1942
|
+
}
|
|
1943
|
+
return n;
|
|
1944
|
+
}, e.generateECPolynomial = function(r) {
|
|
1945
|
+
let o = new Uint8Array([1]);
|
|
1946
|
+
for (let n = 0; n < r; n++)
|
|
1947
|
+
o = e.mul(o, new Uint8Array([1, t.exp(n)]));
|
|
1948
|
+
return o;
|
|
1949
|
+
};
|
|
1950
|
+
})(yt)), yt;
|
|
1951
|
+
}
|
|
1952
|
+
var vt, un;
|
|
1953
|
+
function Ti() {
|
|
1954
|
+
if (un) return vt;
|
|
1955
|
+
un = 1;
|
|
1956
|
+
const e = Si();
|
|
1957
|
+
function t(i) {
|
|
1958
|
+
this.genPoly = void 0, this.degree = i, this.degree && this.initialize(this.degree);
|
|
1959
|
+
}
|
|
1960
|
+
return t.prototype.initialize = function(r) {
|
|
1961
|
+
this.degree = r, this.genPoly = e.generateECPolynomial(this.degree);
|
|
1962
|
+
}, t.prototype.encode = function(r) {
|
|
1963
|
+
if (!this.genPoly)
|
|
1964
|
+
throw new Error("Encoder not initialized");
|
|
1965
|
+
const o = new Uint8Array(r.length + this.degree);
|
|
1966
|
+
o.set(r);
|
|
1967
|
+
const n = e.mod(o, this.genPoly), s = this.degree - n.length;
|
|
1968
|
+
if (s > 0) {
|
|
1969
|
+
const a = new Uint8Array(this.degree);
|
|
1970
|
+
return a.set(n, s), a;
|
|
1971
|
+
}
|
|
1972
|
+
return n;
|
|
1973
|
+
}, vt = t, vt;
|
|
1974
|
+
}
|
|
1975
|
+
var Ct = {}, $t = {}, xt = {}, dn;
|
|
1976
|
+
function Mn() {
|
|
1977
|
+
return dn || (dn = 1, xt.isValid = function(t) {
|
|
1978
|
+
return !isNaN(t) && t >= 1 && t <= 40;
|
|
1979
|
+
}), xt;
|
|
1980
|
+
}
|
|
1981
|
+
var te = {}, hn;
|
|
1982
|
+
function zn() {
|
|
1983
|
+
if (hn) return te;
|
|
1984
|
+
hn = 1;
|
|
1985
|
+
const e = "[0-9]+", t = "[A-Z $%*+\\-./:]+";
|
|
1986
|
+
let i = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
1987
|
+
i = i.replace(/u/g, "\\u");
|
|
1988
|
+
const r = "(?:(?![A-Z0-9 $%*+\\-./:]|" + i + `)(?:.|[\r
|
|
1989
|
+
]))+`;
|
|
1990
|
+
te.KANJI = new RegExp(i, "g"), te.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), te.BYTE = new RegExp(r, "g"), te.NUMERIC = new RegExp(e, "g"), te.ALPHANUMERIC = new RegExp(t, "g");
|
|
1991
|
+
const o = new RegExp("^" + i + "$"), n = new RegExp("^" + e + "$"), s = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
1992
|
+
return te.testKanji = function(l) {
|
|
1993
|
+
return o.test(l);
|
|
1994
|
+
}, te.testNumeric = function(l) {
|
|
1995
|
+
return n.test(l);
|
|
1996
|
+
}, te.testAlphanumeric = function(l) {
|
|
1997
|
+
return s.test(l);
|
|
1998
|
+
}, te;
|
|
1999
|
+
}
|
|
2000
|
+
var fn;
|
|
2001
|
+
function Ie() {
|
|
2002
|
+
return fn || (fn = 1, (function(e) {
|
|
2003
|
+
const t = Mn(), i = zn();
|
|
2004
|
+
e.NUMERIC = {
|
|
2005
|
+
id: "Numeric",
|
|
2006
|
+
bit: 1,
|
|
2007
|
+
ccBits: [10, 12, 14]
|
|
2008
|
+
}, e.ALPHANUMERIC = {
|
|
2009
|
+
id: "Alphanumeric",
|
|
2010
|
+
bit: 2,
|
|
2011
|
+
ccBits: [9, 11, 13]
|
|
2012
|
+
}, e.BYTE = {
|
|
2013
|
+
id: "Byte",
|
|
2014
|
+
bit: 4,
|
|
2015
|
+
ccBits: [8, 16, 16]
|
|
2016
|
+
}, e.KANJI = {
|
|
2017
|
+
id: "Kanji",
|
|
2018
|
+
bit: 8,
|
|
2019
|
+
ccBits: [8, 10, 12]
|
|
2020
|
+
}, e.MIXED = {
|
|
2021
|
+
bit: -1
|
|
2022
|
+
}, e.getCharCountIndicator = function(n, s) {
|
|
2023
|
+
if (!n.ccBits) throw new Error("Invalid mode: " + n);
|
|
2024
|
+
if (!t.isValid(s))
|
|
2025
|
+
throw new Error("Invalid version: " + s);
|
|
2026
|
+
return s >= 1 && s < 10 ? n.ccBits[0] : s < 27 ? n.ccBits[1] : n.ccBits[2];
|
|
2027
|
+
}, e.getBestModeForData = function(n) {
|
|
2028
|
+
return i.testNumeric(n) ? e.NUMERIC : i.testAlphanumeric(n) ? e.ALPHANUMERIC : i.testKanji(n) ? e.KANJI : e.BYTE;
|
|
2029
|
+
}, e.toString = function(n) {
|
|
2030
|
+
if (n && n.id) return n.id;
|
|
2031
|
+
throw new Error("Invalid mode");
|
|
2032
|
+
}, e.isValid = function(n) {
|
|
2033
|
+
return n && n.bit && n.ccBits;
|
|
2034
|
+
};
|
|
2035
|
+
function r(o) {
|
|
2036
|
+
if (typeof o != "string")
|
|
2037
|
+
throw new Error("Param is not a string");
|
|
2038
|
+
switch (o.toLowerCase()) {
|
|
2039
|
+
case "numeric":
|
|
2040
|
+
return e.NUMERIC;
|
|
2041
|
+
case "alphanumeric":
|
|
2042
|
+
return e.ALPHANUMERIC;
|
|
2043
|
+
case "kanji":
|
|
2044
|
+
return e.KANJI;
|
|
2045
|
+
case "byte":
|
|
2046
|
+
return e.BYTE;
|
|
2047
|
+
default:
|
|
2048
|
+
throw new Error("Unknown mode: " + o);
|
|
2049
|
+
}
|
|
2050
|
+
}
|
|
2051
|
+
e.from = function(n, s) {
|
|
2052
|
+
if (e.isValid(n))
|
|
2053
|
+
return n;
|
|
2054
|
+
try {
|
|
2055
|
+
return r(n);
|
|
2056
|
+
} catch {
|
|
2057
|
+
return s;
|
|
2058
|
+
}
|
|
2059
|
+
};
|
|
2060
|
+
})($t)), $t;
|
|
2061
|
+
}
|
|
2062
|
+
var pn;
|
|
2063
|
+
function _i() {
|
|
2064
|
+
return pn || (pn = 1, (function(e) {
|
|
2065
|
+
const t = _e(), i = Dn(), r = zt(), o = Ie(), n = Mn(), s = 7973, a = t.getBCHDigit(s);
|
|
2066
|
+
function l($, m, x) {
|
|
2067
|
+
for (let h = 1; h <= 40; h++)
|
|
2068
|
+
if (m <= e.getCapacity(h, x, $))
|
|
2069
|
+
return h;
|
|
2070
|
+
}
|
|
2071
|
+
function c($, m) {
|
|
2072
|
+
return o.getCharCountIndicator($, m) + 4;
|
|
2073
|
+
}
|
|
2074
|
+
function w($, m) {
|
|
2075
|
+
let x = 0;
|
|
2076
|
+
return $.forEach(function(h) {
|
|
2077
|
+
const b = c(h.mode, m);
|
|
2078
|
+
x += b + h.getBitsLength();
|
|
2079
|
+
}), x;
|
|
2080
|
+
}
|
|
2081
|
+
function E($, m) {
|
|
2082
|
+
for (let x = 1; x <= 40; x++)
|
|
2083
|
+
if (w($, x) <= e.getCapacity(x, m, o.MIXED))
|
|
2084
|
+
return x;
|
|
2085
|
+
}
|
|
2086
|
+
e.from = function(m, x) {
|
|
2087
|
+
return n.isValid(m) ? parseInt(m, 10) : x;
|
|
2088
|
+
}, e.getCapacity = function(m, x, h) {
|
|
2089
|
+
if (!n.isValid(m))
|
|
2090
|
+
throw new Error("Invalid QR Code version");
|
|
2091
|
+
typeof h > "u" && (h = o.BYTE);
|
|
2092
|
+
const b = t.getSymbolTotalCodewords(m), p = i.getTotalCodewordsCount(m, x), g = (b - p) * 8;
|
|
2093
|
+
if (h === o.MIXED) return g;
|
|
2094
|
+
const y = g - c(h, m);
|
|
2095
|
+
switch (h) {
|
|
2096
|
+
case o.NUMERIC:
|
|
2097
|
+
return Math.floor(y / 10 * 3);
|
|
2098
|
+
case o.ALPHANUMERIC:
|
|
2099
|
+
return Math.floor(y / 11 * 2);
|
|
2100
|
+
case o.KANJI:
|
|
2101
|
+
return Math.floor(y / 13);
|
|
2102
|
+
case o.BYTE:
|
|
2103
|
+
default:
|
|
2104
|
+
return Math.floor(y / 8);
|
|
2105
|
+
}
|
|
2106
|
+
}, e.getBestVersionForData = function(m, x) {
|
|
2107
|
+
let h;
|
|
2108
|
+
const b = r.from(x, r.M);
|
|
2109
|
+
if (Array.isArray(m)) {
|
|
2110
|
+
if (m.length > 1)
|
|
2111
|
+
return E(m, b);
|
|
2112
|
+
if (m.length === 0)
|
|
2113
|
+
return 1;
|
|
2114
|
+
h = m[0];
|
|
2115
|
+
} else
|
|
2116
|
+
h = m;
|
|
2117
|
+
return l(h.mode, h.getLength(), b);
|
|
2118
|
+
}, e.getEncodedBits = function(m) {
|
|
2119
|
+
if (!n.isValid(m) || m < 7)
|
|
2120
|
+
throw new Error("Invalid QR Code version");
|
|
2121
|
+
let x = m << 12;
|
|
2122
|
+
for (; t.getBCHDigit(x) - a >= 0; )
|
|
2123
|
+
x ^= s << t.getBCHDigit(x) - a;
|
|
2124
|
+
return m << 12 | x;
|
|
2125
|
+
};
|
|
2126
|
+
})(Ct)), Ct;
|
|
2127
|
+
}
|
|
2128
|
+
var Et = {}, gn;
|
|
2129
|
+
function Ii() {
|
|
2130
|
+
if (gn) return Et;
|
|
2131
|
+
gn = 1;
|
|
2132
|
+
const e = _e(), t = 1335, i = 21522, r = e.getBCHDigit(t);
|
|
2133
|
+
return Et.getEncodedBits = function(n, s) {
|
|
2134
|
+
const a = n.bit << 3 | s;
|
|
2135
|
+
let l = a << 10;
|
|
2136
|
+
for (; e.getBCHDigit(l) - r >= 0; )
|
|
2137
|
+
l ^= t << e.getBCHDigit(l) - r;
|
|
2138
|
+
return (a << 10 | l) ^ i;
|
|
2139
|
+
}, Et;
|
|
2140
|
+
}
|
|
2141
|
+
var Rt = {}, St, mn;
|
|
2142
|
+
function Wi() {
|
|
2143
|
+
if (mn) return St;
|
|
2144
|
+
mn = 1;
|
|
2145
|
+
const e = Ie();
|
|
2146
|
+
function t(i) {
|
|
2147
|
+
this.mode = e.NUMERIC, this.data = i.toString();
|
|
2148
|
+
}
|
|
2149
|
+
return t.getBitsLength = function(r) {
|
|
2150
|
+
return 10 * Math.floor(r / 3) + (r % 3 ? r % 3 * 3 + 1 : 0);
|
|
2151
|
+
}, t.prototype.getLength = function() {
|
|
2152
|
+
return this.data.length;
|
|
2153
|
+
}, t.prototype.getBitsLength = function() {
|
|
2154
|
+
return t.getBitsLength(this.data.length);
|
|
2155
|
+
}, t.prototype.write = function(r) {
|
|
2156
|
+
let o, n, s;
|
|
2157
|
+
for (o = 0; o + 3 <= this.data.length; o += 3)
|
|
2158
|
+
n = this.data.substr(o, 3), s = parseInt(n, 10), r.put(s, 10);
|
|
2159
|
+
const a = this.data.length - o;
|
|
2160
|
+
a > 0 && (n = this.data.substr(o), s = parseInt(n, 10), r.put(s, a * 3 + 1));
|
|
2161
|
+
}, St = t, St;
|
|
2162
|
+
}
|
|
2163
|
+
var Tt, wn;
|
|
2164
|
+
function ki() {
|
|
2165
|
+
if (wn) return Tt;
|
|
2166
|
+
wn = 1;
|
|
2167
|
+
const e = Ie(), t = [
|
|
2168
|
+
"0",
|
|
2169
|
+
"1",
|
|
2170
|
+
"2",
|
|
2171
|
+
"3",
|
|
2172
|
+
"4",
|
|
2173
|
+
"5",
|
|
2174
|
+
"6",
|
|
2175
|
+
"7",
|
|
2176
|
+
"8",
|
|
2177
|
+
"9",
|
|
2178
|
+
"A",
|
|
2179
|
+
"B",
|
|
2180
|
+
"C",
|
|
2181
|
+
"D",
|
|
2182
|
+
"E",
|
|
2183
|
+
"F",
|
|
2184
|
+
"G",
|
|
2185
|
+
"H",
|
|
2186
|
+
"I",
|
|
2187
|
+
"J",
|
|
2188
|
+
"K",
|
|
2189
|
+
"L",
|
|
2190
|
+
"M",
|
|
2191
|
+
"N",
|
|
2192
|
+
"O",
|
|
2193
|
+
"P",
|
|
2194
|
+
"Q",
|
|
2195
|
+
"R",
|
|
2196
|
+
"S",
|
|
2197
|
+
"T",
|
|
2198
|
+
"U",
|
|
2199
|
+
"V",
|
|
2200
|
+
"W",
|
|
2201
|
+
"X",
|
|
2202
|
+
"Y",
|
|
2203
|
+
"Z",
|
|
2204
|
+
" ",
|
|
2205
|
+
"$",
|
|
2206
|
+
"%",
|
|
2207
|
+
"*",
|
|
2208
|
+
"+",
|
|
2209
|
+
"-",
|
|
2210
|
+
".",
|
|
2211
|
+
"/",
|
|
2212
|
+
":"
|
|
2213
|
+
];
|
|
2214
|
+
function i(r) {
|
|
2215
|
+
this.mode = e.ALPHANUMERIC, this.data = r;
|
|
2216
|
+
}
|
|
2217
|
+
return i.getBitsLength = function(o) {
|
|
2218
|
+
return 11 * Math.floor(o / 2) + 6 * (o % 2);
|
|
2219
|
+
}, i.prototype.getLength = function() {
|
|
2220
|
+
return this.data.length;
|
|
2221
|
+
}, i.prototype.getBitsLength = function() {
|
|
2222
|
+
return i.getBitsLength(this.data.length);
|
|
2223
|
+
}, i.prototype.write = function(o) {
|
|
2224
|
+
let n;
|
|
2225
|
+
for (n = 0; n + 2 <= this.data.length; n += 2) {
|
|
2226
|
+
let s = t.indexOf(this.data[n]) * 45;
|
|
2227
|
+
s += t.indexOf(this.data[n + 1]), o.put(s, 11);
|
|
2228
|
+
}
|
|
2229
|
+
this.data.length % 2 && o.put(t.indexOf(this.data[n]), 6);
|
|
2230
|
+
}, Tt = i, Tt;
|
|
2231
|
+
}
|
|
2232
|
+
var _t, bn;
|
|
2233
|
+
function Ai() {
|
|
2234
|
+
return bn || (bn = 1, _t = function(t) {
|
|
2235
|
+
for (var i = [], r = t.length, o = 0; o < r; o++) {
|
|
2236
|
+
var n = t.charCodeAt(o);
|
|
2237
|
+
if (n >= 55296 && n <= 56319 && r > o + 1) {
|
|
2238
|
+
var s = t.charCodeAt(o + 1);
|
|
2239
|
+
s >= 56320 && s <= 57343 && (n = (n - 55296) * 1024 + s - 56320 + 65536, o += 1);
|
|
2240
|
+
}
|
|
2241
|
+
if (n < 128) {
|
|
2242
|
+
i.push(n);
|
|
2243
|
+
continue;
|
|
2244
|
+
}
|
|
2245
|
+
if (n < 2048) {
|
|
2246
|
+
i.push(n >> 6 | 192), i.push(n & 63 | 128);
|
|
2247
|
+
continue;
|
|
2248
|
+
}
|
|
2249
|
+
if (n < 55296 || n >= 57344 && n < 65536) {
|
|
2250
|
+
i.push(n >> 12 | 224), i.push(n >> 6 & 63 | 128), i.push(n & 63 | 128);
|
|
2251
|
+
continue;
|
|
2252
|
+
}
|
|
2253
|
+
if (n >= 65536 && n <= 1114111) {
|
|
2254
|
+
i.push(n >> 18 | 240), i.push(n >> 12 & 63 | 128), i.push(n >> 6 & 63 | 128), i.push(n & 63 | 128);
|
|
2255
|
+
continue;
|
|
2256
|
+
}
|
|
2257
|
+
i.push(239, 191, 189);
|
|
2258
|
+
}
|
|
2259
|
+
return new Uint8Array(i).buffer;
|
|
2260
|
+
}), _t;
|
|
2261
|
+
}
|
|
2262
|
+
var It, yn;
|
|
2263
|
+
function Bi() {
|
|
2264
|
+
if (yn) return It;
|
|
2265
|
+
yn = 1;
|
|
2266
|
+
const e = Ai(), t = Ie();
|
|
2267
|
+
function i(r) {
|
|
2268
|
+
this.mode = t.BYTE, typeof r == "string" && (r = e(r)), this.data = new Uint8Array(r);
|
|
2269
|
+
}
|
|
2270
|
+
return i.getBitsLength = function(o) {
|
|
2271
|
+
return o * 8;
|
|
2272
|
+
}, i.prototype.getLength = function() {
|
|
2273
|
+
return this.data.length;
|
|
2274
|
+
}, i.prototype.getBitsLength = function() {
|
|
2275
|
+
return i.getBitsLength(this.data.length);
|
|
2276
|
+
}, i.prototype.write = function(r) {
|
|
2277
|
+
for (let o = 0, n = this.data.length; o < n; o++)
|
|
2278
|
+
r.put(this.data[o], 8);
|
|
2279
|
+
}, It = i, It;
|
|
2280
|
+
}
|
|
2281
|
+
var Wt, vn;
|
|
2282
|
+
function Pi() {
|
|
2283
|
+
if (vn) return Wt;
|
|
2284
|
+
vn = 1;
|
|
2285
|
+
const e = Ie(), t = _e();
|
|
2286
|
+
function i(r) {
|
|
2287
|
+
this.mode = e.KANJI, this.data = r;
|
|
2288
|
+
}
|
|
2289
|
+
return i.getBitsLength = function(o) {
|
|
2290
|
+
return o * 13;
|
|
2291
|
+
}, i.prototype.getLength = function() {
|
|
2292
|
+
return this.data.length;
|
|
2293
|
+
}, i.prototype.getBitsLength = function() {
|
|
2294
|
+
return i.getBitsLength(this.data.length);
|
|
2295
|
+
}, i.prototype.write = function(r) {
|
|
2296
|
+
let o;
|
|
2297
|
+
for (o = 0; o < this.data.length; o++) {
|
|
2298
|
+
let n = t.toSJIS(this.data[o]);
|
|
2299
|
+
if (n >= 33088 && n <= 40956)
|
|
2300
|
+
n -= 33088;
|
|
2301
|
+
else if (n >= 57408 && n <= 60351)
|
|
2302
|
+
n -= 49472;
|
|
2303
|
+
else
|
|
2304
|
+
throw new Error(
|
|
2305
|
+
"Invalid SJIS character: " + this.data[o] + `
|
|
2306
|
+
Make sure your charset is UTF-8`
|
|
2307
|
+
);
|
|
2308
|
+
n = (n >>> 8 & 255) * 192 + (n & 255), r.put(n, 13);
|
|
2309
|
+
}
|
|
2310
|
+
}, Wt = i, Wt;
|
|
2311
|
+
}
|
|
2312
|
+
var Cn;
|
|
2313
|
+
function Li() {
|
|
2314
|
+
return Cn || (Cn = 1, (function(e) {
|
|
2315
|
+
const t = Ie(), i = Wi(), r = ki(), o = Bi(), n = Pi(), s = zn(), a = _e(), l = ii();
|
|
2316
|
+
function c(p) {
|
|
2317
|
+
return unescape(encodeURIComponent(p)).length;
|
|
2318
|
+
}
|
|
2319
|
+
function w(p, g, y) {
|
|
2320
|
+
const f = [];
|
|
2321
|
+
let D;
|
|
2322
|
+
for (; (D = p.exec(y)) !== null; )
|
|
2323
|
+
f.push({
|
|
2324
|
+
data: D[0],
|
|
2325
|
+
index: D.index,
|
|
2326
|
+
mode: g,
|
|
2327
|
+
length: D[0].length
|
|
2328
|
+
});
|
|
2329
|
+
return f;
|
|
2330
|
+
}
|
|
2331
|
+
function E(p) {
|
|
2332
|
+
const g = w(s.NUMERIC, t.NUMERIC, p), y = w(s.ALPHANUMERIC, t.ALPHANUMERIC, p);
|
|
2333
|
+
let f, D;
|
|
2334
|
+
return a.isKanjiModeEnabled() ? (f = w(s.BYTE, t.BYTE, p), D = w(s.KANJI, t.KANJI, p)) : (f = w(s.BYTE_KANJI, t.BYTE, p), D = []), g.concat(y, f, D).sort(function(I, T) {
|
|
2335
|
+
return I.index - T.index;
|
|
2336
|
+
}).map(function(I) {
|
|
2337
|
+
return {
|
|
2338
|
+
data: I.data,
|
|
2339
|
+
mode: I.mode,
|
|
2340
|
+
length: I.length
|
|
2341
|
+
};
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
function $(p, g) {
|
|
2345
|
+
switch (g) {
|
|
2346
|
+
case t.NUMERIC:
|
|
2347
|
+
return i.getBitsLength(p);
|
|
2348
|
+
case t.ALPHANUMERIC:
|
|
2349
|
+
return r.getBitsLength(p);
|
|
2350
|
+
case t.KANJI:
|
|
2351
|
+
return n.getBitsLength(p);
|
|
2352
|
+
case t.BYTE:
|
|
2353
|
+
return o.getBitsLength(p);
|
|
2354
|
+
}
|
|
2355
|
+
}
|
|
2356
|
+
function m(p) {
|
|
2357
|
+
return p.reduce(function(g, y) {
|
|
2358
|
+
const f = g.length - 1 >= 0 ? g[g.length - 1] : null;
|
|
2359
|
+
return f && f.mode === y.mode ? (g[g.length - 1].data += y.data, g) : (g.push(y), g);
|
|
2360
|
+
}, []);
|
|
2361
|
+
}
|
|
2362
|
+
function x(p) {
|
|
2363
|
+
const g = [];
|
|
2364
|
+
for (let y = 0; y < p.length; y++) {
|
|
2365
|
+
const f = p[y];
|
|
2366
|
+
switch (f.mode) {
|
|
2367
|
+
case t.NUMERIC:
|
|
2368
|
+
g.push([
|
|
2369
|
+
f,
|
|
2370
|
+
{ data: f.data, mode: t.ALPHANUMERIC, length: f.length },
|
|
2371
|
+
{ data: f.data, mode: t.BYTE, length: f.length }
|
|
2372
|
+
]);
|
|
2373
|
+
break;
|
|
2374
|
+
case t.ALPHANUMERIC:
|
|
2375
|
+
g.push([
|
|
2376
|
+
f,
|
|
2377
|
+
{ data: f.data, mode: t.BYTE, length: f.length }
|
|
2378
|
+
]);
|
|
2379
|
+
break;
|
|
2380
|
+
case t.KANJI:
|
|
2381
|
+
g.push([
|
|
2382
|
+
f,
|
|
2383
|
+
{ data: f.data, mode: t.BYTE, length: c(f.data) }
|
|
2384
|
+
]);
|
|
2385
|
+
break;
|
|
2386
|
+
case t.BYTE:
|
|
2387
|
+
g.push([
|
|
2388
|
+
{ data: f.data, mode: t.BYTE, length: c(f.data) }
|
|
2389
|
+
]);
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
return g;
|
|
2393
|
+
}
|
|
2394
|
+
function h(p, g) {
|
|
2395
|
+
const y = {}, f = { start: {} };
|
|
2396
|
+
let D = ["start"];
|
|
2397
|
+
for (let C = 0; C < p.length; C++) {
|
|
2398
|
+
const I = p[C], T = [];
|
|
2399
|
+
for (let v = 0; v < I.length; v++) {
|
|
2400
|
+
const k = I[v], R = "" + C + v;
|
|
2401
|
+
T.push(R), y[R] = { node: k, lastCount: 0 }, f[R] = {};
|
|
2402
|
+
for (let W = 0; W < D.length; W++) {
|
|
2403
|
+
const S = D[W];
|
|
2404
|
+
y[S] && y[S].node.mode === k.mode ? (f[S][R] = $(y[S].lastCount + k.length, k.mode) - $(y[S].lastCount, k.mode), y[S].lastCount += k.length) : (y[S] && (y[S].lastCount = k.length), f[S][R] = $(k.length, k.mode) + 4 + t.getCharCountIndicator(k.mode, g));
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
D = T;
|
|
2408
|
+
}
|
|
2409
|
+
for (let C = 0; C < D.length; C++)
|
|
2410
|
+
f[D[C]].end = 0;
|
|
2411
|
+
return { map: f, table: y };
|
|
2412
|
+
}
|
|
2413
|
+
function b(p, g) {
|
|
2414
|
+
let y;
|
|
2415
|
+
const f = t.getBestModeForData(p);
|
|
2416
|
+
if (y = t.from(g, f), y !== t.BYTE && y.bit < f.bit)
|
|
2417
|
+
throw new Error('"' + p + '" cannot be encoded with mode ' + t.toString(y) + `.
|
|
2418
|
+
Suggested mode is: ` + t.toString(f));
|
|
2419
|
+
switch (y === t.KANJI && !a.isKanjiModeEnabled() && (y = t.BYTE), y) {
|
|
2420
|
+
case t.NUMERIC:
|
|
2421
|
+
return new i(p);
|
|
2422
|
+
case t.ALPHANUMERIC:
|
|
2423
|
+
return new r(p);
|
|
2424
|
+
case t.KANJI:
|
|
2425
|
+
return new n(p);
|
|
2426
|
+
case t.BYTE:
|
|
2427
|
+
return new o(p);
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
e.fromArray = function(g) {
|
|
2431
|
+
return g.reduce(function(y, f) {
|
|
2432
|
+
return typeof f == "string" ? y.push(b(f, null)) : f.data && y.push(b(f.data, f.mode)), y;
|
|
2433
|
+
}, []);
|
|
2434
|
+
}, e.fromString = function(g, y) {
|
|
2435
|
+
const f = E(g, a.isKanjiModeEnabled()), D = x(f), C = h(D, y), I = l.find_path(C.map, "start", "end"), T = [];
|
|
2436
|
+
for (let v = 1; v < I.length - 1; v++)
|
|
2437
|
+
T.push(C.table[I[v]].node);
|
|
2438
|
+
return e.fromArray(m(T));
|
|
2439
|
+
}, e.rawSplit = function(g) {
|
|
2440
|
+
return e.fromArray(
|
|
2441
|
+
E(g, a.isKanjiModeEnabled())
|
|
2442
|
+
);
|
|
2443
|
+
};
|
|
2444
|
+
})(Rt)), Rt;
|
|
2445
|
+
}
|
|
2446
|
+
var $n;
|
|
2447
|
+
function Ni() {
|
|
2448
|
+
if ($n) return ht;
|
|
2449
|
+
$n = 1;
|
|
2450
|
+
const e = _e(), t = zt(), i = vi(), r = Ci(), o = $i(), n = xi(), s = Ei(), a = Dn(), l = Ti(), c = _i(), w = Ii(), E = Ie(), $ = Li();
|
|
2451
|
+
function m(C, I) {
|
|
2452
|
+
const T = C.size, v = n.getPositions(I);
|
|
2453
|
+
for (let k = 0; k < v.length; k++) {
|
|
2454
|
+
const R = v[k][0], W = v[k][1];
|
|
2455
|
+
for (let S = -1; S <= 7; S++)
|
|
2456
|
+
if (!(R + S <= -1 || T <= R + S))
|
|
2457
|
+
for (let A = -1; A <= 7; A++)
|
|
2458
|
+
W + A <= -1 || T <= W + A || (S >= 0 && S <= 6 && (A === 0 || A === 6) || A >= 0 && A <= 6 && (S === 0 || S === 6) || S >= 2 && S <= 4 && A >= 2 && A <= 4 ? C.set(R + S, W + A, !0, !0) : C.set(R + S, W + A, !1, !0));
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
function x(C) {
|
|
2462
|
+
const I = C.size;
|
|
2463
|
+
for (let T = 8; T < I - 8; T++) {
|
|
2464
|
+
const v = T % 2 === 0;
|
|
2465
|
+
C.set(T, 6, v, !0), C.set(6, T, v, !0);
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
function h(C, I) {
|
|
2469
|
+
const T = o.getPositions(I);
|
|
2470
|
+
for (let v = 0; v < T.length; v++) {
|
|
2471
|
+
const k = T[v][0], R = T[v][1];
|
|
2472
|
+
for (let W = -2; W <= 2; W++)
|
|
2473
|
+
for (let S = -2; S <= 2; S++)
|
|
2474
|
+
W === -2 || W === 2 || S === -2 || S === 2 || W === 0 && S === 0 ? C.set(k + W, R + S, !0, !0) : C.set(k + W, R + S, !1, !0);
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
function b(C, I) {
|
|
2478
|
+
const T = C.size, v = c.getEncodedBits(I);
|
|
2479
|
+
let k, R, W;
|
|
2480
|
+
for (let S = 0; S < 18; S++)
|
|
2481
|
+
k = Math.floor(S / 3), R = S % 3 + T - 8 - 3, W = (v >> S & 1) === 1, C.set(k, R, W, !0), C.set(R, k, W, !0);
|
|
2482
|
+
}
|
|
2483
|
+
function p(C, I, T) {
|
|
2484
|
+
const v = C.size, k = w.getEncodedBits(I, T);
|
|
2485
|
+
let R, W;
|
|
2486
|
+
for (R = 0; R < 15; R++)
|
|
2487
|
+
W = (k >> R & 1) === 1, R < 6 ? C.set(R, 8, W, !0) : R < 8 ? C.set(R + 1, 8, W, !0) : C.set(v - 15 + R, 8, W, !0), R < 8 ? C.set(8, v - R - 1, W, !0) : R < 9 ? C.set(8, 15 - R - 1 + 1, W, !0) : C.set(8, 15 - R - 1, W, !0);
|
|
2488
|
+
C.set(v - 8, 8, 1, !0);
|
|
2489
|
+
}
|
|
2490
|
+
function g(C, I) {
|
|
2491
|
+
const T = C.size;
|
|
2492
|
+
let v = -1, k = T - 1, R = 7, W = 0;
|
|
2493
|
+
for (let S = T - 1; S > 0; S -= 2)
|
|
2494
|
+
for (S === 6 && S--; ; ) {
|
|
2495
|
+
for (let A = 0; A < 2; A++)
|
|
2496
|
+
if (!C.isReserved(k, S - A)) {
|
|
2497
|
+
let pe = !1;
|
|
2498
|
+
W < I.length && (pe = (I[W] >>> R & 1) === 1), C.set(k, S - A, pe), R--, R === -1 && (W++, R = 7);
|
|
2499
|
+
}
|
|
2500
|
+
if (k += v, k < 0 || T <= k) {
|
|
2501
|
+
k -= v, v = -v;
|
|
2502
|
+
break;
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
function y(C, I, T) {
|
|
2507
|
+
const v = new i();
|
|
2508
|
+
T.forEach(function(A) {
|
|
2509
|
+
v.put(A.mode.bit, 4), v.put(A.getLength(), E.getCharCountIndicator(A.mode, C)), A.write(v);
|
|
2510
|
+
});
|
|
2511
|
+
const k = e.getSymbolTotalCodewords(C), R = a.getTotalCodewordsCount(C, I), W = (k - R) * 8;
|
|
2512
|
+
for (v.getLengthInBits() + 4 <= W && v.put(0, 4); v.getLengthInBits() % 8 !== 0; )
|
|
2513
|
+
v.putBit(0);
|
|
2514
|
+
const S = (W - v.getLengthInBits()) / 8;
|
|
2515
|
+
for (let A = 0; A < S; A++)
|
|
2516
|
+
v.put(A % 2 ? 17 : 236, 8);
|
|
2517
|
+
return f(v, C, I);
|
|
2518
|
+
}
|
|
2519
|
+
function f(C, I, T) {
|
|
2520
|
+
const v = e.getSymbolTotalCodewords(I), k = a.getTotalCodewordsCount(I, T), R = v - k, W = a.getBlocksCount(I, T), S = v % W, A = W - S, pe = Math.floor(v / W), Oe = Math.floor(R / W), Gn = Oe + 1, Vt = pe - Oe, Qn = new l(Vt);
|
|
2521
|
+
let at = 0;
|
|
2522
|
+
const Ke = new Array(W), Kt = new Array(W);
|
|
2523
|
+
let lt = 0;
|
|
2524
|
+
const Yn = new Uint8Array(C.buffer);
|
|
2525
|
+
for (let ke = 0; ke < W; ke++) {
|
|
2526
|
+
const ut = ke < A ? Oe : Gn;
|
|
2527
|
+
Ke[ke] = Yn.slice(at, at + ut), Kt[ke] = Qn.encode(Ke[ke]), at += ut, lt = Math.max(lt, ut);
|
|
2528
|
+
}
|
|
2529
|
+
const ct = new Uint8Array(v);
|
|
2530
|
+
let Ht = 0, se, ae;
|
|
2531
|
+
for (se = 0; se < lt; se++)
|
|
2532
|
+
for (ae = 0; ae < W; ae++)
|
|
2533
|
+
se < Ke[ae].length && (ct[Ht++] = Ke[ae][se]);
|
|
2534
|
+
for (se = 0; se < Vt; se++)
|
|
2535
|
+
for (ae = 0; ae < W; ae++)
|
|
2536
|
+
ct[Ht++] = Kt[ae][se];
|
|
2537
|
+
return ct;
|
|
2538
|
+
}
|
|
2539
|
+
function D(C, I, T, v) {
|
|
2540
|
+
let k;
|
|
2541
|
+
if (Array.isArray(C))
|
|
2542
|
+
k = $.fromArray(C);
|
|
2543
|
+
else if (typeof C == "string") {
|
|
2544
|
+
let pe = I;
|
|
2545
|
+
if (!pe) {
|
|
2546
|
+
const Oe = $.rawSplit(C);
|
|
2547
|
+
pe = c.getBestVersionForData(Oe, T);
|
|
2548
|
+
}
|
|
2549
|
+
k = $.fromString(C, pe || 40);
|
|
2550
|
+
} else
|
|
2551
|
+
throw new Error("Invalid data");
|
|
2552
|
+
const R = c.getBestVersionForData(k, T);
|
|
2553
|
+
if (!R)
|
|
2554
|
+
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
2555
|
+
if (!I)
|
|
2556
|
+
I = R;
|
|
2557
|
+
else if (I < R)
|
|
2558
|
+
throw new Error(
|
|
2559
|
+
`
|
|
2560
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
2561
|
+
Minimum version required to store current data is: ` + R + `.
|
|
2562
|
+
`
|
|
2563
|
+
);
|
|
2564
|
+
const W = y(I, T, k), S = e.getSymbolSize(I), A = new r(S);
|
|
2565
|
+
return m(A, I), x(A), h(A, I), p(A, T, 0), I >= 7 && b(A, I), g(A, W), isNaN(v) && (v = s.getBestMask(
|
|
2566
|
+
A,
|
|
2567
|
+
p.bind(null, A, T)
|
|
2568
|
+
)), s.applyMask(v, A), p(A, T, v), {
|
|
2569
|
+
modules: A,
|
|
2570
|
+
version: I,
|
|
2571
|
+
errorCorrectionLevel: T,
|
|
2572
|
+
maskPattern: v,
|
|
2573
|
+
segments: k
|
|
2574
|
+
};
|
|
2575
|
+
}
|
|
2576
|
+
return ht.create = function(I, T) {
|
|
2577
|
+
if (typeof I > "u" || I === "")
|
|
2578
|
+
throw new Error("No input text");
|
|
2579
|
+
let v = t.M, k, R;
|
|
2580
|
+
return typeof T < "u" && (v = t.from(T.errorCorrectionLevel, t.M), k = c.from(T.version), R = s.from(T.maskPattern), T.toSJISFunc && e.setToSJISFunction(T.toSJISFunc)), D(I, k, v, R);
|
|
2581
|
+
}, ht;
|
|
2582
|
+
}
|
|
2583
|
+
var kt = {}, At = {}, xn;
|
|
2584
|
+
function jn() {
|
|
2585
|
+
return xn || (xn = 1, (function(e) {
|
|
2586
|
+
function t(i) {
|
|
2587
|
+
if (typeof i == "number" && (i = i.toString()), typeof i != "string")
|
|
2588
|
+
throw new Error("Color should be defined as hex string");
|
|
2589
|
+
let r = i.slice().replace("#", "").split("");
|
|
2590
|
+
if (r.length < 3 || r.length === 5 || r.length > 8)
|
|
2591
|
+
throw new Error("Invalid hex color: " + i);
|
|
2592
|
+
(r.length === 3 || r.length === 4) && (r = Array.prototype.concat.apply([], r.map(function(n) {
|
|
2593
|
+
return [n, n];
|
|
2594
|
+
}))), r.length === 6 && r.push("F", "F");
|
|
2595
|
+
const o = parseInt(r.join(""), 16);
|
|
2596
|
+
return {
|
|
2597
|
+
r: o >> 24 & 255,
|
|
2598
|
+
g: o >> 16 & 255,
|
|
2599
|
+
b: o >> 8 & 255,
|
|
2600
|
+
a: o & 255,
|
|
2601
|
+
hex: "#" + r.slice(0, 6).join("")
|
|
2602
|
+
};
|
|
2603
|
+
}
|
|
2604
|
+
e.getOptions = function(r) {
|
|
2605
|
+
r || (r = {}), r.color || (r.color = {});
|
|
2606
|
+
const o = typeof r.margin > "u" || r.margin === null || r.margin < 0 ? 4 : r.margin, n = r.width && r.width >= 21 ? r.width : void 0, s = r.scale || 4;
|
|
2607
|
+
return {
|
|
2608
|
+
width: n,
|
|
2609
|
+
scale: n ? 4 : s,
|
|
2610
|
+
margin: o,
|
|
2611
|
+
color: {
|
|
2612
|
+
dark: t(r.color.dark || "#000000ff"),
|
|
2613
|
+
light: t(r.color.light || "#ffffffff")
|
|
2614
|
+
},
|
|
2615
|
+
type: r.type,
|
|
2616
|
+
rendererOpts: r.rendererOpts || {}
|
|
2617
|
+
};
|
|
2618
|
+
}, e.getScale = function(r, o) {
|
|
2619
|
+
return o.width && o.width >= r + o.margin * 2 ? o.width / (r + o.margin * 2) : o.scale;
|
|
2620
|
+
}, e.getImageWidth = function(r, o) {
|
|
2621
|
+
const n = e.getScale(r, o);
|
|
2622
|
+
return Math.floor((r + o.margin * 2) * n);
|
|
2623
|
+
}, e.qrToImageData = function(r, o, n) {
|
|
2624
|
+
const s = o.modules.size, a = o.modules.data, l = e.getScale(s, n), c = Math.floor((s + n.margin * 2) * l), w = n.margin * l, E = [n.color.light, n.color.dark];
|
|
2625
|
+
for (let $ = 0; $ < c; $++)
|
|
2626
|
+
for (let m = 0; m < c; m++) {
|
|
2627
|
+
let x = ($ * c + m) * 4, h = n.color.light;
|
|
2628
|
+
if ($ >= w && m >= w && $ < c - w && m < c - w) {
|
|
2629
|
+
const b = Math.floor(($ - w) / l), p = Math.floor((m - w) / l);
|
|
2630
|
+
h = E[a[b * s + p] ? 1 : 0];
|
|
2631
|
+
}
|
|
2632
|
+
r[x++] = h.r, r[x++] = h.g, r[x++] = h.b, r[x] = h.a;
|
|
2633
|
+
}
|
|
2634
|
+
};
|
|
2635
|
+
})(At)), At;
|
|
2636
|
+
}
|
|
2637
|
+
var En;
|
|
2638
|
+
function Oi() {
|
|
2639
|
+
return En || (En = 1, (function(e) {
|
|
2640
|
+
const t = jn();
|
|
2641
|
+
function i(o, n, s) {
|
|
2642
|
+
o.clearRect(0, 0, n.width, n.height), n.style || (n.style = {}), n.height = s, n.width = s, n.style.height = s + "px", n.style.width = s + "px";
|
|
2643
|
+
}
|
|
2644
|
+
function r() {
|
|
2645
|
+
try {
|
|
2646
|
+
return document.createElement("canvas");
|
|
2647
|
+
} catch {
|
|
2648
|
+
throw new Error("You need to specify a canvas element");
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
e.render = function(n, s, a) {
|
|
2652
|
+
let l = a, c = s;
|
|
2653
|
+
typeof l > "u" && (!s || !s.getContext) && (l = s, s = void 0), s || (c = r()), l = t.getOptions(l);
|
|
2654
|
+
const w = t.getImageWidth(n.modules.size, l), E = c.getContext("2d"), $ = E.createImageData(w, w);
|
|
2655
|
+
return t.qrToImageData($.data, n, l), i(E, c, w), E.putImageData($, 0, 0), c;
|
|
2656
|
+
}, e.renderToDataURL = function(n, s, a) {
|
|
2657
|
+
let l = a;
|
|
2658
|
+
typeof l > "u" && (!s || !s.getContext) && (l = s, s = void 0), l || (l = {});
|
|
2659
|
+
const c = e.render(n, s, l), w = l.type || "image/png", E = l.rendererOpts || {};
|
|
2660
|
+
return c.toDataURL(w, E.quality);
|
|
2661
|
+
};
|
|
2662
|
+
})(kt)), kt;
|
|
2663
|
+
}
|
|
2664
|
+
var Bt = {}, Rn;
|
|
2665
|
+
function Di() {
|
|
2666
|
+
if (Rn) return Bt;
|
|
2667
|
+
Rn = 1;
|
|
2668
|
+
const e = jn();
|
|
2669
|
+
function t(o, n) {
|
|
2670
|
+
const s = o.a / 255, a = n + '="' + o.hex + '"';
|
|
2671
|
+
return s < 1 ? a + " " + n + '-opacity="' + s.toFixed(2).slice(1) + '"' : a;
|
|
2672
|
+
}
|
|
2673
|
+
function i(o, n, s) {
|
|
2674
|
+
let a = o + n;
|
|
2675
|
+
return typeof s < "u" && (a += " " + s), a;
|
|
2676
|
+
}
|
|
2677
|
+
function r(o, n, s) {
|
|
2678
|
+
let a = "", l = 0, c = !1, w = 0;
|
|
2679
|
+
for (let E = 0; E < o.length; E++) {
|
|
2680
|
+
const $ = Math.floor(E % n), m = Math.floor(E / n);
|
|
2681
|
+
!$ && !c && (c = !0), o[E] ? (w++, E > 0 && $ > 0 && o[E - 1] || (a += c ? i("M", $ + s, 0.5 + m + s) : i("m", l, 0), l = 0, c = !1), $ + 1 < n && o[E + 1] || (a += i("h", w), w = 0)) : l++;
|
|
2682
|
+
}
|
|
2683
|
+
return a;
|
|
2684
|
+
}
|
|
2685
|
+
return Bt.render = function(n, s, a) {
|
|
2686
|
+
const l = e.getOptions(s), c = n.modules.size, w = n.modules.data, E = c + l.margin * 2, $ = l.color.light.a ? "<path " + t(l.color.light, "fill") + ' d="M0 0h' + E + "v" + E + 'H0z"/>' : "", m = "<path " + t(l.color.dark, "stroke") + ' d="' + r(w, c, l.margin) + '"/>', x = 'viewBox="0 0 ' + E + " " + E + '"', b = '<svg xmlns="http://www.w3.org/2000/svg" ' + (l.width ? 'width="' + l.width + '" height="' + l.width + '" ' : "") + x + ' shape-rendering="crispEdges">' + $ + m + `</svg>
|
|
2687
|
+
`;
|
|
2688
|
+
return typeof a == "function" && a(null, b), b;
|
|
2689
|
+
}, Bt;
|
|
2690
|
+
}
|
|
2691
|
+
var Sn;
|
|
2692
|
+
function Mi() {
|
|
2693
|
+
if (Sn) return Ae;
|
|
2694
|
+
Sn = 1;
|
|
2695
|
+
const e = yi(), t = Ni(), i = Oi(), r = Di();
|
|
2696
|
+
function o(n, s, a, l, c) {
|
|
2697
|
+
const w = [].slice.call(arguments, 1), E = w.length, $ = typeof w[E - 1] == "function";
|
|
2698
|
+
if (!$ && !e())
|
|
2699
|
+
throw new Error("Callback required as last argument");
|
|
2700
|
+
if ($) {
|
|
2701
|
+
if (E < 2)
|
|
2702
|
+
throw new Error("Too few arguments provided");
|
|
2703
|
+
E === 2 ? (c = a, a = s, s = l = void 0) : E === 3 && (s.getContext && typeof c > "u" ? (c = l, l = void 0) : (c = l, l = a, a = s, s = void 0));
|
|
2704
|
+
} else {
|
|
2705
|
+
if (E < 1)
|
|
2706
|
+
throw new Error("Too few arguments provided");
|
|
2707
|
+
return E === 1 ? (a = s, s = l = void 0) : E === 2 && !s.getContext && (l = a, a = s, s = void 0), new Promise(function(m, x) {
|
|
2708
|
+
try {
|
|
2709
|
+
const h = t.create(a, l);
|
|
2710
|
+
m(n(h, s, l));
|
|
2711
|
+
} catch (h) {
|
|
2712
|
+
x(h);
|
|
2713
|
+
}
|
|
2714
|
+
});
|
|
2715
|
+
}
|
|
2716
|
+
try {
|
|
2717
|
+
const m = t.create(a, l);
|
|
2718
|
+
c(null, n(m, s, l));
|
|
2719
|
+
} catch (m) {
|
|
2720
|
+
c(m);
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
return Ae.create = t.create, Ae.toCanvas = o.bind(null, i.render), Ae.toDataURL = o.bind(null, i.renderToDataURL), Ae.toString = o.bind(null, function(n, s, a) {
|
|
2724
|
+
return r.render(n, a);
|
|
2725
|
+
}), Ae;
|
|
2726
|
+
}
|
|
2727
|
+
var zi = Mi();
|
|
2728
|
+
const ji = /* @__PURE__ */ ri(zi), Ui = 0.1, Tn = 2.5, le = 7;
|
|
2729
|
+
function Pt(e, t, i) {
|
|
2730
|
+
return e === t ? !1 : (e - t < 0 ? t - e : e - t) <= i + Ui;
|
|
2731
|
+
}
|
|
2732
|
+
function qi(e, t) {
|
|
2733
|
+
const i = Array.prototype.slice.call(ji.create(e, { errorCorrectionLevel: t }).modules.data, 0), r = Math.sqrt(i.length);
|
|
2734
|
+
return i.reduce((o, n, s) => (s % r === 0 ? o.push([n]) : o[o.length - 1].push(n)) && o, []);
|
|
2735
|
+
}
|
|
2736
|
+
const Fi = {
|
|
2737
|
+
generate({ uri: e, size: t, logoSize: i, padding: r = 8, dotColor: o = "var(--apkt-colors-black)" }) {
|
|
2738
|
+
const s = [], a = qi(e, "Q"), l = (t - 2 * r) / a.length, c = [
|
|
2739
|
+
{ x: 0, y: 0 },
|
|
2740
|
+
{ x: 1, y: 0 },
|
|
2741
|
+
{ x: 0, y: 1 }
|
|
2742
|
+
];
|
|
2743
|
+
c.forEach(({ x: h, y: b }) => {
|
|
2744
|
+
const p = (a.length - le) * l * h + r, g = (a.length - le) * l * b + r, y = 0.45;
|
|
2745
|
+
for (let f = 0; f < c.length; f += 1) {
|
|
2746
|
+
const D = l * (le - f * 2);
|
|
2747
|
+
s.push(Me`
|
|
2748
|
+
<rect
|
|
2749
|
+
fill=${f === 2 ? "var(--apkt-colors-black)" : "var(--apkt-colors-white)"}
|
|
2750
|
+
width=${f === 0 ? D - 10 : D}
|
|
2751
|
+
rx= ${f === 0 ? (D - 10) * y : D * y}
|
|
2752
|
+
ry= ${f === 0 ? (D - 10) * y : D * y}
|
|
2753
|
+
stroke=${o}
|
|
2754
|
+
stroke-width=${f === 0 ? 10 : 0}
|
|
2755
|
+
height=${f === 0 ? D - 10 : D}
|
|
2756
|
+
x= ${f === 0 ? g + l * f + 10 / 2 : g + l * f}
|
|
2757
|
+
y= ${f === 0 ? p + l * f + 10 / 2 : p + l * f}
|
|
2758
|
+
/>
|
|
2759
|
+
`);
|
|
2760
|
+
}
|
|
2761
|
+
});
|
|
2762
|
+
const w = Math.floor((i + 25) / l), E = a.length / 2 - w / 2, $ = a.length / 2 + w / 2 - 1, m = [];
|
|
2763
|
+
a.forEach((h, b) => {
|
|
2764
|
+
h.forEach((p, g) => {
|
|
2765
|
+
if (a[b][g] && !(b < le && g < le || b > a.length - (le + 1) && g < le || b < le && g > a.length - (le + 1)) && !(b > E && b < $ && g > E && g < $)) {
|
|
2766
|
+
const y = b * l + l / 2 + r, f = g * l + l / 2 + r;
|
|
2767
|
+
m.push([y, f]);
|
|
2768
|
+
}
|
|
2769
|
+
});
|
|
2770
|
+
});
|
|
2771
|
+
const x = {};
|
|
2772
|
+
return m.forEach(([h, b]) => {
|
|
2773
|
+
x[h] ? x[h]?.push(b) : x[h] = [b];
|
|
2774
|
+
}), Object.entries(x).map(([h, b]) => {
|
|
2775
|
+
const p = b.filter((g) => b.every((y) => !Pt(g, y, l)));
|
|
2776
|
+
return [Number(h), p];
|
|
2777
|
+
}).forEach(([h, b]) => {
|
|
2778
|
+
b.forEach((p) => {
|
|
2779
|
+
s.push(Me`<circle cx=${h} cy=${p} fill=${o} r=${l / Tn} />`);
|
|
2780
|
+
});
|
|
2781
|
+
}), Object.entries(x).filter(([h, b]) => b.length > 1).map(([h, b]) => {
|
|
2782
|
+
const p = b.filter((g) => b.some((y) => Pt(g, y, l)));
|
|
2783
|
+
return [Number(h), p];
|
|
2784
|
+
}).map(([h, b]) => {
|
|
2785
|
+
b.sort((g, y) => g < y ? -1 : 1);
|
|
2786
|
+
const p = [];
|
|
2787
|
+
for (const g of b) {
|
|
2788
|
+
const y = p.find((f) => f.some((D) => Pt(g, D, l)));
|
|
2789
|
+
y ? y.push(g) : p.push([g]);
|
|
2790
|
+
}
|
|
2791
|
+
return [h, p.map((g) => [g[0], g[g.length - 1]])];
|
|
2792
|
+
}).forEach(([h, b]) => {
|
|
2793
|
+
b.forEach(([p, g]) => {
|
|
2794
|
+
s.push(Me`
|
|
2795
|
+
<line
|
|
2796
|
+
x1=${h}
|
|
2797
|
+
x2=${h}
|
|
2798
|
+
y1=${p}
|
|
2799
|
+
y2=${g}
|
|
2800
|
+
stroke=${o}
|
|
2801
|
+
stroke-width=${l / (Tn / 2)}
|
|
2802
|
+
stroke-linecap="round"
|
|
2803
|
+
/>
|
|
2804
|
+
`);
|
|
2805
|
+
});
|
|
2806
|
+
}), s;
|
|
2807
|
+
}
|
|
2808
|
+
}, Vi = j`
|
|
2809
|
+
:host {
|
|
2810
|
+
position: relative;
|
|
2811
|
+
user-select: none;
|
|
2812
|
+
display: block;
|
|
2813
|
+
overflow: hidden;
|
|
2814
|
+
aspect-ratio: 1 / 1;
|
|
2815
|
+
width: 100%;
|
|
2816
|
+
height: 100%;
|
|
2817
|
+
background-color: ${({ colors: e }) => e.white};
|
|
2818
|
+
border: 1px solid ${({ tokens: e }) => e.theme.borderPrimary};
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
:host {
|
|
2822
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
2823
|
+
display: flex;
|
|
2824
|
+
align-items: center;
|
|
2825
|
+
justify-content: center;
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
:host([data-clear='true']) > wui-icon {
|
|
2829
|
+
display: none;
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
svg:first-child,
|
|
2833
|
+
wui-image,
|
|
2834
|
+
wui-icon {
|
|
2835
|
+
position: absolute;
|
|
2836
|
+
top: 50%;
|
|
2837
|
+
left: 50%;
|
|
2838
|
+
transform: translateY(-50%) translateX(-50%);
|
|
2839
|
+
background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
2840
|
+
box-shadow: inset 0 0 0 4px ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
2841
|
+
border-radius: ${({ borderRadius: e }) => e[6]};
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
wui-image {
|
|
2845
|
+
width: 25%;
|
|
2846
|
+
height: 25%;
|
|
2847
|
+
border-radius: ${({ borderRadius: e }) => e[2]};
|
|
2848
|
+
}
|
|
2849
|
+
|
|
2850
|
+
wui-icon {
|
|
2851
|
+
width: 100%;
|
|
2852
|
+
height: 100%;
|
|
2853
|
+
color: #3396ff !important;
|
|
2854
|
+
transform: translateY(-50%) translateX(-50%) scale(0.25);
|
|
2855
|
+
}
|
|
2856
|
+
|
|
2857
|
+
wui-icon > svg {
|
|
2858
|
+
width: inherit;
|
|
2859
|
+
height: inherit;
|
|
2860
|
+
}
|
|
2861
|
+
`;
|
|
2862
|
+
var be = function(e, t, i, r) {
|
|
2863
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
2864
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
2865
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
2866
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
2867
|
+
};
|
|
2868
|
+
let ne = class extends M {
|
|
2869
|
+
constructor() {
|
|
2870
|
+
super(...arguments), this.uri = "", this.size = 0, this.theme = "dark", this.imageSrc = void 0, this.alt = void 0, this.arenaClear = void 0, this.farcaster = void 0;
|
|
2871
|
+
}
|
|
2872
|
+
render() {
|
|
2873
|
+
return this.dataset.theme = this.theme, this.dataset.clear = String(this.arenaClear), this.style.cssText = `--local-size: ${this.size}px`, u`<wui-flex
|
|
2874
|
+
alignItems="center"
|
|
2875
|
+
justifyContent="center"
|
|
2876
|
+
class="wui-qr-code"
|
|
2877
|
+
direction="column"
|
|
2878
|
+
gap="4"
|
|
2879
|
+
width="100%"
|
|
2880
|
+
style="height: 100%"
|
|
2881
|
+
>
|
|
2882
|
+
${this.templateVisual()} ${this.templateSvg()}
|
|
2883
|
+
</wui-flex>`;
|
|
2884
|
+
}
|
|
2885
|
+
templateSvg() {
|
|
2886
|
+
return Me`
|
|
2887
|
+
<svg height=${this.size} width=${this.size}>
|
|
2888
|
+
${Fi.generate({
|
|
2889
|
+
uri: this.uri,
|
|
2890
|
+
size: this.size,
|
|
2891
|
+
logoSize: this.arenaClear ? 0 : this.size / 4
|
|
2892
|
+
})}
|
|
2893
|
+
</svg>
|
|
2894
|
+
`;
|
|
2895
|
+
}
|
|
2896
|
+
templateVisual() {
|
|
2897
|
+
return this.imageSrc ? u`<wui-image src=${this.imageSrc} alt=${this.alt ?? "logo"}></wui-image>` : this.farcaster ? u`<wui-icon
|
|
2898
|
+
class="farcaster"
|
|
2899
|
+
size="inherit"
|
|
2900
|
+
color="inherit"
|
|
2901
|
+
name="farcaster"
|
|
2902
|
+
></wui-icon>` : u`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`;
|
|
2903
|
+
}
|
|
2904
|
+
};
|
|
2905
|
+
ne.styles = [G, Vi];
|
|
2906
|
+
be([
|
|
2907
|
+
d()
|
|
2908
|
+
], ne.prototype, "uri", void 0);
|
|
2909
|
+
be([
|
|
2910
|
+
d({ type: Number })
|
|
2911
|
+
], ne.prototype, "size", void 0);
|
|
2912
|
+
be([
|
|
2913
|
+
d()
|
|
2914
|
+
], ne.prototype, "theme", void 0);
|
|
2915
|
+
be([
|
|
2916
|
+
d()
|
|
2917
|
+
], ne.prototype, "imageSrc", void 0);
|
|
2918
|
+
be([
|
|
2919
|
+
d()
|
|
2920
|
+
], ne.prototype, "alt", void 0);
|
|
2921
|
+
be([
|
|
2922
|
+
d({ type: Boolean })
|
|
2923
|
+
], ne.prototype, "arenaClear", void 0);
|
|
2924
|
+
be([
|
|
2925
|
+
d({ type: Boolean })
|
|
2926
|
+
], ne.prototype, "farcaster", void 0);
|
|
2927
|
+
ne = be([
|
|
2928
|
+
O("wui-qr-code")
|
|
2929
|
+
], ne);
|
|
2930
|
+
const Ki = j`
|
|
2931
|
+
:host {
|
|
2932
|
+
display: block;
|
|
2933
|
+
background: linear-gradient(
|
|
2934
|
+
90deg,
|
|
2935
|
+
${({ tokens: e }) => e.theme.foregroundSecondary} 0%,
|
|
2936
|
+
${({ tokens: e }) => e.theme.foregroundTertiary} 50%,
|
|
2937
|
+
${({ tokens: e }) => e.theme.foregroundSecondary} 100%
|
|
2938
|
+
);
|
|
2939
|
+
background-size: 200% 100%;
|
|
2940
|
+
animation: shimmer 1s ease-in-out infinite;
|
|
2941
|
+
border-radius: ${({ borderRadius: e }) => e[2]};
|
|
2942
|
+
}
|
|
2943
|
+
|
|
2944
|
+
:host([data-rounded='true']) {
|
|
2945
|
+
border-radius: ${({ borderRadius: e }) => e[16]};
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
@keyframes shimmer {
|
|
2949
|
+
0% {
|
|
2950
|
+
background-position: 200% 0;
|
|
2951
|
+
}
|
|
2952
|
+
100% {
|
|
2953
|
+
background-position: -200% 0;
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
`;
|
|
2957
|
+
var Fe = function(e, t, i, r) {
|
|
2958
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
2959
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
2960
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
2961
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
2962
|
+
};
|
|
2963
|
+
let Re = class extends M {
|
|
2964
|
+
constructor() {
|
|
2965
|
+
super(...arguments), this.width = "", this.height = "", this.variant = "default", this.rounded = !1;
|
|
2966
|
+
}
|
|
2967
|
+
render() {
|
|
2968
|
+
return this.style.cssText = `
|
|
2969
|
+
width: ${this.width};
|
|
2970
|
+
height: ${this.height};
|
|
2971
|
+
`, this.dataset.rounded = this.rounded ? "true" : "false", u`<slot></slot>`;
|
|
2972
|
+
}
|
|
2973
|
+
};
|
|
2974
|
+
Re.styles = [Ki];
|
|
2975
|
+
Fe([
|
|
2976
|
+
d()
|
|
2977
|
+
], Re.prototype, "width", void 0);
|
|
2978
|
+
Fe([
|
|
2979
|
+
d()
|
|
2980
|
+
], Re.prototype, "height", void 0);
|
|
2981
|
+
Fe([
|
|
2982
|
+
d()
|
|
2983
|
+
], Re.prototype, "variant", void 0);
|
|
2984
|
+
Fe([
|
|
2985
|
+
d({ type: Boolean })
|
|
2986
|
+
], Re.prototype, "rounded", void 0);
|
|
2987
|
+
Re = Fe([
|
|
2988
|
+
O("wui-shimmer")
|
|
2989
|
+
], Re);
|
|
2990
|
+
const Hi = j`
|
|
2991
|
+
wui-shimmer {
|
|
2992
|
+
width: 100%;
|
|
2993
|
+
aspect-ratio: 1 / 1;
|
|
2994
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2997
|
+
wui-qr-code {
|
|
2998
|
+
opacity: 0;
|
|
2999
|
+
animation-duration: ${({ durations: e }) => e.xl};
|
|
3000
|
+
animation-timing-function: ${({ easings: e }) => e["ease-out-power-2"]};
|
|
3001
|
+
animation-name: fade-in;
|
|
3002
|
+
animation-fill-mode: forwards;
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
@keyframes fade-in {
|
|
3006
|
+
from {
|
|
3007
|
+
opacity: 0;
|
|
3008
|
+
}
|
|
3009
|
+
to {
|
|
3010
|
+
opacity: 1;
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
`;
|
|
3014
|
+
var Un = function(e, t, i, r) {
|
|
3015
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
3016
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
3017
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
3018
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
3019
|
+
};
|
|
3020
|
+
let Xe = class extends U {
|
|
3021
|
+
constructor() {
|
|
3022
|
+
super(), this.basic = !1, this.forceUpdate = () => {
|
|
3023
|
+
this.requestUpdate();
|
|
3024
|
+
}, window.addEventListener("resize", this.forceUpdate);
|
|
3025
|
+
}
|
|
3026
|
+
firstUpdated() {
|
|
3027
|
+
this.basic || F.sendEvent({
|
|
3028
|
+
type: "track",
|
|
3029
|
+
event: "SELECT_WALLET",
|
|
3030
|
+
properties: {
|
|
3031
|
+
name: this.wallet?.name ?? "WalletConnect",
|
|
3032
|
+
platform: "qrcode",
|
|
3033
|
+
displayIndex: this.wallet?.display_index,
|
|
3034
|
+
walletRank: this.wallet?.order,
|
|
3035
|
+
view: B.state.view
|
|
3036
|
+
}
|
|
3037
|
+
});
|
|
3038
|
+
}
|
|
3039
|
+
disconnectedCallback() {
|
|
3040
|
+
super.disconnectedCallback(), this.unsubscribe?.forEach((t) => t()), window.removeEventListener("resize", this.forceUpdate);
|
|
3041
|
+
}
|
|
3042
|
+
render() {
|
|
3043
|
+
return this.onRenderProxy(), u`
|
|
3044
|
+
<wui-flex
|
|
3045
|
+
flexDirection="column"
|
|
3046
|
+
alignItems="center"
|
|
3047
|
+
.padding=${["0", "5", "5", "5"]}
|
|
3048
|
+
gap="5"
|
|
3049
|
+
>
|
|
3050
|
+
<wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
|
|
3051
|
+
<wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
|
|
3052
|
+
${this.copyTemplate()}
|
|
3053
|
+
</wui-flex>
|
|
3054
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
3055
|
+
`;
|
|
3056
|
+
}
|
|
3057
|
+
onRenderProxy() {
|
|
3058
|
+
!this.ready && this.uri && (this.timeout = setTimeout(() => {
|
|
3059
|
+
this.ready = !0;
|
|
3060
|
+
}, 200));
|
|
3061
|
+
}
|
|
3062
|
+
qrCodeTemplate() {
|
|
3063
|
+
if (!this.uri || !this.ready)
|
|
3064
|
+
return null;
|
|
3065
|
+
const t = this.getBoundingClientRect().width - 40, i = this.wallet ? this.wallet.name : void 0;
|
|
3066
|
+
L.setWcLinking(void 0), L.setRecentWallet(this.wallet);
|
|
3067
|
+
let r = this.uri;
|
|
3068
|
+
if (this.wallet?.mobile_link) {
|
|
3069
|
+
const { redirect: o } = P.formatNativeUrl(this.wallet?.mobile_link, this.uri, null);
|
|
3070
|
+
r = o;
|
|
3071
|
+
}
|
|
3072
|
+
return u` <wui-qr-code
|
|
3073
|
+
size=${t}
|
|
3074
|
+
theme=${Nt.state.themeMode}
|
|
3075
|
+
uri=${r}
|
|
3076
|
+
imageSrc=${z(we.getWalletImage(this.wallet))}
|
|
3077
|
+
color=${z(Nt.state.themeVariables["--w3m-qr-color"])}
|
|
3078
|
+
alt=${z(i)}
|
|
3079
|
+
data-testid="wui-qr-code"
|
|
3080
|
+
></wui-qr-code>`;
|
|
3081
|
+
}
|
|
3082
|
+
copyTemplate() {
|
|
3083
|
+
const t = !this.uri || !this.ready;
|
|
3084
|
+
return u`<wui-button
|
|
3085
|
+
.disabled=${t}
|
|
3086
|
+
@click=${this.onCopyUri}
|
|
3087
|
+
variant="neutral-secondary"
|
|
3088
|
+
size="sm"
|
|
3089
|
+
data-testid="copy-wc2-uri"
|
|
3090
|
+
>
|
|
3091
|
+
Copy link
|
|
3092
|
+
<wui-icon size="sm" color="inherit" name="copy" slot="iconRight"></wui-icon>
|
|
3093
|
+
</wui-button>`;
|
|
3094
|
+
}
|
|
3095
|
+
};
|
|
3096
|
+
Xe.styles = Hi;
|
|
3097
|
+
Un([
|
|
3098
|
+
d({ type: Boolean })
|
|
3099
|
+
], Xe.prototype, "basic", void 0);
|
|
3100
|
+
Xe = Un([
|
|
3101
|
+
O("w3m-connecting-wc-qrcode")
|
|
3102
|
+
], Xe);
|
|
3103
|
+
var Gi = function(e, t, i, r) {
|
|
3104
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
3105
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
3106
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
3107
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
3108
|
+
};
|
|
3109
|
+
let _n = class extends M {
|
|
3110
|
+
constructor() {
|
|
3111
|
+
if (super(), this.wallet = B.state.data?.wallet, !this.wallet)
|
|
3112
|
+
throw new Error("w3m-connecting-wc-unsupported: No wallet provided");
|
|
3113
|
+
F.sendEvent({
|
|
3114
|
+
type: "track",
|
|
3115
|
+
event: "SELECT_WALLET",
|
|
3116
|
+
properties: {
|
|
3117
|
+
name: this.wallet.name,
|
|
3118
|
+
platform: "browser",
|
|
3119
|
+
displayIndex: this.wallet?.display_index,
|
|
3120
|
+
walletRank: this.wallet?.order,
|
|
3121
|
+
view: B.state.view
|
|
3122
|
+
}
|
|
3123
|
+
});
|
|
3124
|
+
}
|
|
3125
|
+
render() {
|
|
3126
|
+
return u`
|
|
3127
|
+
<wui-flex
|
|
3128
|
+
flexDirection="column"
|
|
3129
|
+
alignItems="center"
|
|
3130
|
+
.padding=${["10", "5", "5", "5"]}
|
|
3131
|
+
gap="5"
|
|
3132
|
+
>
|
|
3133
|
+
<wui-wallet-image
|
|
3134
|
+
size="lg"
|
|
3135
|
+
imageSrc=${z(we.getWalletImage(this.wallet))}
|
|
3136
|
+
></wui-wallet-image>
|
|
3137
|
+
|
|
3138
|
+
<wui-text variant="md-regular" color="primary">Not Detected</wui-text>
|
|
3139
|
+
</wui-flex>
|
|
3140
|
+
|
|
3141
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
3142
|
+
`;
|
|
3143
|
+
}
|
|
3144
|
+
};
|
|
3145
|
+
_n = Gi([
|
|
3146
|
+
O("w3m-connecting-wc-unsupported")
|
|
3147
|
+
], _n);
|
|
3148
|
+
var qn = function(e, t, i, r) {
|
|
3149
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
3150
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
3151
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
3152
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
3153
|
+
};
|
|
3154
|
+
let Dt = class extends U {
|
|
3155
|
+
constructor() {
|
|
3156
|
+
if (super(), this.isLoading = !0, !this.wallet)
|
|
3157
|
+
throw new Error("w3m-connecting-wc-web: No wallet provided");
|
|
3158
|
+
this.onConnect = this.onConnectProxy.bind(this), this.secondaryBtnLabel = "Open", this.secondaryLabel = Pn.CONNECT_LABELS.MOBILE, this.secondaryBtnIcon = "externalLink", this.updateLoadingState(), this.unsubscribe.push(L.subscribeKey("wcUri", () => {
|
|
3159
|
+
this.updateLoadingState();
|
|
3160
|
+
})), F.sendEvent({
|
|
3161
|
+
type: "track",
|
|
3162
|
+
event: "SELECT_WALLET",
|
|
3163
|
+
properties: {
|
|
3164
|
+
name: this.wallet.name,
|
|
3165
|
+
platform: "web",
|
|
3166
|
+
displayIndex: this.wallet?.display_index,
|
|
3167
|
+
walletRank: this.wallet?.order,
|
|
3168
|
+
view: B.state.view
|
|
3169
|
+
}
|
|
3170
|
+
});
|
|
3171
|
+
}
|
|
3172
|
+
updateLoadingState() {
|
|
3173
|
+
this.isLoading = !this.uri;
|
|
3174
|
+
}
|
|
3175
|
+
onConnectProxy() {
|
|
3176
|
+
if (this.wallet?.webapp_link && this.uri)
|
|
3177
|
+
try {
|
|
3178
|
+
this.error = !1;
|
|
3179
|
+
const { webapp_link: t, name: i } = this.wallet, { redirect: r, href: o } = P.formatUniversalUrl(t, this.uri);
|
|
3180
|
+
L.setWcLinking({ name: i, href: o }), L.setRecentWallet(this.wallet), P.openHref(r, "_blank");
|
|
3181
|
+
} catch {
|
|
3182
|
+
this.error = !0;
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
};
|
|
3186
|
+
qn([
|
|
3187
|
+
_()
|
|
3188
|
+
], Dt.prototype, "isLoading", void 0);
|
|
3189
|
+
Dt = qn([
|
|
3190
|
+
O("w3m-connecting-wc-web")
|
|
3191
|
+
], Dt);
|
|
3192
|
+
const Qi = j`
|
|
3193
|
+
:host([data-mobile-fullscreen='true']) {
|
|
3194
|
+
height: 100%;
|
|
3195
|
+
display: flex;
|
|
3196
|
+
flex-direction: column;
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
:host([data-mobile-fullscreen='true']) wui-ux-by-reown {
|
|
3200
|
+
margin-top: auto;
|
|
3201
|
+
}
|
|
3202
|
+
`;
|
|
3203
|
+
var We = function(e, t, i, r) {
|
|
3204
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
3205
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
3206
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
3207
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
3208
|
+
};
|
|
3209
|
+
let de = class extends M {
|
|
3210
|
+
constructor() {
|
|
3211
|
+
super(), this.wallet = B.state.data?.wallet, this.unsubscribe = [], this.platform = void 0, this.platforms = [], this.isSiwxEnabled = !!q.state.siwx, this.remoteFeatures = q.state.remoteFeatures, this.displayBranding = !0, this.basic = !1, this.determinePlatforms(), this.initializeConnection(), this.unsubscribe.push(q.subscribeKey("remoteFeatures", (t) => this.remoteFeatures = t));
|
|
3212
|
+
}
|
|
3213
|
+
disconnectedCallback() {
|
|
3214
|
+
this.unsubscribe.forEach((t) => t());
|
|
3215
|
+
}
|
|
3216
|
+
render() {
|
|
3217
|
+
return q.state.enableMobileFullScreen && this.setAttribute("data-mobile-fullscreen", "true"), u`
|
|
3218
|
+
${this.headerTemplate()}
|
|
3219
|
+
<div class="platform-container">${this.platformTemplate()}</div>
|
|
3220
|
+
${this.reownBrandingTemplate()}
|
|
3221
|
+
`;
|
|
3222
|
+
}
|
|
3223
|
+
reownBrandingTemplate() {
|
|
3224
|
+
return !this.remoteFeatures?.reownBranding || !this.displayBranding ? null : u`<wui-ux-by-reown></wui-ux-by-reown>`;
|
|
3225
|
+
}
|
|
3226
|
+
async initializeConnection(t = !1) {
|
|
3227
|
+
if (!(this.platform === "browser" || q.state.manualWCControl && !t))
|
|
3228
|
+
try {
|
|
3229
|
+
const { wcPairingExpiry: i, status: r } = L.state, { redirectView: o } = B.state.data ?? {};
|
|
3230
|
+
if (t || q.state.enableEmbedded || P.isPairingExpired(i) || r === "connecting") {
|
|
3231
|
+
const n = L.getConnections(ge.state.activeChain), s = this.remoteFeatures?.multiWallet, a = n.length > 0;
|
|
3232
|
+
await L.connectWalletConnect({ cache: "never" }), this.isSiwxEnabled || (a && s ? (B.replace("ProfileWallets"), je.showSuccess("New Wallet Added")) : o ? B.replace(o) : kn.close());
|
|
3233
|
+
}
|
|
3234
|
+
} catch (i) {
|
|
3235
|
+
if (i instanceof Error && i.message.includes("An error occurred when attempting to switch chain") && !q.state.enableNetworkSwitch && ge.state.activeChain) {
|
|
3236
|
+
ge.setActiveCaipNetwork(Xn.getUnsupportedNetwork(`${ge.state.activeChain}:${ge.state.activeCaipNetwork?.id}`)), ge.showUnsupportedChainUI();
|
|
3237
|
+
return;
|
|
3238
|
+
}
|
|
3239
|
+
i instanceof An && i.originalName === Bn.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST ? F.sendEvent({
|
|
3240
|
+
type: "track",
|
|
3241
|
+
event: "USER_REJECTED",
|
|
3242
|
+
properties: { message: i.message }
|
|
3243
|
+
}) : F.sendEvent({
|
|
3244
|
+
type: "track",
|
|
3245
|
+
event: "CONNECT_ERROR",
|
|
3246
|
+
properties: { message: i?.message ?? "Unknown" }
|
|
3247
|
+
}), L.setWcError(!0), je.showError(i.message ?? "Connection error"), L.resetWcConnection(), B.goBack();
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
determinePlatforms() {
|
|
3251
|
+
if (!this.wallet) {
|
|
3252
|
+
this.platforms.push("qrcode"), this.platform = "qrcode";
|
|
3253
|
+
return;
|
|
3254
|
+
}
|
|
3255
|
+
if (this.platform)
|
|
3256
|
+
return;
|
|
3257
|
+
const { mobile_link: t, desktop_link: i, webapp_link: r, injected: o, rdns: n } = this.wallet, s = o?.map(({ injected_id: x }) => x).filter(Boolean), a = [...n ? [n] : s ?? []], l = q.state.isUniversalProvider ? !1 : a.length, c = t, w = r, E = L.checkInstalled(a), $ = l && E, m = i && !P.isMobile();
|
|
3258
|
+
$ && !ge.state.noAdapters && this.platforms.push("browser"), c && this.platforms.push(P.isMobile() ? "mobile" : "qrcode"), w && this.platforms.push("web"), m && this.platforms.push("desktop"), !$ && l && !ge.state.noAdapters && this.platforms.push("unsupported"), this.platform = this.platforms[0];
|
|
3259
|
+
}
|
|
3260
|
+
platformTemplate() {
|
|
3261
|
+
switch (this.platform) {
|
|
3262
|
+
case "browser":
|
|
3263
|
+
return u`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;
|
|
3264
|
+
case "web":
|
|
3265
|
+
return u`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;
|
|
3266
|
+
case "desktop":
|
|
3267
|
+
return u`
|
|
3268
|
+
<w3m-connecting-wc-desktop .onRetry=${() => this.initializeConnection(!0)}>
|
|
3269
|
+
</w3m-connecting-wc-desktop>
|
|
3270
|
+
`;
|
|
3271
|
+
case "mobile":
|
|
3272
|
+
return u`
|
|
3273
|
+
<w3m-connecting-wc-mobile isMobile .onRetry=${() => this.initializeConnection(!0)}>
|
|
3274
|
+
</w3m-connecting-wc-mobile>
|
|
3275
|
+
`;
|
|
3276
|
+
case "qrcode":
|
|
3277
|
+
return u`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`;
|
|
3278
|
+
default:
|
|
3279
|
+
return u`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`;
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
headerTemplate() {
|
|
3283
|
+
return this.platforms.length > 1 ? u`
|
|
3284
|
+
<w3m-connecting-header
|
|
3285
|
+
.platforms=${this.platforms}
|
|
3286
|
+
.onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
|
|
3287
|
+
>
|
|
3288
|
+
</w3m-connecting-header>
|
|
3289
|
+
` : null;
|
|
3290
|
+
}
|
|
3291
|
+
async onSelectPlatform(t) {
|
|
3292
|
+
const i = this.shadowRoot?.querySelector("div");
|
|
3293
|
+
i && (await i.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
3294
|
+
duration: 200,
|
|
3295
|
+
fill: "forwards",
|
|
3296
|
+
easing: "ease"
|
|
3297
|
+
}).finished, this.platform = t, i.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
3298
|
+
duration: 200,
|
|
3299
|
+
fill: "forwards",
|
|
3300
|
+
easing: "ease"
|
|
3301
|
+
}));
|
|
3302
|
+
}
|
|
3303
|
+
};
|
|
3304
|
+
de.styles = Qi;
|
|
3305
|
+
We([
|
|
3306
|
+
_()
|
|
3307
|
+
], de.prototype, "platform", void 0);
|
|
3308
|
+
We([
|
|
3309
|
+
_()
|
|
3310
|
+
], de.prototype, "platforms", void 0);
|
|
3311
|
+
We([
|
|
3312
|
+
_()
|
|
3313
|
+
], de.prototype, "isSiwxEnabled", void 0);
|
|
3314
|
+
We([
|
|
3315
|
+
_()
|
|
3316
|
+
], de.prototype, "remoteFeatures", void 0);
|
|
3317
|
+
We([
|
|
3318
|
+
d({ type: Boolean })
|
|
3319
|
+
], de.prototype, "displayBranding", void 0);
|
|
3320
|
+
We([
|
|
3321
|
+
d({ type: Boolean })
|
|
3322
|
+
], de.prototype, "basic", void 0);
|
|
3323
|
+
de = We([
|
|
3324
|
+
O("w3m-connecting-wc-view")
|
|
3325
|
+
], de);
|
|
3326
|
+
var jt = function(e, t, i, r) {
|
|
3327
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
3328
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
3329
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
3330
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
3331
|
+
};
|
|
3332
|
+
let Ze = class extends M {
|
|
3333
|
+
constructor() {
|
|
3334
|
+
super(), this.unsubscribe = [], this.isMobile = P.isMobile(), this.remoteFeatures = q.state.remoteFeatures, this.unsubscribe.push(q.subscribeKey("remoteFeatures", (t) => this.remoteFeatures = t));
|
|
3335
|
+
}
|
|
3336
|
+
disconnectedCallback() {
|
|
3337
|
+
this.unsubscribe.forEach((t) => t());
|
|
3338
|
+
}
|
|
3339
|
+
render() {
|
|
3340
|
+
if (this.isMobile) {
|
|
3341
|
+
const { featured: t, recommended: i } = N.state, { customWallets: r } = q.state, o = Zn.getRecentWallets(), n = t.length || i.length || r?.length || o.length;
|
|
3342
|
+
return u`<wui-flex flexDirection="column" gap="2" .margin=${["1", "3", "3", "3"]}>
|
|
3343
|
+
${n ? u`<w3m-connector-list></w3m-connector-list>` : null}
|
|
3344
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget>
|
|
3345
|
+
</wui-flex>`;
|
|
3346
|
+
}
|
|
3347
|
+
return u`<wui-flex flexDirection="column" .padding=${["0", "0", "4", "0"]}>
|
|
3348
|
+
<w3m-connecting-wc-view ?basic=${!0} .displayBranding=${!1}></w3m-connecting-wc-view>
|
|
3349
|
+
<wui-flex flexDirection="column" .padding=${["0", "3", "0", "3"]}>
|
|
3350
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget>
|
|
3351
|
+
</wui-flex>
|
|
3352
|
+
</wui-flex>
|
|
3353
|
+
${this.reownBrandingTemplate()} `;
|
|
3354
|
+
}
|
|
3355
|
+
reownBrandingTemplate() {
|
|
3356
|
+
return this.remoteFeatures?.reownBranding ? u` <wui-flex flexDirection="column" .padding=${["1", "0", "1", "0"]}>
|
|
3357
|
+
<wui-ux-by-reown></wui-ux-by-reown>
|
|
3358
|
+
</wui-flex>` : null;
|
|
3359
|
+
}
|
|
3360
|
+
};
|
|
3361
|
+
jt([
|
|
3362
|
+
_()
|
|
3363
|
+
], Ze.prototype, "isMobile", void 0);
|
|
3364
|
+
jt([
|
|
3365
|
+
_()
|
|
3366
|
+
], Ze.prototype, "remoteFeatures", void 0);
|
|
3367
|
+
Ze = jt([
|
|
3368
|
+
O("w3m-connecting-wc-basic-view")
|
|
3369
|
+
], Ze);
|
|
3370
|
+
const Yi = (e) => e.strings === void 0;
|
|
3371
|
+
const ze = (e, t) => {
|
|
3372
|
+
const i = e._$AN;
|
|
3373
|
+
if (i === void 0) return !1;
|
|
3374
|
+
for (const r of i) r._$AO?.(t, !1), ze(r, t);
|
|
3375
|
+
return !0;
|
|
3376
|
+
}, et = (e) => {
|
|
3377
|
+
let t, i;
|
|
3378
|
+
do {
|
|
3379
|
+
if ((t = e._$AM) === void 0) break;
|
|
3380
|
+
i = t._$AN, i.delete(e), e = t;
|
|
3381
|
+
} while (i?.size === 0);
|
|
3382
|
+
}, Fn = (e) => {
|
|
3383
|
+
for (let t; t = e._$AM; e = t) {
|
|
3384
|
+
let i = t._$AN;
|
|
3385
|
+
if (i === void 0) t._$AN = i = /* @__PURE__ */ new Set();
|
|
3386
|
+
else if (i.has(e)) break;
|
|
3387
|
+
i.add(e), Zi(t);
|
|
3388
|
+
}
|
|
3389
|
+
};
|
|
3390
|
+
function Ji(e) {
|
|
3391
|
+
this._$AN !== void 0 ? (et(this), this._$AM = e, Fn(this)) : this._$AM = e;
|
|
3392
|
+
}
|
|
3393
|
+
function Xi(e, t = !1, i = 0) {
|
|
3394
|
+
const r = this._$AH, o = this._$AN;
|
|
3395
|
+
if (o !== void 0 && o.size !== 0) if (t) if (Array.isArray(r)) for (let n = i; n < r.length; n++) ze(r[n], !1), et(r[n]);
|
|
3396
|
+
else r != null && (ze(r, !1), et(r));
|
|
3397
|
+
else ze(this, e);
|
|
3398
|
+
}
|
|
3399
|
+
const Zi = (e) => {
|
|
3400
|
+
e.type == ti.CHILD && (e._$AP ??= Xi, e._$AQ ??= Ji);
|
|
3401
|
+
};
|
|
3402
|
+
let er = class extends ei {
|
|
3403
|
+
constructor() {
|
|
3404
|
+
super(...arguments), this._$AN = void 0;
|
|
3405
|
+
}
|
|
3406
|
+
_$AT(t, i, r) {
|
|
3407
|
+
super._$AT(t, i, r), Fn(this), this.isConnected = t._$AU;
|
|
3408
|
+
}
|
|
3409
|
+
_$AO(t, i = !0) {
|
|
3410
|
+
t !== this.isConnected && (this.isConnected = t, t ? this.reconnected?.() : this.disconnected?.()), i && (ze(this, t), et(this));
|
|
3411
|
+
}
|
|
3412
|
+
setValue(t) {
|
|
3413
|
+
if (Yi(this._$Ct)) this._$Ct._$AI(t, this);
|
|
3414
|
+
else {
|
|
3415
|
+
const i = [...this._$Ct._$AH];
|
|
3416
|
+
i[this._$Ci] = t, this._$Ct._$AI(i, this, 0);
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3419
|
+
disconnected() {
|
|
3420
|
+
}
|
|
3421
|
+
reconnected() {
|
|
3422
|
+
}
|
|
3423
|
+
};
|
|
3424
|
+
const Ut = () => new tr();
|
|
3425
|
+
let tr = class {
|
|
3426
|
+
};
|
|
3427
|
+
const Lt = /* @__PURE__ */ new WeakMap(), qt = ni(class extends er {
|
|
3428
|
+
render(e) {
|
|
3429
|
+
return Qt;
|
|
3430
|
+
}
|
|
3431
|
+
update(e, [t]) {
|
|
3432
|
+
const i = t !== this.G;
|
|
3433
|
+
return i && this.G !== void 0 && this.rt(void 0), (i || this.lt !== this.ct) && (this.G = t, this.ht = e.options?.host, this.rt(this.ct = e.element)), Qt;
|
|
3434
|
+
}
|
|
3435
|
+
rt(e) {
|
|
3436
|
+
if (this.isConnected || (e = void 0), typeof this.G == "function") {
|
|
3437
|
+
const t = this.ht ?? globalThis;
|
|
3438
|
+
let i = Lt.get(t);
|
|
3439
|
+
i === void 0 && (i = /* @__PURE__ */ new WeakMap(), Lt.set(t, i)), i.get(this.G) !== void 0 && this.G.call(this.ht, void 0), i.set(this.G, e), e !== void 0 && this.G.call(this.ht, e);
|
|
3440
|
+
} else this.G.value = e;
|
|
3441
|
+
}
|
|
3442
|
+
get lt() {
|
|
3443
|
+
return typeof this.G == "function" ? Lt.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
|
|
3444
|
+
}
|
|
3445
|
+
disconnected() {
|
|
3446
|
+
this.lt === this.ct && this.rt(void 0);
|
|
3447
|
+
}
|
|
3448
|
+
reconnected() {
|
|
3449
|
+
this.rt(this.ct);
|
|
3450
|
+
}
|
|
3451
|
+
}), nr = j`
|
|
3452
|
+
:host {
|
|
3453
|
+
display: flex;
|
|
3454
|
+
align-items: center;
|
|
3455
|
+
justify-content: center;
|
|
3456
|
+
}
|
|
3457
|
+
|
|
3458
|
+
label {
|
|
3459
|
+
position: relative;
|
|
3460
|
+
display: inline-block;
|
|
3461
|
+
user-select: none;
|
|
3462
|
+
transition:
|
|
3463
|
+
background-color ${({ durations: e }) => e.lg}
|
|
3464
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
3465
|
+
color ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
3466
|
+
border ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
3467
|
+
box-shadow ${({ durations: e }) => e.lg}
|
|
3468
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
3469
|
+
width ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
3470
|
+
height ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
3471
|
+
transform ${({ durations: e }) => e.lg}
|
|
3472
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
3473
|
+
opacity ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]};
|
|
3474
|
+
will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
|
|
3475
|
+
}
|
|
3476
|
+
|
|
3477
|
+
input {
|
|
3478
|
+
width: 0;
|
|
3479
|
+
height: 0;
|
|
3480
|
+
opacity: 0;
|
|
3481
|
+
}
|
|
3482
|
+
|
|
3483
|
+
span {
|
|
3484
|
+
position: absolute;
|
|
3485
|
+
cursor: pointer;
|
|
3486
|
+
top: 0;
|
|
3487
|
+
left: 0;
|
|
3488
|
+
right: 0;
|
|
3489
|
+
bottom: 0;
|
|
3490
|
+
background-color: ${({ colors: e }) => e.neutrals300};
|
|
3491
|
+
border-radius: ${({ borderRadius: e }) => e.round};
|
|
3492
|
+
border: 1px solid transparent;
|
|
3493
|
+
will-change: border;
|
|
3494
|
+
transition:
|
|
3495
|
+
background-color ${({ durations: e }) => e.lg}
|
|
3496
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
3497
|
+
color ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
3498
|
+
border ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
3499
|
+
box-shadow ${({ durations: e }) => e.lg}
|
|
3500
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
3501
|
+
width ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
3502
|
+
height ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
3503
|
+
transform ${({ durations: e }) => e.lg}
|
|
3504
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
3505
|
+
opacity ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]};
|
|
3506
|
+
will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
|
|
3507
|
+
}
|
|
3508
|
+
|
|
3509
|
+
span:before {
|
|
3510
|
+
content: '';
|
|
3511
|
+
position: absolute;
|
|
3512
|
+
background-color: ${({ colors: e }) => e.white};
|
|
3513
|
+
border-radius: 50%;
|
|
3514
|
+
}
|
|
3515
|
+
|
|
3516
|
+
/* -- Sizes --------------------------------------------------------- */
|
|
3517
|
+
label[data-size='lg'] {
|
|
3518
|
+
width: 48px;
|
|
3519
|
+
height: 32px;
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
label[data-size='md'] {
|
|
3523
|
+
width: 40px;
|
|
3524
|
+
height: 28px;
|
|
3525
|
+
}
|
|
3526
|
+
|
|
3527
|
+
label[data-size='sm'] {
|
|
3528
|
+
width: 32px;
|
|
3529
|
+
height: 22px;
|
|
3530
|
+
}
|
|
3531
|
+
|
|
3532
|
+
label[data-size='lg'] > span:before {
|
|
3533
|
+
height: 24px;
|
|
3534
|
+
width: 24px;
|
|
3535
|
+
left: 4px;
|
|
3536
|
+
top: 3px;
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3539
|
+
label[data-size='md'] > span:before {
|
|
3540
|
+
height: 20px;
|
|
3541
|
+
width: 20px;
|
|
3542
|
+
left: 4px;
|
|
3543
|
+
top: 3px;
|
|
3544
|
+
}
|
|
3545
|
+
|
|
3546
|
+
label[data-size='sm'] > span:before {
|
|
3547
|
+
height: 16px;
|
|
3548
|
+
width: 16px;
|
|
3549
|
+
left: 3px;
|
|
3550
|
+
top: 2px;
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
/* -- Focus states --------------------------------------------------- */
|
|
3554
|
+
input:focus-visible:not(:checked) + span,
|
|
3555
|
+
input:focus:not(:checked) + span {
|
|
3556
|
+
border: 1px solid ${({ tokens: e }) => e.core.iconAccentPrimary};
|
|
3557
|
+
background-color: ${({ tokens: e }) => e.theme.textTertiary};
|
|
3558
|
+
box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
|
|
3559
|
+
}
|
|
3560
|
+
|
|
3561
|
+
input:focus-visible:checked + span,
|
|
3562
|
+
input:focus:checked + span {
|
|
3563
|
+
border: 1px solid ${({ tokens: e }) => e.core.iconAccentPrimary};
|
|
3564
|
+
box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3567
|
+
/* -- Checked states --------------------------------------------------- */
|
|
3568
|
+
input:checked + span {
|
|
3569
|
+
background-color: ${({ tokens: e }) => e.core.iconAccentPrimary};
|
|
3570
|
+
}
|
|
3571
|
+
|
|
3572
|
+
label[data-size='lg'] > input:checked + span:before {
|
|
3573
|
+
transform: translateX(calc(100% - 9px));
|
|
3574
|
+
}
|
|
3575
|
+
|
|
3576
|
+
label[data-size='md'] > input:checked + span:before {
|
|
3577
|
+
transform: translateX(calc(100% - 9px));
|
|
3578
|
+
}
|
|
3579
|
+
|
|
3580
|
+
label[data-size='sm'] > input:checked + span:before {
|
|
3581
|
+
transform: translateX(calc(100% - 7px));
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
/* -- Hover states ------------------------------------------------------- */
|
|
3585
|
+
label:hover > input:not(:checked):not(:disabled) + span {
|
|
3586
|
+
background-color: ${({ colors: e }) => e.neutrals400};
|
|
3587
|
+
}
|
|
3588
|
+
|
|
3589
|
+
label:hover > input:checked:not(:disabled) + span {
|
|
3590
|
+
background-color: ${({ colors: e }) => e.accent080};
|
|
3591
|
+
}
|
|
3592
|
+
|
|
3593
|
+
/* -- Disabled state --------------------------------------------------- */
|
|
3594
|
+
label:has(input:disabled) {
|
|
3595
|
+
pointer-events: none;
|
|
3596
|
+
user-select: none;
|
|
3597
|
+
}
|
|
3598
|
+
|
|
3599
|
+
input:not(:checked):disabled + span {
|
|
3600
|
+
background-color: ${({ colors: e }) => e.neutrals700};
|
|
3601
|
+
}
|
|
3602
|
+
|
|
3603
|
+
input:checked:disabled + span {
|
|
3604
|
+
background-color: ${({ colors: e }) => e.neutrals700};
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
input:not(:checked):disabled + span::before {
|
|
3608
|
+
background-color: ${({ colors: e }) => e.neutrals400};
|
|
3609
|
+
}
|
|
3610
|
+
|
|
3611
|
+
input:checked:disabled + span::before {
|
|
3612
|
+
background-color: ${({ tokens: e }) => e.theme.textTertiary};
|
|
3613
|
+
}
|
|
3614
|
+
`;
|
|
3615
|
+
var st = function(e, t, i, r) {
|
|
3616
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
3617
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
3618
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
3619
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
3620
|
+
};
|
|
3621
|
+
let Pe = class extends M {
|
|
3622
|
+
constructor() {
|
|
3623
|
+
super(...arguments), this.inputElementRef = Ut(), this.checked = !1, this.disabled = !1, this.size = "md";
|
|
3624
|
+
}
|
|
3625
|
+
render() {
|
|
3626
|
+
return u`
|
|
3627
|
+
<label data-size=${this.size}>
|
|
3628
|
+
<input
|
|
3629
|
+
${qt(this.inputElementRef)}
|
|
3630
|
+
type="checkbox"
|
|
3631
|
+
?checked=${this.checked}
|
|
3632
|
+
?disabled=${this.disabled}
|
|
3633
|
+
@change=${this.dispatchChangeEvent.bind(this)}
|
|
3634
|
+
/>
|
|
3635
|
+
<span></span>
|
|
3636
|
+
</label>
|
|
3637
|
+
`;
|
|
3638
|
+
}
|
|
3639
|
+
dispatchChangeEvent() {
|
|
3640
|
+
this.dispatchEvent(new CustomEvent("switchChange", {
|
|
3641
|
+
detail: this.inputElementRef.value?.checked,
|
|
3642
|
+
bubbles: !0,
|
|
3643
|
+
composed: !0
|
|
3644
|
+
}));
|
|
3645
|
+
}
|
|
3646
|
+
};
|
|
3647
|
+
Pe.styles = [G, he, nr];
|
|
3648
|
+
st([
|
|
3649
|
+
d({ type: Boolean })
|
|
3650
|
+
], Pe.prototype, "checked", void 0);
|
|
3651
|
+
st([
|
|
3652
|
+
d({ type: Boolean })
|
|
3653
|
+
], Pe.prototype, "disabled", void 0);
|
|
3654
|
+
st([
|
|
3655
|
+
d()
|
|
3656
|
+
], Pe.prototype, "size", void 0);
|
|
3657
|
+
Pe = st([
|
|
3658
|
+
O("wui-toggle")
|
|
3659
|
+
], Pe);
|
|
3660
|
+
const ir = j`
|
|
3661
|
+
:host {
|
|
3662
|
+
height: auto;
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
:host > wui-flex {
|
|
3666
|
+
height: 100%;
|
|
3667
|
+
display: flex;
|
|
3668
|
+
align-items: center;
|
|
3669
|
+
justify-content: center;
|
|
3670
|
+
column-gap: ${({ spacing: e }) => e[2]};
|
|
3671
|
+
padding: ${({ spacing: e }) => e[2]} ${({ spacing: e }) => e[3]};
|
|
3672
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
3673
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
3674
|
+
box-shadow: inset 0 0 0 1px ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
3675
|
+
transition: background-color ${({ durations: e }) => e.lg}
|
|
3676
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
3677
|
+
will-change: background-color;
|
|
3678
|
+
cursor: pointer;
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
wui-switch {
|
|
3682
|
+
pointer-events: none;
|
|
3683
|
+
}
|
|
3684
|
+
`;
|
|
3685
|
+
var Vn = function(e, t, i, r) {
|
|
3686
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
3687
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
3688
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
3689
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
3690
|
+
};
|
|
3691
|
+
let tt = class extends M {
|
|
3692
|
+
constructor() {
|
|
3693
|
+
super(...arguments), this.checked = !1;
|
|
3694
|
+
}
|
|
3695
|
+
render() {
|
|
3696
|
+
return u`
|
|
3697
|
+
<wui-flex>
|
|
3698
|
+
<wui-icon size="xl" name="walletConnectBrown"></wui-icon>
|
|
3699
|
+
<wui-toggle
|
|
3700
|
+
?checked=${this.checked}
|
|
3701
|
+
size="sm"
|
|
3702
|
+
@switchChange=${this.handleToggleChange.bind(this)}
|
|
3703
|
+
></wui-toggle>
|
|
3704
|
+
</wui-flex>
|
|
3705
|
+
`;
|
|
3706
|
+
}
|
|
3707
|
+
handleToggleChange(t) {
|
|
3708
|
+
t.stopPropagation(), this.checked = t.detail, this.dispatchSwitchEvent();
|
|
3709
|
+
}
|
|
3710
|
+
dispatchSwitchEvent() {
|
|
3711
|
+
this.dispatchEvent(new CustomEvent("certifiedSwitchChange", {
|
|
3712
|
+
detail: this.checked,
|
|
3713
|
+
bubbles: !0,
|
|
3714
|
+
composed: !0
|
|
3715
|
+
}));
|
|
3716
|
+
}
|
|
3717
|
+
};
|
|
3718
|
+
tt.styles = [G, he, ir];
|
|
3719
|
+
Vn([
|
|
3720
|
+
d({ type: Boolean })
|
|
3721
|
+
], tt.prototype, "checked", void 0);
|
|
3722
|
+
tt = Vn([
|
|
3723
|
+
O("wui-certified-switch")
|
|
3724
|
+
], tt);
|
|
3725
|
+
const rr = j`
|
|
3726
|
+
:host {
|
|
3727
|
+
position: relative;
|
|
3728
|
+
width: 100%;
|
|
3729
|
+
display: inline-flex;
|
|
3730
|
+
flex-direction: column;
|
|
3731
|
+
gap: ${({ spacing: e }) => e[3]};
|
|
3732
|
+
color: ${({ tokens: e }) => e.theme.textPrimary};
|
|
3733
|
+
caret-color: ${({ tokens: e }) => e.core.textAccentPrimary};
|
|
3734
|
+
}
|
|
3735
|
+
|
|
3736
|
+
.wui-input-text-container {
|
|
3737
|
+
position: relative;
|
|
3738
|
+
display: flex;
|
|
3739
|
+
}
|
|
3740
|
+
|
|
3741
|
+
input {
|
|
3742
|
+
width: 100%;
|
|
3743
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
3744
|
+
color: inherit;
|
|
3745
|
+
background: transparent;
|
|
3746
|
+
border: 1px solid ${({ tokens: e }) => e.theme.borderPrimary};
|
|
3747
|
+
caret-color: ${({ tokens: e }) => e.core.textAccentPrimary};
|
|
3748
|
+
padding: ${({ spacing: e }) => e[3]} ${({ spacing: e }) => e[3]}
|
|
3749
|
+
${({ spacing: e }) => e[3]} ${({ spacing: e }) => e[10]};
|
|
3750
|
+
font-size: ${({ textSize: e }) => e.large};
|
|
3751
|
+
line-height: ${({ typography: e }) => e["lg-regular"].lineHeight};
|
|
3752
|
+
letter-spacing: ${({ typography: e }) => e["lg-regular"].letterSpacing};
|
|
3753
|
+
font-weight: ${({ fontWeight: e }) => e.regular};
|
|
3754
|
+
font-family: ${({ fontFamily: e }) => e.regular};
|
|
3755
|
+
}
|
|
3756
|
+
|
|
3757
|
+
input[data-size='lg'] {
|
|
3758
|
+
padding: ${({ spacing: e }) => e[4]} ${({ spacing: e }) => e[3]}
|
|
3759
|
+
${({ spacing: e }) => e[4]} ${({ spacing: e }) => e[10]};
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
@media (hover: hover) and (pointer: fine) {
|
|
3763
|
+
input:hover:enabled {
|
|
3764
|
+
border: 1px solid ${({ tokens: e }) => e.theme.borderSecondary};
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3768
|
+
input:disabled {
|
|
3769
|
+
cursor: unset;
|
|
3770
|
+
border: 1px solid ${({ tokens: e }) => e.theme.borderPrimary};
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3773
|
+
input::placeholder {
|
|
3774
|
+
color: ${({ tokens: e }) => e.theme.textSecondary};
|
|
3775
|
+
}
|
|
3776
|
+
|
|
3777
|
+
input:focus:enabled {
|
|
3778
|
+
border: 1px solid ${({ tokens: e }) => e.theme.borderSecondary};
|
|
3779
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
3780
|
+
-webkit-box-shadow: 0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent040};
|
|
3781
|
+
-moz-box-shadow: 0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent040};
|
|
3782
|
+
box-shadow: 0px 0px 0px 4px ${({ tokens: e }) => e.core.foregroundAccent040};
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3785
|
+
div.wui-input-text-container:has(input:disabled) {
|
|
3786
|
+
opacity: 0.5;
|
|
3787
|
+
}
|
|
3788
|
+
|
|
3789
|
+
wui-icon.wui-input-text-left-icon {
|
|
3790
|
+
position: absolute;
|
|
3791
|
+
top: 50%;
|
|
3792
|
+
transform: translateY(-50%);
|
|
3793
|
+
pointer-events: none;
|
|
3794
|
+
left: ${({ spacing: e }) => e[4]};
|
|
3795
|
+
color: ${({ tokens: e }) => e.theme.iconDefault};
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3798
|
+
button.wui-input-text-submit-button {
|
|
3799
|
+
position: absolute;
|
|
3800
|
+
top: 50%;
|
|
3801
|
+
transform: translateY(-50%);
|
|
3802
|
+
right: ${({ spacing: e }) => e[3]};
|
|
3803
|
+
width: 24px;
|
|
3804
|
+
height: 24px;
|
|
3805
|
+
border: none;
|
|
3806
|
+
background: transparent;
|
|
3807
|
+
border-radius: ${({ borderRadius: e }) => e[2]};
|
|
3808
|
+
color: ${({ tokens: e }) => e.core.textAccentPrimary};
|
|
3809
|
+
}
|
|
3810
|
+
|
|
3811
|
+
button.wui-input-text-submit-button:disabled {
|
|
3812
|
+
opacity: 1;
|
|
3813
|
+
}
|
|
3814
|
+
|
|
3815
|
+
button.wui-input-text-submit-button.loading wui-icon {
|
|
3816
|
+
animation: spin 1s linear infinite;
|
|
3817
|
+
}
|
|
3818
|
+
|
|
3819
|
+
button.wui-input-text-submit-button:hover {
|
|
3820
|
+
background: ${({ tokens: e }) => e.core.foregroundAccent010};
|
|
3821
|
+
}
|
|
3822
|
+
|
|
3823
|
+
input:has(+ .wui-input-text-submit-button) {
|
|
3824
|
+
padding-right: ${({ spacing: e }) => e[12]};
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
input[type='number'] {
|
|
3828
|
+
-moz-appearance: textfield;
|
|
3829
|
+
}
|
|
3830
|
+
|
|
3831
|
+
input[type='search']::-webkit-search-decoration,
|
|
3832
|
+
input[type='search']::-webkit-search-cancel-button,
|
|
3833
|
+
input[type='search']::-webkit-search-results-button,
|
|
3834
|
+
input[type='search']::-webkit-search-results-decoration {
|
|
3835
|
+
-webkit-appearance: none;
|
|
3836
|
+
}
|
|
3837
|
+
|
|
3838
|
+
/* -- Keyframes --------------------------------------------------- */
|
|
3839
|
+
@keyframes spin {
|
|
3840
|
+
from {
|
|
3841
|
+
transform: rotate(0deg);
|
|
3842
|
+
}
|
|
3843
|
+
to {
|
|
3844
|
+
transform: rotate(360deg);
|
|
3845
|
+
}
|
|
3846
|
+
}
|
|
3847
|
+
`;
|
|
3848
|
+
var J = function(e, t, i, r) {
|
|
3849
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
3850
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
3851
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
3852
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
3853
|
+
};
|
|
3854
|
+
let V = class extends M {
|
|
3855
|
+
constructor() {
|
|
3856
|
+
super(...arguments), this.inputElementRef = Ut(), this.disabled = !1, this.loading = !1, this.placeholder = "", this.type = "text", this.value = "", this.size = "md";
|
|
3857
|
+
}
|
|
3858
|
+
render() {
|
|
3859
|
+
return u` <div class="wui-input-text-container">
|
|
3860
|
+
${this.templateLeftIcon()}
|
|
3861
|
+
<input
|
|
3862
|
+
data-size=${this.size}
|
|
3863
|
+
${qt(this.inputElementRef)}
|
|
3864
|
+
data-testid="wui-input-text"
|
|
3865
|
+
type=${this.type}
|
|
3866
|
+
enterkeyhint=${z(this.enterKeyHint)}
|
|
3867
|
+
?disabled=${this.disabled}
|
|
3868
|
+
placeholder=${this.placeholder}
|
|
3869
|
+
@input=${this.dispatchInputChangeEvent.bind(this)}
|
|
3870
|
+
@keydown=${this.onKeyDown}
|
|
3871
|
+
.value=${this.value || ""}
|
|
3872
|
+
/>
|
|
3873
|
+
${this.templateSubmitButton()}
|
|
3874
|
+
<slot class="wui-input-text-slot"></slot>
|
|
3875
|
+
</div>
|
|
3876
|
+
${this.templateError()} ${this.templateWarning()}`;
|
|
3877
|
+
}
|
|
3878
|
+
templateLeftIcon() {
|
|
3879
|
+
return this.icon ? u`<wui-icon
|
|
3880
|
+
class="wui-input-text-left-icon"
|
|
3881
|
+
size="md"
|
|
3882
|
+
data-size=${this.size}
|
|
3883
|
+
color="inherit"
|
|
3884
|
+
name=${this.icon}
|
|
3885
|
+
></wui-icon>` : null;
|
|
3886
|
+
}
|
|
3887
|
+
templateSubmitButton() {
|
|
3888
|
+
return this.onSubmit ? u`<button
|
|
3889
|
+
class="wui-input-text-submit-button ${this.loading ? "loading" : ""}"
|
|
3890
|
+
@click=${this.onSubmit?.bind(this)}
|
|
3891
|
+
?disabled=${this.disabled || this.loading}
|
|
3892
|
+
>
|
|
3893
|
+
${this.loading ? u`<wui-icon name="spinner" size="md"></wui-icon>` : u`<wui-icon name="chevronRight" size="md"></wui-icon>`}
|
|
3894
|
+
</button>` : null;
|
|
3895
|
+
}
|
|
3896
|
+
templateError() {
|
|
3897
|
+
return this.errorText ? u`<wui-text variant="sm-regular" color="error">${this.errorText}</wui-text>` : null;
|
|
3898
|
+
}
|
|
3899
|
+
templateWarning() {
|
|
3900
|
+
return this.warningText ? u`<wui-text variant="sm-regular" color="warning">${this.warningText}</wui-text>` : null;
|
|
3901
|
+
}
|
|
3902
|
+
dispatchInputChangeEvent() {
|
|
3903
|
+
this.dispatchEvent(new CustomEvent("inputChange", {
|
|
3904
|
+
detail: this.inputElementRef.value?.value,
|
|
3905
|
+
bubbles: !0,
|
|
3906
|
+
composed: !0
|
|
3907
|
+
}));
|
|
3908
|
+
}
|
|
3909
|
+
};
|
|
3910
|
+
V.styles = [G, he, rr];
|
|
3911
|
+
J([
|
|
3912
|
+
d()
|
|
3913
|
+
], V.prototype, "icon", void 0);
|
|
3914
|
+
J([
|
|
3915
|
+
d({ type: Boolean })
|
|
3916
|
+
], V.prototype, "disabled", void 0);
|
|
3917
|
+
J([
|
|
3918
|
+
d({ type: Boolean })
|
|
3919
|
+
], V.prototype, "loading", void 0);
|
|
3920
|
+
J([
|
|
3921
|
+
d()
|
|
3922
|
+
], V.prototype, "placeholder", void 0);
|
|
3923
|
+
J([
|
|
3924
|
+
d()
|
|
3925
|
+
], V.prototype, "type", void 0);
|
|
3926
|
+
J([
|
|
3927
|
+
d()
|
|
3928
|
+
], V.prototype, "value", void 0);
|
|
3929
|
+
J([
|
|
3930
|
+
d()
|
|
3931
|
+
], V.prototype, "errorText", void 0);
|
|
3932
|
+
J([
|
|
3933
|
+
d()
|
|
3934
|
+
], V.prototype, "warningText", void 0);
|
|
3935
|
+
J([
|
|
3936
|
+
d()
|
|
3937
|
+
], V.prototype, "onSubmit", void 0);
|
|
3938
|
+
J([
|
|
3939
|
+
d()
|
|
3940
|
+
], V.prototype, "size", void 0);
|
|
3941
|
+
J([
|
|
3942
|
+
d({ attribute: !1 })
|
|
3943
|
+
], V.prototype, "onKeyDown", void 0);
|
|
3944
|
+
V = J([
|
|
3945
|
+
O("wui-input-text")
|
|
3946
|
+
], V);
|
|
3947
|
+
const or = j`
|
|
3948
|
+
:host {
|
|
3949
|
+
position: relative;
|
|
3950
|
+
display: inline-block;
|
|
3951
|
+
width: 100%;
|
|
3952
|
+
}
|
|
3953
|
+
|
|
3954
|
+
wui-icon {
|
|
3955
|
+
position: absolute;
|
|
3956
|
+
top: 50%;
|
|
3957
|
+
transform: translateY(-50%);
|
|
3958
|
+
right: ${({ spacing: e }) => e[3]};
|
|
3959
|
+
color: ${({ tokens: e }) => e.theme.iconDefault};
|
|
3960
|
+
cursor: pointer;
|
|
3961
|
+
padding: ${({ spacing: e }) => e[2]};
|
|
3962
|
+
background-color: transparent;
|
|
3963
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
3964
|
+
transition: background-color ${({ durations: e }) => e.lg}
|
|
3965
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
3966
|
+
}
|
|
3967
|
+
|
|
3968
|
+
@media (hover: hover) {
|
|
3969
|
+
wui-icon:hover {
|
|
3970
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
3971
|
+
}
|
|
3972
|
+
}
|
|
3973
|
+
`;
|
|
3974
|
+
var Kn = function(e, t, i, r) {
|
|
3975
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
3976
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
3977
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
3978
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
3979
|
+
};
|
|
3980
|
+
let nt = class extends M {
|
|
3981
|
+
constructor() {
|
|
3982
|
+
super(...arguments), this.inputComponentRef = Ut(), this.inputValue = "";
|
|
3983
|
+
}
|
|
3984
|
+
render() {
|
|
3985
|
+
return u`
|
|
3986
|
+
<wui-input-text
|
|
3987
|
+
${qt(this.inputComponentRef)}
|
|
3988
|
+
placeholder="Search wallet"
|
|
3989
|
+
icon="search"
|
|
3990
|
+
type="search"
|
|
3991
|
+
enterKeyHint="search"
|
|
3992
|
+
size="sm"
|
|
3993
|
+
@inputChange=${this.onInputChange}
|
|
3994
|
+
>
|
|
3995
|
+
${this.inputValue ? u`<wui-icon
|
|
3996
|
+
@click=${this.clearValue}
|
|
3997
|
+
color="inherit"
|
|
3998
|
+
size="sm"
|
|
3999
|
+
name="close"
|
|
4000
|
+
></wui-icon>` : null}
|
|
4001
|
+
</wui-input-text>
|
|
4002
|
+
`;
|
|
4003
|
+
}
|
|
4004
|
+
onInputChange(t) {
|
|
4005
|
+
this.inputValue = t.detail || "";
|
|
4006
|
+
}
|
|
4007
|
+
clearValue() {
|
|
4008
|
+
const i = this.inputComponentRef.value?.inputElementRef.value;
|
|
4009
|
+
i && (i.value = "", this.inputValue = "", i.focus(), i.dispatchEvent(new Event("input")));
|
|
4010
|
+
}
|
|
4011
|
+
};
|
|
4012
|
+
nt.styles = [G, or];
|
|
4013
|
+
Kn([
|
|
4014
|
+
d()
|
|
4015
|
+
], nt.prototype, "inputValue", void 0);
|
|
4016
|
+
nt = Kn([
|
|
4017
|
+
O("wui-search-bar")
|
|
4018
|
+
], nt);
|
|
4019
|
+
const sr = Me`<svg viewBox="0 0 48 54" fill="none">
|
|
4020
|
+
<path
|
|
4021
|
+
d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z"
|
|
4022
|
+
/>
|
|
4023
|
+
</svg>`, ar = j`
|
|
4024
|
+
:host {
|
|
4025
|
+
display: flex;
|
|
4026
|
+
flex-direction: column;
|
|
4027
|
+
justify-content: center;
|
|
4028
|
+
align-items: center;
|
|
4029
|
+
height: 104px;
|
|
4030
|
+
width: 104px;
|
|
4031
|
+
row-gap: ${({ spacing: e }) => e[2]};
|
|
4032
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
4033
|
+
border-radius: ${({ borderRadius: e }) => e[5]};
|
|
4034
|
+
position: relative;
|
|
4035
|
+
}
|
|
4036
|
+
|
|
4037
|
+
wui-shimmer[data-type='network'] {
|
|
4038
|
+
border: none;
|
|
4039
|
+
-webkit-clip-path: var(--apkt-path-network);
|
|
4040
|
+
clip-path: var(--apkt-path-network);
|
|
4041
|
+
}
|
|
4042
|
+
|
|
4043
|
+
svg {
|
|
4044
|
+
position: absolute;
|
|
4045
|
+
width: 48px;
|
|
4046
|
+
height: 54px;
|
|
4047
|
+
z-index: 1;
|
|
4048
|
+
}
|
|
4049
|
+
|
|
4050
|
+
svg > path {
|
|
4051
|
+
stroke: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
4052
|
+
stroke-width: 1px;
|
|
4053
|
+
}
|
|
4054
|
+
|
|
4055
|
+
@media (max-width: 350px) {
|
|
4056
|
+
:host {
|
|
4057
|
+
width: 100%;
|
|
4058
|
+
}
|
|
4059
|
+
}
|
|
4060
|
+
`;
|
|
4061
|
+
var Hn = function(e, t, i, r) {
|
|
4062
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
4063
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
4064
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
4065
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
4066
|
+
};
|
|
4067
|
+
let it = class extends M {
|
|
4068
|
+
constructor() {
|
|
4069
|
+
super(...arguments), this.type = "wallet";
|
|
4070
|
+
}
|
|
4071
|
+
render() {
|
|
4072
|
+
return u`
|
|
4073
|
+
${this.shimmerTemplate()}
|
|
4074
|
+
<wui-shimmer width="80px" height="20px"></wui-shimmer>
|
|
4075
|
+
`;
|
|
4076
|
+
}
|
|
4077
|
+
shimmerTemplate() {
|
|
4078
|
+
return this.type === "network" ? u` <wui-shimmer data-type=${this.type} width="48px" height="54px"></wui-shimmer>
|
|
4079
|
+
${sr}` : u`<wui-shimmer width="56px" height="56px"></wui-shimmer>`;
|
|
4080
|
+
}
|
|
4081
|
+
};
|
|
4082
|
+
it.styles = [G, he, ar];
|
|
4083
|
+
Hn([
|
|
4084
|
+
d()
|
|
4085
|
+
], it.prototype, "type", void 0);
|
|
4086
|
+
it = Hn([
|
|
4087
|
+
O("wui-card-select-loader")
|
|
4088
|
+
], it);
|
|
4089
|
+
const lr = Ln`
|
|
4090
|
+
:host {
|
|
4091
|
+
display: grid;
|
|
4092
|
+
width: inherit;
|
|
4093
|
+
height: inherit;
|
|
4094
|
+
}
|
|
4095
|
+
`;
|
|
4096
|
+
var X = function(e, t, i, r) {
|
|
4097
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
4098
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
4099
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
4100
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
4101
|
+
};
|
|
4102
|
+
let K = class extends M {
|
|
4103
|
+
render() {
|
|
4104
|
+
return this.style.cssText = `
|
|
4105
|
+
grid-template-rows: ${this.gridTemplateRows};
|
|
4106
|
+
grid-template-columns: ${this.gridTemplateColumns};
|
|
4107
|
+
justify-items: ${this.justifyItems};
|
|
4108
|
+
align-items: ${this.alignItems};
|
|
4109
|
+
justify-content: ${this.justifyContent};
|
|
4110
|
+
align-content: ${this.alignContent};
|
|
4111
|
+
column-gap: ${this.columnGap && `var(--apkt-spacing-${this.columnGap})`};
|
|
4112
|
+
row-gap: ${this.rowGap && `var(--apkt-spacing-${this.rowGap})`};
|
|
4113
|
+
gap: ${this.gap && `var(--apkt-spacing-${this.gap})`};
|
|
4114
|
+
padding-top: ${this.padding && ce.getSpacingStyles(this.padding, 0)};
|
|
4115
|
+
padding-right: ${this.padding && ce.getSpacingStyles(this.padding, 1)};
|
|
4116
|
+
padding-bottom: ${this.padding && ce.getSpacingStyles(this.padding, 2)};
|
|
4117
|
+
padding-left: ${this.padding && ce.getSpacingStyles(this.padding, 3)};
|
|
4118
|
+
margin-top: ${this.margin && ce.getSpacingStyles(this.margin, 0)};
|
|
4119
|
+
margin-right: ${this.margin && ce.getSpacingStyles(this.margin, 1)};
|
|
4120
|
+
margin-bottom: ${this.margin && ce.getSpacingStyles(this.margin, 2)};
|
|
4121
|
+
margin-left: ${this.margin && ce.getSpacingStyles(this.margin, 3)};
|
|
4122
|
+
`, u`<slot></slot>`;
|
|
4123
|
+
}
|
|
4124
|
+
};
|
|
4125
|
+
K.styles = [G, lr];
|
|
4126
|
+
X([
|
|
4127
|
+
d()
|
|
4128
|
+
], K.prototype, "gridTemplateRows", void 0);
|
|
4129
|
+
X([
|
|
4130
|
+
d()
|
|
4131
|
+
], K.prototype, "gridTemplateColumns", void 0);
|
|
4132
|
+
X([
|
|
4133
|
+
d()
|
|
4134
|
+
], K.prototype, "justifyItems", void 0);
|
|
4135
|
+
X([
|
|
4136
|
+
d()
|
|
4137
|
+
], K.prototype, "alignItems", void 0);
|
|
4138
|
+
X([
|
|
4139
|
+
d()
|
|
4140
|
+
], K.prototype, "justifyContent", void 0);
|
|
4141
|
+
X([
|
|
4142
|
+
d()
|
|
4143
|
+
], K.prototype, "alignContent", void 0);
|
|
4144
|
+
X([
|
|
4145
|
+
d()
|
|
4146
|
+
], K.prototype, "columnGap", void 0);
|
|
4147
|
+
X([
|
|
4148
|
+
d()
|
|
4149
|
+
], K.prototype, "rowGap", void 0);
|
|
4150
|
+
X([
|
|
4151
|
+
d()
|
|
4152
|
+
], K.prototype, "gap", void 0);
|
|
4153
|
+
X([
|
|
4154
|
+
d()
|
|
4155
|
+
], K.prototype, "padding", void 0);
|
|
4156
|
+
X([
|
|
4157
|
+
d()
|
|
4158
|
+
], K.prototype, "margin", void 0);
|
|
4159
|
+
K = X([
|
|
4160
|
+
O("wui-grid")
|
|
4161
|
+
], K);
|
|
4162
|
+
const cr = j`
|
|
4163
|
+
button {
|
|
4164
|
+
display: flex;
|
|
4165
|
+
flex-direction: column;
|
|
4166
|
+
justify-content: center;
|
|
4167
|
+
align-items: center;
|
|
4168
|
+
cursor: pointer;
|
|
4169
|
+
width: 104px;
|
|
4170
|
+
row-gap: ${({ spacing: e }) => e[2]};
|
|
4171
|
+
padding: ${({ spacing: e }) => e[3]} ${({ spacing: e }) => e[0]};
|
|
4172
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
4173
|
+
border-radius: clamp(0px, ${({ borderRadius: e }) => e[4]}, 20px);
|
|
4174
|
+
transition:
|
|
4175
|
+
color ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-1"]},
|
|
4176
|
+
background-color ${({ durations: e }) => e.lg}
|
|
4177
|
+
${({ easings: e }) => e["ease-out-power-1"]},
|
|
4178
|
+
border-radius ${({ durations: e }) => e.lg}
|
|
4179
|
+
${({ easings: e }) => e["ease-out-power-1"]};
|
|
4180
|
+
will-change: background-color, color, border-radius;
|
|
4181
|
+
outline: none;
|
|
4182
|
+
border: none;
|
|
4183
|
+
}
|
|
4184
|
+
|
|
4185
|
+
button > wui-flex > wui-text {
|
|
4186
|
+
color: ${({ tokens: e }) => e.theme.textPrimary};
|
|
4187
|
+
max-width: 86px;
|
|
4188
|
+
white-space: nowrap;
|
|
4189
|
+
overflow: hidden;
|
|
4190
|
+
text-overflow: ellipsis;
|
|
4191
|
+
justify-content: center;
|
|
4192
|
+
}
|
|
4193
|
+
|
|
4194
|
+
button > wui-flex > wui-text.certified {
|
|
4195
|
+
max-width: 66px;
|
|
4196
|
+
}
|
|
4197
|
+
|
|
4198
|
+
@media (hover: hover) and (pointer: fine) {
|
|
4199
|
+
button:hover:enabled {
|
|
4200
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
|
|
4204
|
+
button:disabled > wui-flex > wui-text {
|
|
4205
|
+
color: ${({ tokens: e }) => e.core.glass010};
|
|
4206
|
+
}
|
|
4207
|
+
|
|
4208
|
+
[data-selected='true'] {
|
|
4209
|
+
background-color: ${({ colors: e }) => e.accent020};
|
|
4210
|
+
}
|
|
4211
|
+
|
|
4212
|
+
@media (hover: hover) and (pointer: fine) {
|
|
4213
|
+
[data-selected='true']:hover:enabled {
|
|
4214
|
+
background-color: ${({ colors: e }) => e.accent010};
|
|
4215
|
+
}
|
|
4216
|
+
}
|
|
4217
|
+
|
|
4218
|
+
[data-selected='true']:active:enabled {
|
|
4219
|
+
background-color: ${({ colors: e }) => e.accent010};
|
|
4220
|
+
}
|
|
4221
|
+
|
|
4222
|
+
@media (max-width: 350px) {
|
|
4223
|
+
button {
|
|
4224
|
+
width: 100%;
|
|
4225
|
+
}
|
|
4226
|
+
}
|
|
4227
|
+
`;
|
|
4228
|
+
var re = function(e, t, i, r) {
|
|
4229
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
4230
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
4231
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
4232
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
4233
|
+
};
|
|
4234
|
+
let Q = class extends M {
|
|
4235
|
+
constructor() {
|
|
4236
|
+
super(), this.observer = new IntersectionObserver(() => {
|
|
4237
|
+
}), this.visible = !1, this.imageSrc = void 0, this.imageLoading = !1, this.isImpressed = !1, this.explorerId = "", this.walletQuery = "", this.certified = !1, this.displayIndex = 0, this.wallet = void 0, this.observer = new IntersectionObserver((t) => {
|
|
4238
|
+
t.forEach((i) => {
|
|
4239
|
+
i.isIntersecting ? (this.visible = !0, this.fetchImageSrc(), this.sendImpressionEvent()) : this.visible = !1;
|
|
4240
|
+
});
|
|
4241
|
+
}, { threshold: 0.01 });
|
|
4242
|
+
}
|
|
4243
|
+
firstUpdated() {
|
|
4244
|
+
this.observer.observe(this);
|
|
4245
|
+
}
|
|
4246
|
+
disconnectedCallback() {
|
|
4247
|
+
this.observer.disconnect();
|
|
4248
|
+
}
|
|
4249
|
+
render() {
|
|
4250
|
+
const t = this.wallet?.badge_type === "certified";
|
|
4251
|
+
return u`
|
|
4252
|
+
<button>
|
|
4253
|
+
${this.imageTemplate()}
|
|
4254
|
+
<wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="1">
|
|
4255
|
+
<wui-text
|
|
4256
|
+
variant="md-regular"
|
|
4257
|
+
color="inherit"
|
|
4258
|
+
class=${z(t ? "certified" : void 0)}
|
|
4259
|
+
>${this.wallet?.name}</wui-text
|
|
4260
|
+
>
|
|
4261
|
+
${t ? u`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>` : null}
|
|
4262
|
+
</wui-flex>
|
|
4263
|
+
</button>
|
|
4264
|
+
`;
|
|
4265
|
+
}
|
|
4266
|
+
imageTemplate() {
|
|
4267
|
+
return !this.visible && !this.imageSrc || this.imageLoading ? this.shimmerTemplate() : u`
|
|
4268
|
+
<wui-wallet-image
|
|
4269
|
+
size="lg"
|
|
4270
|
+
imageSrc=${z(this.imageSrc)}
|
|
4271
|
+
name=${z(this.wallet?.name)}
|
|
4272
|
+
.installed=${this.wallet?.installed ?? !1}
|
|
4273
|
+
badgeSize="sm"
|
|
4274
|
+
>
|
|
4275
|
+
</wui-wallet-image>
|
|
4276
|
+
`;
|
|
4277
|
+
}
|
|
4278
|
+
shimmerTemplate() {
|
|
4279
|
+
return u`<wui-shimmer width="56px" height="56px"></wui-shimmer>`;
|
|
4280
|
+
}
|
|
4281
|
+
async fetchImageSrc() {
|
|
4282
|
+
this.wallet && (this.imageSrc = we.getWalletImage(this.wallet), !this.imageSrc && (this.imageLoading = !0, this.imageSrc = await we.fetchWalletImage(this.wallet.image_id), this.imageLoading = !1));
|
|
4283
|
+
}
|
|
4284
|
+
sendImpressionEvent() {
|
|
4285
|
+
!this.wallet || this.isImpressed || (this.isImpressed = !0, F.sendWalletImpressionEvent({
|
|
4286
|
+
name: this.wallet.name,
|
|
4287
|
+
walletRank: this.wallet.order,
|
|
4288
|
+
explorerId: this.explorerId,
|
|
4289
|
+
view: B.state.view,
|
|
4290
|
+
query: this.walletQuery,
|
|
4291
|
+
certified: this.certified,
|
|
4292
|
+
displayIndex: this.displayIndex
|
|
4293
|
+
}));
|
|
4294
|
+
}
|
|
4295
|
+
};
|
|
4296
|
+
Q.styles = cr;
|
|
4297
|
+
re([
|
|
4298
|
+
_()
|
|
4299
|
+
], Q.prototype, "visible", void 0);
|
|
4300
|
+
re([
|
|
4301
|
+
_()
|
|
4302
|
+
], Q.prototype, "imageSrc", void 0);
|
|
4303
|
+
re([
|
|
4304
|
+
_()
|
|
4305
|
+
], Q.prototype, "imageLoading", void 0);
|
|
4306
|
+
re([
|
|
4307
|
+
_()
|
|
4308
|
+
], Q.prototype, "isImpressed", void 0);
|
|
4309
|
+
re([
|
|
4310
|
+
d()
|
|
4311
|
+
], Q.prototype, "explorerId", void 0);
|
|
4312
|
+
re([
|
|
4313
|
+
d()
|
|
4314
|
+
], Q.prototype, "walletQuery", void 0);
|
|
4315
|
+
re([
|
|
4316
|
+
d()
|
|
4317
|
+
], Q.prototype, "certified", void 0);
|
|
4318
|
+
re([
|
|
4319
|
+
d()
|
|
4320
|
+
], Q.prototype, "displayIndex", void 0);
|
|
4321
|
+
re([
|
|
4322
|
+
d({ type: Object })
|
|
4323
|
+
], Q.prototype, "wallet", void 0);
|
|
4324
|
+
Q = re([
|
|
4325
|
+
O("w3m-all-wallets-list-item")
|
|
4326
|
+
], Q);
|
|
4327
|
+
const ur = j`
|
|
4328
|
+
wui-grid {
|
|
4329
|
+
max-height: clamp(360px, 400px, 80vh);
|
|
4330
|
+
overflow: scroll;
|
|
4331
|
+
scrollbar-width: none;
|
|
4332
|
+
grid-auto-rows: min-content;
|
|
4333
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
4334
|
+
}
|
|
4335
|
+
|
|
4336
|
+
:host([data-mobile-fullscreen='true']) wui-grid {
|
|
4337
|
+
max-height: none;
|
|
4338
|
+
}
|
|
4339
|
+
|
|
4340
|
+
@media (max-width: 350px) {
|
|
4341
|
+
wui-grid {
|
|
4342
|
+
grid-template-columns: repeat(2, 1fr);
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
|
|
4346
|
+
wui-grid[data-scroll='false'] {
|
|
4347
|
+
overflow: hidden;
|
|
4348
|
+
}
|
|
4349
|
+
|
|
4350
|
+
wui-grid::-webkit-scrollbar {
|
|
4351
|
+
display: none;
|
|
4352
|
+
}
|
|
4353
|
+
|
|
4354
|
+
w3m-all-wallets-list-item {
|
|
4355
|
+
opacity: 0;
|
|
4356
|
+
animation-duration: ${({ durations: e }) => e.xl};
|
|
4357
|
+
animation-timing-function: ${({ easings: e }) => e["ease-inout-power-2"]};
|
|
4358
|
+
animation-name: fade-in;
|
|
4359
|
+
animation-fill-mode: forwards;
|
|
4360
|
+
}
|
|
4361
|
+
|
|
4362
|
+
@keyframes fade-in {
|
|
4363
|
+
from {
|
|
4364
|
+
opacity: 0;
|
|
4365
|
+
}
|
|
4366
|
+
to {
|
|
4367
|
+
opacity: 1;
|
|
4368
|
+
}
|
|
4369
|
+
}
|
|
4370
|
+
|
|
4371
|
+
wui-loading-spinner {
|
|
4372
|
+
padding-top: ${({ spacing: e }) => e[4]};
|
|
4373
|
+
padding-bottom: ${({ spacing: e }) => e[4]};
|
|
4374
|
+
justify-content: center;
|
|
4375
|
+
grid-column: 1 / span 4;
|
|
4376
|
+
}
|
|
4377
|
+
`;
|
|
4378
|
+
var ye = function(e, t, i, r) {
|
|
4379
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
4380
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
4381
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
4382
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
4383
|
+
};
|
|
4384
|
+
const In = "local-paginator";
|
|
4385
|
+
let ie = class extends M {
|
|
4386
|
+
constructor() {
|
|
4387
|
+
super(), this.unsubscribe = [], this.paginationObserver = void 0, this.loading = !N.state.wallets.length, this.wallets = N.state.wallets, this.recommended = N.state.recommended, this.featured = N.state.featured, this.filteredWallets = N.state.filteredWallets, this.mobileFullScreen = q.state.enableMobileFullScreen, this.unsubscribe.push(N.subscribeKey("wallets", (t) => this.wallets = t), N.subscribeKey("recommended", (t) => this.recommended = t), N.subscribeKey("featured", (t) => this.featured = t), N.subscribeKey("filteredWallets", (t) => this.filteredWallets = t));
|
|
4388
|
+
}
|
|
4389
|
+
firstUpdated() {
|
|
4390
|
+
this.initialFetch(), this.createPaginationObserver();
|
|
4391
|
+
}
|
|
4392
|
+
disconnectedCallback() {
|
|
4393
|
+
this.unsubscribe.forEach((t) => t()), this.paginationObserver?.disconnect();
|
|
4394
|
+
}
|
|
4395
|
+
render() {
|
|
4396
|
+
return this.mobileFullScreen && this.setAttribute("data-mobile-fullscreen", "true"), u`
|
|
4397
|
+
<wui-grid
|
|
4398
|
+
data-scroll=${!this.loading}
|
|
4399
|
+
.padding=${["0", "3", "3", "3"]}
|
|
4400
|
+
gap="2"
|
|
4401
|
+
justifyContent="space-between"
|
|
4402
|
+
>
|
|
4403
|
+
${this.loading ? this.shimmerTemplate(16) : this.walletsTemplate()}
|
|
4404
|
+
${this.paginationLoaderTemplate()}
|
|
4405
|
+
</wui-grid>
|
|
4406
|
+
`;
|
|
4407
|
+
}
|
|
4408
|
+
async initialFetch() {
|
|
4409
|
+
this.loading = !0;
|
|
4410
|
+
const t = this.shadowRoot?.querySelector("wui-grid");
|
|
4411
|
+
t && (await N.fetchWalletsByPage({ page: 1 }), await t.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
4412
|
+
duration: 200,
|
|
4413
|
+
fill: "forwards",
|
|
4414
|
+
easing: "ease"
|
|
4415
|
+
}).finished, this.loading = !1, t.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
4416
|
+
duration: 200,
|
|
4417
|
+
fill: "forwards",
|
|
4418
|
+
easing: "ease"
|
|
4419
|
+
}));
|
|
4420
|
+
}
|
|
4421
|
+
shimmerTemplate(t, i) {
|
|
4422
|
+
return [...Array(t)].map(() => u`
|
|
4423
|
+
<wui-card-select-loader type="wallet" id=${z(i)}></wui-card-select-loader>
|
|
4424
|
+
`);
|
|
4425
|
+
}
|
|
4426
|
+
getWallets() {
|
|
4427
|
+
const t = [...this.featured, ...this.recommended];
|
|
4428
|
+
this.filteredWallets?.length > 0 ? t.push(...this.filteredWallets) : t.push(...this.wallets);
|
|
4429
|
+
const i = P.uniqueBy(t, "id"), r = Ot.markWalletsAsInstalled(i);
|
|
4430
|
+
return Ot.markWalletsWithDisplayIndex(r);
|
|
4431
|
+
}
|
|
4432
|
+
walletsTemplate() {
|
|
4433
|
+
return this.getWallets().map((i, r) => u`
|
|
4434
|
+
<w3m-all-wallets-list-item
|
|
4435
|
+
data-testid="wallet-search-item-${i.id}"
|
|
4436
|
+
@click=${() => this.onConnectWallet(i)}
|
|
4437
|
+
.wallet=${i}
|
|
4438
|
+
explorerId=${i.id}
|
|
4439
|
+
certified=${this.badge === "certified"}
|
|
4440
|
+
displayIndex=${r}
|
|
4441
|
+
></w3m-all-wallets-list-item>
|
|
4442
|
+
`);
|
|
4443
|
+
}
|
|
4444
|
+
paginationLoaderTemplate() {
|
|
4445
|
+
const { wallets: t, recommended: i, featured: r, count: o, mobileFilteredOutWalletsLength: n } = N.state, s = window.innerWidth < 352 ? 3 : 4, a = t.length + i.length;
|
|
4446
|
+
let c = Math.ceil(a / s) * s - a + s;
|
|
4447
|
+
return c -= t.length ? r.length % s : 0, o === 0 && r.length > 0 ? null : o === 0 || [...r, ...t, ...i].length < o - (n ?? 0) ? this.shimmerTemplate(c, In) : null;
|
|
4448
|
+
}
|
|
4449
|
+
createPaginationObserver() {
|
|
4450
|
+
const t = this.shadowRoot?.querySelector(`#${In}`);
|
|
4451
|
+
t && (this.paginationObserver = new IntersectionObserver(([i]) => {
|
|
4452
|
+
if (i?.isIntersecting && !this.loading) {
|
|
4453
|
+
const { page: r, count: o, wallets: n } = N.state;
|
|
4454
|
+
n.length < o && N.fetchWalletsByPage({ page: r + 1 });
|
|
4455
|
+
}
|
|
4456
|
+
}), this.paginationObserver.observe(t));
|
|
4457
|
+
}
|
|
4458
|
+
onConnectWallet(t) {
|
|
4459
|
+
H.selectWalletConnector(t);
|
|
4460
|
+
}
|
|
4461
|
+
};
|
|
4462
|
+
ie.styles = ur;
|
|
4463
|
+
ye([
|
|
4464
|
+
_()
|
|
4465
|
+
], ie.prototype, "loading", void 0);
|
|
4466
|
+
ye([
|
|
4467
|
+
_()
|
|
4468
|
+
], ie.prototype, "wallets", void 0);
|
|
4469
|
+
ye([
|
|
4470
|
+
_()
|
|
4471
|
+
], ie.prototype, "recommended", void 0);
|
|
4472
|
+
ye([
|
|
4473
|
+
_()
|
|
4474
|
+
], ie.prototype, "featured", void 0);
|
|
4475
|
+
ye([
|
|
4476
|
+
_()
|
|
4477
|
+
], ie.prototype, "filteredWallets", void 0);
|
|
4478
|
+
ye([
|
|
4479
|
+
_()
|
|
4480
|
+
], ie.prototype, "badge", void 0);
|
|
4481
|
+
ye([
|
|
4482
|
+
_()
|
|
4483
|
+
], ie.prototype, "mobileFullScreen", void 0);
|
|
4484
|
+
ie = ye([
|
|
4485
|
+
O("w3m-all-wallets-list")
|
|
4486
|
+
], ie);
|
|
4487
|
+
const dr = Ln`
|
|
4488
|
+
wui-grid,
|
|
4489
|
+
wui-loading-spinner,
|
|
4490
|
+
wui-flex {
|
|
4491
|
+
height: 360px;
|
|
4492
|
+
}
|
|
4493
|
+
|
|
4494
|
+
wui-grid {
|
|
4495
|
+
overflow: scroll;
|
|
4496
|
+
scrollbar-width: none;
|
|
4497
|
+
grid-auto-rows: min-content;
|
|
4498
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
4499
|
+
}
|
|
4500
|
+
|
|
4501
|
+
:host([data-mobile-fullscreen='true']) wui-grid {
|
|
4502
|
+
max-height: none;
|
|
4503
|
+
height: auto;
|
|
4504
|
+
}
|
|
4505
|
+
|
|
4506
|
+
wui-grid[data-scroll='false'] {
|
|
4507
|
+
overflow: hidden;
|
|
4508
|
+
}
|
|
4509
|
+
|
|
4510
|
+
wui-grid::-webkit-scrollbar {
|
|
4511
|
+
display: none;
|
|
4512
|
+
}
|
|
4513
|
+
|
|
4514
|
+
wui-loading-spinner {
|
|
4515
|
+
justify-content: center;
|
|
4516
|
+
align-items: center;
|
|
4517
|
+
}
|
|
4518
|
+
|
|
4519
|
+
@media (max-width: 350px) {
|
|
4520
|
+
wui-grid {
|
|
4521
|
+
grid-template-columns: repeat(2, 1fr);
|
|
4522
|
+
}
|
|
4523
|
+
}
|
|
4524
|
+
`;
|
|
4525
|
+
var Ve = function(e, t, i, r) {
|
|
4526
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
4527
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
4528
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
4529
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
4530
|
+
};
|
|
4531
|
+
let Se = class extends M {
|
|
4532
|
+
constructor() {
|
|
4533
|
+
super(...arguments), this.prevQuery = "", this.prevBadge = void 0, this.loading = !0, this.mobileFullScreen = q.state.enableMobileFullScreen, this.query = "";
|
|
4534
|
+
}
|
|
4535
|
+
render() {
|
|
4536
|
+
return this.mobileFullScreen && this.setAttribute("data-mobile-fullscreen", "true"), this.onSearch(), this.loading ? u`<wui-loading-spinner color="accent-primary"></wui-loading-spinner>` : this.walletsTemplate();
|
|
4537
|
+
}
|
|
4538
|
+
async onSearch() {
|
|
4539
|
+
(this.query.trim() !== this.prevQuery.trim() || this.badge !== this.prevBadge) && (this.prevQuery = this.query, this.prevBadge = this.badge, this.loading = !0, await N.searchWallet({ search: this.query, badge: this.badge }), this.loading = !1);
|
|
4540
|
+
}
|
|
4541
|
+
walletsTemplate() {
|
|
4542
|
+
const { search: t } = N.state, i = Ot.markWalletsAsInstalled(t);
|
|
4543
|
+
return t.length ? u`
|
|
4544
|
+
<wui-grid
|
|
4545
|
+
data-testid="wallet-list"
|
|
4546
|
+
.padding=${["0", "3", "3", "3"]}
|
|
4547
|
+
rowGap="4"
|
|
4548
|
+
columngap="2"
|
|
4549
|
+
justifyContent="space-between"
|
|
4550
|
+
>
|
|
4551
|
+
${i.map((r, o) => u`
|
|
4552
|
+
<w3m-all-wallets-list-item
|
|
4553
|
+
@click=${() => this.onConnectWallet(r)}
|
|
4554
|
+
.wallet=${r}
|
|
4555
|
+
data-testid="wallet-search-item-${r.id}"
|
|
4556
|
+
explorerId=${r.id}
|
|
4557
|
+
certified=${this.badge === "certified"}
|
|
4558
|
+
walletQuery=${this.query}
|
|
4559
|
+
displayIndex=${o}
|
|
4560
|
+
></w3m-all-wallets-list-item>
|
|
4561
|
+
`)}
|
|
4562
|
+
</wui-grid>
|
|
4563
|
+
` : u`
|
|
4564
|
+
<wui-flex
|
|
4565
|
+
data-testid="no-wallet-found"
|
|
4566
|
+
justifyContent="center"
|
|
4567
|
+
alignItems="center"
|
|
4568
|
+
gap="3"
|
|
4569
|
+
flexDirection="column"
|
|
4570
|
+
>
|
|
4571
|
+
<wui-icon-box size="lg" color="default" icon="wallet"></wui-icon-box>
|
|
4572
|
+
<wui-text data-testid="no-wallet-found-text" color="secondary" variant="md-medium">
|
|
4573
|
+
No Wallet found
|
|
4574
|
+
</wui-text>
|
|
4575
|
+
</wui-flex>
|
|
4576
|
+
`;
|
|
4577
|
+
}
|
|
4578
|
+
onConnectWallet(t) {
|
|
4579
|
+
H.selectWalletConnector(t);
|
|
4580
|
+
}
|
|
4581
|
+
};
|
|
4582
|
+
Se.styles = dr;
|
|
4583
|
+
Ve([
|
|
4584
|
+
_()
|
|
4585
|
+
], Se.prototype, "loading", void 0);
|
|
4586
|
+
Ve([
|
|
4587
|
+
_()
|
|
4588
|
+
], Se.prototype, "mobileFullScreen", void 0);
|
|
4589
|
+
Ve([
|
|
4590
|
+
d()
|
|
4591
|
+
], Se.prototype, "query", void 0);
|
|
4592
|
+
Ve([
|
|
4593
|
+
d()
|
|
4594
|
+
], Se.prototype, "badge", void 0);
|
|
4595
|
+
Se = Ve([
|
|
4596
|
+
O("w3m-all-wallets-search")
|
|
4597
|
+
], Se);
|
|
4598
|
+
var Ft = function(e, t, i, r) {
|
|
4599
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
4600
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
4601
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
4602
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
4603
|
+
};
|
|
4604
|
+
let rt = class extends M {
|
|
4605
|
+
constructor() {
|
|
4606
|
+
super(...arguments), this.search = "", this.badge = void 0, this.onDebouncedSearch = P.debounce((t) => {
|
|
4607
|
+
this.search = t;
|
|
4608
|
+
});
|
|
4609
|
+
}
|
|
4610
|
+
render() {
|
|
4611
|
+
const t = this.search.length >= 2;
|
|
4612
|
+
return u`
|
|
4613
|
+
<wui-flex .padding=${["1", "3", "3", "3"]} gap="2" alignItems="center">
|
|
4614
|
+
<wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
|
|
4615
|
+
<wui-certified-switch
|
|
4616
|
+
?checked=${this.badge === "certified"}
|
|
4617
|
+
@certifiedSwitchChange=${this.onCertifiedSwitchChange.bind(this)}
|
|
4618
|
+
data-testid="wui-certified-switch"
|
|
4619
|
+
></wui-certified-switch>
|
|
4620
|
+
${this.qrButtonTemplate()}
|
|
4621
|
+
</wui-flex>
|
|
4622
|
+
${t || this.badge ? u`<w3m-all-wallets-search
|
|
4623
|
+
query=${this.search}
|
|
4624
|
+
.badge=${this.badge}
|
|
4625
|
+
></w3m-all-wallets-search>` : u`<w3m-all-wallets-list .badge=${this.badge}></w3m-all-wallets-list>`}
|
|
4626
|
+
`;
|
|
4627
|
+
}
|
|
4628
|
+
onInputChange(t) {
|
|
4629
|
+
this.onDebouncedSearch(t.detail);
|
|
4630
|
+
}
|
|
4631
|
+
onCertifiedSwitchChange(t) {
|
|
4632
|
+
t.detail ? (this.badge = "certified", je.showSvg("Only WalletConnect certified", {
|
|
4633
|
+
icon: "walletConnectBrown",
|
|
4634
|
+
iconColor: "accent-100"
|
|
4635
|
+
})) : this.badge = void 0;
|
|
4636
|
+
}
|
|
4637
|
+
qrButtonTemplate() {
|
|
4638
|
+
return P.isMobile() ? u`
|
|
4639
|
+
<wui-icon-box
|
|
4640
|
+
size="xl"
|
|
4641
|
+
iconSize="xl"
|
|
4642
|
+
color="accent-primary"
|
|
4643
|
+
icon="qrCode"
|
|
4644
|
+
border
|
|
4645
|
+
borderColor="wui-accent-glass-010"
|
|
4646
|
+
@click=${this.onWalletConnectQr.bind(this)}
|
|
4647
|
+
></wui-icon-box>
|
|
4648
|
+
` : null;
|
|
4649
|
+
}
|
|
4650
|
+
onWalletConnectQr() {
|
|
4651
|
+
B.push("ConnectingWalletConnect");
|
|
4652
|
+
}
|
|
4653
|
+
};
|
|
4654
|
+
Ft([
|
|
4655
|
+
_()
|
|
4656
|
+
], rt.prototype, "search", void 0);
|
|
4657
|
+
Ft([
|
|
4658
|
+
_()
|
|
4659
|
+
], rt.prototype, "badge", void 0);
|
|
4660
|
+
rt = Ft([
|
|
4661
|
+
O("w3m-all-wallets-view")
|
|
4662
|
+
], rt);
|
|
4663
|
+
const hr = j`
|
|
4664
|
+
:host {
|
|
4665
|
+
width: 100%;
|
|
4666
|
+
}
|
|
4667
|
+
|
|
4668
|
+
button {
|
|
4669
|
+
display: flex;
|
|
4670
|
+
align-items: center;
|
|
4671
|
+
justify-content: space-between;
|
|
4672
|
+
padding: ${({ spacing: e }) => e[3]};
|
|
4673
|
+
width: 100%;
|
|
4674
|
+
background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
4675
|
+
border-radius: ${({ borderRadius: e }) => e[4]};
|
|
4676
|
+
transition:
|
|
4677
|
+
background-color ${({ durations: e }) => e.lg}
|
|
4678
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
4679
|
+
scale ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]};
|
|
4680
|
+
will-change: background-color, scale;
|
|
4681
|
+
}
|
|
4682
|
+
|
|
4683
|
+
wui-text {
|
|
4684
|
+
text-transform: capitalize;
|
|
4685
|
+
}
|
|
4686
|
+
|
|
4687
|
+
wui-image {
|
|
4688
|
+
color: ${({ tokens: e }) => e.theme.textPrimary};
|
|
4689
|
+
}
|
|
4690
|
+
|
|
4691
|
+
@media (hover: hover) {
|
|
4692
|
+
button:hover:enabled {
|
|
4693
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
4694
|
+
}
|
|
4695
|
+
}
|
|
4696
|
+
|
|
4697
|
+
button:disabled {
|
|
4698
|
+
opacity: 0.5;
|
|
4699
|
+
cursor: not-allowed;
|
|
4700
|
+
}
|
|
4701
|
+
`;
|
|
4702
|
+
var oe = function(e, t, i, r) {
|
|
4703
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
4704
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
4705
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
4706
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
4707
|
+
};
|
|
4708
|
+
let Y = class extends M {
|
|
4709
|
+
constructor() {
|
|
4710
|
+
super(...arguments), this.imageSrc = "google", this.loading = !1, this.disabled = !1, this.rightIcon = !0, this.rounded = !1, this.fullSize = !1;
|
|
4711
|
+
}
|
|
4712
|
+
render() {
|
|
4713
|
+
return this.dataset.rounded = this.rounded ? "true" : "false", u`
|
|
4714
|
+
<button
|
|
4715
|
+
?disabled=${this.loading ? !0 : !!this.disabled}
|
|
4716
|
+
data-loading=${this.loading}
|
|
4717
|
+
tabindex=${z(this.tabIdx)}
|
|
4718
|
+
>
|
|
4719
|
+
<wui-flex gap="2" alignItems="center">
|
|
4720
|
+
${this.templateLeftIcon()}
|
|
4721
|
+
<wui-flex gap="1">
|
|
4722
|
+
<slot></slot>
|
|
4723
|
+
</wui-flex>
|
|
4724
|
+
</wui-flex>
|
|
4725
|
+
${this.templateRightIcon()}
|
|
4726
|
+
</button>
|
|
4727
|
+
`;
|
|
4728
|
+
}
|
|
4729
|
+
templateLeftIcon() {
|
|
4730
|
+
return this.icon ? u`<wui-image
|
|
4731
|
+
icon=${this.icon}
|
|
4732
|
+
iconColor=${z(this.iconColor)}
|
|
4733
|
+
?boxed=${!0}
|
|
4734
|
+
?rounded=${this.rounded}
|
|
4735
|
+
></wui-image>` : u`<wui-image
|
|
4736
|
+
?boxed=${!0}
|
|
4737
|
+
?rounded=${this.rounded}
|
|
4738
|
+
?fullSize=${this.fullSize}
|
|
4739
|
+
src=${this.imageSrc}
|
|
4740
|
+
></wui-image>`;
|
|
4741
|
+
}
|
|
4742
|
+
templateRightIcon() {
|
|
4743
|
+
return this.rightIcon ? this.loading ? u`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>` : u`<wui-icon name="chevronRight" size="lg" color="default"></wui-icon>` : null;
|
|
4744
|
+
}
|
|
4745
|
+
};
|
|
4746
|
+
Y.styles = [G, he, hr];
|
|
4747
|
+
oe([
|
|
4748
|
+
d()
|
|
4749
|
+
], Y.prototype, "imageSrc", void 0);
|
|
4750
|
+
oe([
|
|
4751
|
+
d()
|
|
4752
|
+
], Y.prototype, "icon", void 0);
|
|
4753
|
+
oe([
|
|
4754
|
+
d()
|
|
4755
|
+
], Y.prototype, "iconColor", void 0);
|
|
4756
|
+
oe([
|
|
4757
|
+
d({ type: Boolean })
|
|
4758
|
+
], Y.prototype, "loading", void 0);
|
|
4759
|
+
oe([
|
|
4760
|
+
d()
|
|
4761
|
+
], Y.prototype, "tabIdx", void 0);
|
|
4762
|
+
oe([
|
|
4763
|
+
d({ type: Boolean })
|
|
4764
|
+
], Y.prototype, "disabled", void 0);
|
|
4765
|
+
oe([
|
|
4766
|
+
d({ type: Boolean })
|
|
4767
|
+
], Y.prototype, "rightIcon", void 0);
|
|
4768
|
+
oe([
|
|
4769
|
+
d({ type: Boolean })
|
|
4770
|
+
], Y.prototype, "rounded", void 0);
|
|
4771
|
+
oe([
|
|
4772
|
+
d({ type: Boolean })
|
|
4773
|
+
], Y.prototype, "fullSize", void 0);
|
|
4774
|
+
Y = oe([
|
|
4775
|
+
O("wui-list-item")
|
|
4776
|
+
], Y);
|
|
4777
|
+
var fr = function(e, t, i, r) {
|
|
4778
|
+
var o = arguments.length, n = o < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, i) : r, s;
|
|
4779
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, i, r);
|
|
4780
|
+
else for (var a = e.length - 1; a >= 0; a--) (s = e[a]) && (n = (o < 3 ? s(n) : o > 3 ? s(t, i, n) : s(t, i)) || n);
|
|
4781
|
+
return o > 3 && n && Object.defineProperty(t, i, n), n;
|
|
4782
|
+
};
|
|
4783
|
+
let Wn = class extends M {
|
|
4784
|
+
constructor() {
|
|
4785
|
+
super(...arguments), this.wallet = B.state.data?.wallet;
|
|
4786
|
+
}
|
|
4787
|
+
render() {
|
|
4788
|
+
if (!this.wallet)
|
|
4789
|
+
throw new Error("w3m-downloads-view");
|
|
4790
|
+
return u`
|
|
4791
|
+
<wui-flex gap="2" flexDirection="column" .padding=${["3", "3", "4", "3"]}>
|
|
4792
|
+
${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
|
|
4793
|
+
${this.homepageTemplate()}
|
|
4794
|
+
</wui-flex>
|
|
4795
|
+
`;
|
|
4796
|
+
}
|
|
4797
|
+
chromeTemplate() {
|
|
4798
|
+
return this.wallet?.chrome_store ? u`<wui-list-item
|
|
4799
|
+
variant="icon"
|
|
4800
|
+
icon="chromeStore"
|
|
4801
|
+
iconVariant="square"
|
|
4802
|
+
@click=${this.onChromeStore.bind(this)}
|
|
4803
|
+
chevron
|
|
4804
|
+
>
|
|
4805
|
+
<wui-text variant="md-medium" color="primary">Chrome Extension</wui-text>
|
|
4806
|
+
</wui-list-item>` : null;
|
|
4807
|
+
}
|
|
4808
|
+
iosTemplate() {
|
|
4809
|
+
return this.wallet?.app_store ? u`<wui-list-item
|
|
4810
|
+
variant="icon"
|
|
4811
|
+
icon="appStore"
|
|
4812
|
+
iconVariant="square"
|
|
4813
|
+
@click=${this.onAppStore.bind(this)}
|
|
4814
|
+
chevron
|
|
4815
|
+
>
|
|
4816
|
+
<wui-text variant="md-medium" color="primary">iOS App</wui-text>
|
|
4817
|
+
</wui-list-item>` : null;
|
|
4818
|
+
}
|
|
4819
|
+
androidTemplate() {
|
|
4820
|
+
return this.wallet?.play_store ? u`<wui-list-item
|
|
4821
|
+
variant="icon"
|
|
4822
|
+
icon="playStore"
|
|
4823
|
+
iconVariant="square"
|
|
4824
|
+
@click=${this.onPlayStore.bind(this)}
|
|
4825
|
+
chevron
|
|
4826
|
+
>
|
|
4827
|
+
<wui-text variant="md-medium" color="primary">Android App</wui-text>
|
|
4828
|
+
</wui-list-item>` : null;
|
|
4829
|
+
}
|
|
4830
|
+
homepageTemplate() {
|
|
4831
|
+
return this.wallet?.homepage ? u`
|
|
4832
|
+
<wui-list-item
|
|
4833
|
+
variant="icon"
|
|
4834
|
+
icon="browser"
|
|
4835
|
+
iconVariant="square-blue"
|
|
4836
|
+
@click=${this.onHomePage.bind(this)}
|
|
4837
|
+
chevron
|
|
4838
|
+
>
|
|
4839
|
+
<wui-text variant="md-medium" color="primary">Website</wui-text>
|
|
4840
|
+
</wui-list-item>
|
|
4841
|
+
` : null;
|
|
4842
|
+
}
|
|
4843
|
+
openStore(t) {
|
|
4844
|
+
t.href && this.wallet && (F.sendEvent({
|
|
4845
|
+
type: "track",
|
|
4846
|
+
event: "GET_WALLET",
|
|
4847
|
+
properties: {
|
|
4848
|
+
name: this.wallet.name,
|
|
4849
|
+
walletRank: this.wallet.order,
|
|
4850
|
+
explorerId: this.wallet.id,
|
|
4851
|
+
type: t.type
|
|
4852
|
+
}
|
|
4853
|
+
}), P.openHref(t.href, "_blank"));
|
|
4854
|
+
}
|
|
4855
|
+
onChromeStore() {
|
|
4856
|
+
this.wallet?.chrome_store && this.openStore({ href: this.wallet.chrome_store, type: "chrome_store" });
|
|
4857
|
+
}
|
|
4858
|
+
onAppStore() {
|
|
4859
|
+
this.wallet?.app_store && this.openStore({ href: this.wallet.app_store, type: "app_store" });
|
|
4860
|
+
}
|
|
4861
|
+
onPlayStore() {
|
|
4862
|
+
this.wallet?.play_store && this.openStore({ href: this.wallet.play_store, type: "play_store" });
|
|
4863
|
+
}
|
|
4864
|
+
onHomePage() {
|
|
4865
|
+
this.wallet?.homepage && this.openStore({ href: this.wallet.homepage, type: "homepage" });
|
|
4866
|
+
}
|
|
4867
|
+
};
|
|
4868
|
+
Wn = fr([
|
|
4869
|
+
O("w3m-downloads-view")
|
|
4870
|
+
], Wn);
|
|
4871
|
+
export {
|
|
4872
|
+
rt as W3mAllWalletsView,
|
|
4873
|
+
Ze as W3mConnectingWcBasicView,
|
|
4874
|
+
Wn as W3mDownloadsView
|
|
4875
|
+
};
|