@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,611 @@
|
|
|
1
|
+
import { bR as O, bU as W, cv as l, bV as _, bW as I, ci as S, cy as h, cq as T, c3 as f, cg as F, bX as c, cB as D, cc as C, cC as N, ce as j, cD as U, cu as $, ca as d, c5 as P, cE as M, c7 as u, cF as A, c4 as v, cG as q, cz as R, ct as x } from "./index-B6Mg114Z.mjs";
|
|
2
|
+
const z = O`
|
|
3
|
+
:host {
|
|
4
|
+
margin-top: ${({ spacing: t }) => t[1]};
|
|
5
|
+
}
|
|
6
|
+
wui-separator {
|
|
7
|
+
margin: ${({ spacing: t }) => t[3]} calc(${({ spacing: t }) => t[3]} * -1)
|
|
8
|
+
${({ spacing: t }) => t[2]} calc(${({ spacing: t }) => t[3]} * -1);
|
|
9
|
+
width: calc(100% + ${({ spacing: t }) => t[3]} * 2);
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
var g = function(t, e, o, r) {
|
|
13
|
+
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, o) : r, s;
|
|
14
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, r);
|
|
15
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (n < 3 ? s(i) : n > 3 ? s(e, o, i) : s(e, o)) || i);
|
|
16
|
+
return n > 3 && i && Object.defineProperty(e, o, i), i;
|
|
17
|
+
};
|
|
18
|
+
let p = class extends I {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = S.state.connectors, this.authConnector = this.connectors.find((e) => e.type === "AUTH"), this.remoteFeatures = h.state.remoteFeatures, this.isPwaLoading = !1, this.hasExceededUsageLimit = T.state.plan.hasExceededUsageLimit, this.unsubscribe.push(S.subscribeKey("connectors", (e) => {
|
|
21
|
+
this.connectors = e, this.authConnector = this.connectors.find((o) => o.type === "AUTH");
|
|
22
|
+
}), h.subscribeKey("remoteFeatures", (e) => this.remoteFeatures = e));
|
|
23
|
+
}
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback(), this.handlePwaFrameLoad();
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
this.unsubscribe.forEach((e) => e());
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
var i;
|
|
32
|
+
let e = ((i = this.remoteFeatures) == null ? void 0 : i.socials) || [];
|
|
33
|
+
const o = !!this.authConnector, r = e == null ? void 0 : e.length, n = f.state.view === "ConnectSocials";
|
|
34
|
+
return (!o || !r) && !n ? null : (n && !r && (e = F.DEFAULT_SOCIALS), c` <wui-flex flexDirection="column" gap="2">
|
|
35
|
+
${e.map((s) => c`<wui-list-social
|
|
36
|
+
@click=${() => {
|
|
37
|
+
this.onSocialClick(s);
|
|
38
|
+
}}
|
|
39
|
+
data-testid=${`social-selector-${s}`}
|
|
40
|
+
name=${s}
|
|
41
|
+
logo=${s}
|
|
42
|
+
?disabled=${this.isPwaLoading}
|
|
43
|
+
></wui-list-social>`)}
|
|
44
|
+
</wui-flex>`);
|
|
45
|
+
}
|
|
46
|
+
async onSocialClick(e) {
|
|
47
|
+
if (this.hasExceededUsageLimit) {
|
|
48
|
+
f.push("UsageExceeded");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
e && await D(e);
|
|
52
|
+
}
|
|
53
|
+
async handlePwaFrameLoad() {
|
|
54
|
+
var e;
|
|
55
|
+
if (C.isPWA()) {
|
|
56
|
+
this.isPwaLoading = !0;
|
|
57
|
+
try {
|
|
58
|
+
((e = this.authConnector) == null ? void 0 : e.provider) instanceof N && await this.authConnector.provider.init();
|
|
59
|
+
} catch (o) {
|
|
60
|
+
j.open({
|
|
61
|
+
displayMessage: "Error loading embedded wallet in PWA",
|
|
62
|
+
debugMessage: o.message
|
|
63
|
+
}, "error");
|
|
64
|
+
} finally {
|
|
65
|
+
this.isPwaLoading = !1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
p.styles = z;
|
|
71
|
+
g([
|
|
72
|
+
W()
|
|
73
|
+
], p.prototype, "tabIdx", void 0);
|
|
74
|
+
g([
|
|
75
|
+
l()
|
|
76
|
+
], p.prototype, "connectors", void 0);
|
|
77
|
+
g([
|
|
78
|
+
l()
|
|
79
|
+
], p.prototype, "authConnector", void 0);
|
|
80
|
+
g([
|
|
81
|
+
l()
|
|
82
|
+
], p.prototype, "remoteFeatures", void 0);
|
|
83
|
+
g([
|
|
84
|
+
l()
|
|
85
|
+
], p.prototype, "isPwaLoading", void 0);
|
|
86
|
+
g([
|
|
87
|
+
l()
|
|
88
|
+
], p.prototype, "hasExceededUsageLimit", void 0);
|
|
89
|
+
p = g([
|
|
90
|
+
_("w3m-social-login-list")
|
|
91
|
+
], p);
|
|
92
|
+
const B = O`
|
|
93
|
+
wui-flex {
|
|
94
|
+
max-height: clamp(360px, 540px, 80vh);
|
|
95
|
+
overflow: scroll;
|
|
96
|
+
scrollbar-width: none;
|
|
97
|
+
transition: opacity ${({ durations: t }) => t.md}
|
|
98
|
+
${({ easings: t }) => t["ease-out-power-1"]};
|
|
99
|
+
will-change: opacity;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
wui-flex::-webkit-scrollbar {
|
|
103
|
+
display: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
wui-flex.disabled {
|
|
107
|
+
opacity: 0.3;
|
|
108
|
+
pointer-events: none;
|
|
109
|
+
user-select: none;
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
var k = function(t, e, o, r) {
|
|
113
|
+
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, o) : r, s;
|
|
114
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, r);
|
|
115
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (n < 3 ? s(i) : n > 3 ? s(e, o, i) : s(e, o)) || i);
|
|
116
|
+
return n > 3 && i && Object.defineProperty(e, o, i), i;
|
|
117
|
+
};
|
|
118
|
+
let L = class extends I {
|
|
119
|
+
constructor() {
|
|
120
|
+
super(), this.unsubscribe = [], this.checked = U.state.isLegalCheckboxChecked, this.unsubscribe.push(U.subscribeKey("isLegalCheckboxChecked", (e) => {
|
|
121
|
+
this.checked = e;
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
disconnectedCallback() {
|
|
125
|
+
this.unsubscribe.forEach((e) => e());
|
|
126
|
+
}
|
|
127
|
+
render() {
|
|
128
|
+
var E;
|
|
129
|
+
const { termsConditionsUrl: e, privacyPolicyUrl: o } = h.state, r = (E = h.state.features) == null ? void 0 : E.legalCheckbox, s = !!(e || o) && !!r && !this.checked, a = s ? -1 : void 0;
|
|
130
|
+
return c`
|
|
131
|
+
<w3m-legal-checkbox></w3m-legal-checkbox>
|
|
132
|
+
<wui-flex
|
|
133
|
+
flexDirection="column"
|
|
134
|
+
.padding=${["0", "3", "3", "3"]}
|
|
135
|
+
gap="01"
|
|
136
|
+
class=${$(s ? "disabled" : void 0)}
|
|
137
|
+
>
|
|
138
|
+
<w3m-social-login-list tabIdx=${$(a)}></w3m-social-login-list>
|
|
139
|
+
</wui-flex>
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
L.styles = B;
|
|
144
|
+
k([
|
|
145
|
+
l()
|
|
146
|
+
], L.prototype, "checked", void 0);
|
|
147
|
+
L = k([
|
|
148
|
+
_("w3m-connect-socials-view")
|
|
149
|
+
], L);
|
|
150
|
+
const G = O`
|
|
151
|
+
wui-logo {
|
|
152
|
+
width: 80px;
|
|
153
|
+
height: 80px;
|
|
154
|
+
border-radius: ${({ borderRadius: t }) => t[8]};
|
|
155
|
+
}
|
|
156
|
+
@keyframes shake {
|
|
157
|
+
0% {
|
|
158
|
+
transform: translateX(0);
|
|
159
|
+
}
|
|
160
|
+
25% {
|
|
161
|
+
transform: translateX(3px);
|
|
162
|
+
}
|
|
163
|
+
50% {
|
|
164
|
+
transform: translateX(-3px);
|
|
165
|
+
}
|
|
166
|
+
75% {
|
|
167
|
+
transform: translateX(3px);
|
|
168
|
+
}
|
|
169
|
+
100% {
|
|
170
|
+
transform: translateX(0);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
wui-flex:first-child:not(:only-child) {
|
|
174
|
+
position: relative;
|
|
175
|
+
}
|
|
176
|
+
wui-loading-thumbnail {
|
|
177
|
+
position: absolute;
|
|
178
|
+
}
|
|
179
|
+
wui-icon-box {
|
|
180
|
+
position: absolute;
|
|
181
|
+
right: calc(${({ spacing: t }) => t[1]} * -1);
|
|
182
|
+
bottom: calc(${({ spacing: t }) => t[1]} * -1);
|
|
183
|
+
opacity: 0;
|
|
184
|
+
transform: scale(0.5);
|
|
185
|
+
transition: all ${({ easings: t }) => t["ease-out-power-2"]}
|
|
186
|
+
${({ durations: t }) => t.lg};
|
|
187
|
+
}
|
|
188
|
+
wui-text[align='center'] {
|
|
189
|
+
width: 100%;
|
|
190
|
+
padding: 0px ${({ spacing: t }) => t[4]};
|
|
191
|
+
}
|
|
192
|
+
[data-error='true'] wui-icon-box {
|
|
193
|
+
opacity: 1;
|
|
194
|
+
transform: scale(1);
|
|
195
|
+
}
|
|
196
|
+
[data-error='true'] > wui-flex:first-child {
|
|
197
|
+
animation: shake 250ms ${({ easings: t }) => t["ease-out-power-2"]} both;
|
|
198
|
+
}
|
|
199
|
+
.capitalize {
|
|
200
|
+
text-transform: capitalize;
|
|
201
|
+
}
|
|
202
|
+
`;
|
|
203
|
+
var b = function(t, e, o, r) {
|
|
204
|
+
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, o) : r, s;
|
|
205
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, r);
|
|
206
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (n < 3 ? s(i) : n > 3 ? s(e, o, i) : s(e, o)) || i);
|
|
207
|
+
return n > 3 && i && Object.defineProperty(e, o, i), i;
|
|
208
|
+
};
|
|
209
|
+
let m = class extends I {
|
|
210
|
+
constructor() {
|
|
211
|
+
var o, r, n;
|
|
212
|
+
super(), this.unsubscribe = [], this.socialProvider = (o = d.getAccountData()) == null ? void 0 : o.socialProvider, this.socialWindow = (r = d.getAccountData()) == null ? void 0 : r.socialWindow, this.error = !1, this.connecting = !1, this.message = "Connect in the provider window", this.remoteFeatures = h.state.remoteFeatures, this.address = (n = d.getAccountData()) == null ? void 0 : n.address, this.connectionsByNamespace = P.getConnections(d.state.activeChain), this.hasMultipleConnections = this.connectionsByNamespace.length > 0, this.authConnector = S.getAuthConnector(), this.handleSocialConnection = async (i) => {
|
|
213
|
+
var s;
|
|
214
|
+
if ((s = i.data) != null && s.resultUri)
|
|
215
|
+
if (i.origin === M.SECURE_SITE_ORIGIN) {
|
|
216
|
+
window.removeEventListener("message", this.handleSocialConnection, !1);
|
|
217
|
+
try {
|
|
218
|
+
if (this.authConnector && !this.connecting) {
|
|
219
|
+
this.connecting = !0;
|
|
220
|
+
const a = this.parseURLError(i.data.resultUri);
|
|
221
|
+
if (a) {
|
|
222
|
+
this.handleSocialError(a);
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
this.closeSocialWindow(), this.updateMessage();
|
|
226
|
+
const E = i.data.resultUri;
|
|
227
|
+
this.socialProvider && u.sendEvent({
|
|
228
|
+
type: "track",
|
|
229
|
+
event: "SOCIAL_LOGIN_REQUEST_USER_DATA",
|
|
230
|
+
properties: { provider: this.socialProvider }
|
|
231
|
+
}), await P.connectExternal({
|
|
232
|
+
id: this.authConnector.id,
|
|
233
|
+
type: this.authConnector.type,
|
|
234
|
+
socialUri: E
|
|
235
|
+
}, this.authConnector.chain), this.socialProvider && (A.setConnectedSocialProvider(this.socialProvider), u.sendEvent({
|
|
236
|
+
type: "track",
|
|
237
|
+
event: "SOCIAL_LOGIN_SUCCESS",
|
|
238
|
+
properties: { provider: this.socialProvider }
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
} catch (a) {
|
|
242
|
+
this.error = !0, this.updateMessage(), this.socialProvider && u.sendEvent({
|
|
243
|
+
type: "track",
|
|
244
|
+
event: "SOCIAL_LOGIN_ERROR",
|
|
245
|
+
properties: {
|
|
246
|
+
provider: this.socialProvider,
|
|
247
|
+
message: C.parseError(a)
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
} else
|
|
252
|
+
f.goBack(), v.showError("Untrusted Origin"), this.socialProvider && u.sendEvent({
|
|
253
|
+
type: "track",
|
|
254
|
+
event: "SOCIAL_LOGIN_ERROR",
|
|
255
|
+
properties: {
|
|
256
|
+
provider: this.socialProvider,
|
|
257
|
+
message: "Untrusted Origin"
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}, q.EmbeddedWalletAbortController.signal.addEventListener("abort", () => {
|
|
261
|
+
this.closeSocialWindow();
|
|
262
|
+
}), this.unsubscribe.push(d.subscribeChainProp("accountState", (i) => {
|
|
263
|
+
var s;
|
|
264
|
+
if (i && (this.socialProvider = i.socialProvider, i.socialWindow && (this.socialWindow = i.socialWindow), i.address)) {
|
|
265
|
+
const a = (s = this.remoteFeatures) == null ? void 0 : s.multiWallet;
|
|
266
|
+
i.address !== this.address && (this.hasMultipleConnections && a ? (f.replace("ProfileWallets"), v.showSuccess("New Wallet Added"), this.address = i.address) : (R.state.open || h.state.enableEmbedded) && R.close());
|
|
267
|
+
}
|
|
268
|
+
}), h.subscribeKey("remoteFeatures", (i) => {
|
|
269
|
+
this.remoteFeatures = i;
|
|
270
|
+
})), this.authConnector && this.connectSocial();
|
|
271
|
+
}
|
|
272
|
+
disconnectedCallback() {
|
|
273
|
+
this.unsubscribe.forEach((o) => o()), window.removeEventListener("message", this.handleSocialConnection, !1), !d.state.activeCaipAddress && this.socialProvider && !this.connecting && u.sendEvent({
|
|
274
|
+
type: "track",
|
|
275
|
+
event: "SOCIAL_LOGIN_CANCELED",
|
|
276
|
+
properties: { provider: this.socialProvider }
|
|
277
|
+
}), this.closeSocialWindow();
|
|
278
|
+
}
|
|
279
|
+
render() {
|
|
280
|
+
return c`
|
|
281
|
+
<wui-flex
|
|
282
|
+
data-error=${$(this.error)}
|
|
283
|
+
flexDirection="column"
|
|
284
|
+
alignItems="center"
|
|
285
|
+
.padding=${["10", "5", "5", "5"]}
|
|
286
|
+
gap="6"
|
|
287
|
+
>
|
|
288
|
+
<wui-flex justifyContent="center" alignItems="center">
|
|
289
|
+
<wui-logo logo=${$(this.socialProvider)}></wui-logo>
|
|
290
|
+
${this.error ? null : this.loaderTemplate()}
|
|
291
|
+
<wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
|
|
292
|
+
</wui-flex>
|
|
293
|
+
<wui-flex flexDirection="column" alignItems="center" gap="2">
|
|
294
|
+
<wui-text align="center" variant="lg-medium" color="primary"
|
|
295
|
+
>Log in with
|
|
296
|
+
<span class="capitalize">${this.socialProvider ?? "Social"}</span></wui-text
|
|
297
|
+
>
|
|
298
|
+
<wui-text align="center" variant="lg-regular" color=${this.error ? "error" : "secondary"}
|
|
299
|
+
>${this.message}</wui-text
|
|
300
|
+
></wui-flex
|
|
301
|
+
>
|
|
302
|
+
</wui-flex>
|
|
303
|
+
`;
|
|
304
|
+
}
|
|
305
|
+
loaderTemplate() {
|
|
306
|
+
const e = x.state.themeVariables["--w3m-border-radius-master"], o = e ? parseInt(e.replace("px", ""), 10) : 4;
|
|
307
|
+
return c`<wui-loading-thumbnail radius=${o * 9}></wui-loading-thumbnail>`;
|
|
308
|
+
}
|
|
309
|
+
parseURLError(e) {
|
|
310
|
+
try {
|
|
311
|
+
const o = "error=", r = e.indexOf(o);
|
|
312
|
+
return r === -1 ? null : e.substring(r + o.length);
|
|
313
|
+
} catch {
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
connectSocial() {
|
|
318
|
+
const e = setInterval(() => {
|
|
319
|
+
var o;
|
|
320
|
+
(o = this.socialWindow) != null && o.closed && (!this.connecting && f.state.view === "ConnectingSocial" && f.goBack(), clearInterval(e));
|
|
321
|
+
}, 1e3);
|
|
322
|
+
window.addEventListener("message", this.handleSocialConnection, !1);
|
|
323
|
+
}
|
|
324
|
+
updateMessage() {
|
|
325
|
+
this.error ? this.message = "Something went wrong" : this.connecting ? this.message = "Retrieving user data" : this.message = "Connect in the provider window";
|
|
326
|
+
}
|
|
327
|
+
handleSocialError(e) {
|
|
328
|
+
this.error = !0, this.updateMessage(), this.socialProvider && u.sendEvent({
|
|
329
|
+
type: "track",
|
|
330
|
+
event: "SOCIAL_LOGIN_ERROR",
|
|
331
|
+
properties: { provider: this.socialProvider, message: e }
|
|
332
|
+
}), this.closeSocialWindow();
|
|
333
|
+
}
|
|
334
|
+
closeSocialWindow() {
|
|
335
|
+
this.socialWindow && (this.socialWindow.close(), d.setAccountProp("socialWindow", void 0, d.state.activeChain));
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
m.styles = G;
|
|
339
|
+
b([
|
|
340
|
+
l()
|
|
341
|
+
], m.prototype, "socialProvider", void 0);
|
|
342
|
+
b([
|
|
343
|
+
l()
|
|
344
|
+
], m.prototype, "socialWindow", void 0);
|
|
345
|
+
b([
|
|
346
|
+
l()
|
|
347
|
+
], m.prototype, "error", void 0);
|
|
348
|
+
b([
|
|
349
|
+
l()
|
|
350
|
+
], m.prototype, "connecting", void 0);
|
|
351
|
+
b([
|
|
352
|
+
l()
|
|
353
|
+
], m.prototype, "message", void 0);
|
|
354
|
+
b([
|
|
355
|
+
l()
|
|
356
|
+
], m.prototype, "remoteFeatures", void 0);
|
|
357
|
+
m = b([
|
|
358
|
+
_("w3m-connecting-social-view")
|
|
359
|
+
], m);
|
|
360
|
+
const V = O`
|
|
361
|
+
wui-shimmer {
|
|
362
|
+
width: 100%;
|
|
363
|
+
aspect-ratio: 1 / 1;
|
|
364
|
+
border-radius: ${({ borderRadius: t }) => t[4]};
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
wui-qr-code {
|
|
368
|
+
opacity: 0;
|
|
369
|
+
animation-duration: ${({ durations: t }) => t.xl};
|
|
370
|
+
animation-timing-function: ${({ easings: t }) => t["ease-out-power-2"]};
|
|
371
|
+
animation-name: fade-in;
|
|
372
|
+
animation-fill-mode: forwards;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
wui-logo {
|
|
376
|
+
width: 80px;
|
|
377
|
+
height: 80px;
|
|
378
|
+
border-radius: ${({ borderRadius: t }) => t[8]};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
wui-flex:first-child:not(:only-child) {
|
|
382
|
+
position: relative;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
wui-loading-thumbnail {
|
|
386
|
+
position: absolute;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
wui-icon-box {
|
|
390
|
+
position: absolute;
|
|
391
|
+
right: calc(${({ spacing: t }) => t[1]} * -1);
|
|
392
|
+
bottom: calc(${({ spacing: t }) => t[1]} * -1);
|
|
393
|
+
opacity: 0;
|
|
394
|
+
transform: scale(0.5);
|
|
395
|
+
transition:
|
|
396
|
+
opacity ${({ durations: t }) => t.lg} ${({ easings: t }) => t["ease-out-power-2"]},
|
|
397
|
+
transform ${({ durations: t }) => t.lg}
|
|
398
|
+
${({ easings: t }) => t["ease-out-power-2"]};
|
|
399
|
+
will-change: opacity, transform;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
@keyframes fade-in {
|
|
403
|
+
from {
|
|
404
|
+
opacity: 0;
|
|
405
|
+
}
|
|
406
|
+
to {
|
|
407
|
+
opacity: 1;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
`;
|
|
411
|
+
var y = function(t, e, o, r) {
|
|
412
|
+
var n = arguments.length, i = n < 3 ? e : r === null ? r = Object.getOwnPropertyDescriptor(e, o) : r, s;
|
|
413
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(t, e, o, r);
|
|
414
|
+
else for (var a = t.length - 1; a >= 0; a--) (s = t[a]) && (i = (n < 3 ? s(i) : n > 3 ? s(e, o, i) : s(e, o)) || i);
|
|
415
|
+
return n > 3 && i && Object.defineProperty(e, o, i), i;
|
|
416
|
+
};
|
|
417
|
+
let w = class extends I {
|
|
418
|
+
constructor() {
|
|
419
|
+
var e, o;
|
|
420
|
+
super(), this.unsubscribe = [], this.timeout = void 0, this.socialProvider = (e = d.getAccountData()) == null ? void 0 : e.socialProvider, this.uri = (o = d.getAccountData()) == null ? void 0 : o.farcasterUrl, this.ready = !1, this.loading = !1, this.remoteFeatures = h.state.remoteFeatures, this.authConnector = S.getAuthConnector(), this.forceUpdate = () => {
|
|
421
|
+
this.requestUpdate();
|
|
422
|
+
}, this.unsubscribe.push(d.subscribeChainProp("accountState", (r) => {
|
|
423
|
+
this.socialProvider = r == null ? void 0 : r.socialProvider, this.uri = r == null ? void 0 : r.farcasterUrl, this.connectFarcaster();
|
|
424
|
+
}), h.subscribeKey("remoteFeatures", (r) => {
|
|
425
|
+
this.remoteFeatures = r;
|
|
426
|
+
})), window.addEventListener("resize", this.forceUpdate);
|
|
427
|
+
}
|
|
428
|
+
disconnectedCallback() {
|
|
429
|
+
super.disconnectedCallback(), clearTimeout(this.timeout), window.removeEventListener("resize", this.forceUpdate), !d.state.activeCaipAddress && this.socialProvider && (this.uri || this.loading) && u.sendEvent({
|
|
430
|
+
type: "track",
|
|
431
|
+
event: "SOCIAL_LOGIN_CANCELED",
|
|
432
|
+
properties: { provider: this.socialProvider }
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
render() {
|
|
436
|
+
return this.onRenderProxy(), c`${this.platformTemplate()}`;
|
|
437
|
+
}
|
|
438
|
+
platformTemplate() {
|
|
439
|
+
return C.isMobile() ? c`${this.mobileTemplate()}` : c`${this.desktopTemplate()}`;
|
|
440
|
+
}
|
|
441
|
+
desktopTemplate() {
|
|
442
|
+
return this.loading ? c`${this.loadingTemplate()}` : c`${this.qrTemplate()}`;
|
|
443
|
+
}
|
|
444
|
+
qrTemplate() {
|
|
445
|
+
return c` <wui-flex
|
|
446
|
+
flexDirection="column"
|
|
447
|
+
alignItems="center"
|
|
448
|
+
.padding=${["0", "5", "5", "5"]}
|
|
449
|
+
gap="5"
|
|
450
|
+
>
|
|
451
|
+
<wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
|
|
452
|
+
|
|
453
|
+
<wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
|
|
454
|
+
${this.copyTemplate()}
|
|
455
|
+
</wui-flex>`;
|
|
456
|
+
}
|
|
457
|
+
loadingTemplate() {
|
|
458
|
+
return c`
|
|
459
|
+
<wui-flex
|
|
460
|
+
flexDirection="column"
|
|
461
|
+
alignItems="center"
|
|
462
|
+
.padding=${["5", "5", "5", "5"]}
|
|
463
|
+
gap="5"
|
|
464
|
+
>
|
|
465
|
+
<wui-flex justifyContent="center" alignItems="center">
|
|
466
|
+
<wui-logo logo="farcaster"></wui-logo>
|
|
467
|
+
${this.loaderTemplate()}
|
|
468
|
+
<wui-icon-box color="error" icon="close" size="sm"></wui-icon-box>
|
|
469
|
+
</wui-flex>
|
|
470
|
+
<wui-flex flexDirection="column" alignItems="center" gap="2">
|
|
471
|
+
<wui-text align="center" variant="md-medium" color="primary">
|
|
472
|
+
Loading user data
|
|
473
|
+
</wui-text>
|
|
474
|
+
<wui-text align="center" variant="sm-regular" color="secondary">
|
|
475
|
+
Please wait a moment while we load your data.
|
|
476
|
+
</wui-text>
|
|
477
|
+
</wui-flex>
|
|
478
|
+
</wui-flex>
|
|
479
|
+
`;
|
|
480
|
+
}
|
|
481
|
+
mobileTemplate() {
|
|
482
|
+
return c` <wui-flex
|
|
483
|
+
flexDirection="column"
|
|
484
|
+
alignItems="center"
|
|
485
|
+
.padding=${["10", "5", "5", "5"]}
|
|
486
|
+
gap="5"
|
|
487
|
+
>
|
|
488
|
+
<wui-flex justifyContent="center" alignItems="center">
|
|
489
|
+
<wui-logo logo="farcaster"></wui-logo>
|
|
490
|
+
${this.loaderTemplate()}
|
|
491
|
+
<wui-icon-box
|
|
492
|
+
color="error"
|
|
493
|
+
icon="close"
|
|
494
|
+
size="sm"
|
|
495
|
+
></wui-icon-box>
|
|
496
|
+
</wui-flex>
|
|
497
|
+
<wui-flex flexDirection="column" alignItems="center" gap="2">
|
|
498
|
+
<wui-text align="center" variant="md-medium" color="primary"
|
|
499
|
+
>Continue in Farcaster</span></wui-text
|
|
500
|
+
>
|
|
501
|
+
<wui-text align="center" variant="sm-regular" color="secondary"
|
|
502
|
+
>Accept connection request in the app</wui-text
|
|
503
|
+
></wui-flex
|
|
504
|
+
>
|
|
505
|
+
${this.mobileLinkTemplate()}
|
|
506
|
+
</wui-flex>`;
|
|
507
|
+
}
|
|
508
|
+
loaderTemplate() {
|
|
509
|
+
const e = x.state.themeVariables["--w3m-border-radius-master"], o = e ? parseInt(e.replace("px", ""), 10) : 4;
|
|
510
|
+
return c`<wui-loading-thumbnail radius=${o * 9}></wui-loading-thumbnail>`;
|
|
511
|
+
}
|
|
512
|
+
async connectFarcaster() {
|
|
513
|
+
var e, o;
|
|
514
|
+
if (this.authConnector)
|
|
515
|
+
try {
|
|
516
|
+
await ((e = this.authConnector) == null ? void 0 : e.provider.connectFarcaster()), this.socialProvider && (A.setConnectedSocialProvider(this.socialProvider), u.sendEvent({
|
|
517
|
+
type: "track",
|
|
518
|
+
event: "SOCIAL_LOGIN_REQUEST_USER_DATA",
|
|
519
|
+
properties: { provider: this.socialProvider }
|
|
520
|
+
})), this.loading = !0;
|
|
521
|
+
const n = P.getConnections(this.authConnector.chain).length > 0;
|
|
522
|
+
await P.connectExternal(this.authConnector, this.authConnector.chain);
|
|
523
|
+
const i = (o = this.remoteFeatures) == null ? void 0 : o.multiWallet;
|
|
524
|
+
this.socialProvider && u.sendEvent({
|
|
525
|
+
type: "track",
|
|
526
|
+
event: "SOCIAL_LOGIN_SUCCESS",
|
|
527
|
+
properties: { provider: this.socialProvider }
|
|
528
|
+
}), this.loading = !1, n && i ? (f.replace("ProfileWallets"), v.showSuccess("New Wallet Added")) : R.close();
|
|
529
|
+
} catch (r) {
|
|
530
|
+
this.socialProvider && u.sendEvent({
|
|
531
|
+
type: "track",
|
|
532
|
+
event: "SOCIAL_LOGIN_ERROR",
|
|
533
|
+
properties: { provider: this.socialProvider, message: C.parseError(r) }
|
|
534
|
+
}), f.goBack(), v.showError(r);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
mobileLinkTemplate() {
|
|
538
|
+
return c`<wui-button
|
|
539
|
+
size="md"
|
|
540
|
+
?loading=${this.loading}
|
|
541
|
+
?disabled=${!this.uri || this.loading}
|
|
542
|
+
@click=${() => {
|
|
543
|
+
this.uri && C.openHref(this.uri, "_blank");
|
|
544
|
+
}}
|
|
545
|
+
>
|
|
546
|
+
Open farcaster</wui-button
|
|
547
|
+
>`;
|
|
548
|
+
}
|
|
549
|
+
onRenderProxy() {
|
|
550
|
+
!this.ready && this.uri && (this.timeout = setTimeout(() => {
|
|
551
|
+
this.ready = !0;
|
|
552
|
+
}, 200));
|
|
553
|
+
}
|
|
554
|
+
qrCodeTemplate() {
|
|
555
|
+
if (!this.uri || !this.ready)
|
|
556
|
+
return null;
|
|
557
|
+
const e = this.getBoundingClientRect().width - 40, o = x.state.themeVariables["--apkt-qr-color"] ?? x.state.themeVariables["--w3m-qr-color"];
|
|
558
|
+
return c` <wui-qr-code
|
|
559
|
+
size=${e}
|
|
560
|
+
theme=${x.state.themeMode}
|
|
561
|
+
uri=${this.uri}
|
|
562
|
+
?farcaster=${!0}
|
|
563
|
+
data-testid="wui-qr-code"
|
|
564
|
+
color=${$(o)}
|
|
565
|
+
></wui-qr-code>`;
|
|
566
|
+
}
|
|
567
|
+
copyTemplate() {
|
|
568
|
+
const e = !this.uri || !this.ready;
|
|
569
|
+
return c`<wui-button
|
|
570
|
+
.disabled=${e}
|
|
571
|
+
@click=${this.onCopyUri}
|
|
572
|
+
variant="neutral-secondary"
|
|
573
|
+
size="sm"
|
|
574
|
+
data-testid="copy-wc2-uri"
|
|
575
|
+
>
|
|
576
|
+
<wui-icon size="sm" color="default" slot="iconRight" name="copy"></wui-icon>
|
|
577
|
+
Copy link
|
|
578
|
+
</wui-button>`;
|
|
579
|
+
}
|
|
580
|
+
onCopyUri() {
|
|
581
|
+
try {
|
|
582
|
+
this.uri && (C.copyToClopboard(this.uri), v.showSuccess("Link copied"));
|
|
583
|
+
} catch {
|
|
584
|
+
v.showError("Failed to copy");
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
w.styles = V;
|
|
589
|
+
y([
|
|
590
|
+
l()
|
|
591
|
+
], w.prototype, "socialProvider", void 0);
|
|
592
|
+
y([
|
|
593
|
+
l()
|
|
594
|
+
], w.prototype, "uri", void 0);
|
|
595
|
+
y([
|
|
596
|
+
l()
|
|
597
|
+
], w.prototype, "ready", void 0);
|
|
598
|
+
y([
|
|
599
|
+
l()
|
|
600
|
+
], w.prototype, "loading", void 0);
|
|
601
|
+
y([
|
|
602
|
+
l()
|
|
603
|
+
], w.prototype, "remoteFeatures", void 0);
|
|
604
|
+
w = y([
|
|
605
|
+
_("w3m-connecting-farcaster-view")
|
|
606
|
+
], w);
|
|
607
|
+
export {
|
|
608
|
+
L as W3mConnectSocialsView,
|
|
609
|
+
w as W3mConnectingFarcasterView,
|
|
610
|
+
m as W3mConnectingSocialView
|
|
611
|
+
};
|