1"use strict";(self.webpackChunkmain_app=self.webpackChunkmain_app||[]).push([[1241],{21241:(e,t,o)=>{o.r(t),o.d(t,{AppKitModal:()=>Ze,W3mListWallet:()=>Ye,W3mModal:()=>_e,W3mModalBase:()=>Ve,W3mRouterContainer:()=>Qe});var r=o(33858),i=o(65218),a=o(58749),n=o(98861),s=o(99175),c=o(92350),l=o(9615),d=o(26213),u=o(50059),p=o(56900),w=o(74351),h=o(83587),m=o(98969);const g={isUnsupportedChainView:()=>"UnsupportedChain"===w.I.state.view||"SwitchNetwork"===w.I.state.view&&w.I.state.history.includes("UnsupportedChain"),async safeClose(){if(this.isUnsupportedChainView())return void l.W.shake();await m.U.isSIWXCloseDisabled()?l.W.shake():("DataCapture"!==w.I.state.view&&"DataCaptureOtpConfirm"!==w.I.state.view||h.x.disconnect(),l.W.close())}};var y=o(12177),v=o(29110),f=o(51029),b=o(47653),k=o(78644),T=o(13222),x=o(56396),S=o(7820),A=o(10081),C=o(31517),P=o(29269);const $={getGasPriceInEther:(e,t)=>Number(t*e)/1e18,getGasPriceInUSD(e,t,o){const r=$.getGasPriceInEther(t,o);return T.S.bigNumber(e).times(r).toNumber()},getPriceImpact(e){let{sourceTokenAmount:t,sourceTokenPriceInUSD:o,toTokenPriceInUSD:r,toTokenAmount:i}=e;const a=T.S.bigNumber(t).times(o),n=T.S.bigNumber(i).times(r);return a.minus(n).div(a).times(100).toNumber()},getMaxSlippage(e,t){const o=T.S.bigNumber(e).div(100);return T.S.multiply(t,o).toNumber()},getProviderFee(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.0085;return T.S.bigNumber(e).times(t).toString()},isInsufficientNetworkTokenForGas(e,t){const o=t||"0";return!!T.S.bigNumber(e).eq(0)||T.S.bigNumber(T.S.bigNumber(o)).gt(e)},isInsufficientSourceTokenForSwap(e,t,o){const r=o?.find((e=>e.address===t))?.quantity?.numeric;return T.S.bigNumber(r||"0").lt(e)}};var I=o(45749),W=o(29986),E=o(8350),N=o(12911);const R=15e4;Error;const O={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:C.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},D=(0,b.BX)({...O}),q={state:D,subscribe:e=>(0,b.B1)(D,(()=>e(D))),subscribeKey:(e,t)=>(0,k.u$)(D,e,t),getParams(){const e=d.W.state.activeChain,t=d.W.getAccountData(e)?.caipAddress??d.W.state.activeCaipAddress,o=f.w.getPlainAddress(t),r=(0,A.K1)(),i=u.a.getConnectorId(d.W.state.activeChain);if(!o)throw new Error("No address found to swap the tokens from.");const a=!D.toToken?.address||!D.toToken?.decimals,n=!D.sourceToken?.address||!D.sourceToken?.decimals||!T.S.bigNumber(D.sourceTokenAmount).gt(0),c=!D.sourceTokenAmount;return{networkAddress:r,fromAddress:o,fromCaipAddress:t,sourceTokenAddress:D.sourceToken?.address,toTokenAddress:D.toToken?.address,toTokenAmount:D.toTokenAmount,toTokenDecimals:D.toToken?.decimals,sourceTokenAmount:D.sourceTokenAmount,sourceTokenDecimals:D.sourceToken?.decimals,invalidToToken:a,invalidSourceToken:n,invalidSourceTokenAmount:c,availableToSwap:t&&!a&&!n&&!c,isAuthConnector:i===s.o.CONNECTOR_ID.AUTH}},async setSourceToken(e){if(!e)return D.sourceToken=e,D.sourceTokenAmount="",void(D.sourceTokenPriceInUSD=0);D.sourceToken=e,await z.setTokenPrice(e.address,"sourceToken")},setSourceTokenAmount(e){D.sourceTokenAmount=e},async setToToken(e){if(!e)return D.toToken=e,D.toTokenAmount="",void(D.toTokenPriceInUSD=0);D.toToken=e,await z.setTokenPrice(e.address,"toToken")},setToTokenAmount(e){D.toTokenAmount=e?T.S.toFixed(e,6):""},async setTokenPrice(e,t){let o=D.tokensPriceMap[e]||0;o||(D.loadingPrices=!0,o=await z.getAddressPrice(e)),"sourceToken"===t?D.sourceTokenPriceInUSD=o:"toToken"===t&&(D.toTokenPriceInUSD=o),D.loadingPrices&&(D.loadingPrices=!1),z.getParams().availableToSwap&&!D.switchingTokens&&z.swapTokens()},async switchTokens(){if(!D.initializing&&D.initialized&&!D.switchingTokens){D.switchingTokens=!0;try{const e=D.toToken?{...D.toToken}:void 0,t=D.sourceToken?{...D.sourceToken}:void 0,o=e&&""===D.toTokenAmount?"1":D.toTokenAmount;z.setSourceTokenAmount(o),z.setToTokenAmount(""),await z.setSourceToken(e),await z.setToToken(t),D.switchingTokens=!1,z.swapTokens()}catch(e){throw D.switchingTokens=!1,e}}},resetState(){D.myTokensWithBalance=O.myTokensWithBalance,D.tokensPriceMap=O.tokensPriceMap,D.initialized=O.initialized,D.initializing=O.initializing,D.switchingTokens=O.switchingTokens,D.sourceToken=O.sourceToken,D.sourceTokenAmount=O.sourceTokenAmount,D.sourceTokenPriceInUSD=O.sourceTokenPriceInUSD,D.toToken=O.toToken,D.toTokenAmount=O.toTokenAmount,D.toTokenPriceInUSD=O.toTokenPriceInUSD,D.networkPrice=O.networkPrice,D.networkTokenSymbol=O.networkTokenSymbol,D.networkBalanceInUSD=O.networkBalanceInUSD,D.inputError=O.inputError},resetValues(){const{networkAddress:e}=z.getParams(),t=D.tokens?.find((t=>t.address===e));z.setSourceToken(t),z.setToToken(void 0)},getApprovalLoadingState:()=>D.loadingApprovalTransaction,clearError(){D.transactionError=void 0},async initializeState(){if(!D.initializing){if(D.initializing=!0,!D.initialized)try{await z.fetchTokens(),D.initialized=!0}catch(e){D.initialized=!1,v.P.showError("Failed to initialize swap"),w.I.goBack()}D.initializing=!1}},async fetchTokens(){const{networkAddress:e}=z.getParams();await z.getNetworkTokenPrice(),await z.getMyTokensWithBalance();const t=D.myTokensWithBalance?.find((t=>t.address===e));t&&(D.networkTokenSymbol=t.symbol,z.setSourceToken(t),z.setSourceTokenAmount("0"))},async getTokenList(){const e=d.W.state.activeCaipNetwork?.caipNetworkId;if(D.caipNetworkId!==e||!D.tokens)try{D.tokensLoading=!0;const t=await P.s.getTokenList(e);D.tokens=t,D.caipNetworkId=e,D.popularTokens=t.sort(((e,t)=>e.symbol<t.symbol?-1:e.symbol>t.symbol?1:0)),D.suggestedTokens=t.filter((e=>!!C.oU.SWAP_SUGGESTED_TOKENS.includes(e.symbol)))}catch(t){D.tokens=[],D.popularTokens=[],D.suggestedTokens=[]}finally{D.tokensLoading=!1}},async getAddressPrice(e){const t=D.tokensPriceMap[e];if(t)return t;const o=await E.T.fetchTokenPrice({addresses:[e]}),r=o?.fungibles||[],i=[...D.tokens||[],...D.myTokensWithBalance||[]],a=i?.find((t=>t.address===e))?.symbol,n=r.find((e=>e.symbol.toLowerCase()===a?.toLowerCase()))?.price||0,s=parseFloat(n.toString());return D.tokensPriceMap[e]=s,s},async getNetworkTokenPrice(){const{networkAddress:e}=z.getParams(),t=await E.T.fetchTokenPrice({addresses:[e]}).catch((()=>(v.P.showError("Failed to fetch network token price"),{fungibles:[]}))),o=t.fungibles?.[0],r=o?.price.toString()||"0";
1D.tokensPriceMap[e]=parseFloat(r),D.networkTokenSymbol=o?.symbol||"",D.networkPrice=r},async getMyTokensWithBalance(e){const t=await S.Z.getMyTokensWithBalance(e),o=P.s.mapBalancesToSwapTokens(t);o&&(await z.getInitialGasPrice(),z.setBalances(o))},setBalances(e){const{networkAddress:t}=z.getParams(),o=d.W.state.activeCaipNetwork;if(!o)return;const r=e.find((e=>e.address===t));e.forEach((e=>{D.tokensPriceMap[e.address]=e.price||0})),D.myTokensWithBalance=e.filter((e=>e.address.startsWith(o.caipNetworkId))),D.networkBalanceInUSD=r?T.S.multiply(r.quantity.numeric,r.price).toString():"0"},async getInitialGasPrice(){const e=await P.s.fetchGasPrice();if(!e)return{gasPrice:null,gasPriceInUSD:null};switch(d.W.state?.activeCaipNetwork?.chainNamespace){case s.o.CHAIN.SOLANA:return D.gasFee=e.standard??"0",D.gasPriceInUSD=T.S.multiply(e.standard,D.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(D.gasFee),gasPriceInUSD:Number(D.gasPriceInUSD)};case s.o.CHAIN.EVM:default:const t=e.standard??"0",o=BigInt(t),r=BigInt(R),i=$.getGasPriceInUSD(D.networkPrice,r,o);return D.gasFee=t,D.gasPriceInUSD=i,{gasPrice:o,gasPriceInUSD:i}}},async swapTokens(){const e=d.W.getAccountData()?.address,t=D.sourceToken,o=D.toToken,r=T.S.bigNumber(D.sourceTokenAmount).gt(0);if(r||z.setToTokenAmount(""),!o||!t||D.loadingPrices||!r||!e)return;D.loadingQuote=!0;const i=T.S.bigNumber(D.sourceTokenAmount).times(10**t.decimals).round(0);try{const r=await E.T.fetchSwapQuote({userAddress:e,from:t.address,to:o.address,gasPrice:D.gasFee,amount:i.toString()});D.loadingQuote=!1;const a=r?.quotes?.[0]?.toAmount;if(!a)return void W.h.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");const n=T.S.bigNumber(a).div(10**o.decimals).toString();z.setToTokenAmount(n);z.hasInsufficientToken(D.sourceTokenAmount,t.address)?D.inputError="Insufficient balance":(D.inputError=void 0,z.setTransactionDetails())}catch(a){const e=await P.s.handleSwapError(a);D.loadingQuote=!1,D.inputError=e||"Insufficient balance"}},async getTransaction(){const{fromCaipAddress:e,availableToSwap:t}=z.getParams(),o=D.sourceToken,r=D.toToken;if(e&&t&&o&&r&&!D.loadingQuote)try{D.loadingBuildTransaction=!0;let t;return t=await P.s.fetchSwapAllowance({userAddress:e,tokenAddress:o.address,sourceTokenAmount:D.sourceTokenAmount,sourceTokenDecimals:o.decimals})?await z.createSwapTransaction():await z.createAllowanceTransaction(),D.loadingBuildTransaction=!1,D.fetchError=!1,t}catch(i){return w.I.goBack(),v.P.showError("Failed to check allowance"),D.loadingBuildTransaction=!1,D.approvalTransaction=void 0,D.swapTransaction=void 0,void(D.fetchError=!0)}},async createAllowanceTransaction(){const{fromCaipAddress:e,sourceTokenAddress:t,toTokenAddress:o}=z.getParams();if(e&&o){if(!t)throw new Error("createAllowanceTransaction - No source token address found.");try{const r=await E.T.generateApproveCalldata({from:t,to:o,userAddress:e}),i=f.w.getPlainAddress(r.tx.from);if(!i)throw new Error("SwapController:createAllowanceTransaction - address is required");const a={data:r.tx.data,to:i,gasPrice:BigInt(r.tx.eip155.gasPrice),value:BigInt(r.tx.value),toAmount:D.toTokenAmount};return D.swapTransaction=void 0,D.approvalTransaction={data:a.data,to:a.to,gasPrice:a.gasPrice,value:a.value,toAmount:a.toAmount},{data:a.data,to:a.to,gasPrice:a.gasPrice,value:a.value,toAmount:a.toAmount}}catch(r){return w.I.goBack(),v.P.showError("Failed to create approval transaction"),D.approvalTransaction=void 0,D.swapTransaction=void 0,void(D.fetchError=!0)}}},async createSwapTransaction(){const{networkAddress:e,fromCaipAddress:t,sourceTokenAmount:o}=z.getParams(),r=D.sourceToken,i=D.toToken;if(!t||!o||!r||!i)return;const a=h.x.parseUnits(o,r.decimals)?.toString();try{const o=await E.T.generateSwapCalldata({userAddress:t,from:r.address,to:i.address,amount:a,disableEstimate:!0}),n=r.address===e,s=BigInt(o.tx.eip155.gas),c=BigInt(o.tx.eip155.gasPrice),l=f.w.getPlainAddress(o.tx.to);if(!l)throw new Error("SwapController:createSwapTransaction - address is required");const d={data:o.tx.data,to:l,gas:s,gasPrice:c,value:n?BigInt(a??"0"):BigInt("0"),toAmount:D.toTokenAmount};return D.gasPriceInUSD=$.getGasPriceInUSD(D.networkPrice,s,c),D.approvalTransaction=void 0,D.swapTransaction=d,d}catch(n){return w.I.goBack(),v.P.showError("Failed to create transaction"),D.approvalTransaction=void 0,D.swapTransaction=void 0,void(D.fetchError=!0)}},onEmbeddedWalletApprovalSuccess(){v.P.showLoading("Approve limit increase in your wallet"),w.I.replace("SwapPreview")},async sendTransactionForApproval(e){const{fromAddress:t,isAuthConnector:o}=z.getParams();D.loadingApprovalTransaction=!0;o?w.I.pushTransactionStack({onSuccess:z.onEmbeddedWalletApprovalSuccess}):v.P.showLoading("Approve limit increase in your wallet");try{await h.x.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:s.o.CHAIN.EVM}),await z.swapTokens(),await z.getTransaction(),D.approvalTransaction=void 0,D.loadingApprovalTransaction=!1}catch(r){const e=r;D.transactionError=e?.displayMessage,D.loadingApprovalTransaction=!1,v.P.showError(e?.displayMessage||"Transaction error"),N.E.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:e?.displayMessage||e?.message||"Unknown",network:d.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:z.state.sourceToken?.symbol||"",swapToToken:z.state.toToken?.symbol||"",swapFromAmount:z.state.sourceTokenAmount||"",swapToAmount:z.state.toTokenAmount||"",isSmartAccount:(0,A.lj)(s.o.CHAIN.EVM)===x.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(e){if(!e)return;const{fromAddress:t,toTokenAmount:o,isAuthConnector:r}=z.getParams();D.loadingTransaction=!0;const i=`Swapping ${D.sourceToken?.symbol} to ${T.S.formatNumberToLocalString(o,3)} ${D.toToken?.symbol}`,a=`Swapped ${D.sourceToken?.symbol} to ${T.S.formatNumberToLocalString(o,3)} ${D.toToken?.symbol}`;r?w.I.pushTransactionStack({onSuccess(){w.I.replace("Account"),v.P.showLoading(i),q.resetState()}}
1):v.P.showLoading("Confirm transaction in your wallet");try{const o=[D.sourceToken?.address,D.toToken?.address].join(","),i=await h.x.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:s.o.CHAIN.EVM});return D.loadingTransaction=!1,v.P.showSuccess(a),N.E.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:d.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:z.state.sourceToken?.symbol||"",swapToToken:z.state.toToken?.symbol||"",swapFromAmount:z.state.sourceTokenAmount||"",swapToAmount:z.state.toTokenAmount||"",isSmartAccount:(0,A.lj)(s.o.CHAIN.EVM)===x.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),q.resetState(),r||w.I.replace("Account"),q.getMyTokensWithBalance(o),i}catch(n){const e=n;return D.transactionError=e?.displayMessage,D.loadingTransaction=!1,v.P.showError(e?.displayMessage||"Transaction error"),void N.E.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:e?.displayMessage||e?.message||"Unknown",network:d.W.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:z.state.sourceToken?.symbol||"",swapToToken:z.state.toToken?.symbol||"",swapFromAmount:z.state.sourceTokenAmount||"",swapToAmount:z.state.toTokenAmount||"",isSmartAccount:(0,A.lj)(s.o.CHAIN.EVM)===x.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}})}},hasInsufficientToken:(e,t)=>$.isInsufficientSourceTokenForSwap(e,t,D.myTokensWithBalance),setTransactionDetails(){const{toTokenAddress:e,toTokenDecimals:t}=z.getParams();e&&t&&(D.gasPriceInUSD=$.getGasPriceInUSD(D.networkPrice,BigInt(D.gasFee),BigInt(R)),D.priceImpact=$.getPriceImpact({sourceTokenAmount:D.sourceTokenAmount,sourceTokenPriceInUSD:D.sourceTokenPriceInUSD,toTokenPriceInUSD:D.toTokenPriceInUSD,toTokenAmount:D.toTokenAmount}),D.maxSlippage=$.getMaxSlippage(D.slippage,D.toTokenAmount),D.providerFee=$.getProviderFee(D.sourceTokenAmount))}},z=(0,I.X)(q);var B=o(95946),F=o(35301),M=o(43166),U=o(16921);const H=U.AH` 2 :host { 3 display: block; 4 border-radius: clamp(0px, ${e=>{let{borderRadius:t}=e;return t[8]}}, 44px); 5 box-shadow: 0 0 0 1px ${e=>{let{tokens:t}=e;return t.theme.foregroundPrimary}}; 6 overflow: hidden; 7 } 8`;var j=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let L=class extends r.WF{render(){return r.qy`<slot></slot>`}};L.styles=[F.W5,H],L=j([(0,M.E)("wui-card")],L);o(31870),o(72018),o(2844),o(18882);const V=U.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: ${e=>{let{spacing:t}=e;return t[2]}}; 19 padding: ${e=>{let{spacing:t}=e;return t[3]}}; 20 border-radius: ${e=>{let{borderRadius:t}=e;return t[6]}}; 21 border: 1px solid ${e=>{let{tokens:t}=e;return t.theme.borderPrimary}}; 22 box-sizing: border-box; 23 background-color: ${e=>{let{tokens:t}=e;return t.theme.foregroundPrimary}}; 24 box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25); 25 color: ${e=>{let{tokens:t}=e;return t.theme.textPrimary}}; 26 } 27 28 :host > wui-flex[data-type='info'] { 29 .icon-box { 30 background-color: ${e=>{let{tokens:t}=e;return t.theme.foregroundSecondary}}; 31 32 wui-icon { 33 color: ${e=>{let{tokens:t}=e;return t.theme.iconDefault}}; 34 } 35 } 36 } 37 :host > wui-flex[data-type='success'] { 38 .icon-box { 39 background-color: ${e=>{let{tokens:t}=e;return t.core.backgroundSuccess}}; 40 41 wui-icon { 42 color: ${e=>{let{tokens:t}=e;return t.core.borderSuccess}}; 43 } 44 } 45 } 46 :host > wui-flex[data-type='warning'] { 47 .icon-box { 48 background-color: ${e=>{let{tokens:t}=e;return t.core.backgroundWarning}}; 49 50 wui-icon { 51 color: ${e=>{let{tokens:t}=e;return t.core.borderWarning}}; 52 } 53 } 54 } 55 :host > wui-flex[data-type='error'] { 56 .icon-box { 57 background-color: ${e=>{let{tokens:t}=e;return t.core.backgroundError}}; 58 59 wui-icon { 60 color: ${e=>{let{tokens:t}=e;return t.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: ${e=>{let{tokens:t}=e;return t.theme.iconDefault}}; 77 } 78 79 .icon-box { 80 height: 40px; 81 width: 40px; 82 border-radius: ${e=>{let{borderRadius:t}=e;return t[2]}}; 83 background-color: var(--local-icon-bg-value); 84 } 85`;var _=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const Z={info:"info",success:"checkmark",warning:"warningCircle",error:"warning"};let K=class extends r.WF{constructor(){super(...arguments),this.message="",this.type="info"}render(){return r.qy` 86 <wui-flex 87 data-type=${(0,a.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=${Z[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(){W.h.close()}};K.styles=[F.W5,V],_([(0,i.MZ)()],K.prototype,"message",void 0),_([(0,i.MZ)()],K.prototype,"type",void 0),K=_([(0,M.E)("wui-alertbar")],K);const G=B.AH` 115 :host { 116 display: block; 117 position: absolute; 118 top: ${e=>{let{spacing:t}=e;return t[3]}}; 119 left: ${e=>{let{spacing:t}=e;return t[4]}}; 120 right: ${e=>{let{spacing:t}=e;return t[4]}}; 121 opacity: 0; 122 pointer-events: none; 123 } 124`;var Y=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const X={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 J=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.open=W.h.state.open,this.onOpen(!0),this.unsubscribe.push(W.h.subscribeKey("open",(e=>{this.open=e,this.onOpen(!1)})))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){const{message:e,variant:t}=W.h.state,o=X[t];return r.qy` 125 <wui-alertbar 126 message=${e} 127 backgroundColor=${o?.backgroundColor} 128 iconColor=${o?.iconColor} 129 icon=${o?.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")}};J.styles=G,Y([(0,i.wk)()],J.prototype,"open",void 0),J=Y([(0,B.EM)("w3m-alertbar")],J);var Q=o(97544),ee=o(23032);const te=U.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: ${e=>{let{spacing:t}=e;return t[1]}}; 143 } 144 145 /* -- Colors --------------------------------------------------- */ 146 button[data-type='accent'] wui-icon { 147 color: ${e=>{let{tokens:t}=e;return t.core.iconAccentPrimary}}; 148 } 149 150 button[data-type='neutral'][data-variant='primary'] wui-icon { 151 color: ${e=>{let{tokens:t}=e;return t.theme.iconInverse}}; 152 } 153 154 button[data-type='neutral'][data-variant='secondary'] wui-icon { 155 color: ${e=>{let{tokens:t}=e;return t.theme.iconDefault}}; 156 } 157 158 button[data-type='success'] wui-icon { 159 color: ${e=>{let{tokens:t}=e;return t.core.iconSuccess}}; 160 } 161 162 button[data-type='error'] wui-icon { 163 color: ${e=>{let{tokens:t}=e;return t.core.iconError}}; 164 } 165 166 /* -- Sizes --------------------------------------------------- */ 167 button[data-size='xs'] { 168 width: 16px; 169 height: 16px; 170 171 border-radius: ${e=>{let{borderRadius:t}=e;return t[1]}}; 172 } 173 174 button[data-size='sm'] { 175 width: 20px; 176 height: 20px; 177 border-radius: ${e=>{let{borderRadius:t}=e;return t[1]}}; 178 } 179 180 button[data-size='md'] { 181 width: 24px; 182 height: 24px; 183 border-radius: ${e=>{let{borderRadius:t}=e;return t[2]}}; 184 } 185 186 button[data-size='lg'] { 187 width: 28px; 188 height: 28px; 189 border-radius: ${e=>{let{borderRadius:t}=e;return t[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: ${e=>{let{tokens:t}=e;return t.core.foregroundAccent010}}; 216 } 217 218 button[data-variant='primary'][data-type='neutral']:hover:enabled { 219 background-color: ${e=>{let{tokens:t}=e;return t.theme.foregroundSecondary}}; 220 } 221 222 button[data-variant='secondary'][data-type='neutral']:hover:enabled { 223 background-color: ${e=>{let{tokens:t}=e;return t.theme.foregroundSecondary}}; 224 } 225 226 button[data-type='success']:hover:enabled { 227 background-color: ${e=>{let{tokens:t}=e;return t.core.backgroundSuccess}}; 228 } 229 230 button[data-type='error']:hover:enabled { 231 background-color: ${e=>{let{tokens:t}=e;return t.core.backgroundError}}; 232 } 233 } 234 235 /* -- Focus --------------------------------------------------- */ 236 button:focus-visible { 237 box-shadow: 0 0 0 4px ${e=>{let{tokens:t}=e;return t.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 oe=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let re=class extends r.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 r.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,a.J)(this.iconSize)}></wui-icon> 261 </button>`}};re.styles=[F.W5,F.fD,te],oe([(0,i.MZ)()],re.prototype,"icon",void 0),oe([(0,i.MZ)()],re.prototype,"variant",void 0),oe([(0,i.MZ)()],re.prototype,"type",void 0),oe([(0,i.MZ)()],re.prototype,"size",void 0),oe([(0,i.MZ)()],re.prototype,"iconSize",void 0),oe([(0,i.MZ)({type:Boolean})],re.prototype,"fullWidth",void 0),oe([(0,i.MZ)({type:Boolean})],re.prototype,"disabled",void 0),re=oe([(0,M.E)("wui-icon-button")],re);o(92938);const ie=U.AH` 262 button { 263 display: block; 264 display: flex; 265 align-items: center; 266 padding: ${e=>{let{spacing:t}=e;return t[1]}}; 267 transition: background-color ${e=>{let{durations:t}=e;return t.lg}}
267 268 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 269 will-change: background-color; 270 border-radius: ${e=>{let{borderRadius:t}=e;return t[32]}}; 271 } 272 273 wui-image { 274 border-radius: 100%; 275 } 276 277 wui-text { 278 padding-left: ${e=>{let{spacing:t}=e;return t[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: ${e=>{let{tokens:t}=e;return t.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: ${e=>{let{tokens:t}=e;return t.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: ${e=>{let{tokens:t}=e;return t.theme.foregroundSecondary}}; 348 box-shadow: 0 0 0 4px ${e=>{let{tokens:t}=e;return t.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: ${e=>{let{tokens:t}=e;return t.theme.foregroundSecondary}}; 356 } 357 } 358 359 /* -- Disabled states --------------------------------------------------- */ 360 button:disabled { 361 background-color: ${e=>{let{tokens:t}=e;return t.theme.foregroundSecondary}}; 362 opacity: 0.5; 363 } 364`;var ae=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const ne={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},se={lg:"lg",md:"md",sm:"sm"};let ce=class extends r.WF{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size="lg",this.type="text-dropdown",this.disabled=!1}render(){return r.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(){const e=ne[this.size];return this.text?r.qy`<wui-text color="primary" variant=${e}>${this.text}</wui-text>`:null}imageTemplate(){if(this.imageSrc)return r.qy`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`;const e=se[this.size];return r.qy` <wui-flex class="left-icon-container"> 370 <wui-icon size=${e} name="networkPlaceholder"></wui-icon> 371 </wui-flex>`}};ce.styles=[F.W5,F.fD,ie],ae([(0,i.MZ)()],ce.prototype,"imageSrc",void 0),ae([(0,i.MZ)()],ce.prototype,"text",void 0),ae([(0,i.MZ)()],ce.prototype,"size",void 0),ae([(0,i.MZ)()],ce.prototype,"type",void 0),ae([(0,i.MZ)({type:Boolean})],ce.prototype,"disabled",void 0),ce=ae([(0,M.E)("wui-select")],ce);o(47373),o(72698);var le=o(91833);const de=B.AH` 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 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}, 393 slide-down-in 120ms forwards ${e=>{let{easings:t}=e;return t["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 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}, 400 slide-up-in 120ms forwards ${e=>{let{easings:t}=e;return t["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 ue=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const pe=["SmartSessionList"],we={PayWithExchange:B.f.tokens.theme.foregroundPrimary};function he(){const e=w.I.state.data?.connector?.name,t=w.I.state.data?.wallet?.name,o=w.I.state.data?.network?.name,r=t??e,i=u.a.getConnectors(),a=1===i.length&&"w3m-email"===i[0]?.id,n=d.W.getAccountData()?.socialProvider;return{Connect:`Connect ${a?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",ConnectingExter
452nal:r??"Connect Wallet",ConnectingWalletConnect:r??"WalletConnect",ConnectingWalletConnectBasic:"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview Convert",Downloads:r?`Get ${r}`:"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: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:"Payment in Progress",DataCapture:"Profile",DataCaptureOtpConfirm:"Confirm Email",FundWallet:"Fund Wallet",PayWithExchange:"Deposit from Exchange",PayWithExchangeSelectAsset:"Select Asset"}}let me=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.heading=he()[w.I.state.view],this.network=d.W.state.activeCaipNetwork,this.networkImage=Q.$.getNetworkImage(this.network),this.showBack=!1,this.prevHistoryLength=1,this.view=w.I.state.view,this.viewDirection="",this.unsubscribe.push(ee.j.subscribeNetworkImages((()=>{this.networkImage=Q.$.getNetworkImage(this.network)})),w.I.subscribeKey("view",(e=>{setTimeout((()=>{this.view=e,this.heading=he()[e]}),le.o.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()})),d.W.subscribeKey("activeCaipNetwork",(e=>{this.network=e,this.networkImage=Q.$.getNetworkImage(this.network)})))}disconnectCallback(){this.unsubscribe.forEach((e=>e()))}render(){const e=we[w.I.state.view]??B.f.tokens.theme.backgroundPrimary;return this.style.setProperty("--local-header-background-color",e),r.qy` 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(){N.E.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),w.I.push("WhatIsAWallet")}async onClose(){await g.safeClose()}rightHeaderTemplate(){const e=c.H?.state?.features?.smartSessions;return"Account"===w.I.state.view&&e?r.qy`<wui-flex> 461 <wui-icon-button 462 icon="clock" 463 size="lg" 464 iconSize="lg" 465 type="neutral" 466 variant="primary" 467 @click=${()=>w.I.push("SmartSessionList")} 468 data-testid="w3m-header-smart-sessions" 469 ></wui-icon-button> 470 ${this.closeButtonTemplate()} 471 </wui-flex> `:this.closeButtonTemplate()}closeButtonTemplate(){return r.qy` 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 e=pe.includes(this.view);return r.qy` 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 ${e?r.qy`<wui-tag variant="accent" size="md">Beta</wui-tag>`:null} 497 </wui-flex> 498 `}leftHeaderTemplate(){const{view:e}=w.I.state,t="Connect"===e,o=c.H.state.enableEmbedded,i="ApproveTransaction"===e,n="ConnectingSiwe"===e,s="Account"===e,l=c.H.state.enableNetworkSwitch,d=i||n||t&&o;return s&&l?r.qy`<wui-select 499 id="dynamic" 500 data-testid="w3m-account-select-network" 501 active-network=${(0,a.J)(this.network?.name)}
501 502 @click=${this.onNetworks.bind(this)} 503 imageSrc=${(0,a.J)(this.networkImage)} 504 ></wui-select>`:this.showBack&&!d?r.qy`<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>`:r.qy`<wui-icon-button 514 data-hidden=${!t} 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()&&(N.E.sendEvent({type:"track",event:"CLICK_NETWORKS"}),w.I.push("Networks"))}isAllowedNetworkSwitch(){const e=d.W.getAllRequestedCaipNetworks(),t=!!e&&e.length>1,o=e?.find((e=>{let{id:t}=e;return t===this.network?.id}));return t||!o}onViewChange(){const{history:e}=w.I.state;let t=le.o.VIEW_DIRECTION.Next;e.length<this.prevHistoryLength&&(t=le.o.VIEW_DIRECTION.Prev),this.prevHistoryLength=e.length,this.viewDirection=t}async onHistoryChange(){const{history:e}=w.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(){w.I.goBack()}};me.styles=de,ue([(0,i.wk)()],me.prototype,"heading",void 0),ue([(0,i.wk)()],me.prototype,"network",void 0),ue([(0,i.wk)()],me.prototype,"networkImage",void 0),ue([(0,i.wk)()],me.prototype,"showBack",void 0),ue([(0,i.wk)()],me.prototype,"prevHistoryLength",void 0),ue([(0,i.wk)()],me.prototype,"view",void 0),ue([(0,i.wk)()],me.prototype,"viewDirection",void 0),me=ue([(0,B.EM)("w3m-header")],me);o(72613),o(50494);const ge=U.AH` 523 :host { 524 display: flex; 525 align-items: center; 526 gap: ${e=>{let{spacing:t}=e;return t[1]}}; 527 padding: ${e=>{let{spacing:t}=e;return t[2]}} ${e=>{let{spacing:t}=e;return t[3]}} 528 ${e=>{let{spacing:t}=e;return t[2]}} ${e=>{let{spacing:t}=e;return t[2]}}; 529 border-radius: ${e=>{let{borderRadius:t}=e;return t[20]}}; 530 background-color: ${e=>{let{tokens:t}=e;return t.theme.foregroundPrimary}}; 531 box-shadow: 532 0px 0px 8px 0px rgba(0, 0, 0, 0.1), 533 inset 0 0 0 1px ${e=>{let{tokens:t}=e;return t.theme.borderPrimary}}; 534 max-width: 320px; 535 } 536 537 wui-icon-box { 538 border-radius: ${e=>{let{borderRadius:t}=e;return t.round}} !important; 539 overflow: hidden; 540 } 541 542 wui-loading-spinner { 543 padding: ${e=>{let{spacing:t}=e;return t[1]}}; 544 background-color: ${e=>{let{tokens:t}=e;return t.core.foregroundAccent010}}; 545 border-radius: ${e=>{let{borderRadius:t}=e;return t.round}} !important; 546 } 547`;var ye=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ve=class extends r.WF{constructor(){super(...arguments),this.message="",this.variant="success"}render(){return r.qy` 548 ${this.templateIcon()} 549 <wui-text variant="lg-regular" color="primary" data-testid="wui-snackbar-message" 550 >${this.message}</wui-text 551 > 552 `}templateIcon(){return"loading"===this.variant?r.qy`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:r.qy`<wui-icon-box 553 size="md" 554 color=${{success:"success",error:"error",warning:"warning",info:"default"}[this.variant]} 555 icon=${{success:"checkmark",error:"warning",warning:"warningCircle",info:"info"}[this.variant]} 556 ></wui-icon-box>`}};ve.styles=[F.W5,ge],ye([(0,i.MZ)()],ve.prototype,"message",void 0),ye([(0,i.MZ)()],ve.prototype,"variant",void 0),ve=ye([(0,M.E)("wui-snackbar")],ve);const fe=r.AH` 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 be=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ke=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=v.P.state.open,this.unsubscribe.push(v.P.subscribeKey("open",(e=>{this.open=e,this.onOpen()})))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach((e=>e()))}render(){const{message:e,variant:t}=v.P.state;return r.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),v.P.state.autoClose&&(this.timeout=setTimeout((()=>v.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"})}};ke.styles=fe,be([(0,i.wk)()],ke.prototype,"open",void 0),ke=be([(0,B.EM)("w3m-snackbar")],ke);const Te=(0,b.BX)({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),xe={state:Te,subscribe:e=>(0,b.B1)(Te,(()=>e(Te))),subscribeKey:(e,t)=>(0,k.u$)(Te,e,t),showTooltip(e){let{message:t,triggerRect:o,variant:r}=e;Te.open=!0,Te.message=t,Te.triggerRect=o,Te.variant=r},hide(){Te.open=!1,Te.message="",Te.triggerRect={width:0,height:0,top:0,left:0}}},Se=(0,I.X)(xe);o(56300);const Ae=B.AH` 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 ${e=>{let{spacing:t}=e;return t[3]}} 10px ${e=>{let{spacing:t}=e;return t[3]}}; 575 border-radius: ${e=>{let{borderRadius:t}=e;return t[3]}}; 576 color: ${e=>{let{tokens:t}=e;return t.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) - ${e=>{let{spacing:t}=e;return t[5]}}); 582 transition: opacity ${e=>{let{durations:t}=e;return t.lg}}
582 583 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 584 will-change: opacity; 585 opacity: 0; 586 animation-duration: ${e=>{let{durations:t}=e;return t.xl}}; 587 animation-timing-function: ${e=>{let{easings:t}=e;return t["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: ${e=>{let{tokens:t}=e;return t.theme.foregroundPrimary}}; 594 } 595 596 :host([data-variant='shade']) > wui-flex > wui-text { 597 color: ${e=>{let{tokens:t}=e;return t.theme.textSecondary}}; 598 } 599 600 :host([data-variant='fill']) > wui-flex { 601 background-color: ${e=>{let{tokens:t}=e;return t.theme.textPrimary}}; 602 border: none; 603 } 604 605 wui-icon { 606 position: absolute; 607 width: 12px !important; 608 height: 4px !important; 609 color: ${e=>{let{tokens:t}=e;return t.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,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let Pe=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.open=Se.state.open,this.message=Se.state.message,this.triggerRect=Se.state.triggerRect,this.variant=Se.state.variant,this.unsubscribe.push(Se.subscribe((e=>{this.open=e.open,this.message=e.message,this.triggerRect=e.triggerRect,this.variant=e.variant})))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){this.dataset.variant=this.variant;const e=this.triggerRect.top,t=this.triggerRect.left;return this.style.cssText=`\n --w3m-tooltip-top: ${e}px;\n --w3m-tooltip-left: ${t}px;\n --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;\n --w3m-tooltip-display: ${this.open?"flex":"none"};\n --w3m-tooltip-opacity: ${this.open?1:0};\n `,r.qy`<wui-flex> 645 <wui-icon data-placement="top" size="inherit" name="cursor"></wui-icon> 646 <wui-text color="primary" variant="sm-regular">${this.message}</wui-text> 647 </wui-flex>`}};Pe.styles=[Ae],Ce([(0,i.wk)()],Pe.prototype,"open",void 0),Ce([(0,i.wk)()],Pe.prototype,"message",void 0),Ce([(0,i.wk)()],Pe.prototype,"triggerRect",void 0),Ce([(0,i.wk)()],Pe.prototype,"variant",void 0),Pe=Ce([(0,B.EM)("w3m-tooltip")],Pe);const $e={getTabsByNamespace:e=>Boolean(e)&&e===s.o.CHAIN.EVM?!1===c.H.state.remoteFeatures?.activity?le.o.ACCOUNT_TABS.filter((e=>"Activity"!==e.label)):le.o.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(){const e=w.I.state.view;if(le.o.VIEWS_WITH_LEGAL_FOOTER.includes(e)){const{termsConditionsUrl:e,privacyPolicyUrl:t}=c.H.state,o=c.H.state.features?.legalCheckbox;return!(!e&&!t||o)}return le.o.VIEWS_WITH_DEFAULT_FOOTER.includes(e)}};o(66155);const Ie=B.AH` 648 :host wui-ux-by-reown { 649 padding-top: 0; 650 } 651 652 :host wui-ux-by-reown.branding-only { 653 padding-top: ${e=>{let{spacing:t}=e;return t[3]}}; 654 } 655 656 a { 657 text-decoration: none; 658 color: ${e=>{let{tokens:t}=e;return t.core.textAccentPrimary}}; 659 font-weight: 500; 660 } 661`;var We=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let Ee=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=c.H.state.remoteFeatures,this.unsubscribe.push(c.H.subscribeKey("remoteFeatures",(e=>this.remoteFeatures=e)))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=c.H.state,o=c.H.state.features?.legalCheckbox;return!e&&!t||o?r.qy` 662 <wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex> 663 `:r.qy` 664 <wui-flex flexDirection="column"> 665 <wui-flex .padding=${["4","3","3","3"]} justifyContent="center"> 666 <wui-text color="secondary" variant="md-regular" align="center"> 667 By connecting your wallet, you agree to our <br /> 668 ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()} 669 </wui-text> 670 </wui-flex> 671 ${this.reownBrandingTemplate()} 672 </wui-flex> 673 `}andTemplate(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=c.H.state;return e&&t?"and":""}termsTemplate(){const{termsConditionsUrl:e}=c.H.state;return e?r.qy`<a href=${e} target="_blank" rel="noopener noreferrer" 674 >Terms of Service</a 675 >`:null}privacyTemplate(){const{privacyPolicyUrl:e}=c.H.state;return e?r.qy`<a href=${e} target="_blank" rel="noopener noreferrer" 676 >Privacy Policy</a 677 >`:null}reownBrandingTemplate(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.remoteFeatures?.reownBranding?e?r.qy`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:r.qy`<wui-ux-by-reown></wui-ux-by-reown>`:null}};Ee.styles=[Ie],We([(0,i.wk)()],Ee.prototype,"remoteFeatures",void 0),Ee=We([(0,B.EM)("w3m-legal-footer")],Ee);o(28572);const Ne=r.AH``;var Re=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let Oe=class extends r.WF{render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=c.H.state;return e||t?r.qy` 678 <wui-flex 679 .padding=${["4","3","3","3"]} 680 flexDirection="column" 681 alignItems="center" 682 justifyContent="center" 683 gap="3" 684 > 685 <wui-text color="secondary" variant="md-regular" align="center"> 686 We work with the best providers to give you the lowest fees and best support. More options 687 coming soon! 688 </wui-text> 689 690 ${this.howDoesItWorkTemplate()} 691 </wui-flex> 692 `:null}howDoesItWorkTemplate(){return r.qy` <wui-link @click=${this.onWhatIsBuy.bind(this)}> 693 <wui-icon size="xs" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon> 694 How does it work? 695 </wui-link>`}onWhatIsBuy(){N.E.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:(0,A.lj)(d.W.state.activeChain)===x.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}}),w.I.push("WhatIsABuy")}};Oe.styles=[Ne],Oe=Re([(0,B.EM)("w3m-onramp-providers-footer")],Oe);const De=B.AH` 696 :host { 697 display: block; 698 } 699 700 div.container { 701 position: absolute; 702 bottom: 0; 703 left: 0; 704 right: 0; 705 overflow: hidden; 706 height: auto; 707 display: block; 708 } 709 710 div.container[status='hide'] { 711 animation: fade-out; 712 animation-duration: var(--apkt-duration-dynamic); 713 animation-timing-function: ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 714 animation-fill-mode: both; 715 animation-delay: 0s; 716 } 717 718 div.container[status='show'] { 719 animation: fade-in; 720 animation-duration: var(--apkt-duration-dynamic); 721 animation-timing-function: ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 722 animation-fill-mode: both; 723 animation-delay: var(--apkt-duration-dynamic); 724 } 725 726 @keyframes fade-in { 727 from { 728 opacity: 0; 729 filter: blur(6px); 730 } 731 to { 732 opacity: 1; 733 filter: blur(0px); 734 } 735 } 736 737 @keyframes fade-out { 738 from { 739 opacity: 1; 740 filter: blur(0px); 741 } 742 to { 743 opacity: 0; 744 filter: blur(6px); 745 } 746 } 747`;var qe=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let ze=class extends r.WF{constructor(){super(...arguments),this.resizeObserver=void 0,this.unsubscribe=[],this.status="hide",this.view=w.I.state.view}firstUpdated(){this.status=$e.hasFooter()?"show":"hide",this.unsubscribe.push(w.I.subscribeKey("view",(e=>{if(this.view=e,this.status=$e.hasFooter()?"show":"hide","hide"===this.status){document.documentElement.style.setProperty("--apkt-footer-height","0px")}}))),this.resizeObserver=new ResizeObserver((e=>{for(const t of e)if(t.target===this.getWrapper()){const e=`${t.contentRect.height}px`;document.documentElement.style.setProperty("--apkt-footer-height",e)}})),this.resizeObserver.observe(this.getWrapper())}render(){return r.qy` 748 <div class="container" status=${this.status}>${this.templatePageContainer()}</div> 749 `}templatePageContainer(){return $e.hasFooter()?r.qy` ${this.templateFooter()}`:null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return r.qy`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return r.qy`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return r.qy` <wui-flex 750 class="footer-in" 751 padding="3" 752 flexDirection="column" 753 gap="3" 754 alignItems="center" 755 > 756 <wui-text variant="md-regular" color="secondary" align="center"> 757 Your connected wallet may not support some of the networks available for this dApp 758 </wui-text> 759 <wui-link @click=${this.onNetworkHelp.bind(this)}> 760 <wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon> 761 What is a network 762 </wui-link> 763 </wui-flex>`}onNetworkHelp(){N.E.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),w.I.push("WhatIsANetwork")}getWrapper(){return this.shadowRoot?.querySelector("div.container")}};
763ze.styles=[De],qe([(0,i.wk)()],ze.prototype,"status",void 0),qe([(0,i.wk)()],ze.prototype,"view",void 0),ze=qe([(0,B.EM)("w3m-footer")],ze);const Be=B.AH` 764 :host { 765 display: block; 766 width: inherit; 767 } 768`;var Fe=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let Me=class extends r.WF{constructor(){super(),this.unsubscribe=[],this.viewState=w.I.state.view,this.history=w.I.state.history.join(","),this.unsubscribe.push(w.I.subscribeKey("view",(()=>{this.history=w.I.state.history.join(","),document.documentElement.style.setProperty("--apkt-duration-dynamic","var(--apkt-durations-lg)")})))}disconnectedCallback(){this.unsubscribe.forEach((e=>e())),document.documentElement.style.setProperty("--apkt-duration-dynamic","0s")}render(){return r.qy`${this.templatePageContainer()}`}templatePageContainer(){return r.qy`<w3m-router-container 769 history=${this.history} 770 .setView=${()=>{this.viewState=w.I.state.view}} 771 > 772 ${this.viewTemplate(this.viewState)} 773 </w3m-router-container>`}viewTemplate(e){switch(e){case"AccountSettings":return r.qy`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return r.qy`<w3m-account-view></w3m-account-view>`;case"AllWallets":return r.qy`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return r.qy`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return r.qy`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return r.qy`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":default:return r.qy`<w3m-connect-view></w3m-connect-view>`;case"Create":return r.qy`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return r.qy`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return r.qy`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return r.qy`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return r.qy`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return r.qy`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return r.qy`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return r.qy`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return r.qy`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return r.qy`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return r.qy`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return r.qy`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return r.qy`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return r.qy`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return r.qy`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return r.qy`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return r.qy`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return r.qy`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return r.qy`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return r.qy`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return r.qy`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return r.qy`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return r.qy`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return r.qy`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return r.qy`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return r.qy`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return r.qy`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return r.qy`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return r.qy`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return r.qy`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return r.qy`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return r.qy`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return r.qy`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return r.qy`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return r.qy`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return r.qy`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return r.qy`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return r.qy`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return r.qy`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return r.qy`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return r.qy`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return r.qy`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return r.qy`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return r.qy`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return r.qy`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return r.qy`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return r.qy`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return r.qy`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return r.qy`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"FundWallet":return r.qy`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return r.qy`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return r.qy`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`}}};Me.styles=[Be],Fe([(0,i.wk)()],Me.prototype,"viewState",void 0),Fe([(0,i.wk)()],Me.prototype,"history",void 0),Me=Fe([(0,B.EM)("w3m-router")],Me);const Ue=B.AH` 774 :host { 775 z-index: ${e=>{let{tokens:t}=e;return t.core.zIndex}}; 776 display: block; 777 backface-visibility: hidden; 778 will-change: opacity; 779 position: fixed; 780 top: 0; 781 left: 0; 782 right: 0; 783 bottom: 0; 784 pointer-events: none; 785 opacity: 0; 786 background-color: ${e=>{let{tokens:t}=e;return t.theme.overlay}}; 787 backdrop-filter: blur(0px); 788 transition: 789 opacity ${e=>{let{durations:t}=e;return t.lg}}
789 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}, 790 backdrop-filter ${e=>{let{durations:t}=e;return t.lg}} 791 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 792 will-change: opacity; 793 } 794 795 :host(.open) { 796 opacity: 1; 797 backdrop-filter: blur(8px); 798 } 799 800 :host(.appkit-modal) { 801 position: relative; 802 pointer-events: unset; 803 background: none; 804 width: 100%; 805 opacity: 1; 806 } 807 808 wui-card { 809 max-width: var(--apkt-modal-width); 810 width: 100%; 811 position: relative; 812 outline: none; 813 transform: translateY(4px); 814 box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.05); 815 transition: 816 transform ${e=>{let{durations:t}=e;return t.lg}} 817 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}, 818 border-radius ${e=>{let{durations:t}=e;return t.lg}} 819 ${e=>{let{easings:t}=e;return t["ease-out-power-1"]}}, 820 background-color ${e=>{let{durations:t}=e;return t.lg}} 821 ${e=>{let{easings:t}=e;return t["ease-out-power-1"]}}, 822 box-shadow ${e=>{let{durations:t}=e;return t.lg}} 823 ${e=>{let{easings:t}=e;return t["ease-out-power-1"]}}; 824 will-change: border-radius, background-color, transform, box-shadow; 825 background-color: ${e=>{let{tokens:t}=e;return t.theme.backgroundPrimary}}; 826 padding: var(--local-modal-padding); 827 box-sizing: border-box; 828 } 829 830 :host(.open) wui-card { 831 transform: translateY(0px); 832 } 833 834 wui-card::before { 835 z-index: 1; 836 pointer-events: none; 837 content: ''; 838 position: absolute; 839 inset: 0; 840 border-radius: clamp(0px, var(--apkt-borderRadius-8), 44px); 841 transition: box-shadow ${e=>{let{durations:t}=e;return t.lg}} 842 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 843 transition-delay: ${e=>{let{durations:t}=e;return t.md}}; 844 will-change: box-shadow; 845 } 846 847 :host([data-mobile-fullscreen='true']) wui-card::before { 848 border-radius: 0px; 849 } 850 851 :host([data-border='true']) wui-card::before { 852 box-shadow: inset 0px 0px 0px 4px ${e=>{let{tokens:t}=e;return t.theme.foregroundSecondary}}; 853 } 854 855 :host([data-border='false']) wui-card::before { 856 box-shadow: inset 0px 0px 0px 1px ${e=>{let{tokens:t}=e;return t.theme.borderPrimaryDark}}; 857 } 858 859 :host([data-border='true']) wui-card { 860 animation: 861 fade-in ${e=>{let{durations:t}=e;return t.lg}} ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}, 862 card-background-border var(--apkt-duration-dynamic) 863 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 864 animation-fill-mode: backwards, both; 865 animation-delay: var(--apkt-duration-dynamic); 866 } 867 868 :host([data-border='false']) wui-card { 869 animation: 870 fade-in ${e=>{let{durations:t}=e;return t.lg}} ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}, 871 card-background-default var(--apkt-duration-dynamic) 872 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 873 animation-fill-mode: backwards, both; 874 animation-delay: 0s; 875 } 876 877 :host(.appkit-modal) wui-card { 878 max-width: var(--apkt-modal-width); 879 } 880 881 wui-card[shake='true'] { 882 animation: 883 fade-in ${e=>{let{durations:t}=e;return t.lg}} ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}, 884 w3m-shake ${e=>{let{durations:t}=e;return t.xl}} 885 ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 886 } 887 888 wui-flex { 889 overflow-x: hidden; 890 overflow-y: auto; 891 display: flex; 892 align-items: center; 893 justify-content: center; 894 width: 100%; 895 height: 100%; 896 } 897 898 @media (max-height: 700px) and (min-width: 431px) { 899 wui-flex { 900 align-items: flex-start; 901 } 902 903 wui-card { 904 margin: var(--apkt-spacing-6) 0px; 905 } 906 } 907 908 @media (max-width: 430px) { 909 :host([data-mobile-fullscreen='true']) { 910 height: 100dvh; 911 } 912 :host([data-mobile-fullscreen='true']) wui-flex { 913 align-items: stretch; 914 } 915 :host([data-mobile-fullscreen='true']) wui-card { 916 max-width: 100%; 917 height: 100%; 918 border-radius: 0; 919 border: none; 920 } 921 :host(:not([data-mobile-fullscreen='true'])) wui-flex { 922 align-items: flex-end; 923 } 924 925 :host(:not([data-mobile-fullscreen='true'])) wui-card { 926 max-width: 100%; 927 border-bottom: none; 928 } 929 930 :host(:not([data-mobile-fullscreen='true'])) wui-card[data-embedded='true'] { 931 border-bottom-left-radius: clamp(0px, var(--apkt-borderRadius-8), 44px); 932 border-bottom-right-radius: clamp(0px, var(--apkt-borderRadius-8), 44px); 933 } 934 935 :host(:not([data-mobile-fullscreen='true'])) wui-card:not([data-embedded='true']) { 936 border-bottom-left-radius: 0px; 937 border-bottom-right-radius: 0px; 938 } 939 940 wui-card[shake='true'] { 941 animation: w3m-shake 0.5s ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 942 } 943 } 944 945 @keyframes fade-in { 946 0% { 947 transform: scale(0.99) translateY(4px); 948 } 949 100% { 950 transform: scale(1) translateY(0); 951 } 952 } 953 954 @keyframes w3m-shake { 955 0% { 956 transform: scale(1) rotate(0deg); 957 } 958 20% { 959 transform: scale(1) rotate(-1deg); 960 } 961 40% { 962 transform: scale(1) rotate(1.5deg); 963 } 964 60% { 965 transform: scale(1) rotate(-1.5deg); 966 } 967 80% { 968 transform: scale(1) rotate(1deg); 969 } 970 100% { 971 transform: scale(1) rotate(0deg); 972 } 973 } 974 975 @keyframes card-background-border { 976 from { 977 background-color: ${e=>{let{tokens:t}=e;return t.theme.backgroundPrimary}}; 978 } 979 to { 980 background-color: ${e=>{let{tokens:t}=e;return t.theme.foregroundSecondary}}; 981 } 982 } 983 984 @keyframes card-background-default { 985 from { 986 background-color: ${e=>{let{tokens:t}=e;return t.theme.foregroundSecondary}}; 987 } 988 to { 989 background-color: ${e=>{let{tokens:t}=e;return t.theme.backgroundPrimary}}; 990 } 991 } 992`;var He=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};const je="scroll-lock",Le={PayWithExchange:"0",PayWithExchangeSelectAsset:"0"};class Ve extends r.WF{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.hasPrefetched=!1,this.enableEmbedded=c.H.state.enableEmbedded,this.open=l.W.state.open,this.caipAddress=d.W.state.activeCaipAddress,this.caipNetwork=d.W.state.activeCaipNetwork,this.shake=l.W.state.shake,this.filterByNamespace=u.a.state.filterByNamespace,this.padding=B.f.spacing[1],this.mobileFullScreen=c.H.state.enableMobileFullScreen,this.initializeTheming(),p.N.prefetchAnalyticsConfig(),this.unsubscribe.push(l.W.subscribeKey("open",(e=>e?this.onOpen():this.onClose())),l.W.subscribeKey("shake",(e=>this.shake=e)),d.W.subscribeKey("activeCaipNetwork",(e=>this.onNewNetwork(e))),d.W.subscribeKey("activeCaipAddress",(e=>this.onNewAddress(e))),c.H.subscribeKey("enableEmbedded",(e=>this.enableEmbedded=e)),u.a.subscribeKey("filterByNamespace",(e=>{this.filterByNamespace===e||d.W.getAccountData(e)?.caipAddress||(p.N.fetchRecommendedWallets(),this.filterByNamespace=e)})),w.I.subscribeKey("view",(()=>{this.dataset.border=$e.hasFooter()?"true":"false",this.padding=Le[w.I.state.view]??B.f.spacing[1]})))}firstUpdated(){if(this.dataset.border=$e.hasFooter()?"true":"false",this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.caipAddress){if(this.enableEmbedded)return l.W.close(),void this.prefetch();this.onNewAddress(this.caipAddress)}this.open&&this.onOpen(),this.enableEmbedded&&this.prefetch()}disconnectedCallback(){this.unsubscribe.forEach((e=>e())),this.onRemoveKeyboardListener()}render(){return this.style.setProperty("--local-modal-padding",this.padding),this.enableEmbedded?r.qy`${this.contentTemplate()} 993 <w3m-tooltip></w3m-tooltip> `:this.open?r.qy` 994 <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay"> 995 ${this.contentTemplate()} 996 </wui-flex> 997 <w3m-tooltip></w3m-tooltip> 998 `:null}contentTemplate(){return r.qy` <wui-card 999 shake="${this.shake}" 1000 data-embedded="${(0,a.J)(this.enableEmbedded)}" 1001 role="alertdialog" 1002 aria-modal="true" 1003 tabindex="0" 1004 data-testid="w3m-modal-card" 1005 > 1006 <w3m-header></w3m-header> 1007 <w3m-router></w3m-router> 1008 <w3m-footer></w3m-footer> 1009 <w3m-snackbar></w3m-snackbar> 1010 <w3m-alertbar></w3m-alertbar> 1011 </wui-card>`}async onOverlayClick(e){if(e.target===e.currentTarget){if(this.mobileFullScreen)return;await this.handleClose()}}async handleClose(){await g.safeClose()}initializeTheming(){const{themeVariables:e,themeMode:t}=y.W.state,o=B.Zv.getColorTheme(t);(0,B.RF)(e,o)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),v.P.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=je,e.textContent="\n body {\n touch-action: none;\n overflow: hidden;\n overscroll-behavior: contain;\n }\n w3m-modal {\n pointer-events: auto;\n }\n ",document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${je}"]`);e&&e.remove()}onAddKeyboardListener(){this.abortController=new AbortController;const e=this.shadowRoot?.querySelector("wui-card");e?.focus(),window.addEventListener("keydown",(t=>{if("Escape"===t.key)this.handleClose();else if("Tab"===t.key){const{tagName:o}=t.target;!o||o.includes("W3M-")||o.includes("WUI-")||e?.focus()}}),this.abortController)}onRemoveKeyboardListener(){this.abortController?.abort(),this.abortController=void 0}async onNewAddress(e){const t=d.W.state.isSwitchingNamespace,o="ProfileWallets"===w.I.state.view;e?await this.onConnected({caipAddress:e,isSwitchingNamespace:t,isInProfileView:o}):t||this.enableEmbedded||o||l.W.close(),await m.U.initializeIfEnabled(e),this.caipAddress=e,d.W.setIsSwitchingNamespace(!1)}async onConnected(e){if(e.isInProfileView)return;const{chainNamespace:t,chainId:o,address:r}=n.C.parseCaipAddress(e.caipAddress),i=`${t}:${o}
1011`,a=!f.w.getPlainAddress(this.caipAddress),s=await m.U.getSessions({address:r,caipNetworkId:i}),c=!m.U.getSIWX()||s.some((e=>e.data.accountAddress===r)),d=e.isSwitchingNamespace&&c&&!this.enableEmbedded,u=this.enableEmbedded&&a;d?w.I.goBack():u&&l.W.close()}onNewNetwork(e){const t=this.caipNetwork,o=t?.caipNetworkId?.toString(),r=t?.chainNamespace,i=e?.caipNetworkId?.toString(),a=e?.chainNamespace,n=o!==i,c=n&&!(r!==a),u=t?.name===s.o.UNSUPPORTED_NETWORK_NAME,p="ConnectingExternal"===w.I.state.view,h="ProfileWallets"===w.I.state.view,m=!d.W.getAccountData(e?.chainNamespace)?.caipAddress,g="UnsupportedChain"===w.I.state.view,y=l.W.state.open;let v=!1;this.enableEmbedded&&"SwitchNetwork"===w.I.state.view&&(v=!0),n&&z.resetState(),!y||p||h||(m?n&&(v=!0):(g||c&&!u)&&(v=!0)),v&&"SIWXSignMessage"!==w.I.state.view&&w.I.goBack(),this.caipNetwork=e}prefetch(){this.hasPrefetched||(p.N.prefetch(),p.N.fetchWalletsByPage({page:1}),this.hasPrefetched=!0)}}Ve.styles=Ue,He([(0,i.MZ)({type:Boolean})],Ve.prototype,"enableEmbedded",void 0),He([(0,i.wk)()],Ve.prototype,"open",void 0),He([(0,i.wk)()],Ve.prototype,"caipAddress",void 0),He([(0,i.wk)()],Ve.prototype,"caipNetwork",void 0),He([(0,i.wk)()],Ve.prototype,"shake",void 0),He([(0,i.wk)()],Ve.prototype,"filterByNamespace",void 0),He([(0,i.wk)()],Ve.prototype,"padding",void 0),He([(0,i.wk)()],Ve.prototype,"mobileFullScreen",void 0);let _e=class extends Ve{};_e=He([(0,B.EM)("w3m-modal")],_e);let Ze=class extends Ve{};Ze=He([(0,B.EM)("appkit-modal")],Ze);o(17197);const Ke=B.AH` 1012 :host { 1013 width: 100%; 1014 } 1015`;var Ge=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let Ye=class extends r.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}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:w.I.state.view,displayIndex:this.displayIndex}))}render(){return r.qy` 1016 <wui-list-wallet 1017 .walletImages=${this.walletImages} 1018 imageSrc=${(0,a.J)(this.imageSrc)} 1019 name=${this.name} 1020 size=${(0,a.J)(this.size)} 1021 tagLabel=${(0,a.J)(this.tagLabel)} 1022 .tagVariant=${this.tagVariant} 1023 .walletIcon=${this.walletIcon} 1024 .tabIdx=${this.tabIdx} 1025 .disabled=${this.disabled} 1026 .showAllWallets=${this.showAllWallets} 1027 .loading=${this.loading} 1028 loadingSpinnerColor=${this.loadingSpinnerColor} 1029 ></wui-list-wallet> 1030 `}};Ye.styles=Ke,Ge([(0,i.MZ)({type:Array})],Ye.prototype,"walletImages",void 0),Ge([(0,i.MZ)()],Ye.prototype,"imageSrc",void 0),Ge([(0,i.MZ)()],Ye.prototype,"name",void 0),Ge([(0,i.MZ)()],Ye.prototype,"size",void 0),Ge([(0,i.MZ)()],Ye.prototype,"tagLabel",void 0),Ge([(0,i.MZ)()],Ye.prototype,"tagVariant",void 0),Ge([(0,i.MZ)()],Ye.prototype,"walletIcon",void 0),Ge([(0,i.MZ)()],Ye.prototype,"tabIdx",void 0),Ge([(0,i.MZ)({type:Boolean})],Ye.prototype,"disabled",void 0),Ge([(0,i.MZ)({type:Boolean})],Ye.prototype,"showAllWallets",void 0),Ge([(0,i.MZ)({type:Boolean})],Ye.prototype,"loading",void 0),Ge([(0,i.MZ)({type:String})],Ye.prototype,"loadingSpinnerColor",void 0),Ge([(0,i.MZ)()],Ye.prototype,"rdnsId",void 0),Ge([(0,i.MZ)()],Ye.prototype,"displayIndex",void 0),Ge([(0,i.MZ)()],Ye.prototype,"walletRank",void 0),Ye=Ge([(0,B.EM)("w3m-list-wallet")],Ye);const Xe=B.AH` 1031 :host { 1032 --local-duration-height: 0s; 1033 --local-duration: ${e=>{let{durations:t}=e;return t.lg}}
1033; 1034 --local-transition: ${e=>{let{easings:t}=e;return t["ease-out-power-2"]}}; 1035 } 1036 1037 .container { 1038 display: block; 1039 overflow: hidden; 1040 overflow: hidden; 1041 position: relative; 1042 height: var(--local-container-height); 1043 transition: height var(--local-duration-height) var(--local-transition); 1044 will-change: height, padding-bottom; 1045 } 1046 1047 .container[data-mobile-fullscreen='true'] { 1048 overflow: scroll; 1049 } 1050 1051 .page { 1052 position: absolute; 1053 top: 0; 1054 left: 0; 1055 right: 0; 1056 width: 100%; 1057 height: auto; 1058 width: inherit; 1059 box-sizing: border-box; 1060 display: flex; 1061 flex-direction: column; 1062 background-color: ${e=>{let{tokens:t}=e;return t.theme.backgroundPrimary}}; 1063 border-bottom-left-radius: var(--local-border-bottom-radius); 1064 border-bottom-right-radius: var(--local-border-bottom-radius); 1065 transition: border-bottom-left-radius var(--local-duration) var(--local-transition); 1066 } 1067 1068 .page[data-mobile-fullscreen='true'] { 1069 height: 100%; 1070 } 1071 1072 .page-content { 1073 display: flex; 1074 flex-direction: column; 1075 min-height: 100%; 1076 } 1077 1078 .footer { 1079 height: var(--apkt-footer-height); 1080 } 1081 1082 div.page[view-direction^='prev-'] .page-content { 1083 animation: 1084 slide-left-out var(--local-duration) forwards var(--local-transition), 1085 slide-left-in var(--local-duration) forwards var(--local-transition); 1086 animation-delay: 0ms, var(--local-duration, ${e=>{let{durations:t}=e;return t.lg}}); 1087 } 1088 1089 div.page[view-direction^='next-'] .page-content { 1090 animation: 1091 slide-right-out var(--local-duration) forwards var(--local-transition), 1092 slide-right-in var(--local-duration) forwards var(--local-transition); 1093 animation-delay: 0ms, var(--local-duration, ${e=>{let{durations:t}=e;return t.lg}}); 1094 } 1095 1096 @keyframes slide-left-out { 1097 from { 1098 transform: translateX(0px) scale(1); 1099 opacity: 1; 1100 filter: blur(0px); 1101 } 1102 to { 1103 transform: translateX(8px) scale(0.99); 1104 opacity: 0; 1105 filter: blur(4px); 1106 } 1107 } 1108 1109 @keyframes slide-left-in { 1110 from { 1111 transform: translateX(-8px) scale(0.99); 1112 opacity: 0; 1113 filter: blur(4px); 1114 } 1115 to { 1116 transform: translateX(0) translateY(0) scale(1); 1117 opacity: 1; 1118 filter: blur(0px); 1119 } 1120 } 1121 1122 @keyframes slide-right-out { 1123 from { 1124 transform: translateX(0px) scale(1); 1125 opacity: 1; 1126 filter: blur(0px); 1127 } 1128 to { 1129 transform: translateX(-8px) scale(0.99); 1130 opacity: 0; 1131 filter: blur(4px); 1132 } 1133 } 1134 1135 @keyframes slide-right-in { 1136 from { 1137 transform: translateX(8px) scale(0.99); 1138 opacity: 0; 1139 filter: blur(4px); 1140 } 1141 to { 1142 transform: translateX(0) translateY(0) scale(1); 1143 opacity: 1; 1144 filter: blur(0px); 1145 } 1146 } 1147`;var Je=function(e,t,o,r){var i,a=arguments.length,n=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,o,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(n=(a<3?i(n):a>3?i(t,o,n):i(t,o))||n);return a>3&&n&&Object.defineProperty(t,o,n),n};let Qe=class extends r.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=c.H.state.enableMobileFullScreen,this.onViewportResize=()=>{this.updateContainerHeight()}}updated(e){if(e.has("history")){const 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(const t of e)if(t.target===this.getWrapper()){let e=t.contentRect.height;const o=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0");
1147if(this.mobileFullScreen){e=(window.visualViewport?.height||window.innerHeight)-this.getHeaderHeight()-o,this.style.setProperty("--local-border-bottom-radius","0px")}else{e=e+o,this.style.setProperty("--local-border-bottom-radius",o?"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(){const e=this.getWrapper();e&&this.resizeObserver&&this.resizeObserver.unobserve(e),window.removeEventListener("resize",this.onViewportResize),window.visualViewport?.removeEventListener("resize",this.onViewportResize)}render(){return r.qy` 1148 <div class="container" data-mobile-fullscreen="${(0,a.J)(this.mobileFullScreen)}"> 1149 <div 1150 class="page" 1151 data-mobile-fullscreen="${(0,a.J)(this.mobileFullScreen)}" 1152 view-direction="${this.viewDirection}" 1153 > 1154 <div class="page-content"> 1155 <slot></slot> 1156 </div> 1157 </div> 1158 </div> 1159 `}onViewChange(e){const t=e.split(",").filter(Boolean),o=this.historyState.split(",").filter(Boolean),r=o.length,i=t.length,a=t[t.length-1]||"",n=B.Zv.cssDurationToNumber(this.transitionDuration);let s="";i>r?s="next":i<r?s="prev":i===r&&t[i-1]!==o[r-1]&&(s="next"),this.viewDirection=`${s}-${a}`,setTimeout((()=>{this.historyState=e,this.setView?.(a)}),n),setTimeout((()=>{this.viewDirection=""}),2*n)}getWrapper(){return this.shadowRoot?.querySelector("div.page")}updateContainerHeight(){const e=this.getWrapper();if(!e)return;const t=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0");let o=0;if(this.mobileFullScreen){o=(window.visualViewport?.height||window.innerHeight)-this.getHeaderHeight()-t,this.style.setProperty("--local-border-bottom-radius","0px")}else o=e.getBoundingClientRect().height+t,this.style.setProperty("--local-border-bottom-radius",t?"var(--apkt-borderRadius-5)":"0px");this.style.setProperty("--local-container-height",`${o}px`),"0px"!==this.previousHeight&&this.style.setProperty("--local-duration-height",this.transitionDuration),this.previousHeight=`${o}px`}getHeaderHeight(){return 60}};Qe.styles=[Xe],Je([(0,i.MZ)({type:String})],Qe.prototype,"transitionDuration",void 0),Je([(0,i.MZ)({type:String})],Qe.prototype,"transitionFunction",void 0),Je([(0,i.MZ)({type:String})],Qe.prototype,"history",void 0),Je([(0,i.MZ)({type:String})],Qe.prototype,"view",void 0),Je([(0,i.MZ)({attribute:!1})],Qe.prototype,"setView",void 0),Je([(0,i.wk)()],Qe.prototype,"viewDirection",void 0),Je([(0,i.wk)()],Qe.prototype,"historyState",void 0),Je([(0,i.wk)()],Qe.prototype,"previousHeight",void 0),Je([(0,i.wk)()],Qe.prototype,"mobileFullScreen",void 0),Qe=Je([(0,B.EM)("w3m-router-container")],Qe)}}]);
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.