
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="83ce2199-3947-54ca-8eb7-b95c11250b8e")}catch(e){}}();
import{r as s}from"./index-Wp2u197Z.js";import{u as f}from"./components-Dt5xBELm.js";import{u as l}from"./index-f2gNX814.js";const q=a=>{const[e,r]=f(),[t,i]=s.useState(e.get("q")||""),[n,c]=s.useState(!1),h=l();function o(){location.pathname.includes("/archive")?r(e):h(`archive?q=${t}`)}return s.useEffect(()=>{const u=e.get("q")||"";t!==u&&(e.delete("page"),e.set("q",t),r(e));const m=setTimeout(()=>{t?(e.set("q",t),o()):e.has("q")&&!t&&(e.delete("q"),o()),c(!1)},a);return()=>{clearTimeout(m)}},[t,a,e]),{searchTerm:t,setSearchTerm:i,isSearching:n,setIsSearching:c}};export{q as u};
//# sourceMappingURL=useDebounce-CKjtc7tZ.js.map

//# debugId=83ce2199-3947-54ca-8eb7-b95c11250b8e
