import{au as _,ax as S,a$ as v,r as n,aw as D,b6 as $,ay as T,az as N,ag as L,J as q,K as I,N as w,O as k,Q as P}from"./index-09tpYl64.js";var F=function(e){return{root:S({},e.typography.button,{boxSizing:"border-box",borderRadius:e.shape.borderRadius,padding:11,border:"1px solid ".concat(v(e.palette.action.active,.12)),color:v(e.palette.action.active,.38),"&$selected":{color:e.palette.action.active,backgroundColor:v(e.palette.action.active,.12),"&:hover":{backgroundColor:v(e.palette.action.active,.15)},"& + &":{borderLeft:0,marginLeft:0}},"&$disabled":{color:v(e.palette.action.disabled,.12)},"&:hover":{textDecoration:"none",backgroundColor:v(e.palette.text.primary,.05),"@media (hover: none)":{backgroundColor:"transparent"},"&$disabled":{backgroundColor:"transparent"}}}),disabled:{},selected:{},label:{width:"100%",display:"inherit",alignItems:"inherit",justifyContent:"inherit"},sizeSmall:{padding:7,fontSize:e.typography.pxToRem(13)},sizeLarge:{padding:15,fontSize:e.typography.pxToRem(15)}}},H=n.forwardRef(function(e,f){var c=e.children,a=e.classes,p=e.className,g=e.disabled,s=g===void 0?!1:g,r=e.disableFocusRipple,d=r===void 0?!1:r,u=e.onChange,h=e.onClick,b=e.selected,o=e.size,x=o===void 0?"medium":o,m=e.value,y=D(e,["children","classes","className","disabled","disableFocusRipple","onChange","onClick","selected","size","value"]),i=function(l){h&&(h(l,m),l.isDefaultPrevented())||u&&u(l,m)};return n.createElement($,S({className:T(a.root,p,s&&a.disabled,b&&a.selected,x!=="medium"&&a["size".concat(N(x))]),disabled:s,focusRipple:!d,ref:f,onClick:i,onChange:u,value:m,"aria-pressed":b},y),n.createElement("span",{className:a.label},c))});const A=_(F,{name:"MuiToggleButton"})(H);function V(t,e){return e===void 0||t===void 0?!1:Array.isArray(e)?e.indexOf(t)>=0:t===e}var M=function(e){return{root:{display:"inline-flex",borderRadius:e.shape.borderRadius},vertical:{flexDirection:"column"},grouped:{},groupedHorizontal:{"&:not(:first-child)":{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:last-child)":{borderTopRightRadius:0,borderBottomRightRadius:0}},groupedVertical:{"&:not(:first-child)":{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},"&:not(:last-child)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},O=n.forwardRef(function(e,f){var c=e.children,a=e.classes,p=e.className,g=e.exclusive,s=g===void 0?!1:g,r=e.onChange,d=e.orientation,u=d===void 0?"horizontal":d,h=e.size,b=h===void 0?"medium":h,o=e.value,x=D(e,["children","classes","className","exclusive","onChange","orientation","size","value"]),m=function(C,l){if(r){var B=o&&o.indexOf(l),z;o&&B>=0?(z=o.slice(),z.splice(B,1)):z=o?o.concat(l):[l],r(C,z)}},y=function(C,l){r&&r(C,o===l?null:l)};return n.createElement("div",S({role:"group",className:T(a.root,p,u==="vertical"&&a.vertical),ref:f},x),n.Children.map(c,function(i){return n.isValidElement(i)?n.cloneElement(i,{className:T(a.grouped,a["grouped".concat(N(u))],i.props.className),onChange:s?y:m,selected:i.props.selected===void 0?V(i.props.value,o):i.props.selected,size:i.props.size||b}):null}))});const J=_(M,{name:"MuiToggleButtonGroup"})(O),Q=t=>{const[e,f]=n.useState(!1),c=n.useRef(!0),[a,p]=L(),g=JSON.stringify(t.map(({key:s,value:r})=>({key:s,value:r})));return n.useEffect(()=>{if(c.current){t.forEach(({key:r,setter:d})=>{if(a.has(r)){const u=decodeURIComponent(a.get(r)||"");d(u)}}),c.current=!1,f(!0);return}const s=new URLSearchParams;t.forEach(({key:r,value:d})=>{s.set(r,d)}),s.toString()!==a.toString()&&p(s,{replace:!0})},[g,p]),e};var R={},E;function j(){if(E)return R;E=1;var t=q(),e=I();Object.defineProperty(R,"__esModule",{value:!0}),R.default=void 0;var f=e(w()),c=t(k()),a=(0,c.default)(f.createElement("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange");return R.default=a,R}var G=j();const U=P(G);export{U as D,J as T,A as a,Q as u};
//# sourceMappingURL=DateRange-EtehwzvH.js.map
