import{inflateRaw as L}from"zlib";import{promisify as _}from"util";var m=_(L);var g=new TextDecoder,l=t=>{throw new Error("but-unzip~"+t)},x=t=>g.decode(t),C=t=>{let n=t.length-20,e=Math.max(n-65516,2);for(;(n=t.lastIndexOf(80,n-1))!==-1&&!(t[n+1]===75&&t[n+2]===5&&t[n+3]===6)&&n>e;);return n};function*R(t,n=m){let e=C(t);e===-1&&l(2);let c=(r,i)=>t.subarray(e+=r,e+=i),f=new DataView(t.buffer,t.byteOffset),o=r=>f.getUint16(r+e,!0),s=r=>f.getUint32(r+e,!0),d=o(10);for(d!==o(8)&&l(3),e=s(16);d--;){let r=o(10),i=o(28),E=o(30),u=o(32),p=s(20),y=s(42),b=x(c(46,i)),h=x(c(E,u)),D=e,a;e=y,a=c(30+o(26)+o(28),p),yield{filename:b,comment:h,read:()=>r&8?n(a):r?l(1):a},e=D}}var F=(...t)=>[...R(...t)];export{m as inflateRaw,R as iter,F as unzip};