@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,2822 @@
|
|
|
1
|
+
import { c as h, w as Pe, p as Ie, R as u, d as f, e as re, a as I, E as _, h as ae, W as se, C as m, B as K, i as ce, j as Y, k as q, l as Ve, m as Ee, n as je, o as ue, q as Ne, r as We, M as $, t as le, u as S, v as oe, x as T, y as c, z as Re, D as pe, F as fe, G as Ge, H as F, O as g, I as Oe, A as ie, T as Ke, J as Ye, P as Xe } from "./core-CnCeDQAm.js";
|
|
2
|
+
import { c as y, n as p, o as E, r as w, U as De } from "./index-Chq42DrS.js";
|
|
3
|
+
const D = {
|
|
4
|
+
getGasPriceInEther(e, t) {
|
|
5
|
+
const o = t * e;
|
|
6
|
+
return Number(o) / 1e18;
|
|
7
|
+
},
|
|
8
|
+
getGasPriceInUSD(e, t, o) {
|
|
9
|
+
const i = D.getGasPriceInEther(t, o);
|
|
10
|
+
return h.bigNumber(e).times(i).toNumber();
|
|
11
|
+
},
|
|
12
|
+
getPriceImpact({ sourceTokenAmount: e, sourceTokenPriceInUSD: t, toTokenPriceInUSD: o, toTokenAmount: i }) {
|
|
13
|
+
const a = h.bigNumber(e).times(t), n = h.bigNumber(i).times(o);
|
|
14
|
+
return a.minus(n).div(a).times(100).toNumber();
|
|
15
|
+
},
|
|
16
|
+
getMaxSlippage(e, t) {
|
|
17
|
+
const o = h.bigNumber(e).div(100);
|
|
18
|
+
return h.multiply(t, o).toNumber();
|
|
19
|
+
},
|
|
20
|
+
getProviderFee(e, t = 85e-4) {
|
|
21
|
+
return h.bigNumber(e).times(t).toString();
|
|
22
|
+
},
|
|
23
|
+
isInsufficientNetworkTokenForGas(e, t) {
|
|
24
|
+
const o = t || "0";
|
|
25
|
+
return h.bigNumber(e).eq(0) ? !0 : h.bigNumber(h.bigNumber(o)).gt(e);
|
|
26
|
+
},
|
|
27
|
+
isInsufficientSourceTokenForSwap(e, t, o) {
|
|
28
|
+
const i = o?.find((n) => n.address === t)?.quantity?.numeric;
|
|
29
|
+
return h.bigNumber(i || "0").lt(e);
|
|
30
|
+
}
|
|
31
|
+
}, xe = 15e4, qe = 6, k = {
|
|
32
|
+
// Loading states
|
|
33
|
+
initializing: !1,
|
|
34
|
+
initialized: !1,
|
|
35
|
+
loadingPrices: !1,
|
|
36
|
+
loadingQuote: !1,
|
|
37
|
+
loadingApprovalTransaction: !1,
|
|
38
|
+
loadingBuildTransaction: !1,
|
|
39
|
+
loadingTransaction: !1,
|
|
40
|
+
// Control states
|
|
41
|
+
switchingTokens: !1,
|
|
42
|
+
// Error states
|
|
43
|
+
fetchError: !1,
|
|
44
|
+
// Approval & Swap transaction states
|
|
45
|
+
approvalTransaction: void 0,
|
|
46
|
+
swapTransaction: void 0,
|
|
47
|
+
transactionError: void 0,
|
|
48
|
+
// Input values
|
|
49
|
+
sourceToken: void 0,
|
|
50
|
+
sourceTokenAmount: "",
|
|
51
|
+
sourceTokenPriceInUSD: 0,
|
|
52
|
+
toToken: void 0,
|
|
53
|
+
toTokenAmount: "",
|
|
54
|
+
toTokenPriceInUSD: 0,
|
|
55
|
+
networkPrice: "0",
|
|
56
|
+
networkBalanceInUSD: "0",
|
|
57
|
+
networkTokenSymbol: "",
|
|
58
|
+
inputError: void 0,
|
|
59
|
+
// Request values
|
|
60
|
+
slippage: Ee.CONVERT_SLIPPAGE_TOLERANCE,
|
|
61
|
+
// Tokens
|
|
62
|
+
tokens: void 0,
|
|
63
|
+
popularTokens: void 0,
|
|
64
|
+
suggestedTokens: void 0,
|
|
65
|
+
foundTokens: void 0,
|
|
66
|
+
myTokensWithBalance: void 0,
|
|
67
|
+
tokensPriceMap: {},
|
|
68
|
+
// Calculations
|
|
69
|
+
gasFee: "0",
|
|
70
|
+
gasPriceInUSD: 0,
|
|
71
|
+
priceImpact: void 0,
|
|
72
|
+
maxSlippage: void 0,
|
|
73
|
+
providerFee: void 0
|
|
74
|
+
}, r = Ie({ ...k }), de = {
|
|
75
|
+
state: r,
|
|
76
|
+
subscribe(e) {
|
|
77
|
+
return We(r, () => e(r));
|
|
78
|
+
},
|
|
79
|
+
subscribeKey(e, t) {
|
|
80
|
+
return Ne(r, e, t);
|
|
81
|
+
},
|
|
82
|
+
getParams() {
|
|
83
|
+
const e = m.state.activeChain, t = m.getAccountData(e)?.caipAddress ?? m.state.activeCaipAddress, o = ce.getPlainAddress(t), i = je(), a = ue.getConnectorId(m.state.activeChain);
|
|
84
|
+
if (!o)
|
|
85
|
+
throw new Error("No address found to swap the tokens from.");
|
|
86
|
+
const n = !r.toToken?.address || !r.toToken?.decimals, s = !r.sourceToken?.address || !r.sourceToken?.decimals || !h.bigNumber(r.sourceTokenAmount).gt(0), l = !r.sourceTokenAmount;
|
|
87
|
+
return {
|
|
88
|
+
networkAddress: i,
|
|
89
|
+
fromAddress: o,
|
|
90
|
+
fromCaipAddress: t,
|
|
91
|
+
sourceTokenAddress: r.sourceToken?.address,
|
|
92
|
+
toTokenAddress: r.toToken?.address,
|
|
93
|
+
toTokenAmount: r.toTokenAmount,
|
|
94
|
+
toTokenDecimals: r.toToken?.decimals,
|
|
95
|
+
sourceTokenAmount: r.sourceTokenAmount,
|
|
96
|
+
sourceTokenDecimals: r.sourceToken?.decimals,
|
|
97
|
+
invalidToToken: n,
|
|
98
|
+
invalidSourceToken: s,
|
|
99
|
+
invalidSourceTokenAmount: l,
|
|
100
|
+
availableToSwap: t && !n && !s && !l,
|
|
101
|
+
isAuthConnector: a === I.CONNECTOR_ID.AUTH
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
async setSourceToken(e) {
|
|
105
|
+
if (!e) {
|
|
106
|
+
r.sourceToken = e, r.sourceTokenAmount = "", r.sourceTokenPriceInUSD = 0;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
r.sourceToken = e, await d.setTokenPrice(e.address, "sourceToken");
|
|
110
|
+
},
|
|
111
|
+
setSourceTokenAmount(e) {
|
|
112
|
+
r.sourceTokenAmount = e;
|
|
113
|
+
},
|
|
114
|
+
async setToToken(e) {
|
|
115
|
+
if (!e) {
|
|
116
|
+
r.toToken = e, r.toTokenAmount = "", r.toTokenPriceInUSD = 0;
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
r.toToken = e, await d.setTokenPrice(e.address, "toToken");
|
|
120
|
+
},
|
|
121
|
+
setToTokenAmount(e) {
|
|
122
|
+
r.toTokenAmount = e ? h.toFixed(e, qe) : "";
|
|
123
|
+
},
|
|
124
|
+
async setTokenPrice(e, t) {
|
|
125
|
+
let o = r.tokensPriceMap[e] || 0;
|
|
126
|
+
o || (r.loadingPrices = !0, o = await d.getAddressPrice(e)), t === "sourceToken" ? r.sourceTokenPriceInUSD = o : t === "toToken" && (r.toTokenPriceInUSD = o), r.loadingPrices && (r.loadingPrices = !1), d.getParams().availableToSwap && !r.switchingTokens && d.swapTokens();
|
|
127
|
+
},
|
|
128
|
+
async switchTokens() {
|
|
129
|
+
if (!(r.initializing || !r.initialized || r.switchingTokens)) {
|
|
130
|
+
r.switchingTokens = !0;
|
|
131
|
+
try {
|
|
132
|
+
const e = r.toToken ? { ...r.toToken } : void 0, t = r.sourceToken ? { ...r.sourceToken } : void 0, o = e && r.toTokenAmount === "" ? "1" : r.toTokenAmount;
|
|
133
|
+
d.setSourceTokenAmount(o), d.setToTokenAmount(""), await d.setSourceToken(e), await d.setToToken(t), r.switchingTokens = !1, d.swapTokens();
|
|
134
|
+
} catch (e) {
|
|
135
|
+
throw r.switchingTokens = !1, e;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
resetState() {
|
|
140
|
+
r.myTokensWithBalance = k.myTokensWithBalance, r.tokensPriceMap = k.tokensPriceMap, r.initialized = k.initialized, r.initializing = k.initializing, r.switchingTokens = k.switchingTokens, r.sourceToken = k.sourceToken, r.sourceTokenAmount = k.sourceTokenAmount, r.sourceTokenPriceInUSD = k.sourceTokenPriceInUSD, r.toToken = k.toToken, r.toTokenAmount = k.toTokenAmount, r.toTokenPriceInUSD = k.toTokenPriceInUSD, r.networkPrice = k.networkPrice, r.networkTokenSymbol = k.networkTokenSymbol, r.networkBalanceInUSD = k.networkBalanceInUSD, r.inputError = k.inputError;
|
|
141
|
+
},
|
|
142
|
+
resetValues() {
|
|
143
|
+
const { networkAddress: e } = d.getParams(), t = r.tokens?.find((o) => o.address === e);
|
|
144
|
+
d.setSourceToken(t), d.setToToken(void 0);
|
|
145
|
+
},
|
|
146
|
+
getApprovalLoadingState() {
|
|
147
|
+
return r.loadingApprovalTransaction;
|
|
148
|
+
},
|
|
149
|
+
clearError() {
|
|
150
|
+
r.transactionError = void 0;
|
|
151
|
+
},
|
|
152
|
+
async initializeState() {
|
|
153
|
+
if (!r.initializing) {
|
|
154
|
+
if (r.initializing = !0, !r.initialized)
|
|
155
|
+
try {
|
|
156
|
+
await d.fetchTokens(), r.initialized = !0;
|
|
157
|
+
} catch {
|
|
158
|
+
r.initialized = !1, f.showError("Failed to initialize swap"), u.goBack();
|
|
159
|
+
}
|
|
160
|
+
r.initializing = !1;
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
async fetchTokens() {
|
|
164
|
+
const { networkAddress: e } = d.getParams();
|
|
165
|
+
await d.getNetworkTokenPrice(), await d.getMyTokensWithBalance();
|
|
166
|
+
const t = r.myTokensWithBalance?.find((o) => o.address === e);
|
|
167
|
+
t && (r.networkTokenSymbol = t.symbol, d.setSourceToken(t), d.setSourceTokenAmount("0"));
|
|
168
|
+
},
|
|
169
|
+
async getTokenList() {
|
|
170
|
+
const e = m.state.activeCaipNetwork?.caipNetworkId;
|
|
171
|
+
if (!(r.caipNetworkId === e && r.tokens))
|
|
172
|
+
try {
|
|
173
|
+
r.tokensLoading = !0;
|
|
174
|
+
const t = await Y.getTokenList(e);
|
|
175
|
+
r.tokens = t, r.caipNetworkId = e, r.popularTokens = t.sort((o, i) => o.symbol < i.symbol ? -1 : o.symbol > i.symbol ? 1 : 0), r.suggestedTokens = t.filter((o) => !!Ee.SWAP_SUGGESTED_TOKENS.includes(o.symbol));
|
|
176
|
+
} catch {
|
|
177
|
+
r.tokens = [], r.popularTokens = [], r.suggestedTokens = [];
|
|
178
|
+
} finally {
|
|
179
|
+
r.tokensLoading = !1;
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
async getAddressPrice(e) {
|
|
183
|
+
const t = r.tokensPriceMap[e];
|
|
184
|
+
if (t)
|
|
185
|
+
return t;
|
|
186
|
+
const i = (await K.fetchTokenPrice({
|
|
187
|
+
addresses: [e]
|
|
188
|
+
}))?.fungibles || [], n = [...r.tokens || [], ...r.myTokensWithBalance || []]?.find((v) => v.address === e)?.symbol, s = i.find((v) => v.symbol.toLowerCase() === n?.toLowerCase())?.price || 0, l = parseFloat(s.toString());
|
|
189
|
+
return r.tokensPriceMap[e] = l, l;
|
|
190
|
+
},
|
|
191
|
+
async getNetworkTokenPrice() {
|
|
192
|
+
const { networkAddress: e } = d.getParams(), o = (await K.fetchTokenPrice({
|
|
193
|
+
addresses: [e]
|
|
194
|
+
}).catch(() => (f.showError("Failed to fetch network token price"), { fungibles: [] }))).fungibles?.[0], i = o?.price.toString() || "0";
|
|
195
|
+
r.tokensPriceMap[e] = parseFloat(i), r.networkTokenSymbol = o?.symbol || "", r.networkPrice = i;
|
|
196
|
+
},
|
|
197
|
+
async getMyTokensWithBalance(e) {
|
|
198
|
+
const t = await Ve.getMyTokensWithBalance(e), o = Y.mapBalancesToSwapTokens(t);
|
|
199
|
+
o && (await d.getInitialGasPrice(), d.setBalances(o));
|
|
200
|
+
},
|
|
201
|
+
setBalances(e) {
|
|
202
|
+
const { networkAddress: t } = d.getParams(), o = m.state.activeCaipNetwork;
|
|
203
|
+
if (!o)
|
|
204
|
+
return;
|
|
205
|
+
const i = e.find((a) => a.address === t);
|
|
206
|
+
e.forEach((a) => {
|
|
207
|
+
r.tokensPriceMap[a.address] = a.price || 0;
|
|
208
|
+
}), r.myTokensWithBalance = e.filter((a) => a.address.startsWith(o.caipNetworkId)), r.networkBalanceInUSD = i ? h.multiply(i.quantity.numeric, i.price).toString() : "0";
|
|
209
|
+
},
|
|
210
|
+
async getInitialGasPrice() {
|
|
211
|
+
const e = await Y.fetchGasPrice();
|
|
212
|
+
if (!e)
|
|
213
|
+
return { gasPrice: null, gasPriceInUSD: null };
|
|
214
|
+
switch (m.state?.activeCaipNetwork?.chainNamespace) {
|
|
215
|
+
case I.CHAIN.SOLANA:
|
|
216
|
+
return r.gasFee = e.standard ?? "0", r.gasPriceInUSD = h.multiply(e.standard, r.networkPrice).div(1e9).toNumber(), {
|
|
217
|
+
gasPrice: BigInt(r.gasFee),
|
|
218
|
+
gasPriceInUSD: Number(r.gasPriceInUSD)
|
|
219
|
+
};
|
|
220
|
+
case I.CHAIN.EVM:
|
|
221
|
+
default:
|
|
222
|
+
const t = e.standard ?? "0", o = BigInt(t), i = BigInt(xe), a = D.getGasPriceInUSD(r.networkPrice, i, o);
|
|
223
|
+
return r.gasFee = t, r.gasPriceInUSD = a, { gasPrice: o, gasPriceInUSD: a };
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
// -- Swap -------------------------------------- //
|
|
227
|
+
async swapTokens() {
|
|
228
|
+
const e = m.getAccountData()?.address, t = r.sourceToken, o = r.toToken, i = h.bigNumber(r.sourceTokenAmount).gt(0);
|
|
229
|
+
if (i || d.setToTokenAmount(""), !o || !t || r.loadingPrices || !i || !e)
|
|
230
|
+
return;
|
|
231
|
+
r.loadingQuote = !0;
|
|
232
|
+
const a = h.bigNumber(r.sourceTokenAmount).times(10 ** t.decimals).round(0);
|
|
233
|
+
try {
|
|
234
|
+
const n = await K.fetchSwapQuote({
|
|
235
|
+
userAddress: e,
|
|
236
|
+
from: t.address,
|
|
237
|
+
to: o.address,
|
|
238
|
+
gasPrice: r.gasFee,
|
|
239
|
+
amount: a.toString()
|
|
240
|
+
});
|
|
241
|
+
r.loadingQuote = !1;
|
|
242
|
+
const s = n?.quotes?.[0]?.toAmount;
|
|
243
|
+
if (!s) {
|
|
244
|
+
q.open({
|
|
245
|
+
displayMessage: "Incorrect amount",
|
|
246
|
+
debugMessage: "Please enter a valid amount"
|
|
247
|
+
}, "error");
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const l = h.bigNumber(s).div(10 ** o.decimals).toString();
|
|
251
|
+
d.setToTokenAmount(l), d.hasInsufficientToken(r.sourceTokenAmount, t.address) ? r.inputError = "Insufficient balance" : (r.inputError = void 0, d.setTransactionDetails());
|
|
252
|
+
} catch (n) {
|
|
253
|
+
const s = await Y.handleSwapError(n);
|
|
254
|
+
r.loadingQuote = !1, r.inputError = s || "Insufficient balance";
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
// -- Create Transactions -------------------------------------- //
|
|
258
|
+
async getTransaction() {
|
|
259
|
+
const { fromCaipAddress: e, availableToSwap: t } = d.getParams(), o = r.sourceToken, i = r.toToken;
|
|
260
|
+
if (!(!e || !t || !o || !i || r.loadingQuote))
|
|
261
|
+
try {
|
|
262
|
+
r.loadingBuildTransaction = !0;
|
|
263
|
+
const a = await Y.fetchSwapAllowance({
|
|
264
|
+
userAddress: e,
|
|
265
|
+
tokenAddress: o.address,
|
|
266
|
+
sourceTokenAmount: r.sourceTokenAmount,
|
|
267
|
+
sourceTokenDecimals: o.decimals
|
|
268
|
+
});
|
|
269
|
+
let n;
|
|
270
|
+
return a ? n = await d.createSwapTransaction() : n = await d.createAllowanceTransaction(), r.loadingBuildTransaction = !1, r.fetchError = !1, n;
|
|
271
|
+
} catch {
|
|
272
|
+
u.goBack(), f.showError("Failed to check allowance"), r.loadingBuildTransaction = !1, r.approvalTransaction = void 0, r.swapTransaction = void 0, r.fetchError = !0;
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
async createAllowanceTransaction() {
|
|
277
|
+
const { fromCaipAddress: e, sourceTokenAddress: t, toTokenAddress: o } = d.getParams();
|
|
278
|
+
if (!(!e || !o)) {
|
|
279
|
+
if (!t)
|
|
280
|
+
throw new Error("createAllowanceTransaction - No source token address found.");
|
|
281
|
+
try {
|
|
282
|
+
const i = await K.generateApproveCalldata({
|
|
283
|
+
from: t,
|
|
284
|
+
to: o,
|
|
285
|
+
userAddress: e
|
|
286
|
+
}), a = ce.getPlainAddress(i.tx.from);
|
|
287
|
+
if (!a)
|
|
288
|
+
throw new Error("SwapController:createAllowanceTransaction - address is required");
|
|
289
|
+
const n = {
|
|
290
|
+
data: i.tx.data,
|
|
291
|
+
to: a,
|
|
292
|
+
gasPrice: BigInt(i.tx.eip155.gasPrice),
|
|
293
|
+
value: BigInt(i.tx.value),
|
|
294
|
+
toAmount: r.toTokenAmount
|
|
295
|
+
};
|
|
296
|
+
return r.swapTransaction = void 0, r.approvalTransaction = {
|
|
297
|
+
data: n.data,
|
|
298
|
+
to: n.to,
|
|
299
|
+
gasPrice: n.gasPrice,
|
|
300
|
+
value: n.value,
|
|
301
|
+
toAmount: n.toAmount
|
|
302
|
+
}, {
|
|
303
|
+
data: n.data,
|
|
304
|
+
to: n.to,
|
|
305
|
+
gasPrice: n.gasPrice,
|
|
306
|
+
value: n.value,
|
|
307
|
+
toAmount: n.toAmount
|
|
308
|
+
};
|
|
309
|
+
} catch {
|
|
310
|
+
u.goBack(), f.showError("Failed to create approval transaction"), r.approvalTransaction = void 0, r.swapTransaction = void 0, r.fetchError = !0;
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
async createSwapTransaction() {
|
|
316
|
+
const { networkAddress: e, fromCaipAddress: t, sourceTokenAmount: o } = d.getParams(), i = r.sourceToken, a = r.toToken;
|
|
317
|
+
if (!t || !o || !i || !a)
|
|
318
|
+
return;
|
|
319
|
+
const n = re.parseUnits(o, i.decimals)?.toString();
|
|
320
|
+
try {
|
|
321
|
+
const s = await K.generateSwapCalldata({
|
|
322
|
+
userAddress: t,
|
|
323
|
+
from: i.address,
|
|
324
|
+
to: a.address,
|
|
325
|
+
amount: n,
|
|
326
|
+
disableEstimate: !0
|
|
327
|
+
}), l = i.address === e, v = BigInt(s.tx.eip155.gas), H = BigInt(s.tx.eip155.gasPrice), M = ce.getPlainAddress(s.tx.to);
|
|
328
|
+
if (!M)
|
|
329
|
+
throw new Error("SwapController:createSwapTransaction - address is required");
|
|
330
|
+
const V = {
|
|
331
|
+
data: s.tx.data,
|
|
332
|
+
to: M,
|
|
333
|
+
gas: v,
|
|
334
|
+
gasPrice: H,
|
|
335
|
+
value: BigInt(l ? n ?? "0" : "0"),
|
|
336
|
+
toAmount: r.toTokenAmount
|
|
337
|
+
};
|
|
338
|
+
return r.gasPriceInUSD = D.getGasPriceInUSD(r.networkPrice, v, H), r.approvalTransaction = void 0, r.swapTransaction = V, V;
|
|
339
|
+
} catch {
|
|
340
|
+
u.goBack(), f.showError("Failed to create transaction"), r.approvalTransaction = void 0, r.swapTransaction = void 0, r.fetchError = !0;
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
onEmbeddedWalletApprovalSuccess() {
|
|
345
|
+
f.showLoading("Approve limit increase in your wallet"), u.replace("SwapPreview");
|
|
346
|
+
},
|
|
347
|
+
// -- Send Transactions --------------------------------- //
|
|
348
|
+
async sendTransactionForApproval(e) {
|
|
349
|
+
const { fromAddress: t, isAuthConnector: o } = d.getParams();
|
|
350
|
+
r.loadingApprovalTransaction = !0, o ? u.pushTransactionStack({
|
|
351
|
+
onSuccess: d.onEmbeddedWalletApprovalSuccess
|
|
352
|
+
}) : f.showLoading("Approve limit increase in your wallet");
|
|
353
|
+
try {
|
|
354
|
+
await re.sendTransaction({
|
|
355
|
+
address: t,
|
|
356
|
+
to: e.to,
|
|
357
|
+
data: e.data,
|
|
358
|
+
value: e.value,
|
|
359
|
+
chainNamespace: I.CHAIN.EVM
|
|
360
|
+
}), await d.swapTokens(), await d.getTransaction(), r.approvalTransaction = void 0, r.loadingApprovalTransaction = !1;
|
|
361
|
+
} catch (a) {
|
|
362
|
+
const n = a;
|
|
363
|
+
r.transactionError = n?.displayMessage, r.loadingApprovalTransaction = !1, f.showError(n?.displayMessage || "Transaction error"), _.sendEvent({
|
|
364
|
+
type: "track",
|
|
365
|
+
event: "SWAP_APPROVAL_ERROR",
|
|
366
|
+
properties: {
|
|
367
|
+
message: n?.displayMessage || n?.message || "Unknown",
|
|
368
|
+
network: m.state.activeCaipNetwork?.caipNetworkId || "",
|
|
369
|
+
swapFromToken: d.state.sourceToken?.symbol || "",
|
|
370
|
+
swapToToken: d.state.toToken?.symbol || "",
|
|
371
|
+
swapFromAmount: d.state.sourceTokenAmount || "",
|
|
372
|
+
swapToAmount: d.state.toTokenAmount || "",
|
|
373
|
+
isSmartAccount: ae(I.CHAIN.EVM) === se.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
async sendTransactionForSwap(e) {
|
|
379
|
+
if (!e)
|
|
380
|
+
return;
|
|
381
|
+
const { fromAddress: t, toTokenAmount: o, isAuthConnector: i } = d.getParams();
|
|
382
|
+
r.loadingTransaction = !0;
|
|
383
|
+
const a = `Swapping ${r.sourceToken?.symbol} to ${h.formatNumberToLocalString(o, 3)} ${r.toToken?.symbol}`, n = `Swapped ${r.sourceToken?.symbol} to ${h.formatNumberToLocalString(o, 3)} ${r.toToken?.symbol}`;
|
|
384
|
+
i ? u.pushTransactionStack({
|
|
385
|
+
onSuccess() {
|
|
386
|
+
u.replace("Account"), f.showLoading(a), de.resetState();
|
|
387
|
+
}
|
|
388
|
+
}) : f.showLoading("Confirm transaction in your wallet");
|
|
389
|
+
try {
|
|
390
|
+
const s = [r.sourceToken?.address, r.toToken?.address].join(","), l = await re.sendTransaction({
|
|
391
|
+
address: t,
|
|
392
|
+
to: e.to,
|
|
393
|
+
data: e.data,
|
|
394
|
+
value: e.value,
|
|
395
|
+
chainNamespace: I.CHAIN.EVM
|
|
396
|
+
});
|
|
397
|
+
return r.loadingTransaction = !1, f.showSuccess(n), _.sendEvent({
|
|
398
|
+
type: "track",
|
|
399
|
+
event: "SWAP_SUCCESS",
|
|
400
|
+
properties: {
|
|
401
|
+
network: m.state.activeCaipNetwork?.caipNetworkId || "",
|
|
402
|
+
swapFromToken: d.state.sourceToken?.symbol || "",
|
|
403
|
+
swapToToken: d.state.toToken?.symbol || "",
|
|
404
|
+
swapFromAmount: d.state.sourceTokenAmount || "",
|
|
405
|
+
swapToAmount: d.state.toTokenAmount || "",
|
|
406
|
+
isSmartAccount: ae(I.CHAIN.EVM) === se.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
407
|
+
}
|
|
408
|
+
}), de.resetState(), i || u.replace("Account"), de.getMyTokensWithBalance(s), l;
|
|
409
|
+
} catch (s) {
|
|
410
|
+
const l = s;
|
|
411
|
+
r.transactionError = l?.displayMessage, r.loadingTransaction = !1, f.showError(l?.displayMessage || "Transaction error"), _.sendEvent({
|
|
412
|
+
type: "track",
|
|
413
|
+
event: "SWAP_ERROR",
|
|
414
|
+
properties: {
|
|
415
|
+
message: l?.displayMessage || l?.message || "Unknown",
|
|
416
|
+
network: m.state.activeCaipNetwork?.caipNetworkId || "",
|
|
417
|
+
swapFromToken: d.state.sourceToken?.symbol || "",
|
|
418
|
+
swapToToken: d.state.toToken?.symbol || "",
|
|
419
|
+
swapFromAmount: d.state.sourceTokenAmount || "",
|
|
420
|
+
swapToAmount: d.state.toTokenAmount || "",
|
|
421
|
+
isSmartAccount: ae(I.CHAIN.EVM) === se.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
// -- Checks -------------------------------------------- //
|
|
428
|
+
hasInsufficientToken(e, t) {
|
|
429
|
+
return D.isInsufficientSourceTokenForSwap(e, t, r.myTokensWithBalance);
|
|
430
|
+
},
|
|
431
|
+
// -- Calculations -------------------------------------- //
|
|
432
|
+
setTransactionDetails() {
|
|
433
|
+
const { toTokenAddress: e, toTokenDecimals: t } = d.getParams();
|
|
434
|
+
!e || !t || (r.gasPriceInUSD = D.getGasPriceInUSD(r.networkPrice, BigInt(r.gasFee), BigInt(xe)), r.priceImpact = D.getPriceImpact({
|
|
435
|
+
sourceTokenAmount: r.sourceTokenAmount,
|
|
436
|
+
sourceTokenPriceInUSD: r.sourceTokenPriceInUSD,
|
|
437
|
+
toTokenPriceInUSD: r.toTokenPriceInUSD,
|
|
438
|
+
toTokenAmount: r.toTokenAmount
|
|
439
|
+
}), r.maxSlippage = D.getMaxSlippage(r.slippage, r.toTokenAmount), r.providerFee = D.getProviderFee(r.sourceTokenAmount));
|
|
440
|
+
}
|
|
441
|
+
}, d = Pe(de), A = Ie({
|
|
442
|
+
message: "",
|
|
443
|
+
open: !1,
|
|
444
|
+
triggerRect: {
|
|
445
|
+
width: 0,
|
|
446
|
+
height: 0,
|
|
447
|
+
top: 0,
|
|
448
|
+
left: 0
|
|
449
|
+
},
|
|
450
|
+
variant: "shade"
|
|
451
|
+
}), Qe = {
|
|
452
|
+
state: A,
|
|
453
|
+
subscribe(e) {
|
|
454
|
+
return We(A, () => e(A));
|
|
455
|
+
},
|
|
456
|
+
subscribeKey(e, t) {
|
|
457
|
+
return Ne(A, e, t);
|
|
458
|
+
},
|
|
459
|
+
showTooltip({ message: e, triggerRect: t, variant: o }) {
|
|
460
|
+
A.open = !0, A.message = e, A.triggerRect = t, A.variant = o;
|
|
461
|
+
},
|
|
462
|
+
hide() {
|
|
463
|
+
A.open = !1, A.message = "", A.triggerRect = {
|
|
464
|
+
width: 0,
|
|
465
|
+
height: 0,
|
|
466
|
+
top: 0,
|
|
467
|
+
left: 0
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
}, X = Pe(Qe), _e = {
|
|
471
|
+
isUnsupportedChainView() {
|
|
472
|
+
return u.state.view === "UnsupportedChain" || u.state.view === "SwitchNetwork" && u.state.history.includes("UnsupportedChain");
|
|
473
|
+
},
|
|
474
|
+
async safeClose() {
|
|
475
|
+
if (this.isUnsupportedChainView()) {
|
|
476
|
+
$.shake();
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
if (await le.isSIWXCloseDisabled()) {
|
|
480
|
+
$.shake();
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
(u.state.view === "DataCapture" || u.state.view === "DataCaptureOtpConfirm") && re.disconnect(), $.close();
|
|
484
|
+
}
|
|
485
|
+
}, Ze = S`
|
|
486
|
+
:host {
|
|
487
|
+
display: block;
|
|
488
|
+
border-radius: clamp(0px, ${({ borderRadius: e }) => e[8]}, 44px);
|
|
489
|
+
box-shadow: 0 0 0 1px ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
490
|
+
overflow: hidden;
|
|
491
|
+
}
|
|
492
|
+
`;
|
|
493
|
+
var Je = function(e, t, o, i) {
|
|
494
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
495
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
496
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
497
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
498
|
+
};
|
|
499
|
+
let ge = class extends T {
|
|
500
|
+
render() {
|
|
501
|
+
return c`<slot></slot>`;
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
ge.styles = [oe, Ze];
|
|
505
|
+
ge = Je([
|
|
506
|
+
y("wui-card")
|
|
507
|
+
], ge);
|
|
508
|
+
const et = S`
|
|
509
|
+
:host {
|
|
510
|
+
width: 100%;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
:host > wui-flex {
|
|
514
|
+
width: 100%;
|
|
515
|
+
display: flex;
|
|
516
|
+
align-items: center;
|
|
517
|
+
justify-content: center;
|
|
518
|
+
gap: ${({ spacing: e }) => e[2]};
|
|
519
|
+
padding: ${({ spacing: e }) => e[3]};
|
|
520
|
+
border-radius: ${({ borderRadius: e }) => e[6]};
|
|
521
|
+
border: 1px solid ${({ tokens: e }) => e.theme.borderPrimary};
|
|
522
|
+
box-sizing: border-box;
|
|
523
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
524
|
+
box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
|
|
525
|
+
color: ${({ tokens: e }) => e.theme.textPrimary};
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
:host > wui-flex[data-type='info'] {
|
|
529
|
+
.icon-box {
|
|
530
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
531
|
+
|
|
532
|
+
wui-icon {
|
|
533
|
+
color: ${({ tokens: e }) => e.theme.iconDefault};
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
:host > wui-flex[data-type='success'] {
|
|
538
|
+
.icon-box {
|
|
539
|
+
background-color: ${({ tokens: e }) => e.core.backgroundSuccess};
|
|
540
|
+
|
|
541
|
+
wui-icon {
|
|
542
|
+
color: ${({ tokens: e }) => e.core.borderSuccess};
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
:host > wui-flex[data-type='warning'] {
|
|
547
|
+
.icon-box {
|
|
548
|
+
background-color: ${({ tokens: e }) => e.core.backgroundWarning};
|
|
549
|
+
|
|
550
|
+
wui-icon {
|
|
551
|
+
color: ${({ tokens: e }) => e.core.borderWarning};
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
:host > wui-flex[data-type='error'] {
|
|
556
|
+
.icon-box {
|
|
557
|
+
background-color: ${({ tokens: e }) => e.core.backgroundError};
|
|
558
|
+
|
|
559
|
+
wui-icon {
|
|
560
|
+
color: ${({ tokens: e }) => e.core.borderError};
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
wui-flex {
|
|
566
|
+
width: 100%;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
wui-text {
|
|
570
|
+
word-break: break-word;
|
|
571
|
+
flex: 1;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.close {
|
|
575
|
+
cursor: pointer;
|
|
576
|
+
color: ${({ tokens: e }) => e.theme.iconDefault};
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.icon-box {
|
|
580
|
+
height: 40px;
|
|
581
|
+
width: 40px;
|
|
582
|
+
border-radius: ${({ borderRadius: e }) => e[2]};
|
|
583
|
+
background-color: var(--local-icon-bg-value);
|
|
584
|
+
}
|
|
585
|
+
`;
|
|
586
|
+
var ve = function(e, t, o, i) {
|
|
587
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
588
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
589
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
590
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
591
|
+
};
|
|
592
|
+
const tt = {
|
|
593
|
+
info: "info",
|
|
594
|
+
success: "checkmark",
|
|
595
|
+
warning: "warningCircle",
|
|
596
|
+
error: "warning"
|
|
597
|
+
};
|
|
598
|
+
let Z = class extends T {
|
|
599
|
+
constructor() {
|
|
600
|
+
super(...arguments), this.message = "", this.type = "info";
|
|
601
|
+
}
|
|
602
|
+
render() {
|
|
603
|
+
return c`
|
|
604
|
+
<wui-flex
|
|
605
|
+
data-type=${E(this.type)}
|
|
606
|
+
flexDirection="row"
|
|
607
|
+
justifyContent="space-between"
|
|
608
|
+
alignItems="center"
|
|
609
|
+
gap="2"
|
|
610
|
+
>
|
|
611
|
+
<wui-flex columnGap="2" flexDirection="row" alignItems="center">
|
|
612
|
+
<wui-flex
|
|
613
|
+
flexDirection="row"
|
|
614
|
+
alignItems="center"
|
|
615
|
+
justifyContent="center"
|
|
616
|
+
class="icon-box"
|
|
617
|
+
>
|
|
618
|
+
<wui-icon color="inherit" size="md" name=${tt[this.type]}></wui-icon>
|
|
619
|
+
</wui-flex>
|
|
620
|
+
<wui-text variant="md-medium" color="inherit" data-testid="wui-alertbar-text"
|
|
621
|
+
>${this.message}</wui-text
|
|
622
|
+
>
|
|
623
|
+
</wui-flex>
|
|
624
|
+
<wui-icon
|
|
625
|
+
class="close"
|
|
626
|
+
color="inherit"
|
|
627
|
+
size="sm"
|
|
628
|
+
name="close"
|
|
629
|
+
@click=${this.onClose}
|
|
630
|
+
></wui-icon>
|
|
631
|
+
</wui-flex>
|
|
632
|
+
`;
|
|
633
|
+
}
|
|
634
|
+
onClose() {
|
|
635
|
+
q.close();
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
Z.styles = [oe, et];
|
|
639
|
+
ve([
|
|
640
|
+
p()
|
|
641
|
+
], Z.prototype, "message", void 0);
|
|
642
|
+
ve([
|
|
643
|
+
p()
|
|
644
|
+
], Z.prototype, "type", void 0);
|
|
645
|
+
Z = ve([
|
|
646
|
+
y("wui-alertbar")
|
|
647
|
+
], Z);
|
|
648
|
+
const ot = S`
|
|
649
|
+
:host {
|
|
650
|
+
display: block;
|
|
651
|
+
position: absolute;
|
|
652
|
+
top: ${({ spacing: e }) => e[3]};
|
|
653
|
+
left: ${({ spacing: e }) => e[4]};
|
|
654
|
+
right: ${({ spacing: e }) => e[4]};
|
|
655
|
+
opacity: 0;
|
|
656
|
+
pointer-events: none;
|
|
657
|
+
}
|
|
658
|
+
`;
|
|
659
|
+
var Be = function(e, t, o, i) {
|
|
660
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
661
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
662
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
663
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
664
|
+
};
|
|
665
|
+
const nt = {
|
|
666
|
+
info: {
|
|
667
|
+
backgroundColor: "fg-350",
|
|
668
|
+
iconColor: "fg-325",
|
|
669
|
+
icon: "info"
|
|
670
|
+
},
|
|
671
|
+
success: {
|
|
672
|
+
backgroundColor: "success-glass-reown-020",
|
|
673
|
+
iconColor: "success-125",
|
|
674
|
+
icon: "checkmark"
|
|
675
|
+
},
|
|
676
|
+
warning: {
|
|
677
|
+
backgroundColor: "warning-glass-reown-020",
|
|
678
|
+
iconColor: "warning-100",
|
|
679
|
+
icon: "warningCircle"
|
|
680
|
+
},
|
|
681
|
+
error: {
|
|
682
|
+
backgroundColor: "error-glass-reown-020",
|
|
683
|
+
iconColor: "error-125",
|
|
684
|
+
icon: "warning"
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
let we = class extends T {
|
|
688
|
+
constructor() {
|
|
689
|
+
super(), this.unsubscribe = [], this.open = q.state.open, this.onOpen(!0), this.unsubscribe.push(q.subscribeKey("open", (t) => {
|
|
690
|
+
this.open = t, this.onOpen(!1);
|
|
691
|
+
}));
|
|
692
|
+
}
|
|
693
|
+
disconnectedCallback() {
|
|
694
|
+
this.unsubscribe.forEach((t) => t());
|
|
695
|
+
}
|
|
696
|
+
render() {
|
|
697
|
+
const { message: t, variant: o } = q.state, i = nt[o];
|
|
698
|
+
return c`
|
|
699
|
+
<wui-alertbar
|
|
700
|
+
message=${t}
|
|
701
|
+
backgroundColor=${i?.backgroundColor}
|
|
702
|
+
iconColor=${i?.iconColor}
|
|
703
|
+
icon=${i?.icon}
|
|
704
|
+
type=${o}
|
|
705
|
+
></wui-alertbar>
|
|
706
|
+
`;
|
|
707
|
+
}
|
|
708
|
+
onOpen(t) {
|
|
709
|
+
this.open ? (this.animate([
|
|
710
|
+
{ opacity: 0, transform: "scale(0.85)" },
|
|
711
|
+
{ opacity: 1, transform: "scale(1)" }
|
|
712
|
+
], {
|
|
713
|
+
duration: 150,
|
|
714
|
+
fill: "forwards",
|
|
715
|
+
easing: "ease"
|
|
716
|
+
}), this.style.cssText = "pointer-events: auto") : t || (this.animate([
|
|
717
|
+
{ opacity: 1, transform: "scale(1)" },
|
|
718
|
+
{ opacity: 0, transform: "scale(0.85)" }
|
|
719
|
+
], {
|
|
720
|
+
duration: 150,
|
|
721
|
+
fill: "forwards",
|
|
722
|
+
easing: "ease"
|
|
723
|
+
}), this.style.cssText = "pointer-events: none");
|
|
724
|
+
}
|
|
725
|
+
};
|
|
726
|
+
we.styles = ot;
|
|
727
|
+
Be([
|
|
728
|
+
w()
|
|
729
|
+
], we.prototype, "open", void 0);
|
|
730
|
+
we = Be([
|
|
731
|
+
y("w3m-alertbar")
|
|
732
|
+
], we);
|
|
733
|
+
const it = S`
|
|
734
|
+
:host {
|
|
735
|
+
position: relative;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
button {
|
|
739
|
+
display: flex;
|
|
740
|
+
justify-content: center;
|
|
741
|
+
align-items: center;
|
|
742
|
+
background-color: transparent;
|
|
743
|
+
padding: ${({ spacing: e }) => e[1]};
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/* -- Colors --------------------------------------------------- */
|
|
747
|
+
button[data-type='accent'] wui-icon {
|
|
748
|
+
color: ${({ tokens: e }) => e.core.iconAccentPrimary};
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
button[data-type='neutral'][data-variant='primary'] wui-icon {
|
|
752
|
+
color: ${({ tokens: e }) => e.theme.iconInverse};
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
button[data-type='neutral'][data-variant='secondary'] wui-icon {
|
|
756
|
+
color: ${({ tokens: e }) => e.theme.iconDefault};
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
button[data-type='success'] wui-icon {
|
|
760
|
+
color: ${({ tokens: e }) => e.core.iconSuccess};
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
button[data-type='error'] wui-icon {
|
|
764
|
+
color: ${({ tokens: e }) => e.core.iconError};
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/* -- Sizes --------------------------------------------------- */
|
|
768
|
+
button[data-size='xs'] {
|
|
769
|
+
width: 16px;
|
|
770
|
+
height: 16px;
|
|
771
|
+
|
|
772
|
+
border-radius: ${({ borderRadius: e }) => e[1]};
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
button[data-size='sm'] {
|
|
776
|
+
width: 20px;
|
|
777
|
+
height: 20px;
|
|
778
|
+
border-radius: ${({ borderRadius: e }) => e[1]};
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
button[data-size='md'] {
|
|
782
|
+
width: 24px;
|
|
783
|
+
height: 24px;
|
|
784
|
+
border-radius: ${({ borderRadius: e }) => e[2]};
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
button[data-size='lg'] {
|
|
788
|
+
width: 28px;
|
|
789
|
+
height: 28px;
|
|
790
|
+
border-radius: ${({ borderRadius: e }) => e[2]};
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
button[data-size='xs'] wui-icon {
|
|
794
|
+
width: 8px;
|
|
795
|
+
height: 8px;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
button[data-size='sm'] wui-icon {
|
|
799
|
+
width: 12px;
|
|
800
|
+
height: 12px;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
button[data-size='md'] wui-icon {
|
|
804
|
+
width: 16px;
|
|
805
|
+
height: 16px;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
button[data-size='lg'] wui-icon {
|
|
809
|
+
width: 20px;
|
|
810
|
+
height: 20px;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/* -- Hover --------------------------------------------------- */
|
|
814
|
+
@media (hover: hover) {
|
|
815
|
+
button[data-type='accent']:hover:enabled {
|
|
816
|
+
background-color: ${({ tokens: e }) => e.core.foregroundAccent010};
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
button[data-variant='primary'][data-type='neutral']:hover:enabled {
|
|
820
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
button[data-variant='secondary'][data-type='neutral']:hover:enabled {
|
|
824
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
button[data-type='success']:hover:enabled {
|
|
828
|
+
background-color: ${({ tokens: e }) => e.core.backgroundSuccess};
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
button[data-type='error']:hover:enabled {
|
|
832
|
+
background-color: ${({ tokens: e }) => e.core.backgroundError};
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
/* -- Focus --------------------------------------------------- */
|
|
837
|
+
button:focus-visible {
|
|
838
|
+
box-shadow: 0 0 0 4px ${({ tokens: e }) => e.core.foregroundAccent020};
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/* -- Properties --------------------------------------------------- */
|
|
842
|
+
button[data-full-width='true'] {
|
|
843
|
+
width: 100%;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
:host([fullWidth]) {
|
|
847
|
+
width: 100%;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
button[disabled] {
|
|
851
|
+
opacity: 0.5;
|
|
852
|
+
cursor: not-allowed;
|
|
853
|
+
}
|
|
854
|
+
`;
|
|
855
|
+
var U = function(e, t, o, i) {
|
|
856
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
857
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
858
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
859
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
860
|
+
};
|
|
861
|
+
let N = class extends T {
|
|
862
|
+
constructor() {
|
|
863
|
+
super(...arguments), this.icon = "card", this.variant = "primary", this.type = "accent", this.size = "md", this.iconSize = void 0, this.fullWidth = !1, this.disabled = !1;
|
|
864
|
+
}
|
|
865
|
+
render() {
|
|
866
|
+
return c`<button
|
|
867
|
+
data-variant=${this.variant}
|
|
868
|
+
data-type=${this.type}
|
|
869
|
+
data-size=${this.size}
|
|
870
|
+
data-full-width=${this.fullWidth}
|
|
871
|
+
?disabled=${this.disabled}
|
|
872
|
+
>
|
|
873
|
+
<wui-icon color="inherit" name=${this.icon} size=${E(this.iconSize)}></wui-icon>
|
|
874
|
+
</button>`;
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
N.styles = [oe, Re, it];
|
|
878
|
+
U([
|
|
879
|
+
p()
|
|
880
|
+
], N.prototype, "icon", void 0);
|
|
881
|
+
U([
|
|
882
|
+
p()
|
|
883
|
+
], N.prototype, "variant", void 0);
|
|
884
|
+
U([
|
|
885
|
+
p()
|
|
886
|
+
], N.prototype, "type", void 0);
|
|
887
|
+
U([
|
|
888
|
+
p()
|
|
889
|
+
], N.prototype, "size", void 0);
|
|
890
|
+
U([
|
|
891
|
+
p()
|
|
892
|
+
], N.prototype, "iconSize", void 0);
|
|
893
|
+
U([
|
|
894
|
+
p({ type: Boolean })
|
|
895
|
+
], N.prototype, "fullWidth", void 0);
|
|
896
|
+
U([
|
|
897
|
+
p({ type: Boolean })
|
|
898
|
+
], N.prototype, "disabled", void 0);
|
|
899
|
+
N = U([
|
|
900
|
+
y("wui-icon-button")
|
|
901
|
+
], N);
|
|
902
|
+
const rt = S`
|
|
903
|
+
button {
|
|
904
|
+
display: block;
|
|
905
|
+
display: flex;
|
|
906
|
+
align-items: center;
|
|
907
|
+
padding: ${({ spacing: e }) => e[1]};
|
|
908
|
+
transition: background-color ${({ durations: e }) => e.lg}
|
|
909
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
910
|
+
will-change: background-color;
|
|
911
|
+
border-radius: ${({ borderRadius: e }) => e[32]};
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
wui-image {
|
|
915
|
+
border-radius: 100%;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
wui-text {
|
|
919
|
+
padding-left: ${({ spacing: e }) => e[1]};
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
.left-icon-container,
|
|
923
|
+
.right-icon-container {
|
|
924
|
+
width: 24px;
|
|
925
|
+
height: 24px;
|
|
926
|
+
justify-content: center;
|
|
927
|
+
align-items: center;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
wui-icon {
|
|
931
|
+
color: ${({ tokens: e }) => e.theme.iconDefault};
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/* -- Sizes --------------------------------------------------- */
|
|
935
|
+
button[data-size='lg'] {
|
|
936
|
+
height: 32px;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
button[data-size='md'] {
|
|
940
|
+
height: 28px;
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
button[data-size='sm'] {
|
|
944
|
+
height: 24px;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
button[data-size='lg'] wui-image {
|
|
948
|
+
width: 24px;
|
|
949
|
+
height: 24px;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
button[data-size='md'] wui-image {
|
|
953
|
+
width: 20px;
|
|
954
|
+
height: 20px;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
button[data-size='sm'] wui-image {
|
|
958
|
+
width: 16px;
|
|
959
|
+
height: 16px;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
button[data-size='lg'] .left-icon-container {
|
|
963
|
+
width: 24px;
|
|
964
|
+
height: 24px;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
button[data-size='md'] .left-icon-container {
|
|
968
|
+
width: 20px;
|
|
969
|
+
height: 20px;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
button[data-size='sm'] .left-icon-container {
|
|
973
|
+
width: 16px;
|
|
974
|
+
height: 16px;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
/* -- Variants --------------------------------------------------------- */
|
|
978
|
+
button[data-type='filled-dropdown'] {
|
|
979
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
button[data-type='text-dropdown'] {
|
|
983
|
+
background-color: transparent;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/* -- Focus states --------------------------------------------------- */
|
|
987
|
+
button:focus-visible:enabled {
|
|
988
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
989
|
+
box-shadow: 0 0 0 4px ${({ tokens: e }) => e.core.foregroundAccent040};
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
993
|
+
@media (hover: hover) and (pointer: fine) {
|
|
994
|
+
button:hover:enabled,
|
|
995
|
+
button:active:enabled {
|
|
996
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/* -- Disabled states --------------------------------------------------- */
|
|
1001
|
+
button:disabled {
|
|
1002
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
1003
|
+
opacity: 0.5;
|
|
1004
|
+
}
|
|
1005
|
+
`;
|
|
1006
|
+
var j = function(e, t, o, i) {
|
|
1007
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
1008
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
1009
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
1010
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
1011
|
+
};
|
|
1012
|
+
const at = {
|
|
1013
|
+
lg: "lg-regular",
|
|
1014
|
+
md: "md-regular",
|
|
1015
|
+
sm: "sm-regular"
|
|
1016
|
+
}, st = {
|
|
1017
|
+
lg: "lg",
|
|
1018
|
+
md: "md",
|
|
1019
|
+
sm: "sm"
|
|
1020
|
+
};
|
|
1021
|
+
let B = class extends T {
|
|
1022
|
+
constructor() {
|
|
1023
|
+
super(...arguments), this.imageSrc = "", this.text = "", this.size = "lg", this.type = "text-dropdown", this.disabled = !1;
|
|
1024
|
+
}
|
|
1025
|
+
render() {
|
|
1026
|
+
return c`<button ?disabled=${this.disabled} data-size=${this.size} data-type=${this.type}>
|
|
1027
|
+
${this.imageTemplate()} ${this.textTemplate()}
|
|
1028
|
+
<wui-flex class="right-icon-container">
|
|
1029
|
+
<wui-icon name="chevronBottom"></wui-icon>
|
|
1030
|
+
</wui-flex>
|
|
1031
|
+
</button>`;
|
|
1032
|
+
}
|
|
1033
|
+
textTemplate() {
|
|
1034
|
+
const t = at[this.size];
|
|
1035
|
+
return this.text ? c`<wui-text color="primary" variant=${t}>${this.text}</wui-text>` : null;
|
|
1036
|
+
}
|
|
1037
|
+
imageTemplate() {
|
|
1038
|
+
if (this.imageSrc)
|
|
1039
|
+
return c`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`;
|
|
1040
|
+
const t = st[this.size];
|
|
1041
|
+
return c` <wui-flex class="left-icon-container">
|
|
1042
|
+
<wui-icon size=${t} name="networkPlaceholder"></wui-icon>
|
|
1043
|
+
</wui-flex>`;
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
B.styles = [oe, Re, rt];
|
|
1047
|
+
j([
|
|
1048
|
+
p()
|
|
1049
|
+
], B.prototype, "imageSrc", void 0);
|
|
1050
|
+
j([
|
|
1051
|
+
p()
|
|
1052
|
+
], B.prototype, "text", void 0);
|
|
1053
|
+
j([
|
|
1054
|
+
p()
|
|
1055
|
+
], B.prototype, "size", void 0);
|
|
1056
|
+
j([
|
|
1057
|
+
p()
|
|
1058
|
+
], B.prototype, "type", void 0);
|
|
1059
|
+
j([
|
|
1060
|
+
p({ type: Boolean })
|
|
1061
|
+
], B.prototype, "disabled", void 0);
|
|
1062
|
+
B = j([
|
|
1063
|
+
y("wui-select")
|
|
1064
|
+
], B);
|
|
1065
|
+
const ct = S`
|
|
1066
|
+
:host {
|
|
1067
|
+
height: 60px;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
:host > wui-flex {
|
|
1071
|
+
box-sizing: border-box;
|
|
1072
|
+
background-color: var(--local-header-background-color);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
wui-text {
|
|
1076
|
+
background-color: var(--local-header-background-color);
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
wui-flex.w3m-header-title {
|
|
1080
|
+
transform: translateY(0);
|
|
1081
|
+
opacity: 1;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
wui-flex.w3m-header-title[view-direction='prev'] {
|
|
1085
|
+
animation:
|
|
1086
|
+
slide-down-out 120ms forwards ${({ easings: e }) => e["ease-out-power-2"]},
|
|
1087
|
+
slide-down-in 120ms forwards ${({ easings: e }) => e["ease-out-power-2"]};
|
|
1088
|
+
animation-delay: 0ms, 200ms;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
wui-flex.w3m-header-title[view-direction='next'] {
|
|
1092
|
+
animation:
|
|
1093
|
+
slide-up-out 120ms forwards ${({ easings: e }) => e["ease-out-power-2"]},
|
|
1094
|
+
slide-up-in 120ms forwards ${({ easings: e }) => e["ease-out-power-2"]};
|
|
1095
|
+
animation-delay: 0ms, 200ms;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
wui-icon-button[data-hidden='true'] {
|
|
1099
|
+
opacity: 0 !important;
|
|
1100
|
+
pointer-events: none;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
@keyframes slide-up-out {
|
|
1104
|
+
from {
|
|
1105
|
+
transform: translateY(0px);
|
|
1106
|
+
opacity: 1;
|
|
1107
|
+
}
|
|
1108
|
+
to {
|
|
1109
|
+
transform: translateY(3px);
|
|
1110
|
+
opacity: 0;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
@keyframes slide-up-in {
|
|
1115
|
+
from {
|
|
1116
|
+
transform: translateY(-3px);
|
|
1117
|
+
opacity: 0;
|
|
1118
|
+
}
|
|
1119
|
+
to {
|
|
1120
|
+
transform: translateY(0);
|
|
1121
|
+
opacity: 1;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
@keyframes slide-down-out {
|
|
1126
|
+
from {
|
|
1127
|
+
transform: translateY(0px);
|
|
1128
|
+
opacity: 1;
|
|
1129
|
+
}
|
|
1130
|
+
to {
|
|
1131
|
+
transform: translateY(-3px);
|
|
1132
|
+
opacity: 0;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
@keyframes slide-down-in {
|
|
1137
|
+
from {
|
|
1138
|
+
transform: translateY(3px);
|
|
1139
|
+
opacity: 0;
|
|
1140
|
+
}
|
|
1141
|
+
to {
|
|
1142
|
+
transform: translateY(0);
|
|
1143
|
+
opacity: 1;
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
`;
|
|
1147
|
+
var z = function(e, t, o, i) {
|
|
1148
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
1149
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
1150
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
1151
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
1152
|
+
};
|
|
1153
|
+
const lt = ["SmartSessionList"], dt = {
|
|
1154
|
+
PayWithExchange: pe.tokens.theme.foregroundPrimary
|
|
1155
|
+
};
|
|
1156
|
+
function Se() {
|
|
1157
|
+
const e = u.state.data?.connector?.name, t = u.state.data?.wallet?.name, o = u.state.data?.network?.name, i = t ?? e, a = ue.getConnectors(), n = a.length === 1 && a[0]?.id === "w3m-email", s = m.getAccountData()?.socialProvider, l = s ? s.charAt(0).toUpperCase() + s.slice(1) : "Connect Social";
|
|
1158
|
+
return {
|
|
1159
|
+
Connect: `Connect ${n ? "Email" : ""} Wallet`,
|
|
1160
|
+
Create: "Create Wallet",
|
|
1161
|
+
ChooseAccountName: void 0,
|
|
1162
|
+
Account: void 0,
|
|
1163
|
+
AccountSettings: void 0,
|
|
1164
|
+
AllWallets: "All Wallets",
|
|
1165
|
+
ApproveTransaction: "Approve Transaction",
|
|
1166
|
+
BuyInProgress: "Buy",
|
|
1167
|
+
ConnectingExternal: i ?? "Connect Wallet",
|
|
1168
|
+
ConnectingWalletConnect: i ?? "WalletConnect",
|
|
1169
|
+
ConnectingWalletConnectBasic: "WalletConnect",
|
|
1170
|
+
ConnectingSiwe: "Sign In",
|
|
1171
|
+
Convert: "Convert",
|
|
1172
|
+
ConvertSelectToken: "Select token",
|
|
1173
|
+
ConvertPreview: "Preview Convert",
|
|
1174
|
+
Downloads: i ? `Get ${i}` : "Downloads",
|
|
1175
|
+
EmailLogin: "Email Login",
|
|
1176
|
+
EmailVerifyOtp: "Confirm Email",
|
|
1177
|
+
EmailVerifyDevice: "Register Device",
|
|
1178
|
+
GetWallet: "Get a Wallet",
|
|
1179
|
+
Networks: "Choose Network",
|
|
1180
|
+
OnRampProviders: "Choose Provider",
|
|
1181
|
+
OnRampActivity: "Activity",
|
|
1182
|
+
OnRampTokenSelect: "Select Token",
|
|
1183
|
+
OnRampFiatSelect: "Select Currency",
|
|
1184
|
+
Pay: "How you pay",
|
|
1185
|
+
ProfileWallets: "Wallets",
|
|
1186
|
+
SwitchNetwork: o ?? "Switch Network",
|
|
1187
|
+
Transactions: "Activity",
|
|
1188
|
+
UnsupportedChain: "Switch Network",
|
|
1189
|
+
UpgradeEmailWallet: "Upgrade Your Wallet",
|
|
1190
|
+
UpdateEmailWallet: "Edit Email",
|
|
1191
|
+
UpdateEmailPrimaryOtp: "Confirm Current Email",
|
|
1192
|
+
UpdateEmailSecondaryOtp: "Confirm New Email",
|
|
1193
|
+
WhatIsABuy: "What is Buy?",
|
|
1194
|
+
RegisterAccountName: "Choose Name",
|
|
1195
|
+
RegisterAccountNameSuccess: "",
|
|
1196
|
+
WalletReceive: "Receive",
|
|
1197
|
+
WalletCompatibleNetworks: "Compatible Networks",
|
|
1198
|
+
Swap: "Swap",
|
|
1199
|
+
SwapSelectToken: "Select Token",
|
|
1200
|
+
SwapPreview: "Preview Swap",
|
|
1201
|
+
WalletSend: "Send",
|
|
1202
|
+
WalletSendPreview: "Review Send",
|
|
1203
|
+
WalletSendSelectToken: "Select Token",
|
|
1204
|
+
WalletSendConfirmed: "Confirmed",
|
|
1205
|
+
WhatIsANetwork: "What is a network?",
|
|
1206
|
+
WhatIsAWallet: "What is a Wallet?",
|
|
1207
|
+
ConnectWallets: "Connect Wallet",
|
|
1208
|
+
ConnectSocials: "All Socials",
|
|
1209
|
+
ConnectingSocial: l,
|
|
1210
|
+
ConnectingMultiChain: "Select Chain",
|
|
1211
|
+
ConnectingFarcaster: "Farcaster",
|
|
1212
|
+
SwitchActiveChain: "Switch Chain",
|
|
1213
|
+
SmartSessionCreated: void 0,
|
|
1214
|
+
SmartSessionList: "Smart Sessions",
|
|
1215
|
+
SIWXSignMessage: "Sign In",
|
|
1216
|
+
PayLoading: "Payment in Progress",
|
|
1217
|
+
DataCapture: "Profile",
|
|
1218
|
+
DataCaptureOtpConfirm: "Confirm Email",
|
|
1219
|
+
FundWallet: "Fund Wallet",
|
|
1220
|
+
PayWithExchange: "Deposit from Exchange",
|
|
1221
|
+
PayWithExchangeSelectAsset: "Select Asset"
|
|
1222
|
+
};
|
|
1223
|
+
}
|
|
1224
|
+
let W = class extends T {
|
|
1225
|
+
constructor() {
|
|
1226
|
+
super(), this.unsubscribe = [], this.heading = Se()[u.state.view], this.network = m.state.activeCaipNetwork, this.networkImage = fe.getNetworkImage(this.network), this.showBack = !1, this.prevHistoryLength = 1, this.view = u.state.view, this.viewDirection = "", this.unsubscribe.push(Ge.subscribeNetworkImages(() => {
|
|
1227
|
+
this.networkImage = fe.getNetworkImage(this.network);
|
|
1228
|
+
}), u.subscribeKey("view", (t) => {
|
|
1229
|
+
setTimeout(() => {
|
|
1230
|
+
this.view = t, this.heading = Se()[t];
|
|
1231
|
+
}, F.ANIMATION_DURATIONS.HeaderText), this.onViewChange(), this.onHistoryChange();
|
|
1232
|
+
}), m.subscribeKey("activeCaipNetwork", (t) => {
|
|
1233
|
+
this.network = t, this.networkImage = fe.getNetworkImage(this.network);
|
|
1234
|
+
}));
|
|
1235
|
+
}
|
|
1236
|
+
disconnectCallback() {
|
|
1237
|
+
this.unsubscribe.forEach((t) => t());
|
|
1238
|
+
}
|
|
1239
|
+
render() {
|
|
1240
|
+
const t = dt[u.state.view] ?? pe.tokens.theme.backgroundPrimary;
|
|
1241
|
+
return this.style.setProperty("--local-header-background-color", t), c`
|
|
1242
|
+
<wui-flex
|
|
1243
|
+
.padding=${["0", "4", "0", "4"]}
|
|
1244
|
+
justifyContent="space-between"
|
|
1245
|
+
alignItems="center"
|
|
1246
|
+
>
|
|
1247
|
+
${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
|
|
1248
|
+
</wui-flex>
|
|
1249
|
+
`;
|
|
1250
|
+
}
|
|
1251
|
+
onWalletHelp() {
|
|
1252
|
+
_.sendEvent({ type: "track", event: "CLICK_WALLET_HELP" }), u.push("WhatIsAWallet");
|
|
1253
|
+
}
|
|
1254
|
+
async onClose() {
|
|
1255
|
+
await _e.safeClose();
|
|
1256
|
+
}
|
|
1257
|
+
rightHeaderTemplate() {
|
|
1258
|
+
const t = g?.state?.features?.smartSessions;
|
|
1259
|
+
return u.state.view !== "Account" || !t ? this.closeButtonTemplate() : c`<wui-flex>
|
|
1260
|
+
<wui-icon-button
|
|
1261
|
+
icon="clock"
|
|
1262
|
+
size="lg"
|
|
1263
|
+
iconSize="lg"
|
|
1264
|
+
type="neutral"
|
|
1265
|
+
variant="primary"
|
|
1266
|
+
@click=${() => u.push("SmartSessionList")}
|
|
1267
|
+
data-testid="w3m-header-smart-sessions"
|
|
1268
|
+
></wui-icon-button>
|
|
1269
|
+
${this.closeButtonTemplate()}
|
|
1270
|
+
</wui-flex> `;
|
|
1271
|
+
}
|
|
1272
|
+
closeButtonTemplate() {
|
|
1273
|
+
return c`
|
|
1274
|
+
<wui-icon-button
|
|
1275
|
+
icon="close"
|
|
1276
|
+
size="lg"
|
|
1277
|
+
type="neutral"
|
|
1278
|
+
variant="primary"
|
|
1279
|
+
iconSize="lg"
|
|
1280
|
+
@click=${this.onClose.bind(this)}
|
|
1281
|
+
data-testid="w3m-header-close"
|
|
1282
|
+
></wui-icon-button>
|
|
1283
|
+
`;
|
|
1284
|
+
}
|
|
1285
|
+
titleTemplate() {
|
|
1286
|
+
const t = lt.includes(this.view);
|
|
1287
|
+
return c`
|
|
1288
|
+
<wui-flex
|
|
1289
|
+
view-direction="${this.viewDirection}"
|
|
1290
|
+
class="w3m-header-title"
|
|
1291
|
+
alignItems="center"
|
|
1292
|
+
gap="2"
|
|
1293
|
+
>
|
|
1294
|
+
<wui-text
|
|
1295
|
+
display="inline"
|
|
1296
|
+
variant="lg-regular"
|
|
1297
|
+
color="primary"
|
|
1298
|
+
data-testid="w3m-header-text"
|
|
1299
|
+
>
|
|
1300
|
+
${this.heading}
|
|
1301
|
+
</wui-text>
|
|
1302
|
+
${t ? c`<wui-tag variant="accent" size="md">Beta</wui-tag>` : null}
|
|
1303
|
+
</wui-flex>
|
|
1304
|
+
`;
|
|
1305
|
+
}
|
|
1306
|
+
leftHeaderTemplate() {
|
|
1307
|
+
const { view: t } = u.state, o = t === "Connect", i = g.state.enableEmbedded, a = t === "ApproveTransaction", n = t === "ConnectingSiwe", s = t === "Account", l = g.state.enableNetworkSwitch, v = a || n || o && i;
|
|
1308
|
+
return s && l ? c`<wui-select
|
|
1309
|
+
id="dynamic"
|
|
1310
|
+
data-testid="w3m-account-select-network"
|
|
1311
|
+
active-network=${E(this.network?.name)}
|
|
1312
|
+
@click=${this.onNetworks.bind(this)}
|
|
1313
|
+
imageSrc=${E(this.networkImage)}
|
|
1314
|
+
></wui-select>` : this.showBack && !v ? c`<wui-icon-button
|
|
1315
|
+
data-testid="header-back"
|
|
1316
|
+
id="dynamic"
|
|
1317
|
+
icon="chevronLeft"
|
|
1318
|
+
size="lg"
|
|
1319
|
+
iconSize="lg"
|
|
1320
|
+
type="neutral"
|
|
1321
|
+
variant="primary"
|
|
1322
|
+
@click=${this.onGoBack.bind(this)}
|
|
1323
|
+
></wui-icon-button>` : c`<wui-icon-button
|
|
1324
|
+
data-hidden=${!o}
|
|
1325
|
+
id="dynamic"
|
|
1326
|
+
icon="helpCircle"
|
|
1327
|
+
size="lg"
|
|
1328
|
+
iconSize="lg"
|
|
1329
|
+
type="neutral"
|
|
1330
|
+
variant="primary"
|
|
1331
|
+
@click=${this.onWalletHelp.bind(this)}
|
|
1332
|
+
></wui-icon-button>`;
|
|
1333
|
+
}
|
|
1334
|
+
onNetworks() {
|
|
1335
|
+
this.isAllowedNetworkSwitch() && (_.sendEvent({ type: "track", event: "CLICK_NETWORKS" }), u.push("Networks"));
|
|
1336
|
+
}
|
|
1337
|
+
isAllowedNetworkSwitch() {
|
|
1338
|
+
const t = m.getAllRequestedCaipNetworks(), o = t ? t.length > 1 : !1, i = t?.find(({ id: a }) => a === this.network?.id);
|
|
1339
|
+
return o || !i;
|
|
1340
|
+
}
|
|
1341
|
+
onViewChange() {
|
|
1342
|
+
const { history: t } = u.state;
|
|
1343
|
+
let o = F.VIEW_DIRECTION.Next;
|
|
1344
|
+
t.length < this.prevHistoryLength && (o = F.VIEW_DIRECTION.Prev), this.prevHistoryLength = t.length, this.viewDirection = o;
|
|
1345
|
+
}
|
|
1346
|
+
async onHistoryChange() {
|
|
1347
|
+
const { history: t } = u.state, o = this.shadowRoot?.querySelector("#dynamic");
|
|
1348
|
+
t.length > 1 && !this.showBack && o ? (await o.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
1349
|
+
duration: 200,
|
|
1350
|
+
fill: "forwards",
|
|
1351
|
+
easing: "ease"
|
|
1352
|
+
}).finished, this.showBack = !0, o.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
1353
|
+
duration: 200,
|
|
1354
|
+
fill: "forwards",
|
|
1355
|
+
easing: "ease"
|
|
1356
|
+
})) : t.length <= 1 && this.showBack && o && (await o.animate([{ opacity: 1 }, { opacity: 0 }], {
|
|
1357
|
+
duration: 200,
|
|
1358
|
+
fill: "forwards",
|
|
1359
|
+
easing: "ease"
|
|
1360
|
+
}).finished, this.showBack = !1, o.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
1361
|
+
duration: 200,
|
|
1362
|
+
fill: "forwards",
|
|
1363
|
+
easing: "ease"
|
|
1364
|
+
}));
|
|
1365
|
+
}
|
|
1366
|
+
onGoBack() {
|
|
1367
|
+
u.goBack();
|
|
1368
|
+
}
|
|
1369
|
+
};
|
|
1370
|
+
W.styles = ct;
|
|
1371
|
+
z([
|
|
1372
|
+
w()
|
|
1373
|
+
], W.prototype, "heading", void 0);
|
|
1374
|
+
z([
|
|
1375
|
+
w()
|
|
1376
|
+
], W.prototype, "network", void 0);
|
|
1377
|
+
z([
|
|
1378
|
+
w()
|
|
1379
|
+
], W.prototype, "networkImage", void 0);
|
|
1380
|
+
z([
|
|
1381
|
+
w()
|
|
1382
|
+
], W.prototype, "showBack", void 0);
|
|
1383
|
+
z([
|
|
1384
|
+
w()
|
|
1385
|
+
], W.prototype, "prevHistoryLength", void 0);
|
|
1386
|
+
z([
|
|
1387
|
+
w()
|
|
1388
|
+
], W.prototype, "view", void 0);
|
|
1389
|
+
z([
|
|
1390
|
+
w()
|
|
1391
|
+
], W.prototype, "viewDirection", void 0);
|
|
1392
|
+
W = z([
|
|
1393
|
+
y("w3m-header")
|
|
1394
|
+
], W);
|
|
1395
|
+
const ut = S`
|
|
1396
|
+
:host {
|
|
1397
|
+
display: flex;
|
|
1398
|
+
align-items: center;
|
|
1399
|
+
gap: ${({ spacing: e }) => e[1]};
|
|
1400
|
+
padding: ${({ spacing: e }) => e[2]} ${({ spacing: e }) => e[3]}
|
|
1401
|
+
${({ spacing: e }) => e[2]} ${({ spacing: e }) => e[2]};
|
|
1402
|
+
border-radius: ${({ borderRadius: e }) => e[20]};
|
|
1403
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
1404
|
+
box-shadow:
|
|
1405
|
+
0px 0px 8px 0px rgba(0, 0, 0, 0.1),
|
|
1406
|
+
inset 0 0 0 1px ${({ tokens: e }) => e.theme.borderPrimary};
|
|
1407
|
+
max-width: 320px;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
wui-icon-box {
|
|
1411
|
+
border-radius: ${({ borderRadius: e }) => e.round} !important;
|
|
1412
|
+
overflow: hidden;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
wui-loading-spinner {
|
|
1416
|
+
padding: ${({ spacing: e }) => e[1]};
|
|
1417
|
+
background-color: ${({ tokens: e }) => e.core.foregroundAccent010};
|
|
1418
|
+
border-radius: ${({ borderRadius: e }) => e.round} !important;
|
|
1419
|
+
}
|
|
1420
|
+
`;
|
|
1421
|
+
var ye = function(e, t, o, i) {
|
|
1422
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
1423
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
1424
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
1425
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
1426
|
+
};
|
|
1427
|
+
let J = class extends T {
|
|
1428
|
+
constructor() {
|
|
1429
|
+
super(...arguments), this.message = "", this.variant = "success";
|
|
1430
|
+
}
|
|
1431
|
+
render() {
|
|
1432
|
+
return c`
|
|
1433
|
+
${this.templateIcon()}
|
|
1434
|
+
<wui-text variant="lg-regular" color="primary" data-testid="wui-snackbar-message"
|
|
1435
|
+
>${this.message}</wui-text
|
|
1436
|
+
>
|
|
1437
|
+
`;
|
|
1438
|
+
}
|
|
1439
|
+
templateIcon() {
|
|
1440
|
+
const t = {
|
|
1441
|
+
success: "success",
|
|
1442
|
+
error: "error",
|
|
1443
|
+
warning: "warning",
|
|
1444
|
+
info: "default"
|
|
1445
|
+
}, o = {
|
|
1446
|
+
success: "checkmark",
|
|
1447
|
+
error: "warning",
|
|
1448
|
+
warning: "warningCircle",
|
|
1449
|
+
info: "info"
|
|
1450
|
+
};
|
|
1451
|
+
return this.variant === "loading" ? c`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>` : c`<wui-icon-box
|
|
1452
|
+
size="md"
|
|
1453
|
+
color=${t[this.variant]}
|
|
1454
|
+
icon=${o[this.variant]}
|
|
1455
|
+
></wui-icon-box>`;
|
|
1456
|
+
}
|
|
1457
|
+
};
|
|
1458
|
+
J.styles = [oe, ut];
|
|
1459
|
+
ye([
|
|
1460
|
+
p()
|
|
1461
|
+
], J.prototype, "message", void 0);
|
|
1462
|
+
ye([
|
|
1463
|
+
p()
|
|
1464
|
+
], J.prototype, "variant", void 0);
|
|
1465
|
+
J = ye([
|
|
1466
|
+
y("wui-snackbar")
|
|
1467
|
+
], J);
|
|
1468
|
+
const pt = Oe`
|
|
1469
|
+
:host {
|
|
1470
|
+
display: block;
|
|
1471
|
+
position: absolute;
|
|
1472
|
+
opacity: 0;
|
|
1473
|
+
pointer-events: none;
|
|
1474
|
+
top: 11px;
|
|
1475
|
+
left: 50%;
|
|
1476
|
+
width: max-content;
|
|
1477
|
+
}
|
|
1478
|
+
`;
|
|
1479
|
+
var Ue = function(e, t, o, i) {
|
|
1480
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
1481
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
1482
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
1483
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
1484
|
+
};
|
|
1485
|
+
let me = class extends T {
|
|
1486
|
+
constructor() {
|
|
1487
|
+
super(), this.unsubscribe = [], this.timeout = void 0, this.open = f.state.open, this.unsubscribe.push(f.subscribeKey("open", (t) => {
|
|
1488
|
+
this.open = t, this.onOpen();
|
|
1489
|
+
}));
|
|
1490
|
+
}
|
|
1491
|
+
disconnectedCallback() {
|
|
1492
|
+
clearTimeout(this.timeout), this.unsubscribe.forEach((t) => t());
|
|
1493
|
+
}
|
|
1494
|
+
render() {
|
|
1495
|
+
const { message: t, variant: o } = f.state;
|
|
1496
|
+
return c` <wui-snackbar message=${t} variant=${o}></wui-snackbar> `;
|
|
1497
|
+
}
|
|
1498
|
+
onOpen() {
|
|
1499
|
+
clearTimeout(this.timeout), this.open ? (this.animate([
|
|
1500
|
+
{ opacity: 0, transform: "translateX(-50%) scale(0.85)" },
|
|
1501
|
+
{ opacity: 1, transform: "translateX(-50%) scale(1)" }
|
|
1502
|
+
], {
|
|
1503
|
+
duration: 150,
|
|
1504
|
+
fill: "forwards",
|
|
1505
|
+
easing: "ease"
|
|
1506
|
+
}), this.timeout && clearTimeout(this.timeout), f.state.autoClose && (this.timeout = setTimeout(() => f.hide(), 2500))) : this.animate([
|
|
1507
|
+
{ opacity: 1, transform: "translateX(-50%) scale(1)" },
|
|
1508
|
+
{ opacity: 0, transform: "translateX(-50%) scale(0.85)" }
|
|
1509
|
+
], {
|
|
1510
|
+
duration: 150,
|
|
1511
|
+
fill: "forwards",
|
|
1512
|
+
easing: "ease"
|
|
1513
|
+
});
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
me.styles = pt;
|
|
1517
|
+
Ue([
|
|
1518
|
+
w()
|
|
1519
|
+
], me.prototype, "open", void 0);
|
|
1520
|
+
me = Ue([
|
|
1521
|
+
y("w3m-snackbar")
|
|
1522
|
+
], me);
|
|
1523
|
+
const wt = S`
|
|
1524
|
+
:host {
|
|
1525
|
+
pointer-events: none;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
:host > wui-flex {
|
|
1529
|
+
display: var(--w3m-tooltip-display);
|
|
1530
|
+
opacity: var(--w3m-tooltip-opacity);
|
|
1531
|
+
padding: 9px ${({ spacing: e }) => e[3]} 10px ${({ spacing: e }) => e[3]};
|
|
1532
|
+
border-radius: ${({ borderRadius: e }) => e[3]};
|
|
1533
|
+
color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
1534
|
+
position: absolute;
|
|
1535
|
+
top: var(--w3m-tooltip-top);
|
|
1536
|
+
left: var(--w3m-tooltip-left);
|
|
1537
|
+
transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
|
|
1538
|
+
max-width: calc(var(--apkt-modal-width) - ${({ spacing: e }) => e[5]});
|
|
1539
|
+
transition: opacity ${({ durations: e }) => e.lg}
|
|
1540
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
1541
|
+
will-change: opacity;
|
|
1542
|
+
opacity: 0;
|
|
1543
|
+
animation-duration: ${({ durations: e }) => e.xl};
|
|
1544
|
+
animation-timing-function: ${({ easings: e }) => e["ease-out-power-2"]};
|
|
1545
|
+
animation-name: fade-in;
|
|
1546
|
+
animation-fill-mode: forwards;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
:host([data-variant='shade']) > wui-flex {
|
|
1550
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
:host([data-variant='shade']) > wui-flex > wui-text {
|
|
1554
|
+
color: ${({ tokens: e }) => e.theme.textSecondary};
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
:host([data-variant='fill']) > wui-flex {
|
|
1558
|
+
background-color: ${({ tokens: e }) => e.theme.textPrimary};
|
|
1559
|
+
border: none;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
wui-icon {
|
|
1563
|
+
position: absolute;
|
|
1564
|
+
width: 12px !important;
|
|
1565
|
+
height: 4px !important;
|
|
1566
|
+
color: ${({ tokens: e }) => e.theme.foregroundPrimary};
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
wui-icon[data-placement='top'] {
|
|
1570
|
+
bottom: 0px;
|
|
1571
|
+
left: 50%;
|
|
1572
|
+
transform: translate(-50%, 95%);
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
wui-icon[data-placement='bottom'] {
|
|
1576
|
+
top: 0;
|
|
1577
|
+
left: 50%;
|
|
1578
|
+
transform: translate(-50%, -95%) rotate(180deg);
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
wui-icon[data-placement='right'] {
|
|
1582
|
+
top: 50%;
|
|
1583
|
+
left: 0;
|
|
1584
|
+
transform: translate(-65%, -50%) rotate(90deg);
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
wui-icon[data-placement='left'] {
|
|
1588
|
+
top: 50%;
|
|
1589
|
+
right: 0%;
|
|
1590
|
+
transform: translate(65%, -50%) rotate(270deg);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
@keyframes fade-in {
|
|
1594
|
+
from {
|
|
1595
|
+
opacity: 0;
|
|
1596
|
+
}
|
|
1597
|
+
to {
|
|
1598
|
+
opacity: 1;
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
`;
|
|
1602
|
+
var ne = function(e, t, o, i) {
|
|
1603
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
1604
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
1605
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
1606
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
1607
|
+
};
|
|
1608
|
+
let L = class extends T {
|
|
1609
|
+
constructor() {
|
|
1610
|
+
super(), this.unsubscribe = [], this.open = X.state.open, this.message = X.state.message, this.triggerRect = X.state.triggerRect, this.variant = X.state.variant, this.unsubscribe.push(X.subscribe((t) => {
|
|
1611
|
+
this.open = t.open, this.message = t.message, this.triggerRect = t.triggerRect, this.variant = t.variant;
|
|
1612
|
+
}));
|
|
1613
|
+
}
|
|
1614
|
+
disconnectedCallback() {
|
|
1615
|
+
this.unsubscribe.forEach((t) => t());
|
|
1616
|
+
}
|
|
1617
|
+
render() {
|
|
1618
|
+
this.dataset.variant = this.variant;
|
|
1619
|
+
const t = this.triggerRect.top, o = this.triggerRect.left;
|
|
1620
|
+
return this.style.cssText = `
|
|
1621
|
+
--w3m-tooltip-top: ${t}px;
|
|
1622
|
+
--w3m-tooltip-left: ${o}px;
|
|
1623
|
+
--w3m-tooltip-parent-width: ${this.triggerRect.width / 2}px;
|
|
1624
|
+
--w3m-tooltip-display: ${this.open ? "flex" : "none"};
|
|
1625
|
+
--w3m-tooltip-opacity: ${this.open ? 1 : 0};
|
|
1626
|
+
`, c`<wui-flex>
|
|
1627
|
+
<wui-icon data-placement="top" size="inherit" name="cursor"></wui-icon>
|
|
1628
|
+
<wui-text color="primary" variant="sm-regular">${this.message}</wui-text>
|
|
1629
|
+
</wui-flex>`;
|
|
1630
|
+
}
|
|
1631
|
+
};
|
|
1632
|
+
L.styles = [wt];
|
|
1633
|
+
ne([
|
|
1634
|
+
w()
|
|
1635
|
+
], L.prototype, "open", void 0);
|
|
1636
|
+
ne([
|
|
1637
|
+
w()
|
|
1638
|
+
], L.prototype, "message", void 0);
|
|
1639
|
+
ne([
|
|
1640
|
+
w()
|
|
1641
|
+
], L.prototype, "triggerRect", void 0);
|
|
1642
|
+
ne([
|
|
1643
|
+
w()
|
|
1644
|
+
], L.prototype, "variant", void 0);
|
|
1645
|
+
L = ne([
|
|
1646
|
+
y("w3m-tooltip")
|
|
1647
|
+
], L);
|
|
1648
|
+
const Q = {
|
|
1649
|
+
getTabsByNamespace(e) {
|
|
1650
|
+
return !!e && e === I.CHAIN.EVM ? g.state.remoteFeatures?.activity === !1 ? F.ACCOUNT_TABS.filter((o) => o.label !== "Activity") : F.ACCOUNT_TABS : [];
|
|
1651
|
+
},
|
|
1652
|
+
isValidReownName(e) {
|
|
1653
|
+
return /^[a-zA-Z0-9]+$/gu.test(e);
|
|
1654
|
+
},
|
|
1655
|
+
isValidEmail(e) {
|
|
1656
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/gu.test(e);
|
|
1657
|
+
},
|
|
1658
|
+
validateReownName(e) {
|
|
1659
|
+
return e.replace(/\^/gu, "").toLowerCase().replace(/[^a-zA-Z0-9]/gu, "");
|
|
1660
|
+
},
|
|
1661
|
+
hasFooter() {
|
|
1662
|
+
const e = u.state.view;
|
|
1663
|
+
if (F.VIEWS_WITH_LEGAL_FOOTER.includes(e)) {
|
|
1664
|
+
const { termsConditionsUrl: t, privacyPolicyUrl: o } = g.state, i = g.state.features?.legalCheckbox;
|
|
1665
|
+
return !(!t && !o || i);
|
|
1666
|
+
}
|
|
1667
|
+
return F.VIEWS_WITH_DEFAULT_FOOTER.includes(e);
|
|
1668
|
+
}
|
|
1669
|
+
}, mt = S`
|
|
1670
|
+
:host wui-ux-by-reown {
|
|
1671
|
+
padding-top: 0;
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
:host wui-ux-by-reown.branding-only {
|
|
1675
|
+
padding-top: ${({ spacing: e }) => e[3]};
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
a {
|
|
1679
|
+
text-decoration: none;
|
|
1680
|
+
color: ${({ tokens: e }) => e.core.textAccentPrimary};
|
|
1681
|
+
font-weight: 500;
|
|
1682
|
+
}
|
|
1683
|
+
`;
|
|
1684
|
+
var ze = function(e, t, o, i) {
|
|
1685
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
1686
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
1687
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
1688
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
1689
|
+
};
|
|
1690
|
+
let he = class extends T {
|
|
1691
|
+
constructor() {
|
|
1692
|
+
super(), this.unsubscribe = [], this.remoteFeatures = g.state.remoteFeatures, this.unsubscribe.push(g.subscribeKey("remoteFeatures", (t) => this.remoteFeatures = t));
|
|
1693
|
+
}
|
|
1694
|
+
disconnectedCallback() {
|
|
1695
|
+
this.unsubscribe.forEach((t) => t());
|
|
1696
|
+
}
|
|
1697
|
+
render() {
|
|
1698
|
+
const { termsConditionsUrl: t, privacyPolicyUrl: o } = g.state, i = g.state.features?.legalCheckbox;
|
|
1699
|
+
return !t && !o || i ? c`
|
|
1700
|
+
<wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex>
|
|
1701
|
+
` : c`
|
|
1702
|
+
<wui-flex flexDirection="column">
|
|
1703
|
+
<wui-flex .padding=${["4", "3", "3", "3"]} justifyContent="center">
|
|
1704
|
+
<wui-text color="secondary" variant="md-regular" align="center">
|
|
1705
|
+
By connecting your wallet, you agree to our <br />
|
|
1706
|
+
${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
|
|
1707
|
+
</wui-text>
|
|
1708
|
+
</wui-flex>
|
|
1709
|
+
${this.reownBrandingTemplate()}
|
|
1710
|
+
</wui-flex>
|
|
1711
|
+
`;
|
|
1712
|
+
}
|
|
1713
|
+
andTemplate() {
|
|
1714
|
+
const { termsConditionsUrl: t, privacyPolicyUrl: o } = g.state;
|
|
1715
|
+
return t && o ? "and" : "";
|
|
1716
|
+
}
|
|
1717
|
+
termsTemplate() {
|
|
1718
|
+
const { termsConditionsUrl: t } = g.state;
|
|
1719
|
+
return t ? c`<a href=${t} target="_blank" rel="noopener noreferrer"
|
|
1720
|
+
>Terms of Service</a
|
|
1721
|
+
>` : null;
|
|
1722
|
+
}
|
|
1723
|
+
privacyTemplate() {
|
|
1724
|
+
const { privacyPolicyUrl: t } = g.state;
|
|
1725
|
+
return t ? c`<a href=${t} target="_blank" rel="noopener noreferrer"
|
|
1726
|
+
>Privacy Policy</a
|
|
1727
|
+
>` : null;
|
|
1728
|
+
}
|
|
1729
|
+
reownBrandingTemplate(t = !1) {
|
|
1730
|
+
return this.remoteFeatures?.reownBranding ? t ? c`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>` : c`<wui-ux-by-reown></wui-ux-by-reown>` : null;
|
|
1731
|
+
}
|
|
1732
|
+
};
|
|
1733
|
+
he.styles = [mt];
|
|
1734
|
+
ze([
|
|
1735
|
+
w()
|
|
1736
|
+
], he.prototype, "remoteFeatures", void 0);
|
|
1737
|
+
he = ze([
|
|
1738
|
+
y("w3m-legal-footer")
|
|
1739
|
+
], he);
|
|
1740
|
+
const ht = Oe``;
|
|
1741
|
+
var ft = function(e, t, o, i) {
|
|
1742
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
1743
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
1744
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
1745
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
1746
|
+
};
|
|
1747
|
+
let be = class extends T {
|
|
1748
|
+
render() {
|
|
1749
|
+
const { termsConditionsUrl: t, privacyPolicyUrl: o } = g.state;
|
|
1750
|
+
return !t && !o ? null : c`
|
|
1751
|
+
<wui-flex
|
|
1752
|
+
.padding=${["4", "3", "3", "3"]}
|
|
1753
|
+
flexDirection="column"
|
|
1754
|
+
alignItems="center"
|
|
1755
|
+
justifyContent="center"
|
|
1756
|
+
gap="3"
|
|
1757
|
+
>
|
|
1758
|
+
<wui-text color="secondary" variant="md-regular" align="center">
|
|
1759
|
+
We work with the best providers to give you the lowest fees and best support. More options
|
|
1760
|
+
coming soon!
|
|
1761
|
+
</wui-text>
|
|
1762
|
+
|
|
1763
|
+
${this.howDoesItWorkTemplate()}
|
|
1764
|
+
</wui-flex>
|
|
1765
|
+
`;
|
|
1766
|
+
}
|
|
1767
|
+
howDoesItWorkTemplate() {
|
|
1768
|
+
return c` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
|
|
1769
|
+
<wui-icon size="xs" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
|
|
1770
|
+
How does it work?
|
|
1771
|
+
</wui-link>`;
|
|
1772
|
+
}
|
|
1773
|
+
onWhatIsBuy() {
|
|
1774
|
+
_.sendEvent({
|
|
1775
|
+
type: "track",
|
|
1776
|
+
event: "SELECT_WHAT_IS_A_BUY",
|
|
1777
|
+
properties: {
|
|
1778
|
+
isSmartAccount: ae(m.state.activeChain) === se.ACCOUNT_TYPES.SMART_ACCOUNT
|
|
1779
|
+
}
|
|
1780
|
+
}), u.push("WhatIsABuy");
|
|
1781
|
+
}
|
|
1782
|
+
};
|
|
1783
|
+
be.styles = [ht];
|
|
1784
|
+
be = ft([
|
|
1785
|
+
y("w3m-onramp-providers-footer")
|
|
1786
|
+
], be);
|
|
1787
|
+
const gt = S`
|
|
1788
|
+
:host {
|
|
1789
|
+
display: block;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
div.container {
|
|
1793
|
+
position: absolute;
|
|
1794
|
+
bottom: 0;
|
|
1795
|
+
left: 0;
|
|
1796
|
+
right: 0;
|
|
1797
|
+
overflow: hidden;
|
|
1798
|
+
height: auto;
|
|
1799
|
+
display: block;
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
div.container[status='hide'] {
|
|
1803
|
+
animation: fade-out;
|
|
1804
|
+
animation-duration: var(--apkt-duration-dynamic);
|
|
1805
|
+
animation-timing-function: ${({ easings: e }) => e["ease-out-power-2"]};
|
|
1806
|
+
animation-fill-mode: both;
|
|
1807
|
+
animation-delay: 0s;
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
div.container[status='show'] {
|
|
1811
|
+
animation: fade-in;
|
|
1812
|
+
animation-duration: var(--apkt-duration-dynamic);
|
|
1813
|
+
animation-timing-function: ${({ easings: e }) => e["ease-out-power-2"]};
|
|
1814
|
+
animation-fill-mode: both;
|
|
1815
|
+
animation-delay: var(--apkt-duration-dynamic);
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
@keyframes fade-in {
|
|
1819
|
+
from {
|
|
1820
|
+
opacity: 0;
|
|
1821
|
+
filter: blur(6px);
|
|
1822
|
+
}
|
|
1823
|
+
to {
|
|
1824
|
+
opacity: 1;
|
|
1825
|
+
filter: blur(0px);
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
@keyframes fade-out {
|
|
1830
|
+
from {
|
|
1831
|
+
opacity: 1;
|
|
1832
|
+
filter: blur(0px);
|
|
1833
|
+
}
|
|
1834
|
+
to {
|
|
1835
|
+
opacity: 0;
|
|
1836
|
+
filter: blur(6px);
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
`;
|
|
1840
|
+
var ke = function(e, t, o, i) {
|
|
1841
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
1842
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
1843
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
1844
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
1845
|
+
};
|
|
1846
|
+
let ee = class extends T {
|
|
1847
|
+
constructor() {
|
|
1848
|
+
super(...arguments), this.resizeObserver = void 0, this.unsubscribe = [], this.status = "hide", this.view = u.state.view;
|
|
1849
|
+
}
|
|
1850
|
+
firstUpdated() {
|
|
1851
|
+
this.status = Q.hasFooter() ? "show" : "hide", this.unsubscribe.push(u.subscribeKey("view", (t) => {
|
|
1852
|
+
this.view = t, this.status = Q.hasFooter() ? "show" : "hide", this.status === "hide" && document.documentElement.style.setProperty("--apkt-footer-height", "0px");
|
|
1853
|
+
})), this.resizeObserver = new ResizeObserver((t) => {
|
|
1854
|
+
for (const o of t)
|
|
1855
|
+
if (o.target === this.getWrapper()) {
|
|
1856
|
+
const i = `${o.contentRect.height}px`;
|
|
1857
|
+
document.documentElement.style.setProperty("--apkt-footer-height", i);
|
|
1858
|
+
}
|
|
1859
|
+
}), this.resizeObserver.observe(this.getWrapper());
|
|
1860
|
+
}
|
|
1861
|
+
render() {
|
|
1862
|
+
return c`
|
|
1863
|
+
<div class="container" status=${this.status}>${this.templatePageContainer()}</div>
|
|
1864
|
+
`;
|
|
1865
|
+
}
|
|
1866
|
+
templatePageContainer() {
|
|
1867
|
+
return Q.hasFooter() ? c` ${this.templateFooter()}` : null;
|
|
1868
|
+
}
|
|
1869
|
+
templateFooter() {
|
|
1870
|
+
switch (this.view) {
|
|
1871
|
+
case "Networks":
|
|
1872
|
+
return this.templateNetworksFooter();
|
|
1873
|
+
case "Connect":
|
|
1874
|
+
case "ConnectWallets":
|
|
1875
|
+
case "OnRampFiatSelect":
|
|
1876
|
+
case "OnRampTokenSelect":
|
|
1877
|
+
return c`<w3m-legal-footer></w3m-legal-footer>`;
|
|
1878
|
+
case "OnRampProviders":
|
|
1879
|
+
return c`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;
|
|
1880
|
+
default:
|
|
1881
|
+
return null;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
templateNetworksFooter() {
|
|
1885
|
+
return c` <wui-flex
|
|
1886
|
+
class="footer-in"
|
|
1887
|
+
padding="3"
|
|
1888
|
+
flexDirection="column"
|
|
1889
|
+
gap="3"
|
|
1890
|
+
alignItems="center"
|
|
1891
|
+
>
|
|
1892
|
+
<wui-text variant="md-regular" color="secondary" align="center">
|
|
1893
|
+
Your connected wallet may not support some of the networks available for this dApp
|
|
1894
|
+
</wui-text>
|
|
1895
|
+
<wui-link @click=${this.onNetworkHelp.bind(this)}>
|
|
1896
|
+
<wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
|
|
1897
|
+
What is a network
|
|
1898
|
+
</wui-link>
|
|
1899
|
+
</wui-flex>`;
|
|
1900
|
+
}
|
|
1901
|
+
onNetworkHelp() {
|
|
1902
|
+
_.sendEvent({ type: "track", event: "CLICK_NETWORK_HELP" }), u.push("WhatIsANetwork");
|
|
1903
|
+
}
|
|
1904
|
+
getWrapper() {
|
|
1905
|
+
return this.shadowRoot?.querySelector("div.container");
|
|
1906
|
+
}
|
|
1907
|
+
};
|
|
1908
|
+
ee.styles = [gt];
|
|
1909
|
+
ke([
|
|
1910
|
+
w()
|
|
1911
|
+
], ee.prototype, "status", void 0);
|
|
1912
|
+
ke([
|
|
1913
|
+
w()
|
|
1914
|
+
], ee.prototype, "view", void 0);
|
|
1915
|
+
ee = ke([
|
|
1916
|
+
y("w3m-footer")
|
|
1917
|
+
], ee);
|
|
1918
|
+
const bt = S`
|
|
1919
|
+
:host {
|
|
1920
|
+
display: block;
|
|
1921
|
+
width: inherit;
|
|
1922
|
+
}
|
|
1923
|
+
`;
|
|
1924
|
+
var Te = function(e, t, o, i) {
|
|
1925
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
1926
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
1927
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
1928
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
1929
|
+
};
|
|
1930
|
+
let te = class extends T {
|
|
1931
|
+
constructor() {
|
|
1932
|
+
super(), this.unsubscribe = [], this.viewState = u.state.view, this.history = u.state.history.join(","), this.unsubscribe.push(u.subscribeKey("view", () => {
|
|
1933
|
+
this.history = u.state.history.join(","), document.documentElement.style.setProperty("--apkt-duration-dynamic", "var(--apkt-durations-lg)");
|
|
1934
|
+
}));
|
|
1935
|
+
}
|
|
1936
|
+
disconnectedCallback() {
|
|
1937
|
+
this.unsubscribe.forEach((t) => t()), document.documentElement.style.setProperty("--apkt-duration-dynamic", "0s");
|
|
1938
|
+
}
|
|
1939
|
+
render() {
|
|
1940
|
+
return c`${this.templatePageContainer()}`;
|
|
1941
|
+
}
|
|
1942
|
+
templatePageContainer() {
|
|
1943
|
+
return c`<w3m-router-container
|
|
1944
|
+
history=${this.history}
|
|
1945
|
+
.setView=${() => {
|
|
1946
|
+
this.viewState = u.state.view;
|
|
1947
|
+
}}
|
|
1948
|
+
>
|
|
1949
|
+
${this.viewTemplate(this.viewState)}
|
|
1950
|
+
</w3m-router-container>`;
|
|
1951
|
+
}
|
|
1952
|
+
viewTemplate(t) {
|
|
1953
|
+
switch (t) {
|
|
1954
|
+
case "AccountSettings":
|
|
1955
|
+
return c`<w3m-account-settings-view></w3m-account-settings-view>`;
|
|
1956
|
+
case "Account":
|
|
1957
|
+
return c`<w3m-account-view></w3m-account-view>`;
|
|
1958
|
+
case "AllWallets":
|
|
1959
|
+
return c`<w3m-all-wallets-view></w3m-all-wallets-view>`;
|
|
1960
|
+
case "ApproveTransaction":
|
|
1961
|
+
return c`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;
|
|
1962
|
+
case "BuyInProgress":
|
|
1963
|
+
return c`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;
|
|
1964
|
+
case "ChooseAccountName":
|
|
1965
|
+
return c`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;
|
|
1966
|
+
case "Connect":
|
|
1967
|
+
return c`<w3m-connect-view></w3m-connect-view>`;
|
|
1968
|
+
case "Create":
|
|
1969
|
+
return c`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;
|
|
1970
|
+
case "ConnectingWalletConnect":
|
|
1971
|
+
return c`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;
|
|
1972
|
+
case "ConnectingWalletConnectBasic":
|
|
1973
|
+
return c`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;
|
|
1974
|
+
case "ConnectingExternal":
|
|
1975
|
+
return c`<w3m-connecting-external-view></w3m-connecting-external-view>`;
|
|
1976
|
+
case "ConnectingSiwe":
|
|
1977
|
+
return c`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;
|
|
1978
|
+
case "ConnectWallets":
|
|
1979
|
+
return c`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;
|
|
1980
|
+
case "ConnectSocials":
|
|
1981
|
+
return c`<w3m-connect-socials-view></w3m-connect-socials-view>`;
|
|
1982
|
+
case "ConnectingSocial":
|
|
1983
|
+
return c`<w3m-connecting-social-view></w3m-connecting-social-view>`;
|
|
1984
|
+
case "DataCapture":
|
|
1985
|
+
return c`<w3m-data-capture-view></w3m-data-capture-view>`;
|
|
1986
|
+
case "DataCaptureOtpConfirm":
|
|
1987
|
+
return c`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;
|
|
1988
|
+
case "Downloads":
|
|
1989
|
+
return c`<w3m-downloads-view></w3m-downloads-view>`;
|
|
1990
|
+
case "EmailLogin":
|
|
1991
|
+
return c`<w3m-email-login-view></w3m-email-login-view>`;
|
|
1992
|
+
case "EmailVerifyOtp":
|
|
1993
|
+
return c`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;
|
|
1994
|
+
case "EmailVerifyDevice":
|
|
1995
|
+
return c`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;
|
|
1996
|
+
case "GetWallet":
|
|
1997
|
+
return c`<w3m-get-wallet-view></w3m-get-wallet-view>`;
|
|
1998
|
+
case "Networks":
|
|
1999
|
+
return c`<w3m-networks-view></w3m-networks-view>`;
|
|
2000
|
+
case "SwitchNetwork":
|
|
2001
|
+
return c`<w3m-network-switch-view></w3m-network-switch-view>`;
|
|
2002
|
+
case "ProfileWallets":
|
|
2003
|
+
return c`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;
|
|
2004
|
+
case "Transactions":
|
|
2005
|
+
return c`<w3m-transactions-view></w3m-transactions-view>`;
|
|
2006
|
+
case "OnRampProviders":
|
|
2007
|
+
return c`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;
|
|
2008
|
+
case "OnRampTokenSelect":
|
|
2009
|
+
return c`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;
|
|
2010
|
+
case "OnRampFiatSelect":
|
|
2011
|
+
return c`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;
|
|
2012
|
+
case "UpgradeEmailWallet":
|
|
2013
|
+
return c`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;
|
|
2014
|
+
case "UpdateEmailWallet":
|
|
2015
|
+
return c`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;
|
|
2016
|
+
case "UpdateEmailPrimaryOtp":
|
|
2017
|
+
return c`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;
|
|
2018
|
+
case "UpdateEmailSecondaryOtp":
|
|
2019
|
+
return c`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;
|
|
2020
|
+
case "UnsupportedChain":
|
|
2021
|
+
return c`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;
|
|
2022
|
+
case "Swap":
|
|
2023
|
+
return c`<w3m-swap-view></w3m-swap-view>`;
|
|
2024
|
+
case "SwapSelectToken":
|
|
2025
|
+
return c`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;
|
|
2026
|
+
case "SwapPreview":
|
|
2027
|
+
return c`<w3m-swap-preview-view></w3m-swap-preview-view>`;
|
|
2028
|
+
case "WalletSend":
|
|
2029
|
+
return c`<w3m-wallet-send-view></w3m-wallet-send-view>`;
|
|
2030
|
+
case "WalletSendSelectToken":
|
|
2031
|
+
return c`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;
|
|
2032
|
+
case "WalletSendPreview":
|
|
2033
|
+
return c`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;
|
|
2034
|
+
case "WalletSendConfirmed":
|
|
2035
|
+
return c`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;
|
|
2036
|
+
case "WhatIsABuy":
|
|
2037
|
+
return c`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;
|
|
2038
|
+
case "WalletReceive":
|
|
2039
|
+
return c`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;
|
|
2040
|
+
case "WalletCompatibleNetworks":
|
|
2041
|
+
return c`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;
|
|
2042
|
+
case "WhatIsAWallet":
|
|
2043
|
+
return c`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;
|
|
2044
|
+
case "ConnectingMultiChain":
|
|
2045
|
+
return c`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;
|
|
2046
|
+
case "WhatIsANetwork":
|
|
2047
|
+
return c`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;
|
|
2048
|
+
case "ConnectingFarcaster":
|
|
2049
|
+
return c`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;
|
|
2050
|
+
case "SwitchActiveChain":
|
|
2051
|
+
return c`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;
|
|
2052
|
+
case "RegisterAccountName":
|
|
2053
|
+
return c`<w3m-register-account-name-view></w3m-register-account-name-view>`;
|
|
2054
|
+
case "RegisterAccountNameSuccess":
|
|
2055
|
+
return c`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;
|
|
2056
|
+
case "SmartSessionCreated":
|
|
2057
|
+
return c`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;
|
|
2058
|
+
case "SmartSessionList":
|
|
2059
|
+
return c`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;
|
|
2060
|
+
case "SIWXSignMessage":
|
|
2061
|
+
return c`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;
|
|
2062
|
+
case "Pay":
|
|
2063
|
+
return c`<w3m-pay-view></w3m-pay-view>`;
|
|
2064
|
+
case "PayLoading":
|
|
2065
|
+
return c`<w3m-pay-loading-view></w3m-pay-loading-view>`;
|
|
2066
|
+
case "FundWallet":
|
|
2067
|
+
return c`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;
|
|
2068
|
+
case "PayWithExchange":
|
|
2069
|
+
return c`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;
|
|
2070
|
+
case "PayWithExchangeSelectAsset":
|
|
2071
|
+
return c`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`;
|
|
2072
|
+
default:
|
|
2073
|
+
return c`<w3m-connect-view></w3m-connect-view>`;
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
};
|
|
2077
|
+
te.styles = [bt];
|
|
2078
|
+
Te([
|
|
2079
|
+
w()
|
|
2080
|
+
], te.prototype, "viewState", void 0);
|
|
2081
|
+
Te([
|
|
2082
|
+
w()
|
|
2083
|
+
], te.prototype, "history", void 0);
|
|
2084
|
+
te = Te([
|
|
2085
|
+
y("w3m-router")
|
|
2086
|
+
], te);
|
|
2087
|
+
const vt = S`
|
|
2088
|
+
:host {
|
|
2089
|
+
z-index: ${({ tokens: e }) => e.core.zIndex};
|
|
2090
|
+
display: block;
|
|
2091
|
+
backface-visibility: hidden;
|
|
2092
|
+
will-change: opacity;
|
|
2093
|
+
position: fixed;
|
|
2094
|
+
top: 0;
|
|
2095
|
+
left: 0;
|
|
2096
|
+
right: 0;
|
|
2097
|
+
bottom: 0;
|
|
2098
|
+
pointer-events: none;
|
|
2099
|
+
opacity: 0;
|
|
2100
|
+
background-color: ${({ tokens: e }) => e.theme.overlay};
|
|
2101
|
+
backdrop-filter: blur(0px);
|
|
2102
|
+
transition:
|
|
2103
|
+
opacity ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
2104
|
+
backdrop-filter ${({ durations: e }) => e.lg}
|
|
2105
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
2106
|
+
will-change: opacity;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
:host(.open) {
|
|
2110
|
+
opacity: 1;
|
|
2111
|
+
backdrop-filter: blur(8px);
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
:host(.appkit-modal) {
|
|
2115
|
+
position: relative;
|
|
2116
|
+
pointer-events: unset;
|
|
2117
|
+
background: none;
|
|
2118
|
+
width: 100%;
|
|
2119
|
+
opacity: 1;
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
wui-card {
|
|
2123
|
+
max-width: var(--apkt-modal-width);
|
|
2124
|
+
width: 100%;
|
|
2125
|
+
position: relative;
|
|
2126
|
+
outline: none;
|
|
2127
|
+
transform: translateY(4px);
|
|
2128
|
+
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.05);
|
|
2129
|
+
transition:
|
|
2130
|
+
transform ${({ durations: e }) => e.lg}
|
|
2131
|
+
${({ easings: e }) => e["ease-out-power-2"]},
|
|
2132
|
+
border-radius ${({ durations: e }) => e.lg}
|
|
2133
|
+
${({ easings: e }) => e["ease-out-power-1"]},
|
|
2134
|
+
background-color ${({ durations: e }) => e.lg}
|
|
2135
|
+
${({ easings: e }) => e["ease-out-power-1"]},
|
|
2136
|
+
box-shadow ${({ durations: e }) => e.lg}
|
|
2137
|
+
${({ easings: e }) => e["ease-out-power-1"]};
|
|
2138
|
+
will-change: border-radius, background-color, transform, box-shadow;
|
|
2139
|
+
background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
2140
|
+
padding: var(--local-modal-padding);
|
|
2141
|
+
box-sizing: border-box;
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
:host(.open) wui-card {
|
|
2145
|
+
transform: translateY(0px);
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
wui-card::before {
|
|
2149
|
+
z-index: 1;
|
|
2150
|
+
pointer-events: none;
|
|
2151
|
+
content: '';
|
|
2152
|
+
position: absolute;
|
|
2153
|
+
inset: 0;
|
|
2154
|
+
border-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
|
|
2155
|
+
transition: box-shadow ${({ durations: e }) => e.lg}
|
|
2156
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
2157
|
+
transition-delay: ${({ durations: e }) => e.md};
|
|
2158
|
+
will-change: box-shadow;
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
:host([data-mobile-fullscreen='true']) wui-card::before {
|
|
2162
|
+
border-radius: 0px;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
:host([data-border='true']) wui-card::before {
|
|
2166
|
+
box-shadow: inset 0px 0px 0px 4px ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
:host([data-border='false']) wui-card::before {
|
|
2170
|
+
box-shadow: inset 0px 0px 0px 1px ${({ tokens: e }) => e.theme.borderPrimaryDark};
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
:host([data-border='true']) wui-card {
|
|
2174
|
+
animation:
|
|
2175
|
+
fade-in ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
2176
|
+
card-background-border var(--apkt-duration-dynamic)
|
|
2177
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
2178
|
+
animation-fill-mode: backwards, both;
|
|
2179
|
+
animation-delay: var(--apkt-duration-dynamic);
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
:host([data-border='false']) wui-card {
|
|
2183
|
+
animation:
|
|
2184
|
+
fade-in ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
2185
|
+
card-background-default var(--apkt-duration-dynamic)
|
|
2186
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
2187
|
+
animation-fill-mode: backwards, both;
|
|
2188
|
+
animation-delay: 0s;
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
:host(.appkit-modal) wui-card {
|
|
2192
|
+
max-width: var(--apkt-modal-width);
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
wui-card[shake='true'] {
|
|
2196
|
+
animation:
|
|
2197
|
+
fade-in ${({ durations: e }) => e.lg} ${({ easings: e }) => e["ease-out-power-2"]},
|
|
2198
|
+
w3m-shake ${({ durations: e }) => e.xl}
|
|
2199
|
+
${({ easings: e }) => e["ease-out-power-2"]};
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
wui-flex {
|
|
2203
|
+
overflow-x: hidden;
|
|
2204
|
+
overflow-y: auto;
|
|
2205
|
+
display: flex;
|
|
2206
|
+
align-items: center;
|
|
2207
|
+
justify-content: center;
|
|
2208
|
+
width: 100%;
|
|
2209
|
+
height: 100%;
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
@media (max-height: 700px) and (min-width: 431px) {
|
|
2213
|
+
wui-flex {
|
|
2214
|
+
align-items: flex-start;
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
wui-card {
|
|
2218
|
+
margin: var(--apkt-spacing-6) 0px;
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
@media (max-width: 430px) {
|
|
2223
|
+
:host([data-mobile-fullscreen='true']) {
|
|
2224
|
+
height: 100dvh;
|
|
2225
|
+
}
|
|
2226
|
+
:host([data-mobile-fullscreen='true']) wui-flex {
|
|
2227
|
+
align-items: stretch;
|
|
2228
|
+
}
|
|
2229
|
+
:host([data-mobile-fullscreen='true']) wui-card {
|
|
2230
|
+
max-width: 100%;
|
|
2231
|
+
height: 100%;
|
|
2232
|
+
border-radius: 0;
|
|
2233
|
+
border: none;
|
|
2234
|
+
}
|
|
2235
|
+
:host(:not([data-mobile-fullscreen='true'])) wui-flex {
|
|
2236
|
+
align-items: flex-end;
|
|
2237
|
+
}
|
|
2238
|
+
|
|
2239
|
+
:host(:not([data-mobile-fullscreen='true'])) wui-card {
|
|
2240
|
+
max-width: 100%;
|
|
2241
|
+
border-bottom: none;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
:host(:not([data-mobile-fullscreen='true'])) wui-card[data-embedded='true'] {
|
|
2245
|
+
border-bottom-left-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
|
|
2246
|
+
border-bottom-right-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
:host(:not([data-mobile-fullscreen='true'])) wui-card:not([data-embedded='true']) {
|
|
2250
|
+
border-bottom-left-radius: 0px;
|
|
2251
|
+
border-bottom-right-radius: 0px;
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
wui-card[shake='true'] {
|
|
2255
|
+
animation: w3m-shake 0.5s ${({ easings: e }) => e["ease-out-power-2"]};
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
@keyframes fade-in {
|
|
2260
|
+
0% {
|
|
2261
|
+
transform: scale(0.99) translateY(4px);
|
|
2262
|
+
}
|
|
2263
|
+
100% {
|
|
2264
|
+
transform: scale(1) translateY(0);
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
@keyframes w3m-shake {
|
|
2269
|
+
0% {
|
|
2270
|
+
transform: scale(1) rotate(0deg);
|
|
2271
|
+
}
|
|
2272
|
+
20% {
|
|
2273
|
+
transform: scale(1) rotate(-1deg);
|
|
2274
|
+
}
|
|
2275
|
+
40% {
|
|
2276
|
+
transform: scale(1) rotate(1.5deg);
|
|
2277
|
+
}
|
|
2278
|
+
60% {
|
|
2279
|
+
transform: scale(1) rotate(-1.5deg);
|
|
2280
|
+
}
|
|
2281
|
+
80% {
|
|
2282
|
+
transform: scale(1) rotate(1deg);
|
|
2283
|
+
}
|
|
2284
|
+
100% {
|
|
2285
|
+
transform: scale(1) rotate(0deg);
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
@keyframes card-background-border {
|
|
2290
|
+
from {
|
|
2291
|
+
background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
2292
|
+
}
|
|
2293
|
+
to {
|
|
2294
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
@keyframes card-background-default {
|
|
2299
|
+
from {
|
|
2300
|
+
background-color: ${({ tokens: e }) => e.theme.foregroundSecondary};
|
|
2301
|
+
}
|
|
2302
|
+
to {
|
|
2303
|
+
background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
`;
|
|
2307
|
+
var R = function(e, t, o, i) {
|
|
2308
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
2309
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
2310
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
2311
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
2312
|
+
};
|
|
2313
|
+
const Ce = "scroll-lock", yt = {
|
|
2314
|
+
PayWithExchange: "0",
|
|
2315
|
+
PayWithExchangeSelectAsset: "0"
|
|
2316
|
+
};
|
|
2317
|
+
class P extends T {
|
|
2318
|
+
constructor() {
|
|
2319
|
+
super(), this.unsubscribe = [], this.abortController = void 0, this.hasPrefetched = !1, this.enableEmbedded = g.state.enableEmbedded, this.open = $.state.open, this.caipAddress = m.state.activeCaipAddress, this.caipNetwork = m.state.activeCaipNetwork, this.shake = $.state.shake, this.filterByNamespace = ue.state.filterByNamespace, this.padding = pe.spacing[1], this.mobileFullScreen = g.state.enableMobileFullScreen, this.initializeTheming(), ie.prefetchAnalyticsConfig(), this.unsubscribe.push($.subscribeKey("open", (t) => t ? this.onOpen() : this.onClose()), $.subscribeKey("shake", (t) => this.shake = t), m.subscribeKey("activeCaipNetwork", (t) => this.onNewNetwork(t)), m.subscribeKey("activeCaipAddress", (t) => this.onNewAddress(t)), g.subscribeKey("enableEmbedded", (t) => this.enableEmbedded = t), ue.subscribeKey("filterByNamespace", (t) => {
|
|
2320
|
+
this.filterByNamespace !== t && !m.getAccountData(t)?.caipAddress && (ie.fetchRecommendedWallets(), this.filterByNamespace = t);
|
|
2321
|
+
}), u.subscribeKey("view", () => {
|
|
2322
|
+
this.dataset.border = Q.hasFooter() ? "true" : "false", this.padding = yt[u.state.view] ?? pe.spacing[1];
|
|
2323
|
+
}));
|
|
2324
|
+
}
|
|
2325
|
+
firstUpdated() {
|
|
2326
|
+
if (this.dataset.border = Q.hasFooter() ? "true" : "false", this.mobileFullScreen && this.setAttribute("data-mobile-fullscreen", "true"), this.caipAddress) {
|
|
2327
|
+
if (this.enableEmbedded) {
|
|
2328
|
+
$.close(), this.prefetch();
|
|
2329
|
+
return;
|
|
2330
|
+
}
|
|
2331
|
+
this.onNewAddress(this.caipAddress);
|
|
2332
|
+
}
|
|
2333
|
+
this.open && this.onOpen(), this.enableEmbedded && this.prefetch();
|
|
2334
|
+
}
|
|
2335
|
+
disconnectedCallback() {
|
|
2336
|
+
this.unsubscribe.forEach((t) => t()), this.onRemoveKeyboardListener();
|
|
2337
|
+
}
|
|
2338
|
+
render() {
|
|
2339
|
+
return this.style.setProperty("--local-modal-padding", this.padding), this.enableEmbedded ? c`${this.contentTemplate()}
|
|
2340
|
+
<w3m-tooltip></w3m-tooltip> ` : this.open ? c`
|
|
2341
|
+
<wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
|
|
2342
|
+
${this.contentTemplate()}
|
|
2343
|
+
</wui-flex>
|
|
2344
|
+
<w3m-tooltip></w3m-tooltip>
|
|
2345
|
+
` : null;
|
|
2346
|
+
}
|
|
2347
|
+
contentTemplate() {
|
|
2348
|
+
return c` <wui-card
|
|
2349
|
+
shake="${this.shake}"
|
|
2350
|
+
data-embedded="${E(this.enableEmbedded)}"
|
|
2351
|
+
role="alertdialog"
|
|
2352
|
+
aria-modal="true"
|
|
2353
|
+
tabindex="0"
|
|
2354
|
+
data-testid="w3m-modal-card"
|
|
2355
|
+
>
|
|
2356
|
+
<w3m-header></w3m-header>
|
|
2357
|
+
<w3m-router></w3m-router>
|
|
2358
|
+
<w3m-footer></w3m-footer>
|
|
2359
|
+
<w3m-snackbar></w3m-snackbar>
|
|
2360
|
+
<w3m-alertbar></w3m-alertbar>
|
|
2361
|
+
</wui-card>`;
|
|
2362
|
+
}
|
|
2363
|
+
async onOverlayClick(t) {
|
|
2364
|
+
if (t.target === t.currentTarget) {
|
|
2365
|
+
if (this.mobileFullScreen)
|
|
2366
|
+
return;
|
|
2367
|
+
await this.handleClose();
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
async handleClose() {
|
|
2371
|
+
await _e.safeClose();
|
|
2372
|
+
}
|
|
2373
|
+
initializeTheming() {
|
|
2374
|
+
const { themeVariables: t, themeMode: o } = Ke.state, i = De.getColorTheme(o);
|
|
2375
|
+
Ye(t, i);
|
|
2376
|
+
}
|
|
2377
|
+
onClose() {
|
|
2378
|
+
this.open = !1, this.classList.remove("open"), this.onScrollUnlock(), f.hide(), this.onRemoveKeyboardListener();
|
|
2379
|
+
}
|
|
2380
|
+
onOpen() {
|
|
2381
|
+
this.open = !0, this.classList.add("open"), this.onScrollLock(), this.onAddKeyboardListener();
|
|
2382
|
+
}
|
|
2383
|
+
onScrollLock() {
|
|
2384
|
+
const t = document.createElement("style");
|
|
2385
|
+
t.dataset.w3m = Ce, t.textContent = `
|
|
2386
|
+
body {
|
|
2387
|
+
touch-action: none;
|
|
2388
|
+
overflow: hidden;
|
|
2389
|
+
overscroll-behavior: contain;
|
|
2390
|
+
}
|
|
2391
|
+
w3m-modal {
|
|
2392
|
+
pointer-events: auto;
|
|
2393
|
+
}
|
|
2394
|
+
`, document.head.appendChild(t);
|
|
2395
|
+
}
|
|
2396
|
+
onScrollUnlock() {
|
|
2397
|
+
const t = document.head.querySelector(`style[data-w3m="${Ce}"]`);
|
|
2398
|
+
t && t.remove();
|
|
2399
|
+
}
|
|
2400
|
+
onAddKeyboardListener() {
|
|
2401
|
+
this.abortController = new AbortController();
|
|
2402
|
+
const t = this.shadowRoot?.querySelector("wui-card");
|
|
2403
|
+
t?.focus(), window.addEventListener("keydown", (o) => {
|
|
2404
|
+
if (o.key === "Escape")
|
|
2405
|
+
this.handleClose();
|
|
2406
|
+
else if (o.key === "Tab") {
|
|
2407
|
+
const { tagName: i } = o.target;
|
|
2408
|
+
i && !i.includes("W3M-") && !i.includes("WUI-") && t?.focus();
|
|
2409
|
+
}
|
|
2410
|
+
}, this.abortController);
|
|
2411
|
+
}
|
|
2412
|
+
onRemoveKeyboardListener() {
|
|
2413
|
+
this.abortController?.abort(), this.abortController = void 0;
|
|
2414
|
+
}
|
|
2415
|
+
async onNewAddress(t) {
|
|
2416
|
+
const o = m.state.isSwitchingNamespace, i = u.state.view === "ProfileWallets";
|
|
2417
|
+
t ? await this.onConnected({
|
|
2418
|
+
caipAddress: t,
|
|
2419
|
+
isSwitchingNamespace: o,
|
|
2420
|
+
isInProfileView: i
|
|
2421
|
+
}) : !o && !this.enableEmbedded && !i && $.close(), await le.initializeIfEnabled(t), this.caipAddress = t, m.setIsSwitchingNamespace(!1);
|
|
2422
|
+
}
|
|
2423
|
+
async onConnected(t) {
|
|
2424
|
+
if (t.isInProfileView)
|
|
2425
|
+
return;
|
|
2426
|
+
const { chainNamespace: o, chainId: i, address: a } = Xe.parseCaipAddress(t.caipAddress), n = `${o}:${i}`, s = !ce.getPlainAddress(this.caipAddress), l = await le.getSessions({ address: a, caipNetworkId: n }), v = le.getSIWX() ? l.some((V) => V.data.accountAddress === a) : !0, H = t.isSwitchingNamespace && v && !this.enableEmbedded, M = this.enableEmbedded && s;
|
|
2427
|
+
H ? u.goBack() : M && $.close();
|
|
2428
|
+
}
|
|
2429
|
+
onNewNetwork(t) {
|
|
2430
|
+
const o = this.caipNetwork, i = o?.caipNetworkId?.toString(), a = o?.chainNamespace, n = t?.caipNetworkId?.toString(), s = t?.chainNamespace, l = i !== n, H = l && !(a !== s), M = o?.name === I.UNSUPPORTED_NETWORK_NAME, V = u.state.view === "ConnectingExternal", Fe = u.state.view === "ProfileWallets", Le = !m.getAccountData(t?.chainNamespace)?.caipAddress, He = u.state.view === "UnsupportedChain", Me = $.state.open;
|
|
2431
|
+
let G = !1;
|
|
2432
|
+
this.enableEmbedded && u.state.view === "SwitchNetwork" && (G = !0), l && d.resetState(), Me && !V && !Fe && (Le ? l && (G = !0) : (He || H && !M) && (G = !0)), G && u.state.view !== "SIWXSignMessage" && u.goBack(), this.caipNetwork = t;
|
|
2433
|
+
}
|
|
2434
|
+
prefetch() {
|
|
2435
|
+
this.hasPrefetched || (ie.prefetch(), ie.fetchWalletsByPage({ page: 1 }), this.hasPrefetched = !0);
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
P.styles = vt;
|
|
2439
|
+
R([
|
|
2440
|
+
p({ type: Boolean })
|
|
2441
|
+
], P.prototype, "enableEmbedded", void 0);
|
|
2442
|
+
R([
|
|
2443
|
+
w()
|
|
2444
|
+
], P.prototype, "open", void 0);
|
|
2445
|
+
R([
|
|
2446
|
+
w()
|
|
2447
|
+
], P.prototype, "caipAddress", void 0);
|
|
2448
|
+
R([
|
|
2449
|
+
w()
|
|
2450
|
+
], P.prototype, "caipNetwork", void 0);
|
|
2451
|
+
R([
|
|
2452
|
+
w()
|
|
2453
|
+
], P.prototype, "shake", void 0);
|
|
2454
|
+
R([
|
|
2455
|
+
w()
|
|
2456
|
+
], P.prototype, "filterByNamespace", void 0);
|
|
2457
|
+
R([
|
|
2458
|
+
w()
|
|
2459
|
+
], P.prototype, "padding", void 0);
|
|
2460
|
+
R([
|
|
2461
|
+
w()
|
|
2462
|
+
], P.prototype, "mobileFullScreen", void 0);
|
|
2463
|
+
let Ae = class extends P {
|
|
2464
|
+
};
|
|
2465
|
+
Ae = R([
|
|
2466
|
+
y("w3m-modal")
|
|
2467
|
+
], Ae);
|
|
2468
|
+
let $e = class extends P {
|
|
2469
|
+
};
|
|
2470
|
+
$e = R([
|
|
2471
|
+
y("appkit-modal")
|
|
2472
|
+
], $e);
|
|
2473
|
+
const kt = S`
|
|
2474
|
+
:host {
|
|
2475
|
+
width: 100%;
|
|
2476
|
+
}
|
|
2477
|
+
`;
|
|
2478
|
+
var x = function(e, t, o, i) {
|
|
2479
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
2480
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
2481
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
2482
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
2483
|
+
};
|
|
2484
|
+
let b = class extends T {
|
|
2485
|
+
constructor() {
|
|
2486
|
+
super(...arguments), this.hasImpressionSent = !1, this.walletImages = [], this.imageSrc = "", this.name = "", this.size = "md", this.tabIdx = void 0, this.disabled = !1, this.showAllWallets = !1, this.loading = !1, this.loadingSpinnerColor = "accent-100", this.rdnsId = "", this.displayIndex = void 0, this.walletRank = void 0;
|
|
2487
|
+
}
|
|
2488
|
+
connectedCallback() {
|
|
2489
|
+
super.connectedCallback();
|
|
2490
|
+
}
|
|
2491
|
+
disconnectedCallback() {
|
|
2492
|
+
super.disconnectedCallback(), this.cleanupIntersectionObserver();
|
|
2493
|
+
}
|
|
2494
|
+
updated(t) {
|
|
2495
|
+
super.updated(t), (t.has("name") || t.has("imageSrc") || t.has("walletRank")) && (this.hasImpressionSent = !1), t.has("walletRank") && this.walletRank && !this.intersectionObserver && this.setupIntersectionObserver();
|
|
2496
|
+
}
|
|
2497
|
+
setupIntersectionObserver() {
|
|
2498
|
+
this.intersectionObserver = new IntersectionObserver((t) => {
|
|
2499
|
+
t.forEach((o) => {
|
|
2500
|
+
o.isIntersecting && !this.loading && !this.hasImpressionSent && this.sendImpressionEvent();
|
|
2501
|
+
});
|
|
2502
|
+
}, { threshold: 0.1 }), this.intersectionObserver.observe(this);
|
|
2503
|
+
}
|
|
2504
|
+
cleanupIntersectionObserver() {
|
|
2505
|
+
this.intersectionObserver && (this.intersectionObserver.disconnect(), this.intersectionObserver = void 0);
|
|
2506
|
+
}
|
|
2507
|
+
sendImpressionEvent() {
|
|
2508
|
+
!this.name || this.hasImpressionSent || !this.walletRank || (this.hasImpressionSent = !0, (this.rdnsId || this.name) && _.sendWalletImpressionEvent({
|
|
2509
|
+
name: this.name,
|
|
2510
|
+
walletRank: this.walletRank,
|
|
2511
|
+
rdnsId: this.rdnsId,
|
|
2512
|
+
view: u.state.view,
|
|
2513
|
+
displayIndex: this.displayIndex
|
|
2514
|
+
}));
|
|
2515
|
+
}
|
|
2516
|
+
render() {
|
|
2517
|
+
return c`
|
|
2518
|
+
<wui-list-wallet
|
|
2519
|
+
.walletImages=${this.walletImages}
|
|
2520
|
+
imageSrc=${E(this.imageSrc)}
|
|
2521
|
+
name=${this.name}
|
|
2522
|
+
size=${E(this.size)}
|
|
2523
|
+
tagLabel=${E(this.tagLabel)}
|
|
2524
|
+
.tagVariant=${this.tagVariant}
|
|
2525
|
+
.walletIcon=${this.walletIcon}
|
|
2526
|
+
.tabIdx=${this.tabIdx}
|
|
2527
|
+
.disabled=${this.disabled}
|
|
2528
|
+
.showAllWallets=${this.showAllWallets}
|
|
2529
|
+
.loading=${this.loading}
|
|
2530
|
+
loadingSpinnerColor=${this.loadingSpinnerColor}
|
|
2531
|
+
></wui-list-wallet>
|
|
2532
|
+
`;
|
|
2533
|
+
}
|
|
2534
|
+
};
|
|
2535
|
+
b.styles = kt;
|
|
2536
|
+
x([
|
|
2537
|
+
p({ type: Array })
|
|
2538
|
+
], b.prototype, "walletImages", void 0);
|
|
2539
|
+
x([
|
|
2540
|
+
p()
|
|
2541
|
+
], b.prototype, "imageSrc", void 0);
|
|
2542
|
+
x([
|
|
2543
|
+
p()
|
|
2544
|
+
], b.prototype, "name", void 0);
|
|
2545
|
+
x([
|
|
2546
|
+
p()
|
|
2547
|
+
], b.prototype, "size", void 0);
|
|
2548
|
+
x([
|
|
2549
|
+
p()
|
|
2550
|
+
], b.prototype, "tagLabel", void 0);
|
|
2551
|
+
x([
|
|
2552
|
+
p()
|
|
2553
|
+
], b.prototype, "tagVariant", void 0);
|
|
2554
|
+
x([
|
|
2555
|
+
p()
|
|
2556
|
+
], b.prototype, "walletIcon", void 0);
|
|
2557
|
+
x([
|
|
2558
|
+
p()
|
|
2559
|
+
], b.prototype, "tabIdx", void 0);
|
|
2560
|
+
x([
|
|
2561
|
+
p({ type: Boolean })
|
|
2562
|
+
], b.prototype, "disabled", void 0);
|
|
2563
|
+
x([
|
|
2564
|
+
p({ type: Boolean })
|
|
2565
|
+
], b.prototype, "showAllWallets", void 0);
|
|
2566
|
+
x([
|
|
2567
|
+
p({ type: Boolean })
|
|
2568
|
+
], b.prototype, "loading", void 0);
|
|
2569
|
+
x([
|
|
2570
|
+
p({ type: String })
|
|
2571
|
+
], b.prototype, "loadingSpinnerColor", void 0);
|
|
2572
|
+
x([
|
|
2573
|
+
p()
|
|
2574
|
+
], b.prototype, "rdnsId", void 0);
|
|
2575
|
+
x([
|
|
2576
|
+
p()
|
|
2577
|
+
], b.prototype, "displayIndex", void 0);
|
|
2578
|
+
x([
|
|
2579
|
+
p()
|
|
2580
|
+
], b.prototype, "walletRank", void 0);
|
|
2581
|
+
b = x([
|
|
2582
|
+
y("w3m-list-wallet")
|
|
2583
|
+
], b);
|
|
2584
|
+
const Tt = S`
|
|
2585
|
+
:host {
|
|
2586
|
+
--local-duration-height: 0s;
|
|
2587
|
+
--local-duration: ${({ durations: e }) => e.lg};
|
|
2588
|
+
--local-transition: ${({ easings: e }) => e["ease-out-power-2"]};
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
.container {
|
|
2592
|
+
display: block;
|
|
2593
|
+
overflow: hidden;
|
|
2594
|
+
overflow: hidden;
|
|
2595
|
+
position: relative;
|
|
2596
|
+
height: var(--local-container-height);
|
|
2597
|
+
transition: height var(--local-duration-height) var(--local-transition);
|
|
2598
|
+
will-change: height, padding-bottom;
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
.container[data-mobile-fullscreen='true'] {
|
|
2602
|
+
overflow: scroll;
|
|
2603
|
+
}
|
|
2604
|
+
|
|
2605
|
+
.page {
|
|
2606
|
+
position: absolute;
|
|
2607
|
+
top: 0;
|
|
2608
|
+
left: 0;
|
|
2609
|
+
right: 0;
|
|
2610
|
+
width: 100%;
|
|
2611
|
+
height: auto;
|
|
2612
|
+
width: inherit;
|
|
2613
|
+
box-sizing: border-box;
|
|
2614
|
+
display: flex;
|
|
2615
|
+
flex-direction: column;
|
|
2616
|
+
background-color: ${({ tokens: e }) => e.theme.backgroundPrimary};
|
|
2617
|
+
border-bottom-left-radius: var(--local-border-bottom-radius);
|
|
2618
|
+
border-bottom-right-radius: var(--local-border-bottom-radius);
|
|
2619
|
+
transition: border-bottom-left-radius var(--local-duration) var(--local-transition);
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
.page[data-mobile-fullscreen='true'] {
|
|
2623
|
+
height: 100%;
|
|
2624
|
+
}
|
|
2625
|
+
|
|
2626
|
+
.page-content {
|
|
2627
|
+
display: flex;
|
|
2628
|
+
flex-direction: column;
|
|
2629
|
+
min-height: 100%;
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
.footer {
|
|
2633
|
+
height: var(--apkt-footer-height);
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
div.page[view-direction^='prev-'] .page-content {
|
|
2637
|
+
animation:
|
|
2638
|
+
slide-left-out var(--local-duration) forwards var(--local-transition),
|
|
2639
|
+
slide-left-in var(--local-duration) forwards var(--local-transition);
|
|
2640
|
+
animation-delay: 0ms, var(--local-duration, ${({ durations: e }) => e.lg});
|
|
2641
|
+
}
|
|
2642
|
+
|
|
2643
|
+
div.page[view-direction^='next-'] .page-content {
|
|
2644
|
+
animation:
|
|
2645
|
+
slide-right-out var(--local-duration) forwards var(--local-transition),
|
|
2646
|
+
slide-right-in var(--local-duration) forwards var(--local-transition);
|
|
2647
|
+
animation-delay: 0ms, var(--local-duration, ${({ durations: e }) => e.lg});
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
@keyframes slide-left-out {
|
|
2651
|
+
from {
|
|
2652
|
+
transform: translateX(0px) scale(1);
|
|
2653
|
+
opacity: 1;
|
|
2654
|
+
filter: blur(0px);
|
|
2655
|
+
}
|
|
2656
|
+
to {
|
|
2657
|
+
transform: translateX(8px) scale(0.99);
|
|
2658
|
+
opacity: 0;
|
|
2659
|
+
filter: blur(4px);
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2663
|
+
@keyframes slide-left-in {
|
|
2664
|
+
from {
|
|
2665
|
+
transform: translateX(-8px) scale(0.99);
|
|
2666
|
+
opacity: 0;
|
|
2667
|
+
filter: blur(4px);
|
|
2668
|
+
}
|
|
2669
|
+
to {
|
|
2670
|
+
transform: translateX(0) translateY(0) scale(1);
|
|
2671
|
+
opacity: 1;
|
|
2672
|
+
filter: blur(0px);
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
@keyframes slide-right-out {
|
|
2677
|
+
from {
|
|
2678
|
+
transform: translateX(0px) scale(1);
|
|
2679
|
+
opacity: 1;
|
|
2680
|
+
filter: blur(0px);
|
|
2681
|
+
}
|
|
2682
|
+
to {
|
|
2683
|
+
transform: translateX(-8px) scale(0.99);
|
|
2684
|
+
opacity: 0;
|
|
2685
|
+
filter: blur(4px);
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
@keyframes slide-right-in {
|
|
2690
|
+
from {
|
|
2691
|
+
transform: translateX(8px) scale(0.99);
|
|
2692
|
+
opacity: 0;
|
|
2693
|
+
filter: blur(4px);
|
|
2694
|
+
}
|
|
2695
|
+
to {
|
|
2696
|
+
transform: translateX(0) translateY(0) scale(1);
|
|
2697
|
+
opacity: 1;
|
|
2698
|
+
filter: blur(0px);
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
`;
|
|
2702
|
+
var O = function(e, t, o, i) {
|
|
2703
|
+
var a = arguments.length, n = a < 3 ? t : i === null ? i = Object.getOwnPropertyDescriptor(t, o) : i, s;
|
|
2704
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, t, o, i);
|
|
2705
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(t, o, n) : s(t, o)) || n);
|
|
2706
|
+
return a > 3 && n && Object.defineProperty(t, o, n), n;
|
|
2707
|
+
};
|
|
2708
|
+
const xt = 60;
|
|
2709
|
+
let C = class extends T {
|
|
2710
|
+
constructor() {
|
|
2711
|
+
super(...arguments), this.resizeObserver = void 0, this.transitionDuration = "0.15s", this.transitionFunction = "", this.history = "", this.view = "", this.setView = void 0, this.viewDirection = "", this.historyState = "", this.previousHeight = "0px", this.mobileFullScreen = g.state.enableMobileFullScreen, this.onViewportResize = () => {
|
|
2712
|
+
this.updateContainerHeight();
|
|
2713
|
+
};
|
|
2714
|
+
}
|
|
2715
|
+
updated(t) {
|
|
2716
|
+
if (t.has("history")) {
|
|
2717
|
+
const o = this.history;
|
|
2718
|
+
this.historyState !== "" && this.historyState !== o && this.onViewChange(o);
|
|
2719
|
+
}
|
|
2720
|
+
t.has("transitionDuration") && this.style.setProperty("--local-duration", this.transitionDuration), t.has("transitionFunction") && this.style.setProperty("--local-transition", this.transitionFunction);
|
|
2721
|
+
}
|
|
2722
|
+
firstUpdated() {
|
|
2723
|
+
this.transitionFunction && this.style.setProperty("--local-transition", this.transitionFunction), this.style.setProperty("--local-duration", this.transitionDuration), this.historyState = this.history, this.resizeObserver = new ResizeObserver((t) => {
|
|
2724
|
+
for (const o of t)
|
|
2725
|
+
if (o.target === this.getWrapper()) {
|
|
2726
|
+
let i = o.contentRect.height;
|
|
2727
|
+
const a = parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height") || "0");
|
|
2728
|
+
if (this.mobileFullScreen) {
|
|
2729
|
+
const n = window.visualViewport?.height || window.innerHeight, s = this.getHeaderHeight();
|
|
2730
|
+
i = n - s - a, this.style.setProperty("--local-border-bottom-radius", "0px");
|
|
2731
|
+
} else
|
|
2732
|
+
i = i + a, this.style.setProperty("--local-border-bottom-radius", a ? "var(--apkt-borderRadius-5)" : "0px");
|
|
2733
|
+
this.style.setProperty("--local-container-height", `${i}px`), this.previousHeight !== "0px" && this.style.setProperty("--local-duration-height", this.transitionDuration), this.previousHeight = `${i}px`;
|
|
2734
|
+
}
|
|
2735
|
+
}), this.resizeObserver.observe(this.getWrapper()), this.updateContainerHeight(), window.addEventListener("resize", this.onViewportResize), window.visualViewport?.addEventListener("resize", this.onViewportResize);
|
|
2736
|
+
}
|
|
2737
|
+
disconnectedCallback() {
|
|
2738
|
+
const t = this.getWrapper();
|
|
2739
|
+
t && this.resizeObserver && this.resizeObserver.unobserve(t), window.removeEventListener("resize", this.onViewportResize), window.visualViewport?.removeEventListener("resize", this.onViewportResize);
|
|
2740
|
+
}
|
|
2741
|
+
render() {
|
|
2742
|
+
return c`
|
|
2743
|
+
<div class="container" data-mobile-fullscreen="${E(this.mobileFullScreen)}">
|
|
2744
|
+
<div
|
|
2745
|
+
class="page"
|
|
2746
|
+
data-mobile-fullscreen="${E(this.mobileFullScreen)}"
|
|
2747
|
+
view-direction="${this.viewDirection}"
|
|
2748
|
+
>
|
|
2749
|
+
<div class="page-content">
|
|
2750
|
+
<slot></slot>
|
|
2751
|
+
</div>
|
|
2752
|
+
</div>
|
|
2753
|
+
</div>
|
|
2754
|
+
`;
|
|
2755
|
+
}
|
|
2756
|
+
onViewChange(t) {
|
|
2757
|
+
const o = t.split(",").filter(Boolean), i = this.historyState.split(",").filter(Boolean), a = i.length, n = o.length, s = o[o.length - 1] || "", l = De.cssDurationToNumber(this.transitionDuration);
|
|
2758
|
+
let v = "";
|
|
2759
|
+
n > a ? v = "next" : n < a ? v = "prev" : n === a && o[n - 1] !== i[a - 1] && (v = "next"), this.viewDirection = `${v}-${s}`, setTimeout(() => {
|
|
2760
|
+
this.historyState = t, this.setView?.(s);
|
|
2761
|
+
}, l), setTimeout(() => {
|
|
2762
|
+
this.viewDirection = "";
|
|
2763
|
+
}, l * 2);
|
|
2764
|
+
}
|
|
2765
|
+
getWrapper() {
|
|
2766
|
+
return this.shadowRoot?.querySelector("div.page");
|
|
2767
|
+
}
|
|
2768
|
+
updateContainerHeight() {
|
|
2769
|
+
const t = this.getWrapper();
|
|
2770
|
+
if (!t)
|
|
2771
|
+
return;
|
|
2772
|
+
const o = parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height") || "0");
|
|
2773
|
+
let i = 0;
|
|
2774
|
+
if (this.mobileFullScreen) {
|
|
2775
|
+
const a = window.visualViewport?.height || window.innerHeight, n = this.getHeaderHeight();
|
|
2776
|
+
i = a - n - o, this.style.setProperty("--local-border-bottom-radius", "0px");
|
|
2777
|
+
} else
|
|
2778
|
+
i = t.getBoundingClientRect().height + o, this.style.setProperty("--local-border-bottom-radius", o ? "var(--apkt-borderRadius-5)" : "0px");
|
|
2779
|
+
this.style.setProperty("--local-container-height", `${i}px`), this.previousHeight !== "0px" && this.style.setProperty("--local-duration-height", this.transitionDuration), this.previousHeight = `${i}px`;
|
|
2780
|
+
}
|
|
2781
|
+
getHeaderHeight() {
|
|
2782
|
+
return xt;
|
|
2783
|
+
}
|
|
2784
|
+
};
|
|
2785
|
+
C.styles = [Tt];
|
|
2786
|
+
O([
|
|
2787
|
+
p({ type: String })
|
|
2788
|
+
], C.prototype, "transitionDuration", void 0);
|
|
2789
|
+
O([
|
|
2790
|
+
p({ type: String })
|
|
2791
|
+
], C.prototype, "transitionFunction", void 0);
|
|
2792
|
+
O([
|
|
2793
|
+
p({ type: String })
|
|
2794
|
+
], C.prototype, "history", void 0);
|
|
2795
|
+
O([
|
|
2796
|
+
p({ type: String })
|
|
2797
|
+
], C.prototype, "view", void 0);
|
|
2798
|
+
O([
|
|
2799
|
+
p({ attribute: !1 })
|
|
2800
|
+
], C.prototype, "setView", void 0);
|
|
2801
|
+
O([
|
|
2802
|
+
w()
|
|
2803
|
+
], C.prototype, "viewDirection", void 0);
|
|
2804
|
+
O([
|
|
2805
|
+
w()
|
|
2806
|
+
], C.prototype, "historyState", void 0);
|
|
2807
|
+
O([
|
|
2808
|
+
w()
|
|
2809
|
+
], C.prototype, "previousHeight", void 0);
|
|
2810
|
+
O([
|
|
2811
|
+
w()
|
|
2812
|
+
], C.prototype, "mobileFullScreen", void 0);
|
|
2813
|
+
C = O([
|
|
2814
|
+
y("w3m-router-container")
|
|
2815
|
+
], C);
|
|
2816
|
+
export {
|
|
2817
|
+
$e as AppKitModal,
|
|
2818
|
+
b as W3mListWallet,
|
|
2819
|
+
Ae as W3mModal,
|
|
2820
|
+
P as W3mModalBase,
|
|
2821
|
+
C as W3mRouterContainer
|
|
2822
|
+
};
|