1import {bH as L}from'./main-4WA6AAHG.js';var R=new Error("failed to get response body reader"),y=new Error("failed to complete download");var h="Content-Length";var E=e=>new Promise((t,r)=>{let a=new FileReader;a.onload=()=>{let{result:o}=a;o instanceof ArrayBuffer?t(new Uint8Array(o)):t(new Uint8Array);},a.onerror=o=>{r(Error(`File could not be read! Code=${o?.target?.error?.code||-1}`));},a.readAsArrayBuffer(e);}),A=e=>L(null,null,function*(){let t;if(typeof e=="string")/data:_data\/([a-zA-Z]*);base64,([^"]*)/.test(e)?t=atob(e.split(",")[1]).split("").map(r=>r.charCodeAt(0)):t=yield (yield fetch(e)).arrayBuffer();else if(e instanceof URL)t=yield (yield fetch(e)).arrayBuffer();else if(e instanceof File||e instanceof Blob)t=yield E(e);else return new Uint8Array;return new Uint8Array(t)}),b=e=>L(null,null,function*(){return new Promise(t=>{let r=document.createElement("script"),a=()=>{r.removeEventListener("load",a),t();};r.src=e,r.type="text/javascript",r.addEventListener("load",a),document.getElementsByTagName("head")[0].appendChild(r);})}),u=(e,t)=>L(null,null,function*(){let r=yield fetch(e),a;try{let o=parseInt(r.headers.get(h)||"-1"),d=r.body?.getReader();if(!d)throw R;let l=[],s=0;for(;;){let{done:n,value:i}=yield d.read(),f=i?i.length:0;if(n){if(o!=-1&&o!==s)throw y;t&&t({url:e,total:o,received:s,delta:f,done:n});break}l.push(i),s+=f,t&&t({url:e,total:o,received:s,delta:f,done:n});}let p=new Uint8Array(s),w=0;for(let n of l)p.set(n,w),w+=n.length;a=p.buffer;}catch(o){console.log("failed to send download progress event: ",o),a=yield r.arrayBuffer(),t&&t({url:e,total:a.byteLength,received:a.byteLength,delta:0,done:true});}return a}),B=(e,t,r=false,a)=>L(null,null,function*(){let o=r?yield u(e,a):yield (yield fetch(e)).arrayBuffer(),d=new Blob([o],{type:t});return URL.createObjectURL(d)});export{u as downloadWithProgress,A as fetchFile,b as importScript,B as toBlobURL};
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.