@dcl/governance-site 2.0.0 → 2.0.1-20995780683.commit-d6baf5e

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.
Files changed (77) hide show
  1. package/assets/BlockOverrides-9837a6f9.js +5 -0
  2. package/assets/ConstantsUtil-298f7898.js +1 -0
  3. package/assets/ExchangeController-d2354ec6.js +1 -0
  4. package/assets/HelpersUtil-8cddb046.js +62 -0
  5. package/assets/MathUtil-b514a570.js +1 -0
  6. package/assets/NavigationUtil-a0d0ce87.js +1 -0
  7. package/assets/NetworkUtil-220ea128.js +1 -0
  8. package/assets/PhWallet-fd2006d2.js +14 -0
  9. package/assets/{features-b72c9430.js → ReownAuthentication-468828df.js} +4 -4
  10. package/assets/SwapController-7bfd6ce7.js +1 -0
  11. package/assets/{UserAvatar-78751cb5.js → UserAvatar-456716f1.js} +1 -1
  12. package/assets/ccip-ddcec720.js +1 -0
  13. package/assets/data-capture-3e424a2c.js +242 -0
  14. package/assets/email-ea617f9c.js +90 -0
  15. package/assets/embedded-wallet-814bf005.js +410 -0
  16. package/assets/features-fd521597.js +1 -0
  17. package/assets/fortmatic-f3cb4aa6.js +13 -0
  18. package/assets/if-defined-0a35f675.js +5 -0
  19. package/assets/index-034d22a0.js +138 -0
  20. package/assets/{index-a8255d1c.css → index-05771666.css} +4 -4
  21. package/assets/index-07a61b45.js +51 -0
  22. package/assets/index-1039ded0.js +132 -0
  23. package/assets/index-123c1362.js +224 -0
  24. package/assets/index-15bbaaa0.js +7 -0
  25. package/assets/{index-073512a1.js → index-206e3e77.js} +1 -1
  26. package/assets/index-27a991e4.js +53 -0
  27. package/assets/index-2d0efdd2.js +210 -0
  28. package/assets/index-32d53c87.js +189 -0
  29. package/assets/index-3b861a37.js +102 -0
  30. package/assets/index-4207595b.js +100 -0
  31. package/assets/index-4243d275.js +43 -0
  32. package/assets/index-42ce7246.js +63 -0
  33. package/assets/index-47e87339.js +152 -0
  34. package/assets/index-48bd3fca.js +277 -0
  35. package/assets/index-49cc5044.js +46 -0
  36. package/assets/index-5788a0d6.js +468 -0
  37. package/assets/index-5824c226.js +81 -0
  38. package/assets/index-5da565ce.js +78 -0
  39. package/assets/index-685e7949.js +425 -0
  40. package/assets/index-84e8ecf6.js +647 -0
  41. package/assets/index-965fdf98.js +3425 -0
  42. package/assets/index-9d970383.js +152 -0
  43. package/assets/index-a59b6662.js +68 -0
  44. package/assets/index-b457d047.js +1062 -0
  45. package/assets/index-b65e06cc.js +27 -0
  46. package/assets/{index-2ef9f1d1.js → index-d70e4ab8.js} +66 -66
  47. package/assets/index-d7a6ceea.js +30 -0
  48. package/assets/index-d9c55c27.js +77 -0
  49. package/assets/index-db5b7889.js +77 -0
  50. package/assets/index-e3222791.js +78 -0
  51. package/assets/index-eb060c20.js +1 -0
  52. package/assets/index-f3f03959.js +90 -0
  53. package/assets/index-fcda68c9.js +19 -0
  54. package/assets/index-ff4dea43.js +85 -0
  55. package/assets/networks-14f3c0d2.js +1 -0
  56. package/assets/onramp-dcdb1a34.js +422 -0
  57. package/assets/pay-with-exchange-a64f18a3.js +280 -0
  58. package/assets/receive-ca7bc867.js +131 -0
  59. package/assets/ref-88e1be05.js +13 -0
  60. package/assets/send-8739c9fb.js +554 -0
  61. package/assets/socials-ccc593f5.js +250 -0
  62. package/assets/swaps-0a90eb06.js +1050 -0
  63. package/assets/transactions-bb8cb277.js +16 -0
  64. package/assets/{tslib.es6-82b9ba96.js → tslib.es6-db2ec995.js} +2 -2
  65. package/assets/w3m-modal-869dafbc.js +891 -0
  66. package/assets/zoraTestnet-adc7b76b.js +36 -0
  67. package/index.html +4 -4
  68. package/package.json +3 -3
  69. package/assets/basic-ca749c4c.js +0 -1435
  70. package/assets/core-806d78ea.js +0 -249
  71. package/assets/fortmatic-12e0f2e5.js +0 -13
  72. package/assets/index-372705ba.js +0 -1321
  73. package/assets/index-4be588a0.js +0 -94
  74. package/assets/index-74e34dfb.js +0 -39
  75. package/assets/index-bbb36593.js +0 -7
  76. package/assets/index-c1c8440f.js +0 -47
  77. package/assets/w3m-modal-26eff9d9.js +0 -1209
