{"version":3,"file":"use-media-query.f-kMEeM6.js","sources":["../../../src/components/ui/use-media-query.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\n\nexport function useMediaQuery(query: string) {\n const [value, setValue] = useState(false)\n\n useEffect(() => {\n function onChange(event: MediaQueryListEvent) {\n setValue(event.matches)\n }\n\n const result = matchMedia(query)\n result.addEventListener('change', onChange)\n setValue(result.matches)\n\n return () => result.removeEventListener('change', onChange)\n }, [query])\n\n return value\n}\n"],"names":["useMediaQuery","query","value","setValue","useState","useEffect","onChange","event","result"],"mappings":"4YAEO,SAASA,EAAcC,EAAe,CAC3C,KAAM,CAACC,EAAOC,CAAQ,EAAIC,WAAS,EAAK,EAExCC,OAAAA,EAAAA,UAAU,IAAM,CACd,SAASC,EAASC,EAA4B,CAC5CJ,EAASI,EAAM,OAAO,CACxB,CAEM,MAAAC,EAAS,WAAWP,CAAK,EACxB,OAAAO,EAAA,iBAAiB,SAAUF,CAAQ,EAC1CH,EAASK,EAAO,OAAO,EAEhB,IAAMA,EAAO,oBAAoB,SAAUF,CAAQ,CAAA,EACzD,CAACL,CAAK,CAAC,EAEHC,CACT"}