@prohetamine/redstone 0.0.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/dist/PhArrowCircleDown-BR-zH4LC.js +14 -0
- package/dist/PhArrowCircleDown-Sb38khBy.mjs +73 -0
- package/dist/PhArrowClockwise-BE5j9P0Z.mjs +73 -0
- package/dist/PhArrowClockwise-BRaehQGe.js +14 -0
- package/dist/PhArrowDown-B_WmmmY9.js +14 -0
- package/dist/PhArrowDown-CFEyR2dR.mjs +73 -0
- package/dist/PhArrowLeft-CYfU7NZj.mjs +73 -0
- package/dist/PhArrowLeft-CkEd70hm.js +14 -0
- package/dist/PhArrowRight-C07Qkx86.js +14 -0
- package/dist/PhArrowRight-EermNu0V.mjs +73 -0
- package/dist/PhArrowSquareOut-BjTBfzOP.js +14 -0
- package/dist/PhArrowSquareOut-DZwTtw54.mjs +73 -0
- package/dist/PhArrowUp-DB4CCSss.js +14 -0
- package/dist/PhArrowUp-xTpLFQkg.mjs +73 -0
- package/dist/PhArrowUpRight-CQbvn6NO.mjs +73 -0
- package/dist/PhArrowUpRight-GpCIMsAh.js +14 -0
- package/dist/PhArrowsClockwise-BgcIUg-Z.js +14 -0
- package/dist/PhArrowsClockwise-DnUYZTVx.mjs +73 -0
- package/dist/PhArrowsDownUp-C8KXUqtu.js +14 -0
- package/dist/PhArrowsDownUp-DgoprEe2.mjs +73 -0
- package/dist/PhArrowsLeftRight-CahChzCj.js +14 -0
- package/dist/PhArrowsLeftRight-FD4AZiLh.mjs +73 -0
- package/dist/PhBank-DIqIL4x_.js +14 -0
- package/dist/PhBank-DbQOQ9zJ.mjs +73 -0
- package/dist/PhBrowser-BCBXK2IM.mjs +73 -0
- package/dist/PhBrowser-laCKtn7T.js +14 -0
- package/dist/PhCaretDown-CnjP-QjZ.mjs +73 -0
- package/dist/PhCaretDown-DDe42xDU.js +14 -0
- package/dist/PhCaretLeft-Cskc5OY9.js +14 -0
- package/dist/PhCaretLeft-DkuXxjf_.mjs +73 -0
- package/dist/PhCaretRight-CBWpghxt.mjs +73 -0
- package/dist/PhCaretRight-DNgI5w_B.js +14 -0
- package/dist/PhCaretUp-CQ-OztBV.mjs +73 -0
- package/dist/PhCaretUp-CUZ4g_Me.js +14 -0
- package/dist/PhCheck-BVV_Dwfo.js +14 -0
- package/dist/PhCheck-t515emYS.mjs +73 -0
- package/dist/PhCircleHalf-BuQTmrKW.mjs +73 -0
- package/dist/PhCircleHalf-DDC7rige.js +14 -0
- package/dist/PhClock-BqynEKWl.js +14 -0
- package/dist/PhClock-D6XkTmM_.mjs +73 -0
- package/dist/PhCompass-2QeeX5Ad.mjs +73 -0
- package/dist/PhCompass-BsuJwXAE.js +14 -0
- package/dist/PhCopy-CO34-_xD.mjs +73 -0
- package/dist/PhCopy-MVqtRS6X.js +14 -0
- package/dist/PhCreditCard-Dq4kdjCw.js +14 -0
- package/dist/PhCreditCard-bfnqYflD.mjs +73 -0
- package/dist/PhCurrencyDollar-6k8UWxal.js +14 -0
- package/dist/PhCurrencyDollar-BekVYPtC.mjs +73 -0
- package/dist/PhDesktop-BkNzf3rT.mjs +73 -0
- package/dist/PhDesktop-CfsXQ0vC.js +14 -0
- package/dist/PhDeviceMobile-BT3Mg_b0.mjs +73 -0
- package/dist/PhDeviceMobile-BnrrDrwf.js +14 -0
- package/dist/PhDotsThree-6LRvhAcL.js +14 -0
- package/dist/PhDotsThree-kpf2OKxJ.mjs +73 -0
- package/dist/PhEnvelope-CHsfC2e0.js +14 -0
- package/dist/PhEnvelope-UFKpKtwf.mjs +73 -0
- package/dist/PhFunnelSimple-CdAqSIhK.mjs +73 -0
- package/dist/PhFunnelSimple-JAk7X9Wo.js +14 -0
- package/dist/PhGlobe-B3RYXl8h.mjs +73 -0
- package/dist/PhGlobe-Tfs4MfpG.js +14 -0
- package/dist/PhIdentificationCard-Dqmd6eY1.js +14 -0
- package/dist/PhIdentificationCard-rSq59Czm.mjs +73 -0
- package/dist/PhImage-aEryzfCi.js +14 -0
- package/dist/PhImage-ynsEnFd_.mjs +73 -0
- package/dist/PhInfo-B7lsWl6m.mjs +73 -0
- package/dist/PhInfo-D6oUrWpA.js +14 -0
- package/dist/PhLightbulb-FQDaMMqu.mjs +73 -0
- package/dist/PhLightbulb-qbEduhPa.js +14 -0
- package/dist/PhMagnifyingGlass-COdRH2k5.js +14 -0
- package/dist/PhMagnifyingGlass-_NXk13-0.mjs +73 -0
- package/dist/PhPaperPlaneRight-BYi7SorW.mjs +73 -0
- package/dist/PhPaperPlaneRight-DrpVAQOZ.js +14 -0
- package/dist/PhPlus-25KQTPHG.mjs +73 -0
- package/dist/PhPlus-BhUXef08.js +14 -0
- package/dist/PhPower-BKl7gzsB.mjs +73 -0
- package/dist/PhPower-BNJf1AGQ.js +14 -0
- package/dist/PhPuzzlePiece-BkZeF8CX.js +14 -0
- package/dist/PhPuzzlePiece-BqUI4GRs.mjs +73 -0
- package/dist/PhQrCode-C-tqZKPP.mjs +73 -0
- package/dist/PhQrCode-C0v0iXQN.js +14 -0
- package/dist/PhQuestion-BBAiRWgt.js +14 -0
- package/dist/PhQuestion-CtYvffyD.mjs +73 -0
- package/dist/PhQuestionMark-BNbtL2yx.mjs +73 -0
- package/dist/PhQuestionMark-BvGUBZ1h.js +14 -0
- package/dist/PhSealCheck-B0TEqWpq.mjs +73 -0
- package/dist/PhSealCheck-BwNkuF7G.js +14 -0
- package/dist/PhSignOut-C1rMSNaS.js +14 -0
- package/dist/PhSignOut-HX2_BVsD.mjs +73 -0
- package/dist/PhSpinner-CoDYLYOX.mjs +73 -0
- package/dist/PhSpinner-nmsGWDQl.js +14 -0
- package/dist/PhTrash-CALlKx3e.js +14 -0
- package/dist/PhTrash-DeQHS8ZP.mjs +73 -0
- package/dist/PhUser-CA0e5OPI.js +14 -0
- package/dist/PhUser-Cy5EY3vX.mjs +73 -0
- package/dist/PhVault-DdXjVOO9.mjs +73 -0
- package/dist/PhVault-DqxV75cz.js +14 -0
- package/dist/PhWallet-CeQrfGYc.mjs +73 -0
- package/dist/PhWallet-CyCuEs2U.js +14 -0
- package/dist/PhWarning-BKaHv_wT.mjs +73 -0
- package/dist/PhWarning-C7oj86bY.js +14 -0
- package/dist/PhWarningCircle-8MWw-QgE.mjs +73 -0
- package/dist/PhWarningCircle-CrNPXGj4.js +14 -0
- package/dist/PhX-9lsrXjyl.js +14 -0
- package/dist/PhX-DgXr_Fb0.mjs +73 -0
- package/dist/ReownAuthentication-Bfv31LzI.mjs +274 -0
- package/dist/ReownAuthentication-d8aYgGOq.js +5 -0
- package/dist/SwapController-4lzoYsYr.js +1 -0
- package/dist/SwapController-DjzUWRyQ.mjs +462 -0
- package/dist/ccip-CvwbEhki.js +1 -0
- package/dist/ccip-TuO68NeE.mjs +150 -0
- package/dist/data-capture-BwdjH2vc.mjs +489 -0
- package/dist/data-capture-xVUNZJ2T.js +242 -0
- package/dist/email-BCZObJCY.js +90 -0
- package/dist/email-m-wo60fN.mjs +338 -0
- package/dist/embedded-wallet-CGSri-4g.js +410 -0
- package/dist/embedded-wallet-DdZmv5qP.mjs +808 -0
- package/dist/features-BJ8kNaE8.js +1 -0
- package/dist/features-CJ34oImB.mjs +6 -0
- package/dist/index-4lfXeo30.js +132 -0
- package/dist/index-B6Mg114Z.mjs +69182 -0
- package/dist/index-BX7gAgT3.mjs +35 -0
- package/dist/index-BYQqNbCe.js +1 -0
- package/dist/index-BmdHwtJo.js +1 -0
- package/dist/index-BvUx3ULC.js +78 -0
- package/dist/index-CD-QGO70.mjs +196 -0
- package/dist/index-CJtXfdoM.mjs +29621 -0
- package/dist/index-CMzdgE-y.mjs +215 -0
- package/dist/index-CjZQCcwG.js +7203 -0
- package/dist/index-D7VuOaCI.js +19 -0
- package/dist/index-DV7SQwgn.mjs +2688 -0
- package/dist/index-DVf4BnNh.mjs +352 -0
- package/dist/index-DhN9vL4k.js +138 -0
- package/dist/index-DvllakY0.mjs +274 -0
- package/dist/index-Ho06VKh2.mjs +151 -0
- package/dist/index-a8mS2Eh1.js +1062 -0
- package/dist/index-aamBi9Tu.js +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.es.js +14 -0
- package/dist/onramp-DLlhSPQg.js +422 -0
- package/dist/onramp-k-EAEepC.mjs +842 -0
- package/dist/parseSignature-D1tZHglo.js +16 -0
- package/dist/parseSignature-DM0lwcDr.mjs +8883 -0
- package/dist/pay-with-exchange---G2M1Ag.js +280 -0
- package/dist/pay-with-exchange-CFIcUXUe.mjs +512 -0
- package/dist/property-Bd8U3_QP.mjs +618 -0
- package/dist/property-DissjCbZ.js +27 -0
- package/dist/receive-B9LCljO6.mjs +228 -0
- package/dist/receive-E8H6GDOX.js +131 -0
- package/dist/send-B-AooLph.js +554 -0
- package/dist/send-DZd_xhsd.mjs +1155 -0
- package/dist/socials-ChWFLEFe.mjs +611 -0
- package/dist/socials-YSUYSh8o.js +250 -0
- package/dist/swaps-DpR9W9Ld.js +1050 -0
- package/dist/swaps-Du7-Ui_V.mjs +1752 -0
- package/dist/transactions-DhsK5-QJ.mjs +35 -0
- package/dist/transactions-VPsz2OLe.js +16 -0
- package/dist/w3m-modal-DhomfjKU.js +891 -0
- package/dist/w3m-modal-KuYD-zqQ.mjs +1759 -0
- package/package.json +51 -0
- package/readme.md +1 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { ca as S, c5 as g, cy as p, c7 as c, cz as _, c3 as s, c4 as f, cc as b, bV as u, bR as D, bW as C, ci as d, bX as m, cv as E, c0 as W, bY as $, b_ as P, cA as N, c6 as T } from "./index-B6Mg114Z.mjs";
|
|
2
|
+
import { W as y } from "./index-DVf4BnNh.mjs";
|
|
3
|
+
var F = function(a, e, t, r) {
|
|
4
|
+
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
5
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
6
|
+
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
7
|
+
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
8
|
+
};
|
|
9
|
+
let I = class extends y {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.onOtpSubmit = async (e) => {
|
|
12
|
+
var t, r;
|
|
13
|
+
try {
|
|
14
|
+
if (this.authConnector) {
|
|
15
|
+
const n = S.state.activeChain, i = g.getConnections(n), o = (t = p.state.remoteFeatures) == null ? void 0 : t.multiWallet, l = i.length > 0;
|
|
16
|
+
if (await this.authConnector.provider.connectOtp({ otp: e }), c.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_PASS" }), n)
|
|
17
|
+
await g.connectExternal(this.authConnector, n);
|
|
18
|
+
else
|
|
19
|
+
throw new Error("Active chain is not set on ChainController");
|
|
20
|
+
if ((r = p.state.remoteFeatures) != null && r.emailCapture)
|
|
21
|
+
return;
|
|
22
|
+
if (p.state.siwx) {
|
|
23
|
+
_.close();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (l && o) {
|
|
27
|
+
s.replace("ProfileWallets"), f.showSuccess("New Wallet Added");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
_.close();
|
|
31
|
+
}
|
|
32
|
+
} catch (n) {
|
|
33
|
+
throw c.sendEvent({
|
|
34
|
+
type: "track",
|
|
35
|
+
event: "EMAIL_VERIFICATION_CODE_FAIL",
|
|
36
|
+
properties: { message: b.parseError(n) }
|
|
37
|
+
}), n;
|
|
38
|
+
}
|
|
39
|
+
}, this.onOtpResend = async (e) => {
|
|
40
|
+
this.authConnector && (await this.authConnector.provider.connectEmail({ email: e }), c.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_SENT" }));
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
I = F([
|
|
45
|
+
u("w3m-email-verify-otp-view")
|
|
46
|
+
], I);
|
|
47
|
+
const U = D`
|
|
48
|
+
wui-icon-box {
|
|
49
|
+
height: ${({ spacing: a }) => a[16]};
|
|
50
|
+
width: ${({ spacing: a }) => a[16]};
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
var x = function(a, e, t, r) {
|
|
54
|
+
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
55
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
56
|
+
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
57
|
+
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
58
|
+
};
|
|
59
|
+
let w = class extends C {
|
|
60
|
+
constructor() {
|
|
61
|
+
var e;
|
|
62
|
+
super(), this.email = (e = s.state.data) == null ? void 0 : e.email, this.authConnector = d.getAuthConnector(), this.loading = !1, this.listenForDeviceApproval();
|
|
63
|
+
}
|
|
64
|
+
render() {
|
|
65
|
+
if (!this.email)
|
|
66
|
+
throw new Error("w3m-email-verify-device-view: No email provided");
|
|
67
|
+
if (!this.authConnector)
|
|
68
|
+
throw new Error("w3m-email-verify-device-view: No auth connector provided");
|
|
69
|
+
return m`
|
|
70
|
+
<wui-flex
|
|
71
|
+
flexDirection="column"
|
|
72
|
+
alignItems="center"
|
|
73
|
+
.padding=${["6", "3", "6", "3"]}
|
|
74
|
+
gap="4"
|
|
75
|
+
>
|
|
76
|
+
<wui-icon-box size="xl" color="accent-primary" icon="sealCheck"></wui-icon-box>
|
|
77
|
+
|
|
78
|
+
<wui-flex flexDirection="column" alignItems="center" gap="3">
|
|
79
|
+
<wui-flex flexDirection="column" alignItems="center">
|
|
80
|
+
<wui-text variant="md-regular" color="primary">
|
|
81
|
+
Approve the login link we sent to
|
|
82
|
+
</wui-text>
|
|
83
|
+
<wui-text variant="md-regular" color="primary"><b>${this.email}</b></wui-text>
|
|
84
|
+
</wui-flex>
|
|
85
|
+
|
|
86
|
+
<wui-text variant="sm-regular" color="secondary" align="center">
|
|
87
|
+
The code expires in 20 minutes
|
|
88
|
+
</wui-text>
|
|
89
|
+
|
|
90
|
+
<wui-flex alignItems="center" id="w3m-resend-section" gap="2">
|
|
91
|
+
<wui-text variant="sm-regular" color="primary" align="center">
|
|
92
|
+
Didn't receive it?
|
|
93
|
+
</wui-text>
|
|
94
|
+
<wui-link @click=${this.onResendCode.bind(this)} .disabled=${this.loading}>
|
|
95
|
+
Resend email
|
|
96
|
+
</wui-link>
|
|
97
|
+
</wui-flex>
|
|
98
|
+
</wui-flex>
|
|
99
|
+
</wui-flex>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
async listenForDeviceApproval() {
|
|
103
|
+
if (this.authConnector)
|
|
104
|
+
try {
|
|
105
|
+
await this.authConnector.provider.connectDevice(), c.sendEvent({ type: "track", event: "DEVICE_REGISTERED_FOR_EMAIL" }), c.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_SENT" }), s.replace("EmailVerifyOtp", { email: this.email });
|
|
106
|
+
} catch {
|
|
107
|
+
s.goBack();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async onResendCode() {
|
|
111
|
+
try {
|
|
112
|
+
if (!this.loading) {
|
|
113
|
+
if (!this.authConnector || !this.email)
|
|
114
|
+
throw new Error("w3m-email-login-widget: Unable to resend email");
|
|
115
|
+
this.loading = !0, await this.authConnector.provider.connectEmail({ email: this.email }), this.listenForDeviceApproval(), f.showSuccess("Code email resent");
|
|
116
|
+
}
|
|
117
|
+
} catch (e) {
|
|
118
|
+
f.showError(e);
|
|
119
|
+
} finally {
|
|
120
|
+
this.loading = !1;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
w.styles = U;
|
|
125
|
+
x([
|
|
126
|
+
E()
|
|
127
|
+
], w.prototype, "loading", void 0);
|
|
128
|
+
w = x([
|
|
129
|
+
u("w3m-email-verify-device-view")
|
|
130
|
+
], w);
|
|
131
|
+
const j = W`
|
|
132
|
+
wui-email-input {
|
|
133
|
+
width: 100%;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
form {
|
|
137
|
+
width: 100%;
|
|
138
|
+
display: block;
|
|
139
|
+
position: relative;
|
|
140
|
+
}
|
|
141
|
+
`;
|
|
142
|
+
var O = function(a, e, t, r) {
|
|
143
|
+
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
144
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
145
|
+
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
146
|
+
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
147
|
+
};
|
|
148
|
+
let h = class extends C {
|
|
149
|
+
constructor() {
|
|
150
|
+
var e, t;
|
|
151
|
+
super(...arguments), this.formRef = $(), this.initialEmail = ((e = s.state.data) == null ? void 0 : e.email) ?? "", this.redirectView = (t = s.state.data) == null ? void 0 : t.redirectView, this.email = "", this.loading = !1;
|
|
152
|
+
}
|
|
153
|
+
firstUpdated() {
|
|
154
|
+
var e;
|
|
155
|
+
(e = this.formRef.value) == null || e.addEventListener("keydown", (t) => {
|
|
156
|
+
t.key === "Enter" && this.onSubmitEmail(t);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
render() {
|
|
160
|
+
return m`
|
|
161
|
+
<wui-flex flexDirection="column" padding="4" gap="4">
|
|
162
|
+
<form ${P(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
|
|
163
|
+
<wui-email-input
|
|
164
|
+
value=${this.initialEmail}
|
|
165
|
+
.disabled=${this.loading}
|
|
166
|
+
@inputChange=${this.onEmailInputChange.bind(this)}
|
|
167
|
+
>
|
|
168
|
+
</wui-email-input>
|
|
169
|
+
<input type="submit" hidden />
|
|
170
|
+
</form>
|
|
171
|
+
${this.buttonsTemplate()}
|
|
172
|
+
</wui-flex>
|
|
173
|
+
`;
|
|
174
|
+
}
|
|
175
|
+
onEmailInputChange(e) {
|
|
176
|
+
this.email = e.detail;
|
|
177
|
+
}
|
|
178
|
+
async onSubmitEmail(e) {
|
|
179
|
+
try {
|
|
180
|
+
if (this.loading)
|
|
181
|
+
return;
|
|
182
|
+
this.loading = !0, e.preventDefault();
|
|
183
|
+
const t = d.getAuthConnector();
|
|
184
|
+
if (!t)
|
|
185
|
+
throw new Error("w3m-update-email-wallet: Auth connector not found");
|
|
186
|
+
const r = await t.provider.updateEmail({ email: this.email });
|
|
187
|
+
c.sendEvent({ type: "track", event: "EMAIL_EDIT" }), r.action === "VERIFY_SECONDARY_OTP" ? s.push("UpdateEmailSecondaryOtp", {
|
|
188
|
+
email: this.initialEmail,
|
|
189
|
+
newEmail: this.email,
|
|
190
|
+
redirectView: this.redirectView
|
|
191
|
+
}) : s.push("UpdateEmailPrimaryOtp", {
|
|
192
|
+
email: this.initialEmail,
|
|
193
|
+
newEmail: this.email,
|
|
194
|
+
redirectView: this.redirectView
|
|
195
|
+
});
|
|
196
|
+
} catch (t) {
|
|
197
|
+
f.showError(t), this.loading = !1;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
buttonsTemplate() {
|
|
201
|
+
const e = !this.loading && this.email.length > 3 && this.email !== this.initialEmail;
|
|
202
|
+
return this.redirectView ? m`
|
|
203
|
+
<wui-flex gap="3">
|
|
204
|
+
<wui-button size="md" variant="neutral" fullWidth @click=${s.goBack}>
|
|
205
|
+
Cancel
|
|
206
|
+
</wui-button>
|
|
207
|
+
|
|
208
|
+
<wui-button
|
|
209
|
+
size="md"
|
|
210
|
+
variant="accent-primary"
|
|
211
|
+
fullWidth
|
|
212
|
+
@click=${this.onSubmitEmail.bind(this)}
|
|
213
|
+
.disabled=${!e}
|
|
214
|
+
.loading=${this.loading}
|
|
215
|
+
>
|
|
216
|
+
Save
|
|
217
|
+
</wui-button>
|
|
218
|
+
</wui-flex>
|
|
219
|
+
` : m`
|
|
220
|
+
<wui-button
|
|
221
|
+
size="md"
|
|
222
|
+
variant="accent-primary"
|
|
223
|
+
fullWidth
|
|
224
|
+
@click=${this.onSubmitEmail.bind(this)}
|
|
225
|
+
.disabled=${!e}
|
|
226
|
+
.loading=${this.loading}
|
|
227
|
+
>
|
|
228
|
+
Save
|
|
229
|
+
</wui-button>
|
|
230
|
+
`;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
h.styles = j;
|
|
234
|
+
O([
|
|
235
|
+
E()
|
|
236
|
+
], h.prototype, "email", void 0);
|
|
237
|
+
O([
|
|
238
|
+
E()
|
|
239
|
+
], h.prototype, "loading", void 0);
|
|
240
|
+
h = O([
|
|
241
|
+
u("w3m-update-email-wallet-view")
|
|
242
|
+
], h);
|
|
243
|
+
var L = function(a, e, t, r) {
|
|
244
|
+
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
245
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
246
|
+
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
247
|
+
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
248
|
+
};
|
|
249
|
+
let A = class extends y {
|
|
250
|
+
constructor() {
|
|
251
|
+
var e;
|
|
252
|
+
super(), this.email = (e = s.state.data) == null ? void 0 : e.email, this.onOtpSubmit = async (t) => {
|
|
253
|
+
try {
|
|
254
|
+
this.authConnector && (await this.authConnector.provider.updateEmailPrimaryOtp({ otp: t }), c.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_PASS" }), s.replace("UpdateEmailSecondaryOtp", s.state.data));
|
|
255
|
+
} catch (r) {
|
|
256
|
+
throw c.sendEvent({
|
|
257
|
+
type: "track",
|
|
258
|
+
event: "EMAIL_VERIFICATION_CODE_FAIL",
|
|
259
|
+
properties: { message: b.parseError(r) }
|
|
260
|
+
}), r;
|
|
261
|
+
}
|
|
262
|
+
}, this.onStartOver = () => {
|
|
263
|
+
s.replace("UpdateEmailWallet", s.state.data);
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
A = L([
|
|
268
|
+
u("w3m-update-email-primary-otp-view")
|
|
269
|
+
], A);
|
|
270
|
+
var M = function(a, e, t, r) {
|
|
271
|
+
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
272
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
273
|
+
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
274
|
+
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
275
|
+
};
|
|
276
|
+
let R = class extends y {
|
|
277
|
+
constructor() {
|
|
278
|
+
var e, t;
|
|
279
|
+
super(), this.email = (e = s.state.data) == null ? void 0 : e.newEmail, this.redirectView = (t = s.state.data) == null ? void 0 : t.redirectView, this.onOtpSubmit = async (r) => {
|
|
280
|
+
try {
|
|
281
|
+
this.authConnector && (await this.authConnector.provider.updateEmailSecondaryOtp({ otp: r }), c.sendEvent({ type: "track", event: "EMAIL_VERIFICATION_CODE_PASS" }), this.redirectView && s.reset(this.redirectView));
|
|
282
|
+
} catch (n) {
|
|
283
|
+
throw c.sendEvent({
|
|
284
|
+
type: "track",
|
|
285
|
+
event: "EMAIL_VERIFICATION_CODE_FAIL",
|
|
286
|
+
properties: { message: b.parseError(n) }
|
|
287
|
+
}), n;
|
|
288
|
+
}
|
|
289
|
+
}, this.onStartOver = () => {
|
|
290
|
+
s.replace("UpdateEmailWallet", s.state.data);
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
R = M([
|
|
295
|
+
u("w3m-update-email-secondary-otp-view")
|
|
296
|
+
], R);
|
|
297
|
+
var V = function(a, e, t, r) {
|
|
298
|
+
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, t) : r, o;
|
|
299
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, r);
|
|
300
|
+
else for (var l = a.length - 1; l >= 0; l--) (o = a[l]) && (i = (n < 3 ? o(i) : n > 3 ? o(e, t, i) : o(e, t)) || i);
|
|
301
|
+
return n > 3 && i && Object.defineProperty(e, t, i), i;
|
|
302
|
+
};
|
|
303
|
+
let v = class extends C {
|
|
304
|
+
constructor() {
|
|
305
|
+
var e;
|
|
306
|
+
super(), this.authConnector = d.getAuthConnector(), this.isEmailEnabled = (e = p.state.remoteFeatures) == null ? void 0 : e.email, this.isAuthEnabled = this.checkIfAuthEnabled(d.state.connectors), this.connectors = d.state.connectors, d.subscribeKey("connectors", (t) => {
|
|
307
|
+
this.connectors = t, this.isAuthEnabled = this.checkIfAuthEnabled(this.connectors);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
render() {
|
|
311
|
+
if (!this.isEmailEnabled)
|
|
312
|
+
throw new Error("w3m-email-login-view: Email is not enabled");
|
|
313
|
+
if (!this.isAuthEnabled)
|
|
314
|
+
throw new Error("w3m-email-login-view: No auth connector provided");
|
|
315
|
+
return m`<wui-flex flexDirection="column" .padding=${["1", "3", "3", "3"]} gap="4">
|
|
316
|
+
<w3m-email-login-widget></w3m-email-login-widget>
|
|
317
|
+
</wui-flex> `;
|
|
318
|
+
}
|
|
319
|
+
checkIfAuthEnabled(e) {
|
|
320
|
+
const t = e.filter((n) => n.type === N.CONNECTOR_TYPE_AUTH).map((n) => n.chain);
|
|
321
|
+
return T.AUTH_CONNECTOR_SUPPORTED_CHAINS.some((n) => t.includes(n));
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
V([
|
|
325
|
+
E()
|
|
326
|
+
], v.prototype, "connectors", void 0);
|
|
327
|
+
v = V([
|
|
328
|
+
u("w3m-email-login-view")
|
|
329
|
+
], v);
|
|
330
|
+
export {
|
|
331
|
+
v as W3mEmailLoginView,
|
|
332
|
+
y as W3mEmailOtpWidget,
|
|
333
|
+
w as W3mEmailVerifyDeviceView,
|
|
334
|
+
I as W3mEmailVerifyOtpView,
|
|
335
|
+
A as W3mUpdateEmailPrimaryOtpView,
|
|
336
|
+
R as W3mUpdateEmailSecondaryOtpView,
|
|
337
|
+
h as W3mUpdateEmailWalletView
|
|
338
|
+
};
|