PageSourceSearch

https://agentspeech.ai/_next/static/chunks/3722.84007df963aa4507.js

js agentspeech.ai collected 2026-10-05 12:35:03 UTC 169,552 bytes, 2,416 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cf872f01-0b06-4fb5-82c7-bdbad3a79a78",e._sentryDebugIdIdentifier="sentry-dbid-cf872f01-0b06-4fb5-82c7-bdbad3a79a78")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3722],{63722:(e,t,i)=>{i.r(t),i.d(t,{AppKitModal:()=>io,W3mListWallet:()=>ip,W3mModal:()=>ir,W3mModalBase:()=>ia,W3mRouterContainer:()=>iw,W3mUsageExceededView:()=>ic});var a=i(83138),r=i(94738),o=i(78964),n=i(67074),s=i(76595),c=i(61329),l=i(10899),u=i(72880),d=i(67869),p=i(27798),h=i(67243);let m={isUnsupportedChainView:()=>"UnsupportedChain"===d.I.state.view||"SwitchNetwork"===d.I.state.view&&d.I.state.history.includes("UnsupportedChain"),async safeClose(){if(this.isUnsupportedChainView()||await h.U.isSIWXCloseDisabled())return void s.W.shake();("DataCapture"===d.I.state.view||"DataCaptureOtpConfirm"===d.I.state.view)&&p.x.disconnect(),s.W.close()}};var w=i(45069),g=i(65374),y=i(12661),f=i(98866),b=i(12182),v=i(45553),k=i(73537),x=i(30982),T=i(71305),A=i(22378),S=i(12319),I=i(83941);let E={getGasPriceInEther:(e,t)=>Number(t*e)/1e18,getGasPriceInUSD(e,t,i){let a=E.getGasPriceInEther(t,i);return b.S.bigNumber(e).times(a).toNumber()},getPriceImpact({sourceTokenAmount:e,sourceTokenPriceInUSD:t,toTokenPriceInUSD:i,toTokenAmount:a}){let r=b.S.bigNumber(e).times(t),o=b.S.bigNumber(a).times(i);return r.minus(o).div(r).times(100).toNumber()},getMaxSlippage(e,t){let i=b.S.bigNumber(e).div(100);return b.S.multiply(t,i).toNumber()},getProviderFee:(e,t=.0085)=>b.S.bigNumber(e).times(t).toString(),isInsufficientNetworkTokenForGas:(e,t)=>!!b.S.bigNumber(e).eq(0)||b.S.bigNumber(b.S.bigNumber(t||"0")).gt(e),isInsufficientSourceTokenForSwap(e,t,i){let a=i?.find(e=>e.address===t)?.quantity?.numeric;return b.S.bigNumber(a||"0").lt(e)}};var P=i(36964),C=i(52502),$=i(44826),N=i(70417);let R={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,switchingTokens:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:A.oU.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},O=(0,y.BX)({...R}),q={state:O,subscribe:e=>(0,y.B1)(O,()=>e(O)),subscribeKey:(e,t)=>(0,f.u$)(O,e,t),getParams(){let e=c.W.state.activeChain,t=c.W.getAccountData(e)?.caipAddress??c.W.state.activeCaipAddress,i=S.w.getPlainAddress(t),a=(0,T.K1)(),r=l.a.getConnectorId(c.W.state.activeChain);if(!i)throw Error("No address found to swap the tokens from.");let o=!O.toToken?.address||!O.toToken?.decimals,n=!O.sourceToken?.address||!O.sourceToken?.decimals||!b.S.bigNumber(O.sourceTokenAmount).gt(0),s=!O.sourceTokenAmount;return{networkAddress:a,fromAddress:i,fromCaipAddress:t,sourceTokenAddress:O.sourceToken?.address,toTokenAddress:O.toToken?.address,toTokenAmount:O.toTokenAmount,toTokenDecimals:O.toToken?.decimals,sourceTokenAmount:O.sourceTokenAmount,sourceTokenDecimals:O.sourceToken?.decimals,invalidToToken:o,invalidSourceToken:n,invalidSourceTokenAmount:s,availableToSwap:t&&!o&&!n&&!s,isAuthConnector:r===v.o.CONNECTOR_ID.AUTH}},async setSourceToken(e){if(!e){O.sourceToken=e,O.sourceTokenAmount="",O.sourceTokenPriceInUSD=0;return}O.sourceToken=e,await W.setTokenPrice(e.address,"sourceToken")},setSourceTokenAmount(e){O.sourceTokenAmount=e},async setToToken(e){if(!e){O.toToken=e,O.toTokenAmount="",O.toTokenPriceInUSD=0;return}O.toToken=e,await W.setTokenPrice(e.address,"toToken")},setToTokenAmount(e){O.toTokenAmount=e?b.S.toFixed(e,6):""},async setTokenPrice(e,t){let i=O.tokensPriceMap[e]||0;i||(O.loadingPrices=!0,i=await W.getAddressPrice(e)),"sourceToken"===t?O.sourceTokenPriceInUSD=i:"toToken"===t&&(O.toTokenPriceInUSD=i),O.loadingPrices&&(O.loadingPrices=!1),W.getParams().availableToSwap&&!O.switchingTokens&&W.swapTokens()},async switchTokens(){if(!O.initializing&&O.initialized&&!O.switchingTokens){O.switchingTokens=!0;try{let e=O.toToken?{...O.toToken}:void 0,t=O.sourceToken?{...O.sourceToken}:void 0,i=e&&""===O.toTokenAmount?"1":O.toTokenAmount;W.setSourceTokenAmount(i),W.setToTokenAmount(""),await W.setSourceToken(e),await W.setToToken(t),O.switchingTokens=!1,W.swapTokens()}catch(e){throw O.switchingTokens=!1,e}}},resetState(){O.myTokensWithBalance=R.myTokensWithBalance,O.tokensPriceMap=R.tokensPriceMap,O.initialized=R.initialized,O.initializing=R.initializing,O.switchingTokens=R.switchingTokens,O.sourceToken=R.sourceToken,O.sourceTokenAmount=R.sourceTokenAmount,O.sourceTokenPriceInUSD=R.sourceTokenPriceInUSD,O.toToken=R.toToken,O.toTokenAmount=R.toTokenAmount,O.toTokenPriceInUSD=R.toTokenPriceInUSD,O.networkPrice=R.networkPrice,O.networkTokenSymbol=R.networkTokenSymbol,O.networkBalanceInUSD=R.networkBalanceInUSD,O.inputError=R.inputError},resetValues(){let{networkAddress:e}=W.getParams(),t=O.tokens?.find(t=>t.address===e);W.setSourceToken(t),W.setToToken(void 0)},getApprovalLoadingState:()=>O.loadingApprovalTransaction,clearError(){O.transactionError=void 0},async initializeState(){if(!O.initializing){if(O.initializing=!0,!O.initialized)try{await W.fetchTokens(),O.initialized=!0}catch(e){O.initialized=!1,g.P.showError("Failed to initialize swap"),d.I.goBack()}O.initializing=!1}},async fetchTokens(){let{networkAddress:e}=W.getParams();await W.getNetworkTokenPrice(),await W.getMyTokensWithBalance();let t=O.myTokensWithBalance?.find(t=>t.address===e);t&&(O.networkTokenSymbol=t.symbol,W.setSourceToken(t),W.setSourceTokenAmount("0"))},async getTokenList(){let e=c.W.state.activeCaipNetwork?.caipNetworkId;if(O.caipNetworkId!==e||!O.tokens)try{O.tokensLoading=!0;let t=await I.s.getTokenList(e);O.tokens=t,O.caipNetworkId=e,O.popularTokens=t.sort((e,t)=>
1e.symbol<t.symbol?-1:+(e.symbol>t.symbol));let i=(e&&A.oU.SUGGESTED_TOKENS_BY_CHAIN?.[e]||[]).map(e=>t.find(t=>t.symbol===e)).filter(e=>!!e),a=(A.oU.SWAP_SUGGESTED_TOKENS||[]).map(e=>t.find(t=>t.symbol===e)).filter(e=>!!e).filter(e=>!i.some(t=>t.address===e.address));O.suggestedTokens=[...i,...a]}catch(e){O.tokens=[],O.popularTokens=[],O.suggestedTokens=[]}finally{O.tokensLoading=!1}},async getAddressPrice(e){let t=O.tokensPriceMap[e];if(t)return t;let i=await $.T.fetchTokenPrice({addresses:[e]}),a=i?.fungibles||[],r=[...O.tokens||[],...O.myTokensWithBalance||[]],o=r?.find(t=>t.address===e)?.symbol,n=parseFloat((a.find(e=>e.symbol.toLowerCase()===o?.toLowerCase())?.price||0).toString());return O.tokensPriceMap[e]=n,n},async getNetworkTokenPrice(){let{networkAddress:e}=W.getParams(),t=await $.T.fetchTokenPrice({addresses:[e]}).catch(()=>(g.P.showError("Failed to fetch network token price"),{fungibles:[]})),i=t.fungibles?.[0],a=i?.price.toString()||"0";O.tokensPriceMap[e]=parseFloat(a),O.networkTokenSymbol=i?.symbol||"",O.networkPrice=a},async getMyTokensWithBalance(e){let t=await x.Z.getMyTokensWithBalance({forceUpdate:e,caipNetwork:c.W.state.activeCaipNetwork,address:c.W.getAccountData()?.address}),i=I.s.mapBalancesToSwapTokens(t);i&&(await W.getInitialGasPrice(),W.setBalances(i))},setBalances(e){let{networkAddress:t}=W.getParams(),i=c.W.state.activeCaipNetwork;if(!i)return;let a=e.find(e=>e.address===t);e.forEach(e=>{O.tokensPriceMap[e.address]=e.price||0}),O.myTokensWithBalance=e.filter(e=>e.address.startsWith(i.caipNetworkId)),O.networkBalanceInUSD=a?b.S.multiply(a.quantity.numeric,a.price).toString():"0"},async getInitialGasPrice(){let e=await I.s.fetchGasPrice();if(!e)return{gasPrice:null,gasPriceInUSD:null};switch(c.W.state?.activeCaipNetwork?.chainNamespace){case v.o.CHAIN.SOLANA:return O.gasFee=e.standard??"0",O.gasPriceInUSD=b.S.multiply(e.standard,O.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(O.gasFee),gasPriceInUSD:Number(O.gasPriceInUSD)};case v.o.CHAIN.EVM:default:let t=e.standard??"0",i=BigInt(t),a=BigInt(15e4),r=E.getGasPriceInUSD(O.networkPrice,a,i);return O.gasFee=t,O.gasPriceInUSD=r,{gasPrice:i,gasPriceInUSD:r}}},async swapTokens(){let e=c.W.getAccountData()?.address,t=O.sourceToken,i=O.toToken,a=b.S.bigNumber(O.sourceTokenAmount).gt(0);if(a||W.setToTokenAmount(""),!i||!t||O.loadingPrices||!a||!e)return;O.loadingQuote=!0;let r=b.S.bigNumber(O.sourceTokenAmount).times(10**t.decimals).round(0).toFixed(0);try{let a=await $.T.fetchSwapQuote({userAddress:e,from:t.address,to:i.address,gasPrice:O.gasFee,amount:r.toString()});O.loadingQuote=!1;let o=a?.quotes?.[0]?.toAmount;if(!o)return void C.h.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");let n=b.S.bigNumber(o).div(10**i.decimals).toString();W.setToTokenAmount(n),W.hasInsufficientToken(O.sourceTokenAmount,t.address)?O.inputError="Insufficient balance":(O.inputError=void 0,W.setTransactionDetails())}catch(t){let e=await I.s.handleSwapError(t);O.loadingQuote=!1,O.inputError=e||"Insufficient balance"}},async getTransaction(){let{fromCaipAddress:e,availableToSwap:t}=W.getParams(),i=O.sourceToken,a=O.toToken;if(e&&t&&i&&a&&!O.loadingQuote)try{let t;return O.loadingBuildTransaction=!0,t=await I.s.fetchSwapAllowance({userAddress:e,tokenAddress:i.address,sourceTokenAmount:O.sourceTokenAmount,sourceTokenDecimals:i.decimals})?await W.createSwapTransaction():await W.createAllowanceTransaction(),O.loadingBuildTransaction=!1,O.fetchError=!1,t}catch(e){d.I.goBack(),g.P.showError("Failed to check allowance"),O.loadingBuildTransaction=!1,O.approvalTransaction=void 0,O.swapTransaction=void 0,O.fetchError=!0;return}},async createAllowanceTransaction(){let{fromCaipAddress:e,sourceTokenAddress:t,toTokenAddress:i}=W.getParams();if(e&&i){if(!t)throw Error("createAllowanceTransaction - No source token address found.");try{let a=await $.T.generateApproveCalldata({from:t,to:i,userAddress:e}),r=S.w.getPlainAddress(a.tx.from);if(!r)throw Error("SwapController:createAllowanceTransaction - address is required");
1let o={data:a.tx.data,to:r,gasPrice:BigInt(a.tx.eip155.gasPrice),value:BigInt(a.tx.value),toAmount:O.toTokenAmount};return O.swapTransaction=void 0,O.approvalTransaction={data:o.data,to:o.to,gasPrice:o.gasPrice,value:o.value,toAmount:o.toAmount},{data:o.data,to:o.to,gasPrice:o.gasPrice,value:o.value,toAmount:o.toAmount}}catch(e){d.I.goBack(),g.P.showError("Failed to create approval transaction"),O.approvalTransaction=void 0,O.swapTransaction=void 0,O.fetchError=!0;return}}},async createSwapTransaction(){let{networkAddress:e,fromCaipAddress:t,sourceTokenAmount:i}=W.getParams(),a=O.sourceToken,r=O.toToken;if(!t||!i||!a||!r)return;let o=p.x.parseUnits(i,a.decimals)?.toString();try{let i=await $.T.generateSwapCalldata({userAddress:t,from:a.address,to:r.address,amount:o,disableEstimate:!0}),n=a.address===e,s=BigInt(i.tx.eip155.gas),c=BigInt(i.tx.eip155.gasPrice),l=S.w.getPlainAddress(i.tx.to);if(!l)throw Error("SwapController:createSwapTransaction - address is required");let u={data:i.tx.data,to:l,gas:s,gasPrice:c,value:n?BigInt(o??"0"):BigInt("0"),toAmount:O.toTokenAmount};return O.gasPriceInUSD=E.getGasPriceInUSD(O.networkPrice,s,c),O.approvalTransaction=void 0,O.swapTransaction=u,u}catch(e){d.I.goBack(),g.P.showError("Failed to create transaction"),O.approvalTransaction=void 0,O.swapTransaction=void 0,O.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){g.P.showLoading("Approve limit increase in your wallet"),d.I.replace("SwapPreview")},async sendTransactionForApproval(e){let{fromAddress:t,isAuthConnector:i}=W.getParams();O.loadingApprovalTransaction=!0,i?d.I.pushTransactionStack({onSuccess:W.onEmbeddedWalletApprovalSuccess}):g.P.showLoading("Approve limit increase in your wallet");try{await p.x.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:v.o.CHAIN.EVM}),await W.swapTokens(),await W.getTransaction(),O.approvalTransaction=void 0,O.loadingApprovalTransaction=!1}catch(e){O.transactionError=e?.displayMessage,O.loadingApprovalTransaction=!1,g.P.showError(e?.displayMessage||"Transaction error"),N.E.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:e?.displayMessage||e?.message||"Unknown",network:c.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:W.state.sourceToken?.symbol||"",swapToToken:W.state.toToken?.symbol||"",swapFromAmount:W.state.sourceTokenAmount||"",swapToAmount:W.state.toTokenAmount||"",isSmartAccount:(0,T.lj)(v.o.CHAIN.EVM)===k.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(e){if(!e)return;let{fromAddress:t,toTokenAmount:i,isAuthConnector:a}=W.getParams();O.loadingTransaction=!0;let r=`Swapping ${O.sourceToken?.symbol} to ${b.S.formatNumberToLocalString(i,3)} ${O.toToken?.symbol}`,o=`Swapped ${O.sourceToken?.symbol} to ${b.S.formatNumberToLocalString(i,3)} ${O.toToken?.symbol}`;a?d.I.pushTransactionStack({onSuccess(){d.I.replace("Account"),g.P.showLoading(r),q.resetState()}}):g.P.showLoading("Confirm transaction in your wallet");try{let i=[O.sourceToken?.address,O.toToken?.address].join(","),r=await p.x.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:v.o.CHAIN.EVM});return O.loadingTransaction=!1,g.P.showSuccess(o),N.E.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:c.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:W.state.sourceToken?.symbol||"",swapToToken:W.state.toToken?.symbol||"",swapFromAmount:W.state.sourceTokenAmount||"",swapToAmount:W.state.toTokenAmount||"",isSmartAccount:(0,T.lj)(v.o.CHAIN.EVM)===k.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),q.resetState(),a||d.I.replace("Account"),q.getMyTokensWithBalance(i),r}catch(e){O.transactionError=e?.displayMessage,O.loadingTransaction=!1,g.P.showError(e?.displayMessage||"Transaction error"),N.E.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:e?.displayMessage||e?.message||"Unknown",network:c.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:W.state.sourceToken?.symbol||"",swapToToken:W.state.toToken?.symbol||"",swapFromAmount:W.state.sourceTokenAmount||"",swapToAmount:W.state.toTokenAmount||"",isSmartAccount:(0,T.lj)(v.o.CHAIN.EVM)===k.
1Vl.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken:(e,t)=>E.isInsufficientSourceTokenForSwap(e,t,O.myTokensWithBalance),setTransactionDetails(){let{toTokenAddress:e,toTokenDecimals:t}=W.getParams();e&&t&&(O.gasPriceInUSD=E.getGasPriceInUSD(O.networkPrice,BigInt(O.gasFee),BigInt(15e4)),O.priceImpact=E.getPriceImpact({sourceTokenAmount:O.sourceTokenAmount,sourceTokenPriceInUSD:O.sourceTokenPriceInUSD,toTokenPriceInUSD:O.toTokenPriceInUSD,toTokenAmount:O.toTokenAmount}),O.maxSlippage=E.getMaxSlippage(O.slippage,O.toTokenAmount),O.providerFee=E.getProviderFee(O.sourceTokenAmount))}},W=(0,P.X)(q);var _=i(94545),U=i(71084),D=i(47327),M=i(20296);let L=(0,M.AH)`
2  :host {
3    display: block;
4    border-radius: clamp(0px, ${({borderRadius:e})=>e["8"]}, 44px);
5    box-shadow: 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary};
6    overflow: hidden;
7  }
8`,F=class extends a.WF{render(){return(0,a.qy)`<slot></slot>`}};F.styles=[U.W5,L],F=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n}([(0,D.E)("wui-card")],F),i(40575),i(71699),i(24772),i(38534);let z=(0,M.AH)`
9  :host {
10    width: 100%;
11  }
12
13  :host > wui-flex {
14    width: 100%;
15    display: flex;
16    align-items: center;
17    justify-content: center;
18    gap: ${({spacing:e})=>e[2]};
19    padding: ${({spacing:e})=>e[3]};
20    border-radius: ${({borderRadius:e})=>e[6]};
21    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
22    box-sizing: border-box;
23    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
24    box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
25    color: ${({tokens:e})=>e.theme.textPrimary};
26  }
27
28  :host > wui-flex[data-type='info'] {
29    .icon-box {
30      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
31
32      wui-icon {
33        color: ${({tokens:e})=>e.theme.iconDefault};
34      }
35    }
36  }
37  :host > wui-flex[data-type='success'] {
38    .icon-box {
39      background-color: ${({tokens:e})=>e.core.backgroundSuccess};
40
41      wui-icon {
42        color: ${({tokens:e})=>e.core.borderSuccess};
43      }
44    }
45  }
46  :host > wui-flex[data-type='warning'] {
47    .icon-box {
48      background-color: ${({tokens:e})=>e.core.backgroundWarning};
49
50      wui-icon {
51        color: ${({tokens:e})=>e.core.borderWarning};
52      }
53    }
54  }
55  :host > wui-flex[data-type='error'] {
56    .icon-box {
57      background-color: ${({tokens:e})=>e.core.backgroundError};
58
59      wui-icon {
60        color: ${({tokens:e})=>e.core.borderError};
61      }
62    }
63  }
64
65  wui-flex {
66    width: 100%;
67  }
68
69  wui-text {
70    word-break: break-word;
71    flex: 1;
72  }
73
74  .close {
75    cursor: pointer;
76    color: ${({tokens:e})=>e.theme.iconDefault};
77  }
78
79  .icon-box {
80    height: 40px;
81    width: 40px;
82    border-radius: ${({borderRadius:e})=>e["2"]};
83    background-color: var(--local-icon-bg-value);
84  }
85`;var B=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let j={info:"info",success:"checkmark",warning:"warningCircle",error:"warning"},H=class extends a.WF{constructor(){super(...arguments),this.message="",this.type="info"}render(){return(0,a.qy)`
86      <wui-flex
87        data-type=${(0,o.J)(this.type)}
88        flexDirection="row"
89        justifyContent="space-between"
90        alignItems="center"
91        gap="2"
92      >
93        <wui-flex columnGap="2" flexDirection="row" alignItems="center">
94          <wui-flex
95            flexDirection="row"
96            alignItems="center"
97            justifyContent="center"
98            class="icon-box"
99          >
100            <wui-icon color="inherit" size="md" name=${j[this.type]}></wui-icon>
101          </wui-flex>
102          <wui-text variant="md-medium" color="inherit" data-testid="wui-alertbar-text"
103            >${this.message}</wui-text
104          >
105        </wui-flex>
106        <wui-icon
107          class="close"
108          color="inherit"
109          size="sm"
110          name="close"
111          @click=${this.onClose}
112        ></wui-icon>
113      </wui-flex>
114    `}onClose(){C.h.close()}};H.styles=[U.W5,z],B([(0,r.MZ)()],H.prototype,"message",void 0),B([(0,r.MZ)()],H.prototype,"type",void 0),H=B([(0,D.E)("wui-alertbar")],H);let V=(0,_.AH)`
115  :host {
116    display: block;
117    position: absolute;
118    top: ${({spacing:e})=>e["3"]};
119    left: ${({spacing:e})=>e["4"]};
120    right: ${({spacing:e})=>e["4"]};
121    opacity: 0;
122    pointer-events: none;
123  }
124`;var G=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let Z={info:{backgroundColor:"fg-350",iconColor:"fg-325",icon:"info"},success:{backgroundColor:"success-glass-reown-020",iconColor:"success-125",icon:"checkmark"},warning:{backgroundColor:"warning-glass-reown-020",iconColor:"warning-100",icon:"warningCircle"},error:{backgroundColor:"error-glass-reown-020",iconColor:"error-125",icon:"warning"}},Y=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.open=C.h.state.open,this.onOpen(!0),this.unsubscribe.push(C.h.subscribeKey("open",e=>{this.open=e,this.onOpen(!1)}))}
124disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{message:e,variant:t}=C.h.state,i=Z[t];return(0,a.qy)`
125      <wui-alertbar
126        message=${e}
127        backgroundColor=${i?.backgroundColor}
128        iconColor=${i?.iconColor}
129        icon=${i?.icon}
130        type=${t}
131      ></wui-alertbar>
132    `}onOpen(e){this.open?(this.animate([{opacity:0,transform:"scale(0.85)"},{opacity:1,transform:"scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: auto"):e||(this.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: none")}};Y.styles=V,G([(0,r.wk)()],Y.prototype,"open",void 0),Y=G([(0,_.EM)("w3m-alertbar")],Y);var K=i(14744),Q=i(29936);let J=(0,M.AH)`
133  :host {
134    position: relative;
135  }
136
137  button {
138    display: flex;
139    justify-content: center;
140    align-items: center;
141    background-color: transparent;
142    padding: ${({spacing:e})=>e[1]};
143  }
144
145  /* -- Colors --------------------------------------------------- */
146  button[data-type='accent'] wui-icon {
147    color: ${({tokens:e})=>e.core.iconAccentPrimary};
148  }
149
150  button[data-type='neutral'][data-variant='primary'] wui-icon {
151    color: ${({tokens:e})=>e.theme.iconInverse};
152  }
153
154  button[data-type='neutral'][data-variant='secondary'] wui-icon {
155    color: ${({tokens:e})=>e.theme.iconDefault};
156  }
157
158  button[data-type='success'] wui-icon {
159    color: ${({tokens:e})=>e.core.iconSuccess};
160  }
161
162  button[data-type='error'] wui-icon {
163    color: ${({tokens:e})=>e.core.iconError};
164  }
165
166  /* -- Sizes --------------------------------------------------- */
167  button[data-size='xs'] {
168    width: 16px;
169    height: 16px;
170
171    border-radius: ${({borderRadius:e})=>e[1]};
172  }
173
174  button[data-size='sm'] {
175    width: 20px;
176    height: 20px;
177    border-radius: ${({borderRadius:e})=>e[1]};
178  }
179
180  button[data-size='md'] {
181    width: 24px;
182    height: 24px;
183    border-radius: ${({borderRadius:e})=>e[2]};
184  }
185
186  button[data-size='lg'] {
187    width: 28px;
188    height: 28px;
189    border-radius: ${({borderRadius:e})=>e[2]};
190  }
191
192  button[data-size='xs'] wui-icon {
193    width: 8px;
194    height: 8px;
195  }
196
197  button[data-size='sm'] wui-icon {
198    width: 12px;
199    height: 12px;
200  }
201
202  button[data-size='md'] wui-icon {
203    width: 16px;
204    height: 16px;
205  }
206
207  button[data-size='lg'] wui-icon {
208    width: 20px;
209    height: 20px;
210  }
211
212  /* -- Hover --------------------------------------------------- */
213  @media (hover: hover) {
214    button[data-type='accent']:hover:enabled {
215      background-color: ${({tokens:e})=>e.core.foregroundAccent010};
216    }
217
218    button[data-variant='primary'][data-type='neutral']:hover:enabled {
219      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
220    }
221
222    button[data-variant='secondary'][data-type='neutral']:hover:enabled {
223      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
224    }
225
226    button[data-type='success']:hover:enabled {
227      background-color: ${({tokens:e})=>e.core.backgroundSuccess};
228    }
229
230    button[data-type='error']:hover:enabled {
231      background-color: ${({tokens:e})=>e.core.backgroundError};
232    }
233  }
234
235  /* -- Focus --------------------------------------------------- */
236  button:focus-visible {
237    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
238  }
239
240  /* -- Properties --------------------------------------------------- */
241  button[data-full-width='true'] {
242    width: 100%;
243  }
244
245  :host([fullWidth]) {
246    width: 100%;
247  }
248
249  button[disabled] {
250    opacity: 0.5;
251    cursor: not-allowed;
252  }
253`;var X=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let ee=class extends a.WF{constructor(){super(...arguments),this.icon="card",this.variant="primary",this.type="accent",this.size="md",this.iconSize=void 0,this.fullWidth=!1,this.disabled=!1}render(){return(0,a.qy)`<button
254      data-variant=${this.variant}
255      data-type=${this.type}
256      data-size=${this.size}
257      data-full-width=${this.fullWidth}
258      ?disabled=${this.disabled}
259    >
260      <wui-icon color="inherit" name=${this.icon} size=${(0,o.J)(this.iconSize)}></wui-icon>
261    </button>`}}
261;ee.styles=[U.W5,U.fD,J],X([(0,r.MZ)()],ee.prototype,"icon",void 0),X([(0,r.MZ)()],ee.prototype,"variant",void 0),X([(0,r.MZ)()],ee.prototype,"type",void 0),X([(0,r.MZ)()],ee.prototype,"size",void 0),X([(0,r.MZ)()],ee.prototype,"iconSize",void 0),X([(0,r.MZ)({type:Boolean})],ee.prototype,"fullWidth",void 0),X([(0,r.MZ)({type:Boolean})],ee.prototype,"disabled",void 0),ee=X([(0,D.E)("wui-icon-button")],ee),i(45166);let et=(0,M.AH)`
262  button {
263    display: block;
264    display: flex;
265    align-items: center;
266    padding: ${({spacing:e})=>e[1]};
267    transition: background-color ${({durations:e})=>e.lg}
268      ${({easings:e})=>e["ease-out-power-2"]};
269    will-change: background-color;
270    border-radius: ${({borderRadius:e})=>e[32]};
271  }
272
273  wui-image {
274    border-radius: 100%;
275  }
276
277  wui-text {
278    padding-left: ${({spacing:e})=>e[1]};
279  }
280
281  .left-icon-container,
282  .right-icon-container {
283    width: 24px;
284    height: 24px;
285    justify-content: center;
286    align-items: center;
287  }
288
289  wui-icon {
290    color: ${({tokens:e})=>e.theme.iconDefault};
291  }
292
293  /* -- Sizes --------------------------------------------------- */
294  button[data-size='lg'] {
295    height: 32px;
296  }
297
298  button[data-size='md'] {
299    height: 28px;
300  }
301
302  button[data-size='sm'] {
303    height: 24px;
304  }
305
306  button[data-size='lg'] wui-image {
307    width: 24px;
308    height: 24px;
309  }
310
311  button[data-size='md'] wui-image {
312    width: 20px;
313    height: 20px;
314  }
315
316  button[data-size='sm'] wui-image {
317    width: 16px;
318    height: 16px;
319  }
320
321  button[data-size='lg'] .left-icon-container {
322    width: 24px;
323    height: 24px;
324  }
325
326  button[data-size='md'] .left-icon-container {
327    width: 20px;
328    height: 20px;
329  }
330
331  button[data-size='sm'] .left-icon-container {
332    width: 16px;
333    height: 16px;
334  }
335
336  /* -- Variants --------------------------------------------------------- */
337  button[data-type='filled-dropdown'] {
338    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
339  }
340
341  button[data-type='text-dropdown'] {
342    background-color: transparent;
343  }
344
345  /* -- Focus states --------------------------------------------------- */
346  button:focus-visible:enabled {
347    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
348    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
349  }
350
351  /* -- Hover & Active states ----------------------------------------------------------- */
352  @media (hover: hover) and (pointer: fine) {
353    button:hover:enabled,
354    button:active:enabled {
355      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
356    }
357  }
358
359  /* -- Disabled states --------------------------------------------------- */
360  button:disabled {
361    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
362    opacity: 0.5;
363  }
364`;var ei=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let ea={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},er={lg:"lg",md:"md",sm:"sm"},eo=class extends a.WF{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size="lg",this.type="text-dropdown",this.disabled=!1}render(){return(0,a.qy)`<button ?disabled=${this.disabled} data-size=${this.size} data-type=${this.type}>
365      ${this.imageTemplate()} ${this.textTemplate()}
366      <wui-flex class="right-icon-container">
367        <wui-icon name="chevronBottom"></wui-icon>
368      </wui-flex>
369    </button>`}textTemplate(){let e=ea[this.size];return this.text?(0,a.qy)`<wui-text color="primary" variant=${e}>${this.text}</wui-text>`:null}imageTemplate(){if(this.imageSrc)return(0,a.qy)`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`;let e=er[this.size];return(0,a.qy)` <wui-flex class="left-icon-container">
370      <wui-icon size=${e} name="networkPlaceholder"></wui-icon>
371    </wui-flex>`}};eo.styles=[U.W5,U.fD,et],ei([(0,r.MZ)()],eo.prototype,"imageSrc",void 0),ei([(0,r.MZ)()],eo.prototype,"text",void 0),ei([(0,r.MZ)()],eo.prototype,"size",void 0),ei([(0,r.MZ)()],eo.prototype,"type",void 0),ei([(0,r.MZ)({type:Boolean})],eo.prototype,"disabled",void 0),eo=ei([(0,D.E)("wui-select")],eo),i(50505),i(41163);var en=i(95704);let es={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(void 0!==en&&void 0!==en.env?en.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};i(41028),i(77237);let ec=(0,M.AH)`
372  button {
373    background-color: transparent;
374    padding: ${({spacing:e})=>e[1]};
375  }
376
377  button:focus-visible {
378    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
379  }
380
381  button[data-variant='accent']:hover:enabled,
382  button[data-variant='accent']:focus-visible {
383    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
384  }
385
386  button[data-variant='primary']:hover:enabled,
387  button[data-variant='primary']:focus-visible,
388  button[data-variant='secondary']:hover:enabled,
389  button[data-variant='secondary']:focus-visible {
390    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
391  }
392
393  button[data-size='xs'] > wui-icon {
394    width: 8px;
395    height: 8px;
396  }
397
398  button[data-size='sm'] > wui-icon {
399    width: 12px;
400    height: 12px;
401  }
402
403  button[data-size='xs'],
404  button[data-size='sm'] {
405    border-radius: ${({borderRadius:e})=>e[1]};
406  }
407
408  button[data-size='md'],
409  button[data-size='lg'] {
410    border-radius: ${({borderRadius:e})=>e[2]};
411  }
412
413  button[data-size='md'] > wui-icon {
414    width: 16px;
415    height: 16px;
416  }
417
418  button[data-size='lg'] > wui-icon {
419    width: 20px;
420    height: 20px;
421  }
422
423  button:disabled {
424    background-color: transparent;
425    cursor: not-allowed;
426    opacity: 0.5;
427  }
428
429  button:hover:not(:disabled) {
430    background-color: var(--wui-color-accent-glass-015);
431  }
432
433  button:focus-visible:not(:disabled) {
434    background-color: var(--wui-color-accent-glass-015);
435    box-shadow:
436      inset 0 0 0 1px var(--wui-color-accent-100),
437      0 0 0 4px var(--wui-color-accent-glass-020);
438  }
439`;var el=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let eu=class extends a.WF{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="default",this.variant="accent"}render(){return(0,a.qy)`
440      <button data-variant=${this.variant} ?disabled=${this.disabled} data-size=${this.size}>
441        <wui-icon
442          color=${({accent:"accent-primary",primary:"inverse",secondary:"default"})[this.variant]||this.iconColor}
443          size=${this.size}
444          name=${this.icon}
445        ></wui-icon>
446      </button>
447    `}};eu.styles=[U.W5,U.fD,ec],el([(0,r.MZ)()],eu.prototype,"size",void 0),el([(0,r.MZ)({type:Boolean})],eu.prototype,"disabled",void 0),el([(0,r.MZ)()],eu.prototype,"icon",void 0),el([(0,r.MZ)()],eu.prototype,"iconColor",void 0),el([(0,r.MZ)()],eu.prototype,"variant",void 0),eu=el([(0,D.E)("wui-icon-link")],eu),i(26670),i(75484);let ed=(0,a.JW)`<svg width="86" height="96" fill="none">
448  <path
449    d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
450  />
451</svg>`;var ep=i(27313);let eh=(0,a.JW)`
452  <svg fill="none" viewBox="0 0 36 40">
453    <path
454      d="M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z"
455    />
456  </svg>
457`,em=(0,M.AH)`
458  :host {
459    position: relative;
460    border-radius: inherit;
461    display: flex;
462    justify-content: center;
463    align-items: center;
464    width: var(--local-width);
465    height: var(--local-height);
466  }
467
468  :host([data-round='true']) {
469    background: ${({tokens:e})=>e.theme.foregroundPrimary};
470    border-radius: 100%;
471    outline: 1px solid ${({tokens:e})=>e.core.glass010};
472  }
473
474  svg {
475    position: absolute;
476    top: 0;
477    left: 0;
478    width: 100%;
479    height: 100%;
480    z-index: 1;
481  }
482
483  svg > path {
484    stroke: var(--local-stroke);
485  }
486
487  wui-image {
488    width: 100%;
489    height: 100%;
490    -webkit-clip-path: var(--local-path);
491    clip-path: var(--local-path);
492    background: ${({tokens:e})=>e.theme.foregroundPrimary};
493  }
494
495  wui-icon {
496    transform: translateY(-5%);
497    width: var(--local-icon-size);
498    height: var(--local-icon-size);
499  }
500`;var ew=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let eg=class extends a.WF{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:eh,md:ep.a,lg:ed},this.selected=!1,this.round=!1}render(){return this.round?(this.dataset.round="true",this.style.cssText=`
501      --local-width: var(--apkt-spacing-10);
502      --local-height: var(--apkt-spacing-10);
503      --local-icon-size: var(--apkt-spacing-4);
504    `):this.style.cssText=`
505
506      --local-path: var(--apkt-path-network-${this.size});
507      --local-width:  var(--apkt-width-network-${this.size});
508      --local-height:  var(--apkt-height-network-${this.size});
509      --local-icon-size:  var(--apkt-spacing-${({sm:"4",md:"6",lg:"10"})[this.size]});
510    `,(0,a.qy)`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?(0,a.qy)`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:(0,a.qy)`<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`}};eg.styles=[U.W5,em],ew([(0,r.MZ)()],eg.prototype,"size",void 0),ew([(0,r.MZ)()],eg.prototype,"name",void 0),ew([(0,r.MZ)({type:Object})],eg.prototype,"networkImagesBySize",void 0),ew([(0,r.MZ)()],eg.prototype,"imageSrc",void 0),ew([(0,r.MZ)({type:Boolean})],eg.prototype,"selected",void 0),ew([(0,r.MZ)({type:Boolean})],eg.prototype,"round",void 0),eg=ew([(0,D.E)("wui-network-image")],eg);let ey=(0,M.AH)`
511  :host {
512    position: relative;
513    display: flex;
514    width: 100%;
515    height: 1px;
516    background-color: ${({tokens:e})=>e.theme.borderPrimary};
517    justify-content: center;
518    align-items: center;
519  }
520
521  :host > wui-text {
522    position: absolute;
523    padding: 0px 8px;
524    transition: background-color ${({durations:e})=>e.lg}
525      ${({easings:e})=>e["ease-out-power-2"]};
526    will-change: background-color;
527  }
528
529  :host([data-bg-color='primary']) > wui-text {
530    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
531  }
532
533  :host([data-bg-color='secondary']) > wui-text {
534    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
535  }
536`;var ef=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let eb=class extends a.WF{constructor(){super(...arguments),this.text="",this.bgColor="primary"}render(){return this.dataset.bgColor=this.bgColor,(0,a.qy)`${this.template()}`}template(){return this.text?(0,a.qy)`<wui-text variant="md-regular" color="secondary">${this.text}</wui-text>`:null}};eb.styles=[U.W5,ey],ef([(0,r.MZ)()],eb.prototype,"text",void 0),ef([(0,r.MZ)()],eb.prototype,"bgColor",void 0),eb=ef([(0,D.E)("wui-separator")],eb),i(1805);var ev=i(65103),ek=i(79355);let ex={INVALID_PAYMENT_CONFIG:"INVALID_PAYMENT_CONFIG",INVALID_RECIPIENT:"INVALID_RECIPIENT",INVALID_ASSET:"INVALID_ASSET",INVALID_AMOUNT:"INVALID_AMOUNT",UNKNOWN_ERROR:"UNKNOWN_ERROR",UNABLE_TO_INITIATE_PAYMENT:"UNABLE_TO_INITIATE_PAYMENT",INVALID_CHAIN_NAMESPACE:"INVALID_CHAIN_NAMESPACE",GENERIC_PAYMENT_ERROR:"GENERIC_PAYMENT_ERROR",UNABLE_TO_GET_EXCHANGES:"UNABLE_TO_GET_EXCHANGES",ASSET_NOT_SUPPORTED:"ASSET_NOT_SUPPORTED",UNABLE_TO_GET_PAY_URL:"UNABLE_TO_GET_PAY_URL",UNABLE_TO_GET_BUY_STATUS:"UNABLE_TO_GET_BUY_STATUS",UNABLE_TO_GET_TOKEN_BALANCES:"UNABLE_TO_GET_TOKEN_BALANCES",UNABLE_TO_GET_QUOTE:"UNABLE_TO_GET_QUOTE",UNABLE_TO_GET_QUOTE_STATUS:"UNABLE_TO_GET_QUOTE_STATUS",INVALID_RECIPIENT_ADDRESS_FOR_ASSET:"INVALID_RECIPIENT_ADDRESS_FOR_ASSET"},eT={[ex.INVALID_PAYMENT_CONFIG]:"Invalid payment configuration",[ex.INVALID_RECIPIENT]:"Invalid recipient address",[ex.INVALID_ASSET]:"Invalid asset specified",[ex.INVALID_AMOUNT]:"Invalid payment amount",[ex.INVALID_RECIPIENT_ADDRESS_FOR_ASSET]:"Invalid recipient address for the asset selected",[ex.UNKNOWN_ERROR]:"Unknown payment error occurred",[ex.UNABLE_TO_INITIATE_PAYMENT]:"Unable to initiate payment",[ex.INVALID_CHAIN_NAMESPACE]:"Invalid chain namespace",[ex.GENERIC_PAYMENT_ERROR]:"Unable to process payment",[ex.UNABLE_TO_GET_EXCHANGES]:"Unable to get exchanges",[ex.ASSET_NOT_SUPPORTED]:"Asset not supported by the selected exchange",[ex.UNABLE_TO_GET_PAY_URL]:"Unable to get payment URL",[ex.UNABLE_TO_GET_BUY_STATUS]:"Unable to get buy status",[ex.UNABLE_TO_GET_TOKEN_BALANCES]:"Unable to get token balances",[ex.UNABLE_TO_GET_QUOTE]:"Unable to get quote. Please choose a different token",[ex.UNABLE_TO_GET_QUOTE_STATUS]:"Unable to get quote status"};class eA extends Error{get message(){return eT[this.code]}constructor(e,t){super(eT[e]),this.name="AppKitPayError",this.code=e,this.details=t,Error.captureStackTrace&&Error.captureStackTrace(this,eA)}}var eS=i(32464);let eI="reown_test";var eE=i(425),eP=i(32009);async function eC(e,t,i){if(t!==v.o.CHAIN.EVM)throw new eA(ex.INVALID_CHAIN_NAMESPACE);if(!i.fromAddress)throw new eA(ex.INVALID_PAYMENT_CONFIG,"fromAddress is required for native EVM payments.");let a="string"==typeof i.amount?parseFloat(i.amount):i.amount;if(isNaN(a))throw new eA(ex.INVALID_PAYMENT_CONFIG);let r=e.metadata?.decimals??18,o=p.x.parseUnits(a.toString(),r);if("bigint"!=typeof o)throw new eA(ex.GENERIC_PAYMENT_ERROR);return await p.x.sendTransaction({chainNamespace:t,to:i.recipient,address:i.fromAddress,value:o,data:"0x"})??void 0}async function e$(e,t){if(!t.fromAddress)throw new eA(ex.INVALID_PAYMENT_CONFIG,"fromAddress is required for ERC20 EVM payments.");let i=e.asset,a=t.recipient,r=Number(e.metadata.decimals),o=p.x.parseUnits(t.amount.toString(),r);if(void 0===o)throw new eA(ex.GENERIC_PAYMENT_ERROR);return await p.x.writeContract({fromAddress:t.fromAddress,tokenAddress:i,args:[a,o],method:"transfer",abi:eE.v.getERC20Abi(i),chainNamespace:v.o.CHAIN.EVM})??void 0}async function eN(e,t){if(e!==v.o.CHAIN.SOLANA)throw new eA(ex.INVALID_CHAIN_NAMESPACE);if(!t.fromAddress)throw new eA(ex.INVALID_PAYMENT_CONFIG,"fromAddress is required for Solana payments.");let i="string"==typeof t.amount?parseFloat(t.amount):t.amount;if(isNaN(i)||i<=0)throw new eA(ex.INVALID_PAYMENT_CONFIG,"Invalid payment amount.");try{if(!eP.G.getProvider(e))throw new eA(ex.GENERIC_PAYMENT_ERROR,"No Solana provider available.");let a=await p.x.sendTransaction({chainNamespace:v.o.CHAIN.SOLANA,to:t.recipient,value:i,tokenMint:t.tokenMint});if(!a)throw new eA(ex.GENERIC_PAYMENT_ERROR,"Transaction failed.");return a}catch(e){if(e instanceof eA)throw e;throw new eA(ex.GENERIC_PAYMENT_ERROR,`Solana payment failed: ${e}`)}}async function eR({sourceToken:e,toToken:t,amount:i,recipient:a}){let r=p.x.parseUnits(i,e.metadata.decimals),o=p.x.parseUnits(i,t.metadata.decimals);return Promise.resolve({type:eQ,origin:{amount:r?.toString()??"0",currency:e},destination:{amount:o?.toString()??"0",currency:t},fees:[{id:"service",label:"Service Fee",amount:"0",currency:t}],steps:[{requestId:eQ,type:"deposit",deposit:{amount:r?.toString()??"0",currency:e.asset,receiver:a}}],timeInSeconds:6})}function eO(e){if(!e)return null;let t=e.steps[0];return t&&t.type===eJ?t:null}
536function eq(e,t=0){if(!e)return[];let i=e.steps.filter(e=>e.type===eX),a=i.filter((e,i)=>i+1>t);return i.length>0&&i.length<3?a:[]}let eW=new eS.Z({baseUrl:S.w.getApiUrl(),clientId:null});class e_ extends Error{}function eU(){let{projectId:e,sdkType:t,sdkVersion:i}=n.H.state;return{projectId:e,st:t||"appkit",sv:i||"html-wagmi-4.2.2"}}async function eD(e,t){let i=function(){let e=n.H.getSnapshot().projectId;return`https://rpc.walletconnect.org/v1/json-rpc?projectId=${e}`}(),{sdkType:a,sdkVersion:r,projectId:o}=n.H.getSnapshot(),s={jsonrpc:"2.0",id:1,method:e,params:{...t||{},st:a,sv:r,projectId:o}},c=await fetch(i,{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}}),l=await c.json();if(l.error)throw new e_(l.error.message);return l}async function eM(e){return(await eD("reown_getExchanges",e)).result}async function eL(e){return(await eD("reown_getExchangePayUrl",e)).result}async function eF(e){return(await eD("reown_getExchangeBuyStatus",e)).result}async function ez(e){let t=b.S.bigNumber(e.amount).times(10**e.toToken.metadata.decimals).toString(),{chainId:i,chainNamespace:a}=ev.C.parseCaipNetworkId(e.sourceToken.network),{chainId:r,chainNamespace:o}=ev.C.parseCaipNetworkId(e.toToken.network),n="native"===e.sourceToken.asset?(0,T.NH)(a):e.sourceToken.asset,s="native"===e.toToken.asset?(0,T.NH)(o):e.toToken.asset;return await eW.post({path:"/appkit/v1/transfers/quote",body:{user:e.address,originChainId:i.toString(),originCurrency:n,destinationChainId:r.toString(),destinationCurrency:s,recipient:e.recipient,amount:t},params:eU()})}async function eB(e){let t=ek.y.isLowerCaseMatch(e.sourceToken.network,e.toToken.network),i=ek.y.isLowerCaseMatch(e.sourceToken.asset,e.toToken.asset);return t&&i?eR(e):ez(e)}async function ej(e){return await eW.get({path:"/appkit/v1/transfers/status",params:{requestId:e.requestId,...eU()}})}async function eH(e){return await eW.get({path:`/appkit/v1/transfers/assets/exchanges/${e}`,params:eU()})}let eV=["eip155","solana"],eG={eip155:{native:{assetNamespace:"slip44",assetReference:"60"},defaultTokenNamespace:"erc20"},solana:{native:{assetNamespace:"slip44",assetReference:"501"},defaultTokenNamespace:"token"}};function eZ(e,t){let{chainNamespace:i,chainId:a}=ev.C.parseCaipNetworkId(e),r=eG[i];if(!r)throw Error(`Unsupported chain namespace for CAIP-19 formatting: ${i}`);let o=r.native.assetNamespace,n=r.native.assetReference;"native"!==t&&(o=r.defaultTokenNamespace,n=t);let s=`${i}:${a}`;return`${s}/${o}:${n}`}function eY(e){let t=b.S.bigNumber(e,{safe:!0});return t.lt(.001)?"<0.001":t.round(4).toString()}let eK="unknown",eQ="direct-transfer",eJ="deposit",eX="transaction",e0=(0,y.BX)({paymentAsset:{network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},recipient:"0x0",amount:0,isConfigured:!1,error:null,isPaymentInProgress:!1,exchanges:[],isLoading:!1,openInNewTab:!0,redirectUrl:void 0,payWithExchange:void 0,currentPayment:void 0,analyticsSet:!1,paymentId:void 0,choice:"pay",tokenBalances:{[v.o.CHAIN.EVM]:[],[v.o.CHAIN.SOLANA]:[]},isFetchingTokenBalances:!1,selectedPaymentAsset:null,quote:void 0,quoteStatus:"waiting",quoteError:null,isFetchingQuote:!1,selectedExchange:void 0,exchangeUrlForQuote:void 0,requestId:void 0}),e3={state:e0,subscribe:e=>(0,y.B1)(e0,()=>e(e0)),subscribeKey:(e,t)=>(0,f.u$)(e0,e,t),async handleOpenPay(e){this.resetState(),this.setPaymentConfig(e),this.initializeAnalytics();let{chainNamespace:t}=ev.C.parseCaipNetworkId(e3.state.paymentAsset.network);if(!S.w.isAddress(e3.state.recipient,t))throw new eA(ex.INVALID_RECIPIENT_ADDRESS_FOR_ASSET,`Provide valid recipient address for namespace "${t}"`);await this.prepareTokenLogo(),e0.isConfigured=!0,N.E.sendEvent({type:"track",event:"PAY_MODAL_OPEN",properties:{exchanges:e0.exchanges,configuration:{network:e0.paymentAsset.network,asset:e0.paymentAsset.asset,recipient:e0.recipient,amount:e0.amount}}}),await s.W.open({view:"Pay"})},resetState(){e0.paymentAsset={network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},e0.recipient="0x0",e0.amount=0,e0.isConfigured=!1,e0.error=null,e0.isPaymentInProgress=!1,e0.isLoading=!1,e0.currentPayment=void 0,e0.selectedExchange=void 0,e0.exchangeUrlForQuote=void 0,e0.requestId=void 0},resetQuoteState(){e0.quote=void 0,e0.quoteStatus="waiting",e0.quoteError=null,e0.isFetchingQuote=!1,e0.requestId=void 0},setPaymentConfig(e){if(!e.paymentAsset)throw new eA(ex.INVALID_PAYMENT_CONFIG);try{e0.choice=e.choice??"pay",e0.paymentAsset=e.paymentAsset,e0.recipient=e.recipient,e0.amount=e.amount,e0.openInNewTab=e.openInNewTab??!0,e0.redirectUrl=e.redirectUrl,e0.payWithExchange=e.payWithExchange,e0.error=null}catch(e){throw new eA(ex.INVALID_PAYMENT_CONFIG,e.message)}},setSelectedPaymentAsset(e){e0.selectedPaymentAsset=e},setSelectedExchange(e){e0.selectedExchange=e},setRequestId(e){e0.requestId=e},setPaymentInProgress(e){e0.isPaymentInProgress=e},getPaymentAsset:()=>
536e0.paymentAsset,getExchanges:()=>e0.exchanges,async fetchExchanges(){try{e0.isLoading=!0,e0.exchanges=(await eM({page:0})).exchanges.slice(0,2)}catch(e){throw g.P.showError(eT.UNABLE_TO_GET_EXCHANGES),new eA(ex.UNABLE_TO_GET_EXCHANGES)}finally{e0.isLoading=!1}},async getAvailableExchanges(e){try{let t=e?.asset&&e?.network?eZ(e.network,e.asset):void 0;return await eM({page:e?.page??0,asset:t,amount:e?.amount?.toString()})}catch(e){throw new eA(ex.UNABLE_TO_GET_EXCHANGES)}},async getPayUrl(e,t,i=!1){try{let a=Number(t.amount),r=await eL({exchangeId:e,asset:eZ(t.network,t.asset),amount:a.toString(),recipient:`${t.network}:${t.recipient}`});return N.E.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{source:"pay",exchange:{id:e},configuration:{network:t.network,asset:t.asset,recipient:t.recipient,amount:a},currentPayment:{type:"exchange",exchangeId:e},headless:i}}),i&&(this.initiatePayment(),N.E.sendEvent({type:"track",event:"PAY_INITIATED",properties:{source:"pay",paymentId:e0.paymentId||eK,configuration:{network:t.network,asset:t.asset,recipient:t.recipient,amount:a},currentPayment:{type:"exchange",exchangeId:e}}})),r}catch(e){if(e instanceof Error&&e.message.includes("is not supported"))throw new eA(ex.ASSET_NOT_SUPPORTED);throw Error(e.message)}},async generateExchangeUrlForQuote({exchangeId:e,paymentAsset:t,amount:i,recipient:a}){let r=await eL({exchangeId:e,asset:eZ(t.network,t.asset),amount:i.toString(),recipient:a});e0.exchangeSessionId=r.sessionId,e0.exchangeUrlForQuote=r.url},async openPayUrl(e,t,i=!1){try{let a=await this.getPayUrl(e.exchangeId,t,i);if(!a)throw new eA(ex.UNABLE_TO_GET_PAY_URL);let r=e.openInNewTab??!0;return S.w.openHref(a.url,r?"_blank":"_self"),a}catch(e){throw e instanceof eA?e0.error=e.message:e0.error=eT.GENERIC_PAYMENT_ERROR,new eA(ex.UNABLE_TO_GET_PAY_URL)}},async onTransfer({chainNamespace:e,fromAddress:t,toAddress:i,amount:a,paymentAsset:r}){if(e0.currentPayment={type:"wallet",status:"IN_PROGRESS"},!e0.isPaymentInProgress)try{this.initiatePayment();let o=c.W.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===r.network);if(!o)throw Error("Target network not found");let n=c.W.state.activeCaipNetwork;switch(!ek.y.isLowerCaseMatch(n?.caipNetworkId,o.caipNetworkId)&&await c.W.switchActiveNetwork(o),e){case v.o.CHAIN.EVM:"native"===r.asset&&(e0.currentPayment.result=await eC(r,e,{recipient:i,amount:a,fromAddress:t})),r.asset.startsWith("0x")&&(e0.currentPayment.result=await e$(r,{recipient:i,amount:a,fromAddress:t})),e0.currentPayment.status="SUCCESS";break;case v.o.CHAIN.SOLANA:e0.currentPayment.result=await eN(e,{recipient:i,amount:a,fromAddress:t,tokenMint:"native"===r.asset?void 0:r.asset}),e0.currentPayment.status="SUCCESS";break;default:throw new eA(ex.INVALID_CHAIN_NAMESPACE)}}catch(e){throw e instanceof eA?e0.error=e.message:e0.error=eT.GENERIC_PAYMENT_ERROR,e0.currentPayment.status="FAILED",g.P.showError(e0.error),e}finally{e0.isPaymentInProgress=!1}},async onSendTransaction(e){try{let{namespace:t,transactionStep:i}=e;e3.initiatePayment();let a=c.W.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===e0.paymentAsset?.network);if(!a)throw Error("Target network not found");let r=c.W.state.activeCaipNetwork;if(ek.y.isLowerCaseMatch(r?.caipNetworkId,a.caipNetworkId)||await c.W.switchActiveNetwork(a),t===v.o.CHAIN.EVM){let{from:e,to:a,data:r,value:o}=i.transaction;await p.x.sendTransaction({address:e,to:a,data:r,value:BigInt(o),chainNamespace:t})}else if(t===v.o.CHAIN.SOLANA){let{instructions:e}=i.transaction;await p.x.writeSolanaTransaction({instructions:e})}}catch(e){throw e instanceof eA?e0.error=e.message:e0.error=eT.GENERIC_PAYMENT_ERROR,g.P.showError(e0.error),e}finally{e0.isPaymentInProgress=!1}},getExchangeById:e=>e0.exchanges.find(t=>t.id===e),validatePayConfig(e){let{paymentAsset:t,recipient:i,amount:a}=e;if(!t)throw new eA(ex.INVALID_PAYMENT_CONFIG);if(!i)throw new eA(ex.INVALID_RECIPIENT);if(!t.asset)throw new eA(ex.INVALID_ASSET);if(null==a||a<=0)throw new eA(ex.INVALID_AMOUNT)},async handlePayWithExchange(e){try{e0.currentPayment={type:"exchange",exchangeId:e};let{network:t,asset:i}=e0.paymentAsset,a={network:t,asset:i,amount:e0.amount,recipient:e0.recipient},r=await this.getPayUrl(e,a);if(!r)throw new eA(ex.UNABLE_TO_INITIATE_PAYMENT);return e0.currentPayment.sessionId=r.sessionId,e0.currentPayment.status="IN_PROGRESS",e0.currentPayment.exchangeId=e,this.initiatePayment(),{url:r.url,openInNewTab:e0.openInNewTab}}catch(e){return e instanceof eA?e0.error=e.message:e0.error=eT.GENERIC_PAYMENT_ERROR,e0.isPaymentInProgress=!1,g.P.showError(e0.error),null}},async getBuyStatus(e,t){try{let i=await eF({sessionId:t,exchangeId:e});return("SUCCESS"===i.status||"FAILED"===i.status)&&N.E.sendEvent({type:"track",event:"SUCCESS"===i.status?"PAY_SUCCESS":"PAY_ERROR",properties:{message:"FAILED"===i.status?S.w.parseError(e0.error):void 0,source:"pay",paymentId:e0.paymentId||eK,configuration:{network:e0.paymentAsset.network,asset:e0.paymentAsset.asset,recipient:e0.recipient,amount:e0.amount},currentPayment:{type:"exchange",exchangeId:e0.currentPayment?.exchangeId,sessionId:e0.currentPayment?.sessionId,result:i.txHash}}}),i}catch(e){throw new eA(ex.UNABLE_TO_GET_BUY_STATUS)}},async fetchTokensFromEOA({caipAddress:e,caipNetwork:t,namespace:i}){if(!e)return[];let{address:a}=ev.C.parseCaipAddress(e),r=t;return i===v.o.CHAIN.EVM&&(r=void 0),await x.Z.getMyTokensWithBalance({address:a,caipNetwork:r})},async fetchTokensFromExchange(){if(!e0.selectedExchange)return[];let e=Object.values((await eH(e0.selectedExchange.id)).assets).flat();return await Promise.all(e.map(async e=>{let t={chainId:e.network,address:`${e.network}:${e.asset}
536`,symbol:e.metadata.symbol,name:e.metadata.name,iconUrl:e.metadata.logoURI||"",price:0,quantity:{numeric:"0",decimals:e.metadata.decimals.toString()}},{chainNamespace:i}=ev.C.parseCaipNetworkId(t.chainId),a=t.address;if(S.w.isCaipAddress(a)){let{address:e}=ev.C.parseCaipAddress(a);a=e}return t.iconUrl=await K.$.getImageByToken(a??"",i).catch(()=>void 0)??"",t}))},async fetchTokens({caipAddress:e,caipNetwork:t,namespace:i}){try{e0.isFetchingTokenBalances=!0;let a=e0.selectedExchange?this.fetchTokensFromExchange():this.fetchTokensFromEOA({caipAddress:e,caipNetwork:t,namespace:i}),r=await a;e0.tokenBalances={...e0.tokenBalances,[i]:r}}catch(t){let e=t instanceof Error?t.message:"Unable to get token balances";g.P.showError(e)}finally{e0.isFetchingTokenBalances=!1}},async fetchQuote({amount:e,address:t,sourceToken:i,toToken:a,recipient:r}){try{e3.resetQuoteState(),e0.isFetchingQuote=!0;let o=await eB({amount:e,address:e0.selectedExchange?void 0:t,sourceToken:i,toToken:a,recipient:r});if(e0.selectedExchange){let e=eO(o);if(e){let t=`${i.network}:${e.deposit.receiver}`,a=b.S.formatNumber(e.deposit.amount,{decimals:i.metadata.decimals??0,round:8});await e3.generateExchangeUrlForQuote({exchangeId:e0.selectedExchange.id,paymentAsset:i,amount:a.toString(),recipient:t})}}e0.quote=o}catch(t){let e=eT.UNABLE_TO_GET_QUOTE;if(t instanceof Error&&t.cause&&t.cause instanceof Response)try{let i=await t.cause.json();i.error&&"string"==typeof i.error&&(e=i.error)}catch{}throw e0.quoteError=e,g.P.showError(e),new eA(ex.UNABLE_TO_GET_QUOTE)}finally{e0.isFetchingQuote=!1}},async fetchQuoteStatus({requestId:e}){try{if(e===eQ){let e=e0.selectedExchange,t=e0.exchangeSessionId;if(e&&t){switch((await this.getBuyStatus(e.id,t)).status){case"IN_PROGRESS":case"UNKNOWN":default:e0.quoteStatus="waiting";break;case"SUCCESS":e0.quoteStatus="success",e0.isPaymentInProgress=!1;break;case"FAILED":e0.quoteStatus="failure",e0.isPaymentInProgress=!1}return}e0.quoteStatus="success";return}let{status:t}=await ej({requestId:e});e0.quoteStatus=t}catch{throw e0.quoteStatus="failure",new eA(ex.UNABLE_TO_GET_QUOTE_STATUS)}},initiatePayment(){e0.isPaymentInProgress=!0,e0.paymentId=crypto.randomUUID()},initializeAnalytics(){e0.analyticsSet||(e0.analyticsSet=!0,this.subscribeKey("isPaymentInProgress",e=>{if(e0.currentPayment?.status&&"UNKNOWN"!==e0.currentPayment.status){let e={IN_PROGRESS:"PAY_INITIATED",SUCCESS:"PAY_SUCCESS",FAILED:"PAY_ERROR"}[e0.currentPayment.status];N.E.sendEvent({type:"track",event:e,properties:{message:"FAILED"===e0.currentPayment.status?S.w.parseError(e0.error):void 0,source:"pay",paymentId:e0.paymentId||eK,configuration:{network:e0.paymentAsset.network,asset:e0.paymentAsset.asset,recipient:e0.recipient,amount:e0.amount},currentPayment:{type:e0.currentPayment.type,exchangeId:e0.currentPayment.exchangeId,sessionId:e0.currentPayment.sessionId,result:e0.currentPayment.result}}})}}))},async prepareTokenLogo(){if(!e0.paymentAsset.metadata.logoURI)try{let{chainNamespace:e}=ev.C.parseCaipNetworkId(e0.paymentAsset.network),t=await K.$.getImageByToken(e0.paymentAsset.asset,e);e0.paymentAsset.metadata.logoURI=t}catch{}}},e1=(0,_.AH)`
537  wui-separator {
538    margin: var(--apkt-spacing-3) calc(var(--apkt-spacing-3) * -1) var(--apkt-spacing-2)
539      calc(var(--apkt-spacing-3) * -1);
540    width: calc(100% + var(--apkt-spacing-3) * 2);
541  }
542
543  .token-display {
544    padding: var(--apkt-spacing-3) var(--apkt-spacing-3);
545    border-radius: var(--apkt-borderRadius-5);
546    background-color: var(--apkt-tokens-theme-backgroundPrimary);
547    margin-top: var(--apkt-spacing-3);
548    margin-bottom: var(--apkt-spacing-3);
549  }
550
551  .token-display wui-text {
552    text-transform: none;
553  }
554
555  wui-loading-spinner {
556    padding: var(--apkt-spacing-2);
557  }
558
559  .left-image-container {
560    position: relative;
561    justify-content: center;
562    align-items: center;
563  }
564
565  .token-image {
566    border-radius: ${({borderRadius:e})=>e.round};
567    width: 40px;
568    height: 40px;
569  }
570
571  .chain-image {
572    position: absolute;
573    width: 20px;
574    height: 20px;
575    bottom: -3px;
576    right: -5px;
577    border-radius: ${({borderRadius:e})=>e.round};
578    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
579  }
580
581  .payment-methods-container {
582    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
583    border-top-right-radius: ${({borderRadius:e})=>e[8]};
584    border-top-left-radius: ${({borderRadius:e})=>e[8]};
585  }
586`;var e2=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let e5=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.amount=e3.state.amount,this.namespace=void 0,this.paymentAsset=e3.state.paymentAsset,this.activeConnectorIds=l.a.state.activeConnectorIds,this.caipAddress=void 0,this.exchanges=e3.state.exchanges,this.isLoading=e3.state.isLoading,this.initializeNamespace(),this.unsubscribe.push(e3.subscribeKey("amount",e=>this.amount=e)),this.unsubscribe.push(l.a.subscribeKey("activeConnectorIds",e=>this.activeConnectorIds=e)),this.unsubscribe.push(e3.subscribeKey("exchanges",e=>this.exchanges=e)),this.unsubscribe.push(e3.subscribeKey("isLoading",e=>this.isLoading=e)),e3.fetchExchanges(),e3.setSelectedExchange(void 0)}
586disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return(0,a.qy)`
587      <wui-flex flexDirection="column">
588        ${this.paymentDetailsTemplate()} ${this.paymentMethodsTemplate()}
589      </wui-flex>
590    `}paymentMethodsTemplate(){return(0,a.qy)`
591      <wui-flex flexDirection="column" padding="3" gap="2" class="payment-methods-container">
592        ${this.payWithWalletTemplate()} ${this.templateSeparator()}
593        ${this.templateExchangeOptions()}
594      </wui-flex>
595    `}initializeNamespace(){let e=c.W.state.activeChain;this.namespace=e,this.caipAddress=c.W.getAccountData(e)?.caipAddress,this.unsubscribe.push(c.W.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress},e))}paymentDetailsTemplate(){let e=c.W.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===this.paymentAsset.network);return(0,a.qy)`
596      <wui-flex
597        alignItems="center"
598        justifyContent="space-between"
599        .padding=${["6","8","6","8"]}
600        gap="2"
601      >
602        <wui-flex alignItems="center" gap="1">
603          <wui-text variant="h1-regular" color="primary">
604            ${eY(this.amount||"0")}
605          </wui-text>
606
607          <wui-flex flexDirection="column">
608            <wui-text variant="h6-regular" color="secondary">
609              ${this.paymentAsset.metadata.symbol||"Unknown"}
610            </wui-text>
611            <wui-text variant="md-medium" color="secondary"
612              >on ${e?.name||"Unknown"}</wui-text
613            >
614          </wui-flex>
615        </wui-flex>
616
617        <wui-flex class="left-image-container">
618          <wui-image
619            src=${(0,o.J)(this.paymentAsset.metadata.logoURI)}
620            class="token-image"
621          ></wui-image>
622          <wui-image
623            src=${(0,o.J)(K.$.getNetworkImage(e))}
624            class="chain-image"
625          ></wui-image>
626        </wui-flex>
627      </wui-flex>
628    `}payWithWalletTemplate(){return!function(e){let{chainNamespace:t}=ev.C.parseCaipNetworkId(e);return eV.includes(t)}(this.paymentAsset.network)?(0,a.qy)``:this.caipAddress?this.connectedWalletTemplate():this.disconnectedWalletTemplate()}connectedWalletTemplate(){let{name:e,image:t}=this.getWalletProperties({namespace:this.namespace});return(0,a.qy)`
629      <wui-flex flexDirection="column" gap="3">
630        <wui-list-item
631          type="secondary"
632          boxColor="foregroundSecondary"
633          @click=${this.onWalletPayment}
634          .boxed=${!1}
635          ?chevron=${!0}
636          ?fullSize=${!1}
637          ?rounded=${!0}
638          data-testid="wallet-payment-option"
639          imageSrc=${(0,o.J)(t)}
640          imageSize="3xl"
641        >
642          <wui-text variant="lg-regular" color="primary">Pay with ${e}</wui-text>
643        </wui-list-item>
644
645        <wui-list-item
646          type="secondary"
647          icon="power"
648          iconColor="error"
649          @click=${this.onDisconnect}
650          data-testid="disconnect-button"
651          ?chevron=${!1}
652          boxColor="foregroundSecondary"
653        >
654          <wui-text variant="lg-regular" color="secondary">Disconnect</wui-text>
655        </wui-list-item>
656      </wui-flex>
657    `}disconnectedWalletTemplate(){return(0,a.qy)`<wui-list-item
658      type="secondary"
659      boxColor="foregroundSecondary"
660      variant="icon"
661      iconColor="default"
662      iconVariant="overlay"
663      icon="wallet"
664      @click=${this.onWalletPayment}
665      ?chevron=${!0}
666      data-testid="wallet-payment-option"
667    >
668      <wui-text variant="lg-regular" color="primary">Pay with wallet</wui-text>
669    </wui-list-item>`}templateExchangeOptions(){if(this.isLoading)return(0,a.qy)`<wui-flex justifyContent="center" alignItems="center">
670        <wui-loading-spinner size="md"></wui-loading-spinner>
671      </wui-flex>`;let e=this.exchanges.filter(e=>!function(e){let t=c.W.getAllRequestedCaipNetworks().find(t=>t.caipNetworkId===e.network);return!!t&&!!t.testnet}(this.paymentAsset)?e.id!==eI:e.id===eI);return 0===e.length?(0,a.qy)`<wui-flex justifyContent="center" alignItems="center">
672        <wui-text variant="md-medium" color="primary">No exchanges available</wui-text>
673      </wui-flex>`:e.map(e=>(0,a.qy)`
674        <wui-list-item
675          type="secondary"
676          boxColor="foregroundSecondary"
677          @click=${()=>this.onExchangePayment(e)}
678          data-testid="exchange-option-${e.id}"
679          ?chevron=${!0}
680          imageSrc=${(0,o.J)(e.imageUrl)}
681        >
682          <wui-text flexGrow="1" variant="lg-regular" color="primary">
683            Pay with ${e.name}
684          </wui-text>
685        </wui-list-item>
686      `)}templateSeparator(){return(0,a.qy)`<wui-separator text="or" bgColor="secondary"></wui-separator>`}async onWalletPayment(){if(!this.namespace)throw Error("Namespace not found");this.caipAddress?d.I.push("PayQuote"):(await l.a.connect(),await s.W.open({view:"PayQuote"}))}onExchangePayment(e){e3.setSelectedExchange(e),d.I.push("PayQuote")}async onDisconnect(){try{await p.x.disconnect(),await s.W.open({view:"Pay"})}catch{console.error("Failed to disconnect"),g.P.showError("Failed to disconnect")}}getWalletProperties({namespace:e}){if(!e)return{name:void 0,image:void 0};let t=this.activeConnectorIds[e];if(!t)return{name:void 0,image:void 0};let i=l.a.getConnector({id:t,namespace:e});if(!i)return{name:void 0,image:void 0};let a=K.$.getConnectorImage(i);return{name:i.name,image:a}}};e5.styles=e1,e2([(0,r.wk)()],e5.prototype,"amount",void 0),e2([(0,r.wk)()],e5.prototype,"namespace",void 0),e2([(0,r.wk)()],e5.prototype,"paymentAsset",void 0),e2([(0,r.wk)()],e5.prototype,"activeConnectorIds",void 0),e2([(0,r.wk)()],e5.prototype,"caipAddress",void 0),e2([(0,r.wk)()],e5.prototype,"exchanges",void 0),e2([(0,r.wk)()],e5.prototype,"isLoading",void 0),e5=e2([(0,_.EM)("w3m-pay-view")],e5);var e4=i(2354);let e6=(0,M.AH)`
687  :host {
688    display: inline-flex;
689    align-items: center;
690    justify-content: center;
691  }
692
693  .pulse-container {
694    position: relative;
695    width: var(--pulse-size);
696    height: var(--pulse-size);
697    display: flex;
698    align-items: center;
699    justify-content: center;
700  }
701
702  .pulse-rings {
703    position: absolute;
704    inset: 0;
705    pointer-events: none;
706  }
707
708  .pulse-ring {
709    position: absolute;
710    inset: 0;
711    border-radius: 50%;
712    border: 2px solid var(--pulse-color);
713    opacity: 0;
714    animation: pulse var(--pulse-duration, 2s) ease-out infinite;
715  }
716
717  .pulse-content {
718    position: relative;
719    z-index: 1;
720    display: flex;
721    align-items: center;
722    justify-content: center;
723  }
724
725  @keyframes pulse {
726    0% {
727      transform: scale(0.5);
728      opacity: var(--pulse-opacity, 0.3);
729    }
730    50% {
731      opacity: calc(var(--pulse-opacity, 0.3) * 0.5);
732    }
733    100% {
734      transform: scale(1.2);
735      opacity: 0;
736    }
737  }
738`;var e8=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let e7={"accent-primary":M.f.tokens.core.backgroundAccentPrimary},e9=class extends a.WF{constructor(){super(...arguments),this.rings=3,this.duration=2,this.opacity=.3,this.size="200px",this.variant="accent-primary"}render(){let e=e7[this.variant];this.style.cssText=`
739      --pulse-size: ${this.size};
740      --pulse-duration: ${this.duration}s;
741      --pulse-color: ${e};
742      --pulse-opacity: ${this.opacity};
743    `;let t=Array.from({length:this.rings},(e,t)=>this.renderRing(t,this.rings));return(0,a.qy)`
744      <div class="pulse-container">
745        <div class="pulse-rings">${t}</div>
746        <div class="pulse-content">
747          <slot></slot>
748        </div>
749      </div>
750    `}renderRing(e,t){let i=e/t*this.duration,r=`animation-delay: ${i}s;`;return(0,a.qy)`<div class="pulse-ring" style=${r}></div>`}};e9.styles=[U.W5,e6],e8([(0,r.MZ)({type:Number})],e9.prototype,"rings",void 0),e8([(0,r.MZ)({type:Number})],e9.prototype,"duration",void 0),e8([(0,r.MZ)({type:Number})],e9.prototype,"opacity",void 0),e8([(0,r.MZ)()],e9.prototype,"size",void 0),e8([(0,r.MZ)()],e9.prototype,"variant",void 0),e9=e8([(0,D.E)("wui-pulse")],e9);let te=[{id:"received",title:"Receiving funds",icon:"dollar"},{id:"processing",title:"Swapping asset",icon:"recycleHorizontal"},{id:"sending",title:"Sending asset to the recipient address",icon:"send"}],tt=["success","submitted","failure","timeout","refund"],ti=(0,_.AH)`
751  :host {
752    display: block;
753    height: 100%;
754    width: 100%;
755  }
756
757  wui-image {
758    border-radius: ${({borderRadius:e})=>e.round};
759  }
760
761  .token-badge-container {
762    position: absolute;
763    bottom: 6px;
764    left: 50%;
765    transform: translateX(-50%);
766    border-radius: ${({borderRadius:e})=>e[4]};
767    z-index: 3;
768    min-width: 105px;
769  }
770
771  .token-badge-container.loading {
772    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
773    border: 3px solid ${({tokens:e})=>e.theme.backgroundPrimary};
774  }
775
776  .token-badge-container.success {
777    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
778    border: 3px solid ${({tokens:e})=>e.theme.backgroundPrimary};
779  }
780
781  .token-image-container {
782    position: relative;
783  }
784
785  .token-image {
786    border-radius: ${({borderRadius:e})=>e.round};
787    width: 64px;
788    height: 64px;
789  }
790
791  .token-image.success {
792    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
793  }
794
795  .token-image.error {
796    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
797  }
798
799  .token-image.loading {
800    background: ${({colors:e})=>e.accent010};
801  }
802
803  .token-image wui-icon {
804    width: 32px;
805    height: 32px;
806  }
807
808  .token-badge {
809    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
810    border: 1px solid ${({tokens:e})=>e.theme.foregroundSecondary};
811    border-radius: ${({borderRadius:e})=>e[4]};
812  }
813
814  .token-badge wui-text {
815    white-space: nowrap;
816  }
817
818  .payment-lifecycle-container {
819    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
820    border-top-right-radius: ${({borderRadius:e})=>e[6]};
821    border-top-left-radius: ${({borderRadius:e})=>e[6]};
822  }
823
824  .payment-step-badge {
825    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
826    border-radius: ${({borderRadius:e})=>e[1]};
827  }
828
829  .payment-step-badge.loading {
830    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
831  }
832
833  .payment-step-badge.error {
834    background-color: ${({tokens:e})=>e.core.backgroundError};
835  }
836
837  .payment-step-badge.success {
838    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
839  }
840
841  .step-icon-container {
842    position: relative;
843    height: 40px;
844    width: 40px;
845    border-radius: ${({borderRadius:e})=>e.round};
846    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
847  }
848
849  .step-icon-box {
850    position: absolute;
851    right: -4px;
852    bottom: -1px;
853    padding: 2px;
854    border-radius: ${({borderRadius:e})=>e.round};
855    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
856    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
857  }
858
859  .step-icon-box.success {
860    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
861  }
862`;var ta=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tr={received:["pending","success","submitted"],processing:["success","submitted"],sending:["success","submitted"]},to=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.pollingInterval=null,this.paymentAsset=e3.state.paymentAsset,this.quoteStatus=e3.state.quoteStatus,this.quote=e3.state.quote,this.amount=e3.state.amount,this.namespace=void 0,this.caipAddress=void 0,this.profileName=null,this.activeConnectorIds=l.a.state.activeConnectorIds,this.selectedExchange=e3.state.selectedExchange,this.initializeNamespace(),this.unsubscribe.push(e3.subscribeKey("quoteStatus",e=>this.quoteStatus=e),e3.subscribeKey("quote",e=>this.quote=e),l.a.subscribeKey("activeConnectorIds",e=>this.activeConnectorIds=e),e3.subscribeKey("selectedExchange",e=>this.selectedExchange=e))}connectedCallback(){super.connectedCallback(),this.startPolling()}disconnectedCallback(){super.disconnectedCallback(),this.stopPolling(),this.unsubscribe.forEach(e
862=>e())}render(){return(0,a.qy)`
863      <wui-flex flexDirection="column" .padding=${["3","0","0","0"]} gap="2">
864        ${this.tokenTemplate()} ${this.paymentTemplate()} ${this.paymentLifecycleTemplate()}
865      </wui-flex>
866    `}tokenTemplate(){let e=eY(this.amount||"0"),t=this.paymentAsset.metadata.symbol??"Unknown",i=c.W.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===this.paymentAsset.network),r="failure"===this.quoteStatus||"timeout"===this.quoteStatus||"refund"===this.quoteStatus;return"success"===this.quoteStatus||"submitted"===this.quoteStatus?(0,a.qy)`<wui-flex alignItems="center" justifyContent="center">
867        <wui-flex justifyContent="center" alignItems="center" class="token-image success">
868          <wui-icon name="checkmark" color="success" size="inherit"></wui-icon>
869        </wui-flex>
870      </wui-flex>`:r?(0,a.qy)`<wui-flex alignItems="center" justifyContent="center">
871        <wui-flex justifyContent="center" alignItems="center" class="token-image error">
872          <wui-icon name="close" color="error" size="inherit"></wui-icon>
873        </wui-flex>
874      </wui-flex>`:(0,a.qy)`
875      <wui-flex alignItems="center" justifyContent="center">
876        <wui-flex class="token-image-container">
877          <wui-pulse size="125px" rings="3" duration="4" opacity="0.5" variant="accent-primary">
878            <wui-flex justifyContent="center" alignItems="center" class="token-image loading">
879              <wui-icon name="paperPlaneTitle" color="accent-primary" size="inherit"></wui-icon>
880            </wui-flex>
881          </wui-pulse>
882
883          <wui-flex
884            justifyContent="center"
885            alignItems="center"
886            class="token-badge-container loading"
887          >
888            <wui-flex
889              alignItems="center"
890              justifyContent="center"
891              gap="01"
892              padding="1"
893              class="token-badge"
894            >
895              <wui-image
896                src=${(0,o.J)(K.$.getNetworkImage(i))}
897                class="chain-image"
898                size="mdl"
899              ></wui-image>
900
901              <wui-text variant="lg-regular" color="primary">${e} ${t}</wui-text>
902            </wui-flex>
903          </wui-flex>
904        </wui-flex>
905      </wui-flex>
906    `}paymentTemplate(){return(0,a.qy)`
907      <wui-flex flexDirection="column" gap="2" .padding=${["0","6","0","6"]}>
908        ${this.renderPayment()}
909        <wui-separator></wui-separator>
910        ${this.renderWallet()}
911      </wui-flex>
912    `}paymentLifecycleTemplate(){let e=this.getStepsWithStatus();return(0,a.qy)`
913      <wui-flex flexDirection="column" padding="4" gap="2" class="payment-lifecycle-container">
914        <wui-flex alignItems="center" justifyContent="space-between">
915          <wui-text variant="md-regular" color="secondary">PAYMENT CYCLE</wui-text>
916
917          ${this.renderPaymentCycleBadge()}
918        </wui-flex>
919
920        <wui-flex flexDirection="column" gap="5" .padding=${["2","0","2","0"]}>
921          ${e.map(e=>this.renderStep(e))}
922        </wui-flex>
923      </wui-flex>
924    `}renderPaymentCycleBadge(){let e="failure"===this.quoteStatus||"timeout"===this.quoteStatus||"refund"===this.quoteStatus,t="success"===this.quoteStatus||"submitted"===this.quoteStatus;if(e)return(0,a.qy)`
925        <wui-flex
926          justifyContent="center"
927          alignItems="center"
928          class="payment-step-badge error"
929          gap="1"
930        >
931          <wui-icon name="close" color="error" size="xs"></wui-icon>
932          <wui-text variant="sm-regular" color="error">Failed</wui-text>
933        </wui-flex>
934      `;if(t)return(0,a.qy)`
935        <wui-flex
936          justifyContent="center"
937          alignItems="center"
938          class="payment-step-badge success"
939          gap="1"
940        >
941          <wui-icon name="checkmark" color="success" size="xs"></wui-icon>
942          <wui-text variant="sm-regular" color="success">Completed</wui-text>
943        </wui-flex>
944      `;let i=this.quote?.timeInSeconds??0;return(0,a.qy)`
945      <wui-flex alignItems="center" justifyContent="space-between" gap="3">
946        <wui-flex
947          justifyContent="center"
948          alignItems="center"
949          class="payment-step-badge loading"
950          gap="1"
951        >
952          <wui-icon name="clock" color="default" size="xs"></wui-icon>
953          <wui-text variant="sm-regular" color="primary">Est. ${i} sec</wui-text>
954        </wui-flex>
955
956        <wui-icon name="chevronBottom" color="default" size="xxs"></wui-icon>
957      </wui-flex>
958    `}renderPayment(){let e=c.W.getAllRequestedCaipNetworks().find(e=>{let t=this.quote?.origin.currency.network;if(!t)return!1;let{chainId:i}=ev.C.parseCaipNetworkId(t);return ek.y.isLowerCaseMatch(e.id.toString(),i.toString())}),t=eY(b.S.formatNumber(this.quote?.origin.amount||"0",{decimals:this.quote?.origin.currency.metadata.decimals??0}).toString()),i=this.quote?.origin.currency.metadata.symbol??"Unknown";return(0,a.qy)`
959      <wui-flex
960        alignItems="flex-start"
961        justifyContent="space-between"
962        .padding=${["3","0","3","0"]}
963      >
964        <wui-text variant="lg-regular" color="secondary">Payment Method</wui-text>
965
966        <wui-flex flexDirection="column" alignItems="flex-end" gap="1">
967          <wui-flex alignItems="center" gap="01">
968            <wui-text variant="lg-regular" color="primary">${t}</wui-text>
969            <wui-text variant="lg-regular" color="secondary">${i}</wui-text>
970          </wui-flex>
971
972          <wui-flex alignItems="center" gap="1">
973            <wui-text variant="md-regular" color="secondary">on</wui-text>
974            <wui-image
975              src=${(0,o.J)(K.$.getNetworkImage(e))}
976              size="xs"
977            ></wui-image>
978            <wui-text variant="md-regular" color="secondary">${e?.name}</wui-text>
979          </wui-flex>
980        </wui-flex>
981      </wui-flex>
982    `}renderWallet(){return(0,a.qy)`
983      <wui-flex
984        alignItems="flex-start"
985        justifyContent="space-between"
986        .padding=${["3","0","3","0"]}
987      >
988        <wui-text variant="lg-regular" color="secondary">Wallet</wui-text>
989
990        ${this.renderWalletText()}
991      </wui-flex>
992    `}renderWalletText(){let{image:e}=this.getWalletProperties({namespace:this.namespace}),{address:t}=this.caipAddress?ev.C.parseCaipAddress(this.caipAddress):{},i=this.selectedExchange?.name;return this.selectedExchange?(0,a.qy)`
993        <wui-flex alignItems="center" justifyContent="flex-end" gap="1">
994          <wui-text variant="lg-regular" color="primary">${i}</wui-text>
995          <wui-image src=${(0,o.J)(this.selectedExchange.imageUrl)} size="mdl"></wui-image>
996        </wui-flex>
997      `:(0,a.qy)`
998      <wui-flex alignItems="center" justifyContent="flex-end" gap="1">
999        <wui-text variant="lg-regular" color="primary">
1000          ${_.Zv.getTruncateString({string:this.profileName||t||i||"",charsStart:this.profileName?16:4,charsEnd:6*!this.profileName,truncate:this.profileName?"end":"middle"})}
1001        </wui-text>
1002
1003        <wui-image src=${(0,o.J)(e)} size="mdl"></wui-image>
1004      </wui-flex>
1005    `}getStepsWithStatus(){return"failure"===this.quoteStatus||"timeout"===this.quoteStatus||"refund"===this.quoteStatus?te.map(e=>({...e,status:"failed"})):te.map(e=>{let t=(tr[e.id]??[]).includes(this.quoteStatus)?"completed":"pending";return{...e,status:t}})}renderStep({title:e,icon:t,status:i}){return(0,a.qy)`
1006      <wui-flex alignItems="center" gap="3">
1007        <wui-flex justifyContent="center" alignItems="center" class="step-icon-container">
1008          <wui-icon name=${t} color="default" size="mdl"></wui-icon>
1009
1010          <wui-flex alignItems="center" justifyContent="center" class=${(0,e4.H)({"step-icon-box":!0,success:"completed"===i})}>
1011            ${this.renderStatusIndicator(i)}
1012          </wui-flex>
1013        </wui-flex>
1014
1015        <wui-text variant="md-regular" color="primary">${e}</wui-text>
1016      </wui-flex>
1017    `}renderStatusIndicator(e){return"completed"===e?(0,a.qy)`<wui-icon size="sm" color="success" name="checkmark"></wui-icon>`:"failed"===e?(0,a.qy)`<wui-icon size="sm" color="error" name="close"></wui-icon>`:"pending"===e?(0,a.qy)`<wui-loading-spinner color="accent-primary" size="sm"></wui-loading-spinner>`:null}startPolling(){this.pollingInterval||(this.fetchQuoteStatus(),this.pollingInterval=setInterval(()=>{this.fetchQuoteStatus()},3e3))}stopPolling(){this.pollingInterval&&(clearInterval(this.pollingInterval),this.pollingInterval=null)}async fetchQuoteStatus(){let e=e3.state.requestId;if(!e||tt.includes(this.quoteStatus))this.stopPolling();else try{await e3.fetchQuoteStatus({requestId:e}),tt.includes(this.quoteStatus)&&this.stopPolling()}catch{this.stopPolling()}}initializeNamespace(){let e=c.W.state.activeChain;this.namespace=e,this.caipAddress=c.W.getAccountData(e)?.caipAddress,this.profileName=c.W.getAccountData(e)?.profileName??null,this.unsubscribe.push(c.W.subscribeChainProp("accountState",e=>{this.caipAddress=e?.caipAddress,this.profileName=e?.profileName??null},e))}getWalletProperties({namespace:e}){if(!e)return{name:void 0,image:void 0};let t=this.activeConnectorIds[e];if(!t)return{name:void 0,image:void 0};let i=l.a.getConnector({id:t,namespace:e});if(!i)return{name:void 0,image:void 0};let a=K.$.getConnectorImage(i);return{name:i.name,image:a}}};to.styles=ti,ta([(0,r.wk)()],to.prototype,"paymentAsset",void 0),ta([(0,r.wk)()],to.prototype,"quoteStatus",void 0),ta([(0,r.wk)()],to.prototype,"quote",void 0),ta([(0,r.wk)()],to.prototype,"amount",void 0),ta([(0,r.wk)()],to.prototype,"namespace",void 0),ta([(0,r.wk)()],to.prototype,"caipAddress",void 0),ta([(0,r.wk)()],to.prototype,"profileName",void 0),ta([(0,r.wk)()],to.prototype,"activeConnectorIds",void 0),ta([(0,r.wk)()],to.prototype,"selectedExchange",void 0),to=ta([(0,_.EM)("w3m-pay-loading-view")],to);var tn=i(8821);let ts=(0,M.AH)`
1018  button {
1019    display: flex;
1020    align-items: center;
1021    height: 40px;
1022    padding: ${({spacing:e})=>e[2]};
1023    border-radius: ${({borderRadius:e})=>e[4]};
1024    column-gap: ${({spacing:e})=>e[1]};
1025    background-color: transparent;
1026    transition: background-color ${({durations:e})=>e.lg}
1027      ${({easings:e})=>e["ease-out-power-2"]};
1028    will-change: background-color;
1029  }
1030
1031  wui-image,
1032  .icon-box {
1033    width: ${({spacing:e})=>e[6]};
1034    height: ${({spacing:e})=>e[6]};
1035    border-radius: ${({borderRadius:e})=>e[4]};
1036  }
1037
1038  wui-text {
1039    flex: 1;
1040  }
1041
1042  .icon-box {
1043    position: relative;
1044  }
1045
1046  .icon-box[data-active='true'] {
1047    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1048  }
1049
1050  .circle {
1051    position: absolute;
1052    left: 16px;
1053    top: 15px;
1054    width: 8px;
1055    height: 8px;
1056    background-color: ${({tokens:e})=>e.core.textSuccess};
1057    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.foregroundPrimary};
1058    border-radius: 50%;
1059  }
1060
1061  /* -- Hover & Active states ----------------------------------------------------------- */
1062  @media (hover: hover) {
1063    button:hover:enabled,
1064    button:active:enabled {
1065      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1066    }
1067  }
1068`;var tc=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tl=class extends a.WF{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.enableGreenCircle=!0,this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return(0,a.qy)`
1069      <button>
1070        ${this.leftImageTemplate()} ${this.textTemplate()} ${this.rightImageTemplate()}
1071      </button>
1072    `}leftImageTemplate(){let e=this.icon?(0,a.qy)`<wui-icon
1073          size=${(0,o.J)(this.iconSize)}
1074          color="default"
1075          name=${this.icon}
1076          class="icon"
1077        ></wui-icon>`:(0,a.qy)`<wui-image src=${this.imageSrc} alt=${this.alt}></wui-image>`;return(0,a.qy)`
1078      <wui-flex
1079        alignItems="center"
1080        justifyContent="center"
1081        class="icon-box"
1082        data-active=${!!this.icon}
1083      >
1084        ${e}
1085        ${this.enableGreenCircle?(0,a.qy)`<wui-flex class="circle"></wui-flex>`:null}
1086      </wui-flex>
1087    `}textTemplate(){return(0,a.qy)`
1088      <wui-text variant="lg-regular" color="primary">
1089        ${tn.Z.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})}
1090      </wui-text>
1091    `}rightImageTemplate(){return(0,a.qy)`<wui-icon name="chevronBottom" size="sm" color="default"></wui-icon>`}};tl.styles=[U.W5,U.fD,ts],tc([(0,r.MZ)()],tl.prototype,"address",void 0),tc([(0,r.MZ)()],tl.prototype,"profileName",void 0),tc([(0,r.MZ)()],tl.prototype,"alt",void 0),tc([(0,r.MZ)()],tl.prototype,"imageSrc",void 0),tc([(0,r.MZ)()],tl.prototype,"icon",void 0),tc([(0,r.MZ)()],tl.prototype,"iconSize",void 0),tc([(0,r.MZ)({type:Boolean})],tl.prototype,"enableGreenCircle",void 0),tc([(0,r.MZ)({type:Boolean})],tl.prototype,"loading",void 0),tc([(0,r.MZ)({type:Number})],tl.prototype,"charsStart",void 0),tc([(0,r.MZ)({type:Number})],tl.prototype,"charsEnd",void 0),tl=tc([(0,D.E)("wui-wallet-switch")],tl),i(41699);let tu=(0,a.AH)`
1092  :host {
1093    display: block;
1094  }
1095`,td=class extends a.WF{render(){return(0,a.qy)`
1096      <wui-flex flexDirection="column" gap="4">
1097        <wui-flex alignItems="center" justifyContent="space-between">
1098          <wui-text variant="md-regular" color="secondary">Pay</wui-text>
1099          <wui-shimmer width="60px" height="16px" borderRadius="4xs" variant="light"></wui-shimmer>
1100        </wui-flex>
1101
1102        <wui-flex alignItems="center" justifyContent="space-between">
1103          <wui-text variant="md-regular" color="secondary">Network Fee</wui-text>
1104
1105          <wui-flex flexDirection="column" alignItems="flex-end" gap="2">
1106            <wui-shimmer
1107              width="75px"
1108              height="16px"
1109              borderRadius="4xs"
1110              variant="light"
1111            ></wui-shimmer>
1112
1113            <wui-flex alignItems="center" gap="01">
1114              <wui-shimmer width="14px" height="14px" rounded variant="light"></wui-shimmer>
1115              <wui-shimmer
1116                width="49px"
1117                height="14px"
1118                borderRadius="4xs"
1119                variant="light"
1120              ></wui-shimmer>
1121            </wui-flex>
1122          </wui-flex>
1123        </wui-flex>
1124
1125        <wui-flex alignItems="center" justifyContent="space-between">
1126          <wui-text variant="md-regular" color="secondary">Service Fee</wui-text>
1127          <wui-shimmer width="75px" height="16px" borderRadius="4xs" variant="light"></wui-shimmer>
1128        </wui-flex>
1129      </wui-flex>
1130    `}};td.styles=[tu],td=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n}([(0,_.EM)("w3m-pay-fees-skeleton")],td);let tp=(0,_.AH)`
1131  :host {
1132    display: block;
1133  }
1134
1135  wui-image {
1136    border-radius: ${({borderRadius:e})=>e.round};
1137  }
1138`;var th=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tm=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.quote=e3.state.quote,this.unsubscribe.push(e3.subscribeKey("quote",e=>this.quote=e))}
1138disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=b.S.formatNumber(this.quote?.origin.amount||"0",{decimals:this.quote?.origin.currency.metadata.decimals??0,round:6}).toString();return(0,a.qy)`
1139      <wui-flex flexDirection="column" gap="4">
1140        <wui-flex alignItems="center" justifyContent="space-between">
1141          <wui-text variant="md-regular" color="secondary">Pay</wui-text>
1142          <wui-text variant="md-regular" color="primary">
1143            ${e} ${this.quote?.origin.currency.metadata.symbol||"Unknown"}
1144          </wui-text>
1145        </wui-flex>
1146
1147        ${this.quote&&this.quote.fees.length>0?this.quote.fees.map(e=>this.renderFee(e)):null}
1148      </wui-flex>
1149    `}renderFee(e){let t="network"===e.id,i=b.S.formatNumber(e.amount||"0",{decimals:e.currency.metadata.decimals??0,round:6}).toString();if(t){let t=c.W.getAllRequestedCaipNetworks().find(t=>ek.y.isLowerCaseMatch(t.caipNetworkId,e.currency.network));return(0,a.qy)`
1150        <wui-flex alignItems="center" justifyContent="space-between">
1151          <wui-text variant="md-regular" color="secondary">${e.label}</wui-text>
1152
1153          <wui-flex flexDirection="column" alignItems="flex-end" gap="2">
1154            <wui-text variant="md-regular" color="primary">
1155              ${i} ${e.currency.metadata.symbol||"Unknown"}
1156            </wui-text>
1157
1158            <wui-flex alignItems="center" gap="01">
1159              <wui-image
1160                src=${(0,o.J)(K.$.getNetworkImage(t))}
1161                size="xs"
1162              ></wui-image>
1163              <wui-text variant="sm-regular" color="secondary">
1164                ${t?.name||"Unknown"}
1165              </wui-text>
1166            </wui-flex>
1167          </wui-flex>
1168        </wui-flex>
1169      `}return(0,a.qy)`
1170      <wui-flex alignItems="center" justifyContent="space-between">
1171        <wui-text variant="md-regular" color="secondary">${e.label}</wui-text>
1172        <wui-text variant="md-regular" color="primary">
1173          ${i} ${e.currency.metadata.symbol||"Unknown"}
1174        </wui-text>
1175      </wui-flex>
1176    `}};tm.styles=[tp],th([(0,r.wk)()],tm.prototype,"quote",void 0),tm=th([(0,_.EM)("w3m-pay-fees")],tm);let tw=(0,_.AH)`
1177  :host {
1178    display: block;
1179    width: 100%;
1180  }
1181
1182  .disabled-container {
1183    padding: ${({spacing:e})=>e[2]};
1184    min-height: 168px;
1185  }
1186
1187  wui-icon {
1188    width: ${({spacing:e})=>e[8]};
1189    height: ${({spacing:e})=>e[8]};
1190  }
1191
1192  wui-flex > wui-text {
1193    max-width: 273px;
1194  }
1195`;var tg=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let ty=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.selectedExchange=e3.state.selectedExchange,this.unsubscribe.push(e3.subscribeKey("selectedExchange",e=>this.selectedExchange=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=!!this.selectedExchange;return(0,a.qy)`
1196      <wui-flex
1197        flexDirection="column"
1198        alignItems="center"
1199        justifyContent="center"
1200        gap="3"
1201        class="disabled-container"
1202      >
1203        <wui-icon name="coins" color="default" size="inherit"></wui-icon>
1204
1205        <wui-text variant="md-regular" color="primary" align="center">
1206          You don't have enough funds to complete this transaction
1207        </wui-text>
1208
1209        ${e?null:(0,a.qy)`<wui-button
1210              size="md"
1211              variant="neutral-secondary"
1212              @click=${this.dispatchConnectOtherWalletEvent.bind(this)}
1213              >Connect other wallet</wui-button
1214            >`}
1215      </wui-flex>
1216    `}dispatchConnectOtherWalletEvent(){this.dispatchEvent(new CustomEvent("connectOtherWallet",{detail:!0,bubbles:!0,composed:!0}))}};ty.styles=[tw],tg([(0,r.MZ)({type:Array})],ty.prototype,"selectedExchange",void 0),ty=tg([(0,_.EM)("w3m-pay-options-empty")],ty);let tf=(0,_.AH)`
1217  :host {
1218    display: block;
1219    width: 100%;
1220  }
1221
1222  .pay-options-container {
1223    max-height: 196px;
1224    overflow-y: auto;
1225    overflow-x: hidden;
1226    scrollbar-width: none;
1227  }
1228
1229  .pay-options-container::-webkit-scrollbar {
1230    display: none;
1231  }
1232
1233  .pay-option-container {
1234    border-radius: ${({borderRadius:e})=>e[4]};
1235    padding: ${({spacing:e})=>e[3]};
1236    min-height: 60px;
1237  }
1238
1239  .token-images-container {
1240    position: relative;
1241    justify-content: center;
1242    align-items: center;
1243  }
1244
1245  .chain-image {
1246    position: absolute;
1247    bottom: -3px;
1248    right: -5px;
1249    border: 2px solid ${({tokens:e})=>e.theme.foregroundSecondary};
1250  }
1251`,tb=class extends a.WF{render(){return(0,a.qy)`
1252      <wui-flex flexDirection="column" gap="2" class="pay-options-container">
1253        ${this.renderOptionEntry()} ${this.renderOptionEntry()} ${this.renderOptionEntry()}
1254      </wui-flex>
1255    `}renderOptionEntry(){return(0,a.qy)`
1256      <wui-flex
1257        alignItems="center"
1258        justifyContent="space-between"
1259        gap="2"
1260        class="pay-option-container"
1261      >
1262        <wui-flex alignItems="center" gap="2">
1263          <wui-flex class="token-images-container">
1264            <wui-shimmer
1265              width="32px"
1266              height="32px"
1267              rounded
1268              variant="light"
1269              class="token-image"
1270            ></wui-shimmer>
1271            <wui-shimmer
1272              width="16px"
1273              height="16px"
1274              rounded
1275              variant="light"
1276              class="chain-image"
1277            ></wui-shimmer>
1278          </wui-flex>
1279
1280          <wui-flex flexDirection="column" gap="1">
1281            <wui-shimmer
1282              width="74px"
1283              height="16px"
1284              borderRadius="4xs"
1285              variant="light"
1286            ></wui-shimmer>
1287            <wui-shimmer
1288              width="46px"
1289              height="14px"
1290              borderRadius="4xs"
1291              variant="light"
1292            ></wui-shimmer>
1293          </wui-flex>
1294        </wui-flex>
1295      </wui-flex>
1296    `}};tb.styles=[tf],tb=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n}([(0,_.EM)("w3m-pay-options-skeleton")],tb);let tv=(0,_.AH)`
1297  :host {
1298    display: block;
1299    width: 100%;
1300  }
1301
1302  .pay-options-container {
1303    max-height: 196px;
1304    overflow-y: auto;
1305    overflow-x: hidden;
1306    scrollbar-width: none;
1307    mask-image: var(--options-mask-image);
1308    -webkit-mask-image: var(--options-mask-image);
1309  }
1310
1311  .pay-options-container::-webkit-scrollbar {
1312    display: none;
1313  }
1314
1315  .pay-option-container {
1316    cursor: pointer;
1317    border-radius: ${({borderRadius:e})=>e[4]};
1318    padding: ${({spacing:e})=>e[3]};
1319    transition: background-color ${({durations:e})=>e.lg}
1320      ${({easings:e})=>e["ease-out-power-1"]};
1321    will-change: background-color;
1322  }
1323
1324  .token-images-container {
1325    position: relative;
1326    justify-content: center;
1327    align-items: center;
1328  }
1329
1330  .token-image {
1331    border-radius: ${({borderRadius:e})=>e.round};
1332    width: 32px;
1333    height: 32px;
1334  }
1335
1336  .chain-image {
1337    position: absolute;
1338    width: 16px;
1339    height: 16px;
1340    bottom: -3px;
1341    right: -5px;
1342    border-radius: ${({borderRadius:e})=>e.round};
1343    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
1344  }
1345
1346  @media (hover: hover) and (pointer: fine) {
1347    .pay-option-container:hover {
1348      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1349    }
1350  }
1351`;var tk=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tx=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.options=[],this.selectedPaymentAsset=null}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.resizeObserver?.disconnect();let e=this.shadowRoot?.querySelector(".pay-options-container");e?.removeEventListener("scroll",this.handleOptionsListScroll.bind(this))}firstUpdated(){let e=this.shadowRoot?.querySelector(".pay-options-container");e&&(requestAnimationFrame(this.handleOptionsListScroll.bind(this)),e?.addEventListener("scroll",this.handleOptionsListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleOptionsListScroll()}),this.resizeObserver?.observe(e),this.handleOptionsListScroll())}render(){return(0,a.qy)`
1352      <wui-flex flexDirection="column" gap="2" class="pay-options-container">
1353        ${this.options.map(e=>this.payOptionTemplate(e))}
1354      </wui-flex>
1355    `}payOptionTemplate(e){let{network:t,metadata:i,asset:r,amount:n="0"}=e,s=c.W.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===t),l=`${t}:${r}`,u=`${this.selectedPaymentAsset?.network}:${this.selectedPaymentAsset?.asset}`,d=b.S.bigNumber(n,{safe:!0}),p=d.gt(0);return(0,a.qy)`
1356      <wui-flex
1357        alignItems="center"
1358        justifyContent="space-between"
1359        gap="2"
1360        @click=${()=>this.onSelect?.(e)}
1361        class="pay-option-container"
1362      >
1363        <wui-flex alignItems="center" gap="2">
1364          <wui-flex class="token-images-container">
1365            <wui-image
1366              src=${(0,o.J)(i.logoURI)}
1367              class="token-image"
1368              size="3xl"
1369            ></wui-image>
1370            <wui-image
1371              src=${(0,o.J)(K.$.getNetworkImage(s))}
1372              class="chain-image"
1373              size="md"
1374            ></wui-image>
1375          </wui-flex>
1376
1377          <wui-flex flexDirection="column" gap="1">
1378            <wui-text variant="lg-regular" color="primary">${i.symbol}</wui-text>
1379            ${p?(0,a.qy)`<wui-text variant="sm-regular" color="secondary">
1380                  ${d.round(6).toString()} ${i.symbol}
1381                </wui-text>`:null}
1382          </wui-flex>
1383        </wui-flex>
1384
1385        ${l===u?(0,a.qy)`<wui-icon name="checkmark" size="md" color="success"></wui-icon>`:null}
1386      </wui-flex>
1387    `}handleOptionsListScroll(){let e=this.shadowRoot?.querySelector(".pay-options-container");e&&(e.scrollHeight>300?(e.style.setProperty("--options-mask-image",`linear-gradient(
1388          to bottom,
1389          rgba(0, 0, 0, calc(1 - var(--options-scroll--top-opacity))) 0px,
1390          rgba(200, 200, 200, calc(1 - var(--options-scroll--top-opacity))) 1px,
1391          black 50px,
1392          black calc(100% - 50px),
1393          rgba(155, 155, 155, calc(1 - var(--options-scroll--bottom-opacity))) calc(100% - 1px),
1394          rgba(0, 0, 0, calc(1 - var(--options-scroll--bottom-opacity))) 100%
1395        )`),e.style.setProperty("--options-scroll--top-opacity",_.z8.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--options-scroll--bottom-opacity",_.z8.interpolate([0,50],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString())):(e.style.setProperty("--options-mask-image","none"),e.style.setProperty("--options-scroll--top-opacity","0"),e.style.setProperty("--options-scroll--bottom-opacity","0")))}};tx.styles=[tv],tk([(0,r.MZ)({type:Array})],tx.prototype,"options",void 0),tk([(0,r.MZ)()],tx.prototype,"selectedPaymentAsset",void 0),tk([(0,r.MZ)()],tx.prototype,"onSelect",void 0),tx=tk([(0,_.EM)("w3m-pay-options")],tx);let tT=(0,_.AH)`
1396  .payment-methods-container {
1397    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1398    border-top-right-radius: ${({borderRadius:e})=>e[5]};
1399    border-top-left-radius: ${({borderRadius:e})=>e[5]};
1400  }
1401
1402  .pay-options-container {
1403    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1404    border-radius: ${({borderRadius:e})=>e[5]};
1405    padding: ${({spacing:e})=>e[1]};
1406  }
1407
1408  w3m-tooltip-trigger {
1409    display: flex;
1410    align-items: center;
1411    justify-content: center;
1412    max-width: fit-content;
1413  }
1414
1415  wui-image {
1416    border-radius: ${({borderRadius:e})=>e.round};
1417  }
1418
1419  w3m-pay-options.disabled {
1420    opacity: 0.5;
1421    pointer-events: none;
1422  }
1423`;var tA=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tS={eip155:"ethereum",solana:"solana",bip122:"bitcoin",ton:"ton"},tI={eip155:{icon:tS.eip155,label:"EVM"},solana:{icon:tS.solana,label:"Solana"},bip122:{icon:tS.bip122,label:"Bitcoin"},ton:{icon:tS.ton,label:"Ton"}},tE=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.profileName=null,this.paymentAsset=e3.state.paymentAsset,this.namespace=void 0,this.caipAddress=void 0,this.amount=e3.state.amount,this.recipient=e3.state.recipient,this.activeConnectorIds=l.a.state.activeConnectorIds,this.selectedPaymentAsset=e3.state.selectedPaymentAsset,this.selectedExchange=e3.state.selectedExchange,this.isFetchingQuote=e3.state.isFetchingQuote,this.quoteError=e3.state.quoteError,this.quote=e3.state.quote,this.isFetchingTokenBalances=e3.state.isFetchingTokenBalances,this.tokenBalances=e3.state.tokenBalances,this.isPaymentInProgress=e3.state.isPaymentInProgress,this.exchangeUrlForQuote=e3.state.exchangeUrlForQuote,this.completedTransactionsCount=0,this.unsubscribe.push(e3.subscribeKey("paymentAsset",e=>this.paymentAsset=e)),this.unsubscribe.push(e3.subscribeKey("tokenBalances",e=>this.onTokenBalancesChanged(e))),this.unsubscribe.push(e3.subscribeKey("isFetchingTokenBalances",e=>this.isFetchingTokenBalances=e)),this.unsubscribe.push(l.a.subscribeKey("activeConnectorIds",e=>this.activeConnectorIds=e)),this.unsubscribe.push(e3.subscribeKey("selectedPaymentAsset",e=>this.selectedPaymentAsset=e)),this.unsubscribe.push(e3.subscribeKey("isFetchingQuote",e=>this.isFetchingQuote=e)),this.unsubscribe.push(e3.subscribeKey("quoteError",e=>this.quoteError=e)),this.unsubscribe.push(e3.subscribeKey("quote",e=>this.quote=e)),this.unsubscribe.push(e3.subscribeKey("amount",e=>this.amount=e)),this.unsubscribe.push(e3.subscribeKey("recipient",e=>this.recipient=e)),this.unsubscribe.push(e3.subscribeKey("isPaymentInProgress",e=>this.isPaymentInProgress=e)),this.unsubscribe.push(e3.subscribeKey("selectedExchange",e=>this.selectedExchange=e)),this.unsubscribe.push(e3.subscribeKey("exchangeUrlForQuote",e=>this.exchangeUrlForQuote=e)),this.resetQuoteState(),this.initializeNamespace(),this.fetchTokens()}disconnectedCallback(){super.disconnectedCallback(),this.resetAssetsState(),this.unsubscribe.forEach(e
1423=>e())}updated(e){super.updated(e),e.has("selectedPaymentAsset")&&this.fetchQuote()}render(){return(0,a.qy)`
1424      <wui-flex flexDirection="column">
1425        ${this.profileTemplate()}
1426
1427        <wui-flex
1428          flexDirection="column"
1429          gap="4"
1430          class="payment-methods-container"
1431          .padding=${["4","4","5","4"]}
1432        >
1433          ${this.paymentOptionsViewTemplate()} ${this.amountWithFeeTemplate()}
1434
1435          <wui-flex
1436            alignItems="center"
1437            justifyContent="space-between"
1438            .padding=${["1","0","1","0"]}
1439          >
1440            <wui-separator></wui-separator>
1441          </wui-flex>
1442
1443          ${this.paymentActionsTemplate()}
1444        </wui-flex>
1445      </wui-flex>
1446    `}profileTemplate(){if(this.selectedExchange){let e=b.S.formatNumber(this.quote?.origin.amount,{decimals:this.quote?.origin.currency.metadata.decimals??0}).toString();return(0,a.qy)`
1447        <wui-flex
1448          .padding=${["4","3","4","3"]}
1449          alignItems="center"
1450          justifyContent="space-between"
1451          gap="2"
1452        >
1453          <wui-text variant="lg-regular" color="secondary">Paying with</wui-text>
1454
1455          ${this.quote?(0,a.qy)`<wui-text variant="lg-regular" color="primary">
1456                ${b.S.bigNumber(e,{safe:!0}).round(6).toString()}
1457                ${this.quote.origin.currency.metadata.symbol}
1458              </wui-text>`:(0,a.qy)`<wui-shimmer width="80px" height="18px" variant="light"></wui-shimmer>`}
1459        </wui-flex>
1460      `}let e=S.w.getPlainAddress(this.caipAddress)??"",{name:t,image:i}=this.getWalletProperties({namespace:this.namespace}),{icon:r,label:n}=tI[this.namespace]??{};return(0,a.qy)`
1461      <wui-flex
1462        .padding=${["4","3","4","3"]}
1463        alignItems="center"
1464        justifyContent="space-between"
1465        gap="2"
1466      >
1467        <wui-wallet-switch
1468          profileName=${(0,o.J)(this.profileName)}
1469          address=${(0,o.J)(e)}
1470          imageSrc=${(0,o.J)(i)}
1471          alt=${(0,o.J)(t)}
1472          @click=${this.onConnectOtherWallet.bind(this)}
1473          data-testid="wui-wallet-switch"
1474        ></wui-wallet-switch>
1475
1476        <wui-wallet-switch
1477          profileName=${(0,o.J)(n)}
1478          address=${(0,o.J)(e)}
1479          icon=${(0,o.J)(r)}
1480          iconSize="xs"
1481          .enableGreenCircle=${!1}
1482          alt=${(0,o.J)(n)}
1483          @click=${this.onConnectOtherWallet.bind(this)}
1484          data-testid="wui-wallet-switch"
1485        ></wui-wallet-switch>
1486      </wui-flex>
1487    `}initializeNamespace(){let e=c.W.state.activeChain;this.namespace=e,this.caipAddress=c.W.getAccountData(e)?.caipAddress,this.profileName=c.W.getAccountData(e)?.profileName??null,this.unsubscribe.push(c.W.subscribeChainProp("accountState",e=>this.onAccountStateChanged(e),e))}async fetchTokens(){if(this.namespace){let e;if(this.caipAddress){let{chainId:t,chainNamespace:i}=ev.C.parseCaipAddress(this.caipAddress),a=`${i}:${t}`;e=c.W.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===a)}await e3.fetchTokens({caipAddress:this.caipAddress,caipNetwork:e,namespace:this.namespace})}}fetchQuote(){if(this.amount&&this.recipient&&this.selectedPaymentAsset&&this.paymentAsset){let{address:e}=this.caipAddress?ev.C.parseCaipAddress(this.caipAddress):{};e3.fetchQuote({amount:this.amount.toString(),address:e,sourceToken:this.selectedPaymentAsset,toToken:this.paymentAsset,recipient:this.recipient})}}getWalletProperties({namespace:e}){if(!e)return{name:void 0,image:void 0};let t=this.activeConnectorIds[e];if(!t)return{name:void 0,image:void 0};let i=l.a.getConnector({id:t,namespace:e});if(!i)return{name:void 0,image:void 0};let a=K.$.getConnectorImage(i);return{name:i.name,image:a}}paymentOptionsViewTemplate(){return(0,a.qy)`
1488      <wui-flex flexDirection="column" gap="2">
1489        <wui-text variant="sm-regular" color="secondary">CHOOSE PAYMENT OPTION</wui-text>
1490        <wui-flex class="pay-options-container">${this.paymentOptionsTemplate()}</wui-flex>
1491      </wui-flex>
1492    `}paymentOptionsTemplate(){let e=this.getPaymentAssetFromTokenBalances();if(this.isFetchingTokenBalances)return(0,a.qy)`<w3m-pay-options-skeleton></w3m-pay-options-skeleton>`;if(0===e.length)return(0,a.qy)`<w3m-pay-options-empty
1493        @connectOtherWallet=${this.onConnectOtherWallet.bind(this)}
1494      ></w3m-pay-options-empty>`;let t={disabled:this.isFetchingQuote};return(0,a.qy)`<w3m-pay-options
1495      class=${(0,e4.H)(t)}
1496      .options=${e}
1497      .selectedPaymentAsset=${(0,o.J)(this.selectedPaymentAsset)}
1498      .onSelect=${this.onSelectedPaymentAssetChanged.bind(this)}
1499    ></w3m-pay-options>`}amountWithFeeTemplate(){return this.isFetchingQuote||!this.selectedPaymentAsset||this.quoteError?(0,a.qy)`<w3m-pay-fees-skeleton></w3m-pay-fees-skeleton>`:(0,a.qy)`<w3m-pay-fees></w3m-pay-fees>`}paymentActionsTemplate(){let e=this.isFetchingQuote||this.isFetchingTokenBalances,t=this.isFetchingQuote||this.isFetchingTokenBalances||!this.selectedPaymentAsset||!!this.quoteError,i=b.S.formatNumber(this.quote?.origin.amount??0,{decimals:this.quote?.origin.currency.metadata.decimals??0}).toString();return this.selectedExchange?e||t?(0,a.qy)`
1500          <wui-shimmer width="100%" height="48px" variant="light" ?rounded=${!0}></wui-shimmer>
1501        `:(0,a.qy)`<wui-button
1502        size="lg"
1503        fullWidth
1504        variant="accent-secondary"
1505        @click=${this.onPayWithExchange.bind(this)}
1506      >
1507        ${`Continue in ${this.selectedExchange.name}`}
1508
1509        <wui-icon name="arrowRight" color="inherit" size="sm" slot="iconRight"></wui-icon>
1510      </wui-button>
1510`:(0,a.qy)`
1511      <wui-flex alignItems="center" justifyContent="space-between">
1512        <wui-flex flexDirection="column" gap="1">
1513          <wui-text variant="md-regular" color="secondary">Order Total</wui-text>
1514
1515          ${e||t?(0,a.qy)`<wui-shimmer width="58px" height="32px" variant="light"></wui-shimmer>`:(0,a.qy)`<wui-flex alignItems="center" gap="01">
1516                <wui-text variant="h4-regular" color="primary">${eY(i)}</wui-text>
1517
1518                <wui-text variant="lg-regular" color="secondary">
1519                  ${this.quote?.origin.currency.metadata.symbol||"Unknown"}
1520                </wui-text>
1521              </wui-flex>`}
1522        </wui-flex>
1523
1524        ${this.actionButtonTemplate({isLoading:e,isDisabled:t})}
1525      </wui-flex>
1526    `}actionButtonTemplate(e){let t=eq(this.quote),{isLoading:i,isDisabled:r}=e,o="Pay";return t.length>1&&0===this.completedTransactionsCount&&(o="Approve"),(0,a.qy)`
1527      <wui-button
1528        size="lg"
1529        variant="accent-primary"
1530        ?loading=${i||this.isPaymentInProgress}
1531        ?disabled=${r||this.isPaymentInProgress}
1532        @click=${()=>{t.length>0?this.onSendTransactions():this.onTransfer()}}
1533      >
1534        ${o}
1535        ${i?null:(0,a.qy)`<wui-icon
1536              name="arrowRight"
1537              color="inherit"
1538              size="sm"
1539              slot="iconRight"
1540            ></wui-icon>`}
1541      </wui-button>
1542    `}getPaymentAssetFromTokenBalances(){return this.namespace?(this.tokenBalances[this.namespace]??[]).map(e=>{try{let t=c.W.getAllRequestedCaipNetworks().find(t=>t.caipNetworkId===e.chainId),i=e.address;if(!t)throw Error(`Target network not found for balance chainId "${e.chainId}"`);if(ek.y.isLowerCaseMatch(e.symbol,t.nativeCurrency.symbol))i="native";else if(S.w.isCaipAddress(i)){let{address:e}=ev.C.parseCaipAddress(i);i=e}else if(!i)throw Error(`Balance address not found for balance symbol "${e.symbol}"`);return{network:t.caipNetworkId,asset:i,metadata:{name:e.name,symbol:e.symbol,decimals:Number(e.quantity.decimals),logoURI:e.iconUrl},amount:e.quantity.numeric}}catch(e){return null}}).filter(e=>!!e).filter(e=>{let{chainId:t}=ev.C.parseCaipNetworkId(e.network),{chainId:i}=ev.C.parseCaipNetworkId(this.paymentAsset.network);return!!ek.y.isLowerCaseMatch(e.asset,this.paymentAsset.asset)||!this.selectedExchange||!ek.y.isLowerCaseMatch(t.toString(),i.toString())}):[]}onTokenBalancesChanged(e){this.tokenBalances=e;let[t]=this.getPaymentAssetFromTokenBalances();t&&e3.setSelectedPaymentAsset(t)}async onConnectOtherWallet(){await l.a.connect(),await s.W.open({view:"PayQuote"})}onAccountStateChanged(e){let{address:t}=this.caipAddress?ev.C.parseCaipAddress(this.caipAddress):{};if(this.caipAddress=e?.caipAddress,this.profileName=e?.profileName??null,t){let{address:e}=this.caipAddress?ev.C.parseCaipAddress(this.caipAddress):{};e?ek.y.isLowerCaseMatch(e,t)||(this.resetAssetsState(),this.resetQuoteState(),this.fetchTokens()):s.W.close()}}onSelectedPaymentAssetChanged(e){this.isFetchingQuote||e3.setSelectedPaymentAsset(e)}async onTransfer(){let e=eO(this.quote);if(e){if(!ek.y.isLowerCaseMatch(this.selectedPaymentAsset?.asset,e.deposit.currency))throw Error("Quote asset is not the same as the selected payment asset");let t=this.selectedPaymentAsset?.amount??"0",i=b.S.formatNumber(e.deposit.amount,{decimals:this.selectedPaymentAsset?.metadata.decimals??0}).toString();if(!b.S.bigNumber(t).gte(i))return void g.P.showError("Insufficient funds");if(this.quote&&this.selectedPaymentAsset&&this.caipAddress&&this.namespace){let{address:t}=ev.C.parseCaipAddress(this.caipAddress);await e3.onTransfer({chainNamespace:this.namespace,fromAddress:t,toAddress:e.deposit.receiver,amount:i,paymentAsset:this.selectedPaymentAsset}),e3.setRequestId(e.requestId),d.I.push("PayLoading")}}}async onSendTransactions(){let e=this.selectedPaymentAsset?.amount??"0",t=b.S.formatNumber(this.quote?.origin.amount??0,{decimals:this.selectedPaymentAsset?.metadata.decimals??0}).toString();if(!b.S.bigNumber(e).gte(t))return void g.P.showError("Insufficient funds");let i=eq(this.quote),[a]=eq(this.quote,this.completedTransactionsCount);a&&this.namespace&&(await e3.onSendTransaction({namespace:this.namespace,transactionStep:a}),this.completedTransactionsCount+=1,this.completedTransactionsCount===i.length&&(e3.setRequestId(a.requestId),d.I.push("PayLoading")))}onPayWithExchange(){if(this.exchangeUrlForQuote){let e=S.w.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!e)throw Error("Could not create popup window");e.location.href=this.exchangeUrlForQuote;let t=eO(this.quote);t&&e3.setRequestId(t.requestId),e3.initiatePayment(),d.I.push("PayLoading")}}resetAssetsState(){e3.setSelectedPaymentAsset(null)}resetQuoteState(){e3.resetQuoteState()}};tE.styles=tT,tA([(0,r.wk)()],tE.prototype,"profileName",void 0),tA([(0,r.wk)()],tE.prototype,"paymentAsset",void 0),tA([(0,r.wk)()],tE.prototype,"namespace",void 0),tA([(0,r.wk)()],tE.prototype,"caipAddress",void 0),tA([(0,r.wk)()],tE.prototype,"amount",void 0),tA([(0,r.wk)()],tE.prototype,"recipient",void 0),tA([(0,r.wk)()],tE.prototype,"activeConnectorIds",void 0),tA([(0,r.wk)()],tE.prototype,"selectedPaymentAsset",void 0),tA([(0,r.wk)()],tE.prototype,"selectedExchange",void 0),tA([(0,r.wk)()],tE.prototype,"isFetchingQuote",void 0),tA([(0,r.wk)()],tE.prototype,"quoteError",void 0),tA([(0,r.wk)()],tE.prototype,"quote",void 0),tA([(0,r.wk)()],tE.prototype,"isFetchingTokenBalances",void 0),tA([(0,r.wk)()],tE.prototype,"tokenBalances",void 0),tA([(0,r.wk)()],tE.prototype,"isPaymentInProgress",void 0),tA([(0,r.wk)()],tE.prototype,"exchangeUrlForQuote",void 0),tA([(0,r.wk)()],tE.prototype,"completedTransactionsCount",void 0),tE=tA([(0,_.EM)("w3m-pay-quote-view")],tE);let tP=(0,_.AH)`
1543  wui-image {
1544    border-radius: ${({borderRadius:e})=>e.round};
1545  }
1546
1547  .transfers-badge {
1548    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1549    border: 1px solid ${({tokens:e})=>e.theme.foregroundSecondary};
1550    border-radius: ${({borderRadius:e})=>e[4]};
1551  }
1552`;var tC=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let t$=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.paymentAsset=e3.state.paymentAsset,this.amount=e3.state.amount,this.unsubscribe.push(e3.subscribeKey("paymentAsset",e=>{this.paymentAsset=e}),e3.subscribeKey("amount",e=>{this.amount=e}))}
1552disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=c.W.getAllRequestedCaipNetworks().find(e=>e.caipNetworkId===this.paymentAsset.network);return(0,a.qy)`<wui-flex
1553      alignItems="center"
1554      gap="1"
1555      .padding=${["1","2","1","1"]}
1556      class="transfers-badge"
1557    >
1558      <wui-image src=${(0,o.J)(this.paymentAsset.metadata.logoURI)} size="xl"></wui-image>
1559      <wui-text variant="lg-regular" color="primary">
1560        ${this.amount} ${this.paymentAsset.metadata.symbol}
1561      </wui-text>
1562      <wui-text variant="sm-regular" color="secondary">
1563        on ${e?.name??"Unknown"}
1564      </wui-text>
1565    </wui-flex>`}};t$.styles=[tP],tC([(0,r.MZ)()],t$.prototype,"paymentAsset",void 0),tC([(0,r.MZ)()],t$.prototype,"amount",void 0),t$=tC([(0,_.EM)("w3m-pay-header")],t$);let tN=(0,_.AH)`
1566  :host {
1567    height: 60px;
1568  }
1569
1570  :host > wui-flex {
1571    box-sizing: border-box;
1572    background-color: var(--local-header-background-color);
1573  }
1574
1575  wui-text {
1576    background-color: var(--local-header-background-color);
1577  }
1578
1579  wui-flex.w3m-header-title {
1580    transform: translateY(0);
1581    opacity: 1;
1582  }
1583
1584  wui-flex.w3m-header-title[view-direction='prev'] {
1585    animation:
1586      slide-down-out 120ms forwards ${({easings:e})=>e["ease-out-power-2"]},
1587      slide-down-in 120ms forwards ${({easings:e})=>e["ease-out-power-2"]};
1588    animation-delay: 0ms, 200ms;
1589  }
1590
1591  wui-flex.w3m-header-title[view-direction='next'] {
1592    animation:
1593      slide-up-out 120ms forwards ${({easings:e})=>e["ease-out-power-2"]},
1594      slide-up-in 120ms forwards ${({easings:e})=>e["ease-out-power-2"]};
1595    animation-delay: 0ms, 200ms;
1596  }
1597
1598  wui-icon-button[data-hidden='true'] {
1599    opacity: 0 !important;
1600    pointer-events: none;
1601  }
1602
1603  @keyframes slide-up-out {
1604    from {
1605      transform: translateY(0px);
1606      opacity: 1;
1607    }
1608    to {
1609      transform: translateY(3px);
1610      opacity: 0;
1611    }
1612  }
1613
1614  @keyframes slide-up-in {
1615    from {
1616      transform: translateY(-3px);
1617      opacity: 0;
1618    }
1619    to {
1620      transform: translateY(0);
1621      opacity: 1;
1622    }
1623  }
1624
1625  @keyframes slide-down-out {
1626    from {
1627      transform: translateY(0px);
1628      opacity: 1;
1629    }
1630    to {
1631      transform: translateY(-3px);
1632      opacity: 0;
1633    }
1634  }
1635
1636  @keyframes slide-down-in {
1637    from {
1638      transform: translateY(3px);
1639      opacity: 0;
1640    }
1641    to {
1642      transform: translateY(0);
1643      opacity: 1;
1644    }
1645  }
1646`;var tR=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tO=["SmartSessionList"],tq={PayWithExchange:_.f.tokens.theme.foregroundPrimary};function tW(){let e=d.I.state.data?.connector?.name,t=d.I.state.data?.wallet?.name,i=d.I.state.data?.network?.name,a=t??e,r=l.a.getConnectors(),o=1===r.length&&r[0]?.id==="w3m-email",n=c.W.getAccountData()?.socialProvider;return{Connect:`Connect ${o?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",UsageExceeded:"Usage Exceeded",ConnectingExternal:a??"Connect Wallet",ConnectingWalletConnect:a??"WalletConnect",ConnectingWalletConnectBasic:"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview Convert",Downloads:a?`Get ${a}`:"Downloads",EmailLogin:"Email Login",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a Wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Pay:"How you pay",ProfileWallets:"Wallets",SwitchNetwork:i??"Switch Network",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade Your Wallet",UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose Name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select Token",SwapPreview:"Preview Swap",WalletSend:"Send",WalletSendPreview:"Review Send",WalletSendSelectToken:"Select Token",WalletSendConfirmed:"Confirmed",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a Wallet?",ConnectWallets:"Connect Wallet",ConnectSocials:"All Socials",ConnectingSocial:n?n.charAt(0).toUpperCase()+n.slice(1):"Connect Social",ConnectingMultiChain:"Select Chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch Chain",SmartSessionCreated:void 0,SmartSessionList:"Smart Sessions",SIWXSignMessage:"Sign In",PayLoading:"Processing payment...",PayQuote:"Payment Quote",DataCapture:"Profile",DataCaptureOtpConfirm:"Confirm Email",FundWallet:"Fund Wallet",PayWithExchange:"Deposit from Exchange",PayWithExchangeSelectAsset:"Select Asset",SmartAccountSettings:"Smart Account Settings"}}let t_=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.heading=tW()[d.I.state.view],this.network=c.W.state.activeCaipNetwork,this.networkImage=K.$.getNetworkImage(this.network),this.showBack=!1,this.prevHistoryLength=1,this.view=d.I.state.view,this.viewDirection="",this.unsubscribe.push(Q.j.subscribeNetworkImages(()=>{this.networkImage=K.$.getNetworkImage(this.network)}),d.I.subscribeKey("view",e=>{setTimeout(()=>{this.view=e,this.heading=tW()[e]},es.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),c.W.subscribeKey("activeCaipNetwork",e=>{this.network=e,this.networkImage=K.$.getNetworkImage(this.network)}))}
1646disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){let e=tq[d.I.state.view]??_.f.tokens.theme.backgroundPrimary;return this.style.setProperty("--local-header-background-color",e),(0,a.qy)`
1647      <wui-flex
1648        .padding=${["0","4","0","4"]}
1649        justifyContent="space-between"
1650        alignItems="center"
1651      >
1652        ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
1653      </wui-flex>
1654    `}onWalletHelp(){N.E.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),d.I.push("WhatIsAWallet")}async onClose(){await m.safeClose()}rightHeaderTemplate(){let e=n.H?.state?.features?.smartSessions;return"Account"===d.I.state.view&&e?(0,a.qy)`<wui-flex>
1655      <wui-icon-button
1656        icon="clock"
1657        size="lg"
1658        iconSize="lg"
1659        type="neutral"
1660        variant="primary"
1661        @click=${()=>d.I.push("SmartSessionList")}
1662        data-testid="w3m-header-smart-sessions"
1663      ></wui-icon-button>
1664      ${this.closeButtonTemplate()}
1665    </wui-flex> `:this.closeButtonTemplate()}closeButtonTemplate(){return(0,a.qy)`
1666      <wui-icon-button
1667        icon="close"
1668        size="lg"
1669        type="neutral"
1670        variant="primary"
1671        iconSize="lg"
1672        @click=${this.onClose.bind(this)}
1673        data-testid="w3m-header-close"
1674      ></wui-icon-button>
1675    `}titleTemplate(){if("PayQuote"===this.view)return(0,a.qy)`<w3m-pay-header></w3m-pay-header>`;let e=tO.includes(this.view);return(0,a.qy)`
1676      <wui-flex
1677        view-direction="${this.viewDirection}"
1678        class="w3m-header-title"
1679        alignItems="center"
1680        gap="2"
1681      >
1682        <wui-text
1683          display="inline"
1684          variant="lg-regular"
1685          color="primary"
1686          data-testid="w3m-header-text"
1687        >
1688          ${this.heading}
1689        </wui-text>
1690        ${e?(0,a.qy)`<wui-tag variant="accent" size="md">Beta</wui-tag>`:null}
1691      </wui-flex>
1692    `}leftHeaderTemplate(){let{view:e}=d.I.state,t="Connect"===e,i=n.H.state.enableEmbedded,r=n.H.state.enableNetworkSwitch;return"Account"===e&&r?(0,a.qy)`<wui-select
1693        id="dynamic"
1694        data-testid="w3m-account-select-network"
1695        active-network=${(0,o.J)(this.network?.name)}
1696        @click=${this.onNetworks.bind(this)}
1697        imageSrc=${(0,o.J)(this.networkImage)}
1698      ></wui-select>`:this.showBack&&!("ApproveTransaction"===e||"ConnectingSiwe"===e||t&&i)?(0,a.qy)`<wui-icon-button
1699        data-testid="header-back"
1700        id="dynamic"
1701        icon="chevronLeft"
1702        size="lg"
1703        iconSize="lg"
1704        type="neutral"
1705        variant="primary"
1706        @click=${this.onGoBack.bind(this)}
1707      ></wui-icon-button>`:(0,a.qy)`<wui-icon-button
1708      data-hidden=${!t}
1709      id="dynamic"
1710      icon="helpCircle"
1711      size="lg"
1712      iconSize="lg"
1713      type="neutral"
1714      variant="primary"
1715      @click=${this.onWalletHelp.bind(this)}
1716    ></wui-icon-button>`}onNetworks(){this.isAllowedNetworkSwitch()&&(N.E.sendEvent({type:"track",event:"CLICK_NETWORKS"}),d.I.push("Networks"))}isAllowedNetworkSwitch(){let e=c.W.getAllRequestedCaipNetworks(),t=!!e&&e.length>1,i=e?.find(({id:e})=>e===this.network?.id);return t||!i}onViewChange(){let{history:e}=d.I.state,t=es.VIEW_DIRECTION.Next;e.length<this.prevHistoryLength&&(t=es.VIEW_DIRECTION.Prev),this.prevHistoryLength=e.length,this.viewDirection=t}async onHistoryChange(){let{history:e}=d.I.state,t=this.shadowRoot?.querySelector("#dynamic");e.length>1&&!this.showBack&&t?(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){d.I.goBack()}};t_.styles=tN,tR([(0,r.wk)()],t_.prototype,"heading",void 0),tR([(0,r.wk)()],t_.prototype,"network",void 0),tR([(0,r.wk)()],t_.prototype,"networkImage",void 0),tR([(0,r.wk)()],t_.prototype,"showBack",void 0),tR([(0,r.wk)()],t_.prototype,"prevHistoryLength",void 0),tR([(0,r.wk)()],t_.prototype,"view",void 0),tR([(0,r.wk)()],t_.prototype,"viewDirection",void 0),t_=tR([(0,_.EM)("w3m-header")],t_),i(21129),i(84042);let tU=(0,M.AH)`
1717  :host {
1718    display: flex;
1719    align-items: center;
1720    gap: ${({spacing:e})=>e[1]};
1721    padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]}
1722      ${({spacing:e})=>e[2]} ${({spacing:e})=>e[2]};
1723    border-radius: ${({borderRadius:e})=>e[20]};
1724    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1725    box-shadow:
1726      0px 0px 8px 0px rgba(0, 0, 0, 0.1),
1727      inset 0 0 0 1px ${({tokens:e})=>e.theme.borderPrimary};
1728    max-width: 320px;
1729  }
1730
1731  wui-icon-box {
1732    border-radius: ${({borderRadius:e})=>e.round} !important;
1733    overflow: hidden;
1734  }
1735
1736  wui-loading-spinner {
1737    padding: ${({spacing:e})=>e[1]};
1738    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
1739    border-radius: ${({borderRadius:e})=>e.round} !important;
1740  }
1741`;var tD=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tM=class extends a.WF{constructor(){super(...arguments),this.message="",this.variant="success"}render(){return(0,a.qy)`
1742      ${this.templateIcon()}
1743      <wui-text variant="lg-regular" color="primary" data-testid="wui-snackbar-message"
1744        >${this.message}</wui-text
1745      >
1746    `}templateIcon(){return"loading"===this.variant?(0,a.qy)`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:(0,a.qy)`<wui-icon-box
1747      size="md"
1748      color=${({success:"success",error:"error",warning:"warning",info:"default"})[this.variant]}
1749      icon=${({success:"checkmark",error:"warning",warning:"warningCircle",info:"info"})[this.variant]}
1750    ></wui-icon-box>`}};tM.styles=[U.W5,tU],tD([(0,r.MZ)()],tM.prototype,"message",void 0),tD([(0,r.MZ)()],tM.prototype,"variant",void 0),tM=tD([(0,D.E)("wui-snackbar")],tM);let tL=(0,a.AH)`
1751  :host {
1752    display: block;
1753    position: absolute;
1754    opacity: 0;
1755    pointer-events: none;
1756    top: 11px;
1757    left: 50%;
1758    width: max-content;
1759  }
1760`;var tF=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tz=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=g.P.state.open,this.unsubscribe.push(g.P.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e=>e())}render(){let{message:e,variant:t}=g.P.state;return(0,a.qy)` <wui-snackbar message=${e} variant=${t}></wui-snackbar> `}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout&&clearTimeout(this.timeout),g.P.state.autoClose&&(this.timeout=setTimeout(()=>g.P.hide(),2500))):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};tz.styles=tL,tF([(0,r.wk)()],tz.prototype,"open",void 0),tz=tF([(0,_.EM)("w3m-snackbar")],tz);let tB=(0,y.BX)({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),tj=(0,P.X)({state:tB,subscribe:e=>(0,y.B1)(tB,()=>e(tB)),subscribeKey:(e,t)=>(0,f.u$)(tB,e,t),showTooltip({message:e,triggerRect:t,variant:i}){tB.open=!0,tB.message=e,tB.triggerRect=t,tB.variant=i},hide(){tB.open=!1,tB.message="",tB.triggerRect={width:0,height:0,top:0,left:0}}}),tH=(0,a.AH)`
1761  :host {
1762    width: 100%;
1763    display: block;
1764  }
1765`;var tV=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tG=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.text="",this.open=tj.state.open,this.unsubscribe.push(d.I.subscribeKey("view",()=>{tj.hide()}),s.W.subscribeKey("open",e=>{e||tj.hide()}),tj.subscribeKey("open",e=>{this.open=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),tj.hide()}render(){return(0,a.qy)`
1766      <div
1767        @pointermove=${this.onMouseEnter.bind(this)}
1768        @pointerleave=${this.onMouseLeave.bind(this)}
1769      >
1770        ${this.renderChildren()}
1771      </div>
1772    `}renderChildren(){return(0,a.qy)`<slot></slot> `}onMouseEnter(){let e=this.getBoundingClientRect();if(!this.open){let t=document.querySelector("w3m-modal"),i={width:e.width,height:e.height,left:e.left,top:e.top};if(t){let a=t.getBoundingClientRect();i.left=e.left-(window.innerWidth-a.width)/2,i.top=e.top-(window.innerHeight-a.height)/2}tj.showTooltip({message:this.text,triggerRect:i,variant:"shade"})}}onMouseLeave(e){this.contains(e.relatedTarget)||tj.hide()}};tG.styles=[tH],tV([(0,r.MZ)()],tG.prototype,"text",void 0),tV([(0,r.wk)()],tG.prototype,"open",void 0),tG=tV([(0,_.EM)("w3m-tooltip-trigger")],tG);let tZ=(0,_.AH)`
1773  :host {
1774    pointer-events: none;
1775  }
1776
1777  :host > wui-flex {
1778    display: var(--w3m-tooltip-display);
1779    opacity: var(--w3m-tooltip-opacity);
1780    padding: 9px ${({spacing:e})=>e["3"]} 10px ${({spacing:e})=>e["3"]};
1781    border-radius: ${({borderRadius:e})=>e["3"]};
1782    color: ${({tokens:e})=>e.theme.backgroundPrimary};
1783    position: absolute;
1784    top: var(--w3m-tooltip-top);
1785    left: var(--w3m-tooltip-left);
1786    transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
1787    max-width: calc(var(--apkt-modal-width) - ${({spacing:e})=>e["5"]});
1788    transition: opacity ${({durations:e})=>e.lg}
1789      ${({easings:e})=>e["ease-out-power-2"]};
1790    will-change: opacity;
1791    opacity: 0;
1792    animation-duration: ${({durations:e})=>e.xl};
1793    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
1794    animation-name: fade-in;
1795    animation-fill-mode: forwards;
1796  }
1797
1798  :host([data-variant='shade']) > wui-flex {
1799    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1800  }
1801
1802  :host([data-variant='shade']) > wui-flex > wui-text {
1803    color: ${({tokens:e})=>e.theme.textSecondary};
1804  }
1805
1806  :host([data-variant='fill']) > wui-flex {
1807    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
1808    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
1809  }
1810
1811  wui-icon {
1812    position: absolute;
1813    width: 12px !important;
1814    height: 4px !important;
1815    color: ${({tokens:e})=>e.theme.foregroundPrimary};
1816  }
1817
1818  wui-icon[data-placement='top'] {
1819    bottom: 0px;
1820    left: 50%;
1821    transform: translate(-50%, 95%);
1822  }
1823
1824  wui-icon[data-placement='bottom'] {
1825    top: 0;
1826    left: 50%;
1827    transform: translate(-50%, -95%) rotate(180deg);
1828  }
1829
1830  wui-icon[data-placement='right'] {
1831    top: 50%;
1832    left: 0;
1833    transform: translate(-65%, -50%) rotate(90deg);
1834  }
1835
1836  wui-icon[data-placement='left'] {
1837    top: 50%;
1838    right: 0%;
1839    transform: translate(65%, -50%) rotate(270deg);
1840  }
1841
1842  @keyframes fade-in {
1843    from {
1844      opacity: 0;
1845    }
1846    to {
1847      opacity: 1;
1848    }
1849  }
1850`;var tY=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let tK=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.open=tj.state.open,this.message=tj.state.message,this.triggerRect=tj.state.triggerRect,this.variant=tj.state.variant,this.unsubscribe.push(tj.subscribe(e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant}))}
1850disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){this.dataset.variant=this.variant;let e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=`
1851    --w3m-tooltip-top: ${e}px;
1852    --w3m-tooltip-left: ${t}px;
1853    --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;
1854    --w3m-tooltip-display: ${this.open?"flex":"none"};
1855    --w3m-tooltip-opacity: ${+!!this.open};
1856    `,(0,a.qy)`<wui-flex>
1857      <wui-icon data-placement="top" size="inherit" name="cursor"></wui-icon>
1858      <wui-text color="primary" variant="sm-regular">${this.message}</wui-text>
1859    </wui-flex>`}};tK.styles=[tZ],tY([(0,r.wk)()],tK.prototype,"open",void 0),tY([(0,r.wk)()],tK.prototype,"message",void 0),tY([(0,r.wk)()],tK.prototype,"triggerRect",void 0),tY([(0,r.wk)()],tK.prototype,"variant",void 0),tK=tY([(0,_.EM)("w3m-tooltip")],tK);let tQ={getTabsByNamespace:e=>e&&e===v.o.CHAIN.EVM?n.H.state.remoteFeatures?.activity===!1?es.ACCOUNT_TABS.filter(e=>"Activity"!==e.label):es.ACCOUNT_TABS:[],isValidReownName:e=>/^[a-zA-Z0-9]+$/gu.test(e),isValidEmail:e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/gu.test(e),validateReownName:e=>e.replace(/\^/gu,"").toLowerCase().replace(/[^a-zA-Z0-9]/gu,""),hasFooter(){let e=d.I.state.view;if(es.VIEWS_WITH_LEGAL_FOOTER.includes(e)){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.H.state,i=n.H.state.features?.legalCheckbox;return(!!e||!!t)&&!i}return es.VIEWS_WITH_DEFAULT_FOOTER.includes(e)}};i(55877);let tJ=(0,_.AH)`
1860  :host wui-ux-by-reown {
1861    padding-top: 0;
1862  }
1863
1864  :host wui-ux-by-reown.branding-only {
1865    padding-top: ${({spacing:e})=>e["3"]};
1866  }
1867
1868  a {
1869    text-decoration: none;
1870    color: ${({tokens:e})=>e.core.textAccentPrimary};
1871    font-weight: 500;
1872  }
1873`;var tX=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let t0=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=n.H.state.remoteFeatures,this.unsubscribe.push(n.H.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.H.state,i=n.H.state.features?.legalCheckbox;return(e||t)&&!i?(0,a.qy)`
1874      <wui-flex flexDirection="column">
1875        <wui-flex .padding=${["4","3","3","3"]} justifyContent="center">
1876          <wui-text color="secondary" variant="md-regular" align="center">
1877            By connecting your wallet, you agree to our <br />
1878            ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
1879          </wui-text>
1880        </wui-flex>
1881        ${this.reownBrandingTemplate()}
1882      </wui-flex>
1883    `:(0,a.qy)`
1884        <wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex>
1885      `}andTemplate(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.H.state;return e&&t?"and":""}termsTemplate(){let{termsConditionsUrl:e}=n.H.state;return e?(0,a.qy)`<a href=${e} target="_blank" rel="noopener noreferrer"
1886      >Terms of Service</a
1887    >`:null}privacyTemplate(){let{privacyPolicyUrl:e}=n.H.state;return e?(0,a.qy)`<a href=${e} target="_blank" rel="noopener noreferrer"
1888      >Privacy Policy</a
1889    >`:null}reownBrandingTemplate(e=!1){return this.remoteFeatures?.reownBranding?e?(0,a.qy)`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:(0,a.qy)`<wui-ux-by-reown></wui-ux-by-reown>`:null}};t0.styles=[tJ],tX([(0,r.wk)()],t0.prototype,"remoteFeatures",void 0),t0=tX([(0,_.EM)("w3m-legal-footer")],t0),i(48352);let t3=(0,a.AH)``,t1=class extends a.WF{render(){let{termsConditionsUrl:e,privacyPolicyUrl:t}=n.H.state;return e||t?(0,a.qy)`
1890      <wui-flex
1891        .padding=${["4","3","3","3"]}
1892        flexDirection="column"
1893        alignItems="center"
1894        justifyContent="center"
1895        gap="3"
1896      >
1897        <wui-text color="secondary" variant="md-regular" align="center">
1898          We work with the best providers to give you the lowest fees and best support. More options
1899          coming soon!
1900        </wui-text>
1901
1902        ${this.howDoesItWorkTemplate()}
1903      </wui-flex>
1904    `:null}howDoesItWorkTemplate(){return(0,a.qy)` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
1905      <wui-icon size="xs" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
1906      How does it work?
1907    </wui-link>`}onWhatIsBuy(){N.E.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:(0,T.lj)(c.W.state.activeChain)===k.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),d.I.push("WhatIsABuy")}};t1.styles=[t3],t1=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n}([(0,_.EM)("w3m-onramp-providers-footer")],t1);let t2=(0,_.AH)`
1908  :host {
1909    display: block;
1910  }
1911
1912  div.container {
1913    position: absolute;
1914    bottom: 0;
1915    left: 0;
1916    right: 0;
1917    overflow: hidden;
1918    height: auto;
1919    display: block;
1920  }
1921
1922  div.container[status='hide'] {
1923    animation: fade-out;
1924    animation-duration: var(--apkt-duration-dynamic);
1925    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
1926    animation-fill-mode: both;
1927    animation-delay: 0s;
1928  }
1929
1930  div.container[status='show'] {
1931    animation: fade-in;
1932    animation-duration: var(--apkt-duration-dynamic);
1933    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
1934    animation-fill-mode: both;
1935    animation-delay: var(--apkt-duration-dynamic);
1936  }
1937
1938  @keyframes fade-in {
1939    from {
1940      opacity: 0;
1941      filter: blur(6px);
1942    }
1943    to {
1944      opacity: 1;
1945      filter: blur(0px);
1946    }
1947  }
1948
1949  @keyframes fade-out {
1950    from {
1951      opacity: 1;
1952      filter: blur(0px);
1953    }
1954    to {
1955      opacity: 0;
1956      filter: blur(6px);
1957    }
1958  }
1959`;var t5=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let t4=class extends a.WF{constructor(){super(...arguments),this.resizeObserver=void 0,this.unsubscribe=[],this.status="hide",this.view=d.I.state.view}firstUpdated(){this.status=tQ.hasFooter()?"show":"hide",this.unsubscribe.push(d.I.subscribeKey("view",e=>{this.view=e,this.status=tQ.hasFooter()?"show":"hide","hide"===this.status&&document.documentElement.style.setProperty("--apkt-footer-height","0px")})),this.resizeObserver=new ResizeObserver(e=>{for(let t of e)if(t.target===this.getWrapper()){let e=`${t.contentRect.height}px`;document.documentElement.style.setProperty("--apkt-footer-height",e)}}),this.resizeObserver.observe(this.getWrapper())}render(){return(0,a.qy)`
1960      <div class="container" status=${this.status}>${this.templatePageContainer()}</div>
1961    `}templatePageContainer(){return tQ.hasFooter()?(0,a.qy)` ${this.templateFooter()}`:null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return(0,a.qy)`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return(0,a.qy)`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return(0,a.qy)` <wui-flex
1962      class="footer-in"
1963      padding="3"
1964      flexDirection="column"
1965      gap="3"
1966      alignItems="center"
1967    >
1968      <wui-text variant="md-regular" color="secondary" align="center">
1969        Your connected wallet may not support some of the networks available for this dApp
1970      </wui-text>
1971      <wui-link @click=${this.onNetworkHelp.bind(this)}>
1972        <wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
1973        What is a network
1974      </wui-link>
1975    </wui-flex>`}onNetworkHelp(){N.E.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),d.I.push("WhatIsANetwork")}getWrapper(){return this.shadowRoot?.querySelector("div.container")}};t4.styles=[t2],t5([(0,r.wk)()],t4.prototype,"status",void 0),t5([(0,r.wk)()],t4.prototype,"view",void 0),t4=t5([(0,_.EM)("w3m-footer")],t4);let t6=(0,_.AH)`
1976  :host {
1977    display: block;
1978    width: inherit;
1979  }
1980`;var t8=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let t7=class extends a.WF{constructor(){super(),this.unsubscribe=[],this.viewState=d.I.state.view,this.history=d.I.state.history.join(","),this.unsubscribe.push(d.I.subscribeKey("view",()=>{this.history=d.I.state.history.join(","),document.documentElement.style.setProperty("--apkt-duration-dynamic","var(--apkt-durations-lg)")}))}
1980disconnectedCallback(){this.unsubscribe.forEach(e=>e()),document.documentElement.style.setProperty("--apkt-duration-dynamic","0s")}render(){return(0,a.qy)`${this.templatePageContainer()}`}templatePageContainer(){return(0,a.qy)`<w3m-router-container
1981      history=${this.history}
1982      .setView=${()=>{this.viewState=d.I.state.view}}
1983    >
1984      ${this.viewTemplate(this.viewState)}
1985    </w3m-router-container>`}viewTemplate(e){switch(e){case"AccountSettings":return(0,a.qy)`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return(0,a.qy)`<w3m-account-view></w3m-account-view>`;case"AllWallets":return(0,a.qy)`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return(0,a.qy)`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return(0,a.qy)`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return(0,a.qy)`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":default:return(0,a.qy)`<w3m-connect-view></w3m-connect-view>`;case"Create":return(0,a.qy)`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return(0,a.qy)`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return(0,a.qy)`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return(0,a.qy)`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return(0,a.qy)`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return(0,a.qy)`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return(0,a.qy)`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return(0,a.qy)`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return(0,a.qy)`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return(0,a.qy)`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return(0,a.qy)`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return(0,a.qy)`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return(0,a.qy)`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return(0,a.qy)`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return(0,a.qy)`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return(0,a.qy)`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return(0,a.qy)`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return(0,a.qy)`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return(0,a.qy)`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return(0,a.qy)`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return(0,a.qy)`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return(0,a.qy)`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return(0,a.qy)`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return(0,a.qy)`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return(0,a.qy)`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return(0,a.qy)`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return(0,a.qy)`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return(0,a.qy)`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return(0,a.qy)`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return(0,a.qy)`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return(0,a.qy)`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return(0,a.qy)`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return(0,a.qy)`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return(0,a.qy)`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return(0,a.qy)`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return(0,a.qy)`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return(0,a.qy)`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return(0,a.qy)`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return(0,a.qy)`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return(0,a.qy)`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return(0,a.qy)`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return(0,a.qy)`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return(0,a.qy)`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return(0,a.qy)`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return(0,a.qy)`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return(0,a.qy)`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return(0,a.qy)`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return(0,a.qy)`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return(0,a.qy)`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"PayQuote":return(0,a.qy)`<w3m-pay-quote-view></w3m-pay-quote-view>`;case"FundWallet":return(0,a.qy)`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return(0,a.qy)`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return(0,a.qy)`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`;case"UsageExceeded":return(0,a.qy)`<w3m-usage-exceeded-view></w3m-usage-exceeded-view>`;case"SmartAccountSettings":return(0,a.qy)`<w3m-smart-account-settings-view></w3m-smart-account-settings-view>`}}};t7.styles=[t6],t8([(0,r.wk)()],t7.prototype,"viewState",void 0),t8([(0,r.wk)()],t7.prototype,"history",void 0),t7=t8([(0,_.EM)("w3m-router")],t7);let t9=(0,_.AH)`
1986  :host {
1987    z-index: ${({tokens:e})=>e.core.zIndex};
1988    display: block;
1989    backface-visibility: hidden;
1990    will-change: opacity;
1991    position: fixed;
1992    top: 0;
1993    left: 0;
1994    right: 0;
1995    bottom: 0;
1996    pointer-events: none;
1997    opacity: 0;
1998    background-color: ${({tokens:e})=>e.theme.overlay};
1999    backdrop-filter: blur(0px);
2000    transition:
2001      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2002      backdrop-filter ${({durations:e})=>e.lg}
2003        ${({easings:e})=>e["ease-out-power-2"]};
2004    will-change: opacity;
2005  }
2006
2007  :host(.open) {
2008    opacity: 1;
2009    backdrop-filter: blur(8px);
2010  }
2011
2012  :host(.appkit-modal) {
2013    position: relative;
2014    pointer-events: unset;
2015    background: none;
2016    width: 100%;
2017    opacity: 1;
2018  }
2019
2020  wui-card {
2021    max-width: var(--apkt-modal-width);
2022    width: 100%;
2023    position: relative;
2024    outline: none;
2025    transform: translateY(4px);
2026    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.05);
2027    transition:
2028      transform ${({durations:e})=>e.lg}
2029        ${({easings:e})=>e["ease-out-power-2"]},
2030      border-radius ${({durations:e})=>e.lg}
2031        ${({easings:e})=>e["ease-out-power-1"]},
2032      background-color ${({durations:e})=>e.lg}
2033        ${({easings:e})=>e["ease-out-power-1"]},
2034      box-shadow ${({durations:e})=>e.lg}
2035        ${({easings:e})=>e["ease-out-power-1"]};
2036    will-change: border-radius, background-color, transform, box-shadow;
2037    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
2038    padding: var(--local-modal-padding);
2039    box-sizing: border-box;
2040  }
2041
2042  :host(.open) wui-card {
2043    transform: translateY(0px);
2044  }
2045
2046  wui-card::before {
2047    z-index: 1;
2048    pointer-events: none;
2049    content: '';
2050    position: absolute;
2051    inset: 0;
2052    border-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
2053    transition: box-shadow ${({durations:e})=>e.lg}
2054      ${({easings:e})=>e["ease-out-power-2"]};
2055    transition-delay: ${({durations:e})=>e.md};
2056    will-change: box-shadow;
2057  }
2058
2059  :host([data-mobile-fullscreen='true']) wui-card::before {
2060    border-radius: 0px;
2061  }
2062
2063  :host([data-border='true']) wui-card::before {
2064    box-shadow: inset 0px 0px 0px 4px ${({tokens:e})=>e.theme.foregroundSecondary};
2065  }
2066
2067  :host([data-border='false']) wui-card::before {
2068    box-shadow: inset 0px 0px 0px 1px ${({tokens:e})=>e.theme.borderPrimaryDark};
2069  }
2070
2071  :host([data-border='true']) wui-card {
2072    animation:
2073      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2074      card-background-border var(--apkt-duration-dynamic)
2075        ${({easings:e})=>e["ease-out-power-2"]};
2076    animation-fill-mode: backwards, both;
2077    animation-delay: var(--apkt-duration-dynamic);
2078  }
2079
2080  :host([data-border='false']) wui-card {
2081    animation:
2082      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2083      card-background-default var(--apkt-duration-dynamic)
2084        ${({easings:e})=>e["ease-out-power-2"]};
2085    animation-fill-mode: backwards, both;
2086    animation-delay: 0s;
2087  }
2088
2089  :host(.appkit-modal) wui-card {
2090    max-width: var(--apkt-modal-width);
2091  }
2092
2093  wui-card[shake='true'] {
2094    animation:
2095      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2096      w3m-shake ${({durations:e})=>e.xl}
2097        ${({easings:e})=>e["ease-out-power-2"]};
2098  }
2099
2100  wui-flex {
2101    overflow-x: hidden;
2102    overflow-y: auto;
2103    display: flex;
2104    align-items: center;
2105    justify-content: center;
2106    width: 100%;
2107    height: 100%;
2108  }
2109
2110  @media (max-height: 700px) and (min-width: 431px) {
2111    wui-flex {
2112      align-items: flex-start;
2113    }
2114
2115    wui-card {
2116      margin: var(--apkt-spacing-6) 0px;
2117    }
2118  }
2119
2120  @media (max-width: 430px) {
2121    :host([data-mobile-fullscreen='true']) {
2122      height: 100dvh;
2123    }
2124    :host([data-mobile-fullscreen='true']) wui-flex {
2125      align-items: stretch;
2126    }
2127    :host([data-mobile-fullscreen='true']) wui-card {
2128      max-width: 100%;
2129      height: 100%;
2130      border-radius: 0;
2131      border: none;
2132    }
2133    :host(:not([data-mobile-fullscreen='true'])) wui-flex {
2134      align-items: flex-end;
2135    }
2136
2137    :host(:not([data-mobile-fullscreen='true'])) wui-card {
2138      max-width: 100%;
2139      border-bottom: none;
2140    }
2141
2142    :host(:not([data-mobile-fullscreen='true'])) wui-card[data-embedded='true'] {
2143      border-bottom-left-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
2144      border-bottom-right-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
2145    }
2146
2147    :host(:not([data-mobile-fullscreen='true'])) wui-card:not([data-embedded='true']) {
2148      border-bottom-left-radius: 0px;
2149      border-bottom-right-radius: 0px;
2150    }
2151
2152    wui-card[shake='true'] {
2153      animation: w3m-shake 0.5s ${({easings:e})=>e["ease-out-power-2"]};
2154    }
2155  }
2156
2157  @keyframes fade-in {
2158    0% {
2159      transform: scale(0.99) translateY(4px);
2160    }
2161    100% {
2162      transform: scale(1) translateY(0);
2163    }
2164  }
2165
2166  @keyframes w3m-shake {
2167    0% {
2168      transform: scale(1) rotate(0deg);
2169    }
2170    20% {
2171      transform: scale(1) rotate(-1deg);
2172    }
2173    40% {
2174      transform: scale(1) rotate(1.5deg);
2175    }
2176    60% {
2177      transform: scale(1) rotate(-1.5deg);
2178    }
2179    80% {
2180      transform: scale(1) rotate(1deg);
2181    }
2182    100% {
2183      transform: scale(1) rotate(0deg);
2184    }
2185  }
2186
2187  @keyframes card-background-border {
2188    from {
2189      background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
2190    }
2191    to {
2192      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2193    }
2194  }
2195
2196  @keyframes card-background-default {
2197    from {
2198      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2199    }
2200    to {
2201      background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
2202    }
2203  }
2204`;var ie=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let it="scroll-lock",ii={PayWithExchange:"0",PayWithExchangeSelectAsset:"0",Pay:"0",PayQuote:"0",PayLoading:"0"};class ia extends a.WF{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.hasPrefetched=!1,this.enableEmbedded=n.H.state.enableEmbedded,this.open=s.W.state.open,this.caipAddress=c.W.state.activeCaipAddress,this.caipNetwork=c.W.state.activeCaipNetwork,this.shake=s.W.state.shake,this.filterByNamespace=l.a.state.filterByNamespace,this.padding=_.f.spacing[1],this.mobileFullScreen=n.H.state.enableMobileFullScreen,this.initializeTheming(),u.N.prefetchAnalyticsConfig(),this.unsubscribe.push(s.W.subscribeKey("open",e=>e?this.onOpen():this.onClose()),s.W.subscribeKey("shake",e=>this.shake=e),c.W.subscribeKey("activeCaipNetwork",e=>this.onNewNetwork(e)),c.W.subscribeKey("activeCaipAddress",e=>this.onNewAddress(e)),n.H.subscribeKey("enableEmbedded",e=>this.enableEmbedded=e),l.a.subscribeKey("filterByNamespace",e=>{this.filterByNamespace===e||c.W.getAccountData(e)?.caipAddress||(u.N.fetchRecommendedWallets(),this.filterByNamespace=e)}),d.I.subscribeKey("view",()=>{this.dataset.border=tQ.hasFooter()?"true":"false",this.padding=ii[d.I.state.view]??_.f.spacing[1]}))}firstUpdated(){if(this.dataset.border=tQ.hasFooter()?"true":"false",this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.caipAddress){if(this.enableEmbedded){s.W.close(),this.prefetch();return}this.onNewAddress(this.caipAddress)}this.open&&this.onOpen(),this.enableEmbedded&&this.prefetch()}
2204disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return(this.style.setProperty("--local-modal-padding",this.padding),this.enableEmbedded)?(0,a.qy)`${this.contentTemplate()}
2205        <w3m-tooltip></w3m-tooltip> `:this.open?(0,a.qy)`
2206          <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
2207            ${this.contentTemplate()}
2208          </wui-flex>
2209          <w3m-tooltip></w3m-tooltip>
2210        `:null}contentTemplate(){return(0,a.qy)` <wui-card
2211      shake="${this.shake}"
2212      data-embedded="${(0,o.J)(this.enableEmbedded)}"
2213      role="alertdialog"
2214      aria-modal="true"
2215      tabindex="0"
2216      data-testid="w3m-modal-card"
2217    >
2218      <w3m-header></w3m-header>
2219      <w3m-router></w3m-router>
2220      <w3m-footer></w3m-footer>
2221      <w3m-snackbar></w3m-snackbar>
2222      <w3m-alertbar></w3m-alertbar>
2223    </wui-card>`}async onOverlayClick(e){e.target===e.currentTarget&&(this.mobileFullScreen||await this.handleClose())}async handleClose(){await m.safeClose()}initializeTheming(){let{themeVariables:e,themeMode:t}=w.W.state,i=_.Zv.getColorTheme(t);(0,_.RF)(e,i)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),g.P.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){let e=document.createElement("style");e.dataset.w3m=it,e.textContent=`
2224      body {
2225        touch-action: none;
2226        overflow: hidden;
2227        overscroll-behavior: contain;
2228      }
2229      w3m-modal {
2230        pointer-events: auto;
2231      }
2232    `,document.head.appendChild(e)}onScrollUnlock(){let e=document.head.querySelector(`style[data-w3m="${it}"]`);e&&e.remove()}onAddKeyboardListener(){this.abortController=new AbortController;let e=this.shadowRoot?.querySelector("wui-card");e?.focus(),window.addEventListener("keydown",t=>{if("Escape"===t.key)this.handleClose();else if("Tab"===t.key){let{tagName:i}=t.target;!i||i.includes("W3M-")||i.includes("WUI-")||e?.focus()}},this.abortController)}onRemoveKeyboardListener(){this.abortController?.abort(),this.abortController=void 0}async onNewAddress(e){let t=c.W.state.isSwitchingNamespace,i="ProfileWallets"===d.I.state.view;e||t||i||s.W.close(),await h.U.initializeIfEnabled(e),this.caipAddress=e,c.W.setIsSwitchingNamespace(!1)}onNewNetwork(e){let t=this.caipNetwork,i=t?.caipNetworkId?.toString(),a=e?.caipNetworkId?.toString(),r="UnsupportedChain"===d.I.state.view,o=s.W.state.open,n=!1;this.enableEmbedded&&"SwitchNetwork"===d.I.state.view&&(n=!0),i!==a&&W.resetState(),o&&r&&(n=!0),n&&"SIWXSignMessage"!==d.I.state.view&&d.I.goBack(),this.caipNetwork=e}prefetch(){this.hasPrefetched||(u.N.prefetch(),u.N.fetchWalletsByPage({page:1}),this.hasPrefetched=!0)}}ia.styles=t9,ie([(0,r.MZ)({type:Boolean})],ia.prototype,"enableEmbedded",void 0),ie([(0,r.wk)()],ia.prototype,"open",void 0),ie([(0,r.wk)()],ia.prototype,"caipAddress",void 0),ie([(0,r.wk)()],ia.prototype,"caipNetwork",void 0),ie([(0,r.wk)()],ia.prototype,"shake",void 0),ie([(0,r.wk)()],ia.prototype,"filterByNamespace",void 0),ie([(0,r.wk)()],ia.prototype,"padding",void 0),ie([(0,r.wk)()],ia.prototype,"mobileFullScreen",void 0);let ir=class extends ia{};ir=ie([(0,_.EM)("w3m-modal")],ir);let io=class extends ia{};io=ie([(0,_.EM)("appkit-modal")],io);let is=(0,_.AH)`
2233  .icon-box {
2234    width: 64px;
2235    height: 64px;
2236    border-radius: ${({borderRadius:e})=>e[5]};
2237    background-color: ${({colors:e})=>e.semanticError010};
2238  }
2239`,ic=class extends a.WF{constructor(){super()}render(){return(0,a.qy)`
2240      <wui-flex
2241        flexDirection="column"
2242        alignItems="center"
2243        gap="4"
2244        .padding="${["1","3","4","3"]}"
2245      >
2246        <wui-flex justifyContent="center" alignItems="center" class="icon-box">
2247          <wui-icon size="xxl" color="error" name="warningCircle"></wui-icon>
2248        </wui-flex>
2249
2250        <wui-text variant="lg-medium" color="primary" align="center">
2251          The app isn't responding as expected
2252        </wui-text>
2253        <wui-text variant="md-regular" color="secondary" align="center">
2254          Try again or reach out to the app team for help.
2255        </wui-text>
2256
2257        <wui-button
2258          variant="neutral-secondary"
2259          size="md"
2260          @click=${this.onTryAgainClick.bind(this)}
2261          data-testid="w3m-usage-exceeded-button"
2262        >
2263          <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
2264          Try Again
2265        </wui-button>
2266      </wui-flex>
2267    `}onTryAgainClick(){d.I.goBack()}};ic.styles=is,ic=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n}([(0,_.EM)("w3m-usage-exceeded-view")],ic);var il=i(74548);i(78790);let iu=(0,_.AH)`
2268  :host {
2269    width: 100%;
2270  }
2271`;var id=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let ip=class extends a.WF{constructor(){super(...arguments),this.hasImpressionSent=!1,this.walletImages=[],this.imageSrc="",this.name="",this.size="md",this.tabIdx=void 0,this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100",this.rdnsId="",this.displayIndex=void 0,this.walletRank=void 0,this.namespaces=[]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.cleanupIntersectionObserver()}updated(e){super.updated(e),(e.has("name")||e.has("imageSrc")||e.has("walletRank"))&&(this.hasImpressionSent=!1),e.has("walletRank")&&this.walletRank&&!this.intersectionObserver&&this.setupIntersectionObserver()}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(e=>{!e.isIntersecting||this.loading||this.hasImpressionSent||this.sendImpressionEvent()})},{threshold:.1}),this.intersectionObserver.observe(this)}cleanupIntersectionObserver(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=void 0)}sendImpressionEvent(){this.name&&!this.hasImpressionSent&&this.walletRank&&(this.hasImpressionSent=!0,(this.rdnsId||this.name)&&N.E.sendWalletImpressionEvent({name:this.name,walletRank:this.walletRank,rdnsId:this.rdnsId,view:d.I.state.view,displayIndex:this.displayIndex}))}handleGetWalletNamespaces(){return Object.keys(il.q.state.adapters).length>1?this.namespaces:[]}render(){return(0,a.qy)`
2272      <wui-list-wallet
2273        .walletImages=${this.walletImages}
2274        imageSrc=${(0,o.J)(this.imageSrc)}
2275        name=${this.name}
2276        size=${(0,o.J)(this.size)}
2277        tagLabel=${(0,o.J)(this.tagLabel)}
2278        .tagVariant=${this.tagVariant}
2279        .walletIcon=${this.walletIcon}
2280        .tabIdx=${this.tabIdx}
2281        .disabled=${this.disabled}
2282        .showAllWallets=${this.showAllWallets}
2283        .loading=${this.loading}
2284        loadingSpinnerColor=${this.loadingSpinnerColor}
2285        .namespaces=${this.handleGetWalletNamespaces()}
2286      ></wui-list-wallet>
2287    `}};ip.styles=iu,id([(0,r.MZ)({type:Array})],ip.prototype,"walletImages",void 0),id([(0,r.MZ)()],ip.prototype,"imageSrc",void 0),id([(0,r.MZ)()],ip.prototype,"name",void 0),id([(0,r.MZ)()],ip.prototype,"size",void 0),id([(0,r.MZ)()],ip.prototype,"tagLabel",void 0),id([(0,r.MZ)()],ip.prototype,"tagVariant",void 0),id([(0,r.MZ)()],ip.prototype,"walletIcon",void 0),id([(0,r.MZ)()],ip.prototype,"tabIdx",void 0),id([(0,r.MZ)({type:Boolean})],ip.prototype,"disabled",void 0),id([(0,r.MZ)({type:Boolean})],ip.prototype,"showAllWallets",void 0),id([(0,r.MZ)({type:Boolean})],ip.prototype,"loading",void 0),id([(0,r.MZ)({type:String})],ip.prototype,"loadingSpinnerColor",void 0),id([(0,r.MZ)()],ip.prototype,"rdnsId",void 0),id([(0,r.MZ)()],ip.prototype,"displayIndex",void 0),id([(0,r.MZ)()],ip.prototype,"walletRank",void 0),id([(0,r.MZ)({type:Array})],ip.prototype,"namespaces",void 0),ip=id([(0,_.EM)("w3m-list-wallet")],ip);let ih=(0,_.AH)`
2288  :host {
2289    --local-duration-height: 0s;
2290    --local-duration: ${({durations:e})=>e.lg};
2291    --local-transition: ${({easings:e})=>e["ease-out-power-2"]};
2292  }
2293
2294  .container {
2295    display: block;
2296    overflow: hidden;
2297    overflow: hidden;
2298    position: relative;
2299    height: var(--local-container-height);
2300    transition: height var(--local-duration-height) var(--local-transition);
2301    will-change: height, padding-bottom;
2302  }
2303
2304  .container[data-mobile-fullscreen='true'] {
2305    overflow: scroll;
2306  }
2307
2308  .page {
2309    position: absolute;
2310    top: 0;
2311    left: 0;
2312    right: 0;
2313    width: 100%;
2314    height: auto;
2315    width: inherit;
2316    box-sizing: border-box;
2317    display: flex;
2318    flex-direction: column;
2319    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
2320    border-bottom-left-radius: var(--local-border-bottom-radius);
2321    border-bottom-right-radius: var(--local-border-bottom-radius);
2322    transition: border-bottom-left-radius var(--local-duration) var(--local-transition);
2323  }
2324
2325  .page[data-mobile-fullscreen='true'] {
2326    height: 100%;
2327  }
2328
2329  .page-content {
2330    display: flex;
2331    flex-direction: column;
2332    min-height: 100%;
2333  }
2334
2335  .footer {
2336    height: var(--apkt-footer-height);
2337  }
2338
2339  div.page[view-direction^='prev-'] .page-content {
2340    animation:
2341      slide-left-out var(--local-duration) forwards var(--local-transition),
2342      slide-left-in var(--local-duration) forwards var(--local-transition);
2343    animation-delay: 0ms, var(--local-duration, ${({durations:e})=>e.lg});
2344  }
2345
2346  div.page[view-direction^='next-'] .page-content {
2347    animation:
2348      slide-right-out var(--local-duration) forwards var(--local-transition),
2349      slide-right-in var(--local-duration) forwards var(--local-transition);
2350    animation-delay: 0ms, var(--local-duration, ${({durations:e})=>e.lg});
2351  }
2352
2353  @keyframes slide-left-out {
2354    from {
2355      transform: translateX(0px) scale(1);
2356      opacity: 1;
2357      filter: blur(0px);
2358    }
2359    to {
2360      transform: translateX(8px) scale(0.99);
2361      opacity: 0;
2362      filter: blur(4px);
2363    }
2364  }
2365
2366  @keyframes slide-left-in {
2367    from {
2368      transform: translateX(-8px) scale(0.99);
2369      opacity: 0;
2370      filter: blur(4px);
2371    }
2372    to {
2373      transform: translateX(0) translateY(0) scale(1);
2374      opacity: 1;
2375      filter: blur(0px);
2376    }
2377  }
2378
2379  @keyframes slide-right-out {
2380    from {
2381      transform: translateX(0px) scale(1);
2382      opacity: 1;
2383      filter: blur(0px);
2384    }
2385    to {
2386      transform: translateX(-8px) scale(0.99);
2387      opacity: 0;
2388      filter: blur(4px);
2389    }
2390  }
2391
2392  @keyframes slide-right-in {
2393    from {
2394      transform: translateX(8px) scale(0.99);
2395      opacity: 0;
2396      filter: blur(4px);
2397    }
2398    to {
2399      transform: translateX(0) translateY(0) scale(1);
2400      opacity: 1;
2401      filter: blur(0px);
2402    }
2403  }
2404`;var im=function(e,t,i,a){var r,o=arguments.length,n=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n};let iw=class extends a.WF{constructor(){super(...arguments),this.resizeObserver=void 0,this.transitionDuration="0.15s",this.transitionFunction="",this.history="",this.view="",this.setView=void 0,this.viewDirection="",this.historyState="",this.previousHeight="0px",this.mobileFullScreen=n.H.state.enableMobileFullScreen,this.onViewportResize=()=>{this.updateContainerHeight()}}updated(e){if(e.has("history")){let e=this.history;""!==this.historyState&&this.historyState!==e&&this.onViewChange(e)}e.has("transitionDuration")&&this.style.setProperty("--local-duration",this.transitionDuration),e.has("transitionFunction")&&this.style.setProperty("--local-transition",this.transitionFunction)}firstUpdated(){this.transitionFunction&&this.style.setProperty("--local-transition",this.transitionFunction),this.style.setProperty("--local-duration",this.transitionDuration),this.historyState=this.history,this.resizeObserver=new ResizeObserver(e=>{for(let t of e)if(t.target===this.getWrapper()){let e=t.contentRect.height,i=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0");
2404this.mobileFullScreen?(e=(window.visualViewport?.height||window.innerHeight)-this.getHeaderHeight()-i,this.style.setProperty("--local-border-bottom-radius","0px")):(e+=i,this.style.setProperty("--local-border-bottom-radius",i?"var(--apkt-borderRadius-5)":"0px")),this.style.setProperty("--local-container-height",`${e}px`),"0px"!==this.previousHeight&&this.style.setProperty("--local-duration-height",this.transitionDuration),this.previousHeight=`${e}px`}}),this.resizeObserver.observe(this.getWrapper()),this.updateContainerHeight(),window.addEventListener("resize",this.onViewportResize),window.visualViewport?.addEventListener("resize",this.onViewportResize)}disconnectedCallback(){let e=this.getWrapper();e&&this.resizeObserver&&this.resizeObserver.unobserve(e),window.removeEventListener("resize",this.onViewportResize),window.visualViewport?.removeEventListener("resize",this.onViewportResize)}render(){return(0,a.qy)`
2405      <div class="container" data-mobile-fullscreen="${(0,o.J)(this.mobileFullScreen)}">
2406        <div
2407          class="page"
2408          data-mobile-fullscreen="${(0,o.J)(this.mobileFullScreen)}"
2409          view-direction="${this.viewDirection}"
2410        >
2411          <div class="page-content">
2412            <slot></slot>
2413          </div>
2414        </div>
2415      </div>
2416    `}onViewChange(e){let t=e.split(",").filter(Boolean),i=this.historyState.split(",").filter(Boolean),a=i.length,r=t.length,o=t[t.length-1]||"",n=_.Zv.cssDurationToNumber(this.transitionDuration),s="";r>a?s="next":r<a?s="prev":r===a&&t[r-1]!==i[a-1]&&(s="next"),this.viewDirection=`${s}-${o}`,setTimeout(()=>{this.historyState=e,this.setView?.(o)},n),setTimeout(()=>{this.viewDirection=""},2*n)}getWrapper(){return this.shadowRoot?.querySelector("div.page")}updateContainerHeight(){let e=this.getWrapper();if(!e)return;let t=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0"),i=0;this.mobileFullScreen?(i=(window.visualViewport?.height||window.innerHeight)-this.getHeaderHeight()-t,this.style.setProperty("--local-border-bottom-radius","0px")):(i=e.getBoundingClientRect().height+t,this.style.setProperty("--local-border-bottom-radius",t?"var(--apkt-borderRadius-5)":"0px")),this.style.setProperty("--local-container-height",`${i}px`),"0px"!==this.previousHeight&&this.style.setProperty("--local-duration-height",this.transitionDuration),this.previousHeight=`${i}px`}getHeaderHeight(){return 60}};iw.styles=[ih],im([(0,r.MZ)({type:String})],iw.prototype,"transitionDuration",void 0),im([(0,r.MZ)({type:String})],iw.prototype,"transitionFunction",void 0),im([(0,r.MZ)({type:String})],iw.prototype,"history",void 0),im([(0,r.MZ)({type:String})],iw.prototype,"view",void 0),im([(0,r.MZ)({attribute:!1})],iw.prototype,"setView",void 0),im([(0,r.wk)()],iw.prototype,"viewDirection",void 0),im([(0,r.wk)()],iw.prototype,"historyState",void 0),im([(0,r.wk)()],iw.prototype,"previousHeight",void 0),im([(0,r.wk)()],iw.prototype,"mobileFullScreen",void 0),iw=im([(0,_.EM)("w3m-router-container")],iw)}}]);

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.