1import{q as b}from"./BDAbjUlD.js";import{ap as v,aq as I,ar as R,as as T,ak as g,at as k,a9 as L,x as O,L as h,l as q}from"./BDr44Kmt.js";function _(t,r,n){return t<r?n==="asc"?-1:1:t>r?n==="asc"?1:-1:0}function $(t,r,n){return t.slice().sort((s,i)=>{const o=n.length;for(let e=0;e<r.length;e++){const f=o>e?n[e]:n[o-1],c=r[e],u=typeof c=="function",a=u?c(s):s[c],l=u?c(i):i[c],y=_(a,l,f);if(y!==0)return y}return 0})}const m=new WeakMap;function C(t,r,n={}){const{mode:s="replace",route:i=v(),router:o=I(),transform:e}=n;let f=p=>p,c=p=>p;typeof e=="function"?f=e:e&&(e.get&&(f=e.get),e.set&&(c=e.set)),m.has(o)||m.set(o,new Map);const u=m.get(o);let a=i.query[t];R(()=>{a=void 0});let l;const y=T((p,x)=>(l=x,{get(){return p(),f(a!==void 0?a:g(r))},set(d){d=c(d),a!==d&&(a=d===g(r)?void 0:d,u.set(t,d===g(r)?void 0:d),x(),k(()=>{if(u.size===0)return;const Q=Object.fromEntries(u.entries());u.clear();const{params:S,query:w,hash:A}=i;o[g(s)]({params:S,query:{...w,...Q},hash:A})}))}}));return L(()=>i.query[t],p=>{a!==f(p)&&(a=p,l())},{flush:"sync"}),y}function D(t="posts/%"){return b("content").where("stem","LIKE",t).select("categories","date","description","draft","image","path","readingTime","recommend","tags","title","type","updated").all().then(r=>r.filter(n=>!n.draft))}function E(t,r){const{bindQuery:n}=r||{},s=n?C(n,void 0):h(),i=q(()=>[...new Set(g(t).map(e=>e.categories?.[0]))]),o=q(()=>g(t).filter(e=>!s.value||e.categories?.[0]===s.value));return{category:s,categories:i,listCategorized:o}}function M(t,r){const n=O(),{bindDirectionQuery:s,bindOrderQuery:i,initialAscend:o=!1,initialOrder:e=n.pagination.sortOrder||"date"}=r||{},f=i?C(i,e):h(e),c={get:l=>l==="true",set:l=>l.toString()},u=s?C(s,o.toString(),{transform:c}):h(o),a=q(()=>$(g(t),[f.value,"date"],[u.value?"asc":"desc"]));return{sortOrder:f,isAscending:u,listSorted:a}}function j(t){return O().article.categories[t]?.icon??"ph:folder-bold"}function F(t="tech",r){const{prefix:n="text"}=r||{};return`${n}-${t}`}export{E as a,j as b,C as c,D as d,F as g,$ as o,M as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.