"use client";
import{b as g}from"./chunk-ZWSWM4OE.js";import{b as p}from"./chunk-IJ3QNPOW.js";import{e as I}from"./chunk-TERSEXPI.js";import{a as h,m as l}from"./chunk-QKAMOL6D.js";import{p as u,s as r}from"./chunk-KEPQUAOX.js";import a from"clsx";var z=h("EulAmountInput",["input","label","maxBtn","price","header","product","root","customRadius","noBottomRadius","noTopRadius","disabled"]),B=o=>I("EulAmountInput",{header:["header"],input:["input",o.disabled&&"disabled"],label:["label"],maxBtn:["maxBtn"],price:["price"],product:["product"],root:["root",Boolean(o.noBottomRadius||o.noTopRadius)&&"customRadius",!!o.noTopRadius&&"noTopRadius",!!o.noBottomRadius&&"noBottomRadius"]}),n=z;var R=l("label")(({theme:o})=>u`
    display: flex;
    flex-direction: column;
    gap: ${o.spacing(2)};
    align-items: flex-start;
    align-self: stretch;
    padding: ${o.spacing(4)};
    background: ${o.palette.background[200]};
    border-radius: ${o.spacing(2)};
    outline: transparent solid ${o.spacing(.5)};
    outline-offset: ${o.spacing(-.5)};
    transition: ${o.transitions.create(["background-color","outline-color"])};

    &.${n.noBottomRadius} {
      border-radius: ${o.spacing(2,2,0,0)};
    }

    &.${n.noTopRadius} {
      border-radius: ${o.spacing(0,0,2,2)};
    }

    &.${n.noTopRadius}.${n.noBottomRadius} {
      border-radius: 0;
    }

    &:hover {
      background: ${o.palette.background[200]};
    }

    &:focus-within:not(.${n.customRadius}) {
      outline-color: ${o.palette.teal[600]};
    }
  `),k=l("input")(({theme:o})=>u`
    width: 100%;
    padding: 0;
    margin: 0;
    color: ${o.palette.common.white};
    font-size: ${o.typography.input2.fontSize};
    font-family: ${o.typography.fontFamily};
    line-height: ${o.typography.input2.lineHeight};
    background: none;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    -moz-appearance: textfield;

    &:focus {
      outline: none;
      box-shadow: none;
    }

    &::placeholder {
      color: ${o.palette.background[700]};
      opacity: 1;
    }

    &.${n.disabled} {
      color: ${o.palette.background[800]};
    }

    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      margin: 0;
      -webkit-appearance: none;
    }
  `),w=l("button")(({theme:o})=>u`
    padding: ${o.spacing(0,1)};
    color: ${o.palette.teal[700]};
    font: inherit;
    font-size: ${o.typography.pxToRem(14)};
    line-height: ${o.typography.pxToRem(20)};
    background: none;
    border: none;
    box-shadow: none;
    cursor: pointer;
    appearance: none;

    &:focus {
      outline: none;
    }

    &::-moz-focus-inner {
      border: 0;
    }
  `);import{jsx as e,jsxs as s}from"react/jsx-runtime";function C(o){let{asset:A,balance:i,className:T,heading:f,isBalanceLoading:d,isLoading:y,label:S,maxLabel:v,onChange:N,onClickMax:b,product:x,usdValue:c,...$}=o,t=B(o);return s(R,{className:a(T,t.root),children:[s(r,{children:[f&&e(p,{className:a(t.heading),color:"secondary",component:"span",fontWeight:600,variant:"body2",children:f}),s(r,{alignItems:"flex-end",display:"flex",gap:4,justifyContent:"space-between",width:"100%",children:[e(p,{className:a(t.label),color:"secondary",component:"span",variant:"body2",children:S}),y&&e(g,{height:12,width:123}),x&&!y&&e(p,{className:a(t.product),component:"span",variant:"body2",children:x})]})]}),s(r,{alignItems:"center",display:"flex",gap:4,pt:1,width:"100%",children:[e(k,{...$,className:a(t.input),onChange:m=>N?.(m.target.value?/^\d*\.?\d*$/.test(m.target.value)?m.target.value:$.value:void 0)}),A]}),c||i||!i&&d&&s(r,{alignItems:"flex-end",display:"flex",gap:4,height:20,justifyContent:"space-between",width:"100%",children:[c&&s(p,{className:a(t.price),color:"secondary",component:"span",children:["~ $",c]}),i&&!d&&e(p,{className:a(t.balance),component:"span",variant:"body2",children:s(r,{alignItems:"center",display:"flex",gap:2,children:[i,b&&e(w,{className:a(t.maxBtn),onClick:b,children:v||"Max"})]})}),d&&e(g,{height:14,width:168})]})]})}export{n as a,C as b};
