@directcryptopay/sdk 0.1.0
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 +357 -0
- package/dist/ConstantsUtil-B-_-u8aQ.js +6 -0
- package/dist/add-KF4m4jFK.js +19 -0
- package/dist/all-wallets-D6NAjQgX.js +10 -0
- package/dist/app-store-D7TTn-EO.js +21 -0
- package/dist/apple-DjX2E2hE.js +22 -0
- package/dist/arrow-bottom-C0YrNJYB.js +12 -0
- package/dist/arrow-bottom-circle-Dlxvx_XG.js +15 -0
- package/dist/arrow-left-x8_-lUyK.js +12 -0
- package/dist/arrow-right-BTZybj80.js +12 -0
- package/dist/arrow-top-LzH7iLCp.js +12 -0
- package/dist/bank-23jp-IV_.js +18 -0
- package/dist/browser-EjoorDid.js +18 -0
- package/dist/card-DGgWwtwC.js +18 -0
- package/dist/ccip-BMANewTU.js +150 -0
- package/dist/checkmark-B1qcQhBo.js +15 -0
- package/dist/checkmark-bold-Cyc4IEEJ.js +12 -0
- package/dist/chevron-bottom-ClHs08rB.js +12 -0
- package/dist/chevron-left-O8h_551_.js +12 -0
- package/dist/chevron-right-DP3xpyIA.js +12 -0
- package/dist/chevron-top-CuwkBUs9.js +12 -0
- package/dist/chrome-store-zfT_aJ3R.js +65 -0
- package/dist/clock-DHZqivIS.js +12 -0
- package/dist/close-Cp9rNAw4.js +12 -0
- package/dist/coinPlaceholder-U7-T1KKQ.js +12 -0
- package/dist/compass-Ds5-PRSR.js +12 -0
- package/dist/copy-Jg4HdIMf.js +19 -0
- package/dist/core/api.d.ts +30 -0
- package/dist/core/config.d.ts +59 -0
- package/dist/core/logic.d.ts +2 -0
- package/dist/core/wallet.d.ts +34 -0
- package/dist/cursor-DmMevduB.js +7 -0
- package/dist/cursor-transparent-Dn9-1SV8.js +16 -0
- package/dist/dcp-sdk.umd.js +12000 -0
- package/dist/dcp.d.ts +10 -0
- package/dist/desktop-C4udXXlZ.js +13 -0
- package/dist/disconnect-wd1BYLxt.js +12 -0
- package/dist/discord-DthxuCAP.js +21 -0
- package/dist/email-B3jSnUFE.js +696 -0
- package/dist/embedded-wallet-CJHmoBI2.js +468 -0
- package/dist/etherscan-Cjp4xfMW.js +10 -0
- package/dist/exclamation-triangle-CRNR5WOy.js +8 -0
- package/dist/extension-Cydk0mZt.js +12 -0
- package/dist/external-link-CuPTAoq9.js +12 -0
- package/dist/facebook-CghqXmdf.js +30 -0
- package/dist/farcaster-BREqMX4y.js +16 -0
- package/dist/filters-Dn_Ys7ew.js +12 -0
- package/dist/github-C-A7JmIY.js +22 -0
- package/dist/google-CCdM_naE.js +22 -0
- package/dist/hashTypedData-D2Qmzscs.js +197 -0
- package/dist/help-circle-DIH4vyj3.js +16 -0
- package/dist/id-DkJ0gBuy.js +16 -0
- package/dist/if-defined-BciplFKz.js +744 -0
- package/dist/image-qMjyiXM0.js +8 -0
- package/dist/index--3Zp0jAb.js +45 -0
- package/dist/index-1adX-Fit.js +65 -0
- package/dist/index-AvC0IGDl.js +7864 -0
- package/dist/index-B2-vKLd8.js +276 -0
- package/dist/index-B2iDt0TJ.js +146 -0
- package/dist/index-B5zkXsLJ.js +320 -0
- package/dist/index-B7K86vWu.js +1742 -0
- package/dist/index-BBkcvSiY.js +511 -0
- package/dist/index-BdjxQs66.js +181 -0
- package/dist/index-Bijd4_Ns.js +294 -0
- package/dist/index-BpXOsxzU.js +387 -0
- package/dist/index-C1QEJL-2.js +572 -0
- package/dist/index-C27dwOyE.js +243 -0
- package/dist/index-C4BX3QW8.js +58 -0
- package/dist/index-CMPIqsB1.js +170 -0
- package/dist/index-CTYngdl0.js +21991 -0
- package/dist/index-CUdQyyFn.js +51 -0
- package/dist/index-CX60z_g2.js +573 -0
- package/dist/index-CppCc1n8.js +65 -0
- package/dist/index-CqVegmN4.js +559 -0
- package/dist/index-CuiyMA8F.js +78 -0
- package/dist/index-CwB_qRfM.js +305 -0
- package/dist/index-CxOF7GqE.js +265 -0
- package/dist/index-D-IzHD_8.js +54 -0
- package/dist/index-DRNiFv9I.js +218 -0
- package/dist/index-Da8oZh8H.js +838 -0
- package/dist/index-DiHImG4L.js +44236 -0
- package/dist/index-DmOMXRG1.js +181 -0
- package/dist/index-DoSYqTQg.js +199 -0
- package/dist/index-DpHXq5_E.js +603 -0
- package/dist/index-DtCsAVBg.js +78 -0
- package/dist/index-Ij6XA6_4.js +77 -0
- package/dist/index-SzyBYfzA.js +8490 -0
- package/dist/index-eW8y-mXH.js +257 -0
- package/dist/index-fxzIDZsb.js +75 -0
- package/dist/index-lbhz9evJ.js +97 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/info-DMIGgjkL.js +7 -0
- package/dist/info-circle-CJuIKZSx.js +16 -0
- package/dist/lightbulb-qFT6WEWV.js +7 -0
- package/dist/localBatchGatewayRequest-CsMVMFBc.js +91 -0
- package/dist/mail-DoYgQvOt.js +12 -0
- package/dist/mobile-URtsh7o-.js +13 -0
- package/dist/more-DoQd10TF.js +15 -0
- package/dist/network-placeholder-BBA2Ue6C.js +18 -0
- package/dist/nftPlaceholder-C9RXWz9k.js +12 -0
- package/dist/off-YcuDQczT.js +12 -0
- package/dist/onramp-BfqDIx4o.js +1279 -0
- package/dist/parseSignature-280HB24T.js +3560 -0
- package/dist/play-store-sFaloG_r.js +36 -0
- package/dist/plus-l0wekSht.js +17 -0
- package/dist/qr-code-CihrUU4G.js +10 -0
- package/dist/receive-dfY1Cu-g.js +186 -0
- package/dist/recycle-horizontal-nXu6YaPw.js +13 -0
- package/dist/ref-huAzXCX0.js +41 -0
- package/dist/refresh-D2ZbVeNC.js +12 -0
- package/dist/reown-logo-BMaTMJmc.js +16 -0
- package/dist/search-YVM9q3J-.js +12 -0
- package/dist/secp256k1-BrysY3Sv.js +1302 -0
- package/dist/secp256k1-DPQgTBwQ.js +1510 -0
- package/dist/send-BwQZPKxI.js +19 -0
- package/dist/send-GyetMVu1.js +1038 -0
- package/dist/socials-B0W91J9k.js +574 -0
- package/dist/swapHorizontal-Dy_oQEkp.js +12 -0
- package/dist/swapHorizontalBold-C4JpaMpc.js +12 -0
- package/dist/swapHorizontalMedium-D5NuVZFh.js +20 -0
- package/dist/swapHorizontalRoundedBold-Bq4P2MCj.js +12 -0
- package/dist/swapVertical-CVQ8Mg03.js +12 -0
- package/dist/swaps-CA04SSdK.js +1637 -0
- package/dist/telegram-BP4SgW_L.js +20 -0
- package/dist/three-dots-BJYGJ-dQ.js +9 -0
- package/dist/transactions-Bq-98Tsg.js +37 -0
- package/dist/twitch-DTATWo9M.js +22 -0
- package/dist/twitterIcon-D5UWPInb.js +10 -0
- package/dist/types.d.ts +128 -0
- package/dist/ui/Modal.d.ts +9 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/verify-Byvj8Wi1.js +12 -0
- package/dist/verify-filled-B40taNm0.js +12 -0
- package/dist/w3m-modal-HV6SE74G.js +1037 -0
- package/dist/wallet-Cp-6Kk88.js +12 -0
- package/dist/wallet-placeholder-C3juwA9o.js +18 -0
- package/dist/walletconnect-CRkIiLCx.js +36 -0
- package/dist/warning-circle-DtvCLwG4.js +16 -0
- package/dist/x-Cqyx5eCt.js +16 -0
- package/package.json +70 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { cS as g, cT as w, d3 as _, cE as p, d7 as v, cU as m, cY as c, d9 as E, d8 as $, cz as y, cC as b, cA as x, cB as h, cD as R } from "./index-DiHImG4L.js";
|
|
2
|
+
import { n as u, c as C, o as T } from "./if-defined-BciplFKz.js";
|
|
3
|
+
function U() {
|
|
4
|
+
try {
|
|
5
|
+
return c.returnOpenHref(`${$.SECURE_SITE_SDK_ORIGIN}/loading`, "popupWindow", "width=600,height=800,scrollbars=yes");
|
|
6
|
+
} catch {
|
|
7
|
+
throw new Error("Could not open social popup");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
async function O() {
|
|
11
|
+
p.push("ConnectingFarcaster");
|
|
12
|
+
const t = v.getAuthConnector();
|
|
13
|
+
if (t && !g.state.farcasterUrl)
|
|
14
|
+
try {
|
|
15
|
+
const { url: o } = await t.provider.getFarcasterUri();
|
|
16
|
+
g.setFarcasterUrl(o, w.state.activeChain);
|
|
17
|
+
} catch (o) {
|
|
18
|
+
p.goBack(), m.showError(o);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async function j(t) {
|
|
22
|
+
p.push("ConnectingSocial");
|
|
23
|
+
const o = v.getAuthConnector();
|
|
24
|
+
let e = null;
|
|
25
|
+
try {
|
|
26
|
+
const i = setTimeout(() => {
|
|
27
|
+
throw new Error("Social login timed out. Please try again.");
|
|
28
|
+
}, 45e3);
|
|
29
|
+
if (o && t) {
|
|
30
|
+
if (c.isTelegram() || (e = U()), e)
|
|
31
|
+
g.setSocialWindow(e, w.state.activeChain);
|
|
32
|
+
else if (!c.isTelegram())
|
|
33
|
+
throw new Error("Could not create social popup");
|
|
34
|
+
const { uri: n } = await o.provider.getSocialRedirectUri({
|
|
35
|
+
provider: t
|
|
36
|
+
});
|
|
37
|
+
if (!n)
|
|
38
|
+
throw e == null || e.close(), new Error("Could not fetch the social redirect uri");
|
|
39
|
+
if (e && (e.location.href = n), c.isTelegram()) {
|
|
40
|
+
E.setTelegramSocialProvider(t);
|
|
41
|
+
const r = c.formatTelegramSocialLoginUrl(n);
|
|
42
|
+
c.openHref(r, "_top");
|
|
43
|
+
}
|
|
44
|
+
clearTimeout(i);
|
|
45
|
+
}
|
|
46
|
+
} catch (i) {
|
|
47
|
+
e == null || e.close(), m.showError(i == null ? void 0 : i.message);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function P(t) {
|
|
51
|
+
g.setSocialProvider(t, w.state.activeChain), _.sendEvent({
|
|
52
|
+
type: "track",
|
|
53
|
+
event: "SOCIAL_LOGIN_STARTED",
|
|
54
|
+
properties: { provider: t }
|
|
55
|
+
}), t === "farcaster" ? await O() : await j(t);
|
|
56
|
+
}
|
|
57
|
+
const L = y`
|
|
58
|
+
:host {
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
align-items: center;
|
|
62
|
+
width: 40px;
|
|
63
|
+
height: 40px;
|
|
64
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
65
|
+
border: 1px solid var(--wui-color-gray-glass-005);
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
wui-icon {
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
74
|
+
var S = function(t, o, e, i) {
|
|
75
|
+
var n = arguments.length, r = n < 3 ? o : i === null ? i = Object.getOwnPropertyDescriptor(o, e) : i, a;
|
|
76
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, o, e, i);
|
|
77
|
+
else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (r = (n < 3 ? a(r) : n > 3 ? a(o, e, r) : a(o, e)) || r);
|
|
78
|
+
return n > 3 && r && Object.defineProperty(o, e, r), r;
|
|
79
|
+
};
|
|
80
|
+
let f = class extends x {
|
|
81
|
+
constructor() {
|
|
82
|
+
super(...arguments), this.logo = "google";
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
return h`<wui-icon color="inherit" size="inherit" name=${this.logo}></wui-icon> `;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
f.styles = [b, L];
|
|
89
|
+
S([
|
|
90
|
+
u()
|
|
91
|
+
], f.prototype, "logo", void 0);
|
|
92
|
+
f = S([
|
|
93
|
+
C("wui-logo")
|
|
94
|
+
], f);
|
|
95
|
+
const I = y`
|
|
96
|
+
button {
|
|
97
|
+
column-gap: var(--wui-spacing-s);
|
|
98
|
+
padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
|
|
99
|
+
width: 100%;
|
|
100
|
+
justify-content: flex-start;
|
|
101
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
102
|
+
border-radius: var(--wui-border-radius-xs);
|
|
103
|
+
color: var(--wui-color-fg-100);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
wui-text {
|
|
107
|
+
text-transform: capitalize;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
wui-text[data-align='left'] {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex: 1;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
wui-text[data-align='center'] {
|
|
116
|
+
display: flex;
|
|
117
|
+
flex: 1;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.invisible {
|
|
122
|
+
opacity: 0;
|
|
123
|
+
pointer-events: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
button:disabled {
|
|
127
|
+
background-color: var(--wui-color-gray-glass-015);
|
|
128
|
+
color: var(--wui-color-gray-glass-015);
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
var d = function(t, o, e, i) {
|
|
132
|
+
var n = arguments.length, r = n < 3 ? o : i === null ? i = Object.getOwnPropertyDescriptor(o, e) : i, a;
|
|
133
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(t, o, e, i);
|
|
134
|
+
else for (var s = t.length - 1; s >= 0; s--) (a = t[s]) && (r = (n < 3 ? a(r) : n > 3 ? a(o, e, r) : a(o, e)) || r);
|
|
135
|
+
return n > 3 && r && Object.defineProperty(o, e, r), r;
|
|
136
|
+
};
|
|
137
|
+
let l = class extends x {
|
|
138
|
+
constructor() {
|
|
139
|
+
super(...arguments), this.logo = "google", this.name = "Continue with google", this.align = "left", this.disabled = !1;
|
|
140
|
+
}
|
|
141
|
+
render() {
|
|
142
|
+
return h`
|
|
143
|
+
<button ?disabled=${this.disabled} tabindex=${T(this.tabIdx)}>
|
|
144
|
+
<wui-logo logo=${this.logo}></wui-logo>
|
|
145
|
+
<wui-text
|
|
146
|
+
data-align=${this.align}
|
|
147
|
+
variant="paragraph-500"
|
|
148
|
+
color="inherit"
|
|
149
|
+
align=${this.align}
|
|
150
|
+
>${this.name}</wui-text
|
|
151
|
+
>
|
|
152
|
+
${this.templatePlacement()}
|
|
153
|
+
</button>
|
|
154
|
+
`;
|
|
155
|
+
}
|
|
156
|
+
templatePlacement() {
|
|
157
|
+
return this.align === "center" ? h` <wui-logo class="invisible" logo=${this.logo}></wui-logo>` : null;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
l.styles = [b, R, I];
|
|
161
|
+
d([
|
|
162
|
+
u()
|
|
163
|
+
], l.prototype, "logo", void 0);
|
|
164
|
+
d([
|
|
165
|
+
u()
|
|
166
|
+
], l.prototype, "name", void 0);
|
|
167
|
+
d([
|
|
168
|
+
u()
|
|
169
|
+
], l.prototype, "align", void 0);
|
|
170
|
+
d([
|
|
171
|
+
u()
|
|
172
|
+
], l.prototype, "tabIdx", void 0);
|
|
173
|
+
d([
|
|
174
|
+
u({ type: Boolean })
|
|
175
|
+
], l.prototype, "disabled", void 0);
|
|
176
|
+
l = d([
|
|
177
|
+
C("wui-list-social")
|
|
178
|
+
], l);
|
|
179
|
+
export {
|
|
180
|
+
P as e
|
|
181
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { cz as h, cC as p, cD as w, cA as x, cB as m } from "./index-DiHImG4L.js";
|
|
2
|
+
import { n as t, c as g, U as f } from "./if-defined-BciplFKz.js";
|
|
3
|
+
import "./index-CUdQyyFn.js";
|
|
4
|
+
const b = h`
|
|
5
|
+
button {
|
|
6
|
+
padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs);
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
width: 100%;
|
|
10
|
+
border-radius: var(--wui-border-radius-xs);
|
|
11
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
button[data-clickable='false'] {
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
wui-image,
|
|
20
|
+
wui-icon {
|
|
21
|
+
width: var(--wui-spacing-3xl);
|
|
22
|
+
height: var(--wui-spacing-3xl);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
wui-image {
|
|
26
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
var u = function(a, o, r, i) {
|
|
30
|
+
var l = arguments.length, e = l < 3 ? o : i === null ? i = Object.getOwnPropertyDescriptor(o, r) : i, c;
|
|
31
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") e = Reflect.decorate(a, o, r, i);
|
|
32
|
+
else for (var s = a.length - 1; s >= 0; s--) (c = a[s]) && (e = (l < 3 ? c(e) : l > 3 ? c(o, r, e) : c(o, r)) || e);
|
|
33
|
+
return l > 3 && e && Object.defineProperty(o, r, e), e;
|
|
34
|
+
};
|
|
35
|
+
let n = class extends x {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments), this.tokenName = "", this.tokenImageUrl = "", this.tokenValue = 0, this.tokenAmount = "0.0", this.tokenCurrency = "", this.clickable = !1;
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
return m`
|
|
41
|
+
<button data-clickable=${String(this.clickable)}>
|
|
42
|
+
<wui-flex gap="s" alignItems="center">
|
|
43
|
+
${this.visualTemplate()}
|
|
44
|
+
<wui-flex flexDirection="column" justifyContent="spaceBetween">
|
|
45
|
+
<wui-text variant="paragraph-500" color="fg-100">${this.tokenName}</wui-text>
|
|
46
|
+
<wui-text variant="small-400" color="fg-200">
|
|
47
|
+
${f.formatNumberToLocalString(this.tokenAmount, 4)} ${this.tokenCurrency}
|
|
48
|
+
</wui-text>
|
|
49
|
+
</wui-flex>
|
|
50
|
+
</wui-flex>
|
|
51
|
+
<wui-text variant="paragraph-500" color="fg-100">$${this.tokenValue.toFixed(2)}</wui-text>
|
|
52
|
+
</button>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
visualTemplate() {
|
|
56
|
+
return this.tokenName && this.tokenImageUrl ? m`<wui-image alt=${this.tokenName} src=${this.tokenImageUrl}></wui-image>` : m`<wui-icon name="coinPlaceholder" color="fg-100"></wui-icon>`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
n.styles = [p, w, b];
|
|
60
|
+
u([
|
|
61
|
+
t()
|
|
62
|
+
], n.prototype, "tokenName", void 0);
|
|
63
|
+
u([
|
|
64
|
+
t()
|
|
65
|
+
], n.prototype, "tokenImageUrl", void 0);
|
|
66
|
+
u([
|
|
67
|
+
t({ type: Number })
|
|
68
|
+
], n.prototype, "tokenValue", void 0);
|
|
69
|
+
u([
|
|
70
|
+
t()
|
|
71
|
+
], n.prototype, "tokenAmount", void 0);
|
|
72
|
+
u([
|
|
73
|
+
t()
|
|
74
|
+
], n.prototype, "tokenCurrency", void 0);
|
|
75
|
+
u([
|
|
76
|
+
t({ type: Boolean })
|
|
77
|
+
], n.prototype, "clickable", void 0);
|
|
78
|
+
n = u([
|
|
79
|
+
g("wui-list-token")
|
|
80
|
+
], n);
|
|
81
|
+
const y = h`
|
|
82
|
+
:host {
|
|
83
|
+
display: block;
|
|
84
|
+
width: var(--local-width);
|
|
85
|
+
height: var(--local-height);
|
|
86
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
87
|
+
box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005);
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
position: relative;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([data-variant='generated']) {
|
|
93
|
+
--mixed-local-color-1: var(--local-color-1);
|
|
94
|
+
--mixed-local-color-2: var(--local-color-2);
|
|
95
|
+
--mixed-local-color-3: var(--local-color-3);
|
|
96
|
+
--mixed-local-color-4: var(--local-color-4);
|
|
97
|
+
--mixed-local-color-5: var(--local-color-5);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@supports (background: color-mix(in srgb, white 50%, black)) {
|
|
101
|
+
:host([data-variant='generated']) {
|
|
102
|
+
--mixed-local-color-1: color-mix(
|
|
103
|
+
in srgb,
|
|
104
|
+
var(--w3m-color-mix) var(--w3m-color-mix-strength),
|
|
105
|
+
var(--local-color-1)
|
|
106
|
+
);
|
|
107
|
+
--mixed-local-color-2: color-mix(
|
|
108
|
+
in srgb,
|
|
109
|
+
var(--w3m-color-mix) var(--w3m-color-mix-strength),
|
|
110
|
+
var(--local-color-2)
|
|
111
|
+
);
|
|
112
|
+
--mixed-local-color-3: color-mix(
|
|
113
|
+
in srgb,
|
|
114
|
+
var(--w3m-color-mix) var(--w3m-color-mix-strength),
|
|
115
|
+
var(--local-color-3)
|
|
116
|
+
);
|
|
117
|
+
--mixed-local-color-4: color-mix(
|
|
118
|
+
in srgb,
|
|
119
|
+
var(--w3m-color-mix) var(--w3m-color-mix-strength),
|
|
120
|
+
var(--local-color-4)
|
|
121
|
+
);
|
|
122
|
+
--mixed-local-color-5: color-mix(
|
|
123
|
+
in srgb,
|
|
124
|
+
var(--w3m-color-mix) var(--w3m-color-mix-strength),
|
|
125
|
+
var(--local-color-5)
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
:host([data-variant='generated']) {
|
|
131
|
+
box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005);
|
|
132
|
+
background: radial-gradient(
|
|
133
|
+
var(--local-radial-circle),
|
|
134
|
+
#fff 0.52%,
|
|
135
|
+
var(--mixed-local-color-5) 31.25%,
|
|
136
|
+
var(--mixed-local-color-3) 51.56%,
|
|
137
|
+
var(--mixed-local-color-2) 65.63%,
|
|
138
|
+
var(--mixed-local-color-1) 82.29%,
|
|
139
|
+
var(--mixed-local-color-4) 100%
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host([data-variant='default']) {
|
|
144
|
+
box-shadow: 0 0 0 8px var(--wui-color-gray-glass-005);
|
|
145
|
+
background: radial-gradient(
|
|
146
|
+
75.29% 75.29% at 64.96% 24.36%,
|
|
147
|
+
#fff 0.52%,
|
|
148
|
+
#f5ccfc 31.25%,
|
|
149
|
+
#dba4f5 51.56%,
|
|
150
|
+
#9a8ee8 65.63%,
|
|
151
|
+
#6493da 82.29%,
|
|
152
|
+
#6ebdea 100%
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
`;
|
|
156
|
+
var v = function(a, o, r, i) {
|
|
157
|
+
var l = arguments.length, e = l < 3 ? o : i === null ? i = Object.getOwnPropertyDescriptor(o, r) : i, c;
|
|
158
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") e = Reflect.decorate(a, o, r, i);
|
|
159
|
+
else for (var s = a.length - 1; s >= 0; s--) (c = a[s]) && (e = (l < 3 ? c(e) : l > 3 ? c(o, r, e) : c(o, r)) || e);
|
|
160
|
+
return l > 3 && e && Object.defineProperty(o, r, e), e;
|
|
161
|
+
};
|
|
162
|
+
let d = class extends x {
|
|
163
|
+
constructor() {
|
|
164
|
+
super(...arguments), this.imageSrc = void 0, this.alt = void 0, this.address = void 0, this.size = "xl";
|
|
165
|
+
}
|
|
166
|
+
render() {
|
|
167
|
+
return this.style.cssText = `
|
|
168
|
+
--local-width: var(--wui-icon-box-size-${this.size});
|
|
169
|
+
--local-height: var(--wui-icon-box-size-${this.size});
|
|
170
|
+
`, m`${this.visualTemplate()}`;
|
|
171
|
+
}
|
|
172
|
+
visualTemplate() {
|
|
173
|
+
if (this.imageSrc)
|
|
174
|
+
return this.dataset.variant = "image", m`<wui-image src=${this.imageSrc} alt=${this.alt ?? "avatar"}></wui-image>`;
|
|
175
|
+
if (this.address) {
|
|
176
|
+
this.dataset.variant = "generated";
|
|
177
|
+
const o = f.generateAvatarColors(this.address);
|
|
178
|
+
return this.style.cssText += `
|
|
179
|
+
${o}`, null;
|
|
180
|
+
}
|
|
181
|
+
return this.dataset.variant = "default", null;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
d.styles = [p, y];
|
|
185
|
+
v([
|
|
186
|
+
t()
|
|
187
|
+
], d.prototype, "imageSrc", void 0);
|
|
188
|
+
v([
|
|
189
|
+
t()
|
|
190
|
+
], d.prototype, "alt", void 0);
|
|
191
|
+
v([
|
|
192
|
+
t()
|
|
193
|
+
], d.prototype, "address", void 0);
|
|
194
|
+
v([
|
|
195
|
+
t()
|
|
196
|
+
], d.prototype, "size", void 0);
|
|
197
|
+
d = v([
|
|
198
|
+
g("wui-avatar")
|
|
199
|
+
], d);
|