const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-BwXDdQrM.js","assets/chunk-zsgVPwQN.js","assets/preload-helper-rov5CBGT.js","assets/chunk-A7RFOIQ7-jlNKEM6a.js","assets/chunk-BTBUZ646-DM3JdZYw.js","assets/chunk-EADU5A67-CVVwbce8.js","assets/chunk-WGR4JCLS-BWJvuO-n.js","assets/dist-BsAHseYP.js","assets/chunk-3WWIVTCY-BYrk_Nvy.js","assets/chunk-QY3QWFKW-D9_sMH3U.js","assets/dist-DisOkfCO.js","assets/chunk-F2DQ4FIK-Hc2gUWci.js","assets/chunk-VBDAOXYI-4h3am91F.js","assets/pg_dump-Beb71J0-.js","assets/pg_dump-ClZU8_vO.js","assets/editor-C0H0hEHd--dASE4vM.js","assets/connect-BSkeWkEI-qzWu76a7-c-ANI5Gp.js","assets/chunk-YKewjYmz-DgZK4QNE.js","assets/dist-0RiHuA5w-BQ4dSt6u.js","assets/dist-CTgmb7N2-B2RnidgM.js","assets/document-drive-CN2AY1E7-DJyei0OB.js","assets/schemas-D47w5Bks-DMWoGClA.js","assets/parser-CO9mSyAT-DpTf752T.js"])))=>i.map(i=>d[i]);
import{C as e}from"./lz-string-CMojKG3P.js";import{t}from"./preload-helper-rov5CBGT.js";import{lazy as n}from"react";var r=`FILE_DATA`,i=`/pglite/reactor`,a=`/pglite/${e}`,o=[i,a];function s(e,t){let n=e.error??Error(`unknown IDB error`);return Error(`${t}: ${n.message}`,{cause:n})}function c(e){return typeof indexedDB.databases==`function`?indexedDB.databases().then(t=>t.some(t=>t.name===e)).catch(()=>!0):Promise.resolve(!0)}function l(e,t,n){return new Promise((r,i)=>{let a=indexedDB.open(e,t);a.onerror=()=>i(s(a,`IDB open failed for ${e}`)),a.onblocked=()=>i(Error(`IDB open blocked for ${e}`)),a.onupgradeneeded=()=>n?.(a.result),a.onsuccess=()=>r(a.result)})}function u(e){e.objectStoreNames.contains(`FILE_DATA`)||e.createObjectStore(r).createIndex(`timestamp`,`timestamp`,{unique:!1})}async function d(e){if(!await c(e))return null;let t;try{t=await l(e,21,u)}catch{return null}try{if(!t.objectStoreNames.contains(`FILE_DATA`))return null;let n=t.transaction(r,`readonly`).objectStore(r),i=await new Promise((t,r)=>{let i=n.openCursor();i.onerror=()=>r(s(i,`FILE_DATA cursor failed for ${e}`)),i.onsuccess=()=>{let e=i.result;if(!e)return t(null);(typeof e.key==`string`?e.key:``).endsWith(`/PG_VERSION`)?t(e.value):e.continue()}});if(!i)return null;let a=i.contents instanceof Uint8Array?i.contents:new Uint8Array(i.contents),o=new TextDecoder().decode(a).trim(),c=parseInt(o,10);return Number.isFinite(c)?c:null}finally{t.close()}}var f=[16,17],p,m,h=new Set;function g(){for(let e of h)e()}function _(e){return h.add(e),()=>{h.delete(e)}}function v(e){return e===null?null:f.includes(e)?e:null}async function y(){if(p!==void 0)return p;if(m)return m;m=(async()=>{let e=v(await d(i));return p=e,g(),e})();try{return await m}finally{m=void 0}}function b(){return p}function x(){p=void 0,g()}async function S(){return v(await d(a))}function C(e){return e??17}async function w(e){if(e===16)return await t(()=>import(`./dist-BwXDdQrM.js`),__vite__mapDeps([0,1,2,3,4,5,6]));if(e===17)return t(()=>import(`./dist-BsAHseYP.js`),__vite__mapDeps([7,8,1,2,9,10,11,12]));throw Error(`Unsupported PGlite major: ${String(e)}`)}async function T(e){if(e===16)return(await t(async()=>{let{pgDump:e}=await import(`./pg_dump-Beb71J0-.js`);return{pgDump:e}},__vite__mapDeps([13,1,2]))).pgDump;if(e===17)return(await t(async()=>{let{pgDump:e}=await import(`./pg_dump-ClZU8_vO.js`);return{pgDump:e}},__vite__mapDeps([14,1,2]))).pgDump;throw Error(`Unsupported PGlite major: ${String(e)}`)}var E={Component:n(()=>t(()=>import(`./editor-C0H0hEHd--dASE4vM.js`),__vite__mapDeps([15,16,2,17,1,18,19,20,21,22]))),config:{id:`GenericDriveExplorer`,name:`Drive Explorer App`},documentTypes:[`powerhouse/document-drive`]};export{y as a,s as c,T as d,l as f,_ as h,u as i,x as l,C as m,r as n,S as o,d as p,o as r,b as s,E as t,w as u};
//# sourceMappingURL=module-D-kY811l.js.map