PageSourceSearch

https://morphocurationweb.vercel.app/_next/static/chunks/pages/index-f21da9a07b162ae0.js

js morphocurationweb.vercel.app collected 2026-10-03 07:20:25 UTC 59,409 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3332],{16437:e=>{"use strict";e.exports=JSON.parse('[{"inputs":[{"internalType":"address","name":"morpho","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"Id","name":"id","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"avgBorrowRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rateAtTarget","type":"uint256"}],"name":"BorrowRateUpdate","type":"event"},{"inputs":[],"name":"MORPHO","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"},{"components":[{"internalType":"uint128","name":"totalSupplyAssets","type":"uint128"},{"internalType":"uint128","name":"totalSupplyShares","type":"uint128"},{"internalType":"uint128","name":"totalBorrowAssets","type":"uint128"},{"internalType":"uint128","name":"totalBorrowShares","type":"uint128"},{"internalType":"uint128","name":"lastUpdate","type":"uint128"},{"internalType":"uint128","name":"fee","type":"uint128"}],"internalType":"struct Market","name":"market","type":"tuple"}],"name":"borrowRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"loanToken","type":"address"},{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"address","name":"oracle","type":"address"},{"internalType":"address","name":"irm","type":"address"},{"internalType":"uint256","name":"lltv","type":"uint256"}],"internalType":"struct MarketParams","name":"marketParams","type":"tuple"},{"components":[{"internalType":"uint128","name":"totalSupplyAssets","type":"uint128"},{"internalType":"uint128","name":"totalSupplyShares","type":"uint128"},{"internalType":"uint128","name":"totalBorrowAssets","type":"uint128"},{"internalType":"uint128","name":"totalBorrowShares","type":"uint128"},{"internalType":"uint128","name":"lastUpdate","type":"uint128"},{"internalType":"uint128","name":"fee","type":"uint128"}],"internalType":"struct Market","name":"market","type":"tuple"}],"name":"borrowRateView","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"Id","name":"","type":"bytes32"}],"name":"rateAtTarget","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"}]')},16760:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return a(44554)}])},18449:(e,t,a)=>{"use strict";a.d(t,{X:()=>l});var r=a(76200);class s extends r.C{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function l(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new s({value:e});let[a,r="0"]=e.split("."),l=a.startsWith("-");if(l&&(a=a.slice(1)),r=r.replace(/(0+)$/,""),0===t)1===Math.round(Number(`.${r}`))&&(a=`${BigInt(a)+1n}`),r="";else if(r.length>t){let[e,s,l]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],n=Math.round(Number(`${s}.${l}`));(r=n>9?`${BigInt(e)+BigInt(1)}0`.padStart(e.length+1,"0"):`${e}${n}`).length>t&&(r=r.slice(1),a=`${BigInt(a)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${l?"-":""}${a}${r}`)}},44554:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>B});var r=a(37876),s=a(77328),l=a.n(s),n=a(48230),i=a.n(n),o=a(28815),d=a(14232);let c=e=>{let{collateral:t}=e;return(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:t.map((e,t)=>(0,r.jsx)("span",{className:"px-2 py-1 bg-primary-muted/20 text-xs rounded-full text-primary-muted",children:e},t))})};var m=a(18449),u=a(32602),x=a(98626),p=a(90117),h=a(61410),b=a(61540);let y=e=>{let{isOpen:t,onClose:a,vaultAddress:s,onSuccess:l}=e,[n,i]=(0,d.useState)(""),[o,c]=(0,d.useState)(!1),[y,g]=(0,d.useState)(""),[N,j]=(0,d.useState)(""),[f,w]=(0,d.useState)(null),[v,k]=(0,d.useState)(!1),S=(0,x.e)(),{data:C}=(0,p.G)();(0,d.useEffect)(()=>{t&&s&&S&&C&&T()},[t,s,S,C]);let T=async()=>
1{if(s&&S&&C){c(!0),g("");try{let e=await S.readContract({address:s,abi:b,functionName:"name"}),t=await S.readContract({address:s,abi:b,functionName:"asset"}),[a,r]=await Promise.all([S.readContract({address:t,abi:h,functionName:"symbol"}),S.readContract({address:t,abi:h,functionName:"decimals"})]),l=await S.readContract({address:s,abi:b,functionName:"totalAssets"}),n=await S.readContract({address:t,abi:h,functionName:"balanceOf",args:[C.account.address]}),i=await S.readContract({address:t,abi:h,functionName:"allowance",args:[C.account.address,s]});w({name:e,tokenAddress:t,tokenSymbol:a,tokenDecimals:r,totalAssets:l,userBalance:n,currentAllowance:i})}catch(e){console.error("Error loading vault info:",e),g("Failed to load vault information. Please try again.")}finally{c(!1)}}},B=async()=>{if(f&&C&&S){k(!0),g("");try{let e=(0,m.X)(n,f.tokenDecimals),t=await C.writeContract({address:f.tokenAddress,abi:h,functionName:"approve",args:[s,e]});await S.waitForTransactionReceipt({hash:t});let a=await S.readContract({address:f.tokenAddress,abi:h,functionName:"allowance",args:[C.account.address,s]});w({...f,currentAllowance:a}),j("Approval successful! You can now deposit.")}catch(e){console.error("Error approving tokens:",e),g(e.message||"Failed to approve tokens. Please try again.")}finally{k(!1)}}},A=async()=>{if(f&&C&&S){c(!0),g(""),j("");try{let e=(0,m.X)(n,f.tokenDecimals);if(f.userBalance<e)throw Error("Insufficient balance. You have ".concat((0,u.J)(f.userBalance,f.tokenDecimals)," ").concat(f.tokenSymbol,", but trying to deposit ").concat(n," ").concat(f.tokenSymbol,"."));if(f.currentAllowance<e)throw Error("Please approve the vault to spend your tokens first.");let t=await C.writeContract({address:s,abi:b,functionName:"deposit",args:[e,C.account.address]}),a=await S.waitForTransactionReceipt({hash:t});j("Successfully deposited ".concat(n," ").concat(f.tokenSymbol," to the vault!")),await T(),l&&l(a.transactionHash),i("")}catch(e){console.error("Error depositing to vault:",e),g(e.message||"Failed to deposit to vault. Please try again.")}finally{c(!1)}}};return t?(0,r.jsx)("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50",children:(0,r.jsxs)("div",{className:"bg-primary-bg border border-primary-muted/30 rounded-lg p-6 max-w-md w-full",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,r.jsx)("h2",{className:"text-xl font-bold text-accent-white",children:"Deposit to Vault"}),(0,r.jsx)("button",{onClick:a,className:"text-primary-muted hover:text-accent-white",children:"✕"})]}),o&&!f?(0,r.jsx)("div",{className:"text-center py-8",children:(0,r.jsx)("p",{className:"text-primary-muted",children:"Loading vault information..."})}):y&&!f?(0,r.jsx)("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-4 mb-4",children:(0,r.jsx)("p",{className:"text-red-400",children:y})}):f?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"space-y-4 mb-6",children:[(0,r.jsxs)("div",{className:"bg-primary-muted/10 p-4 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex justify-between mb-2",children:[(0,r.jsx)("span",{className:"text-primary-muted",children:"Vault:"}),(0,r.jsx)("span",{className:"text-accent-white font-medium",children:f.name})]}),(0,r.jsxs)("div",{className:"flex justify-between mb-2",children:[(0,r.jsx)("span",{className:"text-primary-muted",children:"Token:"}),(0,r.jsx)("span",{className:"text-accent-white",children:f.tokenSymbol})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-primary-muted",children:"Your Balance:"}),(0,r.jsxs)("span",{className:"text-accent-white",children:[(0,u.J)(f.userBalance,f.tokenDecimals)," ",f.tokenSymbol]})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-primary-text mb-2",children:"Amount to Deposit"}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("input",{type:"text",value:n,onChange:e=>i(e.target.value),className:"flex-1 px-3 py-2 bg-primary-bg/50 border border-primary-muted rounded-l-md text-accent-white placeholder-primary-muted focus:outline-none focus:ring-2 focus:ring-accent-blue focus:border-transparent",placeholder:"Enter amount in ".concat(f.tokenSymbol),disabled:o||v}),(0,r.jsx)("button",{onClick:()=>{i((0,u.J)(f.userBalance,f.tokenDecimals))},className:"px-3 py-2 bg-primary-muted/30 border-t border-r border-b border-primary-muted rounded-r-md text-accent-blue hover:bg-primary-muted/50",children:"MAX"})]})]}),y&&(0,r.jsx)("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-3",children:(0,r.jsx)("p",{className:"text-red-400 text-sm",children:y})}),N&&(0,r.jsx)("div",{className:"bg-green-500/20 border border-green-500/30 rounded-lg p-3",children:(0,r.jsx)("p",{className:"text-green-400 text-sm",children:N})})]}),(0,r.jsxs)("div",{className:"flex space-x-3",children:[n&&(0,m.X)(n||"0",f.tokenDecimals)>f.currentAllowance?(0,r.jsx)("button",{onClick:B,disabled:o||v||!n,className:"flex-1 py-2 bg-accent-blue/80 text-white rounded hover:bg-accent-blue disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:v?"Approving...":"Approve"}):(0,r.jsx)("button",{onClick:A,disabled:o||!n||0>=parseFloat(n),className:"flex-1 py-2 bg-accent-blue text-white rounded hover:bg-accent-blue/80 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:o?"Processing...":"Deposit"}),(0,r.jsx)("button",{onClick:a,className:"px-4 py-2 border border-primary-muted text-primary-text hover:text-accent-white hover:border-primary-text rounded transition-colors",children:"Cancel"})]})]}):null]})}):null},g=e=>{let{vaultAddress:t,vaultName:a,onSuccess:s}=e,[l,n]=(0,d.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>n(!0),className:"px-3 py-1 bg-accent-blue/90 hover:bg-accent-blue text-white text-sm rounded transition-colors",children:"Deposit"}),(0,r.jsx)(y,{isOpen:l,onClose:()=>n(!1),vaultAddress:t,onSuccess:s})]})},N=e=>{let{vaults:t}=e;return t&&0!==t.length?(0,r.jsxs)("div",{className:"bg-white/5 rounded-lg overflow-hidden",children:[(0,r.jsxs)("div",{className:"p-6 border-b border-primary-muted/20",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-accent-white mb-2",children:"My Vaults"}),(0,r.jsx)("p",{className:"text-primary-muted",children:"In Alpha Stage, not ready for use"})]}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full",children:[(0,r.jsx)("thead",{className:"bg-primary-muted/10",children:(0,r.jsxs)("tr",{className:"text-left",children:[(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Vault"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Deposits"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Collateral"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"APY"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Status"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Actions"})]})}),(0,r.jsx)("tbody",{children:t.map(e=>(0,r.jsxs)("tr",{className:"border-b border-primary-muted/10 hover:bg-primary-muted/5",children:[(0,r.jsx)("td",{className:"p-4",children:(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)("div",{className:"w-8 h-8 bg-accent-blue/20 rounded-full flex items-center justify-center",children:(0,r.jsx)("span",{className:"text-accent-blue text-sm font-bold",children:"V"})}),(0,r.jsx)("div",{children:(0,r.jsx)("div",{className:"text-accent-white font-medium",children:e.name})})]})}),(0,r.jsxs)("td",{className:"p-4",children:[(0,r.jsx)("div",{className:"text-accent-white",children:e.deposits}),(0,r.jsx)("div",{className:"text-primary-muted text-sm",children:e.depositsValue})]}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)(c,{collateral:e.collateral})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("span",{className:"text-green-400 font-medium",children:e.apy})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("span",{className:"px-2 py-1 rounded-full text-xs ".concat("active"===e.status?"bg-green-400/20 text-green-400":"bg-yellow-400/20 text-yellow-400"),children:e.status})}),(0,r.jsx)("td",{className:"p-4",children:e.address?(0,r.jsx)(g,{vaultAddress:e.address,vaultName:e.name,onSuccess:e=>{console.log("Deposit successful with tx: ".concat(e))}}):(0,r.jsx)("span",{className:"text-primary-muted text-sm",children:"No address"})})]},e.id))})]})})]}):null},j=e=>{let{markets:t}=e;return t&&0!==t.length?(0,r.jsxs)("div",{className:"bg-white/5 rounded-lg overflow-hidden",children:[(0,r.jsxs)("div",{className:"p-6 border-b border-primary-muted/20",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-accent-white mb-2",children:"My Markets"}),(0,r.jsx)("p",{className:"text-primary-muted",children:"In Alpha Stage, not ready for use"})]}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full",children:[(0,r.jsx)("thead",{className:"bg-primary-muted/10",children:(0,r.jsxs)("tr",{className:"text-left",children:[(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Market"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Deposits"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Curator"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Collateral"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"APY"})]})}),(0,r.jsx)("tbody",{children:t.map(e=>(0,r.jsxs)("tr",{className:"border-b border-primary-muted/10 hover:bg-primary-muted/5",children:[(0,r.jsx)("td",{className:"p-4",children:(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)("div",{className:"w-8 h-8 bg-green-400/20 rounded-full flex items-center justify-center",children:(0,r.jsx)("span",{className:"text-green-400 text-sm font-bold",children:"M"})}),(0,r.jsx)("div",{children:(0,r.jsx)("div",{className:"text-accent-white font-medium",children:e.name})})]})}),(0,r.jsxs)("td",{className:"p-4",children:[(0,r.jsx)("div",{className:"text-accent-white",children:e.deposits}),(0,r.jsx)("div",{className:"text-primary-muted text-sm",children:e.depositsValue})]}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)("div",{className:"w-6 h-6 bg-accent-blue/20 rounded-full flex items-center justify-center",children:(0,r.jsx)("span",{className:"text-accent-blue text-xs",children:"C"})}),(0,r.jsx)("span",{className:"text-accent-white",children:e.curator})]})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)(c,{collateral:e.collateral})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("span",{className:"text-green-400 font-medium",children:e.apy})})]},e.id))})]})})]}):null};var f=a(83662),w=a(25937),v=a(16437),k=a(70746);let S=e=>{let{className:t=""}=e,a=(0,x.e)(),{data:s}=(0,p.G)(),l=(0,k.Gd)(),[n,i]=(0,d.useState)([]),[o,c]=(0,d.useState)(!0),[y,g]=(0,d.useState)(!1),[N,j]=(0,d.useState)(!1),[S,C]=(0,d.useState)(!1),[T,B]=(0,d.useState)(null),[A,F]=(0,d.useState)(""),[M,P]=(0,d.useState)(""),[I,D]=(0,d.useState)(!1),[R,E]=(0,d.useState)(""),L=async e=>{if(!a)throw Error("Public client not available");try{let[t,r,s,l,n,i,o,d,c]=await Promise.all([a.readContract({address:e,abi:b,functionName:"name"}),a.readContract({address:e,abi:b,functionName:"symbol"}),a.readContract({address:e,abi:b,functionName:"asset"}),a.readContract({address:e,abi:b,functionName:"totalAssets"}),a.readContract({address:e,abi:b,functionName:"totalSupply"}),a.readContract({address:e,abi:b,functionName:"owner"}
1),a.readContract({address:e,abi:b,functionName:"curator"}),a.readContract({address:e,abi:b,functionName:"fee"}),a.readContract({address:e,abi:b,functionName:"timelock"})]),[m,x]=await Promise.all([a.readContract({address:s,abi:h,functionName:"symbol"}),a.readContract({address:s,abi:h,functionName:"decimals"})]),p=await V(e),y=n>BigInt(0)?(Number((0,u.J)(l,x))/Number((0,u.J)(n,18))).toFixed(6):"1.000000",g="".concat(Number((0,u.J)(l,x)).toLocaleString()," ").concat(m);return{address:e,name:t,symbol:r,asset:s,assetSymbol:m,assetDecimals:x,totalAssets:l.toString(),totalSupply:n.toString(),totalAssetsFormatted:g,sharePrice:y,owner:i,curator:o,fee:(Number(d)/1e4).toFixed(2)+"%",timelock:(Number(c)/86400).toFixed(1)+" days",apy:p,loading:!1}}catch(t){return console.error("Error loading vault data for ".concat(e,":"),t),{address:e,name:"Failed to load",symbol:"N/A",asset:"",assetSymbol:"",assetDecimals:18,totalAssets:"0",totalSupply:"0",totalAssetsFormatted:"Error loading",sharePrice:"0",owner:"",curator:"",fee:"0%",timelock:"0 days",apy:"0.00%",loading:!1,error:t instanceof Error?t.message:"Unknown error"}}},O=async(e,t,r)=>{if(!a)return 0;try{let s=await a.readContract({address:r,abi:v,functionName:"borrowRateView",args:[{loanToken:e[0],collateralToken:e[1],oracle:e[2],irm:e[3],lltv:e[4]},{totalSupplyAssets:t[0],totalSupplyShares:t[1],totalBorrowAssets:t[2],totalBorrowShares:t[3],lastUpdate:t[4],fee:t[5]}]}),[l,,n,,,i]=t,o=l>BigInt(0)?Number(n)/Number(l):0,d=Number(s)/1e18,c=Math.exp(0x1e187e0*d)-1,m=Number(i)/1e18;return c*o*(1-m)}catch(e){return console.error("Error calculating supply APY:",e),0}},V=async e=>{if(!a)return"0.00%";try{let t=await a.readContract({address:e,abi:b,functionName:"supplyQueueLength"});if(t===BigInt(0))return"0.00%";let r=0,s=0;for(let n=0;n<Number(t);n++)try{let t=await a.readContract({address:e,abi:b,functionName:"supplyQueue",args:[BigInt(n)]}),[i,o]=await Promise.all([a.readContract({address:l.MORPHO,abi:w,functionName:"idToMarketParams",args:[t]}),a.readContract({address:l.MORPHO,abi:w,functionName:"market",args:[t]})]),[d]=await a.readContract({address:l.MORPHO,abi:w,functionName:"position",args:[t,e]});if(d>BigInt(0)){let[e,t]=o,a=t>BigInt(0)?Number(d)*Number(e)/Number(t):0;if(a>0){let[,,,e]=i,t=await O(i,o,e);r+=t*a,s+=a}}}catch(e){console.error("Error processing market ".concat(n,":"),e);continue}let n=s>0?r/s*100:0;return"".concat(n.toFixed(2),"%")}catch(e){return console.error("Error calculating vault APY:",e),"0.00%"}},H=async()=>{if(a)try{let e=await a.getChainId(),t=(0,f._p)("vault",e);if(0===t.length){i([]),c(!1);return}let r=t.map(e=>({address:e.address,name:"Loading...",symbol:"Loading...",asset:"",assetSymbol:"",assetDecimals:18,totalAssets:"0",totalSupply:"0",totalAssetsFormatted:"Loading...",sharePrice:"0",owner:"",curator:"",fee:"0%",timelock:"0 days",apy:"Loading...",loading:!0}));i(r);let s=t.map(e=>L(e.address)),l=await Promise.all(s);i(l)}catch(e){console.error("Error loading vaults:",e)}finally{c(!1)}},X=async()=>{g(!0),await H(),g(!1)},U=async()=>{if(T&&s&&a&&A){D(!0),E("");try{let e=(0,m.X)(A,T.assetDecimals);if(await a.readContract({address:T.asset,abi:h,functionName:"allowance",args:[s.account.address,T.address]})<e){let t=await s.writeContract({address:T.asset,abi:h,functionName:"approve",args:[T.address,e]});await a.waitForTransactionReceipt({hash:t})}let t=await s.writeContract({address:T.address,abi:b,functionName:"deposit",args:[e,s.account.address]});await a.waitForTransactionReceipt({hash:t});let r=await L(T.address);i(e=>e.map(e=>e.address===T.address?r:e)),j(!1),F(""),E("")}catch(e){console.error("Deposit failed:",e),E(e.message||"Deposit failed")}finally{D(!1)}}},Y=async()=>{if(T&&s&&a&&M){D(!0),E("");try{let e=(0,m.X)(M,T.assetDecimals),t=await s.writeContract({address:T.address,abi:b,functionName:"withdraw",args:[e,s.account.address,s.account.address]});await a.waitForTransactionReceipt({hash:t});let r=await L(T.address);i(e=>e.map(e=>e.address===T.address?r:e)),C(!1),P(""),E("")}catch(e){console.error("Withdraw failed:",e),E(e.message||"Withdraw failed")}finally{D(!1)}}};return((0,d.useEffect)(()=>{H()},[a]),o)?(0,r.jsxs)("div",{className:"bg-white/5 rounded-lg overflow-hidden ".concat(t),children:[(0,r.jsxs)("div",{className:"p-6 border-b border-primary-muted/20",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-accent-white mb-2",children:"Live Vault Data"}),(0,r.jsx)("p",{className:"text-primary-muted",children:"Loading real-time vault information..."})]}),(0,r.jsx)("div",{className:"p-6",children:(0,r.jsxs)("div",{className:"animate-pulse",children:[(0,r.jsx)("div",{className:"h-4 bg-primary-muted/20 rounded w-3/4 mb-2"}),(0,r.jsx)("div",{className:"h-4 bg-primary-muted/20 rounded w-1/2"})]})})]}):0===n.length?(0,r.jsxs)("div",{className:"bg-white/5 rounded-lg overflow-hidden ".concat(t),children:[(0,r.jsxs)("div",{className:"p-6 border-b border-primary-muted/20",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-accent-white mb-2",children:"Live Vault Data"}),(0,r.jsx)("p",{className:"text-primary-muted",children:"Real-time information from deployed vault contracts"})]}),(0,r.jsxs)("div",{className:"p-6 text-center",children:[(0,r.jsx)("p",{className:"text-primary-muted",children:"No vaults found on this network"}),(0,r.jsx)("p",{className:"text-primary-muted text-sm mt-2",children:"Deploy a vault to see live data here"})]})]}):(0,r.jsxs)("div",{className:"bg-white/5 rounded-lg overflow-hidden ".concat(t),children:[(0,r.jsx)("div",{className:"p-6 border-b border-primary-muted/20",children:(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-accent-white mb-2",children:"Live Vault Data"}),(0,r.jsx)("p",{className:"text-primary-muted",children:"Real-time information from deployed vault contracts"})]}),(0,r.jsxs)("button",{onClick:X,disabled:y,className:"px-4 py-2 bg-accent-blue/80 hover:bg-accent-blue text-white rounded-md transition-colors disabled:opacity-50 flex items-center gap-2",children:[(0,r.jsx)("svg",{className:"w-4 h-4 ".concat(y?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),y?"Refreshing...":"Refresh"]})]})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full",children:[(0,r.jsx)("thead",{className:"bg-primary-muted/10",children:(0,r.jsxs)("tr",{className:"text-left",children:[(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Vault"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Asset"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Total Assets"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Share Price"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"APY"})," ",(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Fee"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Timelock"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Actions"})]})}),(0,r.jsx)("tbody",{children:n.map(e=>(0,r.jsxs)("tr",{className:"border-b border-primary-muted/10 hover:bg-primary-muted/5",children:[(0,r.jsx)("td",{className:"p-4",children:(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)("div",{className:"w-8 h-8 bg-accent-blue/20 rounded-full flex items-center justify-center",children:(0,r.jsx)("span",{className:"text-accent-blue text-sm font-bold",children:"V"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-accent-white font-medium",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-20"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:e.name}):e.name}),(0,r.jsx)("div",{className:"text-primary-muted text-sm",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-3 bg-primary-muted/20 rounded w-16 mt-1"}):e.symbol}),(0,r.jsxs)("div",{className:"text-primary-muted text-xs font-mono",children:[e.address.slice(0,6),"...",e.address.slice(-4)]})]})]})}),(0,r.jsxs)("td",{className:"p-4",children:[(0,r.jsx)("div",{className:"text-accent-white",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-16"}):e.assetSymbol}),(0,r.jsx)("div",{className:"text-primary-muted text-xs font-mono",children:e.asset&&"".concat(e.asset.slice(0,6),"...").concat(e.asset.slice(-4))})]}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-accent-white",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-24"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:"Error"}):e.totalAssetsFormatted})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-green-400 font-medium",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-16"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:"-"}):"".concat(e.sharePrice," ").concat(e.assetSymbol)})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-green-400 font-medium",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-16"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:"-"}):e.apy})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-primary-text",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-12"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:"-"}):e.fee})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-primary-text",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-16"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:"-"}):e.timelock})}),(0,r.jsx)("td",{className:"p-4",children:e.loading||e.error?e.error?(0,r.jsx)("button",{onClick:()=>L(e.address).then(t=>{i(a=>a.map(a=>a.address===e.address?t:a))}),className:"text-yellow-400 hover:text-yellow-300 p-1 rounded-full hover:bg-yellow-400/10 transition-colors",title:"Retry loading",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}):null:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{onClick:()=>{B(e),j(!0),E("")},className:"px-3 py-1 bg-green-500/20 text-green-400 rounded hover:bg-green-500/30 transition-colors text-sm",title:"Deposit to vault",children:"Deposit"}),(0,r.jsx)("button",{onClick:()=>{B(e),C(!0),E("")},className:"px-3 py-1 bg-blue-500/20 text-blue-400 rounded hover:bg-blue-500/30 transition-colors text-sm",title:"Withdraw from vault",children:"Withdraw"}),(0,r.jsx)("button",{onClick:()=>navigator.clipboard.writeText(e.address),className:"text-accent-blue hover:text-accent-blue/80 p-1 rounded-full hover:bg-accent-blue/10 transition-colors",title:"Copy vault address",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:[(0,r.jsx)("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),(0,r.jsx)("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]})})]})})]},e.address))})]})}),(0,r.jsx)("div",{className:"p-4 bg-primary-muted/5 text-center",children:(0,r.jsxs)("p",{className:"text-primary-muted text-sm",children:[n.length," vault",1===n.length?"":"s"," found • Last updated: ",new Date().toLocaleTimeString()]})}),N&&T&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50",children:(0,r.jsxs)("div",{className:"bg-primary-bg border border-primary-muted/30 rounded-lg p-6 max-w-md w-full mx-4",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,r.jsxs)("h3",{className:"text-xl font-bold text-accent-white",children:["Deposit to ",T.name]}),(0,r.jsx)("button",{onClick:()=>j(!1),className:"text-primary-muted hover:text-accent-white",children:"✕"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium text-primary-text mb-2",children:["Amount (",T.assetSymbol,")"]}),(0,r.jsx)("input",{type:"text",value:A,onChange:e=>F(e.target.value),className:"w-full px-3 py-2 bg-primary-bg/50 border border-primary-muted rounded-md text-accent-white placeholder-primary-muted focus:outline-none focus:ring-2 focus:ring-accent-blue focus:border-transparent",placeholder:"Enter amount in ".concat(T.assetSymbol),disabled:I})]}),R&&(0,r.jsx)("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-3",children:(0,r.jsx)("p",{className:"text-red-400 text-sm",children:R})}),(0,r.jsxs)("div",{className:"flex space-x-3",children:[(0,r.jsx)("button",{onClick:()=>j(!1),className:"flex-1 py-2 bg-primary-muted/30 text-primary-text rounded hover:bg-primary-muted/50 transition-colors",disabled:I,children:"Cancel"}),(0,r.jsx)("button",{onClick:U,disabled:I||!A||0>=parseFloat(A),className:"flex-1 py-2 bg-green-500 text-white rounded hover:bg-green-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:I?"Processing...":"Deposit"})]})]})]})}),S&&T&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50",children:(0,r.jsxs)("div",{className:"bg-primary-bg border border-primary-muted/30 rounded-lg p-6 max-w-md w-full mx-4",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,r.jsxs)("h3",{className:"text-xl font-bold text-accent-white",children:["Withdraw from ",T.
1name]}),(0,r.jsx)("button",{onClick:()=>C(!1),className:"text-primary-muted hover:text-accent-white",children:"✕"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium text-primary-text mb-2",children:["Amount (",T.assetSymbol,")"]}),(0,r.jsx)("input",{type:"text",value:M,onChange:e=>P(e.target.value),className:"w-full px-3 py-2 bg-primary-bg/50 border border-primary-muted rounded-md text-accent-white placeholder-primary-muted focus:outline-none focus:ring-2 focus:ring-accent-blue focus:border-transparent",placeholder:"Enter amount in ".concat(T.assetSymbol),disabled:I})]}),R&&(0,r.jsx)("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-3",children:(0,r.jsx)("p",{className:"text-red-400 text-sm",children:R})}),(0,r.jsxs)("div",{className:"flex space-x-3",children:[(0,r.jsx)("button",{onClick:()=>C(!1),className:"flex-1 py-2 bg-primary-muted/30 text-primary-text rounded hover:bg-primary-muted/50 transition-colors",disabled:I,children:"Cancel"}),(0,r.jsx)("button",{onClick:Y,disabled:I||!M||0>=parseFloat(M),className:"flex-1 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:I?"Processing...":"Withdraw"})]})]})]})})]})},C=e=>{let{className:t=""}=e,a=(0,x.e)(),{data:s}=(0,p.G)(),l=(0,k.Gd)(),[n,i]=(0,d.useState)([]),[o,c]=(0,d.useState)(!0),[b,y]=(0,d.useState)(!1),[g,N]=(0,d.useState)(!1),[j,S]=(0,d.useState)(!1),[C,T]=(0,d.useState)(!1),[B,A]=(0,d.useState)(null),[F,M]=(0,d.useState)(""),[P,I]=(0,d.useState)(""),[D,R]=(0,d.useState)(""),[E,L]=(0,d.useState)(!1),[O,V]=(0,d.useState)(""),[H,X]=(0,d.useState)("0"),[U,Y]=(0,d.useState)(BigInt(0)),$=async(e,t,r)=>{if(!a)return"0.00%";try{let s=await a.readContract({address:r,abi:v,functionName:"borrowRateView",args:[{loanToken:e[0],collateralToken:e[1],oracle:e[2],irm:e[3],lltv:e[4]},{totalSupplyAssets:t[0],totalSupplyShares:t[1],totalBorrowAssets:t[2],totalBorrowShares:t[3],lastUpdate:t[4],fee:t[5]}]});console.log("Borrow Rate Per Second (wei):",s.toString());let l=Number(s)/1e18,n=(Math.exp(0x1e187e0*l)-1)*100;return"".concat(n.toFixed(2),"%")}catch(e){return console.error("Error calculating borrow APY:",e),"0.00%"}},_=async(e,t)=>{if(!a)throw Error("Public client not available");try{let r=await a.readContract({address:l.MORPHO,abi:w,functionName:"idToMarketParams",args:[e]}),[n,i,o,d,c]=r,[m,x,p,b,y,g]=await Promise.all([a.readContract({address:l.MORPHO,abi:w,functionName:"market",args:[e]}),a.readContract({address:n,abi:h,functionName:"symbol"}),a.readContract({address:n,abi:h,functionName:"decimals"}),a.readContract({address:i,abi:h,functionName:"symbol"}),a.readContract({address:i,abi:h,functionName:"decimals"}),s?a.readContract({address:l.MORPHO,abi:w,functionName:"position",args:[e,s.account.address]}):Promise.resolve([BigInt(0),BigInt(0),BigInt(0)])]),[N,j,f,v,k,S]=m,[C,T,B]=g,A=N>BigInt(0)?(Number(f)/Number(N)*100).toFixed(2)+"%":"0%",F=(Number(c)/1e16).toFixed(2)+"%";console.log("Market Borrow APY for market:",e);let M=await $(r,m,d);return{marketId:e,name:t.name||"".concat(b,"/").concat(x," ").concat(F),loanToken:n,loanTokenSymbol:x,loanTokenDecimals:p,collateralToken:i,collateralTokenSymbol:b,collateralTokenDecimals:y,oracle:o,irm:d,lltv:F,totalSupplyAssets:"".concat(Number((0,u.J)(N,p)).toLocaleString()," ").concat(x),totalSupplyShares:j.toString(),totalBorrowAssets:"".concat(Number((0,u.J)(f,p)).toLocaleString()," ").concat(x),totalBorrowShares:v.toString(),lastUpdate:new Date(1e3*Number(k)).toLocaleString(),fee:(Number(S)/1e16).toFixed(4)+"%",utilization:A,borrowAPY:M,userSupplyShares:C.toString(),userBorrowShares:T.toString(),userCollateral:(0,u.J)(B,y),loading:!1}}catch(a){return console.error("Error loading market data for ".concat(e,":"),a),{marketId:e,name:t.name||"Failed to load",loanToken:"",loanTokenSymbol:"",loanTokenDecimals:18,collateralToken:"",collateralTokenSymbol:"",collateralTokenDecimals:18,oracle:"",irm:"",lltv:"0%",totalSupplyAssets:"Error loading",totalSupplyShares:"0",totalBorrowAssets:"Error loading",totalBorrowShares:"0",lastUpdate:"Unknown",fee:"0%",utilization:"0%",borrowAPY:"0.00%",userSupplyShares:"0",userBorrowShares:"0",userCollateral:"0",loading:!1,error:a instanceof Error?a.message:"Unknown error"}}},z=async()=>
1{if(B&&s&&a&&F){L(!0),V("");try{let e=(0,m.X)(F,B.collateralTokenDecimals);if(await a.readContract({address:B.collateralToken,abi:h,functionName:"allowance",args:[s.account.address,l.MORPHO]})<e){let t=await s.writeContract({address:B.collateralToken,abi:h,functionName:"approve",args:[l.MORPHO,e]});await a.waitForTransactionReceipt({hash:t})}let t=[B.loanToken,B.collateralToken,B.oracle,B.irm,(0,m.X)((parseFloat(B.lltv.replace("%",""))/100).toString(),18)],r=await s.writeContract({address:l.MORPHO,abi:w,functionName:"supplyCollateral",args:[t,e,s.account.address,"0x"]});await a.waitForTransactionReceipt({hash:r}),await Z(B.marketId),N(!1),M("")}catch(e){console.error("Supply collateral failed:",e),V(e.message||"Supply collateral failed")}finally{L(!1)}}},J=async()=>{if(B&&s&&a&&P){L(!0),V("");try{let e=(0,m.X)(P,B.loanTokenDecimals),t=[B.loanToken,B.collateralToken,B.oracle,B.irm,(0,m.X)((parseFloat(B.lltv.replace("%",""))/100).toString(),18)],r=await s.writeContract({address:l.MORPHO,abi:w,functionName:"borrow",args:[t,e,BigInt(0),s.account.address,s.account.address]});await a.waitForTransactionReceipt({hash:r}),await Z(B.marketId),S(!1),I("")}catch(e){console.error("Borrow failed:",e),V(e.message||"Borrow failed")}finally{L(!1)}}},W=async()=>{if(B&&s&&a&&D){L(!0),V("");try{let e=(0,m.X)(D,B.loanTokenDecimals);if(await a.readContract({address:B.loanToken,abi:h,functionName:"allowance",args:[s.account.address,l.MORPHO]})<e){let t=await s.writeContract({address:B.loanToken,abi:h,functionName:"approve",args:[l.MORPHO,e]});await a.waitForTransactionReceipt({hash:t})}let t=[B.loanToken,B.collateralToken,B.oracle,B.irm,(0,m.X)((parseFloat(B.lltv.replace("%",""))/100).toString(),18)],r=await s.writeContract({address:l.MORPHO,abi:w,functionName:"repay",args:[t,e,BigInt(0),s.account.address,"0x"]});await a.waitForTransactionReceipt({hash:r}),await Z(B.marketId),T(!1),R("")}catch(e){console.error("Repay failed:",e),V(e.message||"Repay failed")}finally{L(!1)}}},G=async()=>{if(a)try{let e=await a.getChainId(),t=(0,f._p)("market",e);if(0===t.length){i([]),c(!1);return}let r=t.map(e=>({marketId:e.address,name:e.name||"Loading...",loanToken:"",loanTokenSymbol:"Loading...",loanTokenDecimals:18,collateralToken:"",collateralTokenSymbol:"Loading...",collateralTokenDecimals:18,oracle:"",irm:"",lltv:"0%",totalSupplyAssets:"Loading...",totalSupplyShares:"0",totalBorrowAssets:"Loading...",totalBorrowShares:"0",lastUpdate:"Loading...",fee:"0%",utilization:"0%",borrowAPY:"",userSupplyShares:"0",userBorrowShares:"0",userCollateral:"0",loading:!0}));i(r);let s=t.map(e=>_(e.address,e)),l=await Promise.all(s);i(l)}catch(e){console.error("Error loading markets:",e)}finally{c(!1)}},Q=async()=>{y(!0),await G(),y(!1)};(0,d.useEffect)(()=>{G()},[a,s]);let q=async e=>{if(!a||!s)return"0.00";try{let t=(0,m.X)(e.userCollateral||"0",e.collateralTokenDecimals);if(console.log("User Collateral Amount (wei):",t.toString()),t===BigInt(0))return"0.00";let r=await a.readContract({address:e.oracle,abi:[{inputs:[],name:"price",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"price"});console.log("Oracle Price (wei):",r.toString()),console.log("oracle value in decimal:",r/BigInt(1e18));let s=parseFloat(e.lltv.replace("%",""))/100,l=t*r/BigInt(1e36);console.log("Collateral Value in Loan Token (wei):",l.toString());let n=l*BigInt(Math.floor(1e3*s))/BigInt(1e3);console.log("Theoretical Max Borrowable Amount (wei):",n.toString());let i=BigInt(e.userBorrowShares||"0"),o=BigInt(e.totalBorrowShares||"1"),d=BigInt(0);if(i>BigInt(0)&&o>BigInt(0)){let t=e.totalBorrowAssets.match(/^([\d,]+\.?\d*)/),a=t?parseFloat(t[1].replace(/,/g,"")):0,r=o>BigInt(0)?Number(i)/Number(o)*a:0;d=(0,m.X)(r.toString(),e.loanTokenDecimals)}console.log("Current Borrowed Amount (wei):",d.toString()),console.log("Current Borrowed Amount (formatted):",(0,u.J)(d,e.loanTokenDecimals));let c=n>d?n-d:BigInt(0);console.log("Available Borrow Capacity (wei) before safety buffer:",c.toString());let x=c*BigInt(99)/BigInt(100);console.log("Safe Available Borrow Capacity (wei) after 1% buffer:",x.toString());let p=(0,u.J)(x,e.loanTokenDecimals);return console.log("Max Additional Borrowable (formatted) with safety buffer:",p),Math.max(0,parseFloat(p)).toFixed(2)}catch(e){return console.error("Error calculating max borrow:",e),"0.00"}},K=async e=>{A(e),S(!0),V(""),X(await q(e))},Z=async e=>{if(a)try{let t=n.find(t=>t.marketId===e);if(!t)return;let a=await _(e,t);i(t=>t.map(t=>t.marketId===e?a:t))}catch(e){console.error("Error reloading specific market:",e),await G()}},ee=async e=>{if(a&&s)try{let t=await a.readContract({address:e.loanToken,abi:h,functionName:"balanceOf",args:[s.account.address]});Y(t)}catch(e){console.error("Error loading user balance:",e),Y(BigInt(0))}};return o?(0,r.jsxs)("div",{className:"bg-white/5 rounded-lg overflow-hidden ".concat(t),children:[(0,r.jsxs)("div",{className:"p-6 border-b border-primary-muted/20",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-accent-white mb-2",children:"Live Market Data"}),(0,r.jsx)("p",{className:"text-primary-muted",children:"Loading real-time market information..."})]}),(0,r.jsx)("div",{className:"p-6",children:(0,r.jsxs)("div",{className:"animate-pulse",children:[(0,r.jsx)("div",{className:"h-4 bg-primary-muted/20 rounded w-3/4 mb-2"}),(0,r.jsx)("div",{className:"h-4 bg-primary-muted/20 rounded w-1/2"})]})})]}):0===n.length?(0,r.jsxs)("div",{className:"bg-white/5 rounded-lg overflow-hidden ".concat(t),children:[(0,r.jsxs)("div",{className:"p-6 border-b border-primary-muted/20",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-accent-white mb-2",children:"Live Market Data"}),(0,r.jsx)("p",{className:"text-primary-muted",children:"Real-time information from deployed market contracts"})]}),(0,r.jsxs)("div",{className:"p-6 text-center",children:[(0,r.jsx)("p",{className:"text-primary-muted",children:"No markets found on this network"}),(0,r.jsx)("p",{className:"text-primary-muted text-sm mt-2",children:"Deploy a market to see live data here"})]})]}):(0,r.jsxs)("div",{className:"bg-white/5 rounded-lg overflow-hidden ".concat(t),children:[(0,r.jsx)("div",{className:"p-6 border-b border-primary-muted/20",children:(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-accent-white mb-2",children:"Live Market Data"}),(0,r.jsx)("p",{className:"text-primary-muted",children:"Real-time information from deployed market contracts"})]}),(0,r.jsxs)("button",{onClick:Q,disabled:b,className:"px-4 py-2 bg-accent-blue/80 hover:bg-accent-blue text-white rounded-md transition-colors disabled:opacity-50 flex items-center gap-2",children:[(0,r.jsx)("svg",{className:"w-4 h-4 ".concat(b?"animate-spin":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),b?"Refreshing...":"Refresh"]})]})}),(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full",children:[(0,r.jsx)("thead",{className:"bg-primary-muted/10",children:(0,r.jsxs)("tr",{className:"text-left",children:[(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Market"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"LLTV"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Total Supply"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Total Borrow"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Utilization"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Borrow APY"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Fee"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Your Position"}),(0,r.jsx)("th",{className:"p-4 text-primary-muted font-medium",children:"Actions"})]})}),(0,r.jsx)("tbody",{children:n.map(e=>(0,r.jsxs)("tr",{className:"border-b border-primary-muted/10 hover:bg-primary-muted/5",children:[(0,r.jsx)("td",{className:"p-4",children:(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)("div",{className:"w-8 h-8 bg-green-500/20 rounded-full flex items-center justify-center",children:(0,r.jsx)("span",{className:"text-green-400 text-sm font-bold",children:"M"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-accent-white font-medium",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-20"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:e.name}):e.name}),(0,r.jsx)("div",{className:"text-primary-muted text-sm",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-3 bg-primary-muted/20 rounded w-24 mt-1"}):"".concat(e.collateralTokenSymbol," → ").concat(e.loanTokenSymbol)}),(0,r.jsxs)("div",{className:"text-primary-muted text-xs font-mono",children:[e.marketId.slice(0,8),"...",e.marketId.slice(-6)]})]})]})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-accent-white font-medium",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-12"}):e.lltv})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-green-400",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-24"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:"Error"}):e.totalSupplyAssets})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-orange-400",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-24"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:"Error"}):e.totalBorrowAssets})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-blue-400 font-medium",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-12"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:"-"}):e.utilization})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-red-400 font-medium",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-12"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:"-"}):e.borrowAPY})}),(0,r.jsx)("td",{className:"p-4",children:(0,r.jsx)("div",{className:"text-primary-text",children:e.loading?(0,r.jsx)("div",{className:"animate-pulse h-4 bg-primary-muted/20 rounded w-12"}):e.error?(0,r.jsx)("span",{className:"text-red-400",children:"-"}):e.fee})}),(0,r.jsx)("td",{className:"p-4",children:e.loading||e.error||!s?e.loading?(0,r.jsxs)("div",{className:"animate-pulse space-y-1",children:[(0,r.jsx)("div",{className:"h-3 bg-primary-muted/20 rounded w-20"}),(0,r.jsx)("div",{className:"h-3 bg-primary-muted/20 rounded w-16"}),(0,r.jsx)("div",{className:"h-3 bg-primary-muted/20 rounded w-18"})]}):s?null:(0,r.jsx)("span",{className:"text-primary-muted text-sm",children:"Connect wallet"}):(0,r.jsxs)("div",{className:"text-sm space-y-1",children:[(0,r.jsxs)("div",{className:"text-green-400",children:["Collateral: ",parseFloat(e.userCollateral||"0").toFixed(4)," ",e.collateralTokenSymbol]}),(0,r.jsx)("div",{className:"text-orange-400",children:(()=>{let t=BigInt(e.userBorrowShares||"0"),a=BigInt(e.totalBorrowShares||"1"),r=e.totalBorrowAssets;if(t===BigInt(0))return"Borrowed: 0.0000 ".concat(e.loanTokenSymbol);let s=r.match(/^([\d,]+\.?\d*)/),l=s?parseFloat(s[1].replace(/,/g,"")):0,n=a>BigInt(0)?Number(t)/Number(a)*l:0;return"Borrowed: ".concat(n.toFixed(4)," ").concat(e.loanTokenSymbol)})()})]})}),(0,r.jsx)("td",{className:"p-4",children:e.loading||e.error||!s?e.error?(0,r.jsx)("button",{onClick:()=>_(e.marketId,{name:e.name}).then(t=>{i(a=>a.map(a=>
1a.marketId===e.marketId?t:a))}),className:"text-yellow-400 hover:text-yellow-300 p-1 rounded-full hover:bg-yellow-400/10 transition-colors",title:"Retry loading",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}):s?null:(0,r.jsx)("span",{className:"text-primary-muted text-sm",children:"Connect wallet"}):(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{onClick:()=>{A(e),N(!0),V("")},className:"px-2 py-1 bg-green-500/20 text-green-400 rounded hover:bg-green-500/30 transition-colors text-xs",title:"Supply collateral",children:"Supply"}),(0,r.jsx)("button",{onClick:()=>K(e),className:"px-2 py-1 bg-blue-500/20 text-blue-400 rounded hover:bg-blue-500/30 transition-colors text-xs",title:"Borrow assets",children:"Borrow"}),"0"!==e.userBorrowShares&&(0,r.jsx)("button",{onClick:()=>{A(e),T(!0),V(""),ee(e)},className:"px-2 py-1 bg-orange-500/20 text-orange-400 rounded hover:bg-orange-500/30 transition-colors text-xs",title:"Repay loan",children:"Repay"}),(0,r.jsx)("button",{onClick:()=>navigator.clipboard.writeText(e.marketId),className:"text-accent-blue hover:text-accent-blue/80 p-1 rounded-full hover:bg-accent-blue/10 transition-colors",title:"Copy market ID",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:[(0,r.jsx)("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),(0,r.jsx)("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]})})]})})]},e.marketId))})]})}),(0,r.jsx)("div",{className:"p-4 bg-primary-muted/5 text-center",children:(0,r.jsxs)("p",{className:"text-primary-muted text-sm",children:[n.length," market",1===n.length?"":"s"," found • Last updated: ",new Date().toLocaleTimeString()]})}),g&&B&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50",children:(0,r.jsxs)("div",{className:"bg-primary-bg border border-primary-muted/30 rounded-lg p-6 max-w-md w-full mx-4",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,r.jsxs)("h3",{className:"text-xl font-bold text-accent-white",children:["Supply ",B.collateralTokenSymbol]}),(0,r.jsx)("button",{onClick:()=>N(!1),className:"text-primary-muted hover:text-accent-white",children:"✕"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium text-primary-text mb-2",children:["Amount (",B.collateralTokenSymbol,")"]}),(0,r.jsx)("input",{type:"text",value:F,onChange:e=>M(e.target.value),className:"w-full px-3 py-2 bg-primary-bg/50 border border-primary-muted rounded-md text-accent-white placeholder-primary-muted focus:outline-none focus:ring-2 focus:ring-accent-blue focus:border-transparent",placeholder:"Enter amount in ".concat(B.collateralTokenSymbol),disabled:E})]}),O&&(0,r.jsx)("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-3",children:(0,r.jsx)("p",{className:"text-red-400 text-sm",children:O})}),(0,r.jsxs)("div",{className:"flex space-x-3",children:[(0,r.jsx)("button",{onClick:()=>N(!1),className:"flex-1 py-2 bg-primary-muted/30 text-primary-text rounded hover:bg-primary-muted/50 transition-colors",disabled:E,children:"Cancel"}),(0,r.jsx)("button",{onClick:z,disabled:E||!F||0>=parseFloat(F),className:"flex-1 py-2 bg-green-500 text-white rounded hover:bg-green-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:E?"Processing...":"Supply"})]})]})]})}),j&&B&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50",children:(0,r.jsxs)("div",{className:"bg-primary-bg border border-primary-muted/30 rounded-lg p-6 max-w-md w-full mx-4",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,r.jsxs)("h3",{className:"text-xl font-bold text-accent-white",children:["Borrow ",B.loanTokenSymbol]}),(0,r.jsx)("button",{onClick:()=>S(!1),className:"text-primary-muted hover:text-accent-white",children:"✕"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"bg-primary-muted/10 p-4 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex justify-between mb-2",children:[(0,r.jsx)("span",{className:"text-primary-muted",children:"Your Collateral:"}),(0,r.jsxs)("span",{className:"text-accent-white",children:[parseFloat(B.userCollateral||"0").toFixed(4)," ",B.collateralTokenSymbol]})]}),(0,r.jsxs)("div",{className:"flex justify-between mb-2",children:[(0,r.jsx)("span",{className:"text-primary-muted",children:"LLTV:"}),(0,r.jsx)("span",{className:"text-accent-white",children:B.lltv})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-primary-muted",children:"Max Borrowable:"}),(0,r.jsxs)("span",{className:"text-green-400 font-medium",children:[parseFloat(H).toFixed(4)," ",B.loanTokenSymbol]})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium text-primary-text mb-2",children:["Amount (",B.loanTokenSymbol,")"]}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("input",{type:"text",value:P,onChange:e=>I(e.target.value),className:"flex-1 px-3 py-2 bg-primary-bg/50 border border-primary-muted rounded-l-md text-accent-white placeholder-primary-muted focus:outline-none focus:ring-2 focus:ring-accent-blue focus:border-transparent",placeholder:"Enter amount in ".concat(B.loanTokenSymbol),disabled:E}),(0,r.jsx)("button",{onClick:()=>I(H),className:"px-3 py-2 bg-primary-muted/30 border-t border-r border-b border-primary-muted rounded-r-md text-accent-blue hover:bg-primary-muted/50 transition-colors",disabled:E,children:"MAX"})]}),0===parseFloat(H)&&(0,r.jsx)("p",{className:"text-yellow-400 text-xs mt-1",children:"You need to supply collateral first to borrow."}),parseFloat(P||"0")>parseFloat(H)&&parseFloat(H)>0&&(0,r.jsx)("p",{className:"text-red-400 text-xs mt-1",children:"Amount exceeds maximum borrowable limit."})]}),O&&(0,r.jsx)("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-3",children:(0,r.jsx)("p",{className:"text-red-400 text-sm",children:O})}),(0,r.jsxs)("div",{className:"flex space-x-3",children:[(0,r.jsx)("button",{onClick:()=>S(!1),className:"flex-1 py-2 bg-primary-muted/30 text-primary-text rounded hover:bg-primary-muted/50 transition-colors",disabled:E,children:"Cancel"}),(0,r.jsx)("button",{onClick:J,disabled:E||!P||0>=parseFloat(P)||parseFloat(P)>parseFloat(H)||0===parseFloat(H),className:"flex-1 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:E?"Processing...":"Borrow"})]})]})]})}),C&&B&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50",children:(0,r.jsxs)("div",{className:"bg-primary-bg border border-primary-muted/30 rounded-lg p-6 max-w-md w-full mx-4",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,r.jsxs)("h3",{className:"text-xl font-bold text-accent-white",children:["Repay ",B.loanTokenSymbol]}),(0,r.jsx)("button",{onClick:()=>T(!1),className:"text-primary-muted hover:text-accent-white",children:"✕"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("label",{className:"block text-sm font-medium text-primary-text mb-2",children:["Amount (",B.loanTokenSymbol,")"]}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("input",{type:"text",value:D,onChange:e=>R(e.target.value),className:"flex-1 px-3 py-2 bg-primary-bg/50 border border-primary-muted rounded-l-md text-accent-white placeholder-primary-muted focus:outline-none focus:ring-2 focus:ring-accent-blue focus:border-transparent",placeholder:"Enter amount in ".concat(B.loanTokenSymbol),disabled:E}),(0,r.jsx)("button",{onClick:()=>{let e=(0,u.J)(U,B.loanTokenDecimals),t=B.userBorrowShares&&"0"!==B.userBorrowShares?(()=>{var e;let t=parseFloat(B.totalBorrowShares||"0"),a=parseFloat(B.userBorrowShares||"0"),r=null==(e=B.totalBorrowAssets)?void 0:e.match(/^([\d,]+\.?\d*)/),s=r?parseFloat(r[1].replace(/,/g,"")):0;return t>0?(a/t*s).toString():"0"})():"0";R(Math.min(parseFloat(e),parseFloat(t)).toString())},className:"px-3 py-2 bg-primary-muted/30 border-t border-r border-b border-primary-muted rounded-r-md text-accent-blue hover:bg-primary-muted/50 transition-colors",disabled:E,children:"MAX"})]}),(0,r.jsxs)("div",{className:"mt-2 text-xs text-primary-muted",children:["Wallet Balance: ",(0,u.J)(U,B.loanTokenDecimals)," ",B.loanTokenSymbol]})]}),O&&(0,r.jsx)("div",{className:"bg-red-500/20 border border-red-500/30 rounded-lg p-3",children:(0,r.jsx)("p",{className:"text-red-400 text-sm",children:O})}),(0,r.jsxs)("div",{className:"flex space-x-3",children:[(0,r.jsx)("button",{onClick:()=>T(!1),className:"flex-1 py-2 bg-primary-muted/30 text-primary-text rounded hover:bg-primary-muted/50 transition-colors",disabled:E,children:"Cancel"}),(0,r.jsx)("button",{onClick:W,disabled:E||!D||0>=parseFloat(D),className:"flex-1 py-2 bg-orange-500 text-white rounded hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:E?"Processing...":"Repay"})]})]})]})})]})},T=e=>{let{vaults:t=[],markets:a=[]}=e,s=t.length>0||a.length>0;return(0,r.jsxs)("div",{className:"space-y-12",children:[(0,r.jsx)(S,{}),(0,r.jsx)(C,{}),s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N,{vaults:t}),(0,r.jsx)(j,{markets:a})]})]})},B=()=>{let[e,t]=(0,d.useState)([]),[a,s]=(0,d.useState)([]),[n,c]=(0,d.useState)(!0);return(0,d.useEffect)(()=>{let e=(0,f.iu)("vault"),a=(0,f.iu)("market"),r=e.map((e,t)=>{var a,r,s,l,n;return{id:t+1,name:e.name||"Vault ".concat(t+1),deposits:(null==(a=e.details)?void 0:a.deposits)||"0 USDC",depositsValue:(null==(r=e.details)?void 0:r.depositsValue)||"$0",collateral:(null==(s=e.details)?void 0:s.collateral)||["Unknown"],apy:(null==(l=e.details)?void 0:l.apy)||"0%",status:(null==(n=e.details)?void 0:n.status)||"active",address:e.address}}),l=a.map((e,t)=>{var a,r,s,l,n,i;return{id:t+1,name:e.name||"Market ".concat(t+1),deposits:(null==(a=e.details)?void 0:a.deposits)||"0 USDC",depositsValue:(null==(r=e.details)?void 0:r.depositsValue)||"$0",curator:(null==(s=e.details)?void 0:s.curator)||"Unknown",collateral:(null==(l=e.details)?void 0:l.collateral)||[(null==(n=e.details)?void 0:n.collateralTokenAddress)?e.details.collateralTokenAddress.slice(0,6)+"...":"Unknown"],apy:(null==(i=e.details)?void 0:i.apy)||"0%"}});t(r),s(l),c(!1)},[]),(0,r.jsxs)("div",{className:"bg-primary-bg min-h-screen",children:[(0,r.jsxs)(l(),{children:[(0,r.jsx)("title",{children:"Api3 Morpho Curation Tool"}),(0,r.jsx)("meta",{content:"Api3 Morpho Curation Tool - Oracles that pay you",name:"description"}),(0,r.jsx)("link",{href:"/favicon.ico",rel:"icon"})]}),(0,r.jsx)(o.A,{}),(0,r.jsxs)("main",{className:"container mx-auto px-4 py-12",children:[(0,r.jsxs)("div",{className:"text-center mb-16",children:[(0,r.jsx)("h1",{className:"text-6xl font-bold mb-4 text-accent-white",children:"Morpho Curation Tool"}),(0,r.jsxs)("p",{className:"text-xl text-primary-muted mb-8",children:["Earn Additional Revenue with OEV Rewards ",(0,r.jsx)("br",{})," for your Curated Markets"]}),(0,r.jsx)("a",{href:"https://docs.api3.org/dapps/oev-rewards/",target:"_blank",rel:"noopener noreferrer",className:"text-accent-blue underline",children:"Read more about OEV Rewards"}),(0,r.jsx)("div",{className:"mt-9 bg-primary-bg/30 p-6 rounded-lg",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-2 gap-12 mt-8 max-w-md mx-auto",children:[(0,r.jsx)(i(),{href:"/createVault",children:(0,r.jsx)("div",{className:"p-4 border border-primary-muted rounded-lg hover:border-accent-blue cursor-pointer text-accent-white",children:"Create a Vault"})}),(0,r.jsx)(i(),{href:"/configureOEVOracles",children:(0,r.jsx)("div",{className:"p-4 border border-primary-muted rounded-lg hover:border-accent-blue cursor-pointer text-accent-white",children:"Create a Market"})})]})})]}),n?(0,r.jsx)("div",{className:"text-center py-8",children:(0,r.jsx)("p",{className:"text-primary-muted",children:"Loading your deployments..."})}):(0,r.jsx)(T,{vaults:e,markets:a})]})]})}}},e=>{e.O(0,[5695,117,6251,3399,636,6593,8792],()=>e(e.s=16760)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.