import{i as e}from"./chunk-aKtaBQYM.js";import{C as t,Ft as n,H as r,R as i,V as a,Y as o,at as s,it as c,ot as l,vt as u,z as d}from"./mui-BgU4WrXF.js";import{S as f,m as p}from"./List-C_tzGiQy.js";import{Ht as m}from"./index-bel1r0Sr.js";var h=e(n(),1);function g(e){return s(`MuiSwitch`,e)}var _=c(`MuiSwitch`,[`root`,`edgeStart`,`edgeEnd`,`switchBase`,`colorPrimary`,`colorSecondary`,`sizeSmall`,`sizeMedium`,`checked`,`disabled`,`input`,`thumb`,`track`]),v=u(),y=e=>{let{classes:t,edge:n,size:r,color:i,checked:s,disabled:c}=e,l=o({root:[`root`,n&&`edge${a(n)}`,`size${a(r)}`],switchBase:[`switchBase`,`color${a(i)}`,s&&`checked`,c&&`disabled`],thumb:[`thumb`],track:[`track`],input:[`input`]},g,t);return{...t,...l}},b=r(`span`,{name:`MuiSwitch`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.edge&&t[`edge${a(n.edge)}`],t[`size${a(n.size)}`]]}})({display:`inline-flex`,width:58,height:38,overflow:`hidden`,padding:12,boxSizing:`border-box`,position:`relative`,flexShrink:0,zIndex:0,verticalAlign:`middle`,"@media print":{colorAdjust:`exact`},variants:[{props:{edge:`start`},style:{marginLeft:-8}},{props:{edge:`end`},style:{marginRight:-8}},{props:{size:`small`},style:{width:40,height:24,padding:7,[`& .${_.thumb}`]:{width:16,height:16},[`& .${_.switchBase}`]:{padding:4,[`&.${_.checked}`]:{transform:`translateX(16px)`}}}}]}),x=r(m,{name:`MuiSwitch`,slot:`SwitchBase`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.switchBase,{[`& .${_.input}`]:t.input},n.color!=="default"&&t[`color${a(n.color)}`]]}})(d(({theme:e})=>({position:`absolute`,top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode===`light`?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create([`left`,`transform`],{duration:e.transitions.duration.shortest}),[`&.${_.checked}`]:{transform:`translateX(20px)`},[`&.${_.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode===`light`?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${_.checked} + .${_.track}`]:{opacity:.5},[`&.${_.disabled} + .${_.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode===`light`?.12:.2}`},[`& .${_.input}`]:{left:`-100%`,width:`300%`}})),d(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},variants:[...Object.entries(e.palette).filter(t([`light`])).map(([t])=>({props:{color:t},style:{[`&.${_.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:`transparent`}},[`&.${_.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode===`light`?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${_.checked} + .${_.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),S=r(`span`,{name:`MuiSwitch`,slot:`Track`})(d(({theme:e})=>({height:`100%`,width:`100%`,borderRadius:14/2,zIndex:-1,transition:e.transitions.create([`opacity`,`background-color`],{duration:e.transitions.duration.shortest}),"@media (forced-colors: active)":{boxSizing:`border-box`,border:`1px solid ButtonBorder`},backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode===`light`?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode===`light`?.38:.3}`}))),C=r(`span`,{name:`MuiSwitch`,slot:`Thumb`})(d(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:`currentColor`,boxSizing:`border-box`,border:`1px solid transparent`,width:20,height:20,borderRadius:`50%`}))),w=h.forwardRef(function(e,t){let n=i({props:e,name:`MuiSwitch`}),{className:r,color:a=`primary`,edge:o=!1,size:s=`medium`,sx:c,slots:u={},slotProps:d={},...m}=n,h={...n,color:a,edge:o,size:s},g=y(h),_=d.input,w={slots:u,slotProps:d},[T,E]=p(`root`,{className:l(g.root,r),elementType:b,externalForwardedProps:w,ownerState:h,additionalProps:{sx:c}}),[D,O]=p(`thumb`,{className:g.thumb,elementType:C,externalForwardedProps:w,ownerState:h}),k=(0,v.jsx)(D,{...O}),[A,j]=p(`track`,{className:g.track,elementType:S,externalForwardedProps:w,ownerState:h});return(0,v.jsxs)(T,{...E,children:[(0,v.jsx)(x,{type:`checkbox`,icon:k,checkedIcon:k,ref:t,ownerState:h,...m,classes:{...g,root:g.switchBase},slots:{...u.switchBase&&{root:u.switchBase},...u.input&&{input:u.input}},slotProps:{...d.switchBase&&{root:typeof d.switchBase==`function`?d.switchBase(h):d.switchBase},input:f(typeof _==`function`?_(h):_,{role:`switch`})}}),(0,v.jsx)(A,{...j})]})});export{w as t};