@dcl-regenesislabs/mobile-hub 1.0.0-20601593503.commit-26e252e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/PhArrowCircleDown-BtlNV0TZ.js +14 -0
- package/assets/PhArrowClockwise-mOiWYLMV.js +14 -0
- package/assets/PhArrowDown-CkoOD89h.js +14 -0
- package/assets/PhArrowLeft-C0jlxVhM.js +14 -0
- package/assets/PhArrowRight-BI-V03Xf.js +14 -0
- package/assets/PhArrowSquareOut-DnQ7n_B4.js +14 -0
- package/assets/PhArrowUp-izKvURUW.js +14 -0
- package/assets/PhArrowUpRight-Bn-JhHsY.js +14 -0
- package/assets/PhArrowsClockwise-Brtx2Re-.js +14 -0
- package/assets/PhArrowsDownUp-PZosTqZG.js +14 -0
- package/assets/PhArrowsLeftRight-CYsRQ2qh.js +14 -0
- package/assets/PhBank-hhPAIPVb.js +14 -0
- package/assets/PhBrowser-BjzAmrHO.js +14 -0
- package/assets/PhCaretDown-ddSjwcwm.js +14 -0
- package/assets/PhCaretLeft-B7YLoNEF.js +14 -0
- package/assets/PhCaretRight-BY8D5MIg.js +14 -0
- package/assets/PhCaretUp-BG10nSut.js +14 -0
- package/assets/PhCheck-DrKd7pBC.js +14 -0
- package/assets/PhCircleHalf-Bk9C4DvT.js +14 -0
- package/assets/PhClock-Sj17weCB.js +14 -0
- package/assets/PhCompass-Df1ugFO-.js +14 -0
- package/assets/PhCopy-rgttky8E.js +14 -0
- package/assets/PhCreditCard-CZpdid2n.js +14 -0
- package/assets/PhCurrencyDollar-B6IKKjue.js +14 -0
- package/assets/PhDesktop-BuCDXYJj.js +14 -0
- package/assets/PhDeviceMobile-CnybhXY-.js +14 -0
- package/assets/PhDotsThree-CSAEcba1.js +14 -0
- package/assets/PhEnvelope-SmaNeXoQ.js +14 -0
- package/assets/PhFunnelSimple-DKx35ITq.js +14 -0
- package/assets/PhGlobe-q1mqj65V.js +14 -0
- package/assets/PhIdentificationCard-BeLXJpfZ.js +14 -0
- package/assets/PhImage-BYrKfN9k.js +14 -0
- package/assets/PhInfo-X33f06Ej.js +14 -0
- package/assets/PhLightbulb-DMZJsowR.js +14 -0
- package/assets/PhMagnifyingGlass-B6D0sWFL.js +14 -0
- package/assets/PhPaperPlaneRight-Dvo-nXr9.js +14 -0
- package/assets/PhPlus-CBvZvLax.js +14 -0
- package/assets/PhPower-D8-AcNM6.js +14 -0
- package/assets/PhPuzzlePiece-C-7mYqGO.js +14 -0
- package/assets/PhQrCode-uIXlI5ER.js +14 -0
- package/assets/PhQuestion-rUoqC2sC.js +14 -0
- package/assets/PhQuestionMark-W55Txvvb.js +14 -0
- package/assets/PhSealCheck-BeVLq9PH.js +14 -0
- package/assets/PhSignOut-Cq2PivQ6.js +14 -0
- package/assets/PhSpinner-CZMtAFdX.js +14 -0
- package/assets/PhTrash-BamrmMsN.js +14 -0
- package/assets/PhUser-A2fxqIV0.js +14 -0
- package/assets/PhVault-B8m1usHw.js +14 -0
- package/assets/PhWarning-CpkID9oi.js +14 -0
- package/assets/PhWarningCircle-Cm58gXb9.js +14 -0
- package/assets/PhX-C3b4cCEy.js +14 -0
- package/assets/basic-BqNJI8_e.js +1423 -0
- package/assets/core-CHil1RFh.js +217 -0
- package/assets/features-C-ekZReg.js +5 -0
- package/assets/fortmatic-Fv2dqlKd.js +13 -0
- package/assets/index-8e4wv-tH.js +1 -0
- package/assets/index-B06SWXYS.js +36 -0
- package/assets/index-BH66FyTx.js +23 -0
- package/assets/index-Bxs-jmhN.js +15 -0
- package/assets/index-CcyN_bjy.css +1 -0
- package/assets/index-DoQzB8-2.js +5 -0
- package/assets/index-Nz_EXiLp.js +7 -0
- package/assets/index-QHMvomuf.js +1 -0
- package/assets/index-r-E8-KUv.js +1298 -0
- package/assets/property-CnFDNXw5.js +3 -0
- package/assets/w3m-modal-DV77a3rm.js +1209 -0
- package/index.html +14 -0
- package/package.json +22 -0
- package/vite.svg +1 -0
|
@@ -0,0 +1,1209 @@
|
|
|
1
|
+
import{N as h,t as Pe,u as Ie,R as u,S as g,b as te,c as O,E as _,v as oe,x as ne,n as m,B as j,a as de,y as M,z as G,D as Fe,m as pe,F as Le,C as re,G as Ee,I as Ne,M as P,J as We,e as S,r as Z,i as k,d as c,j as Re,K as ae,h as ue,f as He,L as F,O as b,s as Oe,A as ee,T as je,P as Me}from"./core-CHil1RFh.js";import{c as y,n as p,o as I,r as w,U as De}from"./index-r-E8-KUv.js";import"./index-BH66FyTx.js";import"./index-Bxs-jmhN.js";const D={getGasPriceInEther(e,t){const o=t*e;return Number(o)/1e18},getGasPriceInUSD(e,t,o){const i=D.getGasPriceInEther(t,o);return h.bigNumber(e).times(i).toNumber()},getPriceImpact({sourceTokenAmount:e,sourceTokenPriceInUSD:t,toTokenPriceInUSD:o,toTokenAmount:i}){const a=h.bigNumber(e).times(t),n=h.bigNumber(i).times(o);return a.minus(n).div(a).times(100).toNumber()},getMaxSlippage(e,t){const o=h.bigNumber(e).div(100);return h.multiply(t,o).toNumber()},getProviderFee(e,t=.0085){return h.bigNumber(e).times(t).toString()},isInsufficientNetworkTokenForGas(e,t){const o=t||"0";return h.bigNumber(e).eq(0)?!0:h.bigNumber(h.bigNumber(o)).gt(e)},isInsufficientSourceTokenForSwap(e,t,o){const i=o?.find(n=>n.address===t)?.quantity?.numeric;return h.bigNumber(i||"0").lt(e)}},xe=15e4,Ve=6,T={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:pe.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=Ie({...T}),ie={state:r,subscribe(e){return Ne(r,()=>e(r))},subscribeKey(e,t){return Ee(r,e,t)},getParams(){const e=m.state.activeChain,t=m.getAccountData(e)?.caipAddress??m.state.activeCaipAddress,o=de.getPlainAddress(t),i=Le(),a=re.getConnectorId(m.state.activeChain);if(!o)throw new Error("No address found to swap the tokens from.");const n=!r.toToken?.address||!r.toToken?.decimals,s=!r.sourceToken?.address||!r.sourceToken?.decimals||!h.bigNumber(r.sourceTokenAmount).gt(0),l=!r.sourceTokenAmount;return{networkAddress:i,fromAddress:o,fromCaipAddress:t,sourceTokenAddress:r.sourceToken?.address,toTokenAddress:r.toToken?.address,toTokenAmount:r.toTokenAmount,toTokenDecimals:r.toToken?.decimals,sourceTokenAmount:r.sourceTokenAmount,sourceTokenDecimals:r.sourceToken?.decimals,invalidToToken:n,invalidSourceToken:s,invalidSourceTokenAmount:l,availableToSwap:t&&!n&&!s&&!l,isAuthConnector:a===O.CONNECTOR_ID.AUTH}},async setSourceToken(e){if(!e){r.sourceToken=e,r.sourceTokenAmount="",r.sourceTokenPriceInUSD=0;return}r.sourceToken=e,await d.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 d.setTokenPrice(e.address,"toToken")},setToTokenAmount(e){r.toTokenAmount=e?h.toFixed(e,Ve):""},async setTokenPrice(e,t){let o=r.tokensPriceMap[e]||0;o||(r.loadingPrices=!0,o=await d.getAddressPrice(e)),t==="sourceToken"?r.sourceTokenPriceInUSD=o:t==="toToken"&&(r.toTokenPriceInUSD=o),r.loadingPrices&&(r.loadingPrices=!1),d.getParams().availableToSwap&&!r.switchingTokens&&d.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;d.setSourceTokenAmount(o),d.setToTokenAmount(""),await d.setSourceToken(e),await d.setToToken(t),r.switchingTokens=!1,d.swapTokens()}catch(e){throw r.switchingTokens=!1,e}}},resetState(){r.myTokensWithBalance=T.myTokensWithBalance,r.tokensPriceMap=T.tokensPriceMap,r.initialized=T.initialized,r.initializing=T.initializing,r.switchingTokens=T.switchingTokens,r.sourceToken=T.sourceToken,r.sourceTokenAmount=T.sourceTokenAmount,r.sourceTokenPriceInUSD=T.sourceTokenPriceInUSD,r.toToken=T.toToken,r.toTokenAmount=T.toTokenAmount,r.toTokenPriceInUSD=T.toTokenPriceInUSD,r.networkPrice=T.networkPrice,r.networkTokenSymbol=T.networkTokenSymbol,r.networkBalanceInUSD=T.networkBalanceInUSD,r.inputError=T.inputError},resetValues(){const{networkAddress:e}=d.getParams(),t=r.tokens?.find(o=>o.address===e);d.setSourceToken(t),d.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 d.fetchTokens(),r.initialized=!0}catch{r.initialized=!1,g.showError("Failed to initialize swap"),u.goBack()}r.initializing=!1}},async fetchTokens(){const{networkAddress:e}=d.getParams();await d.getNetworkTokenPrice(),await d.getMyTokensWithBalance();const t=r.myTokensWithBalance?.find(o=>o.address===e);t&&(r.networkTokenSymbol=t.symbol,d.setSourceToken(t),d.setSourceTokenAmount("0"))},async getTokenList(){const e=m.state.activeCaipNetwork?.caipNetworkId;if(!(r.caipNetworkId===e&&r.tokens))try{r.tokensLoading=!0;const t=await M.getTokenList(e);r.tokens=t,r.caipNetworkId=e,r.popularTokens=t.sort((s,l)=>s.symbol<l.symbol?-1:s.symbol>l.symbol?1:0);const i=(e&&pe.SUGGESTED_TOKENS_BY_CHAIN?.[e]||[]).map(s=>t.find(l=>l.symbol===s)).filter(s=>!!s),n=(pe.SWAP_SUGGESTED_TOKENS||[]).map(s=>t.find(l=>l.symbol===s)).filter(s=>!!s).filter(s=>!i.some(l=>l.address===s.address));r.suggestedTokens=[...i,...n]}catch{r.tokens=[],r.popularTokens=[],r.suggestedTokens=[]}finally{r.tokensLoading=!1}},async getAddressPrice(e){const t=r.tokensPriceMap[e];if(t)return t;const i=(await j.fetchTokenPrice({addresses:[e]}))?.fungibles||[],n=[...r.tokens||[],...r.myTokensWithBalance||[]]?.find(f=>f.address===e)?.symbol,s=i.find(f=>f.symbol.toLowerCase()===n?.toLowerCase())?.price||0,l=parseFloat(s.toString());return r.tokensPriceMap[e]=l,l},async getNetworkTokenPrice(){const{networkAddress:e}=d.getParams(),o=(await j.fetchTokenPrice({addresses:[e]}).catch(()=>(g.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles?.[0],i=o?.price.toString()||"0";r.tokensPriceMap[e]=parseFloat(i),r.networkTokenSymbol=o?.symbol||"",r.networkPrice=i},async getMyTokensWithBalance(e){const t=await Fe.getMyTokensWithBalance(e),o=M.mapBalancesToSwapTokens(t);o&&(await d.getInitialGasPrice(),d.setBalances(o))},setBalances(e){const{networkAddress:t}=d.getParams(),o=m.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?h.multiply(i.quantity.numeric,i.price).toString():"0"},async getInitialGasPrice(){const e=await M.fetchGasPrice();if(!e)return{gasPrice:null,gasPriceInUSD:null};switch(m.state?.activeCaipNetwork?.chainNamespace){case O.CHAIN.SOLANA:return r.gasFee=e.standard??"0",r.gasPriceInUSD=h.multiply(e.standard,r.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(r.gasFee),gasPriceInUSD:Number(r.gasPriceInUSD)};case O.CHAIN.EVM:default:const t=e.standard??"0",o=BigInt(t),i=BigInt(xe),a=D.getGasPriceInUSD(r.networkPrice,i,o);return r.gasFee=t,r.gasPriceInUSD=a,{gasPrice:o,gasPriceInUSD:a}}},async swapTokens(){const e=m.getAccountData()?.address,t=r.sourceToken,o=r.toToken,i=h.bigNumber(r.sourceTokenAmount).gt(0);if(i||d.setToTokenAmount(""),!o||!t||r.loadingPrices||!i||!e)return;r.loadingQuote=!0;const a=h.bigNumber(r.sourceTokenAmount).times(10**t.decimals).round(0);try{const n=await j.fetchSwapQuote({userAddress:e,from:t.address,to:o.address,gasPrice:r.gasFee,amount:a.toString()});r.loadingQuote=!1;const s=n?.quotes?.[0]?.toAmount;if(!s){G.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");return}const l=h.bigNumber(s).div(10**o.decimals).toString();d.setToTokenAmount(l),d.hasInsufficientToken(r.sourceTokenAmount,t.address)?r.inputError="Insufficient balance":(r.inputError=void 0,d.setTransactionDetails())}catch(n){const s=await M.handleSwapError(n);r.loadingQuote=!1,r.inputError=s||"Insufficient balance"}},async getTransaction(){const{fromCaipAddress:e,availableToSwap:t}=d.getParams(),o=r.sourceToken,i=r.toToken;if(!(!e||!t||!o||!i||r.loadingQuote))try{r.loadingBuildTransaction=!0;const a=await M.fetchSwapAllowance({userAddress:e,tokenAddress:o.address,sourceTokenAmount:r.sourceTokenAmount,sourceTokenDecimals:o.decimals});let n;return a?n=await d.createSwapTransaction():n=await d.createAllowanceTransaction(),r.loadingBuildTransaction=!1,r.fetchError=!1,n}catch{u.goBack(),g.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}=d.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=de.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{u.goBack(),g.showError("Failed to create approval transaction"),r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}}},async createSwapTransaction(){const{networkAddress:e,fromCaipAddress:t,sourceTokenAmount:o}=d.getParams(),i=r.sourceToken,a=r.toToken;if(!t||!o||!i||!a)return;const n=te.parseUnits(o,i.decimals)?.toString();try{const s=await j.generateSwapCalldata({userAddress:t,from:i.address,to:a.address,amount:n,disableEstimate:!0}),l=i.address===e,f=BigInt(s.tx.eip155.gas),ye=BigInt(s.tx.eip155.gasPrice),ke=de.getPlainAddress(s.tx.to);if(!ke)throw new Error("SwapController:createSwapTransaction - address is required");const Te={data:s.tx.data,to:ke,gas:f,gasPrice:ye,value:BigInt(l?n??"0":"0"),toAmount:r.toTokenAmount};return r.gasPriceInUSD=D.getGasPriceInUSD(r.networkPrice,f,ye),r.approvalTransaction=void 0,r.swapTransaction=Te,Te}catch{u.goBack(),g.showError("Failed to create transaction"),r.approvalTransaction=void 0,r.swapTransaction=void 0,r.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){g.showLoading("Approve limit increase in your wallet"),u.replace("SwapPreview")},async sendTransactionForApproval(e){const{fromAddress:t,isAuthConnector:o}=d.getParams();r.loadingApprovalTransaction=!0,o?u.pushTransactionStack({onSuccess:d.onEmbeddedWalletApprovalSuccess}):g.showLoading("Approve limit increase in your wallet");try{await te.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:O.CHAIN.EVM}),await d.swapTokens(),await d.getTransaction(),r.approvalTransaction=void 0,r.loadingApprovalTransaction=!1}catch(a){const n=a;r.transactionError=n?.displayMessage,r.loadingApprovalTransaction=!1,g.showError(n?.displayMessage||"Transaction error"),_.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:n?.displayMessage||n?.message||"Unknown",network:m.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:d.state.sourceToken?.symbol||"",swapToToken:d.state.toToken?.symbol||"",swapFromAmount:d.state.sourceTokenAmount||"",swapToAmount:d.state.toTokenAmount||"",isSmartAccount:oe(O.CHAIN.EVM)===ne.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(e){if(!e)return;const{fromAddress:t,toTokenAmount:o,isAuthConnector:i}=d.getParams();r.loadingTransaction=!0;const a=`Swapping ${r.sourceToken?.symbol} to ${h.formatNumberToLocalString(o,3)} ${r.toToken?.symbol}`,n=`Swapped ${r.sourceToken?.symbol} to ${h.formatNumberToLocalString(o,3)} ${r.toToken?.symbol}`;i?u.pushTransactionStack({onSuccess(){u.replace("Account"),g.showLoading(a),ie.resetState()}}):g.showLoading("Confirm transaction in your wallet");try{const s=[r.sourceToken?.address,r.toToken?.address].join(","),l=await te.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:O.CHAIN.EVM});return r.loadingTransaction=!1,g.showSuccess(n),_.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:m.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:d.state.sourceToken?.symbol||"",swapToToken:d.state.toToken?.symbol||"",swapFromAmount:d.state.sourceTokenAmount||"",swapToAmount:d.state.toTokenAmount||"",isSmartAccount:oe(O.CHAIN.EVM)===ne.ACCOUNT_TYPES.SMART_ACCOUNT}}),ie.resetState(),i||u.replace("Account"),ie.getMyTokensWithBalance(s),l}catch(s){const l=s;r.transactionError=l?.displayMessage,r.loadingTransaction=!1,g.showError(l?.displayMessage||"Transaction error"),_.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:l?.displayMessage||l?.message||"Unknown",network:m.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:d.state.sourceToken?.symbol||"",swapToToken:d.state.toToken?.symbol||"",swapFromAmount:d.state.sourceTokenAmount||"",swapToAmount:d.state.toTokenAmount||"",isSmartAccount:oe(O.CHAIN.EVM)===ne.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(e,t){return D.isInsufficientSourceTokenForSwap(e,t,r.myTokensWithBalance)},setTransactionDetails(){const{toTokenAddress:e,toTokenDecimals:t}=d.getParams();!e||!t||(r.gasPriceInUSD=D.getGasPriceInUSD(r.networkPrice,BigInt(r.gasFee),BigInt(xe)),r.priceImpact=D.getPriceImpact({sourceTokenAmount:r.sourceTokenAmount,sourceTokenPriceInUSD:r.sourceTokenPriceInUSD,toTokenPriceInUSD:r.toTokenPriceInUSD,toTokenAmount:r.toTokenAmount}),r.maxSlippage=D.getMaxSlippage(r.slippage,r.toTokenAmount),r.providerFee=D.getProviderFee(r.sourceTokenAmount))}},d=Pe(ie),A=Ie({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),Ge={state:A,subscribe(e){return Ne(A,()=>e(A))},subscribeKey(e,t){return Ee(A,e,t)},showTooltip({message:e,triggerRect:t,variant:o}){A.open=!0,A.message=e,A.triggerRect=t,A.variant=o},hide(){A.open=!1,A.message="",A.triggerRect={width:0,height:0,top:0,left:0}}},V=Pe(Ge),_e={isUnsupportedChainView(){return u.state.view==="UnsupportedChain"||u.state.view==="SwitchNetwork"&&u.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){P.shake();return}if(await We.isSIWXCloseDisabled()){P.shake();return}(u.state.view==="DataCapture"||u.state.view==="DataCaptureOtpConfirm")&&te.disconnect(),P.close()}},Ke=S`
|
|
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 Ye=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 we=class extends k{render(){return c`<slot></slot>`}};we.styles=[Z,Ke];we=Ye([y("wui-card")],we);const Xe=S`
|
|
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 fe=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 qe={info:"info",success:"checkmark",warning:"warningCircle",error:"warning"};let Y=class extends k{constructor(){super(...arguments),this.message="",this.type="info"}render(){return c`
|
|
86
|
+
<wui-flex
|
|
87
|
+
data-type=${I(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=${qe[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(){G.close()}};Y.styles=[Z,Xe];fe([p()],Y.prototype,"message",void 0);fe([p()],Y.prototype,"type",void 0);Y=fe([y("wui-alertbar")],Y);const Qe=S`
|
|
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 Be=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 Ze={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 se=class extends k{constructor(){super(),this.unsubscribe=[],this.open=G.state.open,this.onOpen(!0),this.unsubscribe.push(G.subscribeKey("open",t=>{this.open=t,this.onOpen(!1)}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){const{message:t,variant:o}=G.state,i=Ze[o];return c`
|
|
125
|
+
<wui-alertbar
|
|
126
|
+
message=${t}
|
|
127
|
+
backgroundColor=${i?.backgroundColor}
|
|
128
|
+
iconColor=${i?.iconColor}
|
|
129
|
+
icon=${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")}};se.styles=Qe;Be([w()],se.prototype,"open",void 0);se=Be([y("w3m-alertbar")],se);const Je=S`
|
|
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 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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 E=class extends k{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 c`<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=${I(this.iconSize)}></wui-icon>
|
|
261
|
+
</button>`}};E.styles=[Z,Re,Je];U([p()],E.prototype,"icon",void 0);U([p()],E.prototype,"variant",void 0);U([p()],E.prototype,"type",void 0);U([p()],E.prototype,"size",void 0);U([p()],E.prototype,"iconSize",void 0);U([p({type:Boolean})],E.prototype,"fullWidth",void 0);U([p({type:Boolean})],E.prototype,"disabled",void 0);E=U([y("wui-icon-button")],E);const et=S`
|
|
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 H=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 tt={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},ot={lg:"lg",md:"md",sm:"sm"};let B=class extends k{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size="lg",this.type="text-dropdown",this.disabled=!1}render(){return c`<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=tt[this.size];return this.text?c`<wui-text color="primary" variant=${t}>${this.text}</wui-text>`:null}imageTemplate(){if(this.imageSrc)return c`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`;const t=ot[this.size];return c` <wui-flex class="left-icon-container">
|
|
370
|
+
<wui-icon size=${t} name="networkPlaceholder"></wui-icon>
|
|
371
|
+
</wui-flex>`}};B.styles=[Z,Re,et];H([p()],B.prototype,"imageSrc",void 0);H([p()],B.prototype,"text",void 0);H([p()],B.prototype,"size",void 0);H([p()],B.prototype,"type",void 0);H([p({type:Boolean})],B.prototype,"disabled",void 0);B=H([y("wui-select")],B);const nt=S`
|
|
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 z=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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=["SmartSessionList"],rt={PayWithExchange:ae.tokens.theme.foregroundPrimary};function Se(){const e=u.state.data?.connector?.name,t=u.state.data?.wallet?.name,o=u.state.data?.network?.name,i=t??e,a=re.getConnectors(),n=a.length===1&&a[0]?.id==="w3m-email",s=m.getAccountData()?.socialProvider,l=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",ConnectingExternal: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:l,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 N=class extends k{constructor(){super(),this.unsubscribe=[],this.heading=Se()[u.state.view],this.network=m.state.activeCaipNetwork,this.networkImage=ue.getNetworkImage(this.network),this.showBack=!1,this.prevHistoryLength=1,this.view=u.state.view,this.viewDirection="",this.unsubscribe.push(He.subscribeNetworkImages(()=>{this.networkImage=ue.getNetworkImage(this.network)}),u.subscribeKey("view",t=>{setTimeout(()=>{this.view=t,this.heading=Se()[t]},F.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),m.subscribeKey("activeCaipNetwork",t=>{this.network=t,this.networkImage=ue.getNetworkImage(this.network)}))}disconnectCallback(){this.unsubscribe.forEach(t=>t())}render(){const t=rt[u.state.view]??ae.tokens.theme.backgroundPrimary;return this.style.setProperty("--local-header-background-color",t),c`
|
|
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(){_.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),u.push("WhatIsAWallet")}async onClose(){await _e.safeClose()}rightHeaderTemplate(){const t=b?.state?.features?.smartSessions;return u.state.view!=="Account"||!t?this.closeButtonTemplate():c`<wui-flex>
|
|
461
|
+
<wui-icon-button
|
|
462
|
+
icon="clock"
|
|
463
|
+
size="lg"
|
|
464
|
+
iconSize="lg"
|
|
465
|
+
type="neutral"
|
|
466
|
+
variant="primary"
|
|
467
|
+
@click=${()=>u.push("SmartSessionList")}
|
|
468
|
+
data-testid="w3m-header-smart-sessions"
|
|
469
|
+
></wui-icon-button>
|
|
470
|
+
${this.closeButtonTemplate()}
|
|
471
|
+
</wui-flex> `}closeButtonTemplate(){return c`
|
|
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=it.includes(this.view);return c`
|
|
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?c`<wui-tag variant="accent" size="md">Beta</wui-tag>`:null}
|
|
497
|
+
</wui-flex>
|
|
498
|
+
`}leftHeaderTemplate(){const{view:t}=u.state,o=t==="Connect",i=b.state.enableEmbedded,a=t==="ApproveTransaction",n=t==="ConnectingSiwe",s=t==="Account",l=b.state.enableNetworkSwitch,f=a||n||o&&i;return s&&l?c`<wui-select
|
|
499
|
+
id="dynamic"
|
|
500
|
+
data-testid="w3m-account-select-network"
|
|
501
|
+
active-network=${I(this.network?.name)}
|
|
502
|
+
@click=${this.onNetworks.bind(this)}
|
|
503
|
+
imageSrc=${I(this.networkImage)}
|
|
504
|
+
></wui-select>`:this.showBack&&!f?c`<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>`:c`<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()&&(_.sendEvent({type:"track",event:"CLICK_NETWORKS"}),u.push("Networks"))}isAllowedNetworkSwitch(){const t=m.getAllRequestedCaipNetworks(),o=t?t.length>1:!1,i=t?.find(({id:a})=>a===this.network?.id);return o||!i}onViewChange(){const{history:t}=u.state;let o=F.VIEW_DIRECTION.Next;t.length<this.prevHistoryLength&&(o=F.VIEW_DIRECTION.Prev),this.prevHistoryLength=t.length,this.viewDirection=o}async onHistoryChange(){const{history:t}=u.state,o=this.shadowRoot?.querySelector("#dynamic");t.length>1&&!this.showBack&&o?(await o.animate([{opacity:1},{opacity:0}],{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(){u.goBack()}};N.styles=nt;z([w()],N.prototype,"heading",void 0);z([w()],N.prototype,"network",void 0);z([w()],N.prototype,"networkImage",void 0);z([w()],N.prototype,"showBack",void 0);z([w()],N.prototype,"prevHistoryLength",void 0);z([w()],N.prototype,"view",void 0);z([w()],N.prototype,"viewDirection",void 0);N=z([y("w3m-header")],N);const at=S`
|
|
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 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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 k{constructor(){super(...arguments),this.message="",this.variant="success"}render(){return c`
|
|
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"?c`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:c`<wui-icon-box
|
|
553
|
+
size="md"
|
|
554
|
+
color=${t[this.variant]}
|
|
555
|
+
icon=${o[this.variant]}
|
|
556
|
+
></wui-icon-box>`}};X.styles=[Z,at];ge([p()],X.prototype,"message",void 0);ge([p()],X.prototype,"variant",void 0);X=ge([y("wui-snackbar")],X);const st=Oe`
|
|
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 Ue=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 k{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=g.state.open,this.unsubscribe.push(g.subscribeKey("open",t=>{this.open=t,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(t=>t())}render(){const{message:t,variant:o}=g.state;return c` <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),g.state.autoClose&&(this.timeout=setTimeout(()=>g.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"})}};ce.styles=st;Ue([w()],ce.prototype,"open",void 0);ce=Ue([y("w3m-snackbar")],ce);const ct=S`
|
|
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 J=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 L=class extends k{constructor(){super(),this.unsubscribe=[],this.open=V.state.open,this.message=V.state.message,this.triggerRect=V.state.triggerRect,this.variant=V.state.variant,this.unsubscribe.push(V.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
|
+
`,c`<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>`}};L.styles=[ct];J([w()],L.prototype,"open",void 0);J([w()],L.prototype,"message",void 0);J([w()],L.prototype,"triggerRect",void 0);J([w()],L.prototype,"variant",void 0);L=J([y("w3m-tooltip")],L);const K={getTabsByNamespace(e){return!!e&&e===O.CHAIN.EVM?b.state.remoteFeatures?.activity===!1?F.ACCOUNT_TABS.filter(o=>o.label!=="Activity"):F.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(){const e=u.state.view;if(F.VIEWS_WITH_LEGAL_FOOTER.includes(e)){const{termsConditionsUrl:t,privacyPolicyUrl:o}=b.state,i=b.state.features?.legalCheckbox;return!(!t&&!o||i)}return F.VIEWS_WITH_DEFAULT_FOOTER.includes(e)}},lt=S`
|
|
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 ze=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 le=class extends k{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=b.state.remoteFeatures,this.unsubscribe.push(b.subscribeKey("remoteFeatures",t=>this.remoteFeatures=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){const{termsConditionsUrl:t,privacyPolicyUrl:o}=b.state,i=b.state.features?.legalCheckbox;return!t&&!o||i?c`
|
|
668
|
+
<wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex>
|
|
669
|
+
`:c`
|
|
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}=b.state;return t&&o?"and":""}termsTemplate(){const{termsConditionsUrl:t}=b.state;return t?c`<a href=${t} target="_blank" rel="noopener noreferrer"
|
|
680
|
+
>Terms of Service</a
|
|
681
|
+
>`:null}privacyTemplate(){const{privacyPolicyUrl:t}=b.state;return t?c`<a href=${t} target="_blank" rel="noopener noreferrer"
|
|
682
|
+
>Privacy Policy</a
|
|
683
|
+
>`:null}reownBrandingTemplate(t=!1){return this.remoteFeatures?.reownBranding?t?c`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:c`<wui-ux-by-reown></wui-ux-by-reown>`:null}};le.styles=[lt];ze([w()],le.prototype,"remoteFeatures",void 0);le=ze([y("w3m-legal-footer")],le);const dt=Oe``;var ut=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 me=class extends k{render(){const{termsConditionsUrl:t,privacyPolicyUrl:o}=b.state;return!t&&!o?null:c`
|
|
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 c` <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(){_.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:oe(m.state.activeChain)===ne.ACCOUNT_TYPES.SMART_ACCOUNT}}),u.push("WhatIsABuy")}};me.styles=[dt];me=ut([y("w3m-onramp-providers-footer")],me);const pt=S`
|
|
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 be=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 q=class extends k{constructor(){super(...arguments),this.resizeObserver=void 0,this.unsubscribe=[],this.status="hide",this.view=u.state.view}firstUpdated(){this.status=K.hasFooter()?"show":"hide",this.unsubscribe.push(u.subscribeKey("view",t=>{this.view=t,this.status=K.hasFooter()?"show":"hide",this.status==="hide"&&document.documentElement.style.setProperty("--apkt-footer-height","0px")})),this.resizeObserver=new ResizeObserver(t=>{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 c`
|
|
754
|
+
<div class="container" status=${this.status}>${this.templatePageContainer()}</div>
|
|
755
|
+
`}templatePageContainer(){return K.hasFooter()?c` ${this.templateFooter()}`:null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return c`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return c`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return c` <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(){_.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),u.push("WhatIsANetwork")}getWrapper(){return this.shadowRoot?.querySelector("div.container")}};q.styles=[pt];be([w()],q.prototype,"status",void 0);be([w()],q.prototype,"view",void 0);q=be([y("w3m-footer")],q);const wt=S`
|
|
770
|
+
:host {
|
|
771
|
+
display: block;
|
|
772
|
+
width: inherit;
|
|
773
|
+
}
|
|
774
|
+
`;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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 Q=class extends k{constructor(){super(),this.unsubscribe=[],this.viewState=u.state.view,this.history=u.state.history.join(","),this.unsubscribe.push(u.subscribeKey("view",()=>{this.history=u.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 c`${this.templatePageContainer()}`}templatePageContainer(){return c`<w3m-router-container
|
|
775
|
+
history=${this.history}
|
|
776
|
+
.setView=${()=>{this.viewState=u.state.view}}
|
|
777
|
+
>
|
|
778
|
+
${this.viewTemplate(this.viewState)}
|
|
779
|
+
</w3m-router-container>`}viewTemplate(t){switch(t){case"AccountSettings":return c`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return c`<w3m-account-view></w3m-account-view>`;case"AllWallets":return c`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return c`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return c`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return c`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":return c`<w3m-connect-view></w3m-connect-view>`;case"Create":return c`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return c`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return c`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;case"ConnectingExternal":return c`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return c`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return c`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return c`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return c`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return c`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return c`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return c`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return c`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return c`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return c`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return c`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return c`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return c`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return c`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return c`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return c`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return c`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return c`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return c`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return c`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return c`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return c`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return c`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return c`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return c`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return c`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return c`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return c`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return c`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return c`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return c`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return c`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return c`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return c`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return c`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return c`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return c`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return c`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return c`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return c`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return c`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return c`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return c`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return c`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return c`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"FundWallet":return c`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return c`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return c`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`;case"UsageExceeded":return c`<w3m-usage-exceeded-view></w3m-usage-exceeded-view>`;default:return c`<w3m-connect-view></w3m-connect-view>`}}};Q.styles=[wt];ve([w()],Q.prototype,"viewState",void 0);ve([w()],Q.prototype,"history",void 0);Q=ve([y("w3m-router")],Q);const mt=S`
|
|
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 W=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 Ce="scroll-lock",ht={PayWithExchange:"0",PayWithExchangeSelectAsset:"0"};class $ extends k{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.hasPrefetched=!1,this.enableEmbedded=b.state.enableEmbedded,this.open=P.state.open,this.caipAddress=m.state.activeCaipAddress,this.caipNetwork=m.state.activeCaipNetwork,this.shake=P.state.shake,this.filterByNamespace=re.state.filterByNamespace,this.padding=ae.spacing[1],this.mobileFullScreen=b.state.enableMobileFullScreen,this.initializeTheming(),ee.prefetchAnalyticsConfig(),this.unsubscribe.push(P.subscribeKey("open",t=>t?this.onOpen():this.onClose()),P.subscribeKey("shake",t=>this.shake=t),m.subscribeKey("activeCaipNetwork",t=>this.onNewNetwork(t)),m.subscribeKey("activeCaipAddress",t=>this.onNewAddress(t)),b.subscribeKey("enableEmbedded",t=>this.enableEmbedded=t),re.subscribeKey("filterByNamespace",t=>{this.filterByNamespace!==t&&!m.getAccountData(t)?.caipAddress&&(ee.fetchRecommendedWallets(),this.filterByNamespace=t)}),u.subscribeKey("view",()=>{this.dataset.border=K.hasFooter()?"true":"false",this.padding=ht[u.state.view]??ae.spacing[1]}))}firstUpdated(){if(this.dataset.border=K.hasFooter()?"true":"false",this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.caipAddress){if(this.enableEmbedded){P.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?c`${this.contentTemplate()}
|
|
999
|
+
<w3m-tooltip></w3m-tooltip> `:this.open?c`
|
|
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 c` <wui-card
|
|
1005
|
+
shake="${this.shake}"
|
|
1006
|
+
data-embedded="${I(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 _e.safeClose()}initializeTheming(){const{themeVariables:t,themeMode:o}=je.state,i=De.getColorTheme(o);Me(t,i)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),g.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const t=document.createElement("style");t.dataset.w3m=Ce,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="${Ce}"]`);t&&t.remove()}onAddKeyboardListener(){this.abortController=new AbortController;const t=this.shadowRoot?.querySelector("wui-card");t?.focus(),window.addEventListener("keydown",o=>{if(o.key==="Escape")this.handleClose();else if(o.key==="Tab"){const{tagName:i}=o.target;i&&!i.includes("W3M-")&&!i.includes("WUI-")&&t?.focus()}},this.abortController)}onRemoveKeyboardListener(){this.abortController?.abort(),this.abortController=void 0}async onNewAddress(t){const o=m.state.isSwitchingNamespace,i=u.state.view==="ProfileWallets";!t&&!o&&!i&&P.close(),await We.initializeIfEnabled(t),this.caipAddress=t,m.setIsSwitchingNamespace(!1)}onNewNetwork(t){const i=this.caipNetwork?.caipNetworkId?.toString(),a=t?.caipNetworkId?.toString(),n=i!==a,s=u.state.view==="UnsupportedChain",l=P.state.open;let f=!1;this.enableEmbedded&&u.state.view==="SwitchNetwork"&&(f=!0),n&&d.resetState(),l&&s&&(f=!0),f&&u.state.view!=="SIWXSignMessage"&&u.goBack(),this.caipNetwork=t}prefetch(){this.hasPrefetched||(ee.prefetch(),ee.fetchWalletsByPage({page:1}),this.hasPrefetched=!0)}}$.styles=mt;W([p({type:Boolean})],$.prototype,"enableEmbedded",void 0);W([w()],$.prototype,"open",void 0);W([w()],$.prototype,"caipAddress",void 0);W([w()],$.prototype,"caipNetwork",void 0);W([w()],$.prototype,"shake",void 0);W([w()],$.prototype,"filterByNamespace",void 0);W([w()],$.prototype,"padding",void 0);W([w()],$.prototype,"mobileFullScreen",void 0);let Ae=class extends ${};Ae=W([y("w3m-modal")],Ae);let $e=class extends ${};$e=W([y("appkit-modal")],$e);const ft=S`
|
|
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 gt=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 he=class extends k{constructor(){super()}render(){return c`
|
|
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(){u.goBack()}};he.styles=ft;he=gt([y("w3m-usage-exceeded-view")],he);const bt=S`
|
|
1062
|
+
:host {
|
|
1063
|
+
width: 100%;
|
|
1064
|
+
}
|
|
1065
|
+
`;var x=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 v=class extends k{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)&&_.sendWalletImpressionEvent({name:this.name,walletRank:this.walletRank,rdnsId:this.rdnsId,view:u.state.view,displayIndex:this.displayIndex}))}render(){return c`
|
|
1066
|
+
<wui-list-wallet
|
|
1067
|
+
.walletImages=${this.walletImages}
|
|
1068
|
+
imageSrc=${I(this.imageSrc)}
|
|
1069
|
+
name=${this.name}
|
|
1070
|
+
size=${I(this.size)}
|
|
1071
|
+
tagLabel=${I(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
|
+
`}};v.styles=bt;x([p({type:Array})],v.prototype,"walletImages",void 0);x([p()],v.prototype,"imageSrc",void 0);x([p()],v.prototype,"name",void 0);x([p()],v.prototype,"size",void 0);x([p()],v.prototype,"tagLabel",void 0);x([p()],v.prototype,"tagVariant",void 0);x([p()],v.prototype,"walletIcon",void 0);x([p()],v.prototype,"tabIdx",void 0);x([p({type:Boolean})],v.prototype,"disabled",void 0);x([p({type:Boolean})],v.prototype,"showAllWallets",void 0);x([p({type:Boolean})],v.prototype,"loading",void 0);x([p({type:String})],v.prototype,"loadingSpinnerColor",void 0);x([p()],v.prototype,"rdnsId",void 0);x([p()],v.prototype,"displayIndex",void 0);x([p()],v.prototype,"walletRank",void 0);v=x([y("w3m-list-wallet")],v);const vt=S`
|
|
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 R=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 l=e.length-1;l>=0;l--)(s=e[l])&&(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 yt=60;let C=class extends k{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=b.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(){this.transitionFunction&&this.style.setProperty("--local-transition",this.transitionFunction),this.style.setProperty("--local-duration",this.transitionDuration),this.historyState=this.history,this.resizeObserver=new ResizeObserver(t=>{for(const o of t)if(o.target===this.getWrapper()){let i=o.contentRect.height;const a=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0");if(this.mobileFullScreen){const n=window.visualViewport?.height||window.innerHeight,s=this.getHeaderHeight();i=n-s-a,this.style.setProperty("--local-border-bottom-radius","0px")}else i=i+a,this.style.setProperty("--local-border-bottom-radius",a?"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`}}),this.resizeObserver.observe(this.getWrapper()),this.updateContainerHeight(),window.addEventListener("resize",this.onViewportResize),window.visualViewport?.addEventListener("resize",this.onViewportResize)}disconnectedCallback(){const t=this.getWrapper();t&&this.resizeObserver&&this.resizeObserver.unobserve(t),window.removeEventListener("resize",this.onViewportResize),window.visualViewport?.removeEventListener("resize",this.onViewportResize)}render(){return c`
|
|
1198
|
+
<div class="container" data-mobile-fullscreen="${I(this.mobileFullScreen)}">
|
|
1199
|
+
<div
|
|
1200
|
+
class="page"
|
|
1201
|
+
data-mobile-fullscreen="${I(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]||"",l=De.cssDurationToNumber(this.transitionDuration);let f="";n>a?f="next":n<a?f="prev":n===a&&o[n-1]!==i[a-1]&&(f="next"),this.viewDirection=`${f}-${s}`,setTimeout(()=>{this.historyState=t,this.setView?.(s)},l),setTimeout(()=>{this.viewDirection=""},l*2)}getWrapper(){return this.shadowRoot?.querySelector("div.page")}updateContainerHeight(){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 a=window.visualViewport?.height||window.innerHeight,n=this.getHeaderHeight();i=a-n-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 yt}};C.styles=[vt];R([p({type:String})],C.prototype,"transitionDuration",void 0);R([p({type:String})],C.prototype,"transitionFunction",void 0);R([p({type:String})],C.prototype,"history",void 0);R([p({type:String})],C.prototype,"view",void 0);R([p({attribute:!1})],C.prototype,"setView",void 0);R([w()],C.prototype,"viewDirection",void 0);R([w()],C.prototype,"historyState",void 0);R([w()],C.prototype,"previousHeight",void 0);R([w()],C.prototype,"mobileFullScreen",void 0);C=R([y("w3m-router-container")],C);export{$e as AppKitModal,v as W3mListWallet,Ae as W3mModal,$ as W3mModalBase,C as W3mRouterContainer,he as W3mUsageExceededView};
|