@aori/mega-swap-widget 0.1.0 → 0.1.2

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.
Files changed (99) hide show
  1. package/LICENSE +5 -12
  2. package/README.md +9 -1
  3. package/dist/AssetSelectionMenu-4E576X3D.cjs +2 -0
  4. package/dist/AssetSelectionMenu-ZFY7XFRX.js +2 -0
  5. package/dist/ChainSelectionMenu-SKXLHK3S.js +2 -0
  6. package/dist/ChainSelectionMenu-VU3SIBVL.cjs +2 -0
  7. package/dist/SwapFormHorizontal-GI4X7ISS.js +2 -0
  8. package/dist/SwapFormHorizontal-V557YBX2.cjs +2 -0
  9. package/dist/SwapFormSplit-52RBMJIO.js +2 -0
  10. package/dist/SwapFormSplit-PQCS3BPT.cjs +2 -0
  11. package/dist/WalletPlaceholderPanel-TTONBBI4.cjs +2 -0
  12. package/dist/WalletPlaceholderPanel-Z4JCFCNV.js +2 -0
  13. package/dist/WidgetWalletPanel-XYV3YL4I.js +2 -0
  14. package/dist/WidgetWalletPanel-YBMN5KZH.cjs +2 -0
  15. package/dist/chunk-34N36GUD.cjs +2 -0
  16. package/dist/chunk-46H44R7V.js +2 -0
  17. package/dist/chunk-4BQRVCQR.js +2 -0
  18. package/dist/chunk-4LJJMEOG.js +2 -0
  19. package/dist/chunk-726CI6GC.js +2 -0
  20. package/dist/chunk-73CB2I7U.js +2 -0
  21. package/dist/chunk-DUIRZSBV.cjs +2 -0
  22. package/dist/chunk-EW2OR6CJ.js +27 -0
  23. package/dist/chunk-FDQKBTWP.js +2 -0
  24. package/dist/chunk-HTWUZKYO.cjs +2 -0
  25. package/dist/chunk-KH57FLST.cjs +57 -0
  26. package/dist/chunk-LXEKOQAG.cjs +27 -0
  27. package/dist/chunk-MCT3UZTP.cjs +2 -0
  28. package/dist/chunk-OPN7WCJR.js +57 -0
  29. package/dist/chunk-T3I3AJXV.cjs +2 -0
  30. package/dist/chunk-UZWGYG2S.cjs +2 -0
  31. package/dist/chunk-XYF2YBR3.js +2 -0
  32. package/dist/chunk-XZRXVBSB.cjs +2 -0
  33. package/dist/index.cjs +2 -1772
  34. package/dist/index.css +1 -1423
  35. package/dist/index.js +2 -1772
  36. package/package.json +2 -22
  37. package/dist/AssetSelectionMenu-Y3EB32BT.cjs +0 -13
  38. package/dist/AssetSelectionMenu-Y3EB32BT.cjs.map +0 -1
  39. package/dist/AssetSelectionMenu-ZRG42UCZ.js +0 -13
  40. package/dist/AssetSelectionMenu-ZRG42UCZ.js.map +0 -1
  41. package/dist/ChainSelectionMenu-FBAPPFKI.cjs +0 -11
  42. package/dist/ChainSelectionMenu-FBAPPFKI.cjs.map +0 -1
  43. package/dist/ChainSelectionMenu-QO3H4TNR.js +0 -11
  44. package/dist/ChainSelectionMenu-QO3H4TNR.js.map +0 -1
  45. package/dist/SwapFormHorizontal-JDJUDFNX.js +0 -573
  46. package/dist/SwapFormHorizontal-JDJUDFNX.js.map +0 -1
  47. package/dist/SwapFormHorizontal-WG3Z3CFT.cjs +0 -573
  48. package/dist/SwapFormHorizontal-WG3Z3CFT.cjs.map +0 -1
  49. package/dist/SwapFormSplit-7CHTPLEQ.js +0 -441
  50. package/dist/SwapFormSplit-7CHTPLEQ.js.map +0 -1
  51. package/dist/SwapFormSplit-VDDIRQUQ.cjs +0 -441
  52. package/dist/SwapFormSplit-VDDIRQUQ.cjs.map +0 -1
  53. package/dist/WalletPlaceholderPanel-7YDQ4FT6.js +0 -57
  54. package/dist/WalletPlaceholderPanel-7YDQ4FT6.js.map +0 -1
  55. package/dist/WalletPlaceholderPanel-FZ6XIAMF.cjs +0 -57
  56. package/dist/WalletPlaceholderPanel-FZ6XIAMF.cjs.map +0 -1
  57. package/dist/WidgetWalletPanel-D7I5TAU3.js +0 -789
  58. package/dist/WidgetWalletPanel-D7I5TAU3.js.map +0 -1
  59. package/dist/WidgetWalletPanel-T7H6FGVN.cjs +0 -789
  60. package/dist/WidgetWalletPanel-T7H6FGVN.cjs.map +0 -1
  61. package/dist/chunk-3E6RNP2D.cjs +0 -389
  62. package/dist/chunk-3E6RNP2D.cjs.map +0 -1
  63. package/dist/chunk-5TH6MFQD.cjs +0 -122
  64. package/dist/chunk-5TH6MFQD.cjs.map +0 -1
  65. package/dist/chunk-5XSCUUOW.js +0 -101
  66. package/dist/chunk-5XSCUUOW.js.map +0 -1
  67. package/dist/chunk-6Q7MSCKS.js +0 -2199
  68. package/dist/chunk-6Q7MSCKS.js.map +0 -1
  69. package/dist/chunk-6XB5R4GF.cjs +0 -368
  70. package/dist/chunk-6XB5R4GF.cjs.map +0 -1
  71. package/dist/chunk-6YLNOZ7P.js +0 -389
  72. package/dist/chunk-6YLNOZ7P.js.map +0 -1
  73. package/dist/chunk-7AWG6OWF.js +0 -27
  74. package/dist/chunk-7AWG6OWF.js.map +0 -1
  75. package/dist/chunk-ARMW5POL.js +0 -3082
  76. package/dist/chunk-ARMW5POL.js.map +0 -1
  77. package/dist/chunk-B3ILUJ7G.cjs +0 -101
  78. package/dist/chunk-B3ILUJ7G.cjs.map +0 -1
  79. package/dist/chunk-GGM3MDFM.js +0 -32
  80. package/dist/chunk-GGM3MDFM.js.map +0 -1
  81. package/dist/chunk-GZUTUD5O.cjs +0 -2199
  82. package/dist/chunk-GZUTUD5O.cjs.map +0 -1
  83. package/dist/chunk-HXOGJSAI.cjs +0 -3082
  84. package/dist/chunk-HXOGJSAI.cjs.map +0 -1
  85. package/dist/chunk-LTA7IG3J.js +0 -122
  86. package/dist/chunk-LTA7IG3J.js.map +0 -1
  87. package/dist/chunk-NBJPKJBC.cjs +0 -32
  88. package/dist/chunk-NBJPKJBC.cjs.map +0 -1
  89. package/dist/chunk-PGYOJ5RB.cjs +0 -27
  90. package/dist/chunk-PGYOJ5RB.cjs.map +0 -1
  91. package/dist/chunk-QHW27RMH.js +0 -199
  92. package/dist/chunk-QHW27RMH.js.map +0 -1
  93. package/dist/chunk-TMC4SUEV.js +0 -368
  94. package/dist/chunk-TMC4SUEV.js.map +0 -1
  95. package/dist/chunk-XQINW7QP.cjs +0 -199
  96. package/dist/chunk-XQINW7QP.cjs.map +0 -1
  97. package/dist/index.cjs.map +0 -1
  98. package/dist/index.css.map +0 -1
  99. package/dist/index.js.map +0 -1
package/LICENSE CHANGED
@@ -1,16 +1,9 @@
1
- MIT License
1
+ Copyright (c) 2025 Aori. All rights reserved.
2
2
 
3
- Copyright (c) 2025 Aori
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
3
+ UNLICENSED — This software and associated documentation files (the "Software")
4
+ are proprietary and confidential. No part of the Software may be reproduced,
5
+ distributed, transmitted, sublicensed, or sold without the prior written
6
+ permission of the copyright holder.
14
7
 
15
8
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
9
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
package/README.md CHANGED
@@ -77,7 +77,15 @@ const config: AoriSwapWidgetConfig = {
77
77
  };
78
78
  ```
79
79
 
80
- ### 2. Render
80
+ ### 2. Import styles
81
+
82
+ ```ts
83
+ import '@aori/mega-swap-widget/styles.css';
84
+ ```
85
+
86
+ Add this import once in your app's entry point (e.g. `_app.tsx`, `layout.tsx`, or `main.tsx`). Without it, the widget will render unstyled.
87
+
88
+ ### 3. Render
81
89
 
82
90
  ```tsx
