1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="0966a845-a6be-450f-61d1-c3848d50e392")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,533143,e=>{"use strict";let t;e.i(812207);var r=e.i(108285),o=e.i(654479);e.i(374576);var i=e.i(56350),n=e.i(886259),a=e.i(227302),s=e.i(82283),l=e.i(758331);e.i(404041);var c=e.i(645975);e.i(62238);var d=r,u=e.i(120119);e.i(234051);var h=e.i(829389),p=e.i(401564),f=e.i(971080),g=e.i(149454),m=e.i(653157),w=e.i(221728);e.i(987789);var b=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let y=class extends d.LitElement{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=g.ConnectorController.state.connectors,this.count=n.ApiController.state.count,this.filteredCount=n.ApiController.state.filteredWallets.length,this.isFetchingRecommendedWallets=n.ApiController.state.isFetchingRecommendedWallets,this.unsubscribe.push(g.ConnectorController.subscribeKey("connectors",e=>this.connectors=e),n.ApiController.subscribeKey("count",e=>this.count=e),n.ApiController.subscribeKey("filteredWallets",e=>this.filteredCount=e.length),n.ApiController.subscribeKey("isFetchingRecommendedWallets",e=>this.isFetchingRecommendedWallets=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.connectors.find(e=>"walletConnect"===e.id),{allWallets:t}=s.OptionsController.state;if(!e||"HIDE"===t||"ONLY_MOBILE"===t&&!a.CoreHelperUtil.isMobile())return null;let r=n.ApiController.state.featured.length,i=this.count+r,l=i<10?i:10*Math.floor(i/10),c=this.filteredCount>0?this.filteredCount:l,d=`${c}`;this.filteredCount>0?d=`${this.filteredCount}`:c<i&&(d=`${c}+`);let u=f.ConnectionController.hasAnyConnection(p.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT);return o.html` 3 <wui-list-wallet 4 name="Search Wallet" 5 walletIcon="search" 6 showAllWallets 7 @click=${this.onAllWallets.bind(this)} 8 tagLabel=${d} 9 tagVariant="info" 10 data-testid="all-wallets" 11 tabIdx=${(0,h.ifDefined)(this.tabIdx)} 12 .loading=${this.isFetchingRecommendedWallets} 13 ?disabled=${u} 14 size="sm" 15 ></wui-list-wallet> 16 `}onAllWallets(){m.EventsController.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),w.RouterController.push("AllWallets",{redirectView:w.RouterController.state.data?.redirectView})}};b([(0,u.property)()],y.prototype,"tabIdx",void 0),b([(0,i.state)()],y.prototype,"connectors",void 0),b([(0,i.state)()],y.prototype,"count",void 0),b([(0,i.state)()],y.prototype,"filteredCount",void 0),b([(0,i.state)()],y.prototype,"isFetchingRecommendedWallets",void 0),y=b([(0,c.customElement)("w3m-all-wallets-widget")],y);var v=r,C=e.i(241845),x=e.i(436220),$=e.i(769718),E=e.i(288085),R=e.i(162611);let k=R.css` 17 :host { 18 margin-top: ${({spacing:e})=>e["1"]}; 19 } 20 wui-separator { 21 margin: ${({spacing:e})=>e["3"]} calc(${({spacing:e})=>e["3"]} * -1) 22 ${({spacing:e})=>e["2"]} calc(${({spacing:e})=>e["3"]} * -1); 23 width: calc(100% + ${({spacing:e})=>e["3"]} * 2); 24 } 25`;var T=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let O=class extends v.LitElement{constructor(){super(),this.unsubscribe=[],this.connectors=g.ConnectorController.state.connectors,this.recommended=n.ApiController.state.recommended,this.featured=n.ApiController.state.featured,this.explorerWallets=n.ApiController.state.explorerWallets,this.connections=f.ConnectionController.state.connections,this.connectorImages=C.AssetController.state.connectorImages,this.loadingTelegram=!1,this.unsubscribe.push(g.ConnectorController.subscribeKey("connectors",e=>this.connectors=e),f.ConnectionController.subscribeKey("connections",e=>this.connections=e),C.AssetController.subscribeKey("connectorImages",e=>this.connectorImages=e),n.ApiController.subscribeKey("recommended",e=>this.recommended=e),n.ApiController.subscribeKey("featured",e=>this.featured=e),n.ApiController.subscribeKey("explorerFilteredWallets",e=>{this.explorerWallets=e?.length?e:n.ApiController.state.explorerWallets}),n.ApiController.subscribeKey("explorerWallets",e=>{this.explorerWallets?.length||(this.explorerWallets=e)})),a.CoreHelperUtil.isTelegram()&&a.CoreHelperUtil.isIos()&&(this.loadingTelegram=!f.ConnectionController.state.wcUri,this.unsubscribe.push(f.ConnectionController.subscribeKey("wcUri",e=>this.loadingTelegram=!e)))}
25disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return o.html` 26 <wui-flex flexDirection="column" gap="2"> ${this.connectorListTemplate()} </wui-flex> 27 `}mapConnectorsToExplorerWallets(e,t){return e.map(e=>{if("MULTI_CHAIN"===e.type&&e.connectors){let r=e.connectors.map(e=>e.id),o=e.connectors.map(e=>e.name),i=e.connectors.map(e=>e.info?.rdns);return e.explorerWallet=t?.find(e=>r.includes(e.id)||o.includes(e.name)||e.rdns&&(i.includes(e.rdns)||r.includes(e.rdns)))??e.explorerWallet,e}let r=t?.find(t=>t.id===e.id||t.rdns===e.info?.rdns||t.name===e.name);return e.explorerWallet=r??e.explorerWallet,e})}processConnectorsByType(e,t=!0){let r=E.ConnectorUtil.sortConnectorsByExplorerWallet([...e]);return t?r.filter(E.ConnectorUtil.showConnector):r}connectorListTemplate(){let e=this.mapConnectorsToExplorerWallets(this.connectors,this.explorerWallets??[]),t=E.ConnectorUtil.getConnectorsByType(e,this.recommended,this.featured),r=this.processConnectorsByType(t.announced.filter(e=>"walletConnect"!==e.id)),o=this.processConnectorsByType(t.injected),i=this.processConnectorsByType(t.multiChain.filter(e=>"WalletConnect"!==e.name),!1),n=t.custom,s=t.recent,l=this.processConnectorsByType(t.external.filter(e=>e.id!==p.ConstantsUtil.CONNECTOR_ID.COINBASE_SDK)),c=t.recommended,d=t.featured,u=E.ConnectorUtil.getConnectorTypeOrder({custom:n,recent:s,announced:r,injected:o,multiChain:i,recommended:c,featured:d,external:l}),h=this.connectors.find(e=>"walletConnect"===e.id),f=a.CoreHelperUtil.isMobile(),g=[];for(let e of u)switch(e){case"walletConnect":!f&&h&&g.push({kind:"connector",subtype:"walletConnect",connector:h});break;case"recent":E.ConnectorUtil.getFilteredRecentWallets().forEach(e=>g.push({kind:"wallet",subtype:"recent",wallet:e}));break;case"injected":i.forEach(e=>g.push({kind:"connector",subtype:"multiChain",connector:e})),r.forEach(e=>g.push({kind:"connector",subtype:"announced",connector:e})),o.forEach(e=>g.push({kind:"connector",subtype:"injected",connector:e}));break;case"featured":d.forEach(e=>g.push({kind:"wallet",subtype:"featured",wallet:e}));break;case"custom":E.ConnectorUtil.getFilteredCustomWallets(n??[]).forEach(e=>g.push({kind:"wallet",subtype:"custom",wallet:e}));break;case"external":l.forEach(e=>g.push({kind:"connector",subtype:"external",connector:e}));break;case"recommended":E.ConnectorUtil.getCappedRecommendedWallets(c).forEach(e=>g.push({kind:"wallet",subtype:"recommended",wallet:e}));break;default:console.warn(`Unknown connector type: ${e}`)}return g.map((e,t)=>"connector"===e.kind?this.renderConnector(e,t):this.renderWallet(e,t))}renderConnector(e,t){let r,i,n=e.connector,a=x.AssetUtil.getConnectorImage(n)||this.connectorImages[n?.imageId??""],s=(this.connections.get(n.chain)??[]).some(e=>$.HelpersUtil.isLowerCaseMatch(e.connectorId,n.id));"multiChain"===e.subtype?(r="multichain",i="info"):"walletConnect"===e.subtype?(r="qr code",i="accent"):"injected"===e.subtype||"announced"===e.subtype?(r=s?"connected":"installed",i=s?"info":"success"):(r=void 0,i=void 0);let l=f.ConnectionController.hasAnyConnection(p.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT),c=("walletConnect"===e.subtype||"external"===e.subtype)&&l;return o.html` 28 <w3m-list-wallet 29 displayIndex=${t} 30 imageSrc=${(0,h.ifDefined)(a)} 31 .installed=${!0} 32 name=${n.name??"Unknown"} 33 .tagVariant=${i} 34 tagLabel=${(0,h.ifDefined)(r)} 35 data-testid=${`wallet-selector-${n.id.toLowerCase()}`} 36 size="sm" 37 @click=${()=>this.onClickConnector(e)} 38 tabIdx=${(0,h.ifDefined)(this.tabIdx)} 39 ?disabled=${c} 40 rdnsId=${(0,h.ifDefined)(n.explorerWallet?.rdns||void 0)} 41 walletRank=${(0,h.ifDefined)(n.explorerWallet?.order)} 42 > 43 </w3m-list-wallet> 44 `}onClickConnector(e){let t=w.RouterController.state.data?.redirectView;if("walletConnect"===e.subtype){g.ConnectorController.setActiveConnector(e.connector),a.CoreHelperUtil.isMobile()?w.RouterController.push("AllWallets"):w.RouterController.push("ConnectingWalletConnect",{redirectView:t});return}if("multiChain"===e.subtype){g.ConnectorController.setActiveConnector(e.connector),w.RouterController.push("ConnectingMultiChain",{redirectView:t});return}if("injected"===e.subtype){g.ConnectorController.setActiveConnector(e.connector),w.RouterController.push("ConnectingExter
44nal",{connector:e.connector,redirectView:t,wallet:e.connector.explorerWallet});return}if("announced"===e.subtype)return"walletConnect"===e.connector.id?void(a.CoreHelperUtil.isMobile()?w.RouterController.push("AllWallets"):w.RouterController.push("ConnectingWalletConnect",{redirectView:t})):(w.RouterController.push("ConnectingExternal",{connector:e.connector,redirectView:t,wallet:e.connector.explorerWallet}),void 0);w.RouterController.push("ConnectingExternal",{connector:e.connector,redirectView:t})}renderWallet(e,t){let r=e.wallet,i=x.AssetUtil.getWalletImage(r),n=f.ConnectionController.hasAnyConnection(p.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT),a=this.loadingTelegram,s="recent"===e.subtype?"recent":void 0,l="recent"===e.subtype?"info":void 0;return o.html` 45 <w3m-list-wallet 46 displayIndex=${t} 47 imageSrc=${(0,h.ifDefined)(i)} 48 name=${r.name??"Unknown"} 49 @click=${()=>this.onClickWallet(e)} 50 size="sm" 51 data-testid=${`wallet-selector-${r.id}`} 52 tabIdx=${(0,h.ifDefined)(this.tabIdx)} 53 ?loading=${a} 54 ?disabled=${n} 55 rdnsId=${(0,h.ifDefined)(r.rdns||void 0)} 56 walletRank=${(0,h.ifDefined)(r.order)} 57 tagLabel=${(0,h.ifDefined)(s)} 58 .tagVariant=${l} 59 > 60 </w3m-list-wallet> 61 `}onClickWallet(e){let t=w.RouterController.state.data?.redirectView;if("featured"===e.subtype)return void g.ConnectorController.selectWalletConnector(e.wallet);if("recent"===e.subtype){if(this.loadingTelegram)return;g.ConnectorController.selectWalletConnector(e.wallet);return}if("custom"===e.subtype){if(this.loadingTelegram)return;w.RouterController.push("ConnectingWalletConnect",{wallet:e.wallet,redirectView:t});return}if(this.loadingTelegram)return;let r=g.ConnectorController.getConnector({id:e.wallet.id,rdns:e.wallet.rdns});r?w.RouterController.push("ConnectingExternal",{connector:r,redirectView:t}):w.RouterController.push("ConnectingWalletConnect",{wallet:e.wallet,redirectView:t})}};O.styles=k,T([(0,u.property)({type:Number})],O.prototype,"tabIdx",void 0),T([(0,i.state)()],O.prototype,"connectors",void 0),T([(0,i.state)()],O.prototype,"recommended",void 0),T([(0,i.state)()],O.prototype,"featured",void 0),T([(0,i.state)()],O.prototype,"explorerWallets",void 0),T([(0,i.state)()],O.prototype,"connections",void 0),T([(0,i.state)()],O.prototype,"connectorImages",void 0),T([(0,i.state)()],O.prototype,"loadingTelegram",void 0),O=T([(0,c.customElement)("w3m-connector-list")],O);var P=r,A=e.i(683075),S=e.i(592279),N=e.i(960398),I=e.i(803468),U=e.i(811424);let L={ether:-9,wei:9};function j(e,t="wei"){return function(e,t){let r=e.toString(),o=r.startsWith("-");o&&(r=r.slice(1));let[i,n]=[(r=r.padStart(t,"0")).slice(0,r.length-t),r.slice(r.length-t)];return n=n.replace(/(0+)$/,""),`${o?"-":""}${i||"0"}${n?`.${n}`:""}`}(e,L[t])}let M="2.47.6",D={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${M}`};class B extends Error{constructor(e,t={}){const r=t.cause instanceof B?t.cause.details:t.cause?.message?t.cause.message:t.details,o=t.cause instanceof B&&t.cause.docsPath||t.docsPath,i=D.getDocsUrl?.({...t,docsPath:o});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...D.version?[`Version: ${D.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=M}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}class z extends B{constructor({cause:e,message:t}={}){const r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(z,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}
61),Object.defineProperty(z,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/}),Object.defineProperty(class extends B{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${j(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}},"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/}),Object.defineProperty(class extends B{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${j(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}},"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/}),Object.defineProperty(class extends B{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}},"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/}),Object.defineProperty(class extends B{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account. 62Try increasing the nonce or find the latest nonce with \`getTransactionCount\`.`,{cause:e,name:"NonceTooLowError"})}},"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/}),Object.defineProperty(class extends B{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}},"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/}),Object.defineProperty(class extends B{constructor({cause:e}={}){super("The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.",{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}},"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/}),Object.defineProperty(class extends B{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}},"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/}),Object.defineProperty(class extends B{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}},"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/}),Object.defineProperty(class extends B{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}},"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/}),Object.defineProperty(class extends B{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${j(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${j(r)} gwei`:""}).`,{cause:e,name:"TipAboveFeeCapError"})}},"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});let _=(e,t,r)=>JSON.stringify(e,(e,r)=>{let o="bigint"==typeof r?r.toString():r;return"function"==typeof t?t(e,o):o},r);class W extends B{constructor({body:e,cause:t,details:r,headers:o,status:i,url:n}){super("HTTP request failed.",{cause:t,details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${(e=>e)(n)}`,e&&`Request body: ${_(e)}
62`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=o,this.status=i,this.url=n}}class H extends B{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${(e=>e)(r)}`,`Request body: ${_(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.data=t.data,this.url=r}}class q extends B{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(e=>e)(t)}`,`Request body: ${_(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=t}}class F extends B{constructor(e,{code:t,docsPath:r,metaMessages:o,name:i,shortMessage:n}){super(n,{cause:e,docsPath:r,metaMessages:o||e?.metaMessages,name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i||e.name,this.code=e instanceof H?e.code:t??-1}}class K extends F{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class V extends F{constructor(e){super(e,{code:V.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(V,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class J extends F{constructor(e){super(e,{code:J.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(J,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Y extends F{constructor(e,{method:t}={}){super(e,{code:Y.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(Y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class G extends F{constructor(e){super(e,{code:G.code,name:"InvalidParamsRpcError",shortMessage:"Invalid parameters were provided to the RPC method.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(G,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Q extends F{constructor(e){super(e,{code:Q.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Q,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class X extends F{constructor(e){super(e,{code:X.code,name:"InvalidInputRpcError",shortMessage:"Missing or invalid parameters.\nDouble check you have provided the correct parameters."})}}Object.defineProperty(X,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Z extends F{constructor(e){super(e,{code:Z.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Z,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ee extends F{constructor(e){super(e,{code:ee.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ee,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class et extends F{constructor(e){super(e,{code:et.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(et,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class er extends F{constructor(e,{method:t}={}){super(e,{code:er.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(er,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class eo extends F{constructor(e){super(e,{code:eo.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class ei extends F{constructor(e){super(e,{code:ei.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(ei,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class en extends K{constructor(e){super(e,{code:en.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(en,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class ea extends K{constructor(e){super(e,{code:ea.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(ea,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class es extends K{constructor(e,{method:t}={}){super(e,{code:es.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(es,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class el extends K{constructor(e){super(e,{code:el.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(el,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});
62class ec extends K{constructor(e){super(e,{code:ec.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(ec,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class ed extends K{constructor(e){super(e,{code:ed.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(ed,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class eu extends K{constructor(e){super(e,{code:eu.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(eu,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class eh extends K{constructor(e){super(e,{code:eh.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(eh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class ep extends K{constructor(e){super(e,{code:ep.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(ep,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class ef extends K{constructor(e){super(e,{code:ef.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(ef,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class eg extends K{constructor(e){super(e,{code:eg.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(eg,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class em extends K{constructor(e){super(e,{code:em.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(em,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class ew extends K{constructor(e){super(e,{code:ew.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(ew,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class eb extends K{constructor(e){super(e,{code:eb.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(eb,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class ey extends F{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}async function ev(e){return new Promise(t=>setTimeout(t,e))}class eC extends B{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}class ex extends B{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function e$(e){return!function(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}(e,{strict:!1})?e.length:Math.ceil((e.length-2)/2)}let eE=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),eR=new TextEncoder;class ek extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,t)),t}set(e,t){if(super.has(e)&&super.delete(e),super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=super.keys().next().value;void 0!==e&&super.delete(e)}return this}}let eT=new ek(8192),eO=256;function eP({key:e,methods:r,name:o,request:i,retryCount:n=3,retryDelay:a=150,timeout:s,type:l},c){return{config:{key:e,methods:r,name:o,request:i,retryCount:n,retryDelay:a,timeout:s,type:l},request:function(e,t={}){return async(r,o={})=>{let{dedupe:i=!1,methods:n,retryDelay:a=150,retryCount:s=3,uid:l}={...t,...o},{method:c}=r;if(n?.exclude?.includes(c)||n?.include&&!n.include.includes(c))throw new er(Error("method not supported"),{method:c});let d=i?function(e,t={}){return function(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=eE[e[t]];let o=`0x${r}`;return"number"==typeof t.size?(!function(e,{size:t}){if(e$(e)>t)throw new ex({givenSize:e$(e),maxSize:t})}(o,{size:t.size}),function(e,{dir:t,size:r=32}={}){return"string"==typeof e?function(e,{dir:t,size:r=32}={}){if(null===r)return e;let o=e.replace("0x","");if(o.length>2*r)throw new eC({size:Math.ceil(o.length/2),targetSize:r,type:"hex"});return`0x${o["right"===t?"padEnd":"padStart"](2*r,"0")}`}(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new eC({size:e.length,targetSize:r,type:"bytes"});let o=new Uint8Array(r);for(let i=0;i<r;i++){let n="right"===t;o[n?i:r-i-1]=e[n?i:e.length-i-1]}return o}(e,{dir:t,size:r})}(o,{dir:"right",size:t.size})):o}(eR.encode(e),t)}(`${l}.${_(r)}`):void 0;return function(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(eT.get(r))return eT.get(r);let o=e().finally(()=>eT.delete(r));return eT.set(r,o),o}(()=>(function(e,{delay:t=100,retryCount:r=2,shouldRetry:o=()=>!0}={}){return new Promise((i,n)=>{let a=async({count:s=0}={})=>{let l=async({error:e})=>{let r="function"==typeof t?t({count:s,error:e}):t;r&&await ev(r),a({count:s+1})};try{let t=await e();i(t)}catch(e){if(s<r&&await o({count:s,error:e}))return l({error:e});n(e)}};a()})})(async()=>{try{return await e(r)}catch(e){switch(e.code){case V.code:throw new V(e);case J.code:throw new J(e);case Y.code:throw new Y(e,{method:r.method});case G.code:throw new G(e);case Q.code:throw new Q(e);case X.code:throw new X(e);case Z.code:throw new Z(e);case ee.code:throw new ee(e);case et.code:throw new et(e);case er.code:throw new er(e,{method:r.method});case eo.code:throw new eo(e);case ei.code:throw new ei(e);case en.code:throw new en(e);case ea.code:throw new ea(e);case es.code:throw new es(e);case el.code:throw new el(e);
62case ec.code:throw new ec(e);case ed.code:throw new ed(e);case eu.code:throw new eu(e);case eh.code:throw new eh(e);case ep.code:throw new ep(e);case ef.code:throw new ef(e);case eg.code:throw new eg(e);case em.code:throw new em(e);case ew.code:throw new ew(e);case 5e3:throw new en(e);case eb.code:throw new eb(e);default:if(e instanceof B)throw e;throw new ey(e)}}},{delay:({count:e,error:t})=>{if(t&&t instanceof W){let e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e,10)}return~~(1<<e)*a},retryCount:s,shouldRetry:({error:e})=>{var t;return"code"in(t=e)&&"number"==typeof t.code?-1===t.code||t.code===eo.code||t.code===Q.code:!(t instanceof W)||!t.status||403===t.status||408===t.status||413===t.status||429===t.status||500===t.status||502===t.status||503===t.status||504===t.status||!1}}),{enabled:i,id:d})}}(i,{methods:r,retryCount:n,retryDelay:a,uid:function(e=11){if(!t||eO+e>512){t="",eO=0;for(let e=0;e<256;e++)t+=(256+256*Math.random()|0).toString(16).substring(1)}return t.substring(eO,eO+++e)}()}),value:c}}function eA(e,t={}){let{key:r="fallback",name:o="Fallback",rank:i=!1,shouldThrow:n=eS,retryCount:a,retryDelay:s}=t;return({chain:t,pollingInterval:l=4e3,timeout:c,...d})=>{let u=e,h=()=>{},p=eP({key:r,name:o,async request({method:e,params:r}){let o,i=async(a=0)=>{let s=u[a]({...d,chain:t,retryCount:0,timeout:c});try{let t=await s.request({method:e,params:r});return h({method:e,params:r,response:t,transport:s,status:"success"}),t}catch(l){if(h({error:l,method:e,params:r,transport:s,status:"error"}),n(l)||a===u.length-1||!(o??=u.slice(a+1).some(r=>{let{include:o,exclude:i}=r({chain:t}).config.methods||{};return o?o.includes(e):!i||!i.includes(e)})))throw l;return i(a+1)}};return i()},retryCount:a,retryDelay:s,type:"fallback"},{onResponse:e=>h=e,transports:u.map(e=>e({chain:t,retryCount:0}))});if(i){let e="object"==typeof i?i:{};!function({chain:e,interval:t=4e3,onTransports:r,ping:o,sampleCount:i=10,timeout:n=1e3,transports:a,weights:s={}}){let{stability:l=.7,latency:c=.3}=s,d=[],u=async()=>{let s=await Promise.all(a.map(async t=>{let r,i,a=t({chain:e,retryCount:0,timeout:n}),s=Date.now();try{await (o?o({transport:a}):a.request({method:"net_listening"})),i=1}catch{i=0}finally{r=Date.now()}return{latency:r-s,success:i}}));d.push(s),d.length>i&&d.shift();let h=Math.max(...d.map(e=>Math.max(...e.map(({latency:e})=>e))));r(a.map((e,t)=>{let r=d.map(e=>e[t].latency),o=r.reduce((e,t)=>e+t,0)/r.length,i=d.map(e=>e[t].success),n=i.reduce((e,t)=>e+t,0)/i.length;return 0===n?[0,t]:[c*(1-o/h)+l*n,t]}).sort((e,t)=>t[0]-e[0]).map(([,e])=>a[e])),await ev(t),u()};u()}({chain:t,interval:e.interval??l,onTransports:e=>u=e,ping:e.ping,sampleCount:e.sampleCount,timeout:e.timeout,transports:u,weights:e.weights})}return p}}function eS(e){return!!("code"in e&&"number"==typeof e.code&&(e.code===et.code||e.code===en.code||e.code===eb.code||z.nodeMessage.test(e.message)||5e3===e.code))}class eN extends B{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}let eI=new Map,eU={current:0,take(){return this.current++},reset(){this.current=0}};function eL(e,t={}){let{batch:r,fetchFn:o,fetchOptions:i,key:n="http",methods:a,name:s="HTTP JSON-RPC",onFetchRequest:l,onFetchResponse:c,retryDelay:d,raw:u}=t;return({chain:h,retryCount:p,timeout:f})=>{let{batchSize:g=1e3,wait:m=0}="object"==typeof r?r:{},w=t.retryCount??p,b=f??t.timeout??1e4,y=e||h?.rpcUrls.default.http[0];if(!y)throw new eN;let v=function(e,t={}){let{url:r,headers:o}=function(e){try{let t=new URL(e),r=(()=>{if(t.username){let e=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(e)}`}}}})();return{url:t.toString(),...r}}catch{return{url:e}}}(e);return{async request(e){let{body:i,fetchFn:n=t.fetchFn??fetch,onRequest:a=t.onRequest,onResponse:s=t.onResponse,timeout:l=t.timeout??1e4}=e,c={...t.fetchOptions??{},...e.fetchOptions??{}},{headers:d,method:u,signal:h}=c;try{let e,t=await function(e,{errorInstance:t=Error("timed out"),timeout:r,signal:o}){return new Promise((i,n)=>{(async()=>{let a;try{let s=new AbortController;r>0&&(a=setTimeout(()=>{o?s.abort():n(t)},r)),i(await e({signal:s?.signal||null}))}catch(e){e?.name==="AbortError"&&n(t),n(e)}finally{clearTimeout(a)}})()})}(async({signal:e})=>{let t={...c,body:Array.isArray(i)?_(i.map(e=>({jsonrpc:"2.0",id:e.id??eU.take(),...e}))):_({jsonrpc:"2.0",id:i.id??eU.take(),...i}),headers:{...o,"Content-Type":"application/json",...d},method:u||"POST",signal:h||(l>0?e:null)}
62,s=new Request(r,t),p=await a?.(s,t)??{...t,url:r};return await n(p.url??r,p)},{errorInstance:new q({body:i,url:r}),timeout:l,signal:!0});if(s&&await s(t),t.headers.get("Content-Type")?.startsWith("application/json"))e=await t.json();else{e=await t.text();try{e=JSON.parse(e||"{}")}catch(r){if(t.ok)throw r;e={error:e}}}if(!t.ok){if("number"==typeof e.error?.code&&"string"==typeof e.error?.message)return e;throw new W({body:i,details:_(e.error)||t.statusText,headers:t.headers,status:t.status,url:r})}return e}catch(e){if(e instanceof W||e instanceof q)throw e;throw new W({body:i,cause:e,url:r})}}}}(y,{fetchFn:o,fetchOptions:i,onRequest:l,onResponse:c,timeout:b});return eP({key:n,methods:a,name:s,async request({method:e,params:t}){let o={method:e,params:t},{schedule:i}=function({fn:e,id:t,shouldSplitBatch:r,wait:o=0,sort:i}){let n=async()=>{let t=s();a();let r=t.map(({args:e})=>e);0!==r.length&&e(r).then(e=>{i&&Array.isArray(e)&&e.sort(i);for(let r=0;r<t.length;r++){let{resolve:o}=t[r];o?.([e[r],e])}}).catch(e=>{for(let r=0;r<t.length;r++){let{reject:o}=t[r];o?.(e)}})},a=()=>eI.delete(t),s=()=>eI.get(t)||[],l=e=>eI.set(t,[...s(),e]);return{flush:a,async schedule(e){let t,i,{promise:a,resolve:c,reject:d}=(t=()=>void 0,i=()=>void 0,{promise:new Promise((e,r)=>{t=e,i=r}),resolve:t,reject:i});return(r?.([...s().map(({args:e})=>e),e])&&n(),s().length>0)?l({args:e,resolve:c,reject:d}):(l({args:e,resolve:c,reject:d}),setTimeout(n,o)),a}}}({id:y,wait:m,shouldSplitBatch:e=>e.length>g,fn:e=>v.request({body:e}),sort:(e,t)=>e.id-t.id}),n=async e=>r?i(e):[await v.request({body:e})],[{error:a,result:s}]=await n(o);if(u)return{error:a,result:s};if(a)throw new H({body:o,error:a,url:y});return s},retryCount:w,retryDelay:d,timeout:b,type:"http"},{fetchOptions:i,url:y})}}var ej=e.i(16555);p.ConstantsUtil.CONNECTOR_ID.COINBASE,p.ConstantsUtil.CONNECTOR_ID.COINBASE_SDK,p.ConstantsUtil.CONNECTOR_ID.SAFE,p.ConstantsUtil.CONNECTOR_ID.LEDGER,p.ConstantsUtil.CONNECTOR_ID.OKX,ej.ConstantsUtil.METMASK_CONNECTOR_NAME,ej.ConstantsUtil.TRUST_CONNECTOR_NAME,ej.ConstantsUtil.SOLFLARE_CONNECTOR_NAME,ej.ConstantsUtil.PHANTOM_CONNECTOR_NAME,ej.ConstantsUtil.COIN98_CONNECTOR_NAME,ej.ConstantsUtil.MAGIC_EDEN_CONNECTOR_NAME,ej.ConstantsUtil.BACKPACK_CONNECTOR_NAME,ej.ConstantsUtil.BITGET_CONNECTOR_NAME,ej.ConstantsUtil.FRONTIER_CONNECTOR_NAME,ej.ConstantsUtil.XVERSE_CONNECTOR_NAME,ej.ConstantsUtil.LEATHER_CONNECTOR_NAME,ej.ConstantsUtil.OKX_CONNECTOR_NAME;let eM={1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",5e3:"e86fae9b-b770-4eea-e520-150e12c81100",295:"6a97d510-cac8-4e58-c7ce-e8681b044c00",0xaa36a7:"e909ea0a-f92a-4512-c8fc-748044ea6800",84532:"a18a7ecd-e307-4360-4746-283182228e00",1301:"4eeea7ef-0014-4649-5d1d-07271a80f600",130:"2257980a-3463-48c6-cbac-a42d2a956e00",10143:"0a728e83-bacb-46db-7844-948f05434900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",0x4e454152:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",80094:"e329c2c9-59b0-4a02-83e4-212ff3779900",2741:"fc2427d1-5af9-4a9c-8da5-6f94627cd900","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700","000000000019d6689c085ae165831e93":"0b4838db-0161-4ffe-022d-532bf03dba00","000000000933ea01ad0ee984209779ba":"39354064-d79b-420b-065d-f980c4b78200","00000008819873e925422c1ff0f99f7c":"b3406e4a-bbfc-44fb-e3a6-89673c78b700"};function eD(e,t){let r=new URL("https://rpc.walletconnect.org/v1/");return r.searchParams.set("chainId",e),r.searchParams.set("projectId",t),r.toString()}p.ConstantsUtil.CONNECTOR_ID.COINBASE,p.ConstantsUtil.CONNECTOR_ID.COINBASE_SDK,p.ConstantsUtil.CONNECTOR_ID.SAFE,p.ConstantsUtil.CONNECTOR_ID.LEDGER,p.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT,p.ConstantsUtil.CONNECTOR_ID.INJECTED,p.ConstantsUtil.CONNECTOR_ID.INJECTED,p.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT,p.ConstantsUtil.CONNECTOR_ID.COINBASE,p.ConstantsUtil.CONNECTOR_ID.COINBASE_SDK,p.ConstantsUtil.CONNECTOR_ID.LEDGER,p.ConstantsUtil.CONNECTOR_ID.SAFE,p.ConstantsUtil.CONNECTOR_ID.INJECTED,p.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT,p.ConstantsUtil.CONNECTOR_ID.EIP6963,p.ConstantsUtil.CONNECTOR_ID.AUTH,ej.ConstantsUtil.CONNECTOR_TYPE_AUTH;let eB=["near:mainnet","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","eip155:1101","eip155:
6256","eip155:42161","eip155:7777777","eip155:59144","eip155:324","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","eip155:5000","solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz","eip155:80084","eip155:5003","eip155:100","eip155:8453","eip155:42220","eip155:1313161555","eip155:17000","eip155:1","eip155:300","eip155:1313161554","eip155:1329","eip155:84532","eip155:421614","eip155:11155111","eip155:8217","eip155:43114","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","eip155:999999999","eip155:11155420","eip155:80002","eip155:97","eip155:43113","eip155:137","eip155:10","eip155:1301","eip155:80094","eip155:80069","eip155:560048","eip155:31","eip155:2818","eip155:57054","eip155:911867","eip155:534351","eip155:1112","eip155:534352","eip155:1111","eip155:146","eip155:130","eip155:1284","eip155:30","eip155:2810","bip122:000000000019d6689c085ae165831e93","bip122:000000000933ea01ad0ee984209779ba"],ez={extendRpcUrlWithProjectId(e,t){let r=!1;try{r="rpc.walletconnect.org"===new URL(e).host}catch(e){r=!1}if(r){let r=new URL(e);return r.searchParams.has("projectId")||r.searchParams.set("projectId",t),r.toString()}return e},isCaipNetwork:e=>"chainNamespace"in e&&"caipNetworkId"in e,getChainNamespace(e){return this.isCaipNetwork(e)?e.chainNamespace:p.ConstantsUtil.CHAIN.EVM},getCaipNetworkId(e){return this.isCaipNetwork(e)?e.caipNetworkId:`${p.ConstantsUtil.CHAIN.EVM}:${e.id}`},getDefaultRpcUrl(e,t,r){let o=e.rpcUrls?.default?.http?.[0];return eB.includes(t)?eD(t,r):o||""},extendCaipNetwork(e,{customNetworkImageUrls:t,projectId:r,customRpcUrls:o}){let i=this.getChainNamespace(e),n=this.getCaipNetworkId(e),a=e.rpcUrls?.default?.http?.[0],s=this.getDefaultRpcUrl(e,n,r),l=e?.rpcUrls?.chainDefault?.http?.[0]||a,c=o?.[n]?.map(e=>e.url)||[],d=[...c,...s?[s]:[]],u=[...c];return l&&!u.includes(l)&&u.push(l),{...e,chainNamespace:i,caipNetworkId:n,assets:{imageId:eM[e.id],imageUrl:t?.[e.id]},rpcUrls:{...e.rpcUrls,default:{http:d},chainDefault:{http:u}}}},extendCaipNetworks:(e,{customNetworkImageUrls:t,projectId:r,customRpcUrls:o})=>e.map(e=>ez.extendCaipNetwork(e,{customNetworkImageUrls:t,customRpcUrls:o,projectId:r})),getViemTransport(e,t,r){let o=[];return r?.forEach(e=>{o.push(eL(e.url,e.config))}),eB.includes(e.caipNetworkId)&&o.push(eL(eD(e.caipNetworkId,t),{fetchOptions:{headers:{"Content-Type":"text/plain"}}})),e?.rpcUrls?.default?.http?.forEach(e=>{o.push(eL(e))}),eA(o)},extendWagmiTransports(e,t,r){return eB.includes(e.caipNetworkId)?eA([r,eL(this.getDefaultRpcUrl(e,e.caipNetworkId,t))]):r},getUnsupportedNetwork:e=>({id:e.split(":")[1],caipNetworkId:e,name:p.ConstantsUtil.UNSUPPORTED_NETWORK_NAME,chainNamespace:e.split(":")[0],nativeCurrency:{name:"",decimals:0,symbol:""},rpcUrls:{default:{http:[]}}}),getCaipNetworkFromStorage(e){let t=l.StorageUtil.getActiveCaipNetworkId(),r=N.ChainController.getAllRequestedCaipNetworks(),o=Array.from(N.ChainController.state.chains?.keys()||[]),i=t?.split(":")[0],n=!!i&&o.includes(i),a=r?.find(e=>e.caipNetworkId===t);return n&&!a&&t?this.getUnsupportedNetwork(t):a||e||r?.[0]}};var e_=r,eW=r,eH=e.i(459088),eq=r;e.i(199618),e.i(839009);let eF=R.css` 63 :host { 64 flex: 1; 65 height: 100%; 66 } 67 68 button { 69 width: 100%; 70 height: 100%; 71 display: inline-flex; 72 align-items: center; 73 padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]}; 74 column-gap: ${({spacing:e})=>e[1]}; 75 color: ${({tokens:e})=>e.theme.textSecondary}; 76 border-radius: ${({borderRadius:e})=>e[20]}; 77 background-color: transparent; 78 transition: background-color ${({durations:e})=>e.lg} 79 ${({easings:e})=>e["ease-out-power-2"]}; 80 will-change: background-color; 81 } 82 83 /* -- Hover & Active states ----------------------------------------------------------- */ 84 button[data-active='true'] { 85 color: ${({tokens:e})=>e.theme.textPrimary}; 86 background-color: ${({tokens:e})=>e.theme.foregroundTertiary}; 87 } 88 89 button:hover:enabled:not([data-active='true']), 90 button:active:enabled:not([data-active='true']) { 91 wui-text, 92 wui-icon { 93 color: ${({tokens:e})=>e.theme.textPrimary}; 94 } 95 } 96`;var eK=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let eV={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},eJ={lg:"md",md:"sm",sm:"sm"},eY=class extends eq.LitElement{constructor(){super(...arguments),this.icon="mobile",this.size="md",this.label="",this.active=!1}render(){return o.html` 97 <button data-active=${this.active}> 98 ${this.icon?o.html`<wui-icon size=${eJ[this.size]} name=${this.icon}></wui-icon>`:""} 99 <wui-text variant=${eV[this.size]}> ${this.label} </wui-text> 100 </button> 101 `}};eY.styles=[eH.resetStyles,eH.elementStyles,eF],eK([(0,u.property)()],eY.prototype,"icon",void 0),eK([(0,u.property)()],eY.prototype,"size",void 0),eK([(0,u.property)()],eY.prototype,"label",void 0),eK([(0,u.property)({type:Boolean})],eY.prototype,"active",void 0),eY=eK([(0,c.customElement)("wui-tab-item")],eY);let eG=R.css` 102 :host { 103 display: inline-flex; 104 align-items: center; 105 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 106 border-radius: ${({borderRadius:e})=>e[32]}; 107 padding: ${({spacing:e})=>e["01"]}; 108 box-sizing: border-box; 109 } 110 111 :host([data-size='sm']) {
112 height: 26px; 113 } 114 115 :host([data-size='md']) { 116 height: 36px; 117 } 118`;var eQ=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let eX=class extends eW.LitElement{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.size="md",this.activeTab=0}render(){return this.dataset.size=this.size,this.tabs.map((e,t)=>{let r=t===this.activeTab;return o.html` 119 <wui-tab-item 120 @click=${()=>this.onTabClick(t)} 121 icon=${e.icon} 122 size=${this.size} 123 label=${e.label} 124 ?active=${r} 125 data-active=${r} 126 data-testid="tab-${e.label?.toLowerCase()}" 127 ></wui-tab-item> 128 `})}onTabClick(e){this.activeTab=e,this.onTabChange(e)}};eX.styles=[eH.resetStyles,eH.elementStyles,eG],eQ([(0,u.property)({type:Array})],eX.prototype,"tabs",void 0),eQ([(0,u.property)()],eX.prototype,"onTabChange",void 0),eQ([(0,u.property)()],eX.prototype,"size",void 0),eQ([(0,i.state)()],eX.prototype,"activeTab",void 0),eX=eQ([(0,c.customElement)("wui-tabs")],eX);var eZ=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let e0=class extends e_.LitElement{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=this.generateTabs();return o.html` 129 <wui-flex justifyContent="center" .padding=${["0","0","4","0"]}> 130 <wui-tabs .tabs=${e} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs> 131 </wui-flex> 132 `}generateTabs(){let e=this.platforms.map(e=>{if("browser"===e)return{label:"Browser",icon:"extension",platform:"browser"};if("mobile"===e)return{label:"Mobile",icon:"mobile",platform:"mobile"};if("qrcode"===e)return{label:"Mobile",icon:"mobile",platform:"qrcode"};if("web"===e)return{label:"Webapp",icon:"browser",platform:"web"};if("desktop"===e)return{label:"Desktop",icon:"desktop",platform:"desktop"};return{label:"Browser",icon:"extension",platform:"unsupported"}});return this.platformTabs=e.map(({platform:e})=>e),e}onTabChange(e){let t=this.platformTabs[e];t&&this.onSelectPlatfrom?.(t)}};eZ([(0,u.property)({type:Array})],e0.prototype,"platforms",void 0),eZ([(0,u.property)()],e0.prototype,"onSelectPlatfrom",void 0),e0=eZ([(0,c.customElement)("w3m-connecting-header")],e0);var e1=r,e3=e.i(639403),e2=r;e.i(383227);let e5=R.css` 133 :host { 134 width: var(--local-width); 135 } 136 137 button { 138 width: var(--local-width); 139 white-space: nowrap; 140 column-gap: ${({spacing:e})=>e[2]}; 141 transition: 142 scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]}, 143 background-color ${({durations:e})=>e.lg} 144 ${({easings:e})=>e["ease-out-power-2"]}, 145 border-radius ${({durations:e})=>e.lg} 146 ${({easings:e})=>e["ease-out-power-1"]}; 147 will-change: scale, background-color, border-radius; 148 cursor: pointer; 149 } 150 151 /* -- Sizes --------------------------------------------------- */ 152 button[data-size='sm'] { 153 border-radius: ${({borderRadius:e})=>e[2]}; 154 padding: 0 ${({spacing:e})=>e[2]}; 155 height: 28px; 156 } 157 158 button[data-size='md'] { 159 border-radius: ${({borderRadius:e})=>e[3]}; 160 padding: 0 ${({spacing:e})=>e[4]}; 161 height: 38px; 162 } 163 164 button[data-size='lg'] { 165 border-radius: ${({borderRadius:e})=>e[4]}; 166 padding: 0 ${({spacing:e})=>e[5]}; 167 height: 48px; 168 } 169 170 /* -- Variants --------------------------------------------------------- */ 171 button[data-variant='accent-primary'] { 172 background-color: ${({tokens:e})=>e.core.backgroundAccentPrimary}; 173 color: ${({tokens:e})=>e.theme.textInvert}; 174 } 175 176 button[data-variant='accent-secondary'] { 177 background-color: ${({tokens:e})=>e.core.foregroundAccent010}; 178 color: ${({tokens:e})=>e.core.textAccentPrimary}; 179 } 180 181 button[data-variant='neutral-primary'] { 182 background-color: ${({tokens:e})=>e.theme.backgroundInvert}; 183 color: ${({tokens:e})=>e.theme.textInvert}; 184 } 185 186 button[data-variant='neutral-secondary'] { 187 background-color: transparent; 188 border: 1px solid ${({tokens:e})=>e.theme.borderSecondary}; 189 color: ${({tokens:e})=>e.theme.textPrimary}; 190 } 191 192 button[data-variant='neutral-tertiary'] { 193 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 194 color: ${({tokens:e})=>e.theme.textPrimary}; 195 } 196 197 button[data-variant='error-primary'] { 198 background-color: ${({tokens:e})=>e.core.textError}; 199 color: ${({tokens:e})=>e.theme.textInvert}; 200 } 201 202 button[data-variant='error-secondary'] { 203 background-color: ${({tokens:e})=>e.core.backgroundError}; 204 color: ${({tokens:e})=>e.core.textError}; 205 } 206 207 button[data-variant='shade'] { 208 background: var(--wui-color-gray-glass-002); 209 color: var(--wui-color-fg-200); 210 border: none; 211 box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005); 212 } 213 214 /* -- Focus states --------------------------------------------------- */ 215 button[data-size='sm']:focus-visible:enabled { 216 border-radius: 28px; 217 } 218 219 button[data-size='md']:focus-visible:enabled { 220 border-radius: 38px; 221 } 222 223 button[data-size='lg']:focus-visible:enabled { 224 border-radius: 48px; 225 } 226 button[data-variant='shade']:focus-visible:enabled { 227 background: var(--wui-color-gray-glass-005); 228 box-shadow: 229 inset 0 0 0 1px var(--wui-color-gray-glass-010), 230 0 0 0 4px var(--wui-color-gray-glass-002); 231 } 232 233 /* -- Hover & Active states ----------------------------------------------------------- */ 234 @media (hover: hover) { 235 button[data-size='sm']:hover:enabled { 236 border-radius: 28px; 237 } 238 239 button[data-size='md']:hover:enabled { 240 border-radius: 38px; 241 } 242 243 button[data-size='lg']:hover:enabled { 244 border-radius: 48px; 245 } 246 247 button[data-variant='shade']:hover:enabled { 248 background: var(--wui-color-gray-glass-002); 249 } 250 251 button[data-variant='shade']:active:enabled { 252 background: var(--wui-color-gray-glass-005); 253 } 254 } 255 256 button[data-size='sm']:active:enabled { 257 border-radius: 28px; 258 } 259 260 button[data-size='md']:active:enabled { 261 border-radius: 38px; 262 } 263 264 button[data-size='lg']:active:enabled { 265 border-radius: 48px; 266 } 267 268 /* -- Disabled states --------------------------------------------------- */ 269 button:disabled { 270 opacity: 0.3; 271 } 272`;var e4=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let e8={lg:"lg-regular-mono",md:"md-regular-mono",sm:"sm-regular-mono"},e6={lg:"md",md:"md",sm:"sm"},e9=class extends e2.LitElement{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="accent-primary"}render(){this.style.cssText=` 273 --local-width: ${this.fullWidth?"100%":"auto"}; 274 `;let e=this.textVariant??e8[this.size];return o.html` 275 <button data-variant=${this.variant} data-size=${this.size} ?disabled=${this.disabled}> 276 ${this.loadingTemplate()} 277 <slot name="iconLeft"></slot> 278 <wui-text variant=${e} color="inherit"> 279 <slot></slot> 280 </wui-text> 281 <slot name="iconRight"></slot> 282 </button> 283 `}loadingTemplate(){if(this.loading){let e=e6[this.size],t="neutral-primary"===this.variant||"accent-primary"===this.variant?"invert":"primary";return o.html`<wui-loading-spinner color=${t} size=${e}></wui-loading-spinner>`}return null}};e9.styles=[eH.resetStyles,eH.elementStyles,e5],e4([(0,u.property)()],e9.prototype,"size",void 0),e4([(0,u.property)({type:Boolean})],e9.prototype,"disabled",void 0),e4([(0,u.property)({type:Boolean})],e9.prototype,"fullWidth",void 0),e4([(0,u.property)({type:Boolean})],e9.prototype,"loading",void 0),e4([(0,u.property)()],e9.prototype,"variant",void 0),e4([(0,u.property)()],e9.prototype,"textVariant",void 0),e9=e4([(0,c.customElement)("wui-button")],e9),e.i(443452),e.i(912190),e.
283i(210380);var e7=r;let te=R.css` 284 :host { 285 display: block; 286 width: 100px; 287 height: 100px; 288 } 289 290 svg { 291 width: 100px; 292 height: 100px; 293 } 294 295 rect { 296 fill: none; 297 stroke: ${e=>e.colors.accent100}; 298 stroke-width: 3px; 299 stroke-linecap: round; 300 animation: dash 1s linear infinite; 301 } 302 303 @keyframes dash { 304 to { 305 stroke-dashoffset: 0px; 306 } 307 } 308`;var tt=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let tr=class extends e7.LitElement{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){let e=this.radius>50?50:this.radius,t=36-e;return o.html` 309 <svg viewBox="0 0 110 110" width="110" height="110"> 310 <rect 311 x="2" 312 y="2" 313 width="106" 314 height="106" 315 rx=${e} 316 stroke-dasharray="${116+t} ${245+t}" 317 stroke-dashoffset=${360+1.75*t} 318 /> 319 </svg> 320 `}};tr.styles=[eH.resetStyles,te],tt([(0,u.property)({type:Number})],tr.prototype,"radius",void 0),tr=tt([(0,c.customElement)("wui-loading-thumbnail")],tr),e.i(249536),e.
320i(720226);var to=r,ti=e.i(112699),tn=r;e.i(73944);let ta=R.css` 321 wui-flex { 322 width: 100%; 323 height: 52px; 324 box-sizing: border-box; 325 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 326 border-radius: ${({borderRadius:e})=>e[5]}; 327 padding-left: ${({spacing:e})=>e[3]}; 328 padding-right: ${({spacing:e})=>e[3]}; 329 display: flex; 330 align-items: center; 331 justify-content: space-between; 332 gap: ${({spacing:e})=>e[6]}; 333 } 334 335 wui-text { 336 color: ${({tokens:e})=>e.theme.textSecondary}; 337 } 338 339 wui-icon { 340 width: 12px; 341 height: 12px; 342 } 343`;var ts=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let tl=class extends tn.LitElement{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return o.html` 344 <wui-flex justifyContent="space-between" alignItems="center"> 345 <wui-text variant="lg-regular" color="inherit">${this.label}</wui-text> 346 <wui-button variant="accent-secondary" size="sm"> 347 ${this.buttonLabel} 348 <wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon> 349 </wui-button> 350 </wui-flex> 351 `}};tl.styles=[eH.resetStyles,eH.elementStyles,ta],ts([(0,u.property)({type:Boolean})],tl.prototype,"disabled",void 0),ts([(0,u.property)()],tl.prototype,"label",void 0),ts([(0,u.property)()],tl.prototype,"buttonLabel",void 0),tl=ts([(0,c.customElement)("wui-cta-button")],tl);let tc=R.css` 352 :host { 353 display: block; 354 padding: 0 ${({spacing:e})=>e["5"]} ${({spacing:e})=>e["5"]}; 355 } 356`;var td=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let tu=class extends to.LitElement{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;let{name:e,app_store:t,play_store:r,chrome_store:i,homepage:n}=this.wallet,s=a.CoreHelperUtil.isMobile(),l=a.CoreHelperUtil.isIos(),c=a.CoreHelperUtil.isAndroid(),d=[t,r,n,i].filter(Boolean).length>1,u=ti.UiHelperUtil.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return d&&!s?o.html` 357 <wui-cta-button 358 label=${`Don't have ${u}?`} 359 buttonLabel="Get" 360 @click=${()=>w.RouterController.push("Downloads",{wallet:this.wallet})} 361 ></wui-cta-button> 362 `:!d&&n?o.html` 363 <wui-cta-button 364 label=${`Don't have ${u}?`} 365 buttonLabel="Get" 366 @click=${this.onHomePage.bind(this)} 367 ></wui-cta-button> 368 `:t&&l?o.html` 369 <wui-cta-button 370 label=${`Don't have ${u}?`} 371 buttonLabel="Get" 372 @click=${this.onAppStore.bind(this)} 373 ></wui-cta-button> 374 `:r&&c?o.html` 375 <wui-cta-button 376 label=${`Don't have ${u}?`} 377 buttonLabel="Get" 378 @click=${this.onPlayStore.bind(this)} 379 ></wui-cta-button> 380 `:(this.style.display="none",null)}onAppStore(){this.wallet?.app_store&&a.CoreHelperUtil.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&a.CoreHelperUtil.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&a.CoreHelperUtil.openHref(this.wallet.homepage,"_blank")}};tu.styles=[tc],td([(0,u.property)({type:Object})],tu.prototype,"wallet",void 0),tu=td([(0,c.customElement)("w3m-mobile-download-links")],tu);let th=R.css` 381 @keyframes shake { 382 0% { 383 transform: translateX(0); 384 } 385 25% { 386 transform: translateX(3px); 387 } 388 50% { 389 transform: translateX(-3px); 390 } 391 75% { 392 transform: translateX(3px); 393 } 394 100% { 395 transform: translateX(0); 396 } 397 } 398 399 wui-flex:first-child:not(:only-child) { 400 position: relative; 401 } 402 403 wui-wallet-image { 404 width: 56px; 405 height: 56px; 406 } 407 408 wui-loading-thumbnail { 409 position: absolute; 410 } 411 412 wui-icon-box { 413 position: absolute; 414 right: calc(${({spacing:e})=>e["1"]} * -1); 415 bottom: calc(${({spacing:e})=>e["1"]} * -1); 416 opacity: 0; 417 transform: scale(0.5); 418 transition-property: opacity, transform; 419 transition-duration: ${({durations:e})=>e.lg}; 420 transition-timing-function: ${({easings:e})=>e["ease-out-power-2"]}; 421 will-change: opacity, transform; 422 } 423 424 wui-text[align='center'] { 425 width: 100%; 426 padding: 0px ${({spacing:e})=>e["4"]}; 427 } 428 429 [data-error='true'] wui-icon-box { 430 opacity: 1; 431 transform: scale(1); 432 } 433 434 [data-error='true'] > wui-flex:first-child { 435 animation: shake 250ms ${({easings:e})=>e["ease-out-power-2"]} both; 436 } 437 438 [data-retry='false'] wui-link { 439 display: none; 440 } 441 442 [data-retry='true'] wui-link { 443 display: block; 444 opacity: 1; 445 } 446
447 w3m-mobile-download-links { 448 padding: 0px; 449 width: 100%; 450 } 451`;var tp=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};class tf extends e1.LitElement{constructor(){super(),this.wallet=w.RouterController.state.data?.wallet,this.connector=w.RouterController.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=x.AssetUtil.getConnectorImage(this.connector)??x.AssetUtil.getWalletImage(this.wallet),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=f.ConnectionController.state.wcUri,this.error=f.ConnectionController.state.wcError,this.ready=!1,this.showRetry=!1,this.label=void 0,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(f.ConnectionController.subscribeKey("wcUri",e=>{this.uri=e,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())}),f.ConnectionController.subscribeKey("wcError",e=>this.error=e)),(a.CoreHelperUtil.isTelegram()||a.CoreHelperUtil.isSafari())&&a.CoreHelperUtil.isIos()&&f.ConnectionController.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),f.ConnectionController.setWcError(!1),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();let e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel,t="";return this.label?t=this.label:(t=`Continue in ${this.name}`,this.error&&(t="Connection declined")),o.html` 452 <wui-flex 453 data-error=${(0,h.ifDefined)(this.error)} 454 data-retry=${this.showRetry} 455 flexDirection="column" 456 alignItems="center" 457 .padding=${["10","5","5","5"]} 458 gap="6" 459 > 460 <wui-flex gap="2" justifyContent="center" alignItems="center"> 461 <wui-wallet-image size="lg" imageSrc=${(0,h.ifDefined)(this.imageSrc)}></wui-wallet-image> 462 463 ${this.error?null:this.loaderTemplate()} 464 465 <wui-icon-box 466 color="error" 467 icon="close" 468 size="sm" 469 border 470 borderColor="wui-color-bg-125" 471 ></wui-icon-box> 472 </wui-flex> 473 474 <wui-flex flexDirection="column" alignItems="center" gap="6"> <wui-flex 475 flexDirection="column" 476 alignItems="center" 477 gap="2" 478 .padding=${["2","0","0","0"]} 479 > 480 <wui-text align="center" variant="lg-medium" color=${this.error?"error":"primary"}> 481 ${t} 482 </wui-text> 483 <wui-text align="center" variant="lg-regular" color="secondary">${e}</wui-text> 484 </wui-flex> 485 486 ${this.secondaryBtnLabel?o.html` 487 <wui-button 488 variant="neutral-secondary" 489 size="md" 490 ?disabled=${this.isRetrying||this.isLoading} 491 @click=${this.onTryAgain.bind(this)} 492 data-testid="w3m-connecting-widget-secondary-button" 493 > 494 <wui-icon 495 color="inherit" 496 slot="iconLeft" 497 name=${this.secondaryBtnIcon} 498 ></wui-icon> 499 ${this.secondaryBtnLabel} 500 </wui-button> 501 `:null} 502 </wui-flex> 503 504 ${this.isWalletConnect?o.html` 505 <wui-flex .padding=${["0","5","5","5"]} justifyContent="center"> 506 <wui-link 507 @click=${this.onCopyUri} 508 variant="secondary" 509 icon="copy" 510 data-testid="wui-link-copy" 511 > 512 Copy link 513 </wui-link> 514 </wui-flex> 515 `:null} 516
517 <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links></wui-flex> 518 </wui-flex> 519 `}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;let e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){f.ConnectionController.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.()}loaderTemplate(){let e=e3.ThemeController.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return o.html`<wui-loading-thumbnail radius=${9*t}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(a.CoreHelperUtil.copyToClopboard(this.uri),U.SnackController.showSuccess("Link copied"))}catch{U.SnackController.showError("Failed to copy")}}}tf.styles=th,tp([(0,i.state)()],tf.prototype,"isRetrying",void 0),tp([(0,i.state)()],tf.prototype,"uri",void 0),tp([(0,i.state)()],tf.prototype,"error",void 0),tp([(0,i.state)()],tf.prototype,"ready",void 0),tp([(0,i.state)()],tf.prototype,"showRetry",void 0),tp([(0,i.state)()],tf.prototype,"label",void 0),tp([(0,i.state)()],tf.prototype,"secondaryBtnLabel",void 0),tp([(0,i.state)()],tf.prototype,"secondaryLabel",void 0),tp([(0,i.state)()],tf.prototype,"isLoading",void 0),tp([(0,u.property)({type:Boolean})],tf.prototype,"isMobile",void 0),tp([(0,u.property)()],tf.prototype,"onRetry",void 0);let tg=class extends tf{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),m.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:w.RouterController.state.view}})}async onConnectProxy(){try{this.error=!1;let{connectors:e}=g.ConnectorController.state,t=e.find(e=>"ANNOUNCED"===e.type&&e.info?.rdns===this.wallet?.rdns||"INJECTED"===e.type||e.name===this.wallet?.name);if(t)await f.ConnectionController.connectExternal(t,t.chain);else throw Error("w3m-connecting-wc-browser: No connector found");I.ModalController.close(),m.EventsController.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.wallet?.name||"Unknown",view:w.RouterController.state.view,walletRank:this.wallet?.order}})}catch(e){e instanceof S.AppKitError&&e.originalName===A.ErrorUtil.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?m.EventsController.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:e.message}}):m.EventsController.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}};tg=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a}([(0,c.customElement)("w3m-connecting-wc-browser")],tg);let tm=class extends tf{constructor(){if(super(),!this.wallet)throw Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),m.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:w.RouterController.state.view}})}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:e,name:t}=this.wallet,{redirect:r,href:o}=a.CoreHelperUtil.formatNativeUrl(e,this.uri);f.ConnectionController.setWcLinking({name:t,href:o}),f.ConnectionController.setRecentWallet(this.wallet),a.CoreHelperUtil.openHref(r,"_blank")}catch{this.error=!0}}};tm=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a}([(0,c.customElement)("w3m-connecting-wc-desktop")],tm);var tw=e.i(360334),tb=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let ty=class extends tf{constructor(){if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=s.OptionsController.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{if(this.wallet?.mobile_link&&this.uri)try{this.error=!1;let{mobile_link:e,link_mode:t,name:r}=this.wallet,{redirect:o,redirectUniversalLink:i,href:n}=a.CoreHelperUtil.formatNativeUrl(e,this.uri,t);this.redirectDeeplink=o,this.redirectUniversalLink=i,this.target=a.CoreHelperUtil.isIframe()?"_top":"_self",f.ConnectionController.setWcLinking({name:r,href:n}),f.ConnectionController.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?a.CoreHelperUtil.openHref(this.redirectUniversalLink,this.target):a.CoreHelperUtil.openHref(this.redirectDeeplink,this.target)}catch(e){m.EventsController.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:e instanceof Error?e.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}},!this.wallet)throw Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=tw.ConstantsUtil.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(f.ConnectionController.subscribeKey("wcUri",()=>{this.onHandleURI()})),m.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:w.RouterController.state.view}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onTryAgain(){f.ConnectionController.setWcError(!1),this.onConnect?.()}};tb([(0,i.state)()],ty.prototype,"redirectDeeplink",void 0),tb([(0,i.state)()],ty.prototype,"redirectUniversalLink",void 0),tb([(0,i.state)()],ty.prototype,"target",void 0),tb([(0,i.state)()],ty.prototype,"preferUniversalLinks",void 0),tb([(0,i.state)()],ty.prototype,"isLoading",void 0),ty=tb([(0,c.customElement)("w3m-connecting-wc-mobile")],ty);var tv=r;e.i(864380);var tC=e.i(973134);function tx(e,t,r){return e!==t&&(e-t<0?t-e:e-t)<=r+.1}
519let t$={generate({uri:e,size:t,logoSize:r,padding:i=8,dotColor:n="var(--apkt-colors-black)"}){let a,s,l=[],c=(s=Math.sqrt((a=Array.prototype.slice.call(tC.default.create(e,{errorCorrectionLevel:"Q"}).modules.data,0)).length),a.reduce((e,t,r)=>(r%s==0?e.push([t]):e[e.length-1].push(t))&&e,[])),d=(t-2*i)/c.length,u=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];u.forEach(({x:e,y:t})=>{let r=(c.length-7)*d*e+i,a=(c.length-7)*d*t+i;for(let e=0;e<u.length;e+=1){let t=d*(7-2*e);l.push(o.svg` 520 <rect 521 fill=${2===e?"var(--apkt-colors-black)":"var(--apkt-colors-white)"} 522 width=${0===e?t-10:t} 523 rx= ${0===e?(t-10)*.45:.45*t} 524 ry= ${0===e?(t-10)*.45:.45*t} 525 stroke=${n} 526 stroke-width=${10*(0===e)} 527 height=${0===e?t-10:t} 528 x= ${0===e?a+d*e+5:a+d*e} 529 y= ${0===e?r+d*e+5:r+d*e} 530 /> 531 `)}});let h=Math.floor((r+25)/d),p=c.length/2-h/2,f=c.length/2+h/2-1,g=[];c.forEach((e,t)=>{e.forEach((e,r)=>{!c[t][r]||t<7&&r<7||t>c.length-8&&r<7||t<7&&r>c.length-8||t>p&&t<f&&r>p&&r<f||g.push([t*d+d/2+i,r*d+d/2+i])})});let m={};return g.forEach(([e,t])=>{m[e]?m[e]?.push(t):m[e]=[t]}),Object.entries(m).map(([e,t])=>{let r=t.filter(e=>t.every(t=>!tx(e,t,d)));return[Number(e),r]}).forEach(([e,t])=>{t.forEach(t=>{l.push(o.svg`<circle cx=${e} cy=${t} fill=${n} r=${d/2.5} />`)})}),Object.entries(m).filter(([e,t])=>t.length>1).map(([e,t])=>{let r=t.filter(e=>t.some(t=>tx(e,t,d)));return[Number(e),r]}).map(([e,t])=>{t.sort((e,t)=>e<t?-1:1);let r=[];for(let e of t){let t=r.find(t=>t.some(t=>tx(e,t,d)));t?t.push(e):r.push([e])}return[e,r.map(e=>[e[0],e[e.length-1]])]}).forEach(([e,t])=>{t.forEach(([t,r])=>{l.push(o.svg` 532 <line 533 x1=${e} 534 x2=${e} 535 y1=${t} 536 y2=${r} 537 stroke=${n} 538 stroke-width=${d/1.25} 539 stroke-linecap="round" 540 /> 541 `)})}),l}},tE=R.css` 542 :host { 543 position: relative; 544 user-select: none; 545 display: block; 546 overflow: hidden; 547 aspect-ratio: 1 / 1; 548 width: 100%; 549 height: 100%; 550 background-color: ${({colors:e})=>e.white}; 551 border: 1px solid ${({tokens:e})=>e.theme.borderPrimary}; 552 } 553 554 :host { 555 border-radius: ${({borderRadius:e})=>e[4]}; 556 display: flex; 557 align-items: center; 558 justify-content: center; 559 } 560 561 :host([data-clear='true']) > wui-icon { 562 display: none; 563 } 564 565 svg:first-child, 566 wui-image, 567 wui-icon { 568 position: absolute; 569 top: 50%; 570 left: 50%; 571 transform: translateY(-50%) translateX(-50%); 572 background-color: ${({tokens:e})=>e.theme.backgroundPrimary}; 573 box-shadow: inset 0 0 0 4px ${({tokens:e})=>e.theme.backgroundPrimary}; 574 border-radius: ${({borderRadius:e})=>e[6]}; 575 } 576 577 wui-image { 578 width: 25%; 579 height: 25%; 580 border-radius: ${({borderRadius:e})=>e[2]}; 581 } 582 583 wui-icon { 584 width: 100%; 585 height: 100%; 586 color: #3396ff !important; 587 transform: translateY(-50%) translateX(-50%) scale(0.25); 588 } 589 590 wui-icon > svg { 591 width: inherit; 592 height: inherit; 593 } 594`;var tR=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let tk=class extends tv.LitElement{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=`--local-size: ${this.size}px`,o.html`<wui-flex 595 alignItems="center" 596 justifyContent="center" 597 class="wui-qr-code" 598 direction="column" 599 gap="4" 600 width="100%" 601 style="height: 100%" 602 > 603 ${this.templateVisual()} ${this.templateSvg()} 604 </wui-flex>`}templateSvg(){return o.svg` 605 <svg height=${this.size} width=${this.size}> 606 ${t$.generate({uri:this.uri,size:this.size,logoSize:this.arenaClear?0:this.size/4})} 607 </svg> 608 `}templateVisual(){return this.imageSrc?o.html`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?o.html`<wui-icon 609 class="farcaster" 610 size="inherit" 611 color="inherit" 612 name="farcaster" 613 ></wui-icon>`:o.html`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};tk.styles=[eH.resetStyles,tE],tR([(0,u.property)()],tk.prototype,"uri",void 0),tR([(0,u.property)({type:Number})],tk.prototype,"size",void 0),tR([(0,u.property)()],tk.prototype,"theme",void 0),tR([(0,u.property)()],tk.prototype,"imageSrc",void 0),tR([(0,u.property)()],tk.prototype,"alt",void 0),tR([(0,u.property)({type:Boolean})],tk.prototype,"arenaClear",void 0),tR([(0,u.property)({type:Boolean})],tk.prototype,"farcaster",void 0),tk=tR([(0,c.customElement)("wui-qr-code")],tk);var tT=r;let tO=R.css` 614 :host { 615 display: block; 616 background: linear-gradient( 617 90deg, 618 ${({tokens:e})=>e.theme.foregroundSecondary} 0%, 619 ${({tokens:e})=>e.theme.foregroundTertiary} 50%, 620 ${({tokens:e})=>e.theme.foregroundSecondary} 100% 621 ); 622 background-size: 200% 100%; 623 animation: shimmer 1s ease-in-out infinite; 624 border-radius: ${({borderRadius:e})=>e[2]}; 625 } 626 627 :host([data-rounded='true']) { 628 border-radius: ${({borderRadius:e})=>e[16]}; 629 } 630 631 @keyframes shimmer { 632 0% { 633 background-position: 200% 0; 634 } 635 100% { 636 background-position: -200% 0; 637 } 638 } 639`;var tP=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let tA=class extends tT.LitElement{constructor(){super(...arguments),this.width="",this.height="",this.variant="default",this.rounded=!1}render(){return this.style.cssText=` 640 width: ${this.width}; 641 height: ${this.height}; 642 `,this.dataset.rounded=this.rounded?"true":"false",o.html`<slot></slot>`}};tA.styles=[tO],tP([(0,u.property)()],tA.prototype,"width",void 0),tP([(0,u.property)()],tA.prototype,"height",void 0),tP([(0,u.property)()],tA.prototype,"variant",void 0),tP([(0,u.property)({type:Boolean})],tA.prototype,"rounded",void 0),tA=tP([(0,c.customElement)("wui-shimmer")],tA),e.i(803596);let tS=R.css` 643 wui-shimmer { 644 width: 100%; 645 aspect-ratio: 1 / 1; 646 border-radius: ${({borderRadius:e})=>e[4]}; 647 } 648 649 wui-qr-code { 650 opacity: 0; 651 animation-duration: ${({durations:e})=>e.xl}; 652 animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]}; 653 animation-name: fade-in; 654 animation-fill-mode: forwards; 655 } 656 657 @keyframes fade-in { 658 from { 659 opacity: 0; 660 } 661 to { 662 opacity: 1; 663 } 664 } 665`;var tN=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let tI=class extends tf{constructor(){super(),this.basic=!1,this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate)}firstUpdated(){this.basic||m.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet?.name??"WalletConnect",platform:"qrcode",dis
665playIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:w.RouterController.state.view}})}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribe?.forEach(e=>e()),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),o.html` 666 <wui-flex 667 flexDirection="column" 668 alignItems="center" 669 .padding=${["0","5","5","5"]} 670 gap="5" 671 > 672 <wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer> 673 <wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text> 674 ${this.copyTemplate()} 675 </wui-flex> 676 <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links> 677 `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;let e=this.getBoundingClientRect().width-40,t=this.wallet?this.wallet.name:void 0;f.ConnectionController.setWcLinking(void 0),f.ConnectionController.setRecentWallet(this.wallet);let r=this.uri;if(this.wallet?.mobile_link){let{redirect:e}=a.CoreHelperUtil.formatNativeUrl(this.wallet?.mobile_link,this.uri,null);r=e}return o.html` <wui-qr-code 678 size=${e} 679 theme=${e3.ThemeController.state.themeMode} 680 uri=${r} 681 imageSrc=${(0,h.ifDefined)(x.AssetUtil.getWalletImage(this.wallet))} 682 color=${(0,h.ifDefined)(e3.ThemeController.state.themeVariables["--w3m-qr-color"])} 683 alt=${(0,h.ifDefined)(t)} 684 data-testid="wui-qr-code" 685 ></wui-qr-code>`}copyTemplate(){let e=!this.uri||!this.ready;return o.html`<wui-button 686 .disabled=${e} 687 @click=${this.onCopyUri} 688 variant="neutral-secondary" 689 size="sm" 690 data-testid="copy-wc2-uri" 691 > 692 Copy link 693 <wui-icon size="sm" color="inherit" name="copy" slot="iconRight"></wui-icon> 694 </wui-button>`}};tI.styles=tS,tN([(0,u.property)({type:Boolean})],tI.prototype,"basic",void 0),tI=tN([(0,c.customElement)("w3m-connecting-wc-qrcode")],tI);var tU=r;let tL=class extends tU.LitElement{constructor(){if(super(),this.wallet=w.RouterController.state.data?.wallet,!this.wallet)throw Error("w3m-connecting-wc-unsupported: No wallet provided");m.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:w.RouterController.state.view}})}render(){return o.html` 695 <wui-flex 696 flexDirection="column" 697 alignItems="center" 698 .padding=${["10","5","5","5"]} 699 gap="5" 700 > 701 <wui-wallet-image 702 size="lg" 703 imageSrc=${(0,h.ifDefined)(x.AssetUtil.getWalletImage(this.wallet))} 704 ></wui-wallet-image> 705 706 <wui-text variant="md-regular" color="primary">Not Detected</wui-text> 707 </wui-flex> 708 709 <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links> 710 `}};tL=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a}([(0,c.customElement)("w3m-connecting-wc-unsupported")],tL);var tj=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let tM=class extends tf{constructor(){if(super(),this.isLoading=!0,!this.wallet)throw Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=tw.ConstantsUtil.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(f.ConnectionController.subscribeKey("wcUri",()=>{this.updateLoadingState()})),m.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:w.RouterController.state.view}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){if(this.wallet?.webapp_link&&this.uri)try{this.error=!1;let{webapp_link:e,name:t}=this.wallet,{redirect:r,href:o}=a.CoreHelperUtil.formatUniversalUrl(e,this.uri);f.ConnectionController.setWcLinking({name:t,href:o}),f.ConnectionController.setRecentWallet(this.wallet),a.CoreHelperUtil.openHref(r,"_blank")}catch{this.error=!0}}};tj([(0,i.state)()],tM.prototype,"isLoading",void 0),tM=tj([(0,c.customElement)("w3m-connecting-wc-web")],tM);let tD=R.css` 711 :host([data-mobile-fullscreen='true']) { 712 height: 100%; 713 display: flex; 714 flex-direction: column; 715 } 716 717 :host([data-mobile-fullscreen='true']) wui-ux-by-reown { 718 margin-top: auto; 719 } 720`;var tB=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let tz=class extends P.LitElement{constructor(){super(),this.wallet=w.RouterController.state.data?.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!s.OptionsController.state.siwx,this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.displayBranding=!0,this.basic=!1,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(s.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}
720disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return s.OptionsController.state.enableMobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),o.html` 721 ${this.headerTemplate()} 722 <div class="platform-container">${this.platformTemplate()}</div> 723 ${this.reownBrandingTemplate()} 724 `}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding&&this.displayBranding?o.html`<wui-ux-by-reown></wui-ux-by-reown>`:null}async initializeConnection(e=!1){if("browser"!==this.platform&&(!s.OptionsController.state.manualWCControl||e))try{let{wcPairingExpiry:t,status:r}=f.ConnectionController.state,{redirectView:o}=w.RouterController.state.data??{};if(e||s.OptionsController.state.enableEmbedded||a.CoreHelperUtil.isPairingExpired(t)||"connecting"===r){let e=f.ConnectionController.getConnections(N.ChainController.state.activeChain),t=this.remoteFeatures?.multiWallet,r=e.length>0;await f.ConnectionController.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||(r&&t?(w.RouterController.replace("ProfileWallets"),U.SnackController.showSuccess("New Wallet Added")):o?w.RouterController.replace(o):I.ModalController.close())}}catch(e){if(e instanceof Error&&e.message.includes("An error occurred when attempting to switch chain")&&!s.OptionsController.state.enableNetworkSwitch&&N.ChainController.state.activeChain){N.ChainController.setActiveCaipNetwork(ez.getUnsupportedNetwork(`${N.ChainController.state.activeChain}:${N.ChainController.state.activeCaipNetwork?.id}`)),N.ChainController.showUnsupportedChainUI();return}e instanceof S.AppKitError&&e.originalName===A.ErrorUtil.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?m.EventsController.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:e.message}}):m.EventsController.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),f.ConnectionController.setWcError(!0),U.SnackController.showError(e.message??"Connection error"),f.ConnectionController.resetWcConnection(),w.RouterController.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;let{mobile_link:e,desktop_link:t,webapp_link:r,injected:o,rdns:i}=this.wallet,n=o?.map(({injected_id:e})=>
724e).filter(Boolean),l=[...i?[i]:n??[]],c=!s.OptionsController.state.isUniversalProvider&&l.length,d=f.ConnectionController.checkInstalled(l),u=c&&d,h=t&&!a.CoreHelperUtil.isMobile();u&&!N.ChainController.state.noAdapters&&this.platforms.push("browser"),e&&this.platforms.push(a.CoreHelperUtil.isMobile()?"mobile":"qrcode"),r&&this.platforms.push("web"),h&&this.platforms.push("desktop"),u||!c||N.ChainController.state.noAdapters||this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return o.html`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return o.html`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return o.html` 725 <w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}> 726 </w3m-connecting-wc-desktop> 727 `;case"mobile":return o.html` 728 <w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}> 729 </w3m-connecting-wc-mobile> 730 `;case"qrcode":return o.html`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`;default:return o.html`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?o.html` 731 <w3m-connecting-header 732 .platforms=${this.platforms} 733 .onSelectPlatfrom=${this.onSelectPlatform.bind(this)} 734 > 735 </w3m-connecting-header> 736 `:null}async onSelectPlatform(e){let t=this.shadowRoot?.querySelector("div");t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};tz.styles=tD,tB([(0,i.state)()],tz.prototype,"platform",void 0),tB([(0,i.state)()],tz.prototype,"platforms",void 0),tB([(0,i.state)()],tz.prototype,"isSiwxEnabled",void 0),tB([(0,i.state)()],tz.prototype,"remoteFeatures",void 0),tB([(0,u.property)({type:Boolean})],tz.prototype,"displayBranding",void 0),tB([(0,u.property)({type:Boolean})],tz.prototype,"basic",void 0),tz=tB([(0,c.customElement)("w3m-connecting-wc-view")],tz);var t_=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let tW=class extends r.LitElement{constructor(){super(),this.unsubscribe=[],this.isMobile=a.CoreHelperUtil.isMobile(),this.remoteFeatures=s.OptionsController.state.remoteFeatures,this.unsubscribe.push(s.OptionsController.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(this.isMobile){let{featured:e,recommended:t}=n.ApiController.state,{customWallets:r}=s.OptionsController.state,i=l.StorageUtil.getRecentWallets(),a=e.length||t.length||r?.length||i.length;return o.html`<wui-flex flexDirection="column" gap="2" .margin=${["1","3","3","3"]}> 737 ${a?o.html`<w3m-connector-list></w3m-connector-list>`:null} 738 <w3m-all-wallets-widget></w3m-all-wallets-widget> 739 </wui-flex>`}return o.html`<wui-flex flexDirection="column" .padding=${["0","0","4","0"]}> 740 <w3m-connecting-wc-view ?basic=${!0} .displayBranding=${!1}></w3m-connecting-wc-view> 741 <wui-flex flexDirection="column" .padding=${["0","3","0","3"]}> 742 <w3m-all-wallets-widget></w3m-all-wallets-widget> 743 </wui-flex> 744 </wui-flex> 745 ${this.reownBrandingTemplate()} `}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding?o.html` <wui-flex flexDirection="column" .padding=${["1","0","1","0"]}> 746 <wui-ux-by-reown></wui-ux-by-reown> 747 </wui-flex>`:null}};t_([(0,i.state)()],tW.prototype,"isMobile",void 0),t_([(0,i.state)()],tW.prototype,"remoteFeatures",void 0),tW=t_([(0,c.customElement)("w3m-connecting-wc-basic-view")],tW),e.s(["W3mConnectingWcBasicView",0,tW],612639);var tH=r,tq=r,tF=r;let{I:tK}=o._$LH;var tV=e.i(391909);let tJ=(e,t)=>
747{let r=e._$AN;if(void 0===r)return!1;for(let e of r)e._$AO?.(t,!1),tJ(e,t);return!0},tY=e=>{let t,r;do{if(void 0===(t=e._$AM))break;(r=t._$AN).delete(e),e=t}while(0===r?.size)},tG=e=>{for(let t;t=e._$AM;e=t){let r=t._$AN;if(void 0===r)t._$AN=r=new Set;else if(r.has(e))break;r.add(e),tZ(t)}};function tQ(e){void 0!==this._$AN?(tY(this),this._$AM=e,tG(this)):this._$AM=e}function tX(e,t=!1,r=0){let o=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(t)if(Array.isArray(o))for(let e=r;e<o.length;e++)tJ(o[e],!1),tY(o[e]);else null!=o&&(tJ(o,!1),tY(o));else tJ(this,e)}let tZ=e=>{e.type==tV.PartType.CHILD&&(e._$AP??=tX,e._$AQ??=tQ)};class t0 extends tV.Directive{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),tG(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(tJ(this,e),tY(this))}setValue(e){if(void 0===this._$Ct.strings)this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}let t1=()=>new t3;class t3{}let t2=new WeakMap,t5=(0,tV.directive)(class extends t0{render(e){return o.nothing}update(e,[t]){let r=t!==this.G;return r&&void 0!==this.G&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),o.nothing}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){let t=this.ht??globalThis,r=t2.get(t);void 0===r&&(r=new WeakMap,t2.set(t,r)),void 0!==r.get(this.G)&&this.G.call(this.ht,void 0),r.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?t2.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),t4=R.css` 748 :host { 749 display: flex; 750 align-items: center; 751 justify-content: center; 752 } 753 754 label { 755 position: relative; 756 display: inline-block; 757 user-select: none; 758 transition: 759 background-color ${({durations:e})=>e.lg} 760 ${({easings:e})=>e["ease-out-power-2"]}, 761 color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 762 border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 763 box-shadow ${({durations:e})=>e.lg} 764 ${({easings:e})=>e["ease-out-power-2"]}, 765 width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 766 height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 767 transform ${({durations:e})=>e.lg} 768 ${({easings:e})=>e["ease-out-power-2"]}, 769 opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}; 770 will-change: background-color, color, border, box-shadow, width, height, transform, opacity; 771 } 772 773 input { 774 width: 0; 775 height: 0; 776 opacity: 0; 777 } 778 779 span { 780 position: absolute; 781 cursor: pointer; 782 top: 0; 783 left: 0; 784 right: 0; 785 bottom: 0; 786 background-color: ${({colors:e})=>e.neutrals300}; 787 border-radius: ${({borderRadius:e})=>e.round}; 788 border: 1px solid transparent; 789 will-change: border; 790 transition: 791 background-color ${({durations:e})=>e.lg} 792 ${({easings:e})=>e["ease-out-power-2"]}, 793 color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 794 border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 795 box-shadow ${({durations:e})=>e.lg} 796 ${({easings:e})=>e["ease-out-power-2"]}, 797 width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 798 height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}, 799 transform ${({durations:e})=>e.lg} 800 ${({easings:e})=>e["ease-out-power-2"]}, 801 opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}; 802 will-change: background-color, color, border, box-shadow, width, height, transform, opacity; 803 } 804 805 span:before { 806 content: ''; 807 position: absolute; 808 background-color: ${({colors:e})=>e.white}; 809 border-radius: 50%; 810 } 811 812 /* -- Sizes --------------------------------------------------------- */ 813 label[data-size='lg'] { 814 width: 48px; 815 height: 32px; 816 } 817 818 label[data-size='md'] { 819 width: 40px; 820 height: 28px; 821 } 822 823 label[data-size='sm'] { 824 width: 32px; 825 height: 22px; 826 } 827 828 label[data-size='lg'] > span:before { 829 height: 24px; 830 width: 24px; 831 left: 4px; 832 top: 3px; 833 } 834 835 label[data-size='md'] > span:before { 836 height: 20px;
837 width: 20px; 838 left: 4px; 839 top: 3px; 840 } 841 842 label[data-size='sm'] > span:before { 843 height: 16px; 844 width: 16px; 845 left: 3px; 846 top: 2px; 847 } 848 849 /* -- Focus states --------------------------------------------------- */ 850 input:focus-visible:not(:checked) + span, 851 input:focus:not(:checked) + span { 852 border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary}; 853 background-color: ${({tokens:e})=>e.theme.textTertiary}; 854 box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2); 855 } 856 857 input:focus-visible:checked + span, 858 input:focus:checked + span { 859 border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary}; 860 box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2); 861 } 862 863 /* -- Checked states --------------------------------------------------- */ 864 input:checked + span { 865 background-color: ${({tokens:e})=>e.core.iconAccentPrimary}; 866 } 867 868 label[data-size='lg'] > input:checked + span:before { 869 transform: translateX(calc(100% - 9px)); 870 } 871 872 label[data-size='md'] > input:checked + span:before { 873 transform: translateX(calc(100% - 9px)); 874 } 875 876 label[data-size='sm'] > input:checked + span:before { 877 transform: translateX(calc(100% - 7px)); 878 } 879 880 /* -- Hover states ------------------------------------------------------- */ 881 label:hover > input:not(:checked):not(:disabled) + span { 882 background-color: ${({colors:e})=>e.neutrals400}; 883 } 884 885 label:hover > input:checked:not(:disabled) + span { 886 background-color: ${({colors:e})=>e.accent080}; 887 } 888 889 /* -- Disabled state --------------------------------------------------- */ 890 label:has(input:disabled) { 891 pointer-events: none; 892 user-select: none; 893 } 894 895 input:not(:checked):disabled + span { 896 background-color: ${({colors:e})=>e.neutrals700}; 897 } 898 899 input:checked:disabled + span { 900 background-color: ${({colors:e})=>e.neutrals700}; 901 } 902 903 input:not(:checked):disabled + span::before { 904 background-color: ${({colors:e})=>e.neutrals400}; 905 } 906 907 input:checked:disabled + span::before { 908 background-color: ${({tokens:e})=>e.theme.textTertiary}; 909 } 910`;var t8=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let t6=class extends tF.LitElement{constructor(){super(...arguments),this.inputElementRef=t1(),this.checked=!1,this.disabled=!1,this.size="md"}render(){return o.html` 911 <label data-size=${this.size}> 912 <input 913 ${t5(this.inputElementRef)} 914 type="checkbox" 915 ?checked=${this.checked} 916 ?disabled=${this.disabled} 917 @change=${this.dispatchChangeEvent.bind(this)} 918 /> 919 <span></span> 920 </label> 921 `}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("switchChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};t6.styles=[eH.resetStyles,eH.elementStyles,t4],t8([(0,u.property)({type:Boolean})],t6.prototype,"checked",void 0),t8([(0,u.property)({type:Boolean})],t6.prototype,"disabled",void 0),t8([(0,u.property)()],t6.prototype,"size",void 0),t6=t8([(0,c.customElement)("wui-toggle")],t6);let t9=R.css` 922 :host { 923 height: auto; 924 } 925 926 :host > wui-flex { 927 height: 100%; 928 display: flex; 929 align-items: center; 930 justify-content: center; 931 column-gap: ${({spacing:e})=>e["2"]}; 932 padding: ${({spacing:e})=>e["2"]} ${({spacing:e})=>e["3"]}; 933 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 934 border-radius: ${({borderRadius:e})=>e["4"]}; 935 box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary}; 936 transition: background-color ${({durations:e})=>e.lg} 937 ${({easings:e})=>e["ease-out-power-2"]}; 938 will-change: background-color; 939 cursor: pointer; 940 } 941 942 wui-switch { 943 pointer-events: none; 944 } 945`;var t7=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let re=class extends tq.LitElement{constructor(){super(...arguments),this.checked=!1}
945render(){return o.html` 946 <wui-flex> 947 <wui-icon size="xl" name="walletConnectBrown"></wui-icon> 948 <wui-toggle 949 ?checked=${this.checked} 950 size="sm" 951 @switchChange=${this.handleToggleChange.bind(this)} 952 ></wui-toggle> 953 </wui-flex> 954 `}handleToggleChange(e){e.stopPropagation(),this.checked=e.detail,this.dispatchSwitchEvent()}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("certifiedSwitchChange",{detail:this.checked,bubbles:!0,composed:!0}))}};re.styles=[eH.resetStyles,eH.elementStyles,t9],t7([(0,u.property)({type:Boolean})],re.prototype,"checked",void 0),re=t7([(0,c.customElement)("wui-certified-switch")],re);var rt=r,rr=r;let ro=R.css` 955 :host { 956 position: relative; 957 width: 100%; 958 display: inline-flex; 959 flex-direction: column; 960 gap: ${({spacing:e})=>e[3]}; 961 color: ${({tokens:e})=>e.theme.textPrimary}; 962 caret-color: ${({tokens:e})=>e.core.textAccentPrimary}; 963 } 964 965 .wui-input-text-container { 966 position: relative; 967 display: flex; 968 } 969 970 input { 971 width: 100%; 972 border-radius: ${({borderRadius:e})=>e[4]}; 973 color: inherit; 974 background: transparent; 975 border: 1px solid ${({tokens:e})=>e.theme.borderPrimary}; 976 caret-color: ${({tokens:e})=>e.core.textAccentPrimary}; 977 padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[3]} 978 ${({spacing:e})=>e[3]} ${({spacing:e})=>e[10]}; 979 font-size: ${({textSize:e})=>e.large}; 980 line-height: ${({typography:e})=>e["lg-regular"].lineHeight}; 981 letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing}; 982 font-weight: ${({fontWeight:e})=>e.regular}; 983 font-family: ${({fontFamily:e})=>e.regular}; 984 } 985 986 input[data-size='lg'] { 987 padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[3]} 988 ${({spacing:e})=>e[4]} ${({spacing:e})=>e[10]}; 989 } 990 991 @media (hover: hover) and (pointer: fine) { 992 input:hover:enabled { 993 border: 1px solid ${({tokens:e})=>e.theme.borderSecondary}; 994 } 995 } 996 997 input:disabled { 998 cursor: unset; 999 border: 1px solid ${({tokens:e})=>e.theme.borderPrimary}; 1000 } 1001 1002 input::placeholder { 1003 color: ${({tokens:e})=>e.theme.textSecondary}; 1004 } 1005 1006 input:focus:enabled { 1007 border: 1px solid ${({tokens:e})=>e.theme.borderSecondary}; 1008 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 1009 -webkit-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040}; 1010 -moz-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040}; 1011 box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040}; 1012 } 1013 1014 div.wui-input-text-container:has(input:disabled) { 1015 opacity: 0.5; 1016 } 1017 1018 wui-icon.wui-input-text-left-icon { 1019 position: absolute; 1020 top: 50%; 1021 transform: translateY(-50%); 1022 pointer-events: none; 1023 left: ${({spacing:e})=>e[4]}; 1024 color: ${({tokens:e})=>e.theme.iconDefault}; 1025 } 1026 1027 button.wui-input-text-submit-button { 1028 position: absolute; 1029 top: 50%; 1030 transform: translateY(-50%); 1031 right: ${({spacing:e})=>e[3]}; 1032 width: 24px; 1033 height: 24px; 1034 border: none; 1035 background: transparent; 1036 border-radius: ${({borderRadius:e})=>e[2]}; 1037 color: ${({tokens:e})=>e.core.textAccentPrimary}; 1038 } 1039 1040 button.wui-input-text-submit-button:disabled { 1041 opacity: 1; 1042 } 1043 1044 button.wui-input-text-submit-button.loading wui-icon { 1045 animation: spin 1s linear infinite; 1046 } 1047 1048 button.wui-input-text-submit-button:hover { 1049 background: ${({tokens:e})=>e.core.foregroundAccent010}; 1050 } 1051 1052 input:has(+ .wui-input-text-submit-button) { 1053 padding-right: ${({spacing:e})=>e[12]}; 1054 } 1055 1056 input[type='number'] { 1057 -moz-appearance: textfield; 1058 } 1059 1060 input[type='search']::-webkit-search-decoration, 1061 input[type='search']::-webkit-search-cancel-button, 1062 input[type='search']::-webkit-search-results-button, 1063 input[type='search']::-webkit-search-results-decoration { 1064 -webkit-appearance: none; 1065 } 1066 1067 /* -- Keyframes --------------------------------------------------- */ 1068 @keyframes spin { 1069 from { 1070 transform: rotate(0deg); 1071 } 1072 to { 1073 transform: rotate(360deg); 1074 } 1075 } 1076`;var ri=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let rn=class extends rr.LitElement{constructor(){super(...arguments),this.inputElementRef=t1(),this.disabled=!1,this.loading=!1,this.placeholder="",this.type="text",this.value="",this.size="md"}render(){return o.html` <div class="wui-input-text-container"> 1077 ${this.templateLeftIcon()} 1078 <input 1079 data-size=${this.size} 1080 ${t5(this.inputElementRef)} 1081 data-testid="wui-input-text" 1082 type=${this.type} 1083 enterkeyhint=${(0,h.ifDefined)(this.enterKeyHint)} 1084 ?disabled=${this.disabled} 1085 placeholder=${this.placeholder}
1086 @input=${this.dispatchInputChangeEvent.bind(this)} 1087 @keydown=${this.onKeyDown} 1088 .value=${this.value||""} 1089 /> 1090 ${this.templateSubmitButton()} 1091 <slot class="wui-input-text-slot"></slot> 1092 </div> 1093 ${this.templateError()} ${this.templateWarning()}`}templateLeftIcon(){return this.icon?o.html`<wui-icon 1094 class="wui-input-text-left-icon" 1095 size="md" 1096 data-size=${this.size} 1097 color="inherit" 1098 name=${this.icon} 1099 ></wui-icon>`:null}templateSubmitButton(){return this.onSubmit?o.html`<button 1100 class="wui-input-text-submit-button ${this.loading?"loading":""}" 1101 @click=${this.onSubmit?.bind(this)} 1102 ?disabled=${this.disabled||this.loading} 1103 > 1104 ${this.loading?o.html`<wui-icon name="spinner" size="md"></wui-icon>`:o.html`<wui-icon name="chevronRight" size="md"></wui-icon>`} 1105 </button>`:null}templateError(){return this.errorText?o.html`<wui-text variant="sm-regular" color="error">${this.errorText}</wui-text>`:null}templateWarning(){return this.warningText?o.html`<wui-text variant="sm-regular" color="warning">${this.warningText}</wui-text>`:null}dispatchInputChangeEvent(){this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};rn.styles=[eH.resetStyles,eH.elementStyles,ro],ri([(0,u.property)()],rn.prototype,"icon",void 0),ri([(0,u.property)({type:Boolean})],rn.prototype,"disabled",void 0),ri([(0,u.property)({type:Boolean})],rn.prototype,"loading",void 0),ri([(0,u.property)()],rn.prototype,"placeholder",void 0),ri([(0,u.property)()],rn.prototype,"type",void 0),ri([(0,u.property)()],rn.prototype,"value",void 0),ri([(0,u.property)()],rn.prototype,"errorText",void 0),ri([(0,u.property)()],rn.prototype,"warningText",void 0),ri([(0,u.property)()],rn.prototype,"onSubmit",void 0),ri([(0,u.property)()],rn.prototype,"size",void 0),ri([(0,u.property)({attribute:!1})],rn.prototype,"onKeyDown",void 0),rn=ri([(0,c.customElement)("wui-input-text")],rn);let ra=R.css` 1106 :host { 1107 position: relative; 1108 display: inline-block; 1109 width: 100%; 1110 } 1111 1112 wui-icon { 1113 position: absolute; 1114 top: 50%; 1115 transform: translateY(-50%); 1116 right: ${({spacing:e})=>e[3]}; 1117 color: ${({tokens:e})=>e.theme.iconDefault}; 1118 cursor: pointer; 1119 padding: ${({spacing:e})=>e[2]}; 1120 background-color: transparent; 1121 border-radius: ${({borderRadius:e})=>e[4]}; 1122 transition: background-color ${({durations:e})=>e.lg} 1123 ${({easings:e})=>e["ease-out-power-2"]}; 1124 } 1125 1126 @media (hover: hover) { 1127 wui-icon:hover { 1128 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 1129 } 1130 } 1131`;var rs=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let rl=class extends rt.LitElement{constructor(){super(...arguments),this.inputComponentRef=t1(),this.inputValue=""}render(){return o.html` 1132 <wui-input-text 1133 ${t5(this.inputComponentRef)} 1134 placeholder="Search wallet" 1135 icon="search" 1136 type="search" 1137 enterKeyHint="search" 1138 size="sm" 1139 @inputChange=${this.onInputChange} 1140 > 1141 ${this.inputValue?o.html`<wui-icon 1142 @click=${this.clearValue} 1143 color="inherit" 1144 size="sm" 1145 name="close" 1146 ></wui-icon>`:null} 1147 </wui-input-text> 1148 `}onInputChange(e){this.inputValue=e.detail||""}clearValue(){let e=this.inputComponentRef.value,t=e?.inputElementRef.value;t&&(t.value="",this.inputValue="",t.focus(),t.dispatchEvent(new Event("input")))}};rl.styles=[eH.resetStyles,ra],rs([(0,u.property)()],rl.prototype,"inputValue",void 0),rl=rs([(0,c.customElement)("wui-search-bar")],rl);var rc=r,rd=r;let ru=o.svg`<svg viewBox="0 0 48 54" fill="none"> 1149 <path 1150 d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.951
11505 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" 1151 /> 1152</svg>`,rh=R.css` 1153 :host { 1154 display: flex; 1155 flex-direction: column; 1156 justify-content: center; 1157 align-items: center; 1158 height: 104px; 1159 width: 104px; 1160 row-gap: ${({spacing:e})=>e[2]}; 1161 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 1162 border-radius: ${({borderRadius:e})=>e[5]}; 1163 position: relative; 1164 } 1165 1166 wui-shimmer[data-type='network'] { 1167 border: none; 1168 -webkit-clip-path: var(--apkt-path-network); 1169 clip-path: var(--apkt-path-network); 1170 } 1171 1172 svg { 1173 position: absolute; 1174 width: 48px; 1175 height: 54px; 1176 z-index: 1; 1177 } 1178 1179 svg > path { 1180 stroke: ${({tokens:e})=>e.theme.foregroundSecondary}; 1181 stroke-width: 1px; 1182 } 1183 1184 @media (max-width: 350px) { 1185 :host { 1186 width: 100%; 1187 } 1188 } 1189`;var rp=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let rf=class extends rd.LitElement{constructor(){super(...arguments),this.type="wallet"}render(){return o.html` 1190 ${this.shimmerTemplate()} 1191 <wui-shimmer width="80px" height="20px"></wui-shimmer> 1192 `}shimmerTemplate(){return"network"===this.type?o.html` <wui-shimmer data-type=${this.type} width="48px" height="54px"></wui-shimmer> 1193 ${ru}`:o.html`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}};rf.styles=[eH.resetStyles,eH.elementStyles,rh],rp([(0,u.property)()],rf.prototype,"type",void 0),rf=rp([(0,c.customElement)("wui-card-select-loader")],rf);var rg=r,rm=e.i(315193);let rw=rm.css` 1194 :host { 1195 display: grid; 1196 width: inherit; 1197 height: inherit; 1198 } 1199`;var rb=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let ry=class extends rg.LitElement{render(){return this.style.cssText=` 1200 grid-template-rows: ${this.gridTemplateRows}; 1201 grid-template-columns: ${this.gridTemplateColumns}; 1202 justify-items: ${this.justifyItems}; 1203 align-items: ${this.alignItems}; 1204 justify-content: ${this.justifyContent}; 1205 align-content: ${this.alignContent}; 1206 column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`}; 1207 row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`}; 1208 gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`}; 1209 padding-top: ${this.padding&&ti.UiHelperUtil.getSpacingStyles(this.padding,0)}; 1210 padding-right: ${this.padding&&ti.UiHelperUtil.getSpacingStyles(this.padding,1)}; 1211 padding-bottom: ${this.padding&&ti.UiHelperUtil.getSpacingStyles(this.padding,2)}; 1212 padding-left: ${this.padding&&ti.UiHelperUtil.getSpacingStyles(this.padding,3)}; 1213 margin-top: ${this.margin&&ti.UiHelperUtil.getSpacingStyles(this.margin,0)}; 1214 margin-right: ${this.margin&&ti.UiHelperUtil.getSpacingStyles(this.margin,1)}; 1215 margin-bottom: ${this.margin&&ti.UiHelperUtil.getSpacingStyles(this.margin,2)}; 1216 margin-left: ${this.margin&&ti.UiHelperUtil.getSpacingStyles(this.margin,3)}; 1217 `,o.html`<slot></slot>`}};ry.styles=[eH.resetStyles,rw],rb([(0,u.property)()],ry.prototype,"gridTemplateRows",void 0),rb([(0,u.property)()],ry.prototype,"gridTemplateColumns",void 0),rb([(0,u.property)()],ry.prototype,"justifyItems",void 0),rb([(0,u.property)()],ry.prototype,"alignItems",void 0),rb([(0,u.property)()],ry.prototype,"justifyContent",void 0),rb([(0,u.property)()],ry.prototype,"alignContent",void 0),rb([(0,u.property)()],ry.prototype,"columnGap",void 0),rb([(0,u.property)()],ry.prototype,"rowGap",void 0),rb([(0,u.property)()],ry.prototype,"gap",void 0),rb([(0,u.property)()],ry.prototype,"padding",void 0),rb([(0,u.property)()],ry.prototype,"margin",void 0),ry=rb([(0,c.customElement)("wui-grid")],ry);var rv=e.i(533659),rC=r;let rx=R.css` 1218 button { 1219 display: flex; 1220 flex-direction: column; 1221 justify-content: center;
1222 align-items: center; 1223 cursor: pointer; 1224 width: 104px; 1225 row-gap: ${({spacing:e})=>e["2"]}; 1226 padding: ${({spacing:e})=>e["3"]} ${({spacing:e})=>e["0"]}; 1227 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 1228 border-radius: clamp(0px, ${({borderRadius:e})=>e["4"]}, 20px); 1229 transition: 1230 color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]}, 1231 background-color ${({durations:e})=>e.lg} 1232 ${({easings:e})=>e["ease-out-power-1"]}, 1233 border-radius ${({durations:e})=>e.lg} 1234 ${({easings:e})=>e["ease-out-power-1"]}; 1235 will-change: background-color, color, border-radius; 1236 outline: none; 1237 border: none; 1238 } 1239 1240 button > wui-flex > wui-text { 1241 color: ${({tokens:e})=>e.theme.textPrimary}; 1242 max-width: 86px; 1243 white-space: nowrap; 1244 overflow: hidden; 1245 text-overflow: ellipsis; 1246 justify-content: center; 1247 } 1248 1249 button > wui-flex > wui-text.certified { 1250 max-width: 66px; 1251 } 1252 1253 @media (hover: hover) and (pointer: fine) { 1254 button:hover:enabled { 1255 background-color: ${({tokens:e})=>e.theme.foregroundSecondary}; 1256 } 1257 } 1258 1259 button:disabled > wui-flex > wui-text { 1260 color: ${({tokens:e})=>e.core.glass010}; 1261 } 1262 1263 [data-selected='true'] { 1264 background-color: ${({colors:e})=>e.accent020}; 1265 } 1266 1267 @media (hover: hover) and (pointer: fine) { 1268 [data-selected='true']:hover:enabled { 1269 background-color: ${({colors:e})=>e.accent010}; 1270 } 1271 } 1272 1273 [data-selected='true']:active:enabled { 1274 background-color: ${({colors:e})=>e.accent010}; 1275 } 1276 1277 @media (max-width: 350px) { 1278 button { 1279 width: 100%; 1280 } 1281 } 1282`;var r$=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let rE=class extends rC.LitElement{constructor(){super(),this.observer=new IntersectionObserver(()=>void 0),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.isImpressed=!1,this.explorerId="",this.walletQuery="",this.certified=!1,this.displayIndex=0,this.wallet=void 0,this.observer=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(this.visible=!0,this.fetchImageSrc(),this.sendImpressionEvent()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){let e=this.wallet?.badge_type==="certified";return o.html` 1283 <button> 1284 ${this.imageTemplate()} 1285 <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="1"> 1286 <wui-text 1287 variant="md-regular" 1288 color="inherit" 1289 class=${(0,h.ifDefined)(e?"certified":void 0)} 1290 >${this.wallet?.name}</wui-text 1291 > 1292 ${e?o.html`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null} 1293 </wui-flex> 1294 </button> 1295 `}imageTemplate(){return(this.visible||this.imageSrc)&&!this.imageLoading?o.html` 1296 <wui-wallet-image 1297 size="lg" 1298 imageSrc=${(0,h.ifDefined)(this.imageSrc)} 1299 name=${(0,h.ifDefined)(this.wallet?.name)} 1300 .installed=${this.wallet?.installed??!1} 1301 badgeSize="sm" 1302 > 1303 </wui-wallet-image> 1304 `:this.shimmerTemplate()}shimmerTemplate(){return o.html`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}async fetchImageSrc(){!this.wallet||(this.imageSrc=x.AssetUtil.getWalletImage(this.wallet),this.imageSrc||(this.imageLoading=!0,this.imageSrc=await x.AssetUtil.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}sendImpressionEvent(){this.wallet&&!this.isImpressed&&(this.isImpressed=!0,m.EventsController.sendWalletImpressionEvent({name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.explorerId,view:w.RouterController.state.view,query:this.walletQuery,certified:this.certified,displayIndex:this.displayIndex}))}};rE.styles=rx,r$([(0,i.state)()],rE.prototype,"visible",void 0),r$([(0,i.state)()],rE.prototype,"imageSrc",void 0),r$([(0,i.state)()],rE.prototype,"imageLoading",void 0),r$([(0,i.state)()],rE.prototype,"isImpressed",void 0),r$([(0,u.property)()],rE.prototype,"explorerId",void 0),r$([(0,u.property)()],rE.prototype,"walletQuery",void 0),r$([(0,u.property)()],rE.prototype,"certified",void 0),r$([(0,u.property)()],rE.prototype,"displayIndex",void 0),r$([(0,u.property)({type:Object})],rE.prototype,"wallet",void 0),rE=r$([(0,c.customElement)("w3m-all-wallets-list-item")],rE);let rR=R.css` 1305 wui-grid { 1306 max-height: clamp(360px, 400px, 80vh); 1307 overflow: scroll; 1308 scrollbar-width: none; 1309 grid-auto-rows: min-content; 1310 grid-template-columns: repeat(auto-fill, 104px); 1311 } 1312 1313 :host([data-mobile-fullscreen='true']) wui-grid { 1314 max-height: none; 1315 } 1316 1317 @media (max-width: 350px) { 1318 wui-grid { 1319 grid-template-columns: repeat(2, 1fr); 1320 } 1321 } 1322 1323 wui-grid[data-scroll='false'] { 1324 overflow: hidden; 1325 } 1326 1327 wui-grid::-webkit-scrollbar {
1328 display: none; 1329 } 1330 1331 w3m-all-wallets-list-item { 1332 opacity: 0; 1333 animation-duration: ${({durations:e})=>e.xl}; 1334 animation-timing-function: ${({easings:e})=>e["ease-inout-power-2"]}; 1335 animation-name: fade-in; 1336 animation-fill-mode: forwards; 1337 } 1338 1339 @keyframes fade-in { 1340 from { 1341 opacity: 0; 1342 } 1343 to { 1344 opacity: 1; 1345 } 1346 } 1347 1348 wui-loading-spinner { 1349 padding-top: ${({spacing:e})=>e["4"]}; 1350 padding-bottom: ${({spacing:e})=>e["4"]}; 1351 justify-content: center; 1352 grid-column: 1 / span 4; 1353 } 1354`;var rk=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let rT="local-paginator",rO=class extends rc.LitElement{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!n.ApiController.state.wallets.length,this.wallets=n.ApiController.state.wallets,this.recommended=n.ApiController.state.recommended,this.featured=n.ApiController.state.featured,this.filteredWallets=n.ApiController.state.filteredWallets,this.mobileFullScreen=s.OptionsController.state.enableMobileFullScreen,this.unsubscribe.push(n.ApiController.subscribeKey("wallets",e=>this.wallets=e),n.ApiController.subscribeKey("recommended",e=>this.recommended=e),n.ApiController.subscribeKey("featured",e=>this.featured=e),n.ApiController.subscribeKey("filteredWallets",e=>this.filteredWallets=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.paginationObserver?.disconnect()}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),o.html` 1355 <wui-grid 1356 data-scroll=${!this.loading} 1357 .padding=${["0","3","3","3"]} 1358 gap="2" 1359 justifyContent="space-between" 1360 > 1361 ${this.loading?this.shimmerTemplate(16):this.walletsTemplate()} 1362 ${this.paginationLoaderTemplate()} 1363 </wui-grid> 1364 `}async initialFetch(){this.loading=!0;let e=this.shadowRoot?.querySelector("wui-grid");e&&(await n.ApiController.fetchWalletsByPage({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,t){return[...Array(e)].map(()=>o.html` 1365 <wui-card-select-loader type="wallet" id=${(0,h.ifDefined)(t)}></wui-card-select-loader> 1366 `)}getWallets(){let e=[...this.featured,...this.recommended];this.filteredWallets?.length>0?e.push(...this.filteredWallets):e.push(...this.wallets);let t=a.CoreHelperUtil.uniqueBy(e,"id"),r=rv.WalletUtil.markWalletsAsInstalled(t);return rv.WalletUtil.markWalletsWithDisplayIndex(r)}walletsTemplate(){return this.getWallets().map((e,t)=>o.html` 1367 <w3m-all-wallets-list-item 1368 data-testid="wallet-search-item-${e.id}" 1369 @click=${()=>this.onConnectWallet(e)} 1370 .wallet=${e} 1371 explorerId=${e.id} 1372 certified=${"certified"===this.badge} 1373 displayIndex=${t} 1374 ></w3m-all-wallets-list-item> 1375 `)}paginationLoaderTemplate(){let{wallets:e,recommended:t,featured:r,count:o,mobileFilteredOutWalletsLength:i}=n.ApiController.state,a=window.innerWidth<352?3:4,s=e.length+t.length,l=Math.ceil(s/a)*a-s+a;return(l-=e.length?r.length%a:0,0===o&&r.length>0)?null:0===o||[...r,...e,...t].length<o-(i??0)?this.shimmerTemplate(l,rT):null}createPaginationObserver(){let e=this.shadowRoot?.querySelector(`#${rT}`);e&&(this.paginationObserver=new IntersectionObserver(([e])=>{if(e?.isIntersecting&&!this.loading){let{page:e,count:t,wallets:r}=n.ApiController.state;r.length<t&&n.ApiController.fetchWalletsByPage({page:e+1})}}),this.paginationObserver.observe(e))}onConnectWallet(e){g.ConnectorController.selectWalletConnector(e)}};rO.styles=rR,rk([(0,i.state)()],rO.prototype,"loading",void 0),rk([(0,i.state)()],rO.prototype,"wallets",void 0),rk([(0,i.state)()],rO.prototype,"recommended",void 0),rk([(0,i.state)()],rO.prototype,"featured",void 0),rk([(0,i.state)()],rO.prototype,"filteredWallets",void 0),rk([(0,i.state)()],rO.prototype,"badge",void 0),rk([(0,i.state)()],rO.prototype,"mobileFullScreen",void 0),rO=rk([(0,c.customElement)("w3m-all-wallets-list")],rO);var rP=r;let rA=rm.css` 1376 wui-grid, 1377 wui-loading-spinner, 1378 wui-flex { 1379 height: 360px; 1380 } 1381 1382 wui-grid { 1383 overflow: scroll; 1384 scrollbar-width: none; 1385 grid-auto-rows: min-content; 1386 grid-template-columns: repeat(auto-fill, 104px); 1387 } 1388 1389 :host([data-mobile-fullscreen='true']) wui-grid { 1390 max-height: none; 1391 height: auto; 1392 } 1393 1394 wui-grid[data-scroll='false'] { 1395 overflow: hidden; 1396 } 1397 1398 wui-grid::-webkit-scrollbar {
1399 display: none; 1400 } 1401 1402 wui-loading-spinner { 1403 justify-content: center; 1404 align-items: center; 1405 } 1406 1407 @media (max-width: 350px) { 1408 wui-grid { 1409 grid-template-columns: repeat(2, 1fr); 1410 } 1411 } 1412`;var rS=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let rN=class extends rP.LitElement{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.mobileFullScreen=s.OptionsController.state.enableMobileFullScreen,this.query=""}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.onSearch(),this.loading?o.html`<wui-loading-spinner color="accent-primary"></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 n.ApiController.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){let{search:e}=n.ApiController.state,t=rv.WalletUtil.markWalletsAsInstalled(e);return e.length?o.html` 1413 <wui-grid 1414 data-testid="wallet-list" 1415 .padding=${["0","3","3","3"]} 1416 rowGap="4" 1417 columngap="2" 1418 justifyContent="space-between" 1419 > 1420 ${t.map((e,t)=>o.html` 1421 <w3m-all-wallets-list-item 1422 @click=${()=>this.onConnectWallet(e)} 1423 .wallet=${e} 1424 data-testid="wallet-search-item-${e.id}" 1425 explorerId=${e.id} 1426 certified=${"certified"===this.badge} 1427 walletQuery=${this.query} 1428 displayIndex=${t} 1429 ></w3m-all-wallets-list-item> 1430 `)} 1431 </wui-grid> 1432 `:o.html` 1433 <wui-flex 1434 data-testid="no-wallet-found" 1435 justifyContent="center" 1436 alignItems="center" 1437 gap="3" 1438 flexDirection="column" 1439 > 1440 <wui-icon-box size="lg" color="default" icon="wallet"></wui-icon-box> 1441 <wui-text data-testid="no-wallet-found-text" color="secondary" variant="md-medium"> 1442 No Wallet found 1443 </wui-text> 1444 </wui-flex> 1445 `}onConnectWallet(e){g.ConnectorController.selectWalletConnector(e)}};rN.styles=rA,rS([(0,i.state)()],rN.prototype,"loading",void 0),rS([(0,i.state)()],rN.prototype,"mobileFullScreen",void 0),rS([(0,u.property)()],rN.prototype,"query",void 0),rS([(0,u.property)()],rN.prototype,"badge",void 0),rN=rS([(0,c.customElement)("w3m-all-wallets-search")],rN);var rI=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let rU=class extends tH.LitElement{constructor(){super(...arguments),this.search="",this.badge=void 0,this.onDebouncedSearch=a.CoreHelperUtil.debounce(e=>{this.search=e})}render(){let e=this.search.length>=2;return o.html` 1446 <wui-flex .padding=${["1","3","3","3"]} gap="2" alignItems="center"> 1447 <wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar> 1448 <wui-certified-switch 1449 ?checked=${"certified"===this.badge} 1450 @certifiedSwitchChange=${this.onCertifiedSwitchChange.bind(this)} 1451 data-testid="wui-certified-switch" 1452 ></wui-certified-switch> 1453 ${this.qrButtonTemplate()} 1454 </wui-flex> 1455 ${e||this.badge?o.html`<w3m-all-wallets-search 1456 query=${this.search} 1457 .badge=${this.badge} 1458 ></w3m-all-wallets-search>`:o.html`<w3m-all-wallets-list .badge=${this.badge}></w3m-all-wallets-list>`} 1459 `}onInputChange(e){this.onDebouncedSearch(e.detail)}onCertifiedSwitchChange(e){e.detail?(this.badge="certified",U.SnackController.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})):this.badge=void 0}qrButtonTemplate(){return a.CoreHelperUtil.isMobile()?o.html` 1460 <wui-icon-box 1461 size="xl" 1462 iconSize="xl" 1463 color="accent-primary" 1464 icon="qrCode" 1465 border 1466 borderColor="wui-accent-glass-010" 1467 @click=${this.onWalletConnectQr.bind(this)} 1468 ></wui-icon-box> 1469 `:null}onWalletConnectQr(){w.RouterController.push("ConnectingWalletConnect")}};rI([(0,i.state)()],rU.prototype,"search",void 0),rI([(0,i.state)()],rU.prototype,"badge",void 0),rU=rI([(0,c.customElement)("w3m-all-wallets-view")],rU),e.s(["W3mAllWalletsView",0,rU],210149);var rL=r,rj=r;let rM=R.css` 1470 :host { 1471 width: 100%; 1472 } 1473 1474 button { 1475 display: flex; 1476 align-items: center; 1477 justify-content: space-between; 1478 padding: ${({spacing:e})=>e[3]}; 1479 width: 100%; 1480 background-color: ${({tokens:e})=>e.theme.backgroundPrimary}; 1481 border-radius: ${({borderRadius:e})=>e[4]}; 1482 transition: 1483 background-color ${({durations:e})=>e.lg} 1484 ${({easings:e})=>e["ease-out-power-2"]}, 1485 scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]}; 1486 will-change: background-color, scale; 1487 } 1488 1489 wui-text { 1490 text-transform: capitalize; 1491 } 1492 1493 wui-image { 1494 color: ${({tokens:e})=>e.theme.textPrimary}; 1495 } 1496 1497 @media (hover: hover) { 1498 button:hover:enabled { 1499 background-color: ${({tokens:e})=>e.theme.foregroundPrimary}; 1500 } 1501 } 1502 1503 button:disabled { 1504 opacity: 0.5;
1505 cursor: not-allowed; 1506 } 1507`;var rD=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a};let rB=class extends rj.LitElement{constructor(){super(...arguments),this.imageSrc="google",this.loading=!1,this.disabled=!1,this.rightIcon=!0,this.rounded=!1,this.fullSize=!1}render(){return this.dataset.rounded=this.rounded?"true":"false",o.html` 1508 <button 1509 ?disabled=${!!this.loading||!!this.disabled} 1510 data-loading=${this.loading} 1511 tabindex=${(0,h.ifDefined)(this.tabIdx)} 1512 > 1513 <wui-flex gap="2" alignItems="center"> 1514 ${this.templateLeftIcon()} 1515 <wui-flex gap="1"> 1516 <slot></slot> 1517 </wui-flex> 1518 </wui-flex> 1519 ${this.templateRightIcon()} 1520 </button> 1521 `}templateLeftIcon(){return this.icon?o.html`<wui-image 1522 icon=${this.icon} 1523 iconColor=${(0,h.ifDefined)(this.iconColor)} 1524 ?boxed=${!0} 1525 ?rounded=${this.rounded} 1526 ></wui-image>`:o.html`<wui-image 1527 ?boxed=${!0} 1528 ?rounded=${this.rounded} 1529 ?fullSize=${this.fullSize} 1530 src=${this.imageSrc} 1531 ></wui-image>`}templateRightIcon(){return this.rightIcon?this.loading?o.html`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:o.html`<wui-icon name="chevronRight" size="lg" color="default"></wui-icon>`:null}};rB.styles=[eH.resetStyles,eH.elementStyles,rM],rD([(0,u.property)()],rB.prototype,"imageSrc",void 0),rD([(0,u.property)()],rB.prototype,"icon",void 0),rD([(0,u.property)()],rB.prototype,"iconColor",void 0),rD([(0,u.property)({type:Boolean})],rB.prototype,"loading",void 0),rD([(0,u.property)()],rB.prototype,"tabIdx",void 0),rD([(0,u.property)({type:Boolean})],rB.prototype,"disabled",void 0),rD([(0,u.property)({type:Boolean})],rB.prototype,"rightIcon",void 0),rD([(0,u.property)({type:Boolean})],rB.prototype,"rounded",void 0),rD([(0,u.property)({type:Boolean})],rB.prototype,"fullSize",void 0),rB=rD([(0,c.customElement)("wui-list-item")],rB);let rz=class extends rL.LitElement{constructor(){super(...arguments),this.wallet=w.RouterController.state.data?.wallet}render(){if(!this.wallet)throw Error("w3m-downloads-view");return o.html` 1532 <wui-flex gap="2" flexDirection="column" .padding=${["3","3","4","3"]}> 1533 ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} 1534 ${this.homepageTemplate()} 1535 </wui-flex> 1536 `}chromeTemplate(){return this.wallet?.chrome_store?o.html`<wui-list-item 1537 variant="icon" 1538 icon="chromeStore" 1539 iconVariant="square" 1540 @click=${this.onChromeStore.bind(this)} 1541 chevron 1542 > 1543 <wui-text variant="md-medium" color="primary">Chrome Extension</wui-text> 1544 </wui-list-item>`:null}iosTemplate(){return this.wallet?.app_store?o.html`<wui-list-item 1545 variant="icon" 1546 icon="appStore" 1547 iconVariant="square" 1548 @click=${this.onAppStore.bind(this)} 1549 chevron 1550 > 1551 <wui-text variant="md-medium" color="primary">iOS App</wui-text> 1552 </wui-list-item>`:null}androidTemplate(){return this.wallet?.play_store?o.html`<wui-list-item 1553 variant="icon" 1554 icon="playStore" 1555 iconVariant="square" 1556 @click=${this.onPlayStore.bind(this)} 1557 chevron 1558 > 1559 <wui-text variant="md-medium" color="primary">Android App</wui-text> 1560 </wui-list-item>`:null}homepageTemplate(){return this.wallet?.homepage?o.html` 1561 <wui-list-item 1562 variant="icon" 1563 icon="browser" 1564 iconVariant="square-blue" 1565 @click=${this.onHomePage.bind(this)} 1566 chevron 1567 > 1568 <wui-text variant="md-medium" color="primary">Website</wui-text> 1569 </wui-list-item> 1570 `:null}openStore(e){e.href&&this.wallet&&(m.EventsController.sendEvent({type:"track",event:"GET_WALLET",properties:{name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.wallet.id,type:e.type}}),a.CoreHelperUtil.openHref(e.href,"_blank"))}onChromeStore(){this.wallet?.chrome_store&&this.openStore({href:this.wallet.chrome_store,type:"chrome_store"})}onAppStore(){this.wallet?.app_store&&this.openStore({href:this.wallet.app_store,type:"app_store"})}onPlayStore(){this.wallet?.play_store&&this.openStore({href:this.wallet.play_store,type:"play_store"})}onHomePage(){this.wallet?.homepage&&this.openStore({href:this.wallet.homepage,type:"homepage"})}};rz=function(e,t,r,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(n<3?i(a):n>3?i(t,r,a):i(t,r))||a);return n>3&&a&&Object.defineProperty(t,r,a),a}([(0,c.customElement)("w3m-downloads-view")],rz),e.s(["W3mDownloadsView",0,rz],108201),e.s([],719152),e.i(719152),e.i(612639),e.i(210149),e.i(108201),e.s(["W3mAllWalletsView",0,rU,"W3mConnectingWcBasicView",0,tW,"W3mDownloadsView",0,rz],533143)},738750,(e,t,r)=>{t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},87201,(e,t,r)=>{let o,i=[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];r.getSymbolSize=function(e){if(!e)throw Error('"version" cannot be null or undefined');if(e<1||e>40)throw Error('"version" should be in range from 1 to 40');return 4*e+17},r.getSymbolTotalCodewords=function(e){return i[e]},r.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},r.setToSJISFunction=function(e){if("function"!=typeof e)throw Error('"toSJISFunc" is not a valid function.');o=e},r.isKanjiModeEnabled=function(){return void 0!==o},r.toSJIS=function(e){return o(e)}},473133,(e,t,r)=>{r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2},r.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},r.from=function(e,t){if(r.isValid(e))return e;try{if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw Error("Unknown EC Level: "+e)}}catch(e){return t}}},173666,(e,t,r)=>{function o(){this.buffer=[],this.length=0}o.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=o},811421,(e,t,r)=>{function o(e){if(!e||e<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}o.prototype.set=function(e,t,r,o){let i=e*this.size+t;this.data[i]=r,o&&(this.reservedBit[i]=!0)},o.prototype.get=function(e,t){return this.data[e*this.size+t]},o.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},o.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=o},720637,(e,t,r)=>{let o=e.r(87201).getSymbolSize;r.getRowColCoords=function(e){if(1===e)return[];let t=Math.floor(e/7)+2,r=o(e),i=145===r?26:2*Math.ceil((r-13)/(2*t-2)),n=[r-7];for(let e=1;e<t-1;e++)n[e]=n[e-1]-i;return n.push(6),n.reverse()},r.getPositions=function(e){let t=[],o=r.getRowColCoords(e),i=o.length;for(let e=0;e<i;e++)for(let r=0;r<i;r++)(0!==e||0!==r)&&(0!==e||r!==i-1)&&(e!==i-1||0!==r)&&t.push([o[e],o[r]]);return t}},814002,(e,t,r)=>{let o=e.r(87201).getSymbolSize;r.getPositions=function(e){let t=o(e);return[[0,0],[t-7,0],[0,t-7]]}},237692,(e,t,r)=>{r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};r.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},r.from=function(e){return r.isValid(e)?parseInt(e,10):void 0},r.getPenaltyN1=function(e){let t=e.size,r=0,o=0,i=0,n=null,a=null;for(let s=0;s<t;s++){o=i=0,n=a=null;for(let l=0;l<t;l++){let t=e.get(s,l);t===n?o++:(o>=5&&(r+=3+(o-5)),n=t,o=1),(t=e.get(l,s))===a?i++:(i>=5&&(r+=3+(i-5)),a=t,i=1)}o>=5&&(r+=3+(o-5)),i>=5&&(r+=3+(i-5))}return r},r.getPenaltyN2=function(e){let t=e.size,r=0;for(let o=0;o<t-1;o++)for(let i=0;i<t-1;i++){let t=e.get(o,i)+e.get(o,i+1)+e.get(o+1,i)+e.get(o+1,i+1);(4===t||0===t)&&r++}return 3*r},r.getPenaltyN3=function(e){let t=e.size,r=0,o=0,i=0;for(let n=0;n<t;n++){o=i=0;for(let a=0;a<t;a++)o=o<<1&2047|e.get(n,a),a>=10&&(1488===o||93===o)&&r++,i=i<<1&2047|e.get(a,n),a>=10&&(1488===i||93===i)&&r++}return 40*r},r.getPenaltyN4=function(e){let t=0,r=e.data.length;for(let o=0;o<r;o++)t+=e.data[o];return 10*Math.abs(Math.ceil(100*t/r/5)-10)}
1570,r.applyMask=function(e,t){let o=t.size;for(let i=0;i<o;i++)for(let n=0;n<o;n++)t.isReserved(n,i)||t.xor(n,i,function(e,t,o){switch(e){case r.Patterns.PATTERN000:return(t+o)%2==0;case r.Patterns.PATTERN001:return t%2==0;case r.Patterns.PATTERN010:return o%3==0;case r.Patterns.PATTERN011:return(t+o)%3==0;case r.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(o/3))%2==0;case r.Patterns.PATTERN101:return t*o%2+t*o%3==0;case r.Patterns.PATTERN110:return(t*o%2+t*o%3)%2==0;case r.Patterns.PATTERN111:return(t*o%3+(t+o)%2)%2==0;default:throw Error("bad maskPattern:"+e)}}(e,n,i))},r.getBestMask=function(e,t){let o=Object.keys(r.Patterns).length,i=0,n=1/0;for(let a=0;a<o;a++){t(a),r.applyMask(a,e);let o=r.getPenaltyN1(e)+r.getPenaltyN2(e)+r.getPenaltyN3(e)+r.getPenaltyN4(e);r.applyMask(a,e),o<n&&(n=o,i=a)}return i}},848125,(e,t,r)=>{let o=e.r(473133),i=[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],n=[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];r.getBlocksCount=function(e,t){switch(t){case o.L:return i[(e-1)*4+0];case o.M:return i[(e-1)*4+1];case o.Q:return i[(e-1)*4+2];case o.H:return i[(e-1)*4+3];default:return}},r.getTotalCodewordsCount=function(e,t){switch(t){case o.L:return n[(e-1)*4+0];case o.M:return n[(e-1)*4+1];case o.Q:return n[(e-1)*4+2];case o.H:return n[(e-1)*4+3];default:return}}},654232,(e,t,r)=>{let o=new Uint8Array(512),i=new Uint8Array(256),n=1;for(let e=0;e<255;e++)o[e]=n,i[n]=e,256&(n<<=1)&&(n^=285);for(let e=255;e<512;e++)o[e]=o[e-255];r.log=function(e){if(e<1)throw Error("log("+e+")");return i[e]},r.exp=function(e){return o[e]},r.mul=function(e,t){return 0===e||0===t?0:o[i[e]+i[t]]}},950677,(e,t,r)=>{let o=e.r(654232);r.mul=function(e,t){let r=new Uint8Array(e.length+t.length-1);for(let i=0;i<e.length;i++)for(let n=0;n<t.length;n++)r[i+n]^=o.mul(e[i],t[n]);return r},r.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){let e=r[0];for(let i=0;i<t.length;i++)r[i]^=o.mul(t[i],e);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},r.generateECPolynomial=function(e){let t=new Uint8Array([1]);for(let i=0;i<e;i++)t=r.mul(t,new Uint8Array([1,o.exp(i)]));return t}},962458,(e,t,r)=>{let o=e.r(950677);function i(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(e){this.degree=e,this.genPoly=o.generateECPolynomial(this.degree)},i.prototype.encode=function(e){if(!this.genPoly)throw Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let r=o.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=i},67483,(e,t,r)=>{r.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},396592,(e,t,r)=>{let o="[0-9]+",i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",n="(?:(?![A-Z0-9 $%*+\\-./:]|"+(i=i.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";r.KANJI=RegExp(i,"g"),r.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=RegExp(n,"g"),r.NUMERIC=RegExp(o,"g"),r.ALPHANUMERIC=RegExp("[A-Z $%*+\\-./:]+","g");let a=RegExp("^"+i+"$"),s=RegExp("^"+o+"$"),l=RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(e){return a.test(e)},r.testNumeric=function(e){return s.test(e)},r.testAlphanumeric=function(e){return l.test(e)}},150882,(e,t,r)=>{let o=e.r(67483),i=e.r(396592);r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(e,t){if(!e.ccBits)throw Error("Invalid mode: "+e);if(!o.isValid(t))throw Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]}
vendor: 13,950 bytes, line 1570
1570,r.getBestModeForData=function(e){return i.testNumeric(e)?r.NUMERIC:i.testAlphanumeric(e)?r.ALPHANUMERIC:i.testKanji(e)?r.KANJI:r.BYTE},r.toString=function(e){if(e&&e.id)return e.id;throw Error("Invalid mode")},r.isValid=function(e){return e&&e.bit&&e.ccBits},r.from=function(e,t){if(r.isValid(e))return e;try{if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw Error("Unknown mode: "+e)}}catch(e){return t}}},93547,(e,t,r)=>{let o=e.r(87201),i=e.r(848125),n=e.r(473133),a=e.r(150882),s=e.r(67483),l=o.getBCHDigit(7973);function c(e,t){return a.getCharCountIndicator(e,t)+4}r.from=function(e,t){return s.isValid(e)?parseInt(e,10):t},r.getCapacity=function(e,t,r){if(!s.isValid(e))throw Error("Invalid QR Code version");void 0===r&&(r=a.BYTE);let n=(o.getSymbolTotalCodewords(e)-i.getTotalCodewordsCount(e,t))*8;if(r===a.MIXED)return n;let l=n-c(r,e);switch(r){case a.NUMERIC:return Math.floor(l/10*3);case a.ALPHANUMERIC:return Math.floor(l/11*2);case a.KANJI:return Math.floor(l/13);case a.BYTE:default:return Math.floor(l/8)}},r.getBestVersionForData=function(e,t){let o,i=n.from(t,n.M);if(Array.isArray(e)){if(e.length>1){for(let t=1;t<=40;t++)if(function(e,t){let r=0;return e.forEach(function(e){let o=c(e.mode,t);r+=o+e.getBitsLength()}),r}(e,t)<=r.getCapacity(t,i,a.MIXED))return t;return}if(0===e.length)return 1;o=e[0]}else o=e;return function(e,t,o){for(let i=1;i<=40;i++)if(t<=r.getCapacity(i,o,e))return i}(o.mode,o.getLength(),i)},r.getEncodedBits=function(e){if(!s.isValid(e)||e<7)throw Error("Invalid QR Code version");let t=e<<12;for(;o.getBCHDigit(t)-l>=0;)t^=7973<<o.getBCHDigit(t)-l;return e<<12|t}},857655,(e,t,r)=>{let o=e.r(87201),i=o.getBCHDigit(1335);r.getEncodedBits=function(e,t){let r=e.bit<<3|t,n=r<<10;for(;o.getBCHDigit(n)-i>=0;)n^=1335<<o.getBCHDigit(n)-i;return(r<<10|n)^21522}},494097,(e,t,r)=>{let o=e.r(150882);function i(e){this.mode=o.NUMERIC,this.data=e.toString()}i.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t,r;for(t=0;t+3<=this.data.length;t+=3)r=parseInt(this.data.substr(t,3),10),e.put(r,10);let o=this.data.length-t;o>0&&(r=parseInt(this.data.substr(t),10),e.put(r,3*o+1))},t.exports=i},112553,(e,t,r)=>{let o=e.r(150882),i=["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 n(e){this.mode=o.ALPHANUMERIC,this.data=e}n.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*i.indexOf(this.data[t]);r+=i.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(i.indexOf(this.data[t]),6)},t.exports=n},84770,(e,t,r)=>{"use strict";t.exports=function(e){for(var t=[],r=e.length,o=0;o<r;o++){var i=e.charCodeAt(o);if(i>=55296&&i<=56319&&r>o+1){var n=e.charCodeAt(o+1);n>=56320&&n<=57343&&(i=(i-55296)*1024+n-56320+65536,o+=1)}if(i<128){t.push(i);continue}if(i<2048){t.push(i>>6|192),t.push(63&i|128);continue}if(i<55296||i>=57344&&i<65536){t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128);continue}if(i>=65536&&i<=1114111){t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer}},882257,(e,t,r)=>{let o=e.r(84770),i=e.r(150882);function n(e){this.mode=i.BYTE,"string"==typeof e&&(e=o(e)),this.data=new Uint8Array(e)}n.getBitsLength=function(e){return 8*e},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},t.exports=n},422644,(e,t,r)=>{let o=e.r(150882),i=e.r(87201);function n(e){this.mode=o.KANJI,this.data=e}n.getBitsLength=function(e){return 13*e},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=i.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r=(r>>>8&255)*192+(255&r),e.put(r,13)}},t.exports=n},297930,(e,t,r)=>{let o=e.r(150882),i=e.r(494097),n=e.r(112553),a=e.r(882257),s=e.r(422644),l=e.r(396592),c=e.r(87201),d=e.r(245953);function u(e){return unescape(encodeURIComponent(e)).length}function h(e,t,r){let o,i=[];for(;null!==(o=e.exec(r));)i.push({data:o[0],index:o.index,mode:t,length:o[0].length});return i}function p(e){let t,r,i=h(l.NUMERIC,o.NUMERIC,e),n=h(l.ALPHANUMERIC,o.ALPHANUMERIC,e);return c.isKanjiModeEnabled()?(t=h(l.BYTE,o.BYTE,e),r=h(l.KANJI,o.KANJI,e)):(t=h(l.BYTE_KANJI,o.BYTE,e),r=[]),i.concat(n,t,r).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,t){switch(t){case o.NUMERIC:return i.getBitsLength(e);case o.ALPHANUMERIC:return n.getBitsLength(e);case o.KANJI:return s.getBitsLength(e);case o.BYTE:return a.getBitsLength(e)}}function g(e,t){let r,l=o.getBestModeForData(e);if((r=o.from(t,l))!==o.BYTE&&r.bit<l.bit)throw Error('"'+e+'" cannot be encoded with mode '+o.toString(r)+".\n Suggested mode is: "+o.toString(l));switch(r===o.KANJI&&!c.isKanjiModeEnabled()&&(r=o.BYTE),r){case o.NUMERIC:return new i(e);case o.ALPHANUMERIC:return new n(e);case o.KANJI:return new s(e);case o.BYTE:return new a(e)}}r.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},r.fromString=function(e,t){let i=function(e,t){let r={},i={start:{}},n=["start"];for(let a=0;a<e.length;a++){let s=e[a],l=[];for(let e=0;e<s.length;e++){let c=s[e],d=""+a+e;l.push(d),r[d]={node:c,lastCount:0},i[d]={};for(let e=0;e<n.length;e++){let a=n[e];r[a]&&r[a].node.mode===c.mode?(i[a][d]=f(r[a].lastCount+c.length,c.mode)-f(r[a].lastCount,c.mode),r[a].lastCount+=c.length):(r[a]&&(r[a].lastCount=c.length),i[a][d]=f(c.length,c.mode)+4+o.getCharCountIndicator(c.mode,t))}}n=l}for(let e=0;e<n.length;e++)i[n[e]].end=0;return{map:i,table:r}}(function(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case o.NUMERIC:t.push([i,{data:i.data,mode:o.ALPHANUMERIC,length:i.length},{data:i.data,mode:o.BYTE,length:i.length}]);break;case o.ALPHANUMERIC:t.push([i,{data:i.data,mode:o.BYTE,length:i.length}]);break;case o.KANJI:t.push([i,{data:i.data,mode:o.BYTE,length:u(i.data)}]);break;case o.BYTE:t.push([{data:i.data,mode:o.BYTE,length:u(i.data)}])}}return t}(p(e,c.isKanjiModeEnabled())),t),n=d.find_path(i.map,"start","end"),a=[];for(let e=1;e<n.length-1;e++)a.push(i.table[n[e]].node);return r.fromArray(a.reduce(function(e,t){let r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?e[e.length-1].data+=t.data:e.push(t),e},[]))},r.rawSplit=function(e){return r.fromArray(p(e,c.isKanjiModeEnabled()))}},30671,(e,t,r)=>{let o=e.r(87201),i=e.r(473133),n=e.r(173666),a=e.r(811421),s=e.r(720637),l=e.r(814002),c=e.r(237692),d=e.r(848125),u=e.r(962458),h=e.r(93547),p=e.r(857655),f=e.r(150882),g=e.r(297930);function m(e,t,r){let o,i,n=e.size,a=p.getEncodedBits(t,r);for(o=0;o<15;o++)i=(a>>o&1)==1,o<6?e.set(o,8,i,!0):o<8?e.set(o+1,8,i,!0):e.set(n-15+o,8,i,!0),o<8?e.set(8,n-o-1,i,!0):o<9?e.set(8,15-o-1+1,i,!0):e.set(8,15-o-1,i,!0);e.set(n-8,8,1,!0)}r.create=function(e,t){let r,p;if(void 0===e||""===e)throw Error("No input text");let w=i.M;return void 0!==t&&(w=i.from(t.errorCorrectionLevel,i.M),r=h.from(t.version),p=c.from(t.maskPattern),t.toSJISFunc&&o.setToSJISFunction(t.toSJISFunc)),function(e,t,r,i){let p;if(Array.isArray(e))p=g.fromArray(e);else if("string"==typeof e){let o=t;if(!o){let t=g.rawSplit(e);o=h.getBestVersionForData(t,r)}p=g.fromString(e,o||40)}else throw Error("Invalid data");let w=h.getBestVersionForData(p,r);if(!w)throw Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<w)throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+w+".\n")}else t=w;let b=function(e,t,r){let i=new n;r.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(i)});let a=(o.getSymbolTotalCodewords(e)-d.getTotalCodewordsCount(e,t))*8;for(i.getLengthInBits()+4<=a&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);let s=(a-i.getLengthInBits())/8;for(let e=0;e<s;e++)i.put(e%2?17:236,8);return function(e,t,r){let i,n,a=o.getSymbolTotalCodewords(t),s=a-d.getTotalCodewordsCount(t,r),l=d.getBlocksCount(t,r),c=a%l,h=l-c,p=Math.floor(a/l),f=Math.floor(s/l),g=f+1,m=p-f,w=new u(m),b=0,y=Array(l),v=Array(l),C=0,x=new Uint8Array(e.buffer);for(let e=0;e<l;e++){let t=e<h?f:g;y[e]=x.slice(b,b+t),v[e]=w.encode(y[e]),b+=t,C=Math.max(C,t)}let $=new Uint8Array(a),E=0;for(i=0;i<C;i++)for(n=0;n<l;n++)i<y[n].length&&($[E++]=y[n][i]);for(i=0;i<m;i++)for(n=0;n<l;n++)$[E++]=v[n][i];return $}(i,e,t)}(t,r,p),y=new a(o.getSymbolSize(t));!function(e,t){let r=e.size,o=l.getPositions(t);for(let t=0;t<o.length;t++){let i=o[t][0],n=o[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1)&&!(r<=i+t))for(let o=-1;o<=7;o++)n+o<=-1||r<=n+o||(t>=0&&t<=6&&(0===o||6===o)||o>=0&&o<=6&&(0===t||6===t)||t>=2&&t<=4&&o>=2&&o<=4?e.set(i+t,n+o,!0,!0):e.set(i+t,n+o,!1,!0))}}(y,t);let v=y.size;for(let e=8;e<v-8;e++){let t=e%2==0;y.set(e,6,t,!0),y.set(6,e,t,!0)}return!function(e,t){let r=s.getPositions(t);for(let t=0;t<r.length;t++){let o=r[t][0],i=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(o+t,i+r,!0,!0):e.set(o+t,i+r,!1,!0)}}(y,t),m(y,r,0),t>=7&&function(e,t){let r,o,i,n=e.size,a=h.getEncodedBits(t);for(let t=0;t<18;t++)r=Math.floor(t/3),o=t%3+n-8-3,i=(a>>t&1)==1,e.set(r,o,i,!0),e.set(o,r,i,!0)}(y,t),!function(e,t){let r=e.size,o=-1,i=r-1,n=7,a=0;for(let s=r-1;s>0;s-=2)for(6===s&&s--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,s-r)){let o=!1;a<t.length&&(o=(t[a]>>>n&1)==1),e.set(i,s-r,o),-1==--n&&(a++,n=7)}if((i+=o)<0||r<=i){i-=o,o=-o;break}}}(y,b),isNaN(i)&&(i=c.getBestMask(y,m.bind(null,y,r))),c.applyMask(i,y),m(y,r,i),{modules:y,version:t,errorCorrectionLevel:r,maskPattern:i,segments:p}}(e,r,w,p)}},125950,(e,t,r)=>{function o(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw Error("Invalid hex color: "+e);(3===t.length||4===t.length)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");let r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}r.getOptions=function(e){e||(e={}),e.color||(e.color={});let t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:t,color:{dark:o(e.color.dark||"#000000ff"),light:o(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},r.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},r.getImageWidth=function(e,t){let o=r.getScale(e,t);return Math.floor((e+2*t.margin)*o)},r.qrToImageData=function(e,t,o){let i=t.modules.size,n=t.modules.data,a=r.getScale(i,o),s=Math.floor((i+2*o.margin)*a),l=o.margin*a,c=[o.color.light,o.color.dark];for(let t=0;t<s;t++)for(let r=0;r<s;r++){let d=(t*s+r)*4,u=o.color.light;t>=l&&r>=l&&t<s-l&&r<s-l&&(u=c[+!!n[Math.floor((t-l)/a)*i+Math.floor((r-l)/a)]]),e[d++]=u.r,e[d++]=u.g,e[d++]=u.b,e[d]=u.a}}},563037,(e,t,r)=>{let o=e.r(125950);r.render=function(e,t,r){var i;let n=r,a=t;void 0!==n||t&&t.getContext||(n=t,t=void 0),t||(a=function(){try{return document.createElement("canvas")}catch(e){throw Error("You need to specify a canvas element")}}()),n=o.getOptions(n);let s=o.getImageWidth(e.modules.size,n),l=a.getContext("2d"),c=l.createImageData(s,s);return o.qrToImageData(c.data,e,n),i=a,l.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=s,i.width=s,i.style.height=s+"px",i.style.width=s+"px",l.putImageData(c,0,0),a},r.renderToDataURL=function(e,t,o){let i=o;void 0!==i||t&&t.getContext||(i=t,t=void 0),i||(i={});let n=r.render(e,t,i),a=i.type||"image/png",s=i.rendererOpts||{};return n.toDataURL(a,s.quality)}},310891,(e,t,r)=>{let o=e.r(125950);function i(e,t){let r=e.a/255,o=t+'="'+e.hex+'"';return r<1?o+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':o}function n(e,t,r){let o=e+t;return void 0!==r&&(o+=" "+r),o}r.render=function(e,t,r){let a=o.getOptions(t),s=e.modules.size,l=e.modules.data,c=s+2*a.margin,d=a.color.light.a?"<path "+i(a.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",u="<path "+i(a.color.dark,"stroke")+' d="'+function(e,t,r){let o="",i=0,a=!1,s=0;for(let l=0;l<e.length;l++){let c=Math.floor(l%t),d=Math.floor(l/t);c||a||(a=!0),e[l]?(s++,l>0&&c>0&&e[l-1]||(o+=a?n("M",c+r,.5+d+r):n("m",i,0),i=0,a=!1),c+1<t&&e[l+1]||(o+=n("h",s),s=0)):i++}return o}(l,s,a.margin)+'"/>',h='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+('viewBox="0 0 '+c+" ")+c+'" shape-rendering="crispEdges">'+d+u+"</svg>\n";return"function"==typeof r&&r(null,h),h}},973134,(e,t,r)=>{let o=e.r(738750),i=e.r(30671),n=e.r(563037),a=e.r(310891);function s(e,t,r,n,a){let s=[].slice.call(arguments,1),l=s.length,c="function"==typeof s[l-1];if(!c&&!o())throw Error("Callback required as last argument");
1570if(c){if(l<2)throw Error("Too few arguments provided");2===l?(a=r,r=t,t=n=void 0):3===l&&(t.getContext&&void 0===a?(a=n,n=void 0):(a=n,n=r,r=t,t=void 0))}else{if(l<1)throw Error("Too few arguments provided");return 1===l?(r=t,t=n=void 0):2!==l||t.getContext||(n=r,r=t,t=void 0),new Promise(function(o,a){try{let a=i.create(r,n);o(e(a,t,n))}catch(e){a(e)}})}try{let o=i.create(r,n);a(null,e(o,t,n))}catch(e){a(e)}}r.create=i.create,r.toCanvas=s.bind(null,n.render),r.toDataURL=s.bind(null,n.renderToDataURL),r.toString=s.bind(null,function(e,t,r){return a.render(e,r)})}]); 1571 1572//# debugId=0966a845-a6be-450f-61d1-c3848d50e392
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.