UNPKG

@scandit/web-datacapture-core

Version:

Scandit Data Capture SDK for the Web

1 lines 750 B
import {a as a$1}from'./chunk-QCZSSQAQ.js';var a=Promise.resolve(),c=false,i=false,n,l={writableDataPath:""};async function f(e){if(n==null)return;c=true;let t=new Promise((r,o)=>{setTimeout(()=>{o(new a$1({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}));},1500);});try{await Promise.race([new Promise((r,o)=>{n==null||n(e,s=>{if(s!=null){o(s);return}r();});}),t]);}finally{c=false;}}async function u(e){return i||(c?(i=true,a=a.then(async()=>(i=false,f(e)))):a=f(e)),a}async function p(e){l=e,n=FS.syncfs,FS.syncfs=(t,r)=>{let o=r,s=()=>{o();},S=m=>{o(m);};u(t).then(s).catch(S);};try{FS.mkdir(l.writableDataPath);}catch(t){if(t.code!=="EEXIST")throw n=void 0,t}return FS.mount(IDBFS,{},l.writableDataPath),u(true)}export{p as a};