83
91
  import { SwapWidget } from '@aori/mega-swap-widget';
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+ "use client";var _chunkHTWUZKYOcjs = require('./chunk-HTWUZKYO.cjs');require('./chunk-UZWGYG2S.cjs');require('./chunk-LXEKOQAG.cjs');require('./chunk-34N36GUD.cjs');require('./chunk-T3I3AJXV.cjs');exports.default = _chunkHTWUZKYOcjs.a;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use client";import{a}from"./chunk-4LJJMEOG.js";import"./chunk-726CI6GC.js";import"./chunk-EW2OR6CJ.js";import"./chunk-46H44R7V.js";import"./chunk-73CB2I7U.js";export{a as default};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use client";import{a}from"./chunk-FDQKBTWP.js";import"./chunk-EW2OR6CJ.js";import"./chunk-73CB2I7U.js";export{a as default};
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+ "use client";var _chunkXZRXVBSBcjs = require('./chunk-XZRXVBSB.cjs');require('./chunk-LXEKOQAG.cjs');require('./chunk-T3I3AJXV.cjs');exports.default = _chunkXZRXVBSBcjs.a;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use client";import{a as ne}from"./chunk-4BQRVCQR.js";import{e as oe,g as se,h as f,i as w,j as re,v as ae,w as le}from"./chunk-XYF2YBR3.js";import{a as $}from"./chunk-4LJJMEOG.js";import{a as B}from"./chunk-FDQKBTWP.js";import"./chunk-OPN7WCJR.js";import{c as d,f as ie}from"./chunk-726CI6GC.js";import{b as ee}from"./chunk-EW2OR6CJ.js";import{a as te}from"./chunk-46H44R7V.js";import"./chunk-73CB2I7U.js";import{useCallback as p,useEffect as Fe,useMemo as Me,useRef as Ie,useState as de}from"react";import{useShallow as We}from"zustand/react/shallow";import{Fragment as k,jsx as e,jsxs as r}from"react/jsx-runtime";var P=()=>{},$e=({onSwapComplete:ue,onSwapInitiated:ce,onBackToSwap:h,onMoreChainsClick:Be})=>{let{web3ConnectionType:He,hasConnectHandler:pe,lockBase:O,lockQuote:N,disableInverting:me,swapButtonVariant:q,tokenDisplay:H,tokenBadgeOrientation:x,widgetType:ge,assetMenuVariant:fe}=ee(),Q=H==="pill"||H==="ghost",T=ge==="compact",{baseToken:t,quoteToken:o,baseAmount:i,quoteAmount:u,isBaseGasToken:we,isQuoteGasToken:ve,isWrappingPair:a,isUnwrappingPair:l,baseBalance:g,quoteBalance:Qe,setBaseAmount:R,setQuoteAmount:c,swapTokens:U,clearForm:V}=ie(),{rfqQuote:Ue,status:Ve,handleInputChange:F,ensureForParams:j,stop:je,clear:S,refresh:G}=oe(),{address:m}=te(),{openConnectModal:be}=se(),{isRecipientInputOpen:M,txStatus:z,view:v,selectedChainFilterChainId:D}=d(We(n=>({isRecipientInputOpen:n.isRecipientInputOpen,txStatus:n.txStatus,view:n.view,selectedChainFilterChainId:n.selectedChainFilter?.chainId??null}))),[C,he]=de(null),[y,E]=de(null),xe=Ie(!1),s=!1,Se=Me(()=>!t||!o||typeof i!="number"||!u||!m||parseFloat(g.formatted)<i?null:{base:t,quote:o,baseAmount:i,quoteAmount:u,userAddress:m},[t,o,i,u,m,g.formatted]),Ce=p(n=>{E(n),d.getState().startTracking(n)},[]),ye=p(()=>{xe.current=!0,G()},[G]);Fe(()=>{if(C===null&&!(!t||!o)){if(!i||i<=0){F({amount:null,inputToken:t,outputToken:o,setOutputAmount:c});return}if(a||l){c(i);return}F({amount:i,inputToken:t,outputToken:o,setOutputAmount:c})}},[C,i,t,o,a,l,F,c]);let I=p(()=>{d.getState().setView("baseSelection")},[]),W=p(()=>{d.getState().setView("quoteSelection")},[]),Ae=p(()=>{U(),c(null)},[U,c]),Pe=p(()=>{if(!g.formatted||!t||!o)return;let n=parseFloat(g.formatted);if(!n||n<=0)return;let b=n*.9999999999;a||l?(R(b),c(b),S()):(R(b),c(null),j({inputToken:t,outputToken:o,inputAmount:b.toString(),setOutputAmount:A=>c(A)}))},[g.formatted,t,o,a,l,R,c,S,j]),ke=p(()=>{S(),V()},[S,V]),_=g.formatted?parseFloat(g.formatted):null,Oe=!!(i||u),L=fe==="split",J=L&&(v==="baseSelection"||v==="baseChainSelection"),K=L&&(v==="quoteSelection"||v==="quoteChainSelection"),X=p(n=>{let A=d.getState().view==="baseChainSelection"?"base":"quote";d.getState().setChainFilter({chainId:n,side:A}),d.getState().pushRecentChain(n),d.getState().transitionToView(A==="base"?"baseSelection":"quoteSelection","chainSelection")},[]),Ne=p(()=>{d.getState().transitionToView("baseChainSelection","chainSelection")},[]),qe=p(()=>{d.getState().transitionToView("quoteChainSelection","chainSelection")},[]),Te=t?.price&&i?`$${(t.price*i).toFixed(2)}`:"$0.00",Re=o?.price&&u?`$${(o.price*u).toFixed(2)}`:"$0.00",Y=C==="trackingTx"&&!!y&&!!t&&!!o&&!!i&&!!u,Z={backgroundColor:q==="default"?"var(--widget-primary)":"transparent",color:q==="default"?"var(--widget-primary-foreground)":"var(--widget-primary)",border:q!=="default"?"1px solid var(--widget-primary)":"none",borderRadius:"var(--widget-radius)"};return r("div",{className:"flex flex-col w-full",children:[Y&&y&&t&&o&&i&&u?e("div",{className:"flex-1 min-h-0 overflow-hidden",children:e(le,{orderHash:y,base:t,quote:o,baseAmount:i,quoteAmount:u,status:z})}):r("div",{className:`grid grid-cols-[1fr_auto_1fr] items-stretch px-4 ${T?"pt-3 pb-1":"pt-4 pb-2"} gap-2`,children:[e("div",{className:`relative flex flex-col gap-1 p-3 rounded-lg overflow-hidden ${J?"h-[380px]":""}`,style:{border:"1px solid var(--widget-border)",backgroundColor:"var(--widget-card)"},children:J?v==="baseChainSelection"?e(B,{toggle:h??P,side:"base",onChainSelect:X}):e($,{toggle:h??P,side:"base",otherAsset:o,onMoreChainsClick:Ne,selectedChainFilter:D}):r(k,{children:[Q?T?r("div",{className:`flex items-center gap-2 ${x==="right"?"flex-row-reverse":"flex-row"}`,children:[e(w,{toggle:I,side:"base",asset:t,isPlacingOrder:s||O}),e("div",{className:"flex-1 min-w-0",children:e(f,{side:"base",asset:t??null,otherAsset:o??null,isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})})]}):r("div",{className:`flex flex-col ${x==="right"?"items-end":"items-start"}`,children:[e(w,{toggle:I,side:"base",asset:t,isPlacingOrder:s||O}),e(f,{side:"base",asset:t??null,otherAsset:o??null,isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})]}):r(k,{children:[e(w,{toggle:I,side:"base",asset:t,isPlacingOrder:s||O}),e(f,{side:"base",asset:t??null,otherAsset:o??null,isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})]}),r("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono text-xs",style:{color:"var(--widget-muted-foreground)"},children:Te}),m&&_!==null&&_>0&&e("button",{type:"button",onClick:Pe,disabled:s,className:"flex items-center rounded-full px-2 py-0.5 text-xs font-medium uppercase cursor-pointer disabled:opacity-40 transition-colors bg-(--widget-primary) text-(--widget-primary-foreground) hover:bg-(--widget-foreground) hover:text-(--widget-card)",children:"Max"})]})]})}),e("div",{className:"flex items-center justify-center px-1",children:me?e("div",{className:"flex h-8 w-8 items-center justify-center opacity-20",children:e("span",{className:"text-sm",style:{color:"var(--widget-muted-foreground)"},children:"\u2192"})}):e("button",{type:"button",onClick:Ae,"aria-label":"Swap input and output tokens",className:"flex h-8 w-8 items-center justify-center rounded-full cursor-pointer transition-colors bg-(--widget-card) text-(--widget-muted-foreground) hover:bg-(--widget-secondary) hover:text-(--widget-foreground)",style:{border:"1px solid var(--widget-border)"},children:e("span",{className:"text-2xs",children:"\u2194"})})}),e("div",{className:`relative flex flex-col gap-1 p-3 rounded-lg overflow-hidden ${K?"h-[380px]":""}`,style:{border:"1px solid var(--widget-border)",backgroundColor:"var(--widget-card)"},children:K?v==="quoteChainSelection"?e(B,{toggle:h??P,side:"quote",onChainSelect:X}):e($,{toggle:h??P,side:"quote",otherAsset:t,onMoreChainsClick:qe,selectedChainFilter:D}):r(k,{children:[Q?T?r("div",{className:`flex items-center gap-2 ${x==="right"?"flex-row-reverse":"flex-row"}`,children:[e(w,{toggle:W,side:"quote",asset:o,isPlacingOrder:s||N}),e("div",{className:"flex-1 min-w-0",children:e(f,{side:"quote",asset:o??null,otherAsset:t??null,isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})})]}):r("div",{className:`flex flex-col ${x==="right"?"items-end":"items-start"}`,children:[e(w,{toggle:W,side:"quote",asset:o,isPlacingOrder:s||N}),e(f,{side:"quote",asset:o??null,otherAsset:t??null,isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})]}):r(k,{children:[e(w,{toggle:W,side:"quote",asset:o,isPlacingOrder:s||N}),e(f,{side:"quote",asset:o??null,otherAsset:t??null,isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})]}),r("div",{className:"flex items-center justify-between",children:[e("span",{className:"mono text-xs",style:{color:"var(--widget-muted-foreground)"},children:Re}),Oe&&e("button",{type:"button",onClick:ke,disabled:s,className:"flex items-center rounded-full px-2 py-0.5 text-xs font-medium uppercase cursor-pointer disabled:opacity-40 transition-colors text-(--widget-muted-foreground) hover:bg-(--widget-secondary)",children:"Clear"})]})]})})]}),e("div",{className:"flex flex-row items-center w-full overflow-hidden px-4",style:{borderTop:M?"1px solid var(--widget-border)":"none",maxHeight:M?"60px":"0px",opacity:M?1:0,transition:"max-height 0.3s ease, opacity 0.3s ease"},children:e(re,{})}),e("div",{className:"px-4",style:{borderTop:"1px solid var(--widget-border)",borderBottom:"1px solid var(--widget-border)"},children:e(ne,{})}),e("div",{className:`relative ${Y?"px-0":"px-4"} py-4`,children:m&&t&&o&&i&&i>0?e(ae,{base:t,baseAmount:i,quote:o,quoteAmount:u??0,userAddress:m,isWrappingPair:a,isUnwrappingPair:l,isBaseGasToken:we,isQuoteGasToken:ve,reviewActionProps:Se,reviewState:C,setReviewState:he,trackedOrderHash:y,setTrackedOrderHash:E,onSwapComplete:ue,onSwapInitiated:ce,onOrderSubmitted:Ce,onStaleQuoteRestart:ye,txStatus:z}):!m&&pe?e("button",{onClick:()=>be(),className:"w-full py-3 text-sm font-medium cursor-pointer transition-opacity hover:opacity-80",style:Z,children:"Connect Wallet"}):e("button",{disabled:!0,className:"w-full py-3 text-sm font-medium transition-colors disabled:opacity-40 cursor-not-allowed",style:Z,children:m?"Enter Amount":"Connect Wallet"})})]})},rt=$e;export{rt as default};
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+ "use client";var _chunkDUIRZSBVcjs = require('./chunk-DUIRZSBV.cjs');var _chunkMCT3UZTPcjs = require('./chunk-MCT3UZTP.cjs');var _chunkHTWUZKYOcjs = require('./chunk-HTWUZKYO.cjs');var _chunkXZRXVBSBcjs = require('./chunk-XZRXVBSB.cjs');require('./chunk-KH57FLST.cjs');var _chunkUZWGYG2Scjs = require('./chunk-UZWGYG2S.cjs');var _chunkLXEKOQAGcjs = require('./chunk-LXEKOQAG.cjs');var _chunk34N36GUDcjs = require('./chunk-34N36GUD.cjs');require('./chunk-T3I3AJXV.cjs');var _react = require('react');var _shallow = require('zustand/react/shallow');var _jsxruntime = require('react/jsx-runtime');var P=()=>{},$e=({onSwapComplete:ue,onSwapInitiated:ce,onBackToSwap:h,onMoreChainsClick:Be})=>{let{web3ConnectionType:He,hasConnectHandler:pe,lockBase:O,lockQuote:N,disableInverting:me,swapButtonVariant:q,tokenDisplay:H,tokenBadgeOrientation:x,widgetType:ge,assetMenuVariant:fe}=_chunkLXEKOQAGcjs.b.call(void 0, ),Q=H==="pill"||H==="ghost",T=ge==="compact",{baseToken:t,quoteToken:o,baseAmount:i,quoteAmount:u,isBaseGasToken:we,isQuoteGasToken:ve,isWrappingPair:a,isUnwrappingPair:l,baseBalance:g,quoteBalance:Qe,setBaseAmount:R,setQuoteAmount:c,swapTokens:U,clearForm:V}=_chunkUZWGYG2Scjs.f.call(void 0, ),{rfqQuote:Ue,status:Ve,handleInputChange:F,ensureForParams:j,stop:je,clear:S,refresh:G}=_chunkMCT3UZTPcjs.e.call(void 0, ),{address:m}=_chunk34N36GUDcjs.a.call(void 0, ),{openConnectModal:be}=_chunkMCT3UZTPcjs.g.call(void 0, ),{isRecipientInputOpen:M,txStatus:z,view:v,selectedChainFilterChainId:D}=_chunkUZWGYG2Scjs.c.call(void 0, _shallow.useShallow.call(void 0, n=>({isRecipientInputOpen:n.isRecipientInputOpen,txStatus:n.txStatus,view:n.view,selectedChainFilterChainId:_nullishCoalesce(_optionalChain([n, 'access', _2 => _2.selectedChainFilter, 'optionalAccess', _3 => _3.chainId]), () => (null))}))),[C,he]=_react.useState.call(void 0, null),[y,E]=_react.useState.call(void 0, null),xe=_react.useRef.call(void 0, !1),s=!1,Se=_react.useMemo.call(void 0, ()=>!t||!o||typeof i!="number"||!u||!m||parseFloat(g.formatted)<i?null:{base:t,quote:o,baseAmount:i,quoteAmount:u,userAddress:m},[t,o,i,u,m,g.formatted]),Ce=_react.useCallback.call(void 0, n=>{E(n),_chunkUZWGYG2Scjs.c.getState().startTracking(n)},[]),ye=_react.useCallback.call(void 0, ()=>{xe.current=!0,G()},[G]);_react.useEffect.call(void 0, ()=>{if(C===null&&!(!t||!o)){if(!i||i<=0){F({amount:null,inputToken:t,outputToken:o,setOutputAmount:c});return}if(a||l){c(i);return}F({amount:i,inputToken:t,outputToken:o,setOutputAmount:c})}},[C,i,t,o,a,l,F,c]);let I=_react.useCallback.call(void 0, ()=>{_chunkUZWGYG2Scjs.c.getState().setView("baseSelection")},[]),W=_react.useCallback.call(void 0, ()=>{_chunkUZWGYG2Scjs.c.getState().setView("quoteSelection")},[]),Ae=_react.useCallback.call(void 0, ()=>{U(),c(null)},[U,c]),Pe=_react.useCallback.call(void 0, ()=>{if(!g.formatted||!t||!o)return;let n=parseFloat(g.formatted);if(!n||n<=0)return;let b=n*.9999999999;a||l?(R(b),c(b),S()):(R(b),c(null),j({inputToken:t,outputToken:o,inputAmount:b.toString(),setOutputAmount:A=>c(A)}))},[g.formatted,t,o,a,l,R,c,S,j]),ke=_react.useCallback.call(void 0, ()=>{S(),V()},[S,V]),_=g.formatted?parseFloat(g.formatted):null,Oe=!!(i||u),L=fe==="split",J=L&&(v==="baseSelection"||v==="baseChainSelection"),K=L&&(v==="quoteSelection"||v==="quoteChainSelection"),X=_react.useCallback.call(void 0, n=>{let A=_chunkUZWGYG2Scjs.c.getState().view==="baseChainSelection"?"base":"quote";_chunkUZWGYG2Scjs.c.getState().setChainFilter({chainId:n,side:A}),_chunkUZWGYG2Scjs.c.getState().pushRecentChain(n),_chunkUZWGYG2Scjs.c.getState().transitionToView(A==="base"?"baseSelection":"quoteSelection","chainSelection")},[]),Ne=_react.useCallback.call(void 0, ()=>{_chunkUZWGYG2Scjs.c.getState().transitionToView("baseChainSelection","chainSelection")},[]),qe=_react.useCallback.call(void 0, ()=>{_chunkUZWGYG2Scjs.c.getState().transitionToView("quoteChainSelection","chainSelection")},[]),Te=_optionalChain([t, 'optionalAccess', _4 => _4.price])&&i?`$${(t.price*i).toFixed(2)}`:"$0.00",Re=_optionalChain([o, 'optionalAccess', _5 => _5.price])&&u?`$${(o.price*u).toFixed(2)}`:"$0.00",Y=C==="trackingTx"&&!!y&&!!t&&!!o&&!!i&&!!u,Z={backgroundColor:q==="default"?"var(--widget-primary)":"transparent",color:q==="default"?"var(--widget-primary-foreground)":"var(--widget-primary)",border:q!=="default"?"1px solid var(--widget-primary)":"none",borderRadius:"var(--widget-radius)"};return _jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col w-full",children:[Y&&y&&t&&o&&i&&u?_jsxruntime.jsx.call(void 0, "div",{className:"flex-1 min-h-0 overflow-hidden",children:_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.w,{orderHash:y,base:t,quote:o,baseAmount:i,quoteAmount:u,status:z})}):_jsxruntime.jsxs.call(void 0, "div",{className:`grid grid-cols-[1fr_auto_1fr] items-stretch px-4 ${T?"pt-3 pb-1":"pt-4 pb-2"} gap-2`,children:[_jsxruntime.jsx.call(void 0, "div",{className:`relative flex flex-col gap-1 p-3 rounded-lg overflow-hidden ${J?"h-[380px]":""}`,style:{border:"1px solid var(--widget-border)",backgroundColor:"var(--widget-card)"},children:J?v==="baseChainSelection"?_jsxruntime.jsx.call(void 0, _chunkXZRXVBSBcjs.a,{toggle:_nullishCoalesce(h, () => (P)),side:"base",onChainSelect:X}):_jsxruntime.jsx.call(void 0, _chunkHTWUZKYOcjs.a,{toggle:_nullishCoalesce(h, () => (P)),side:"base",otherAsset:o,onMoreChainsClick:Ne,selectedChainFilter:D}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[Q?T?_jsxruntime.jsxs.call(void 0, "div",{className:`flex items-center gap-2 ${x==="right"?"flex-row-reverse":"flex-row"}`,children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:I,side:"base",asset:t,isPlacingOrder:s||O}),_jsxruntime.jsx.call(void 0, "div",{className:"flex-1 min-w-0",children:_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"base",asset:_nullishCoalesce(t, () => (null)),otherAsset:_nullishCoalesce(o, () => (null)),isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})})]}):_jsxruntime.jsxs.call(void 0, "div",{className:`flex flex-col ${x==="right"?"items-end":"items-start"}`,children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:I,side:"base",asset:t,isPlacingOrder:s||O}),_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"base",asset:_nullishCoalesce(t, () => (null)),otherAsset:_nullishCoalesce(o, () => (null)),isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:I,side:"base",asset:t,isPlacingOrder:s||O}),_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"base",asset:_nullishCoalesce(t, () => (null)),otherAsset:_nullishCoalesce(o, () => (null)),isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-between",children:[_jsxruntime.jsx.call(void 0, "span",{className:"mono text-xs",style:{color:"var(--widget-muted-foreground)"},children:Te}),m&&_!==null&&_>0&&_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:Pe,disabled:s,className:"flex items-center rounded-full px-2 py-0.5 text-xs font-medium uppercase cursor-pointer disabled:opacity-40 transition-colors bg-(--widget-primary) text-(--widget-primary-foreground) hover:bg-(--widget-foreground) hover:text-(--widget-card)",children:"Max"})]})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"flex items-center justify-center px-1",children:me?_jsxruntime.jsx.call(void 0, "div",{className:"flex h-8 w-8 items-center justify-center opacity-20",children:_jsxruntime.jsx.call(void 0, "span",{className:"text-sm",style:{color:"var(--widget-muted-foreground)"},children:"\u2192"})}):_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:Ae,"aria-label":"Swap input and output tokens",className:"flex h-8 w-8 items-center justify-center rounded-full cursor-pointer transition-colors bg-(--widget-card) text-(--widget-muted-foreground) hover:bg-(--widget-secondary) hover:text-(--widget-foreground)",style:{border:"1px solid var(--widget-border)"},children:_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs",children:"\u2194"})})}),_jsxruntime.jsx.call(void 0, "div",{className:`relative flex flex-col gap-1 p-3 rounded-lg overflow-hidden ${K?"h-[380px]":""}`,style:{border:"1px solid var(--widget-border)",backgroundColor:"var(--widget-card)"},children:K?v==="quoteChainSelection"?_jsxruntime.jsx.call(void 0, _chunkXZRXVBSBcjs.a,{toggle:_nullishCoalesce(h, () => (P)),side:"quote",onChainSelect:X}):_jsxruntime.jsx.call(void 0, _chunkHTWUZKYOcjs.a,{toggle:_nullishCoalesce(h, () => (P)),side:"quote",otherAsset:t,onMoreChainsClick:qe,selectedChainFilter:D}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[Q?T?_jsxruntime.jsxs.call(void 0, "div",{className:`flex items-center gap-2 ${x==="right"?"flex-row-reverse":"flex-row"}`,children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:W,side:"quote",asset:o,isPlacingOrder:s||N}),_jsxruntime.jsx.call(void 0, "div",{className:"flex-1 min-w-0",children:_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"quote",asset:_nullishCoalesce(o, () => (null)),otherAsset:_nullishCoalesce(t, () => (null)),isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})})]}):_jsxruntime.jsxs.call(void 0, "div",{className:`flex flex-col ${x==="right"?"items-end":"items-start"}`,children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:W,side:"quote",asset:o,isPlacingOrder:s||N}),_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"quote",asset:_nullishCoalesce(o, () => (null)),otherAsset:_nullishCoalesce(t, () => (null)),isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:W,side:"quote",asset:o,isPlacingOrder:s||N}),_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"quote",asset:_nullishCoalesce(o, () => (null)),otherAsset:_nullishCoalesce(t, () => (null)),isPlacingOrder:s,isWrappingPair:a,isUnwrappingPair:l})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-between",children:[_jsxruntime.jsx.call(void 0, "span",{className:"mono text-xs",style:{color:"var(--widget-muted-foreground)"},children:Re}),Oe&&_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:ke,disabled:s,className:"flex items-center rounded-full px-2 py-0.5 text-xs font-medium uppercase cursor-pointer disabled:opacity-40 transition-colors text-(--widget-muted-foreground) hover:bg-(--widget-secondary)",children:"Clear"})]})]})})]}),_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-row items-center w-full overflow-hidden px-4",style:{borderTop:M?"1px solid var(--widget-border)":"none",maxHeight:M?"60px":"0px",opacity:M?1:0,transition:"max-height 0.3s ease, opacity 0.3s ease"},children:_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.j,{})}),_jsxruntime.jsx.call(void 0, "div",{className:"px-4",style:{borderTop:"1px solid var(--widget-border)",borderBottom:"1px solid var(--widget-border)"},children:_jsxruntime.jsx.call(void 0, _chunkDUIRZSBVcjs.a,{})}),_jsxruntime.jsx.call(void 0, "div",{className:`relative ${Y?"px-0":"px-4"} py-4`,children:m&&t&&o&&i&&i>0?_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.v,{base:t,baseAmount:i,quote:o,quoteAmount:_nullishCoalesce(u, () => (0)),userAddress:m,isWrappingPair:a,isUnwrappingPair:l,isBaseGasToken:we,isQuoteGasToken:ve,reviewActionProps:Se,reviewState:C,setReviewState:he,trackedOrderHash:y,setTrackedOrderHash:E,onSwapComplete:ue,onSwapInitiated:ce,onOrderSubmitted:Ce,onStaleQuoteRestart:ye,txStatus:z}):!m&&pe?_jsxruntime.jsx.call(void 0, "button",{onClick:()=>be(),className:"w-full py-3 text-sm font-medium cursor-pointer transition-opacity hover:opacity-80",style:Z,children:"Connect Wallet"}):_jsxruntime.jsx.call(void 0, "button",{disabled:!0,className:"w-full py-3 text-sm font-medium transition-colors disabled:opacity-40 cursor-not-allowed",style:Z,children:m?"Enter Amount":"Connect Wallet"})})]})},rt= exports.default =$e;exports.default = rt;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use client";import{e as ae,g as ne,h as b,i as h,j as re,v as le,w as de}from"./chunk-XYF2YBR3.js";import{a as ce}from"./chunk-4LJJMEOG.js";import{a as ue}from"./chunk-FDQKBTWP.js";import"./chunk-OPN7WCJR.js";import{c as l,f as ie}from"./chunk-726CI6GC.js";import{P as U,X as se,b as te}from"./chunk-EW2OR6CJ.js";import{a as oe}from"./chunk-46H44R7V.js";import"./chunk-73CB2I7U.js";import{useCallback as f,useEffect as pe,useMemo as Ge,useRef as me,useState as V}from"react";import{useShallow as Le}from"zustand/react/shallow";import{Fragment as P,jsx as e,jsxs as t}from"react/jsx-runtime";var ge=()=>{},_e=({onSwapComplete:fe,onSwapInitiated:xe,onBackToSwap:H,onMoreChainsClick:Je})=>{let{web3ConnectionType:Ke,hasConnectHandler:ve,lockBase:O,lockQuote:T,disableInverting:we,swapButtonVariant:q,tokenDisplay:j,tokenBadgeOrientation:y,widgetType:be,assetMenuVariant:he}=te(),E=j==="pill"||j==="ghost",N=be==="compact",{baseToken:d,quoteToken:c,baseAmount:a,quoteAmount:n,isBaseGasToken:Se,isQuoteGasToken:ye,isWrappingPair:u,isUnwrappingPair:p,baseBalance:w,setBaseAmount:R,setQuoteAmount:g,swapTokens:D,clearForm:z}=ie(),{handleInputChange:F,ensureForParams:G,clear:C,refresh:L,liquidityError:Ne,routingError:Ce}=ae(),{address:x}=oe(),{openConnectModal:ke}=ne(),{isRecipientInputOpen:I,txStatus:_,view:v,selectedChainFilterChainId:Ae}=l(Le(i=>({isRecipientInputOpen:i.isRecipientInputOpen,txStatus:i.txStatus,view:i.view,selectedChainFilterChainId:i.selectedChainFilterChainId??null}))),[k,Pe]=V(null),[A,J]=V(null),Oe=me(!1),r=!1,Te=Ge(()=>!d||!c||typeof a!="number"||!n||!x||parseFloat(w.formatted)<a?null:{base:d,quote:c,baseAmount:a,quoteAmount:n,userAddress:x},[d,c,a,n,x,w.formatted]),qe=f(i=>{J(i),l.getState().startTracking(i)},[]),Re=f(()=>{Oe.current=!0,L()},[L]);pe(()=>{if(k===null&&!(!d||!c)){if(!a||a<=0){F({amount:null,inputToken:d,outputToken:c,setOutputAmount:g});return}if(u||p){g(a);return}F({amount:a,inputToken:d,outputToken:c,setOutputAmount:g})}},[k,a,d,c,u,p,F,g]);let K=a&&n&&parseFloat(n.toString())?parseFloat(a.toString())/parseFloat(n.toString()):0,M=f(()=>{l.getState().setView("baseSelection")},[]),$=f(()=>{l.getState().setView("quoteSelection")},[]),Fe=f(()=>{D(),g(null)},[D,g]),Ie=f(()=>{if(!w.formatted||!d||!c)return;let i=parseFloat(w.formatted);if(!i||i<=0)return;let m=i*.9999999999;u||p?(R(m),g(m),C()):(R(m),g(null),G({inputToken:d,outputToken:c,inputAmount:m.toString(),setOutputAmount:S=>g(S)}))},[w.formatted,d,c,u,p,R,g,C,G]),Me=f(()=>{C(),z()},[C,z]),X=w.formatted?parseFloat(w.formatted):null,$e=!!(a||n),s=d,o=c,We=s?.price&&a?`$${(s.price*a).toFixed(2)}`:"$0.00",Be=o?.price&&n?`$${(o.price*n).toFixed(2)}`:"$0.00",Qe=!!(s&&o&&a&&n),Ue=Ne||Ce,Y=k==="trackingTx"&&!!A&&!!s&&!!o&&!!a&&!!n,W=he==="split",B=W&&(v==="baseSelection"||v==="quoteSelection"||v==="baseChainSelection"||v==="quoteChainSelection"),Q=v==="baseSelection"||v==="baseChainSelection"?"base":"quote",Ve=Q==="base"?o:s,Z=me(null),[He,je]=V(380);pe(()=>{if(!W)return;let i=Z.current;if(!i)return;let m=new ResizeObserver(S=>{for(let ze of S)je(ze.contentRect.height)});return m.observe(i),()=>m.disconnect()},[W]);let Ee=f(i=>{let S=l.getState().view==="baseChainSelection"?"base":"quote";l.getState().setChainFilter({chainId:i,side:S}),l.getState().pushRecentChain(i),l.getState().transitionToView(S==="base"?"baseSelection":"quoteSelection","chainSelection")},[]),De=f(()=>{let i=l.getState().view;i==="baseSelection"?l.getState().transitionToView("baseChainSelection","chainSelection"):i==="quoteSelection"&&l.getState().transitionToView("quoteChainSelection","chainSelection")},[]),ee={backgroundColor:q==="default"?"var(--widget-primary)":"transparent",color:q==="default"?"var(--widget-primary-foreground)":"var(--widget-primary)",border:q!=="default"?"1px solid var(--widget-primary)":"none",borderRadius:"var(--widget-radius)"};return t("div",{className:"flex flex-row w-full",children:[t("div",{ref:Z,className:"flex flex-col flex-1 min-w-0",style:{borderRight:"1px solid var(--widget-border)"},children:[Y&&A&&s&&o&&a&&n?e("div",{className:"flex-1 min-h-0 overflow-hidden",children:e(de,{orderHash:A,base:s,quote:o,baseAmount:a,quoteAmount:n,status:_})}):t(P,{children:[t("div",{className:`relative ${N?"px-4 pt-3 pb-1":"px-4 pt-4 pb-2"}`,style:{borderBottom:"1px solid var(--widget-border)"},children:[E?N?t("div",{className:`flex items-center gap-2 ${y==="right"?"flex-row-reverse":"flex-row"}`,children:[e(h,{toggle:M,side:"base",asset:s,isPlacingOrder:r||O}),e("div",{className:"flex-1 min-w-0",children:e(b,{side:"base",asset:s??null,otherAsset:o??null,isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})})]}):t("div",{className:`flex flex-col ${y==="right"?"items-end":"items-start"}`,children:[e(h,{toggle:M,side:"base",asset:s,isPlacingOrder:r||O}),e(b,{side:"base",asset:s??null,otherAsset:o??null,isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})]}):t(P,{children:[e(h,{toggle:M,side:"base",asset:s,isPlacingOrder:r||O}),e(b,{side:"base",asset:s??null,otherAsset:o??null,isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})]}),t("div",{className:"mb-1 flex w-full flex-row items-center justify-between",children:[e("p",{className:"mono text-sm",style:{color:"var(--widget-muted-foreground)"},children:We}),x&&X!==null&&X>0&&e("button",{type:"button",onClick:Ie,disabled:r,className:"absolute bottom-3 right-4 flex items-center rounded-full px-3 py-0.5 text-xs font-medium uppercase cursor-pointer disabled:opacity-40 bg-(--widget-primary) text-(--widget-primary-foreground) hover:bg-(--widget-foreground) hover:text-(--widget-card) transition-colors",children:"Max"})]})]}),!we&&e("div",{className:"flex justify-center -my-4 relative z-10",children:t("button",{type:"button",onClick:Fe,"aria-label":"Swap input and output tokens",className:"flex h-8 w-8 items-center justify-center rounded-full cursor-pointer bg-(--widget-card) text-(--widget-muted-foreground) hover:bg-(--widget-secondary) hover:text-(--widget-foreground) transition-colors",style:{border:"1px solid var(--widget-border)"},children:[e("span",{className:"text-2xs",children:"\u2191"}),e("span",{className:"text-2xs",children:"\u2193"})]})}),t("div",{className:`relative ${N?"px-4 pt-4 pb-1":"px-4 pt-6 pb-2"}`,children:[E?N?t("div",{className:`flex items-center gap-2 ${y==="right"?"flex-row-reverse":"flex-row"}`,children:[e(h,{toggle:$,side:"quote",asset:o,isPlacingOrder:r||T}),e("div",{className:"flex-1 min-w-0",children:e(b,{side:"quote",asset:o??null,otherAsset:s??null,isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})})]}):t("div",{className:`flex flex-col ${y==="right"?"items-end":"items-start"}`,children:[e(h,{toggle:$,side:"quote",asset:o,isPlacingOrder:r||T}),e(b,{side:"quote",asset:o??null,otherAsset:s??null,isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})]}):t(P,{children:[e(h,{toggle:$,side:"quote",asset:o,isPlacingOrder:r||T}),e(b,{side:"quote",asset:o??null,otherAsset:s??null,isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})]}),t("div",{className:"flex w-full flex-row items-center justify-between",children:[e("p",{className:"mono text-sm",style:{color:"var(--widget-muted-foreground)"},children:Be}),$e&&e("button",{type:"button",onClick:Me,disabled:r,className:"absolute bottom-2 right-4 flex items-center rounded-full px-3 py-0.5 text-xs font-medium uppercase cursor-pointer disabled:opacity-40 text-(--widget-muted-foreground) hover:bg-(--widget-secondary) transition-colors",children:"Clear"})]})]})]}),e("div",{className:"flex flex-row items-center w-full overflow-hidden",style:{borderTop:I?"1px solid var(--widget-border)":"none",maxHeight:I?"60px":"0px",opacity:I?1:0,transition:"max-height 0.3s ease, opacity 0.3s ease"},children:e(re,{})}),e("div",{className:`relative ${Y?"px-0":"px-4"} py-4`,children:x&&s&&o&&a&&a>0?e(le,{base:s,baseAmount:a,quote:o,quoteAmount:n??0,userAddress:x,isWrappingPair:u,isUnwrappingPair:p,isBaseGasToken:Se,isQuoteGasToken:ye,reviewActionProps:Te,reviewState:k,setReviewState:Pe,trackedOrderHash:A,setTrackedOrderHash:J,onSwapComplete:fe,onSwapInitiated:xe,onOrderSubmitted:qe,onStaleQuoteRestart:Re,txStatus:_}):!x&&ve?e("button",{onClick:()=>ke(),className:"w-full py-3 text-sm font-medium cursor-pointer transition-opacity hover:opacity-80",style:ee,children:"Connect Wallet"}):e("button",{disabled:!0,className:"w-full py-3 text-sm font-medium transition-colors disabled:opacity-40 cursor-not-allowed",style:ee,children:x?"Enter Amount":"Connect Wallet"})})]}),e("div",{className:`flex flex-col transition-all duration-300 ${B?"flex-1 min-w-0":"w-48 shrink-0"}`,style:{backgroundColor:"var(--widget-background)",...B?{height:`${He}px`}:{}},children:B?e("div",{className:"flex flex-col overflow-hidden p-2",style:{height:"100%"},children:v==="baseChainSelection"||v==="quoteChainSelection"?e(ue,{toggle:H??ge,side:Q,onChainSelect:Ee}):e(ce,{toggle:H??ge,side:Q,otherAsset:Ve,onMoreChainsClick:De,selectedChainFilter:Ae})}):t("div",{className:"flex flex-col gap-3 px-4 py-4",children:[e("span",{className:"text-2xs uppercase tracking-wider font-medium",style:{color:"var(--widget-muted-foreground)"},children:"Quote Details"}),Qe&&s&&o?t(P,{children:[t("div",{className:"flex flex-col gap-0.5",children:[e("span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:"Rate"}),t("div",{className:"flex items-center gap-1",children:[e(U,{asset:o,size:"3xs",noChain:!0}),t("span",{className:"font-mono text-xs uppercase",children:["1 ",o.symbol]})]}),e("div",{className:"flex items-center gap-1 pl-4",children:t("span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:["= ",K.toFixed(6)]})}),t("div",{className:"flex items-center gap-1 pl-4",children:[e(U,{asset:s,size:"3xs",noChain:!0}),e("span",{className:"font-mono text-xs uppercase",children:s.symbol})]})]}),t("div",{className:"flex flex-col gap-2",style:{borderTop:"1px solid var(--widget-border)",paddingTop:"0.5rem"},children:[t("div",{className:"flex justify-between items-center",children:[e("span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:"USD Value"}),t("span",{className:"font-mono text-xs",children:["$",s.price?(s.price*K*parseFloat(n.toString())).toFixed(2):"\u2014"]})]}),t("div",{className:"flex justify-between items-center",children:[e("span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:"Order Type"}),e("span",{className:"text-2xs font-mono",style:{color:"var(--widget-foreground)"},children:"RFQ"})]}),t("div",{className:"flex justify-between items-center",children:[e("span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:"Fill"}),e("span",{className:"text-2xs",style:{color:"var(--widget-primary)"},children:"Exact"})]}),s.chainId!==o.chainId&&t("div",{className:"flex justify-between items-center",children:[e("span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:"Route"}),e("span",{className:"text-2xs font-mono",children:"Cross-chain"})]})]})]}):Ue?t("div",{className:"flex flex-col gap-1",children:[e(se,{className:"h-6 w-6",style:{color:"var(--widget-destructive)"}}),e("span",{className:"text-2xs",style:{color:"var(--widget-destructive)"},children:"Quote not found"})]}):t("div",{className:"flex flex-col gap-2 mt-2",children:[[...Array(4)].map((i,m)=>e("div",{className:"h-3 rounded animate-pulse",style:{backgroundColor:"var(--widget-muted)",width:m%2===0?"80%":"60%",opacity:.5}},m)),e("span",{className:"text-2xs mt-1",style:{color:"var(--widget-muted-foreground)",opacity:.5},children:"Enter an amount"})]})]})})]})},gt=_e;export{gt as default};
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+ "use client";var _chunkMCT3UZTPcjs = require('./chunk-MCT3UZTP.cjs');var _chunkHTWUZKYOcjs = require('./chunk-HTWUZKYO.cjs');var _chunkXZRXVBSBcjs = require('./chunk-XZRXVBSB.cjs');require('./chunk-KH57FLST.cjs');var _chunkUZWGYG2Scjs = require('./chunk-UZWGYG2S.cjs');var _chunkLXEKOQAGcjs = require('./chunk-LXEKOQAG.cjs');var _chunk34N36GUDcjs = require('./chunk-34N36GUD.cjs');require('./chunk-T3I3AJXV.cjs');var _react = require('react');var _shallow = require('zustand/react/shallow');var _jsxruntime = require('react/jsx-runtime');var ge=()=>{},_e=({onSwapComplete:fe,onSwapInitiated:xe,onBackToSwap:H,onMoreChainsClick:Je})=>{let{web3ConnectionType:Ke,hasConnectHandler:ve,lockBase:O,lockQuote:T,disableInverting:we,swapButtonVariant:q,tokenDisplay:j,tokenBadgeOrientation:y,widgetType:be,assetMenuVariant:he}=_chunkLXEKOQAGcjs.b.call(void 0, ),E=j==="pill"||j==="ghost",N=be==="compact",{baseToken:d,quoteToken:c,baseAmount:a,quoteAmount:n,isBaseGasToken:Se,isQuoteGasToken:ye,isWrappingPair:u,isUnwrappingPair:p,baseBalance:w,setBaseAmount:R,setQuoteAmount:g,swapTokens:D,clearForm:z}=_chunkUZWGYG2Scjs.f.call(void 0, ),{handleInputChange:F,ensureForParams:G,clear:C,refresh:L,liquidityError:Ne,routingError:Ce}=_chunkMCT3UZTPcjs.e.call(void 0, ),{address:x}=_chunk34N36GUDcjs.a.call(void 0, ),{openConnectModal:ke}=_chunkMCT3UZTPcjs.g.call(void 0, ),{isRecipientInputOpen:I,txStatus:_,view:v,selectedChainFilterChainId:Ae}=_chunkUZWGYG2Scjs.c.call(void 0, _shallow.useShallow.call(void 0, i=>({isRecipientInputOpen:i.isRecipientInputOpen,txStatus:i.txStatus,view:i.view,selectedChainFilterChainId:_nullishCoalesce(i.selectedChainFilterChainId, () => (null))}))),[k,Pe]=_react.useState.call(void 0, null),[A,J]=_react.useState.call(void 0, null),Oe=_react.useRef.call(void 0, !1),r=!1,Te=_react.useMemo.call(void 0, ()=>!d||!c||typeof a!="number"||!n||!x||parseFloat(w.formatted)<a?null:{base:d,quote:c,baseAmount:a,quoteAmount:n,userAddress:x},[d,c,a,n,x,w.formatted]),qe=_react.useCallback.call(void 0, i=>{J(i),_chunkUZWGYG2Scjs.c.getState().startTracking(i)},[]),Re=_react.useCallback.call(void 0, ()=>{Oe.current=!0,L()},[L]);_react.useEffect.call(void 0, ()=>{if(k===null&&!(!d||!c)){if(!a||a<=0){F({amount:null,inputToken:d,outputToken:c,setOutputAmount:g});return}if(u||p){g(a);return}F({amount:a,inputToken:d,outputToken:c,setOutputAmount:g})}},[k,a,d,c,u,p,F,g]);let K=a&&n&&parseFloat(n.toString())?parseFloat(a.toString())/parseFloat(n.toString()):0,M=_react.useCallback.call(void 0, ()=>{_chunkUZWGYG2Scjs.c.getState().setView("baseSelection")},[]),$=_react.useCallback.call(void 0, ()=>{_chunkUZWGYG2Scjs.c.getState().setView("quoteSelection")},[]),Fe=_react.useCallback.call(void 0, ()=>{D(),g(null)},[D,g]),Ie=_react.useCallback.call(void 0, ()=>{if(!w.formatted||!d||!c)return;let i=parseFloat(w.formatted);if(!i||i<=0)return;let m=i*.9999999999;u||p?(R(m),g(m),C()):(R(m),g(null),G({inputToken:d,outputToken:c,inputAmount:m.toString(),setOutputAmount:S=>g(S)}))},[w.formatted,d,c,u,p,R,g,C,G]),Me=_react.useCallback.call(void 0, ()=>{C(),z()},[C,z]),X=w.formatted?parseFloat(w.formatted):null,$e=!!(a||n),s=d,o=c,We=_optionalChain([s, 'optionalAccess', _2 => _2.price])&&a?`$${(s.price*a).toFixed(2)}`:"$0.00",Be=_optionalChain([o, 'optionalAccess', _3 => _3.price])&&n?`$${(o.price*n).toFixed(2)}`:"$0.00",Qe=!!(s&&o&&a&&n),Ue=Ne||Ce,Y=k==="trackingTx"&&!!A&&!!s&&!!o&&!!a&&!!n,W=he==="split",B=W&&(v==="baseSelection"||v==="quoteSelection"||v==="baseChainSelection"||v==="quoteChainSelection"),Q=v==="baseSelection"||v==="baseChainSelection"?"base":"quote",Ve=Q==="base"?o:s,Z=_react.useRef.call(void 0, null),[He,je]=_react.useState.call(void 0, 380);_react.useEffect.call(void 0, ()=>{if(!W)return;let i=Z.current;if(!i)return;let m=new ResizeObserver(S=>{for(let ze of S)je(ze.contentRect.height)});return m.observe(i),()=>m.disconnect()},[W]);let Ee=_react.useCallback.call(void 0, i=>{let S=_chunkUZWGYG2Scjs.c.getState().view==="baseChainSelection"?"base":"quote";_chunkUZWGYG2Scjs.c.getState().setChainFilter({chainId:i,side:S}),_chunkUZWGYG2Scjs.c.getState().pushRecentChain(i),_chunkUZWGYG2Scjs.c.getState().transitionToView(S==="base"?"baseSelection":"quoteSelection","chainSelection")},[]),De=_react.useCallback.call(void 0, ()=>{let i=_chunkUZWGYG2Scjs.c.getState().view;i==="baseSelection"?_chunkUZWGYG2Scjs.c.getState().transitionToView("baseChainSelection","chainSelection"):i==="quoteSelection"&&_chunkUZWGYG2Scjs.c.getState().transitionToView("quoteChainSelection","chainSelection")},[]),ee={backgroundColor:q==="default"?"var(--widget-primary)":"transparent",color:q==="default"?"var(--widget-primary-foreground)":"var(--widget-primary)",border:q!=="default"?"1px solid var(--widget-primary)":"none",borderRadius:"var(--widget-radius)"};return _jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-row w-full",children:[_jsxruntime.jsxs.call(void 0, "div",{ref:Z,className:"flex flex-col flex-1 min-w-0",style:{borderRight:"1px solid var(--widget-border)"},children:[Y&&A&&s&&o&&a&&n?_jsxruntime.jsx.call(void 0, "div",{className:"flex-1 min-h-0 overflow-hidden",children:_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.w,{orderHash:A,base:s,quote:o,baseAmount:a,quoteAmount:n,status:_})}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:`relative ${N?"px-4 pt-3 pb-1":"px-4 pt-4 pb-2"}`,style:{borderBottom:"1px solid var(--widget-border)"},children:[E?N?_jsxruntime.jsxs.call(void 0, "div",{className:`flex items-center gap-2 ${y==="right"?"flex-row-reverse":"flex-row"}`,children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:M,side:"base",asset:s,isPlacingOrder:r||O}),_jsxruntime.jsx.call(void 0, "div",{className:"flex-1 min-w-0",children:_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"base",asset:_nullishCoalesce(s, () => (null)),otherAsset:_nullishCoalesce(o, () => (null)),isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})})]}):_jsxruntime.jsxs.call(void 0, "div",{className:`flex flex-col ${y==="right"?"items-end":"items-start"}`,children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:M,side:"base",asset:s,isPlacingOrder:r||O}),_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"base",asset:_nullishCoalesce(s, () => (null)),otherAsset:_nullishCoalesce(o, () => (null)),isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:M,side:"base",asset:s,isPlacingOrder:r||O}),_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"base",asset:_nullishCoalesce(s, () => (null)),otherAsset:_nullishCoalesce(o, () => (null)),isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"mb-1 flex w-full flex-row items-center justify-between",children:[_jsxruntime.jsx.call(void 0, "p",{className:"mono text-sm",style:{color:"var(--widget-muted-foreground)"},children:We}),x&&X!==null&&X>0&&_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:Ie,disabled:r,className:"absolute bottom-3 right-4 flex items-center rounded-full px-3 py-0.5 text-xs font-medium uppercase cursor-pointer disabled:opacity-40 bg-(--widget-primary) text-(--widget-primary-foreground) hover:bg-(--widget-foreground) hover:text-(--widget-card) transition-colors",children:"Max"})]})]}),!we&&_jsxruntime.jsx.call(void 0, "div",{className:"flex justify-center -my-4 relative z-10",children:_jsxruntime.jsxs.call(void 0, "button",{type:"button",onClick:Fe,"aria-label":"Swap input and output tokens",className:"flex h-8 w-8 items-center justify-center rounded-full cursor-pointer bg-(--widget-card) text-(--widget-muted-foreground) hover:bg-(--widget-secondary) hover:text-(--widget-foreground) transition-colors",style:{border:"1px solid var(--widget-border)"},children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs",children:"\u2191"}),_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs",children:"\u2193"})]})}),_jsxruntime.jsxs.call(void 0, "div",{className:`relative ${N?"px-4 pt-4 pb-1":"px-4 pt-6 pb-2"}`,children:[E?N?_jsxruntime.jsxs.call(void 0, "div",{className:`flex items-center gap-2 ${y==="right"?"flex-row-reverse":"flex-row"}`,children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:$,side:"quote",asset:o,isPlacingOrder:r||T}),_jsxruntime.jsx.call(void 0, "div",{className:"flex-1 min-w-0",children:_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"quote",asset:_nullishCoalesce(o, () => (null)),otherAsset:_nullishCoalesce(s, () => (null)),isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})})]}):_jsxruntime.jsxs.call(void 0, "div",{className:`flex flex-col ${y==="right"?"items-end":"items-start"}`,children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:$,side:"quote",asset:o,isPlacingOrder:r||T}),_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"quote",asset:_nullishCoalesce(o, () => (null)),otherAsset:_nullishCoalesce(s, () => (null)),isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.i,{toggle:$,side:"quote",asset:o,isPlacingOrder:r||T}),_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.h,{side:"quote",asset:_nullishCoalesce(o, () => (null)),otherAsset:_nullishCoalesce(s, () => (null)),isPlacingOrder:r,isWrappingPair:u,isUnwrappingPair:p})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex w-full flex-row items-center justify-between",children:[_jsxruntime.jsx.call(void 0, "p",{className:"mono text-sm",style:{color:"var(--widget-muted-foreground)"},children:Be}),$e&&_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:Me,disabled:r,className:"absolute bottom-2 right-4 flex items-center rounded-full px-3 py-0.5 text-xs font-medium uppercase cursor-pointer disabled:opacity-40 text-(--widget-muted-foreground) hover:bg-(--widget-secondary) transition-colors",children:"Clear"})]})]})]}),_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-row items-center w-full overflow-hidden",style:{borderTop:I?"1px solid var(--widget-border)":"none",maxHeight:I?"60px":"0px",opacity:I?1:0,transition:"max-height 0.3s ease, opacity 0.3s ease"},children:_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.j,{})}),_jsxruntime.jsx.call(void 0, "div",{className:`relative ${Y?"px-0":"px-4"} py-4`,children:x&&s&&o&&a&&a>0?_jsxruntime.jsx.call(void 0, _chunkMCT3UZTPcjs.v,{base:s,baseAmount:a,quote:o,quoteAmount:_nullishCoalesce(n, () => (0)),userAddress:x,isWrappingPair:u,isUnwrappingPair:p,isBaseGasToken:Se,isQuoteGasToken:ye,reviewActionProps:Te,reviewState:k,setReviewState:Pe,trackedOrderHash:A,setTrackedOrderHash:J,onSwapComplete:fe,onSwapInitiated:xe,onOrderSubmitted:qe,onStaleQuoteRestart:Re,txStatus:_}):!x&&ve?_jsxruntime.jsx.call(void 0, "button",{onClick:()=>ke(),className:"w-full py-3 text-sm font-medium cursor-pointer transition-opacity hover:opacity-80",style:ee,children:"Connect Wallet"}):_jsxruntime.jsx.call(void 0, "button",{disabled:!0,className:"w-full py-3 text-sm font-medium transition-colors disabled:opacity-40 cursor-not-allowed",style:ee,children:x?"Enter Amount":"Connect Wallet"})})]}),_jsxruntime.jsx.call(void 0, "div",{className:`flex flex-col transition-all duration-300 ${B?"flex-1 min-w-0":"w-48 shrink-0"}`,style:{backgroundColor:"var(--widget-background)",...B?{height:`${He}px`}:{}},children:B?_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col overflow-hidden p-2",style:{height:"100%"},children:v==="baseChainSelection"||v==="quoteChainSelection"?_jsxruntime.jsx.call(void 0, _chunkXZRXVBSBcjs.a,{toggle:_nullishCoalesce(H, () => (ge)),side:Q,onChainSelect:Ee}):_jsxruntime.jsx.call(void 0, _chunkHTWUZKYOcjs.a,{toggle:_nullishCoalesce(H, () => (ge)),side:Q,otherAsset:Ve,onMoreChainsClick:De,selectedChainFilter:Ae})}):_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-3 px-4 py-4",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs uppercase tracking-wider font-medium",style:{color:"var(--widget-muted-foreground)"},children:"Quote Details"}),Qe&&s&&o?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-0.5",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:"Rate"}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-1",children:[_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.P,{asset:o,size:"3xs",noChain:!0}),_jsxruntime.jsxs.call(void 0, "span",{className:"font-mono text-xs uppercase",children:["1 ",o.symbol]})]}),_jsxruntime.jsx.call(void 0, "div",{className:"flex items-center gap-1 pl-4",children:_jsxruntime.jsxs.call(void 0, "span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:["= ",K.toFixed(6)]})}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-1 pl-4",children:[_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.P,{asset:s,size:"3xs",noChain:!0}),_jsxruntime.jsx.call(void 0, "span",{className:"font-mono text-xs uppercase",children:s.symbol})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",style:{borderTop:"1px solid var(--widget-border)",paddingTop:"0.5rem"},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex justify-between items-center",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:"USD Value"}),_jsxruntime.jsxs.call(void 0, "span",{className:"font-mono text-xs",children:["$",s.price?(s.price*K*parseFloat(n.toString())).toFixed(2):"\u2014"]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex justify-between items-center",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:"Order Type"}),_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs font-mono",style:{color:"var(--widget-foreground)"},children:"RFQ"})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex justify-between items-center",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:"Fill"}),_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs",style:{color:"var(--widget-primary)"},children:"Exact"})]}),s.chainId!==o.chainId&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex justify-between items-center",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs",style:{color:"var(--widget-muted-foreground)"},children:"Route"}),_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs font-mono",children:"Cross-chain"})]})]})]}):Ue?_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-1",children:[_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.X,{className:"h-6 w-6",style:{color:"var(--widget-destructive)"}}),_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs",style:{color:"var(--widget-destructive)"},children:"Quote not found"})]}):_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2 mt-2",children:[[...Array(4)].map((i,m)=>_jsxruntime.jsx.call(void 0, "div",{className:"h-3 rounded animate-pulse",style:{backgroundColor:"var(--widget-muted)",width:m%2===0?"80%":"60%",opacity:.5}},m)),_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs mt-1",style:{color:"var(--widget-muted-foreground)",opacity:.5},children:"Enter an amount"})]})]})})]})},gt= exports.default =_e;exports.default = gt;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+ "use client";var _chunk34N36GUDcjs = require('./chunk-34N36GUD.cjs');require('./chunk-T3I3AJXV.cjs');var _wagmi = require('wagmi');var _jsxruntime = require('react/jsx-runtime');var i=()=>{let{disconnect:r}=_wagmi.useDisconnect.call(void 0, ),{address:s}=_chunk34N36GUDcjs.a.call(void 0, );return _jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col h-full w-full",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex-1 flex flex-col items-center justify-center p-6 gap-3 text-center",children:[_jsxruntime.jsxs.call(void 0, "svg",{className:"size-8",viewBox:"0 0 24 24",fill:"none",style:{color:"var(--widget-muted-foreground)",opacity:.5},children:[_jsxruntime.jsx.call(void 0, "rect",{x:"2",y:"3",width:"20",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 2"}),_jsxruntime.jsx.call(void 0, "path",{d:"M8 12h8M12 8v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-medium",style:{color:"var(--widget-foreground)"},children:"Your custom components live here"})]}),s&&_jsxruntime.jsx.call(void 0, "div",{className:"px-4 pb-4",children:_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:()=>r(),className:"w-full py-2.5 text-xs font-medium cursor-pointer transition-colors",style:{backgroundColor:"var(--widget-secondary)",color:"var(--widget-secondary-foreground)",borderRadius:"var(--widget-radius)"},children:"Disconnect"})})]})};exports.WalletPlaceholderPanel = i;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use client";import{a as o}from"./chunk-46H44R7V.js";import"./chunk-73CB2I7U.js";import{useDisconnect as l}from"wagmi";import{jsx as e,jsxs as t}from"react/jsx-runtime";var i=()=>{let{disconnect:r}=l(),{address:s}=o();return t("div",{className:"flex flex-col h-full w-full",children:[t("div",{className:"flex-1 flex flex-col items-center justify-center p-6 gap-3 text-center",children:[t("svg",{className:"size-8",viewBox:"0 0 24 24",fill:"none",style:{color:"var(--widget-muted-foreground)",opacity:.5},children:[e("rect",{x:"2",y:"3",width:"20",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 2"}),e("path",{d:"M8 12h8M12 8v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e("p",{className:"text-sm font-medium",style:{color:"var(--widget-foreground)"},children:"Your custom components live here"})]}),s&&e("div",{className:"px-4 pb-4",children:e("button",{type:"button",onClick:()=>r(),className:"w-full py-2.5 text-xs font-medium cursor-pointer transition-colors",style:{backgroundColor:"var(--widget-secondary)",color:"var(--widget-secondary-foreground)",borderRadius:"var(--widget-radius)"},children:"Disconnect"})})]})};export{i as WalletPlaceholderPanel};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ "use client";import{a as ve}from"./chunk-OPN7WCJR.js";import{c as E,f as se}from"./chunk-726CI6GC.js";import{F as Z,H as Q,I as X,L as J,O as Y,P as M,R as ee,S as te,_ as re,b as G,e as V,h as _,k as R,q,r as K}from"./chunk-EW2OR6CJ.js";import{a as B}from"./chunk-46H44R7V.js";import{b as ge}from"./chunk-73CB2I7U.js";import{useCallback as Me,useState as He}from"react";import{useDisconnect as Be}from"wagmi";import{useCallback as ye,useEffect as we,useMemo as D,useRef as he}from"react";function oe(e){let{address:s,isConnected:n}=B(),{chainDataMap:c}=X(),m=re(),{getToken:v,tokenRegistry:f}=Z(),{supportedInputTokens:p,supportedOutputTokens:w}=G(),l=D(()=>{if(!p.length&&!w.length)return[];let t=new Set,o=[];for(let x of[...p,...w]){let S=`${x.chainId}-${x.address.toLowerCase()}`;t.has(S)||(t.add(S),o.push(x))}return o},[p,w]),{balances:u,isLoading:d,isError:i,refetch:h}=J(s,m,{enabled:n&&e&&!!s,refetchOnWindowFocus:!1},l.length>0?l:void 0),L=D(()=>l.length?new Set(l.map(t=>`${t.chainId}-${t.address.toLowerCase()}`)):null,[l]),r=D(()=>!u||u.length===0?{}:u.filter(o=>!o.assetInfo||!o.balance||o.balance==="0"?!1:L?L.has(`${o.chainId}-${o.address.toLowerCase()}`):R(o.assetInfo)||f.length===0?!0:f.some(x=>x.address.toLowerCase()===o.address.toLowerCase()&&x.chainId===o.chainId)).reduce((o,x)=>{let S=String(x.chainId);return o[S]||(o[S]=[]),o[S].push({token:x.address,amount:x.balance,decimals:x.decimals,assetInfo:x.assetInfo}),o},{}),[u,f,L]),k=D(()=>!u||u.length===0?0:u.reduce((t,o)=>!o.assetInfo||o.decimals===void 0?t:t+parseFloat(o.balance)/10**o.decimals*(o.assetInfo.price||0),0),[u]),T=D(()=>m.length===0?{}:m.reduce((t,o)=>{let x=c[o],S=V(o);return t[o.toString()]={chainId:o,name:S?.displayName||x?.chainKey||`Chain ${o}`},t},{}),[m,c]),W=D(()=>f.map(t=>({address:t.address,chainId:t.chainId})),[f]),N=he(null);we(()=>()=>{N.current&&clearTimeout(N.current)},[]);let A=ye(()=>{N.current&&clearTimeout(N.current),N.current=setTimeout(()=>h(),2e3)},[h]);return{address:s,isConnected:n,groupedAssets:r,totalBalance:k,balancesLoading:d,balancesError:i,chains:T,getToken:v,useTokenWithLazyLoad:Q,tokenRegistry:W,refetchBalances:A}}var ae=ge(ve(),1);import{jsx as I,jsxs as $}from"react/jsx-runtime";var ne=({address:e,totalBalance:s,isLoading:n=!1})=>{let c=m=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(m);return I("div",{className:"p-2 w-full flex justify-center",children:$("div",{className:"relative w-full h-[140px] overflow-hidden",style:{borderRadius:"var(--widget-radius)",border:"1px var(--widget-border-style) var(--widget-border)"},children:[$("div",{className:"absolute inset-0 z-0",children:[I("img",{className:"w-full h-full object-cover opacity-60",src:(0,ae.makeGradient)(e),alt:"address gradient"}),I("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent"})]}),$("div",{className:"relative z-10 flex h-full flex-col justify-between p-3",children:[$("div",{children:[I("p",{className:"text-2xs uppercase mono",style:{color:"var(--widget-muted-foreground)",opacity:.7},children:"Token Balance:"}),n?I(te,{className:"h-8 w-28 bg-white/10 rounded mt-1"}):I("p",{className:"text-2xl font-bold mt-0.5",style:{color:"var(--widget-foreground)"},children:c(s)})]}),I("div",{className:"flex items-center",children:I(ee,{text:e,type:"address",children:I("p",{className:"mono text-2xs",style:{color:"var(--widget-foreground)",opacity:.7},children:e})})})]})]})})};import{useCallback as j,useMemo as le,useState as ke}from"react";import{useState as xe}from"react";import{jsx as H,jsxs as U}from"react/jsx-runtime";var ie=({asset:e,balanceAmount:s,balanceDecimals:n,price:c,onSelect:m,getToken:v,useTokenWithLazyLoad:f})=>{let[p,w]=xe(!1),l=n!==void 0?parseFloat(s)/10**n:0,d=f?.(e.chainId,e.address)?.token,i=c??null;return R(e)&&i==null&&(d?.price!=null?i=d.price:v&&(i=v(e.chainId,e.address)?.price??null)),H("div",{role:"button",tabIndex:0,className:"flex h-[52px] w-full flex-row items-center p-3 cursor-pointer transition-colors",style:{borderBottom:"1px var(--widget-border-style) var(--widget-border)",backgroundColor:p?"var(--widget-secondary)":"transparent"},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),onClick:()=>m?.(e),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),m?.(e))},children:U("div",{className:"flex h-full w-full flex-row items-center justify-between",children:[U("div",{className:"flex h-full flex-row items-center gap-2",children:[H(M,{asset:e,size:"sm"}),U("div",{className:"flex flex-col items-start",children:[H("p",{className:"text-sm font-medium uppercase",style:{color:"var(--widget-foreground)"},children:e.symbol}),l>0&&H("p",{className:"mono text-xs",style:{color:"var(--widget-muted-foreground)"},children:l.toFixed(4)})]})]}),H("p",{className:"text-sm font-medium",style:{color:"var(--widget-foreground)"},children:i!=null?`$${(i*l).toFixed(2)}`:"\u2014"})]})})};import{jsx as C,jsxs as z}from"react/jsx-runtime";var be=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2}),Ne=_(),de=({groupedAssets:e,chains:s,tokenRegistry:n=[],getToken:c,useTokenWithLazyLoad:m,onAssetSelect:v})=>{let[f,p]=ke(new Set),w=j(r=>s?.[r]?.name||Ne[r]||`Chain ${r}`,[s]),l=le(()=>{let r=new Set;for(let k of n)r.add(`${k.chainId}-${k.address.toLowerCase()}`);return r},[n]),u=j(r=>r.decimals===void 0||!r.assetInfo?.price?0:parseFloat(r.amount)/10**r.decimals*r.assetInfo.price,[]),{filteredGroupedAssets:d,chainTotals:i}=le(()=>{let r=Object.entries(e).map(([W,N])=>{let A=N.filter(t=>t.assetInfo?R(t.assetInfo)?!0:l.size>0?l.has(`${t.assetInfo.chainId}-${t.assetInfo.address?.toLowerCase()??""}`):!0:!1);return[W,A]}).filter(([,W])=>W.length>0),k={};for(let[W,N]of r)k[W]=N.reduce((A,t)=>A+u(t),0);return{filteredGroupedAssets:[...r].sort((W,N)=>(k[N[0]]??0)-(k[W[0]]??0)),chainTotals:k}},[e,l,u]),h=j(r=>{p(k=>{let T=new Set(k);return T.has(r)?T.delete(r):T.add(r),T})},[]),L=r=>be.format(r);return d.length===0?C("div",{className:"flex items-center justify-center p-6",children:C("p",{className:"text-sm",style:{color:"var(--widget-muted-foreground)"},children:"No token balances found"})}):C("div",{className:"pb-2 pt-1",children:d.map(([r,k])=>{let T=parseInt(r),W=w(T),N=i[r]||0,A=f.has(r);return z("div",{className:"mx-2 mb-2",style:{border:"1px var(--widget-border-style) var(--widget-border)",borderRadius:"var(--widget-radius)",overflow:"hidden"},children:[z("button",{type:"button",onClick:()=>h(r),className:"flex w-full flex-row items-center justify-between p-2 cursor-pointer transition-colors hover:bg-(--widget-secondary)",style:{backgroundColor:"transparent"},children:[z("div",{className:"inline-flex flex-row items-center gap-2",children:[C(Y,{chain:T,size:"sm"}),C("p",{className:"text-sm font-medium capitalize",style:{color:"var(--widget-foreground)"},children:W})]}),z("div",{className:"flex items-center gap-2",children:[C("p",{className:"text-sm font-semibold",style:{color:"var(--widget-foreground)"},children:L(N)}),C("span",{className:`transition-transform duration-200 ${A?"rotate-180":""}`,style:{color:"var(--widget-muted-foreground)"},children:C("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:C("path",{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),C("div",{className:`overflow-hidden transition-all duration-200 ease-out ${A?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"}`,children:C("div",{style:{borderTop:"1px var(--widget-border-style) var(--widget-border)"},children:k.map(t=>t.assetInfo?C(ie,{asset:t.assetInfo,balanceAmount:t.amount,balanceDecimals:t.decimals,price:t.assetInfo?.price??null,onSelect:v,getToken:c,useTokenWithLazyLoad:m},`${t.assetInfo.chainId}-${t.token}`):null)})})]},r)})})};import{useCallback as Se,useRef as Re,useState as De}from"react";function ce(e,s){return{orders:[],isLoading:!1,error:null,hasMore:!1,loadMore:async()=>{},totalOrders:0}}import{useState as Ce}from"react";import{jsx as a,jsxs as b}from"react/jsx-runtime";var We=()=>b("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:[a("circle",{cx:"5",cy:"5",r:"4",stroke:"currentColor",strokeWidth:"1.2"}),a("path",{d:"M3 5.2L4.3 6.5L7 3.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Te=()=>b("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:[a("circle",{cx:"5",cy:"5",r:"4",stroke:"currentColor",strokeWidth:"1.2"}),a("path",{d:"M3.5 3.5L6.5 6.5M6.5 3.5L3.5 6.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),Le=()=>b("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:[a("circle",{cx:"5",cy:"5",r:"4",stroke:"currentColor",strokeWidth:"1.2"}),a("path",{d:"M5 3V5.5L6.5 6.5",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})]}),ue=()=>b("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:[a("circle",{cx:"5",cy:"5",r:"4",stroke:"currentColor",strokeWidth:"1.2"}),a("circle",{cx:"5",cy:"5",r:"1.5",fill:"currentColor"})]}),Ie=e=>{switch((e||"").toLowerCase()){case"completed":case"settled":case"success":case"swapped":case"swap":return{icon:a(We,{}),color:"var(--widget-primary)"};case"received":return{icon:a(ue,{}),color:"var(--widget-accent)"};case"failed":case"error":case"expired":return{icon:a(Te,{}),color:"var(--widget-destructive)"};case"pending":case"created":case"placed":return{icon:a(Le,{}),color:"var(--widget-muted-foreground)"};default:return{icon:a(ue,{}),color:"var(--widget-muted-foreground)"}}},Ae=e=>{switch((e||"").toLowerCase()){case"completed":case"settled":case"success":case"swapped":case"swap":return"color-mix(in srgb, var(--widget-primary) 5%, transparent)";case"failed":case"error":case"expired":return"color-mix(in srgb, var(--widget-destructive) 5%, transparent)";case"pending":case"created":case"placed":return"color-mix(in srgb, var(--widget-accent) 5%, transparent)";default:return"var(--widget-secondary)"}},P=(e,s)=>{try{let n=parseFloat(e||"0");if(isNaN(n)||n===0)return"0";let c=s?.decimals??18;return q(n/10**c)}catch{return"0"}},me=({order:e,baseToken:s,quoteToken:n})=>{let[c,m]=Ce(!1),v=e?.status||e?.eventType||"unknown",{icon:f,color:p}=Ie(v),l=(i=>{if(!i)return{date:"",time:""};let h=new Date(typeof i=="number"?i:Number(i)||i);return{date:h.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),time:h.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",timeZone:"UTC",hour12:!1})+" UTC"}})(e?.timestamp||e?.createdAt||""),u=s?{asset:s,symbol:s.symbol,amount:P(e?.inputAmount,s)}:{asset:null,symbol:(e?.inputToken||"").slice(0,6)+"...",amount:P(e?.inputAmount,null)},d=n?{asset:n,symbol:n.symbol,amount:P(e?.outputAmount,n)}:{asset:null,symbol:(e?.outputToken||"").slice(0,6)+"...",amount:P(e?.outputAmount,null)};return b("a",{href:e?.explorerUrl||"#",target:"_blank",rel:"noopener noreferrer",className:"group flex flex-col cursor-pointer transition-all duration-200 ease-in-out no-underline",style:{border:"1px var(--widget-border-style) var(--widget-border)",backgroundColor:c?Ae(v):"transparent",marginBottom:"0.5rem",padding:"0.25rem"},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[b("div",{className:"flex flex-row items-center justify-between space-x-1",children:[b("div",{className:"flex flex-row items-center space-x-1",children:[a("div",{className:"-translate-y-px",style:{color:p},children:f}),a("p",{className:"text-2xs mono uppercase",style:{color:p},children:v})]}),b("div",{className:"flex flex-row items-center space-x-2",children:[b("span",{className:"text-2xs mono",style:{color:c?"var(--widget-foreground)":"var(--widget-muted-foreground)"},children:["\xAC ",K(e?.quoteId||e?.orderHash||"")]}),a("svg",{className:"w-2.5 -translate-y-px opacity-70 group-hover:rotate-[-45deg] group-hover:opacity-100 duration-200",style:{color:"var(--widget-foreground)"},viewBox:"0 0 684 684",fill:"none",children:a("path",{d:"M0.666687 384.667L519.92 384.667L281.627 622.96L342 683.333L683.333 342L342 0.666687L281.627 61.04L519.92 299.333L0.666687 299.333V384.667Z",fill:"currentColor"})})]})]}),b("div",{className:"flex flex-row items-center justify-between pr-2",style:{backgroundColor:c?"transparent":"var(--widget-secondary)"},children:[a("div",{className:"flex flex-col w-full h-full p-2",children:a("div",{className:"flex h-8 w-full items-center justify-between px-2",children:b("div",{className:"flex items-center space-x-1",children:[a(M,{asset:u.asset,size:"xs",className:"h-3 w-3"}),b("div",{className:"flex flex-col",children:[a("span",{className:"text-sm h-4",style:{color:"var(--widget-muted-foreground)"},children:u.amount}),a("span",{className:"text-xs",style:{color:"var(--widget-foreground)"},children:u.symbol})]}),a("span",{className:"px-1",style:{color:"var(--widget-muted-foreground)"},children:"\u2192"}),a(M,{asset:d.asset,size:"xs",className:"h-3 w-3"}),b("div",{className:"flex flex-col",children:[a("span",{className:"text-sm h-4",style:{color:"var(--widget-muted-foreground)"},children:d.amount}),a("span",{className:"text-xs",style:{color:"var(--widget-foreground)"},children:d.symbol})]})]})})}),b("div",{className:"flex flex-col items-end text-right shrink-0",children:[a("span",{className:"text-2xs mono whitespace-nowrap",style:{color:"var(--widget-muted-foreground)"},children:l.date}),l.time&&a("span",{className:"text-2xs mono whitespace-nowrap",style:{color:"var(--widget-muted-foreground)",opacity:.6},children:l.time})]})]})]})};import{Fragment as Fe,jsx as y,jsxs as O}from"react/jsx-runtime";var fe=()=>O("div",{className:"mt-2 flex flex-col",style:{height:"4rem",border:"1px var(--widget-border-style) var(--widget-border)",backgroundColor:"var(--widget-secondary)"},children:[O("div",{className:"flex items-center space-x-2 p-2",children:[y("div",{className:"h-4 w-4 rounded",style:{backgroundColor:"var(--widget-muted)"}}),y("div",{className:"h-3 w-24 rounded",style:{backgroundColor:"var(--widget-muted)"}})]}),O("div",{className:"flex h-8 w-full items-center justify-between px-4",children:[y("div",{className:"flex items-center space-x-1",children:[4,16,10,4,16,10].map((e,s)=>y("div",{className:"h-3 rounded",style:{width:`${e*4}px`,backgroundColor:"var(--widget-muted)"}},s))}),y("div",{className:"h-3 w-10 rounded",style:{backgroundColor:"var(--widget-muted)"}})]})]}),pe=({isActive:e})=>{let{address:s}=B(),{orders:n,isLoading:c,error:m,hasMore:v,loadMore:f}=ce(s,e),[p,w]=De(!1),l=Re(null),u=Se(async d=>{let i=d.currentTarget;if(i.scrollTop+i.clientHeight>=i.scrollHeight-100&&!c&&!p&&v){w(!0);try{await f()}finally{w(!1)}}},[c,p,v,f]);return s?m?y("div",{className:"flex items-center justify-center p-4",children:y("p",{className:"text-sm",style:{color:"var(--widget-destructive)"},children:"Error loading activity"})}):y("div",{ref:l,className:"flex flex-col flex-1 min-h-0 overflow-y-auto p-2",onScroll:u,style:{backgroundColor:"transparent"},children:c?Array.from({length:5}).map((d,i)=>y(fe,{},i)):n.length===0?y("div",{className:"flex flex-col items-center justify-center h-full p-6",children:y("p",{className:"text-sm",style:{color:"var(--widget-muted-foreground)"},children:"No Activity"})}):O(Fe,{children:[n.map(d=>y(me,{order:d,baseToken:d.enrichedTokens?.base??null,quoteToken:d.enrichedTokens?.quote??null},d.orderHash)),p&&y(fe,{})]})}):y("div",{className:"flex items-center justify-center p-4",children:y("p",{className:"text-sm",style:{color:"var(--widget-muted-foreground)"},children:"Connect your wallet to view activity"})})};import{Fragment as $e,jsx as g,jsxs as F}from"react/jsx-runtime";var Ee=()=>F("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[g("div",{className:"p-2 w-full flex justify-center",children:g("div",{className:"relative w-full h-[140px] animate-pulse",style:{borderRadius:"var(--widget-radius)",border:"1px var(--widget-border-style) var(--widget-border)",backgroundColor:"var(--widget-secondary)"}})}),g("div",{className:"px-2 flex flex-col gap-1.5 mt-1",children:[80,60,72,55,65].map((e,s)=>F("div",{className:"flex items-center justify-between py-1.5",children:[F("div",{className:"flex items-center gap-2",children:[g("div",{className:"h-6 w-6 rounded-full animate-pulse shrink-0",style:{backgroundColor:"var(--widget-secondary)"}}),g("div",{className:"h-3.5 animate-pulse",style:{width:`${e}px`,backgroundColor:"var(--widget-secondary)",borderRadius:"0.25rem"}})]}),g("div",{className:"h-3.5 w-14 animate-pulse",style:{backgroundColor:"var(--widget-secondary)",opacity:.5,borderRadius:"0.25rem"}})]},s))}),g("div",{className:"mt-auto shrink-0 p-2",style:{borderTop:"1px var(--widget-border-style) var(--widget-border)"},children:g("div",{className:"w-full animate-pulse",style:{height:"34px",backgroundColor:"var(--widget-secondary)",opacity:.35,borderRadius:"var(--widget-radius)"}})})]}),It=()=>{let e=E(L=>L.walletTab),[s,n]=He(!1),{disconnect:c}=Be(),{setQuoteToken:m}=se(),v=Me(async L=>{await m(L),E.getState().setView("swap")},[m]),{address:f,groupedAssets:p,totalBalance:w,balancesLoading:l,chains:u,getToken:d,useTokenWithLazyLoad:i,tokenRegistry:h}=oe(!0);return f?l&&e==="wallet"?g(Ee,{}):F("div",{className:"flex flex-col w-full h-full overflow-hidden",children:[F("div",{className:"flex-1 overflow-y-auto",style:{minHeight:0},children:[e==="wallet"&&F($e,{children:[g(ne,{address:f,totalBalance:w,isLoading:l}),g(de,{groupedAssets:p,chains:u,tokenRegistry:h,getToken:d,useTokenWithLazyLoad:i,onAssetSelect:v})]}),e==="activity"&&g(pe,{isActive:e==="activity"})]}),g("div",{className:"shrink-0 p-2",style:{borderTop:"1px var(--widget-border-style) var(--widget-border)"},children:g("button",{type:"button",onClick:()=>{c(),E.getState().setView("swap")},onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),className:"w-full py-2 text-xs mono uppercase cursor-pointer transition-colors",style:{backgroundColor:s?"var(--widget-destructive)":"transparent",color:s?"var(--widget-destructive-foreground)":"var(--widget-destructive)",border:"1px var(--widget-border-style) var(--widget-destructive)",borderRadius:"var(--widget-radius)"},children:"Sign Out"})})]}):g("div",{className:"flex flex-col items-center justify-center h-full p-4",children:g("p",{className:"text-sm",style:{color:"var(--widget-muted-foreground)"},children:"Connect your wallet to view your portfolio"})})};export{It as WidgetWalletPanel};
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+ "use client";var _chunkKH57FLSTcjs = require('./chunk-KH57FLST.cjs');var _chunkUZWGYG2Scjs = require('./chunk-UZWGYG2S.cjs');var _chunkLXEKOQAGcjs = require('./chunk-LXEKOQAG.cjs');var _chunk34N36GUDcjs = require('./chunk-34N36GUD.cjs');var _chunkT3I3AJXVcjs = require('./chunk-T3I3AJXV.cjs');var _react = require('react');var _wagmi = require('wagmi');function oe(e){let{address:s,isConnected:n}=_chunk34N36GUDcjs.a.call(void 0, ),{chainDataMap:c}=_chunkLXEKOQAGcjs.I.call(void 0, ),m=_chunkLXEKOQAGcjs._.call(void 0, ),{getToken:v,tokenRegistry:f}=_chunkLXEKOQAGcjs.F.call(void 0, ),{supportedInputTokens:p,supportedOutputTokens:w}=_chunkLXEKOQAGcjs.b.call(void 0, ),l=_react.useMemo.call(void 0, ()=>{if(!p.length&&!w.length)return[];let t=new Set,o=[];for(let x of[...p,...w]){let S=`${x.chainId}-${x.address.toLowerCase()}`;t.has(S)||(t.add(S),o.push(x))}return o},[p,w]),{balances:u,isLoading:d,isError:i,refetch:h}=_chunkLXEKOQAGcjs.L.call(void 0, s,m,{enabled:n&&e&&!!s,refetchOnWindowFocus:!1},l.length>0?l:void 0),L=_react.useMemo.call(void 0, ()=>l.length?new Set(l.map(t=>`${t.chainId}-${t.address.toLowerCase()}`)):null,[l]),r=_react.useMemo.call(void 0, ()=>!u||u.length===0?{}:u.filter(o=>!o.assetInfo||!o.balance||o.balance==="0"?!1:L?L.has(`${o.chainId}-${o.address.toLowerCase()}`):_chunkLXEKOQAGcjs.k.call(void 0, o.assetInfo)||f.length===0?!0:f.some(x=>x.address.toLowerCase()===o.address.toLowerCase()&&x.chainId===o.chainId)).reduce((o,x)=>{let S=String(x.chainId);return o[S]||(o[S]=[]),o[S].push({token:x.address,amount:x.balance,decimals:x.decimals,assetInfo:x.assetInfo}),o},{}),[u,f,L]),k=_react.useMemo.call(void 0, ()=>!u||u.length===0?0:u.reduce((t,o)=>!o.assetInfo||o.decimals===void 0?t:t+parseFloat(o.balance)/10**o.decimals*(o.assetInfo.price||0),0),[u]),T=_react.useMemo.call(void 0, ()=>m.length===0?{}:m.reduce((t,o)=>{let x=c[o],S=_chunkLXEKOQAGcjs.e.call(void 0, o);return t[o.toString()]={chainId:o,name:_optionalChain([S, 'optionalAccess', _2 => _2.displayName])||_optionalChain([x, 'optionalAccess', _3 => _3.chainKey])||`Chain ${o}`},t},{}),[m,c]),W=_react.useMemo.call(void 0, ()=>f.map(t=>({address:t.address,chainId:t.chainId})),[f]),N=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>()=>{N.current&&clearTimeout(N.current)},[]);let A=_react.useCallback.call(void 0, ()=>{N.current&&clearTimeout(N.current),N.current=setTimeout(()=>h(),2e3)},[h]);return{address:s,isConnected:n,groupedAssets:r,totalBalance:k,balancesLoading:d,balancesError:i,chains:T,getToken:v,useTokenWithLazyLoad:_chunkLXEKOQAGcjs.H,tokenRegistry:W,refetchBalances:A}}var ae=_chunkT3I3AJXVcjs.b.call(void 0, _chunkKH57FLSTcjs.a.call(void 0, ),1);var _jsxruntime = require('react/jsx-runtime');var ne=({address:e,totalBalance:s,isLoading:n=!1})=>{let c=m=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(m);return _jsxruntime.jsx.call(void 0, "div",{className:"p-2 w-full flex justify-center",children:_jsxruntime.jsxs.call(void 0, "div",{className:"relative w-full h-[140px] overflow-hidden",style:{borderRadius:"var(--widget-radius)",border:"1px var(--widget-border-style) var(--widget-border)"},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"absolute inset-0 z-0",children:[_jsxruntime.jsx.call(void 0, "img",{className:"w-full h-full object-cover opacity-60",src:(0,ae.makeGradient)(e),alt:"address gradient"}),_jsxruntime.jsx.call(void 0, "div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent"})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"relative z-10 flex h-full flex-col justify-between p-3",children:[_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-2xs uppercase mono",style:{color:"var(--widget-muted-foreground)",opacity:.7},children:"Token Balance:"}),n?_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.S,{className:"h-8 w-28 bg-white/10 rounded mt-1"}):_jsxruntime.jsx.call(void 0, "p",{className:"text-2xl font-bold mt-0.5",style:{color:"var(--widget-foreground)"},children:c(s)})]}),_jsxruntime.jsx.call(void 0, "div",{className:"flex items-center",children:_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.R,{text:e,type:"address",children:_jsxruntime.jsx.call(void 0, "p",{className:"mono text-2xs",style:{color:"var(--widget-foreground)",opacity:.7},children:e})})})]})]})})};var ie=({asset:e,balanceAmount:s,balanceDecimals:n,price:c,onSelect:m,getToken:v,useTokenWithLazyLoad:f})=>{let[p,w]=_react.useState.call(void 0, !1),l=n!==void 0?parseFloat(s)/10**n:0,d=_optionalChain([f, 'optionalCall', _4 => _4(e.chainId,e.address), 'optionalAccess', _5 => _5.token]),i=_nullishCoalesce(c, () => (null));return _chunkLXEKOQAGcjs.k.call(void 0, e)&&i==null&&(_optionalChain([d, 'optionalAccess', _6 => _6.price])!=null?i=d.price:v&&(i=_nullishCoalesce(_optionalChain([v, 'call', _7 => _7(e.chainId,e.address), 'optionalAccess', _8 => _8.price]), () => (null)))),_jsxruntime.jsx.call(void 0, "div",{role:"button",tabIndex:0,className:"flex h-[52px] w-full flex-row items-center p-3 cursor-pointer transition-colors",style:{borderBottom:"1px var(--widget-border-style) var(--widget-border)",backgroundColor:p?"var(--widget-secondary)":"transparent"},onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),onClick:()=>_optionalChain([m, 'optionalCall', _9 => _9(e)]),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),_optionalChain([m, 'optionalCall', _10 => _10(e)]))},children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex h-full w-full flex-row items-center justify-between",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex h-full flex-row items-center gap-2",children:[_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.P,{asset:e,size:"sm"}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col items-start",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-medium uppercase",style:{color:"var(--widget-foreground)"},children:e.symbol}),l>0&&_jsxruntime.jsx.call(void 0, "p",{className:"mono text-xs",style:{color:"var(--widget-muted-foreground)"},children:l.toFixed(4)})]})]}),_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-medium",style:{color:"var(--widget-foreground)"},children:i!=null?`$${(i*l).toFixed(2)}`:"\u2014"})]})})};var be=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2}),Ne=_chunkLXEKOQAGcjs.h.call(void 0, ),de=({groupedAssets:e,chains:s,tokenRegistry:n=[],getToken:c,useTokenWithLazyLoad:m,onAssetSelect:v})=>{let[f,p]=_react.useState.call(void 0, new Set),w=_react.useCallback.call(void 0, r=>_optionalChain([s, 'optionalAccess', _11 => _11[r], 'optionalAccess', _12 => _12.name])||Ne[r]||`Chain ${r}`,[s]),l=_react.useMemo.call(void 0, ()=>{let r=new Set;for(let k of n)r.add(`${k.chainId}-${k.address.toLowerCase()}`);return r},[n]),u=_react.useCallback.call(void 0, r=>r.decimals===void 0||!_optionalChain([r, 'access', _13 => _13.assetInfo, 'optionalAccess', _14 => _14.price])?0:parseFloat(r.amount)/10**r.decimals*r.assetInfo.price,[]),{filteredGroupedAssets:d,chainTotals:i}=_react.useMemo.call(void 0, ()=>{let r=Object.entries(e).map(([W,N])=>{let A=N.filter(t=>t.assetInfo?_chunkLXEKOQAGcjs.k.call(void 0, t.assetInfo)?!0:l.size>0?l.has(`${t.assetInfo.chainId}-${_nullishCoalesce(_optionalChain([t, 'access', _15 => _15.assetInfo, 'access', _16 => _16.address, 'optionalAccess', _17 => _17.toLowerCase, 'call', _18 => _18()]), () => (""))}`):!0:!1);return[W,A]}).filter(([,W])=>W.length>0),k={};for(let[W,N]of r)k[W]=N.reduce((A,t)=>A+u(t),0);return{filteredGroupedAssets:[...r].sort((W,N)=>(_nullishCoalesce(k[N[0]], () => (0)))-(_nullishCoalesce(k[W[0]], () => (0)))),chainTotals:k}},[e,l,u]),h=_react.useCallback.call(void 0, r=>{p(k=>{let T=new Set(k);return T.has(r)?T.delete(r):T.add(r),T})},[]),L=r=>be.format(r);return d.length===0?_jsxruntime.jsx.call(void 0, "div",{className:"flex items-center justify-center p-6",children:_jsxruntime.jsx.call(void 0, "p",{className:"text-sm",style:{color:"var(--widget-muted-foreground)"},children:"No token balances found"})}):_jsxruntime.jsx.call(void 0, "div",{className:"pb-2 pt-1",children:d.map(([r,k])=>{let T=parseInt(r),W=w(T),N=i[r]||0,A=f.has(r);return _jsxruntime.jsxs.call(void 0, "div",{className:"mx-2 mb-2",style:{border:"1px var(--widget-border-style) var(--widget-border)",borderRadius:"var(--widget-radius)",overflow:"hidden"},children:[_jsxruntime.jsxs.call(void 0, "button",{type:"button",onClick:()=>h(r),className:"flex w-full flex-row items-center justify-between p-2 cursor-pointer transition-colors hover:bg-(--widget-secondary)",style:{backgroundColor:"transparent"},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"inline-flex flex-row items-center gap-2",children:[_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.O,{chain:T,size:"sm"}),_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-medium capitalize",style:{color:"var(--widget-foreground)"},children:W})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-2",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-semibold",style:{color:"var(--widget-foreground)"},children:L(N)}),_jsxruntime.jsx.call(void 0, "span",{className:`transition-transform duration-200 ${A?"rotate-180":""}`,style:{color:"var(--widget-muted-foreground)"},children:_jsxruntime.jsx.call(void 0, "svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:_jsxruntime.jsx.call(void 0, "path",{d:"M2.5 4.5L6 8L9.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),_jsxruntime.jsx.call(void 0, "div",{className:`overflow-hidden transition-all duration-200 ease-out ${A?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"}`,children:_jsxruntime.jsx.call(void 0, "div",{style:{borderTop:"1px var(--widget-border-style) var(--widget-border)"},children:k.map(t=>t.assetInfo?_jsxruntime.jsx.call(void 0, ie,{asset:t.assetInfo,balanceAmount:t.amount,balanceDecimals:t.decimals,price:_nullishCoalesce(_optionalChain([t, 'access', _19 => _19.assetInfo, 'optionalAccess', _20 => _20.price]), () => (null)),onSelect:v,getToken:c,useTokenWithLazyLoad:m},`${t.assetInfo.chainId}-${t.token}`):null)})})]},r)})})};function ce(e,s){return{orders:[],isLoading:!1,error:null,hasMore:!1,loadMore:async()=>{},totalOrders:0}}var We=()=>_jsxruntime.jsxs.call(void 0, "svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"5",cy:"5",r:"4",stroke:"currentColor",strokeWidth:"1.2"}),_jsxruntime.jsx.call(void 0, "path",{d:"M3 5.2L4.3 6.5L7 3.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]}),Te=()=>_jsxruntime.jsxs.call(void 0, "svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"5",cy:"5",r:"4",stroke:"currentColor",strokeWidth:"1.2"}),_jsxruntime.jsx.call(void 0, "path",{d:"M3.5 3.5L6.5 6.5M6.5 3.5L3.5 6.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),Le=()=>_jsxruntime.jsxs.call(void 0, "svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"5",cy:"5",r:"4",stroke:"currentColor",strokeWidth:"1.2"}),_jsxruntime.jsx.call(void 0, "path",{d:"M5 3V5.5L6.5 6.5",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})]}),ue=()=>_jsxruntime.jsxs.call(void 0, "svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"5",cy:"5",r:"4",stroke:"currentColor",strokeWidth:"1.2"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"5",cy:"5",r:"1.5",fill:"currentColor"})]}),Ie=e=>{switch((e||"").toLowerCase()){case"completed":case"settled":case"success":case"swapped":case"swap":return{icon:_jsxruntime.jsx.call(void 0, We,{}),color:"var(--widget-primary)"};case"received":return{icon:_jsxruntime.jsx.call(void 0, ue,{}),color:"var(--widget-accent)"};case"failed":case"error":case"expired":return{icon:_jsxruntime.jsx.call(void 0, Te,{}),color:"var(--widget-destructive)"};case"pending":case"created":case"placed":return{icon:_jsxruntime.jsx.call(void 0, Le,{}),color:"var(--widget-muted-foreground)"};default:return{icon:_jsxruntime.jsx.call(void 0, ue,{}),color:"var(--widget-muted-foreground)"}}},Ae=e=>{switch((e||"").toLowerCase()){case"completed":case"settled":case"success":case"swapped":case"swap":return"color-mix(in srgb, var(--widget-primary) 5%, transparent)";case"failed":case"error":case"expired":return"color-mix(in srgb, var(--widget-destructive) 5%, transparent)";case"pending":case"created":case"placed":return"color-mix(in srgb, var(--widget-accent) 5%, transparent)";default:return"var(--widget-secondary)"}},P=(e,s)=>{try{let n=parseFloat(e||"0");if(isNaN(n)||n===0)return"0";let c=_nullishCoalesce(_optionalChain([s, 'optionalAccess', _21 => _21.decimals]), () => (18));return _chunkLXEKOQAGcjs.q.call(void 0, n/10**c)}catch (e2){return"0"}},me=({order:e,baseToken:s,quoteToken:n})=>{let[c,m]=_react.useState.call(void 0, !1),v=_optionalChain([e, 'optionalAccess', _22 => _22.status])||_optionalChain([e, 'optionalAccess', _23 => _23.eventType])||"unknown",{icon:f,color:p}=Ie(v),l=(i=>{if(!i)return{date:"",time:""};let h=new Date(typeof i=="number"?i:Number(i)||i);return{date:h.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),time:h.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",timeZone:"UTC",hour12:!1})+" UTC"}})(_optionalChain([e, 'optionalAccess', _24 => _24.timestamp])||_optionalChain([e, 'optionalAccess', _25 => _25.createdAt])||""),u=s?{asset:s,symbol:s.symbol,amount:P(_optionalChain([e, 'optionalAccess', _26 => _26.inputAmount]),s)}:{asset:null,symbol:(_optionalChain([e, 'optionalAccess', _27 => _27.inputToken])||"").slice(0,6)+"...",amount:P(_optionalChain([e, 'optionalAccess', _28 => _28.inputAmount]),null)},d=n?{asset:n,symbol:n.symbol,amount:P(_optionalChain([e, 'optionalAccess', _29 => _29.outputAmount]),n)}:{asset:null,symbol:(_optionalChain([e, 'optionalAccess', _30 => _30.outputToken])||"").slice(0,6)+"...",amount:P(_optionalChain([e, 'optionalAccess', _31 => _31.outputAmount]),null)};return _jsxruntime.jsxs.call(void 0, "a",{href:_optionalChain([e, 'optionalAccess', _32 => _32.explorerUrl])||"#",target:"_blank",rel:"noopener noreferrer",className:"group flex flex-col cursor-pointer transition-all duration-200 ease-in-out no-underline",style:{border:"1px var(--widget-border-style) var(--widget-border)",backgroundColor:c?Ae(v):"transparent",marginBottom:"0.5rem",padding:"0.25rem"},onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-row items-center justify-between space-x-1",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-row items-center space-x-1",children:[_jsxruntime.jsx.call(void 0, "div",{className:"-translate-y-px",style:{color:p},children:f}),_jsxruntime.jsx.call(void 0, "p",{className:"text-2xs mono uppercase",style:{color:p},children:v})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-row items-center space-x-2",children:[_jsxruntime.jsxs.call(void 0, "span",{className:"text-2xs mono",style:{color:c?"var(--widget-foreground)":"var(--widget-muted-foreground)"},children:["\xAC ",_chunkLXEKOQAGcjs.r.call(void 0, _optionalChain([e, 'optionalAccess', _33 => _33.quoteId])||_optionalChain([e, 'optionalAccess', _34 => _34.orderHash])||"")]}),_jsxruntime.jsx.call(void 0, "svg",{className:"w-2.5 -translate-y-px opacity-70 group-hover:rotate-[-45deg] group-hover:opacity-100 duration-200",style:{color:"var(--widget-foreground)"},viewBox:"0 0 684 684",fill:"none",children:_jsxruntime.jsx.call(void 0, "path",{d:"M0.666687 384.667L519.92 384.667L281.627 622.96L342 683.333L683.333 342L342 0.666687L281.627 61.04L519.92 299.333L0.666687 299.333V384.667Z",fill:"currentColor"})})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-row items-center justify-between pr-2",style:{backgroundColor:c?"transparent":"var(--widget-secondary)"},children:[_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col w-full h-full p-2",children:_jsxruntime.jsx.call(void 0, "div",{className:"flex h-8 w-full items-center justify-between px-2",children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-1",children:[_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.P,{asset:u.asset,size:"xs",className:"h-3 w-3"}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-sm h-4",style:{color:"var(--widget-muted-foreground)"},children:u.amount}),_jsxruntime.jsx.call(void 0, "span",{className:"text-xs",style:{color:"var(--widget-foreground)"},children:u.symbol})]}),_jsxruntime.jsx.call(void 0, "span",{className:"px-1",style:{color:"var(--widget-muted-foreground)"},children:"\u2192"}),_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.P,{asset:d.asset,size:"xs",className:"h-3 w-3"}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-sm h-4",style:{color:"var(--widget-muted-foreground)"},children:d.amount}),_jsxruntime.jsx.call(void 0, "span",{className:"text-xs",style:{color:"var(--widget-foreground)"},children:d.symbol})]})]})})}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col items-end text-right shrink-0",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs mono whitespace-nowrap",style:{color:"var(--widget-muted-foreground)"},children:l.date}),l.time&&_jsxruntime.jsx.call(void 0, "span",{className:"text-2xs mono whitespace-nowrap",style:{color:"var(--widget-muted-foreground)",opacity:.6},children:l.time})]})]})]})};var fe=()=>_jsxruntime.jsxs.call(void 0, "div",{className:"mt-2 flex flex-col",style:{height:"4rem",border:"1px var(--widget-border-style) var(--widget-border)",backgroundColor:"var(--widget-secondary)"},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-2 p-2",children:[_jsxruntime.jsx.call(void 0, "div",{className:"h-4 w-4 rounded",style:{backgroundColor:"var(--widget-muted)"}}),_jsxruntime.jsx.call(void 0, "div",{className:"h-3 w-24 rounded",style:{backgroundColor:"var(--widget-muted)"}})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex h-8 w-full items-center justify-between px-4",children:[_jsxruntime.jsx.call(void 0, "div",{className:"flex items-center space-x-1",children:[4,16,10,4,16,10].map((e,s)=>_jsxruntime.jsx.call(void 0, "div",{className:"h-3 rounded",style:{width:`${e*4}px`,backgroundColor:"var(--widget-muted)"}},s))}),_jsxruntime.jsx.call(void 0, "div",{className:"h-3 w-10 rounded",style:{backgroundColor:"var(--widget-muted)"}})]})]}),pe=({isActive:e})=>{let{address:s}=_chunk34N36GUDcjs.a.call(void 0, ),{orders:n,isLoading:c,error:m,hasMore:v,loadMore:f}=ce(s,e),[p,w]=_react.useState.call(void 0, !1),l=_react.useRef.call(void 0, null),u=_react.useCallback.call(void 0, async d=>{let i=d.currentTarget;if(i.scrollTop+i.clientHeight>=i.scrollHeight-100&&!c&&!p&&v){w(!0);try{await f()}finally{w(!1)}}},[c,p,v,f]);return s?m?_jsxruntime.jsx.call(void 0, "div",{className:"flex items-center justify-center p-4",children:_jsxruntime.jsx.call(void 0, "p",{className:"text-sm",style:{color:"var(--widget-destructive)"},children:"Error loading activity"})}):_jsxruntime.jsx.call(void 0, "div",{ref:l,className:"flex flex-col flex-1 min-h-0 overflow-y-auto p-2",onScroll:u,style:{backgroundColor:"transparent"},children:c?Array.from({length:5}).map((d,i)=>_jsxruntime.jsx.call(void 0, fe,{},i)):n.length===0?_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col items-center justify-center h-full p-6",children:_jsxruntime.jsx.call(void 0, "p",{className:"text-sm",style:{color:"var(--widget-muted-foreground)"},children:"No Activity"})}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[n.map(d=>_jsxruntime.jsx.call(void 0, me,{order:d,baseToken:_nullishCoalesce(_optionalChain([d, 'access', _35 => _35.enrichedTokens, 'optionalAccess', _36 => _36.base]), () => (null)),quoteToken:_nullishCoalesce(_optionalChain([d, 'access', _37 => _37.enrichedTokens, 'optionalAccess', _38 => _38.quote]), () => (null))},d.orderHash)),p&&_jsxruntime.jsx.call(void 0, fe,{})]})}):_jsxruntime.jsx.call(void 0, "div",{className:"flex items-center justify-center p-4",children:_jsxruntime.jsx.call(void 0, "p",{className:"text-sm",style:{color:"var(--widget-muted-foreground)"},children:"Connect your wallet to view activity"})})};var Ee=()=>_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col w-full h-full overflow-hidden",children:[_jsxruntime.jsx.call(void 0, "div",{className:"p-2 w-full flex justify-center",children:_jsxruntime.jsx.call(void 0, "div",{className:"relative w-full h-[140px] animate-pulse",style:{borderRadius:"var(--widget-radius)",border:"1px var(--widget-border-style) var(--widget-border)",backgroundColor:"var(--widget-secondary)"}})}),_jsxruntime.jsx.call(void 0, "div",{className:"px-2 flex flex-col gap-1.5 mt-1",children:[80,60,72,55,65].map((e,s)=>_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-between py-1.5",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-2",children:[_jsxruntime.jsx.call(void 0, "div",{className:"h-6 w-6 rounded-full animate-pulse shrink-0",style:{backgroundColor:"var(--widget-secondary)"}}),_jsxruntime.jsx.call(void 0, "div",{className:"h-3.5 animate-pulse",style:{width:`${e}px`,backgroundColor:"var(--widget-secondary)",borderRadius:"0.25rem"}})]}),_jsxruntime.jsx.call(void 0, "div",{className:"h-3.5 w-14 animate-pulse",style:{backgroundColor:"var(--widget-secondary)",opacity:.5,borderRadius:"0.25rem"}})]},s))}),_jsxruntime.jsx.call(void 0, "div",{className:"mt-auto shrink-0 p-2",style:{borderTop:"1px var(--widget-border-style) var(--widget-border)"},children:_jsxruntime.jsx.call(void 0, "div",{className:"w-full animate-pulse",style:{height:"34px",backgroundColor:"var(--widget-secondary)",opacity:.35,borderRadius:"var(--widget-radius)"}})})]}),It= exports.WidgetWalletPanel =()=>{let e=_chunkUZWGYG2Scjs.c.call(void 0, L=>L.walletTab),[s,n]=_react.useState.call(void 0, !1),{disconnect:c}=_wagmi.useDisconnect.call(void 0, ),{setQuoteToken:m}=_chunkUZWGYG2Scjs.f.call(void 0, ),v=_react.useCallback.call(void 0, async L=>{await m(L),_chunkUZWGYG2Scjs.c.getState().setView("swap")},[m]),{address:f,groupedAssets:p,totalBalance:w,balancesLoading:l,chains:u,getToken:d,useTokenWithLazyLoad:i,tokenRegistry:h}=oe(!0);return f?l&&e==="wallet"?_jsxruntime.jsx.call(void 0, Ee,{}):_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col w-full h-full overflow-hidden",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex-1 overflow-y-auto",style:{minHeight:0},children:[e==="wallet"&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, ne,{address:f,totalBalance:w,isLoading:l}),_jsxruntime.jsx.call(void 0, de,{groupedAssets:p,chains:u,tokenRegistry:h,getToken:d,useTokenWithLazyLoad:i,onAssetSelect:v})]}),e==="activity"&&_jsxruntime.jsx.call(void 0, pe,{isActive:e==="activity"})]}),_jsxruntime.jsx.call(void 0, "div",{className:"shrink-0 p-2",style:{borderTop:"1px var(--widget-border-style) var(--widget-border)"},children:_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:()=>{c(),_chunkUZWGYG2Scjs.c.getState().setView("swap")},onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),className:"w-full py-2 text-xs mono uppercase cursor-pointer transition-colors",style:{backgroundColor:s?"var(--widget-destructive)":"transparent",color:s?"var(--widget-destructive-foreground)":"var(--widget-destructive)",border:"1px var(--widget-border-style) var(--widget-destructive)",borderRadius:"var(--widget-radius)"},children:"Sign Out"})})]}):_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col items-center justify-center h-full p-4",children:_jsxruntime.jsx.call(void 0, "p",{className:"text-sm",style:{color:"var(--widget-muted-foreground)"},children:"Connect your wallet to view your portfolio"})})};exports.WidgetWalletPanel = It;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
+ var _react = require('react');var _wagmi = require('wagmi');function r(){let[e,t]=_react.useState.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{t(!0)},[]),e}function a(){let e=r(),{address:t,isConnected:n,isConnecting:o,isReconnecting:s}=_wagmi.useAccount.call(void 0, );return{mounted:e,address:t,isConnected:n,isLoading:o||s}}exports.a = a;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{useEffect as u,useState as c}from"react";import{useAccount as i}from"wagmi";function r(){let[e,t]=c(!1);return u(()=>{t(!0)},[]),e}function a(){let e=r(),{address:t,isConnected:n,isConnecting:o,isReconnecting:s}=i();return{mounted:e,address:t,isConnected:n,isLoading:o||s}}export{a};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{e as g}from"./chunk-XYF2YBR3.js";import{f as y}from"./chunk-726CI6GC.js";import{P as m,X as f,b as w}from"./chunk-EW2OR6CJ.js";import E,{useEffect as $,useState as j}from"react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function x(a){if(a===0)return"0";let o=Math.abs(a);return o>=1e4?a.toFixed(0):o>=1e3?a.toFixed(1):o>=100?a.toFixed(2):o>=1?a.toFixed(4):o>=.01?a.toFixed(6):a.toExponential(3)}var N=E.memo(()=>{let[a,o]=j(!1),{liquidityError:b,routingError:h}=g(),{baseAmount:r,baseToken:s,quoteAmount:l,quoteToken:i}=y(),{quoteLoaderVariant:p,widgetType:F}=w(),u=F==="compact",n=r&&l&&parseFloat(l.toString())?parseFloat(r.toString())/parseFloat(l.toString()):0,v=b||h,c=s&&i&&r&&parseFloat(r.toString())&&l;return $(()=>{p==="expanded"&&c&&o(!0)},[p,c]),p==="none"?null:p==="default"?e("div",{className:`relative box-border flex flex-row pt-1 h-8 w-full items-center${u?" justify-start overflow-x-auto":" justify-center"}`,children:e("div",{className:`flex h-full items-center${u?" min-w-max":" w-full overflow-hidden"}`,style:{color:"var(--widget-foreground)"},children:s&&i?r&&parseFloat(r.toString())?l?t("div",{className:"translate-y-px font-mono flex flex-row items-center gap-2 whitespace-nowrap",children:[t("div",{className:"flex flex-row items-center gap-1",children:[e(m,{asset:i,size:"3xs",noChain:!0,className:"mb-0.5"}),t("span",{className:"text-xs uppercase",children:["1 ",i?.symbol]})]}),e("span",{className:"text-xs",style:{color:"var(--widget-muted-foreground)"},children:"="}),t("div",{className:"flex flex-row items-center gap-1",children:[e(m,{asset:s,size:"3xs",noChain:!0,className:"mb-0.5"}),t("span",{className:"text-xs uppercase",children:[x(n)," ",s?.symbol]})]}),e("span",{className:"text-xs",style:{color:"var(--widget-muted-foreground)"},children:s?.price?`\u2248 $${(s.price*n).toFixed(2)}`:""})]}):v?t("div",{className:"flex h-full w-full flex-row pb-1 items-center justify-between",children:[e("p",{className:"text-xs",style:{color:"var(--widget-destructive)"},children:"Quote not found"}),e(f,{className:"h-8 w-8",style:{color:"var(--widget-destructive)"}})]}):t("div",{className:"flex h-full w-full flex-row pb-1 items-center justify-between",children:[e("p",{className:"text-xs",style:{color:"var(--widget-accent)"},children:"Searching For Quote"}),e(f,{className:"h-8 w-8",style:{color:"var(--widget-accent)"}})]}):e("div",{className:"text-xs pb-1",style:{color:"var(--widget-foreground)",opacity:.4},children:"Enter Amount"}):e("div",{className:"text-xs pb-1",style:{color:"var(--widget-foreground)",opacity:.4},children:"Enter Amount"})})}):t("div",{className:"flex flex-col w-full",children:[e("div",{className:`relative box-border flex flex-row pt-1 h-8 w-full items-center cursor-pointer${u?" overflow-x-auto":""}`,role:"button",tabIndex:0,onClick:()=>c&&o(d=>!d),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),c&&o(S=>!S))},children:e("div",{className:`flex h-full items-center${u?" min-w-max overflow-x-auto":" w-full overflow-hidden"}`,style:{color:"var(--widget-foreground)"},children:s&&i?r&&parseFloat(r.toString())?l?t("div",{className:"translate-y-px font-mono flex w-full flex-row items-center justify-between",children:[t("div",{className:"flex flex-row items-center gap-2 whitespace-nowrap",children:[t("div",{className:"flex flex-row items-center gap-1",children:[e(m,{asset:i,size:"3xs",noChain:!0,className:"mb-0.5"}),t("span",{className:"text-xs uppercase",children:["1 ",i?.symbol]})]}),e("span",{className:"text-xs",style:{color:"var(--widget-muted-foreground)"},children:"="}),t("div",{className:"flex flex-row items-center gap-1",children:[e(m,{asset:s,size:"3xs",noChain:!0,className:"mb-0.5"}),t("span",{className:"text-xs uppercase",children:[x(n)," ",s?.symbol]})]}),e("span",{className:"text-xs",style:{color:"var(--widget-muted-foreground)"},children:s?.price?`\u2248 $${(s.price*n).toFixed(2)}`:""})]}),e("span",{className:"text-xs ml-2 transition-transform duration-200 shrink-0",style:{color:"var(--widget-muted-foreground)",transform:a?"rotate(180deg)":"rotate(0deg)",display:"inline-block"},children:"\u25BE"})]}):v?t("div",{className:"flex h-full w-full flex-row pb-1 items-center justify-between",children:[e("p",{className:"text-xs",style:{color:"var(--widget-destructive)"},children:"Quote not found"}),e(f,{className:"h-8 w-8",style:{color:"var(--widget-destructive)"}})]}):t("div",{className:"flex h-full w-full flex-row pb-1 items-center justify-between",children:[e("p",{className:"text-xs",style:{color:"var(--widget-accent)"},children:"Searching For Quote"}),e(f,{className:"h-8 w-8",style:{color:"var(--widget-accent)"}})]}):e("div",{className:"text-xs pb-1",style:{color:"var(--widget-foreground)",opacity:.4},children:"Enter Amount"}):e("div",{className:"text-xs pb-1",style:{color:"var(--widget-foreground)",opacity:.4},children:"Enter Amount"})})}),e("div",{className:"overflow-hidden transition-all duration-200",style:{maxHeight:a&&c?"80px":"0px",opacity:a&&c?1:0},children:t("div",{className:"flex flex-col gap-0.5 pb-1 font-mono",children:[t("div",{className:"flex justify-between text-2xs",style:{color:"var(--widget-muted-foreground)"},children:[e("span",{children:"USD Value"}),t("span",{children:["$",s?.price&&l?(s.price*n*parseFloat(l.toString())).toFixed(2):"\u2014"]})]}),t("div",{className:"flex justify-between text-2xs",style:{color:"var(--widget-muted-foreground)"},children:[e("span",{children:"Rate"}),e("span",{className:"uppercase",children:n>0?`${x(n)} ${s?.symbol??""}`:"\u2014"})]}),t("div",{className:"flex justify-between text-2xs",style:{color:"var(--widget-muted-foreground)"},children:[e("span",{children:"Order Type"}),e("span",{children:"RFQ (Exact Fill)"})]})]})})]})});N.displayName="QuoteLoader";var R=N;export{R as a};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{c as p,f as re}from"./chunk-726CI6GC.js";import{F as Z,G as ee,H as te,L as se,O as ae,P as N,_ as ne,b as Y,g as K,k as A,w as x,x as J,z as X}from"./chunk-EW2OR6CJ.js";import{a as oe}from"./chunk-46H44R7V.js";import $,{useCallback as ie,useEffect as ke,useMemo as z}from"react";import{useShallow as Ae}from"zustand/react/shallow";import Ce from"react";import{jsx as I,jsxs as T}from"react/jsx-runtime";var H=Ce.memo(({asset:n,otherAsset:i,handleFormSelection:S,getToken:G})=>{let{token:g}=te(n.chainId,n.address),C=G(n.chainId,n.address),a=g||C||n.assetInfo;if(!a)return null;let f=a.price!=null&&n.decimals!==void 0?x(a,n.balance,n.decimals):null;return T("button",{type:"button",className:"w-full flex items-center justify-between p-3 cursor-pointer",style:{borderBottom:"1px solid var(--widget-border)"},onClick:()=>S(a,i),children:[T("div",{className:"flex items-center space-x-3 min-w-0 flex-1",children:[I(N,{asset:a,size:"md",className:"flex-shrink-0"}),T("div",{className:"flex flex-col items-start min-w-0 flex-1",children:[I("span",{className:"text-base font-medium",style:{color:"var(--widget-foreground)"},children:a.symbol.length>20?`${a.symbol.substring(0,20)}...`:a.symbol}),I("span",{className:"text-sm",style:{color:"var(--widget-foreground)",opacity:.6},children:a.name.length>20?`${a.name.substring(0,20)}...`:a.name})]})]}),T("div",{className:"flex flex-col items-end text-right flex-shrink-0",children:[I("span",{className:"text-xs font-mono",style:{color:"var(--widget-foreground)",opacity:.5},children:"Balance:"}),I("span",{className:"text-xs font-mono",style:{color:"var(--widget-foreground)"},children:f!=null?`$${f.toFixed(2)}`:"\u2014"})]})]},`${a.chainId}-${a.address}`)},(n,i)=>n.asset.address===i.asset.address&&n.asset.chainId===i.asset.chainId&&n.asset.balance===i.asset.balance&&n.asset.assetInfo?.price===i.asset.assetInfo?.price&&n.otherAsset.address===i.otherAsset.address);H.displayName="AssetSelectionBalanceItem";import{jsx as o,jsxs as m}from"react/jsx-runtime";var Ne=({toggle:n,side:i,otherAsset:S,containerHeight:G,onChainHover:g,onMoreChainsClick:C,selectedChainFilter:a})=>{let{address:_}=oe(),{assetSelectionSearch:f,assetSelectionChain:c,assetSelectionCategory:le,recentChainIds:W}=p(Ae(e=>({assetSelectionSearch:e.assetSelectionSearch,assetSelectionChain:e.assetSelectionChain,assetSelectionCategory:e.assetSelectionCategory,recentChainIds:e.recentChainIds}))),L=X(f,300),b=ne(),{supportedInputTokens:de,supportedOutputTokens:ce,supportedInputChains:ue,supportedOutputChains:me,inputSelectionSearch:fe,outputSelectionSearch:pe,showInputSelectionTokenBalances:he,showOutputSelectionTokenBalances:ge}=Y(),we=i==="base"?fe:pe,be=i==="base"?he:ge,{setBaseToken:q,setQuoteToken:V}=re(),y=i==="base"?de:ce,w=i==="base"?ue:me,B=w.length===1,v=z(()=>{if(y.length===0)return null;let e=new Set;for(let t of y)e.add(`${t.chainId}-${t.address.toLowerCase()}`);return e},[y]);ke(()=>{B?p.getState().setAssetSelectionChain(w[0]):a&&p.getState().setAssetSelectionChain(a)},[a,B,w]);let ye=$.useMemo(()=>{let r=w.length>0?new Set(w):null,s=K(b).filter(l=>!r||r.has(l.id)).map(l=>({chainId:l.id,name:l.displayName})),d=new Map(s.map(l=>[l.chainId,l])),u=[],h=new Set,Q=d.get(4326);Q&&(u.push(Q),h.add(4326));for(let l of W){if(u.length>=5)break;if(h.has(l))continue;let U=d.get(l);U&&(u.push(U),h.add(l))}for(let l of s){if(u.length>=5)break;h.has(l.chainId)||u.push(l)}return u},[b,W,w]),{enrichedTokens:M,isLoading:ve}=ee(c==="all"?"all":c),{tokenRegistry:j,getToken:D}=Z(),xe=z(()=>{let e=new Set;for(let t of j)e.add(`${t.chainId}-${t.address.toLowerCase()}`);return e},[j]),E=z(()=>v?M.filter(e=>v.has(`${e.chainId}-${e.address.toLowerCase()}`)):M,[M,v]),R=$.useMemo(()=>{if(!L)return E;let e=L.toLowerCase();return E.filter(t=>(t.symbol||"").toLowerCase().includes(e)||(t.name||"").toLowerCase().includes(e)||t.address.toLowerCase().includes(e))},[E,L]),O=$.useMemo(()=>{let e=c==="all"?(R||[]).filter(s=>b.includes(s.chainId)):R||[],t=new Set;return[...e.filter(s=>{let d=`${s.chainId}-${s.address.toLowerCase()}`;return t.has(d)?!1:(t.add(d),!0)})].sort((s,d)=>{let u=A(s),h=A(d);return u&&!h?-1:!u&&h?1:s.marketCap&&!d.marketCap?-1:!s.marketCap&&d.marketCap?1:!s.marketCap&&!d.marketCap?0:d.marketCap-s.marketCap})},[R,c,b]),{balances:k,isLoading:Ie}=se(_,b,void 0,y.length>0?y:void 0),P=$.useMemo(()=>{if(!k)return[];let e=c==="all"?k:k.filter(r=>r.chainId===c),t=new Set;return e.filter(r=>{let s=`${r.chainId}-${(r.address||"").toLowerCase()}`;return t.has(s)?!1:(t.add(s),!0)})},[k,c]),Se=ie(e=>{let t=e.target.value.toLowerCase(),r=J(t),s=p.getState();r?(s.setAssetSelectionSearch(r),s.setAssetSelectionAddressInput(r)):(s.setAssetSelectionAddressInput(""),s.setAssetSelectionSearch(t))},[]),F=ie(async e=>{i==="base"?await q(e):i==="quote"&&await V(e),n()},[n,i,q,V]);return m("div",{className:"w-full h-full flex flex-col pt-2.5",children:[!B&&m("div",{className:"flex flex-row justify-between py-1 flex-shrink-0 h-10",children:[o("button",{type:"button",className:"flex flex-row items-center w-full h-full px-2.5 whitespace-nowrap font-bold uppercase text-xs cursor-pointer",style:{backgroundColor:c==="all"&&!a?"var(--widget-primary)":"var(--widget-secondary)",color:c==="all"&&!a?"var(--widget-primary-foreground)":"var(--widget-secondary-foreground)",border:"1px solid var(--widget-border)",borderRadius:"var(--widget-radius) 0 0 var(--widget-radius)"},onClick:e=>{e.stopPropagation(),p.getState().setAssetSelectionChain("all")},onMouseEnter:()=>g?.("All Chains"),onMouseLeave:()=>g?.(null),children:"All"}),ye.map((e,t)=>o("button",{type:"button",className:"flex items-center justify-center px-2 w-full cursor-pointer",style:{backgroundColor:c===e.chainId?"var(--widget-primary)":"var(--widget-secondary)",color:c===e.chainId?"var(--widget-primary-foreground)":"var(--widget-secondary-foreground)",borderTop:"1px solid var(--widget-border)",borderBottom:"1px solid var(--widget-border)",borderLeft:t===0?"none":"1px solid var(--widget-border)",borderRight:"1px solid var(--widget-border)"},onClick:r=>{r.stopPropagation(),p.getState().setAssetSelectionChain(e.chainId)},onMouseEnter:()=>g?.(e.name),onMouseLeave:()=>g?.(null),children:o("div",{className:"mb-px h-4 w-4",children:o(ae,{chain:e.chainId,size:"xs"})})},e.chainId)),C&&o("button",{type:"button",className:"flex flex-row cursor-pointer items-center w-full h-full px-2.5 whitespace-nowrap uppercase font-bold text-xs",style:{backgroundColor:"var(--widget-secondary)",color:"var(--widget-secondary-foreground)",border:"1px solid var(--widget-border)",borderRadius:"0 var(--widget-radius) var(--widget-radius) 0"},onClick:e=>{e.stopPropagation(),C()},children:"More"})]}),we&&o("div",{className:"flex-shrink-0",children:m("div",{className:"relative mt-1",children:[o("input",{className:"w-full h-10 px-4 text-sm",style:{backgroundColor:"var(--widget-card)",color:"var(--widget-card-foreground)",border:"1px solid var(--widget-border)"},placeholder:"Search tokens by name, symbol, or address...",autoComplete:"off",value:f,onChange:Se}),f&&o("button",{type:"button",onClick:()=>p.getState().setAssetSelectionSearch(""),className:"absolute right-2 top-1/2 -translate-y-1/2 cursor-pointer rounded-full px-2 py-1 text-xs",style:{backgroundColor:"var(--widget-secondary)",color:"var(--widget-secondary-foreground)",border:"1px solid var(--widget-border)"},children:"clear"})]})}),m("div",{className:"flex-1 min-h-0 overflow-auto mt-2",style:{backgroundColor:"var(--widget-background)"},children:[be&&!Ie&&P.length>0&&!f&&le==="all"&&m("div",{children:[o("p",{className:"my-1 ml-4 text-xs",style:{color:"var(--widget-muted-foreground)"},children:"Your Tokens"}),P.filter(e=>e.assetInfo?v?v.has(`${e.assetInfo.chainId}-${e.assetInfo.address.toLowerCase()}`):A(e.assetInfo)||xe.has(`${e.assetInfo.chainId}-${e.assetInfo.address.toLowerCase()}`):!1).sort((e,t)=>{let r=D(e.chainId,e.address)||e.assetInfo,s=D(t.chainId,t.address)||t.assetInfo,d=r&&e.decimals!==void 0?x(r,e.balance,e.decimals):0;return(s&&t.decimals!==void 0?x(s,t.balance,t.decimals):0)-d}).map(e=>!e.assetInfo||!S?null:o(H,{asset:e,otherAsset:S,handleFormSelection:F,getToken:D},`${e.assetInfo.chainId}-${e.assetInfo.address}`))]}),o("p",{className:"my-2 ml-4 text-xs",style:{color:"var(--widget-muted-foreground)"},children:f?"Search Results":"Supported Tokens"}),ve?o("div",{className:"flex items-center justify-center p-8",children:o("span",{style:{color:"var(--widget-muted-foreground)"},children:"Loading tokens..."})}):O.length===0?o("div",{className:"px-4 py-3 text-sm",style:{color:"var(--widget-muted-foreground)"},children:"Token Not Found"}):O.map(e=>m("div",{role:"button",tabIndex:0,className:"w-full flex items-center justify-between p-3 cursor-pointer",style:{borderBottom:"1px solid var(--widget-border)"},onClick:()=>F(e),onKeyDown:t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),F(e))},children:[m("div",{className:"flex items-center space-x-3 min-w-0 flex-1",children:[o(N,{asset:e,size:"md",className:"flex-shrink-0"}),m("div",{className:"flex flex-col items-start min-w-0 flex-1",children:[o("span",{className:"text-base font-medium truncate",style:{color:"var(--widget-foreground)"},children:(e.symbol||"").length>20?`${e.symbol.substring(0,20)}...`:e.symbol||"\u2014"}),o("span",{className:"text-sm truncate",style:{color:"var(--widget-muted-foreground)"},children:(e.name||"").length>20?`${e.name.substring(0,20)}...`:e.name||"\u2014"})]})]}),m("div",{className:"flex flex-col items-end text-right flex-shrink-0",children:[o("span",{className:"text-xs font-mono",style:{color:"var(--widget-foreground)"},children:e.price?`$${e.price>=999999?`${(e.price/1e6).toFixed(2)}M`:e.price.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:e.price<1?5:2})}`:"\u2014"}),m("span",{className:"text-xs font-mono",style:{color:"var(--widget-muted-foreground)"},children:[e.address?.slice(0,6),"...",e.address?.slice(-4)]})]})]},`${e.chainId}-${e.address}`))]})]})},Ue=Ne;export{Ue as a};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{D,E as y,M as H,e as g}from"./chunk-EW2OR6CJ.js";import{a as P}from"./chunk-46H44R7V.js";import{create as ee}from"zustand";import{useCallback as q,useEffect as te,useRef as ne}from"react";var x=ee()(n=>({baseToken:null,quoteToken:null,setBaseTokenDirect:e=>n({baseToken:e}),setQuoteTokenDirect:e=>n({quoteToken:e}),swapTokensDirect:()=>n(e=>({baseToken:e.quoteToken,quoteToken:e.baseToken}))}));function O(n){let{data:e,isLoading:c}=D(),o=x(),T=ne(!1),t=n?.defaultBaseToken??null,l=n?.defaultQuoteToken??null;te(()=>{if(!e||e.length===0||T.current)return;T.current=!0;let u=k=>e.find(m=>m.chainId===k.chainId&&m.address.toLowerCase()===k.address.toLowerCase())??null,r=t?u(t):null,p=l?u(l):null;r&&p&&r.chainId===p.chainId&&r.address.toLowerCase()===p.address.toLowerCase()?(o.setBaseTokenDirect(r),o.setQuoteTokenDirect(null)):(o.setBaseTokenDirect(r),o.setQuoteTokenDirect(p))},[e,t,l,o]);let h=q(u=>{if(!u){o.setBaseTokenDirect(null);return}let r=x.getState();r.quoteToken&&u.chainId===r.quoteToken.chainId&&u.address.toLowerCase()===r.quoteToken.address.toLowerCase()?o.swapTokensDirect():o.setBaseTokenDirect(u)},[o]),f=q(u=>{if(!u){o.setQuoteTokenDirect(null);return}let r=x.getState();r.baseToken&&u.chainId===r.baseToken.chainId&&u.address.toLowerCase()===r.baseToken.address.toLowerCase()?o.swapTokensDirect():o.setQuoteTokenDirect(u)},[o]),w=q(()=>{o.swapTokensDirect()},[o]);return{baseToken:o.baseToken,quoteToken:o.quoteToken,setBaseToken:h,setQuoteToken:f,swapTokens:w,isLoading:c}}import{create as se}from"zustand";var W=se()(n=>({view:"swap",isTransitioning:!1,transitionType:"navigation",selectedChainFilter:null,hoveredChainName:null,isRecipientInputOpen:!1,recipient:null,hasAllowanceError:!1,baseAmount:null,quoteAmount:null,isTrackingTx:!1,trackingOrderHash:null,txStatus:"pending",walletTab:"wallet",assetSelectionSearch:"",assetSelectionChain:"all",assetSelectionCategory:"all",assetSelectionAddressInput:"",recentChainIds:[],setView:e=>n({view:e,isTransitioning:!0,...e!=="wallet"&&{walletTab:"wallet"}}),setWalletTab:e=>n({walletTab:e}),setIsTransitioning:e=>n({isTransitioning:e}),transitionToView:(e,c="navigation")=>n({isTransitioning:!0,transitionType:c,view:e,...e!=="wallet"&&{walletTab:"wallet"}}),setChainFilter:e=>n({selectedChainFilter:e}),setHoveredChainName:e=>n({hoveredChainName:e}),toggleRecipientInput:()=>n(e=>({isRecipientInputOpen:!e.isRecipientInputOpen,recipient:e.isRecipientInputOpen?null:e.recipient})),setRecipient:e=>n({recipient:e}),setHasAllowanceError:e=>n({hasAllowanceError:e}),setBaseAmount:e=>n({baseAmount:e}),setQuoteAmount:e=>n({quoteAmount:e}),clearAmounts:()=>n({baseAmount:null,quoteAmount:null}),setIsTrackingTx:e=>n({isTrackingTx:e}),setTrackingOrderHash:e=>n({trackingOrderHash:e}),setTxStatus:e=>n({txStatus:e}),startTracking:e=>n({isTrackingTx:!0,trackingOrderHash:e,txStatus:"pending"}),stopTracking:()=>n({isTrackingTx:!1,trackingOrderHash:null,txStatus:"pending"}),setAssetSelectionSearch:e=>n({assetSelectionSearch:e}),setAssetSelectionChain:e=>n({assetSelectionChain:e}),setAssetSelectionCategory:e=>n({assetSelectionCategory:e}),setAssetSelectionAddressInput:e=>n({assetSelectionAddressInput:e}),pushRecentChain:e=>n(c=>{if(e===4326)return c;let T=c.recentChainIds.filter(t=>t!==e);return{recentChainIds:[e,...T].slice(0,3)}}),resetAssetSelection:()=>n({assetSelectionSearch:"",assetSelectionChain:"all",assetSelectionCategory:"all",assetSelectionAddressInput:""}),resetUI:()=>n({view:"swap",isTransitioning:!1,selectedChainFilter:null,hoveredChainName:null,isRecipientInputOpen:!1,recipient:null,hasAllowanceError:!1,baseAmount:null,quoteAmount:null,isTrackingTx:!1,trackingOrderHash:null,txStatus:"pending",walletTab:"wallet",assetSelectionSearch:"",assetSelectionChain:"all",assetSelectionCategory:"all",assetSelectionAddressInput:""})}));import{useCallback as S,useMemo as d}from"react";import{parseUnits as E}from"viem";import{useShallow as oe}from"zustand/react/shallow";var U=(n,e,c,o)=>{let{address:T}=P(),{baseToken:t,quoteToken:l,setBaseToken:h,setQuoteToken:f,swapTokens:w,isLoading:u}=O({defaultBaseToken:n,defaultQuoteToken:e}),{baseAmount:r,quoteAmount:p,setBaseAmount:k,setQuoteAmount:m,clearAmounts:F}=W(oe(s=>({baseAmount:s.baseAmount,quoteAmount:s.quoteAmount,setBaseAmount:s.setBaseAmount,setQuoteAmount:s.setQuoteAmount,clearAmounts:s.clearAmounts}))),{data:Q}=y(t?.address,t?.chainId),{data:R}=y(l?.address,l?.chainId),a=d(()=>{if(!t)return null;let s=Q?.price??t.price;return s===t.price?t:{...t,price:s}},[t,Q?.price]),i=d(()=>{if(!l)return null;let s=R?.price??l.price;return s===l.price?l:{...l,price:s}},[l,R?.price]),{baseBalance:A,quoteBalance:I,isLoading:L}=H(T,a,i),b=d(()=>!A||A.raw==="0"?null:A,[A]),C=d(()=>!I||I.raw==="0"?null:I,[I]),v=d(()=>{if(!a?.chainId)return!1;let s=g(a.chainId);return a.address.toLowerCase()===s?.gasToken.address?.toLowerCase()},[a]),B=d(()=>{if(!i?.chainId)return!1;let s=g(i.chainId);return i.address.toLowerCase()===s?.gasToken.address?.toLowerCase()},[i]),V=d(()=>{if(!v||!a?.chainId||!i||a.chainId!==i.chainId||a.chainId===988)return!1;let s=g(a.chainId);return i.address.toLowerCase()===s?.wrappedAsset.address?.toLowerCase()},[v,a,i]),G=d(()=>{if(!a?.chainId||!i||!B||a.chainId!==i.chainId||a.chainId===988)return!1;let s=g(a.chainId);return a.address.toLowerCase()===s?.wrappedAsset.address?.toLowerCase()},[a,i,B]),M=d(()=>({raw:b?.raw??"0",formatted:b?.formatted??"0"}),[b]),_=d(()=>({raw:C?.raw??"0",formatted:C?.formatted??"0"}),[C]),z=d(()=>!a||typeof r!="number"||a.decimals===void 0||a.decimals===null?null:E(r.toFixed(a.decimals),a.decimals).toString(),[a,r]),J=d(()=>!i||typeof p!="number"||i.decimals===void 0||i.decimals===null?null:E(p.toFixed(i.decimals),i.decimals).toString(),[i,p]),K=S(async s=>{h(s),m(null),c?.(s)},[h,m,c]),X=S(async s=>{f(s),o?.(s)},[f,o]),Y=S(s=>k(s),[k]),Z=S(s=>m(s),[m]),$=S(()=>{w(),l&&c?.(l),t&&o?.(t)},[w,t,l,c,o]),j=S(()=>F(),[F]);return{baseToken:a,baseAmount:r,quoteToken:i,quoteAmount:p,isBaseGasToken:v,isQuoteGasToken:B,isWrappingPair:V,isUnwrappingPair:G,baseBalance:M,quoteBalance:_,baseAmountRaw:z,quoteAmountRaw:J,isBaseBalanceLoading:L,isQuoteBalanceLoading:L,isRegistryLoading:u,setBaseToken:K,setQuoteToken:X,setBaseAmount:Y,setQuoteAmount:Z,swapTokens:$,clearForm:j}};import{createContext as ae,useContext as ie,useMemo as re}from"react";import{jsx as le}from"react/jsx-runtime";var N=ae(null),ye=({children:n,defaultBaseToken:e,defaultQuoteToken:c,onBaseTokenChange:o,onQuoteTokenChange:T})=>{let t=U(e,c,o,T),l=re(()=>t,[t.baseToken,t.quoteToken,t.baseAmount,t.quoteAmount,t.isBaseGasToken,t.isQuoteGasToken,t.isWrappingPair,t.isUnwrappingPair,t.baseBalance,t.quoteBalance,t.baseAmountRaw,t.quoteAmountRaw,t.isBaseBalanceLoading,t.isQuoteBalanceLoading,t.setBaseToken,t.setQuoteToken,t.setBaseAmount,t.setQuoteAmount,t.swapTokens,t.clearForm,t.isRegistryLoading]);return le(N.Provider,{value:l,children:n})},qe=()=>{let n=ie(N);if(!n)throw new Error("useSwapFormContext must be used within SwapFormProvider");return n};export{x as a,O as b,W as c,U as d,ye as e,qe as f};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ var g=Object.create;var f=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var l=(b,a,c,e)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&f(b,d,{get:()=>a[d],enumerable:!(e=h(a,d))||e.enumerable});return b};var n=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?f(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b};
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+ var _chunkMCT3UZTPcjs = require('./chunk-MCT3UZTP.cjs');var _chunkUZWGYG2Scjs = require('./chunk-UZWGYG2S.cjs');var _chunkLXEKOQAGcjs = require('./chunk-LXEKOQAG.cjs');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _jsxruntime = require('react/jsx-runtime');function x(a){if(a===0)return"0";let o=Math.abs(a);return o>=1e4?a.toFixed(0):o>=1e3?a.toFixed(1):o>=100?a.toFixed(2):o>=1?a.toFixed(4):o>=.01?a.toFixed(6):a.toExponential(3)}var N=_react2.default.memo(()=>{let[a,o]=_react.useState.call(void 0, !1),{liquidityError:b,routingError:h}=_chunkMCT3UZTPcjs.e.call(void 0, ),{baseAmount:r,baseToken:s,quoteAmount:l,quoteToken:i}=_chunkUZWGYG2Scjs.f.call(void 0, ),{quoteLoaderVariant:p,widgetType:F}=_chunkLXEKOQAGcjs.b.call(void 0, ),u=F==="compact",n=r&&l&&parseFloat(l.toString())?parseFloat(r.toString())/parseFloat(l.toString()):0,v=b||h,c=s&&i&&r&&parseFloat(r.toString())&&l;return _react.useEffect.call(void 0, ()=>{p==="expanded"&&c&&o(!0)},[p,c]),p==="none"?null:p==="default"?_jsxruntime.jsx.call(void 0, "div",{className:`relative box-border flex flex-row pt-1 h-8 w-full items-center${u?" justify-start overflow-x-auto":" justify-center"}`,children:_jsxruntime.jsx.call(void 0, "div",{className:`flex h-full items-center${u?" min-w-max":" w-full overflow-hidden"}`,style:{color:"var(--widget-foreground)"},children:s&&i?r&&parseFloat(r.toString())?l?_jsxruntime.jsxs.call(void 0, "div",{className:"translate-y-px font-mono flex flex-row items-center gap-2 whitespace-nowrap",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-row items-center gap-1",children:[_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.P,{asset:i,size:"3xs",noChain:!0,className:"mb-0.5"}),_jsxruntime.jsxs.call(void 0, "span",{className:"text-xs uppercase",children:["1 ",_optionalChain([i, 'optionalAccess', _ => _.symbol])]})]}),_jsxruntime.jsx.call(void 0, "span",{className:"text-xs",style:{color:"var(--widget-muted-foreground)"},children:"="}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-row items-center gap-1",children:[_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.P,{asset:s,size:"3xs",noChain:!0,className:"mb-0.5"}),_jsxruntime.jsxs.call(void 0, "span",{className:"text-xs uppercase",children:[x(n)," ",_optionalChain([s, 'optionalAccess', _2 => _2.symbol])]})]}),_jsxruntime.jsx.call(void 0, "span",{className:"text-xs",style:{color:"var(--widget-muted-foreground)"},children:_optionalChain([s, 'optionalAccess', _3 => _3.price])?`\u2248 $${(s.price*n).toFixed(2)}`:""})]}):v?_jsxruntime.jsxs.call(void 0, "div",{className:"flex h-full w-full flex-row pb-1 items-center justify-between",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-xs",style:{color:"var(--widget-destructive)"},children:"Quote not found"}),_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.X,{className:"h-8 w-8",style:{color:"var(--widget-destructive)"}})]}):_jsxruntime.jsxs.call(void 0, "div",{className:"flex h-full w-full flex-row pb-1 items-center justify-between",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-xs",style:{color:"var(--widget-accent)"},children:"Searching For Quote"}),_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.X,{className:"h-8 w-8",style:{color:"var(--widget-accent)"}})]}):_jsxruntime.jsx.call(void 0, "div",{className:"text-xs pb-1",style:{color:"var(--widget-foreground)",opacity:.4},children:"Enter Amount"}):_jsxruntime.jsx.call(void 0, "div",{className:"text-xs pb-1",style:{color:"var(--widget-foreground)",opacity:.4},children:"Enter Amount"})})}):_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col w-full",children:[_jsxruntime.jsx.call(void 0, "div",{className:`relative box-border flex flex-row pt-1 h-8 w-full items-center cursor-pointer${u?" overflow-x-auto":""}`,role:"button",tabIndex:0,onClick:()=>c&&o(d=>!d),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),c&&o(S=>!S))},children:_jsxruntime.jsx.call(void 0, "div",{className:`flex h-full items-center${u?" min-w-max overflow-x-auto":" w-full overflow-hidden"}`,style:{color:"var(--widget-foreground)"},children:s&&i?r&&parseFloat(r.toString())?l?_jsxruntime.jsxs.call(void 0, "div",{className:"translate-y-px font-mono flex w-full flex-row items-center justify-between",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-row items-center gap-2 whitespace-nowrap",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-row items-center gap-1",children:[_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.P,{asset:i,size:"3xs",noChain:!0,className:"mb-0.5"}),_jsxruntime.jsxs.call(void 0, "span",{className:"text-xs uppercase",children:["1 ",_optionalChain([i, 'optionalAccess', _4 => _4.symbol])]})]}),_jsxruntime.jsx.call(void 0, "span",{className:"text-xs",style:{color:"var(--widget-muted-foreground)"},children:"="}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-row items-center gap-1",children:[_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.P,{asset:s,size:"3xs",noChain:!0,className:"mb-0.5"}),_jsxruntime.jsxs.call(void 0, "span",{className:"text-xs uppercase",children:[x(n)," ",_optionalChain([s, 'optionalAccess', _5 => _5.symbol])]})]}),_jsxruntime.jsx.call(void 0, "span",{className:"text-xs",style:{color:"var(--widget-muted-foreground)"},children:_optionalChain([s, 'optionalAccess', _6 => _6.price])?`\u2248 $${(s.price*n).toFixed(2)}`:""})]}),_jsxruntime.jsx.call(void 0, "span",{className:"text-xs ml-2 transition-transform duration-200 shrink-0",style:{color:"var(--widget-muted-foreground)",transform:a?"rotate(180deg)":"rotate(0deg)",display:"inline-block"},children:"\u25BE"})]}):v?_jsxruntime.jsxs.call(void 0, "div",{className:"flex h-full w-full flex-row pb-1 items-center justify-between",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-xs",style:{color:"var(--widget-destructive)"},children:"Quote not found"}),_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.X,{className:"h-8 w-8",style:{color:"var(--widget-destructive)"}})]}):_jsxruntime.jsxs.call(void 0, "div",{className:"flex h-full w-full flex-row pb-1 items-center justify-between",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-xs",style:{color:"var(--widget-accent)"},children:"Searching For Quote"}),_jsxruntime.jsx.call(void 0, _chunkLXEKOQAGcjs.X,{className:"h-8 w-8",style:{color:"var(--widget-accent)"}})]}):_jsxruntime.jsx.call(void 0, "div",{className:"text-xs pb-1",style:{color:"var(--widget-foreground)",opacity:.4},children:"Enter Amount"}):_jsxruntime.jsx.call(void 0, "div",{className:"text-xs pb-1",style:{color:"var(--widget-foreground)",opacity:.4},children:"Enter Amount"})})}),_jsxruntime.jsx.call(void 0, "div",{className:"overflow-hidden transition-all duration-200",style:{maxHeight:a&&c?"80px":"0px",opacity:a&&c?1:0},children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-0.5 pb-1 font-mono",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex justify-between text-2xs",style:{color:"var(--widget-muted-foreground)"},children:[_jsxruntime.jsx.call(void 0, "span",{children:"USD Value"}),_jsxruntime.jsxs.call(void 0, "span",{children:["$",_optionalChain([s, 'optionalAccess', _7 => _7.price])&&l?(s.price*n*parseFloat(l.toString())).toFixed(2):"\u2014"]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex justify-between text-2xs",style:{color:"var(--widget-muted-foreground)"},children:[_jsxruntime.jsx.call(void 0, "span",{children:"Rate"}),_jsxruntime.jsx.call(void 0, "span",{className:"uppercase",children:n>0?`${x(n)} ${_nullishCoalesce(_optionalChain([s, 'optionalAccess', _8 => _8.symbol]), () => (""))}`:"\u2014"})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex justify-between text-2xs",style:{color:"var(--widget-muted-foreground)"},children:[_jsxruntime.jsx.call(void 0, "span",{children:"Order Type"}),_jsxruntime.jsx.call(void 0, "span",{children:"RFQ (Exact Fill)"})]})]})})]})});N.displayName="QuoteLoader";var R=N;exports.a = R;