import{_ as ue,a as O,b0 as Ne}from"./chunk-material-ui-42c43899.js";import{r as o}from"./chunk-react-162a731f.js";import{b as M,g as ce,a as pe,m as Z,s as v,u as fe,n as Ie,j as ne,k as Ue,h as H,d as je}from"./chunk-styled-bfd8e494.js";import{j as N}from"./main-ac2fa4b1.js";function Fe(s){const{className:T,classes:a,pulsate:l=!1,rippleX:P,rippleY:n,rippleSize:c,in:D,onExited:p,timeout:i}=s,[d,h]=o.useState(!1),f=M(T,a.ripple,a.rippleVisible,l&&a.ripplePulsate),C={width:c,height:c,top:-(c/2)+n,left:-(c/2)+P},r=M(a.child,d&&a.childLeaving,l&&a.childPulsate);return!D&&!d&&h(!0),o.useEffect(()=>{if(!D&&p!=null){const m=setTimeout(p,i);return()=>{clearTimeout(m)}}},[p,D,i]),N.jsx("span",{className:f,style:C,children:N.jsx("span",{className:r})})}function at(s){return ce("MuiTouchRipple",s)}const Ke=pe("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),u=Ke,_e=["center","classes","className"];let W=s=>s,ie,re,ae,le;const Q=550,ze=80,Xe=Z(ie||(ie=W` 0% { transform: scale(0); opacity: 0.1; } 100% { transform: scale(1); opacity: 0.3; } `)),Ye=Z(re||(re=W` 0% { opacity: 1; } 100% { opacity: 0; } `)),Ae=Z(ae||(ae=W` 0% { transform: scale(1); } 50% { transform: scale(0.92); } 100% { transform: scale(1); } `)),He=v("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Oe=v(Fe,{name:"MuiTouchRipple",slot:"Ripple"})(le||(le=W` opacity: 0; position: absolute; &.${0} { opacity: 0.3; transform: scale(1); animation-name: ${0}; animation-duration: ${0}ms; animation-timing-function: ${0}; } &.${0} { animation-duration: ${0}ms; } & .${0} { opacity: 1; display: block; width: 100%; height: 100%; border-radius: 50%; background-color: currentColor; } & .${0} { opacity: 0; animation-name: ${0}; animation-duration: ${0}ms; animation-timing-function: ${0}; } & .${0} { position: absolute; /* @noflip */ left: 0px; top: 0; animation-name: ${0}; animation-duration: 2500ms; animation-timing-function: ${0}; animation-iteration-count: infinite; animation-delay: 200ms; } `),u.rippleVisible,Xe,Q,({theme:s})=>s.transitions.easing.easeInOut,u.ripplePulsate,({theme:s})=>s.transitions.duration.shorter,u.child,u.childLeaving,Ye,Q,({theme:s})=>s.transitions.easing.easeInOut,u.childPulsate,Ae,({theme:s})=>s.transitions.easing.easeInOut),We=o.forwardRef(function(T,a){const l=fe({props:T,name:"MuiTouchRipple"}),{center:P=!1,classes:n={},className:c}=l,D=ue(l,_e),[p,i]=o.useState([]),d=o.useRef(0),h=o.useRef(null);o.useEffect(()=>{h.current&&(h.current(),h.current=null)},[p]);const f=o.useRef(!1),C=Ie(),r=o.useRef(null),m=o.useRef(null),F=o.useCallback(t=>{const{pulsate:b,rippleX:R,rippleY:L,rippleSize:j,cb:_}=t;i(g=>[...g,N.jsx(Oe,{classes:{ripple:M(n.ripple,u.ripple),rippleVisible:M(n.rippleVisible,u.rippleVisible),ripplePulsate:M(n.ripplePulsate,u.ripplePulsate),child:M(n.child,u.child),childLeaving:M(n.childLeaving,u.childLeaving),childPulsate:M(n.childPulsate,u.childPulsate)},timeout:Q,pulsate:b,rippleX:R,rippleY:L,rippleSize:j},d.current)]),d.current+=1,h.current=_},[n]),I=o.useCallback((t={},b={},R=()=>{})=>{const{pulsate:L=!1,center:j=P||b.pulsate,fakeElement:_=!1}=b;if((t==null?void 0:t.type)==="mousedown"&&f.current){f.current=!1;return}(t==null?void 0:t.type)==="touchstart"&&(f.current=!0);const g=_?null:m.current,w=g?g.getBoundingClientRect():{width:0,height:0,left:0,top:0};let x,V,$;if(j||t===void 0||t.clientX===0&&t.clientY===0||!t.clientX&&!t.touches)x=Math.round(w.width/2),V=Math.round(w.height/2);else{const{clientX:S,clientY:B}=t.touches&&t.touches.length>0?t.touches[0]:t;x=Math.round(S-w.left),V=Math.round(B-w.top)}if(j)$=Math.sqrt((2*w.width**2+w.height**2)/3),$%2===0&&($+=1);else{const S=Math.max(Math.abs((g?g.clientWidth:0)-x),x)*2+2,B=Math.max(Math.abs((g?g.clientHeight:0)-V),V)*2+2;$=Math.sqrt(S**2+B**2)}t!=null&&t.touches?r.current===null&&(r.current=()=>{F({pulsate:L,rippleX:x,rippleY:V,rippleSize:$,cb:R})},C.start(ze,()=>{r.current&&(r.current(),r.current=null)})):F({pulsate:L,rippleX:x,rippleY:V,rippleSize:$,cb:R})},[P,F,C]),K=o.useCallback(()=>{I({},{pulsate:!0})},[I]),U=o.useCallback((t,b)=>{if(C.clear(),(t==null?void 0:t.type)==="touchend"&&r.current){r.current(),r.current=null,C.start(0,()=>{U(t,b)});return}r.current=null,i(R=>R.length>0?R.slice(1):R),h.current=b},[C]);return o.useImperativeHandle(a,()=>({pulsate:K,start:I,stop:U}),[K,I,U]),N.jsx(He,O({className:M(u.root,n.root,c),ref:m},D,{children:N.jsx(Ne,{component:null,exit:!0,children:p})}))}),qe=We;function Ge(s){return ce("MuiButtonBase",s)}const Je=pe("MuiButtonBase",["root","disabled","focusVisible"]),Qe=Je,Ze=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],ve=s=>{const{disabled:T,focusVisible:a,focusVisibleClassName:l,classes:P}=s,c=je({root:["root",T&&"disabled",a&&"focusVisible"]},Ge,P);return a&&l&&(c.root+=` ${l}`),c},et=v("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(s,T)=>T.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Qe.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),tt=o.forwardRef(function(T,a){const l=fe({props:T,name:"MuiButtonBase"}),{action:P,centerRipple:n=!1,children:c,className:D,component:p="button",disabled:i=!1,disableRipple:d=!1,disableTouchRipple:h=!1,focusRipple:f=!1,LinkComponent:C="a",onBlur:r,onClick:m,onContextMenu:F,onDragLeave:I,onFocus:K,onFocusVisible:U,onKeyDown:t,onKeyUp:b,onMouseDown:R,onMouseLeave:L,onMouseUp:j,onTouchEnd:_,onTouchMove:g,onTouchStart:w,tabIndex:x=0,TouchRippleProps:V,touchRippleRef:$,type:S}=l,B=ue(l,Ze),z=o.useRef(null),y=o.useRef(null),de=ne(y,$),{isFocusVisibleRef:ee,onFocus:he,onBlur:me,ref:be}=Ue(),[E,Y]=o.useState(!1);i&&E&&Y(!1),o.useImperativeHandle(P,()=>({focusVisible:()=>{Y(!0),z.current.focus()}}),[]);const[q,Re]=o.useState(!1);o.useEffect(()=>{Re(!0)},[]);const ge=q&&!d&&!i;o.useEffect(()=>{E&&f&&!d&&q&&y.current.pulsate()},[d,f,E,q]);function k(e,oe,Ee=h){return H(se=>(oe&&oe(se),!Ee&&y.current&&y.current[e](se),!0))}const ye=k("start",R),Me=k("stop",F),Te=k("stop",I),Ce=k("stop",j),xe=k("stop",e=>{E&&e.preventDefault(),L&&L(e)}),Be=k("start",w),ke=k("stop",_),Pe=k("stop",g),we=k("stop",e=>{me(e),ee.current===!1&&Y(!1),r&&r(e)},!1),Ve=H(e=>{z.current||(z.current=e.currentTarget),he(e),ee.current===!0&&(Y(!0),U&&U(e)),K&&K(e)}),G=()=>{const e=z.current;return p&&p!=="button"&&!(e.tagName==="A"&&e.href)},J=o.useRef(!1),$e=H(e=>{f&&!J.current&&E&&y.current&&e.key===" "&&(J.current=!0,y.current.stop(e,()=>{y.current.start(e)})),e.target===e.currentTarget&&G()&&e.key===" "&&e.preventDefault(),t&&t(e),e.target===e.currentTarget&&G()&&e.key==="Enter"&&!i&&(e.preventDefault(),m&&m(e))}),De=H(e=>{f&&e.key===" "&&y.current&&E&&!e.defaultPrevented&&(J.current=!1,y.current.stop(e,()=>{y.current.pulsate(e)})),b&&b(e),m&&e.target===e.currentTarget&&G()&&e.key===" "&&!e.defaultPrevented&&m(e)});let A=p;A==="button"&&(B.href||B.to)&&(A=C);const X={};A==="button"?(X.type=S===void 0?"button":S,X.disabled=i):(!B.href&&!B.to&&(X.role="button"),i&&(X["aria-disabled"]=i));const Le=ne(a,be,z),te=O({},l,{centerRipple:n,component:p,disabled:i,disableRipple:d,disableTouchRipple:h,focusRipple:f,tabIndex:x,focusVisible:E}),Se=ve(te);return N.jsxs(et,O({as:A,className:M(Se.root,D),ownerState:te,onBlur:we,onClick:m,onContextMenu:Me,onFocus:Ve,onKeyDown:$e,onKeyUp:De,onMouseDown:ye,onMouseLeave:xe,onMouseUp:Ce,onDragLeave:Te,onTouchEnd:ke,onTouchMove:Pe,onTouchStart:Be,ref:Le,tabIndex:i?-1:x,type:S},X,B,{children:[c,ge?N.jsx(qe,O({ref:de,center:n},V)):null]}))}),lt=tt;export{lt as B,at as a,Qe as b,Ge as g,u as t};