import{t as V,a as j}from"./index.KC8tfXZc.js";import{N as q}from"./scheduler.jKBL1uqE.js";import{w as _,r as x}from"./paths.r3hZIWZB.js";function D(e){return e?.length!==void 0?e:Array.from(e)}function F(e,f){V(e,1,1,()=>{f.delete(e.key)})}function G(e,f,i,m,w,g,o,v,h,y,d,p){let a=e.length,s=g.length,n=a;const l={};for(;n--;)l[e[n].key]=n;const u=[],S=new Map,L=new Map,k=[];for(n=s;n--;){const t=p(w,g,n),r=i(t);let c=o.get(r);c?m&&k.push(()=>c.p(t,f)):(c=y(r,t),c.c()),S.set(r,u[n]=c),r in l&&L.set(r,Math.abs(n-l[r]))}const z=new Set,I=new Set;function E(t){j(t,1),t.m(v,d),o.set(t.key,t),d=t.first,s--}for(;a&&s;){const t=u[s-1],r=e[a-1],c=t.key,b=r.key;t===r?(d=t.first,a--,s--):S.has(b)?!o.has(c)||z.has(c)?E(t):I.has(b)?a--:L.get(c)>L.get(b)?(I.add(c),E(t)):(z.add(b),a--):(h(r,o),a--)}for(;a--;){const t=e[a];S.has(t.key)||h(t,o)}for(;s;)E(u[s-1]);return q(k),u}var M={local:{},session:{}};function A(e){return e==="local"?localStorage:sessionStorage}function N(e,f,i){var m,w;const g=(m=i?.serializer)!=null?m:JSON,o=(w=i?.storage)!=null?w:"local",v=typeof window<"u"&&typeof document<"u",h=v?A(o):null;function y(d,p){h?.setItem(d,g.stringify(p))}if(!M[o][e]){const d=_(f,s=>{const n=h?.getItem(e);if(n&&s(g.parse(n)),v&&o=="local"){const l=u=>{u.key===e&&s(u.newValue?g.parse(u.newValue):null)};return window.addEventListener("storage",l),()=>window.removeEventListener("storage",l)}}),{subscribe:p,set:a}=d;M[o][e]={set(s){y(e,s),a(s)},update(s){return d.update(n=>{const l=s(n);return y(e,l),l})},subscribe:p}}return M[o][e]}const J=e=>x(window.matchMedia(e).matches,f=>{const i=window.matchMedia(e),m=w=>f(w.matches);return i.addEventListener("change",m),()=>i.removeEventListener("change",m)}),H=_(!1),O=_(!1),K=_(!1);O.subscribe(e=>{e?document.documentElement.style.overflow="hidden":document.documentElement.style.overflow=""});const P=J("(prefers-reduced-motion: reduce)"),R=_(!1),U=_(""),W=N("svelte:recent-searches",[]),Q=N("svelte:theme",{preference:"system",current:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"});Q.subscribe(e=>{document.body.classList.remove("light","dark"),document.body.classList.add(e.current)});export{K as a,U as b,W as c,F as d,D as e,J as m,H as n,O as o,N as p,P as r,R as s,Q as t,G as u};
