PageSourceSearch

https://stellar-void.netlify.app/assets/w3m-modal-B5rN9-HM.js

js stellar-void.netlify.app collected 2026-10-03 11:27:11 UTC 82,678 bytes, 1,209 lines download raw bytes

1import{N as b,t as _e,w as Be,l as Te,u as Ue,v as ze,n as f,a as ye,y as Ye,C as me,c as z,S as v,R as p,z as Z,B as J,D as Xe,F as te,b as de,E as M,G as ue,I as pe,M as R,J as Fe,d as A,r as se,i as x,x as l,h as Le,K as he,g as ke,e as qe,L as Y,O as y,s as He,A as le,T as Qe,P as Ze}from"./core-BZ7irhOn.js";import{c as T,n as m,o as O,r as h,U as je}from"./index-6Nlc7-x6.js";import"./index-sZawWQES.js";const j={getGasPriceInEther(e,t){const o=t*e;return Number(o)/1e18},getGasPriceInUSD(e,t,o){const i=j.getGasPriceInEther(t,o);return b.bigNumber(e).times(i).toNumber()},getPriceImpact({sourceTokenAmount:e,sourceTokenPriceInUSD:t,toTokenPriceInUSD:o,toTokenAmount:i}){const a=b.bigNumber(e).times(t),n=b.bigNumber(i).times(o);return a.minus(n).div(a).times(100).toNumber()},getMaxSlippage(e,t){const o=b.bigNumber(e).div(100);return b.multiply(t,o).toNumber()},getProviderFee(e,t=.0085){return b.bigNumber(e).times(t).toString()},isInsufficientNetworkTokenForGas(e,t){const o=t||"0";return b.bigNumber(e).eq(0)?!0:b.bigNumber(b.bigNumber(o)).gt(e)},isInsufficientSourceTokenForSwap(e,t,o){var n,s;const i=(s=(n=o==null?void 0:o.find(c=>c.address===t))==null?void 0:n.quantity)==null?void 0:s.numeric;return b.bigNumber(i||"0").lt(e)}},We=15e4,Je=6,S={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:Te.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},r=_e({...S}),we={state:r,subscribe(e){return Ue(r,()=>e(r))},subscribeKey(e,t){return ze(r,e,t)},getParams(){var d,w,g,P,E,F,L,H,Q;const e=f.state.activeChain,t=((d=f.getAccountData(e))==null?void 0:d.caipAddress)??f.state.activeCaipAddress,o=ye.getPlainAddress(t),i=Ye(),a=me.getConnectorId(f.state.activeChain);if(!o)throw new Error("No address found to swap the tokens from.");const n=!((w=r.toToken)!=null&&w.address)||!((g=r.toToken)!=null&&g.decimals),s=!((P=r.sourceToken)!=null&&P.address)||!((E=r.sourceToken)!=null&&E.decimals)||!b.bigNumber(r.sourceTokenAmount).gt(0),c=!r.sourceTokenAmount;return{networkAddress:i,fromAddress:o,fromCaipAddress:t,sourceTokenAddress:(F=r.sourceToken)==null?void 0:F.address,toTokenAddress:(L=r.toToken)==null?void 0:L.address,toTokenAmount:r.toTokenAmount,toTokenDecimals:(H=r.toToken)==null?void 0:H.decimals,sourceTokenAmount:r.sourceTokenAmount,sourceTokenDecimals:(Q=r.sourceToken)==null?void 0:Q.decimals,invalidToToken:n,invalidSourceToken:s,invalidSourceTokenAmount:c,availableToSwap:t&&!n&&!s&&!c,isAuthConnector:a===z.CONNECTOR_ID.AUTH}},async setSourceToken(e){if(!e){r.sourceToken=e,r.sourceTokenAmount="",r.sourceTokenPriceInUSD=0;return}r.sourceToken=e,await u.setTokenPrice(e.address,"sourceToken")},setSourceTokenAmount(e){r.sourceTokenAmount=e},async setToToken(e){if(!e){r.toToken=e,r.toTokenAmount="",r.toTokenPriceInUSD=0;return}r.toToken=e,await u.setTokenPrice(e.address,"toToken")},setToTokenAmount(e){r.toTokenAmount=e?b.toFixed(e,Je):""},async setTokenPrice(e,t){let o=r.tokensPriceMap[e]||0;o||(r.loadingPrices=!0,o=await u.getAddressPrice(e)),t==="sourceToken"?r.sourceTokenPriceInUSD=o:t==="toToken"&&(r.toTokenPriceInUSD=o),r.loadingPrices&&(r.loadingPrices=!1),u.getParams().availableToSwap&&!r.switchingTokens&&u.swapTokens()},async switchTokens(){if(!(r.initializing||!r.initialized||r.switchingTokens)){r.switchingTokens=!0;try{const e=r.toToken?{...r.toToken}:void 0,t=r.sourceToken?{...r.sourceToken}:void 0,o=e&&r.toTokenAmount===""?"1":r.toTokenAmount;u.setSourceTokenAmount(o),u.setToTokenAmount(""),await u.setSourceToken(e),await u.setToToken(t),r.switchingTokens=!1,u.swapTokens()}catch(e){throw r.switchingTokens=!1,e}}},resetState(){r.myTokensWithBalance=S.myTokensWithBalance,r.tokensPriceMap=S.tokensPriceMap,r.initialized=S.initialized,r.initializing=S.initializing,r.switchingTokens=S.switchingTokens,r.sourceToken=S.sourceToken,r.sourceTokenAmount=S.sourceTokenAmount,r.sourceTokenPriceInUSD=S.sourceTokenPriceInUSD,r.toToken=S.toToken,r.toTokenAmount=S.toTokenAmount,r.toTokenPriceInUSD=S.toTokenPriceInUSD,r.networkPrice=S.networkPrice,r.networkTokenSymbol=S.networkTokenSymbol,r.networkBalanceInUSD=S.networkBalanceInUSD,r.inputError=S.inputError},resetValues(){var o;const{networkAddress:e}=u.getParams(),t=(o=r.tokens)==null?void 0:o.find(i=>i.address===e);u.setSourceToken(t),u.setToToken(void 0)},getApprovalLoadingState(){return r.loadingApprovalTransaction},clearError(){r.transactionError=void 0},async initializeState(){if(!r.initializing){if(r.initializing=!0,!r.initialized)try{await u.fetchTokens(),r.initialized=!0}catch{r.initialized=!1,v.showError("Failed to initialize swap"),p.goBack()}r.initializing=!1}},async fetchTokens(){var o;const{networkAddress:e}=u.getParams();await u.getNetworkTokenPrice(),await u.getMyTokensWithBalance();const t=(o=r.myTokensWithBalance)==null?void 0:o.find(i=>i.address===e);t&&(r.networkTokenSymbol=t.symbol,u.setSourceToken(t),u.setSourceTokenAmount("0"))},async getTokenList(){var t,o;const e=(t=f.state.activeCaipNetwork)==null?void 0:t.caipNetworkId;if(!(r.caipNetworkId===e&&r.tokens))try{r.tokensLoading=!0;const i=await Z.getTokenList(e);r.tokens=i,r.caipNetworkId=e,r.popularTokens=i.sort((d,w)=>d.symbol<w.symbol?-1:d.symbol>w.symbol?1:0);const n=(e&&((o=Te.SUGGESTED_TOKENS_BY_CHAIN)==null?void 0:o[e])||[]).map(d=>i.find(w=>w.symbol===d)).filter(d=>!!d),c=(Te.SWAP_SUGGESTED_TOKENS||[]).map(d=>i.find(w=>w.symbol===d)).filter(d=>!!d).filter(d=>!n.some(w=>w.address===d.address));r.suggestedTokens=[...n,...c]}catch{r.tokens=[],r.popularTokens=[],r.suggestedTokens=[]}finally{r.tokensLoading=!1}},async getAddressPrice(e){var d,w;const t=r.tokensPriceMap[e];if(t)return t;const o=await J.fetchTokenPrice({addresses:[e]}),i=(o==null?void 0:o.fungibles)||[],a=[...r.tokens||[],...r.myTokensWithBalance||[]],n=(d=a==null?void 0:a.find(g=>g.address===e))==null?void 0:d.symbol,s=((w=i.find(g=>g.symbol.toLowerCase()===(n==null?void 0:n.toLowerCase())))==null?void 0:w.price)||0,c=parseFloat(s.toString());return r.tokensPriceMap[e]=c,c},async getNetworkTokenPrice(){var a;const{networkAddress:e}=u.getParams(),o=(a=(await J.fetchTokenPrice({addresses:[e]}).catch(()=>(v.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles)==null?void 0:a[0],i=(o==null?void 0:o.price.toString())||"0";
1r.tokensPriceMap[e]=parseFloat(i),r.networkTokenSymbol=(o==null?void 0:o.symbol)||"",r.networkPrice=i},async getMyTokensWithBalance(e){const t=await Xe.getMyTokensWithBalance(e),o=Z.mapBalancesToSwapTokens(t);o&&(await u.getInitialGasPrice(),u.setBalances(o))},setBalances(e){const{networkAddress:t}=u.getParams(),o=f.state.activeCaipNetwork;if(!o)return;const i=e.find(a=>a.address===t);e.forEach(a=>{r.tokensPriceMap[a.address]=a.price||0}),r.myTokensWithBalance=e.filter(a=>a.address.startsWith(o.caipNetworkId)),r.networkBalanceInUSD=i?b.multiply(i.quantity.numeric,i.price).toString():"0"},async getInitialGasPrice(){var t,o;const e=await Z.fetchGasPrice();if(!e)return{gasPrice:null,gasPriceInUSD:null};switch((o=(t=f.state)==null?void 0:t.activeCaipNetwork)==null?void 0:o.chainNamespace){case z.CHAIN.SOLANA:return r.gasFee=e.standard??"0",r.gasPriceInUSD=b.multiply(e.standard,r.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(r.gasFee),gasPriceInUSD:Number(r.gasPriceInUSD)};case z.CHAIN.EVM:default:const i=e.standard??"0",a=BigInt(i),n=BigInt(We),s=j.getGasPriceInUSD(r.networkPrice,n,a);return r.gasFee=i,r.gasPriceInUSD=s,{gasPrice:a,gasPriceInUSD:s}}},async swapTokens(){var n,s,c;const e=(n=f.getAccountData())==null?void 0:n.address,t=r.sourceToken,o=r.toToken,i=b.bigNumber(r.sourceTokenAmount).gt(0);if(i||u.setToTokenAmount(""),!o||!t||r.loadingPrices||!i||!e)return;r.loadingQuote=!0;const a=b.bigNumber(r.sourceTokenAmount).times(10**t.decimals).round(0);try{const d=await J.fetchSwapQuote({userAddress:e,from:t.address,to:o.address,gasPrice:r.gasFee,amount:a.toString()});r.loadingQuote=!1;const w=(c=(s=d==null?void 0:d.quotes)==null?void 0:s[0])==null?void 0:c.toAmount;if(!w){te.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");return}const g=b.bigNumber(w).div(10**o.decimals).toString();u.setToTokenAmount(g),u.hasInsufficientToken(r.sourceTokenAmount,t.address)?r.inputError="Insufficient balance":(r.inputError=void 0,u.setTransactionDetails())}catch(d){const w=await Z.handleSwapError(d);r.loadingQuote=!1,r.inputError=w||"Insufficient balance"}},async getTransaction(){const{fromCaipAddress:e,availableToSwap:t}=u.getParams(),o=r.sourceToken,i=r.toToken;if(!(!e||!t||!o||!i||r.loadingQuote))try{r.loadingBuildTransaction=!0;const a=await Z.fetchSwapAllowance({userAddress:e,tokenAddress:o.address,sourceTokenAmount:r.sourceTokenAmount,sourceTokenDecimals:o.decimals});let n;return a?n=await u.createSwapTransaction():n=await u.createAllowanceTransaction(),r.loadingBuildTransaction=!1,r.fetchError=!1,n}catch{p.goBack(),v.showError("Failed to check allowance"),r.loadingBuildTransaction=!1,r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}},async createAllowanceTransaction(){const{fromCaipAddress:e,sourceTokenAddress:t,toTokenAddress:o}=u.getParams();if(!(!e||!o)){if(!t)throw new Error("createAllowanceTransaction - No source token address found.");try{const i=await J.generateApproveCalldata({from:t,to:o,userAddress:e}),a=ye.getPlainAddress(i.tx.from);if(!a)throw new Error("SwapController:createAllowanceTransaction - address is required");const n={data:i.tx.data,to:a,gasPrice:BigInt(i.tx.eip155.gasPrice),value:BigInt(i.tx.value),toAmount:r.toTokenAmount};return r.swapTransaction=void 0,r.approvalTransaction={data:n.data,to:n.to,gasPrice:n.gasPrice,value:n.value,toAmount:n.toAmount},{data:n.data,to:n.to,gasPrice:n.gasPrice,value:n.value,toAmount:n.toAmount}}catch{p.goBack(),v.showError("Failed to create approval transaction"),r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}}},async createSwapTransaction(){var s;const{networkAddress:e,fromCaipAddress:t,sourceTokenAmount:o}=u.getParams(),i=r.sourceToken,a=r.toToken;if(!t||!o||!i||!a)return;const n=(s=de.parseUnits(o,i.decimals))==null?void 0:s.toString();try{const c=await J.generateSwapCalldata({userAddress:t,from:i.address,to:a.address,amount:n,disableEstimate:!0}),d=i.address===e,w=BigInt(c.tx.eip155.gas),g=BigInt(c.tx.eip155.gasPrice),P=ye.getPlainAddress(c.tx.to);if(!P)throw new Error("SwapController:createSwapTransaction - address is required");
1const E={data:c.tx.data,to:P,gas:w,gasPrice:g,value:BigInt(d?n??"0":"0"),toAmount:r.toTokenAmount};return r.gasPriceInUSD=j.getGasPriceInUSD(r.networkPrice,w,g),r.approvalTransaction=void 0,r.swapTransaction=E,E}catch{p.goBack(),v.showError("Failed to create transaction"),r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){v.showLoading("Approve limit increase in your wallet"),p.replace("SwapPreview")},async sendTransactionForApproval(e){var a,n,s;const{fromAddress:t,isAuthConnector:o}=u.getParams();r.loadingApprovalTransaction=!0,o?p.pushTransactionStack({onSuccess:u.onEmbeddedWalletApprovalSuccess}):v.showLoading("Approve limit increase in your wallet");try{await de.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:z.CHAIN.EVM}),await u.swapTokens(),await u.getTransaction(),r.approvalTransaction=void 0,r.loadingApprovalTransaction=!1}catch(c){const d=c;r.transactionError=d==null?void 0:d.displayMessage,r.loadingApprovalTransaction=!1,v.showError((d==null?void 0:d.displayMessage)||"Transaction error"),M.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:(d==null?void 0:d.displayMessage)||(d==null?void 0:d.message)||"Unknown",network:((a=f.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)||"",swapFromToken:((n=u.state.sourceToken)==null?void 0:n.symbol)||"",swapToToken:((s=u.state.toToken)==null?void 0:s.symbol)||"",swapFromAmount:u.state.sourceTokenAmount||"",swapToAmount:u.state.toTokenAmount||"",isSmartAccount:ue(z.CHAIN.EVM)===pe.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(e){var s,c,d,w,g,P,E,F,L,H,Q,Ee;if(!e)return;const{fromAddress:t,toTokenAmount:o,isAuthConnector:i}=u.getParams();r.loadingTransaction=!0;const a=`Swapping ${(s=r.sourceToken)==null?void 0:s.symbol} to ${b.formatNumberToLocalString(o,3)} ${(c=r.toToken)==null?void 0:c.symbol}`,n=`Swapped ${(d=r.sourceToken)==null?void 0:d.symbol} to ${b.formatNumberToLocalString(o,3)} ${(w=r.toToken)==null?void 0:w.symbol}`;i?p.pushTransactionStack({onSuccess(){p.replace("Account"),v.showLoading(a),we.resetState()}}):v.showLoading("Confirm transaction in your wallet");try{const ve=[(g=r.sourceToken)==null?void 0:g.address,(P=r.toToken)==null?void 0:P.address].join(","),$=await de.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:z.CHAIN.EVM});return r.loadingTransaction=!1,v.showSuccess(n),M.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:((E=f.state.activeCaipNetwork)==null?void 0:E.caipNetworkId)||"",swapFromToken:((F=u.state.sourceToken)==null?void 0:F.symbol)||"",swapToToken:((L=u.state.toToken)==null?void 0:L.symbol)||"",swapFromAmount:u.state.sourceTokenAmount||"",swapToAmount:u.state.toTokenAmount||"",isSmartAccount:ue(z.CHAIN.EVM)===pe.ACCOUNT_TYPES.SMART_ACCOUNT}}),we.resetState(),i||p.replace("Account"),we.getMyTokensWithBalance(ve),$}catch(ve){const $=ve;r.transactionError=$==null?void 0:$.displayMessage,r.loadingTransaction=!1,v.showError(($==null?void 0:$.displayMessage)||"Transaction error"),M.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:($==null?void 0:$.displayMessage)||($==null?void 0:$.message)||"Unknown",network:((H=f.state.activeCaipNetwork)==null?void 0:H.caipNetworkId)||"",swapFromToken:((Q=u.state.sourceToken)==null?void 0:Q.symbol)||"",swapToToken:((Ee=u.state.toToken)==null?void 0:Ee.symbol)||"",swapFromAmount:u.state.sourceTokenAmount||"",swapToAmount:u.state.toTokenAmount||"",isSmartAccount:ue(z.CHAIN.EVM)===pe.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(e,t){return j.isInsufficientSourceTokenForSwap(e,t,r.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:e,toTokenDecimals:t}=u.getParams();!e||!t||(r.gasPriceInUSD=j.getGasPriceInUSD(r.networkPrice,BigInt(r.gasFee),BigInt(We)),r.priceImpact=j.getPriceImpact({sourceTokenAmount:r.sourceTokenAmount,sourceTokenPriceInUSD:r.sourceTokenPriceInUSD,toTokenPriceInUSD:r.toTokenPriceInUSD,toTokenAmount:r.toTokenAmount}),r.maxSlippage=j.getMaxSlippage(r.slippage,r.toTokenAmount),r.providerFee=j.getProviderFee(r.sourceTokenAmount))}},u=Be(we),W=_e({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),et={state:W,subscribe(e){return Ue(W,()=>e(W))},subscribeKey(e,t){return ze(W,e,t)},showTooltip({message:e,triggerRect:t,variant:o}){W.open=!0,W.message=e,W.triggerRect=t,W.variant=o},hide(){W.open=!1,W.message="",W.triggerRect={width:0,height:0,top:0,left:0}}},ee=Be(et),Me={isUnsupportedChainView(){return p.state.view==="UnsupportedChain"||p.state.view==="SwitchNetwork"&&p.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){R.shake();return}if(await Fe.isSIWXCloseDisabled()){R.shake();return}(p.state.view==="DataCapture"||p.state.view==="DataCaptureOtpConfirm")&&de.disconnect(),R.close()}},tt=A`
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`;var ot=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let xe=class extends x{render(){return l`<slot></slot>`}};xe.styles=[se,tt];xe=ot([T("wui-card")],xe);const nt=A`
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 Ae=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const it={info:"info",success:"checkmark",warning:"warningCircle",error:"warning"};let ne=class extends x{constructor(){super(...arguments),this.message="",this.type="info"}render(){return l`
86      <wui-flex
87        data-type=${O(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=${it[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(){te.close()}};ne.styles=[se,nt];Ae([m()],ne.prototype,"message",void 0);Ae([m()],ne.prototype,"type",void 0);ne=Ae([T("wui-alertbar")],ne);const rt=A`
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 Ve=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const at={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"}};let fe=class extends x{constructor(){super(),this.unsubscribe=[],this.open=te.state.open,this.onOpen(!0),this.unsubscribe.push(te.subscribeKey("open",t=>{this.open=t,this.onOpen(!1)}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){const{message:t,variant:o}=te.state,i=at[o];return l`
125      <wui-alertbar
126        message=${t}
127        backgroundColor=${i==null?void 0:i.backgroundColor}
128        iconColor=${i==null?void 0:i.iconColor}
129        icon=${i==null?void 0:i.icon}
130        type=${o}
131      ></wui-alertbar>
132    `}onOpen(t){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"):t||(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")}};
132fe.styles=rt;Ve([h()],fe.prototype,"open",void 0);fe=Ve([T("w3m-alertbar")],fe);const st=A`
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 G=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let D=class extends x{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 l`<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=${O(this.iconSize)}></wui-icon>
261    </button>`}};D.styles=[se,Le,st];G([m()],D.prototype,"icon",void 0);G([m()],D.prototype,"variant",void 0);G([m()],D.prototype,"type",void 0);G([m()],D.prototype,"size",void 0);G([m()],D.prototype,"iconSize",void 0);G([m({type:Boolean})],D.prototype,"fullWidth",void 0);G([m({type:Boolean})],D.prototype,"disabled",void 0);D=G([T("wui-icon-button")],D);const ct=A`
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 q=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const lt={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},dt={lg:"lg",md:"md",sm:"sm"};let V=class extends x{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size="lg",this.type="text-dropdown",this.disabled=!1}render(){return l`<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(){const t=lt[this.size];return this.text?l`<wui-text color="primary" variant=${t}>${this.text}</wui-text>`:null}imageTemplate(){if(this.imageSrc)return l`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`;const t=dt[this.size];return l` <wui-flex class="left-icon-container">
370      <wui-icon size=${t} name="networkPlaceholder"></wui-icon>
371    </wui-flex>`}};V.styles=[se,Le,ct];q([m()],V.prototype,"imageSrc",void 0);q([m()],V.prototype,"text",void 0);q([m()],V.prototype,"size",void 0);q([m()],V.prototype,"type",void 0);q([m({type:Boolean})],V.prototype,"disabled",void 0);V=q([T("wui-select")],V);const ut=A`
372  :host {
373    height: 60px;
374  }
375
376  :host > wui-flex {
377    box-sizing: border-box;
378    background-color: var(--local-header-background-color);
379  }
380
381  wui-text {
382    background-color: var(--local-header-background-color);
383  }
384
385  wui-flex.w3m-header-title {
386    transform: translateY(0);
387    opacity: 1;
388  }
389
390  wui-flex.w3m-header-title[view-direction='prev'] {
391    animation:
392      slide-down-out 120ms forwards ${({easings:e})=>e["ease-out-power-2"]},
393      slide-down-in 120ms forwards ${({easings:e})=>e["ease-out-power-2"]};
394    animation-delay: 0ms, 200ms;
395  }
396
397  wui-flex.w3m-header-title[view-direction='next'] {
398    animation:
399      slide-up-out 120ms forwards ${({easings:e})=>e["ease-out-power-2"]},
400      slide-up-in 120ms forwards ${({easings:e})=>e["ease-out-power-2"]};
401    animation-delay: 0ms, 200ms;
402  }
403
404  wui-icon-button[data-hidden='true'] {
405    opacity: 0 !important;
406    pointer-events: none;
407  }
408
409  @keyframes slide-up-out {
410    from {
411      transform: translateY(0px);
412      opacity: 1;
413    }
414    to {
415      transform: translateY(3px);
416      opacity: 0;
417    }
418  }
419
420  @keyframes slide-up-in {
421    from {
422      transform: translateY(-3px);
423      opacity: 0;
424    }
425    to {
426      transform: translateY(0);
427      opacity: 1;
428    }
429  }
430
431  @keyframes slide-down-out {
432    from {
433      transform: translateY(0px);
434      opacity: 1;
435    }
436    to {
437      transform: translateY(-3px);
438      opacity: 0;
439    }
440  }
441
442  @keyframes slide-down-in {
443    from {
444      transform: translateY(3px);
445      opacity: 0;
446    }
447    to {
448      transform: translateY(0);
449      opacity: 1;
450    }
451  }
452`;var K=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const pt=["SmartSessionList"],wt={PayWithExchange:he.tokens.theme.foregroundPrimary};function Ne(){var d,w,g,P,E,F,L,H;const e=(w=(d=p.state.data)==null?void 0:d.connector)==null?void 0:w.name,t=(P=(g=p.state.data)==null?void 0:g.wallet)==null?void 0:P.name,o=(F=(E=p.state.data)==null?void 0:E.network)==null?void 0:F.name,i=t??e,a=me.getConnectors(),n=a.length===1&&((L=a[0])==null?void 0:L.id)==="w3m-email",s=(H=f.getAccountData())==null?void 0:H.socialProvider,c=s?s.charAt(0).toUpperCase()+s.slice(1):"Connect Social";return{Connect:`Connect ${n?"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",ConnectingExter
452nal:i??"Connect Wallet",ConnectingWalletConnect:i??"WalletConnect",ConnectingWalletConnectBasic:"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview Convert",Downloads:i?`Get ${i}`:"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:o??"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:c,ConnectingMultiChain:"Select Chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch Chain",SmartSessionCreated:void 0,SmartSessionList:"Smart Sessions",SIWXSignMessage:"Sign In",PayLoading:"Payment in Progress",DataCapture:"Profile",DataCaptureOtpConfirm:"Confirm Email",FundWallet:"Fund Wallet",PayWithExchange:"Deposit from Exchange",PayWithExchangeSelectAsset:"Select Asset"}}let _=class extends x{constructor(){super(),this.unsubscribe=[],this.heading=Ne()[p.state.view],this.network=f.state.activeCaipNetwork,this.networkImage=ke.getNetworkImage(this.network),this.showBack=!1,this.prevHistoryLength=1,this.view=p.state.view,this.viewDirection="",this.unsubscribe.push(qe.subscribeNetworkImages(()=>{this.networkImage=ke.getNetworkImage(this.network)}),p.subscribeKey("view",t=>{setTimeout(()=>{this.view=t,this.heading=Ne()[t]},Y.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),f.subscribeKey("activeCaipNetwork",t=>{this.network=t,this.networkImage=ke.getNetworkImage(this.network)}))}disconnectCallback(){this.unsubscribe.forEach(t=>t())}render(){const t=wt[p.state.view]??he.tokens.theme.backgroundPrimary;return this.style.setProperty("--local-header-background-color",t),l`
453      <wui-flex
454        .padding=${["0","4","0","4"]}
455        justifyContent="space-between"
456        alignItems="center"
457      >
458        ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
459      </wui-flex>
460    `}onWalletHelp(){M.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),p.push("WhatIsAWallet")}async onClose(){await Me.safeClose()}rightHeaderTemplate(){var o,i,a;const t=(a=(i=(o=y)==null?void 0:o.state)==null?void 0:i.features)==null?void 0:a.smartSessions;return p.state.view!=="Account"||!t?this.closeButtonTemplate():l`<wui-flex>
461      <wui-icon-button
462        icon="clock"
463        size="lg"
464        iconSize="lg"
465        type="neutral"
466        variant="primary"
467        @click=${()=>p.push("SmartSessionList")}
468        data-testid="w3m-header-smart-sessions"
469      ></wui-icon-button>
470      ${this.closeButtonTemplate()}
471    </wui-flex> `}closeButtonTemplate(){return l`
472      <wui-icon-button
473        icon="close"
474        size="lg"
475        type="neutral"
476        variant="primary"
477        iconSize="lg"
478        @click=${this.onClose.bind(this)}
479        data-testid="w3m-header-close"
480      ></wui-icon-button>
481    `}titleTemplate(){const t=pt.includes(this.view);return l`
482      <wui-flex
483        view-direction="${this.viewDirection}"
484        class="w3m-header-title"
485        alignItems="center"
486        gap="2"
487      >
488        <wui-text
489          display="inline"
490          variant="lg-regular"
491          color="primary"
492          data-testid="w3m-header-text"
493        >
494          ${this.heading}
495        </wui-text>
496        ${t?l`<wui-tag variant="accent" size="md">Beta</wui-tag>`:null}
497      </wui-flex>
498    `}leftHeaderTemplate(){var w;const{view:t}=p.state,o=t==="Connect",i=y.state.enableEmbedded,a=t==="ApproveTransaction",n=t==="ConnectingSiwe",s=t==="Account",c=y.state.enableNetworkSwitch,d=a||n||o&&i;return s&&c?l`<wui-select
499        id="dynamic"
500        data-testid="w3m-account-select-network"
501        active-network=${O((w=this.network)==null?void 0:w.name)}
502        @click=${this.onNetworks.bind(this)}
503        imageSrc=${O(this.networkImage)}
504      ></wui-select>`:this.showBack&&!d?l`<wui-icon-button
505        data-testid="header-back"
506        id="dynamic"
507        icon="chevronLeft"
508        size="lg"
509        iconSize="lg"
510        type="neutral"
511        variant="primary"
512        @click=${this.onGoBack.bind(this)}
513      ></wui-icon-button>`:l`<wui-icon-button
514      data-hidden=${!o}
515      id="dynamic"
516      icon="helpCircle"
517      size="lg"
518      iconSize="lg"
519      type="neutral"
520      variant="primary"
521      @click=${this.onWalletHelp.bind(this)}
522    ></wui-icon-button>`}onNetworks(){this.isAllowedNetworkSwitch()&&(M.sendEvent({type:"track",event:"CLICK_NETWORKS"}),p.push("Networks"))}isAllowedNetworkSwitch(){const t=f.getAllRequestedCaipNetworks(),o=t?t.length>1:!1,i=t==null?void 0:t.find(({id:a})=>{var n;return a===((n=this.network)==null?void 0:n.id)});return o||!i}onViewChange(){const{history:t}=p.state;let o=Y.VIEW_DIRECTION.Next;t.length<this.prevHistoryLength&&(o=Y.VIEW_DIRECTION.Prev),this.prevHistoryLength=t.length,this.viewDirection=o}async onHistoryChange(){var i;const{history:t}=p.state,o=(i=this.shadowRoot)==null?void 0:i.querySelector("#dynamic");t.length>1&&!this.showBack&&o?(await o.animate([{opacity:1},{opacity:0}
522],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,o.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):t.length<=1&&this.showBack&&o&&(await o.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,o.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){p.goBack()}};_.styles=ut;K([h()],_.prototype,"heading",void 0);K([h()],_.prototype,"network",void 0);K([h()],_.prototype,"networkImage",void 0);K([h()],_.prototype,"showBack",void 0);K([h()],_.prototype,"prevHistoryLength",void 0);K([h()],_.prototype,"view",void 0);K([h()],_.prototype,"viewDirection",void 0);_=K([T("w3m-header")],_);const mt=A`
523  :host {
524    display: flex;
525    align-items: center;
526    gap: ${({spacing:e})=>e[1]};
527    padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]}
528      ${({spacing:e})=>e[2]} ${({spacing:e})=>e[2]};
529    border-radius: ${({borderRadius:e})=>e[20]};
530    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
531    box-shadow:
532      0px 0px 8px 0px rgba(0, 0, 0, 0.1),
533      inset 0 0 0 1px ${({tokens:e})=>e.theme.borderPrimary};
534    max-width: 320px;
535  }
536
537  wui-icon-box {
538    border-radius: ${({borderRadius:e})=>e.round} !important;
539    overflow: hidden;
540  }
541
542  wui-loading-spinner {
543    padding: ${({spacing:e})=>e[1]};
544    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
545    border-radius: ${({borderRadius:e})=>e.round} !important;
546  }
547`;var $e=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ie=class extends x{constructor(){super(...arguments),this.message="",this.variant="success"}render(){return l`
548      ${this.templateIcon()}
549      <wui-text variant="lg-regular" color="primary" data-testid="wui-snackbar-message"
550        >${this.message}</wui-text
551      >
552    `}templateIcon(){const t={success:"success",error:"error",warning:"warning",info:"default"},o={success:"checkmark",error:"warning",warning:"warningCircle",info:"info"};return this.variant==="loading"?l`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:l`<wui-icon-box
553      size="md"
554      color=${t[this.variant]}
555      icon=${o[this.variant]}
556    ></wui-icon-box>`}};ie.styles=[se,mt];$e([m()],ie.prototype,"message",void 0);$e([m()],ie.prototype,"variant",void 0);ie=$e([T("wui-snackbar")],ie);const ht=He`
557  :host {
558    display: block;
559    position: absolute;
560    opacity: 0;
561    pointer-events: none;
562    top: 11px;
563    left: 50%;
564    width: max-content;
565  }
566`;var Ge=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ge=class extends x{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=v.state.open,this.unsubscribe.push(v.subscribeKey("open",t=>{this.open=t,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(t=>t())}render(){const{message:t,variant:o}=v.state;return l` <wui-snackbar message=${t} variant=${o}></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),v.state.autoClose&&(this.timeout=setTimeout(()=>v.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"})}};ge.styles=ht;Ge([h()],ge.prototype,"open",void 0);ge=Ge([T("w3m-snackbar")],ge);const ft=A`
567  :host {
568    pointer-events: none;
569  }
570
571  :host > wui-flex {
572    display: var(--w3m-tooltip-display);
573    opacity: var(--w3m-tooltip-opacity);
574    padding: 9px ${({spacing:e})=>e[3]} 10px ${({spacing:e})=>e[3]};
575    border-radius: ${({borderRadius:e})=>e[3]};
576    color: ${({tokens:e})=>e.theme.backgroundPrimary};
577    position: absolute;
578    top: var(--w3m-tooltip-top);
579    left: var(--w3m-tooltip-left);
580    transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
581    max-width: calc(var(--apkt-modal-width) - ${({spacing:e})=>e[5]});
582    transition: opacity ${({durations:e})=>e.lg}
583      ${({easings:e})=>e["ease-out-power-2"]};
584    will-change: opacity;
585    opacity: 0;
586    animation-duration: ${({durations:e})=>e.xl};
587    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
588    animation-name: fade-in;
589    animation-fill-mode: forwards;
590  }
591
592  :host([data-variant='shade']) > wui-flex {
593    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
594  }
595
596  :host([data-variant='shade']) > wui-flex > wui-text {
597    color: ${({tokens:e})=>e.theme.textSecondary};
598  }
599
600  :host([data-variant='fill']) > wui-flex {
601    background-color: ${({tokens:e})=>e.theme.textPrimary};
602    border: none;
603  }
604
605  wui-icon {
606    position: absolute;
607    width: 12px !important;
608    height: 4px !important;
609    color: ${({tokens:e})=>e.theme.foregroundPrimary};
610  }
611
612  wui-icon[data-placement='top'] {
613    bottom: 0px;
614    left: 50%;
615    transform: translate(-50%, 95%);
616  }
617
618  wui-icon[data-placement='bottom'] {
619    top: 0;
620    left: 50%;
621    transform: translate(-50%, -95%) rotate(180deg);
622  }
623
624  wui-icon[data-placement='right'] {
625    top: 50%;
626    left: 0;
627    transform: translate(-65%, -50%) rotate(90deg);
628  }
629
630  wui-icon[data-placement='left'] {
631    top: 50%;
632    right: 0%;
633    transform: translate(65%, -50%) rotate(270deg);
634  }
635
636  @keyframes fade-in {
637    from {
638      opacity: 0;
639    }
640    to {
641      opacity: 1;
642    }
643  }
644`;var ce=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let X=class extends x{constructor(){super(),this.unsubscribe=[],this.open=ee.state.open,this.message=ee.state.message,this.triggerRect=ee.state.triggerRect,this.variant=ee.state.variant,this.unsubscribe.push(ee.subscribe(t=>{this.open=t.open,this.message=t.message,this.triggerRect=t.triggerRect,this.variant=t.variant}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){this.dataset.variant=this.variant;const t=this.triggerRect.top,o=this.triggerRect.left;return this.style.cssText=`
645    --w3m-tooltip-top: ${t}px;
646    --w3m-tooltip-left: ${o}px;
647    --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;
648    --w3m-tooltip-display: ${this.open?"flex":"none"};
649    --w3m-tooltip-opacity: ${this.open?1:0};
650    `,l`<wui-flex>
651      <wui-icon data-placement="top" size="inherit" name="cursor"></wui-icon>
652      <wui-text color="primary" variant="sm-regular">${this.message}</wui-text>
653    </wui-flex>`}};X.styles=[ft];ce([h()],X.prototype,"open",void 0);ce([h()],X.prototype,"message",void 0);ce([h()],X.prototype,"triggerRect",void 0);ce([h()],X.prototype,"variant",void 0);X=ce([T("w3m-tooltip")],X);const oe={getTabsByNamespace(e){var o;return!!e&&e===z.CHAIN.EVM?((o=y.state.remoteFeatures)==null?void 0:o.activity)===!1?Y.ACCOUNT_TABS.filter(i=>i.label!=="Activity"):Y.ACCOUNT_TABS:[]},isValidReownName(e){return/^[a-zA-Z0-9]+$/gu.test(e)},isValidEmail(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/gu.test(e)},validateReownName(e){return e.replace(/\^/gu,"").toLowerCase().replace(/[^a-zA-Z0-9]/gu,"")},hasFooter(){var t;const e=p.state.view;if(Y.VIEWS_WITH_LEGAL_FOOTER.includes(e)){const{termsConditionsUrl:o,privacyPolicyUrl:i}=y.state,a=(t=y.state.features)==null?void 0:t.legalCheckbox;return!(!o&&!i||a)}
653return Y.VIEWS_WITH_DEFAULT_FOOTER.includes(e)}},gt=A`
654  :host wui-ux-by-reown {
655    padding-top: 0;
656  }
657
658  :host wui-ux-by-reown.branding-only {
659    padding-top: ${({spacing:e})=>e[3]};
660  }
661
662  a {
663    text-decoration: none;
664    color: ${({tokens:e})=>e.core.textAccentPrimary};
665    font-weight: 500;
666  }
667`;var Ke=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let be=class extends x{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=y.state.remoteFeatures,this.unsubscribe.push(y.subscribeKey("remoteFeatures",t=>this.remoteFeatures=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){var n;const{termsConditionsUrl:t,privacyPolicyUrl:o}=y.state,i=(n=y.state.features)==null?void 0:n.legalCheckbox;return!t&&!o||i?l`
668        <wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex>
669      `:l`
670      <wui-flex flexDirection="column">
671        <wui-flex .padding=${["4","3","3","3"]} justifyContent="center">
672          <wui-text color="secondary" variant="md-regular" align="center">
673            By connecting your wallet, you agree to our <br />
674            ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
675          </wui-text>
676        </wui-flex>
677        ${this.reownBrandingTemplate()}
678      </wui-flex>
679    `}andTemplate(){const{termsConditionsUrl:t,privacyPolicyUrl:o}=y.state;return t&&o?"and":""}termsTemplate(){const{termsConditionsUrl:t}=y.state;return t?l`<a href=${t} target="_blank" rel="noopener noreferrer"
680      >Terms of Service</a
681    >`:null}privacyTemplate(){const{privacyPolicyUrl:t}=y.state;return t?l`<a href=${t} target="_blank" rel="noopener noreferrer"
682      >Privacy Policy</a
683    >`:null}reownBrandingTemplate(t=!1){var o;return(o=this.remoteFeatures)!=null&&o.reownBranding?t?l`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:l`<wui-ux-by-reown></wui-ux-by-reown>`:null}};be.styles=[gt];Ke([h()],be.prototype,"remoteFeatures",void 0);be=Ke([T("w3m-legal-footer")],be);const bt=He``;var vt=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let Se=class extends x{render(){const{termsConditionsUrl:t,privacyPolicyUrl:o}=y.state;return!t&&!o?null:l`
684      <wui-flex
685        .padding=${["4","3","3","3"]}
686        flexDirection="column"
687        alignItems="center"
688        justifyContent="center"
689        gap="3"
690      >
691        <wui-text color="secondary" variant="md-regular" align="center">
692          We work with the best providers to give you the lowest fees and best support. More options
693          coming soon!
694        </wui-text>
695
696        ${this.howDoesItWorkTemplate()}
697      </wui-flex>
698    `}howDoesItWorkTemplate(){return l` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
699      <wui-icon size="xs" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
700      How does it work?
701    </wui-link>`}onWhatIsBuy(){M.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:ue(f.state.activeChain)===pe.ACCOUNT_TYPES.SMART_ACCOUNT}}),p.push("WhatIsABuy")}};Se.styles=[bt];Se=vt([T("w3m-onramp-providers-footer")],Se);const yt=A`
702  :host {
703    display: block;
704  }
705
706  div.container {
707    position: absolute;
708    bottom: 0;
709    left: 0;
710    right: 0;
711    overflow: hidden;
712    height: auto;
713    display: block;
714  }
715
716  div.container[status='hide'] {
717    animation: fade-out;
718    animation-duration: var(--apkt-duration-dynamic);
719    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
720    animation-fill-mode: both;
721    animation-delay: 0s;
722  }
723
724  div.container[status='show'] {
725    animation: fade-in;
726    animation-duration: var(--apkt-duration-dynamic);
727    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
728    animation-fill-mode: both;
729    animation-delay: var(--apkt-duration-dynamic);
730  }
731
732  @keyframes fade-in {
733    from {
734      opacity: 0;
735      filter: blur(6px);
736    }
737    to {
738      opacity: 1;
739      filter: blur(0px);
740    }
741  }
742
743  @keyframes fade-out {
744    from {
745      opacity: 1;
746      filter: blur(0px);
747    }
748    to {
749      opacity: 0;
750      filter: blur(6px);
751    }
752  }
753`;var Pe=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let re=class extends x{constructor(){super(...arguments),this.resizeObserver=void 0,this.unsubscribe=[],this.status="hide",this.view=p.state.view}firstUpdated(){this.status=oe.hasFooter()?"show":"hide",this.unsubscribe.push(p.subscribeKey("view",t=>{this.view=t,this.status=oe.hasFooter()?"show":"hide",this.status==="hide"&&document.documentElement.style.setProperty("--apkt-footer-height","0px")})),this.resizeObserver=new ResizeObserver(t=>
753{for(const o of t)if(o.target===this.getWrapper()){const i=`${o.contentRect.height}px`;document.documentElement.style.setProperty("--apkt-footer-height",i)}}),this.resizeObserver.observe(this.getWrapper())}render(){return l`
754      <div class="container" status=${this.status}>${this.templatePageContainer()}</div>
755    `}templatePageContainer(){return oe.hasFooter()?l` ${this.templateFooter()}`:null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return l`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return l`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return l` <wui-flex
756      class="footer-in"
757      padding="3"
758      flexDirection="column"
759      gap="3"
760      alignItems="center"
761    >
762      <wui-text variant="md-regular" color="secondary" align="center">
763        Your connected wallet may not support some of the networks available for this dApp
764      </wui-text>
765      <wui-link @click=${this.onNetworkHelp.bind(this)}>
766        <wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
767        What is a network
768      </wui-link>
769    </wui-flex>`}onNetworkHelp(){M.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),p.push("WhatIsANetwork")}getWrapper(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("div.container")}};re.styles=[yt];Pe([h()],re.prototype,"status",void 0);Pe([h()],re.prototype,"view",void 0);re=Pe([T("w3m-footer")],re);const kt=A`
770  :host {
771    display: block;
772    width: inherit;
773  }
774`;var Ie=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ae=class extends x{constructor(){super(),this.unsubscribe=[],this.viewState=p.state.view,this.history=p.state.history.join(","),this.unsubscribe.push(p.subscribeKey("view",()=>{this.history=p.state.history.join(","),document.documentElement.style.setProperty("--apkt-duration-dynamic","var(--apkt-durations-lg)")}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),document.documentElement.style.setProperty("--apkt-duration-dynamic","0s")}render(){return l`${this.templatePageContainer()}`}templatePageContainer(){return l`<w3m-router-container
775      history=${this.history}
776      .setView=${()=>{this.viewState=p.state.view}}
777    >
778      ${this.viewTemplate(this.viewState)}
779    </w3m-router-container>`}viewTemplate(t){switch(t){case"AccountSettings":return l`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return l`<w3m-account-view></w3m-account-view>`;case"AllWallets":return l`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return l`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return l`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return l`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":return l`<w3m-connect-view></w3m-connect-view>`;case"Create":return l`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return l`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return l`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return l`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return l`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return l`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return l`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return l`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return l`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return l`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return l`<w3m-downloads-view>
779</w3m-downloads-view>`;case"EmailLogin":return l`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return l`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return l`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return l`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return l`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return l`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return l`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return l`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return l`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return l`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return l`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return l`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return l`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return l`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return l`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return l`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return l`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return l`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return l`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return l`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return l`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return l`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return l`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return l`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return l`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return l`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return l`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return l`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return l`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return l`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return l`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return l`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return l`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return l`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return l`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return l`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return l`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return l`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"FundWallet":return l`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return l`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return l`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`;case"UsageExceeded":return l`<w3m-usage-exceeded-view></w3m-usage-exceeded-view>`;default:return l`<w3m-connect-view></w3m-connect-view>`}}};ae.styles=[kt];Ie([h()],ae.prototype,"viewState",void 0);Ie([h()],ae.prototype,"history",void 0);ae=Ie([T("w3m-router")],ae);const Tt=A`
780  :host {
781    z-index: ${({tokens:e})=>e.core.zIndex};
782    display: block;
783    backface-visibility: hidden;
784    will-change: opacity;
785    position: fixed;
786    top: 0;
787    left: 0;
788    right: 0;
789    bottom: 0;
790    pointer-events: none;
791    opacity: 0;
792    background-color: ${({tokens:e})=>e.theme.overlay};
793    backdrop-filter: blur(0px);
794    transition:
795      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
796      backdrop-filter ${({durations:e})=>e.lg}
797        ${({easings:e})=>e["ease-out-power-2"]};
798    will-change: opacity;
799  }
800
801  :host(.open) {
802    opacity: 1;
803    backdrop-filter: blur(8px);
804  }
805
806  :host(.appkit-modal) {
807    position: relative;
808    pointer-events: unset;
809    background: none;
810    width: 100%;
811    opacity: 1;
812  }
813
814  wui-card {
815    max-width: var(--apkt-modal-width);
816    width: 100%;
817    position: relative;
818    outline: none;
819    transform: translateY(4px);
820    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.05);
821    transition:
822      transform ${({durations:e})=>e.lg}
823        ${({easings:e})=>e["ease-out-power-2"]},
824      border-radius ${({durations:e})=>e.lg}
825        ${({easings:e})=>e["ease-out-power-1"]},
826      background-color ${({durations:e})=>e.lg}
827        ${({easings:e})=>e["ease-out-power-1"]},
828      box-shadow ${({durations:e})=>e.lg}
829        ${({easings:e})=>e["ease-out-power-1"]};
830    will-change: border-radius, background-color, transform, box-shadow;
831    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
832    padding: var(--local-modal-padding);
833    box-sizing: border-box;
834  }
835
836  :host(.open) wui-card {
837    transform: translateY(0px);
838  }
839
840  wui-card::before {
841    z-index: 1;
842    pointer-events: none;
843    content: '';
844    position: absolute;
845    inset: 0;
846    border-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
847    transition: box-shadow ${({durations:e})=>e.lg}
848      ${({easings:e})=>e["ease-out-power-2"]};
849    transition-delay: ${({durations:e})=>e.md};
850    will-change: box-shadow;
851  }
852
853  :host([data-mobile-fullscreen='true']) wui-card::before {
854    border-radius: 0px;
855  }
856
857  :host([data-border='true']) wui-card::before {
858    box-shadow: inset 0px 0px 0px 4px ${({tokens:e})=>e.theme.foregroundSecondary};
859  }
860
861  :host([data-border='false']) wui-card::before {
862    box-shadow: inset 0px 0px 0px 1px ${({tokens:e})=>e.theme.borderPrimaryDark};
863  }
864
865  :host([data-border='true']) wui-card {
866    animation:
867      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
868      card-background-border var(--apkt-duration-dynamic)
869        ${({easings:e})=>e["ease-out-power-2"]};
870    animation-fill-mode: backwards, both;
871    animation-delay: var(--apkt-duration-dynamic);
872  }
873
874  :host([data-border='false']) wui-card {
875    animation:
876      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
877      card-background-default var(--apkt-duration-dynamic)
878        ${({easings:e})=>e["ease-out-power-2"]};
879    animation-fill-mode: backwards, both;
880    animation-delay: 0s;
881  }
882
883  :host(.appkit-modal) wui-card {
884    max-width: var(--apkt-modal-width);
885  }
886
887  wui-card[shake='true'] {
888    animation:
889      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
890      w3m-shake ${({durations:e})=>e.xl}
891        ${({easings:e})=>e["ease-out-power-2"]};
892  }
893
894  wui-flex {
895    overflow-x: hidden;
896    overflow-y: auto;
897    display: flex;
898    align-items: center;
899    justify-content: center;
900    width: 100%;
901    height: 100%;
902  }
903
904  @media (max-height: 700px) and (min-width: 431px) {
905    wui-flex {
906      align-items: flex-start;
907    }
908
909    wui-card {
910      margin: var(--apkt-spacing-6) 0px;
911    }
912  }
913
914  @media (max-width: 430px) {
915    :host([data-mobile-fullscreen='true']) {
916      height: 100dvh;
917    }
918    :host([data-mobile-fullscreen='true']) wui-flex {
919      align-items: stretch;
920    }
921    :host([data-mobile-fullscreen='true']) wui-card {
922      max-width: 100%;
923      height: 100%;
924      border-radius: 0;
925      border: none;
926    }
927    :host(:not([data-mobile-fullscreen='true'])) wui-flex {
928      align-items: flex-end;
929    }
930
931    :host(:not([data-mobile-fullscreen='true'])) wui-card {
932      max-width: 100%;
933      border-bottom: none;
934    }
935
936    :host(:not([data-mobile-fullscreen='true'])) wui-card[data-embedded='true'] {
937      border-bottom-left-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
938      border-bottom-right-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
939    }
940
941    :host(:not([data-mobile-fullscreen='true'])) wui-card:not([data-embedded='true']) {
942      border-bottom-left-radius: 0px;
943      border-bottom-right-radius: 0px;
944    }
945
946    wui-card[shake='true'] {
947      animation: w3m-shake 0.5s ${({easings:e})=>e["ease-out-power-2"]};
948    }
949  }
950
951  @keyframes fade-in {
952    0% {
953      transform: scale(0.99) translateY(4px);
954    }
955    100% {
956      transform: scale(1) translateY(0);
957    }
958  }
959
960  @keyframes w3m-shake {
961    0% {
962      transform: scale(1) rotate(0deg);
963    }
964    20% {
965      transform: scale(1) rotate(-1deg);
966    }
967    40% {
968      transform: scale(1) rotate(1.5deg);
969    }
970    60% {
971      transform: scale(1) rotate(-1.5deg);
972    }
973    80% {
974      transform: scale(1) rotate(1deg);
975    }
976    100% {
977      transform: scale(1) rotate(0deg);
978    }
979  }
980
981  @keyframes card-background-border {
982    from {
983      background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
984    }
985    to {
986      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
987    }
988  }
989
990  @keyframes card-background-default {
991    from {
992      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
993    }
994    to {
995      background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
996    }
997  }
998`;var B=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const Re="scroll-lock",xt={PayWithExchange:"0",PayWithExchangeSelectAsset:"0"};class N extends x{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.hasPrefetched=!1,this.enableEmbedded=y.state.enableEmbedded,this.open=R.state.open,this.caipAddress=f.state.activeCaipAddress,this.caipNetwork=f.state.activeCaipNetwork,this.shake=R.state.shake,this.filterByNamespace=me.state.filterByNamespace,this.padding=he.spacing[1],this.mobileFullScreen=y.state.enableMobileFullScreen,this.initializeTheming(),le.prefetchAnalyticsConfig(),this.unsubscribe.push(R.subscribeKey("open",t=>t?this.onOpen():this.onClose()),R.subscribeKey("shake",t=>this.shake=t),f.subscribeKey("activeCaipNetwork",t=>this.onNewNetwork(t)),f.subscribeKey("activeCaipAddress",t=>this.onNewAddress(t)),y.subscribeKey("enableEmbedded",t=>this.enableEmbedded=t),me.subscribeKey("filterByNamespace",t=>{var o;this.filterByNamespace!==t&&!((o=f.getAccountData(t))!=null&&o.caipAddress)&&(le.fetchRecommendedWallets(),this.filterByNamespace=t)}),p.subscribeKey("view",()=>{this.dataset.border=oe.hasFooter()?"true":"false",this.padding=xt[p.state.view]??he.spacing[1]}))}firstUpdated(){if(this.dataset.border=oe.hasFooter()?"true":"false",this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.caipAddress){if(this.enableEmbedded){R.close(),this.prefetch();return}this.onNewAddress(this.caipAddress)}this.open&&this.onOpen(),this.enableEmbedded&&this.prefetch()}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),this.onRemoveKeyboardListener()}render(){return this.style.setProperty("--local-modal-padding",this.padding),this.enableEmbedded?l`${this.contentTemplate()}
999        <w3m-tooltip></w3m-tooltip> `:this.open?l`
1000          <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
1001            ${this.contentTemplate()}
1002          </wui-flex>
1003          <w3m-tooltip></w3m-tooltip>
1004        `:null}contentTemplate(){return l` <wui-card
1005      shake="${this.shake}"
1006      data-embedded="${O(this.enableEmbedded)}"
1007      role="alertdialog"
1008      aria-modal="true"
1009      tabindex="0"
1010      data-testid="w3m-modal-card"
1011    >
1012      <w3m-header></w3m-header>
1013      <w3m-router></w3m-router>
1014      <w3m-footer></w3m-footer>
1015      <w3m-snackbar></w3m-snackbar>
1016      <w3m-alertbar></w3m-alertbar>
1017    </wui-card>`}async onOverlayClick(t){if(t.target===t.currentTarget){if(this.mobileFullScreen)return;await this.handleClose()}}async handleClose(){await Me.safeClose()}initializeTheming(){const{themeVariables:t,themeMode:o}=Qe.state,i=je.getColorTheme(o);Ze(t,i)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),v.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const t=document.createElement("style");t.dataset.w3m=Re,t.textContent=`
1018      body {
1019        touch-action: none;
1020        overflow: hidden;
1021        overscroll-behavior: contain;
1022      }
1023      w3m-modal {
1024        pointer-events: auto;
1025      }
1026    `,document.head.appendChild(t)}onScrollUnlock(){const t=document.head.querySelector(`style[data-w3m="${Re}"]`);t&&t.remove()}onAddKeyboardListener(){var o;this.abortController=new AbortController;const t=(o=this.shadowRoot)==null?void 0:o.querySelector("wui-card");t==null||t.focus(),window.addEventListener("keydown",i=>{if(i.key==="Escape")this.handleClose();else if(i.key==="Tab"){const{tagName:a}=i.target;a&&!a.includes("W3M-")&&!a.includes("WUI-")&&(t==null||t.focus())}},this.abortController)}onRemoveKeyboardListener(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}async onNewAddress(t){const o=f.state.isSwitchingNamespace,i=p.state.view==="ProfileWallets";!t&&!o&&!i&&R.close(),await Fe.initializeIfEnabled(t),this.caipAddress=t,f.setIsSwitchingNamespace(!1)}onNewNetwork(t){var w,g;const o=this.caipNetwork,i=(w=o==null?void 0:o.caipNetworkId)==null?void 0:w.toString(),a=(g=t==null?void 0:t.caipNetworkId)==null?void 0:g.toString(),n=i!==a,s=p.state.view==="UnsupportedChain",c=R.state.open;let d=!1;this.enableEmbedded&&p.state.view==="SwitchNetwork"&&(d=!0),n&&u.resetState(),c&&s&&(d=!0),d&&p.state.view!=="SIWXSignMessage"&&p.goBack(),this.caipNetwork=t}prefetch(){this.hasPrefetched||(le.prefetch(),le.fetchWalletsByPage({page:1}),this.hasPrefetched=!0)}}N.styles=Tt;B([m({type:Boolean})],N.prototype,"enableEmbedded",void 0);B([h()],N.prototype,"open",void 0);B([h()],N.prototype,"caipAddress",void 0);B([h()],N.prototype,"caipNetwork",void 0);B([h()],N.prototype,"shake",void 0);B([h()],N.prototype,"filterByNamespace",void 0);B([h()],N.prototype,"padding",void 0);B([h()],N.prototype,"mobileFullScreen",void 0);let Oe=class extends N{};Oe=B([T("w3m-modal")],Oe);let De=class extends N{};De=B([T("appkit-modal")],De);const St=A`
1027  .icon-box {
1028    width: 64px;
1029    height: 64px;
1030    border-radius: ${({borderRadius:e})=>e[5]};
1031    background-color: ${({colors:e})=>e.semanticError010};
1032  }
1033`;var Ct=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let Ce=class extends x{constructor(){super()}render(){return l`
1034      <wui-flex
1035        flexDirection="column"
1036        alignItems="center"
1037        gap="4"
1038        .padding="${["1","3","4","3"]}"
1039      >
1040        <wui-flex justifyContent="center" alignItems="center" class="icon-box">
1041          <wui-icon size="xxl" color="error" name="warningCircle"></wui-icon>
1042        </wui-flex>
1043
1044        <wui-text variant="lg-medium" color="primary" align="center">
1045          The app isn't responding as expected
1046        </wui-text>
1047        <wui-text variant="md-regular" color="secondary" align="center">
1048          Try again or reach out to the app team for help.
1049        </wui-text>
1050
1051        <wui-button
1052          variant="neutral-secondary"
1053          size="md"
1054          @click=${this.onTryAgainClick.bind(this)}
1055          data-testid="w3m-usage-exceeded-button"
1056        >
1057          <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
1058          Try Again
1059        </wui-button>
1060      </wui-flex>
1061    `}onTryAgainClick(){p.goBack()}};Ce.styles=St;Ce=Ct([T("w3m-usage-exceeded-view")],Ce);const At=A`
1062  :host {
1063    width: 100%;
1064  }
1065`;var C=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let k=class extends x{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}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.cleanupIntersectionObserver()}updated(t){super.updated(t),(t.has("name")||t.has("imageSrc")||t.has("walletRank"))&&(this.hasImpressionSent=!1),t.has("walletRank")&&this.walletRank&&!this.intersectionObserver&&this.setupIntersectionObserver()}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(o=>{o.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)&&M.sendWalletImpressionEvent({name:this.name,walletRank:this.walletRank,rdnsId:this.rdnsId,view:p.state.view,displayIndex:this.displayIndex}))}render(){return l`
1066      <wui-list-wallet
1067        .walletImages=${this.walletImages}
1068        imageSrc=${O(this.imageSrc)}
1069        name=${this.name}
1070        size=${O(this.size)}
1071        tagLabel=${O(this.tagLabel)}
1072        .tagVariant=${this.tagVariant}
1073        .walletIcon=${this.walletIcon}
1074        .tabIdx=${this.tabIdx}
1075        .disabled=${this.disabled}
1076        .showAllWallets=${this.showAllWallets}
1077        .loading=${this.loading}
1078        loadingSpinnerColor=${this.loadingSpinnerColor}
1079      ></wui-list-wallet>
1080    `}};k.styles=At;C([m({type:Array})],k.prototype,"walletImages",void 0);C([m()],k.prototype,"imageSrc",void 0);C([m()],k.prototype,"name",void 0);C([m()],k.prototype,"size",void 0);C([m()],k.prototype,"tagLabel",void 0);C([m()],k.prototype,"tagVariant",void 0);C([m()],k.prototype,"walletIcon",void 0);C([m()],k.prototype,"tabIdx",void 0);C([m({type:Boolean})],k.prototype,"disabled",void 0);C([m({type:Boolean})],k.prototype,"showAllWallets",void 0);C([m({type:Boolean})],k.prototype,"loading",void 0);C([m({type:String})],k.prototype,"loadingSpinnerColor",void 0);C([m()],k.prototype,"rdnsId",void 0);C([m()],k.prototype,"displayIndex",void 0);C([m()],k.prototype,"walletRank",void 0);k=C([T("w3m-list-wallet")],k);const $t=A`
1081  :host {
1082    --local-duration-height: 0s;
1083    --local-duration: ${({durations:e})=>e.lg};
1084    --local-transition: ${({easings:e})=>e["ease-out-power-2"]};
1085  }
1086
1087  .container {
1088    display: block;
1089    overflow: hidden;
1090    overflow: hidden;
1091    position: relative;
1092    height: var(--local-container-height);
1093    transition: height var(--local-duration-height) var(--local-transition);
1094    will-change: height, padding-bottom;
1095  }
1096
1097  .container[data-mobile-fullscreen='true'] {
1098    overflow: scroll;
1099  }
1100
1101  .page {
1102    position: absolute;
1103    top: 0;
1104    left: 0;
1105    right: 0;
1106    width: 100%;
1107    height: auto;
1108    width: inherit;
1109    box-sizing: border-box;
1110    display: flex;
1111    flex-direction: column;
1112    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
1113    border-bottom-left-radius: var(--local-border-bottom-radius);
1114    border-bottom-right-radius: var(--local-border-bottom-radius);
1115    transition: border-bottom-left-radius var(--local-duration) var(--local-transition);
1116  }
1117
1118  .page[data-mobile-fullscreen='true'] {
1119    height: 100%;
1120  }
1121
1122  .page-content {
1123    display: flex;
1124    flex-direction: column;
1125    min-height: 100%;
1126  }
1127
1128  .footer {
1129    height: var(--apkt-footer-height);
1130  }
1131
1132  div.page[view-direction^='prev-'] .page-content {
1133    animation:
1134      slide-left-out var(--local-duration) forwards var(--local-transition),
1135      slide-left-in var(--local-duration) forwards var(--local-transition);
1136    animation-delay: 0ms, var(--local-duration, ${({durations:e})=>e.lg});
1137  }
1138
1139  div.page[view-direction^='next-'] .page-content {
1140    animation:
1141      slide-right-out var(--local-duration) forwards var(--local-transition),
1142      slide-right-in var(--local-duration) forwards var(--local-transition);
1143    animation-delay: 0ms, var(--local-duration, ${({durations:e})=>e.lg});
1144  }
1145
1146  @keyframes slide-left-out {
1147    from {
1148      transform: translateX(0px) scale(1);
1149      opacity: 1;
1150      filter: blur(0px);
1151    }
1152    to {
1153      transform: translateX(8px) scale(0.99);
1154      opacity: 0;
1155      filter: blur(4px);
1156    }
1157  }
1158
1159  @keyframes slide-left-in {
1160    from {
1161      transform: translateX(-8px) scale(0.99);
1162      opacity: 0;
1163      filter: blur(4px);
1164    }
1165    to {
1166      transform: translateX(0) translateY(0) scale(1);
1167      opacity: 1;
1168      filter: blur(0px);
1169    }
1170  }
1171
1172  @keyframes slide-right-out {
1173    from {
1174      transform: translateX(0px) scale(1);
1175      opacity: 1;
1176      filter: blur(0px);
1177    }
1178    to {
1179      transform: translateX(-8px) scale(0.99);
1180      opacity: 0;
1181      filter: blur(4px);
1182    }
1183  }
1184
1185  @keyframes slide-right-in {
1186    from {
1187      transform: translateX(8px) scale(0.99);
1188      opacity: 0;
1189      filter: blur(4px);
1190    }
1191    to {
1192      transform: translateX(0) translateY(0) scale(1);
1193      opacity: 1;
1194      filter: blur(0px);
1195    }
1196  }
1197`;var U=function(e,t,o,i){var a=arguments.length,n=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(n=(a<3?s(n):a>3?s(t,o,n):s(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const Pt=60;let I=class extends x{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=y.state.enableMobileFullScreen,this.onViewportResize=()=>{this.updateContainerHeight()}}updated(t){if(t.has("history")){const o=this.history;this.historyState!==""&&this.historyState!==o&&this.onViewChange(o)}t.has("transitionDuration")&&this.style.setProperty("--local-duration",this.transitionDuration),t.has("transitionFunction")&&this.style.setProperty("--local-transition",this.transitionFunction)}firstUpdated(){var t;this.transitionFunction&&this.style.setProperty("--local-transition",this.transitionFunction),this.style.setProperty("--local-duration",this.transitionDuration),this.historyState=this.history,this.resizeObserver=new ResizeObserver(o=>{var i;for(const a of o)if(a.target===this.getWrapper()){let n=a.contentRect.height;const s=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0");
1197if(this.mobileFullScreen){const c=((i=window.visualViewport)==null?void 0:i.height)||window.innerHeight,d=this.getHeaderHeight();n=c-d-s,this.style.setProperty("--local-border-bottom-radius","0px")}else n=n+s,this.style.setProperty("--local-border-bottom-radius",s?"var(--apkt-borderRadius-5)":"0px");this.style.setProperty("--local-container-height",`${n}px`),this.previousHeight!=="0px"&&this.style.setProperty("--local-duration-height",this.transitionDuration),this.previousHeight=`${n}px`}}),this.resizeObserver.observe(this.getWrapper()),this.updateContainerHeight(),window.addEventListener("resize",this.onViewportResize),(t=window.visualViewport)==null||t.addEventListener("resize",this.onViewportResize)}disconnectedCallback(){var o;const t=this.getWrapper();t&&this.resizeObserver&&this.resizeObserver.unobserve(t),window.removeEventListener("resize",this.onViewportResize),(o=window.visualViewport)==null||o.removeEventListener("resize",this.onViewportResize)}render(){return l`
1198      <div class="container" data-mobile-fullscreen="${O(this.mobileFullScreen)}">
1199        <div
1200          class="page"
1201          data-mobile-fullscreen="${O(this.mobileFullScreen)}"
1202          view-direction="${this.viewDirection}"
1203        >
1204          <div class="page-content">
1205            <slot></slot>
1206          </div>
1207        </div>
1208      </div>
1209    `}onViewChange(t){const o=t.split(",").filter(Boolean),i=this.historyState.split(",").filter(Boolean),a=i.length,n=o.length,s=o[o.length-1]||"",c=je.cssDurationToNumber(this.transitionDuration);let d="";n>a?d="next":n<a?d="prev":n===a&&o[n-1]!==i[a-1]&&(d="next"),this.viewDirection=`${d}-${s}`,setTimeout(()=>{var w;this.historyState=t,(w=this.setView)==null||w.call(this,s)},c),setTimeout(()=>{this.viewDirection=""},c*2)}getWrapper(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("div.page")}updateContainerHeight(){var a;const t=this.getWrapper();if(!t)return;const o=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0");let i=0;if(this.mobileFullScreen){const n=((a=window.visualViewport)==null?void 0:a.height)||window.innerHeight,s=this.getHeaderHeight();i=n-s-o,this.style.setProperty("--local-border-bottom-radius","0px")}else i=t.getBoundingClientRect().height+o,this.style.setProperty("--local-border-bottom-radius",o?"var(--apkt-borderRadius-5)":"0px");this.style.setProperty("--local-container-height",`${i}px`),this.previousHeight!=="0px"&&this.style.setProperty("--local-duration-height",this.transitionDuration),this.previousHeight=`${i}px`}getHeaderHeight(){return Pt}};I.styles=[$t];U([m({type:String})],I.prototype,"transitionDuration",void 0);U([m({type:String})],I.prototype,"transitionFunction",void 0);U([m({type:String})],I.prototype,"history",void 0);U([m({type:String})],I.prototype,"view",void 0);U([m({attribute:!1})],I.prototype,"setView",void 0);U([h()],I.prototype,"viewDirection",void 0);U([h()],I.prototype,"historyState",void 0);U([h()],I.prototype,"previousHeight",void 0);U([h()],I.prototype,"mobileFullScreen",void 0);I=U([T("w3m-router-container")],I);export{De as AppKitModal,k as W3mListWallet,Oe as W3mModal,N as W3mModalBase,I as W3mRouterContainer,Ce as W3mUsageExceededView};

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.