@@ -0,0 +1,410 @@
1
+ import{n as H,l as f,M as W,O as K,m as c,o as _,T as j,V as G,j as E,r as z,k as B,c as N,C as m,X as V,y as T,W as h,x as L,Y as X,Z as v,h as k,E as O,S as q,R as Z}from"./index-48bd3fca.js";import{r as u,c as w,n as l}from"./index-84e8ecf6.js";import"./index-42ce7246.js";import{C as D}from"./NetworkUtil-220ea128.js";import{e as Q,n as J}from"./ref-88e1be05.js";import"./index-07a61b45.js";import{H as I}from"./HelpersUtil-8cddb046.js";import{o as ee}from"./if-defined-0a35f675.js";import"./index-9d970383.js";import"./index-d9c55c27.js";import"./index-47e87339.js";import"./index-ff4dea43.js";import"./index-a59b6662.js";import{N as te}from"./NavigationUtil-a0d0ce87.js";import"./index-d70e4ab8.js";import"./BlockOverrides-9837a6f9.js";import"./index-4243d275.js";import"./ConstantsUtil-298f7898.js";const ie=H`
2
+ div {
3
+ width: 100%;
4
+ }
5
+
6
+ [data-ready='false'] {
7
+ transform: scale(1.05);
8
+ }
9
+
10
+ @media (max-width: 430px) {
11
+ [data-ready='false'] {
12
+ transform: translateY(-50px);
13
+ }
14
+ }
15
+ `;var F=globalThis&&globalThis.__decorate||function(e,t,i,r){var n=arguments.length,o=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o};const P=600,M=360,oe=64;let R=class extends f{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(W.subscribeKey("open",t=>{t||this.onHideIframe()}),W.subscribeKey("shake",t=>{t?this.iframe.style.animation="w3m-shake 500ms var(--apkt-easings-ease-out-power-2)":this.iframe.style.animation="none"}))}disconnectedCallback(){var t;this.onHideIframe(),this.unsubscribe.forEach(i=>i()),(t=this.bodyObserver)==null||t.unobserve(window.document.body)}async firstUpdated(){var i;await this.syncTheme(),this.iframe.style.display="block";const t=(i=this==null?void 0:this.renderRoot)==null?void 0:i.querySelector("div");this.bodyObserver=new ResizeObserver(r=>{var s,a;const n=(s=r==null?void 0:r[0])==null?void 0:s.contentBoxSize,o=(a=n==null?void 0:n[0])==null?void 0:a.inlineSize;this.iframe.style.height=`${P}px`,t.style.height=`${P}px`,K.state.enableEmbedded?this.updateFrameSizeForEmbeddedMode():o&&o<=430?(this.iframe.style.width="100%",this.iframe.style.left="0px",this.iframe.style.bottom="0px",this.iframe.style.top="unset",this.onShowIframe()):(this.iframe.style.width=`${M}px`,this.iframe.style.left=`calc(50% - ${M/2}px)`,this.iframe.style.top=`calc(50% - ${P/2}px + ${oe/2}px)`,this.iframe.style.bottom="unset",this.onShowIframe())}),this.bodyObserver.observe(window.document.body)}render(){return c`<div data-ready=${this.ready} id="w3m-frame-container"></div>`}onShowIframe(){const t=window.innerWidth<=430;this.ready=!0,this.iframe.style.animation=t?"w3m-iframe-zoom-in-mobile 200ms var(--apkt-easings-ease-out-power-2)":"w3m-iframe-zoom-in 200ms var(--apkt-easings-ease-out-power-2)"}onHideIframe(){this.iframe.style.display="none",this.iframe.style.animation="w3m-iframe-fade-out 200ms var(--apkt-easings-ease-out-power-2)"}async syncTheme(){const t=_.getAuthConnector();if(t){const i=j.getSnapshot().themeMode,r=j.getSnapshot().themeVariables;await t.provider.syncTheme({themeVariables:r,w3mThemeVariables:G(r,i)})}}async updateFrameSizeForEmbeddedMode(){var r;const t=(r=this==null?void 0:this.renderRoot)==null?void 0:r.querySelector("div");await new Promise(n=>{setTimeout(n,300)});const i=this.getBoundingClientRect();t.style.width="100%",this.iframe.style.left=`${i.left}px`,this.iframe.style.top=`${i.top}px`,this.iframe.style.width=`${i.width}px`,this.iframe.style.height=`${i.height}px`,this.onShowIframe()}};R.styles=ie;F([u()],R.prototype,"ready",void 0);R=F([w("w3m-approve-transaction-view")],R);const re=E`
16
+ a {
17
+ border: none;
18
+ border-radius: ${({borderRadius:e})=>e[20]};
19
+ display: flex;
20
+ flex-direction: row;
21
+ align-items: center;
22
+ padding: ${({spacing:e})=>e[1]};
23
+ transition:
24
+ background-color ${({durations:e})=>e.lg}
25
+ ${({easings:e})=>e["ease-out-power-2"]},
26
+ box-shadow ${({durations:e})=>e.lg}
27
+ ${({easings:e})=>e["ease-out-power-2"]},
28
+ border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
29
+ will-change: background-color, box-shadow, border;
30
+ }
31
+
32
+ /* -- Variants --------------------------------------------------------------- */
33
+ a[data-type='success'] {
34
+ background-color: ${({tokens:e})=>e.core.backgroundSuccess};
35
+ color: ${({tokens:e})=>e.core.textSuccess};
36
+ }
37
+
38
+ a[data-type='error'] {
39
+ background-color: ${({tokens:e})=>e.core.backgroundError};
40
+ color: ${({tokens:e})=>e.core.textError};
41
+ }
42
+
43
+ a[data-type='warning'] {
44
+ background-color: ${({tokens:e})=>e.core.backgroundWarning};
45
+ color: ${({tokens:e})=>e.core.textWarning};
46
+ }
47
+
48
+ /* -- Sizes --------------------------------------------------------------- */
49
+ a[data-size='sm'] {
50
+ height: 24px;
51
+ }
52
+
53
+ a[data-size='md'] {
54
+ height: 28px;
55
+ }
56
+
57
+ a[data-size='lg'] {
58
+ height: 32px;
59
+ }
60
+
61
+ a[data-size='sm'] > wui-image,
62
+ a[data-size='sm'] > wui-icon {
63
+ width: 16px;
64
+ height: 16px;
65
+ }
66
+
67
+ a[data-size='md'] > wui-image,
68
+ a[data-size='md'] > wui-icon {
69
+ width: 20px;
70
+ height: 20px;
71
+ }
72
+
73
+ a[data-size='lg'] > wui-image,
74
+ a[data-size='lg'] > wui-icon {
75
+ width: 24px;
76
+ height: 24px;
77
+ }
78
+
79
+ wui-text {
80
+ padding-left: ${({spacing:e})=>e[1]};
81
+ padding-right: ${({spacing:e})=>e[1]};
82
+ }
83
+
84
+ wui-image {
85
+ border-radius: ${({borderRadius:e})=>e[3]};
86
+ overflow: hidden;
87
+ user-drag: none;
88
+ user-select: none;
89
+ -moz-user-select: none;
90
+ -webkit-user-drag: none;
91
+ -webkit-user-select: none;
92
+ -ms-user-select: none;
93
+ }
94
+
95
+ /* -- States --------------------------------------------------------------- */
96
+ @media (hover: hover) and (pointer: fine) {
97
+ a[data-type='success']:not(:disabled):hover {
98
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
99
+ box-shadow: 0px 0px 0px 1px ${({tokens:e})=>e.core.borderSuccess};
100
+ }
101
+
102
+ a[data-type='error']:not(:disabled):hover {
103
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
104
+ box-shadow: 0px 0px 0px 1px ${({tokens:e})=>e.core.borderError};
105
+ }
106
+
107
+ a[data-type='warning']:not(:disabled):hover {
108
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
109
+ box-shadow: 0px 0px 0px 1px ${({tokens:e})=>e.core.borderWarning};
110
+ }
111
+ }
112
+
113
+ a[data-type='success']:not(:disabled):focus-visible {
114
+ box-shadow:
115
+ 0px 0px 0px 1px ${({tokens:e})=>e.core.backgroundAccentPrimary},
116
+ 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent020};
117
+ }
118
+
119
+ a[data-type='error']:not(:disabled):focus-visible {
120
+ box-shadow:
121
+ 0px 0px 0px 1px ${({tokens:e})=>e.core.backgroundAccentPrimary},
122
+ 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent020};
123
+ }
124
+
125
+ a[data-type='warning']:not(:disabled):focus-visible {
126
+ box-shadow:
127
+ 0px 0px 0px 1px ${({tokens:e})=>e.core.backgroundAccentPrimary},
128
+ 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent020};
129
+ }
130
+
131
+ a:disabled {
132
+ opacity: 0.5;
133
+ }
134
+ `;var y=globalThis&&globalThis.__decorate||function(e,t,i,r){var n=arguments.length,o=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o};const ne={sm:"md-regular",md:"lg-regular",lg:"lg-regular"},se={success:"sealCheck",error:"warning",warning:"exclamationCircle"};let d=class extends f{constructor(){super(...arguments),this.type="success",this.size="md",this.imageSrc=void 0,this.disabled=!1,this.href="",this.text=void 0}render(){return c`
135
+ <a
136
+ rel="noreferrer"
137
+ target="_blank"
138
+ href=${this.href}
139
+ class=${this.disabled?"disabled":""}
140
+ data-type=${this.type}
141
+ data-size=${this.size}
142
+ >
143
+ ${this.imageTemplate()}
144
+ <wui-text variant=${ne[this.size]} color="inherit">${this.text}</wui-text>
145
+ </a>
146
+ `}imageTemplate(){return this.imageSrc?c`<wui-image src=${this.imageSrc} size="inherit"></wui-image>`:c`<wui-icon
147
+ name=${se[this.type]}
148
+ weight="fill"
149
+ color="inherit"
150
+ size="inherit"
151
+ class="image-icon"
152
+ ></wui-icon>`}};d.styles=[z,B,re];y([l()],d.prototype,"type",void 0);y([l()],d.prototype,"size",void 0);y([l()],d.prototype,"imageSrc",void 0);y([l({type:Boolean})],d.prototype,"disabled",void 0);y([l()],d.prototype,"href",void 0);y([l()],d.prototype,"text",void 0);d=y([w("wui-semantic-chip")],d);var ae=globalThis&&globalThis.__decorate||function(e,t,i,r){var n=arguments.length,o=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o};let Y=class extends f{render(){return c`
153
+ <wui-flex flexDirection="column" alignItems="center" gap="5" padding="5">
154
+ <wui-text variant="md-regular" color="primary">Follow the instructions on</wui-text>
155
+ <wui-semantic-chip
156
+ icon="externalLink"
157
+ variant="fill"
158
+ text=${N.SECURE_SITE_DASHBOARD}
159
+ href=${N.SECURE_SITE_DASHBOARD}
160
+ imageSrc=${N.SECURE_SITE_FAVICON}
161
+ data-testid="w3m-secure-website-button"
162
+ >
163
+ </wui-semantic-chip>
164
+ <wui-text variant="sm-regular" color="secondary">
165
+ You will have to reconnect for security reasons
166
+ </wui-text>
167
+ </wui-flex>
168
+ `}};Y=ae([w("w3m-upgrade-wallet-view")],Y);var C=globalThis&&globalThis.__decorate||function(e,t,i,r){var n=arguments.length,o=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o};let $=class extends f{constructor(){super(...arguments),this.loading=!1,this.switched=!1,this.text="",this.network=m.state.activeCaipNetwork}render(){return c`
169
+ <wui-flex flexDirection="column" gap="2" .padding=${["6","4","3","4"]}>
170
+ ${this.togglePreferredAccountTypeTemplate()} ${this.toggleSmartAccountVersionTemplate()}
171
+ </wui-flex>
172
+ `}toggleSmartAccountVersionTemplate(){return c`
173
+ <w3m-tooltip-trigger text="Changing the smart account version will reload the page">
174
+ <wui-list-item
175
+ icon=${this.isV6()?"arrowTop":"arrowBottom"}
176
+ ?rounded=${!0}
177
+ ?chevron=${!0}
178
+ data-testid="account-toggle-smart-account-version"
179
+ @click=${this.toggleSmartAccountVersion.bind(this)}
180
+ >
181
+ <wui-text variant="lg-regular" color="primary"
182
+ >Force Smart Account Version ${this.isV6()?"7":"6"}</wui-text
183
+ >
184
+ </wui-list-item>
185
+ </w3m-tooltip-trigger>
186
+ `}isV6(){return(V.get("dapp_smart_account_version")||"v6")==="v6"}toggleSmartAccountVersion(){var t;V.set("dapp_smart_account_version",this.isV6()?"v7":"v6"),typeof window<"u"&&((t=window==null?void 0:window.location)==null||t.reload())}togglePreferredAccountTypeTemplate(){var o;const t=(o=this.network)==null?void 0:o.chainNamespace,i=m.checkIfSmartAccountEnabled(),r=_.getConnectorId(t);return!_.getAuthConnector()||r!==D.CONNECTOR_ID.AUTH||!i?null:(this.switched||(this.text=T(t)===h.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your Smart Account"),c`
187
+ <wui-list-item
188
+ icon="swapHorizontal"
189
+ ?rounded=${!0}
190
+ ?chevron=${!0}
191
+ ?loading=${this.loading}
192
+ @click=${this.changePreferredAccountType.bind(this)}
193
+ data-testid="account-toggle-preferred-account-type"
194
+ >
195
+ <wui-text variant="lg-regular" color="primary">${this.text}</wui-text>
196
+ </wui-list-item>
197
+ `)}async changePreferredAccountType(){var o;const t=(o=this.network)==null?void 0:o.chainNamespace,i=m.checkIfSmartAccountEnabled(),r=T(t)===h.ACCOUNT_TYPES.SMART_ACCOUNT||!i?h.ACCOUNT_TYPES.EOA:h.ACCOUNT_TYPES.SMART_ACCOUNT;_.getAuthConnector()&&(this.loading=!0,await L.setPreferredAccountType(r,t),this.text=r===h.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your Smart Account",this.switched=!0,X.resetSend(),this.loading=!1,this.requestUpdate())}};C([u()],$.prototype,"loading",void 0);C([u()],$.prototype,"switched",void 0);C([u()],$.prototype,"text",void 0);C([u()],$.prototype,"network",void 0);$=C([w("w3m-smart-account-settings-view")],$);const ce=E`
198
+ :host {
199
+ width: 100%;
200
+ }
201
+
202
+ button {
203
+ width: 100%;
204
+ display: flex;
205
+ justify-content: space-between;
206
+ align-items: center;
207
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
208
+ border-radius: ${({borderRadius:e})=>e[4]};
209
+ padding: ${({spacing:e})=>e[4]};
210
+ }
211
+
212
+ .name {
213
+ max-width: 75%;
214
+ overflow: hidden;
215
+ text-overflow: ellipsis;
216
+ white-space: nowrap;
217
+ }
218
+
219
+ @media (hover: hover) and (pointer: fine) {
220
+ button:hover:enabled {
221
+ cursor: pointer;
222
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
223
+ border-radius: ${({borderRadius:e})=>e[6]};
224
+ }
225
+ }
226
+
227
+ button:disabled {
228
+ opacity: 0.5;
229
+ cursor: default;
230
+ }
231
+
232
+ button:focus-visible:enabled {
233
+ box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
234
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
235
+ }
236
+ `;var A=globalThis&&globalThis.__decorate||function(e,t,i,r){var n=arguments.length,o=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o};let b=class extends f{constructor(){super(...arguments),this.name="",this.registered=!1,this.loading=!1,this.disabled=!1}render(){return c`
237
+ <button ?disabled=${this.disabled}>
238
+ <wui-text class="name" color="primary" variant="md-regular">${this.name}</wui-text>
239
+ ${this.templateRightContent()}
240
+ </button>
241
+ `}templateRightContent(){return this.loading?c`<wui-loading-spinner size="lg" color="primary"></wui-loading-spinner>`:this.registered?c`<wui-tag variant="info" size="sm">Registered</wui-tag>`:c`<wui-tag variant="success" size="sm">Available</wui-tag>`}};b.styles=[z,B,ce];A([l()],b.prototype,"name",void 0);A([l({type:Boolean})],b.prototype,"registered",void 0);A([l({type:Boolean})],b.prototype,"loading",void 0);A([l({type:Boolean})],b.prototype,"disabled",void 0);b=A([w("wui-account-name-suggestion-item")],b);const le=E`
242
+ :host {
243
+ position: relative;
244
+ width: 100%;
245
+ display: inline-block;
246
+ }
247
+
248
+ :host([disabled]) {
249
+ opacity: 0.5;
250
+ cursor: not-allowed;
251
+ }
252
+
253
+ .base-name {
254
+ position: absolute;
255
+ right: ${({spacing:e})=>e[4]};
256
+ top: 50%;
257
+ transform: translateY(-50%);
258
+ text-align: right;
259
+ padding: ${({spacing:e})=>e[1]};
260
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
261
+ border-radius: ${({borderRadius:e})=>e[1]};
262
+ }
263
+ `;var S=globalThis&&globalThis.__decorate||function(e,t,i,r){var n=arguments.length,o=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o};let g=class extends f{constructor(){super(...arguments),this.disabled=!1,this.loading=!1}render(){return c`
264
+ <wui-input-text
265
+ value=${ee(this.value)}
266
+ ?disabled=${this.disabled}
267
+ .value=${this.value||""}
268
+ data-testid="wui-ens-input"
269
+ icon="search"
270
+ inputRightPadding="5xl"
271
+ .onKeyDown=${this.onKeyDown}
272
+ ></wui-input-text>
273
+ `}};g.styles=[z,le];S([l()],g.prototype,"errorMessage",void 0);S([l({type:Boolean})],g.prototype,"disabled",void 0);S([l()],g.prototype,"value",void 0);S([l({type:Boolean})],g.prototype,"loading",void 0);S([l({attribute:!1})],g.prototype,"onKeyDown",void 0);g=S([w("wui-ens-input")],g);const ue=E`
274
+ wui-flex {
275
+ width: 100%;
276
+ }
277
+
278
+ .suggestion {
279
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
280
+ border-radius: ${({borderRadius:e})=>e[4]};
281
+ }
282
+
283
+ .suggestion:hover:not(:disabled) {
284
+ cursor: pointer;
285
+ border: none;
286
+ width: 100%;
287
+ display: flex;
288
+ justify-content: space-between;
289
+ align-items: center;
290
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
291
+ border-radius: ${({borderRadius:e})=>e[6]};
292
+ padding: ${({spacing:e})=>e[4]};
293
+ }
294
+
295
+ .suggestion:disabled {
296
+ opacity: 0.5;
297
+ cursor: default;
298
+ }
299
+
300
+ .suggestion:focus-visible:not(:disabled) {
301
+ box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
302
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
303
+ }
304
+
305
+ .suggested-name {
306
+ max-width: 75%;
307
+ overflow: hidden;
308
+ text-overflow: ellipsis;
309
+ white-space: nowrap;
310
+ }
311
+
312
+ form {
313
+ width: 100%;
314
+ position: relative;
315
+ }
316
+
317
+ .input-submit-button,
318
+ .input-loading-spinner {
319
+ position: absolute;
320
+ top: 22px;
321
+ transform: translateY(-50%);
322
+ right: 10px;
323
+ }
324
+ `;var x=globalThis&&globalThis.__decorate||function(e,t,i,r){var n=arguments.length,o=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o};let p=class extends f{constructor(){var t;super(),this.formRef=Q(),this.usubscribe=[],this.name="",this.error="",this.loading=v.state.loading,this.suggestions=v.state.suggestions,this.profileName=(t=m.getAccountData())==null?void 0:t.profileName,this.onDebouncedNameInputChange=k.debounce(i=>{i.length<4?this.error="Name must be at least 4 characters long":I.isValidReownName(i)?(this.error="",v.getSuggestions(i)):this.error="The value is not a valid username"}),this.usubscribe.push(v.subscribe(i=>{this.suggestions=i.suggestions,this.loading=i.loading}),m.subscribeChainProp("accountState",i=>{this.profileName=i==null?void 0:i.profileName,i!=null&&i.profileName&&(this.error="You already own a name")}))}firstUpdated(){var t;(t=this.formRef.value)==null||t.addEventListener("keydown",this.onEnterKey.bind(this))}disconnectedCallback(){var t;super.disconnectedCallback(),this.usubscribe.forEach(i=>i()),(t=this.formRef.value)==null||t.removeEventListener("keydown",this.onEnterKey.bind(this))}render(){return c`
325
+ <wui-flex
326
+ flexDirection="column"
327
+ alignItems="center"
328
+ gap="4"
329
+ .padding=${["1","3","4","3"]}
330
+ >
331
+ <form ${J(this.formRef)} @submit=${this.onSubmitName.bind(this)}>
332
+ <wui-ens-input
333
+ @inputChange=${this.onNameInputChange.bind(this)}
334
+ .errorMessage=${this.error}
335
+ .value=${this.name}
336
+ .onKeyDown=${this.onKeyDown.bind(this)}
337
+ >
338
+ </wui-ens-input>
339
+ ${this.submitButtonTemplate()}
340
+ <input type="submit" hidden />
341
+ </form>
342
+ ${this.templateSuggestions()}
343
+ </wui-flex>
344
+ `}submitButtonTemplate(){const t=this.suggestions.find(r=>{var n,o;return((o=(n=r.name)==null?void 0:n.split("."))==null?void 0:o[0])===this.name&&r.registered});if(this.loading)return c`<wui-loading-spinner
345
+ class="input-loading-spinner"
346
+ color="secondary"
347
+ ></wui-loading-spinner>`;const i=`${this.name}${D.WC_NAME_SUFFIX}`;return c`
348
+ <wui-icon-link
349
+ ?disabled=${!!t}
350
+ class="input-submit-button"
351
+ size="sm"
352
+ icon="chevronRight"
353
+ iconColor=${t?"default":"accent-primary"}
354
+ @click=${()=>this.onSubmitName(i)}
355
+ >
356
+ </wui-icon-link>
357
+ `}onNameInputChange(t){const i=I.validateReownName(t.detail||"");this.name=i,this.onDebouncedNameInputChange(i)}onKeyDown(t){t.key.length===1&&!I.isValidReownName(t.key)&&t.preventDefault()}templateSuggestions(){return!this.name||this.name.length<4||this.error?null:c`<wui-flex flexDirection="column" gap="1" alignItems="center">
358
+ ${this.suggestions.map(t=>c`<wui-account-name-suggestion-item
359
+ name=${t.name}
360
+ ?registered=${t.registered}
361
+ ?loading=${this.loading}
362
+ ?disabled=${t.registered||this.loading}
363
+ data-testid="account-name-suggestion"
364
+ @click=${()=>this.onSubmitName(t.name)}
365
+ ></wui-account-name-suggestion-item>`)}
366
+ </wui-flex>`}isAllowedToSubmit(t){var n;const i=(n=t.split("."))==null?void 0:n[0],r=this.suggestions.find(o=>{var s,a;return((a=(s=o.name)==null?void 0:s.split("."))==null?void 0:a[0])===i&&o.registered});return!this.loading&&!this.error&&!this.profileName&&i&&v.validateName(i)&&!r}async onSubmitName(t){try{if(!this.isAllowedToSubmit(t))return;O.sendEvent({type:"track",event:"REGISTER_NAME_INITIATED",properties:{isSmartAccount:T(m.state.activeChain)===h.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:t}}),await v.registerName(t),O.sendEvent({type:"track",event:"REGISTER_NAME_SUCCESS",properties:{isSmartAccount:T(m.state.activeChain)===h.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:t}})}catch(i){q.showError(i.message),O.sendEvent({type:"track",event:"REGISTER_NAME_ERROR",properties:{isSmartAccount:T(m.state.activeChain)===h.ACCOUNT_TYPES.SMART_ACCOUNT,ensName:t,error:k.parseError(i)}})}}onEnterKey(t){if(t.key==="Enter"&&this.name&&this.isAllowedToSubmit(this.name)){const i=`${this.name}${D.WC_NAME_SUFFIX}`;this.onSubmitName(i)}}};p.styles=ue;x([l()],p.prototype,"errorMessage",void 0);x([u()],p.prototype,"name",void 0);x([u()],p.prototype,"error",void 0);x([u()],p.prototype,"loading",void 0);x([u()],p.prototype,"suggestions",void 0);x([u()],p.prototype,"profileName",void 0);p=x([w("w3m-register-account-name-view")],p);const de=H`
367
+ .continue-button-container {
368
+ width: 100%;
369
+ }
370
+ `;var pe=globalThis&&globalThis.__decorate||function(e,t,i,r){var n=arguments.length,o=n<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(n<3?s(o):n>3?s(t,i,o):s(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o};let U=class extends f{render(){return c`
371
+ <wui-flex
372
+ flexDirection="column"
373
+ alignItems="center"
374
+ gap="6"
375
+ .padding=${["0","0","4","0"]}
376
+ >
377
+ ${this.onboardingTemplate()} ${this.buttonsTemplate()}
378
+ <wui-link
379
+ @click=${()=>{k.openHref(te.URLS.FAQ,"_blank")}}
380
+ >
381
+ Learn more
382
+ <wui-icon color="inherit" slot="iconRight" name="externalLink"></wui-icon>
383
+ </wui-link>
384
+ </wui-flex>
385
+ `}onboardingTemplate(){return c` <wui-flex
386
+ flexDirection="column"
387
+ gap="6"
388
+ alignItems="center"
389
+ .padding=${["0","6","0","6"]}
390
+ >
391
+ <wui-flex gap="3" alignItems="center" justifyContent="center">
392
+ <wui-icon-box size="xl" color="success" icon="checkmark"></wui-icon-box>
393
+ </wui-flex>
394
+ <wui-flex flexDirection="column" alignItems="center" gap="3">
395
+ <wui-text align="center" variant="md-medium" color="primary">
396
+ Account name chosen successfully
397
+ </wui-text>
398
+ <wui-text align="center" variant="md-regular" color="primary">
399
+ You can now fund your account and trade crypto
400
+ </wui-text>
401
+ </wui-flex>
402
+ </wui-flex>`}buttonsTemplate(){return c`<wui-flex
403
+ .padding=${["0","4","0","4"]}
404
+ gap="3"
405
+ class="continue-button-container"
406
+ >
407
+ <wui-button fullWidth size="lg" borderRadius="xs" @click=${this.redirectToAccount.bind(this)}
408
+ >Let's Go!
409
+ </wui-button>
410
+ </wui-flex>`}redirectToAccount(){Z.replace("Account")}};U.styles=de;U=pe([w("w3m-register-account-name-success-view")],U);export{R as W3mApproveTransactionView,U as W3mRegisterAccountNameSuccess,p as W3mRegisterAccountNameView,$ as W3mSmartAccountSettingsView,Y as W3mUpgradeWalletView};
@@ -0,0 +1 @@
1
+ import{R as p,a}from"./ReownAuthentication-468828df.js";import"./index-48bd3fca.js";import"./index-d70e4ab8.js";import"./NetworkUtil-220ea128.js";import"./BlockOverrides-9837a6f9.js";import"./index-4243d275.js";export{p as ReownAuthentication,a as ReownAuthenticationMessenger};
@@ -0,0 +1,13 @@
1
+ import{g as Z}from"./index-d70e4ab8.js";function $(h,y){for(var a=0;a<y.length;a++){const r=y[a];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in h)){const u=Object.getOwnPropertyDescriptor(r,o);u&&Object.defineProperty(h,o,u.get?u:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}))}var z=function(h){var y={};function a(r){if(y[r])return y[r].exports;var o=y[r]={i:r,l:!1,exports:{}};return h[r].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=h,a.c=y,a.d=function(r,o,u){a.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:u})},a.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},a.t=function(r,o){if(1&o&&(r=a(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var u=Object.create(null);if(a.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var l in r)a.d(u,l,(function(R){return r[R]}).bind(null,l));return u},a.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(o,"a",o),o},a.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},a.p="",a(a.s=3)}([function(h,y){h.exports=function(a){return a&&a.__esModule?a:{default:a}}},function(h,y){h.exports=function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}},function(h,y,a){function r(){return Math.floor(9e4*Math.random())+1e4}Object.defineProperty(y,"__esModule",{value:!0}),y.sendAsyncWrapper=function(o,u){var l=this;return new Promise(function(R,x){l.sendAsync({jsonrpc:"2.0",id:r(),method:o,params:u||[]},function(O,T){O?x(O):R(T.result)})})},y.sendFortmaticAsyncWrapper=function(o){var u=this;return new Promise(function(l,R){u.getProvider().sendFortmaticAsync(o,function(x,O){x?R(x):l(O?O.result:{})})})},y.randomId=r,y.findExistingResponse=function(o,u){for(var l=0;l<o.length;l++)if(o[l].id===u)return o[l];return null}},function(h,y,a){h.exports=a(4)},function(h,y,a){var r=a(0),o=r(a(1)),u=r(a(5)),l=a(2),R="fm_composeSend",x="fm_logout",O="fm_get_balances",T="fm_get_transactions",w="fm_is_logged_in",P="fm_accountSettings",n="fm_deposit",s="fm_get_user",c="fm_configure",f={};h.exports=function b(_,A,I){var v=this;if((0,o.default)(this,b),this.fortmaticClient="https://x2.fortmatic.com",!_)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.apiKey=_,this.options=I,this.ethNetwork=A,this.queryParams=btoa(JSON.stringify({API_KEY:_,ETH_NETWORK:A})),this.transactions={send:function(m,M){var C=new g(R,{to:m.to,value:m.amount});v.getProvider().sendFortmaticAsync(C,M)}},this.getProvider=function(){return f["fortmatic-".concat(v.queryParams)]||(f["fortmatic-".concat(v.queryParams)]=new u.default(v.fortmaticClient,{API_KEY:_,ETH_NETWORK:A})),f["fortmatic-".concat(v.queryParams)]},this.user={login:function(){return v.getProvider().enable()},logout:function(){v.getProvider().account=null,v.getProvider().network=null;var m=new g(x);return l.sendFortmaticAsyncWrapper.call(v,m)},getUser:function(){var m=new g(s);return l.sendFortmaticAsyncWrapper.call(v,m)},getBalances:function(){var m=new g(O);return l.sendFortmaticAsyncWrapper.call(v,m)},getTransactions:function(){var m=new g(T);return l.sendFortmaticAsyncWrapper.call(v,m)},isLoggedIn:function(){var m=new g(w);return l.sendFortmaticAsyncWrapper.call(v,m)},settings:function(){var m=new g(P);return l.sendFortmaticAsyncWrapper.call(v,m)},deposit:function(m){var M=new g(n,m);return l.sendFortmaticAsyncWrapper.call(v,M)}},this.configure=function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=new g(c);return M.params=[m],l.sendFortmaticAsyncWrapper.call(v,M)}};var g=function b(_,A){(0,o.default)(this,b),this.id=(0,l.randomId)(),this.method=_,this.params=A?[A]:[{}]}},function(h,y,a){var r=a(0);Object.defineProperty(y,"__esModule",{value:!0}),y.default=void 0;var o=r(a(6)),u=r(a(9)),l=r(a(1)),R=r(a(10)),x=a(11),O=r(a(12)),T=a(2),w=function(){function P(n,s){if((0,l.default)(this,P),this.fortmaticClient=n,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!s.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:s.API_KEY,ETH_NETWORK:s.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:x.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,R.default)(P,[{key:"constructPostMessage",value:function(){var n=this;Object.keys(this.postMessages).map(function(s){n.postMessages[s]+="-".concat(n.queryParams)})}},{key:"createOverlay",value:function(){var n=this;return new Promise(function(s,c){var f=function(){if(function(){var A=!0,I=!1,v=void 0;try{for(var m,M=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(A=(m=M.next()).done);A=!0)if(m.value.src.includes(n.queryParams))return!1}catch(C){I=!0,v=C}finally{try{A||M.return==null||M.return()}finally{if(I)throw v}}return!0}()){var g=document.createElement("style");g.innerHTML=O.default.css,g.type="text/css",document.head.appendChild(g);var b=document.createElement("iframe");b.className="fortmatic-iframe",b.src="".concat(n.fortmaticClient,"/send?params=").concat(n.queryParams),document.body.appendChild(b);var _=document.createElement("img");_.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(_),s({iframe:b})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?f():window.addEventListener("load",f.bind(n),!1)})}},{key:"showOverlay",value:function(){var n=(0,u.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="block";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"hideOverlay",value:function(){var n=(0,u.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="none";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"sendAsync",value:function(n,s){n.length>0?this.enqueue({payload:{id:(0,T.randomId)(),batch:n.map(function(c){return c.id=(0,T.randomId)(),c}),method:"eth_batchRequest"},cb:s}):this.enqueue({payload:n,cb:s})}},{key:"sendFortmaticAsync",value:function(n,s){this.enqueue({payload:n,cb:s,isNative:!0})}},{key:"send",value:function(n,s){if(typeof n=="string")return T.sendAsyncWrapper.call(this,n,s);if(!s){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(n,function(){});var c={};switch(n.method){case"eth_accounts":c=this.account?[this.account]:[];break;case"eth_coinbase":c=this.account;break;case"net_version":c=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":c=!0;break;default:c={}}return{id:n.id,jsonrpc:n.jsonrpc,result:c}}this.sendAsync(n,s)}},{key:"enqueue",value:function(n){this.queue.push(n),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:function(){var n=(0,u.default)(o.default.mark(function s(){var c,f,g,b=this;return o.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(this.queue.length!==0){_.next=2;break}return _.abrupt("return");case 2:if(!(c=this.queue.shift())){_.next=11;break}return f=c.payload,g=c.cb,f.id=(0,T.randomId)(),_.next=9,this.postMessage(c.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,c.payload);case 9:f.batch&&f.batch.length>0?(f.batch.forEach(function(A){b.requests[A.id]={parentId:f.id,payload:A,cb:function(I,v){var m=b.requests[f.id].batchResponse;if(I&&I.response&&!(0,T.findExistingResponse)(m,I.response.id))throw m.push({jsonrpc:"2.0",id:I.response.id,error:{code:I.response.code,message:I.response.message}}),b.requests[f.id].cb(null,m),I.response;if(v&&v.result&&!(0,T.findExistingResponse)(m,v.id))return m.push(v);throw new Error("Fortmatic: unexpected callback behavior")}}}),this.requests[f.id]={payload:f,cb:g,batchResponse:[]}):this.requests[f.id]={payload:f,cb:g},this.dequeue();case 11:case"end":return _.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"postMessage",value:function(){var n=(0,u.default)(o.default.mark(function s(c,f){var g;return o.default.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,this.overlay;case 2:if(!(g=b.sent).iframe.contentWindow){b.next=7;break}g.iframe.contentWindow.postMessage({msgType:c,payload:f},"*"),b.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return b.stop()}},s,this)}));return function(s,c){return n.apply(this,arguments)}}()},{key:"enable",value:function(){return T.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var n=this;window.addEventListener("message",function(s){if(s.origin===n.fortmaticClient){var c=s.data.response?s.data.response.id:null;switch(s.data.msgType){case n.postMessages.FORTMATIC_OVERLAY_READY:n.overlayReady=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HANDLE_RESPONSE:try{n.requests[c].cb(null,s.data.response);var f=n.requests[c].parentId;f&&n.requests[f].payload.batch.length===n.requests[f].batchResponse.length&&n.requests[f].cb(null,n.requests[f].batchResponse),n.requests[c].payload.method==="eth_accounts"?n.account=s.data.response.result[0]:n.requests[c].payload.method==="eth_coinbase"?n.account=s.data.response.result:n.requests[c].payload.method==="net_version"&&(n.network=s.data.response.result)}catch{}n.isLoggedIn=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HIDE_OVERLAY:n.hideOverlay();break;case n.postMessages.FORTMATIC_SHOW_OVERLAY:n.showOverlay();break;case n.postMessages.FORTMATIC_USER_LOGOUT:n.account=null,n.network=null,n.isLoggedIn=!1;break;case n.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw n.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case n.postMessages.FORTMATIC_USER_DENIED:if(c){var g=s.data.response&&s.data.response.message?s.data.response.message:"Fortmatic: Modal was closed without executing action!",b=s.data.response&&s.data.response.code?s.data.response.code:1;n.requests[c].cb({message:g,code:b,response:s.data.response})}else n.queue.forEach(function(_){return _.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})});n.dequeue()}}})}}]),P}();y.default=w},function(h,y,a){h.exports=a(7)},function(h,y,a){var r=function(){return this||typeof self=="object"&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,u=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,h.exports=a(8),o)r.regeneratorRuntime=u;else try{delete r.regeneratorRuntime}catch{r.regeneratorRuntime=void 0}},function(h,y){(function(a){var r,o=Object.prototype,u=o.hasOwnProperty,l=typeof Symbol=="function"?Symbol:{},R=l.iterator||"@@iterator",x=l.asyncIterator||"@@asyncIterator",O=l.toStringTag||"@@toStringTag",T=typeof h=="object",w=a.regeneratorRuntime;if(w)T&&(h.exports=w);else{(w=a.regeneratorRuntime=T?h.exports:{}).wrap=I;var P="suspendedStart",n="suspendedYield",s="executing",c="completed",f={},g={};g[R]=function(){return this};var b=Object.getPrototypeOf,_=b&&b(b(G([])));_&&_!==o&&u.call(_,R)&&(g=_);var A=C.prototype=m.prototype=Object.create(g);M.prototype=A.constructor=C,C.constructor=M,C[O]=M.displayName="GeneratorFunction",w.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===M||(e.displayName||e.name)==="GeneratorFunction")},w.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,C):(t.__proto__=C,O in t||(t[O]="GeneratorFunction")),t.prototype=Object.create(A),t},w.awrap=function(t){return{__await:t}},V(U.prototype),U.prototype[x]=function(){return this},w.AsyncIterator=U,w.async=function(t,e,d,p){var i=new U(I(t,e,d,p));return w.isGeneratorFunction(e)?i:i.next().then(function(F){return F.done?F.value:i.next()})},V(A),A[O]="Generator",A[R]=function(){return this},A.toString=function(){return"[object Generator]"},w.keys=function(t){var e=[];for(var d in t)e.push(d);return e.reverse(),function p(){for(;e.length;){var i=e.pop();if(i in t)return p.value=i,p.done=!1,p}return p.done=!0,p}},w.values=G,K.prototype={constructor:K,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Y),!t)for(var e in this)e.charAt(0)==="t"&&u.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function d(W,E){return F.type="throw",F.arg=t,e.next=W,E&&(e.method="next",e.arg=r),!!E}for(var p=this.tryEntries.length-1;p>=0;--p){var i=this.tryEntries[p],F=i.completion;if(i.tryLoc==="root")return d("end");if(i.tryLoc<=this.prev){var j=u.call(i,"catchLoc"),q=u.call(i,"finallyLoc");if(j&&q){if(this.prev<i.catchLoc)return d(i.catchLoc,!0);if(this.prev<i.finallyLoc)return d(i.finallyLoc)}else if(j){if(this.prev<i.catchLoc)return d(i.catchLoc,!0)}else{if(!q)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return d(i.finallyLoc)}}}},abrupt:function(t,e){for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d];if(p.tryLoc<=this.prev&&u.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var i=p;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var F=i?i.completion:{};return F.type=t,F.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(F)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.finallyLoc===t)return this.complete(d.completion,d.afterLoc),Y(d),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.tryLoc===t){var p=d.completion;if(p.type==="throw"){var i=p.arg;Y(d)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,d){return this.delegate={iterator:G(t),resultName:e,nextLoc:d},this.method==="next"&&(this.arg=r),f}}}function I(t,e,d,p){var i=e&&e.prototype instanceof m?e:m,F=Object.create(i.prototype),j=new K(p||[]);return F._invoke=function(q,W,E){var L=P;return function(S,D){if(L===s)throw new Error("Generator is already running");if(L===c){if(S==="throw")throw D;return Q()}for(E.method=S,E.arg=D;;){var H=E.delegate;if(H){var N=B(H,E);if(N){if(N===f)continue;return N}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(L===P)throw L=c,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);L=s;var k=v(q,W,E);if(k.type==="normal"){if(L=E.done?c:n,k.arg===f)continue;return{value:k.arg,done:E.done}}k.type==="throw"&&(L=c,E.method="throw",E.arg=k.arg)}}}(t,d,j),F}function v(t,e,d){try{return{type:"normal",arg:t.call(e,d)}}catch(p){return{type:"throw",arg:p}}}function m(){}function M(){}function C(){}function V(t){["next","throw","return"].forEach(function(e){t[e]=function(d){return this._invoke(e,d)}})}function U(t){var e;this._invoke=function(d,p){function i(){return new Promise(function(F,j){(function q(W,E,L,S){var D=v(t[W],t,E);if(D.type!=="throw"){var H=D.arg,N=H.value;return N&&typeof N=="object"&&u.call(N,"__await")?Promise.resolve(N.__await).then(function(k){q("next",k,L,S)},function(k){q("throw",k,L,S)}):Promise.resolve(N).then(function(k){H.value=k,L(H)},function(k){return q("throw",k,L,S)})}S(D.arg)})(d,p,F,j)})}return e=e?e.then(i,i):i()}}function B(t,e){var d=t.iterator[e.method];if(d===r){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=r,B(t,e),e.method==="throw"))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var p=v(d,t.iterator,e.arg);if(p.type==="throw")return e.method="throw",e.arg=p.arg,e.delegate=null,f;var i=p.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=r),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function J(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Y(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function K(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(J,this),this.reset(!0)}function G(t){if(t){var e=t[R];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var d=-1,p=function i(){for(;++d<t.length;)if(u.call(t,d))return i.value=t[d],i.done=!1,i;return i.value=r,i.done=!0,i};return p.next=p}}return{next:Q}}function Q(){return{value:r,done:!0}}})(function(){return this||typeof self=="object"&&self}()||Function("return this")())},function(h,y){function a(r,o,u,l,R,x,O){try{var T=r[x](O),w=T.value}catch(P){return void u(P)}T.done?o(w):Promise.resolve(w).then(l,R)}h.exports=function(r){return function(){var o=this,u=arguments;return new Promise(function(l,R){var x=r.apply(o,u);function O(w){a(x,l,R,O,T,"next",w)}function T(w){a(x,l,R,O,T,"throw",w)}O(void 0)})}}},function(h,y){function a(r,o){for(var u=0;u<o.length;u++){var l=o[u];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(r,l.key,l)}}h.exports=function(r,o,u){return o&&a(r.prototype,o),u&&a(r,u),r}},function(h){h.exports={name:"fortmatic",version:"1.1.3",description:"Fortmatic Javascript SDK",main:"lib/fortmatic.js",scripts:{build:"WEBPACK_ENV=production webpack","build:dev":"WEBPACK_ENV=development BABEL_ENV=development webpack --progress --colors --watch",test:"nyc --reporter=lcov --reporter=text-summary ava"},author:"Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(h,y,a){y.css=`
2
+ .fortmatic-iframe {
3
+ display: none;
4
+ position: fixed;
5
+ top: 0;
6
+ right: 0;
7
+ width: 100%;
8
+ height: 100%;
9
+ border: none;
10
+ border-radius: 0;
11
+ z-index: 2147483647;
12
+ }
13
+ `}]);const X=Z(z),te=$({__proto__:null,default:X},[z]);export{te as f};
@@ -0,0 +1,5 @@
1
+ import{A as r}from"./index-48bd3fca.js";/**
2
+ * @license
3
+ * Copyright 2018 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const m=o=>o??r;export{m as o};
@@ -0,0 +1,138 @@
1
+ import{j as g,r as m,k as u,l as p,m as n}from"./index-48bd3fca.js";import{n as r,c as x}from"./index-84e8ecf6.js";import"./index-42ce7246.js";import"./index-d7a6ceea.js";const b=g`
2
+ button {
3
+ display: block;
4
+ display: flex;
5
+ align-items: center;
6
+ padding: ${({spacing:e})=>e[1]};
7
+ transition: background-color ${({durations:e})=>e.lg}
8
+ ${({easings:e})=>e["ease-out-power-2"]};
9
+ will-change: background-color;
10
+ background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
11
+ border-radius: ${({borderRadius:e})=>e[32]};
12
+ }
13
+
14
+ wui-image {
15
+ border-radius: ${({borderRadius:e})=>e[32]};
16
+ }
17
+
18
+ wui-text {
19
+ padding-left: ${({spacing:e})=>e[1]};
20
+ padding-right: ${({spacing:e})=>e[1]};
21
+ }
22
+
23
+ .left-icon-container {
24
+ width: 24px;
25
+ height: 24px;
26
+ justify-content: center;
27
+ align-items: center;
28
+ }
29
+
30
+ .left-image-container {
31
+ position: relative;
32
+ justify-content: center;
33
+ align-items: center;
34
+ }
35
+
36
+ .chain-image {
37
+ position: absolute;
38
+ border: 1px solid ${({tokens:e})=>e.theme.foregroundPrimary};
39
+ }
40
+
41
+ /* -- Sizes --------------------------------------------------- */
42
+ button[data-size='lg'] {
43
+ height: 32px;
44
+ }
45
+
46
+ button[data-size='md'] {
47
+ height: 28px;
48
+ }
49
+
50
+ button[data-size='sm'] {
51
+ height: 24px;
52
+ }
53
+
54
+ button[data-size='lg'] .token-image {
55
+ width: 24px;
56
+ height: 24px;
57
+ }
58
+
59
+ button[data-size='md'] .token-image {
60
+ width: 20px;
61
+ height: 20px;
62
+ }
63
+
64
+ button[data-size='sm'] .token-image {
65
+ width: 16px;
66
+ height: 16px;
67
+ }
68
+
69
+ button[data-size='lg'] .left-icon-container {
70
+ width: 24px;
71
+ height: 24px;
72
+ }
73
+
74
+ button[data-size='md'] .left-icon-container {
75
+ width: 20px;
76
+ height: 20px;
77
+ }
78
+
79
+ button[data-size='sm'] .left-icon-container {
80
+ width: 16px;
81
+ height: 16px;
82
+ }
83
+
84
+ button[data-size='lg'] .chain-image {
85
+ width: 12px;
86
+ height: 12px;
87
+ bottom: 2px;
88
+ right: -4px;
89
+ }
90
+
91
+ button[data-size='md'] .chain-image {
92
+ width: 10px;
93
+ height: 10px;
94
+ bottom: 2px;
95
+ right: -4px;
96
+ }
97
+
98
+ button[data-size='sm'] .chain-image {
99
+ width: 8px;
100
+ height: 8px;
101
+ bottom: 2px;
102
+ right: -3px;
103
+ }
104
+
105
+ /* -- Focus states --------------------------------------------------- */
106
+ button:focus-visible:enabled {
107
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
108
+ box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
109
+ }
110
+
111
+ /* -- Hover & Active states ----------------------------------------------------------- */
112
+ @media (hover: hover) {
113
+ button:hover:enabled,
114
+ button:active:enabled {
115
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
116
+ }
117
+ }
118
+
119
+ /* -- Disabled states --------------------------------------------------- */
120
+ button:disabled {
121
+ background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
122
+ opacity: 0.5;
123
+ }
124
+ `;var a=globalThis&&globalThis.__decorate||function(e,t,s,d){var l=arguments.length,o=l<3?t:d===null?d=Object.getOwnPropertyDescriptor(t,s):d,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,s,d);else for(var h=e.length-1;h>=0;h--)(c=e[h])&&(o=(l<3?c(o):l>3?c(t,s,o):c(t,s))||o);return l>3&&o&&Object.defineProperty(t,s,o),o};const f={lg:"lg-regular",md:"lg-regular",sm:"md-regular"},w={lg:"lg",md:"md",sm:"sm"};let i=class extends p{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.text="",this.loading=!1}render(){return this.loading?n` <wui-flex alignItems="center" gap="01" padding="01">
125
+ <wui-shimmer width="20px" height="20px"></wui-shimmer>
126
+ <wui-shimmer width="32px" height="18px" borderRadius="4xs"></wui-shimmer>
127
+ </wui-flex>`:n`
128
+ <button ?disabled=${this.disabled} data-size=${this.size}>
129
+ ${this.imageTemplate()} ${this.textTemplate()}
130
+ </button>
131
+ `}imageTemplate(){if(this.imageSrc&&this.chainImageSrc)return n`<wui-flex class="left-image-container">
132
+ <wui-image src=${this.imageSrc} class="token-image"></wui-image>
133
+ <wui-image src=${this.chainImageSrc} class="chain-image"></wui-image>
134
+ </wui-flex>`;if(this.imageSrc)return n`<wui-image src=${this.imageSrc} class="token-image"></wui-image>`;const t=w[this.size];return n`<wui-flex class="left-icon-container">
135
+ <wui-icon size=${t} name="networkPlaceholder"></wui-icon>
136
+ </wui-flex>`}textTemplate(){const t=f[this.size];return n`<wui-text color="primary" variant=${t}
137
+ >${this.text}</wui-text
138
+ >`}};i.styles=[m,u,b];a([r()],i.prototype,"size",void 0);a([r()],i.prototype,"imageSrc",void 0);a([r()],i.prototype,"chainImageSrc",void 0);a([r({type:Boolean})],i.prototype,"disabled",void 0);a([r()],i.prototype,"text",void 0);a([r({type:Boolean})],i.prototype,"loading",void 0);i=a([x("wui-token-button")],i);