1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CKofFsCb.js","./BCoosobH.js","./entry.B9oqW5Ou.css"])))=>i.map(i=>d[i]); 2import{i as w}from"./BCoosobH.js";import{d as p,t as d,e as f,f as b}from"./DzktYct8.js";import"./BBxAi4ht.js";import"./CdPuwlzh.js";async function h(n,r="gzip"){let e;if(typeof Buffer<"u"){const i=Buffer.from(n,"base64");e=Uint8Array.from(i)}else if(typeof atob<"u")e=Uint8Array.from(atob(n),i=>i.charCodeAt(0));else throw new TypeError("No base64 decoding method available");const o=new Response(new Blob([e])).body?.pipeThrough(new DecompressionStream(r)),c=await new Response(o).text();return JSON.parse(c)}function l(n,r){const e=g(n),t={...r};for(const o in t)e[o]==="json"&&t[o]&&t[o]!=="undefined"&&(t[o]=JSON.parse(t[o])),e[o]==="boolean"&&t[o]!=="undefined"&&(t[o]=!!t[o]);for(const o in t)t[o]==="NULL"&&(t[o]=void 0);return t}function g(n){const r=n.match(/FROM\s+(\w+)/);return r?p[y(r[1])]?.fields||{}:{}}function y(n){return n.replace(/^_content_/,"")}let a;const u=new Map,s=new Map;function I(n){async function r(e){const t=String(e);return a||(s.has("_")||s.set("_",S()),a=await s.get("_"),s.delete("_")),u.has(t)||(s.has(t)||s.set(t,_(e)),await s.get(t),u.set(t,"loaded"),s.delete(t)),a}return{all:async(e,t)=>(await r(n),a.exec({sql:e,bind:t,rowMode:"object",returnValue:"resultRows"}).map(o=>l(e,o))),first:async(e,t)=>(await r(n),l(e,a.exec({sql:e,bind:t,rowMode:"object",returnValue:"resultRows"}).shift())),exec:async(e,t)=>{await r(n),await a.exec({sql:e,bind:t})}}}async function S(){if(!a){const n=await w(()=>import("./CKofFsCb.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>e.default);globalThis.sqlite3ApiConfig={silent:!0,debug:(...e)=>console.debug(...e),warn:(...e)=>{String(e[0]).includes("OPFS sqlite3_vfs")||console.warn(...e)},error:(...e)=>console.error(...e),log:(...e)=>console.log(...e)};const r=await n();a=new r.oo1.DB}return a}async function _(n){if(window.sessionStorage.getItem("previewToken"))return a;let r=null;const e=`checksum_${n}`,t=`collection_${n}`;let o="matched";try{a.exec({sql:`SELECT * FROM ${d.info} where id = '${e}'`,rowMode:"object",returnValue:"resultRows"}).shift()?.version!==f[String(n)]&&(o="mismatch")}catch{o="missing"}if(o!=="matched"){if(window.localStorage.getItem(`content_${e}`)===f[String(n)]&&(r=window.localStorage.getItem(`content_${t}`)),!r){r=await b(void 0,String(n));try{window.localStorage.setItem(`content_${e}`,f[String(n)]),window.localStorage.setItem(`content_${t}`,r)}catch(i){console.error("Database integrity check failed, rebuilding database",i)}}const c=await h(r);await a.exec({sql:`DROP TABLE IF EXISTS ${d[String(n)]}`}),o==="mismatch"&&await a.exec({sql:`DELETE FROM ${d.info} WHERE id = '${e}'`});for(const i of c)try{await a.exec(i)}catch(m){console.error("Error executing command",m)}}return a}export{I as loadDatabaseAdapter};
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.