@recoilpay/intent-widget 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/LICENSE +21 -0
- package/README.md +89 -0
- package/dist/chunks/add-6QI4IE74.js +15 -0
- package/dist/chunks/all-wallets-THC5DP7W.js +6 -0
- package/dist/chunks/app-store-FS2F7VYK.js +17 -0
- package/dist/chunks/apple-C2QR6WKS.js +18 -0
- package/dist/chunks/arrow-bottom-AW5LWHGC.js +8 -0
- package/dist/chunks/arrow-bottom-circle-3L4ACEWX.js +11 -0
- package/dist/chunks/arrow-left-OKHNGLQ4.js +8 -0
- package/dist/chunks/arrow-right-V4EYTZ5E.js +8 -0
- package/dist/chunks/arrow-top-XLD7PH65.js +8 -0
- package/dist/chunks/bank-DT5OX7C2.js +14 -0
- package/dist/chunks/basic-2ESEHJO2.js +2133 -0
- package/dist/chunks/browser-HWASO4BM.js +14 -0
- package/dist/chunks/card-AWLNHRWK.js +14 -0
- package/dist/chunks/ccip-7WYWVY5O.js +29 -0
- package/dist/chunks/ccip-CJPBHIYN.js +1 -0
- package/dist/chunks/ccip-P2XLZ2Q3.js +1 -0
- package/dist/chunks/ccip-TDNDQCYX.js +1 -0
- package/dist/chunks/checkmark-CFJVGYKN.js +11 -0
- package/dist/chunks/checkmark-bold-KYZGMQZC.js +8 -0
- package/dist/chunks/chevron-bottom-UFI5ZQCD.js +8 -0
- package/dist/chunks/chevron-left-IXZPWY6V.js +8 -0
- package/dist/chunks/chevron-right-YBXAUXMQ.js +8 -0
- package/dist/chunks/chevron-top-XGVJAAGN.js +8 -0
- package/dist/chunks/chrome-store-V7ZFZ4HF.js +61 -0
- package/dist/chunks/chunk-6XSLLSJX.js +1 -0
- package/dist/chunks/chunk-BFNNKT2C.js +20 -0
- package/dist/chunks/chunk-EZRXHJOM.js +9 -0
- package/dist/chunks/chunk-F7HZCPX2.js +1 -0
- package/dist/chunks/chunk-FK7PQ7YB.js +6 -0
- package/dist/chunks/chunk-FL3MRXUD.js +6 -0
- package/dist/chunks/chunk-FYS4NW6G.js +1 -0
- package/dist/chunks/chunk-GPOI2YA7.js +886 -0
- package/dist/chunks/chunk-H5GR6EPA.js +394 -0
- package/dist/chunks/chunk-JYRWMYZ2.js +36 -0
- package/dist/chunks/chunk-LQZA24C3.js +37 -0
- package/dist/chunks/chunk-MYICIF4X.js +6 -0
- package/dist/chunks/chunk-MYQCVH5Z.js +1 -0
- package/dist/chunks/chunk-OKQEFB6X.js +28 -0
- package/dist/chunks/chunk-QOQKSUB7.js +29 -0
- package/dist/chunks/chunk-WYVJ6QLD.js +29 -0
- package/dist/chunks/chunk-Z3OIWTR5.js +1 -0
- package/dist/chunks/clock-5HKMPIUO.js +8 -0
- package/dist/chunks/close-7Q5B2HQ4.js +8 -0
- package/dist/chunks/coinPlaceholder-3K6ZUCBB.js +8 -0
- package/dist/chunks/compass-W74LSHT5.js +8 -0
- package/dist/chunks/copy-6Q4PP5RG.js +15 -0
- package/dist/chunks/core-52H33BRG.js +15 -0
- package/dist/chunks/cursor-HIA7HILJ.js +3 -0
- package/dist/chunks/cursor-transparent-3QFUBR2Y.js +12 -0
- package/dist/chunks/desktop-AQ4JHUBR.js +9 -0
- package/dist/chunks/disconnect-DAKWOTZ3.js +8 -0
- package/dist/chunks/discord-5FRZ3W43.js +17 -0
- package/dist/chunks/etherscan-JBY3FG5R.js +6 -0
- package/dist/chunks/exclamation-triangle-3RG2YEHW.js +4 -0
- package/dist/chunks/extension-KJD6T6D2.js +8 -0
- package/dist/chunks/external-link-4TRP536K.js +8 -0
- package/dist/chunks/facebook-IYUAR5JX.js +26 -0
- package/dist/chunks/farcaster-32VRU3TK.js +12 -0
- package/dist/chunks/filters-XZ2LOG4T.js +8 -0
- package/dist/chunks/github-4DWZB2US.js +18 -0
- package/dist/chunks/google-7JIWLIDN.js +18 -0
- package/dist/chunks/help-circle-YBXI5V2B.js +12 -0
- package/dist/chunks/id-RY6NX47S.js +12 -0
- package/dist/chunks/image-TFG7VUHL.js +4 -0
- package/dist/chunks/index.es-SEE33E5T.js +15 -0
- package/dist/chunks/info-OGTYPPEO.js +3 -0
- package/dist/chunks/info-circle-KH5E4LQP.js +12 -0
- package/dist/chunks/lightbulb-U33OSZ3X.js +3 -0
- package/dist/chunks/mail-RCAHKDDA.js +8 -0
- package/dist/chunks/mine.wasm-DWLXBUXQ.js +1 -0
- package/dist/chunks/mobile-RMRLWRK2.js +9 -0
- package/dist/chunks/more-QN5BQZLT.js +11 -0
- package/dist/chunks/native-ESI6QOB3.js +1 -0
- package/dist/chunks/native-FKR3QBFJ.js +1 -0
- package/dist/chunks/native-J6GYQGMC.js +1 -0
- package/dist/chunks/native-YYHLKJS6.js +1 -0
- package/dist/chunks/network-placeholder-7TZ4FX3A.js +14 -0
- package/dist/chunks/nftPlaceholder-5A4AUYE2.js +8 -0
- package/dist/chunks/off-NW3B3Z3Q.js +8 -0
- package/dist/chunks/play-store-NST7OJXU.js +32 -0
- package/dist/chunks/plus-ZJXOSK2O.js +13 -0
- package/dist/chunks/qr-code-KDG2JZZK.js +6 -0
- package/dist/chunks/recycle-horizontal-3X37MC7E.js +9 -0
- package/dist/chunks/refresh-GL7N6ZKZ.js +8 -0
- package/dist/chunks/reown-logo-EXAEIT6H.js +12 -0
- package/dist/chunks/search-EDSER3WT.js +8 -0
- package/dist/chunks/secp256k1-6A42G7KH.js +11 -0
- package/dist/chunks/secp256k1-ACZE2VHK.js +10 -0
- package/dist/chunks/secp256k1-AHJALKHB.js +11 -0
- package/dist/chunks/secp256k1-Z3G34S2I.js +11 -0
- package/dist/chunks/send-G6RI7LIU.js +15 -0
- package/dist/chunks/swapHorizontal-PS74G3QM.js +8 -0
- package/dist/chunks/swapHorizontalBold-UXWIWNWD.js +8 -0
- package/dist/chunks/swapHorizontalMedium-RJ2OQ4TF.js +16 -0
- package/dist/chunks/swapHorizontalRoundedBold-7IWPKFFP.js +8 -0
- package/dist/chunks/swapVertical-BQ25C2TX.js +8 -0
- package/dist/chunks/telegram-D2ONVLTF.js +16 -0
- package/dist/chunks/three-dots-WTLTFKLX.js +5 -0
- package/dist/chunks/twitch-YCCDDY6J.js +18 -0
- package/dist/chunks/twitterIcon-W26URVWN.js +6 -0
- package/dist/chunks/verify-4BN2QIGK.js +8 -0
- package/dist/chunks/verify-filled-PMCOH3ZN.js +8 -0
- package/dist/chunks/w3m-modal-RWMJ7KYJ.js +642 -0
- package/dist/chunks/wallet-2P4SEUMP.js +8 -0
- package/dist/chunks/wallet-placeholder-V5RSTMZ2.js +14 -0
- package/dist/chunks/walletconnect-VJ2EPWKZ.js +30 -0
- package/dist/chunks/warning-circle-HB2VR6PY.js +12 -0
- package/dist/chunks/x-T5WBAOG3.js +12 -0
- package/dist/recoilpay-intent-widget.js +925 -0
- package/package.json +55 -0
|
@@ -0,0 +1,2133 @@
|
|
|
1
|
+
import{a as c,b as m,c as h,d as jo,e as ko,f as zo}from"./chunk-H5GR6EPA.js";import{h as ht,i as st}from"./chunk-FYS4NW6G.js";import{A as he,K as y,L,M as Do,N as X,O as d,a as Ao,h as pe,i as pt,j as f,k as N,l as Ke,m as B,o as U,p as R,q as E,r as Gt,s as v,t as yt,u as x,x as Yt}from"./chunk-GPOI2YA7.js";import"./chunk-BFNNKT2C.js";import{b as g,e as l,f as mt,h as Ge,j as p}from"./chunk-OKQEFB6X.js";import"./chunk-Z3OIWTR5.js";import"./chunk-F7HZCPX2.js";import"./chunk-JYRWMYZ2.js";import"./chunk-EZRXHJOM.js";import{b as W,e as Ar}from"./chunk-MYQCVH5Z.js";var ni=W((ld,ri)=>{"use strict";ri.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var gt=W(It=>{"use strict";var oo,Ur=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];It.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};It.getSymbolTotalCodewords=function(t){return Ur[t]};It.getBCHDigit=function(r){let t=0;for(;r!==0;)t++,r>>>=1;return t};It.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');oo=t};It.isKanjiModeEnabled=function(){return typeof oo<"u"};It.toSJIS=function(t){return oo(t)}});var Se=W(Y=>{"use strict";Y.L={bit:1};Y.M={bit:0};Y.Q={bit:3};Y.H={bit:2};function Nr(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return Y.L;case"m":case"medium":return Y.M;case"q":case"quartile":return Y.Q;case"h":case"high":return Y.H;default:throw new Error("Unknown EC Level: "+r)}}Y.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};Y.from=function(t,e){if(Y.isValid(t))return t;try{return Nr(t)}catch{return e}}});var li=W((dd,ai)=>{"use strict";function si(){this.buffer=[],this.length=0}si.prototype={get:function(r){let t=Math.floor(r/8);return(this.buffer[t]>>>7-r%8&1)===1},put:function(r,t){for(let e=0;e<t;e++)this.putBit((r>>>t-e-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),r&&(this.buffer[t]|=128>>>this.length%8),this.length++}};ai.exports=si});var ui=W((pd,ci)=>{"use strict";function ee(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}ee.prototype.set=function(r,t,e,i){let n=r*this.size+t;this.data[n]=e,i&&(this.reservedBit[n]=!0)};ee.prototype.get=function(r,t){return this.data[r*this.size+t]};ee.prototype.xor=function(r,t,e){this.data[r*this.size+t]^=e};ee.prototype.isReserved=function(r,t){return this.reservedBit[r*this.size+t]};ci.exports=ee});var di=W(Te=>{"use strict";var Mr=gt().getSymbolSize;Te.getRowColCoords=function(t){if(t===1)return[];let e=Math.floor(t/7)+2,i=Mr(t),n=i===145?26:Math.ceil((i-13)/(2*e-2))*2,o=[i-7];for(let s=1;s<e-1;s++)o[s]=o[s-1]-n;return o.push(6),o.reverse()};Te.getPositions=function(t){let e=[],i=Te.getRowColCoords(t),n=i.length;for(let o=0;o<n;o++)for(let s=0;s<n;s++)o===0&&s===0||o===0&&s===n-1||o===n-1&&s===0||e.push([i[o],i[s]]);return e}});var mi=W(hi=>{"use strict";var qr=gt().getSymbolSize,pi=7;hi.getPositions=function(t){let e=qr(t);return[[0,0],[e-pi,0],[0,e-pi]]}});var fi=W(O=>{"use strict";O.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var Wt={N1:3,N2:3,N3:40,N4:10};O.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};O.from=function(t){return O.isValid(t)?parseInt(t,10):void 0};O.getPenaltyN1=function(t){let e=t.size,i=0,n=0,o=0,s=null,a=null;for(let u=0;u<e;u++){n=o=0,s=a=null;for(let b=0;b<e;b++){let w=t.get(u,b);w===s?n++:(n>=5&&(i+=Wt.N1+(n-5)),s=w,n=1),w=t.get(b,u),w===a?o++:(o>=5&&(i+=Wt.N1+(o-5)),a=w,o=1)}n>=5&&(i+=Wt.N1+(n-5)),o>=5&&(i+=Wt.N1+(o-5))}return i};O.getPenaltyN2=function(t){let e=t.size,i=0;for(let n=0;n<e-1;n++)for(let o=0;o<e-1;o++){let s=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);(s===4||s===0)&&i++}return i*Wt.N2};O.getPenaltyN3=function(t){let e=t.size,i=0,n=0,o=0;for(let s=0;s<e;s++){n=o=0;for(let a=0;a<e;a++)n=n<<1&2047|t.get(s,a),a>=10&&(n===1488||n===93)&&i++,o=o<<1&2047|t.get(a,s),a>=10&&(o===1488||o===93)&&i++}return i*Wt.N3};O.getPenaltyN4=function(t){let e=0,i=t.data.length;for(let o=0;o<i;o++)e+=t.data[o];return Math.abs(Math.ceil(e*100/i/5)-10)*Wt.N4};function Fr(r,t,e){switch(r){case O.Patterns.PATTERN000:return(t+e)%2===0;case O.Patterns.PATTERN001:return t%2===0;case O.Patterns.PATTERN010:return e%3===0;case O.Patterns.PATTERN011:return(t+e)%3===0;case O.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2===0;case O.Patterns.PATTERN101:return t*e%2+t*e%3===0;case O.Patterns.PATTERN110:return(t*e%2+t*e%3)%2===0;case O.Patterns.PATTERN111:return(t*e%3+(t+e)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}O.applyMask=function(t,e){let i=e.size;for(let n=0;n<i;n++)for(let o=0;o<i;o++)e.isReserved(o,n)||e.xor(o,n,Fr(t,o,n))};O.getBestMask=function(t,e){let i=Object.keys(O.Patterns).length,n=0,o=1/0;for(let s=0;s<i;s++){e(s),O.applyMask(s,t);let a=O.getPenaltyN1(t)+O.getPenaltyN2(t)+O.getPenaltyN3(t)+O.getPenaltyN4(t);O.applyMask(s,t),a<o&&(o=a,n=s)}return n}});var ro=W(io=>{"use strict";var wt=Se(),Le=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Be=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];io.getBlocksCount=function(t,e){switch(e){case wt.L:return Le[(t-1)*4+0];case wt.M:return Le[(t-1)*4+1];case wt.Q:return Le[(t-1)*4+2];case wt.H:return Le[(t-1)*4+3];default:return}};io.getTotalCodewordsCount=function(t,e){switch(e){case wt.L:return Be[(t-1)*4+0];case wt.M:return Be[(t-1)*4+1];case wt.Q:return Be[(t-1)*4+2];case wt.H:return Be[(t-1)*4+3];default:return}}});var gi=W(Pe=>{"use strict";var oe=new Uint8Array(512),Oe=new Uint8Array(256);(function(){let t=1;for(let e=0;e<255;e++)oe[e]=t,Oe[t]=e,t<<=1,t&256&&(t^=285);for(let e=255;e<512;e++)oe[e]=oe[e-255]})();Pe.log=function(t){if(t<1)throw new Error("log("+t+")");return Oe[t]};Pe.exp=function(t){return oe[t]};Pe.mul=function(t,e){return t===0||e===0?0:oe[Oe[t]+Oe[e]]}});var wi=W(ie=>{"use strict";var no=gi();ie.mul=function(t,e){let i=new Uint8Array(t.length+e.length-1);for(let n=0;n<t.length;n++)for(let o=0;o<e.length;o++)i[n+o]^=no.mul(t[n],e[o]);return i};ie.mod=function(t,e){let i=new Uint8Array(t);for(;i.length-e.length>=0;){let n=i[0];for(let s=0;s<e.length;s++)i[s]^=no.mul(e[s],n);let o=0;for(;o<i.length&&i[o]===0;)o++;i=i.slice(o)}return i};ie.generateECPolynomial=function(t){let e=new Uint8Array([1]);for(let i=0;i<t;i++)e=ie.mul(e,new Uint8Array([1,no.exp(i)]));return e}});var xi=W((vd,vi)=>{"use strict";var bi=wi();function so(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}so.prototype.initialize=function(t){this.degree=t,this.genPoly=bi.generateECPolynomial(this.degree)};so.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");let e=new Uint8Array(t.length+this.degree);e.set(t);let i=bi.mod(e,this.genPoly),n=this.degree-i.length;if(n>0){let o=new Uint8Array(this.degree);return o.set(i,n),o}return i};vi.exports=so});var ao=W(yi=>{"use strict";yi.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var lo=W(ct=>{"use strict";var Ci="[0-9]+",Vr="[A-Z $%*+\\-./:]+",re="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";re=re.replace(/u/g,"\\u");var Hr="(?:(?![A-Z0-9 $%*+\\-./:]|"+re+`)(?:.|[\r
|
|
2
|
+
]))+`;ct.KANJI=new RegExp(re,"g");ct.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");ct.BYTE=new RegExp(Hr,"g");ct.NUMERIC=new RegExp(Ci,"g");ct.ALPHANUMERIC=new RegExp(Vr,"g");var Kr=new RegExp("^"+re+"$"),Gr=new RegExp("^"+Ci+"$"),Yr=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ct.testKanji=function(t){return Kr.test(t)};ct.testNumeric=function(t){return Gr.test(t)};ct.testAlphanumeric=function(t){return Yr.test(t)}});var bt=W(j=>{"use strict";var Jr=ao(),co=lo();j.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};j.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};j.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};j.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};j.MIXED={bit:-1};j.getCharCountIndicator=function(t,e){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!Jr.isValid(e))throw new Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]};j.getBestModeForData=function(t){return co.testNumeric(t)?j.NUMERIC:co.testAlphanumeric(t)?j.ALPHANUMERIC:co.testKanji(t)?j.KANJI:j.BYTE};j.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};j.isValid=function(t){return t&&t.bit&&t.ccBits};function Qr(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return j.NUMERIC;case"alphanumeric":return j.ALPHANUMERIC;case"kanji":return j.KANJI;case"byte":return j.BYTE;default:throw new Error("Unknown mode: "+r)}}j.from=function(t,e){if(j.isValid(t))return t;try{return Qr(t)}catch{return e}}});var Ii=W(St=>{"use strict";var Ae=gt(),Xr=ro(),Ei=Se(),vt=bt(),uo=ao(),$i=7973,Ri=Ae.getBCHDigit($i);function Zr(r,t,e){for(let i=1;i<=40;i++)if(t<=St.getCapacity(i,e,r))return i}function _i(r,t){return vt.getCharCountIndicator(r,t)+4}function tn(r,t){let e=0;return r.forEach(function(i){let n=_i(i.mode,t);e+=n+i.getBitsLength()}),e}function en(r,t){for(let e=1;e<=40;e++)if(tn(r,e)<=St.getCapacity(e,t,vt.MIXED))return e}St.from=function(t,e){return uo.isValid(t)?parseInt(t,10):e};St.getCapacity=function(t,e,i){if(!uo.isValid(t))throw new Error("Invalid QR Code version");typeof i>"u"&&(i=vt.BYTE);let n=Ae.getSymbolTotalCodewords(t),o=Xr.getTotalCodewordsCount(t,e),s=(n-o)*8;if(i===vt.MIXED)return s;let a=s-_i(i,t);switch(i){case vt.NUMERIC:return Math.floor(a/10*3);case vt.ALPHANUMERIC:return Math.floor(a/11*2);case vt.KANJI:return Math.floor(a/13);case vt.BYTE:default:return Math.floor(a/8)}};St.getBestVersionForData=function(t,e){let i,n=Ei.from(e,Ei.M);if(Array.isArray(t)){if(t.length>1)return en(t,n);if(t.length===0)return 1;i=t[0]}else i=t;return Zr(i.mode,i.getLength(),n)};St.getEncodedBits=function(t){if(!uo.isValid(t)||t<7)throw new Error("Invalid QR Code version");let e=t<<12;for(;Ae.getBCHDigit(e)-Ri>=0;)e^=$i<<Ae.getBCHDigit(e)-Ri;return t<<12|e}});var Li=W(Ti=>{"use strict";var po=gt(),Si=1335,on=21522,Wi=po.getBCHDigit(Si);Ti.getEncodedBits=function(t,e){let i=t.bit<<3|e,n=i<<10;for(;po.getBCHDigit(n)-Wi>=0;)n^=Si<<po.getBCHDigit(n)-Wi;return(i<<10|n)^on}});var Oi=W(($d,Bi)=>{"use strict";var rn=bt();function kt(r){this.mode=rn.NUMERIC,this.data=r.toString()}kt.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};kt.prototype.getLength=function(){return this.data.length};kt.prototype.getBitsLength=function(){return kt.getBitsLength(this.data.length)};kt.prototype.write=function(t){let e,i,n;for(e=0;e+3<=this.data.length;e+=3)i=this.data.substr(e,3),n=parseInt(i,10),t.put(n,10);let o=this.data.length-e;o>0&&(i=this.data.substr(e),n=parseInt(i,10),t.put(n,o*3+1))};Bi.exports=kt});var Ai=W((_d,Pi)=>{"use strict";var nn=bt(),ho=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function zt(r){this.mode=nn.ALPHANUMERIC,this.data=r}zt.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};zt.prototype.getLength=function(){return this.data.length};zt.prototype.getBitsLength=function(){return zt.getBitsLength(this.data.length)};zt.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let i=ho.indexOf(this.data[e])*45;i+=ho.indexOf(this.data[e+1]),t.put(i,11)}this.data.length%2&&t.put(ho.indexOf(this.data[e]),6)};Pi.exports=zt});var ji=W((Id,Di)=>{"use strict";Di.exports=function(t){for(var e=[],i=t.length,n=0;n<i;n++){var o=t.charCodeAt(n);if(o>=55296&&o<=56319&&i>n+1){var s=t.charCodeAt(n+1);s>=56320&&s<=57343&&(o=(o-55296)*1024+s-56320+65536,n+=1)}if(o<128){e.push(o);continue}if(o<2048){e.push(o>>6|192),e.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){e.push(o>>12|224),e.push(o>>6&63|128),e.push(o&63|128);continue}if(o>=65536&&o<=1114111){e.push(o>>18|240),e.push(o>>12&63|128),e.push(o>>6&63|128),e.push(o&63|128);continue}e.push(239,191,189)}return new Uint8Array(e).buffer}});var zi=W((Wd,ki)=>{"use strict";var sn=ji(),an=bt();function Ut(r){this.mode=an.BYTE,typeof r=="string"&&(r=sn(r)),this.data=new Uint8Array(r)}Ut.getBitsLength=function(t){return t*8};Ut.prototype.getLength=function(){return this.data.length};Ut.prototype.getBitsLength=function(){return Ut.getBitsLength(this.data.length)};Ut.prototype.write=function(r){for(let t=0,e=this.data.length;t<e;t++)r.put(this.data[t],8)};ki.exports=Ut});var Ni=W((Sd,Ui)=>{"use strict";var ln=bt(),cn=gt();function Nt(r){this.mode=ln.KANJI,this.data=r}Nt.getBitsLength=function(t){return t*13};Nt.prototype.getLength=function(){return this.data.length};Nt.prototype.getBitsLength=function(){return Nt.getBitsLength(this.data.length)};Nt.prototype.write=function(r){let t;for(t=0;t<this.data.length;t++){let e=cn.toSJIS(this.data[t]);if(e>=33088&&e<=40956)e-=33088;else if(e>=57408&&e<=60351)e-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
|
|
3
|
+
Make sure your charset is UTF-8`);e=(e>>>8&255)*192+(e&255),r.put(e,13)}};Ui.exports=Nt});var Mi=W((Td,mo)=>{"use strict";var ne={single_source_shortest_paths:function(r,t,e){var i={},n={};n[t]=0;var o=ne.PriorityQueue.make();o.push(t,0);for(var s,a,u,b,w,C,$,F,M;!o.empty();){s=o.pop(),a=s.value,b=s.cost,w=r[a]||{};for(u in w)w.hasOwnProperty(u)&&(C=w[u],$=b+C,F=n[u],M=typeof n[u]>"u",(M||F>$)&&(n[u]=$,o.push(u,$),i[u]=a))}if(typeof e<"u"&&typeof n[e]>"u"){var S=["Could not find a path from ",t," to ",e,"."].join("");throw new Error(S)}return i},extract_shortest_path_from_predecessor_list:function(r,t){for(var e=[],i=t,n;i;)e.push(i),n=r[i],i=r[i];return e.reverse(),e},find_path:function(r,t,e){var i=ne.single_source_shortest_paths(r,t,e);return ne.extract_shortest_path_from_predecessor_list(i,e)},PriorityQueue:{make:function(r){var t=ne.PriorityQueue,e={},i;r=r||{};for(i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e.queue=[],e.sorter=r.sorter||t.default_sorter,e},default_sorter:function(r,t){return r.cost-t.cost},push:function(r,t){var e={value:r,cost:t};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof mo<"u"&&(mo.exports=ne)});var Ji=W(Mt=>{"use strict";var I=bt(),Vi=Oi(),Hi=Ai(),Ki=zi(),Gi=Ni(),se=lo(),De=gt(),un=Mi();function qi(r){return unescape(encodeURIComponent(r)).length}function ae(r,t,e){let i=[],n;for(;(n=r.exec(e))!==null;)i.push({data:n[0],index:n.index,mode:t,length:n[0].length});return i}function Yi(r){let t=ae(se.NUMERIC,I.NUMERIC,r),e=ae(se.ALPHANUMERIC,I.ALPHANUMERIC,r),i,n;return De.isKanjiModeEnabled()?(i=ae(se.BYTE,I.BYTE,r),n=ae(se.KANJI,I.KANJI,r)):(i=ae(se.BYTE_KANJI,I.BYTE,r),n=[]),t.concat(e,i,n).sort(function(s,a){return s.index-a.index}).map(function(s){return{data:s.data,mode:s.mode,length:s.length}})}function fo(r,t){switch(t){case I.NUMERIC:return Vi.getBitsLength(r);case I.ALPHANUMERIC:return Hi.getBitsLength(r);case I.KANJI:return Gi.getBitsLength(r);case I.BYTE:return Ki.getBitsLength(r)}}function dn(r){return r.reduce(function(t,e){let i=t.length-1>=0?t[t.length-1]:null;return i&&i.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}function pn(r){let t=[];for(let e=0;e<r.length;e++){let i=r[e];switch(i.mode){case I.NUMERIC:t.push([i,{data:i.data,mode:I.ALPHANUMERIC,length:i.length},{data:i.data,mode:I.BYTE,length:i.length}]);break;case I.ALPHANUMERIC:t.push([i,{data:i.data,mode:I.BYTE,length:i.length}]);break;case I.KANJI:t.push([i,{data:i.data,mode:I.BYTE,length:qi(i.data)}]);break;case I.BYTE:t.push([{data:i.data,mode:I.BYTE,length:qi(i.data)}])}}return t}function hn(r,t){let e={},i={start:{}},n=["start"];for(let o=0;o<r.length;o++){let s=r[o],a=[];for(let u=0;u<s.length;u++){let b=s[u],w=""+o+u;a.push(w),e[w]={node:b,lastCount:0},i[w]={};for(let C=0;C<n.length;C++){let $=n[C];e[$]&&e[$].node.mode===b.mode?(i[$][w]=fo(e[$].lastCount+b.length,b.mode)-fo(e[$].lastCount,b.mode),e[$].lastCount+=b.length):(e[$]&&(e[$].lastCount=b.length),i[$][w]=fo(b.length,b.mode)+4+I.getCharCountIndicator(b.mode,t))}}n=a}for(let o=0;o<n.length;o++)i[n[o]].end=0;return{map:i,table:e}}function Fi(r,t){let e,i=I.getBestModeForData(r);if(e=I.from(t,i),e!==I.BYTE&&e.bit<i.bit)throw new Error('"'+r+'" cannot be encoded with mode '+I.toString(e)+`.
|
|
4
|
+
Suggested mode is: `+I.toString(i));switch(e===I.KANJI&&!De.isKanjiModeEnabled()&&(e=I.BYTE),e){case I.NUMERIC:return new Vi(r);case I.ALPHANUMERIC:return new Hi(r);case I.KANJI:return new Gi(r);case I.BYTE:return new Ki(r)}}Mt.fromArray=function(t){return t.reduce(function(e,i){return typeof i=="string"?e.push(Fi(i,null)):i.data&&e.push(Fi(i.data,i.mode)),e},[])};Mt.fromString=function(t,e){let i=Yi(t,De.isKanjiModeEnabled()),n=pn(i),o=hn(n,e),s=un.find_path(o.map,"start","end"),a=[];for(let u=1;u<s.length-1;u++)a.push(o.table[s[u]].node);return Mt.fromArray(dn(a))};Mt.rawSplit=function(t){return Mt.fromArray(Yi(t,De.isKanjiModeEnabled()))}});var Xi=W(Qi=>{"use strict";var ke=gt(),go=Se(),mn=li(),fn=ui(),gn=di(),wn=mi(),vo=fi(),xo=ro(),bn=xi(),je=Ii(),vn=Li(),xn=bt(),wo=Ji();function yn(r,t){let e=r.size,i=wn.getPositions(t);for(let n=0;n<i.length;n++){let o=i[n][0],s=i[n][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||e<=o+a))for(let u=-1;u<=7;u++)s+u<=-1||e<=s+u||(a>=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?r.set(o+a,s+u,!0,!0):r.set(o+a,s+u,!1,!0))}}function Cn(r){let t=r.size;for(let e=8;e<t-8;e++){let i=e%2===0;r.set(e,6,i,!0),r.set(6,e,i,!0)}}function En(r,t){let e=gn.getPositions(t);for(let i=0;i<e.length;i++){let n=e[i][0],o=e[i][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?r.set(n+s,o+a,!0,!0):r.set(n+s,o+a,!1,!0)}}function Rn(r,t){let e=r.size,i=je.getEncodedBits(t),n,o,s;for(let a=0;a<18;a++)n=Math.floor(a/3),o=a%3+e-8-3,s=(i>>a&1)===1,r.set(n,o,s,!0),r.set(o,n,s,!0)}function bo(r,t,e){let i=r.size,n=vn.getEncodedBits(t,e),o,s;for(o=0;o<15;o++)s=(n>>o&1)===1,o<6?r.set(o,8,s,!0):o<8?r.set(o+1,8,s,!0):r.set(i-15+o,8,s,!0),o<8?r.set(8,i-o-1,s,!0):o<9?r.set(8,15-o-1+1,s,!0):r.set(8,15-o-1,s,!0);r.set(i-8,8,1,!0)}function $n(r,t){let e=r.size,i=-1,n=e-1,o=7,s=0;for(let a=e-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!r.isReserved(n,a-u)){let b=!1;s<t.length&&(b=(t[s]>>>o&1)===1),r.set(n,a-u,b),o--,o===-1&&(s++,o=7)}if(n+=i,n<0||e<=n){n-=i,i=-i;break}}}function _n(r,t,e){let i=new mn;e.forEach(function(u){i.put(u.mode.bit,4),i.put(u.getLength(),xn.getCharCountIndicator(u.mode,r)),u.write(i)});let n=ke.getSymbolTotalCodewords(r),o=xo.getTotalCodewordsCount(r,t),s=(n-o)*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);let a=(s-i.getLengthInBits())/8;for(let u=0;u<a;u++)i.put(u%2?17:236,8);return In(i,r,t)}function In(r,t,e){let i=ke.getSymbolTotalCodewords(t),n=xo.getTotalCodewordsCount(t,e),o=i-n,s=xo.getBlocksCount(t,e),a=i%s,u=s-a,b=Math.floor(i/s),w=Math.floor(o/s),C=w+1,$=b-w,F=new bn($),M=0,S=new Array(s),_=new Array(s),k=0,T=new Uint8Array(r.buffer);for(let Ot=0;Ot<s;Ot++){let He=Ot<u?w:C;S[Ot]=T.slice(M,M+He),_[Ot]=F.encode(S[Ot]),M+=He,k=Math.max(k,He)}let z=new Uint8Array(i),A=0,D,nt;for(D=0;D<k;D++)for(nt=0;nt<s;nt++)D<S[nt].length&&(z[A++]=S[nt][D]);for(D=0;D<$;D++)for(nt=0;nt<s;nt++)z[A++]=_[nt][D];return z}function Wn(r,t,e,i){let n;if(Array.isArray(r))n=wo.fromArray(r);else if(typeof r=="string"){let b=t;if(!b){let w=wo.rawSplit(r);b=je.getBestVersionForData(w,e)}n=wo.fromString(r,b||40)}else throw new Error("Invalid data");let o=je.getBestVersionForData(n,e);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=o;else if(t<o)throw new Error(`
|
|
5
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
6
|
+
Minimum version required to store current data is: `+o+`.
|
|
7
|
+
`);let s=_n(t,e,n),a=ke.getSymbolSize(t),u=new fn(a);return yn(u,t),Cn(u),En(u,t),bo(u,e,0),t>=7&&Rn(u,t),$n(u,s),isNaN(i)&&(i=vo.getBestMask(u,bo.bind(null,u,e))),vo.applyMask(i,u),bo(u,e,i),{modules:u,version:t,errorCorrectionLevel:e,maskPattern:i,segments:n}}Qi.create=function(t,e){if(typeof t>"u"||t==="")throw new Error("No input text");let i=go.M,n,o;return typeof e<"u"&&(i=go.from(e.errorCorrectionLevel,go.M),n=je.from(e.version),o=vo.from(e.maskPattern),e.toSJISFunc&&ke.setToSJISFunction(e.toSJISFunc)),Wn(t,n,i,o)}});var yo=W(Tt=>{"use strict";function Zi(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let t=r.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+r);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(i){return[i,i]}))),t.length===6&&t.push("F","F");let e=parseInt(t.join(""),16);return{r:e>>24&255,g:e>>16&255,b:e>>8&255,a:e&255,hex:"#"+t.slice(0,6).join("")}}Tt.getOptions=function(t){t||(t={}),t.color||(t.color={});let e=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,i=t.width&&t.width>=21?t.width:void 0,n=t.scale||4;return{width:i,scale:i?4:n,margin:e,color:{dark:Zi(t.color.dark||"#000000ff"),light:Zi(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}};Tt.getScale=function(t,e){return e.width&&e.width>=t+e.margin*2?e.width/(t+e.margin*2):e.scale};Tt.getImageWidth=function(t,e){let i=Tt.getScale(t,e);return Math.floor((t+e.margin*2)*i)};Tt.qrToImageData=function(t,e,i){let n=e.modules.size,o=e.modules.data,s=Tt.getScale(n,i),a=Math.floor((n+i.margin*2)*s),u=i.margin*s,b=[i.color.light,i.color.dark];for(let w=0;w<a;w++)for(let C=0;C<a;C++){let $=(w*a+C)*4,F=i.color.light;if(w>=u&&C>=u&&w<a-u&&C<a-u){let M=Math.floor((w-u)/s),S=Math.floor((C-u)/s);F=b[o[M*n+S]?1:0]}t[$++]=F.r,t[$++]=F.g,t[$++]=F.b,t[$]=F.a}}});var tr=W(ze=>{"use strict";var Co=yo();function Sn(r,t,e){r.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=e,t.width=e,t.style.height=e+"px",t.style.width=e+"px"}function Tn(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}ze.render=function(t,e,i){let n=i,o=e;typeof n>"u"&&(!e||!e.getContext)&&(n=e,e=void 0),e||(o=Tn()),n=Co.getOptions(n);let s=Co.getImageWidth(t.modules.size,n),a=o.getContext("2d"),u=a.createImageData(s,s);return Co.qrToImageData(u.data,t,n),Sn(a,o,s),a.putImageData(u,0,0),o};ze.renderToDataURL=function(t,e,i){let n=i;typeof n>"u"&&(!e||!e.getContext)&&(n=e,e=void 0),n||(n={});let o=ze.render(t,e,n),s=n.type||"image/png",a=n.rendererOpts||{};return o.toDataURL(s,a.quality)}});var ir=W(or=>{"use strict";var Ln=yo();function er(r,t){let e=r.a/255,i=t+'="'+r.hex+'"';return e<1?i+" "+t+'-opacity="'+e.toFixed(2).slice(1)+'"':i}function Eo(r,t,e){let i=r+t;return typeof e<"u"&&(i+=" "+e),i}function Bn(r,t,e){let i="",n=0,o=!1,s=0;for(let a=0;a<r.length;a++){let u=Math.floor(a%t),b=Math.floor(a/t);!u&&!o&&(o=!0),r[a]?(s++,a>0&&u>0&&r[a-1]||(i+=o?Eo("M",u+e,.5+b+e):Eo("m",n,0),n=0,o=!1),u+1<t&&r[a+1]||(i+=Eo("h",s),s=0)):n++}return i}or.render=function(t,e,i){let n=Ln.getOptions(e),o=t.modules.size,s=t.modules.data,a=o+n.margin*2,u=n.color.light.a?"<path "+er(n.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",b="<path "+er(n.color.dark,"stroke")+' d="'+Bn(s,o,n.margin)+'"/>',w='viewBox="0 0 '+a+" "+a+'"',$='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+w+' shape-rendering="crispEdges">'+u+b+`</svg>
|
|
8
|
+
`;return typeof i=="function"&&i(null,$),$}});var nr=W(le=>{"use strict";var On=ni(),Ro=Xi(),rr=tr(),Pn=ir();function $o(r,t,e,i,n){let o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!On())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(n=e,e=t,t=i=void 0):s===3&&(t.getContext&&typeof n>"u"?(n=i,i=void 0):(n=i,i=e,e=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(e=t,t=i=void 0):s===2&&!t.getContext&&(i=e,e=t,t=void 0),new Promise(function(u,b){try{let w=Ro.create(e,i);u(r(w,t,i))}catch(w){b(w)}})}try{let u=Ro.create(e,i);n(null,r(u,t,i))}catch(u){n(u)}}le.create=Ro.create;le.toCanvas=$o.bind(null,rr.render);le.toDataURL=$o.bind(null,rr.renderToDataURL);le.toString=$o.bind(null,function(r,t,e){return Pn.render(r,e)})});var Uo=g`
|
|
9
|
+
:host {
|
|
10
|
+
position: relative;
|
|
11
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
width: var(--local-size);
|
|
16
|
+
height: var(--local-size);
|
|
17
|
+
border-radius: inherit;
|
|
18
|
+
border-radius: var(--local-border-radius);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host > wui-flex {
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
border-radius: inherit;
|
|
24
|
+
border-radius: var(--local-border-radius);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:host::after {
|
|
28
|
+
content: '';
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 0;
|
|
31
|
+
bottom: 0;
|
|
32
|
+
left: 0;
|
|
33
|
+
right: 0;
|
|
34
|
+
border-radius: inherit;
|
|
35
|
+
border: 1px solid var(--wui-color-gray-glass-010);
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host([name='Extension'])::after {
|
|
40
|
+
border: 1px solid var(--wui-color-accent-glass-010);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([data-wallet-icon='allWallets']) {
|
|
44
|
+
background-color: var(--wui-all-wallets-bg-100);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([data-wallet-icon='allWallets'])::after {
|
|
48
|
+
border: 1px solid var(--wui-color-accent-glass-010);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
wui-icon[data-parent-size='inherit'] {
|
|
52
|
+
width: 75%;
|
|
53
|
+
height: 75%;
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
wui-icon[data-parent-size='sm'] {
|
|
58
|
+
width: 18px;
|
|
59
|
+
height: 18px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
wui-icon[data-parent-size='md'] {
|
|
63
|
+
width: 24px;
|
|
64
|
+
height: 24px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
wui-icon[data-parent-size='lg'] {
|
|
68
|
+
width: 42px;
|
|
69
|
+
height: 42px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
wui-icon[data-parent-size='full'] {
|
|
73
|
+
width: 100%;
|
|
74
|
+
height: 100%;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host > wui-icon-box {
|
|
78
|
+
position: absolute;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
right: -1px;
|
|
81
|
+
bottom: -2px;
|
|
82
|
+
z-index: 1;
|
|
83
|
+
border: 2px solid var(--wui-color-bg-150, #1e1f1f);
|
|
84
|
+
padding: 1px;
|
|
85
|
+
}
|
|
86
|
+
`;var Ct=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},at=class extends p{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let t="xxs";return this.size==="lg"?t="m":this.size==="md"?t="xs":t="xxs",this.style.cssText=`
|
|
87
|
+
--local-border-radius: var(--wui-border-radius-${t});
|
|
88
|
+
--local-size: var(--wui-wallet-image-size-${this.size});
|
|
89
|
+
`,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),l`
|
|
90
|
+
<wui-flex justifyContent="center" alignItems="center"> ${this.templateVisual()} </wui-flex>
|
|
91
|
+
`}templateVisual(){return this.imageSrc?l`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:this.walletIcon?l`<wui-icon
|
|
92
|
+
data-parent-size="md"
|
|
93
|
+
size="md"
|
|
94
|
+
color="inherit"
|
|
95
|
+
name=${this.walletIcon}
|
|
96
|
+
></wui-icon>`:l`<wui-icon
|
|
97
|
+
data-parent-size=${this.size}
|
|
98
|
+
size="inherit"
|
|
99
|
+
color="inherit"
|
|
100
|
+
name="walletPlaceholder"
|
|
101
|
+
></wui-icon>`}};at.styles=[L,y,Uo];Ct([c()],at.prototype,"size",void 0);Ct([c()],at.prototype,"name",void 0);Ct([c()],at.prototype,"imageSrc",void 0);Ct([c()],at.prototype,"walletIcon",void 0);Ct([c({type:Boolean})],at.prototype,"installed",void 0);Ct([c()],at.prototype,"badgeSize",void 0);at=Ct([d("wui-wallet-image")],at);var No=g`
|
|
102
|
+
:host {
|
|
103
|
+
position: relative;
|
|
104
|
+
border-radius: var(--wui-border-radius-xxs);
|
|
105
|
+
width: 40px;
|
|
106
|
+
height: 40px;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
background: var(--wui-color-gray-glass-002);
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
align-items: center;
|
|
112
|
+
flex-wrap: wrap;
|
|
113
|
+
gap: var(--wui-spacing-4xs);
|
|
114
|
+
padding: 3.75px !important;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:host::after {
|
|
118
|
+
content: '';
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: 0;
|
|
121
|
+
bottom: 0;
|
|
122
|
+
left: 0;
|
|
123
|
+
right: 0;
|
|
124
|
+
border-radius: inherit;
|
|
125
|
+
border: 1px solid var(--wui-color-gray-glass-010);
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host > wui-wallet-image {
|
|
130
|
+
width: 14px;
|
|
131
|
+
height: 14px;
|
|
132
|
+
border-radius: var(--wui-border-radius-5xs);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
:host > wui-flex {
|
|
136
|
+
padding: 2px;
|
|
137
|
+
position: fixed;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
left: 34px;
|
|
140
|
+
bottom: 8px;
|
|
141
|
+
background: var(--dark-background-150, #1e1f1f);
|
|
142
|
+
border-radius: 50%;
|
|
143
|
+
z-index: 2;
|
|
144
|
+
display: flex;
|
|
145
|
+
}
|
|
146
|
+
`;var Mo=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Ye=4,me=class extends p{constructor(){super(...arguments),this.walletImages=[]}render(){let t=this.walletImages.length<Ye;return l`${this.walletImages.slice(0,Ye).map(({src:e,walletName:i})=>l`
|
|
147
|
+
<wui-wallet-image
|
|
148
|
+
size="inherit"
|
|
149
|
+
imageSrc=${e}
|
|
150
|
+
name=${h(i)}
|
|
151
|
+
></wui-wallet-image>
|
|
152
|
+
`)}
|
|
153
|
+
${t?[...Array(Ye-this.walletImages.length)].map(()=>l` <wui-wallet-image size="inherit" name=""></wui-wallet-image>`):null}
|
|
154
|
+
<wui-flex>
|
|
155
|
+
<wui-icon-box
|
|
156
|
+
size="xxs"
|
|
157
|
+
iconSize="xxs"
|
|
158
|
+
iconcolor="success-100"
|
|
159
|
+
backgroundcolor="success-100"
|
|
160
|
+
icon="checkmark"
|
|
161
|
+
background="opaque"
|
|
162
|
+
></wui-icon-box>
|
|
163
|
+
</wui-flex>`}};me.styles=[y,No];Mo([c({type:Array})],me.prototype,"walletImages",void 0);me=Mo([d("wui-all-wallets-image")],me);var qo=g`
|
|
164
|
+
button {
|
|
165
|
+
column-gap: var(--wui-spacing-s);
|
|
166
|
+
padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs);
|
|
167
|
+
width: 100%;
|
|
168
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
169
|
+
border-radius: var(--wui-border-radius-xs);
|
|
170
|
+
color: var(--wui-color-fg-100);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
button > wui-text:nth-child(2) {
|
|
174
|
+
display: flex;
|
|
175
|
+
flex: 1;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
button:disabled {
|
|
179
|
+
background-color: var(--wui-color-gray-glass-015);
|
|
180
|
+
color: var(--wui-color-gray-glass-015);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
button:disabled > wui-tag {
|
|
184
|
+
background-color: var(--wui-color-gray-glass-010);
|
|
185
|
+
color: var(--wui-color-fg-300);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
wui-icon {
|
|
189
|
+
color: var(--wui-color-fg-200) !important;
|
|
190
|
+
}
|
|
191
|
+
`;var V=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},q=class extends p{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.tabIdx=void 0,this.installed=!1,this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100"}render(){return l`
|
|
192
|
+
<button ?disabled=${this.disabled} tabindex=${h(this.tabIdx)}>
|
|
193
|
+
${this.templateAllWallets()} ${this.templateWalletImage()}
|
|
194
|
+
<wui-text variant="paragraph-500" color="inherit">${this.name}</wui-text>
|
|
195
|
+
${this.templateStatus()}
|
|
196
|
+
</button>
|
|
197
|
+
`}templateAllWallets(){return this.showAllWallets&&this.imageSrc?l` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `:this.showAllWallets&&this.walletIcon?l` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?l`<wui-wallet-image
|
|
198
|
+
size="sm"
|
|
199
|
+
imageSrc=${this.imageSrc}
|
|
200
|
+
name=${this.name}
|
|
201
|
+
.installed=${this.installed}
|
|
202
|
+
></wui-wallet-image>`:!this.showAllWallets&&!this.imageSrc?l`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`:null}templateStatus(){return this.loading?l`<wui-loading-spinner
|
|
203
|
+
size="lg"
|
|
204
|
+
color=${this.loadingSpinnerColor}
|
|
205
|
+
></wui-loading-spinner>`:this.tagLabel&&this.tagVariant?l`<wui-tag variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`:this.icon?l`<wui-icon color="inherit" size="sm" name=${this.icon}></wui-icon>`:null}};q.styles=[y,L,qo];V([c({type:Array})],q.prototype,"walletImages",void 0);V([c()],q.prototype,"imageSrc",void 0);V([c()],q.prototype,"name",void 0);V([c()],q.prototype,"tagLabel",void 0);V([c()],q.prototype,"tagVariant",void 0);V([c()],q.prototype,"icon",void 0);V([c()],q.prototype,"walletIcon",void 0);V([c()],q.prototype,"tabIdx",void 0);V([c({type:Boolean})],q.prototype,"installed",void 0);V([c({type:Boolean})],q.prototype,"disabled",void 0);V([c({type:Boolean})],q.prototype,"showAllWallets",void 0);V([c({type:Boolean})],q.prototype,"loading",void 0);V([c({type:String})],q.prototype,"loadingSpinnerColor",void 0);q=V([d("wui-list-wallet")],q);var Pt=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Et=class extends p{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=v.state.connectors,this.count=R.state.count,this.filteredCount=R.state.filteredWallets.length,this.isFetchingRecommendedWallets=R.state.isFetchingRecommendedWallets,this.unsubscribe.push(v.subscribeKey("connectors",t=>this.connectors=t),R.subscribeKey("count",t=>this.count=t),R.subscribeKey("filteredWallets",t=>this.filteredCount=t.length),R.subscribeKey("isFetchingRecommendedWallets",t=>this.isFetchingRecommendedWallets=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let t=this.connectors.find(u=>u.id==="walletConnect"),{allWallets:e}=N.state;if(!t||e==="HIDE"||e==="ONLY_MOBILE"&&!f.isMobile())return null;let i=R.state.featured.length,n=this.count+i,o=n<10?n:Math.floor(n/10)*10,s=this.filteredCount>0?this.filteredCount:o,a=`${s}`;return this.filteredCount>0?a=`${this.filteredCount}`:s<n&&(a=`${s}+`),l`
|
|
206
|
+
<wui-list-wallet
|
|
207
|
+
name="All Wallets"
|
|
208
|
+
walletIcon="allWallets"
|
|
209
|
+
showAllWallets
|
|
210
|
+
@click=${this.onAllWallets.bind(this)}
|
|
211
|
+
tagLabel=${a}
|
|
212
|
+
tagVariant="shade"
|
|
213
|
+
data-testid="all-wallets"
|
|
214
|
+
tabIdx=${h(this.tabIdx)}
|
|
215
|
+
.loading=${this.isFetchingRecommendedWallets}
|
|
216
|
+
loadingSpinnerColor=${this.isFetchingRecommendedWallets?"fg-300":"accent-100"}
|
|
217
|
+
></wui-list-wallet>
|
|
218
|
+
`}onAllWallets(){U.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),E.push("AllWallets")}};Pt([c()],Et.prototype,"tabIdx",void 0);Pt([m()],Et.prototype,"connectors",void 0);Pt([m()],Et.prototype,"count",void 0);Pt([m()],Et.prototype,"filteredCount",void 0);Pt([m()],Et.prototype,"isFetchingRecommendedWallets",void 0);Et=Pt([d("w3m-all-wallets-widget")],Et);var Je=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},fe=class extends p{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=v.state.connectors,this.unsubscribe.push(v.subscribeKey("connectors",t=>this.connectors=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let t=this.connectors.filter(e=>e.type==="ANNOUNCED");return t?.length?l`
|
|
219
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
220
|
+
${t.filter(st.showConnector).map(e=>l`
|
|
221
|
+
<wui-list-wallet
|
|
222
|
+
imageSrc=${h(B.getConnectorImage(e))}
|
|
223
|
+
name=${e.name??"Unknown"}
|
|
224
|
+
@click=${()=>this.onConnector(e)}
|
|
225
|
+
tagVariant="success"
|
|
226
|
+
tagLabel="installed"
|
|
227
|
+
data-testid=${`wallet-selector-${e.id}`}
|
|
228
|
+
.installed=${!0}
|
|
229
|
+
tabIdx=${h(this.tabIdx)}
|
|
230
|
+
>
|
|
231
|
+
</wui-list-wallet>
|
|
232
|
+
`)}
|
|
233
|
+
</wui-flex>
|
|
234
|
+
`:(this.style.cssText="display: none",null)}onConnector(t){t.id==="walletConnect"?f.isMobile()?E.push("AllWallets"):E.push("ConnectingWalletConnect"):E.push("ConnectingExternal",{connector:t})}};Je([c()],fe.prototype,"tabIdx",void 0);Je([m()],fe.prototype,"connectors",void 0);fe=Je([d("w3m-connect-announced-widget")],fe);var ge=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Jt=class extends p{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=v.state.connectors,this.loading=!1,this.unsubscribe.push(v.subscribeKey("connectors",t=>this.connectors=t)),f.isTelegram()&&f.isIos()&&(this.loading=!x.state.wcUri,this.unsubscribe.push(x.subscribeKey("wcUri",t=>this.loading=!t)))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let{customWallets:t}=N.state;if(!t?.length)return this.style.cssText="display: none",null;let e=this.filterOutDuplicateWallets(t);return l`<wui-flex flexDirection="column" gap="xs">
|
|
235
|
+
${e.map(i=>l`
|
|
236
|
+
<wui-list-wallet
|
|
237
|
+
imageSrc=${h(B.getWalletImage(i))}
|
|
238
|
+
name=${i.name??"Unknown"}
|
|
239
|
+
@click=${()=>this.onConnectWallet(i)}
|
|
240
|
+
data-testid=${`wallet-selector-${i.id}`}
|
|
241
|
+
tabIdx=${h(this.tabIdx)}
|
|
242
|
+
?loading=${this.loading}
|
|
243
|
+
>
|
|
244
|
+
</wui-list-wallet>
|
|
245
|
+
`)}
|
|
246
|
+
</wui-flex>`}filterOutDuplicateWallets(t){let e=pt.getRecentWallets(),i=this.connectors.map(a=>a.info?.rdns).filter(Boolean),n=e.map(a=>a.rdns).filter(Boolean),o=i.concat(n);if(o.includes("io.metamask.mobile")&&f.isMobile()){let a=o.indexOf("io.metamask.mobile");o[a]="io.metamask"}return t.filter(a=>!o.includes(String(a?.rdns)))}onConnectWallet(t){this.loading||E.push("ConnectingWalletConnect",{wallet:t})}};ge([c()],Jt.prototype,"tabIdx",void 0);ge([m()],Jt.prototype,"connectors",void 0);ge([m()],Jt.prototype,"loading",void 0);Jt=ge([d("w3m-connect-custom-widget")],Jt);var Qe=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},we=class extends p{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=v.state.connectors,this.unsubscribe.push(v.subscribeKey("connectors",t=>this.connectors=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let i=this.connectors.filter(n=>n.type==="EXTERNAL").filter(st.showConnector).filter(n=>n.id!==Ao.CONNECTOR_ID.COINBASE_SDK);return i?.length?l`
|
|
247
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
248
|
+
${i.map(n=>l`
|
|
249
|
+
<wui-list-wallet
|
|
250
|
+
imageSrc=${h(B.getConnectorImage(n))}
|
|
251
|
+
.installed=${!0}
|
|
252
|
+
name=${n.name??"Unknown"}
|
|
253
|
+
data-testid=${`wallet-selector-external-${n.id}`}
|
|
254
|
+
@click=${()=>this.onConnector(n)}
|
|
255
|
+
tabIdx=${h(this.tabIdx)}
|
|
256
|
+
>
|
|
257
|
+
</wui-list-wallet>
|
|
258
|
+
`)}
|
|
259
|
+
</wui-flex>
|
|
260
|
+
`:(this.style.cssText="display: none",null)}onConnector(t){E.push("ConnectingExternal",{connector:t})}};Qe([c()],we.prototype,"tabIdx",void 0);Qe([m()],we.prototype,"connectors",void 0);we=Qe([d("w3m-connect-external-widget")],we);var Xe=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},be=class extends p{constructor(){super(...arguments),this.tabIdx=void 0,this.wallets=[]}render(){return this.wallets.length?l`
|
|
261
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
262
|
+
${this.wallets.map(t=>l`
|
|
263
|
+
<wui-list-wallet
|
|
264
|
+
data-testid=${`wallet-selector-featured-${t.id}`}
|
|
265
|
+
imageSrc=${h(B.getWalletImage(t))}
|
|
266
|
+
name=${t.name??"Unknown"}
|
|
267
|
+
@click=${()=>this.onConnectWallet(t)}
|
|
268
|
+
tabIdx=${h(this.tabIdx)}
|
|
269
|
+
>
|
|
270
|
+
</wui-list-wallet>
|
|
271
|
+
`)}
|
|
272
|
+
</wui-flex>
|
|
273
|
+
`:(this.style.cssText="display: none",null)}onConnectWallet(t){v.selectWalletConnector(t)}};Xe([c()],be.prototype,"tabIdx",void 0);Xe([c()],be.prototype,"wallets",void 0);be=Xe([d("w3m-connect-featured-widget")],be);var Ze=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},ve=class extends p{constructor(){super(...arguments),this.tabIdx=void 0,this.connectors=[]}render(){let t=this.connectors.filter(st.showConnector);return t.length===0?(this.style.cssText="display: none",null):l`
|
|
274
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
275
|
+
${t.map(e=>l`
|
|
276
|
+
<wui-list-wallet
|
|
277
|
+
imageSrc=${h(B.getConnectorImage(e))}
|
|
278
|
+
.installed=${!0}
|
|
279
|
+
name=${e.name??"Unknown"}
|
|
280
|
+
tagVariant="success"
|
|
281
|
+
tagLabel="installed"
|
|
282
|
+
data-testid=${`wallet-selector-${e.id}`}
|
|
283
|
+
@click=${()=>this.onConnector(e)}
|
|
284
|
+
tabIdx=${h(this.tabIdx)}
|
|
285
|
+
>
|
|
286
|
+
</wui-list-wallet>
|
|
287
|
+
`)}
|
|
288
|
+
</wui-flex>
|
|
289
|
+
`}onConnector(t){v.setActiveConnector(t),E.push("ConnectingExternal",{connector:t})}};Ze([c()],ve.prototype,"tabIdx",void 0);Ze([c()],ve.prototype,"connectors",void 0);ve=Ze([d("w3m-connect-injected-widget")],ve);var to=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},xe=class extends p{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=v.state.connectors,this.unsubscribe.push(v.subscribeKey("connectors",t=>this.connectors=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let t=this.connectors.filter(e=>e.type==="MULTI_CHAIN"&&e.name!=="WalletConnect");return t?.length?l`
|
|
290
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
291
|
+
${t.map(e=>l`
|
|
292
|
+
<wui-list-wallet
|
|
293
|
+
imageSrc=${h(B.getConnectorImage(e))}
|
|
294
|
+
.installed=${!0}
|
|
295
|
+
name=${e.name??"Unknown"}
|
|
296
|
+
tagVariant="shade"
|
|
297
|
+
tagLabel="multichain"
|
|
298
|
+
data-testid=${`wallet-selector-${e.id}`}
|
|
299
|
+
@click=${()=>this.onConnector(e)}
|
|
300
|
+
tabIdx=${h(this.tabIdx)}
|
|
301
|
+
>
|
|
302
|
+
</wui-list-wallet>
|
|
303
|
+
`)}
|
|
304
|
+
</wui-flex>
|
|
305
|
+
`:(this.style.cssText="display: none",null)}onConnector(t){v.setActiveConnector(t),E.push("ConnectingMultiChain")}};to([c()],xe.prototype,"tabIdx",void 0);to([m()],xe.prototype,"connectors",void 0);xe=to([d("w3m-connect-multi-chain-widget")],xe);var ye=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Qt=class extends p{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=v.state.connectors,this.loading=!1,this.unsubscribe.push(v.subscribeKey("connectors",t=>this.connectors=t)),f.isTelegram()&&f.isIos()&&(this.loading=!x.state.wcUri,this.unsubscribe.push(x.subscribeKey("wcUri",t=>this.loading=!t)))}render(){let e=pt.getRecentWallets().filter(i=>!ht.isExcluded(i)).filter(i=>!this.hasWalletConnector(i)).filter(i=>this.isWalletCompatibleWithCurrentChain(i));return e.length?l`
|
|
306
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
307
|
+
${e.map(i=>l`
|
|
308
|
+
<wui-list-wallet
|
|
309
|
+
imageSrc=${h(B.getWalletImage(i))}
|
|
310
|
+
name=${i.name??"Unknown"}
|
|
311
|
+
@click=${()=>this.onConnectWallet(i)}
|
|
312
|
+
tagLabel="recent"
|
|
313
|
+
tagVariant="shade"
|
|
314
|
+
tabIdx=${h(this.tabIdx)}
|
|
315
|
+
?loading=${this.loading}
|
|
316
|
+
>
|
|
317
|
+
</wui-list-wallet>
|
|
318
|
+
`)}
|
|
319
|
+
</wui-flex>
|
|
320
|
+
`:(this.style.cssText="display: none",null)}onConnectWallet(t){this.loading||v.selectWalletConnector(t)}hasWalletConnector(t){return this.connectors.some(e=>e.id===t.id||e.name===t.name)}isWalletCompatibleWithCurrentChain(t){let e=Yt.state.activeChain;return e&&t.chains?t.chains.some(i=>{let n=i.split(":")[0];return e===n}):!0}};ye([c()],Qt.prototype,"tabIdx",void 0);ye([m()],Qt.prototype,"connectors",void 0);ye([m()],Qt.prototype,"loading",void 0);Qt=ye([d("w3m-connect-recent-widget")],Qt);var Ce=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Xt=class extends p{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.wallets=[],this.loading=!1,f.isTelegram()&&f.isIos()&&(this.loading=!x.state.wcUri,this.unsubscribe.push(x.subscribeKey("wcUri",t=>this.loading=!t)))}render(){let{connectors:t}=v.state,{customWallets:e,featuredWalletIds:i}=N.state,n=pt.getRecentWallets(),o=t.find(C=>C.id==="walletConnect"),a=t.filter(C=>C.type==="INJECTED"||C.type==="ANNOUNCED"||C.type==="MULTI_CHAIN").filter(C=>C.name!=="Browser Wallet");if(!o)return null;if(i||e||!this.wallets.length)return this.style.cssText="display: none",null;let u=a.length+n.length,b=Math.max(0,2-u),w=ht.filterOutDuplicateWallets(this.wallets).slice(0,b);return w.length?l`
|
|
321
|
+
<wui-flex flexDirection="column" gap="xs">
|
|
322
|
+
${w.map(C=>l`
|
|
323
|
+
<wui-list-wallet
|
|
324
|
+
imageSrc=${h(B.getWalletImage(C))}
|
|
325
|
+
name=${C?.name??"Unknown"}
|
|
326
|
+
@click=${()=>this.onConnectWallet(C)}
|
|
327
|
+
tabIdx=${h(this.tabIdx)}
|
|
328
|
+
?loading=${this.loading}
|
|
329
|
+
>
|
|
330
|
+
</wui-list-wallet>
|
|
331
|
+
`)}
|
|
332
|
+
</wui-flex>
|
|
333
|
+
`:(this.style.cssText="display: none",null)}onConnectWallet(t){if(this.loading)return;let e=v.getConnector(t.id,t.rdns);e?E.push("ConnectingExternal",{connector:e}):E.push("ConnectingWalletConnect",{wallet:t})}};Ce([c()],Xt.prototype,"tabIdx",void 0);Ce([c()],Xt.prototype,"wallets",void 0);Ce([m()],Xt.prototype,"loading",void 0);Xt=Ce([d("w3m-connect-recommended-widget")],Xt);var Ee=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Zt=class extends p{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=v.state.connectors,this.connectorImages=Ke.state.connectorImages,this.unsubscribe.push(v.subscribeKey("connectors",t=>this.connectors=t),Ke.subscribeKey("connectorImages",t=>this.connectorImages=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){if(f.isMobile())return this.style.cssText="display: none",null;let t=this.connectors.find(i=>i.id==="walletConnect");if(!t)return this.style.cssText="display: none",null;let e=t.imageUrl||this.connectorImages[t?.imageId??""];return l`
|
|
334
|
+
<wui-list-wallet
|
|
335
|
+
imageSrc=${h(e)}
|
|
336
|
+
name=${t.name??"Unknown"}
|
|
337
|
+
@click=${()=>this.onConnector(t)}
|
|
338
|
+
tagLabel="qr code"
|
|
339
|
+
tagVariant="main"
|
|
340
|
+
tabIdx=${h(this.tabIdx)}
|
|
341
|
+
data-testid="wallet-selector-walletconnect"
|
|
342
|
+
>
|
|
343
|
+
</wui-list-wallet>
|
|
344
|
+
`}onConnector(t){v.setActiveConnector(t),E.push("ConnectingWalletConnect")}};Ee([c()],Zt.prototype,"tabIdx",void 0);Ee([m()],Zt.prototype,"connectors",void 0);Ee([m()],Zt.prototype,"connectorImages",void 0);Zt=Ee([d("w3m-connect-walletconnect-widget")],Zt);var Fo=g`
|
|
345
|
+
:host {
|
|
346
|
+
margin-top: var(--wui-spacing-3xs);
|
|
347
|
+
}
|
|
348
|
+
wui-separator {
|
|
349
|
+
margin: var(--wui-spacing-m) calc(var(--wui-spacing-m) * -1) var(--wui-spacing-xs)
|
|
350
|
+
calc(var(--wui-spacing-m) * -1);
|
|
351
|
+
width: calc(100% + var(--wui-spacing-s) * 2);
|
|
352
|
+
}
|
|
353
|
+
`;var te=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Rt=class extends p{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=v.state.connectors,this.recommended=R.state.recommended,this.featured=R.state.featured,this.unsubscribe.push(v.subscribeKey("connectors",t=>this.connectors=t),R.subscribeKey("recommended",t=>this.recommended=t),R.subscribeKey("featured",t=>this.featured=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){return l`
|
|
354
|
+
<wui-flex flexDirection="column" gap="xs"> ${this.connectorListTemplate()} </wui-flex>
|
|
355
|
+
`}connectorListTemplate(){let{custom:t,recent:e,announced:i,injected:n,multiChain:o,recommended:s,featured:a,external:u}=st.getConnectorsByType(this.connectors,this.recommended,this.featured);return st.getConnectorTypeOrder({custom:t,recent:e,announced:i,injected:n,multiChain:o,recommended:s,featured:a,external:u}).map(w=>{switch(w){case"injected":return l`
|
|
356
|
+
${o.length?l`<w3m-connect-multi-chain-widget
|
|
357
|
+
tabIdx=${h(this.tabIdx)}
|
|
358
|
+
></w3m-connect-multi-chain-widget>`:null}
|
|
359
|
+
${i.length?l`<w3m-connect-announced-widget
|
|
360
|
+
tabIdx=${h(this.tabIdx)}
|
|
361
|
+
></w3m-connect-announced-widget>`:null}
|
|
362
|
+
${n.length?l`<w3m-connect-injected-widget
|
|
363
|
+
.connectors=${n}
|
|
364
|
+
tabIdx=${h(this.tabIdx)}
|
|
365
|
+
></w3m-connect-injected-widget>`:null}
|
|
366
|
+
`;case"walletConnect":return l`<w3m-connect-walletconnect-widget
|
|
367
|
+
tabIdx=${h(this.tabIdx)}
|
|
368
|
+
></w3m-connect-walletconnect-widget>`;case"recent":return l`<w3m-connect-recent-widget
|
|
369
|
+
tabIdx=${h(this.tabIdx)}
|
|
370
|
+
></w3m-connect-recent-widget>`;case"featured":return l`<w3m-connect-featured-widget
|
|
371
|
+
.wallets=${a}
|
|
372
|
+
tabIdx=${h(this.tabIdx)}
|
|
373
|
+
></w3m-connect-featured-widget>`;case"custom":return l`<w3m-connect-custom-widget
|
|
374
|
+
tabIdx=${h(this.tabIdx)}
|
|
375
|
+
></w3m-connect-custom-widget>`;case"external":return l`<w3m-connect-external-widget
|
|
376
|
+
tabIdx=${h(this.tabIdx)}
|
|
377
|
+
></w3m-connect-external-widget>`;case"recommended":return l`<w3m-connect-recommended-widget
|
|
378
|
+
.wallets=${s}
|
|
379
|
+
tabIdx=${h(this.tabIdx)}
|
|
380
|
+
></w3m-connect-recommended-widget>`;default:return console.warn(`Unknown connector type: ${w}`),null}})}};Rt.styles=Fo;te([c()],Rt.prototype,"tabIdx",void 0);te([m()],Rt.prototype,"connectors",void 0);te([m()],Rt.prototype,"recommended",void 0);te([m()],Rt.prototype,"featured",void 0);Rt=te([d("w3m-connector-list")],Rt);var Vo=g`
|
|
381
|
+
:host {
|
|
382
|
+
display: inline-flex;
|
|
383
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
384
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
385
|
+
padding: var(--wui-spacing-3xs);
|
|
386
|
+
position: relative;
|
|
387
|
+
height: 36px;
|
|
388
|
+
min-height: 36px;
|
|
389
|
+
overflow: hidden;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
:host::before {
|
|
393
|
+
content: '';
|
|
394
|
+
position: absolute;
|
|
395
|
+
pointer-events: none;
|
|
396
|
+
top: 4px;
|
|
397
|
+
left: 4px;
|
|
398
|
+
display: block;
|
|
399
|
+
width: var(--local-tab-width);
|
|
400
|
+
height: 28px;
|
|
401
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
402
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
403
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
|
|
404
|
+
transform: translateX(calc(var(--local-tab) * var(--local-tab-width)));
|
|
405
|
+
transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
406
|
+
will-change: background-color, opacity;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
:host([data-type='flex'])::before {
|
|
410
|
+
left: 3px;
|
|
411
|
+
transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px)));
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
:host([data-type='flex']) {
|
|
415
|
+
display: flex;
|
|
416
|
+
padding: 0px 0px 0px 12px;
|
|
417
|
+
gap: 4px;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
:host([data-type='flex']) > button > wui-text {
|
|
421
|
+
position: absolute;
|
|
422
|
+
left: 18px;
|
|
423
|
+
opacity: 0;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
button[data-active='true'] > wui-icon,
|
|
427
|
+
button[data-active='true'] > wui-text {
|
|
428
|
+
color: var(--wui-color-fg-100);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
button[data-active='false'] > wui-icon,
|
|
432
|
+
button[data-active='false'] > wui-text {
|
|
433
|
+
color: var(--wui-color-fg-200);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
button[data-active='true']:disabled,
|
|
437
|
+
button[data-active='false']:disabled {
|
|
438
|
+
background-color: transparent;
|
|
439
|
+
opacity: 0.5;
|
|
440
|
+
cursor: not-allowed;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
button[data-active='true']:disabled > wui-text {
|
|
444
|
+
color: var(--wui-color-fg-200);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
button[data-active='false']:disabled > wui-text {
|
|
448
|
+
color: var(--wui-color-fg-300);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
button > wui-icon,
|
|
452
|
+
button > wui-text {
|
|
453
|
+
pointer-events: none;
|
|
454
|
+
transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md);
|
|
455
|
+
will-change: color;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
button {
|
|
459
|
+
width: var(--local-tab-width);
|
|
460
|
+
transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
461
|
+
will-change: background-color;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
:host([data-type='flex']) > button {
|
|
465
|
+
width: 34px;
|
|
466
|
+
position: relative;
|
|
467
|
+
display: flex;
|
|
468
|
+
justify-content: flex-start;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
button:hover:enabled,
|
|
472
|
+
button:active:enabled {
|
|
473
|
+
background-color: transparent !important;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
button:hover:enabled > wui-icon,
|
|
477
|
+
button:active:enabled > wui-icon {
|
|
478
|
+
transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg);
|
|
479
|
+
color: var(--wui-color-fg-125);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
button:hover:enabled > wui-text,
|
|
483
|
+
button:active:enabled > wui-text {
|
|
484
|
+
transition: all var(--wui-ease-out-power-1) var(--wui-duration-lg);
|
|
485
|
+
color: var(--wui-color-fg-125);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
button {
|
|
489
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
490
|
+
}
|
|
491
|
+
`;var ft=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},et=class extends p{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=`
|
|
492
|
+
--local-tab: ${this.activeTab};
|
|
493
|
+
--local-tab-width: ${this.localTabWidth};
|
|
494
|
+
`,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((t,e)=>{let i=e===this.activeTab;return l`
|
|
495
|
+
<button
|
|
496
|
+
?disabled=${this.disabled}
|
|
497
|
+
@click=${()=>this.onTabClick(e)}
|
|
498
|
+
data-active=${i}
|
|
499
|
+
data-testid="tab-${t.label?.toLowerCase()}"
|
|
500
|
+
>
|
|
501
|
+
${this.iconTemplate(t)}
|
|
502
|
+
<wui-text variant="small-600" color="inherit"> ${t.label} </wui-text>
|
|
503
|
+
</button>
|
|
504
|
+
`})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(t){return t.icon?l`<wui-icon size="xs" color="inherit" name=${t.icon}></wui-icon>`:null}onTabClick(t){this.buttons&&this.animateTabs(t,!1),this.activeTab=t,this.onTabChange(t)}animateTabs(t,e){let i=this.buttons[this.activeTab],n=this.buttons[t],o=i?.querySelector("wui-text"),s=n?.querySelector("wui-text"),a=n?.getBoundingClientRect(),u=s?.getBoundingClientRect();i&&o&&!e&&t!==this.activeTab&&(o.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),i.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),n&&a&&u&&s&&(t!==this.activeTab||e)&&(this.localTabWidth=`${Math.round(a.width+u.width)+6}px`,n.animate([{width:`${a.width+u.width}px`}],{duration:e?0:500,fill:"forwards",easing:"ease"}),s.animate([{opacity:1}],{duration:e?0:125,delay:e?0:200,fill:"forwards",easing:"ease"}))}};et.styles=[y,L,Vo];ft([c({type:Array})],et.prototype,"tabs",void 0);ft([c()],et.prototype,"onTabChange",void 0);ft([c({type:Array})],et.prototype,"buttons",void 0);ft([c({type:Boolean})],et.prototype,"disabled",void 0);ft([c()],et.prototype,"localTabWidth",void 0);ft([m()],et.prototype,"activeTab",void 0);ft([m()],et.prototype,"isDense",void 0);et=ft([d("wui-tabs")],et);var eo=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Re=class extends p{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(t=>t())}render(){let t=this.generateTabs();return l`
|
|
505
|
+
<wui-flex justifyContent="center" .padding=${["0","0","l","0"]}>
|
|
506
|
+
<wui-tabs .tabs=${t} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
|
|
507
|
+
</wui-flex>
|
|
508
|
+
`}generateTabs(){let t=this.platforms.map(e=>e==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:e==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:e==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:e==="web"?{label:"Webapp",icon:"browser",platform:"web"}:e==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=t.map(({platform:e})=>e),t}onTabChange(t){let e=this.platformTabs[t];e&&this.onSelectPlatfrom?.(e)}};eo([c({type:Array})],Re.prototype,"platforms",void 0);eo([c()],Re.prototype,"onSelectPlatfrom",void 0);Re=eo([d("w3m-connecting-header")],Re);var Ho=g`
|
|
509
|
+
:host {
|
|
510
|
+
width: var(--local-width);
|
|
511
|
+
position: relative;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
button {
|
|
515
|
+
border: none;
|
|
516
|
+
border-radius: var(--local-border-radius);
|
|
517
|
+
width: var(--local-width);
|
|
518
|
+
white-space: nowrap;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/* -- Sizes --------------------------------------------------- */
|
|
522
|
+
button[data-size='md'] {
|
|
523
|
+
padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l);
|
|
524
|
+
height: 36px;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
button[data-size='md'][data-icon-left='true'][data-icon-right='false'] {
|
|
528
|
+
padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
button[data-size='md'][data-icon-right='true'][data-icon-left='false'] {
|
|
532
|
+
padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
button[data-size='lg'] {
|
|
536
|
+
padding: var(--wui-spacing-m) var(--wui-spacing-2l);
|
|
537
|
+
height: 48px;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/* -- Variants --------------------------------------------------------- */
|
|
541
|
+
button[data-variant='main'] {
|
|
542
|
+
background-color: var(--wui-color-accent-100);
|
|
543
|
+
color: var(--wui-color-inverse-100);
|
|
544
|
+
border: none;
|
|
545
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
button[data-variant='inverse'] {
|
|
549
|
+
background-color: var(--wui-color-inverse-100);
|
|
550
|
+
color: var(--wui-color-inverse-000);
|
|
551
|
+
border: none;
|
|
552
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
button[data-variant='accent'] {
|
|
556
|
+
background-color: var(--wui-color-accent-glass-010);
|
|
557
|
+
color: var(--wui-color-accent-100);
|
|
558
|
+
border: none;
|
|
559
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
button[data-variant='accent-error'] {
|
|
563
|
+
background: var(--wui-color-error-glass-015);
|
|
564
|
+
color: var(--wui-color-error-100);
|
|
565
|
+
border: none;
|
|
566
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-error-glass-010);
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
button[data-variant='accent-success'] {
|
|
570
|
+
background: var(--wui-color-success-glass-015);
|
|
571
|
+
color: var(--wui-color-success-100);
|
|
572
|
+
border: none;
|
|
573
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-success-glass-010);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
button[data-variant='neutral'] {
|
|
577
|
+
background: transparent;
|
|
578
|
+
color: var(--wui-color-fg-100);
|
|
579
|
+
border: none;
|
|
580
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/* -- Focus states --------------------------------------------------- */
|
|
584
|
+
button[data-variant='main']:focus-visible:enabled {
|
|
585
|
+
background-color: var(--wui-color-accent-090);
|
|
586
|
+
box-shadow:
|
|
587
|
+
inset 0 0 0 1px var(--wui-color-accent-100),
|
|
588
|
+
0 0 0 4px var(--wui-color-accent-glass-020);
|
|
589
|
+
}
|
|
590
|
+
button[data-variant='inverse']:focus-visible:enabled {
|
|
591
|
+
background-color: var(--wui-color-inverse-100);
|
|
592
|
+
box-shadow:
|
|
593
|
+
inset 0 0 0 1px var(--wui-color-gray-glass-010),
|
|
594
|
+
0 0 0 4px var(--wui-color-accent-glass-020);
|
|
595
|
+
}
|
|
596
|
+
button[data-variant='accent']:focus-visible:enabled {
|
|
597
|
+
background-color: var(--wui-color-accent-glass-010);
|
|
598
|
+
box-shadow:
|
|
599
|
+
inset 0 0 0 1px var(--wui-color-accent-100),
|
|
600
|
+
0 0 0 4px var(--wui-color-accent-glass-020);
|
|
601
|
+
}
|
|
602
|
+
button[data-variant='accent-error']:focus-visible:enabled {
|
|
603
|
+
background: var(--wui-color-error-glass-015);
|
|
604
|
+
box-shadow:
|
|
605
|
+
inset 0 0 0 1px var(--wui-color-error-100),
|
|
606
|
+
0 0 0 4px var(--wui-color-error-glass-020);
|
|
607
|
+
}
|
|
608
|
+
button[data-variant='accent-success']:focus-visible:enabled {
|
|
609
|
+
background: var(--wui-color-success-glass-015);
|
|
610
|
+
box-shadow:
|
|
611
|
+
inset 0 0 0 1px var(--wui-color-success-100),
|
|
612
|
+
0 0 0 4px var(--wui-color-success-glass-020);
|
|
613
|
+
}
|
|
614
|
+
button[data-variant='neutral']:focus-visible:enabled {
|
|
615
|
+
background: var(--wui-color-gray-glass-005);
|
|
616
|
+
box-shadow:
|
|
617
|
+
inset 0 0 0 1px var(--wui-color-gray-glass-010),
|
|
618
|
+
0 0 0 4px var(--wui-color-gray-glass-002);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
622
|
+
@media (hover: hover) and (pointer: fine) {
|
|
623
|
+
button[data-variant='main']:hover:enabled {
|
|
624
|
+
background-color: var(--wui-color-accent-090);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
button[data-variant='main']:active:enabled {
|
|
628
|
+
background-color: var(--wui-color-accent-080);
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
button[data-variant='accent']:hover:enabled {
|
|
632
|
+
background-color: var(--wui-color-accent-glass-015);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
button[data-variant='accent']:active:enabled {
|
|
636
|
+
background-color: var(--wui-color-accent-glass-020);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
button[data-variant='accent-error']:hover:enabled {
|
|
640
|
+
background: var(--wui-color-error-glass-020);
|
|
641
|
+
color: var(--wui-color-error-100);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
button[data-variant='accent-error']:active:enabled {
|
|
645
|
+
background: var(--wui-color-error-glass-030);
|
|
646
|
+
color: var(--wui-color-error-100);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
button[data-variant='accent-success']:hover:enabled {
|
|
650
|
+
background: var(--wui-color-success-glass-020);
|
|
651
|
+
color: var(--wui-color-success-100);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
button[data-variant='accent-success']:active:enabled {
|
|
655
|
+
background: var(--wui-color-success-glass-030);
|
|
656
|
+
color: var(--wui-color-success-100);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
button[data-variant='neutral']:hover:enabled {
|
|
660
|
+
background: var(--wui-color-gray-glass-002);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
button[data-variant='neutral']:active:enabled {
|
|
664
|
+
background: var(--wui-color-gray-glass-005);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] {
|
|
668
|
+
padding-left: var(--wui-spacing-m);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] {
|
|
672
|
+
padding-right: var(--wui-spacing-m);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/* -- Disabled state --------------------------------------------------- */
|
|
677
|
+
button:disabled {
|
|
678
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
679
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
|
|
680
|
+
color: var(--wui-color-gray-glass-020);
|
|
681
|
+
cursor: not-allowed;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
button > wui-text {
|
|
685
|
+
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
686
|
+
will-change: opacity;
|
|
687
|
+
opacity: var(--local-opacity-100);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
::slotted(*) {
|
|
691
|
+
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
692
|
+
will-change: opacity;
|
|
693
|
+
opacity: var(--local-opacity-100);
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
wui-loading-spinner {
|
|
697
|
+
position: absolute;
|
|
698
|
+
left: 50%;
|
|
699
|
+
top: 50%;
|
|
700
|
+
transform: translate(-50%, -50%);
|
|
701
|
+
opacity: var(--local-opacity-000);
|
|
702
|
+
}
|
|
703
|
+
`;var ot=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Ko={main:"inverse-100",inverse:"inverse-000",accent:"accent-100","accent-error":"error-100","accent-success":"success-100",neutral:"fg-100",disabled:"gray-glass-020"},Dr={lg:"paragraph-600",md:"small-600"},jr={lg:"md",md:"md"},G=class extends p{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="main",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=`
|
|
704
|
+
--local-width: ${this.fullWidth?"100%":"auto"};
|
|
705
|
+
--local-opacity-100: ${this.loading?0:1};
|
|
706
|
+
--local-opacity-000: ${this.loading?1:0};
|
|
707
|
+
--local-border-radius: var(--wui-border-radius-${this.borderRadius});
|
|
708
|
+
`;let t=this.textVariant??Dr[this.size];return l`
|
|
709
|
+
<button
|
|
710
|
+
data-variant=${this.variant}
|
|
711
|
+
data-icon-left=${this.hasIconLeft}
|
|
712
|
+
data-icon-right=${this.hasIconRight}
|
|
713
|
+
data-size=${this.size}
|
|
714
|
+
?disabled=${this.disabled}
|
|
715
|
+
>
|
|
716
|
+
${this.loadingTemplate()}
|
|
717
|
+
<slot name="iconLeft" @slotchange=${()=>this.handleSlotLeftChange()}></slot>
|
|
718
|
+
<wui-text variant=${t} color="inherit">
|
|
719
|
+
<slot></slot>
|
|
720
|
+
</wui-text>
|
|
721
|
+
<slot name="iconRight" @slotchange=${()=>this.handleSlotRightChange()}></slot>
|
|
722
|
+
</button>
|
|
723
|
+
`}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){if(this.loading){let t=jr[this.size],e=this.disabled?Ko.disabled:Ko[this.variant];return l`<wui-loading-spinner color=${e} size=${t}></wui-loading-spinner>`}return l``}};G.styles=[y,L,Ho];ot([c()],G.prototype,"size",void 0);ot([c({type:Boolean})],G.prototype,"disabled",void 0);ot([c({type:Boolean})],G.prototype,"fullWidth",void 0);ot([c({type:Boolean})],G.prototype,"loading",void 0);ot([c()],G.prototype,"variant",void 0);ot([c({type:Boolean})],G.prototype,"hasIconLeft",void 0);ot([c({type:Boolean})],G.prototype,"hasIconRight",void 0);ot([c()],G.prototype,"borderRadius",void 0);ot([c()],G.prototype,"textVariant",void 0);G=ot([d("wui-button")],G);var Go=g`
|
|
724
|
+
button {
|
|
725
|
+
padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
|
|
726
|
+
border-radius: var(--wui-border-radius-3xs);
|
|
727
|
+
background-color: transparent;
|
|
728
|
+
color: var(--wui-color-accent-100);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
button:disabled {
|
|
732
|
+
background-color: transparent;
|
|
733
|
+
color: var(--wui-color-gray-glass-015);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
button:hover {
|
|
737
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
738
|
+
}
|
|
739
|
+
`;var $e=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},At=class extends p{constructor(){super(...arguments),this.tabIdx=void 0,this.disabled=!1,this.color="inherit"}render(){return l`
|
|
740
|
+
<button ?disabled=${this.disabled} tabindex=${h(this.tabIdx)}>
|
|
741
|
+
<slot name="iconLeft"></slot>
|
|
742
|
+
<wui-text variant="small-600" color=${this.color}>
|
|
743
|
+
<slot></slot>
|
|
744
|
+
</wui-text>
|
|
745
|
+
<slot name="iconRight"></slot>
|
|
746
|
+
</button>
|
|
747
|
+
`}};At.styles=[y,L,Go];$e([c()],At.prototype,"tabIdx",void 0);$e([c({type:Boolean})],At.prototype,"disabled",void 0);$e([c()],At.prototype,"color",void 0);At=$e([d("wui-link")],At);var Yo=g`
|
|
748
|
+
:host {
|
|
749
|
+
display: block;
|
|
750
|
+
width: var(--wui-box-size-md);
|
|
751
|
+
height: var(--wui-box-size-md);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
svg {
|
|
755
|
+
width: var(--wui-box-size-md);
|
|
756
|
+
height: var(--wui-box-size-md);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
rect {
|
|
760
|
+
fill: none;
|
|
761
|
+
stroke: var(--wui-color-accent-100);
|
|
762
|
+
stroke-width: 4px;
|
|
763
|
+
stroke-linecap: round;
|
|
764
|
+
animation: dash 1s linear infinite;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
@keyframes dash {
|
|
768
|
+
to {
|
|
769
|
+
stroke-dashoffset: 0px;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
`;var Jo=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},_e=class extends p{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){let t=this.radius>50?50:this.radius,i=36-t,n=116+i,o=245+i,s=360+i*1.75;return l`
|
|
773
|
+
<svg viewBox="0 0 110 110" width="110" height="110">
|
|
774
|
+
<rect
|
|
775
|
+
x="2"
|
|
776
|
+
y="2"
|
|
777
|
+
width="106"
|
|
778
|
+
height="106"
|
|
779
|
+
rx=${t}
|
|
780
|
+
stroke-dasharray="${n} ${o}"
|
|
781
|
+
stroke-dashoffset=${s}
|
|
782
|
+
/>
|
|
783
|
+
</svg>
|
|
784
|
+
`}};_e.styles=[y,Yo];Jo([c({type:Number})],_e.prototype,"radius",void 0);_e=Jo([d("wui-loading-thumbnail")],_e);var Qo=g`
|
|
785
|
+
button {
|
|
786
|
+
border: none;
|
|
787
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
button[data-variant='main'] {
|
|
791
|
+
background-color: var(--wui-color-accent-100);
|
|
792
|
+
color: var(--wui-color-inverse-100);
|
|
793
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
button[data-variant='accent'] {
|
|
797
|
+
background-color: var(--wui-color-accent-glass-010);
|
|
798
|
+
color: var(--wui-color-accent-100);
|
|
799
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
button[data-variant='gray'] {
|
|
803
|
+
background-color: transparent;
|
|
804
|
+
color: var(--wui-color-fg-200);
|
|
805
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
button[data-variant='shade'] {
|
|
809
|
+
background-color: transparent;
|
|
810
|
+
color: var(--wui-color-accent-100);
|
|
811
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
button[data-size='sm'] {
|
|
815
|
+
height: 32px;
|
|
816
|
+
padding: 0 var(--wui-spacing-s);
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
button[data-size='md'] {
|
|
820
|
+
height: 40px;
|
|
821
|
+
padding: 0 var(--wui-spacing-l);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
button[data-size='sm'] > wui-image {
|
|
825
|
+
width: 16px;
|
|
826
|
+
height: 16px;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
button[data-size='md'] > wui-image {
|
|
830
|
+
width: 24px;
|
|
831
|
+
height: 24px;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
button[data-size='sm'] > wui-icon {
|
|
835
|
+
width: 12px;
|
|
836
|
+
height: 12px;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
button[data-size='md'] > wui-icon {
|
|
840
|
+
width: 14px;
|
|
841
|
+
height: 14px;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
wui-image {
|
|
845
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
846
|
+
overflow: hidden;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
button.disabled > wui-icon,
|
|
850
|
+
button.disabled > wui-image {
|
|
851
|
+
filter: grayscale(1);
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
button[data-variant='main'] > wui-image {
|
|
855
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-accent-090);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
button[data-variant='shade'] > wui-image,
|
|
859
|
+
button[data-variant='gray'] > wui-image {
|
|
860
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-010);
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
@media (hover: hover) and (pointer: fine) {
|
|
864
|
+
button[data-variant='main']:focus-visible {
|
|
865
|
+
background-color: var(--wui-color-accent-090);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
button[data-variant='main']:hover:enabled {
|
|
869
|
+
background-color: var(--wui-color-accent-090);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
button[data-variant='main']:active:enabled {
|
|
873
|
+
background-color: var(--wui-color-accent-080);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
button[data-variant='accent']:hover:enabled {
|
|
877
|
+
background-color: var(--wui-color-accent-glass-015);
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
button[data-variant='accent']:active:enabled {
|
|
881
|
+
background-color: var(--wui-color-accent-glass-020);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
button[data-variant='shade']:focus-visible,
|
|
885
|
+
button[data-variant='gray']:focus-visible,
|
|
886
|
+
button[data-variant='shade']:hover,
|
|
887
|
+
button[data-variant='gray']:hover {
|
|
888
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
button[data-variant='gray']:active,
|
|
892
|
+
button[data-variant='shade']:active {
|
|
893
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
button.disabled {
|
|
898
|
+
color: var(--wui-color-gray-glass-020);
|
|
899
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
900
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
|
|
901
|
+
pointer-events: none;
|
|
902
|
+
}
|
|
903
|
+
`;var $t=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},lt=class extends p{constructor(){super(...arguments),this.variant="accent",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.size="md",this.text=""}render(){let t=this.size==="sm"?"small-600":"paragraph-600";return l`
|
|
904
|
+
<button
|
|
905
|
+
class=${this.disabled?"disabled":""}
|
|
906
|
+
data-variant=${this.variant}
|
|
907
|
+
data-size=${this.size}
|
|
908
|
+
>
|
|
909
|
+
${this.imageSrc?l`<wui-image src=${this.imageSrc}></wui-image>`:null}
|
|
910
|
+
<wui-text variant=${t} color="inherit"> ${this.text} </wui-text>
|
|
911
|
+
<wui-icon name=${this.icon} color="inherit" size="inherit"></wui-icon>
|
|
912
|
+
</button>
|
|
913
|
+
`}};lt.styles=[y,L,Qo];$t([c()],lt.prototype,"variant",void 0);$t([c()],lt.prototype,"imageSrc",void 0);$t([c({type:Boolean})],lt.prototype,"disabled",void 0);$t([c()],lt.prototype,"icon",void 0);$t([c()],lt.prototype,"size",void 0);$t([c()],lt.prototype,"text",void 0);lt=$t([d("wui-chip-button")],lt);var Xo=g`
|
|
914
|
+
wui-flex {
|
|
915
|
+
width: 100%;
|
|
916
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
917
|
+
border-radius: var(--wui-border-radius-xs);
|
|
918
|
+
}
|
|
919
|
+
`;var Ie=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Dt=class extends p{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return l`
|
|
920
|
+
<wui-flex
|
|
921
|
+
justifyContent="space-between"
|
|
922
|
+
alignItems="center"
|
|
923
|
+
.padding=${["1xs","2l","1xs","2l"]}
|
|
924
|
+
>
|
|
925
|
+
<wui-text variant="paragraph-500" color="fg-200">${this.label}</wui-text>
|
|
926
|
+
<wui-chip-button size="sm" variant="shade" text=${this.buttonLabel} icon="chevronRight">
|
|
927
|
+
</wui-chip-button>
|
|
928
|
+
</wui-flex>
|
|
929
|
+
`}};Dt.styles=[y,L,Xo];Ie([c({type:Boolean})],Dt.prototype,"disabled",void 0);Ie([c()],Dt.prototype,"label",void 0);Ie([c()],Dt.prototype,"buttonLabel",void 0);Dt=Ie([d("wui-cta-button")],Dt);var Zo=g`
|
|
930
|
+
:host {
|
|
931
|
+
display: block;
|
|
932
|
+
padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl);
|
|
933
|
+
}
|
|
934
|
+
`;var ti=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},We=class extends p{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;let{name:t,app_store:e,play_store:i,chrome_store:n,homepage:o}=this.wallet,s=f.isMobile(),a=f.isIos(),u=f.isAndroid(),b=[e,i,o,n].filter(Boolean).length>1,w=X.getTruncateString({string:t,charsStart:12,charsEnd:0,truncate:"end"});return b&&!s?l`
|
|
935
|
+
<wui-cta-button
|
|
936
|
+
label=${`Don't have ${w}?`}
|
|
937
|
+
buttonLabel="Get"
|
|
938
|
+
@click=${()=>E.push("Downloads",{wallet:this.wallet})}
|
|
939
|
+
></wui-cta-button>
|
|
940
|
+
`:!b&&o?l`
|
|
941
|
+
<wui-cta-button
|
|
942
|
+
label=${`Don't have ${w}?`}
|
|
943
|
+
buttonLabel="Get"
|
|
944
|
+
@click=${this.onHomePage.bind(this)}
|
|
945
|
+
></wui-cta-button>
|
|
946
|
+
`:e&&a?l`
|
|
947
|
+
<wui-cta-button
|
|
948
|
+
label=${`Don't have ${w}?`}
|
|
949
|
+
buttonLabel="Get"
|
|
950
|
+
@click=${this.onAppStore.bind(this)}
|
|
951
|
+
></wui-cta-button>
|
|
952
|
+
`:i&&u?l`
|
|
953
|
+
<wui-cta-button
|
|
954
|
+
label=${`Don't have ${w}?`}
|
|
955
|
+
buttonLabel="Get"
|
|
956
|
+
@click=${this.onPlayStore.bind(this)}
|
|
957
|
+
></wui-cta-button>
|
|
958
|
+
`:(this.style.display="none",null)}onAppStore(){this.wallet?.app_store&&f.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&f.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&f.openHref(this.wallet.homepage,"_blank")}};We.styles=[Zo];ti([c({type:Object})],We.prototype,"wallet",void 0);We=ti([d("w3m-mobile-download-links")],We);var ei=g`
|
|
959
|
+
@keyframes shake {
|
|
960
|
+
0% {
|
|
961
|
+
transform: translateX(0);
|
|
962
|
+
}
|
|
963
|
+
25% {
|
|
964
|
+
transform: translateX(3px);
|
|
965
|
+
}
|
|
966
|
+
50% {
|
|
967
|
+
transform: translateX(-3px);
|
|
968
|
+
}
|
|
969
|
+
75% {
|
|
970
|
+
transform: translateX(3px);
|
|
971
|
+
}
|
|
972
|
+
100% {
|
|
973
|
+
transform: translateX(0);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
wui-flex:first-child:not(:only-child) {
|
|
978
|
+
position: relative;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
wui-loading-thumbnail {
|
|
982
|
+
position: absolute;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
wui-icon-box {
|
|
986
|
+
position: absolute;
|
|
987
|
+
right: calc(var(--wui-spacing-3xs) * -1);
|
|
988
|
+
bottom: calc(var(--wui-spacing-3xs) * -1);
|
|
989
|
+
opacity: 0;
|
|
990
|
+
transform: scale(0.5);
|
|
991
|
+
transition-property: opacity, transform;
|
|
992
|
+
transition-duration: var(--wui-duration-lg);
|
|
993
|
+
transition-timing-function: var(--wui-ease-out-power-2);
|
|
994
|
+
will-change: opacity, transform;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
wui-text[align='center'] {
|
|
998
|
+
width: 100%;
|
|
999
|
+
padding: 0px var(--wui-spacing-l);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
[data-error='true'] wui-icon-box {
|
|
1003
|
+
opacity: 1;
|
|
1004
|
+
transform: scale(1);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
[data-error='true'] > wui-flex:first-child {
|
|
1008
|
+
animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
[data-retry='false'] wui-link {
|
|
1012
|
+
display: none;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
[data-retry='true'] wui-link {
|
|
1016
|
+
display: block;
|
|
1017
|
+
opacity: 1;
|
|
1018
|
+
}
|
|
1019
|
+
`;var it=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},P=class extends p{constructor(){super(),this.wallet=E.state.data?.wallet,this.connector=E.state.data?.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=B.getWalletImage(this.wallet)??B.getConnectorImage(this.connector),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=x.state.wcUri,this.error=x.state.wcError,this.ready=!1,this.showRetry=!1,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(x.subscribeKey("wcUri",t=>{this.uri=t,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())}),x.subscribeKey("wcError",t=>this.error=t)),(f.isTelegram()||f.isSafari())&&f.isIos()&&x.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),x.setWcError(!1),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();let t=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel,e=`Continue in ${this.name}`;return this.error&&(e="Connection declined"),l`
|
|
1020
|
+
<wui-flex
|
|
1021
|
+
data-error=${h(this.error)}
|
|
1022
|
+
data-retry=${this.showRetry}
|
|
1023
|
+
flexDirection="column"
|
|
1024
|
+
alignItems="center"
|
|
1025
|
+
.padding=${["3xl","xl","xl","xl"]}
|
|
1026
|
+
gap="xl"
|
|
1027
|
+
>
|
|
1028
|
+
<wui-flex justifyContent="center" alignItems="center">
|
|
1029
|
+
<wui-wallet-image size="lg" imageSrc=${h(this.imageSrc)}></wui-wallet-image>
|
|
1030
|
+
|
|
1031
|
+
${this.error?null:this.loaderTemplate()}
|
|
1032
|
+
|
|
1033
|
+
<wui-icon-box
|
|
1034
|
+
backgroundColor="error-100"
|
|
1035
|
+
background="opaque"
|
|
1036
|
+
iconColor="error-100"
|
|
1037
|
+
icon="close"
|
|
1038
|
+
size="sm"
|
|
1039
|
+
border
|
|
1040
|
+
borderColor="wui-color-bg-125"
|
|
1041
|
+
></wui-icon-box>
|
|
1042
|
+
</wui-flex>
|
|
1043
|
+
|
|
1044
|
+
<wui-flex flexDirection="column" alignItems="center" gap="xs">
|
|
1045
|
+
<wui-text variant="paragraph-500" color=${this.error?"error-100":"fg-100"}>
|
|
1046
|
+
${e}
|
|
1047
|
+
</wui-text>
|
|
1048
|
+
<wui-text align="center" variant="small-500" color="fg-200">${t}</wui-text>
|
|
1049
|
+
</wui-flex>
|
|
1050
|
+
|
|
1051
|
+
${this.secondaryBtnLabel?l`
|
|
1052
|
+
<wui-button
|
|
1053
|
+
variant="accent"
|
|
1054
|
+
size="md"
|
|
1055
|
+
?disabled=${this.isRetrying||this.isLoading}
|
|
1056
|
+
@click=${this.onTryAgain.bind(this)}
|
|
1057
|
+
data-testid="w3m-connecting-widget-secondary-button"
|
|
1058
|
+
>
|
|
1059
|
+
<wui-icon color="inherit" slot="iconLeft" name=${this.secondaryBtnIcon}></wui-icon>
|
|
1060
|
+
${this.secondaryBtnLabel}
|
|
1061
|
+
</wui-button>
|
|
1062
|
+
`:null}
|
|
1063
|
+
</wui-flex>
|
|
1064
|
+
|
|
1065
|
+
${this.isWalletConnect?l`
|
|
1066
|
+
<wui-flex .padding=${["0","xl","xl","xl"]} justifyContent="center">
|
|
1067
|
+
<wui-link @click=${this.onCopyUri} color="fg-200" data-testid="wui-link-copy">
|
|
1068
|
+
<wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
|
|
1069
|
+
Copy link
|
|
1070
|
+
</wui-link>
|
|
1071
|
+
</wui-flex>
|
|
1072
|
+
`:null}
|
|
1073
|
+
|
|
1074
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
1075
|
+
`}onShowRetry(){this.error&&!this.showRetry&&(this.showRetry=!0,this.shadowRoot?.querySelector("wui-button")?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"}))}onTryAgain(){x.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.()}loaderTemplate(){let t=Gt.state.themeVariables["--w3m-border-radius-master"],e=t?parseInt(t.replace("px",""),10):4;return l`<wui-loading-thumbnail radius=${e*9}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(f.copyToClopboard(this.uri),yt.showSuccess("Link copied"))}catch{yt.showError("Failed to copy")}}};P.styles=ei;it([m()],P.prototype,"isRetrying",void 0);it([m()],P.prototype,"uri",void 0);it([m()],P.prototype,"error",void 0);it([m()],P.prototype,"ready",void 0);it([m()],P.prototype,"showRetry",void 0);it([m()],P.prototype,"secondaryBtnLabel",void 0);it([m()],P.prototype,"secondaryLabel",void 0);it([m()],P.prototype,"isLoading",void 0);it([c({type:Boolean})],P.prototype,"isMobile",void 0);it([c()],P.prototype,"onRetry",void 0);var kr=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},oi=class extends P{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),U.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){try{this.error=!1;let{connectors:t}=v.state,e=t.find(i=>i.type==="ANNOUNCED"&&i.info?.rdns===this.wallet?.rdns||i.type==="INJECTED"||i.name===this.wallet?.name);if(e)await x.connectExternal(e,e.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");he.close(),U.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.wallet?.name||"Unknown"}})}catch(t){U.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:t?.message??"Unknown"}}),this.error=!0}}};oi=kr([d("w3m-connecting-wc-browser")],oi);var zr=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},ii=class extends P{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),U.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onConnectProxy(){if(this.wallet?.desktop_link&&this.uri)try{this.error=!1;let{desktop_link:t,name:e}=this.wallet,{redirect:i,href:n}=f.formatNativeUrl(t,this.uri);x.setWcLinking({name:e,href:n}),x.setRecentWallet(this.wallet),f.openHref(i,"_blank")}catch{this.error=!0}}};ii=zr([d("w3m-connecting-wc-desktop")],ii);var jt=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},_t=class extends P{constructor(){if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=N.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{if(this.wallet?.mobile_link&&this.uri)try{this.error=!1;let{mobile_link:t,link_mode:e,name:i}=this.wallet,{redirect:n,redirectUniversalLink:o,href:s}=f.formatNativeUrl(t,this.uri,e);this.redirectDeeplink=n,this.redirectUniversalLink=o,this.target=f.isIframe()?"_top":"_self",x.setWcLinking({name:i,href:s}),x.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?f.openHref(this.redirectUniversalLink,this.target):f.openHref(this.redirectDeeplink,this.target)}catch(t){U.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:t instanceof Error?t.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=pe.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(x.subscribeKey("wcUri",()=>{this.onHandleURI()})),U.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onTryAgain(){x.setWcError(!1),this.onConnect?.()}};jt([m()],_t.prototype,"redirectDeeplink",void 0);jt([m()],_t.prototype,"redirectUniversalLink",void 0);jt([m()],_t.prototype,"target",void 0);jt([m()],_t.prototype,"preferUniversalLinks",void 0);jt([m()],_t.prototype,"isLoading",void 0);_t=jt([d("w3m-connecting-wc-mobile")],_t);var ar=Ar(nr(),1);var An=.1,sr=2.5,ut=7;function _o(r,t,e){return r===t?!1:(r-t<0?t-r:r-t)<=e+An}function Dn(r,t){let e=Array.prototype.slice.call(ar.default.create(r,{errorCorrectionLevel:t}).modules.data,0),i=Math.sqrt(e.length);return e.reduce((n,o,s)=>(s%i===0?n.push([o]):n[n.length-1].push(o))&&n,[])}var lr={generate({uri:r,size:t,logoSize:e,dotColor:i="#141414"}){let n="transparent",s=[],a=Dn(r,"Q"),u=t/a.length,b=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];b.forEach(({x:S,y:_})=>{let k=(a.length-ut)*u*S,T=(a.length-ut)*u*_,z=.45;for(let A=0;A<b.length;A+=1){let D=u*(ut-A*2);s.push(mt`
|
|
1076
|
+
<rect
|
|
1077
|
+
fill=${A===2?i:n}
|
|
1078
|
+
width=${A===0?D-5:D}
|
|
1079
|
+
rx= ${A===0?(D-5)*z:D*z}
|
|
1080
|
+
ry= ${A===0?(D-5)*z:D*z}
|
|
1081
|
+
stroke=${i}
|
|
1082
|
+
stroke-width=${A===0?5:0}
|
|
1083
|
+
height=${A===0?D-5:D}
|
|
1084
|
+
x= ${A===0?T+u*A+5/2:T+u*A}
|
|
1085
|
+
y= ${A===0?k+u*A+5/2:k+u*A}
|
|
1086
|
+
/>
|
|
1087
|
+
`)}});let w=Math.floor((e+25)/u),C=a.length/2-w/2,$=a.length/2+w/2-1,F=[];a.forEach((S,_)=>{S.forEach((k,T)=>{if(a[_][T]&&!(_<ut&&T<ut||_>a.length-(ut+1)&&T<ut||_<ut&&T>a.length-(ut+1))&&!(_>C&&_<$&&T>C&&T<$)){let z=_*u+u/2,A=T*u+u/2;F.push([z,A])}})});let M={};return F.forEach(([S,_])=>{M[S]?M[S]?.push(_):M[S]=[_]}),Object.entries(M).map(([S,_])=>{let k=_.filter(T=>_.every(z=>!_o(T,z,u)));return[Number(S),k]}).forEach(([S,_])=>{_.forEach(k=>{s.push(mt`<circle cx=${S} cy=${k} fill=${i} r=${u/sr} />`)})}),Object.entries(M).filter(([S,_])=>_.length>1).map(([S,_])=>{let k=_.filter(T=>_.some(z=>_o(T,z,u)));return[Number(S),k]}).map(([S,_])=>{_.sort((T,z)=>T<z?-1:1);let k=[];for(let T of _){let z=k.find(A=>A.some(D=>_o(T,D,u)));z?z.push(T):k.push([T])}return[S,k.map(T=>[T[0],T[T.length-1]])]}).forEach(([S,_])=>{_.forEach(([k,T])=>{s.push(mt`
|
|
1088
|
+
<line
|
|
1089
|
+
x1=${S}
|
|
1090
|
+
x2=${S}
|
|
1091
|
+
y1=${k}
|
|
1092
|
+
y2=${T}
|
|
1093
|
+
stroke=${i}
|
|
1094
|
+
stroke-width=${u/(sr/2)}
|
|
1095
|
+
stroke-linecap="round"
|
|
1096
|
+
/>
|
|
1097
|
+
`)})}),s}};var cr=g`
|
|
1098
|
+
:host {
|
|
1099
|
+
position: relative;
|
|
1100
|
+
user-select: none;
|
|
1101
|
+
display: block;
|
|
1102
|
+
overflow: hidden;
|
|
1103
|
+
aspect-ratio: 1 / 1;
|
|
1104
|
+
width: var(--local-size);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
:host([data-theme='dark']) {
|
|
1108
|
+
border-radius: clamp(0px, var(--wui-border-radius-l), 40px);
|
|
1109
|
+
background-color: var(--wui-color-inverse-100);
|
|
1110
|
+
padding: var(--wui-spacing-l);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
:host([data-theme='light']) {
|
|
1114
|
+
box-shadow: 0 0 0 1px var(--wui-color-bg-125);
|
|
1115
|
+
background-color: var(--wui-color-bg-125);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
:host([data-clear='true']) > wui-icon {
|
|
1119
|
+
display: none;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
svg:first-child,
|
|
1123
|
+
wui-image,
|
|
1124
|
+
wui-icon {
|
|
1125
|
+
position: absolute;
|
|
1126
|
+
top: 50%;
|
|
1127
|
+
left: 50%;
|
|
1128
|
+
transform: translateY(-50%) translateX(-50%);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
wui-image {
|
|
1132
|
+
width: 25%;
|
|
1133
|
+
height: 25%;
|
|
1134
|
+
border-radius: var(--wui-border-radius-xs);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
wui-icon {
|
|
1138
|
+
width: 100%;
|
|
1139
|
+
height: 100%;
|
|
1140
|
+
color: var(--local-icon-color) !important;
|
|
1141
|
+
transform: translateY(-50%) translateX(-50%) scale(0.25);
|
|
1142
|
+
}
|
|
1143
|
+
`;var dt=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},jn="#3396ff",Z=class extends p{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=`
|
|
1144
|
+
--local-size: ${this.size}px;
|
|
1145
|
+
--local-icon-color: ${this.color??jn}
|
|
1146
|
+
`,l`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){let t=this.theme==="light"?this.size:this.size-32;return mt`
|
|
1147
|
+
<svg height=${t} width=${t}>
|
|
1148
|
+
${lr.generate({uri:this.uri,size:t,logoSize:this.arenaClear?0:t/4,dotColor:this.color})}
|
|
1149
|
+
</svg>
|
|
1150
|
+
`}templateVisual(){return this.imageSrc?l`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?l`<wui-icon
|
|
1151
|
+
class="farcaster"
|
|
1152
|
+
size="inherit"
|
|
1153
|
+
color="inherit"
|
|
1154
|
+
name="farcaster"
|
|
1155
|
+
></wui-icon>`:l`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};Z.styles=[y,cr];dt([c()],Z.prototype,"uri",void 0);dt([c({type:Number})],Z.prototype,"size",void 0);dt([c()],Z.prototype,"theme",void 0);dt([c()],Z.prototype,"imageSrc",void 0);dt([c()],Z.prototype,"alt",void 0);dt([c()],Z.prototype,"color",void 0);dt([c({type:Boolean})],Z.prototype,"arenaClear",void 0);dt([c({type:Boolean})],Z.prototype,"farcaster",void 0);Z=dt([d("wui-qr-code")],Z);var ur=g`
|
|
1156
|
+
:host {
|
|
1157
|
+
display: block;
|
|
1158
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
|
|
1159
|
+
background: linear-gradient(
|
|
1160
|
+
120deg,
|
|
1161
|
+
var(--wui-color-bg-200) 5%,
|
|
1162
|
+
var(--wui-color-bg-200) 48%,
|
|
1163
|
+
var(--wui-color-bg-300) 55%,
|
|
1164
|
+
var(--wui-color-bg-300) 60%,
|
|
1165
|
+
var(--wui-color-bg-300) calc(60% + 10px),
|
|
1166
|
+
var(--wui-color-bg-200) calc(60% + 12px),
|
|
1167
|
+
var(--wui-color-bg-200) 100%
|
|
1168
|
+
);
|
|
1169
|
+
background-size: 250%;
|
|
1170
|
+
animation: shimmer 3s linear infinite reverse;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
:host([variant='light']) {
|
|
1174
|
+
background: linear-gradient(
|
|
1175
|
+
120deg,
|
|
1176
|
+
var(--wui-color-bg-150) 5%,
|
|
1177
|
+
var(--wui-color-bg-150) 48%,
|
|
1178
|
+
var(--wui-color-bg-200) 55%,
|
|
1179
|
+
var(--wui-color-bg-200) 60%,
|
|
1180
|
+
var(--wui-color-bg-200) calc(60% + 10px),
|
|
1181
|
+
var(--wui-color-bg-150) calc(60% + 12px),
|
|
1182
|
+
var(--wui-color-bg-150) 100%
|
|
1183
|
+
);
|
|
1184
|
+
background-size: 250%;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
@keyframes shimmer {
|
|
1188
|
+
from {
|
|
1189
|
+
background-position: -250% 0;
|
|
1190
|
+
}
|
|
1191
|
+
to {
|
|
1192
|
+
background-position: 250% 0;
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
`;var ce=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Lt=class extends p{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m",this.variant="default"}render(){return this.style.cssText=`
|
|
1196
|
+
width: ${this.width};
|
|
1197
|
+
height: ${this.height};
|
|
1198
|
+
border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`};
|
|
1199
|
+
`,l`<slot></slot>`}};Lt.styles=[ur];ce([c()],Lt.prototype,"width",void 0);ce([c()],Lt.prototype,"height",void 0);ce([c()],Lt.prototype,"borderRadius",void 0);ce([c()],Lt.prototype,"variant",void 0);Lt=ce([d("wui-shimmer")],Lt);var dr="https://reown.com";var pr=g`
|
|
1200
|
+
.reown-logo {
|
|
1201
|
+
height: var(--wui-spacing-xxl);
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
a {
|
|
1205
|
+
text-decoration: none;
|
|
1206
|
+
cursor: pointer;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
a:hover {
|
|
1210
|
+
opacity: 0.9;
|
|
1211
|
+
}
|
|
1212
|
+
`;var kn=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Io=class extends p{render(){return l`
|
|
1213
|
+
<a
|
|
1214
|
+
data-testid="ux-branding-reown"
|
|
1215
|
+
href=${dr}
|
|
1216
|
+
rel="noreferrer"
|
|
1217
|
+
target="_blank"
|
|
1218
|
+
style="text-decoration: none;"
|
|
1219
|
+
>
|
|
1220
|
+
<wui-flex
|
|
1221
|
+
justifyContent="center"
|
|
1222
|
+
alignItems="center"
|
|
1223
|
+
gap="xs"
|
|
1224
|
+
.padding=${["0","0","l","0"]}
|
|
1225
|
+
>
|
|
1226
|
+
<wui-text variant="small-500" color="fg-100"> UX by </wui-text>
|
|
1227
|
+
<wui-icon name="reown" size="xxxl" class="reown-logo"></wui-icon>
|
|
1228
|
+
</wui-flex>
|
|
1229
|
+
</a>
|
|
1230
|
+
`}};Io.styles=[y,L,pr];Io=kn([d("wui-ux-by-reown")],Io);var hr=g`
|
|
1231
|
+
@keyframes fadein {
|
|
1232
|
+
from {
|
|
1233
|
+
opacity: 0;
|
|
1234
|
+
}
|
|
1235
|
+
to {
|
|
1236
|
+
opacity: 1;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
wui-shimmer {
|
|
1241
|
+
width: 100%;
|
|
1242
|
+
aspect-ratio: 1 / 1;
|
|
1243
|
+
border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
wui-qr-code {
|
|
1247
|
+
opacity: 0;
|
|
1248
|
+
animation-duration: 200ms;
|
|
1249
|
+
animation-timing-function: ease;
|
|
1250
|
+
animation-name: fadein;
|
|
1251
|
+
animation-fill-mode: forwards;
|
|
1252
|
+
}
|
|
1253
|
+
`;var zn=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Wo=class extends P{constructor(){super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),U.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet?.name??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribe?.forEach(t=>t()),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),l`
|
|
1254
|
+
<wui-flex
|
|
1255
|
+
flexDirection="column"
|
|
1256
|
+
alignItems="center"
|
|
1257
|
+
.padding=${["0","xl","xl","xl"]}
|
|
1258
|
+
gap="xl"
|
|
1259
|
+
>
|
|
1260
|
+
<wui-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
|
|
1261
|
+
|
|
1262
|
+
<wui-text variant="paragraph-500" color="fg-100">
|
|
1263
|
+
Scan this QR Code with your phone
|
|
1264
|
+
</wui-text>
|
|
1265
|
+
${this.copyTemplate()}
|
|
1266
|
+
</wui-flex>
|
|
1267
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
1268
|
+
`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;let t=this.getBoundingClientRect().width-40,e=this.wallet?this.wallet.name:void 0;return x.setWcLinking(void 0),x.setRecentWallet(this.wallet),l` <wui-qr-code
|
|
1269
|
+
size=${t}
|
|
1270
|
+
theme=${Gt.state.themeMode}
|
|
1271
|
+
uri=${this.uri}
|
|
1272
|
+
imageSrc=${h(B.getWalletImage(this.wallet))}
|
|
1273
|
+
color=${h(Gt.state.themeVariables["--w3m-qr-color"])}
|
|
1274
|
+
alt=${h(e)}
|
|
1275
|
+
data-testid="wui-qr-code"
|
|
1276
|
+
></wui-qr-code>`}copyTemplate(){let t=!this.uri||!this.ready;return l`<wui-link
|
|
1277
|
+
.disabled=${t}
|
|
1278
|
+
@click=${this.onCopyUri}
|
|
1279
|
+
color="fg-200"
|
|
1280
|
+
data-testid="copy-wc2-uri"
|
|
1281
|
+
>
|
|
1282
|
+
<wui-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wui-icon>
|
|
1283
|
+
Copy link
|
|
1284
|
+
</wui-link>`}};Wo.styles=hr;Wo=zn([d("w3m-connecting-wc-qrcode")],Wo);var Un=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},mr=class extends p{constructor(){if(super(),this.wallet=E.state.data?.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");U.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return l`
|
|
1285
|
+
<wui-flex
|
|
1286
|
+
flexDirection="column"
|
|
1287
|
+
alignItems="center"
|
|
1288
|
+
.padding=${["3xl","xl","xl","xl"]}
|
|
1289
|
+
gap="xl"
|
|
1290
|
+
>
|
|
1291
|
+
<wui-wallet-image
|
|
1292
|
+
size="lg"
|
|
1293
|
+
imageSrc=${h(B.getWalletImage(this.wallet))}
|
|
1294
|
+
></wui-wallet-image>
|
|
1295
|
+
|
|
1296
|
+
<wui-text variant="paragraph-500" color="fg-100">Not Detected</wui-text>
|
|
1297
|
+
</wui-flex>
|
|
1298
|
+
|
|
1299
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
1300
|
+
`}};mr=Un([d("w3m-connecting-wc-unsupported")],mr);var fr=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},So=class extends P{constructor(){if(super(),this.isLoading=!0,!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=pe.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(x.subscribeKey("wcUri",()=>{this.updateLoadingState()})),U.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){if(this.wallet?.webapp_link&&this.uri)try{this.error=!1;let{webapp_link:t,name:e}=this.wallet,{redirect:i,href:n}=f.formatUniversalUrl(t,this.uri);x.setWcLinking({name:e,href:n}),x.setRecentWallet(this.wallet),f.openHref(i,"_blank")}catch{this.error=!0}}};fr([m()],So.prototype,"isLoading",void 0);So=fr([d("w3m-connecting-wc-web")],So);var ue=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},qt=class extends p{constructor(){super(),this.wallet=E.state.data?.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!N.state.siwx,this.remoteFeatures=N.state.remoteFeatures,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(N.subscribeKey("remoteFeatures",t=>this.remoteFeatures=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){return l`
|
|
1301
|
+
${this.headerTemplate()}
|
|
1302
|
+
<div>${this.platformTemplate()}</div>
|
|
1303
|
+
${this.reownBrandingTemplate()}
|
|
1304
|
+
`}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding?l`<wui-ux-by-reown></wui-ux-by-reown>`:null}async initializeConnection(t=!1){if(!(this.platform==="browser"||N.state.manualWCControl&&!t))try{let{wcPairingExpiry:e,status:i}=x.state;(t||N.state.enableEmbedded||f.isPairingExpired(e)||i==="connecting")&&(await x.connectWalletConnect(),this.isSiwxEnabled||he.close())}catch(e){U.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),x.setWcError(!0),yt.showError(e.message??"Connection error"),x.resetWcConnection(),E.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;let{mobile_link:t,desktop_link:e,webapp_link:i,injected:n,rdns:o}=this.wallet,s=n?.map(({injected_id:M})=>M).filter(Boolean),a=[...o?[o]:s??[]],u=N.state.isUniversalProvider?!1:a.length,b=t,w=i,C=x.checkInstalled(a),$=u&&C,F=e&&!f.isMobile();$&&!Yt.state.noAdapters&&this.platforms.push("browser"),b&&this.platforms.push(f.isMobile()?"mobile":"qrcode"),w&&this.platforms.push("web"),F&&this.platforms.push("desktop"),!$&&u&&!Yt.state.noAdapters&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return l`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return l`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return l`
|
|
1305
|
+
<w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
|
|
1306
|
+
</w3m-connecting-wc-desktop>
|
|
1307
|
+
`;case"mobile":return l`
|
|
1308
|
+
<w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
|
|
1309
|
+
</w3m-connecting-wc-mobile>
|
|
1310
|
+
`;case"qrcode":return l`<w3m-connecting-wc-qrcode></w3m-connecting-wc-qrcode>`;default:return l`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?l`
|
|
1311
|
+
<w3m-connecting-header
|
|
1312
|
+
.platforms=${this.platforms}
|
|
1313
|
+
.onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
|
|
1314
|
+
>
|
|
1315
|
+
</w3m-connecting-header>
|
|
1316
|
+
`:null}async onSelectPlatform(t){let e=this.shadowRoot?.querySelector("div");e&&(await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=t,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};ue([m()],qt.prototype,"platform",void 0);ue([m()],qt.prototype,"platforms",void 0);ue([m()],qt.prototype,"isSiwxEnabled",void 0);ue([m()],qt.prototype,"remoteFeatures",void 0);qt=ue([d("w3m-connecting-wc-view")],qt);var gr=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},To=class extends p{constructor(){super(...arguments),this.isMobile=f.isMobile()}render(){if(this.isMobile){let{featured:t,recommended:e}=R.state,{customWallets:i}=N.state,n=pt.getRecentWallets(),o=t.length||e.length||i?.length||n.length;return l`<wui-flex
|
|
1317
|
+
flexDirection="column"
|
|
1318
|
+
gap="xs"
|
|
1319
|
+
.margin=${["3xs","s","s","s"]}
|
|
1320
|
+
>
|
|
1321
|
+
${o?l`<w3m-connector-list></w3m-connector-list>`:null}
|
|
1322
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget>
|
|
1323
|
+
</wui-flex>`}return l`<wui-flex flexDirection="column" .padding=${["0","0","l","0"]}>
|
|
1324
|
+
<w3m-connecting-wc-view></w3m-connecting-wc-view>
|
|
1325
|
+
<wui-flex flexDirection="column" .padding=${["0","m","0","m"]}>
|
|
1326
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget> </wui-flex
|
|
1327
|
+
></wui-flex>`}};gr([m()],To.prototype,"isMobile",void 0);To=gr([d("w3m-connecting-wc-basic-view")],To);var Ft=()=>new Bo,Bo=class{},Lo=new WeakMap,Vt=jo(class extends ko{render(r){return Ge}update(r,[t]){let e=t!==this.G;return e&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=r.options?.host,this.rt(this.ct=r.element)),Ge}rt(r){if(this.G!==void 0)if(this.isConnected||(r=void 0),typeof this.G=="function"){let t=this.ht??globalThis,e=Lo.get(t);e===void 0&&(e=new WeakMap,Lo.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,r),r!==void 0&&this.G.call(this.ht,r)}else this.G.value=r}get lt(){return typeof this.G=="function"?Lo.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var wr=g`
|
|
1328
|
+
:host {
|
|
1329
|
+
display: flex;
|
|
1330
|
+
align-items: center;
|
|
1331
|
+
justify-content: center;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
label {
|
|
1335
|
+
position: relative;
|
|
1336
|
+
display: inline-block;
|
|
1337
|
+
width: 32px;
|
|
1338
|
+
height: 22px;
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
input {
|
|
1342
|
+
width: 0;
|
|
1343
|
+
height: 0;
|
|
1344
|
+
opacity: 0;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
span {
|
|
1348
|
+
position: absolute;
|
|
1349
|
+
cursor: pointer;
|
|
1350
|
+
top: 0;
|
|
1351
|
+
left: 0;
|
|
1352
|
+
right: 0;
|
|
1353
|
+
bottom: 0;
|
|
1354
|
+
background-color: var(--wui-color-blue-100);
|
|
1355
|
+
border-width: 1px;
|
|
1356
|
+
border-style: solid;
|
|
1357
|
+
border-color: var(--wui-color-gray-glass-002);
|
|
1358
|
+
border-radius: 999px;
|
|
1359
|
+
transition:
|
|
1360
|
+
background-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
|
|
1361
|
+
border-color var(--wui-ease-inout-power-1) var(--wui-duration-md);
|
|
1362
|
+
will-change: background-color, border-color;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
span:before {
|
|
1366
|
+
position: absolute;
|
|
1367
|
+
content: '';
|
|
1368
|
+
height: 16px;
|
|
1369
|
+
width: 16px;
|
|
1370
|
+
left: 3px;
|
|
1371
|
+
top: 2px;
|
|
1372
|
+
background-color: var(--wui-color-inverse-100);
|
|
1373
|
+
transition: transform var(--wui-ease-inout-power-1) var(--wui-duration-lg);
|
|
1374
|
+
will-change: transform;
|
|
1375
|
+
border-radius: 50%;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
input:checked + span {
|
|
1379
|
+
border-color: var(--wui-color-gray-glass-005);
|
|
1380
|
+
background-color: var(--wui-color-blue-100);
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
input:not(:checked) + span {
|
|
1384
|
+
background-color: var(--wui-color-gray-glass-010);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
input:checked + span:before {
|
|
1388
|
+
transform: translateX(calc(100% - 7px));
|
|
1389
|
+
}
|
|
1390
|
+
`;var br=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Ue=class extends p{constructor(){super(...arguments),this.inputElementRef=Ft(),this.checked=void 0}render(){return l`
|
|
1391
|
+
<label>
|
|
1392
|
+
<input
|
|
1393
|
+
${Vt(this.inputElementRef)}
|
|
1394
|
+
type="checkbox"
|
|
1395
|
+
?checked=${h(this.checked)}
|
|
1396
|
+
@change=${this.dispatchChangeEvent.bind(this)}
|
|
1397
|
+
/>
|
|
1398
|
+
<span></span>
|
|
1399
|
+
</label>
|
|
1400
|
+
`}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("switchChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};Ue.styles=[y,L,Do,wr];br([c({type:Boolean})],Ue.prototype,"checked",void 0);Ue=br([d("wui-switch")],Ue);var vr=g`
|
|
1401
|
+
:host {
|
|
1402
|
+
height: 100%;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
button {
|
|
1406
|
+
display: flex;
|
|
1407
|
+
align-items: center;
|
|
1408
|
+
justify-content: center;
|
|
1409
|
+
column-gap: var(--wui-spacing-1xs);
|
|
1410
|
+
padding: var(--wui-spacing-xs) var(--wui-spacing-s);
|
|
1411
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
1412
|
+
border-radius: var(--wui-border-radius-xs);
|
|
1413
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
|
|
1414
|
+
transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
1415
|
+
will-change: background-color;
|
|
1416
|
+
cursor: pointer;
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
wui-switch {
|
|
1420
|
+
pointer-events: none;
|
|
1421
|
+
}
|
|
1422
|
+
`;var xr=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Ne=class extends p{constructor(){super(...arguments),this.checked=void 0}render(){return l`
|
|
1423
|
+
<button>
|
|
1424
|
+
<wui-icon size="xl" name="walletConnectBrown"></wui-icon>
|
|
1425
|
+
<wui-switch ?checked=${h(this.checked)}></wui-switch>
|
|
1426
|
+
</button>
|
|
1427
|
+
`}};Ne.styles=[y,L,vr];xr([c({type:Boolean})],Ne.prototype,"checked",void 0);Ne=xr([d("wui-certified-switch")],Ne);var yr=g`
|
|
1428
|
+
button {
|
|
1429
|
+
background-color: var(--wui-color-fg-300);
|
|
1430
|
+
border-radius: var(--wui-border-radius-4xs);
|
|
1431
|
+
width: 16px;
|
|
1432
|
+
height: 16px;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
button:disabled {
|
|
1436
|
+
background-color: var(--wui-color-bg-300);
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
wui-icon {
|
|
1440
|
+
color: var(--wui-color-bg-200) !important;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
button:focus-visible {
|
|
1444
|
+
background-color: var(--wui-color-fg-250);
|
|
1445
|
+
border: 1px solid var(--wui-color-accent-100);
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
@media (hover: hover) and (pointer: fine) {
|
|
1449
|
+
button:hover:enabled {
|
|
1450
|
+
background-color: var(--wui-color-fg-250);
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
button:active:enabled {
|
|
1454
|
+
background-color: var(--wui-color-fg-225);
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
`;var Cr=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Me=class extends p{constructor(){super(...arguments),this.icon="copy"}render(){return l`
|
|
1458
|
+
<button>
|
|
1459
|
+
<wui-icon color="inherit" size="xxs" name=${this.icon}></wui-icon>
|
|
1460
|
+
</button>
|
|
1461
|
+
`}};Me.styles=[y,L,yr];Cr([c()],Me.prototype,"icon",void 0);Me=Cr([d("wui-input-element")],Me);var Er=g`
|
|
1462
|
+
:host {
|
|
1463
|
+
position: relative;
|
|
1464
|
+
width: 100%;
|
|
1465
|
+
display: inline-block;
|
|
1466
|
+
color: var(--wui-color-fg-275);
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
input {
|
|
1470
|
+
width: 100%;
|
|
1471
|
+
border-radius: var(--wui-border-radius-xs);
|
|
1472
|
+
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-002);
|
|
1473
|
+
background: var(--wui-color-gray-glass-002);
|
|
1474
|
+
font-size: var(--wui-font-size-paragraph);
|
|
1475
|
+
letter-spacing: var(--wui-letter-spacing-paragraph);
|
|
1476
|
+
color: var(--wui-color-fg-100);
|
|
1477
|
+
transition:
|
|
1478
|
+
background-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
|
|
1479
|
+
border-color var(--wui-ease-inout-power-1) var(--wui-duration-md),
|
|
1480
|
+
box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md);
|
|
1481
|
+
will-change: background-color, border-color, box-shadow;
|
|
1482
|
+
caret-color: var(--wui-color-accent-100);
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
input:disabled {
|
|
1486
|
+
cursor: not-allowed;
|
|
1487
|
+
border: 1px solid var(--wui-color-gray-glass-010);
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
input:disabled::placeholder,
|
|
1491
|
+
input:disabled + wui-icon {
|
|
1492
|
+
color: var(--wui-color-fg-300);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
input::placeholder {
|
|
1496
|
+
color: var(--wui-color-fg-275);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
input:focus:enabled {
|
|
1500
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
1501
|
+
-webkit-box-shadow:
|
|
1502
|
+
inset 0 0 0 1px var(--wui-color-accent-100),
|
|
1503
|
+
0px 0px 0px 4px var(--wui-box-shadow-blue);
|
|
1504
|
+
-moz-box-shadow:
|
|
1505
|
+
inset 0 0 0 1px var(--wui-color-accent-100),
|
|
1506
|
+
0px 0px 0px 4px var(--wui-box-shadow-blue);
|
|
1507
|
+
box-shadow:
|
|
1508
|
+
inset 0 0 0 1px var(--wui-color-accent-100),
|
|
1509
|
+
0px 0px 0px 4px var(--wui-box-shadow-blue);
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
input:hover:enabled {
|
|
1513
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
wui-icon {
|
|
1517
|
+
position: absolute;
|
|
1518
|
+
top: 50%;
|
|
1519
|
+
transform: translateY(-50%);
|
|
1520
|
+
pointer-events: none;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
.wui-size-sm {
|
|
1524
|
+
padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s);
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
wui-icon + .wui-size-sm {
|
|
1528
|
+
padding: 9px var(--wui-spacing-m) 10px 36px;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
wui-icon[data-input='sm'] {
|
|
1532
|
+
left: var(--wui-spacing-s);
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
.wui-size-md {
|
|
1536
|
+
padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m);
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
wui-icon + .wui-size-md,
|
|
1540
|
+
wui-loading-spinner + .wui-size-md {
|
|
1541
|
+
padding: 10.5px var(--wui-spacing-3xl) 10.5px var(--wui-spacing-3xl);
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
wui-icon[data-input='md'] {
|
|
1545
|
+
left: var(--wui-spacing-l);
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
.wui-size-lg {
|
|
1549
|
+
padding: var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-l);
|
|
1550
|
+
letter-spacing: var(--wui-letter-spacing-medium-title);
|
|
1551
|
+
font-size: var(--wui-font-size-medium-title);
|
|
1552
|
+
font-weight: var(--wui-font-weight-light);
|
|
1553
|
+
line-height: 130%;
|
|
1554
|
+
color: var(--wui-color-fg-100);
|
|
1555
|
+
height: 64px;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
.wui-padding-right-xs {
|
|
1559
|
+
padding-right: var(--wui-spacing-xs);
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
.wui-padding-right-s {
|
|
1563
|
+
padding-right: var(--wui-spacing-s);
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
.wui-padding-right-m {
|
|
1567
|
+
padding-right: var(--wui-spacing-m);
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
.wui-padding-right-l {
|
|
1571
|
+
padding-right: var(--wui-spacing-l);
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
.wui-padding-right-xl {
|
|
1575
|
+
padding-right: var(--wui-spacing-xl);
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
.wui-padding-right-2xl {
|
|
1579
|
+
padding-right: var(--wui-spacing-2xl);
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
.wui-padding-right-3xl {
|
|
1583
|
+
padding-right: var(--wui-spacing-3xl);
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
.wui-padding-right-4xl {
|
|
1587
|
+
padding-right: var(--wui-spacing-4xl);
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
.wui-padding-right-5xl {
|
|
1591
|
+
padding-right: var(--wui-spacing-5xl);
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
wui-icon + .wui-size-lg,
|
|
1595
|
+
wui-loading-spinner + .wui-size-lg {
|
|
1596
|
+
padding-left: 50px;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
wui-icon[data-input='lg'] {
|
|
1600
|
+
left: var(--wui-spacing-l);
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
.wui-size-mdl {
|
|
1604
|
+
padding: 17.25px var(--wui-spacing-m) 17.25px var(--wui-spacing-m);
|
|
1605
|
+
}
|
|
1606
|
+
wui-icon + .wui-size-mdl,
|
|
1607
|
+
wui-loading-spinner + .wui-size-mdl {
|
|
1608
|
+
padding: 17.25px var(--wui-spacing-3xl) 17.25px 40px;
|
|
1609
|
+
}
|
|
1610
|
+
wui-icon[data-input='mdl'] {
|
|
1611
|
+
left: var(--wui-spacing-m);
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
input:placeholder-shown ~ ::slotted(wui-input-element),
|
|
1615
|
+
input:placeholder-shown ~ ::slotted(wui-icon) {
|
|
1616
|
+
opacity: 0;
|
|
1617
|
+
pointer-events: none;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
input::-webkit-outer-spin-button,
|
|
1621
|
+
input::-webkit-inner-spin-button {
|
|
1622
|
+
-webkit-appearance: none;
|
|
1623
|
+
margin: 0;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
input[type='number'] {
|
|
1627
|
+
-moz-appearance: textfield;
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
::slotted(wui-input-element),
|
|
1631
|
+
::slotted(wui-icon) {
|
|
1632
|
+
position: absolute;
|
|
1633
|
+
top: 50%;
|
|
1634
|
+
transform: translateY(-50%);
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
::slotted(wui-input-element) {
|
|
1638
|
+
right: var(--wui-spacing-m);
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
::slotted(wui-icon) {
|
|
1642
|
+
right: 0px;
|
|
1643
|
+
}
|
|
1644
|
+
`;var rt=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},J=class extends p{constructor(){super(...arguments),this.inputElementRef=Ft(),this.size="md",this.disabled=!1,this.placeholder="",this.type="text",this.value=""}render(){let t=`wui-padding-right-${this.inputRightPadding}`,i={[`wui-size-${this.size}`]:!0,[t]:!!this.inputRightPadding};return l`${this.templateIcon()}
|
|
1645
|
+
<input
|
|
1646
|
+
data-testid="wui-input-text"
|
|
1647
|
+
${Vt(this.inputElementRef)}
|
|
1648
|
+
class=${zo(i)}
|
|
1649
|
+
type=${this.type}
|
|
1650
|
+
enterkeyhint=${h(this.enterKeyHint)}
|
|
1651
|
+
?disabled=${this.disabled}
|
|
1652
|
+
placeholder=${this.placeholder}
|
|
1653
|
+
@input=${this.dispatchInputChangeEvent.bind(this)}
|
|
1654
|
+
.value=${this.value||""}
|
|
1655
|
+
tabindex=${h(this.tabIdx)}
|
|
1656
|
+
/>
|
|
1657
|
+
<slot></slot>`}templateIcon(){return this.icon?l`<wui-icon
|
|
1658
|
+
data-input=${this.size}
|
|
1659
|
+
size=${this.size}
|
|
1660
|
+
color="inherit"
|
|
1661
|
+
name=${this.icon}
|
|
1662
|
+
></wui-icon>`:null}dispatchInputChangeEvent(){this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};J.styles=[y,L,Er];rt([c()],J.prototype,"size",void 0);rt([c()],J.prototype,"icon",void 0);rt([c({type:Boolean})],J.prototype,"disabled",void 0);rt([c()],J.prototype,"placeholder",void 0);rt([c()],J.prototype,"type",void 0);rt([c()],J.prototype,"keyHint",void 0);rt([c()],J.prototype,"value",void 0);rt([c()],J.prototype,"inputRightPadding",void 0);rt([c()],J.prototype,"tabIdx",void 0);J=rt([d("wui-input-text")],J);var Rr=g`
|
|
1663
|
+
:host {
|
|
1664
|
+
position: relative;
|
|
1665
|
+
display: inline-block;
|
|
1666
|
+
width: 100%;
|
|
1667
|
+
}
|
|
1668
|
+
`;var Nn=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Oo=class extends p{constructor(){super(...arguments),this.inputComponentRef=Ft()}render(){return l`
|
|
1669
|
+
<wui-input-text
|
|
1670
|
+
${Vt(this.inputComponentRef)}
|
|
1671
|
+
placeholder="Search wallet"
|
|
1672
|
+
icon="search"
|
|
1673
|
+
type="search"
|
|
1674
|
+
enterKeyHint="search"
|
|
1675
|
+
size="sm"
|
|
1676
|
+
>
|
|
1677
|
+
<wui-input-element @click=${this.clearValue} icon="close"></wui-input-element>
|
|
1678
|
+
</wui-input-text>
|
|
1679
|
+
`}clearValue(){let e=this.inputComponentRef.value?.inputElementRef.value;e&&(e.value="",e.focus(),e.dispatchEvent(new Event("input")))}};Oo.styles=[y,Rr];Oo=Nn([d("wui-search-bar")],Oo);var $r=mt`<svg viewBox="0 0 48 54" fill="none">
|
|
1680
|
+
<path
|
|
1681
|
+
d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z"
|
|
1682
|
+
/>
|
|
1683
|
+
</svg>`;var _r=g`
|
|
1684
|
+
:host {
|
|
1685
|
+
display: flex;
|
|
1686
|
+
flex-direction: column;
|
|
1687
|
+
align-items: center;
|
|
1688
|
+
width: 104px;
|
|
1689
|
+
row-gap: var(--wui-spacing-xs);
|
|
1690
|
+
padding: var(--wui-spacing-xs) 10px;
|
|
1691
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
1692
|
+
border-radius: clamp(0px, var(--wui-border-radius-xs), 20px);
|
|
1693
|
+
position: relative;
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
wui-shimmer[data-type='network'] {
|
|
1697
|
+
border: none;
|
|
1698
|
+
-webkit-clip-path: var(--wui-path-network);
|
|
1699
|
+
clip-path: var(--wui-path-network);
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
svg {
|
|
1703
|
+
position: absolute;
|
|
1704
|
+
width: 48px;
|
|
1705
|
+
height: 54px;
|
|
1706
|
+
z-index: 1;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
svg > path {
|
|
1710
|
+
stroke: var(--wui-color-gray-glass-010);
|
|
1711
|
+
stroke-width: 1px;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
@media (max-width: 350px) {
|
|
1715
|
+
:host {
|
|
1716
|
+
width: 100%;
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
`;var Ir=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},qe=class extends p{constructor(){super(...arguments),this.type="wallet"}render(){return l`
|
|
1720
|
+
${this.shimmerTemplate()}
|
|
1721
|
+
<wui-shimmer width="56px" height="20px" borderRadius="xs"></wui-shimmer>
|
|
1722
|
+
`}shimmerTemplate(){return this.type==="network"?l` <wui-shimmer
|
|
1723
|
+
data-type=${this.type}
|
|
1724
|
+
width="48px"
|
|
1725
|
+
height="54px"
|
|
1726
|
+
borderRadius="xs"
|
|
1727
|
+
></wui-shimmer>
|
|
1728
|
+
${$r}`:l`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}};qe.styles=[y,L,_r];Ir([c()],qe.prototype,"type",void 0);qe=Ir([d("wui-card-select-loader")],qe);var Wr=g`
|
|
1729
|
+
:host {
|
|
1730
|
+
display: grid;
|
|
1731
|
+
width: inherit;
|
|
1732
|
+
height: inherit;
|
|
1733
|
+
}
|
|
1734
|
+
`;var Q=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},H=class extends p{render(){return this.style.cssText=`
|
|
1735
|
+
grid-template-rows: ${this.gridTemplateRows};
|
|
1736
|
+
grid-template-columns: ${this.gridTemplateColumns};
|
|
1737
|
+
justify-items: ${this.justifyItems};
|
|
1738
|
+
align-items: ${this.alignItems};
|
|
1739
|
+
justify-content: ${this.justifyContent};
|
|
1740
|
+
align-content: ${this.alignContent};
|
|
1741
|
+
column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`};
|
|
1742
|
+
row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`};
|
|
1743
|
+
gap: ${this.gap&&`var(--wui-spacing-${this.gap})`};
|
|
1744
|
+
padding-top: ${this.padding&&X.getSpacingStyles(this.padding,0)};
|
|
1745
|
+
padding-right: ${this.padding&&X.getSpacingStyles(this.padding,1)};
|
|
1746
|
+
padding-bottom: ${this.padding&&X.getSpacingStyles(this.padding,2)};
|
|
1747
|
+
padding-left: ${this.padding&&X.getSpacingStyles(this.padding,3)};
|
|
1748
|
+
margin-top: ${this.margin&&X.getSpacingStyles(this.margin,0)};
|
|
1749
|
+
margin-right: ${this.margin&&X.getSpacingStyles(this.margin,1)};
|
|
1750
|
+
margin-bottom: ${this.margin&&X.getSpacingStyles(this.margin,2)};
|
|
1751
|
+
margin-left: ${this.margin&&X.getSpacingStyles(this.margin,3)};
|
|
1752
|
+
`,l`<slot></slot>`}};H.styles=[y,Wr];Q([c()],H.prototype,"gridTemplateRows",void 0);Q([c()],H.prototype,"gridTemplateColumns",void 0);Q([c()],H.prototype,"justifyItems",void 0);Q([c()],H.prototype,"alignItems",void 0);Q([c()],H.prototype,"justifyContent",void 0);Q([c()],H.prototype,"alignContent",void 0);Q([c()],H.prototype,"columnGap",void 0);Q([c()],H.prototype,"rowGap",void 0);Q([c()],H.prototype,"gap",void 0);Q([c()],H.prototype,"padding",void 0);Q([c()],H.prototype,"margin",void 0);H=Q([d("wui-grid")],H);var Sr=g`
|
|
1753
|
+
button {
|
|
1754
|
+
display: flex;
|
|
1755
|
+
flex-direction: column;
|
|
1756
|
+
justify-content: center;
|
|
1757
|
+
align-items: center;
|
|
1758
|
+
cursor: pointer;
|
|
1759
|
+
width: 104px;
|
|
1760
|
+
row-gap: var(--wui-spacing-xs);
|
|
1761
|
+
padding: var(--wui-spacing-s) var(--wui-spacing-0);
|
|
1762
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
1763
|
+
border-radius: clamp(0px, var(--wui-border-radius-xs), 20px);
|
|
1764
|
+
transition:
|
|
1765
|
+
color var(--wui-duration-lg) var(--wui-ease-out-power-1),
|
|
1766
|
+
background-color var(--wui-duration-lg) var(--wui-ease-out-power-1),
|
|
1767
|
+
border-radius var(--wui-duration-lg) var(--wui-ease-out-power-1);
|
|
1768
|
+
will-change: background-color, color, border-radius;
|
|
1769
|
+
outline: none;
|
|
1770
|
+
border: none;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
button > wui-flex > wui-text {
|
|
1774
|
+
color: var(--wui-color-fg-100);
|
|
1775
|
+
max-width: 86px;
|
|
1776
|
+
white-space: nowrap;
|
|
1777
|
+
overflow: hidden;
|
|
1778
|
+
text-overflow: ellipsis;
|
|
1779
|
+
justify-content: center;
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
button > wui-flex > wui-text.certified {
|
|
1783
|
+
max-width: 66px;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
button:hover:enabled {
|
|
1787
|
+
background-color: var(--wui-color-gray-glass-005);
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
button:disabled > wui-flex > wui-text {
|
|
1791
|
+
color: var(--wui-color-gray-glass-015);
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
[data-selected='true'] {
|
|
1795
|
+
background-color: var(--wui-color-accent-glass-020);
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
@media (hover: hover) and (pointer: fine) {
|
|
1799
|
+
[data-selected='true']:hover:enabled {
|
|
1800
|
+
background-color: var(--wui-color-accent-glass-015);
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
[data-selected='true']:active:enabled {
|
|
1805
|
+
background-color: var(--wui-color-accent-glass-010);
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
@media (max-width: 350px) {
|
|
1809
|
+
button {
|
|
1810
|
+
width: 100%;
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
`;var de=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Bt=class extends p{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.wallet=void 0,this.observer=new IntersectionObserver(t=>{t.forEach(e=>{e.isIntersecting?(this.visible=!0,this.fetchImageSrc()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){let t=this.wallet?.badge_type==="certified";return l`
|
|
1814
|
+
<button>
|
|
1815
|
+
${this.imageTemplate()}
|
|
1816
|
+
<wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="3xs">
|
|
1817
|
+
<wui-text
|
|
1818
|
+
variant="tiny-500"
|
|
1819
|
+
color="inherit"
|
|
1820
|
+
class=${h(t?"certified":void 0)}
|
|
1821
|
+
>${this.wallet?.name}</wui-text
|
|
1822
|
+
>
|
|
1823
|
+
${t?l`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null}
|
|
1824
|
+
</wui-flex>
|
|
1825
|
+
</button>
|
|
1826
|
+
`}imageTemplate(){return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():l`
|
|
1827
|
+
<wui-wallet-image
|
|
1828
|
+
size="md"
|
|
1829
|
+
imageSrc=${h(this.imageSrc)}
|
|
1830
|
+
name=${this.wallet?.name}
|
|
1831
|
+
.installed=${this.wallet?.installed}
|
|
1832
|
+
badgeSize="sm"
|
|
1833
|
+
>
|
|
1834
|
+
</wui-wallet-image>
|
|
1835
|
+
`}shimmerTemplate(){return l`<wui-shimmer width="56px" height="56px" borderRadius="xs"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=B.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await B.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}};Bt.styles=Sr;de([m()],Bt.prototype,"visible",void 0);de([m()],Bt.prototype,"imageSrc",void 0);de([m()],Bt.prototype,"imageLoading",void 0);de([c()],Bt.prototype,"wallet",void 0);Bt=de([d("w3m-all-wallets-list-item")],Bt);var Tr=g`
|
|
1836
|
+
wui-grid {
|
|
1837
|
+
max-height: clamp(360px, 400px, 80vh);
|
|
1838
|
+
overflow: scroll;
|
|
1839
|
+
scrollbar-width: none;
|
|
1840
|
+
grid-auto-rows: min-content;
|
|
1841
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
@media (max-width: 350px) {
|
|
1845
|
+
wui-grid {
|
|
1846
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
wui-grid[data-scroll='false'] {
|
|
1851
|
+
overflow: hidden;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
wui-grid::-webkit-scrollbar {
|
|
1855
|
+
display: none;
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
wui-loading-spinner {
|
|
1859
|
+
padding-top: var(--wui-spacing-l);
|
|
1860
|
+
padding-bottom: var(--wui-spacing-l);
|
|
1861
|
+
justify-content: center;
|
|
1862
|
+
grid-column: 1 / span 4;
|
|
1863
|
+
}
|
|
1864
|
+
`;var Ht=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Lr="local-paginator",xt=class extends p{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!R.state.wallets.length,this.wallets=R.state.wallets,this.recommended=R.state.recommended,this.featured=R.state.featured,this.filteredWallets=R.state.filteredWallets,this.unsubscribe.push(R.subscribeKey("wallets",t=>this.wallets=t),R.subscribeKey("recommended",t=>this.recommended=t),R.subscribeKey("featured",t=>this.featured=t),R.subscribeKey("filteredWallets",t=>this.filteredWallets=t))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),this.paginationObserver?.disconnect()}render(){return l`
|
|
1865
|
+
<wui-grid
|
|
1866
|
+
data-scroll=${!this.loading}
|
|
1867
|
+
.padding=${["0","s","s","s"]}
|
|
1868
|
+
columnGap="xxs"
|
|
1869
|
+
rowGap="l"
|
|
1870
|
+
justifyContent="space-between"
|
|
1871
|
+
>
|
|
1872
|
+
${this.loading?this.shimmerTemplate(16):this.walletsTemplate()}
|
|
1873
|
+
${this.paginationLoaderTemplate()}
|
|
1874
|
+
</wui-grid>
|
|
1875
|
+
`}async initialFetch(){this.loading=!0;let t=this.shadowRoot?.querySelector("wui-grid");t&&(await R.fetchWalletsByPage({page:1}),await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(t,e){return[...Array(t)].map(()=>l`
|
|
1876
|
+
<wui-card-select-loader type="wallet" id=${h(e)}></wui-card-select-loader>
|
|
1877
|
+
`)}walletsTemplate(){let t=this.filteredWallets?.length>0?f.uniqueBy([...this.featured,...this.recommended,...this.filteredWallets],"id"):f.uniqueBy([...this.featured,...this.recommended,...this.wallets],"id");return ht.markWalletsAsInstalled(t).map(i=>l`
|
|
1878
|
+
<w3m-all-wallets-list-item
|
|
1879
|
+
@click=${()=>this.onConnectWallet(i)}
|
|
1880
|
+
.wallet=${i}
|
|
1881
|
+
></w3m-all-wallets-list-item>
|
|
1882
|
+
`)}paginationLoaderTemplate(){let{wallets:t,recommended:e,featured:i,count:n}=R.state,o=window.innerWidth<352?3:4,s=t.length+e.length,u=Math.ceil(s/o)*o-s+o;return u-=t.length?i.length%o:0,n===0&&i.length>0?null:n===0||[...i,...t,...e].length<n?this.shimmerTemplate(u,Lr):null}createPaginationObserver(){let t=this.shadowRoot?.querySelector(`#${Lr}`);t&&(this.paginationObserver=new IntersectionObserver(([e])=>{if(e?.isIntersecting&&!this.loading){let{page:i,count:n,wallets:o}=R.state;o.length<n&&R.fetchWalletsByPage({page:i+1})}}),this.paginationObserver.observe(t))}onConnectWallet(t){v.selectWalletConnector(t)}};xt.styles=Tr;Ht([m()],xt.prototype,"loading",void 0);Ht([m()],xt.prototype,"wallets",void 0);Ht([m()],xt.prototype,"recommended",void 0);Ht([m()],xt.prototype,"featured",void 0);Ht([m()],xt.prototype,"filteredWallets",void 0);xt=Ht([d("w3m-all-wallets-list")],xt);var Br=g`
|
|
1883
|
+
wui-grid,
|
|
1884
|
+
wui-loading-spinner,
|
|
1885
|
+
wui-flex {
|
|
1886
|
+
height: 360px;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
wui-grid {
|
|
1890
|
+
overflow: scroll;
|
|
1891
|
+
scrollbar-width: none;
|
|
1892
|
+
grid-auto-rows: min-content;
|
|
1893
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
wui-grid[data-scroll='false'] {
|
|
1897
|
+
overflow: hidden;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
wui-grid::-webkit-scrollbar {
|
|
1901
|
+
display: none;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
wui-loading-spinner {
|
|
1905
|
+
justify-content: center;
|
|
1906
|
+
align-items: center;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
@media (max-width: 350px) {
|
|
1910
|
+
wui-grid {
|
|
1911
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1912
|
+
}
|
|
1913
|
+
}
|
|
1914
|
+
`;var Fe=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Kt=class extends p{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?l`<wui-loading-spinner color="accent-100"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){(this.query.trim()!==this.prevQuery.trim()||this.badge!==this.prevBadge)&&(this.prevQuery=this.query,this.prevBadge=this.badge,this.loading=!0,await R.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){let{search:t}=R.state,e=ht.markWalletsAsInstalled(t);return t.length?l`
|
|
1915
|
+
<wui-grid
|
|
1916
|
+
data-testid="wallet-list"
|
|
1917
|
+
.padding=${["0","s","s","s"]}
|
|
1918
|
+
rowGap="l"
|
|
1919
|
+
columnGap="xs"
|
|
1920
|
+
justifyContent="space-between"
|
|
1921
|
+
>
|
|
1922
|
+
${e.map(i=>l`
|
|
1923
|
+
<w3m-all-wallets-list-item
|
|
1924
|
+
@click=${()=>this.onConnectWallet(i)}
|
|
1925
|
+
.wallet=${i}
|
|
1926
|
+
data-testid="wallet-search-item-${i.id}"
|
|
1927
|
+
></w3m-all-wallets-list-item>
|
|
1928
|
+
`)}
|
|
1929
|
+
</wui-grid>
|
|
1930
|
+
`:l`
|
|
1931
|
+
<wui-flex
|
|
1932
|
+
data-testid="no-wallet-found"
|
|
1933
|
+
justifyContent="center"
|
|
1934
|
+
alignItems="center"
|
|
1935
|
+
gap="s"
|
|
1936
|
+
flexDirection="column"
|
|
1937
|
+
>
|
|
1938
|
+
<wui-icon-box
|
|
1939
|
+
size="lg"
|
|
1940
|
+
iconColor="fg-200"
|
|
1941
|
+
backgroundColor="fg-300"
|
|
1942
|
+
icon="wallet"
|
|
1943
|
+
background="transparent"
|
|
1944
|
+
></wui-icon-box>
|
|
1945
|
+
<wui-text data-testid="no-wallet-found-text" color="fg-200" variant="paragraph-500">
|
|
1946
|
+
No Wallet found
|
|
1947
|
+
</wui-text>
|
|
1948
|
+
</wui-flex>
|
|
1949
|
+
`}onConnectWallet(t){v.selectWalletConnector(t)}};Kt.styles=Br;Fe([m()],Kt.prototype,"loading",void 0);Fe([c()],Kt.prototype,"query",void 0);Fe([c()],Kt.prototype,"badge",void 0);Kt=Fe([d("w3m-all-wallets-search")],Kt);var Po=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Ve=class extends p{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=f.debounce(t=>{this.search=t})}render(){let t=this.search.length>=2;return l`
|
|
1950
|
+
<wui-flex .padding=${["0","s","s","s"]} gap="xs">
|
|
1951
|
+
<wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
|
|
1952
|
+
<wui-certified-switch
|
|
1953
|
+
?checked=${this.badge}
|
|
1954
|
+
@click=${this.onClick.bind(this)}
|
|
1955
|
+
data-testid="wui-certified-switch"
|
|
1956
|
+
></wui-certified-switch>
|
|
1957
|
+
${this.qrButtonTemplate()}
|
|
1958
|
+
</wui-flex>
|
|
1959
|
+
${t||this.badge?l`<w3m-all-wallets-search
|
|
1960
|
+
query=${this.search}
|
|
1961
|
+
badge=${h(this.badge)}
|
|
1962
|
+
></w3m-all-wallets-search>`:l`<w3m-all-wallets-list badge=${h(this.badge)}></w3m-all-wallets-list>`}
|
|
1963
|
+
`}onInputChange(t){this.onDebouncedSearch(t.detail)}onClick(){if(this.badge==="certified"){this.badge=void 0;return}this.badge="certified",yt.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})}qrButtonTemplate(){return f.isMobile()?l`
|
|
1964
|
+
<wui-icon-box
|
|
1965
|
+
size="lg"
|
|
1966
|
+
iconSize="xl"
|
|
1967
|
+
iconColor="accent-100"
|
|
1968
|
+
backgroundColor="accent-100"
|
|
1969
|
+
icon="qrCode"
|
|
1970
|
+
background="transparent"
|
|
1971
|
+
border
|
|
1972
|
+
borderColor="wui-accent-glass-010"
|
|
1973
|
+
@click=${this.onWalletConnectQr.bind(this)}
|
|
1974
|
+
></wui-icon-box>
|
|
1975
|
+
`:null}onWalletConnectQr(){E.push("ConnectingWalletConnect")}};Po([m()],Ve.prototype,"search",void 0);Po([m()],Ve.prototype,"badge",void 0);Ve=Po([d("w3m-all-wallets-view")],Ve);var Or=g`
|
|
1976
|
+
button {
|
|
1977
|
+
column-gap: var(--wui-spacing-s);
|
|
1978
|
+
padding: 11px 18px 11px var(--wui-spacing-s);
|
|
1979
|
+
width: 100%;
|
|
1980
|
+
background-color: var(--wui-color-gray-glass-002);
|
|
1981
|
+
border-radius: var(--wui-border-radius-xs);
|
|
1982
|
+
color: var(--wui-color-fg-250);
|
|
1983
|
+
transition:
|
|
1984
|
+
color var(--wui-ease-out-power-1) var(--wui-duration-md),
|
|
1985
|
+
background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
1986
|
+
will-change: color, background-color;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
button[data-iconvariant='square'],
|
|
1990
|
+
button[data-iconvariant='square-blue'] {
|
|
1991
|
+
padding: 6px 18px 6px 9px;
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
button > wui-flex {
|
|
1995
|
+
flex: 1;
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
button > wui-image {
|
|
1999
|
+
width: 32px;
|
|
2000
|
+
height: 32px;
|
|
2001
|
+
box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
|
|
2002
|
+
border-radius: var(--wui-border-radius-3xl);
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
button > wui-icon {
|
|
2006
|
+
width: 36px;
|
|
2007
|
+
height: 36px;
|
|
2008
|
+
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
|
|
2009
|
+
will-change: opacity;
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
button > wui-icon-box[data-variant='blue'] {
|
|
2013
|
+
box-shadow: 0 0 0 2px var(--wui-color-accent-glass-005);
|
|
2014
|
+
}
|
|
2015
|
+
|
|
2016
|
+
button > wui-icon-box[data-variant='overlay'] {
|
|
2017
|
+
box-shadow: 0 0 0 2px var(--wui-color-gray-glass-005);
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
button > wui-icon-box[data-variant='square-blue'] {
|
|
2021
|
+
border-radius: var(--wui-border-radius-3xs);
|
|
2022
|
+
position: relative;
|
|
2023
|
+
border: none;
|
|
2024
|
+
width: 36px;
|
|
2025
|
+
height: 36px;
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
button > wui-icon-box[data-variant='square-blue']::after {
|
|
2029
|
+
content: '';
|
|
2030
|
+
position: absolute;
|
|
2031
|
+
top: 0;
|
|
2032
|
+
bottom: 0;
|
|
2033
|
+
left: 0;
|
|
2034
|
+
right: 0;
|
|
2035
|
+
border-radius: inherit;
|
|
2036
|
+
border: 1px solid var(--wui-color-accent-glass-010);
|
|
2037
|
+
pointer-events: none;
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
button > wui-icon:last-child {
|
|
2041
|
+
width: 14px;
|
|
2042
|
+
height: 14px;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
button:disabled {
|
|
2046
|
+
color: var(--wui-color-gray-glass-020);
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
button[data-loading='true'] > wui-icon {
|
|
2050
|
+
opacity: 0;
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
wui-loading-spinner {
|
|
2054
|
+
position: absolute;
|
|
2055
|
+
right: 18px;
|
|
2056
|
+
top: 50%;
|
|
2057
|
+
transform: translateY(-50%);
|
|
2058
|
+
}
|
|
2059
|
+
`;var tt=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},K=class extends p{constructor(){super(...arguments),this.tabIdx=void 0,this.variant="icon",this.disabled=!1,this.imageSrc=void 0,this.alt=void 0,this.chevron=!1,this.loading=!1}render(){return l`
|
|
2060
|
+
<button
|
|
2061
|
+
?disabled=${this.loading?!0:!!this.disabled}
|
|
2062
|
+
data-loading=${this.loading}
|
|
2063
|
+
data-iconvariant=${h(this.iconVariant)}
|
|
2064
|
+
tabindex=${h(this.tabIdx)}
|
|
2065
|
+
>
|
|
2066
|
+
${this.loadingTemplate()} ${this.visualTemplate()}
|
|
2067
|
+
<wui-flex gap="3xs">
|
|
2068
|
+
<slot></slot>
|
|
2069
|
+
</wui-flex>
|
|
2070
|
+
${this.chevronTemplate()}
|
|
2071
|
+
</button>
|
|
2072
|
+
`}visualTemplate(){if(this.variant==="image"&&this.imageSrc)return l`<wui-image src=${this.imageSrc} alt=${this.alt??"list item"}></wui-image>`;if(this.iconVariant==="square"&&this.icon&&this.variant==="icon")return l`<wui-icon name=${this.icon}></wui-icon>`;if(this.variant==="icon"&&this.icon&&this.iconVariant){let t=["blue","square-blue"].includes(this.iconVariant)?"accent-100":"fg-200",e=this.iconVariant==="square-blue"?"mdl":"md",i=this.iconSize?this.iconSize:e;return l`
|
|
2073
|
+
<wui-icon-box
|
|
2074
|
+
data-variant=${this.iconVariant}
|
|
2075
|
+
icon=${this.icon}
|
|
2076
|
+
iconSize=${i}
|
|
2077
|
+
background="transparent"
|
|
2078
|
+
iconColor=${t}
|
|
2079
|
+
backgroundColor=${t}
|
|
2080
|
+
size=${e}
|
|
2081
|
+
></wui-icon-box>
|
|
2082
|
+
`}return null}loadingTemplate(){return this.loading?l`<wui-loading-spinner
|
|
2083
|
+
data-testid="wui-list-item-loading-spinner"
|
|
2084
|
+
color="fg-300"
|
|
2085
|
+
></wui-loading-spinner>`:l``}chevronTemplate(){return this.chevron?l`<wui-icon size="inherit" color="fg-200" name="chevronRight"></wui-icon>`:null}};K.styles=[y,L,Or];tt([c()],K.prototype,"icon",void 0);tt([c()],K.prototype,"iconSize",void 0);tt([c()],K.prototype,"tabIdx",void 0);tt([c()],K.prototype,"variant",void 0);tt([c()],K.prototype,"iconVariant",void 0);tt([c({type:Boolean})],K.prototype,"disabled",void 0);tt([c()],K.prototype,"imageSrc",void 0);tt([c()],K.prototype,"alt",void 0);tt([c({type:Boolean})],K.prototype,"chevron",void 0);tt([c({type:Boolean})],K.prototype,"loading",void 0);K=tt([d("wui-list-item")],K);var Mn=function(r,t,e,i){var n=arguments.length,o=n<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,t,e,i);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(o=(n<3?s(o):n>3?s(t,e,o):s(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o},Pr=class extends p{constructor(){super(...arguments),this.wallet=E.state.data?.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return l`
|
|
2086
|
+
<wui-flex gap="xs" flexDirection="column" .padding=${["s","s","l","s"]}>
|
|
2087
|
+
${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
|
|
2088
|
+
${this.homepageTemplate()}
|
|
2089
|
+
</wui-flex>
|
|
2090
|
+
`}chromeTemplate(){return this.wallet?.chrome_store?l`<wui-list-item
|
|
2091
|
+
variant="icon"
|
|
2092
|
+
icon="chromeStore"
|
|
2093
|
+
iconVariant="square"
|
|
2094
|
+
@click=${this.onChromeStore.bind(this)}
|
|
2095
|
+
chevron
|
|
2096
|
+
>
|
|
2097
|
+
<wui-text variant="paragraph-500" color="fg-100">Chrome Extension</wui-text>
|
|
2098
|
+
</wui-list-item>`:null}iosTemplate(){return this.wallet?.app_store?l`<wui-list-item
|
|
2099
|
+
variant="icon"
|
|
2100
|
+
icon="appStore"
|
|
2101
|
+
iconVariant="square"
|
|
2102
|
+
@click=${this.onAppStore.bind(this)}
|
|
2103
|
+
chevron
|
|
2104
|
+
>
|
|
2105
|
+
<wui-text variant="paragraph-500" color="fg-100">iOS App</wui-text>
|
|
2106
|
+
</wui-list-item>`:null}androidTemplate(){return this.wallet?.play_store?l`<wui-list-item
|
|
2107
|
+
variant="icon"
|
|
2108
|
+
icon="playStore"
|
|
2109
|
+
iconVariant="square"
|
|
2110
|
+
@click=${this.onPlayStore.bind(this)}
|
|
2111
|
+
chevron
|
|
2112
|
+
>
|
|
2113
|
+
<wui-text variant="paragraph-500" color="fg-100">Android App</wui-text>
|
|
2114
|
+
</wui-list-item>`:null}homepageTemplate(){return this.wallet?.homepage?l`
|
|
2115
|
+
<wui-list-item
|
|
2116
|
+
variant="icon"
|
|
2117
|
+
icon="browser"
|
|
2118
|
+
iconVariant="square-blue"
|
|
2119
|
+
@click=${this.onHomePage.bind(this)}
|
|
2120
|
+
chevron
|
|
2121
|
+
>
|
|
2122
|
+
<wui-text variant="paragraph-500" color="fg-100">Website</wui-text>
|
|
2123
|
+
</wui-list-item>
|
|
2124
|
+
`:null}onChromeStore(){this.wallet?.chrome_store&&f.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){this.wallet?.app_store&&f.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&f.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&f.openHref(this.wallet.homepage,"_blank")}};Pr=Mn([d("w3m-downloads-view")],Pr);export{Ve as W3mAllWalletsView,To as W3mConnectingWcBasicView,Pr as W3mDownloadsView};
|
|
2125
|
+
/*! Bundled license information:
|
|
2126
|
+
|
|
2127
|
+
lit-html/directives/ref.js:
|
|
2128
|
+
(**
|
|
2129
|
+
* @license
|
|
2130
|
+
* Copyright 2020 Google LLC
|
|
2131
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
2132
|
+
*)
|
|
2133
|
+
*/
|