import{g as T,a as P,r as R,u as j,b as v,d as M,j as d,J as r,e as D,s as u,m as p,K as I}from"./main-BMMRv56V.js";import{S as N}from"./SwitchBase-BoGf5uFH.js";function U(t){return T("MuiSwitch",t)}const o=P("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),E=t=>{const{classes:a,edge:s,size:l,color:h,checked:w,disabled:g}=t,S={root:["root",s&&`edge${r(s)}`,`size${r(l)}`],switchBase:["switchBase",`color${r(h)}`,w&&"checked",g&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},b=D(S,U,a);return{...a,...b}},O=u("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:s}=t;return[a.root,s.edge&&a[`edge${r(s.edge)}`],a[`size${r(s.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,[`& .${o.thumb}`]:{width:16,height:16},[`& .${o.switchBase}`]:{padding:4,[`&.${o.checked}`]:{transform:"translateX(16px)"}}}}]}),A=u(N,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,a)=>{const{ownerState:s}=t;return[a.switchBase,{[`& .${o.input}`]:a.input},s.color!=="default"&&a[`color${r(s.color)}`]]}})(p(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${o.checked}`]:{transform:"translateX(20px)"},[`&.${o.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${o.checked} + .${o.track}`]:{opacity:.5},[`&.${o.disabled} + .${o.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${o.input}`]:{left:"-100%",width:"300%"}})),p(({theme:t})=>({"&:hover":{backgroundColor:t.alpha((t.vars||t).palette.action.active,(t.vars||t).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(I(["light"])).map(([a])=>({props:{color:a},style:{[`&.${o.checked}`]:{color:(t.vars||t).palette[a].main,"&:hover":{backgroundColor:t.alpha((t.vars||t).palette[a].main,(t.vars||t).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${o.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${a}DisabledColor`]:`${t.palette.mode==="light"?t.lighten(t.palette[a].main,.62):t.darken(t.palette[a].main,.55)}`}},[`&.${o.checked} + .${o.track}`]:{backgroundColor:(t.vars||t).palette[a].main}}}))]}))),F=u("span",{name:"MuiSwitch",slot:"Track"})(p(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`}))),X=u("span",{name:"MuiSwitch",slot:"Thumb"})(p(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),L=R.forwardRef(function(a,s){const l=j({props:a,name:"MuiSwitch"}),{className:h,color:w="primary",edge:g=!1,size:S="medium",sx:b,slots:c={},slotProps:e={},...f}=l,i={...l,color:w,edge:g,size:S},n=E(i),k={slots:c,slotProps:e},[y,m]=v("root",{className:M(n.root,h),elementType:O,externalForwardedProps:k,ownerState:i,additionalProps:{sx:b}}),[x,C]=v("thumb",{className:n.thumb,elementType:X,externalForwardedProps:k,ownerState:i}),$=d.jsx(x,{...C}),[B,z]=v("track",{className:n.track,elementType:F,externalForwardedProps:k,ownerState:i});return d.jsxs(y,{...m,children:[d.jsx(A,{type:"checkbox",icon:$,checkedIcon:$,ref:s,ownerState:i,...f,classes:{...n,root:n.switchBase},slots:{...c.switchBase&&{root:c.switchBase},...c.input&&{input:c.input}},slotProps:{...e.switchBase&&{root:typeof e.switchBase=="function"?e.switchBase(i):e.switchBase},input:{role:"switch"},...e.input&&{input:typeof e.input=="function"?e.input(i):e.input}}}),d.jsx(B,{...z})]})});export{L as S};
