import{dJ as f,d8 as h,r as l,bq as y,dS as g}from"./index-76d4793e.js";function Q(n,r,e,s,c){const[t,d]=l.useState(()=>c&&e?e(n).matches:s?s(n).matches:r);return y(()=>{if(!e)return;const o=e(n),a=()=>{d(o.matches)};return a(),o.addEventListener("change",a),()=>{o.removeEventListener("change",a)}},[n,e]),t}const S={...g},p=S.useSyncExternalStore;function v(n,r,e,s,c){const t=l.useCallback(()=>r,[r]),d=l.useMemo(()=>{if(c&&e)return()=>e(n).matches;if(s!==null){const{matches:i}=s(n);return()=>i}return t},[t,n,s,c,e]),[o,a]=l.useMemo(()=>{if(e===null)return[t,()=>()=>{}];const i=e(n);return[()=>i.matches,u=>(i.addEventListener("change",u),()=>{i.removeEventListener("change",u)})]},[t,e,n]);return p(a,o,d)}function E(n={}){const{themeId:r}=n;return function(s,c={}){let t=f();t&&r&&(t=t[r]||t);const d=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:o=!1,matchMedia:a=d?window.matchMedia:null,ssrMatchMedia:m=null,noSsr:i=!1}=h({name:"MuiUseMediaQuery",props:c,theme:t});let u=typeof s=="function"?s(t):s;return u=u.replace(/^@media( ?)/m,""),u.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
`)),(p!==void 0?v:Q)(u,o,a,m,i)}}const x=E();export{E as a,x as u};
