????
Current Path : C:/inetpub/vhost/tracnghiem.gdtsolutions.vn/wwwroot/assets/ |
Current File : C:/inetpub/vhost/tracnghiem.gdtsolutions.vn/wwwroot/assets/useMediaQuery-72cdd2fe.js |
import{aY as l,aq as h,b as f,ar as p,aZ as w}from"./index-9bcd78a9.js";function M(e,i,t,s,a){const u=typeof window<"u"&&typeof window.matchMedia<"u",[c,d]=f.useState(()=>a&&u?t(e).matches:s?s(e).matches:i);return p(()=>{let r=!0;if(!u)return;const n=t(e),o=()=>{r&&d(n.matches)};return o(),n.addListener(o),()=>{r=!1,n.removeListener(o)}},[e,t,u]),c}const m=w["useSyncExternalStore"];function S(e,i,t,s){const a=f.useCallback(()=>i,[i]),u=f.useMemo(()=>{if(s!==null){const{matches:n}=s(e);return()=>n}return a},[a,e,s]),[c,d]=f.useMemo(()=>{if(t===null)return[a,()=>()=>{}];const n=t(e);return[()=>n.matches,o=>(n.addListener(o),()=>{n.removeListener(o)})]},[a,t,e]);return m(d,c,u)}function v(e,i={}){const t=l(),s=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:a=!1,matchMedia:u=s?window.matchMedia:null,ssrMatchMedia:c=null,noSsr:d}=h({name:"MuiUseMediaQuery",props:i,theme:t});typeof e=="function"&&t===null&&console.error(["MUI: The `query` argument provided is invalid.","You are providing a function without a theme in the context.","One of the parent elements needs to use a ThemeProvider."].join(` `));let r=typeof e=="function"?e(t):e;r=r.replace(/^@media( ?)/m,"");const o=(m!==void 0?S:M)(r,a,u,c,d);return f.useDebugValue({query:r,match:o}),o}export{v as u};