module.exports=[814747,(e,s,t)=>{s.exports=e.x("path",()=>require("path"))},925372,(e,s,t)=>{s.exports=e.x("better-sqlite3",()=>require("better-sqlite3"))},318146,e=>{"use strict";var s=e.i(605271),t=e.i(431585),c=e.i(422124);class r{async getAllSpecs(e){let r=e?s.db.select().from(t.schema.specs).where((0,c.eq)(t.schema.specs.projectId,e)):s.db.select().from(t.schema.specs);return await r.orderBy(t.schema.specs.specNumber)}async getSpec(e,r){if(!r)return null;let a=parseInt(e.split("-")[0],10);if(isNaN(a))return null;let l=await s.db.select().from(t.schema.specs).where((0,c.and)((0,c.eq)(t.schema.specs.projectId,r),(0,c.eq)(t.schema.specs.specNumber,a))).limit(1);return l.length>0?l[0]:null}async getSpecsByStatus(e,r){let a=[(0,c.eq)(t.schema.specs.status,e)];return r&&a.push((0,c.eq)(t.schema.specs.projectId,r)),await s.db.select().from(t.schema.specs).where((0,c.and)(...a)).orderBy(t.schema.specs.specNumber)}async searchSpecs(e,s){let t=await this.getAllSpecs(s),c=e.toLowerCase();return t.filter(e=>e.specName.toLowerCase().includes(c)||e.title?.toLowerCase().includes(c)||e.contentMd.toLowerCase().includes(c))}invalidateCache(){}}e.s(["DatabaseSource",()=>r])}];

//# sourceMappingURL=%5Broot-of-the-server%5D__f06435b0._.js.map