From 0f138970380e29bcae247a23ad70e88717102378 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Fri, 13 Dec 2024 18:39:58 -0800 Subject: [PATCH] add dist files --- dist/cli.cjs | 11 + dist/cli.d.cts | 1 + dist/cli.d.ts | 1 + dist/cli.js | 11 + dist/index.all.js | 34 +++ dist/index.all.js.map | 1 + dist/index.cjs | 10 + dist/index.d.cts | 99 +++++++++ dist/index.d.ts | 350 ++++++++++++++++++++++++++++++ dist/index.js | 10 + dist/node/index.cjs | 2 + dist/node/index.d.cts | 27 +++ dist/node/index.d.ts | 27 +++ dist/node/index.js | 2 + dist/utils-dfea30f1.d.ts | 49 +++++ dist/utils.cjs | 1 + dist/utils.d.cts | 1 + dist/utils.d.ts | 1 + dist/utils.js | 1 + dist/warcserializer-a7845700.d.ts | 212 ++++++++++++++++++ 20 files changed, 851 insertions(+) create mode 100755 dist/cli.cjs create mode 100755 dist/cli.d.cts create mode 100755 dist/cli.d.ts create mode 100755 dist/cli.js create mode 100644 dist/index.all.js create mode 100644 dist/index.all.js.map create mode 100644 dist/index.cjs create mode 100644 dist/index.d.cts create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/node/index.cjs create mode 100644 dist/node/index.d.cts create mode 100644 dist/node/index.d.ts create mode 100644 dist/node/index.js create mode 100644 dist/utils-dfea30f1.d.ts create mode 100644 dist/utils.cjs create mode 100644 dist/utils.d.cts create mode 100644 dist/utils.d.ts create mode 100644 dist/utils.js create mode 100644 dist/warcserializer-a7845700.d.ts diff --git a/dist/cli.cjs b/dist/cli.cjs new file mode 100755 index 0000000..9d126e4 --- /dev/null +++ b/dist/cli.cjs @@ -0,0 +1,11 @@ +#!/usr/bin/env node +"use strict";var fe=Object.create;var $=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var we=(n,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of ye(r))!me.call(n,s)&&s!==e&&$(n,s,{get:()=>r[s],enumerable:!(t=pe(r,s))||t.enumerable});return n};var E=(n,r,e)=>(e=n!=null?fe(ge(n)):{},we(r||!n||!n.__esModule?$(e,"default",{value:n,enumerable:!0}):e,n));var L=require("fs"),de=require("path"),v=require("process"),le=E(require("yargs"),1),ce=require("yargs/helpers");function z(n){let r;typeof n=="string"?r=n:n?.length?r=n.reduce((e,t)=>(e+=String.fromCharCode(t),e),""):n?r=n.toString():r="";try{return"__wb_post_data="+btoa(r)}catch{return"__wb_post_data="}}function J(n){try{if(!n.startsWith("https:")&&!n.startsWith("http:"))return n;n=n.replace(/^(https?:\/\/)www\d*\./,"$1");let r=n.toLowerCase(),e=new URL(r),s=e.hostname.split(".").reverse().join(",");if(e.port&&(s+=":"+e.port),s+=")",s+=e.pathname,e.search){let i=e.search.slice(1).split("&");i.sort(),s+="?"+i.join("&")}return s}catch{return n}}function X(n){let{method:r,headers:e,postData:t=""}=n;if(r==="GET")return!1;let i=(l=>{let c=l.get("content-type");if(c)return c;if(!(l instanceof Headers)){for(let[u,m]of l.entries())if(u&&u.toLowerCase()==="content-type")return m}return""})(e),a=i.split(";")[0];function o(l){return l instanceof Uint8Array&&(l=new TextDecoder().decode(l)),l}let d="";switch(a){case"application/x-www-form-urlencoded":d=o(t);break;case"application/json":d=V(o(t));break;case"text/plain":try{d=V(o(t),!1)}catch{d=z(t)}break;case"multipart/form-data":{if(!i)throw new Error("utils cannot call postToGetURL when missing content-type header");d=Ce(o(t),i);break}default:d=z(t)}return d!=null?(n.url=Re(n.url,decodeURI(d),n.method),n.method="GET",n.requestBody=d,!0):!1}function Re(n,r,e){if(!e)return n;let t=n.indexOf("?")>0?"&":"?";return`${n}${t}__wb_method=${e}&${r}`}function Ae(n,r=!0){if(typeof n=="string")try{n=JSON.parse(n)}catch{n={}}let e=new URLSearchParams,t={},s=a=>e.has(a)?(a in t||(t[a]=1),a+"."+ ++t[a]+"_"):a,i=(a,o="")=>{let d="";if(typeof a=="object"&&!(a instanceof Array))try{for(let[l,c]of Object.entries(a))i(c,l)}catch{a===null&&(d="null")}else if(a instanceof Array)for(let l=0;le+=String.fromCharCode(t)),e}function Q(n){let r=new Uint8Array(n.length);for(let e=0;e1?Number(r[1]):"",this._statusText=r.length>2?r[2]:""}get statusCode(){return this._statusCode===void 0&&this._parseResponseStatusLine(),this._statusCode}get protocol(){return this._protocol===void 0&&this._parseResponseStatusLine(),this._protocol}get statusText(){return this._statusText===void 0&&this._parseResponseStatusLine(),this._statusText}_parseRequestStatusLine(){let r=this.statusline.split(" ",2);this._method=r[0]??"",this._requestPath=r.length>1?r[1]:""}get method(){return this._method===void 0&&this._parseRequestStatusLine(),this._method}get requestPath(){return this._requestPath===void 0&&this._parseRequestStatusLine(),this._requestPath}},T=class{constructor(){this.reencodeHeaders=new Set}async parse(r,{headersClass:e,firstLine:t}={headersClass:f}){let s=t||await r.readline();if(!s)return null;let i=s.trimEnd();if(!i)return null;let a=new e,o=await ke(r),d=0,l,c,u,m="",h;for(;d=0&&l0&&s.push(t.slice(e).join(r)),s}async function Ie(n,r){let e=0;for(let t=0;t=n.length){let{value:i}=await r.next();if(!i)break;let a=new Uint8Array(i.length+n.length);a.set(n,0),a.set(i,n.length),n=a}if(n[s+1]===10&&n[s+2]===13&&n[s+3]===10)return[s+3,n];e=s+1}return[-1,n]}async function ke(n){let r=[],e=0,t=0,s=null,i=n[Symbol.asyncIterator]();for await(let a of i){if([t,a]=await Ie(a,i),t>=0){s=a;break}r.push(a),e+=a.byteLength}if(s){let[a,o]=R(s,t+1);r.push(a),e+=a.byteLength,n.unread(o)}else if(!r.length)return"";return be.decode(C(r,e))}var te=E(require("uuid-random"),1);var K=E(require("pako"),1);var Z=new TextDecoder("utf-8"),S=class extends K.default.Inflate{constructor(e,t){super(e);this.ended=!1;this.chunks=[];this.reader=t}onEnd(e){this.err=e,this.err||(this.reader._rawOffset+=this.strm.total_in)}},g=class n{static async readFully(r){let e=[],t=0;for await(let s of r)e.push(s),t+=s.byteLength;return C(e,t)}getReadableStream(){let r=this[Symbol.asyncIterator]();return new ReadableStream({async pull(e){return r.next().then(t=>{t.done||!t.value?e.close():e.enqueue(t.value)})}})}async readFully(){return await n.readFully(this)}async readline(r=0){let e=await this.readlineRaw(r);return e?Z.decode(e):""}async*iterLines(r=0){let e=null;for(;e=await this.readline(r);)yield e}};function Te(n){return!!(n&&Symbol.iterator in Object(n))}function He(n){return!!(n&&Symbol.asyncIterator in Object(n))}var A=class n extends g{constructor(e,t="gzip",s=!1){super();this.compressed=t,this.opts={raw:t==="deflateRaw"},this.inflator=t?new S(this.opts,this):null;let i;if(He(e))i=e;else if(typeof e=="object"&&"read"in e&&typeof e.read=="function")i=n.fromReadable(e);else if(e instanceof ReadableStream)i=n.fromReadable(e.getReader());else if(Te(e))i=n.fromIter(e);else throw new TypeError("Invalid Stream Source");s?this._sourceIter=this.dechunk(i):this._sourceIter=i[Symbol.asyncIterator](),this.lastValue=null,this.errored=!1,this._savedChunk=null,this._rawOffset=0,this._readOffset=0,this.numChunks=0}async _loadNext(){let e=await this._sourceIter.next();return e.done?null:e.value}async*dechunk(e){let t=e instanceof n?e:new n(e,null),s=-1,i=!0;for(;s!=0;){let a=await t.readlineRaw(64),o=new Uint8Array;if(s=a?parseInt(Z.decode(a),16):0,!s||s>2**32){if(Number.isNaN(s)||s>2**32){i||(this.errored=!0),yield a;break}}else if(o=await t.readSize(s),o.length!=s){i?yield a:this.errored=!0,yield o;break}let d=await t.readSize(2);if(d[0]!=13||d[1]!=10){i?yield a:this.errored=!0,yield o,yield d;break}else{if(i=!1,!o||s===0)return;yield o}}yield*t}unread(e){e.length&&(this._readOffset-=e.length,this._savedChunk&&console.log("Already have chunk!"),this._savedChunk=e)}async _next(){if(this._savedChunk){let t=this._savedChunk;return this._savedChunk=null,t}if(this.compressed){let t=this._getNextChunk();if(t)return t}let e=await this._loadNext();for(;this.compressed&&e;){this._push(e);let t=this._getNextChunk(e);if(t)return t;e=await this._loadNext()}return e}_push(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _push when this.compressed is null");this.lastValue=e,this.inflator.ended&&(this.inflator=new S(this.opts,this)),this.inflator.push(e),this.inflator.err&&this.inflator.ended&&this.compressed==="deflate"&&!this.opts.raw&&this.numChunks===0&&(this.opts.raw=!0,this.compressed="deflateRaw",this.inflator=new S(this.opts,this),this.inflator.push(e))}_getNextChunk(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _getNextChunk when this.compressed is null");for(;;){if(this.inflator.chunks.length>0)return this.numChunks++,this.inflator.chunks.shift();if(this.inflator.ended){if(this.inflator.err!==0)return this.compressed=null,e;let t=this.inflator.strm.avail_in;if(t&&this.lastValue){this._push(this.lastValue.slice(-t));continue}}return null}}async*[Symbol.asyncIterator](){let e=null;for(;e=await this._next();)this._readOffset+=e.length,yield e}async readlineRaw(e){let t=[],s=0,i=-1,a=null;for await(let o of this){if(e&&s+o.byteLength>e){a=o,i=e-s-1;let d=o.slice(0,i+1).indexOf(10);d>=0&&(i=d);break}if(i=o.indexOf(10),i>=0){a=o;break}t.push(o),s+=o.byteLength}if(a){let[o,d]=R(a,i+1);t.push(o),s+=o.byteLength,this.unread(d)}else if(!t.length)return null;return C(t,s)}async readFully(){return(await this._readOrSkip())[1]}async readSize(e){return(await this._readOrSkip(e))[1]}async skipSize(e){return(await this._readOrSkip(e,!0))[0]}async _readOrSkip(e=-1,t=!1){let s=[],i=0;for await(let a of this){if(e>=0)if(a.length>e){let[o,d]=R(a,e);t||s.push(o),i+=o.byteLength,this.unread(d);break}else if(a.length===e){t||s.push(a),i+=a.byteLength,e=0;break}else e-=a.length;t||s.push(a),i+=a.byteLength}return t?[i,new Uint8Array]:[i,C(s,i)]}getReadOffset(){return this._readOffset}getRawOffset(){return this.compressed?this._rawOffset:this._readOffset}getRawLength(e){return this.compressed?this.inflator.strm.total_in:this._readOffset-e}static fromReadable(e){return{async*[Symbol.asyncIterator](){let s=null;for(;(s=await e.read())&&!s.done;)yield s.value}}}static fromIter(e){return{async*[Symbol.asyncIterator](){for(let s of e)yield s}}}},_=class extends g{constructor(e,t,s=0){super();this.sourceIter=e,this.length=t,this.limit=t,this.skip=s}setLimitSkip(e,t=0){this.limit=e,this.skip=t}async*[Symbol.asyncIterator](){if(!(this.limit<=0))for await(let e of this.sourceIter){if(this.skip>0)if(e.length>=this.skip){let[,t]=R(e,this.skip);e=t,this.skip=0}else{this.skip-=e.length;continue}if(e.length>this.limit){let[t,s]=R(e,this.limit);e=t,this.sourceIter.unread&&this.sourceIter.unread(s)}if(e.length&&(this.limit-=e.length,yield e),this.limit<=0)break}}async readlineRaw(e){if(this.limit<=0)return null;let t=await this.sourceIter.readlineRaw(e?Math.min(e,this.limit):this.limit);return this.limit-=t?.length||0,t}async skipFully(){let e=this.limit;for(;this.limit>0;)this.limit-=await this.sourceIter.skipSize(this.limit);return e}};var Ue=new TextDecoder("utf-8"),We=new TextEncoder,Le="WARC/1.1",Y="WARC/1.0",ve="http://netpreserve.org/warc/1.0/revisit/identical-payload-digest",Fe="http://netpreserve.org/warc/1.1/revisit/identical-payload-digest",Ee={warcinfo:"application/warc-fields",response:"application/http; msgtype=response",revisit:"application/http; msgtype=response",request:"application/http; msgtype=request",metadata:"application/warc-fields"},H=class n extends g{constructor({warcHeaders:e,reader:t}){super();this._offset=0;this._length=0;this._urlkey="";this.warcHeaders=e,this._reader=t,this._contentReader=null,this.payload=null,this.httpHeaders=null,this.consumed="",this.fixUp()}static create({url:e,date:t,type:s,warcHeaders:i={},filename:a="",httpHeaders:o={},statusline:d="HTTP/1.1 200 OK",warcVersion:l=Y,keepHeadersCase:c=!0,refersToUrl:u=void 0,refersToDate:m=void 0}={},h){function B(w){let he=w;return l===Y&&(w=w.split(".")[0],w.charAt(he.length-1)!="Z"&&(w+="Z")),w}t=B(t||new Date().toISOString());let p=new f(i);if(s==="warcinfo")a&&p.set("WARC-Filename",a);else if(e)try{p.set("WARC-Target-URI",new URL(e).href)}catch{p.set("WARC-Target-URI",e)}p.set("WARC-Date",t),s&&p.set("WARC-Type",s),s==="revisit"&&(p.set("WARC-Profile",l===Le?Fe:ve),u&&(p.set("WARC-Refers-To-Target-URI",u),p.set("WARC-Refers-To-Date",B(m||new Date().toISOString()))));let b=new x({statusline:l,headers:p});b.headers.get("WARC-Record-ID")||b.headers.set("WARC-Record-ID",``),b.headers.get("Content-Type")||b.headers.set("Content-Type",s&&Ee[s]||"application/octet-stream"),h||(h=ee());let j=new n({warcHeaders:b,reader:h}),k=null,F=!1;switch(s){case"response":case"request":case"revisit":c?(k=new f(o),F=!k.size):(k=new Headers(o),F=!Object.entries(o).length),(!F||s!=="revisit")&&(j.httpHeaders=new x({statusline:d,headers:k}));break}return j}static createWARCInfo(e={},t){async function*s(){for(let[i,a]of Object.entries(t))yield We.encode(`${i}: ${a}\r +`)}return e.type="warcinfo",n.create(e,s())}getResponseInfo(){let e=this.httpHeaders;return e?{headers:e.headers,status:e.statusCode,statusText:e.statusText}:null}fixUp(){let e=this.warcHeaders.headers.get("WARC-Target-URI");e&&e.startsWith("<")&&e.endsWith(">")&&this.warcHeaders.headers.set("WARC-Target-URI",e.slice(1,-1))}async readFully(e=!1){if(this.httpHeaders){if(this.payload&&!this.payload.length)return this.payload;if(this._contentReader&&!e)throw new TypeError("WARC Record decoding already started, but requesting raw payload");if(e&&this.consumed==="raw"&&this.payload)return await this._createDecodingReader([this.payload]).readFully()}return this.payload?this.payload:(e?(this.payload=await super.readFully(),this.consumed="content"):(this.payload=await g.readFully(this._reader),this.consumed="raw"),this.payload)}get reader(){if(this.payload&&!this.payload.length)return ee();if(this._contentReader)throw new TypeError("WARC Record decoding already started, but requesting raw payload");return this._reader}get contentReader(){return this.httpHeaders?(this._contentReader||(this._contentReader=this._createDecodingReader(this._reader)),this._contentReader):this._reader}_createDecodingReader(e){if(!this.httpHeaders)throw new Error("WARCRecord cannot call _createDecodingReader when this.httpHeaders === null");let t=this.httpHeaders.headers.get("Content-Encoding"),s=this.httpHeaders.headers.get("Transfer-Encoding"),i=s==="chunked";return!t&&!i&&(t=s),new A(e,t,i)}async readlineRaw(e){if(this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");if(this.contentReader instanceof g)return this.contentReader.readlineRaw(e);throw new Error("WARCRecord cannot call readlineRaw on this.contentReader if it does not extend BaseAsyncIterReader")}async contentText(){let e=await this.readFully(!0);return Ue.decode(e)}async*[Symbol.asyncIterator](){for await(let e of this.contentReader)if(yield e,this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");this.consumed="content"}async skipFully(){if(!this.consumed){if(this._reader instanceof _){let e=await this._reader.skipFully();return this.consumed="skipped",e}throw new Error("WARCRecord cannot call skipFully on this._reader if it is not a LimitReader")}}warcHeader(e){return this.warcHeaders.headers.get(e)}get warcType(){return this.warcHeaders.headers.get("WARC-Type")}get warcTargetURI(){return this.warcHeaders.headers.get("WARC-Target-URI")}get warcDate(){return this.warcHeaders.headers.get("WARC-Date")}get warcRefersToTargetURI(){return this.warcHeaders.headers.get("WARC-Refers-To-Target-URI")}get warcRefersToDate(){return this.warcHeaders.headers.get("WARC-Refers-To-Date")}get warcPayloadDigest(){return this.warcHeaders.headers.get("WARC-Payload-Digest")}get warcBlockDigest(){return this.warcHeaders.headers.get("WARC-Block-Digest")}get warcContentType(){return this.warcHeaders.headers.get("Content-Type")}get warcContentLength(){return Number(this.warcHeaders.headers.get("Content-Length"))}get warcConcurrentTo(){if(this.warcHeaders.headers instanceof f)return this.warcHeaders.headers.getMultiple("WARC-Concurrent-To");{let e=this.warcHeaders.headers.get("WARC-Concurrent-To");return e?e.split(","):[]}}};async function*ee(){}var re=new TextDecoder,O=new Uint8Array([]),U=class n{static async parse(r,e){return new n(r,e).parse()}static iterRecords(r,e){return new n(r,e)[Symbol.asyncIterator]()}constructor(r,{keepHeadersCase:e=!1,parseHttp:t=!0}={}){this._offset=0,this._warcHeadersLength=0,this._headersClass=e?f:Headers,this._parseHttp=t,r instanceof A?this._reader=r:this._reader=new A(r),this._record=null}async readToNextRecord(){if(!this._reader||!this._record)return O;await this._record.skipFully(),this._reader.compressed&&(this._offset=this._reader.getRawOffset());let r=await this._reader.readlineRaw(),e=0;if(!r)r=O;else{if(e=r.byteLength-1,e===9&&re.decode(r).startsWith("WARC/"))return r;for(;e>0;){let t=r[e-1];if(t!==10&&t!==13)break;e--}e&&console.warn(`Content-Length Too Small: Record not followed by newline, Remainder Length: ${e}, Offset: ${this._reader.getRawOffset()-r.byteLength}`)}if(this._reader.compressed)await this._reader.skipSize(2),r=O;else{for(r=await this._reader.readlineRaw();r&&r.byteLength===2;)r=await this._reader.readlineRaw();this._offset=this._reader.getRawOffset(),r&&(this._offset-=r.length)}return r}_initRecordReader(r){return new _(this._reader,Number(r.headers.get("Content-Length")||0))}async parse(){let r=await this.readToNextRecord(),e=r?re.decode(r):"",t=new T,s=await t.parse(this._reader,{firstLine:e,headersClass:this._headersClass});if(!s)return null;this._warcHeadersLength=this._reader.getReadOffset();let i=new H({warcHeaders:s,reader:this._initRecordReader(s)});if(this._record=i,this._parseHttp)switch(i.warcType){case"response":case"request":await this._addHttpHeaders(i,t);break;case"revisit":i.warcContentLength>0&&await this._addHttpHeaders(i,t);break}return i}get offset(){return this._offset}get recordLength(){return this._reader.getRawLength(this._offset)}async*[Symbol.asyncIterator](){let r=null;for(;(r=await this.parse())!==null;)yield r;this._record=null}async _addHttpHeaders(r,e){let t=await e.parse(this._reader,{headersClass:this._headersClass});r.httpHeaders=t;let s=this._reader.getReadOffset()-this._warcHeadersLength;r.reader instanceof _&&r.reader.setLimitSkip(r.warcContentLength-s)}};var M=["offset","warc-type","warc-target-uri"],q=class{constructor(r={},e=M){this.opts=r,r.fields?(this.fields=r.fields,this.reqFields=this.fields.filter(t=>Pe(t))):(this.fields=e,this.reqFields=[]),this.parseHttp=!1}serialize(r){return JSON.stringify(r)+` +`}write(r,e){e.write(this.serialize(r))}async writeAll(r,e){for await(let t of this.iterIndex(r))this.write(t,e)}async*iterIndex(r){let e={strictHeaders:!0,parseHttp:this.parseHttp};for(let{filename:t,reader:s}of r){let i=new U(s,e);yield*this.iterRecords(i,t)}}async*iterRecords(r,e){for await(let t of r){await t.skipFully();let s=this.indexRecord(t,r,e);s&&(yield s)}}indexRecord(r,e,t){if(this.filterRecord&&!this.filterRecord(r))return null;let s={},{offset:i,recordLength:a}=e,o={offset:i,length:a,filename:t};for(let d of this.fields)d in o?s[d]=o[d]:this.setField(d,r,s);return s}setField(r,e,t){let s=this.getField(r,e);s!==null&&(t[r]=s)}getField(r,e){if(r.startsWith("req."))if(e.warcType==="request")r=r.slice(4);else return null;if(r==="http:status")return e.httpHeaders&&(e.warcType==="response"||e.warcType==="revisit")?e.httpHeaders.statusCode:null;if(r.startsWith("http:")){if(e.httpHeaders){let t=e.httpHeaders.headers,s=r.slice(5),i=t.get(s);if(t instanceof Map){let a=s.toLowerCase();for(let o of t.keys())a===o.toLowerCase()&&(i=t.get(o))}return i}return null}return e.warcHeaders.headers.get(r)||null}},I=class extends q{constructor(r,e){super(r,e);for(let t of this.fields)if(t.startsWith("http:")){this.parseHttp=!0;break}}},N="urlkey,timestamp,url,mime,status,digest,length,offset,filename".split(","),De="urlkey,timestamp,url,mime,status,digest,redirect,meta,length,offset,filename".split(","),W=class extends I{constructor(e){super(e,N);switch(this.includeAll=!!e?.all,this.overrideIndexForAll=!!e?.all,this.parseHttp=!0,this.noSurt=!!e?.noSurt,this._lastRecord=null,e?.format){case"cdxj":this.serialize=this.serializeCDXJ;break;case"cdx":this.serialize=this.serializeCDX11;break;case"json":default:break}}async*iterRecords(e,t){this._lastRecord=null;for await(let i of e){await i.readFully();let a=this.indexRecord(i,e,t);a&&(yield a)}let s=this.indexRecord(null,e,t);s&&(yield s)}filterRecord(e){if(this.includeAll)return!0;let t=e.warcType;return!(t==="request"||t==="warcinfo"||(t==="metadata"||t==="resource")&&e.warcContentType==="application/warc-fields")}indexRecord(e,t,s){if(this.overrideIndexForAll)return e?super.indexRecord(e,t,s):null;let i=this._lastRecord;if(this._lastRecord=e,e&&(e._offset=t.offset,e._length=t.recordLength),!i)return null;if(!e||i.warcTargetURI!=e.warcTargetURI)return this.indexRecordPair(i,null,t,s);let a=e.warcType,o=i.warcType;return a==="request"&&(o==="response"||o==="revisit")?(this._lastRecord=null,this.indexRecordPair(i,e,t,s)):(a==="response"||a==="revisit")&&o==="request"?(this._lastRecord=null,this.indexRecordPair(e,i,t,s)):this.indexRecordPair(i,null,t,s)}indexRecordPair(e,t,s,i){let a,o,d=e.warcTargetURI||"";if(t?.httpHeaders&&t.httpHeaders.method!=="GET"){let c={url:d,method:t.httpHeaders.method,headers:t.httpHeaders.headers,postData:t.payload};a=c.method,X(c)&&(o=c.requestBody,d=c.url)}e._urlkey=d;let l=super.indexRecord(e,s,i);if(l&&(e._offset!==void 0&&(l.offset=e._offset,l.length=e._length),a&&(l.method=a),o&&(l.requestBody=o),t&&this.reqFields.length))for(let c of this.reqFields)this.setField(c,t,l);return l}serializeCDXJ(e){let{urlkey:t,timestamp:s}=e;return delete e.urlkey,delete e.timestamp,`${t} ${s} ${JSON.stringify(e,(a,o)=>["offset","length","status"].includes(a)?o==null?"":""+o:o)} +`}serializeCDX11(e){let t=[];for(let s of De)t.push(e[s]!=null?e[s]:"-");return t.join(" ")+` +`}getField(e,t){let s=null;switch(e){case"urlkey":return s=t._urlkey||t.warcTargetURI||null,this.noSurt||s===null?s:J(s);case"timestamp":return s=t.warcDate??"",s.replace(/[-:T]/g,"").slice(0,14);case"url":return t.warcTargetURI;case"mime":switch(t.warcType){case"revisit":return"warc/revisit";case"response":case"request":e="http:content-type";break;default:return t.warcContentType}return s=super.getField(e,t),s?s.toString().split(";",1)[0]?.trim():null;case"status":return super.getField("http:status",t);case"referrer":return super.getField("req.http:referer",t);case"digest":return s=t.warcPayloadDigest,s?s.split(":",2)[1]:null;default:return super.getField(e,t)}}};function Pe(n){return n.startsWith("req.")||n.toLowerCase()==="referrer"}var se=n=>n.flatMap(r=>r.split(",")).filter(r=>!!r),ne=n=>n.positional("filenames",{describe:"WARC file(s) to index",type:"string",array:!0,demandOption:"true"}).option("fields",{alias:"f",describe:"fields to include in index",type:"array",default:M,coerce:se}),ie=n=>n.positional("filenames",{describe:"WARC file(s) to index",type:"string",array:!0,demandOption:"true"}).option("all",{alias:"a",describe:"index all WARC records",type:"boolean"}).option("format",{describe:"output format",choices:["json","cdxj","cdx"],default:"cdxj"}).option("noSurt",{describe:"Use plain urlkey, do not convert to SURT form (Sort-friendly URI Reordering Transform)",type:"boolean"}).option("fields",{alias:"f",describe:"fields to include in index",type:"array",default:N,coerce:se});var ae="2.4.2";var Me=1024*128;async function ue(n=v.stdout,r){let e=Promise.resolve();return r=r||(0,ce.hideBin)(process.argv),(0,le.default)().version(ae).usage("$0 [command]").command({command:"index ",describe:"Index WARC(s)",builder:ne,handler:async t=>{e=new I(t).writeAll(oe(t.filenames),n)}}).command({command:"cdx-index ",describe:"CDX(J) Index of WARC(s)",builder:ie,handler:async t=>{e=new W(t).writeAll(oe(t.filenames),n)}}).demandCommand(1,"Please specify a command").strictCommands().help().parseAsync(r),e}function oe(n){return n.reduce((r,e)=>{if(!(0,L.lstatSync)(e).isFile())return v.stderr.write(`Skipping ${e}, not a file +`),r;let t=(0,L.createReadStream)(e,{highWaterMark:Me});return e=(0,de.basename)(e),r.push({filename:e,reader:t}),r},[])}ue(); diff --git a/dist/cli.d.cts b/dist/cli.d.cts new file mode 100755 index 0000000..908ba84 --- /dev/null +++ b/dist/cli.d.cts @@ -0,0 +1 @@ +#!/usr/bin/env node diff --git a/dist/cli.d.ts b/dist/cli.d.ts new file mode 100755 index 0000000..908ba84 --- /dev/null +++ b/dist/cli.d.ts @@ -0,0 +1 @@ +#!/usr/bin/env node diff --git a/dist/cli.js b/dist/cli.js new file mode 100755 index 0000000..f5d5965 --- /dev/null +++ b/dist/cli.js @@ -0,0 +1,11 @@ +#!/usr/bin/env node +import{lstatSync as Te,createReadStream as He}from"fs";import{basename as Ue}from"path";import{stdout as We,stderr as Le}from"process";import ve from"yargs";import{hideBin as Fe}from"yargs/helpers";function B(n){let r;typeof n=="string"?r=n:n?.length?r=n.reduce((e,t)=>(e+=String.fromCharCode(t),e),""):n?r=n.toString():r="";try{return"__wb_post_data="+btoa(r)}catch{return"__wb_post_data="}}function $(n){try{if(!n.startsWith("https:")&&!n.startsWith("http:"))return n;n=n.replace(/^(https?:\/\/)www\d*\./,"$1");let r=n.toLowerCase(),e=new URL(r),s=e.hostname.split(".").reverse().join(",");if(e.port&&(s+=":"+e.port),s+=")",s+=e.pathname,e.search){let i=e.search.slice(1).split("&");i.sort(),s+="?"+i.join("&")}return s}catch{return n}}function z(n){let{method:r,headers:e,postData:t=""}=n;if(r==="GET")return!1;let i=(l=>{let c=l.get("content-type");if(c)return c;if(!(l instanceof Headers)){for(let[u,w]of l.entries())if(u&&u.toLowerCase()==="content-type")return w}return""})(e),a=i.split(";")[0];function o(l){return l instanceof Uint8Array&&(l=new TextDecoder().decode(l)),l}let d="";switch(a){case"application/x-www-form-urlencoded":d=o(t);break;case"application/json":d=j(o(t));break;case"text/plain":try{d=j(o(t),!1)}catch{d=B(t)}break;case"multipart/form-data":{if(!i)throw new Error("utils cannot call postToGetURL when missing content-type header");d=de(o(t),i);break}default:d=B(t)}return d!=null?(n.url=ie(n.url,decodeURI(d),n.method),n.method="GET",n.requestBody=d,!0):!1}function ie(n,r,e){if(!e)return n;let t=n.indexOf("?")>0?"&":"?";return`${n}${t}__wb_method=${e}&${r}`}function ae(n,r=!0){if(typeof n=="string")try{n=JSON.parse(n)}catch{n={}}let e=new URLSearchParams,t={},s=a=>e.has(a)?(a in t||(t[a]=1),a+"."+ ++t[a]+"_"):a,i=(a,o="")=>{let d="";if(typeof a=="object"&&!(a instanceof Array))try{for(let[l,c]of Object.entries(a))i(c,l)}catch{a===null&&(d="null")}else if(a instanceof Array)for(let l=0;le+=String.fromCharCode(t)),e}function J(n){let r=new Uint8Array(n.length);for(let e=0;e1?Number(r[1]):"",this._statusText=r.length>2?r[2]:""}get statusCode(){return this._statusCode===void 0&&this._parseResponseStatusLine(),this._statusCode}get protocol(){return this._protocol===void 0&&this._parseResponseStatusLine(),this._protocol}get statusText(){return this._statusText===void 0&&this._parseResponseStatusLine(),this._statusText}_parseRequestStatusLine(){let r=this.statusline.split(" ",2);this._method=r[0]??"",this._requestPath=r.length>1?r[1]:""}get method(){return this._method===void 0&&this._parseRequestStatusLine(),this._method}get requestPath(){return this._requestPath===void 0&&this._parseRequestStatusLine(),this._requestPath}},H=class{constructor(){this.reencodeHeaders=new Set}async parse(r,{headersClass:e,firstLine:t}={headersClass:f}){let s=t||await r.readline();if(!s)return null;let i=s.trimEnd();if(!i)return null;let a=new e,o=await fe(r),d=0,l,c,u,w="",h;for(;d=0&&l0&&s.push(t.slice(e).join(r)),s}async function he(n,r){let e=0;for(let t=0;t=n.length){let{value:i}=await r.next();if(!i)break;let a=new Uint8Array(i.length+n.length);a.set(n,0),a.set(i,n.length),n=a}if(n[s+1]===10&&n[s+2]===13&&n[s+3]===10)return[s+3,n];e=s+1}return[-1,n]}async function fe(n){let r=[],e=0,t=0,s=null,i=n[Symbol.asyncIterator]();for await(let a of i){if([t,a]=await he(a,i),t>=0){s=a;break}r.push(a),e+=a.byteLength}if(s){let[a,o]=A(s,t+1);r.push(a),e+=a.byteLength,n.unread(o)}else if(!r.length)return"";return ce.decode(x(r,e))}import me from"uuid-random";import pe from"pako";var X=new TextDecoder("utf-8"),I=class extends pe.Inflate{constructor(e,t){super(e);this.ended=!1;this.chunks=[];this.reader=t}onEnd(e){this.err=e,this.err||(this.reader._rawOffset+=this.strm.total_in)}},m=class n{static async readFully(r){let e=[],t=0;for await(let s of r)e.push(s),t+=s.byteLength;return x(e,t)}getReadableStream(){let r=this[Symbol.asyncIterator]();return new ReadableStream({async pull(e){return r.next().then(t=>{t.done||!t.value?e.close():e.enqueue(t.value)})}})}async readFully(){return await n.readFully(this)}async readline(r=0){let e=await this.readlineRaw(r);return e?X.decode(e):""}async*iterLines(r=0){let e=null;for(;e=await this.readline(r);)yield e}};function ye(n){return!!(n&&Symbol.iterator in Object(n))}function ge(n){return!!(n&&Symbol.asyncIterator in Object(n))}var _=class n extends m{constructor(e,t="gzip",s=!1){super();this.compressed=t,this.opts={raw:t==="deflateRaw"},this.inflator=t?new I(this.opts,this):null;let i;if(ge(e))i=e;else if(typeof e=="object"&&"read"in e&&typeof e.read=="function")i=n.fromReadable(e);else if(e instanceof ReadableStream)i=n.fromReadable(e.getReader());else if(ye(e))i=n.fromIter(e);else throw new TypeError("Invalid Stream Source");s?this._sourceIter=this.dechunk(i):this._sourceIter=i[Symbol.asyncIterator](),this.lastValue=null,this.errored=!1,this._savedChunk=null,this._rawOffset=0,this._readOffset=0,this.numChunks=0}async _loadNext(){let e=await this._sourceIter.next();return e.done?null:e.value}async*dechunk(e){let t=e instanceof n?e:new n(e,null),s=-1,i=!0;for(;s!=0;){let a=await t.readlineRaw(64),o=new Uint8Array;if(s=a?parseInt(X.decode(a),16):0,!s||s>2**32){if(Number.isNaN(s)||s>2**32){i||(this.errored=!0),yield a;break}}else if(o=await t.readSize(s),o.length!=s){i?yield a:this.errored=!0,yield o;break}let d=await t.readSize(2);if(d[0]!=13||d[1]!=10){i?yield a:this.errored=!0,yield o,yield d;break}else{if(i=!1,!o||s===0)return;yield o}}yield*t}unread(e){e.length&&(this._readOffset-=e.length,this._savedChunk&&console.log("Already have chunk!"),this._savedChunk=e)}async _next(){if(this._savedChunk){let t=this._savedChunk;return this._savedChunk=null,t}if(this.compressed){let t=this._getNextChunk();if(t)return t}let e=await this._loadNext();for(;this.compressed&&e;){this._push(e);let t=this._getNextChunk(e);if(t)return t;e=await this._loadNext()}return e}_push(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _push when this.compressed is null");this.lastValue=e,this.inflator.ended&&(this.inflator=new I(this.opts,this)),this.inflator.push(e),this.inflator.err&&this.inflator.ended&&this.compressed==="deflate"&&!this.opts.raw&&this.numChunks===0&&(this.opts.raw=!0,this.compressed="deflateRaw",this.inflator=new I(this.opts,this),this.inflator.push(e))}_getNextChunk(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _getNextChunk when this.compressed is null");for(;;){if(this.inflator.chunks.length>0)return this.numChunks++,this.inflator.chunks.shift();if(this.inflator.ended){if(this.inflator.err!==0)return this.compressed=null,e;let t=this.inflator.strm.avail_in;if(t&&this.lastValue){this._push(this.lastValue.slice(-t));continue}}return null}}async*[Symbol.asyncIterator](){let e=null;for(;e=await this._next();)this._readOffset+=e.length,yield e}async readlineRaw(e){let t=[],s=0,i=-1,a=null;for await(let o of this){if(e&&s+o.byteLength>e){a=o,i=e-s-1;let d=o.slice(0,i+1).indexOf(10);d>=0&&(i=d);break}if(i=o.indexOf(10),i>=0){a=o;break}t.push(o),s+=o.byteLength}if(a){let[o,d]=A(a,i+1);t.push(o),s+=o.byteLength,this.unread(d)}else if(!t.length)return null;return x(t,s)}async readFully(){return(await this._readOrSkip())[1]}async readSize(e){return(await this._readOrSkip(e))[1]}async skipSize(e){return(await this._readOrSkip(e,!0))[0]}async _readOrSkip(e=-1,t=!1){let s=[],i=0;for await(let a of this){if(e>=0)if(a.length>e){let[o,d]=A(a,e);t||s.push(o),i+=o.byteLength,this.unread(d);break}else if(a.length===e){t||s.push(a),i+=a.byteLength,e=0;break}else e-=a.length;t||s.push(a),i+=a.byteLength}return t?[i,new Uint8Array]:[i,x(s,i)]}getReadOffset(){return this._readOffset}getRawOffset(){return this.compressed?this._rawOffset:this._readOffset}getRawLength(e){return this.compressed?this.inflator.strm.total_in:this._readOffset-e}static fromReadable(e){return{async*[Symbol.asyncIterator](){let s=null;for(;(s=await e.read())&&!s.done;)yield s.value}}}static fromIter(e){return{async*[Symbol.asyncIterator](){for(let s of e)yield s}}}},C=class extends m{constructor(e,t,s=0){super();this.sourceIter=e,this.length=t,this.limit=t,this.skip=s}setLimitSkip(e,t=0){this.limit=e,this.skip=t}async*[Symbol.asyncIterator](){if(!(this.limit<=0))for await(let e of this.sourceIter){if(this.skip>0)if(e.length>=this.skip){let[,t]=A(e,this.skip);e=t,this.skip=0}else{this.skip-=e.length;continue}if(e.length>this.limit){let[t,s]=A(e,this.limit);e=t,this.sourceIter.unread&&this.sourceIter.unread(s)}if(e.length&&(this.limit-=e.length,yield e),this.limit<=0)break}}async readlineRaw(e){if(this.limit<=0)return null;let t=await this.sourceIter.readlineRaw(e?Math.min(e,this.limit):this.limit);return this.limit-=t?.length||0,t}async skipFully(){let e=this.limit;for(;this.limit>0;)this.limit-=await this.sourceIter.skipSize(this.limit);return e}};var we=new TextDecoder("utf-8"),Re=new TextEncoder,Ae="WARC/1.1",G="WARC/1.0",_e="http://netpreserve.org/warc/1.0/revisit/identical-payload-digest",Ce="http://netpreserve.org/warc/1.1/revisit/identical-payload-digest",xe={warcinfo:"application/warc-fields",response:"application/http; msgtype=response",revisit:"application/http; msgtype=response",request:"application/http; msgtype=request",metadata:"application/warc-fields"},U=class n extends m{constructor({warcHeaders:e,reader:t}){super();this._offset=0;this._length=0;this._urlkey="";this.warcHeaders=e,this._reader=t,this._contentReader=null,this.payload=null,this.httpHeaders=null,this.consumed="",this.fixUp()}static create({url:e,date:t,type:s,warcHeaders:i={},filename:a="",httpHeaders:o={},statusline:d="HTTP/1.1 200 OK",warcVersion:l=G,keepHeadersCase:c=!0,refersToUrl:u=void 0,refersToDate:w=void 0}={},h){function M(R){let ne=R;return l===G&&(R=R.split(".")[0],R.charAt(ne.length-1)!="Z"&&(R+="Z")),R}t=M(t||new Date().toISOString());let p=new f(i);if(s==="warcinfo")a&&p.set("WARC-Filename",a);else if(e)try{p.set("WARC-Target-URI",new URL(e).href)}catch{p.set("WARC-Target-URI",e)}p.set("WARC-Date",t),s&&p.set("WARC-Type",s),s==="revisit"&&(p.set("WARC-Profile",l===Ae?Ce:_e),u&&(p.set("WARC-Refers-To-Target-URI",u),p.set("WARC-Refers-To-Date",M(w||new Date().toISOString()))));let S=new b({statusline:l,headers:p});S.headers.get("WARC-Record-ID")||S.headers.set("WARC-Record-ID",``),S.headers.get("Content-Type")||S.headers.set("Content-Type",s&&xe[s]||"application/octet-stream"),h||(h=Q());let N=new n({warcHeaders:S,reader:h}),T=null,v=!1;switch(s){case"response":case"request":case"revisit":c?(T=new f(o),v=!T.size):(T=new Headers(o),v=!Object.entries(o).length),(!v||s!=="revisit")&&(N.httpHeaders=new b({statusline:d,headers:T}));break}return N}static createWARCInfo(e={},t){async function*s(){for(let[i,a]of Object.entries(t))yield Re.encode(`${i}: ${a}\r +`)}return e.type="warcinfo",n.create(e,s())}getResponseInfo(){let e=this.httpHeaders;return e?{headers:e.headers,status:e.statusCode,statusText:e.statusText}:null}fixUp(){let e=this.warcHeaders.headers.get("WARC-Target-URI");e&&e.startsWith("<")&&e.endsWith(">")&&this.warcHeaders.headers.set("WARC-Target-URI",e.slice(1,-1))}async readFully(e=!1){if(this.httpHeaders){if(this.payload&&!this.payload.length)return this.payload;if(this._contentReader&&!e)throw new TypeError("WARC Record decoding already started, but requesting raw payload");if(e&&this.consumed==="raw"&&this.payload)return await this._createDecodingReader([this.payload]).readFully()}return this.payload?this.payload:(e?(this.payload=await super.readFully(),this.consumed="content"):(this.payload=await m.readFully(this._reader),this.consumed="raw"),this.payload)}get reader(){if(this.payload&&!this.payload.length)return Q();if(this._contentReader)throw new TypeError("WARC Record decoding already started, but requesting raw payload");return this._reader}get contentReader(){return this.httpHeaders?(this._contentReader||(this._contentReader=this._createDecodingReader(this._reader)),this._contentReader):this._reader}_createDecodingReader(e){if(!this.httpHeaders)throw new Error("WARCRecord cannot call _createDecodingReader when this.httpHeaders === null");let t=this.httpHeaders.headers.get("Content-Encoding"),s=this.httpHeaders.headers.get("Transfer-Encoding"),i=s==="chunked";return!t&&!i&&(t=s),new _(e,t,i)}async readlineRaw(e){if(this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");if(this.contentReader instanceof m)return this.contentReader.readlineRaw(e);throw new Error("WARCRecord cannot call readlineRaw on this.contentReader if it does not extend BaseAsyncIterReader")}async contentText(){let e=await this.readFully(!0);return we.decode(e)}async*[Symbol.asyncIterator](){for await(let e of this.contentReader)if(yield e,this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");this.consumed="content"}async skipFully(){if(!this.consumed){if(this._reader instanceof C){let e=await this._reader.skipFully();return this.consumed="skipped",e}throw new Error("WARCRecord cannot call skipFully on this._reader if it is not a LimitReader")}}warcHeader(e){return this.warcHeaders.headers.get(e)}get warcType(){return this.warcHeaders.headers.get("WARC-Type")}get warcTargetURI(){return this.warcHeaders.headers.get("WARC-Target-URI")}get warcDate(){return this.warcHeaders.headers.get("WARC-Date")}get warcRefersToTargetURI(){return this.warcHeaders.headers.get("WARC-Refers-To-Target-URI")}get warcRefersToDate(){return this.warcHeaders.headers.get("WARC-Refers-To-Date")}get warcPayloadDigest(){return this.warcHeaders.headers.get("WARC-Payload-Digest")}get warcBlockDigest(){return this.warcHeaders.headers.get("WARC-Block-Digest")}get warcContentType(){return this.warcHeaders.headers.get("Content-Type")}get warcContentLength(){return Number(this.warcHeaders.headers.get("Content-Length"))}get warcConcurrentTo(){if(this.warcHeaders.headers instanceof f)return this.warcHeaders.headers.getMultiple("WARC-Concurrent-To");{let e=this.warcHeaders.headers.get("WARC-Concurrent-To");return e?e.split(","):[]}}};async function*Q(){}var K=new TextDecoder,D=new Uint8Array([]),W=class n{static async parse(r,e){return new n(r,e).parse()}static iterRecords(r,e){return new n(r,e)[Symbol.asyncIterator]()}constructor(r,{keepHeadersCase:e=!1,parseHttp:t=!0}={}){this._offset=0,this._warcHeadersLength=0,this._headersClass=e?f:Headers,this._parseHttp=t,r instanceof _?this._reader=r:this._reader=new _(r),this._record=null}async readToNextRecord(){if(!this._reader||!this._record)return D;await this._record.skipFully(),this._reader.compressed&&(this._offset=this._reader.getRawOffset());let r=await this._reader.readlineRaw(),e=0;if(!r)r=D;else{if(e=r.byteLength-1,e===9&&K.decode(r).startsWith("WARC/"))return r;for(;e>0;){let t=r[e-1];if(t!==10&&t!==13)break;e--}e&&console.warn(`Content-Length Too Small: Record not followed by newline, Remainder Length: ${e}, Offset: ${this._reader.getRawOffset()-r.byteLength}`)}if(this._reader.compressed)await this._reader.skipSize(2),r=D;else{for(r=await this._reader.readlineRaw();r&&r.byteLength===2;)r=await this._reader.readlineRaw();this._offset=this._reader.getRawOffset(),r&&(this._offset-=r.length)}return r}_initRecordReader(r){return new C(this._reader,Number(r.headers.get("Content-Length")||0))}async parse(){let r=await this.readToNextRecord(),e=r?K.decode(r):"",t=new H,s=await t.parse(this._reader,{firstLine:e,headersClass:this._headersClass});if(!s)return null;this._warcHeadersLength=this._reader.getReadOffset();let i=new U({warcHeaders:s,reader:this._initRecordReader(s)});if(this._record=i,this._parseHttp)switch(i.warcType){case"response":case"request":await this._addHttpHeaders(i,t);break;case"revisit":i.warcContentLength>0&&await this._addHttpHeaders(i,t);break}return i}get offset(){return this._offset}get recordLength(){return this._reader.getRawLength(this._offset)}async*[Symbol.asyncIterator](){let r=null;for(;(r=await this.parse())!==null;)yield r;this._record=null}async _addHttpHeaders(r,e){let t=await e.parse(this._reader,{headersClass:this._headersClass});r.httpHeaders=t;let s=this._reader.getReadOffset()-this._warcHeadersLength;r.reader instanceof C&&r.reader.setLimitSkip(r.warcContentLength-s)}};var O=["offset","warc-type","warc-target-uri"],P=class{constructor(r={},e=O){this.opts=r,r.fields?(this.fields=r.fields,this.reqFields=this.fields.filter(t=>Se(t))):(this.fields=e,this.reqFields=[]),this.parseHttp=!1}serialize(r){return JSON.stringify(r)+` +`}write(r,e){e.write(this.serialize(r))}async writeAll(r,e){for await(let t of this.iterIndex(r))this.write(t,e)}async*iterIndex(r){let e={strictHeaders:!0,parseHttp:this.parseHttp};for(let{filename:t,reader:s}of r){let i=new W(s,e);yield*this.iterRecords(i,t)}}async*iterRecords(r,e){for await(let t of r){await t.skipFully();let s=this.indexRecord(t,r,e);s&&(yield s)}}indexRecord(r,e,t){if(this.filterRecord&&!this.filterRecord(r))return null;let s={},{offset:i,recordLength:a}=e,o={offset:i,length:a,filename:t};for(let d of this.fields)d in o?s[d]=o[d]:this.setField(d,r,s);return s}setField(r,e,t){let s=this.getField(r,e);s!==null&&(t[r]=s)}getField(r,e){if(r.startsWith("req."))if(e.warcType==="request")r=r.slice(4);else return null;if(r==="http:status")return e.httpHeaders&&(e.warcType==="response"||e.warcType==="revisit")?e.httpHeaders.statusCode:null;if(r.startsWith("http:")){if(e.httpHeaders){let t=e.httpHeaders.headers,s=r.slice(5),i=t.get(s);if(t instanceof Map){let a=s.toLowerCase();for(let o of t.keys())a===o.toLowerCase()&&(i=t.get(o))}return i}return null}return e.warcHeaders.headers.get(r)||null}},k=class extends P{constructor(r,e){super(r,e);for(let t of this.fields)if(t.startsWith("http:")){this.parseHttp=!0;break}}},q="urlkey,timestamp,url,mime,status,digest,length,offset,filename".split(","),be="urlkey,timestamp,url,mime,status,digest,redirect,meta,length,offset,filename".split(","),L=class extends k{constructor(e){super(e,q);switch(this.includeAll=!!e?.all,this.overrideIndexForAll=!!e?.all,this.parseHttp=!0,this.noSurt=!!e?.noSurt,this._lastRecord=null,e?.format){case"cdxj":this.serialize=this.serializeCDXJ;break;case"cdx":this.serialize=this.serializeCDX11;break;case"json":default:break}}async*iterRecords(e,t){this._lastRecord=null;for await(let i of e){await i.readFully();let a=this.indexRecord(i,e,t);a&&(yield a)}let s=this.indexRecord(null,e,t);s&&(yield s)}filterRecord(e){if(this.includeAll)return!0;let t=e.warcType;return!(t==="request"||t==="warcinfo"||(t==="metadata"||t==="resource")&&e.warcContentType==="application/warc-fields")}indexRecord(e,t,s){if(this.overrideIndexForAll)return e?super.indexRecord(e,t,s):null;let i=this._lastRecord;if(this._lastRecord=e,e&&(e._offset=t.offset,e._length=t.recordLength),!i)return null;if(!e||i.warcTargetURI!=e.warcTargetURI)return this.indexRecordPair(i,null,t,s);let a=e.warcType,o=i.warcType;return a==="request"&&(o==="response"||o==="revisit")?(this._lastRecord=null,this.indexRecordPair(i,e,t,s)):(a==="response"||a==="revisit")&&o==="request"?(this._lastRecord=null,this.indexRecordPair(e,i,t,s)):this.indexRecordPair(i,null,t,s)}indexRecordPair(e,t,s,i){let a,o,d=e.warcTargetURI||"";if(t?.httpHeaders&&t.httpHeaders.method!=="GET"){let c={url:d,method:t.httpHeaders.method,headers:t.httpHeaders.headers,postData:t.payload};a=c.method,z(c)&&(o=c.requestBody,d=c.url)}e._urlkey=d;let l=super.indexRecord(e,s,i);if(l&&(e._offset!==void 0&&(l.offset=e._offset,l.length=e._length),a&&(l.method=a),o&&(l.requestBody=o),t&&this.reqFields.length))for(let c of this.reqFields)this.setField(c,t,l);return l}serializeCDXJ(e){let{urlkey:t,timestamp:s}=e;return delete e.urlkey,delete e.timestamp,`${t} ${s} ${JSON.stringify(e,(a,o)=>["offset","length","status"].includes(a)?o==null?"":""+o:o)} +`}serializeCDX11(e){let t=[];for(let s of be)t.push(e[s]!=null?e[s]:"-");return t.join(" ")+` +`}getField(e,t){let s=null;switch(e){case"urlkey":return s=t._urlkey||t.warcTargetURI||null,this.noSurt||s===null?s:$(s);case"timestamp":return s=t.warcDate??"",s.replace(/[-:T]/g,"").slice(0,14);case"url":return t.warcTargetURI;case"mime":switch(t.warcType){case"revisit":return"warc/revisit";case"response":case"request":e="http:content-type";break;default:return t.warcContentType}return s=super.getField(e,t),s?s.toString().split(";",1)[0]?.trim():null;case"status":return super.getField("http:status",t);case"referrer":return super.getField("req.http:referer",t);case"digest":return s=t.warcPayloadDigest,s?s.split(":",2)[1]:null;default:return super.getField(e,t)}}};function Se(n){return n.startsWith("req.")||n.toLowerCase()==="referrer"}var Z=n=>n.flatMap(r=>r.split(",")).filter(r=>!!r),Y=n=>n.positional("filenames",{describe:"WARC file(s) to index",type:"string",array:!0,demandOption:"true"}).option("fields",{alias:"f",describe:"fields to include in index",type:"array",default:O,coerce:Z}),ee=n=>n.positional("filenames",{describe:"WARC file(s) to index",type:"string",array:!0,demandOption:"true"}).option("all",{alias:"a",describe:"index all WARC records",type:"boolean"}).option("format",{describe:"output format",choices:["json","cdxj","cdx"],default:"cdxj"}).option("noSurt",{describe:"Use plain urlkey, do not convert to SURT form (Sort-friendly URI Reordering Transform)",type:"boolean"}).option("fields",{alias:"f",describe:"fields to include in index",type:"array",default:q,coerce:Z});var te="2.4.2";var Ee=1024*128;async function se(n=We,r){let e=Promise.resolve();return r=r||Fe(process.argv),ve().version(te).usage("$0 [command]").command({command:"index ",describe:"Index WARC(s)",builder:Y,handler:async t=>{e=new k(t).writeAll(re(t.filenames),n)}}).command({command:"cdx-index ",describe:"CDX(J) Index of WARC(s)",builder:ee,handler:async t=>{e=new L(t).writeAll(re(t.filenames),n)}}).demandCommand(1,"Please specify a command").strictCommands().help().parseAsync(r),e}function re(n){return n.reduce((r,e)=>{if(!Te(e).isFile())return Le.write(`Skipping ${e}, not a file +`),r;let t=He(e,{highWaterMark:Ee});return e=Ue(e),r.push({filename:e,reader:t}),r},[])}se(); diff --git a/dist/index.all.js b/dist/index.all.js new file mode 100644 index 0000000..51e0656 --- /dev/null +++ b/dist/index.all.js @@ -0,0 +1,34 @@ +var xB=Object.create;var ki=Object.defineProperty;var mB=Object.getOwnPropertyDescriptor;var zB=Object.getOwnPropertyNames;var vB=Object.getPrototypeOf,XB=Object.prototype.hasOwnProperty;var yi=(A=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(A,{get:(g,I)=>(typeof require<"u"?require:g)[I]}):A)(function(A){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+A+'" is not supported')});var q=(A,g)=>()=>(g||A((g={exports:{}}).exports,g),g.exports);var ZB=(A,g,I,i)=>{if(g&&typeof g=="object"||typeof g=="function")for(let B of zB(g))!XB.call(A,B)&&B!==I&&ki(A,B,{get:()=>g[B],enumerable:!(i=mB(g,B))||i.enumerable});return A};var uI=(A,g,I)=>(I=A!=null?xB(vB(A)):{},ZB(g||!A||!A.__esModule?ki(I,"default",{value:A,enumerable:!0}):I,A));var $=q(R=>{"use strict";var bB=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function VB(A,g){return Object.prototype.hasOwnProperty.call(A,g)}R.assign=function(A){for(var g=Array.prototype.slice.call(arguments,1);g.length;){var I=g.shift();if(I){if(typeof I!="object")throw new TypeError(I+"must be non-object");for(var i in I)VB(I,i)&&(A[i]=I[i])}}return A};R.shrinkBuf=function(A,g){return A.length===g?A:A.subarray?A.subarray(0,g):(A.length=g,A)};var LB={arraySet:function(A,g,I,i,B){if(g.subarray&&A.subarray){A.set(g.subarray(I,I+i),B);return}for(var Q=0;Q{"use strict";var WB=$(),_B=4,ui=0,pi=1,PB=2;function wA(A){for(var g=A.length;--g>=0;)A[g]=0}var TB=0,Ji=1,jB=2,$B=3,AQ=258,JI=29,YA=256,KA=YA+1+JI,DA=30,KI=19,Ki=2*KA+1,aA=15,pI=16,IQ=7,qI=256,qi=16,Mi=17,Ri=18,UI=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],II=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],iQ=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Yi=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],gQ=512,AA=new Array((KA+2)*2);wA(AA);var JA=new Array(DA*2);wA(JA);var qA=new Array(gQ);wA(qA);var MA=new Array(AQ-$B+1);wA(MA);var MI=new Array(JI);wA(MI);var iI=new Array(DA);wA(iI);function SI(A,g,I,i,B){this.static_tree=A,this.extra_bits=g,this.extra_base=I,this.elems=i,this.max_length=B,this.has_stree=A&&A.length}var xi,mi,zi;function HI(A,g){this.dyn_tree=A,this.max_code=0,this.stat_desc=g}function vi(A){return A<256?qA[A]:qA[256+(A>>>7)]}function RA(A,g){A.pending_buf[A.pending++]=g&255,A.pending_buf[A.pending++]=g>>>8&255}function x(A,g,I){A.bi_valid>pI-I?(A.bi_buf|=g<>pI-A.bi_valid,A.bi_valid+=I-pI):(A.bi_buf|=g<>>=1,I<<=1;while(--g>0);return I>>>1}function BQ(A){A.bi_valid===16?(RA(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):A.bi_valid>=8&&(A.pending_buf[A.pending++]=A.bi_buf&255,A.bi_buf>>=8,A.bi_valid-=8)}function QQ(A,g){var I=g.dyn_tree,i=g.max_code,B=g.stat_desc.static_tree,Q=g.stat_desc.has_stree,e=g.stat_desc.extra_bits,C=g.stat_desc.extra_base,E=g.stat_desc.max_length,t,a,s,o,n,D,d=0;for(o=0;o<=aA;o++)A.bl_count[o]=0;for(I[A.heap[A.heap_max]*2+1]=0,t=A.heap_max+1;tE&&(o=E,d++),I[a*2+1]=o,!(a>i)&&(A.bl_count[o]++,n=0,a>=C&&(n=e[a-C]),D=I[a*2],A.opt_len+=D*(o+n),Q&&(A.static_len+=D*(B[a*2+1]+n)));if(d!==0){do{for(o=E-1;A.bl_count[o]===0;)o--;A.bl_count[o]--,A.bl_count[o+1]+=2,A.bl_count[E]--,d-=2}while(d>0);for(o=E;o!==0;o--)for(a=A.bl_count[o];a!==0;)s=A.heap[--t],!(s>i)&&(I[s*2+1]!==o&&(A.opt_len+=(o-I[s*2+1])*I[s*2],I[s*2+1]=o),a--)}}function Zi(A,g,I){var i=new Array(aA+1),B=0,Q,e;for(Q=1;Q<=aA;Q++)i[Q]=B=B+I[Q-1]<<1;for(e=0;e<=g;e++){var C=A[e*2+1];C!==0&&(A[e*2]=Xi(i[C]++,C))}}function eQ(){var A,g,I,i,B,Q=new Array(aA+1);for(I=0,i=0;i>=7;i8?RA(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function CQ(A,g,I,i){Vi(A),i&&(RA(A,I),RA(A,~I)),WB.arraySet(A.pending_buf,A.window,g,I,A.pending),A.pending+=I}function Si(A,g,I,i){var B=g*2,Q=I*2;return A[B]>1;e>=1;e--)GI(A,I,e);t=Q;do e=A.heap[1],A.heap[1]=A.heap[A.heap_len--],GI(A,I,1),C=A.heap[1],A.heap[--A.heap_max]=e,A.heap[--A.heap_max]=C,I[t*2]=I[e*2]+I[C*2],A.depth[t]=(A.depth[e]>=A.depth[C]?A.depth[e]:A.depth[C])+1,I[e*2+1]=I[C*2+1]=t,A.heap[1]=t++,GI(A,I,1);while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],QQ(A,g),Zi(I,E,A.bl_count)}function Gi(A,g,I){var i,B=-1,Q,e=g[0*2+1],C=0,E=7,t=4;for(e===0&&(E=138,t=3),g[(I+1)*2+1]=65535,i=0;i<=I;i++)Q=e,e=g[(i+1)*2+1],!(++C=3&&A.bl_tree[Yi[g]*2+1]===0;g--);return A.opt_len+=3*(g+1)+5+5+4,g}function aQ(A,g,I,i){var B;for(x(A,g-257,5),x(A,I-1,5),x(A,i-4,4),B=0;B>>=1)if(g&1&&A.dyn_ltree[I*2]!==0)return ui;if(A.dyn_ltree[9*2]!==0||A.dyn_ltree[10*2]!==0||A.dyn_ltree[13*2]!==0)return pi;for(I=32;I0?(A.strm.data_type===PB&&(A.strm.data_type=EQ(A)),NI(A,A.l_desc),NI(A,A.d_desc),e=tQ(A),B=A.opt_len+3+7>>>3,Q=A.static_len+3+7>>>3,Q<=B&&(B=Q)):B=Q=I+5,I+4<=B&&g!==-1?Li(A,g,I,i):A.strategy===_B||Q===B?(x(A,(Ji<<1)+(i?1:0),3),Hi(A,AA,JA)):(x(A,(jB<<1)+(i?1:0),3),aQ(A,A.l_desc.max_code+1,A.d_desc.max_code+1,e+1),Hi(A,A.dyn_ltree,A.dyn_dtree)),bi(A),i&&Vi(A)}function cQ(A,g,I){return A.pending_buf[A.d_buf+A.last_lit*2]=g>>>8&255,A.pending_buf[A.d_buf+A.last_lit*2+1]=g&255,A.pending_buf[A.l_buf+A.last_lit]=I&255,A.last_lit++,g===0?A.dyn_ltree[I*2]++:(A.matches++,g--,A.dyn_ltree[(MA[I]+YA+1)*2]++,A.dyn_dtree[vi(g)*2]++),A.last_lit===A.lit_bufsize-1}lA._tr_init=nQ;lA._tr_stored_block=Li;lA._tr_flush_block=rQ;lA._tr_tally=cQ;lA._tr_align=oQ});var RI=q((kC,Wi)=>{"use strict";function hQ(A,g,I,i){for(var B=A&65535|0,Q=A>>>16&65535|0,e=0;I!==0;){e=I>2e3?2e3:I,I-=e;do B=B+g[i++]|0,Q=Q+B|0;while(--e);B%=65521,Q%=65521}return B|Q<<16|0}Wi.exports=hQ});var YI=q((yC,_i)=>{"use strict";function dQ(){for(var A,g=[],I=0;I<256;I++){A=I;for(var i=0;i<8;i++)A=A&1?3988292384^A>>>1:A>>>1;g[I]=A}return g}var fQ=dQ();function sQ(A,g,I,i){var B=fQ,Q=i+I;A^=-1;for(var e=i;e>>8^B[(A^g[e])&255];return A^-1}_i.exports=sQ});var gI=q((uC,Pi)=>{"use strict";Pi.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Qg=q(_=>{"use strict";var Y=$(),z=Oi(),Ag=RI(),gA=YI(),FQ=gI(),rA=0,DQ=1,wQ=3,tA=4,Ti=5,W=0,ji=1,v=-2,lQ=-3,xI=-5,kQ=-1,yQ=1,BI=2,uQ=3,pQ=4,SQ=0,HQ=2,tI=8,GQ=9,UQ=15,NQ=8,JQ=29,KQ=256,zI=KQ+1+JQ,qQ=30,MQ=19,RQ=2*zI+1,YQ=15,p=3,eA=258,b=eA+p+1,xQ=32,aI=42,vI=69,QI=73,eI=91,CI=103,EA=113,mA=666,K=1,zA=2,nA=3,uA=4,mQ=3;function CA(A,g){return A.msg=FQ[g],g}function $i(A){return(A<<1)-(A>4?9:0)}function QA(A){for(var g=A.length;--g>=0;)A[g]=0}function BA(A){var g=A.state,I=g.pending;I>A.avail_out&&(I=A.avail_out),I!==0&&(Y.arraySet(A.output,g.pending_buf,g.pending_out,I,A.next_out),A.next_out+=I,g.pending_out+=I,A.total_out+=I,A.avail_out-=I,g.pending-=I,g.pending===0&&(g.pending_out=0))}function M(A,g){z._tr_flush_block(A,A.block_start>=0?A.block_start:-1,A.strstart-A.block_start,g),A.block_start=A.strstart,BA(A.strm)}function H(A,g){A.pending_buf[A.pending++]=g}function xA(A,g){A.pending_buf[A.pending++]=g>>>8&255,A.pending_buf[A.pending++]=g&255}function zQ(A,g,I,i){var B=A.avail_in;return B>i&&(B=i),B===0?0:(A.avail_in-=B,Y.arraySet(g,A.input,A.next_in,B,I),A.state.wrap===1?A.adler=Ag(A.adler,g,B,I):A.state.wrap===2&&(A.adler=gA(A.adler,g,B,I)),A.next_in+=B,A.total_in+=B,B)}function Ig(A,g){var I=A.max_chain_length,i=A.strstart,B,Q,e=A.prev_length,C=A.nice_match,E=A.strstart>A.w_size-b?A.strstart-(A.w_size-b):0,t=A.window,a=A.w_mask,s=A.prev,o=A.strstart+eA,n=t[i+e-1],D=t[i+e];A.prev_length>=A.good_match&&(I>>=2),C>A.lookahead&&(C=A.lookahead);do if(B=g,!(t[B+e]!==D||t[B+e-1]!==n||t[B]!==t[i]||t[++B]!==t[i+1])){i+=2,B++;do;while(t[++i]===t[++B]&&t[++i]===t[++B]&&t[++i]===t[++B]&&t[++i]===t[++B]&&t[++i]===t[++B]&&t[++i]===t[++B]&&t[++i]===t[++B]&&t[++i]===t[++B]&&ie){if(A.match_start=g,e=Q,Q>=C)break;n=t[i+e-1],D=t[i+e]}}while((g=s[g&a])>E&&--I!==0);return e<=A.lookahead?e:A.lookahead}function oA(A){var g=A.w_size,I,i,B,Q,e;do{if(Q=A.window_size-A.lookahead-A.strstart,A.strstart>=g+(g-b)){Y.arraySet(A.window,A.window,g,g,0),A.match_start-=g,A.strstart-=g,A.block_start-=g,i=A.hash_size,I=i;do B=A.head[--I],A.head[I]=B>=g?B-g:0;while(--i);i=g,I=i;do B=A.prev[--I],A.prev[I]=B>=g?B-g:0;while(--i);Q+=g}if(A.strm.avail_in===0)break;if(i=zQ(A.strm,A.window,A.strstart+A.lookahead,Q),A.lookahead+=i,A.lookahead+A.insert>=p)for(e=A.strstart-A.insert,A.ins_h=A.window[e],A.ins_h=(A.ins_h<A.pending_buf_size-5&&(I=A.pending_buf_size-5);;){if(A.lookahead<=1){if(oA(A),A.lookahead===0&&g===rA)return K;if(A.lookahead===0)break}A.strstart+=A.lookahead,A.lookahead=0;var i=A.block_start+I;if((A.strstart===0||A.strstart>=i)&&(A.lookahead=A.strstart-i,A.strstart=i,M(A,!1),A.strm.avail_out===0)||A.strstart-A.block_start>=A.w_size-b&&(M(A,!1),A.strm.avail_out===0))return K}return A.insert=0,g===tA?(M(A,!0),A.strm.avail_out===0?nA:uA):(A.strstart>A.block_start&&(M(A,!1),A.strm.avail_out===0),K)}function mI(A,g){for(var I,i;;){if(A.lookahead=p&&(A.ins_h=(A.ins_h<=p)if(i=z._tr_tally(A,A.strstart-A.match_start,A.match_length-p),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=p){A.match_length--;do A.strstart++,A.ins_h=(A.ins_h<=p&&(A.ins_h=(A.ins_h<4096)&&(A.match_length=p-1)),A.prev_length>=p&&A.match_length<=A.prev_length){B=A.strstart+A.lookahead-p,i=z._tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-p),A.lookahead-=A.prev_length-1,A.prev_length-=2;do++A.strstart<=B&&(A.ins_h=(A.ins_h<=p&&A.strstart>0&&(B=A.strstart-1,i=e[B],i===e[++B]&&i===e[++B]&&i===e[++B])){Q=A.strstart+eA;do;while(i===e[++B]&&i===e[++B]&&i===e[++B]&&i===e[++B]&&i===e[++B]&&i===e[++B]&&i===e[++B]&&i===e[++B]&&BA.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=p?(I=z._tr_tally(A,1,A.match_length-p),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(I=z._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),I&&(M(A,!1),A.strm.avail_out===0))return K}return A.insert=0,g===tA?(M(A,!0),A.strm.avail_out===0?nA:uA):A.last_lit&&(M(A,!1),A.strm.avail_out===0)?K:zA}function ZQ(A,g){for(var I;;){if(A.lookahead===0&&(oA(A),A.lookahead===0)){if(g===rA)return K;break}if(A.match_length=0,I=z._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,I&&(M(A,!1),A.strm.avail_out===0))return K}return A.insert=0,g===tA?(M(A,!0),A.strm.avail_out===0?nA:uA):A.last_lit&&(M(A,!1),A.strm.avail_out===0)?K:zA}function O(A,g,I,i,B){this.good_length=A,this.max_lazy=g,this.nice_length=I,this.max_chain=i,this.func=B}var yA;yA=[new O(0,0,0,0,vQ),new O(4,4,8,4,mI),new O(4,5,16,8,mI),new O(4,6,32,32,mI),new O(4,4,16,16,kA),new O(8,16,32,32,kA),new O(8,16,128,128,kA),new O(8,32,128,256,kA),new O(32,128,258,1024,kA),new O(32,258,258,4096,kA)];function bQ(A){A.window_size=2*A.w_size,QA(A.head),A.max_lazy_match=yA[A.level].max_lazy,A.good_match=yA[A.level].good_length,A.nice_match=yA[A.level].nice_length,A.max_chain_length=yA[A.level].max_chain,A.strstart=0,A.block_start=0,A.lookahead=0,A.insert=0,A.match_length=A.prev_length=p-1,A.match_available=0,A.ins_h=0}function VQ(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=tI,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Y.Buf16(RQ*2),this.dyn_dtree=new Y.Buf16((2*qQ+1)*2),this.bl_tree=new Y.Buf16((2*MQ+1)*2),QA(this.dyn_ltree),QA(this.dyn_dtree),QA(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Y.Buf16(YQ+1),this.heap=new Y.Buf16(2*zI+1),QA(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Y.Buf16(2*zI+1),QA(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ig(A){var g;return!A||!A.state?CA(A,v):(A.total_in=A.total_out=0,A.data_type=HQ,g=A.state,g.pending=0,g.pending_out=0,g.wrap<0&&(g.wrap=-g.wrap),g.status=g.wrap?aI:EA,A.adler=g.wrap===2?0:1,g.last_flush=rA,z._tr_init(g),W)}function gg(A){var g=ig(A);return g===W&&bQ(A.state),g}function LQ(A,g){return!A||!A.state||A.state.wrap!==2?v:(A.state.gzhead=g,W)}function Bg(A,g,I,i,B,Q){if(!A)return v;var e=1;if(g===kQ&&(g=6),i<0?(e=0,i=-i):i>15&&(e=2,i-=16),B<1||B>GQ||I!==tI||i<8||i>15||g<0||g>9||Q<0||Q>pQ)return CA(A,v);i===8&&(i=9);var C=new VQ;return A.state=C,C.strm=A,C.wrap=e,C.gzhead=null,C.w_bits=i,C.w_size=1<Ti||g<0)return A?CA(A,v):v;if(i=A.state,!A.output||!A.input&&A.avail_in!==0||i.status===mA&&g!==tA)return CA(A,A.avail_out===0?xI:v);if(i.strm=A,I=i.last_flush,i.last_flush=g,i.status===aI)if(i.wrap===2)A.adler=0,H(i,31),H(i,139),H(i,8),i.gzhead?(H(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),H(i,i.gzhead.time&255),H(i,i.gzhead.time>>8&255),H(i,i.gzhead.time>>16&255),H(i,i.gzhead.time>>24&255),H(i,i.level===9?2:i.strategy>=BI||i.level<2?4:0),H(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(H(i,i.gzhead.extra.length&255),H(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(A.adler=gA(A.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=vI):(H(i,0),H(i,0),H(i,0),H(i,0),H(i,0),H(i,i.level===9?2:i.strategy>=BI||i.level<2?4:0),H(i,mQ),i.status=EA);else{var e=tI+(i.w_bits-8<<4)<<8,C=-1;i.strategy>=BI||i.level<2?C=0:i.level<6?C=1:i.level===6?C=2:C=3,e|=C<<6,i.strstart!==0&&(e|=xQ),e+=31-e%31,i.status=EA,xA(i,e),i.strstart!==0&&(xA(i,A.adler>>>16),xA(i,A.adler&65535)),A.adler=1}if(i.status===vI)if(i.gzhead.extra){for(B=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>B&&(A.adler=gA(A.adler,i.pending_buf,i.pending-B,B)),BA(A),B=i.pending,i.pending===i.pending_buf_size));)H(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>B&&(A.adler=gA(A.adler,i.pending_buf,i.pending-B,B)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=QI)}else i.status=QI;if(i.status===QI)if(i.gzhead.name){B=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>B&&(A.adler=gA(A.adler,i.pending_buf,i.pending-B,B)),BA(A),B=i.pending,i.pending===i.pending_buf_size)){Q=1;break}i.gzindexB&&(A.adler=gA(A.adler,i.pending_buf,i.pending-B,B)),Q===0&&(i.gzindex=0,i.status=eI)}else i.status=eI;if(i.status===eI)if(i.gzhead.comment){B=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>B&&(A.adler=gA(A.adler,i.pending_buf,i.pending-B,B)),BA(A),B=i.pending,i.pending===i.pending_buf_size)){Q=1;break}i.gzindexB&&(A.adler=gA(A.adler,i.pending_buf,i.pending-B,B)),Q===0&&(i.status=CI)}else i.status=CI;if(i.status===CI&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&BA(A),i.pending+2<=i.pending_buf_size&&(H(i,A.adler&255),H(i,A.adler>>8&255),A.adler=0,i.status=EA)):i.status=EA),i.pending!==0){if(BA(A),A.avail_out===0)return i.last_flush=-1,W}else if(A.avail_in===0&&$i(g)<=$i(I)&&g!==tA)return CA(A,xI);if(i.status===mA&&A.avail_in!==0)return CA(A,xI);if(A.avail_in!==0||i.lookahead!==0||g!==rA&&i.status!==mA){var E=i.strategy===BI?ZQ(i,g):i.strategy===uQ?XQ(i,g):yA[i.level].func(i,g);if((E===nA||E===uA)&&(i.status=mA),E===K||E===nA)return A.avail_out===0&&(i.last_flush=-1),W;if(E===zA&&(g===DQ?z._tr_align(i):g!==Ti&&(z._tr_stored_block(i,0,0,!1),g===wQ&&(QA(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),BA(A),A.avail_out===0))return i.last_flush=-1,W}return g!==tA?W:i.wrap<=0?ji:(i.wrap===2?(H(i,A.adler&255),H(i,A.adler>>8&255),H(i,A.adler>>16&255),H(i,A.adler>>24&255),H(i,A.total_in&255),H(i,A.total_in>>8&255),H(i,A.total_in>>16&255),H(i,A.total_in>>24&255)):(xA(i,A.adler>>>16),xA(i,A.adler&65535)),BA(A),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?W:ji)}function _Q(A){var g;return!A||!A.state?v:(g=A.state.status,g!==aI&&g!==vI&&g!==QI&&g!==eI&&g!==CI&&g!==EA&&g!==mA?CA(A,v):(A.state=null,g===EA?CA(A,lQ):W))}function PQ(A,g){var I=g.length,i,B,Q,e,C,E,t,a;if(!A||!A.state||(i=A.state,e=i.wrap,e===2||e===1&&i.status!==aI||i.lookahead))return v;for(e===1&&(A.adler=Ag(A.adler,g,I,0)),i.wrap=0,I>=i.w_size&&(e===0&&(QA(i.head),i.strstart=0,i.block_start=0,i.insert=0),a=new Y.Buf8(i.w_size),Y.arraySet(a,g,I-i.w_size,i.w_size,0),g=a,I=i.w_size),C=A.avail_in,E=A.next_in,t=A.input,A.avail_in=I,A.next_in=0,A.input=g,oA(i);i.lookahead>=p;){B=i.strstart,Q=i.lookahead-(p-1);do i.ins_h=(i.ins_h<{"use strict";var EI=$(),eg=!0,Cg=!0;try{String.fromCharCode.apply(null,[0])}catch{eg=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Cg=!1}var vA=new EI.Buf8(256);for(IA=0;IA<256;IA++)vA[IA]=IA>=252?6:IA>=248?5:IA>=240?4:IA>=224?3:IA>=192?2:1;var IA;vA[254]=vA[254]=1;pA.string2buf=function(A){var g,I,i,B,Q,e=A.length,C=0;for(B=0;B>>6,g[Q++]=128|I&63):I<65536?(g[Q++]=224|I>>>12,g[Q++]=128|I>>>6&63,g[Q++]=128|I&63):(g[Q++]=240|I>>>18,g[Q++]=128|I>>>12&63,g[Q++]=128|I>>>6&63,g[Q++]=128|I&63);return g};function tg(A,g){if(g<65534&&(A.subarray&&Cg||!A.subarray&&eg))return String.fromCharCode.apply(null,EI.shrinkBuf(A,g));for(var I="",i=0;i4){C[i++]=65533,I+=Q-1;continue}for(B&=Q===2?31:Q===3?15:7;Q>1&&I1){C[i++]=65533;continue}B<65536?C[i++]=B:(B-=65536,C[i++]=55296|B>>10&1023,C[i++]=56320|B&1023)}return tg(C,i)};pA.utf8border=function(A,g){var I;for(g=g||A.length,g>A.length&&(g=A.length),I=g-1;I>=0&&(A[I]&192)===128;)I--;return I<0||I===0?g:I+vA[A[I]]>g?I:g}});var ZI=q((HC,ag)=>{"use strict";function TQ(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}ag.exports=TQ});var rg=q(bA=>{"use strict";var XA=Qg(),ZA=$(),VI=XI(),LI=gI(),jQ=ZI(),og=Object.prototype.toString,$Q=0,bI=4,SA=0,Eg=1,ng=2,Ae=-1,Ie=0,ie=8;function cA(A){if(!(this instanceof cA))return new cA(A);this.options=ZA.assign({level:Ae,method:ie,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ie,to:""},A||{});var g=this.options;g.raw&&g.windowBits>0?g.windowBits=-g.windowBits:g.gzip&&g.windowBits>0&&g.windowBits<16&&(g.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jQ,this.strm.avail_out=0;var I=XA.deflateInit2(this.strm,g.level,g.method,g.windowBits,g.memLevel,g.strategy);if(I!==SA)throw new Error(LI[I]);if(g.header&&XA.deflateSetHeader(this.strm,g.header),g.dictionary){var i;if(typeof g.dictionary=="string"?i=VI.string2buf(g.dictionary):og.call(g.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(g.dictionary):i=g.dictionary,I=XA.deflateSetDictionary(this.strm,i),I!==SA)throw new Error(LI[I]);this._dict_set=!0}}cA.prototype.push=function(A,g){var I=this.strm,i=this.options.chunkSize,B,Q;if(this.ended)return!1;Q=g===~~g?g:g===!0?bI:$Q,typeof A=="string"?I.input=VI.string2buf(A):og.call(A)==="[object ArrayBuffer]"?I.input=new Uint8Array(A):I.input=A,I.next_in=0,I.avail_in=I.input.length;do{if(I.avail_out===0&&(I.output=new ZA.Buf8(i),I.next_out=0,I.avail_out=i),B=XA.deflate(I,Q),B!==Eg&&B!==SA)return this.onEnd(B),this.ended=!0,!1;(I.avail_out===0||I.avail_in===0&&(Q===bI||Q===ng))&&(this.options.to==="string"?this.onData(VI.buf2binstring(ZA.shrinkBuf(I.output,I.next_out))):this.onData(ZA.shrinkBuf(I.output,I.next_out)))}while((I.avail_in>0||I.avail_out===0)&&B!==Eg);return Q===bI?(B=XA.deflateEnd(this.strm),this.onEnd(B),this.ended=!0,B===SA):(Q===ng&&(this.onEnd(SA),I.avail_out=0),!0)};cA.prototype.onData=function(A){this.chunks.push(A)};cA.prototype.onEnd=function(A){A===SA&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ZA.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};function OI(A,g){var I=new cA(g);if(I.push(A,!0),I.err)throw I.msg||LI[I.err];return I.result}function ge(A,g){return g=g||{},g.raw=!0,OI(A,g)}function Be(A,g){return g=g||{},g.gzip=!0,OI(A,g)}bA.Deflate=cA;bA.deflate=OI;bA.deflateRaw=ge;bA.gzip=Be});var hg=q((UC,cg)=>{"use strict";var nI=30,Qe=12;cg.exports=function(g,I){var i,B,Q,e,C,E,t,a,s,o,n,D,d,l,w,S,u,F,c,r,h,f,y,G,k;i=g.state,B=g.next_in,G=g.input,Q=B+(g.avail_in-5),e=g.next_out,k=g.output,C=e-(I-g.avail_out),E=e+(g.avail_out-257),t=i.dmax,a=i.wsize,s=i.whave,o=i.wnext,n=i.window,D=i.hold,d=i.bits,l=i.lencode,w=i.distcode,S=(1<>>24,D>>>=c,d-=c,c=F>>>16&255,c===0)k[e++]=F&65535;else if(c&16){r=F&65535,c&=15,c&&(d>>=c,d-=c),d<15&&(D+=G[B++]<>>24,D>>>=c,d-=c,c=F>>>16&255,c&16){if(h=F&65535,c&=15,dt){g.msg="invalid distance too far back",i.mode=nI;break A}if(D>>>=c,d-=c,c=e-C,h>c){if(c=h-c,c>s&&i.sane){g.msg="invalid distance too far back",i.mode=nI;break A}if(f=0,y=n,o===0){if(f+=a-c,c2;)k[e++]=y[f++],k[e++]=y[f++],k[e++]=y[f++],r-=3;r&&(k[e++]=y[f++],r>1&&(k[e++]=y[f++]))}else{f=e-h;do k[e++]=k[f++],k[e++]=k[f++],k[e++]=k[f++],r-=3;while(r>2);r&&(k[e++]=k[f++],r>1&&(k[e++]=k[f++]))}}else if(c&64){g.msg="invalid distance code",i.mode=nI;break A}else{F=w[(F&65535)+(D&(1<>3,B-=r,d-=r<<3,D&=(1<{"use strict";var dg=$(),HA=15,fg=852,sg=592,Fg=0,WI=1,Dg=2,ee=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Ce=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],te=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],ae=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];wg.exports=function(g,I,i,B,Q,e,C,E){var t=E.bits,a=0,s=0,o=0,n=0,D=0,d=0,l=0,w=0,S=0,u=0,F,c,r,h,f,y=null,G=0,k,Z=new dg.Buf16(HA+1),TA=new dg.Buf16(HA+1),jA=null,wi=0,li,$A,AI;for(a=0;a<=HA;a++)Z[a]=0;for(s=0;s=1&&Z[n]===0;n--);if(D>n&&(D=n),n===0)return Q[e++]=1<<24|64<<16|0,Q[e++]=1<<24|64<<16|0,E.bits=1,0;for(o=1;o0&&(g===Fg||n!==1))return-1;for(TA[1]=0,a=1;afg||g===Dg&&S>sg)return 1;for(;;){li=a-l,C[s]k?($A=jA[wi+C[s]],AI=y[G+C[s]]):($A=32+64,AI=0),F=1<>l)+c]=li<<24|$A<<16|AI|0;while(c!==0);for(F=1<>=1;if(F!==0?(u&=F-1,u+=F):u=0,s++,--Z[a]===0){if(a===n)break;a=I[i+C[s]]}if(a>D&&(u&h)!==r){for(l===0&&(l=D),f+=o,d=a-l,w=1<fg||g===Dg&&S>sg)return 1;r=u&h,Q[r]=D<<24|d<<16|f-e|0}}return u!==0&&(Q[f+u]=a-l<<24|64<<16|0),E.bits=D,0}});var gB=q(V=>{"use strict";var m=$(),Ai=RI(),P=YI(),Ee=hg(),VA=lg(),ne=0,Wg=1,_g=2,kg=4,oe=5,oI=6,hA=0,re=1,ce=2,X=-2,Pg=-3,Ii=-4,he=-5,yg=8,Tg=1,ug=2,pg=3,Sg=4,Hg=5,Gg=6,Ug=7,Ng=8,Jg=9,Kg=10,hI=11,iA=12,_I=13,qg=14,PI=15,Mg=16,Rg=17,Yg=18,xg=19,rI=20,cI=21,mg=22,zg=23,vg=24,Xg=25,Zg=26,TI=27,bg=28,Vg=29,N=30,ii=31,de=32,fe=852,se=592,Fe=15,De=Fe;function Lg(A){return(A>>>24&255)+(A>>>8&65280)+((A&65280)<<8)+((A&255)<<24)}function we(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new m.Buf16(320),this.work=new m.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function jg(A){var g;return!A||!A.state?X:(g=A.state,A.total_in=A.total_out=g.total=0,A.msg="",g.wrap&&(A.adler=g.wrap&1),g.mode=Tg,g.last=0,g.havedict=0,g.dmax=32768,g.head=null,g.hold=0,g.bits=0,g.lencode=g.lendyn=new m.Buf32(fe),g.distcode=g.distdyn=new m.Buf32(se),g.sane=1,g.back=-1,hA)}function $g(A){var g;return!A||!A.state?X:(g=A.state,g.wsize=0,g.whave=0,g.wnext=0,jg(A))}function AB(A,g){var I,i;return!A||!A.state||(i=A.state,g<0?(I=0,g=-g):(I=(g>>4)+1,g<48&&(g&=15)),g&&(g<8||g>15))?X:(i.window!==null&&i.wbits!==g&&(i.window=null),i.wrap=I,i.wbits=g,$g(A))}function IB(A,g){var I,i;return A?(i=new we,A.state=i,i.window=null,I=AB(A,g),I!==hA&&(A.state=null),I):X}function le(A){return IB(A,De)}var Og=!0,jI,$I;function ke(A){if(Og){var g;for(jI=new m.Buf32(512),$I=new m.Buf32(32),g=0;g<144;)A.lens[g++]=8;for(;g<256;)A.lens[g++]=9;for(;g<280;)A.lens[g++]=7;for(;g<288;)A.lens[g++]=8;for(VA(Wg,A.lens,0,288,jI,0,A.work,{bits:9}),g=0;g<32;)A.lens[g++]=5;VA(_g,A.lens,0,32,$I,0,A.work,{bits:5}),Og=!1}A.lencode=jI,A.lenbits=9,A.distcode=$I,A.distbits=5}function iB(A,g,I,i){var B,Q=A.state;return Q.window===null&&(Q.wsize=1<=Q.wsize?(m.arraySet(Q.window,g,I-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize):(B=Q.wsize-Q.wnext,B>i&&(B=i),m.arraySet(Q.window,g,I-i,B,Q.wnext),i-=B,i?(m.arraySet(Q.window,g,I-i,i,0),Q.wnext=i,Q.whave=Q.wsize):(Q.wnext+=B,Q.wnext===Q.wsize&&(Q.wnext=0),Q.whave>>8&255,I.check=P(I.check,y,2,0),t=0,a=0,I.mode=ug;break}if(I.flags=0,I.head&&(I.head.done=!1),!(I.wrap&1)||(((t&255)<<8)+(t>>8))%31){A.msg="incorrect header check",I.mode=N;break}if((t&15)!==yg){A.msg="unknown compression method",I.mode=N;break}if(t>>>=4,a-=4,h=(t&15)+8,I.wbits===0)I.wbits=h;else if(h>I.wbits){A.msg="invalid window size",I.mode=N;break}I.dmax=1<>8&1),I.flags&512&&(y[0]=t&255,y[1]=t>>>8&255,I.check=P(I.check,y,2,0)),t=0,a=0,I.mode=pg;case pg:for(;a<32;){if(C===0)break A;C--,t+=i[Q++]<>>8&255,y[2]=t>>>16&255,y[3]=t>>>24&255,I.check=P(I.check,y,4,0)),t=0,a=0,I.mode=Sg;case Sg:for(;a<16;){if(C===0)break A;C--,t+=i[Q++]<>8),I.flags&512&&(y[0]=t&255,y[1]=t>>>8&255,I.check=P(I.check,y,2,0)),t=0,a=0,I.mode=Hg;case Hg:if(I.flags&1024){for(;a<16;){if(C===0)break A;C--,t+=i[Q++]<>>8&255,I.check=P(I.check,y,2,0)),t=0,a=0}else I.head&&(I.head.extra=null);I.mode=Gg;case Gg:if(I.flags&1024&&(n=I.length,n>C&&(n=C),n&&(I.head&&(h=I.head.extra_len-I.length,I.head.extra||(I.head.extra=new Array(I.head.extra_len)),m.arraySet(I.head.extra,i,Q,n,h)),I.flags&512&&(I.check=P(I.check,i,n,Q)),C-=n,Q+=n,I.length-=n),I.length))break A;I.length=0,I.mode=Ug;case Ug:if(I.flags&2048){if(C===0)break A;n=0;do h=i[Q+n++],I.head&&h&&I.length<65536&&(I.head.name+=String.fromCharCode(h));while(h&&n>9&1,I.head.done=!0),A.adler=I.check=0,I.mode=iA;break;case Kg:for(;a<32;){if(C===0)break A;C--,t+=i[Q++]<>>=a&7,a-=a&7,I.mode=TI;break}for(;a<3;){if(C===0)break A;C--,t+=i[Q++]<>>=1,a-=1,t&3){case 0:I.mode=qg;break;case 1:if(ke(I),I.mode=rI,g===oI){t>>>=2,a-=2;break A}break;case 2:I.mode=Rg;break;case 3:A.msg="invalid block type",I.mode=N}t>>>=2,a-=2;break;case qg:for(t>>>=a&7,a-=a&7;a<32;){if(C===0)break A;C--,t+=i[Q++]<>>16^65535)){A.msg="invalid stored block lengths",I.mode=N;break}if(I.length=t&65535,t=0,a=0,I.mode=PI,g===oI)break A;case PI:I.mode=Mg;case Mg:if(n=I.length,n){if(n>C&&(n=C),n>E&&(n=E),n===0)break A;m.arraySet(B,i,Q,n,e),C-=n,Q+=n,E-=n,e+=n,I.length-=n;break}I.mode=iA;break;case Rg:for(;a<14;){if(C===0)break A;C--,t+=i[Q++]<>>=5,a-=5,I.ndist=(t&31)+1,t>>>=5,a-=5,I.ncode=(t&15)+4,t>>>=4,a-=4,I.nlen>286||I.ndist>30){A.msg="too many length or distance symbols",I.mode=N;break}I.have=0,I.mode=Yg;case Yg:for(;I.have>>=3,a-=3}for(;I.have<19;)I.lens[Z[I.have++]]=0;if(I.lencode=I.lendyn,I.lenbits=7,G={bits:I.lenbits},f=VA(ne,I.lens,0,19,I.lencode,0,I.work,G),I.lenbits=G.bits,f){A.msg="invalid code lengths set",I.mode=N;break}I.have=0,I.mode=xg;case xg:for(;I.have>>24,S=l>>>16&255,u=l&65535,!(w<=a);){if(C===0)break A;C--,t+=i[Q++]<>>=w,a-=w,I.lens[I.have++]=u;else{if(u===16){for(k=w+2;a>>=w,a-=w,I.have===0){A.msg="invalid bit length repeat",I.mode=N;break}h=I.lens[I.have-1],n=3+(t&3),t>>>=2,a-=2}else if(u===17){for(k=w+3;a>>=w,a-=w,h=0,n=3+(t&7),t>>>=3,a-=3}else{for(k=w+7;a>>=w,a-=w,h=0,n=11+(t&127),t>>>=7,a-=7}if(I.have+n>I.nlen+I.ndist){A.msg="invalid bit length repeat",I.mode=N;break}for(;n--;)I.lens[I.have++]=h}}if(I.mode===N)break;if(I.lens[256]===0){A.msg="invalid code -- missing end-of-block",I.mode=N;break}if(I.lenbits=9,G={bits:I.lenbits},f=VA(Wg,I.lens,0,I.nlen,I.lencode,0,I.work,G),I.lenbits=G.bits,f){A.msg="invalid literal/lengths set",I.mode=N;break}if(I.distbits=6,I.distcode=I.distdyn,G={bits:I.distbits},f=VA(_g,I.lens,I.nlen,I.ndist,I.distcode,0,I.work,G),I.distbits=G.bits,f){A.msg="invalid distances set",I.mode=N;break}if(I.mode=rI,g===oI)break A;case rI:I.mode=cI;case cI:if(C>=6&&E>=258){A.next_out=e,A.avail_out=E,A.next_in=Q,A.avail_in=C,I.hold=t,I.bits=a,Ee(A,o),e=A.next_out,B=A.output,E=A.avail_out,Q=A.next_in,i=A.input,C=A.avail_in,t=I.hold,a=I.bits,I.mode===iA&&(I.back=-1);break}for(I.back=0;l=I.lencode[t&(1<>>24,S=l>>>16&255,u=l&65535,!(w<=a);){if(C===0)break A;C--,t+=i[Q++]<>F)],w=l>>>24,S=l>>>16&255,u=l&65535,!(F+w<=a);){if(C===0)break A;C--,t+=i[Q++]<>>=F,a-=F,I.back+=F}if(t>>>=w,a-=w,I.back+=w,I.length=u,S===0){I.mode=Zg;break}if(S&32){I.back=-1,I.mode=iA;break}if(S&64){A.msg="invalid literal/length code",I.mode=N;break}I.extra=S&15,I.mode=mg;case mg:if(I.extra){for(k=I.extra;a>>=I.extra,a-=I.extra,I.back+=I.extra}I.was=I.length,I.mode=zg;case zg:for(;l=I.distcode[t&(1<>>24,S=l>>>16&255,u=l&65535,!(w<=a);){if(C===0)break A;C--,t+=i[Q++]<>F)],w=l>>>24,S=l>>>16&255,u=l&65535,!(F+w<=a);){if(C===0)break A;C--,t+=i[Q++]<>>=F,a-=F,I.back+=F}if(t>>>=w,a-=w,I.back+=w,S&64){A.msg="invalid distance code",I.mode=N;break}I.offset=u,I.extra=S&15,I.mode=vg;case vg:if(I.extra){for(k=I.extra;a>>=I.extra,a-=I.extra,I.back+=I.extra}if(I.offset>I.dmax){A.msg="invalid distance too far back",I.mode=N;break}I.mode=Xg;case Xg:if(E===0)break A;if(n=o-E,I.offset>n){if(n=I.offset-n,n>I.whave&&I.sane){A.msg="invalid distance too far back",I.mode=N;break}n>I.wnext?(n-=I.wnext,D=I.wsize-n):D=I.wnext-n,n>I.length&&(n=I.length),d=I.window}else d=B,D=e-I.offset,n=I.length;n>E&&(n=E),E-=n,I.length-=n;do B[e++]=d[D++];while(--n);I.length===0&&(I.mode=cI);break;case Zg:if(E===0)break A;B[e++]=I.length,E--,I.mode=cI;break;case TI:if(I.wrap){for(;a<32;){if(C===0)break A;C--,t|=i[Q++]<{"use strict";BB.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var eB=q((qC,QB)=>{"use strict";function He(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}QB.exports=He});var tB=q(OA=>{"use strict";var GA=gB(),LA=$(),dI=XI(),J=gi(),Bi=gI(),Ge=ZI(),Ue=eB(),CB=Object.prototype.toString;function dA(A){if(!(this instanceof dA))return new dA(A);this.options=LA.assign({chunkSize:16384,windowBits:0,to:""},A||{});var g=this.options;g.raw&&g.windowBits>=0&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),g.windowBits>=0&&g.windowBits<16&&!(A&&A.windowBits)&&(g.windowBits+=32),g.windowBits>15&&g.windowBits<48&&(g.windowBits&15||(g.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ge,this.strm.avail_out=0;var I=GA.inflateInit2(this.strm,g.windowBits);if(I!==J.Z_OK)throw new Error(Bi[I]);if(this.header=new Ue,GA.inflateGetHeader(this.strm,this.header),g.dictionary&&(typeof g.dictionary=="string"?g.dictionary=dI.string2buf(g.dictionary):CB.call(g.dictionary)==="[object ArrayBuffer]"&&(g.dictionary=new Uint8Array(g.dictionary)),g.raw&&(I=GA.inflateSetDictionary(this.strm,g.dictionary),I!==J.Z_OK)))throw new Error(Bi[I])}dA.prototype.push=function(A,g){var I=this.strm,i=this.options.chunkSize,B=this.options.dictionary,Q,e,C,E,t,a=!1;if(this.ended)return!1;e=g===~~g?g:g===!0?J.Z_FINISH:J.Z_NO_FLUSH,typeof A=="string"?I.input=dI.binstring2buf(A):CB.call(A)==="[object ArrayBuffer]"?I.input=new Uint8Array(A):I.input=A,I.next_in=0,I.avail_in=I.input.length;do{if(I.avail_out===0&&(I.output=new LA.Buf8(i),I.next_out=0,I.avail_out=i),Q=GA.inflate(I,J.Z_NO_FLUSH),Q===J.Z_NEED_DICT&&B&&(Q=GA.inflateSetDictionary(this.strm,B)),Q===J.Z_BUF_ERROR&&a===!0&&(Q=J.Z_OK,a=!1),Q!==J.Z_STREAM_END&&Q!==J.Z_OK)return this.onEnd(Q),this.ended=!0,!1;I.next_out&&(I.avail_out===0||Q===J.Z_STREAM_END||I.avail_in===0&&(e===J.Z_FINISH||e===J.Z_SYNC_FLUSH))&&(this.options.to==="string"?(C=dI.utf8border(I.output,I.next_out),E=I.next_out-C,t=dI.buf2string(I.output,C),I.next_out=E,I.avail_out=i-E,E&&LA.arraySet(I.output,I.output,C,E,0),this.onData(t)):this.onData(LA.shrinkBuf(I.output,I.next_out))),I.avail_in===0&&I.avail_out===0&&(a=!0)}while((I.avail_in>0||I.avail_out===0)&&Q!==J.Z_STREAM_END);return Q===J.Z_STREAM_END&&(e=J.Z_FINISH),e===J.Z_FINISH?(Q=GA.inflateEnd(this.strm),this.onEnd(Q),this.ended=!0,Q===J.Z_OK):(e===J.Z_SYNC_FLUSH&&(this.onEnd(J.Z_OK),I.avail_out=0),!0)};dA.prototype.onData=function(A){this.chunks.push(A)};dA.prototype.onEnd=function(A){A===J.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=LA.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};function Qi(A,g){var I=new dA(g);if(I.push(A,!0),I.err)throw I.msg||Bi[I.err];return I.result}function Ne(A,g){return g=g||{},g.raw=!0,Qi(A,g)}OA.Inflate=dA;OA.inflate=Qi;OA.inflateRaw=Ne;OA.ungzip=Qi});var ei=q((RC,EB)=>{"use strict";var Je=$().assign,Ke=rg(),qe=tB(),Me=gi(),aB={};Je(aB,Ke,qe,Me);EB.exports=aB});var DB=q(()=>{"use strict"});var wB=q((LC,ti)=>{"use strict";(function(){var A,g=0,I=[],i;for(i=0;i<256;i++)I[i]=(i+256).toString(16).substr(1);C.BUFFER_SIZE=4096,C.bin=e,C.clearBuffer=function(){A=null,g=0},C.test=function(E){return typeof E=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(E):!1};var B;typeof crypto<"u"?B=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(B=window.msCrypto),typeof ti<"u"&&typeof yi=="function"?(B=B||DB(),ti.exports=C):typeof window<"u"&&(window.uuid=C),C.randomBytes=function(){if(B){if(B.randomBytes)return B.randomBytes;if(B.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(E){var t=new Uint8Array(E);return B.getRandomValues(t),Array.from(t)}:function(E){var t=new Uint8Array(E);return B.getRandomValues(t),t}}return function(E){var t,a=[];for(t=0;tC.BUFFER_SIZE)&&(g=0,A=C.randomBytes(C.BUFFER_SIZE)),A.slice(g,g+=E)}function e(){var E=Q(16);return E[6]=E[6]&15|64,E[8]=E[8]&63|128,E}function C(){var E=e();return I[E[0]]+I[E[1]]+I[E[2]]+I[E[3]]+"-"+I[E[4]]+I[E[5]]+"-"+I[E[6]]+I[E[7]]+"-"+I[E[8]]+I[E[9]]+"-"+I[E[10]]+I[E[11]]+I[E[12]]+I[E[13]]+I[E[14]]+I[E[15]]}})()});var fB=uI(ei(),1);function nB(A){let g;typeof A=="string"?g=A:A?.length?g=A.reduce((I,i)=>(I+=String.fromCharCode(i),I),""):A?g=A.toString():g="";try{return"__wb_post_data="+btoa(g)}catch{return"__wb_post_data="}}function YC(A){return A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function rB(A){try{if(!A.startsWith("https:")&&!A.startsWith("http:"))return A;A=A.replace(/^(https?:\/\/)www\d*\./,"$1");let g=A.toLowerCase(),I=new URL(g),B=I.hostname.split(".").reverse().join(",");if(I.port&&(B+=":"+I.port),B+=")",B+=I.pathname,I.search){let Q=I.search.slice(1).split("&");Q.sort(),B+="?"+Q.join("&")}return B}catch{return A}}function cB(A){let{method:g,headers:I,postData:i=""}=A;if(g==="GET")return!1;let Q=(t=>{let a=t.get("content-type");if(a)return a;if(!(t instanceof Headers)){for(let[s,o]of t.entries())if(s&&s.toLowerCase()==="content-type")return o}return""})(I),e=Q.split(";")[0];function C(t){return t instanceof Uint8Array&&(t=new TextDecoder().decode(t)),t}let E="";switch(e){case"application/x-www-form-urlencoded":E=C(i);break;case"application/json":E=oB(C(i));break;case"text/plain":try{E=oB(C(i),!1)}catch{E=nB(i)}break;case"multipart/form-data":{if(!Q)throw new Error("utils cannot call postToGetURL when missing content-type header");E=me(C(i),Q);break}default:E=nB(i)}return E!=null?(A.url=Re(A.url,decodeURI(E),A.method),A.method="GET",A.requestBody=E,!0):!1}function Re(A,g,I){if(!I)return A;let i=A.indexOf("?")>0?"&":"?";return`${A}${i}__wb_method=${I}&${g}`}function Ye(A,g=!0){if(typeof A=="string")try{A=JSON.parse(A)}catch{A={}}let I=new URLSearchParams,i={},B=e=>I.has(e)?(e in i||(i[e]=1),e+"."+ ++i[e]+"_"):e,Q=(e,C="")=>{let E="";if(typeof e=="object"&&!(e instanceof Array))try{for(let[t,a]of Object.entries(e))Q(a,t)}catch{e===null&&(E="null")}else if(e instanceof Array)for(let t=0;tI+=String.fromCharCode(i)),I}function dB(A){let g=new Uint8Array(A.length);for(let I=0;I{i.done||!i.value?I.close():I.enqueue(i.value)})}})}async readFully(){return await A.readFully(this)}async readline(g=0){let I=await this.readlineRaw(g);return I?sB.decode(I):""}async*iterLines(g=0){let I=null;for(;I=await this.readline(g);)yield I}};function ze(A){return!!(A&&Symbol.iterator in Object(A))}function ve(A){return!!(A&&Symbol.asyncIterator in Object(A))}var sA=class A extends j{constructor(I,i="gzip",B=!1){super();this.compressed=i,this.opts={raw:i==="deflateRaw"},this.inflator=i?new WA(this.opts,this):null;let Q;if(ve(I))Q=I;else if(typeof I=="object"&&"read"in I&&typeof I.read=="function")Q=A.fromReadable(I);else if(I instanceof ReadableStream)Q=A.fromReadable(I.getReader());else if(ze(I))Q=A.fromIter(I);else throw new TypeError("Invalid Stream Source");B?this._sourceIter=this.dechunk(Q):this._sourceIter=Q[Symbol.asyncIterator](),this.lastValue=null,this.errored=!1,this._savedChunk=null,this._rawOffset=0,this._readOffset=0,this.numChunks=0}async _loadNext(){let I=await this._sourceIter.next();return I.done?null:I.value}async*dechunk(I){let i=I instanceof A?I:new A(I,null),B=-1,Q=!0;for(;B!=0;){let e=await i.readlineRaw(64),C=new Uint8Array;if(B=e?parseInt(sB.decode(e),16):0,!B||B>2**32){if(Number.isNaN(B)||B>2**32){Q||(this.errored=!0),yield e;break}}else if(C=await i.readSize(B),C.length!=B){Q?yield e:this.errored=!0,yield C;break}let E=await i.readSize(2);if(E[0]!=13||E[1]!=10){Q?yield e:this.errored=!0,yield C,yield E;break}else{if(Q=!1,!C||B===0)return;yield C}}yield*i}unread(I){I.length&&(this._readOffset-=I.length,this._savedChunk&&console.log("Already have chunk!"),this._savedChunk=I)}async _next(){if(this._savedChunk){let i=this._savedChunk;return this._savedChunk=null,i}if(this.compressed){let i=this._getNextChunk();if(i)return i}let I=await this._loadNext();for(;this.compressed&&I;){this._push(I);let i=this._getNextChunk(I);if(i)return i;I=await this._loadNext()}return I}_push(I){if(!this.inflator)throw new Error("AsyncIterReader cannot call _push when this.compressed is null");this.lastValue=I,this.inflator.ended&&(this.inflator=new WA(this.opts,this)),this.inflator.push(I),this.inflator.err&&this.inflator.ended&&this.compressed==="deflate"&&!this.opts.raw&&this.numChunks===0&&(this.opts.raw=!0,this.compressed="deflateRaw",this.inflator=new WA(this.opts,this),this.inflator.push(I))}_getNextChunk(I){if(!this.inflator)throw new Error("AsyncIterReader cannot call _getNextChunk when this.compressed is null");for(;;){if(this.inflator.chunks.length>0)return this.numChunks++,this.inflator.chunks.shift();if(this.inflator.ended){if(this.inflator.err!==0)return this.compressed=null,I;let i=this.inflator.strm.avail_in;if(i&&this.lastValue){this._push(this.lastValue.slice(-i));continue}}return null}}async*[Symbol.asyncIterator](){let I=null;for(;I=await this._next();)this._readOffset+=I.length,yield I}async readlineRaw(I){let i=[],B=0,Q=-1,e=null;for await(let C of this){if(I&&B+C.byteLength>I){e=C,Q=I-B-1;let E=C.slice(0,Q+1).indexOf(10);E>=0&&(Q=E);break}if(Q=C.indexOf(10),Q>=0){e=C;break}i.push(C),B+=C.byteLength}if(e){let[C,E]=fA(e,Q+1);i.push(C),B+=C.byteLength,this.unread(E)}else if(!i.length)return null;return UA(i,B)}async readFully(){return(await this._readOrSkip())[1]}async readSize(I){return(await this._readOrSkip(I))[1]}async skipSize(I){return(await this._readOrSkip(I,!0))[0]}async _readOrSkip(I=-1,i=!1){let B=[],Q=0;for await(let e of this){if(I>=0)if(e.length>I){let[C,E]=fA(e,I);i||B.push(C),Q+=C.byteLength,this.unread(E);break}else if(e.length===I){i||B.push(e),Q+=e.byteLength,I=0;break}else I-=e.length;i||B.push(e),Q+=e.byteLength}return i?[Q,new Uint8Array]:[Q,UA(B,Q)]}getReadOffset(){return this._readOffset}getRawOffset(){return this.compressed?this._rawOffset:this._readOffset}getRawLength(I){return this.compressed?this.inflator.strm.total_in:this._readOffset-I}static fromReadable(I){return{async*[Symbol.asyncIterator](){let B=null;for(;(B=await I.read())&&!B.done;)yield B.value}}}static fromIter(I){return{async*[Symbol.asyncIterator](){for(let B of I)yield B}}}},FA=class extends j{constructor(I,i,B=0){super();this.sourceIter=I,this.length=i,this.limit=i,this.skip=B}setLimitSkip(I,i=0){this.limit=I,this.skip=i}async*[Symbol.asyncIterator](){if(!(this.limit<=0))for await(let I of this.sourceIter){if(this.skip>0)if(I.length>=this.skip){let[,i]=fA(I,this.skip);I=i,this.skip=0}else{this.skip-=I.length;continue}if(I.length>this.limit){let[i,B]=fA(I,this.limit);I=i,this.sourceIter.unread&&this.sourceIter.unread(B)}if(I.length&&(this.limit-=I.length,yield I),this.limit<=0)break}}async readlineRaw(I){if(this.limit<=0)return null;let i=await this.sourceIter.readlineRaw(I?Math.min(I,this.limit):this.limit);return this.limit-=i?.length||0,i}async skipFully(){let I=this.limit;for(;this.limit>0;)this.limit-=await this.sourceIter.skipSize(this.limit);return I}};var Ci=new Uint8Array([13,10]),FB=new Uint8Array([13,10,13,10]),Xe=new TextDecoder("utf-8"),NA=class{constructor({statusline:g,headers:I,reencodeHeaders:i}){this.statusline=g,this.headers=I,this.reencodeHeaders=i}toString(){let g=[this.statusline],I=this.headers instanceof Headers;for(let[i,B]of this.headers)I&&this.reencodeHeaders?.has(i)?g.push(`${i}: ${dB(B)}`):g.push(`${i}: ${B}`);return g.join(`\r +`)+`\r +`}async*iterSerialize(g){yield g.encode(this.statusline),yield Ci;for(let[I,i]of this.headers)yield g.encode(`${I}: ${i}\r +`)}_parseResponseStatusLine(){let g=Ze(this.statusline," ",2);this._protocol=g[0]??"",this._statusCode=g.length>1?Number(g[1]):"",this._statusText=g.length>2?g[2]:""}get statusCode(){return this._statusCode===void 0&&this._parseResponseStatusLine(),this._statusCode}get protocol(){return this._protocol===void 0&&this._parseResponseStatusLine(),this._protocol}get statusText(){return this._statusText===void 0&&this._parseResponseStatusLine(),this._statusText}_parseRequestStatusLine(){let g=this.statusline.split(" ",2);this._method=g[0]??"",this._requestPath=g.length>1?g[1]:""}get method(){return this._method===void 0&&this._parseRequestStatusLine(),this._method}get requestPath(){return this._requestPath===void 0&&this._parseRequestStatusLine(),this._requestPath}},FI=class{constructor(){this.reencodeHeaders=new Set}async parse(g,{headersClass:I,firstLine:i}={headersClass:T}){let B=i||await g.readline();if(!B)return null;let Q=B.trimEnd();if(!Q)return null;let e=new I,C=await Ve(g),E=0,t,a,s,o="",n;for(;E=0&&t0&&B.push(i.slice(I).join(g)),B}async function be(A,g){let I=0;for(let i=0;i=A.length){let{value:Q}=await g.next();if(!Q)break;let e=new Uint8Array(Q.length+A.length);e.set(A,0),e.set(Q,A.length),A=e}if(A[B+1]===10&&A[B+2]===13&&A[B+3]===10)return[B+3,A];I=B+1}return[-1,A]}async function Ve(A){let g=[],I=0,i=0,B=null,Q=A[Symbol.asyncIterator]();for await(let e of Q){if([i,e]=await be(e,Q),i>=0){B=e;break}g.push(e),I+=e.byteLength}if(B){let[e,C]=fA(B,i+1);g.push(e),I+=e.byteLength,A.unread(C)}else if(!g.length)return"";return Xe.decode(UA(g,I))}var yB=uI(wB(),1);var Le=new TextDecoder("utf-8"),Oe=new TextEncoder,We="WARC/1.1",lB="WARC/1.0",_e="http://netpreserve.org/warc/1.0/revisit/identical-payload-digest",Pe="http://netpreserve.org/warc/1.1/revisit/identical-payload-digest",Te={warcinfo:"application/warc-fields",response:"application/http; msgtype=response",revisit:"application/http; msgtype=response",request:"application/http; msgtype=request",metadata:"application/warc-fields"},DI=class A extends j{constructor({warcHeaders:I,reader:i}){super();this._offset=0;this._length=0;this._urlkey="";this.warcHeaders=I,this._reader=i,this._contentReader=null,this.payload=null,this.httpHeaders=null,this.consumed="",this.fixUp()}static create({url:I,date:i,type:B,warcHeaders:Q={},filename:e="",httpHeaders:C={},statusline:E="HTTP/1.1 200 OK",warcVersion:t=lB,keepHeadersCase:a=!0,refersToUrl:s=void 0,refersToDate:o=void 0}={},n){function D(F){let c=F;return t===lB&&(F=F.split(".")[0],F.charAt(c.length-1)!="Z"&&(F+="Z")),F}i=D(i||new Date().toISOString());let d=new T(Q);if(B==="warcinfo")e&&d.set("WARC-Filename",e);else if(I)try{d.set("WARC-Target-URI",new URL(I).href)}catch{d.set("WARC-Target-URI",I)}d.set("WARC-Date",i),B&&d.set("WARC-Type",B),B==="revisit"&&(d.set("WARC-Profile",t===We?Pe:_e),s&&(d.set("WARC-Refers-To-Target-URI",s),d.set("WARC-Refers-To-Date",D(o||new Date().toISOString()))));let l=new NA({statusline:t,headers:d});l.headers.get("WARC-Record-ID")||l.headers.set("WARC-Record-ID",``),l.headers.get("Content-Type")||l.headers.set("Content-Type",B&&Te[B]||"application/octet-stream"),n||(n=kB());let w=new A({warcHeaders:l,reader:n}),S=null,u=!1;switch(B){case"response":case"request":case"revisit":a?(S=new T(C),u=!S.size):(S=new Headers(C),u=!Object.entries(C).length),(!u||B!=="revisit")&&(w.httpHeaders=new NA({statusline:E,headers:S}));break}return w}static createWARCInfo(I={},i){async function*B(){for(let[Q,e]of Object.entries(i))yield Oe.encode(`${Q}: ${e}\r +`)}return I.type="warcinfo",A.create(I,B())}getResponseInfo(){let I=this.httpHeaders;return I?{headers:I.headers,status:I.statusCode,statusText:I.statusText}:null}fixUp(){let I=this.warcHeaders.headers.get("WARC-Target-URI");I&&I.startsWith("<")&&I.endsWith(">")&&this.warcHeaders.headers.set("WARC-Target-URI",I.slice(1,-1))}async readFully(I=!1){if(this.httpHeaders){if(this.payload&&!this.payload.length)return this.payload;if(this._contentReader&&!I)throw new TypeError("WARC Record decoding already started, but requesting raw payload");if(I&&this.consumed==="raw"&&this.payload)return await this._createDecodingReader([this.payload]).readFully()}return this.payload?this.payload:(I?(this.payload=await super.readFully(),this.consumed="content"):(this.payload=await j.readFully(this._reader),this.consumed="raw"),this.payload)}get reader(){if(this.payload&&!this.payload.length)return kB();if(this._contentReader)throw new TypeError("WARC Record decoding already started, but requesting raw payload");return this._reader}get contentReader(){return this.httpHeaders?(this._contentReader||(this._contentReader=this._createDecodingReader(this._reader)),this._contentReader):this._reader}_createDecodingReader(I){if(!this.httpHeaders)throw new Error("WARCRecord cannot call _createDecodingReader when this.httpHeaders === null");let i=this.httpHeaders.headers.get("Content-Encoding"),B=this.httpHeaders.headers.get("Transfer-Encoding"),Q=B==="chunked";return!i&&!Q&&(i=B),new sA(I,i,Q)}async readlineRaw(I){if(this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");if(this.contentReader instanceof j)return this.contentReader.readlineRaw(I);throw new Error("WARCRecord cannot call readlineRaw on this.contentReader if it does not extend BaseAsyncIterReader")}async contentText(){let I=await this.readFully(!0);return Le.decode(I)}async*[Symbol.asyncIterator](){for await(let I of this.contentReader)if(yield I,this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");this.consumed="content"}async skipFully(){if(!this.consumed){if(this._reader instanceof FA){let I=await this._reader.skipFully();return this.consumed="skipped",I}throw new Error("WARCRecord cannot call skipFully on this._reader if it is not a LimitReader")}}warcHeader(I){return this.warcHeaders.headers.get(I)}get warcType(){return this.warcHeaders.headers.get("WARC-Type")}get warcTargetURI(){return this.warcHeaders.headers.get("WARC-Target-URI")}get warcDate(){return this.warcHeaders.headers.get("WARC-Date")}get warcRefersToTargetURI(){return this.warcHeaders.headers.get("WARC-Refers-To-Target-URI")}get warcRefersToDate(){return this.warcHeaders.headers.get("WARC-Refers-To-Date")}get warcPayloadDigest(){return this.warcHeaders.headers.get("WARC-Payload-Digest")}get warcBlockDigest(){return this.warcHeaders.headers.get("WARC-Block-Digest")}get warcContentType(){return this.warcHeaders.headers.get("Content-Type")}get warcContentLength(){return Number(this.warcHeaders.headers.get("Content-Length"))}get warcConcurrentTo(){if(this.warcHeaders.headers instanceof T)return this.warcHeaders.headers.getMultiple("WARC-Concurrent-To");{let I=this.warcHeaders.headers.get("WARC-Concurrent-To");return I?I.split(","):[]}}};async function*kB(){}var uB=new TextDecoder,ai=new Uint8Array([]),wI=class A{static async parse(g,I){return new A(g,I).parse()}static iterRecords(g,I){return new A(g,I)[Symbol.asyncIterator]()}constructor(g,{keepHeadersCase:I=!1,parseHttp:i=!0}={}){this._offset=0,this._warcHeadersLength=0,this._headersClass=I?T:Headers,this._parseHttp=i,g instanceof sA?this._reader=g:this._reader=new sA(g),this._record=null}async readToNextRecord(){if(!this._reader||!this._record)return ai;await this._record.skipFully(),this._reader.compressed&&(this._offset=this._reader.getRawOffset());let g=await this._reader.readlineRaw(),I=0;if(!g)g=ai;else{if(I=g.byteLength-1,I===9&&uB.decode(g).startsWith("WARC/"))return g;for(;I>0;){let i=g[I-1];if(i!==10&&i!==13)break;I--}I&&console.warn(`Content-Length Too Small: Record not followed by newline, Remainder Length: ${I}, Offset: ${this._reader.getRawOffset()-g.byteLength}`)}if(this._reader.compressed)await this._reader.skipSize(2),g=ai;else{for(g=await this._reader.readlineRaw();g&&g.byteLength===2;)g=await this._reader.readlineRaw();this._offset=this._reader.getRawOffset(),g&&(this._offset-=g.length)}return g}_initRecordReader(g){return new FA(this._reader,Number(g.headers.get("Content-Length")||0))}async parse(){let g=await this.readToNextRecord(),I=g?uB.decode(g):"",i=new FI,B=await i.parse(this._reader,{firstLine:I,headersClass:this._headersClass});if(!B)return null;this._warcHeadersLength=this._reader.getReadOffset();let Q=new DI({warcHeaders:B,reader:this._initRecordReader(B)});if(this._record=Q,this._parseHttp)switch(Q.warcType){case"response":case"request":await this._addHttpHeaders(Q,i);break;case"revisit":Q.warcContentLength>0&&await this._addHttpHeaders(Q,i);break}return Q}get offset(){return this._offset}get recordLength(){return this._reader.getRawLength(this._offset)}async*[Symbol.asyncIterator](){let g=null;for(;(g=await this.parse())!==null;)yield g;this._record=null}async _addHttpHeaders(g,I){let i=await I.parse(this._reader,{headersClass:this._headersClass});g.httpHeaders=i;let B=this._reader.getReadOffset()-this._warcHeadersLength;g.reader instanceof FA&&g.reader.setLimitSkip(g.warcContentLength-B)}};function Ei(A){if(A instanceof Int8Array||A instanceof Uint8Array||A instanceof Uint8ClampedArray)return new DataView(A.buffer,A.byteOffset,A.byteLength);if(A instanceof ArrayBuffer)return new DataView(A);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}var je="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",$e="0123456789ABCDEFGHIJKLMNOPQRSTUV",AC="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function ni(A,g,I){I=I||{};let i,B;switch(g){case"RFC3548":case"RFC4648":i=je,B=!0;break;case"RFC4648-HEX":i=$e,B=!0;break;case"Crockford":i=AC,B=!1;break;default:throw new Error("Unknown base32 variant: "+g)}let Q=I.padding!==void 0?I.padding:B,e=Ei(A),C=0,E=0,t="";for(let a=0;a=5;)t+=i[E>>>C-5&31],C-=5;if(C>0&&(t+=i[E<<5-C&31]),Q)for(;t.length%8!==0;)t+="=";return t}var RB=uI(ei(),1);function kI(A,g,I,i){function B(Q){return Q instanceof I?Q:new I(function(e){e(Q)})}return new(I||(I=Promise))(function(Q,e){function C(a){try{t(i.next(a))}catch(s){e(s)}}function E(a){try{t(i.throw(a))}catch(s){e(s)}}function t(a){a.done?Q(a.value):B(a.value).then(C,E)}t((i=i.apply(A,g||[])).next())})}var U=class{constructor(){this.mutex=Promise.resolve()}lock(){let g=()=>{};return this.mutex=this.mutex.then(()=>new Promise(g)),new Promise(I=>{g=I})}dispatch(g){return kI(this,void 0,void 0,function*(){let I=yield this.lock();try{return yield Promise.resolve(g())}finally{I()}})}},oi;function IC(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global}var hi=IC(),ri=(oi=hi.Buffer)!==null&&oi!==void 0?oi:null,iC=hi.TextEncoder?new hi.TextEncoder:null;function NB(A,g){return(A&15)+(A>>6|A>>3&8)<<4|(g&15)+(g>>6|g>>3&8)}function gC(A,g){let I=g.length>>1;for(let i=0;i>>4;A[i++]=Q>9?Q+pB:Q+SB,Q=g[B]&15,A[i++]=Q>9?Q+pB:Q+SB}return String.fromCharCode.apply(null,A)}var GB=ri!==null?A=>{if(typeof A=="string"){let g=ri.from(A,"utf8");return new Uint8Array(g.buffer,g.byteOffset,g.length)}if(ri.isBuffer(A))return new Uint8Array(A.buffer,A.byteOffset,A.length);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")}:A=>{if(typeof A=="string")return iC.encode(A);if(ArrayBuffer.isView(A))return new Uint8Array(A.buffer,A.byteOffset,A.byteLength);throw new Error("Invalid data type!")},UB="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",PA=new Uint8Array(256);for(let A=0;A>4,B+=1,i[B]=(C&15)<<4|E>>2,B+=1,i[B]=(E&3)<<6|t&63,B+=1}return i}var lI=16*1024,_A=4,CC=new U,ci=new Map;function JB(A,g){return kI(this,void 0,void 0,function*(){let I=null,i=null,B=!1;if(typeof WebAssembly>"u")throw new Error("WebAssembly is not supported in this environment!");let Q=(r,h=0)=>{i.set(r,h)},e=()=>i,C=()=>I.exports,E=r=>{I.exports.Hash_SetMemorySize(r);let h=I.exports.Hash_GetBuffer(),f=I.exports.memory.buffer;i=new Uint8Array(f,h,r)},t=()=>new DataView(I.exports.memory.buffer).getUint32(I.exports.STATE_SIZE,!0),a=CC.dispatch(()=>kI(this,void 0,void 0,function*(){if(!ci.has(A.name)){let h=eC(A.data),f=WebAssembly.compile(h);ci.set(A.name,f)}let r=yield ci.get(A.name);I=yield WebAssembly.instantiate(r,{})})),s=()=>kI(this,void 0,void 0,function*(){I||(yield a);let r=I.exports.Hash_GetBuffer(),h=I.exports.memory.buffer;i=new Uint8Array(h,r,lI)}),o=(r=null)=>{B=!0,I.exports.Hash_Init(r)},n=r=>{let h=0;for(;h{if(!B)throw new Error("update() called before init()");let h=GB(r);n(h)},d=new Uint8Array(g*2),l=(r,h=null)=>{if(!B)throw new Error("digest() called before init()");return B=!1,I.exports.Hash_Final(h),r==="binary"?i.slice(0,g):HB(d,i,g)},w=()=>{if(!B)throw new Error("save() can only be called after init() and before digest()");let r=I.exports.Hash_GetState(),h=t(),f=I.exports.memory.buffer,y=new Uint8Array(f,r,h),G=new Uint8Array(_A+h);return gC(G,A.hash),G.set(y,_A),G},S=r=>{if(!(r instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");let h=I.exports.Hash_GetState(),f=t(),y=_A+f,G=I.exports.memory.buffer;if(r.length!==y)throw new Error(`Bad state length (expected ${y} bytes, got ${r.length})`);if(!BC(A.hash,r.subarray(0,_A)))throw new Error("This state was written by an incompatible hash implementation");let k=r.subarray(_A);new Uint8Array(G,h,f).set(k),B=!0},u=r=>typeof r=="string"?r.length
  • !0;break;case"blake2b":case"blake2s":F=(r,h)=>h<=512&&u(r);break;case"blake3":F=(r,h)=>h===0&&u(r);break;case"xxhash64":case"xxhash3":case"xxhash128":F=()=>!1;break}let c=(r,h=null,f=null)=>{if(!F(r,h))return o(h),D(r),l("hex",f);let y=GB(r);return i.set(y),I.exports.Hash_Calculate(y.length,h,f),HB(d,i,g)};return yield s(),{getMemory:e,writeMemory:Q,getExports:C,setMemorySize:E,init:o,update:D,digest:l,save:w,load:S,calculate:c,hashLength:g}})}var et=new U;var Ct=new U;var tt=new DataView(new ArrayBuffer(4));var at=new U;var Et=new U;var nt=new U;var ot=new U;var rt=new U;var ct=new U;var tC="sha1",aC="AGFzbQEAAAABEQRgAAF/YAJ/fwBgAABgAX8AAwkIAAECAQMCAAMEBQFwAQEBBQQBAQICBg4CfwFB4IkFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAACC0hhc2hfVXBkYXRlAAQKSGFzaF9GaW5hbAAFDUhhc2hfR2V0U3RhdGUABg5IYXNoX0NhbGN1bGF0ZQAHClNUQVRFX1NJWkUDAQqfKQgFAEGACQurIgoBfgJ/AX4BfwF+A38BfgF/AX5HfyAAIAEpAxAiAkIgiKciA0EYdCADQQh0QYCA/AdxciACQiiIp0GA/gNxIAJCOIincnIiBCABKQMIIgVCIIinIgNBGHQgA0EIdEGAgPwHcXIgBUIoiKdBgP4DcSAFQjiIp3JyIgZzIAEpAygiB0IgiKciA0EYdCADQQh0QYCA/AdxciAHQiiIp0GA/gNxIAdCOIincnIiCHMgBaciA0EYdCADQQh0QYCA/AdxciADQQh2QYD+A3EgA0EYdnJyIgkgASkDACIFpyIDQRh0IANBCHRBgID8B3FyIANBCHZBgP4DcSADQRh2cnIiCnMgASkDICILpyIDQRh0IANBCHRBgID8B3FyIANBCHZBgP4DcSADQRh2cnIiDHMgASkDMCINQiCIpyIDQRh0IANBCHRBgID8B3FyIA1CKIinQYD+A3EgDUI4iKdyciIDc0EBdyIOc0EBdyIPIAYgBUIgiKciEEEYdCAQQQh0QYCA/AdxciAFQiiIp0GA/gNxIAVCOIincnIiEXMgC0IgiK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(A=>{A.init();let g={init:()=>(A.init(),g),update:I=>(A.update(I),g),digest:I=>A.digest(I),save:()=>A.save(),load:I=>(A.load(I),g),blockSize:64,digestSize:20};return g})}var dt=new U;var ft=new U;var oC="sha256",rC="AGFzbQEAAAABEQRgAAF/YAF/AGACf38AYAAAAwgHAAEBAgMAAgQFAXABAQEFBAEBAgIGDgJ/AUHwiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCuJIBwUAQYAJC50BAEEAQgA3A8CJAUEAQRxBICAAQeABRiIAGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAAbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gABs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAAbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyAAGzcDyIkBC4ACAgF+Bn9BAEEAKQPAiQEiASAArXw3A8CJAQJAAkACQCABp0E/cSICDQBBgAkhAgwBCwJAIABBwAAgAmsiAyADIABLIgQbIgVFDQAgAkGAiQFqIQZBACECQQAhBwNAIAYgAmogAkGACWotAAA6AAAgBSAHQQFqIgdB/wFxIgJLDQALCyAEDQFByIkBQYCJARADIAAgA2shACADQYAJaiECCwJAIABBwABJDQADQEHIiQEgAhADIAJBwABqIQIgAEFAaiIAQT9LDQALCyAARQ0AQQAhB0EAIQUDQCAHQYCJAWogAiAHai0AADoAACAAIAVBAWoiBUH/AXEiB0sNAAsLC5M+AUV/IAAgASgCPCICQRh0IAJBCHRBgID8B3FyIAJBCHZBgP4DcSACQRh2cnIiAkEOdyACQQN2cyACQRl3cyABKAI4IgNBGHQgA0EIdEGAgPwHcXIgA0EIdkGA/gNxIANBGHZyciIDaiABKAIg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kBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC4IkBQQBBACgC3IkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC3IkBQQBBACgC2IkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC2IkBQQBBACgC1IkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC1IkBQQBBACgC0IkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC0IkBQQBBACgCzIkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYCzIkBQQBBACgCyIkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZyciIBNgLIiQECQEEAKALoiQEiBEUNAEEAIAE6AIAJIARBAUYNACABQQh2IQNBASEBQQEhAgNAIAFBgAlqIAM6AAAgBCACQQFqIgJB/wFxIgFNDQEgAUHIiQFqLQAAIQMMAAsLCwYAQYCJAQujAQBBAEIANwPAiQFBAEEcQSAgAUHgAUYiARs2AuiJAUEAQqef5qfG9JP9vn9Cq7OP/JGjs/DbACABGzcD4IkBQQBCsZaA/p+ihazoAEL/pLmIxZHagpt/IAEbNwPYiQFBAEKXusODk6eWh3dC8ua746On/aelfyABGzcD0IkBQQBC2L2WiPygtb42QufMp9DW0Ouzu38gARs3A8iJASAAEAIQBAsLCwEAQYAICwRwAAAA",cC="817d957e",hC={name:oC,data:rC,hash:cC},st=new U;var Ft=new U;function di(){return JB(hC,32).then(A=>{A.init(256);let g={init:()=>(A.init(256),g),update:I=>(A.update(I),g),digest:I=>A.digest(I),save:()=>A.save(),load:I=>(A.load(I),g),blockSize:64,digestSize:32};return g})}var Dt=new U;var wt=new U;var lt=new U;var kt=new U;var yt=new ArrayBuffer(8);var ut=new U;var pt=new ArrayBuffer(8);var St=new U;var Ht=new ArrayBuffer(8);var Gt=new U;var Ut=new U;var Nt=new U;var qB=new TextEncoder,fi=class{},yI=class extends fi{constructor(){super(...arguments);this.buffers=[]}write(I){this.buffers.push(I)}async*readAll(){for(let I of this.buffers)yield I}clear(){this.buffers=[]}},MB=class A extends j{constructor(I,i={},B=new yI){super();this.gzip=!1;this.digestAlgo="";this.digestAlgoPrefix="";this.digestBase32=!1;this.preferPako=!1;this._alreadyDigested=!1;this.blockHasher=null;this.payloadHasher=null;this.httpHeadersBuff=null;this.warcHeadersBuff=null;this.gzip=!!i.gzip,this.record=I;let Q=i.digest||{};this.digestAlgo=Q.algo||"sha-256",this.digestAlgoPrefix=Q.prefix||"sha256:",this.digestBase32=!!Q.base32,this.preferPako=!!i.preferPako,A.noComputeDigest(I)&&(this.digestAlgo=""),this.externalBuffer=B}static async serialize(I,i,B=new yI){return await new A(I,i,B).readFully()}static noComputeDigest(I){return I.warcType==="revisit"||I.warcType==="warcinfo"||I.warcPayloadDigest&&I.warcBlockDigest}async*[Symbol.asyncIterator](){if(!this.gzip){yield*this.generateRecord();return}if("CompressionStream"in globalThis&&!this.preferPako){let I=new globalThis.CompressionStream("gzip");yield*this.streamCompress(I)}else yield*this.pakoCompress()}async readlineRaw(I){return null}async*pakoCompress(){let I=new RB.default.Deflate({gzip:!0}),i=null;for await(let B of this.generateRecord())for(i&&i.length>0&&I.push(i),i=B;I.chunks.length;)yield I.chunks.shift();i&&I.push(i,!0),yield I.result}async*streamCompress(I){let i=this.generateRecord();new ReadableStream({async pull(C){let E=await i.next();E.done?C.close():C.enqueue(E.value)}}).pipeThrough(I);let Q=null,e=I.readable.getReader();for(;(Q=await e.read())&&!Q.done;)yield Q.value}async newHasher(){switch(this.digestAlgo){case"sha-256":return di();case"sha-1":return KB();case"":return null;default:return di()}}getDigest(I){return this.digestAlgoPrefix+(this.digestBase32?ni(I.digest("binary"),"RFC4648"):I.digest("hex"))}async digestRecord(){let I=this.record;if(this._alreadyDigested)return Number(I.warcHeaders.headers.get("Content-Length"));let i=await this.newHasher(),B=await this.newHasher(),Q=0;I.httpHeaders&&(this.httpHeadersBuff=qB.encode(I.httpHeaders.toString()+`\r +`),Q+=this.httpHeadersBuff.length,i?.update(this.httpHeadersBuff));for await(let e of I.reader)i?.update(e),B?.update(e),this.externalBuffer.write(e),Q+=e.length;return B&&I.warcHeaders.headers.set("WARC-Payload-Digest",this.getDigest(B)),i&&I.warcHeaders.headers.set("WARC-Block-Digest",this.getDigest(i)),I.warcHeaders.headers.set("Content-Length",Q.toString()),this.warcHeadersBuff=qB.encode(I.warcHeaders.toString()),this._alreadyDigested=!0,Q}async*generateRecord(){if(await this.digestRecord(),this.warcHeadersBuff&&(yield this.warcHeadersBuff),yield Ci,this.httpHeadersBuff&&(yield this.httpHeadersBuff),this.externalBuffer)for await(let I of this.externalBuffer.readAll())yield I;yield FB}};var dC=["offset","warc-type","warc-target-uri"],si=class{constructor(g={},I=dC){this.opts=g,g.fields?(this.fields=g.fields,this.reqFields=this.fields.filter(i=>FC(i))):(this.fields=I,this.reqFields=[]),this.parseHttp=!1}serialize(g){return JSON.stringify(g)+` +`}write(g,I){I.write(this.serialize(g))}async writeAll(g,I){for await(let i of this.iterIndex(g))this.write(i,I)}async*iterIndex(g){let I={strictHeaders:!0,parseHttp:this.parseHttp};for(let{filename:i,reader:B}of g){let Q=new wI(B,I);yield*this.iterRecords(Q,i)}}async*iterRecords(g,I){for await(let i of g){await i.skipFully();let B=this.indexRecord(i,g,I);B&&(yield B)}}indexRecord(g,I,i){if(this.filterRecord&&!this.filterRecord(g))return null;let B={},{offset:Q,recordLength:e}=I,C={offset:Q,length:e,filename:i};for(let E of this.fields)E in C?B[E]=C[E]:this.setField(E,g,B);return B}setField(g,I,i){let B=this.getField(g,I);B!==null&&(i[g]=B)}getField(g,I){if(g.startsWith("req."))if(I.warcType==="request")g=g.slice(4);else return null;if(g==="http:status")return I.httpHeaders&&(I.warcType==="response"||I.warcType==="revisit")?I.httpHeaders.statusCode:null;if(g.startsWith("http:")){if(I.httpHeaders){let i=I.httpHeaders.headers,B=g.slice(5),Q=i.get(B);if(i instanceof Map){let e=B.toLowerCase();for(let C of i.keys())e===C.toLowerCase()&&(Q=i.get(C))}return Q}return null}return I.warcHeaders.headers.get(g)||null}},Fi=class extends si{constructor(g,I){super(g,I);for(let i of this.fields)if(i.startsWith("http:")){this.parseHttp=!0;break}}},fC="urlkey,timestamp,url,mime,status,digest,length,offset,filename".split(","),sC="urlkey,timestamp,url,mime,status,digest,redirect,meta,length,offset,filename".split(","),Di=class extends Fi{constructor(I){super(I,fC);switch(this.includeAll=!!I?.all,this.overrideIndexForAll=!!I?.all,this.parseHttp=!0,this.noSurt=!!I?.noSurt,this._lastRecord=null,I?.format){case"cdxj":this.serialize=this.serializeCDXJ;break;case"cdx":this.serialize=this.serializeCDX11;break;case"json":default:break}}async*iterRecords(I,i){this._lastRecord=null;for await(let Q of I){await Q.readFully();let e=this.indexRecord(Q,I,i);e&&(yield e)}let B=this.indexRecord(null,I,i);B&&(yield B)}filterRecord(I){if(this.includeAll)return!0;let i=I.warcType;return!(i==="request"||i==="warcinfo"||(i==="metadata"||i==="resource")&&I.warcContentType==="application/warc-fields")}indexRecord(I,i,B){if(this.overrideIndexForAll)return I?super.indexRecord(I,i,B):null;let Q=this._lastRecord;if(this._lastRecord=I,I&&(I._offset=i.offset,I._length=i.recordLength),!Q)return null;if(!I||Q.warcTargetURI!=I.warcTargetURI)return this.indexRecordPair(Q,null,i,B);let e=I.warcType,C=Q.warcType;return e==="request"&&(C==="response"||C==="revisit")?(this._lastRecord=null,this.indexRecordPair(Q,I,i,B)):(e==="response"||e==="revisit")&&C==="request"?(this._lastRecord=null,this.indexRecordPair(I,Q,i,B)):this.indexRecordPair(Q,null,i,B)}indexRecordPair(I,i,B,Q){let e,C,E=I.warcTargetURI||"";if(i?.httpHeaders&&i.httpHeaders.method!=="GET"){let a={url:E,method:i.httpHeaders.method,headers:i.httpHeaders.headers,postData:i.payload};e=a.method,cB(a)&&(C=a.requestBody,E=a.url)}I._urlkey=E;let t=super.indexRecord(I,B,Q);if(t&&(I._offset!==void 0&&(t.offset=I._offset,t.length=I._length),e&&(t.method=e),C&&(t.requestBody=C),i&&this.reqFields.length))for(let a of this.reqFields)this.setField(a,i,t);return t}serializeCDXJ(I){let{urlkey:i,timestamp:B}=I;return delete I.urlkey,delete I.timestamp,`${i} ${B} ${JSON.stringify(I,(e,C)=>["offset","length","status"].includes(e)?C==null?"":""+C:C)} +`}serializeCDX11(I){let i=[];for(let B of sC)i.push(I[B]!=null?I[B]:"-");return i.join(" ")+` +`}getField(I,i){let B=null;switch(I){case"urlkey":return B=i._urlkey||i.warcTargetURI||null,this.noSurt||B===null?B:rB(B);case"timestamp":return B=i.warcDate??"",B.replace(/[-:T]/g,"").slice(0,14);case"url":return i.warcTargetURI;case"mime":switch(i.warcType){case"revisit":return"warc/revisit";case"response":case"request":I="http:content-type";break;default:return i.warcContentType}return B=super.getField(I,i),B?B.toString().split(";",1)[0]?.trim():null;case"status":return super.getField("http:status",i);case"referrer":return super.getField("req.http:referer",i);case"digest":return B=i.warcPayloadDigest,B?B.split(":",2)[1]:null;default:return super.getField(I,i)}}},YB=class extends Di{constructor(g){super(g),this.overrideIndexForAll=!1}indexRecordPair(g,I,i,B){let Q=super.indexRecordPair(g,I,i,B);return Q&&{cdx:Q,record:g,reqRecord:I}}};function FC(A){return A.startsWith("req.")||A.toLowerCase()==="referrer"}export{sA as AsyncIterReader,j as BaseAsyncIterReader,fi as BaseSerializerBuffer,YB as CDXAndRecordIndexer,Di as CDXIndexer,Ci as CRLF,FB as CRLFCRLF,fC as DEFAULT_CDX_FIELDS,dC as DEFAULT_FIELDS,sC as DEFAULT_LEGACY_CDX_FIELDS,T as HeadersMultiMap,Fi as Indexer,FA as LimitReader,WA as NoConcatInflator,yI as SerializerInMemBuffer,NA as StatusAndHeaders,FI as StatusAndHeadersParser,hB as UTFToLatin1,wI as WARCParser,DI as WARCRecord,MB as WARCSerializer,lB as WARC_1_0,We as WARC_1_1,Re as appendRequestQuery,nB as binaryToString,UA as concatChunks,rB as getSurt,be as indexOfDoubleCRLF,FC as isRequestHeader,Ye as jsonToQueryParams,oB as jsonToQueryString,dB as latin1ToUTF,xe as mfdToQueryParams,me as mfdToQueryString,xC as multiValueHeader,cB as postToGetUrl,Ve as readToDoubleCRLF,YC as rxEscape,fA as splitChunk}; +/*! Bundled license information: + +hash-wasm/dist/index.esm.js: + (*! + * hash-wasm (https://www.npmjs.com/package/hash-wasm) + * (c) Dani Biro + * @license MIT + *) + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** *) +*/ +//# sourceMappingURL=index.all.js.map \ No newline at end of file diff --git a/dist/index.all.js.map b/dist/index.all.js.map new file mode 100644 index 0000000..9141454 --- /dev/null +++ b/dist/index.all.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../node_modules/pako/lib/utils/common.js","../node_modules/pako/lib/zlib/trees.js","../node_modules/pako/lib/zlib/adler32.js","../node_modules/pako/lib/zlib/crc32.js","../node_modules/pako/lib/zlib/messages.js","../node_modules/pako/lib/zlib/deflate.js","../node_modules/pako/lib/utils/strings.js","../node_modules/pako/lib/zlib/zstream.js","../node_modules/pako/lib/deflate.js","../node_modules/pako/lib/zlib/inffast.js","../node_modules/pako/lib/zlib/inftrees.js","../node_modules/pako/lib/zlib/inflate.js","../node_modules/pako/lib/zlib/constants.js","../node_modules/pako/lib/zlib/gzheader.js","../node_modules/pako/lib/inflate.js","../node_modules/pako/index.js","../node_modules/uuid-random/index.js","../src/lib/readers.ts","../src/lib/utils.ts","../src/lib/statusandheaders.ts","../src/lib/warcrecord.ts","../src/lib/warcparser.ts","../node_modules/to-data-view/index.js","../node_modules/base32-encode/index.js","../src/lib/warcserializer.ts","../node_modules/hash-wasm/dist/index.esm.js","../src/lib/indexer.ts"],"sourcesContent":["'use strict';\n\n\nvar TYPED_OK = (typeof Uint8Array !== 'undefined') &&\n (typeof Uint16Array !== 'undefined') &&\n (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n var sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n var source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (var p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n if (buf.length === size) { return buf; }\n if (buf.subarray) { return buf.subarray(0, size); }\n buf.length = size;\n return buf;\n};\n\n\nvar fnTyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n if (src.subarray && dest.subarray) {\n dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n return;\n }\n // Fallback to ordinary array\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n var i, l, len, pos, chunk, result;\n\n // calculate data length\n len = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n result = new Uint8Array(len);\n pos = 0;\n for (i = 0, l = chunks.length; i < l; i++) {\n chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n }\n};\n\nvar fnUntyped = {\n arraySet: function (dest, src, src_offs, len, dest_offs) {\n for (var i = 0; i < len; i++) {\n dest[dest_offs + i] = src[src_offs + i];\n }\n },\n // Join array of chunks to single array.\n flattenChunks: function (chunks) {\n return [].concat.apply([], chunks);\n }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n if (on) {\n exports.Buf8 = Uint8Array;\n exports.Buf16 = Uint16Array;\n exports.Buf32 = Int32Array;\n exports.assign(exports, fnTyped);\n } else {\n exports.Buf8 = Array;\n exports.Buf16 = Array;\n exports.Buf32 = Array;\n exports.assign(exports, fnUntyped);\n }\n};\n\nexports.setTyped(TYPED_OK);\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED = 1;\n//var Z_HUFFMAN_ONLY = 2;\n//var Z_RLE = 3;\nvar Z_FIXED = 4;\n//var Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY = 0;\nvar Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES = 30;\n/* number of distance codes */\n\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK = 256;\n/* end of block literal code */\n\nvar REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits = /* extra bits for each length code */\n [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];\n\nvar extra_dbits = /* extra bits for each distance code */\n [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];\n\nvar extra_blbits = /* extra bits for each bit length code */\n [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n this.static_tree = static_tree; /* static tree or NULL */\n this.extra_bits = extra_bits; /* extra bits for each code or NULL */\n this.extra_base = extra_base; /* base index for extra_bits */\n this.elems = elems; /* max number of elements in the tree */\n this.max_length = max_length; /* max bit length for the codes */\n\n // show if `static_tree` has data or dummy - needed for monomorphic objects\n this.has_stree = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n this.dyn_tree = dyn_tree; /* the dynamic tree */\n this.max_code = 0; /* largest code with non zero frequency */\n this.stat_desc = stat_desc; /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n// put_byte(s, (uch)((w) & 0xff));\n// put_byte(s, (uch)((ush)(w) >> 8));\n s.pending_buf[s.pending++] = (w) & 0xff;\n s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n if (s.bi_valid > (Buf_size - length)) {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n put_short(s, s.bi_buf);\n s.bi_buf = value >> (Buf_size - s.bi_valid);\n s.bi_valid += length - Buf_size;\n } else {\n s.bi_buf |= (value << s.bi_valid) & 0xffff;\n s.bi_valid += length;\n }\n}\n\n\nfunction send_code(s, c, tree) {\n send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n var res = 0;\n do {\n res |= code & 1;\n code >>>= 1;\n res <<= 1;\n } while (--len > 0);\n return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n if (s.bi_valid === 16) {\n put_short(s, s.bi_buf);\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n } else if (s.bi_valid >= 8) {\n s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n s.bi_buf >>= 8;\n s.bi_valid -= 8;\n }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n * above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n * array bl_count contains the frequencies for each bit length.\n * The length opt_len is updated; static_len is also updated if stree is\n * not null.\n */\nfunction gen_bitlen(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var max_code = desc.max_code;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var extra = desc.stat_desc.extra_bits;\n var base = desc.stat_desc.extra_base;\n var max_length = desc.stat_desc.max_length;\n var h; /* heap index */\n var n, m; /* iterate over the tree elements */\n var bits; /* bit length */\n var xbits; /* extra bits */\n var f; /* frequency */\n var overflow = 0; /* number of elements with bit length too large */\n\n for (bits = 0; bits <= MAX_BITS; bits++) {\n s.bl_count[bits] = 0;\n }\n\n /* In a first pass, compute the optimal bit lengths (which may\n * overflow in the case of the bit length tree).\n */\n tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n n = s.heap[h];\n bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n if (bits > max_length) {\n bits = max_length;\n overflow++;\n }\n tree[n * 2 + 1]/*.Len*/ = bits;\n /* We overwrite tree[n].Dad which is no longer needed */\n\n if (n > max_code) { continue; } /* not a leaf node */\n\n s.bl_count[bits]++;\n xbits = 0;\n if (n >= base) {\n xbits = extra[n - base];\n }\n f = tree[n * 2]/*.Freq*/;\n s.opt_len += f * (bits + xbits);\n if (has_stree) {\n s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n }\n }\n if (overflow === 0) { return; }\n\n // Trace((stderr,\"\\nbit length overflow\\n\"));\n /* This happens for example on obj2 and pic of the Calgary corpus */\n\n /* Find the first bit length which could increase: */\n do {\n bits = max_length - 1;\n while (s.bl_count[bits] === 0) { bits--; }\n s.bl_count[bits]--; /* move one leaf down the tree */\n s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n s.bl_count[max_length]--;\n /* The brother of the overflow item also moves one step up,\n * but this does not affect bl_count[max_length]\n */\n overflow -= 2;\n } while (overflow > 0);\n\n /* Now recompute all bit lengths, scanning in increasing frequency.\n * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n * lengths instead of fixing only the wrong ones. This idea is taken\n * from 'ar' written by Haruhiko Okumura.)\n */\n for (bits = max_length; bits !== 0; bits--) {\n n = s.bl_count[bits];\n while (n !== 0) {\n m = s.heap[--h];\n if (m > max_code) { continue; }\n if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n tree[m * 2 + 1]/*.Len*/ = bits;\n }\n n--;\n }\n }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n * zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1< length code (0..28) */\n length = 0;\n for (code = 0; code < LENGTH_CODES - 1; code++) {\n base_length[code] = length;\n for (n = 0; n < (1 << extra_lbits[code]); n++) {\n _length_code[length++] = code;\n }\n }\n //Assert (length == 256, \"tr_static_init: length != 256\");\n /* Note that the length 255 (match length 258) can be represented\n * in two different ways: code 284 + 5 bits or code 285, so we\n * overwrite length_code[255] to use the best encoding:\n */\n _length_code[length - 1] = code;\n\n /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n dist = 0;\n for (code = 0; code < 16; code++) {\n base_dist[code] = dist;\n for (n = 0; n < (1 << extra_dbits[code]); n++) {\n _dist_code[dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: dist != 256\");\n dist >>= 7; /* from now on, all distances are divided by 128 */\n for (; code < D_CODES; code++) {\n base_dist[code] = dist << 7;\n for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n _dist_code[256 + dist++] = code;\n }\n }\n //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n /* Construct the codes of the static literal tree */\n for (bits = 0; bits <= MAX_BITS; bits++) {\n bl_count[bits] = 0;\n }\n\n n = 0;\n while (n <= 143) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n while (n <= 255) {\n static_ltree[n * 2 + 1]/*.Len*/ = 9;\n n++;\n bl_count[9]++;\n }\n while (n <= 279) {\n static_ltree[n * 2 + 1]/*.Len*/ = 7;\n n++;\n bl_count[7]++;\n }\n while (n <= 287) {\n static_ltree[n * 2 + 1]/*.Len*/ = 8;\n n++;\n bl_count[8]++;\n }\n /* Codes 286 and 287 do not exist, but we must include them in the\n * tree construction to get a canonical Huffman tree (longest code\n * all ones)\n */\n gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n /* The static distance tree is trivial: */\n for (n = 0; n < D_CODES; n++) {\n static_dtree[n * 2 + 1]/*.Len*/ = 5;\n static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n }\n\n // Now data ready and we can init static trees\n static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);\n static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);\n\n //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n var n; /* iterates over tree elements */\n\n /* Initialize the trees. */\n for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n s.opt_len = s.static_len = 0;\n s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n if (s.bi_valid > 8) {\n put_short(s, s.bi_buf);\n } else if (s.bi_valid > 0) {\n //put_byte(s, (Byte)s->bi_buf);\n s.pending_buf[s.pending++] = s.bi_buf;\n }\n s.bi_buf = 0;\n s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf *buf; /* the input data */\n//unsigned len; /* its length */\n//int header; /* true if block header must be written */\n{\n bi_windup(s); /* align on byte boundary */\n\n if (header) {\n put_short(s, len);\n put_short(s, ~len);\n }\n// while (len--) {\n// put_byte(s, *buf++);\n// }\n utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n var _n2 = n * 2;\n var _m2 = m * 2;\n return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n// deflate_state *s;\n// ct_data *tree; /* the tree to restore */\n// int k; /* node to move down */\n{\n var v = s.heap[k];\n var j = k << 1; /* left son of k */\n while (j <= s.heap_len) {\n /* Set j to the smallest of the two sons: */\n if (j < s.heap_len &&\n smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n j++;\n }\n /* Exit if v is smaller than both sons */\n if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n /* Exchange v with the smallest son */\n s.heap[k] = s.heap[j];\n k = j;\n\n /* And continue down the tree, setting j to the left son of k */\n j <<= 1;\n }\n s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n// deflate_state *s;\n// const ct_data *ltree; /* literal tree */\n// const ct_data *dtree; /* distance tree */\n{\n var dist; /* distance of matched string */\n var lc; /* match length or unmatched char (if dist == 0) */\n var lx = 0; /* running index in l_buf */\n var code; /* the code to send */\n var extra; /* number of extra bits to send */\n\n if (s.last_lit !== 0) {\n do {\n dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);\n lc = s.pending_buf[s.l_buf + lx];\n lx++;\n\n if (dist === 0) {\n send_code(s, lc, ltree); /* send a literal byte */\n //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n } else {\n /* Here, lc is the match length - MIN_MATCH */\n code = _length_code[lc];\n send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n extra = extra_lbits[code];\n if (extra !== 0) {\n lc -= base_length[code];\n send_bits(s, lc, extra); /* send the extra length bits */\n }\n dist--; /* dist is now the match distance - 1 */\n code = d_code(dist);\n //Assert (code < D_CODES, \"bad d_code\");\n\n send_code(s, code, dtree); /* send the distance code */\n extra = extra_dbits[code];\n if (extra !== 0) {\n dist -= base_dist[code];\n send_bits(s, dist, extra); /* send the extra distance bits */\n }\n } /* literal or match pair ? */\n\n /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n // \"pendingBuf overflow\");\n\n } while (lx < s.last_lit);\n }\n\n send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n * and corresponding code. The length opt_len is updated; static_len is\n * also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n// deflate_state *s;\n// tree_desc *desc; /* the tree descriptor */\n{\n var tree = desc.dyn_tree;\n var stree = desc.stat_desc.static_tree;\n var has_stree = desc.stat_desc.has_stree;\n var elems = desc.stat_desc.elems;\n var n, m; /* iterate over heap elements */\n var max_code = -1; /* largest code with non zero frequency */\n var node; /* new node being created */\n\n /* Construct the initial heap, with least frequent element in\n * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n * heap[0] is not used.\n */\n s.heap_len = 0;\n s.heap_max = HEAP_SIZE;\n\n for (n = 0; n < elems; n++) {\n if (tree[n * 2]/*.Freq*/ !== 0) {\n s.heap[++s.heap_len] = max_code = n;\n s.depth[n] = 0;\n\n } else {\n tree[n * 2 + 1]/*.Len*/ = 0;\n }\n }\n\n /* The pkzip format requires that at least one distance code exists,\n * and that at least one bit should be sent even if there is only one\n * possible code. So to avoid special checks later on we force at least\n * two codes of non zero frequency.\n */\n while (s.heap_len < 2) {\n node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n tree[node * 2]/*.Freq*/ = 1;\n s.depth[node] = 0;\n s.opt_len--;\n\n if (has_stree) {\n s.static_len -= stree[node * 2 + 1]/*.Len*/;\n }\n /* node is 0 or 1 so it does not have extra bits */\n }\n desc.max_code = max_code;\n\n /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n * establish sub-heaps of increasing lengths:\n */\n for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n /* Construct the Huffman tree by repeatedly combining the least two\n * frequent nodes.\n */\n node = elems; /* next internal node of the tree */\n do {\n //pqremove(s, tree, n); /* n = node of least frequency */\n /*** pqremove ***/\n n = s.heap[1/*SMALLEST*/];\n s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n pqdownheap(s, tree, 1/*SMALLEST*/);\n /***/\n\n m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n s.heap[--s.heap_max] = m;\n\n /* Create a new node father of n and m */\n tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n /* and insert the new node in the heap */\n s.heap[1/*SMALLEST*/] = node++;\n pqdownheap(s, tree, 1/*SMALLEST*/);\n\n } while (s.heap_len >= 2);\n\n s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n /* At this point, the fields freq and dad are set. We can now\n * generate the bit lengths.\n */\n gen_bitlen(s, desc);\n\n /* The field len is now set, we can generate the bit codes */\n gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n } else if (curlen !== 0) {\n\n if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n } else if (count <= 10) {\n s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n } else {\n s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n }\n\n count = 0;\n prevlen = curlen;\n\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n// deflate_state *s;\n// ct_data *tree; /* the tree to be scanned */\n// int max_code; /* and its largest code of non zero frequency */\n{\n var n; /* iterates over all tree elements */\n var prevlen = -1; /* last emitted length */\n var curlen; /* length of current code */\n\n var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n var count = 0; /* repeat count of the current code */\n var max_count = 7; /* max repeat count */\n var min_count = 4; /* min repeat count */\n\n /* tree[max_code+1].Len = -1; */ /* guard already set */\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n }\n\n for (n = 0; n <= max_code; n++) {\n curlen = nextlen;\n nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n if (++count < max_count && curlen === nextlen) {\n continue;\n\n } else if (count < min_count) {\n do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n } else if (curlen !== 0) {\n if (curlen !== prevlen) {\n send_code(s, curlen, s.bl_tree);\n count--;\n }\n //Assert(count >= 3 && count <= 6, \" 3_6?\");\n send_code(s, REP_3_6, s.bl_tree);\n send_bits(s, count - 3, 2);\n\n } else if (count <= 10) {\n send_code(s, REPZ_3_10, s.bl_tree);\n send_bits(s, count - 3, 3);\n\n } else {\n send_code(s, REPZ_11_138, s.bl_tree);\n send_bits(s, count - 11, 7);\n }\n\n count = 0;\n prevlen = curlen;\n if (nextlen === 0) {\n max_count = 138;\n min_count = 3;\n\n } else if (curlen === nextlen) {\n max_count = 6;\n min_count = 3;\n\n } else {\n max_count = 7;\n min_count = 4;\n }\n }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n var max_blindex; /* index of last bit length code of non zero freq */\n\n /* Determine the bit length frequencies for literal and distance trees */\n scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n /* Build the bit length tree: */\n build_tree(s, s.bl_desc);\n /* opt_len now includes the length of the tree representations, except\n * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n */\n\n /* Determine the number of bit length codes to send. The pkzip format\n * requires that at least 4 bit length codes be sent. (appnote.txt says\n * 3 but the actual value used is 4.)\n */\n for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n break;\n }\n }\n /* Update opt_len to include the bit length tree and counts */\n s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n // s->opt_len, s->static_len));\n\n return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n// deflate_state *s;\n// int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n var rank; /* index in bl_order */\n\n //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n // \"too many codes\");\n //Tracev((stderr, \"\\nbl counts: \"));\n send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n send_bits(s, dcodes - 1, 5);\n send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */\n for (rank = 0; rank < blcodes; rank++) {\n //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n }\n //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n * a) There are no non-portable control characters belonging to the\n * \"black list\" (0..6, 14..25, 28..31).\n * b) There is at least one printable character belonging to the\n * \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n * \"gray list\" that is ignored in this detection algorithm:\n * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n /* black_mask is the bit mask of black-listed bytes\n * set bits 0..6, 14..25, and 28..31\n * 0xf3ffc07f = binary 11110011111111111100000001111111\n */\n var black_mask = 0xf3ffc07f;\n var n;\n\n /* Check for non-textual (\"black-listed\") bytes. */\n for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n return Z_BINARY;\n }\n }\n\n /* Check for textual (\"white-listed\") bytes. */\n if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n for (n = 32; n < LITERALS; n++) {\n if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n return Z_TEXT;\n }\n }\n\n /* There are no \"black-listed\" or \"white-listed\" bytes:\n * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n */\n return Z_BINARY;\n}\n\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n if (!static_init_done) {\n tr_static_init();\n static_init_done = true;\n }\n\n s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);\n s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);\n s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n s.bi_buf = 0;\n s.bi_valid = 0;\n\n /* Initialize the first block of the first file: */\n init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */\n copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n send_bits(s, STATIC_TREES << 1, 3);\n send_code(s, END_BLOCK, static_ltree);\n bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf; /* input block, or NULL if too old */\n//ulg stored_len; /* length of input block */\n//int last; /* one if this is the last block for a file */\n{\n var opt_lenb, static_lenb; /* opt_len and static_len in bytes */\n var max_blindex = 0; /* index of last bit length code of non zero freq */\n\n /* Build the Huffman trees unless a stored block is forced */\n if (s.level > 0) {\n\n /* Check if the file is binary or text */\n if (s.strm.data_type === Z_UNKNOWN) {\n s.strm.data_type = detect_data_type(s);\n }\n\n /* Construct the literal and distance trees */\n build_tree(s, s.l_desc);\n // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n\n build_tree(s, s.d_desc);\n // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n // s->static_len));\n /* At this point, opt_len and static_len are the total bit lengths of\n * the compressed block data, excluding the tree representations.\n */\n\n /* Build the bit length tree for the above two trees, and get the index\n * in bl_order of the last bit length code to send.\n */\n max_blindex = build_bl_tree(s);\n\n /* Determine the best encoding. Compute the block lengths in bytes. */\n opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n // s->last_lit));\n\n if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n } else {\n // Assert(buf != (char*)0, \"lost buf\");\n opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n }\n\n if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n /* 4: two words for the lengths */\n\n /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n * Otherwise we can't have processed more than WSIZE input bytes since\n * the last block flush, because compression would have been\n * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n * transform a block into a stored block.\n */\n _tr_stored_block(s, buf, stored_len, last);\n\n } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n compress_block(s, static_ltree, static_dtree);\n\n } else {\n send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n compress_block(s, s.dyn_ltree, s.dyn_dtree);\n }\n // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n /* The above check is made mod 2^32, for files larger than 512 MB\n * and uLong implemented on 32 bits.\n */\n init_block(s);\n\n if (last) {\n bi_windup(s);\n }\n // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n // s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc * 2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize - 1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}\n\nexports._tr_init = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction adler32(adler, buf, len, pos) {\n var s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n var c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n var t = crcTable,\n end = pos + len;\n\n crc ^= -1;\n\n for (var i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar trees = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar msg = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\nvar Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\n//var Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\n//var Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\n//var Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION = 0;\n//var Z_BEST_SPEED = 1;\n//var Z_BEST_COMPRESSION = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED = 1;\nvar Z_HUFFMAN_ONLY = 2;\nvar Z_RLE = 3;\nvar Z_FIXED = 4;\nvar Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY = 0;\n//var Z_TEXT = 1;\n//var Z_ASCII = 1; // = Z_TEXT\nvar Z_UNKNOWN = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES = 30;\n/* number of distance codes */\nvar BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n strm.msg = msg[errorCode];\n return errorCode;\n}\n\nfunction rank(f) {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n var s = strm.state;\n\n //_tr_flush_bits(s);\n var len = s.pending;\n if (len > strm.avail_out) {\n len = strm.avail_out;\n }\n if (len === 0) { return; }\n\n utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n strm.next_out += len;\n s.pending_out += len;\n strm.total_out += len;\n strm.avail_out -= len;\n s.pending -= len;\n if (s.pending === 0) {\n s.pending_out = 0;\n }\n}\n\n\nfunction flush_block_only(s, last) {\n trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n s.block_start = s.strstart;\n flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n// put_byte(s, (Byte)(b >> 8));\n// put_byte(s, (Byte)(b & 0xff));\n s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read. All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n var len = strm.avail_in;\n\n if (len > size) { len = size; }\n if (len === 0) { return 0; }\n\n strm.avail_in -= len;\n\n // zmemcpy(buf, strm->next_in, len);\n utils.arraySet(buf, strm.input, strm.next_in, len, start);\n if (strm.state.wrap === 1) {\n strm.adler = adler32(strm.adler, buf, len, start);\n }\n\n else if (strm.state.wrap === 2) {\n strm.adler = crc32(strm.adler, buf, len, start);\n }\n\n strm.next_in += len;\n strm.total_in += len;\n\n return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n var chain_length = s.max_chain_length; /* max hash chain length */\n var scan = s.strstart; /* current string */\n var match; /* matched string */\n var len; /* length of current match */\n var best_len = s.prev_length; /* best match length so far */\n var nice_match = s.nice_match; /* stop if match long enough */\n var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n var _win = s.window; // shortcut\n\n var wmask = s.w_mask;\n var prev = s.prev;\n\n /* Stop when cur_match becomes <= limit. To simplify the code,\n * we prevent matches with the string of window index 0.\n */\n\n var strend = s.strstart + MAX_MATCH;\n var scan_end1 = _win[scan + best_len - 1];\n var scan_end = _win[scan + best_len];\n\n /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n * It is easy to get rid of this optimization if necessary.\n */\n // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n /* Do not waste too much time if we already have a good match: */\n if (s.prev_length >= s.good_match) {\n chain_length >>= 2;\n }\n /* Do not look for matches beyond the end of the input. This is necessary\n * to make deflate deterministic.\n */\n if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n do {\n // Assert(cur_match < s->strstart, \"no future\");\n match = cur_match;\n\n /* Skip to next match if the match length cannot increase\n * or if the match length is less than 2. Note that the checks below\n * for insufficient lookahead only occur occasionally for performance\n * reasons. Therefore uninitialized memory will be accessed, and\n * conditional jumps will be made that depend on those values.\n * However the length of the match is limited to the lookahead, so\n * the output of deflate is not affected by the uninitialized values.\n */\n\n if (_win[match + best_len] !== scan_end ||\n _win[match + best_len - 1] !== scan_end1 ||\n _win[match] !== _win[scan] ||\n _win[++match] !== _win[scan + 1]) {\n continue;\n }\n\n /* The check at best_len-1 can be removed because it will be made\n * again later. (This heuristic is not always a win.)\n * It is not necessary to compare scan[2] and match[2] since they\n * are always equal when the other bytes match, given that\n * the hash keys are equal and that HASH_BITS >= 8.\n */\n scan += 2;\n match++;\n // Assert(*scan == *match, \"match[2]?\");\n\n /* We check for insufficient lookahead only every 8th comparison;\n * the 256th check will be made at strstart+258.\n */\n do {\n /*jshint noempty:false*/\n } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n scan < strend);\n\n // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n len = MAX_MATCH - (strend - scan);\n scan = strend - MAX_MATCH;\n\n if (len > best_len) {\n s.match_start = cur_match;\n best_len = len;\n if (len >= nice_match) {\n break;\n }\n scan_end1 = _win[scan + best_len - 1];\n scan_end = _win[scan + best_len];\n }\n } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n if (best_len <= s.lookahead) {\n return best_len;\n }\n return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n * At least one byte has been read, or avail_in == 0; reads are\n * performed for at least two bytes (required for the zip translate_eol\n * option -- not supported here).\n */\nfunction fill_window(s) {\n var _w_size = s.w_size;\n var p, n, m, more, str;\n\n //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n do {\n more = s.window_size - s.lookahead - s.strstart;\n\n // JS ints have 32 bit, block below not needed\n /* Deal with !@#$% 64K limit: */\n //if (sizeof(int) <= 2) {\n // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n // more = wsize;\n //\n // } else if (more == (unsigned)(-1)) {\n // /* Very unlikely, but possible on 16 bit machine if\n // * strstart == 0 && lookahead == 1 (input done a byte at time)\n // */\n // more--;\n // }\n //}\n\n\n /* If the window is almost full and there is insufficient lookahead,\n * move the upper half to the lower one to make room in the upper half.\n */\n if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n s.match_start -= _w_size;\n s.strstart -= _w_size;\n /* we now have strstart >= MAX_DIST */\n s.block_start -= _w_size;\n\n /* Slide the hash table (could be avoided with 32 bit values\n at the expense of memory usage). We slide even when level == 0\n to keep the hash table consistent if we switch back to level > 0\n later. (Using level 0 permanently is not an optimal usage of\n zlib, so we don't care about this pathological case.)\n */\n\n n = s.hash_size;\n p = n;\n do {\n m = s.head[--p];\n s.head[p] = (m >= _w_size ? m - _w_size : 0);\n } while (--n);\n\n n = _w_size;\n p = n;\n do {\n m = s.prev[--p];\n s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n /* If n is not on any hash chain, prev[n] is garbage but\n * its value will never be used.\n */\n } while (--n);\n\n more += _w_size;\n }\n if (s.strm.avail_in === 0) {\n break;\n }\n\n /* If there was no sliding:\n * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n * more == window_size - lookahead - strstart\n * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n * => more >= window_size - 2*WSIZE + 2\n * In the BIG_MEM or MMAP case (not yet supported),\n * window_size == input_size + MIN_LOOKAHEAD &&\n * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n * Otherwise, window_size == 2*WSIZE so more >= 2.\n * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n */\n //Assert(more >= 2, \"more < 2\");\n n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n s.lookahead += n;\n\n /* Initialize the hash value now that we have some input: */\n if (s.lookahead + s.insert >= MIN_MATCH) {\n str = s.strstart - s.insert;\n s.ins_h = s.window[str];\n\n /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n// Call update_hash() MIN_MATCH-3 more times\n//#endif\n while (s.insert) {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = str;\n str++;\n s.insert--;\n if (s.lookahead + s.insert < MIN_MATCH) {\n break;\n }\n }\n }\n /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n * but this is not important since only literal bytes will be emitted.\n */\n\n } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n /* If the WIN_INIT bytes after the end of the current data have never been\n * written, then zero those bytes in order to avoid memory check reports of\n * the use of uninitialized (or uninitialised as Julian writes) bytes by\n * the longest match routines. Update the high water mark for the next\n * time through here. WIN_INIT is set to MAX_MATCH since the longest match\n * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n */\n// if (s.high_water < s.window_size) {\n// var curr = s.strstart + s.lookahead;\n// var init = 0;\n//\n// if (s.high_water < curr) {\n// /* Previous high water mark below current data -- zero WIN_INIT\n// * bytes or up to end of window, whichever is less.\n// */\n// init = s.window_size - curr;\n// if (init > WIN_INIT)\n// init = WIN_INIT;\n// zmemzero(s->window + curr, (unsigned)init);\n// s->high_water = curr + init;\n// }\n// else if (s->high_water < (ulg)curr + WIN_INIT) {\n// /* High water mark at or above current data, but below current data\n// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n// * to end of window, whichever is less.\n// */\n// init = (ulg)curr + WIN_INIT - s->high_water;\n// if (init > s->window_size - s->high_water)\n// init = s->window_size - s->high_water;\n// zmemzero(s->window + s->high_water, (unsigned)init);\n// s->high_water += init;\n// }\n// }\n//\n// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n// \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n * to pending_buf_size, and each stored block has a 5 byte header:\n */\n var max_block_size = 0xffff;\n\n if (max_block_size > s.pending_buf_size - 5) {\n max_block_size = s.pending_buf_size - 5;\n }\n\n /* Copy as much as possible from input to output: */\n for (;;) {\n /* Fill the window as much as possible: */\n if (s.lookahead <= 1) {\n\n //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n // s->block_start >= (long)s->w_size, \"slide too late\");\n// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n// s.block_start >= s.w_size)) {\n// throw new Error(\"slide too late\");\n// }\n\n fill_window(s);\n if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n\n if (s.lookahead === 0) {\n break;\n }\n /* flush the current block */\n }\n //Assert(s->block_start >= 0L, \"block gone\");\n// if (s.block_start < 0) throw new Error(\"block gone\");\n\n s.strstart += s.lookahead;\n s.lookahead = 0;\n\n /* Emit a stored block if pending_buf will be full: */\n var max_start = s.block_start + max_block_size;\n\n if (s.strstart === 0 || s.strstart >= max_start) {\n /* strstart == 0 is possible when wraparound on 16-bit machine */\n s.lookahead = s.strstart - max_start;\n s.strstart = max_start;\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n\n\n }\n /* Flush if we may have to slide, otherwise block_start may become\n * negative and the data will be gone:\n */\n if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n\n s.insert = 0;\n\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n\n if (s.strstart > s.block_start) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n var hash_head; /* head of the hash chain */\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) {\n break; /* flush the current block */\n }\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n * At this point we have always match_length < MIN_MATCH\n */\n if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n }\n if (s.match_length >= MIN_MATCH) {\n // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n /*** _tr_tally_dist(s, s.strstart - s.match_start,\n s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n\n /* Insert new strings in the hash table only if the match length\n * is not too large. This saves time but degrades compression.\n */\n if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n s.match_length--; /* string at strstart already in table */\n do {\n s.strstart++;\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n * always MIN_MATCH bytes ahead.\n */\n } while (--s.match_length !== 0);\n s.strstart++;\n } else\n {\n s.strstart += s.match_length;\n s.match_length = 0;\n s.ins_h = s.window[s.strstart];\n /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n// Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n * matter since it will be recomputed at next deflate call.\n */\n }\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n var hash_head; /* head of hash chain */\n var bflush; /* set if current block must be flushed */\n\n var max_insert;\n\n /* Process the input block. */\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the next match, plus MIN_MATCH bytes to insert the\n * string following the next match.\n */\n if (s.lookahead < MIN_LOOKAHEAD) {\n fill_window(s);\n if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* Insert the string window[strstart .. strstart+2] in the\n * dictionary, and set hash_head to the head of the hash chain:\n */\n hash_head = 0/*NIL*/;\n if (s.lookahead >= MIN_MATCH) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n\n /* Find the longest match, discarding those <= prev_length.\n */\n s.prev_length = s.match_length;\n s.prev_match = s.match_start;\n s.match_length = MIN_MATCH - 1;\n\n if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n /* To simplify the code, we prevent matches with the string\n * of window index 0 (in particular we have to avoid a match\n * of the string with itself at the start of the input file).\n */\n s.match_length = longest_match(s, hash_head);\n /* longest_match() sets match_start */\n\n if (s.match_length <= 5 &&\n (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n /* If prev_match is also MIN_MATCH, match_start is garbage\n * but we will ignore the current match anyway.\n */\n s.match_length = MIN_MATCH - 1;\n }\n }\n /* If there was a match at the previous step and the current\n * match is not better, output the previous match:\n */\n if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n max_insert = s.strstart + s.lookahead - MIN_MATCH;\n /* Do not insert strings in hash table beyond this. */\n\n //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n s.prev_length - MIN_MATCH, bflush);***/\n bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n /* Insert in hash table all strings up to the end of the match.\n * strstart-1 and strstart are already inserted. If there is not\n * enough lookahead, the last two strings are not inserted in\n * the hash table.\n */\n s.lookahead -= s.prev_length - 1;\n s.prev_length -= 2;\n do {\n if (++s.strstart <= max_insert) {\n /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n s.head[s.ins_h] = s.strstart;\n /***/\n }\n } while (--s.prev_length !== 0);\n s.match_available = 0;\n s.match_length = MIN_MATCH - 1;\n s.strstart++;\n\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n } else if (s.match_available) {\n /* If there was no match at the previous position, output a\n * single literal. If there was a match but the current match\n * is longer, truncate the previous match to a single literal.\n */\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n if (bflush) {\n /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n flush_block_only(s, false);\n /***/\n }\n s.strstart++;\n s.lookahead--;\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n } else {\n /* There is no previous match to compare with, wait for\n * the next step to decide.\n */\n s.match_available = 1;\n s.strstart++;\n s.lookahead--;\n }\n }\n //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n if (s.match_available) {\n //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n s.match_available = 0;\n }\n s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n\n return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one. Do not maintain a hash table. (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n var bflush; /* set if current block must be flushed */\n var prev; /* byte at distance one to match */\n var scan, strend; /* scan goes up to strend for length of run */\n\n var _win = s.window;\n\n for (;;) {\n /* Make sure that we always have enough lookahead, except\n * at the end of the input file. We need MAX_MATCH bytes\n * for the longest run, plus one for the unrolled loop.\n */\n if (s.lookahead <= MAX_MATCH) {\n fill_window(s);\n if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n if (s.lookahead === 0) { break; } /* flush the current block */\n }\n\n /* See how many times the previous byte repeats */\n s.match_length = 0;\n if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n scan = s.strstart - 1;\n prev = _win[scan];\n if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n strend = s.strstart + MAX_MATCH;\n do {\n /*jshint noempty:false*/\n } while (prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n prev === _win[++scan] && prev === _win[++scan] &&\n scan < strend);\n s.match_length = MAX_MATCH - (strend - scan);\n if (s.match_length > s.lookahead) {\n s.match_length = s.lookahead;\n }\n }\n //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n }\n\n /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n if (s.match_length >= MIN_MATCH) {\n //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n s.lookahead -= s.match_length;\n s.strstart += s.match_length;\n s.match_length = 0;\n } else {\n /* No match, output a literal byte */\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n s.lookahead--;\n s.strstart++;\n }\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n if (s.lookahead === 0) {\n if (flush === Z_NO_FLUSH) {\n return BS_NEED_MORE;\n }\n break; /* flush the current block */\n }\n }\n\n /* Output a literal byte */\n s.match_length = 0;\n //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n s.lookahead--;\n s.strstart++;\n if (bflush) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n }\n s.insert = 0;\n if (flush === Z_FINISH) {\n /*** FLUSH_BLOCK(s, 1); ***/\n flush_block_only(s, true);\n if (s.strm.avail_out === 0) {\n return BS_FINISH_STARTED;\n }\n /***/\n return BS_FINISH_DONE;\n }\n if (s.last_lit) {\n /*** FLUSH_BLOCK(s, 0); ***/\n flush_block_only(s, false);\n if (s.strm.avail_out === 0) {\n return BS_NEED_MORE;\n }\n /***/\n }\n return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}\n\nvar configuration_table;\n\nconfiguration_table = [\n /* good lazy nice chain */\n new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */\n new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */\n new Config(4, 5, 16, 8, deflate_fast), /* 2 */\n new Config(4, 6, 32, 32, deflate_fast), /* 3 */\n\n new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */\n new Config(8, 16, 32, 32, deflate_slow), /* 5 */\n new Config(8, 16, 128, 128, deflate_slow), /* 6 */\n new Config(8, 32, 128, 256, deflate_slow), /* 7 */\n new Config(32, 128, 258, 1024, deflate_slow), /* 8 */\n new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n s.window_size = 2 * s.w_size;\n\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n\n /* Set the default configuration parameters:\n */\n s.max_lazy_match = configuration_table[s.level].max_lazy;\n s.good_match = configuration_table[s.level].good_length;\n s.nice_match = configuration_table[s.level].nice_length;\n s.max_chain_length = configuration_table[s.level].max_chain;\n\n s.strstart = 0;\n s.block_start = 0;\n s.lookahead = 0;\n s.insert = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.status = 0; /* as the name implies */\n this.pending_buf = null; /* output still pending */\n this.pending_buf_size = 0; /* size of pending_buf */\n this.pending_out = 0; /* next pending byte to output to the stream */\n this.pending = 0; /* nb of bytes in the pending buffer */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.gzhead = null; /* gzip header information to write */\n this.gzindex = 0; /* where in extra, name, or comment */\n this.method = Z_DEFLATED; /* can only be DEFLATED */\n this.last_flush = -1; /* value of flush param for previous deflate call */\n\n this.w_size = 0; /* LZ77 window size (32K by default) */\n this.w_bits = 0; /* log2(w_size) (8..16) */\n this.w_mask = 0; /* w_size - 1 */\n\n this.window = null;\n /* Sliding window. Input bytes are read into the second half of the window,\n * and move to the first half later to keep a dictionary of at least wSize\n * bytes. With this organization, matches are limited to a distance of\n * wSize-MAX_MATCH bytes, but this ensures that IO is always\n * performed with a length multiple of the block size.\n */\n\n this.window_size = 0;\n /* Actual size of window: 2*wSize, except when the user input buffer\n * is directly used as sliding window.\n */\n\n this.prev = null;\n /* Link to older string with same hash index. To limit the size of this\n * array to 64K, this link is maintained only for the last 32K strings.\n * An index in this array is thus a window index modulo 32K.\n */\n\n this.head = null; /* Heads of the hash chains or NIL. */\n\n this.ins_h = 0; /* hash index of string to be inserted */\n this.hash_size = 0; /* number of elements in hash table */\n this.hash_bits = 0; /* log2(hash_size) */\n this.hash_mask = 0; /* hash_size-1 */\n\n this.hash_shift = 0;\n /* Number of bits by which ins_h must be shifted at each input\n * step. It must be such that after MIN_MATCH steps, the oldest\n * byte no longer takes part in the hash key, that is:\n * hash_shift * MIN_MATCH >= hash_bits\n */\n\n this.block_start = 0;\n /* Window position at the beginning of the current output block. Gets\n * negative when the window is moved backwards.\n */\n\n this.match_length = 0; /* length of best match */\n this.prev_match = 0; /* previous match */\n this.match_available = 0; /* set if previous match exists */\n this.strstart = 0; /* start of string to insert */\n this.match_start = 0; /* start of matching string */\n this.lookahead = 0; /* number of valid bytes ahead in window */\n\n this.prev_length = 0;\n /* Length of the best match at previous step. Matches not greater than this\n * are discarded. This is used in the lazy match evaluation.\n */\n\n this.max_chain_length = 0;\n /* To speed up deflation, hash chains are never searched beyond this\n * length. A higher limit improves compression ratio but degrades the\n * speed.\n */\n\n this.max_lazy_match = 0;\n /* Attempt to find a better match only when the current match is strictly\n * smaller than this value. This mechanism is used only for compression\n * levels >= 4.\n */\n // That's alias to max_lazy_match, don't use directly\n //this.max_insert_length = 0;\n /* Insert new strings in the hash table only if the match length is not\n * greater than this length. This saves time but degrades compression.\n * max_insert_length is used only for compression levels <= 3.\n */\n\n this.level = 0; /* compression level (1..9) */\n this.strategy = 0; /* favor or force Huffman coding*/\n\n this.good_match = 0;\n /* Use a faster search when the previous match is longer than this */\n\n this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n /* used by trees.c: */\n\n /* Didn't use ct_data typedef below to suppress compiler warning */\n\n // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */\n // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */\n\n // Use flat array of DOUBLE size, with interleaved fata,\n // because JS does not support effective\n this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);\n this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);\n this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);\n zero(this.dyn_ltree);\n zero(this.dyn_dtree);\n zero(this.bl_tree);\n\n this.l_desc = null; /* desc. for literal tree */\n this.d_desc = null; /* desc. for distance tree */\n this.bl_desc = null; /* desc. for bit length tree */\n\n //ush bl_count[MAX_BITS+1];\n this.bl_count = new utils.Buf16(MAX_BITS + 1);\n /* number of codes at each bit length for an optimal tree */\n\n //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */\n this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */\n zero(this.heap);\n\n this.heap_len = 0; /* number of elements in the heap */\n this.heap_max = 0; /* element of largest frequency */\n /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n * The same heap array is used to build all trees.\n */\n\n this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n zero(this.depth);\n /* Depth of each subtree used as tie breaker for trees of equal frequency\n */\n\n this.l_buf = 0; /* buffer index for literals or lengths */\n\n this.lit_bufsize = 0;\n /* Size of match buffer for literals/lengths. There are 4 reasons for\n * limiting lit_bufsize to 64K:\n * - frequencies can be kept in 16 bit counters\n * - if compression is not successful for the first block, all input\n * data is still in the window so we can still emit a stored block even\n * when input comes from standard input. (This can also be done for\n * all blocks if lit_bufsize is not greater than 32K.)\n * - if compression is not successful for a file smaller than 64K, we can\n * even emit a stored file instead of a stored block (saving 5 bytes).\n * This is applicable only for zip (not gzip or zlib).\n * - creating new Huffman trees less frequently may not provide fast\n * adaptation to changes in the input data statistics. (Take for\n * example a binary file with poorly compressible code followed by\n * a highly compressible string table.) Smaller buffer sizes give\n * fast adaptation but have of course the overhead of transmitting\n * trees more frequently.\n * - I can't count above 4\n */\n\n this.last_lit = 0; /* running index in l_buf */\n\n this.d_buf = 0;\n /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n * the same number of elements. To use different lengths, an extra flag\n * array would be necessary.\n */\n\n this.opt_len = 0; /* bit length of current block with optimal trees */\n this.static_len = 0; /* bit length of current block with static trees */\n this.matches = 0; /* number of string matches in current block */\n this.insert = 0; /* bytes at end of window left to insert */\n\n\n this.bi_buf = 0;\n /* Output buffer. bits are inserted starting at the bottom (least\n * significant bits).\n */\n this.bi_valid = 0;\n /* Number of valid bits in bi_buf. All bits above the last valid bit\n * are always zero.\n */\n\n // Used for window memory init. We safely ignore it for JS. That makes\n // sense only for pointers and memory check tools.\n //this.high_water = 0;\n /* High water mark offset in window for initialized bytes -- bytes above\n * this are set to zero in order to avoid memory check warnings when\n * longest match routines access bytes past the input. This is then\n * updated to the new high water mark.\n */\n}\n\n\nfunction deflateResetKeep(strm) {\n var s;\n\n if (!strm || !strm.state) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.total_in = strm.total_out = 0;\n strm.data_type = Z_UNKNOWN;\n\n s = strm.state;\n s.pending = 0;\n s.pending_out = 0;\n\n if (s.wrap < 0) {\n s.wrap = -s.wrap;\n /* was made negative by deflate(..., Z_FINISH); */\n }\n s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n strm.adler = (s.wrap === 2) ?\n 0 // crc32(0, Z_NULL, 0)\n :\n 1; // adler32(0, Z_NULL, 0)\n s.last_flush = Z_NO_FLUSH;\n trees._tr_init(s);\n return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n var ret = deflateResetKeep(strm);\n if (ret === Z_OK) {\n lm_init(strm.state);\n }\n return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n strm.state.gzhead = head;\n return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n if (!strm) { // === Z_NULL\n return Z_STREAM_ERROR;\n }\n var wrap = 1;\n\n if (level === Z_DEFAULT_COMPRESSION) {\n level = 6;\n }\n\n if (windowBits < 0) { /* suppress zlib wrapper */\n wrap = 0;\n windowBits = -windowBits;\n }\n\n else if (windowBits > 15) {\n wrap = 2; /* write gzip wrapper instead */\n windowBits -= 16;\n }\n\n\n if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n strategy < 0 || strategy > Z_FIXED) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n\n if (windowBits === 8) {\n windowBits = 9;\n }\n /* until 256-byte window bug fixed */\n\n var s = new DeflateState();\n\n strm.state = s;\n s.strm = strm;\n\n s.wrap = wrap;\n s.gzhead = null;\n s.w_bits = windowBits;\n s.w_size = 1 << s.w_bits;\n s.w_mask = s.w_size - 1;\n\n s.hash_bits = memLevel + 7;\n s.hash_size = 1 << s.hash_bits;\n s.hash_mask = s.hash_size - 1;\n s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n s.window = new utils.Buf8(s.w_size * 2);\n s.head = new utils.Buf16(s.hash_size);\n s.prev = new utils.Buf16(s.w_size);\n\n // Don't need mem init magic for JS.\n //s.high_water = 0; /* nothing written to s->window yet */\n\n s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n s.pending_buf_size = s.lit_bufsize * 4;\n\n //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n //s->pending_buf = (uchf *) overlay;\n s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n s.d_buf = 1 * s.lit_bufsize;\n\n //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n s.l_buf = (1 + 2) * s.lit_bufsize;\n\n s.level = level;\n s.strategy = strategy;\n s.method = method;\n\n return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n var old_flush, s;\n var beg, val; // for gzip header write only\n\n if (!strm || !strm.state ||\n flush > Z_BLOCK || flush < 0) {\n return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n }\n\n s = strm.state;\n\n if (!strm.output ||\n (!strm.input && strm.avail_in !== 0) ||\n (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n }\n\n s.strm = strm; /* just in case */\n old_flush = s.last_flush;\n s.last_flush = flush;\n\n /* Write the header */\n if (s.status === INIT_STATE) {\n\n if (s.wrap === 2) { // GZIP header\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n put_byte(s, 31);\n put_byte(s, 139);\n put_byte(s, 8);\n if (!s.gzhead) { // s->gzhead == Z_NULL\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, 0);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, OS_CODE);\n s.status = BUSY_STATE;\n }\n else {\n put_byte(s, (s.gzhead.text ? 1 : 0) +\n (s.gzhead.hcrc ? 2 : 0) +\n (!s.gzhead.extra ? 0 : 4) +\n (!s.gzhead.name ? 0 : 8) +\n (!s.gzhead.comment ? 0 : 16)\n );\n put_byte(s, s.gzhead.time & 0xff);\n put_byte(s, (s.gzhead.time >> 8) & 0xff);\n put_byte(s, (s.gzhead.time >> 16) & 0xff);\n put_byte(s, (s.gzhead.time >> 24) & 0xff);\n put_byte(s, s.level === 9 ? 2 :\n (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n 4 : 0));\n put_byte(s, s.gzhead.os & 0xff);\n if (s.gzhead.extra && s.gzhead.extra.length) {\n put_byte(s, s.gzhead.extra.length & 0xff);\n put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n }\n if (s.gzhead.hcrc) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n }\n s.gzindex = 0;\n s.status = EXTRA_STATE;\n }\n }\n else // DEFLATE header\n {\n var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n var level_flags = -1;\n\n if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n level_flags = 0;\n } else if (s.level < 6) {\n level_flags = 1;\n } else if (s.level === 6) {\n level_flags = 2;\n } else {\n level_flags = 3;\n }\n header |= (level_flags << 6);\n if (s.strstart !== 0) { header |= PRESET_DICT; }\n header += 31 - (header % 31);\n\n s.status = BUSY_STATE;\n putShortMSB(s, header);\n\n /* Save the adler32 of the preset dictionary: */\n if (s.strstart !== 0) {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n strm.adler = 1; // adler32(0L, Z_NULL, 0);\n }\n }\n\n//#ifdef GZIP\n if (s.status === EXTRA_STATE) {\n if (s.gzhead.extra/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n\n while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n break;\n }\n }\n put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n s.gzindex++;\n }\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (s.gzindex === s.gzhead.extra.length) {\n s.gzindex = 0;\n s.status = NAME_STATE;\n }\n }\n else {\n s.status = NAME_STATE;\n }\n }\n if (s.status === NAME_STATE) {\n if (s.gzhead.name/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.name.length) {\n val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.gzindex = 0;\n s.status = COMMENT_STATE;\n }\n }\n else {\n s.status = COMMENT_STATE;\n }\n }\n if (s.status === COMMENT_STATE) {\n if (s.gzhead.comment/* != Z_NULL*/) {\n beg = s.pending; /* start of bytes to update crc */\n //int val;\n\n do {\n if (s.pending === s.pending_buf_size) {\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n flush_pending(strm);\n beg = s.pending;\n if (s.pending === s.pending_buf_size) {\n val = 1;\n break;\n }\n }\n // JS specific: little magic to add zero terminator to end of string\n if (s.gzindex < s.gzhead.comment.length) {\n val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n } else {\n val = 0;\n }\n put_byte(s, val);\n } while (val !== 0);\n\n if (s.gzhead.hcrc && s.pending > beg) {\n strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n }\n if (val === 0) {\n s.status = HCRC_STATE;\n }\n }\n else {\n s.status = HCRC_STATE;\n }\n }\n if (s.status === HCRC_STATE) {\n if (s.gzhead.hcrc) {\n if (s.pending + 2 > s.pending_buf_size) {\n flush_pending(strm);\n }\n if (s.pending + 2 <= s.pending_buf_size) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n strm.adler = 0; //crc32(0L, Z_NULL, 0);\n s.status = BUSY_STATE;\n }\n }\n else {\n s.status = BUSY_STATE;\n }\n }\n//#endif\n\n /* Flush as much pending output as possible */\n if (s.pending !== 0) {\n flush_pending(strm);\n if (strm.avail_out === 0) {\n /* Since avail_out is 0, deflate will be called again with\n * more output space, but possibly with both pending and\n * avail_in equal to zero. There won't be anything to do,\n * but this is not an error situation so make sure we\n * return OK instead of BUF_ERROR at next call of deflate:\n */\n s.last_flush = -1;\n return Z_OK;\n }\n\n /* Make sure there is something to do and avoid duplicate consecutive\n * flushes. For repeated and useless calls with Z_FINISH, we keep\n * returning Z_STREAM_END instead of Z_BUF_ERROR.\n */\n } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n flush !== Z_FINISH) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* User must not provide more input after the first FINISH: */\n if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n return err(strm, Z_BUF_ERROR);\n }\n\n /* Start a new block or continue the current one.\n */\n if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n configuration_table[s.level].func(s, flush));\n\n if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n s.status = FINISH_STATE;\n }\n if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n if (strm.avail_out === 0) {\n s.last_flush = -1;\n /* avoid BUF_ERROR next call, see above */\n }\n return Z_OK;\n /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n * of deflate should use the same flush parameter to make sure\n * that the flush is complete. So we don't have to output an\n * empty block here, this will be done at next call. This also\n * ensures that for a very small output buffer, we emit at most\n * one empty block.\n */\n }\n if (bstate === BS_BLOCK_DONE) {\n if (flush === Z_PARTIAL_FLUSH) {\n trees._tr_align(s);\n }\n else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n trees._tr_stored_block(s, 0, 0, false);\n /* For a full flush, this empty block will be recognized\n * as a special marker by inflate_sync().\n */\n if (flush === Z_FULL_FLUSH) {\n /*** CLEAR_HASH(s); ***/ /* forget history */\n zero(s.head); // Fill with NIL (= 0);\n\n if (s.lookahead === 0) {\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n }\n }\n flush_pending(strm);\n if (strm.avail_out === 0) {\n s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n return Z_OK;\n }\n }\n }\n //Assert(strm->avail_out > 0, \"bug2\");\n //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n if (flush !== Z_FINISH) { return Z_OK; }\n if (s.wrap <= 0) { return Z_STREAM_END; }\n\n /* Write the trailer */\n if (s.wrap === 2) {\n put_byte(s, strm.adler & 0xff);\n put_byte(s, (strm.adler >> 8) & 0xff);\n put_byte(s, (strm.adler >> 16) & 0xff);\n put_byte(s, (strm.adler >> 24) & 0xff);\n put_byte(s, strm.total_in & 0xff);\n put_byte(s, (strm.total_in >> 8) & 0xff);\n put_byte(s, (strm.total_in >> 16) & 0xff);\n put_byte(s, (strm.total_in >> 24) & 0xff);\n }\n else\n {\n putShortMSB(s, strm.adler >>> 16);\n putShortMSB(s, strm.adler & 0xffff);\n }\n\n flush_pending(strm);\n /* If avail_out is zero, the application will call deflate again\n * to flush the rest.\n */\n if (s.wrap > 0) { s.wrap = -s.wrap; }\n /* write the trailer only once! */\n return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n var status;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n status = strm.state.status;\n if (status !== INIT_STATE &&\n status !== EXTRA_STATE &&\n status !== NAME_STATE &&\n status !== COMMENT_STATE &&\n status !== HCRC_STATE &&\n status !== BUSY_STATE &&\n status !== FINISH_STATE\n ) {\n return err(strm, Z_STREAM_ERROR);\n }\n\n strm.state = null;\n\n return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var s;\n var str, n;\n var wrap;\n var avail;\n var next;\n var input;\n var tmpDict;\n\n if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n return Z_STREAM_ERROR;\n }\n\n s = strm.state;\n wrap = s.wrap;\n\n if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n return Z_STREAM_ERROR;\n }\n\n /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n if (wrap === 1) {\n /* adler32(strm->adler, dictionary, dictLength); */\n strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n }\n\n s.wrap = 0; /* avoid computing Adler-32 in read_buf */\n\n /* if dictionary would fill window, just replace the history */\n if (dictLength >= s.w_size) {\n if (wrap === 0) { /* already empty otherwise */\n /*** CLEAR_HASH(s); ***/\n zero(s.head); // Fill with NIL (= 0);\n s.strstart = 0;\n s.block_start = 0;\n s.insert = 0;\n }\n /* use the tail */\n // dictionary = dictionary.slice(dictLength - s.w_size);\n tmpDict = new utils.Buf8(s.w_size);\n utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n dictionary = tmpDict;\n dictLength = s.w_size;\n }\n /* insert dictionary into window and hash */\n avail = strm.avail_in;\n next = strm.next_in;\n input = strm.input;\n strm.avail_in = dictLength;\n strm.next_in = 0;\n strm.input = dictionary;\n fill_window(s);\n while (s.lookahead >= MIN_MATCH) {\n str = s.strstart;\n n = s.lookahead - (MIN_MATCH - 1);\n do {\n /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n s.head[s.ins_h] = str;\n str++;\n } while (--n);\n s.strstart = str;\n s.lookahead = MIN_MATCH - 1;\n fill_window(s);\n }\n s.strstart += s.lookahead;\n s.block_start = s.strstart;\n s.insert = s.lookahead;\n s.lookahead = 0;\n s.match_length = s.prev_length = MIN_MATCH - 1;\n s.match_available = 0;\n strm.next_in = next;\n strm.input = input;\n strm.avail_in = avail;\n s.wrap = wrap;\n return Z_OK;\n}\n\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new utils.Buf8(256);\nfor (var q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new utils.Buf8(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n }\n }\n\n var result = '';\n for (var i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n var buf = new utils.Buf8(str.length);\n for (var i = 0, len = buf.length; i < len; i++) {\n buf[i] = str.charCodeAt(i);\n }\n return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n var i, out, c, c_len;\n var len = max || buf.length;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n var utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","'use strict';\n\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\n\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH = 0;\nvar Z_FINISH = 4;\n\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_SYNC_FLUSH = 2;\n\nvar Z_DEFAULT_COMPRESSION = -1;\n\nvar Z_DEFAULT_STRATEGY = 0;\n\nvar Z_DEFLATED = 8;\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n if (!(this instanceof Deflate)) return new Deflate(options);\n\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBits += 16;\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_deflate.deflateInit2(\n this.strm,\n opt.level,\n opt.method,\n opt.windowBits,\n opt.memLevel,\n opt.strategy\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n if (opt.header) {\n zlib_deflate.deflateSetHeader(this.strm, opt.header);\n }\n\n if (opt.dictionary) {\n var dict;\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n // If we need to compress text, change encoding to utf8.\n dict = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n dict = new Uint8Array(opt.dictionary);\n } else {\n dict = opt.dictionary;\n }\n\n status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this._dict_set = true;\n }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n * converted to utf8 byte sequence.\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var status, _mode;\n\n if (this.ended) { return false; }\n\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // If we need to compress text, change encoding to utf8.\n strm.input = strings.string2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n status = zlib_deflate.deflate(strm, _mode); /* no bad return value */\n\n if (status !== Z_STREAM_END && status !== Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n if (this.options.to === 'string') {\n this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n // Finalize on the last chunk.\n if (_mode === Z_FINISH) {\n status = zlib_deflate.deflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === Z_SYNC_FLUSH) {\n this.onEnd(Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n * (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n var deflator = new Deflate(options);\n\n deflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n options = options || {};\n options.gzip = true;\n return deflate(input, options);\n}\n\n\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n var state;\n var _in; /* local strm.input */\n var last; /* have enough input while in < last */\n var _out; /* local strm.output */\n var beg; /* inflate()'s initial strm.output */\n var end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n var dmax; /* maximum distance from zlib header */\n//#endif\n var wsize; /* window size or zero if not using window */\n var whave; /* valid bytes in the window */\n var wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n var s_window; /* allocated sliding window, if wsize != 0 */\n var hold; /* local strm.hold */\n var bits; /* local strm.bits */\n var lcode; /* local strm.lencode */\n var dcode; /* local strm.distcode */\n var lmask; /* mask for first level of length codes */\n var dmask; /* mask for first level of distance codes */\n var here; /* retrieved table entry */\n var op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n var len; /* match length, unused bytes */\n var dist; /* match distance */\n var from; /* where to copy match from */\n var from_source;\n\n\n var input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n var bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n var len = 0; /* a code's length in bits */\n var sym = 0; /* index of code symbols */\n var min = 0, max = 0; /* minimum and maximum code lengths */\n var root = 0; /* number of index bits for root table */\n var curr = 0; /* number of index bits for current table */\n var drop = 0; /* code bits to drop for sub-table */\n var left = 0; /* number of prefix codes available */\n var used = 0; /* code entries in table used */\n var huff = 0; /* Huffman code */\n var incr; /* for incrementing code, index */\n var fill; /* index for replicating entries */\n var low; /* low bits for current root entry */\n var mask; /* mask for low root bits */\n var next; /* next available space in table */\n var base = null; /* base value table to use */\n var base_index = 0;\n// var shoextra; /* extra bits table to use */\n var end; /* use base and extra for symbol > end */\n var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n var extra = null;\n var extra_index = 0;\n\n var here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n end = 19;\n\n } else if (type === LENS) {\n base = lbase;\n base_index -= 257;\n extra = lext;\n extra_index -= 257;\n end = 256;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n end = -1;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] < end) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] > end) {\n here_op = extra[extra_index + work[sym]];\n here_val = base[base_index + work[sym]];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\nvar adler32 = require('./adler32');\nvar crc32 = require('./crc32');\nvar inflate_fast = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH = 2;\n//var Z_FULL_FLUSH = 3;\nvar Z_FINISH = 4;\nvar Z_BLOCK = 5;\nvar Z_TREES = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK = 0;\nvar Z_STREAM_END = 1;\nvar Z_NEED_DICT = 2;\n//var Z_ERRNO = -1;\nvar Z_STREAM_ERROR = -2;\nvar Z_DATA_ERROR = -3;\nvar Z_MEM_ERROR = -4;\nvar Z_BUF_ERROR = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar HEAD = 1; /* i: waiting for magic header */\nvar FLAGS = 2; /* i: waiting for method and flags (gzip) */\nvar TIME = 3; /* i: waiting for modification time (gzip) */\nvar OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nvar EXLEN = 5; /* i: waiting for extra length (gzip) */\nvar EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nvar NAME = 7; /* i: waiting for end of file name (gzip) */\nvar COMMENT = 8; /* i: waiting for end of comment (gzip) */\nvar HCRC = 9; /* i: waiting for header crc (gzip) */\nvar DICTID = 10; /* i: waiting for dictionary check value */\nvar DICT = 11; /* waiting for inflateSetDictionary() call */\nvar TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nvar TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nvar STORED = 14; /* i: waiting for stored size (length and complement) */\nvar COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nvar COPY = 16; /* i/o: waiting for input or output to copy stored block */\nvar TABLE = 17; /* i: waiting for dynamic block table lengths */\nvar LENLENS = 18; /* i: waiting for code length code lengths */\nvar CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nvar LEN_ = 20; /* i: same as LEN below, but only first time in */\nvar LEN = 21; /* i: waiting for length/lit/eob code */\nvar LENEXT = 22; /* i: waiting for length extra bits */\nvar DIST = 23; /* i: waiting for distance code */\nvar DISTEXT = 24; /* i: waiting for distance extra bits */\nvar MATCH = 25; /* o: waiting for output space to copy string */\nvar LIT = 26; /* o: waiting for output space to write literal */\nvar CHECK = 27; /* i: waiting for 32-bit check value */\nvar LENGTH = 28; /* i: waiting for 32-bit length (gzip) */\nvar DONE = 29; /* finished check, done -- remain here until reset */\nvar BAD = 30; /* got a data error -- remain here until reset */\nvar MEM = 31; /* got an inflate() memory error -- remain here until reset */\nvar SYNC = 32; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib) */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n this.work = new utils.Buf16(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n}\n\nfunction inflateReset(strm) {\n var state;\n\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n var wrap;\n var state;\n\n /* get the state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 1;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n var ret;\n var state;\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.window = null/*Z_NULL*/;\n ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n}\n\nfunction inflateInit(strm) {\n return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n var sym;\n\n lenfix = new utils.Buf32(512);\n distfix = new utils.Buf32(32);\n\n /* literal/length table */\n sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n var dist;\n var state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new utils.Buf8(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n utils.arraySet(state.window, src, end - copy, copy, 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n}\n\nfunction inflate(strm, flush) {\n var state;\n var input, output; // input/output buffers\n var next; /* next input INDEX */\n var put; /* next output INDEX */\n var have, left; /* available input and output */\n var hold; /* bit buffer */\n var bits; /* bits in bit buffer */\n var _in, _out; /* save starting available input and output */\n var copy; /* number of stored or match bytes to copy */\n var from; /* where to copy match bytes from */\n var from_source;\n var here = 0; /* current decoding table entry */\n var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //var last; /* parent table entry */\n var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n var len; /* length to copy for repeats, bits to drop */\n var ret; /* return code */\n var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */\n var opts;\n\n var n; // temporary var for NEED_BITS\n\n var order = /* permutation of code lengths */\n [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n if (!strm || !strm.state || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n state.flags = 0; /* expect zlib header */\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n else if (len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n state.dmax = 1 << len;\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if (state.flags & 0x0200) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Array(state.head.extra_len);\n }\n utils.arraySet(\n state.head.extra,\n input,\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n copy,\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if (state.flags & 0x0200) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n utils.arraySet(output, input, next, copy, put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if (_out) {\n strm.adler = state.check =\n /*UPDATE(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if (state.wrap && _out) {\n strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n}\n\nfunction inflateEnd(strm) {\n\n if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n return Z_STREAM_ERROR;\n }\n\n var state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n var state;\n\n /* check state */\n if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n var dictLength = dictionary.length;\n\n var state;\n var dictid;\n var ret;\n\n /* check state */\n if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n //Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils = require('./utils/common');\nvar strings = require('./utils/strings');\nvar c = require('./zlib/constants');\nvar msg = require('./zlib/messages');\nvar ZStream = require('./zlib/zstream');\nvar GZheader = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n if (!(this instanceof Inflate)) return new Inflate(options);\n\n this.options = utils.assign({\n chunkSize: 16384,\n windowBits: 0,\n to: ''\n }, options || {});\n\n var opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n var status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== c.Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, mode) {\n var strm = this.strm;\n var chunkSize = this.options.chunkSize;\n var dictionary = this.options.dictionary;\n var status, _mode;\n var next_out_utf8, tail, utf8str;\n\n // Flag to properly process Z_BUF_ERROR on testing inflate call\n // when we check that all output data was flushed.\n var allowBufError = false;\n\n if (this.ended) { return false; }\n _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n // Convert data if needed\n if (typeof data === 'string') {\n // Only binary strings can be decompressed on practice\n strm.input = strings.binstring2buf(data);\n } else if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n do {\n if (strm.avail_out === 0) {\n strm.output = new utils.Buf8(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */\n\n if (status === c.Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);\n }\n\n if (status === c.Z_BUF_ERROR && allowBufError === true) {\n status = c.Z_OK;\n allowBufError = false;\n }\n\n if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n if (this.options.to === 'string') {\n\n next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n tail = strm.next_out - next_out_utf8;\n utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n this.onData(utf8str);\n\n } else {\n this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n }\n }\n }\n\n // When no more input data, we should check that internal inflate buffers\n // are flushed. The only way to do it when avail_out = 0 - run one more\n // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n // Here we set flag to process this error properly.\n //\n // NOTE. Deflate does not return error in this case and does not needs such\n // logic.\n if (strm.avail_in === 0 && strm.avail_out === 0) {\n allowBufError = true;\n }\n\n } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n if (status === c.Z_STREAM_END) {\n _mode = c.Z_FINISH;\n }\n\n // Finalize on the last chunk.\n if (_mode === c.Z_FINISH) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return status === c.Z_OK;\n }\n\n // callback interim results if Z_SYNC_FLUSH.\n if (_mode === c.Z_SYNC_FLUSH) {\n this.onEnd(c.Z_OK);\n strm.avail_out = 0;\n return true;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n * on js engine support. When string output requested, each chunk\n * will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === c.Z_OK) {\n if (this.options.to === 'string') {\n // Glue & convert here, until we teach pako to send\n // utf8 aligned strings to onData\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n * , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n * , output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err)\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n var inflator = new Inflate(options);\n\n inflator.push(input, true);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip = inflate;\n","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign = require('./lib/utils/common').assign;\n\nvar deflate = require('./lib/deflate');\nvar inflate = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\n\nvar pako = {};\n\nassign(pako, deflate, inflate, constants);\n\nmodule.exports = pako;\n","\"use strict\";\n\n(function(){\n\n var\n buf,\n bufIdx = 0,\n hexBytes = [],\n i\n ;\n\n // Pre-calculate toString(16) for speed\n for (i = 0; i < 256; i++) {\n hexBytes[i] = (i + 0x100).toString(16).substr(1);\n }\n\n // Buffer random numbers for speed\n // Reduce memory usage by decreasing this number (min 16)\n // or improve speed by increasing this number (try 16384)\n uuid.BUFFER_SIZE = 4096;\n\n // Binary uuids\n uuid.bin = uuidBin;\n\n // Clear buffer\n uuid.clearBuffer = function() {\n buf = null;\n bufIdx = 0;\n };\n\n // Test for uuid\n uuid.test = function(uuid) {\n if (typeof uuid === 'string') {\n return /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(uuid);\n }\n return false;\n };\n\n // Node & Browser support\n var crypt0;\n if (typeof crypto !== 'undefined') {\n crypt0 = crypto;\n } else if( (typeof window !== 'undefined') && (typeof window.msCrypto !== 'undefined')) {\n crypt0 = window.msCrypto; // IE11\n }\n\n if ((typeof module !== 'undefined') && (typeof require === 'function')) {\n crypt0 = crypt0 || require('crypto');\n module.exports = uuid;\n } else if (typeof window !== 'undefined') {\n window.uuid = uuid;\n }\n\n // Use best available PRNG\n // Also expose this so you can override it.\n uuid.randomBytes = (function(){\n if (crypt0) {\n if (crypt0.randomBytes) {\n return crypt0.randomBytes;\n }\n if (crypt0.getRandomValues) {\n if (typeof Uint8Array.prototype.slice !== 'function') {\n return function(n) {\n var bytes = new Uint8Array(n);\n crypt0.getRandomValues(bytes);\n return Array.from(bytes);\n };\n }\n return function(n) {\n var bytes = new Uint8Array(n);\n crypt0.getRandomValues(bytes);\n return bytes;\n };\n }\n }\n return function(n) {\n var i, r = [];\n for (i = 0; i < n; i++) {\n r.push(Math.floor(Math.random() * 256));\n }\n return r;\n };\n })();\n\n // Buffer some random bytes for speed\n function randomBytesBuffered(n) {\n if (!buf || ((bufIdx + n) > uuid.BUFFER_SIZE)) {\n bufIdx = 0;\n buf = uuid.randomBytes(uuid.BUFFER_SIZE);\n }\n return buf.slice(bufIdx, bufIdx += n);\n }\n\n // uuid.bin\n function uuidBin() {\n var b = randomBytesBuffered(16);\n b[6] = (b[6] & 0x0f) | 0x40;\n b[8] = (b[8] & 0x3f) | 0x80;\n return b;\n }\n\n // String UUIDv4 (Random)\n function uuid() {\n var b = uuidBin();\n return hexBytes[b[0]] + hexBytes[b[1]] +\n hexBytes[b[2]] + hexBytes[b[3]] + '-' +\n hexBytes[b[4]] + hexBytes[b[5]] + '-' +\n hexBytes[b[6]] + hexBytes[b[7]] + '-' +\n hexBytes[b[8]] + hexBytes[b[9]] + '-' +\n hexBytes[b[10]] + hexBytes[b[11]] +\n hexBytes[b[12]] + hexBytes[b[13]] +\n hexBytes[b[14]] + hexBytes[b[15]]\n ;\n }\n\n})();\n","import pako from \"pako\";\nimport { type Source, type SourceReader } from \"./types\";\nimport { splitChunk, concatChunks } from \"./utils\";\n\nconst decoder = new TextDecoder(\"utf-8\");\n\n// ===========================================================================\nexport class NoConcatInflator<\n T extends BaseAsyncIterReader,\n> extends pako.Inflate {\n reader: T;\n ended = false;\n chunks: Uint8Array[] = [];\n\n constructor(options: pako.InflateOptions, reader: T) {\n super(options);\n this.reader = reader;\n }\n\n override onEnd(status: pako.ReturnCodes) {\n this.err = status;\n if (!this.err) {\n // @ts-expect-error strm is not implemented in typescript types\n this.reader._rawOffset += this.strm.total_in;\n }\n }\n}\n\n// ===========================================================================\nexport abstract class BaseAsyncIterReader {\n static async readFully(\n iter: AsyncIterable | Iterable,\n ): Promise {\n const chunks = [];\n let size = 0;\n\n for await (const chunk of iter) {\n chunks.push(chunk);\n size += chunk.byteLength;\n }\n\n return concatChunks(chunks, size);\n }\n\n abstract [Symbol.asyncIterator](): AsyncIterator;\n\n getReadableStream() {\n const streamIter = this[Symbol.asyncIterator]();\n\n return new ReadableStream({\n async pull(controller) {\n return streamIter.next().then((result) => {\n // all done;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (result.done || !result.value) {\n controller.close();\n } else {\n controller.enqueue(result.value);\n }\n });\n },\n });\n }\n\n async readFully(): Promise {\n return await BaseAsyncIterReader.readFully(this);\n }\n\n abstract readlineRaw(maxLength?: number): Promise;\n\n async readline(maxLength = 0) {\n const lineBuff = await this.readlineRaw(maxLength);\n return lineBuff ? decoder.decode(lineBuff) : \"\";\n }\n\n async *iterLines(maxLength = 0) {\n let line = null;\n\n while ((line = await this.readline(maxLength))) {\n yield line;\n }\n }\n}\n\n// ===========================================================================\nexport type AsyncIterReaderOpts = {\n raw: boolean;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- type guard\nfunction isIterable(input: any): input is Iterable {\n return Boolean(input && Symbol.iterator in Object(input));\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- type guard\nfunction isAsyncIterable(input: any): input is AsyncIterable {\n return Boolean(input && Symbol.asyncIterator in Object(input));\n}\n\n// ===========================================================================\nexport class AsyncIterReader extends BaseAsyncIterReader {\n compressed!: string | null;\n opts!: AsyncIterReaderOpts;\n inflator!: NoConcatInflator | null;\n\n _sourceIter: AsyncIterator;\n\n lastValue: Uint8Array | null;\n errored: boolean;\n _savedChunk: Uint8Array | null;\n _rawOffset: number;\n _readOffset: number;\n numChunks: number;\n\n constructor(\n streamOrIter: Source,\n compressed: string | null = \"gzip\",\n dechunk = false,\n ) {\n super();\n this.compressed = compressed;\n this.opts = { raw: compressed === \"deflateRaw\" };\n\n this.inflator = compressed ? new NoConcatInflator(this.opts, this) : null;\n\n let source: AsyncIterable;\n if (isAsyncIterable(streamOrIter)) {\n source = streamOrIter;\n } else if (\n typeof streamOrIter === \"object\" &&\n \"read\" in streamOrIter &&\n typeof streamOrIter.read === \"function\"\n ) {\n source = AsyncIterReader.fromReadable(streamOrIter);\n } else if (streamOrIter instanceof ReadableStream) {\n source = AsyncIterReader.fromReadable(streamOrIter.getReader());\n } else if (isIterable(streamOrIter)) {\n source = AsyncIterReader.fromIter(streamOrIter);\n } else {\n throw new TypeError(\"Invalid Stream Source\");\n }\n\n if (dechunk) {\n this._sourceIter = this.dechunk(source);\n } else {\n this._sourceIter = source[Symbol.asyncIterator]();\n }\n\n this.lastValue = null;\n\n this.errored = false;\n\n this._savedChunk = null;\n\n this._rawOffset = 0;\n this._readOffset = 0;\n\n this.numChunks = 0;\n }\n\n async _loadNext() {\n const res = await this._sourceIter.next();\n return !res.done ? res.value : null;\n }\n\n async *dechunk(\n source: AsyncIterable,\n ): AsyncIterator {\n const reader =\n source instanceof AsyncIterReader\n ? source\n : new AsyncIterReader(source, null);\n\n let size = -1;\n let first = true;\n\n while (size != 0) {\n const lineBuff = await reader.readlineRaw(64);\n let chunk: Uint8Array = new Uint8Array();\n\n size = lineBuff ? parseInt(decoder.decode(lineBuff), 16) : 0;\n\n if (!size || size > 2 ** 32) {\n if (Number.isNaN(size) || size > 2 ** 32) {\n if (!first) {\n this.errored = true;\n }\n yield lineBuff;\n break;\n }\n } else {\n chunk = await reader.readSize(size);\n if (chunk.length != size) {\n if (!first) {\n this.errored = true;\n } else {\n yield lineBuff;\n }\n yield chunk;\n break;\n }\n }\n\n const sep = await reader.readSize(2);\n\n if (sep[0] != 13 || sep[1] != 10) {\n if (!first) {\n this.errored = true;\n } else {\n yield lineBuff;\n }\n yield chunk;\n yield sep;\n break;\n } else {\n first = false;\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!chunk || size === 0) {\n return;\n } else {\n yield chunk;\n }\n }\n }\n\n yield* reader;\n }\n\n unread(chunk: Uint8Array) {\n if (!chunk.length) {\n return;\n }\n\n this._readOffset -= chunk.length;\n\n /* istanbul ignore if */\n if (this._savedChunk) {\n console.log(\"Already have chunk!\");\n }\n\n this._savedChunk = chunk;\n }\n\n async _next() {\n if (this._savedChunk) {\n const chunk = this._savedChunk;\n this._savedChunk = null;\n return chunk;\n }\n\n if (this.compressed) {\n const newValue = this._getNextChunk();\n if (newValue) {\n return newValue;\n }\n }\n\n let value = await this._loadNext();\n\n while (this.compressed && value) {\n this._push(value);\n\n const newValue = this._getNextChunk(value);\n if (newValue) {\n return newValue;\n }\n value = await this._loadNext();\n }\n\n return value;\n }\n\n _push(value: Uint8Array) {\n // only called if this.compressed is not null\n if (!this.inflator) {\n throw new Error(\n \"AsyncIterReader cannot call _push when this.compressed is null\",\n );\n }\n this.lastValue = value;\n\n if (this.inflator.ended) {\n this.inflator = new NoConcatInflator(this.opts, this);\n }\n this.inflator.push(value);\n\n // \"deflate\" allows automatically trying \"deflateRaw\", while \"gzip\" does not\n if (\n this.inflator.err &&\n this.inflator.ended &&\n this.compressed === \"deflate\" &&\n !this.opts.raw &&\n this.numChunks === 0\n ) {\n this.opts.raw = true;\n this.compressed = \"deflateRaw\";\n\n this.inflator = new NoConcatInflator(this.opts, this);\n this.inflator.push(value);\n }\n }\n\n _getNextChunk(original?: Uint8Array) {\n // only called if this.compressed is not null\n if (!this.inflator) {\n throw new Error(\n \"AsyncIterReader cannot call _getNextChunk when this.compressed is null\",\n );\n }\n // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition\n while (true) {\n if (this.inflator.chunks.length > 0) {\n this.numChunks++;\n return this.inflator.chunks.shift();\n }\n\n if (this.inflator.ended) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n if (this.inflator.err !== 0) {\n // assume not compressed\n this.compressed = null;\n return original;\n }\n\n // @ts-expect-error strm is not implemented in typescript types\n const avail_in = this.inflator.strm.avail_in;\n\n if (avail_in && this.lastValue) {\n this._push(this.lastValue.slice(-avail_in));\n continue;\n }\n }\n\n return null;\n }\n }\n\n async *[Symbol.asyncIterator]() {\n let chunk = null;\n while ((chunk = await this._next())) {\n this._readOffset += chunk.length;\n yield chunk;\n }\n }\n\n async readlineRaw(maxLength?: number) {\n const chunks = [];\n let size = 0;\n\n let inx = -1;\n\n let lastChunk = null;\n\n for await (const chunk of this) {\n if (maxLength && size + chunk.byteLength > maxLength) {\n lastChunk = chunk;\n inx = maxLength - size - 1;\n const lineInx = chunk.slice(0, inx + 1).indexOf(10);\n if (lineInx >= 0) {\n inx = lineInx;\n }\n break;\n }\n\n inx = chunk.indexOf(10);\n\n if (inx >= 0) {\n lastChunk = chunk;\n break;\n }\n\n chunks.push(chunk);\n size += chunk.byteLength;\n }\n\n if (lastChunk) {\n const [first, remainder] = splitChunk(lastChunk, inx + 1);\n chunks.push(first);\n size += first.byteLength;\n\n this.unread(remainder);\n } else if (!chunks.length) {\n return null;\n }\n\n return concatChunks(chunks, size);\n }\n\n override async readFully(): Promise {\n return (await this._readOrSkip())[1];\n }\n\n async readSize(sizeLimit: number): Promise {\n return (await this._readOrSkip(sizeLimit))[1];\n }\n\n async skipSize(sizeLimit: number): Promise {\n return (await this._readOrSkip(sizeLimit, true))[0];\n }\n\n async _readOrSkip(sizeLimit = -1, skip = false) {\n const chunks: Uint8Array[] = [];\n let size = 0;\n\n //while ((res = await this._readiter.next()) && (chunk = res.value)) {\n for await (const chunk of this) {\n if (sizeLimit >= 0) {\n if (chunk.length > sizeLimit) {\n const [first, remainder] = splitChunk(chunk, sizeLimit);\n if (!skip) {\n chunks.push(first);\n }\n size += first.byteLength;\n this.unread(remainder);\n break;\n } else if (chunk.length === sizeLimit) {\n if (!skip) {\n chunks.push(chunk);\n }\n size += chunk.byteLength;\n sizeLimit = 0;\n break;\n } else {\n sizeLimit -= chunk.length;\n }\n }\n if (!skip) {\n chunks.push(chunk);\n }\n size += chunk.byteLength;\n }\n\n if (skip) {\n return [size, new Uint8Array()] as const;\n }\n return [size, concatChunks(chunks, size)] as const;\n }\n\n getReadOffset() {\n return this._readOffset;\n }\n\n getRawOffset() {\n return this.compressed ? this._rawOffset : this._readOffset;\n }\n\n getRawLength(prevOffset: number): number {\n if (this.compressed) {\n // @ts-expect-error strm is not implemented in typescript types\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return this.inflator.strm.total_in;\n }\n return this._readOffset - prevOffset;\n }\n\n static fromReadable(source: Readable) {\n const iterable = {\n async *[Symbol.asyncIterator]() {\n let res = null;\n\n while ((res = await source.read()) && !res.done) {\n yield res.value as Uint8Array;\n }\n },\n };\n\n return iterable;\n }\n\n static fromIter(source: Iterable) {\n const iterable = {\n async *[Symbol.asyncIterator]() {\n for (const chunk of source) {\n yield chunk;\n }\n },\n };\n\n return iterable;\n }\n}\n\n// ===========================================================================\nexport class LimitReader extends BaseAsyncIterReader {\n sourceIter!: AsyncIterReader;\n length!: number;\n limit!: number;\n skip!: number;\n\n constructor(streamIter: AsyncIterReader, limit: number, skip = 0) {\n super();\n this.sourceIter = streamIter;\n this.length = limit;\n this.limit = limit;\n this.skip = skip;\n }\n\n setLimitSkip(limit: number, skip = 0) {\n this.limit = limit;\n this.skip = skip;\n }\n\n async *[Symbol.asyncIterator]() {\n if (this.limit <= 0) {\n return;\n }\n\n for await (let chunk of this.sourceIter) {\n if (this.skip > 0) {\n if (chunk.length >= this.skip) {\n const [, /*first*/ remainder] = splitChunk(chunk, this.skip);\n chunk = remainder;\n this.skip = 0;\n } else {\n this.skip -= chunk.length;\n continue;\n }\n }\n\n if (chunk.length > this.limit) {\n const [first, remainder] = splitChunk(chunk, this.limit);\n chunk = first;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (this.sourceIter.unread) {\n this.sourceIter.unread(remainder);\n }\n }\n\n if (chunk.length) {\n this.limit -= chunk.length;\n\n yield chunk;\n }\n\n if (this.limit <= 0) {\n break;\n }\n }\n }\n\n async readlineRaw(maxLength?: number) {\n if (this.limit <= 0) {\n return null;\n }\n\n const result = await this.sourceIter.readlineRaw(\n maxLength ? Math.min(maxLength, this.limit) : this.limit,\n );\n this.limit -= result?.length || 0;\n return result;\n }\n\n async skipFully() {\n const origLimit = this.limit;\n\n while (this.limit > 0) {\n this.limit -= await this.sourceIter.skipSize(this.limit);\n }\n\n return origLimit;\n }\n}\n","import { type Request } from \"./types\";\n\nexport function binaryToString(data: Uint8Array | string | undefined | null) {\n let string;\n\n if (typeof data === \"string\") {\n string = data;\n } else if (data?.length) {\n string = data.reduce((accumulator, value) => {\n accumulator += String.fromCharCode(value);\n return accumulator;\n }, \"\");\n } else if (data) {\n string = data.toString();\n } else {\n string = \"\";\n }\n // try btoa, if it fails, just ignore the binary data string\n try {\n // eslint-disable-next-line deprecation/deprecation\n return \"__wb_post_data=\" + btoa(string);\n } catch (_e) {\n return \"__wb_post_data=\";\n }\n}\n\nexport function rxEscape(string: string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nexport function getSurt(url: string) {\n try {\n if (!url.startsWith(\"https:\") && !url.startsWith(\"http:\")) {\n return url;\n }\n url = url.replace(/^(https?:\\/\\/)www\\d*\\./, \"$1\");\n const urlLower = url.toLowerCase();\n const urlObj = new URL(urlLower);\n\n const hostParts = urlObj.hostname.split(\".\").reverse();\n let surt = hostParts.join(\",\");\n if (urlObj.port) {\n surt += \":\" + urlObj.port;\n }\n surt += \")\";\n surt += urlObj.pathname;\n if (urlObj.search) {\n const args = urlObj.search.slice(1).split(\"&\");\n args.sort();\n surt += \"?\" + args.join(\"&\");\n }\n return surt;\n } catch (_e) {\n return url;\n }\n}\n\nexport function postToGetUrl(request: Request) {\n const { method, headers, postData = \"\" } = request;\n\n if (method === \"GET\") {\n return false;\n }\n\n const getContentType = (headers: Headers | Map): string => {\n const ct = headers.get(\"content-type\");\n if (ct) {\n return ct;\n }\n if (!(headers instanceof Headers)) {\n for (const [key, value] of headers.entries()) {\n if (key && key.toLowerCase() === \"content-type\") {\n return value;\n }\n }\n }\n return \"\";\n };\n\n const contentType = getContentType(headers);\n\n const requestMime = contentType.split(\";\")[0];\n\n function decodeIfNeeded(\n postData: Uint8Array | string | undefined | null,\n ): string | undefined | null {\n if (postData instanceof Uint8Array) {\n postData = new TextDecoder().decode(postData);\n }\n return postData;\n }\n\n let query: string | undefined | null = \"\";\n\n switch (requestMime) {\n case \"application/x-www-form-urlencoded\":\n query = decodeIfNeeded(postData);\n break;\n\n case \"application/json\":\n query = jsonToQueryString(decodeIfNeeded(postData));\n break;\n\n case \"text/plain\":\n try {\n query = jsonToQueryString(decodeIfNeeded(postData), false);\n } catch (_e) {\n query = binaryToString(postData);\n }\n break;\n\n case \"multipart/form-data\": {\n if (!contentType) {\n throw new Error(\n \"utils cannot call postToGetURL when missing content-type header\",\n );\n }\n query = mfdToQueryString(decodeIfNeeded(postData), contentType);\n break;\n }\n\n default:\n query = binaryToString(postData);\n }\n\n if (query != null) {\n request.url = appendRequestQuery(\n request.url,\n decodeURI(query),\n request.method,\n );\n request.method = \"GET\";\n request.requestBody = query;\n return true;\n }\n\n return false;\n}\n\nexport function appendRequestQuery(url: string, query: string, method: string) {\n if (!method) {\n return url;\n }\n\n const start = url.indexOf(\"?\") > 0 ? \"&\" : \"?\";\n\n return `${url}${start}__wb_method=${method}&${query}`;\n}\n\nexport function jsonToQueryParams(json: unknown, ignoreInvalid = true) {\n if (typeof json === \"string\") {\n try {\n json = JSON.parse(json);\n } catch (_e) {\n json = {};\n }\n }\n\n const q = new URLSearchParams();\n\n const dupes: Record = {};\n\n const getKey = (key: string) => {\n if (!q.has(key)) {\n return key;\n }\n\n if (!(key in dupes)) {\n dupes[key] = 1;\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-type-assertion\n return key + \".\" + ++dupes[key]! + \"_\";\n };\n\n const parser = (jsonObj: unknown, key = \"\") => {\n let queryValue = \"\";\n\n // if object, attempt to recurse through key/value pairs\n if (typeof jsonObj === \"object\" && !(jsonObj instanceof Array)) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n for (const [key, value] of Object.entries(jsonObj!)) {\n parser(value as object, key);\n }\n } catch (_e) {\n // special case for null\n if (jsonObj === null) {\n queryValue = \"null\";\n }\n }\n }\n\n // if array, recurse through values, re-using key\n else if (jsonObj instanceof Array) {\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < jsonObj.length; i++) {\n parser(jsonObj[i], key);\n }\n }\n\n if ([\"string\", \"number\", \"boolean\"].includes(typeof jsonObj)) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-base-to-string\n queryValue = jsonObj!.toString();\n }\n\n if (queryValue) {\n q.set(getKey(key), queryValue);\n }\n };\n\n try {\n parser(json);\n } catch (e) {\n if (!ignoreInvalid) {\n throw e;\n }\n }\n return q;\n}\n\nexport function mfdToQueryParams(\n mfd: string | Uint8Array | undefined | null = \"\",\n contentType: string,\n) {\n const params = new URLSearchParams();\n\n if (mfd instanceof Uint8Array) {\n mfd = new TextDecoder().decode(mfd);\n }\n\n try {\n const boundary = contentType.split(\"boundary=\")[1];\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const parts = mfd!.split(new RegExp(\"-*\" + boundary + \"-*\", \"mi\"));\n\n for (const part of parts) {\n const m = part.trim().match(/name=\"([^\"]+)\"\\r\\n\\r\\n(.*)/im);\n if (m) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- match checked\n params.set(m[1]!, m[2]!);\n }\n }\n } catch (_e) {\n // ignore invalid, don't add params\n }\n\n return params;\n}\n\nexport function jsonToQueryString(\n json: string | Record | undefined | null = \"\",\n ignoreInvalid = true,\n) {\n return jsonToQueryParams(json, ignoreInvalid).toString();\n}\n\nexport function mfdToQueryString(\n mfd: string | Uint8Array | undefined | null,\n contentType: string,\n) {\n return mfdToQueryParams(mfd, contentType).toString();\n}\n\n// ===========================================================================\n// parsing utils\n\nexport function concatChunks(chunks: Uint8Array[], size: number): Uint8Array {\n if (chunks.length === 1) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return chunks[0]!;\n }\n const buffer = new Uint8Array(size);\n\n let offset = 0;\n\n for (const chunk of chunks) {\n buffer.set(chunk, offset);\n offset += chunk.byteLength;\n }\n\n return buffer;\n}\n\nexport function splitChunk(\n chunk: Uint8Array,\n inx: number,\n): [Uint8Array, Uint8Array] {\n return [chunk.slice(0, inx), chunk.slice(inx)];\n}\n\n// ===========================================================================\nexport function UTFToLatin1(value: string) {\n const buf = new TextEncoder().encode(value);\n\n let str = \"\";\n buf.forEach((x) => (str += String.fromCharCode(x)));\n return str;\n}\n\n// ===========================================================================\nexport function latin1ToUTF(str: string) {\n const buf = new Uint8Array(str.length);\n for (let i = 0; i < str.length; i++) {\n buf[i] = str.charCodeAt(i) & 0xff;\n }\n return new TextDecoder().decode(buf);\n}\n\n// ===========================================================================\n// headers multi map\nconst MULTI_VALUE_ALLOWED = [\"set-cookie\", \"warc-concurrent-to\", \"warc-protocol\"];\n\n// using something other than comma to reduce change of any collisions with actual data\n// in theory, collision still possible with arbitrary cookie value\nconst JOIN_MARKER = \",,,\";\n\nexport function multiValueHeader(name: string, value: string[]) {\n if (!MULTI_VALUE_ALLOWED.includes(name.toLowerCase())) {\n throw new Error(\"not a valid multi value header\");\n }\n return value.join(JOIN_MARKER);\n}\n\nexport class HeadersMultiMap extends Map {\n constructor(headersInit?: HeadersInit) {\n // if an array of array, parse that and add individually here\n if (headersInit instanceof Array) {\n super();\n for (const entry of headersInit) {\n if (entry instanceof Array) {\n const name = entry[0];\n const value = entry[1];\n this.append(name, value);\n }\n }\n } else {\n super(headersInit ? Object.entries(headersInit) : undefined);\n }\n }\n\n getMultiple(name: string): string[] | undefined {\n const value = super.get(name);\n if (!value) {\n return undefined;\n }\n if (MULTI_VALUE_ALLOWED.includes(name.toLowerCase())) {\n return value.split(JOIN_MARKER);\n }\n return [value];\n }\n\n append(name: string, value: string) {\n if (MULTI_VALUE_ALLOWED.includes(name.toLowerCase())) {\n const prev = this.get(name);\n this.set(name, prev !== undefined ? prev + JOIN_MARKER + value : value);\n } else {\n this.set(name, value);\n }\n }\n\n override *[Symbol.iterator](): IterableIterator<[string, string]> {\n for (const [name, value] of super[Symbol.iterator]()) {\n if (MULTI_VALUE_ALLOWED.includes(name.toLowerCase())) {\n for (const v of value.split(JOIN_MARKER)) {\n yield [name, v];\n }\n } else {\n yield [name, value];\n }\n }\n }\n}\n","import { concatChunks, HeadersMultiMap, latin1ToUTF, splitChunk, UTFToLatin1 } from \"./utils\";\nimport { type AsyncIterReader } from \"./readers\";\n\nexport const CRLF = new Uint8Array([13, 10]);\nexport const CRLFCRLF = new Uint8Array([13, 10, 13, 10]);\n\nconst decoder = new TextDecoder(\"utf-8\");\n\n// ===========================================================================\nexport class StatusAndHeaders {\n statusline: string;\n headers: HeadersMultiMap | Headers;\n readonly reencodeHeaders?: Set;\n\n constructor({\n statusline,\n headers,\n reencodeHeaders,\n }: {\n statusline: string;\n headers: HeadersMultiMap | Headers;\n reencodeHeaders?: Set;\n }) {\n this.statusline = statusline;\n this.headers = headers;\n this.reencodeHeaders = reencodeHeaders;\n }\n\n toString() {\n const buff = [this.statusline];\n\n const isHeaders = this.headers instanceof Headers;\n\n for (const [name, value] of this.headers) {\n if (isHeaders && this.reencodeHeaders?.has(name)) {\n buff.push(`${name}: ${latin1ToUTF(value)}`);\n } else {\n buff.push(`${name}: ${value}`);\n }\n }\n\n return buff.join(\"\\r\\n\") + \"\\r\\n\";\n }\n\n async *iterSerialize(encoder: TextEncoder) {\n yield encoder.encode(this.statusline);\n yield CRLF;\n for (const [name, value] of this.headers) {\n yield encoder.encode(`${name}: ${value}\\r\\n`);\n }\n }\n\n _protocol: string | undefined;\n _statusCode: number | string | undefined;\n _statusText: string | undefined;\n\n _parseResponseStatusLine() {\n const parts = splitRemainder(this.statusline, \" \", 2);\n this._protocol = parts[0] ?? \"\";\n this._statusCode = parts.length > 1 ? Number(parts[1]) : \"\";\n this._statusText = parts.length > 2 ? parts[2] : \"\";\n }\n\n get statusCode() {\n if (this._statusCode === undefined) {\n this._parseResponseStatusLine();\n }\n return this._statusCode;\n }\n\n get protocol() {\n if (this._protocol === undefined) {\n this._parseResponseStatusLine();\n }\n return this._protocol;\n }\n\n get statusText() {\n if (this._statusText === undefined) {\n this._parseResponseStatusLine();\n }\n return this._statusText;\n }\n\n _method: string | undefined;\n _requestPath: string | undefined;\n\n _parseRequestStatusLine() {\n const parts = this.statusline.split(\" \", 2);\n this._method = parts[0] ?? \"\";\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- length checked\n this._requestPath = parts.length > 1 ? parts[1]! : \"\";\n }\n\n get method() {\n if (this._method === undefined) {\n this._parseRequestStatusLine();\n }\n return this._method;\n }\n\n get requestPath() {\n if (this._requestPath === undefined) {\n this._parseRequestStatusLine();\n }\n return this._requestPath;\n }\n}\n\n// ===========================================================================\nexport class StatusAndHeadersParser {\n reencodeHeaders = new Set();\n\n async parse(\n reader: AsyncIterReader,\n {\n headersClass,\n firstLine,\n }: {\n firstLine?: string;\n headersClass: typeof HeadersMultiMap | typeof Headers;\n } = {\n headersClass: HeadersMultiMap,\n },\n ) {\n const fullStatusLine = firstLine ? firstLine : await reader.readline();\n\n if (!fullStatusLine) {\n return null;\n }\n\n const statusline = fullStatusLine.trimEnd();\n\n if (!statusline) {\n return null;\n }\n\n const headers = new headersClass();\n\n const headerBuff = await readToDoubleCRLF(reader);\n\n let start = 0;\n let nameEnd, valueStart, valueEnd;\n let name = \"\";\n let value;\n\n while (start < headerBuff.length) {\n valueEnd = headerBuff.indexOf(\"\\n\", start);\n\n if (value && (headerBuff[start] === \" \" || headerBuff[start] === \"\\t\")) {\n value += headerBuff\n .slice(start, valueEnd < 0 ? undefined : valueEnd)\n .trimEnd();\n } else {\n if (value) {\n this.setHeader(name, value, headers);\n value = null;\n }\n\n nameEnd = headerBuff.indexOf(\":\", start);\n\n valueStart = nameEnd < 0 ? start : nameEnd + 1;\n\n if (nameEnd >= 0 && nameEnd < valueEnd) {\n name = headerBuff.slice(start, nameEnd).trimStart();\n value = headerBuff\n .slice(valueStart, valueEnd < 0 ? undefined : valueEnd)\n .trim();\n } else {\n value = null;\n }\n }\n\n if (valueEnd < 0) {\n break;\n }\n\n start = valueEnd + 1;\n }\n\n if (value) {\n this.setHeader(name, value, headers);\n }\n\n return new StatusAndHeaders({\n statusline,\n headers,\n reencodeHeaders: this.reencodeHeaders,\n });\n }\n\n setHeader(\n name: string,\n value: string,\n headers: Headers | HeadersMultiMap,\n reencoded = false,\n ) {\n try {\n headers.append(name, value);\n if (headers instanceof Headers && reencoded) {\n this.reencodeHeaders.add(name.toLowerCase());\n }\n } catch (_e) {\n if (!reencoded) {\n // if haven't reencoded already, try reencoding as latin1 before saving\n this.setHeader(name, UTFToLatin1(value), headers, true);\n }\n }\n }\n}\n\n// ===========================================================================\nfunction splitRemainder(str: string, sep: string, limit: number) {\n const parts = str.split(sep);\n const newParts = parts.slice(0, limit);\n const rest = parts.slice(limit);\n if (rest.length > 0) {\n newParts.push(parts.slice(limit).join(sep));\n }\n return newParts;\n}\n\n// ===========================================================================\nexport async function indexOfDoubleCRLF(\n buffer: Uint8Array,\n iter: AsyncIterator,\n) {\n let start = 0;\n\n for (let i = 0; i < buffer.length - 4; i++) {\n const inx = buffer.indexOf(13, start);\n if (inx < 0) {\n break;\n }\n\n if (inx + 3 >= buffer.length) {\n const { value } = await iter.next();\n if (!value) {\n break;\n }\n\n const newBuff = new Uint8Array(value.length + buffer.length);\n newBuff.set(buffer, 0);\n newBuff.set(value, buffer.length);\n buffer = newBuff;\n }\n\n if (\n buffer[inx + 1] === 10 &&\n buffer[inx + 2] === 13 &&\n buffer[inx + 3] === 10\n ) {\n return [inx + 3, buffer] as const;\n }\n\n start = inx + 1;\n }\n\n return [-1, buffer] as const;\n}\n\n// ===========================================================================\nexport async function readToDoubleCRLF(reader: AsyncIterReader) {\n const chunks = [];\n let size = 0;\n\n let inx = 0;\n\n let lastChunk = null;\n\n const iter = reader[Symbol.asyncIterator]();\n\n for await (let chunk of iter) {\n [inx, chunk] = await indexOfDoubleCRLF(chunk, iter);\n\n if (inx >= 0) {\n lastChunk = chunk;\n break;\n }\n\n chunks.push(chunk);\n size += chunk.byteLength;\n }\n\n if (lastChunk) {\n const [first, remainder] = splitChunk(lastChunk, inx + 1);\n chunks.push(first);\n size += first.byteLength;\n\n reader.unread(remainder);\n } else if (!chunks.length) {\n return \"\";\n }\n\n return decoder.decode(concatChunks(chunks, size));\n}\n\n// ===========================================================================\n","import uuid from \"uuid-random\";\nimport { BaseAsyncIterReader, AsyncIterReader, LimitReader } from \"./readers\";\nimport { StatusAndHeaders } from \"./statusandheaders\";\nimport { type Source } from \"./types\";\nimport { HeadersMultiMap } from \"./utils\";\n\nconst decoder = new TextDecoder(\"utf-8\");\nconst encoder = new TextEncoder();\n\nexport const WARC_1_1 = \"WARC/1.1\";\nexport const WARC_1_0 = \"WARC/1.0\";\n\nconst REVISIT_PROFILE_1_0 =\n \"http://netpreserve.org/warc/1.0/revisit/identical-payload-digest\";\nconst REVISIT_PROFILE_1_1 =\n \"http://netpreserve.org/warc/1.1/revisit/identical-payload-digest\";\n\nexport type WARCType =\n | \"warcinfo\"\n | \"response\"\n | \"resource\"\n | \"request\"\n | \"metadata\"\n | \"revisit\"\n | \"conversion\"\n | \"continuation\";\n\nconst defaultRecordCT: Partial> = {\n warcinfo: \"application/warc-fields\",\n response: \"application/http; msgtype=response\",\n revisit: \"application/http; msgtype=response\",\n request: \"application/http; msgtype=request\",\n metadata: \"application/warc-fields\",\n};\n\n// ===========================================================================\nexport type WARCRecordOpts = {\n url?: string;\n date?: string;\n type?: WARCType;\n warcHeaders?: Record | [string, string][];\n filename?: string;\n httpHeaders?: HeadersInit;\n statusline?: string;\n warcVersion?: typeof WARC_1_0 | typeof WARC_1_1;\n keepHeadersCase?: boolean;\n refersToUrl?: string;\n refersToDate?: string;\n};\n\n// ===========================================================================\nexport class WARCRecord extends BaseAsyncIterReader {\n static create(\n {\n url,\n date,\n type,\n warcHeaders = {},\n filename = \"\",\n httpHeaders = {},\n statusline = \"HTTP/1.1 200 OK\",\n warcVersion = WARC_1_0,\n keepHeadersCase = true,\n refersToUrl = undefined,\n refersToDate = undefined,\n }: WARCRecordOpts = {},\n reader?: AsyncIterable | Iterable,\n ) {\n function checkDate(d: string) {\n const date = d;\n if (warcVersion === WARC_1_0) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- constant\n d = d.split(\".\")[0]!;\n if (d.charAt(date.length - 1) != \"Z\") {\n d += \"Z\";\n }\n }\n return d;\n }\n\n date = checkDate(date || new Date().toISOString());\n\n const warcHeadersMap = new HeadersMultiMap(warcHeaders);\n\n if (type === \"warcinfo\") {\n if (filename) {\n warcHeadersMap.set(\"WARC-Filename\", filename);\n }\n } else if (url) {\n try {\n warcHeadersMap.set(\"WARC-Target-URI\", new URL(url).href);\n } catch (_e) {\n warcHeadersMap.set(\"WARC-Target-URI\", url);\n }\n }\n\n warcHeadersMap.set(\"WARC-Date\", date);\n\n if (type) {\n warcHeadersMap.set(\"WARC-Type\", type);\n }\n\n if (type === \"revisit\") {\n warcHeadersMap.set(\n \"WARC-Profile\",\n warcVersion === WARC_1_1 ? REVISIT_PROFILE_1_1 : REVISIT_PROFILE_1_0,\n );\n if (refersToUrl) {\n warcHeadersMap.set(\"WARC-Refers-To-Target-URI\", refersToUrl);\n warcHeadersMap.set(\n \"WARC-Refers-To-Date\",\n checkDate(refersToDate || new Date().toISOString()),\n );\n }\n }\n\n const warcHeadersObj = new StatusAndHeaders({\n statusline: warcVersion,\n headers: warcHeadersMap,\n });\n\n if (!warcHeadersObj.headers.get(\"WARC-Record-ID\")) {\n warcHeadersObj.headers.set(\"WARC-Record-ID\", ``);\n }\n\n if (!warcHeadersObj.headers.get(\"Content-Type\")) {\n warcHeadersObj.headers.set(\n \"Content-Type\",\n (type && defaultRecordCT[type]) || \"application/octet-stream\",\n );\n }\n\n if (!reader) {\n reader = emptyReader();\n }\n\n const record = new WARCRecord({ warcHeaders: warcHeadersObj, reader });\n let headers: HeadersMultiMap | Headers | null = null;\n let isEmpty = false;\n\n switch (type) {\n case \"response\":\n case \"request\":\n case \"revisit\":\n if (keepHeadersCase) {\n headers = new HeadersMultiMap(httpHeaders);\n isEmpty = !headers.size;\n } else {\n headers = new Headers(httpHeaders);\n isEmpty = !Object.entries(httpHeaders).length;\n }\n\n // for revisit records, if there are no http headers, don't add statusline\n // for other request/response, add an empty statusline-only block\n if (!isEmpty || type !== \"revisit\") {\n record.httpHeaders = new StatusAndHeaders({ statusline, headers });\n }\n break;\n }\n\n return record;\n }\n\n static createWARCInfo(\n opts: WARCRecordOpts = {},\n info: Record,\n ) {\n async function* genInfo() {\n for (const [name, value] of Object.entries(info)) {\n yield encoder.encode(`${name}: ${value}\\r\\n`);\n }\n }\n\n opts.type = \"warcinfo\";\n\n return WARCRecord.create(opts, genInfo());\n }\n\n warcHeaders: StatusAndHeaders;\n _reader: AsyncIterable | Iterable;\n _contentReader: BaseAsyncIterReader | null;\n payload: Uint8Array | null;\n httpHeaders: StatusAndHeaders | null;\n consumed: \"content\" | \"raw\" | \"skipped\" | \"\";\n\n _offset: number | undefined = 0;\n _length = 0;\n\n _urlkey = \"\";\n\n constructor({\n warcHeaders,\n reader,\n }: {\n warcHeaders: StatusAndHeaders;\n reader: AsyncIterable | Iterable;\n }) {\n super();\n\n this.warcHeaders = warcHeaders;\n\n this._reader = reader;\n this._contentReader = null;\n\n this.payload = null;\n this.httpHeaders = null;\n\n this.consumed = \"\";\n\n this.fixUp();\n }\n\n getResponseInfo() {\n const httpHeaders = this.httpHeaders;\n\n if (!httpHeaders) {\n return null;\n }\n\n // match parameters for Response(..., initOpts);\n return {\n headers: httpHeaders.headers,\n status: httpHeaders.statusCode,\n statusText: httpHeaders.statusText,\n };\n }\n\n fixUp() {\n // Fix wget-style error where WARC-Target-URI is wrapped in <>\n const uri = this.warcHeaders.headers.get(\"WARC-Target-URI\");\n if (uri && uri.startsWith(\"<\") && uri.endsWith(\">\")) {\n this.warcHeaders.headers.set(\"WARC-Target-URI\", uri.slice(1, -1));\n }\n }\n\n override async readFully(isContent = false) {\n // if have httpHeaders, need to consider transfer and content decoding is decoding content vs raw data\n if (this.httpHeaders) {\n // if payload is empty, just return\n if (this.payload && !this.payload.length) {\n return this.payload;\n }\n\n // otherwise, can't serialize payload as raw if already started reading\n if (this._contentReader && !isContent) {\n throw new TypeError(\n \"WARC Record decoding already started, but requesting raw payload\",\n );\n }\n\n // reading content, but already consumed raw data, convert\n if (isContent && this.consumed === \"raw\" && this.payload) {\n return await this._createDecodingReader([this.payload]).readFully();\n }\n }\n\n if (this.payload) {\n return this.payload;\n }\n\n if (isContent) {\n this.payload = await super.readFully();\n this.consumed = \"content\";\n } else {\n this.payload = await BaseAsyncIterReader.readFully(this._reader);\n this.consumed = \"raw\";\n }\n\n return this.payload;\n }\n\n get reader() {\n // already consumed payload, and know its empty, just return empty reader\n if (this.payload && !this.payload.length) {\n return emptyReader();\n }\n\n if (this._contentReader) {\n throw new TypeError(\n \"WARC Record decoding already started, but requesting raw payload\",\n );\n }\n\n return this._reader;\n }\n\n get contentReader() {\n if (!this.httpHeaders) {\n return this._reader;\n }\n\n if (!this._contentReader) {\n this._contentReader = this._createDecodingReader(this._reader);\n }\n\n return this._contentReader;\n }\n\n _createDecodingReader(source: Source) {\n // only called if this.httpHeaders !== null\n if (!this.httpHeaders) {\n throw new Error(\n \"WARCRecord cannot call _createDecodingReader when this.httpHeaders === null\",\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n let contentEnc = this.httpHeaders.headers.get(\"Content-Encoding\")!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const transferEnc = this.httpHeaders.headers.get(\"Transfer-Encoding\")!;\n\n const chunked = transferEnc === \"chunked\";\n\n // Transfer-Encoding is not chunked and no Content-Encoding\n // try Transfer-Encoding as Content-Encoding\n if (!contentEnc && !chunked) {\n contentEnc = transferEnc;\n }\n\n return new AsyncIterReader(source, contentEnc, chunked);\n }\n\n async readlineRaw(maxLength?: number) {\n if (this.consumed) {\n throw new Error(\n \"Record already consumed.. Perhaps a promise was not awaited?\",\n );\n }\n if (this.contentReader instanceof BaseAsyncIterReader) {\n return this.contentReader.readlineRaw(maxLength);\n }\n throw new Error(\n \"WARCRecord cannot call readlineRaw on this.contentReader if it does not extend BaseAsyncIterReader\",\n );\n }\n\n async contentText() {\n const payload = await this.readFully(true);\n return decoder.decode(payload);\n }\n\n async *[Symbol.asyncIterator]() {\n for await (const chunk of this.contentReader) {\n yield chunk;\n if (this.consumed) {\n throw new Error(\n \"Record already consumed.. Perhaps a promise was not awaited?\",\n );\n }\n }\n\n this.consumed = \"content\";\n }\n\n async skipFully() {\n if (this.consumed) {\n return;\n }\n if (this._reader instanceof LimitReader) {\n const res = await this._reader.skipFully();\n this.consumed = \"skipped\";\n return res;\n }\n throw new Error(\n \"WARCRecord cannot call skipFully on this._reader if it is not a LimitReader\",\n );\n }\n\n warcHeader(name: string) {\n return this.warcHeaders.headers.get(name);\n }\n\n get warcType() {\n return this.warcHeaders.headers.get(\"WARC-Type\");\n }\n\n get warcTargetURI() {\n return this.warcHeaders.headers.get(\"WARC-Target-URI\");\n }\n\n get warcDate() {\n return this.warcHeaders.headers.get(\"WARC-Date\");\n }\n\n get warcRefersToTargetURI() {\n return this.warcHeaders.headers.get(\"WARC-Refers-To-Target-URI\");\n }\n\n get warcRefersToDate() {\n return this.warcHeaders.headers.get(\"WARC-Refers-To-Date\");\n }\n\n get warcPayloadDigest() {\n return this.warcHeaders.headers.get(\"WARC-Payload-Digest\");\n }\n\n get warcBlockDigest() {\n return this.warcHeaders.headers.get(\"WARC-Block-Digest\");\n }\n\n get warcContentType() {\n return this.warcHeaders.headers.get(\"Content-Type\");\n }\n\n get warcContentLength() {\n return Number(this.warcHeaders.headers.get(\"Content-Length\"));\n }\n\n get warcConcurrentTo() {\n if (this.warcHeaders.headers instanceof HeadersMultiMap) {\n return this.warcHeaders.headers.getMultiple(\"WARC-Concurrent-To\");\n } else {\n const res = this.warcHeaders.headers.get(\"WARC-Concurrent-To\");\n return res ? res.split(\",\") : [];\n }\n }\n}\n\n// ===========================================================================\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nasync function* emptyReader(): AsyncGenerator {}\n","import {\n StatusAndHeadersParser,\n type StatusAndHeaders,\n} from \"./statusandheaders\";\nimport { WARCRecord } from \"./warcrecord\";\nimport { AsyncIterReader, LimitReader } from \"./readers\";\nimport { type Source, type IndexerOffsetLength } from \"./types\";\nimport { HeadersMultiMap } from \"./utils\";\n\nconst decoder = new TextDecoder();\nconst EMPTY = new Uint8Array([]);\n\nexport type WARCParserOpts = {\n keepHeadersCase?: boolean;\n parseHttp?: boolean;\n};\n\n// ===========================================================================\nexport class WARCParser implements IndexerOffsetLength {\n static async parse(source: Source, options?: WARCParserOpts) {\n return new WARCParser(source, options).parse();\n }\n\n static iterRecords(source: Source, options?: WARCParserOpts) {\n return new WARCParser(source, options)[Symbol.asyncIterator]();\n }\n\n _offset: number;\n _warcHeadersLength: number;\n\n _headersClass: typeof HeadersMultiMap | typeof Headers;\n _parseHttp: boolean;\n\n _reader: AsyncIterReader;\n\n _record: WARCRecord | null;\n\n constructor(\n source: Source,\n { keepHeadersCase = false, parseHttp = true }: WARCParserOpts = {},\n ) {\n this._offset = 0;\n this._warcHeadersLength = 0;\n\n this._headersClass = keepHeadersCase ? HeadersMultiMap : Headers;\n this._parseHttp = parseHttp;\n\n if (!(source instanceof AsyncIterReader)) {\n this._reader = new AsyncIterReader(source);\n } else {\n this._reader = source;\n }\n\n this._record = null;\n }\n\n async readToNextRecord() {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!this._reader || !this._record) {\n return EMPTY;\n }\n\n await this._record.skipFully();\n\n if (this._reader.compressed) {\n this._offset = this._reader.getRawOffset();\n }\n\n let nextline = await this._reader.readlineRaw();\n\n let lineLen = 0;\n\n if (!nextline) {\n nextline = EMPTY;\n } else {\n lineLen = nextline.byteLength - 1;\n\n // if line starts with WARC/, we're actually in a new record, return immediately\n if (lineLen === 9 && decoder.decode(nextline).startsWith(\"WARC/\")) {\n return nextline;\n }\n\n // otherwise, detect leftover data\n while (lineLen > 0) {\n const value = nextline[lineLen - 1];\n if (value !== 10 && value !== 13) {\n break;\n }\n lineLen--;\n }\n\n if (lineLen) {\n console.warn(`Content-Length Too Small: Record not followed by newline, \\\nRemainder Length: ${lineLen}, \\\nOffset: ${this._reader.getRawOffset() - nextline.byteLength}`);\n }\n }\n\n if (this._reader.compressed) {\n await this._reader.skipSize(2);\n nextline = EMPTY;\n } else {\n nextline = await this._reader.readlineRaw();\n\n // consume remaining new lines\n while (nextline && nextline.byteLength === 2) {\n nextline = await this._reader.readlineRaw();\n }\n\n this._offset = this._reader.getRawOffset();\n if (nextline) {\n this._offset -= nextline.length;\n }\n }\n\n return nextline;\n }\n\n _initRecordReader(warcHeaders: StatusAndHeaders) {\n return new LimitReader(\n this._reader,\n Number(warcHeaders.headers.get(\"Content-Length\") || 0),\n );\n }\n\n async parse() {\n const firstLineBuff = await this.readToNextRecord();\n const firstLine = firstLineBuff ? decoder.decode(firstLineBuff) : \"\";\n\n const headersParser = new StatusAndHeadersParser();\n const warcHeaders = await headersParser.parse(this._reader, {\n firstLine,\n headersClass: this._headersClass,\n });\n\n if (!warcHeaders) {\n return null;\n }\n\n this._warcHeadersLength = this._reader.getReadOffset();\n\n const record = new WARCRecord({\n warcHeaders,\n reader: this._initRecordReader(warcHeaders),\n });\n\n this._record = record;\n\n if (this._parseHttp) {\n switch (record.warcType) {\n case \"response\":\n case \"request\":\n await this._addHttpHeaders(record, headersParser);\n break;\n\n case \"revisit\":\n if (record.warcContentLength > 0) {\n await this._addHttpHeaders(record, headersParser);\n }\n break;\n }\n }\n\n return record;\n }\n\n get offset() {\n return this._offset;\n }\n\n get recordLength() {\n return this._reader.getRawLength(this._offset);\n }\n\n async *[Symbol.asyncIterator]() {\n let record = null;\n\n while ((record = await this.parse()) !== null) {\n yield record;\n }\n\n this._record = null;\n }\n\n async _addHttpHeaders(\n record: WARCRecord,\n headersParser: StatusAndHeadersParser,\n ) {\n const httpHeaders = await headersParser.parse(this._reader, {\n headersClass: this._headersClass,\n });\n record.httpHeaders = httpHeaders;\n\n const headersLen = this._reader.getReadOffset() - this._warcHeadersLength;\n if (record.reader instanceof LimitReader) {\n record.reader.setLimitSkip(record.warcContentLength - headersLen);\n }\n }\n}\n\n// ===========================================================================\n","export default function toDataView (data) {\n if (data instanceof Int8Array || data instanceof Uint8Array || data instanceof Uint8ClampedArray) {\n return new DataView(data.buffer, data.byteOffset, data.byteLength)\n }\n\n if (data instanceof ArrayBuffer) {\n return new DataView(data)\n }\n\n throw new TypeError('Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray')\n}\n","import toDataView from 'to-data-view'\n\nconst RFC4648 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'\nconst RFC4648_HEX = '0123456789ABCDEFGHIJKLMNOPQRSTUV'\nconst CROCKFORD = '0123456789ABCDEFGHJKMNPQRSTVWXYZ'\n\nexport default function base32Encode (data, variant, options) {\n options = options || {}\n let alphabet, defaultPadding\n\n switch (variant) {\n case 'RFC3548':\n case 'RFC4648':\n alphabet = RFC4648\n defaultPadding = true\n break\n case 'RFC4648-HEX':\n alphabet = RFC4648_HEX\n defaultPadding = true\n break\n case 'Crockford':\n alphabet = CROCKFORD\n defaultPadding = false\n break\n default:\n throw new Error('Unknown base32 variant: ' + variant)\n }\n\n const padding = (options.padding !== undefined ? options.padding : defaultPadding)\n const view = toDataView(data)\n\n let bits = 0\n let value = 0\n let output = ''\n\n for (let i = 0; i < view.byteLength; i++) {\n value = (value << 8) | view.getUint8(i)\n bits += 8\n\n while (bits >= 5) {\n output += alphabet[(value >>> (bits - 5)) & 31]\n bits -= 5\n }\n }\n\n if (bits > 0) {\n output += alphabet[(value << (5 - bits)) & 31]\n }\n\n if (padding) {\n while ((output.length % 8) !== 0) {\n output += '='\n }\n }\n\n return output\n}\n","//import base32 from \"hi-base32\";\nimport base32Encode from \"base32-encode\";\nimport pako from \"pako\";\n\nimport { createSHA256, createSHA1 } from \"hash-wasm\";\nimport { type IHasher } from \"hash-wasm/dist/lib/WASMInterface.js\";\n\nimport { type WARCRecord } from \"./warcrecord\";\nimport { BaseAsyncIterReader } from \"./readers\";\nimport { CRLF, CRLFCRLF } from \"./statusandheaders\";\n\nconst encoder = new TextEncoder();\n\n// ===========================================================================\nexport type WARCSerializerOpts = {\n gzip?: boolean;\n digest?: {\n algo?: AlgorithmIdentifier;\n prefix?: string;\n base32?: boolean;\n };\n preferPako?: boolean;\n};\n\n// ===========================================================================\n/* Base class for custom buffering while serializing */\nexport abstract class BaseSerializerBuffer {\n abstract write(chunk: Uint8Array): void;\n abstract readAll(): AsyncIterable;\n abstract clear(): void;\n}\n\n// ===========================================================================\nexport class SerializerInMemBuffer extends BaseSerializerBuffer {\n buffers: Uint8Array[] = [];\n\n write(chunk: Uint8Array): void {\n this.buffers.push(chunk);\n }\n\n async *readAll(): AsyncIterable {\n for (const buff of this.buffers) {\n yield buff;\n }\n }\n\n clear() {\n this.buffers = [];\n }\n}\n\n// ===========================================================================\nexport class WARCSerializer extends BaseAsyncIterReader {\n gzip = false;\n\n digestAlgo: AlgorithmIdentifier = \"\";\n digestAlgoPrefix = \"\";\n digestBase32 = false;\n preferPako = false;\n\n record: WARCRecord;\n\n externalBuffer: BaseSerializerBuffer | undefined;\n _alreadyDigested = false;\n\n blockHasher: IHasher | null = null;\n payloadHasher: IHasher | null = null;\n\n httpHeadersBuff: Uint8Array | null = null;\n warcHeadersBuff: Uint8Array | null = null;\n\n static async serialize(\n record: WARCRecord,\n opts?: WARCSerializerOpts,\n externalBuffer: BaseSerializerBuffer = new SerializerInMemBuffer(),\n ) {\n const s = new WARCSerializer(record, opts, externalBuffer);\n return await s.readFully();\n }\n\n constructor(\n record: WARCRecord,\n opts: WARCSerializerOpts = {},\n externalBuffer: BaseSerializerBuffer = new SerializerInMemBuffer(),\n ) {\n super();\n this.gzip = Boolean(opts.gzip);\n\n this.record = record;\n\n const digestOpts = opts.digest || {};\n this.digestAlgo = digestOpts.algo || \"sha-256\";\n this.digestAlgoPrefix = digestOpts.prefix || \"sha256:\";\n this.digestBase32 = Boolean(digestOpts.base32);\n this.preferPako = Boolean(opts.preferPako);\n\n if (WARCSerializer.noComputeDigest(record)) {\n this.digestAlgo = \"\";\n }\n\n this.externalBuffer = externalBuffer;\n }\n\n static noComputeDigest(record: WARCRecord) {\n return (\n record.warcType === \"revisit\" ||\n record.warcType === \"warcinfo\" ||\n (record.warcPayloadDigest && record.warcBlockDigest)\n );\n }\n\n async *[Symbol.asyncIterator]() {\n if (!this.gzip) {\n yield* this.generateRecord();\n return;\n }\n\n if (\"CompressionStream\" in globalThis && !this.preferPako) {\n const cs = new globalThis.CompressionStream(\"gzip\");\n yield* this.streamCompress(cs);\n } else {\n yield* this.pakoCompress();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n override async readlineRaw(maxLength?: number): Promise {\n return null;\n }\n\n async *pakoCompress() {\n const deflater = new pako.Deflate({ gzip: true });\n\n let lastChunk: Uint8Array | null = null;\n\n for await (const chunk of this.generateRecord()) {\n if (lastChunk && lastChunk.length > 0) {\n deflater.push(lastChunk);\n }\n lastChunk = chunk;\n\n // @ts-expect-error Deflate has property chunks in implementation\n while (deflater.chunks.length) {\n // @ts-expect-error Deflate has property chunks in implementation\n yield deflater.chunks.shift();\n }\n }\n\n if (lastChunk) {\n deflater.push(lastChunk, true);\n }\n yield deflater.result;\n }\n\n async *streamCompress(cs: CompressionStream) {\n const recordIter = this.generateRecord();\n\n const source = new ReadableStream({\n async pull(controller) {\n const res = await recordIter.next();\n if (!res.done) {\n controller.enqueue(res.value);\n } else {\n controller.close();\n }\n },\n });\n\n source.pipeThrough(cs);\n\n let res: ReadableStreamReadResult | null = null;\n\n const reader = cs.readable.getReader();\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((res = await reader.read()) && !res.done) {\n yield res.value;\n }\n }\n\n async newHasher() {\n switch (this.digestAlgo) {\n case \"sha-256\":\n return createSHA256();\n\n case \"sha-1\":\n return createSHA1();\n\n case \"\":\n return null;\n\n default:\n return createSHA256();\n }\n }\n\n getDigest(hasher: IHasher) {\n return (\n this.digestAlgoPrefix +\n (this.digestBase32\n ? base32Encode(hasher.digest(\"binary\"), \"RFC4648\")\n : hasher.digest(\"hex\"))\n );\n }\n\n async digestRecord() {\n const record = this.record;\n\n if (this._alreadyDigested) {\n return Number(record.warcHeaders.headers.get(\"Content-Length\"));\n }\n\n const blockHasher = await this.newHasher();\n const payloadHasher = await this.newHasher();\n\n let size = 0;\n\n if (record.httpHeaders) {\n this.httpHeadersBuff = encoder.encode(\n record.httpHeaders.toString() + \"\\r\\n\",\n );\n size += this.httpHeadersBuff.length;\n\n blockHasher?.update(this.httpHeadersBuff);\n }\n\n for await (const chunk of record.reader) {\n blockHasher?.update(chunk);\n payloadHasher?.update(chunk);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.externalBuffer!.write(chunk);\n\n size += chunk.length;\n }\n\n if (payloadHasher) {\n record.warcHeaders.headers.set(\n \"WARC-Payload-Digest\",\n this.getDigest(payloadHasher),\n );\n }\n\n if (blockHasher) {\n record.warcHeaders.headers.set(\n \"WARC-Block-Digest\",\n this.getDigest(blockHasher),\n );\n }\n\n record.warcHeaders.headers.set(\"Content-Length\", size.toString());\n\n this.warcHeadersBuff = encoder.encode(record.warcHeaders.toString());\n\n this._alreadyDigested = true;\n\n return size;\n }\n\n async *generateRecord() {\n await this.digestRecord();\n\n if (this.warcHeadersBuff) {\n yield this.warcHeadersBuff;\n }\n\n yield CRLF;\n\n if (this.httpHeadersBuff) {\n yield this.httpHeadersBuff;\n }\n\n if (this.externalBuffer) {\n for await (const chunk of this.externalBuffer.readAll()) {\n yield chunk;\n }\n }\n\n yield CRLFCRLF;\n }\n}\n","/*!\n * hash-wasm (https://www.npmjs.com/package/hash-wasm)\n * (c) Dani Biro\n * @license MIT\n */\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\n\nclass Mutex {\n constructor() {\n this.mutex = Promise.resolve();\n }\n lock() {\n let begin = () => { };\n this.mutex = this.mutex.then(() => new Promise(begin));\n return new Promise((res) => {\n begin = res;\n });\n }\n dispatch(fn) {\n return __awaiter(this, void 0, void 0, function* () {\n const unlock = yield this.lock();\n try {\n return yield Promise.resolve(fn());\n }\n finally {\n unlock();\n }\n });\n }\n}\n\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable no-bitwise */\nvar _a;\nfunction getGlobal() {\n if (typeof globalThis !== 'undefined')\n return globalThis;\n // eslint-disable-next-line no-restricted-globals\n if (typeof self !== 'undefined')\n return self;\n if (typeof window !== 'undefined')\n return window;\n return global;\n}\nconst globalObject = getGlobal();\nconst nodeBuffer = (_a = globalObject.Buffer) !== null && _a !== void 0 ? _a : null;\nconst textEncoder = globalObject.TextEncoder ? new globalObject.TextEncoder() : null;\nfunction intArrayToString(arr, len) {\n return String.fromCharCode(...arr.subarray(0, len));\n}\nfunction hexCharCodesToInt(a, b) {\n return (((a & 0xF) + ((a >> 6) | ((a >> 3) & 0x8))) << 4) | ((b & 0xF) + ((b >> 6) | ((b >> 3) & 0x8)));\n}\nfunction writeHexToUInt8(buf, str) {\n const size = str.length >> 1;\n for (let i = 0; i < size; i++) {\n const index = i << 1;\n buf[i] = hexCharCodesToInt(str.charCodeAt(index), str.charCodeAt(index + 1));\n }\n}\nfunction hexStringEqualsUInt8(str, buf) {\n if (str.length !== buf.length * 2) {\n return false;\n }\n for (let i = 0; i < buf.length; i++) {\n const strIndex = i << 1;\n if (buf[i] !== hexCharCodesToInt(str.charCodeAt(strIndex), str.charCodeAt(strIndex + 1))) {\n return false;\n }\n }\n return true;\n}\nconst alpha = 'a'.charCodeAt(0) - 10;\nconst digit = '0'.charCodeAt(0);\nfunction getDigestHex(tmpBuffer, input, hashLength) {\n let p = 0;\n /* eslint-disable no-plusplus */\n for (let i = 0; i < hashLength; i++) {\n let nibble = input[i] >>> 4;\n tmpBuffer[p++] = nibble > 9 ? nibble + alpha : nibble + digit;\n nibble = input[i] & 0xF;\n tmpBuffer[p++] = nibble > 9 ? nibble + alpha : nibble + digit;\n }\n /* eslint-enable no-plusplus */\n return String.fromCharCode.apply(null, tmpBuffer);\n}\nconst getUInt8Buffer = nodeBuffer !== null\n ? (data) => {\n if (typeof data === 'string') {\n const buf = nodeBuffer.from(data, 'utf8');\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.length);\n }\n if (nodeBuffer.isBuffer(data)) {\n return new Uint8Array(data.buffer, data.byteOffset, data.length);\n }\n if (ArrayBuffer.isView(data)) {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n throw new Error('Invalid data type!');\n }\n : (data) => {\n if (typeof data === 'string') {\n return textEncoder.encode(data);\n }\n if (ArrayBuffer.isView(data)) {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n throw new Error('Invalid data type!');\n };\nconst base64Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst base64Lookup = new Uint8Array(256);\nfor (let i = 0; i < base64Chars.length; i++) {\n base64Lookup[base64Chars.charCodeAt(i)] = i;\n}\nfunction encodeBase64(data, pad = true) {\n const len = data.length;\n const extraBytes = len % 3;\n const parts = [];\n const len2 = len - extraBytes;\n for (let i = 0; i < len2; i += 3) {\n const tmp = ((data[i] << 16) & 0xFF0000)\n + ((data[i + 1] << 8) & 0xFF00)\n + (data[i + 2] & 0xFF);\n const triplet = base64Chars.charAt((tmp >> 18) & 0x3F)\n + base64Chars.charAt((tmp >> 12) & 0x3F)\n + base64Chars.charAt((tmp >> 6) & 0x3F)\n + base64Chars.charAt(tmp & 0x3F);\n parts.push(triplet);\n }\n if (extraBytes === 1) {\n const tmp = data[len - 1];\n const a = base64Chars.charAt(tmp >> 2);\n const b = base64Chars.charAt((tmp << 4) & 0x3F);\n parts.push(`${a}${b}`);\n if (pad) {\n parts.push('==');\n }\n }\n else if (extraBytes === 2) {\n const tmp = (data[len - 2] << 8) + data[len - 1];\n const a = base64Chars.charAt(tmp >> 10);\n const b = base64Chars.charAt((tmp >> 4) & 0x3F);\n const c = base64Chars.charAt((tmp << 2) & 0x3F);\n parts.push(`${a}${b}${c}`);\n if (pad) {\n parts.push('=');\n }\n }\n return parts.join('');\n}\nfunction getDecodeBase64Length(data) {\n let bufferLength = Math.floor(data.length * 0.75);\n const len = data.length;\n if (data[len - 1] === '=') {\n bufferLength -= 1;\n if (data[len - 2] === '=') {\n bufferLength -= 1;\n }\n }\n return bufferLength;\n}\nfunction decodeBase64(data) {\n const bufferLength = getDecodeBase64Length(data);\n const len = data.length;\n const bytes = new Uint8Array(bufferLength);\n let p = 0;\n for (let i = 0; i < len; i += 4) {\n const encoded1 = base64Lookup[data.charCodeAt(i)];\n const encoded2 = base64Lookup[data.charCodeAt(i + 1)];\n const encoded3 = base64Lookup[data.charCodeAt(i + 2)];\n const encoded4 = base64Lookup[data.charCodeAt(i + 3)];\n bytes[p] = (encoded1 << 2) | (encoded2 >> 4);\n p += 1;\n bytes[p] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n p += 1;\n bytes[p] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n p += 1;\n }\n return bytes;\n}\n\nconst MAX_HEAP = 16 * 1024;\nconst WASM_FUNC_HASH_LENGTH = 4;\nconst wasmMutex = new Mutex();\nconst wasmModuleCache = new Map();\nfunction WASMInterface(binary, hashLength) {\n return __awaiter(this, void 0, void 0, function* () {\n let wasmInstance = null;\n let memoryView = null;\n let initialized = false;\n if (typeof WebAssembly === 'undefined') {\n throw new Error('WebAssembly is not supported in this environment!');\n }\n const writeMemory = (data, offset = 0) => {\n memoryView.set(data, offset);\n };\n const getMemory = () => memoryView;\n const getExports = () => wasmInstance.exports;\n const setMemorySize = (totalSize) => {\n wasmInstance.exports.Hash_SetMemorySize(totalSize);\n const arrayOffset = wasmInstance.exports.Hash_GetBuffer();\n const memoryBuffer = wasmInstance.exports.memory.buffer;\n memoryView = new Uint8Array(memoryBuffer, arrayOffset, totalSize);\n };\n const getStateSize = () => {\n const view = new DataView(wasmInstance.exports.memory.buffer);\n const stateSize = view.getUint32(wasmInstance.exports.STATE_SIZE, true);\n return stateSize;\n };\n const loadWASMPromise = wasmMutex.dispatch(() => __awaiter(this, void 0, void 0, function* () {\n if (!wasmModuleCache.has(binary.name)) {\n const asm = decodeBase64(binary.data);\n const promise = WebAssembly.compile(asm);\n wasmModuleCache.set(binary.name, promise);\n }\n const module = yield wasmModuleCache.get(binary.name);\n wasmInstance = yield WebAssembly.instantiate(module, {\n // env: {\n // emscripten_memcpy_big: (dest, src, num) => {\n // const memoryBuffer = wasmInstance.exports.memory.buffer;\n // const memView = new Uint8Array(memoryBuffer, 0);\n // memView.set(memView.subarray(src, src + num), dest);\n // },\n // print_memory: (offset, len) => {\n // const memoryBuffer = wasmInstance.exports.memory.buffer;\n // const memView = new Uint8Array(memoryBuffer, 0);\n // console.log('print_int32', memView.subarray(offset, offset + len));\n // },\n // },\n });\n // wasmInstance.exports._start();\n }));\n const setupInterface = () => __awaiter(this, void 0, void 0, function* () {\n if (!wasmInstance) {\n yield loadWASMPromise;\n }\n const arrayOffset = wasmInstance.exports.Hash_GetBuffer();\n const memoryBuffer = wasmInstance.exports.memory.buffer;\n memoryView = new Uint8Array(memoryBuffer, arrayOffset, MAX_HEAP);\n });\n const init = (bits = null) => {\n initialized = true;\n wasmInstance.exports.Hash_Init(bits);\n };\n const updateUInt8Array = (data) => {\n let read = 0;\n while (read < data.length) {\n const chunk = data.subarray(read, read + MAX_HEAP);\n read += chunk.length;\n memoryView.set(chunk);\n wasmInstance.exports.Hash_Update(chunk.length);\n }\n };\n const update = (data) => {\n if (!initialized) {\n throw new Error('update() called before init()');\n }\n const Uint8Buffer = getUInt8Buffer(data);\n updateUInt8Array(Uint8Buffer);\n };\n const digestChars = new Uint8Array(hashLength * 2);\n const digest = (outputType, padding = null) => {\n if (!initialized) {\n throw new Error('digest() called before init()');\n }\n initialized = false;\n wasmInstance.exports.Hash_Final(padding);\n if (outputType === 'binary') {\n // the data is copied to allow GC of the original memory object\n return memoryView.slice(0, hashLength);\n }\n return getDigestHex(digestChars, memoryView, hashLength);\n };\n const save = () => {\n if (!initialized) {\n throw new Error('save() can only be called after init() and before digest()');\n }\n const stateOffset = wasmInstance.exports.Hash_GetState();\n const stateLength = getStateSize();\n const memoryBuffer = wasmInstance.exports.memory.buffer;\n const internalState = new Uint8Array(memoryBuffer, stateOffset, stateLength);\n // prefix is 4 bytes from SHA1 hash of the WASM binary\n // it is used to detect incompatible internal states between different versions of hash-wasm\n const prefixedState = new Uint8Array(WASM_FUNC_HASH_LENGTH + stateLength);\n writeHexToUInt8(prefixedState, binary.hash);\n prefixedState.set(internalState, WASM_FUNC_HASH_LENGTH);\n return prefixedState;\n };\n const load = (state) => {\n if (!(state instanceof Uint8Array)) {\n throw new Error('load() expects an Uint8Array generated by save()');\n }\n const stateOffset = wasmInstance.exports.Hash_GetState();\n const stateLength = getStateSize();\n const overallLength = WASM_FUNC_HASH_LENGTH + stateLength;\n const memoryBuffer = wasmInstance.exports.memory.buffer;\n if (state.length !== overallLength) {\n throw new Error(`Bad state length (expected ${overallLength} bytes, got ${state.length})`);\n }\n if (!hexStringEqualsUInt8(binary.hash, state.subarray(0, WASM_FUNC_HASH_LENGTH))) {\n throw new Error('This state was written by an incompatible hash implementation');\n }\n const internalState = state.subarray(WASM_FUNC_HASH_LENGTH);\n new Uint8Array(memoryBuffer, stateOffset, stateLength).set(internalState);\n initialized = true;\n };\n const isDataShort = (data) => {\n if (typeof data === 'string') {\n // worst case is 4 bytes / char\n return data.length < MAX_HEAP / 4;\n }\n return data.byteLength < MAX_HEAP;\n };\n let canSimplify = isDataShort;\n switch (binary.name) {\n case 'argon2':\n case 'scrypt':\n canSimplify = () => true;\n break;\n case 'blake2b':\n case 'blake2s':\n // if there is a key at blake2 then cannot simplify\n canSimplify = (data, initParam) => initParam <= 512 && isDataShort(data);\n break;\n case 'blake3':\n // if there is a key at blake3 then cannot simplify\n canSimplify = (data, initParam) => initParam === 0 && isDataShort(data);\n break;\n case 'xxhash64': // cannot simplify\n case 'xxhash3':\n case 'xxhash128':\n canSimplify = () => false;\n break;\n }\n // shorthand for (init + update + digest) for better performance\n const calculate = (data, initParam = null, digestParam = null) => {\n if (!canSimplify(data, initParam)) {\n init(initParam);\n update(data);\n return digest('hex', digestParam);\n }\n const buffer = getUInt8Buffer(data);\n memoryView.set(buffer);\n wasmInstance.exports.Hash_Calculate(buffer.length, initParam, digestParam);\n return getDigestHex(digestChars, memoryView, hashLength);\n };\n yield setupInterface();\n return {\n getMemory,\n writeMemory,\n getExports,\n setMemorySize,\n init,\n update,\n digest,\n save,\n load,\n calculate,\n hashLength,\n };\n });\n}\n\nvar name$k = \"adler32\";\nvar data$k = \"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAgQFAXABAQEFBAEBAgIGDgJ/AUGAiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUA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xqKAIAIgFB/wFxaiIEaiAEIAFBCHZB/wFxaiIEaiAEIAFBEHZB/wFxaiIEaiAEIAFBGHZqIgJqIQMgBkEQaiEGIABBcGoiAEEPSw0ACyAARQ0BCwNAIAIgBi0AAGoiAiADaiEDIAZBAWohBiAAQX9qIgANAAsLIANB8f8DcCEDIAJB8f8DcCECCyACIANBEHRyIQELQQAgATYChAgLMgEBf0EAQQAoAoQIIgBBGHQgAEEIdEGAgPwHcXIgAEEIdkGA/gNxIABBGHZycjYCgAkLBQBBhAgLPABBAEEBNgKECCAAEAJBAEEAKAKECCIAQRh0IABBCHRBgID8B3FyIABBCHZBgP4DcSAAQRh2cnI2AoAJCwsVAgBBgAgLBAQAAAAAQYQICwQBAAAA\";\nvar hash$k = \"321174b4\";\nvar wasmJson$k = {\n\tname: name$k,\n\tdata: data$k,\n\thash: hash$k\n};\n\nfunction lockedCreate(mutex, binary, hashLength) {\n return __awaiter(this, void 0, void 0, function* () {\n const unlock = yield mutex.lock();\n const wasm = yield WASMInterface(binary, hashLength);\n unlock();\n return wasm;\n });\n}\n\nconst mutex$l = new Mutex();\nlet wasmCache$l = null;\n/**\n * Calculates Adler-32 hash. The resulting 32-bit hash is stored in\n * network byte order (big-endian).\n *\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction adler32(data) {\n if (wasmCache$l === null) {\n return lockedCreate(mutex$l, wasmJson$k, 4)\n .then((wasm) => {\n wasmCache$l = wasm;\n return wasmCache$l.calculate(data);\n });\n }\n try {\n const hash = wasmCache$l.calculate(data);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new Adler-32 hash instance\n */\nfunction createAdler32() {\n return WASMInterface(wasmJson$k, 4).then((wasm) => {\n wasm.init();\n const obj = {\n init: () => { wasm.init(); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 4,\n digestSize: 4,\n };\n return obj;\n });\n}\n\nvar name$j = \"blake2b\";\nvar data$j = \"AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwoJAAECAwECAgABBAUBcAEBAQUEAQECAgYOAn8BQbCLBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAApIYXNoX0ZpbmFsAAMJSGFzaF9Jbml0AAULSGFzaF9VcGRhdGUABg1IYXNoX0dldFN0YXRlAAcOSGFzaF9DYWxjdWxhdGUACApTVEFURV9TSVpFAwEKjzkJBQBBgAkL5QICBH8BfgJAIAFBAUgNAAJAAkACQEGAAUEAKALgigEiAmsiAyABSA0AIAEhAwwBC0EAQQA2AuCKAQJAIAJB/wBKDQBBACEEQQAhBQNAIAQgAmpB4IkBaiAAIARqLQAAOgAAIAMgBUEBaiIFQf8BcSIESg0ACwtBAEEAKQPAiQEiBkKAAXw3A8CJAUEAQQApA8iJASAGQv9+Vq18NwPIiQFB4IkBEAIgACADaiEAAkAgASADayIDQYEBSA0AIAIgAWohBANAQQBBACkDwIkBIgZCgAF8NwPAiQFBAEEAKQPIiQEgBkL/flatfDcDyIkBIAAQAiAAQYABaiEAIARBgH9qIgRBgAJKDQALIARBgH9qIQMLIANBAUgNAQtBACEEQQAhBQNAQQAoAuCKASAEakHgiQFqIAAgBGotAAA6AAAgAyAFQQFqIgVB/wFxIgRKDQALC0EAQQAoAuCKASADajYC4IoBCwu/LgEkfkEAIAApA2AiASAAKQNAIgIgACkDSCIDIAIgACkDGCIEIAApA1giBSAAKQMgIgYgAiAAKQMQIgcgASADIAApAwAiCCAAKQNwIgkgACkDOCIKIAggACkDeCILIAApA2giDCAGIAApA1AiDSAAKQMIIg4gCSAKIAApAzAiDyAHIA4gBCAJIA0gCCABIAEgDiACIAYgAyACIAQgB0EAKQOoiQEiEEEAKQOIiQF8fCIRfEEAKQPIiQEgEYVCn9j52cKR2oKbf4VCIIkiEUK7zqqm2NDr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QQApA5CLAULRhZrv+s+Uh9EAhTcDoIkBQQBBACkDmIsBQp/Y+dnCkdqCm3+FNwOoiQFBAEEAKQOgiwFC6/qG2r+19sEfhTcDsIkBQQBBACkDqIsBQvnC+JuRo7Pw2wCFNwO4iQFBACAFp0H/AXE2AuSKAQJAIAFBAUgNACACQgA3A3ggAkIANwNwIAJCADcDaCACQgA3A2AgAkIANwNYIAJCADcDUCACQgA3A0ggAkIANwNAIAJCADcDOCACQgA3AzAgAkIANwMoIAJCADcDICACQgA3AxggAkIANwMQIAJCADcDCCACQgA3AwBBACEDA0AgAiAAaiAAQYAJai0AADoAACADQQFqIgNB/wFxIgAgAUgNAAsgAkGAARABCyACQYABaiQACxIAIABBA3ZB/z9xIABBEHYQBAsJAEGACSAAEAELBgBBgIkBCxsAIAFBA3ZB/z9xIAFBEHYQBEGACSAAEAEQAwsLCwEAQYAICwTwAAAA\";\nvar hash$j = \"68afc9cf\";\nvar wasmJson$j = {\n\tname: name$j,\n\tdata: data$j,\n\thash: hash$j\n};\n\nconst mutex$k = new Mutex();\nlet wasmCache$k = null;\nfunction validateBits$4(bits) {\n if (!Number.isInteger(bits) || bits < 8 || bits > 512 || bits % 8 !== 0) {\n return new Error('Invalid variant! Valid values: 8, 16, ..., 512');\n }\n return null;\n}\nfunction getInitParam$1(outputBits, keyBits) {\n // eslint-disable-next-line no-bitwise\n return outputBits | (keyBits << 16);\n}\n/**\n * Calculates BLAKE2b hash\n * @param data Input data (string, Buffer or TypedArray)\n * @param bits Number of output bits, which has to be a number\n * divisible by 8, between 8 and 512. Defaults to 512.\n * @param key Optional key (string, Buffer or TypedArray). Maximum length is 64 bytes.\n * @returns Computed hash as a hexadecimal string\n */\nfunction blake2b(data, bits = 512, key = null) {\n if (validateBits$4(bits)) {\n return Promise.reject(validateBits$4(bits));\n }\n let keyBuffer = null;\n let initParam = bits;\n if (key !== null) {\n keyBuffer = getUInt8Buffer(key);\n if (keyBuffer.length > 64) {\n return Promise.reject(new Error('Max key length is 64 bytes'));\n }\n initParam = getInitParam$1(bits, keyBuffer.length);\n }\n const hashLength = bits / 8;\n if (wasmCache$k === null || wasmCache$k.hashLength !== hashLength) {\n return lockedCreate(mutex$k, wasmJson$j, hashLength)\n .then((wasm) => {\n wasmCache$k = wasm;\n if (initParam > 512) {\n wasmCache$k.writeMemory(keyBuffer);\n }\n return wasmCache$k.calculate(data, initParam);\n });\n }\n try {\n if (initParam > 512) {\n wasmCache$k.writeMemory(keyBuffer);\n }\n const hash = wasmCache$k.calculate(data, initParam);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new BLAKE2b hash instance\n * @param bits Number of output bits, which has to be a number\n * divisible by 8, between 8 and 512. Defaults to 512.\n * @param key Optional key (string, Buffer or TypedArray). Maximum length is 64 bytes.\n */\nfunction createBLAKE2b(bits = 512, key = null) {\n if (validateBits$4(bits)) {\n return Promise.reject(validateBits$4(bits));\n }\n let keyBuffer = null;\n let initParam = bits;\n if (key !== null) {\n keyBuffer = getUInt8Buffer(key);\n if (keyBuffer.length > 64) {\n return Promise.reject(new Error('Max key length is 64 bytes'));\n }\n initParam = getInitParam$1(bits, keyBuffer.length);\n }\n const outputSize = bits / 8;\n return WASMInterface(wasmJson$j, outputSize).then((wasm) => {\n if (initParam > 512) {\n wasm.writeMemory(keyBuffer);\n }\n wasm.init(initParam);\n const obj = {\n init: initParam > 512\n ? () => {\n wasm.writeMemory(keyBuffer);\n wasm.init(initParam);\n return obj;\n }\n : () => {\n wasm.init(initParam);\n return obj;\n },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 128,\n digestSize: outputSize,\n };\n return obj;\n });\n}\n\nvar name$i = \"argon2\";\nvar data$i = \"AGFzbQEAAAABKQVgAX8Bf2AAAX9gEH9/f39/f39/f39/f39/f38AYAR/f39/AGACf38AAwYFAAECAwQEBQFwAQEBBQ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iETcDACAKIBEgCikDACISfCASQgGGQv7///8fgyAQQiCIfnwiEDcDACAGIBAgBikDAIUiEEIoiSIRNwMAIAIgESACKQMAIhJ8IBBCGIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIUiEEIwiSIRNwMAIAogESAKKQMAIhJ8IBBCEIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAGIBAgBikDAIVCAYk3AwAgAyAHKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFIhBCIIkiETcDACALIBEgCykDACISfCASQgGGQv7///8fgyAQQiCIfnwiEDcDACAHIBAgBykDAIUiEEIoiSIRNwMAIAMgESADKQMAIhJ8IBBCGIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIUiEEIwiSIRNwMAIAsgESALKQMAIhJ8IBBCEIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgACAFKQMAIhAgACkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFIhBCIIkiETcDACAKIBEgCikDACISfCASQgGGQv7///8fgyAQQiCIfnwiEDcDACAFIBAgBSkDAIUiEEIoiSIRNwMAIAAgESAAKQMAIhJ8IBBCGIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIUiEEIwiSIRNwMAIAogESAKKQMAIhJ8IBBCEIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAFIBAgBSkDAIVCAYk3AwAgASAGKQMAIhAgASkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDCAQIAwpAwCFIhBCIIkiETcDACALIBEgCykDACISfCASQgGGQv7///8fgyAQQiCIfnwiEDcDACAGIBAgBikDAIUiEEIoiSIRNwMAIAEgESABKQMAIhJ8IBBCGIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAMIBAgDCkDAIUiEEIwiSIRNwMAIAsgESALKQMAIhJ8IBBCEIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAGIBAgBikDAIVCAYk3AwAgAiAHKQMAIhAgAikDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDSAQIA0pAwCFIhBCIIkiETcDACAIIBEgCCkDACISfCASQgGGQv7///8fgyAQQiCIfnwiEDcDACAHIBAgBykDAIUiEEIoiSIRNwMAIAIgESACKQMAIhJ8IBBCGIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACANIBAgDSkDAIUiEEIwiSIRNwMAIAggESAIKQMAIhJ8IBBCEIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgAyAEKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDiAQIA4pAwCFIhBCIIkiETcDACAJIBEgCSkDACISfCASQgGGQv7///8fgyAQQiCIfnwiEDcDACAEIBAgBCkDAIUiEEIoiSIRNwMAIAMgESADKQMAIhJ8IBBCGIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIUiEEIwiSIRNwMAIAkgESAJKQMAIhJ8IBBCEIhC/////w+DIBJCAYZC/v///x+DfnwiEDcDACAEIBAgBCkDAIVCAYk3AwALhxoBAX9BACEEQQAgAikDACABKQMAhTcDkAhBACACKQMIIAEpAwiFNwOYCEEAIAIpAxAgASkDEIU3A6AIQQAgAikDGCABKQMYhTcDqAhBACACKQMgIAEpAyCFNwOwCEEAIAIpAyggASkDKIU3A7gIQQAgAikDMCABKQMwhTcDwAhBACACKQM4IAEpAziFNwPICEEAIAIpA0AgASkDQIU3A9AIQQAgAikDSCABKQNIhTcD2AhBACACKQNQIAEpA1CFNwPgCEEAIAIpA1ggASkDWIU3A+gIQQAgAikDYCABKQNghTcD8AhBACACKQNoIAEpA2iFNwP4CEEAIAIpA3AgASkDcIU3A4AJQQAgAikDeCABKQN4hTcDiAlBACACKQOAASABKQOAAYU3A5AJQQAgAikDiAEgASkDiAG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MAIAFB+AdJIQMgAUEIaiEBIAMNAAsLCw==\";\nvar hash$i = \"59aa4fb4\";\nvar wasmJson$i = {\n\tname: name$i,\n\tdata: data$i,\n\thash: hash$i\n};\n\nfunction encodeResult(salt, options, res) {\n const parameters = [\n `m=${options.memorySize}`,\n `t=${options.iterations}`,\n `p=${options.parallelism}`,\n ].join(',');\n return `$argon2${options.hashType}$v=19$${parameters}$${encodeBase64(salt, false)}$${encodeBase64(res, false)}`;\n}\nconst uint32View = new DataView(new ArrayBuffer(4));\nfunction int32LE(x) {\n uint32View.setInt32(0, x, true);\n return new Uint8Array(uint32View.buffer);\n}\nfunction hashFunc(blake512, buf, len) {\n return __awaiter(this, void 0, void 0, function* () {\n if (len <= 64) {\n const blake = yield createBLAKE2b(len * 8);\n blake.update(int32LE(len));\n blake.update(buf);\n return blake.digest('binary');\n }\n const r = Math.ceil(len / 32) - 2;\n const ret = new Uint8Array(len);\n blake512.init();\n blake512.update(int32LE(len));\n blake512.update(buf);\n let vp = blake512.digest('binary');\n ret.set(vp.subarray(0, 32), 0);\n for (let i = 1; i < r; i++) {\n blake512.init();\n blake512.update(vp);\n vp = blake512.digest('binary');\n ret.set(vp.subarray(0, 32), i * 32);\n }\n const partialBytesNeeded = len - 32 * r;\n let blakeSmall;\n if (partialBytesNeeded === 64) {\n blakeSmall = blake512;\n blakeSmall.init();\n }\n else {\n blakeSmall = yield createBLAKE2b(partialBytesNeeded * 8);\n }\n blakeSmall.update(vp);\n vp = blakeSmall.digest('binary');\n ret.set(vp.subarray(0, partialBytesNeeded), r * 32);\n return ret;\n });\n}\nfunction getHashType(type) {\n switch (type) {\n case 'd':\n return 0;\n case 'i':\n return 1;\n default:\n return 2;\n }\n}\nfunction argon2Internal(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { parallelism, iterations, hashLength } = options;\n const password = getUInt8Buffer(options.password);\n const salt = getUInt8Buffer(options.salt);\n const version = 0x13;\n const hashType = getHashType(options.hashType);\n const { memorySize } = options; // in KB\n const [argon2Interface, blake512] = yield Promise.all([\n WASMInterface(wasmJson$i, 1024),\n createBLAKE2b(512),\n ]);\n // last block is for storing the init vector\n argon2Interface.setMemorySize(memorySize * 1024 + 1024);\n const initVector = new Uint8Array(24);\n const initVectorView = new DataView(initVector.buffer);\n initVectorView.setInt32(0, parallelism, true);\n initVectorView.setInt32(4, hashLength, true);\n initVectorView.setInt32(8, memorySize, true);\n initVectorView.setInt32(12, iterations, true);\n initVectorView.setInt32(16, version, true);\n initVectorView.setInt32(20, hashType, true);\n argon2Interface.writeMemory(initVector, memorySize * 1024);\n blake512.init();\n blake512.update(initVector);\n blake512.update(int32LE(password.length));\n blake512.update(password);\n blake512.update(int32LE(salt.length));\n blake512.update(salt);\n blake512.update(int32LE(0)); // key length + key\n blake512.update(int32LE(0)); // associatedData length + associatedData\n const segments = Math.floor(memorySize / (parallelism * 4)); // length of each lane\n const lanes = segments * 4;\n const param = new Uint8Array(72);\n const H0 = blake512.digest('binary');\n param.set(H0);\n for (let lane = 0; lane < parallelism; lane++) {\n param.set(int32LE(0), 64);\n param.set(int32LE(lane), 68);\n let position = lane * lanes;\n let chunk = yield hashFunc(blake512, param, 1024);\n argon2Interface.writeMemory(chunk, position * 1024);\n position += 1;\n param.set(int32LE(1), 64);\n chunk = yield hashFunc(blake512, param, 1024);\n argon2Interface.writeMemory(chunk, position * 1024);\n }\n const C = new Uint8Array(1024);\n writeHexToUInt8(C, argon2Interface.calculate(new Uint8Array([]), memorySize));\n const res = yield hashFunc(blake512, C, hashLength);\n if (options.outputType === 'hex') {\n const digestChars = new Uint8Array(hashLength * 2);\n return getDigestHex(digestChars, res, hashLength);\n }\n if (options.outputType === 'encoded') {\n return encodeResult(salt, options, res);\n }\n // return binary format\n return res;\n });\n}\nconst validateOptions$3 = (options) => {\n if (!options || typeof options !== 'object') {\n throw new Error('Invalid options parameter. It requires an object.');\n }\n if (!options.password) {\n throw new Error('Password must be specified');\n }\n options.password = getUInt8Buffer(options.password);\n if (options.password.length < 1) {\n throw new Error('Password must be specified');\n }\n if (!options.salt) {\n throw new Error('Salt must be specified');\n }\n options.salt = getUInt8Buffer(options.salt);\n if (options.salt.length < 8) {\n throw new Error('Salt should be at least 8 bytes long');\n }\n if (!Number.isInteger(options.iterations) || options.iterations < 1) {\n throw new Error('Iterations should be a positive number');\n }\n if (!Number.isInteger(options.parallelism) || options.parallelism < 1) {\n throw new Error('Parallelism should be a positive number');\n }\n if (!Number.isInteger(options.hashLength) || options.hashLength < 4) {\n throw new Error('Hash length should be at least 4 bytes.');\n }\n if (!Number.isInteger(options.memorySize)) {\n throw new Error('Memory size should be specified.');\n }\n if (options.memorySize < 8 * options.parallelism) {\n throw new Error('Memory size should be at least 8 * parallelism.');\n }\n if (options.outputType === undefined) {\n options.outputType = 'hex';\n }\n if (!['hex', 'binary', 'encoded'].includes(options.outputType)) {\n throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary', 'encoded']`);\n }\n};\n/**\n * Calculates hash using the argon2i password-hashing function\n * @returns Computed hash\n */\nfunction argon2i(options) {\n return __awaiter(this, void 0, void 0, function* () {\n validateOptions$3(options);\n return argon2Internal(Object.assign(Object.assign({}, options), { hashType: 'i' }));\n });\n}\n/**\n * Calculates hash using the argon2id password-hashing function\n * @returns Computed hash\n */\nfunction argon2id(options) {\n return __awaiter(this, void 0, void 0, function* () {\n validateOptions$3(options);\n return argon2Internal(Object.assign(Object.assign({}, options), { hashType: 'id' }));\n });\n}\n/**\n * Calculates hash using the argon2d password-hashing function\n * @returns Computed hash\n */\nfunction argon2d(options) {\n return __awaiter(this, void 0, void 0, function* () {\n validateOptions$3(options);\n return argon2Internal(Object.assign(Object.assign({}, options), { hashType: 'd' }));\n });\n}\nconst getHashParameters = (password, encoded) => {\n const regex = /^\\$argon2(id|i|d)\\$v=([0-9]+)\\$((?:[mtp]=[0-9]+,){2}[mtp]=[0-9]+)\\$([A-Za-z0-9+/]+)\\$([A-Za-z0-9+/]+)$/;\n const match = encoded.match(regex);\n if (!match) {\n throw new Error('Invalid hash');\n }\n const [, hashType, version, parameters, salt, hash] = match;\n if (version !== '19') {\n throw new Error(`Unsupported version: ${version}`);\n }\n const parsedParameters = {};\n const paramMap = { m: 'memorySize', p: 'parallelism', t: 'iterations' };\n parameters.split(',').forEach((x) => {\n const [n, v] = x.split('=');\n parsedParameters[paramMap[n]] = parseInt(v, 10);\n });\n return Object.assign(Object.assign({}, parsedParameters), { password, hashType: hashType, salt: decodeBase64(salt), hashLength: getDecodeBase64Length(hash), outputType: 'encoded' });\n};\nconst validateVerifyOptions$1 = (options) => {\n if (!options || typeof options !== 'object') {\n throw new Error('Invalid options parameter. It requires an object.');\n }\n if (options.hash === undefined || typeof options.hash !== 'string') {\n throw new Error('Hash should be specified');\n }\n};\n/**\n * Verifies password using the argon2 password-hashing function\n * @returns True if the encoded hash matches the password\n */\nfunction argon2Verify(options) {\n return __awaiter(this, void 0, void 0, function* () {\n validateVerifyOptions$1(options);\n const params = getHashParameters(options.password, options.hash);\n validateOptions$3(params);\n const hashStart = options.hash.lastIndexOf('$') + 1;\n const result = yield argon2Internal(params);\n return result.substring(hashStart) === options.hash.substring(hashStart);\n });\n}\n\nvar name$h = \"blake2s\";\nvar data$h = \"AGFzbQEAAAABEQRgAAF/YAJ/fwBgAX8AYAAAAwkIAAECAwICAAEEBQFwAQEBBQQBAQICBg4CfwFBoIoFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACkhhc2hfRmluYWwAAwlIYXNoX0luaXQABAtIYXNoX1VwZGF0ZQAFDUhhc2hfR2V0U3RhdGUABg5IYXNoX0NhbGN1bGF0ZQAHClNUQVRFX1NJWkUDAQqhMAgFAEGACQvjAgEFfwJAIAFBAUgNAEEAIQICQAJAAkBBwABBACgC8IkBIgNrIgQgAUgNACABIQUMAQtBAEEANgLwiQECQCAERQ0AIANBMGohBSAAIQYDQCAFQYCJAWogBi0AADoAACAGQQFqIQYgBUEBaiIFQfAARw0ACwtBAEEA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be3M2AoSJAUEAQQAoAoiKAUHy5rvjA3M2AoiJAUEAQQAoAoyKAUG66r+qenM2AoyJAUEAQQAoApCKAUH/pLmIBXM2ApCJAUEAQQAoApSKAUGM0ZXYeXM2ApSJAUEAQQAoApiKAUGrs4/8AXM2ApiJAUEAIANB/wFxNgL0iQFBAEEAKAKcigFBmZqD3wVzNgKciQECQCACRQ0AIAFBOGpCADcDACABQTBqQgA3AwAgAUEoakIANwMAIAFBIGpCADcDACABQRhqQgA3AwAgAUEQakIANwMAIAFCADcDCCABQgA3AwBBACEDA0AgASAAaiAAQYAJai0AADoAACACIANBAWoiA0H/AXEiAEsNAAsgAUHAABABCyABQcAAaiQACwkAQYAJIAAQAQsGAEGAiQELDwAgARAEQYAJIAAQARADCwsLAQBBgAgLBHwAAAA=\";\nvar hash$h = \"0f570f49\";\nvar wasmJson$h = {\n\tname: name$h,\n\tdata: data$h,\n\thash: hash$h\n};\n\nconst mutex$j = new Mutex();\nlet wasmCache$j = null;\nfunction validateBits$3(bits) {\n if (!Number.isInteger(bits) || bits < 8 || bits > 256 || bits % 8 !== 0) {\n return new Error('Invalid variant! Valid values: 8, 16, ..., 256');\n }\n return null;\n}\nfunction getInitParam(outputBits, keyBits) {\n // eslint-disable-next-line no-bitwise\n return outputBits | (keyBits << 16);\n}\n/**\n * Calculates BLAKE2s hash\n * @param data Input data (string, Buffer or TypedArray)\n * @param bits Number of output bits, which has to be a number\n * divisible by 8, between 8 and 256. Defaults to 256.\n * @param key Optional key (string, Buffer or TypedArray). Maximum length is 32 bytes.\n * @returns Computed hash as a hexadecimal string\n */\nfunction blake2s(data, bits = 256, key = null) {\n if (validateBits$3(bits)) {\n return Promise.reject(validateBits$3(bits));\n }\n let keyBuffer = null;\n let initParam = bits;\n if (key !== null) {\n keyBuffer = getUInt8Buffer(key);\n if (keyBuffer.length > 32) {\n return Promise.reject(new Error('Max key length is 32 bytes'));\n }\n initParam = getInitParam(bits, keyBuffer.length);\n }\n const hashLength = bits / 8;\n if (wasmCache$j === null || wasmCache$j.hashLength !== hashLength) {\n return lockedCreate(mutex$j, wasmJson$h, hashLength)\n .then((wasm) => {\n wasmCache$j = wasm;\n if (initParam > 512) {\n wasmCache$j.writeMemory(keyBuffer);\n }\n return wasmCache$j.calculate(data, initParam);\n });\n }\n try {\n if (initParam > 512) {\n wasmCache$j.writeMemory(keyBuffer);\n }\n const hash = wasmCache$j.calculate(data, initParam);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new BLAKE2s hash instance\n * @param bits Number of output bits, which has to be a number\n * divisible by 8, between 8 and 256. Defaults to 256.\n * @param key Optional key (string, Buffer or TypedArray). Maximum length is 32 bytes.\n */\nfunction createBLAKE2s(bits = 256, key = null) {\n if (validateBits$3(bits)) {\n return Promise.reject(validateBits$3(bits));\n }\n let keyBuffer = null;\n let initParam = bits;\n if (key !== null) {\n keyBuffer = getUInt8Buffer(key);\n if (keyBuffer.length > 32) {\n return Promise.reject(new Error('Max key length is 32 bytes'));\n }\n initParam = getInitParam(bits, keyBuffer.length);\n }\n const outputSize = bits / 8;\n return WASMInterface(wasmJson$h, outputSize).then((wasm) => {\n if (initParam > 512) {\n wasm.writeMemory(keyBuffer);\n }\n wasm.init(initParam);\n const obj = {\n init: initParam > 512\n ? () => {\n wasm.writeMemory(keyBuffer);\n wasm.init(initParam);\n return obj;\n }\n : () => {\n wasm.init(initParam);\n return obj;\n },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 64,\n digestSize: outputSize,\n };\n return obj;\n });\n}\n\nvar name$g = \"blake3\";\nvar data$g = \"AGFzbQEAAAABJQZgAAF/YAF/AGADf39/AGAGf39/f35/AGABfgBgBX9/fn9/AX8DDQwAAQIDBAUBAQEBAAIEBQFwAQEBBQQBAQICBg4CfwFBgJgFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dld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A8CJAUEAQQA7AYiKASACQYAJaiEDCwJAIABBgQhJDQBBACkDwIkBIQQgAUEoaiEPA0AgBEIKhiEKQgEgAEEBcq15Qj+FhqchAgNAIAIiEEEBdiECIAogEEF/aq2DQgBSDQALIBBBCnatIQ0CQAJAIBBBgAhLDQAgAUEAOwHYASABQgA3A9ABIAFCADcDyAEgAUIANwPAASABQgA3A7gBIAFCADcDsAEgAUIANwOoASABQgA3A6ABIAFCADcDmAEgAUEAKQOAiQE3A3AgAUEAKQOIiQE3A3ggAUEAKQOQiQE3A4ABIAFBAC0AiooBOgDaASABQQApA5iJATcDiAEgASAENwOQASABQfAAaiADIBAQAiABIAEpA3AiBDcDACABIAEpA3giBTcDCCABIAEpA4ABIgY3AxAgASABKQOIASIHNwMYIAEgASkDmAE3AyggASABKQOgATcDMCABIAEpA6gBNwM4IAEtANoBIQIgAS0A2QEhCyABKQOQASEKIAEgAS0A2AEiCDoAaCABIAo3AyAgASABKQOwATcDQCABIAEpA7gBNwNIIAEgASkDwAE3A1AgASABKQPIATcDWCABIAEpA9ABNwNgIAEgAiALRXJBAnIiAjoAaSABIAc3A/gBIAEgBjcD8AEgASAFNwPoASABIAQ3A+ABIAFBgAJqIAFB4AFqIA8gCCAKIAJB/wFxEAMgASkDoAIhBCABKQOAAiEFIAEpA6gCIQYgASkDiAIhByABKQOwAiEMIAEpA5ACIQ4gASkDuAIhESABKQOYAiESIAoQBEEAQQAtAJCKASICQQFqOgCQigEgAkEFdCICQamKAWogESAShTcDACACQaGKAWogDCAOhTcDACACQZmKAWogBiAHhTcDACACQZGKAWogBCAFhTcDAAwBCwJAAkAgAyAQIARBAC0AiooBIgIgAUHwAGoQBSITQQJLDQAgASkDiAEhCiABKQOAASEEIAEpA3ghBSABKQNwIQYMAQsgAkEEciEUA0AgE0F+akEBdiIVQQFqIQggAUHIAmohAiABQfAAaiELA0AgAiALNgIAIAtBwABqIQsgAkEEaiECIAhBf2oiCA0ACyABIQIgAUHIAmohCyAVQQFqIhY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wOoAiAFQYABaiAFQZACaiADQcAAQgAgARADIAUpA6ABIQIgBSkDgAEhCSAFKQOoASEKIAUpA4gBIQsgBSkDsAEhDCAFKQOQASETIAhBGGogBSkDuAEgBSkDmAGFNwMAIAhBEGogDCAThTcDACAIQQhqIAogC4U3AwAgCCACIAmFNwMAIAhBIGohCCAHQQRqIQcgDUF/aiINDQALIABBfnEhDQsgDSAATw0AIAQgBkEFdGoiCCAFIAZBBnRqIgcpAwA3AwAgCCAHKQMINwMIIAggBykDEDcDECAIIAcpAxg3AxggBkEBaiEGCyAFQdACaiQAIAYLvREIAn8EfgF/AX4EfwN+An8BfiMAQfABayIBJAACQCAARQ0AAkBBAC0AkIoBIgINACABQTBqQQApA9CJATcDACABQThqQQApA9iJATcDACABQQApA6CJASIDNwMAIAFBACkDqIkBIgQ3AwggAUEAKQOwiQEiBTcDECABQQApA7iJASIGNwMYIAFBACkDyIkBNwMoQQAtAIqKASECQQAtAImKASEHQQApA8CJASEIQQAtAIiKASEJIAFBwABqQQApA+CJATcDACABQcgAakEAKQPoiQE3AwAgAUHQAGpBACkD8IkBNwMAIAFB2ABqQQApA/iJATcDACABQeAAakEAKQOAigE3AwAgASAJOgBoIAEgCDcDICABIAIgB0VyQQJyIgI6AGkgAUHwAGpBAXIhCiABQShqIQtCACEIQYAJIQwDQCABQbABaiABIAsgCUH/AXEgCCACQQhyQf8BcRADIAEgASkD2AEiDSABKQO4AYU3A3ggASABKQPgASIOIAEpA8ABhTcDgAEgASAGIAEpA+gBIg+FNwOoASABIAUgDoU3A6ABIAEgBCANhTcDmAEgASADIAEpA9ABIg2FNwOQASABIA8gASkDyAGFNwOIASAAQcAAIABBwABJGyIQQX9qIQkgASANIAEpA7ABhSINNwNwIA2nIREgCiEHIAwhAgJAA0AgAiAROgAAIAlFDQEgCUF/aiEJIAJBAWohAiAHLQAAIREgB0EBaiEHDAALCyAAIBBrIgBFDQIgDCAQaiEMIAhCAXwhCCABKQMIIQQgASkDACEDIAEpAxghBiABKQMQIQUgAS0AaSECIAEtAGghCQwACwsCQAJAAkBBAC0AiYoBIglBBnRBAEEALQCIigEiDGtGDQAgAUHgAGpBACkDgIoBNwMAIAFB2ABqQQApA/iJATcDACABQdAAakEAKQPwiQE3AwAgAUHIAGpBACkD6IkBNwMAIAFBwABqQQApA+CJATcDACABQThqQQApA9iJATcDACABQTBqQQApA9CJATcDACABQQApA8iJATcDKCABQQApA8CJASIINwMgIAFBACkDuIkBIg03AxggAUEAKQOwiQEiDjcDECABQQApA6iJASIPNwMIIAFBACkDoIkBIgM3AwBBAC0AiooBIQcgAUHuAGogAUG0AWovAQA7AQAgASABKAGwATYBaiABIAw6AGggASAHIAlFckECciIJOgBpDAELIAFB4ABqIAJBfmoiAkEFdCIJQcmKAWopAwA3AwAgAUHYAGogCUHBigFqKQMANwMAIAFB0ABqIAlBuYoBaikDADcDACABQcgAaiAJQbGKAWopAwA3AwBBwAAhDCABQcAAaiAJQamKAWopAwA3AwAgAUE4aiAJQaGKAWopAwA3AwAgAUEwaiAJQZmKAWopAwA3AwBCACEIIAFCADcDICABQQApA5iJASINNwMYIAFBACkDkIkBIg43AxAgAUEAKQOIiQEiDzcDCCABQQApA4CJASIDNwMAIAEgCUGRigFqKQMANwMoQQAtAIqKASEJIAFB7gBqIAFBsAFqQQRqLwEAOwEAIAEgASgBsAE2AWogASAJQQRyIgk6AGkgAUHAADoAaCACRQ0BCyACQX9qIgdBBXQiEUGRigFqKQMAIQQgEUGZigFqKQMAIQUgEUGhigFqKQMAIQYgEUGpigFqKQMAIRIgASANNwOIASABIA43A4ABIAEgDzcDeCABIAM3A3AgAUGwAWogAUHwAGogAUEoaiIQIAwgCCAJQf8BcRADIAFBwAA6AGggASASNwNAIAEgBjcDOCABIAU3AzAgASAENwMoIAFCADcDICABQQApA5iJASIINwMYIAFBACkDkIkBIg03AxAgAUEAKQOIiQEiDjcDCCABQQApA4CJASIPNwMAIAFBAC0AiooBQQRyIgk6AGkgASABKQPoASABKQPIAYU3A2AgASABKQPgASABKQPAAYU3A1ggASABKQPYASABKQO4AYU3A1AgASABKQPQASABKQOwAYU3A0ggAUHuAGogAUGwAWpBBGoiDC8BADsBACABIAEoAbABNgFqIAdFDQAgAUHqAGohESACQQV0QemJAWohAgNAIAJBaGopAwAhAyACQXBqKQMAIQQgAkF4aikDACEFIAIpAwAhBiABIAg3A4gBIAEgDTcDgAEgASAONwN4IAEgDzcDcCABQbABaiABQfAAaiAQQcAAQgAgCUH/AXEQAyABQcAAOgBoIAEgBjcDQCABIAU3AzggASAENwMwIAEgAzcDKCABQgA3AyAgAUEAKQOYiQEiCDcDGCABQQApA5CJASINNwMQIAFBACkDiIkBIg43AwggAUEAKQOAiQEiDzcDACABQQAtAIqKAUEEciIJOgBpIAEgASkD6AEgASkDyAGFNwNgIAEgASkD4AEgASkDwAGFNwNYIAEgASkD2AEgASkDuAGFNwNQIAEgASkD0AEgASkDsAGFNwNIIBFBBGogDC8BADsBACARIAEoAbABNgEAIAJBYGohAiAHQX9qIgcNAAsLIAFB8ABqQQFyIQogAUEoaiELQgAhCEGACSEMQcAAIQIDQCABQbABaiABIAsgAkH/AXEgCCAJQQhyQf8BcRADIAEgASkD2AEiDSABKQO4AYU3A3ggASABKQPgASIOIAEpA8ABhTcDgAEgASABKQPoASIPIAEpA8gBhTcDiAEgASABKQMAIAEpA9ABIgOFNwOQASABIA0gASkDCIU3A5gBIAEgDiABKQMQhTcDoAEgASADIAEpA7ABhSINNwNwIAEgDyABKQMYhTcDqAEgAEHAACAAQcAASRsiEEF/aiECIA2nIREgCiEHIAwhCQJAA0AgCSAROgAAIAJFDQEgAkF/aiECIAlBAWohCSAHLQAAIREgB0EBaiEHDAALCyAAIBBrIgBFDQEgDCAQaiEMIAhCAXwhCCABLQBpIQkgAS0AaCECDAALCyABQfABaiQAC6MCAQR+AkACQCAAQSBGDQBCq7OP/JGjs/DbACEBQv+kuYjFkdqCm38hAkLy5rvjo6f9p6V/IQNC58yn0NbQ67O7fyEEQQAhAAwBC0EAKQOYCSEBQQApA5AJIQJBACkDiAkhA0EAKQOACSEEQRAhAAtBACAAOgCKigFBAEIANwOAigFBAEIANwP4iQFBAEIANwPwiQFBAEIANwPoiQFBAEIANwPgiQFBAEIANwPYiQFBAEIANwPQiQFBAEIANwPIiQFBAEIANwPAiQFBACABNwO4iQFBACACNwOwiQFBACADNwOoiQFBACAENwOgiQFBACABNwOYiQFBACACNwOQiQFBACADNwOIiQFBACAENwOAiQFBAEEAOgCQigFBAEEAOwGIigELBgAgABABCwYAIAAQBgsGAEGAiQELqwIBBH4CQAJAIAFBIEYNAEKrs4/8kaOz8NsAIQNC/6S5iMWR2oKbfyEEQvLmu+Ojp/2npX8hBULnzKfQ1tDrs7t/IQZBACEBDAELQQApA5gJIQNBACkDkAkhBEEAKQOICSEFQQApA4AJIQZBECEBC0EAIAE6AIqKAUEAQgA3A4CKAUEAQgA3A/iJAUEAQgA3A/CJAUEAQgA3A+iJAUEAQgA3A+CJAUEAQgA3A9iJAUEAQgA3A9CJAUEAQgA3A8iJAUEAQgA3A8CJAUEAIAM3A7iJAUEAIAQ3A7CJAUEAIAU3A6iJAUEAIAY3A6CJAUEAIAM3A5iJAUEAIAQ3A5CJAUEAIAU3A4iJAUEAIAY3A4CJAUEAQQA6AJCKAUEAQQA7AYiKASAAEAEgAhAGCwsLAQBBgAgLBHgHAAA=\";\nvar hash$g = \"e8655383\";\nvar wasmJson$g = {\n\tname: name$g,\n\tdata: data$g,\n\thash: hash$g\n};\n\nconst mutex$i = new Mutex();\nlet wasmCache$i = null;\nfunction validateBits$2(bits) {\n if (!Number.isInteger(bits) || bits < 8 || bits % 8 !== 0) {\n return new Error('Invalid variant! Valid values: 8, 16, ...');\n }\n return null;\n}\n/**\n * Calculates BLAKE3 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @param bits Number of output bits, which has to be a number\n * divisible by 8. Defaults to 256.\n * @param key Optional key (string, Buffer or TypedArray). Length should be 32 bytes.\n * @returns Computed hash as a hexadecimal string\n */\nfunction blake3(data, bits = 256, key = null) {\n if (validateBits$2(bits)) {\n return Promise.reject(validateBits$2(bits));\n }\n let keyBuffer = null;\n let initParam = 0; // key is empty by default\n if (key !== null) {\n keyBuffer = getUInt8Buffer(key);\n if (keyBuffer.length !== 32) {\n return Promise.reject(new Error('Key length must be exactly 32 bytes'));\n }\n initParam = 32;\n }\n const hashLength = bits / 8;\n const digestParam = hashLength;\n if (wasmCache$i === null || wasmCache$i.hashLength !== hashLength) {\n return lockedCreate(mutex$i, wasmJson$g, hashLength)\n .then((wasm) => {\n wasmCache$i = wasm;\n if (initParam === 32) {\n wasmCache$i.writeMemory(keyBuffer);\n }\n return wasmCache$i.calculate(data, initParam, digestParam);\n });\n }\n try {\n if (initParam === 32) {\n wasmCache$i.writeMemory(keyBuffer);\n }\n const hash = wasmCache$i.calculate(data, initParam, digestParam);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new BLAKE3 hash instance\n * @param bits Number of output bits, which has to be a number\n * divisible by 8. Defaults to 256.\n * @param key Optional key (string, Buffer or TypedArray). Length should be 32 bytes.\n */\nfunction createBLAKE3(bits = 256, key = null) {\n if (validateBits$2(bits)) {\n return Promise.reject(validateBits$2(bits));\n }\n let keyBuffer = null;\n let initParam = 0; // key is empty by default\n if (key !== null) {\n keyBuffer = getUInt8Buffer(key);\n if (keyBuffer.length !== 32) {\n return Promise.reject(new Error('Key length must be exactly 32 bytes'));\n }\n initParam = 32;\n }\n const outputSize = bits / 8;\n const digestParam = outputSize;\n return WASMInterface(wasmJson$g, outputSize).then((wasm) => {\n if (initParam === 32) {\n wasm.writeMemory(keyBuffer);\n }\n wasm.init(initParam);\n const obj = {\n init: initParam === 32\n ? () => {\n wasm.writeMemory(keyBuffer);\n wasm.init(initParam);\n return obj;\n }\n : () => {\n wasm.init(initParam);\n return obj;\n },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType, digestParam),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 64,\n digestSize: outputSize,\n };\n return obj;\n });\n}\n\nvar name$f = \"crc32\";\nvar data$f = \"AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwQFAXABAQEFBAEBAgIGDgJ/AUGQyQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAILSGFzaF9VcGRhdGUAAwpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCq0HBwUAQYAJC8MDAQN/QYCJASEBQQAhAgNAIAFBAEEAQQBBAEEAQQBBAEEAIAJBAXFrIABxIAJBAXZzIgNBAXFrIABxIANBAXZzIgNBAXFrIABxIANBAXZzIgNBAXFrIABxIANBAXZzIgNBAXFrIABxIANBAXZzIgNBAXFrIABxIANBAXZzIgNBAXFrIABxIANBAXZzIgNBAXFrIABxIANBAXZzNgIAIAFBBGohASACQQFqIgJBgAJHDQALQQAhAANAIABBhJEBaiAAQYSJAWooAgAiAkH/AXFBAnRBgIkBaigCACACQQh2cyICNgIAIABBhJkBaiACQf8BcUECdEGAiQFqKAIAIAJBCHZzIgI2AgAgAEGEoQFqIAJB/wFxQQJ0QYCJAWooAgAgAkEIdnMiAjYCACAAQYSpAWogAkH/AXFBAnRBgIkBaigCACACQQh2cyICNgIAIABBhLEBaiACQf8BcUECdEGAiQFqKAIAIAJBCHZzIgI2AgAgAEGEuQFqIAJB/wFxQQJ0QYCJAWooAgAgAkEIdnMiAjYCACAAQYTBAWogAkH/AXFBAnRBgIkBaigCACACQQh2czYCACAAQQRqIgBB/AdHDQALCycAAkBBACgCgMkBIABGDQAgABABQQAgADYCgMkBC0EAQQA2AoTJAQuhAgEDf0EAKAKEyQFBf3MhAUGACSECAkAgAEEISQ0AQYAJIQIDQCACQQRqKAIAIgNBDnZB/AdxQYCRAWooAgAgA0EWdkH8B3FBgIkBaigCAHMgA0EGdkH8B3FBgJkBaigCAHMgA0H/AXFBAnRBgKEBaigCAHMgAigCACABcyIBQRZ2QfwHcUGAqQFqKAIAcyABQQ52QfwHcUGAsQFqKAIAcyABQQZ2QfwHcUGAuQFqKAIAcyABQf8BcUECdEGAwQFqKAIAcyEBIAJBCGohAiAAQXhqIgBBB0sNAAsLAkAgAEUNAANAIAFB/wFxIAItAABzQQJ0QYCJAWooAgAgAUEIdnMhASACQQFqIQIgAEF/aiIADQALC0EAIAFBf3M2AoTJAQszAQF/QQBBACgChMkBIgBBGHQgAEEIdEGAgPwHcXIgAEEIdkGA/gNxIABBGHZycjYCgAkLBgBBhMkBC1oAAkBBACgCgMkBIAFGDQAgARABQQAgATYCgMkBC0EAQQA2AoTJASAAEANBAEEAKAKEyQEiAUEYdCABQQh0QYCA/AdxciABQQh2QYD+A3EgAUEYdnJyNgKACQsLCwEAQYAICwQEAAAA\";\nvar hash$f = \"749723dc\";\nvar wasmJson$f = {\n\tname: name$f,\n\tdata: data$f,\n\thash: hash$f\n};\n\nconst mutex$h = new Mutex();\nlet wasmCache$h = null;\n/**\n * Calculates CRC-32 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction crc32(data) {\n if (wasmCache$h === null) {\n return lockedCreate(mutex$h, wasmJson$f, 4)\n .then((wasm) => {\n wasmCache$h = wasm;\n return wasmCache$h.calculate(data, 0xEDB88320);\n });\n }\n try {\n const hash = wasmCache$h.calculate(data, 0xEDB88320);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new CRC-32 hash instance\n */\nfunction createCRC32() {\n return WASMInterface(wasmJson$f, 4).then((wasm) => {\n wasm.init(0xEDB88320);\n const obj = {\n init: () => { wasm.init(0xEDB88320); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 4,\n digestSize: 4,\n };\n return obj;\n });\n}\n\nconst mutex$g = new Mutex();\nlet wasmCache$g = null;\n/**\n * Calculates CRC-32C hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction crc32c(data) {\n if (wasmCache$g === null) {\n return lockedCreate(mutex$g, wasmJson$f, 4)\n .then((wasm) => {\n wasmCache$g = wasm;\n return wasmCache$g.calculate(data, 0x82F63B78);\n });\n }\n try {\n const hash = wasmCache$g.calculate(data, 0x82F63B78);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new CRC-32C hash instance\n */\nfunction createCRC32C() {\n return WASMInterface(wasmJson$f, 4).then((wasm) => {\n wasm.init(0x82F63B78);\n const obj = {\n init: () => { wasm.init(0x82F63B78); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 4,\n digestSize: 4,\n };\n return obj;\n });\n}\n\nvar name$e = \"md4\";\nvar data$e = \"AGFzbQEAAAABEgRgAAF/YAAAYAF/AGACf38BfwMIBwABAgMBAAIEBQFwAQEBBQQBAQICBg4CfwFBoIoFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABC0hhc2hfVXBkYXRlAAIKSGFzaF9GaW5hbAAEDUhhc2hfR2V0U3RhdGUABQ5IYXNoX0NhbGN1bGF0ZQAGClNUQVRFX1NJWkUDAQqXEQcFAEGACQstAEEAQv6568XpjpWZEDcCkIkBQQBCgcaUupbx6uZvNwKIiQFBAEIANwKAiQEL6AIBA39BAEEAKAKAiQEiASAAakH/////AXEiAjYCgIkBQQAoAoSJASEDAkAgAiABTw0AQQAgA0EBaiIDNgKEiQELQQAgAyAAQR12ajYChIkBAkACQAJAAkACQAJAIAFBP3EiAw0AQYAJIQIMAQtBwAAgA2siAiAASw0BIANBGGohA0EAIQEDQCADIAFqQYCJAWogAUGACWotAAA6AAAgAyABQQFqIgFqQdgARw0AC0GYiQFBwAAQAxogACACayEAIAJBgAlqIQILIABBwABPDQEgACEDDAILIABFDQJBACEBIANBmIkBakEALQCACToAACAAQQFGDQIgA0GZiQFqIQMgAEF/aiECA0AgAyABaiABQYEJai0AADoAACACIAFBAWoiAUcNAAwDCwsgAEE/cSEDIAIgAEFAcRADIQILIANFDQBBACEBA0AgAUGYiQFqIAIgAWotAAA6AAAgAyABQQFqIgFHDQALCwuYCwEXf0EAKAKUiQEhAkEAKAKQiQEhA0EAKAKMiQEhBEEAKAKIiQEhBQNAIABBHGooAgAiBiAAQRRqKAIAIgcgAEEYaigCACIIIABBEGooAgAiCSAAQSxqKAIAIgogAEEoaigCACILIABBJGooAgAiDCAAQSBqKAIAIg0gCyAIIABBCGooAgAiDiADaiAAQQRqKAIAIg8gAmogBCADIAJzcSACcyAFaiAAKAIAIhBqQQN3IhEgBCADc3EgA3NqQQd3IhIgESAEc3EgBHNqQQt3IhNqIBIgB2ogESAJaiAAQQxqKAIAIhQgBGogEyASIBFzcSARc2pBE3ciESATIBJzcSASc2pBA3ciEiARIBNzcSATc2pBB3ciEyASIBFzcSARc2pBC3ciFWogEyAMaiASIA1qIBEgBmogFSATIBJzcSASc2pBE3ciESAVIBNzcSATc2pBA3ciEiARIBVzcSAVc2pBB3ciEyASIBFzcSARc2pBC3ciFSAAQThqKAIAIhZqIBMgAEE0aigCACIXaiASIABBMGooAgAiGGogESAKaiAVIBMgEnNxIBJzakETdyISIBUgE3NxIBNzakEDdyITIBIgFXNxIBVzakEHdyIVIBMgEnNxIBJzakELdyIRaiAJIBVqIBAgE2ogEiAAQTxqKAIAIglqIBEgFSATc3EgE3NqQRN3IhIgESAVcnEgESAVcXJqQZnzidQFakEDdyITIBIgEXJxIBIgEXFyakGZ84nUBWpBBXciESATIBJycSATIBJxcmpBmfOJ1AVqQQl3IhVqIAcgEWogDyAT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QEiAEE/cSIBQZiJAWpBgAE6AAACQAJAAkAgAUE/cyICQQdLDQACQCACRQ0AIAFBmYkBaiEAA0AgAEEAOgAAIABBAWohACACQX9qIgINAAsLQcAAIQJBmIkBQcAAEAMaQQAhAAwBCyACQQhGDQEgAUEBaiEACyAAQY+JAWohAQNAIAEgAmpBADoAACACQXdqIQAgAkF/aiECIABBAEoNAAtBACgCgIkBIQALQQAgAEEVdjoA04kBQQAgAEENdjoA0okBQQAgAEEFdjoA0YkBQQAgAEEDdCICOgDQiQFBACACNgKAiQFBAEEAKAKEiQE2AtSJAUGYiQFBwAAQAxpBAEEAKQKIiQE3A4AJQQBBACkCkIkBNwOICQsGAEGAiQELMwBBAEL+uevF6Y6VmRA3ApCJAUEAQoHGlLqW8ermbzcCiIkBQQBCADcCgIkBIAAQAhAECwsLAQBBgAgLBJgAAAA=\";\nvar hash$e = \"1bf01052\";\nvar wasmJson$e = {\n\tname: name$e,\n\tdata: data$e,\n\thash: hash$e\n};\n\nconst mutex$f = new Mutex();\nlet wasmCache$f = null;\n/**\n * Calculates MD4 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction md4(data) {\n if (wasmCache$f === null) {\n return lockedCreate(mutex$f, wasmJson$e, 16)\n .then((wasm) => {\n wasmCache$f = wasm;\n return wasmCache$f.calculate(data);\n });\n }\n try {\n const hash = wasmCache$f.calculate(data);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new MD4 hash instance\n */\nfunction createMD4() {\n return WASMInterface(wasmJson$e, 16).then((wasm) => {\n wasm.init();\n const obj = {\n init: () => { wasm.init(); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 64,\n digestSize: 16,\n };\n return obj;\n });\n}\n\nvar name$d = \"md5\";\nvar data$d = \"AGFzbQEAAAABEgRgA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cgFWoiECASQX9zciAVc2pBgv3Nun9qQQZ3IBBqIhEgFUF/c3IgEHNqQbXk6+l7akEKdyARaiISIBBBf3NyIBFzakG7pd/WAmpBD3cgEmoiFSAEaiAWIBBqIBUgEUF/c3IgEnNqQZGnm9x+akEVd2ohBCAVIANqIQMgEiACaiECIBEgBWohBSAAQcAAaiEAIAFBQGoiAQ0AC0EAIAI2ApSJAUEAIAM2ApCJAUEAIAQ2AoyJAUEAIAU2AoiJASAAC6ECAQN/QQAoAoCJASIAQT9xIgFBmIkBakGAAToAAAJAAkACQCABQT9zIgJBB0sNAAJAIAJFDQAgAUGZiQFqIQADQCAAQQA6AAAgAEEBaiEAIAJBf2oiAg0ACwtBwAAhAkGYiQFBwAAQAxpBACEADAELIAJBCEYNASABQQFqIQALIABBj4kBaiEBA0AgASACakEAOgAAIAJBd2ohACACQX9qIQIgAEEASg0AC0EAKAKAiQEhAAtBACAAQRV2OgDTiQFBACAAQQ12OgDSiQFBACAAQQV2OgDRiQFBACAAQQN0IgI6ANCJAUEAIAI2AoCJAUEAQQAoAoSJATYC1IkBQZiJAUHAABADGkEAQQApAoiJATcDgAlBAEEAKQKQiQE3A4gJCwYAQYCJAQszAEEAQv6568XpjpWZEDcCkIkBQQBCgcaUupbx6uZvNwKIiQFBAEIANwKAiQEgABACEAQLCwsBAEGACAsEmAAAAA==\";\nvar hash$d = \"9b0fac7d\";\nvar wasmJson$d = {\n\tname: name$d,\n\tdata: data$d,\n\thash: hash$d\n};\n\nconst mutex$e = new Mutex();\nlet wasmCache$e = null;\n/**\n * Calculates MD5 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction md5(data) {\n if (wasmCache$e === null) {\n return lockedCreate(mutex$e, wasmJson$d, 16)\n .then((wasm) => {\n wasmCache$e = wasm;\n return wasmCache$e.calculate(data);\n });\n }\n try {\n const hash = wasmCache$e.calculate(data);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new MD5 hash instance\n */\nfunction createMD5() {\n return WASMInterface(wasmJson$d, 16).then((wasm) => {\n wasm.init();\n const obj = {\n init: () => { wasm.init(); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 64,\n digestSize: 16,\n };\n return obj;\n });\n}\n\nvar name$c = \"sha1\";\nvar data$c = \"AGFzbQEAAAABEQRgAAF/YAJ/fwBgAABgAX8AAwkIAAECAQMCAAMEBQFwAQEBBQQBAQICBg4CfwFB4IkFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAACC0hhc2hfVXBkYXRlAAQKSGFzaF9GaW5hbAAFDUhhc2hfR2V0U3RhdGUABg5IYXNoX0NhbGN1bGF0ZQAHClNUQVRFX1NJWkUDAQqfKQgFAEGACQurIgoBfgJ/AX4BfwF+A38BfgF/AX5HfyAAIAEpAxAiAkIgiKciA0EYdCADQQh0QYCA/AdxciACQiiIp0GA/gNxIAJCOIincnIiBCABKQMIIgVCIIinIgNBGHQgA0EIdEGAgPwHcXIgBUIoiKdBgP4DcSAFQjiIp3JyIgZzIAEpAygiB0IgiKciA0EYdCADQQh0QYCA/AdxciAHQiiIp0GA/gNxIAdCOIincnIiCHMgBaciA0EYdCADQQh0QYCA/AdxciADQQh2QYD+A3EgA0EYdnJyIgkgASkDACIFpyIDQRh0IANBCHRBgID8B3FyIANBCHZBgP4DcSADQRh2cnIiCnMgASkDICILpyIDQRh0IANBCHRBgID8B3FyIANBCHZBgP4DcSADQRh2cnIiDHMgASkDMCINQiCIpyIDQRh0IANBCHRBgID8B3FyIA1CKIinQYD+A3EgDUI4iKdyciIDc0EBdyIOc0EBdyIPIAYgBUIgiKciEEEYdCAQQQh0QYCA/AdxciAFQiiIp0GA/gNxIAVCOIincnIiEXMgC0IgiKciEEEYdCAQQQh0QYCA/AdxciAL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mutex$d = new Mutex();\nlet wasmCache$d = null;\n/**\n * Calculates SHA-1 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction sha1(data) {\n if (wasmCache$d === null) {\n return lockedCreate(mutex$d, wasmJson$c, 20)\n .then((wasm) => {\n wasmCache$d = wasm;\n return wasmCache$d.calculate(data);\n });\n }\n try {\n const hash = wasmCache$d.calculate(data);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new SHA-1 hash instance\n */\nfunction createSHA1() {\n return WASMInterface(wasmJson$c, 20).then((wasm) => {\n wasm.init();\n const obj = {\n init: () => { wasm.init(); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 64,\n digestSize: 20,\n };\n return obj;\n });\n}\n\nvar name$b = \"sha3\";\nvar data$b = \"AGFzbQEAAAABDwNgAAF/YAF/AGADf39/AAMIBwABAQIBAAIEBQFwAQEBBQQBAQICBg4CfwFBkI0FC38AQcAJCwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABC0hhc2hfVXBkYXRlAAIKSGFzaF9GaW5hbAAEDUhhc2hfR2V0U3RhdGUABQ5IYXNoX0NhbGN1bGF0ZQAGClNUQVRFX1NJWkUDAQrLFwcFAEGACgvXAwBBAEIANwOAjQFBAEIANwP4jAFBAEIANwPwjAFBAEIANwPojAFBAEIANwPgjAFBAEIANwPYjAFBAEIANwPQjAFBAEIANwPIjAFBAEIANwPAjAFBAEIANwO4jAFBAEIANwOwjAFBAEIANwOojAFBAEIANwOgjAFBAEIANwOYjAFBAEIANwOQjAFBAEIANwOIjAFBAEIANwOAjAFBAEIANwP4iwFBAEIANwPwiwFBAEIANwPoiwFBAEIANwPgiwFBAEIANwPYiwFBAEIANwPQiwFBAEIANwPIiwFBAEIANwPAiwFBAEIANwO4iwFBAEIANwOwiwFBAEIANwOoiwFBAEIANwOgiwFBAEIANwOYiwFBAEIANwOQiwFBAEIANwOIiwFBAEIANwOAiwFBAEIANwP4igFBAEIANwPwigFBAEIANwPoigFBAEIANwPgigFBAEIANwPYigFBAEIANwPQigFBAEIANwPIigFBAEIANwPAigFBAEIANwO4igFBAEIANwOwigFBAEIANwOoigFBAEIANwOgigFBAEIANwOYigFBAEIANwOQigFBAEIANwOIigFBAEIANwOAigFBAEHADCAAQQF0a0EDdjYCjI0BQQBBADYCiI0BC/8BAQZ/AkBBACgCiI0BIgFBAEgNAEEAIAEgAGpBACgCjI0BIgJwNgKIjQECQAJAIAENAEGACiEBDAELAkAgACACIAFrIgMgAyAASyIEGyIFRQ0AIAFByIsBaiEGQQAhAQNAIAYgAWogAUGACmotAAA6AAAgBSABQQFqIgFHDQALCyAEDQFBgIoBQciLASACEAMgACADayEAIANBgApqIQELAkAgACACSQ0AA0BBgIoBIAEgAhADIAEgAmohASAAIAJrIgAgAk8NAAsLIABFDQBBACECQQAhBQNAIAJByIsBaiABIAJqLQAAOgAAIAAgBUEBaiIFQf8BcSICSw0ACwsLyAoBKH4gACAAKQMAIAEpAwCFIgM3AwAgACAAKQMIIAEpAwiFIgQ3AwggACAAKQMQIAEpAxCFIgU3AxAgACAAKQMYIAEpAxiFIgY3AxggACAAKQMgIAEpAyCFIgc3AyAgACAAKQMoIAEpAyiFIgg3AyggACAAKQMwIAEpAzCFIgk3AzAgACAAKQM4IAEpAziFIgo3AzggACAAKQNAIAEpA0CFIgs3A0ACQAJAIAJByABLDQAgACkDUCEMIAApA2AhDSAAKQNIIQ4gACkDWCEPDAELIAAgACkDSCABKQNIhSIONwNIIAAgACkDUCABKQNQhSIMNwNQIAAgACkDWCABKQNYhSIPNwNYIAAgACkDYCABKQNghSINNwNgIAJB6QBJDQAgACAAKQNoIAEpA2iFNwNoIAAgACkDcCABKQNwhTcDcCAAIAApA3ggASkDeIU3A3ggACAAKQOAASABKQOAA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IoBQQBCADcDmIoBQQBCADcDkIoBQQBCADcDiIoBQQBCADcDgIoBQQBBwAwgAUEBdGtBA3Y2AoyNAUEAQQA2AoiNASAAEAJB5ABBACgCjI0BIgFBAXZrIQMCQEEAKAKIjQEiAEEASA0AIAEhBAJAIAEgAEYNACAAQciLAWohBUEAIQADQCAFIABqQQA6AAAgAEEBaiIAIAFBACgCiI0BIgRrSQ0ACwsgBEHIiwFqIgAgAC0AACACcjoAACABQceLAWoiACAALQAAQYABcjoAAEGAigFByIsBIAEQA0EAQYCAgIB4NgKIjQELAkAgA0ECdiIBRQ0AQQAhAANAIABBgApqIABBgIoBaigCADYCACAAQQRqIQAgAUF/aiIBDQALCwsLzAEBAEGACAvEAQEAAAAAAAAAgoAAAAAAAACKgAAAAAAAgACAAIAAAACAi4AAAAAAAAABAACAAAAAAIGAAIAAAACACYAAAAAAAICKAAAAAAAAAIgAAAAAAAAACYAAgAAAAAAKAACAAAAAAIuAAIAAAAAAiwAAAAAAAICJgAAAAAAAgAOAAAAAAACAAoAAAAAAAICAAAAAAAAAgAqAAAAAAAAACgAAgAAAAICBgACAAAAAgICAAAAAAACAAQAAgAAAAAAIgACAAAAAgJABAAA=\";\nvar hash$b = \"ec266d91\";\nvar wasmJson$b = {\n\tname: name$b,\n\tdata: data$b,\n\thash: hash$b\n};\n\nconst mutex$c = new Mutex();\nlet wasmCache$c = null;\nfunction validateBits$1(bits) {\n if (![224, 256, 384, 512].includes(bits)) {\n return new Error('Invalid variant! Valid values: 224, 256, 384, 512');\n }\n return null;\n}\n/**\n * Calculates SHA-3 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @param bits Number of output bits. Valid values: 224, 256, 384, 512\n * @returns Computed hash as a hexadecimal string\n */\nfunction sha3(data, bits = 512) {\n if (validateBits$1(bits)) {\n return Promise.reject(validateBits$1(bits));\n }\n const hashLength = bits / 8;\n if (wasmCache$c === null || wasmCache$c.hashLength !== hashLength) {\n return lockedCreate(mutex$c, wasmJson$b, hashLength)\n .then((wasm) => {\n wasmCache$c = wasm;\n return wasmCache$c.calculate(data, bits, 0x06);\n });\n }\n try {\n const hash = wasmCache$c.calculate(data, bits, 0x06);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new SHA-3 hash instance\n * @param bits Number of output bits. Valid values: 224, 256, 384, 512\n */\nfunction createSHA3(bits = 512) {\n if (validateBits$1(bits)) {\n return Promise.reject(validateBits$1(bits));\n }\n const outputSize = bits / 8;\n return WASMInterface(wasmJson$b, outputSize).then((wasm) => {\n wasm.init(bits);\n const obj = {\n init: () => { wasm.init(bits); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType, 0x06),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 200 - 2 * outputSize,\n digestSize: outputSize,\n };\n return obj;\n });\n}\n\nconst mutex$b = new Mutex();\nlet wasmCache$b = null;\nfunction validateBits(bits) {\n if (![224, 256, 384, 512].includes(bits)) {\n return new Error('Invalid variant! Valid values: 224, 256, 384, 512');\n }\n return null;\n}\n/**\n * Calculates Keccak hash\n * @param data Input data (string, Buffer or TypedArray)\n * @param bits Number of output bits. Valid values: 224, 256, 384, 512\n * @returns Computed hash as a hexadecimal string\n */\nfunction keccak(data, bits = 512) {\n if (validateBits(bits)) {\n return Promise.reject(validateBits(bits));\n }\n const hashLength = bits / 8;\n if (wasmCache$b === null || wasmCache$b.hashLength !== hashLength) {\n return lockedCreate(mutex$b, wasmJson$b, hashLength)\n .then((wasm) => {\n wasmCache$b = wasm;\n return wasmCache$b.calculate(data, bits, 0x01);\n });\n }\n try {\n const hash = wasmCache$b.calculate(data, bits, 0x01);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new Keccak hash instance\n * @param bits Number of output bits. Valid values: 224, 256, 384, 512\n */\nfunction createKeccak(bits = 512) {\n if (validateBits(bits)) {\n return Promise.reject(validateBits(bits));\n }\n const outputSize = bits / 8;\n return WASMInterface(wasmJson$b, outputSize).then((wasm) => {\n wasm.init(bits);\n const obj = {\n init: () => { wasm.init(bits); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType, 0x01),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 200 - 2 * outputSize,\n digestSize: outputSize,\n };\n return obj;\n });\n}\n\nvar name$a = \"sha256\";\nvar data$a = \"AGFzbQEAAAABEQRgAAF/YAF/AGACf38AYAAAAwgHAAEBAgMAAgQFAXABAQEFBAEBAgIGDgJ/AUHwiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAQNSGFzaF9HZXRTdGF0ZQAFDkhhc2hfQ2FsY3VsYXRlAAYKU1RBVEVfU0laRQMBCuJIBwUAQYAJC50BAEEAQgA3A8CJAUEAQRxBICAAQeABRiIAGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAAbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gABs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAAbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyAAGzcDyIkBC4ACAgF+Bn9BAEEAKQPAiQEiASAArXw3A8CJAQJAAkACQCABp0E/cSICDQBBgAkhAgwBCwJAIABBwAAgAmsiAyADIABLIgQbIgVFDQAgAkGAiQFqIQZBACECQQAhBwNAIAYgAmogAkGACWotAAA6AAAgBSAHQQFqIgdB/wFxIgJLDQALCyAEDQFByIkBQYCJARADIAAgA2shACADQYAJaiECCwJAIABBwABJDQADQEHIiQEgAhADIAJBwABqIQIgAEFAaiIAQT9LDQALCyAARQ0AQQAhB0EAIQUDQCAHQYCJAWogAiAHai0AADoAACAAIAVBAWoiBUH/AXEiB0sNAAsLC5M+AUV/IA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UEYdCABQQh0QYCA/AdxciABQQh2QYD+A3EgAUEYdnJyNgK4iQFByIkBQYCJARADQQBBACgC5IkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC5IkBQQBBACgC4IkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC4IkBQQBBACgC3IkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC3IkBQQBBACgC2IkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC2IkBQQBBACgC1IkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC1IkBQQBBACgC0IkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYC0IkBQQBBACgCzIkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYCzIkBQQBBACgCyIkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZyciIBNgLIiQECQEEAKALoiQEiBEUNAEEAIAE6AIAJIARBAUYNACABQQh2IQNBASEBQQEhAgNAIAFBgAlqIAM6AAAgBCACQQFqIgJB/wFxIgFNDQEgAUHIiQFqLQAAIQMMAAsLCwYAQYCJAQujAQBBAEIANwPAiQFBAEEcQSAgAUHgAUYiARs2AuiJAUEAQqef5qfG9JP9vn9Cq7OP/JGjs/DbACABGzcD4IkBQQBCsZaA/p+ihazoAEL/pLmIxZHagpt/IAEbNwPYiQFBAEKXusODk6eWh3dC8ua746On/aelfyABGzcD0IkBQQBC2L2WiPygtb42QufMp9DW0Ouzu38gARs3A8iJASAAEAIQBAsLCwEAQYAICwRwAAAA\";\nvar hash$a = \"817d957e\";\nvar wasmJson$a = {\n\tname: name$a,\n\tdata: data$a,\n\thash: hash$a\n};\n\nconst mutex$a = new Mutex();\nlet wasmCache$a = null;\n/**\n * Calculates SHA-2 (SHA-224) hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction sha224(data) {\n if (wasmCache$a === null) {\n return lockedCreate(mutex$a, wasmJson$a, 28)\n .then((wasm) => {\n wasmCache$a = wasm;\n return wasmCache$a.calculate(data, 224);\n });\n }\n try {\n const hash = wasmCache$a.calculate(data, 224);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new SHA-2 (SHA-224) hash instance\n */\nfunction createSHA224() {\n return WASMInterface(wasmJson$a, 28).then((wasm) => {\n wasm.init(224);\n const obj = {\n init: () => { wasm.init(224); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 64,\n digestSize: 28,\n };\n return obj;\n });\n}\n\nconst mutex$9 = new Mutex();\nlet wasmCache$9 = null;\n/**\n * Calculates SHA-2 (SHA-256) hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction sha256(data) {\n if (wasmCache$9 === null) {\n return lockedCreate(mutex$9, wasmJson$a, 32)\n .then((wasm) => {\n wasmCache$9 = wasm;\n return wasmCache$9.calculate(data, 256);\n });\n }\n try {\n const hash = wasmCache$9.calculate(data, 256);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new SHA-2 (SHA-256) hash instance\n */\nfunction createSHA256() {\n return WASMInterface(wasmJson$a, 32).then((wasm) => {\n wasm.init(256);\n const obj = {\n init: () => { wasm.init(256); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 64,\n digestSize: 32,\n };\n return obj;\n });\n}\n\nvar name$9 = \"sha512\";\nvar data$9 = \"AGFzbQEAAAABEQRgAAF/YAF/AGACf38AYAAAAwgHAAEBAgMA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EIABCKIhCgP4DgyAAQjiIhISENwOgigFBAEEAKQOYigEiAEI4hiAAQiiGQoCAgICAgMD/AIOEIABCGIZCgICAgIDgP4MgAEIIhkKAgICA8B+DhIQgAEIIiEKAgID4D4MgAEIYiEKAgPwHg4QgAEIoiEKA/gODIABCOIiEhIQ3A5iKAUEAQQApA5CKASIAQjiGIABCKIZCgICAgICAwP8Ag4QgAEIYhkKAgICAgOA/gyAAQgiGQoCAgIDwH4OEhCAAQgiIQoCAgPgPgyAAQhiIQoCA/AeDhCAAQiiIQoD+A4MgAEI4iISEhDcDkIoBQQBBACkDiIoBIgBCOIYgAEIohkKAgICAgIDA/wCDhCAAQhiGQoCAgICA4D+DIABCCIZCgICAgPAfg4SEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISEIgA3A4iKAQJAQQAoAsiKASIDRQ0AQQAgADwAgAkgA0EBRg0AIABCCIinIQRBASEBQQEhAgNAIAFBgAlqIAQ6AAAgAyACQQFqIgJB/wFxIgFNDQEgAUGIigFqLQAAIQQMAAsLCwYAQYCJAQuhAgBBAEIANwOAigFBAEEwQcAAIAFBgANGIgEbNgLIigFBAEKkn+n324PS2scAQvnC+JuRo7Pw2wAgARs3A8CKAUEAQqef5qfWwYuGW0Lr+obav7X2wR8gARs3A7iKAUEAQpGq4ML20JLajn9Cn9j52cKR2oKbfyABGzcDsIoBQQBCsZaA/v/MyZnnAELRhZrv+s+Uh9EAIAEbNwOoigFBAEK5srm4j5v7lxVC8e30+KWn/aelfyABGzcDoIoBQQBCl7rDg6OrwKyRf0Kr8NP0r+68tzwgARs3A5iKAUEAQoeq87OjpYrN4gBCu86qptjQ67O7fyABGzcDkIoBQQBC2L2WiNyr591LQoiS853/zPmE6gAgARs3A4iKASAAEAIQBAsLCwEAQYAICwTQAAAA\";\nvar hash$9 = \"a5d1ca7c\";\nvar wasmJson$9 = {\n\tname: name$9,\n\tdata: data$9,\n\thash: hash$9\n};\n\nconst mutex$8 = new Mutex();\nlet wasmCache$8 = null;\n/**\n * Calculates SHA-2 (SHA-384) hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction sha384(data) {\n if (wasmCache$8 === null) {\n return lockedCreate(mutex$8, wasmJson$9, 48)\n .then((wasm) => {\n wasmCache$8 = wasm;\n return wasmCache$8.calculate(data, 384);\n });\n }\n try {\n const hash = wasmCache$8.calculate(data, 384);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new SHA-2 (SHA-384) hash instance\n */\nfunction createSHA384() {\n return WASMInterface(wasmJson$9, 48).then((wasm) => {\n wasm.init(384);\n const obj = {\n init: () => { wasm.init(384); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 128,\n digestSize: 48,\n };\n return obj;\n });\n}\n\nconst mutex$7 = new Mutex();\nlet wasmCache$7 = null;\n/**\n * Calculates SHA-2 (SHA-512) hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction sha512(data) {\n if (wasmCache$7 === null) {\n return lockedCreate(mutex$7, wasmJson$9, 64)\n .then((wasm) => {\n wasmCache$7 = wasm;\n return wasmCache$7.calculate(data, 512);\n });\n }\n try {\n const hash = wasmCache$7.calculate(data, 512);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new SHA-2 (SHA-512) hash instance\n */\nfunction createSHA512() {\n return WASMInterface(wasmJson$9, 64).then((wasm) => {\n wasm.init(512);\n const obj = {\n init: () => { wasm.init(512); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 128,\n digestSize: 64,\n };\n return obj;\n });\n}\n\nvar name$8 = \"xxhash32\";\nvar data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bCAFakENd0Gx893xeWwhBSACQRBqIgIgA00NAAsLQQAgATYCjIkBQQAgBDYCiIkBQQAgBTYChIkBQQAgBjYCgIkBQQAgACACayIBNgKgiQEgAUUNAEEAIQEDQCABQZCJAWogAiABai0AADoAACABQQFqIgFBACgCoIkBSQ0ACwsLzAICAX4Gf0EAKQOoiQEiAKchAQJAAkAgAEIQVA0AQQAoAoSJAUEHd0EAKAKAiQFBAXdqQQAoAoiJAUEMd2pBACgCjIkBQRJ3aiECDAELQQAoAoiJAUGxz9myAWohAgsgAiABaiECQZCJASEBQQAoAqCJASIDQZCJAWohBAJAIANBBEgNAEGQiQEhBQNAIAUoAgBBvdzKlXxsIAJqQRF3Qa/W074CbCECIAVBCGohBiAFQQRqIgEhBSAGIARNDQALCwJAIAEgBEYNACADQZCJAWohBQNAIAEtAABBsc/ZsgFsIAJqQQt3QbHz3fF5bCECIAUgAUEBaiIBRw0ACwtBACACQQ92IAJzQfeUr694bCIBQQ12IAFzQb3cypV8bCIBQRB2IAFzIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycq03A4AJCwYAQYCJAQtTAEEAQgA3A6iJAUEAIAE2AoiJAUEAIAFBz4yijgZqNgKMiQFBACABQfeUr694ajYChIkBQQAgAUGoiI2hAmo2AoCJAUEAQQA2AqCJASAAEAIQAwsLCwEAQYAICwQwAAAA\";\nvar hash$8 = \"5b6a5062\";\nvar wasmJson$8 = {\n\tname: name$8,\n\tdata: data$8,\n\thash: hash$8\n};\n\nconst mutex$6 = new Mutex();\nlet wasmCache$6 = null;\nfunction validateSeed$3(seed) {\n if (!Number.isInteger(seed) || seed < 0 || seed > 0xFFFFFFFF) {\n return new Error('Seed must be a valid 32-bit long unsigned integer.');\n }\n return null;\n}\n/**\n * Calculates xxHash32 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @param seed Number used to initialize the internal state of the algorithm (defaults to 0)\n * @returns Computed hash as a hexadecimal string\n */\nfunction xxhash32(data, seed = 0) {\n if (validateSeed$3(seed)) {\n return Promise.reject(validateSeed$3(seed));\n }\n if (wasmCache$6 === null) {\n return lockedCreate(mutex$6, wasmJson$8, 4)\n .then((wasm) => {\n wasmCache$6 = wasm;\n return wasmCache$6.calculate(data, seed);\n });\n }\n try {\n const hash = wasmCache$6.calculate(data, seed);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new xxHash32 hash instance\n * @param data Input data (string, Buffer or TypedArray)\n * @param seed Number used to initialize the internal state of the algorithm (defaults to 0)\n */\nfunction createXXHash32(seed = 0) {\n if (validateSeed$3(seed)) {\n return Promise.reject(validateSeed$3(seed));\n }\n return WASMInterface(wasmJson$8, 4).then((wasm) => {\n wasm.init(seed);\n const obj = {\n init: () => { wasm.init(seed); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 16,\n digestSize: 4,\n };\n return obj;\n });\n}\n\nvar name$7 = \"xxhash64\";\nvar data$7 = \"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMHBgABAgEAAQQFAXABAQEFBAEBAgIGDgJ/AUHQiQULfwBBgAgLB3AIBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAJSGFzaF9Jbml0AAELSGFzaF9VcGRhdGUAAgpIYXNoX0ZpbmFsAAMNSGFzaF9HZXRTdGF0ZQAEDkhhc2hfQ2FsY3VsYXRlAAUKU1RBVEVfU0laRQMBCqINBgUAQYAJC2MBAX5BAEIANwPIiQFBAEEAKQOACSIANwOQiQFBACAAQvnq0NDnyaHk4QB8NwOYiQFBACAAQs/W077Sx6vZQnw3A4iJAUEAIABC1uuC7ur9ifXgAHw3A4CJAUEAQQA2AsCJAQv/BQMDfwR+AX8CQCAARQ0AQQBBACkDyIkBIACtfDcDyIkBAkBBACgCwIkBIgEgAGpBH0sNAEEAIAFBAWo2AsCJASABQaCJAWpBAC0AgAk6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FCz9bTvtLHq9lCfkIhiCABQoCAgID4tJ31k39+hEKHla+vmLbem55/foVCh5Wvr5i23puef35C49zKlfzO8vWFf3wgA0LP1tO+0ser2UJ+QiGIIANCgICAgPi0nfWTf36EQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCAEQs/W077Sx6vZQn5CIYggBEKAgICA+LSd9ZN/foRCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+QuPcypX8zvL1hX98IQEMAQtBACkDkIkBQsXP2bLx5brqJ3whAQsgASAAfCEAQaCJASEFQQAoAsCJASIGQaCJAWohBwJAIAZBCEgNAEGgiQEhCANAIAgpAwAiAULP1tO+0ser2UJ+QiGIIAFCgICAgPi0nfWTf36EQoeVr6+Ytt6bnn9+IACFQhuJQoeVr6+Ytt6bnn9+QuPcypX8zvL1hX98IQAgCEEQaiEJIAhBCGoiBSEIIAkgB00NAAsLAkACQCAFQQRqIgggB00NACAFIQgMAQsgBTUCAEKHla+vmLbem55/fiAAhUIXiULP1tO+0ser2UJ+Qvnz3fGZ9pmrFnwhAAsCQCAIIAdGDQAgBkGgiQFqIQkDQCAIMQAAQsXP2bLx5brqJ34gAIVCC4lCh5Wvr5i23puef34hACAJIAhBAWoiCEcNAAsLQQAgAEIhiCAAhULP1tO+0ser2UJ+IgBCHYggAIVC+fPd8Zn2masWfiIAQiCIIACFIgBCOIYgAEIohkKAgICAgIDA/wCDhCAAQhiGQoCAgICA4D+DIABCCIZCgICAgPAfg4SEIABCCIhCgICA+A+DIABCGIhCgID8B4OEIABCKIhCgP4DgyAAQjiIhISENwOACQsGAEGAiQELAgALCwsBAEGACAsEUAAAAA==\";\nvar hash$7 = \"bc315b2a\";\nvar wasmJson$7 = {\n\tname: name$7,\n\tdata: data$7,\n\thash: hash$7\n};\n\nconst mutex$5 = new Mutex();\nlet wasmCache$5 = null;\nconst seedBuffer$2 = new ArrayBuffer(8);\nfunction validateSeed$2(seed) {\n if (!Number.isInteger(seed) || seed < 0 || seed > 0xFFFFFFFF) {\n return new Error('Seed must be given as two valid 32-bit long unsigned integers (lo + high).');\n }\n return null;\n}\nfunction writeSeed$2(arr, low, high) {\n // write in little-endian format\n const buffer = new DataView(arr);\n buffer.setUint32(0, low, true);\n buffer.setUint32(4, high, true);\n}\n/**\n * Calculates xxHash64 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @param seedLow Lower 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n * @param seedHigh Higher 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n * @returns Computed hash as a hexadecimal string\n */\nfunction xxhash64(data, seedLow = 0, seedHigh = 0) {\n if (validateSeed$2(seedLow)) {\n return Promise.reject(validateSeed$2(seedLow));\n }\n if (validateSeed$2(seedHigh)) {\n return Promise.reject(validateSeed$2(seedHigh));\n }\n if (wasmCache$5 === null) {\n return lockedCreate(mutex$5, wasmJson$7, 8)\n .then((wasm) => {\n wasmCache$5 = wasm;\n writeSeed$2(seedBuffer$2, seedLow, seedHigh);\n wasmCache$5.writeMemory(new Uint8Array(seedBuffer$2));\n return wasmCache$5.calculate(data);\n });\n }\n try {\n writeSeed$2(seedBuffer$2, seedLow, seedHigh);\n wasmCache$5.writeMemory(new Uint8Array(seedBuffer$2));\n const hash = wasmCache$5.calculate(data);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new xxHash64 hash instance\n * @param seedLow Lower 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n * @param seedHigh Higher 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n */\nfunction createXXHash64(seedLow = 0, seedHigh = 0) {\n if (validateSeed$2(seedLow)) {\n return Promise.reject(validateSeed$2(seedLow));\n }\n if (validateSeed$2(seedHigh)) {\n return Promise.reject(validateSeed$2(seedHigh));\n }\n return WASMInterface(wasmJson$7, 8).then((wasm) => {\n const instanceBuffer = new ArrayBuffer(8);\n writeSeed$2(instanceBuffer, seedLow, seedHigh);\n wasm.writeMemory(new Uint8Array(instanceBuffer));\n wasm.init();\n const obj = {\n init: () => {\n wasm.writeMemory(new Uint8Array(instanceBuffer));\n wasm.init();\n return obj;\n },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 32,\n digestSize: 8,\n };\n return obj;\n });\n}\n\nvar name$6 = \"xxhash3\";\nvar data$6 = \"AGFzbQEAAAABJAZgAAF/YAR/f39/AGAHf39/f39/fwBgA39/fgF+YAAAYAF/AAMMCwABAgMDAwQFBAAEBAUBcAEBAQUEAQECAgYOAn8BQcCOBQt/AEHACQsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQABgtIYXNoX1VwZGF0ZQAHCkhhc2hfRmluYWwACA1IYXNoX0dldFN0YXRlAAkOSGFzaF9DYWxjdWxhdGUACgpTVEFURV9TSVpFAwEK+joLBQBBgAoL7wMBEH4CQCADRQ0AIAFBOGohASACQThqIQIgACkDMCEEIAApAzghBSAAKQMgIQYgACkDKCEHIAApAxAhCCAAKQMYIQkgACkDACEKIAApAwghCwNAIAcgAUFoaikDACIMfCACQXBqKQMAIAFBcGopAwAiDYUiB0IgiCAHQv////8Pg358IQcgCSABQVhqKQMAIg58IAJBYGopAwAgAUFgaikDACIPhSIJQiCIIAlC/////w+DfnwhCSALIAFBSGopAwAiEHwgAkFQaikDACABQVBqKQMAIhGFIgtCIIggC0L/////D4N+fCELIAJBeGopAwAgAUF4aikDACIShSITQiCIIBNC/////w+DfiAEfCABKQMAIhN8IQQgAkFoaikDACAMhSIMQiCIIAxC/////w+DfiAGfCANfCEGIAJBWGopAwAgDoUiDEIgiCAMQv////8Pg34gCHwgD3whCCACQUhqKQMAIBCFIgxCIIggDEL/////D4N+IAp8IBF8IQogBSASfCACKQMAIBOFIgVCIIggBUL/////D4N+fCEFIAFBwABqIQEgAkEIaiECIANBf2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gBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDOCACfSAAQeiLAWopAwCFIgNC/////w+DIgQgASkDMCACfCAAQeCLAWopAwCFIgVCIIgiBn4iB0L/////D4MgA0IgiCIDIAVC/////w+DIgV+fCAEIAV+IgRCIIh8IgVCIIYgBEL/////D4OEIAdCIIggAyAGfnwgBUIgiHyFfCEDCyABKQMIIAJ9QQApA4iMAYUiBEL/////D4MiBSABKQMAIAJ8QQApA4CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgA3wgASkDGCACfSAAQfiLAWopAwCFIgNC/////w+DIgQgASkDECACfCAAQfCLAWopAwCFIgJCIIgiBX4iBkL/////D4MgA0IgiCIDIAJC/////w+DIgJ+fCAEIAJ+IgJCIIh8IgRCIIYgAkL/////D4OEIAZCIIggAyAFfnwgBEIgiHyFfCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQuICwQBfwV+An8BfkEAIQMgASkDeCACfUEAKQP4jAGFIgRC/////w+DIgUgASkDcCACfEEAKQPwjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpA2ggAn1BACkD6IwBhSIEQv////8PgyIFIAEpA2AgAnxBACkD4IwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQNYIAJ9QQApA9iMAYUiBEL/////D4MiBSABKQNQIAJ8QQApA9CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDSCACfUEAKQPIjAGFIgRC/////w+DIgUgASkDQCACfEEAKQPAjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAzggAn1BACkDuIwBhSIEQv////8PgyIFIAEpAzAgAnxBACkDsIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSABKQMoIAJ9QQApA6iMAYUiBEL/////D4MiBSABKQMgIAJ8QQApA6CMAYUiBkIgiCIHfiIIQv////8PgyAEQiCIIgQgBkL/////D4MiBn58IAUgBn4iBUIgiHwiBkIghiAFQv////8Pg4QgCEIgiCAEIAd+fCAGQiCIfIUgASkDGCACfUEAKQOYjAGFIgRC/////w+DIgUgASkDECACfEEAKQOQjAGFIgZCIIgiB34iCEL/////D4MgBEIgiCIEIAZC/////w+DIgZ+fCAFIAZ+IgVCIIh8IgZCIIYgBUL/////D4OEIAhCIIggBCAHfnwgBkIgiHyFIAEpAwggAn1BACkDiIwBhSIEQv////8PgyIFIAEpAwAgAnxBACkDgIwBhSIGQiCIIgd+IghC/////w+DIARCIIgiBCAGQv////8PgyIGfnwgBSAGfiIFQiCIfCIGQiCGIAVC/////w+DhCAIQiCIIAQgB358IAZCIIh8hSAArUKHla+vmLbem55/fnx8fHx8fHx8IgRCJYggBIVC+fPd8ZnymasWfiIEQiCIIASFIQQgAEEQbSEJAkAgAEGQAUgNACAJQQkgCUEJShtBeGohCQNAIAEgA2oiCkELaikDACACfSADQYiNAWopAwCFIgVC/////w+DIgYgCkEDaikDACACfCADQYCNAWopAwCFIgdCIIgiCH4iC0L/////D4MgBUIgiCIFIAdC/////w+DIgd+fCAGIAd+IgZCIIh8IgdCIIYgBkL/////D4OEIAtCIIggBSAIfnwgB0IgiHyFIAR8IQQgA0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EDAkACQEEAKQOQjgEiBELxAVQNACACQQApA4CKATcDACACQQApA4iKATcDCCACQQApA5CKATcDECACQQApA5iKATcDGCACQQApA6CKATcDICACQQApA6iKATcDKCACQQApA7CKATcDMCACQQApA7iKATcDOAJAAkBBACgCgI4BIgVBwABJDQAgAkEAKAKIjgE2AkAgAiACQcAAakEAKAKYjgFBgIwBIAVBf2pBBnYgA0EAKAKcjgEQAiACIAIpAwhBACgCgI4BIgBBwIsBaikDACIEfCADQQAoApyOAWoiBkEBaikDACAAQciLAWopAwAiB4UiCEIgiCAIQv////8Pg358Igk3AwggAiACKQMYIABB0IsBaikDACIIfCAGQRFqKQMAIABB2IsBaikDACIKhSILQiCIIAtC/////w+DfnwiDDcDGCACIAcgBCAGQXlqKQMAhSIEQiCIIARC/////w+DfiACKQMAfHwiDTcDACACIAogCCAGQQlqKQMAhSIEQiCIIARC/////w+DfiACKQMQfHwiDjcDECAGQRlqKQMAIQQgAikDICEHIAIgAikDKCAAQeCLAWopAwAiCHwgBkEhaikDACAAQeiLAWopAwAiCoUiC0IgiCALQv////8Pg358Ig83AyggAiAKIAcgBCAIhSIEQiCIIARC/////w+Dfnx8IhA3AyAgAiACKQM4IABB8IsBaikDACIEfCAGQTFqKQMAIABB+IsBaikDACIHhSIIQiCIIAhC/////w+Dfnw3AzggByAEIAZBKWopAwCFIgRCIIggBEL/////D4N+IAIpAzB8fCEEDAELQcAAIAVrIRECQAJAAkAgBUE4TQ0AQYCOASARayEGIAJBwABqIQUgESEADAELQQAhEiARIQADQCACQcAAaiASaiAFIBJqQcCNAWopAwA3AwAgEkEIaiESIABBeGoiAEEHSw0ACyAFIBJqIgZBwABGDQEgBkHAjQFqIQYgAkHAAGogEmohBQsDQCAFIAYtAAA6AAAgBUEBaiEFIAZBAWohBiAAQX9qIgANAAtBACgCgI4BIQULIAJBwABqIBFqIQZBgIwBIQACQCAFQQhJDQBBgIwBIQADQCAGIAApAwA3AwAgBkEIaiEGIABBCGohACAFQXhqIgVBB0sNAAsLAkAgBUUNAANAIAYgAC0AADoAACAGQQFqIQYgAEEBaiEAIAVBf2oiBQ0ACwsgAiACKQMIIAIpA0AiBHwgA0EAKAKcjgFqIgBBAWopAwAgAikDSCIHhSIIQiCIIAhC/////w+DfnwiCTcDCCACIAIpAxggAikDUCIIfCAAQRFqKQMAIAIpA1giCoUiC0IgiCALQv////8Pg358Igw3AxggAiAHIAQgAEF5aikDAIUiBEIgiCAEQv////8Pg34gAikDAHx8Ig03AwAgAiAKIAggAEEJaikDAIUiBEIgiCAEQv////8Pg34gAikDEHx8Ig43AxAgAEEZaikDACEEIAIpAyAhByACIAIpAyggAikDYCIIfCAAQSFqKQMAIAIpA2giCoUiC0IgiCALQv////8Pg358Ig83AyggAiAKIAcgBCAIhSIEQiCIIARC/////w+Dfnx8IhA3AyAgAiACKQM4IAIpA3AiBHwgAEExaikDACACKQN4IgeFIghCIIggCEL/////D4N+fDcDOCAHIAQgAEEpaikDAIUiBEIgiCAEQv////8Pg34gAikDMHx8IQQLIAIgBDcDMCADKQNDIAIpAziFIgdC/////w+DIgggAykDOyAEhSIEQiCIIgp+IgtC/////w+DIAdCIIgiByAEQv////8PgyIEfnwgCCAEfiIEQiCIfCIIQiCGIARC/////w+DhCALQiCIIAcgCn58IAhCIIh8hSADKQMzIA+FIgRC/////w+DIgcgAykDKyAQhSIIQiCIIgp+IgtC/////w+DIARCIIgiBCAIQv////8PgyIIfnwgByAIfiIHQiCIfCIIQiCGIAdC/////w+DhCALQiCIIAQgCn58IAhCIIh8hSADKQMjIAyFIgRC/////w+DIgcgAykDGyAOhSIIQiCIIgp+IgtC/////w+DIARCIIgiBCAIQv////8PgyIIfnwgByAIfiIHQiCIfCIIQiCGIAdC/////w+DhCALQiCIIAQgCn58IAhCIIh8hSADKQMTIAmFIgRC/////w+DIgcgAykDCyANhSIIQiCIIgp+IgtC/////w+DIARCIIgiBCAIQv////8PgyIIfnwgByAIfiIHQiCIfCIIQiCGIAdC/////w+DhCALQiCIIAQgCn58IAhCIIh8hUEAKQOQjgFCh5Wvr5i23puef358fHx8IgRCJYggBIVC+fPd8ZnymasWfiIEQiCIIASFIQQMAQsgBKchAAJAQQApA6COASIEUA0AAkAgAEEQSw0AIABBgAggBBADIQQMAgsCQCAAQYABSw0AIABBgAggBBAEIQQMAgsgAEGACCAEEAUhBAwBCwJAIABBEEsNACAAIANCABADIQQMAQsCQCAAQYABSw0AIAAgA0IAEAQhBAwBCyAAIANCABAFIQQLQQAgBEI4hiAEQiiGQoCAgICAgMD/AIOEIARCGIZCgICAgIDgP4MgBEIIhkKAgICA8B+DhIQgBEIIiEKAgID4D4MgBEIYiEKAgPwHg4QgBEIoiEKA/gODIARCOIiEhIQ3A4AKIAEkAAsGAEGAigELAgALC8wBAQBBgAgLxAG4/mw5I6RLvnwBgSz3Ia0c3tRt6YOQl9tyQKSkt7NnH8t55k7MwOV4glrQfcz/ciG4CEZ090MkjuA1kOaBOiZMPChSu5HDAMuI0GWLG1Muo3FkSJeiDflOOBnvRqnerNio+nY/45w0P/ncu8fHC08dilHgS820WTHIn37J2XhzZOrFrIM00+vDxYGg//oTY+sXDd1Rt/DaSdMWVSYp1GieKxa+WH1HofyP+LjRetAxzkXLOo+VFgQor9f7yrtLQH5AAgAA\";\nvar hash$6 = \"187bc2c6\";\nvar wasmJson$6 = {\n\tname: name$6,\n\tdata: data$6,\n\thash: hash$6\n};\n\nconst mutex$4 = new Mutex();\nlet wasmCache$4 = null;\nconst seedBuffer$1 = new ArrayBuffer(8);\nfunction validateSeed$1(seed) {\n if (!Number.isInteger(seed) || seed < 0 || seed > 0xFFFFFFFF) {\n return new Error('Seed must be given as two valid 32-bit long unsigned integers (lo + high).');\n }\n return null;\n}\nfunction writeSeed$1(arr, low, high) {\n // write in little-endian format\n const buffer = new DataView(arr);\n buffer.setUint32(0, low, true);\n buffer.setUint32(4, high, true);\n}\n/**\n * Calculates xxHash3 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @param seedLow Lower 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n * @param seedHigh Higher 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n * @returns Computed hash as a hexadecimal string\n */\nfunction xxhash3(data, seedLow = 0, seedHigh = 0) {\n if (validateSeed$1(seedLow)) {\n return Promise.reject(validateSeed$1(seedLow));\n }\n if (validateSeed$1(seedHigh)) {\n return Promise.reject(validateSeed$1(seedHigh));\n }\n if (wasmCache$4 === null) {\n return lockedCreate(mutex$4, wasmJson$6, 8)\n .then((wasm) => {\n wasmCache$4 = wasm;\n writeSeed$1(seedBuffer$1, seedLow, seedHigh);\n wasmCache$4.writeMemory(new Uint8Array(seedBuffer$1));\n return wasmCache$4.calculate(data);\n });\n }\n try {\n writeSeed$1(seedBuffer$1, seedLow, seedHigh);\n wasmCache$4.writeMemory(new Uint8Array(seedBuffer$1));\n const hash = wasmCache$4.calculate(data);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new xxHash3 hash instance\n * @param seedLow Lower 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n * @param seedHigh Higher 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n */\nfunction createXXHash3(seedLow = 0, seedHigh = 0) {\n if (validateSeed$1(seedLow)) {\n return Promise.reject(validateSeed$1(seedLow));\n }\n if (validateSeed$1(seedHigh)) {\n return Promise.reject(validateSeed$1(seedHigh));\n }\n return WASMInterface(wasmJson$6, 8).then((wasm) => {\n const instanceBuffer = new ArrayBuffer(8);\n writeSeed$1(instanceBuffer, seedLow, seedHigh);\n wasm.writeMemory(new Uint8Array(instanceBuffer));\n wasm.init();\n const obj = {\n init: () => {\n wasm.writeMemory(new Uint8Array(instanceBuffer));\n wasm.init();\n return obj;\n },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 512,\n digestSize: 8,\n };\n return obj;\n });\n}\n\nvar name$5 = \"xxhash128\";\nvar data$5 = \"AGFzbQEAAAABKwdgAAF/YAR/f39/AGAHf39/f39/fwBgA39/fgF+YAR/f39+AGAAAGABfwADDQwAAQIDBAQEBQYFAAUEBQFwAQEBBQQBAQICBg4CfwFBwI4FC38AQcAJCwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAAHC0hhc2hfVXBkYXRlAAgKSGFzaF9GaW5hbAAJDUhhc2hfR2V0U3RhdGUACg5IYXNoX0NhbGN1bGF0ZQALClNUQVRFX1NJWkUDAQrKRgwFAEGACgvvAwEQfgJAIANFDQAgAUE4aiEBIAJBOGohAiAAKQMwIQQgACkDOCEFIAApAyAhBiAAKQMoIQcgACkDECEIIAApAxghCSAAKQMAIQogACkDCCELA0AgByABQWhqKQMAIgx8IAJBcGopAwAgAUFwaikDACINhSIHQiCIIAdC/////w+DfnwhByAJIAFBWGopAwAiDnwgAkFgaikDACABQWBqKQMAIg+FIglCIIggCUL/////D4N+fCEJIAsgAUFIaikDACIQfCACQVBqKQMAIAFBUGopAwAiEYUiC0IgiCALQv////8Pg358IQsgAkF4aikDACABQXhqKQMAIhKFIhNCIIggE0L/////D4N+IAR8IAEpAwAiE3whBCACQWhqKQMAIAyFIgxCIIggDEL/////D4N+IAZ8IA18IQYgAkFYaikDACAOhSIMQiCIIAxC/////w+DfiAIfCAPfCEIIAJBSGopAwAgEIUiDEIgiCAMQv////8Pg34gCnwgEXwhCiAFIBJ8IAIpAwAgE4UiBUIgiCAFQv////8Pg358IQUgAUHAAGohASACQQhqIQIgA0F/aiIDDQALIAAgCTcDGCAAIAo3AwAgACALNwMIIAAgBzcDKCAAIAg3AxAgACAFNwM4IAAgBjcDICAAIAQ3AzALC94CAgF/AX4CQCACIAEoAgAiB2siAiAESw0AIAAgAyAFIAdBA3RqIAIQASAAIAApAwAiCCAFIAZqIgcpAwCFIAhCL4iFQrHz3fEJfjcDACAAIAApAwgiCCAHKQMIhSAIQi+IhUKx893xCX43AwggACAAKQMQIgggBykDEIUgCEIviIVCsfPd8Ql+NwMQIAAgACkDGCIIIAcpAxiFIAhCL4iFQrHz3fEJfjcDGCAAIAApAyAiCCAHKQMghSAIQi+IhUKx893xCX43AyAgACAAKQMoIgggBykDKIUgCEIviIVCsfPd8Ql+NwMoIAAgACkDMCIIIAcpAzCFIAhCL4iFQrHz3fEJfjcDMCAAIAApAzgiCCAHKQM4hSAIQi+IhUKx893xCX43AzggACADIAJBBnRqIAUgBCACayIHEAEgASAHNgIADwsgACADIAUgB0EDdGogBBABIAEgByAEajYCAAvtAwEFfiABKQM4IAApAziFIgNC/////w+DIgQgASkDMCAAKQMwhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMoIAApAyiFIgNC/////w+DIgQgASkDICAAKQMghSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMYIAApAxiFIgNC/////w+DIgQgASkDECAAKQMQhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSABKQMIIAApAwiFIgNC/////w+DIgQgASkDACAAKQMAhSIFQiCIIgZ+IgdC/////w+DIANCIIgiAyAFQv////8PgyIFfnwgBCAFfiIEQiCIfCIFQiCGIARC/////w+DhCAHQiCIIAMgBn58IAVCIIh8hSACfHx8fCICQiWIIAKFQvnz3fGZ8pmrFn4iAkIgiCAChQvCCAEFfgJAIAFBCUkNACAAQQApA4CMASACKQMoIAIpAyCFIAN9hSABQfiLAWopAwAiBIUiBUIgiCIGQoeVr68IfiIHQv////8PgyAFQv////8PgyIFQrHz3fEJfnwgBUKHla+vCH4iB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AOFQvnz3fGZ9pmrFn4iA0IgiCADhTcDCA8LIAAgAikDUCADhSACKQNYhSIEQiGIIASFQs/W077Sx6vZQn4iBEIdiCAEhUL5893xmfaZqxZ+IgRCIIggBIU3AwggACACKQNAIAOFIAIpA0iFIgNCIYggA4VCz9bTvtLHq9lCfiIDQh2IIAOFQvnz3fGZ9pmrFn4iA0IgiCADhTcDAAunCgEKfiABrSIEQoeVr6+Ytt6bnn9+IQUCQAJAIAFBIU8NAEIAIQYMAQtCACEHAkAgAUHBAEkNAEIAIQcCQCABQeEASQ0AIAIpA3ggA30gAUHIiwFqKQMAIgiFIgdC/////w+DIgkgAikDcCADfCABQcCLAWopAwAiCoUiC0IgiCIMfiINQiCIIAdCIIgiByAMfnwgDUL/////D4MgByALQv////8PgyILfnwgCSALfiIHQiCIfCIJQiCIfEEAKQO4jAEiC0EAKQOwjAEiDHyFIAlCIIYgB0L/////D4OEhSEHIAIpA2ggA30gC4UiCUL/////D4MiCyACKQNgIAN8IAyFIgxCIIgiDX4iBkL/////D4MgCUIgiCIJIAxC/////w+DIgx+fCALIAx+IgtCIIh8IgxCIIYgC0L/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAV8IAggCnyFIQULIAIpA1ggA30gAUHYiwFqKQMAIgiFIglC/////w+DIgogAikDUCADfCABQdCLAWopAwAiC4UiDEIgiCINfiIGQv////8PgyAJQiCIIgkgDEL/////D4MiDH58IAogDH4iCkIgiHwiDEIghiAKQv////8Pg4QgBkIgiCAJIA1+fCAMQiCIfIUgB3xBACkDqIwBIglBACkDoIwBIgp8hSEHIAIpA0ggA30gCYUiCUL/////D4MiDCACKQNAIAN8IAqFIgpCIIgiDX4iBkL/////D4MgCUIgiCIJIApC/////w+DIgp+fCAMIAp+IgpCIIh8IgxCIIYgCkL/////D4OEIAZCIIggCSANfnwgDEIgiHyFIAV8IAggC3yFIQULIAIpAzggA30gAUHoiwFqKQMAIgiFIglC/////w+DIgogAikDMCADfCABQeCLAWopAwAiC4UiDEIgiCINfiIGQv////8PgyAJQiCIIgkgDEL/////D4MiDH58IAogDH4iCkIgiHwiDEIghiAKQv////8Pg4QgBkIgiCAJIA1+fCAMQiCIfIUgB3xBACkDmIwBIgdBACkDkIwBIgl8hSEGIAIpAyggA30gB4UiB0L/////D4MiCiACKQMgIAN8IAmFIglCIIgiDH4iDUL/////D4MgB0IgiCIHIAlC/////w+DIgl+fCAKIAl+IglCIIh8IgpCIIYgCUL/////D4OEIA1CIIggByAMfnwgCkIgiHyFIAV8IAggC3yFIQULIAAgAikDGCADfSABQfiLAWopAwAiB4UiCEL/////D4MiCSACKQMQIAN8IAFB8IsBaikDACIKhSILQiCIIgx+Ig1C/////w+DIAhCIIgiCCALQv////8PgyILfnwgCSALfiIJQiCIfCILQiCGIAlC/////w+DhCANQiCIIAggDH58IAtCIIh8hSAGfEEAKQOIjAEiCEEAKQOAjAEiCXyFIgsgAikDCCADfSAIhSIIQv////8PgyIMIAIpAwAgA3wgCYUiCUIgiCINfiIGQv////8PgyAIQiCIIgggCUL/////D4MiCX58IAwgCX4iCUIgiHwiDEIghiAJQv////8Pg4QgBkIgiCAIIA1+fCAMQiCIfIUgBXwgByAKfIUiBXwiB0IliCAHhUL5893xmfKZqxZ+IgdCIIggB4U3AwAgAEIAIAVCh5Wvr5i23puef34gBCADfULP1tO+0ser2UJ+fCALQuPcypX8zvL1hX9+fCIDQiWIIAOFQvnz3fGZ8pmrFn4iA0IgiCADhX03AwgLiQ8DAX8UfgJ/QQAhBCACKQN4IAN9QQApA/iMASIFhSIGQv////8PgyIHIAIpA3AgA3xBACkD8IwBIgiFIglCIIgiCn4iC0L/////D4MgBkIgiCIGIAlC/////w+DIgl+fCAHIAl+IgdCIIh8IglCIIYgB0L/////D4OEIAtCIIggBiAKfnwgCUIgiHyFIAIpA1ggA31BACkD2IwBIgeFIgZC/////w+DIgkgAikDUCADfEEAKQPQjAEiCoUiC0IgiCIMfiINQv////8PgyAGQiCIIgYgC0L/////D4MiC358IAkgC34iCUIgiHwiC0IghiAJQv////8Pg4QgDUIgiCAGIAx+fCALQiCIfIUgAikDOCADfUEAKQO4jAEiCYUiBkL/////D4MiCyACKQMwIAN8QQApA7CMASIMhSINQiCIIg5+Ig9C/////w+DIAZCIIgiBiANQv////8PgyINfnwgCyANfiILQiCIfCINQiCGIAtC/////w+DhCAPQiCIIAYgDn58IA1CIIh8hSACKQMYIAN9QQApA5iMASILhSIGQv////8PgyINIAIpAxAgA3xBACkDkIwBIg6FIg9CIIgiEH4iEUL/////D4MgBkIgiCIGIA9C/////w+DIg9+fCANIA9+Ig1CIIh8Ig9CIIYgDUL/////D4OEIBFCIIggBiAQfnwgD0IgiHyFQQApA4iMASINQQApA4CMASIPfIV8QQApA6iMASIQQQApA6CMASIRfIV8QQApA8iMASISQQApA8CMASITfIV8QQApA+iMASIUQQApA+CMASIVfIUiBkIliCAGhUL5893xmfKZqxZ+IgZCIIggBoUhBiACKQNoIAN9IBSFIhRC/////w+DIhYgAikDYCADfCAVhSIVQiCIIhd+IhhC/////w+DIBRCIIgiFCAVQv////8PgyIVfnwgFiAVfiIVQiCIfCIWQiCGIBVC/////w+DhCAYQiCIIBQgF358IBZCIIh8hSACKQNIIAN9IBKFIhJC/////w+DIhQgAikDQCADfCAThSITQiCIIhV+IhZC/////w+DIBJCIIgiEiATQv////8PgyITfnwgFCATfiITQiCIfCIUQiCGIBNC/////w+DhCAWQiCIIBIgFX58IBRCIIh8hSACKQMoIAN9IBCFIhBC/////w+DIhIgAikDICADfCARhSIRQiCIIhN+IhRC/////w+DIBBCIIgiECARQv////8PgyIRfnwgEiARfiIRQiCIfCISQiCGIBFC/////w+DhCAUQiCIIBAgE358IBJCIIh8hSACKQMIIAN9IA2FIg1C/////w+DIhAgAikDACADfCAPhSIPQiCIIhF+IhJC/////w+DIA1CIIgiDSAPQv////8PgyIPfnwgECAPfiIPQiCIfCIQQiCGIA9C/////w+DhCASQiCIIA0gEX58IBBCIIh8hSABrSIPQoeVr6+Ytt6bnn9+fCALI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AAKQMIQQAoAoCOASICQcCLAWopAwAiBHwgA0EAKAKcjgFqIgZBAWopAwAgAkHIiwFqKQMAIgeFIghCIIggCEL/////D4N+fDcDCCAAIAApAxggAkHQiwFqKQMAIgh8IAZBEWopAwAgAkHYiwFqKQMAIgmFIgpCIIggCkL/////D4N+fDcDGCAAIAcgBCAGQXlqKQMAhSIEQiCIIARC/////w+DfiAAKQMAfHw3AwAgACAJIAggBkEJaikDAIUiBEIgiCAEQv////8Pg34gACkDEHx8NwMQIAZBGWopAwAhBCAAKQMgIQcgACAAKQMoIAJB4IsBaikDACIIfCAGQSFqKQMAIAJB6IsBaikDACIJhSIKQiCIIApC/////w+Dfnw3AyggACAJIAcgBCAIhSIEQiCIIARC/////w+Dfnx8NwMgIAAgACkDOCACQfCLAWopAwAiBHwgBkExaikDACACQfiLAWopAwAiB4UiCEIgiCAIQv////8Pg358NwM4IAAgByAEIAZBKWopAwCFIgRCIIggBEL/////D4N+IAApAzB8fDcDMAwBC0HAACAFayELAkACQAJAIAVBOE0NAEGAjgEgC2shBiAAQcAAaiEFIAshAgwBC0EAIQwgCyECA0AgAEHAAGogDGogBSAMakHAjQFqKQMANwMAIAxBCGohDCACQXhqIgJBB0sNAAsgBSAMaiIGQcAARg0BIAZBwI0BaiEGIABBwABqIAxqIQULA0AgBSAGLQAAOgAAIAVBAWohBSAGQQFqIQYgAkF/aiICDQALQQAoAoCOASEFCyAAQcAAaiALaiEGQYCMASECAkAgBUEISQ0AQYCMASECA0AgBiACKQMANwMAIAZBCGohBiACQQhqIQIgBUF4aiIFQQdLDQALCwJAIAVFDQADQCAGIAItAAA6AAAgBkEBaiEGIAJBAWohAiAFQX9qIgUNAAsLIAAgACkDCCAAKQNAIgR8IANBACgCnI4BaiICQQFqKQMAIAApA0giB4UiCEIgiCAIQv////8Pg358NwMIIAAgACkDGCAAKQNQIgh8IAJBEWopAwAgACkDWCIJhSIKQiCIIApC/////w+Dfnw3AxggACAHIAQgAkF5aikDAIUiBEIgiCA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pg5CX23JApKS3s2cfy3nmTszA5XiCWtB9zP9yIbgIRnT3QySO4DWQ5oE6Jkw8KFK7kcMAy4jQZYsbUy6jcWRIl6IN+U44Ge9Gqd6s2Kj6dj/jnDQ/+dy7x8cLTx2KUeBLzbRZMciffsnZeHNk6sWsgzTT68PFgaD/+hNj6xcN3VG38NpJ0xZVJinUaJ4rFr5YfUeh/I/4uNF60DHORcs6j5UWBCiv1/vKu0tAfkACAAA=\";\nvar hash$5 = \"e8e3fcf8\";\nvar wasmJson$5 = {\n\tname: name$5,\n\tdata: data$5,\n\thash: hash$5\n};\n\nconst mutex$3 = new Mutex();\nlet wasmCache$3 = null;\nconst seedBuffer = new ArrayBuffer(8);\nfunction validateSeed(seed) {\n if (!Number.isInteger(seed) || seed < 0 || seed > 0xFFFFFFFF) {\n return new Error('Seed must be given as two valid 32-bit long unsigned integers (lo + high).');\n }\n return null;\n}\nfunction writeSeed(arr, low, high) {\n // write in little-endian format\n const buffer = new DataView(arr);\n buffer.setUint32(0, low, true);\n buffer.setUint32(4, high, true);\n}\n/**\n * Calculates xxHash128 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @param seedLow Lower 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n * @param seedHigh Higher 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n * @returns Computed hash as a hexadecimal string\n */\nfunction xxhash128(data, seedLow = 0, seedHigh = 0) {\n if (validateSeed(seedLow)) {\n return Promise.reject(validateSeed(seedLow));\n }\n if (validateSeed(seedHigh)) {\n return Promise.reject(validateSeed(seedHigh));\n }\n if (wasmCache$3 === null) {\n return lockedCreate(mutex$3, wasmJson$5, 16)\n .then((wasm) => {\n wasmCache$3 = wasm;\n writeSeed(seedBuffer, seedLow, seedHigh);\n wasmCache$3.writeMemory(new Uint8Array(seedBuffer));\n return wasmCache$3.calculate(data);\n });\n }\n try {\n writeSeed(seedBuffer, seedLow, seedHigh);\n wasmCache$3.writeMemory(new Uint8Array(seedBuffer));\n const hash = wasmCache$3.calculate(data);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new xxHash128 hash instance\n * @param seedLow Lower 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n * @param seedHigh Higher 32 bits of the number used to\n * initialize the internal state of the algorithm (defaults to 0)\n */\nfunction createXXHash128(seedLow = 0, seedHigh = 0) {\n if (validateSeed(seedLow)) {\n return Promise.reject(validateSeed(seedLow));\n }\n if (validateSeed(seedHigh)) {\n return Promise.reject(validateSeed(seedHigh));\n }\n return WASMInterface(wasmJson$5, 16).then((wasm) => {\n const instanceBuffer = new ArrayBuffer(8);\n writeSeed(instanceBuffer, seedLow, seedHigh);\n wasm.writeMemory(new Uint8Array(instanceBuffer));\n wasm.init();\n const obj = {\n init: () => {\n wasm.writeMemory(new Uint8Array(instanceBuffer));\n wasm.init();\n return obj;\n },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 512,\n digestSize: 16,\n };\n return obj;\n });\n}\n\nvar name$4 = \"ripemd160\";\nvar data$4 = \"AGFzbQEAAAABEQRgAAF/YAAAYAF/AGACf38AAwkIAAECAwIBAAIEBQFwAQEBBQQBAQICBg4CfwFB4IkFC38AQcAICweDAQkGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAARByaXBlbWQxNjBfdXBkYXRlAAMLSGFzaF9VcGRhdGUABApIYXNoX0ZpbmFsAAUNSGFzaF9HZXRTdGF0ZQAGDkhhc2hfQ2FsY3VsYXRlAAcKU1RBVEVfU0laRQMBCtAxCAUAQYAJCzoAQQBB8MPLnnw2ApiJAUEAQv6568XpjpWZEDcCkIkBQQBCgcaUupbx6uZvNwKIiQFBAEIANwKAiQELpiwBHn9BACAAKAIkIgEgACgCACICIAAoAhAiAyACIAAoAiwiBCAAKAIMIgUgACgCBCIGI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QEHAACAFayICIAFNDQAgBSECDAELQQAhA0EAIQQDQCADIAVqQZyJAWogACADai0AADoAACACIARBAWoiBEH/AXEiA0sNAAtBnIkBEAIgASACayEBIAAgAmohAEEAIQILAkAgAUHAAEkNAANAIAAQAiAAQcAAaiEAIAFBQGoiAUE/Sw0ACwsgAUUNAEEAIQNBACEEA0AgAyACakGciQFqIAAgA2otAAA6AAAgASAEQQFqIgRB/wFxIgNLDQALCwsJAEGACSAAEAMLggEBAn8jAEEQayIAJAAgAEEAKAKAiQEiAUEDdDYCCCAAQQAoAoSJAUEDdCABQR12cjYCDEGACEE4QfgAIAFBP3EiAUE4SRsgAWsQAyAAQQhqQQgQA0EAQQAoAoiJATYCgAlBAEEAKQKMiQE3AoQJQQBBACkClIkBNwKMCSAAQRBqJAALBgBBgIkBC8EBAQF/IwBBEGsiASQAQQBB8MPLnnw2ApiJAUEAQv6568XpjpWZEDcCkIkBQQBCgcaUupbx6uZvNwKIiQFBAEIANwKAiQFBgAkgABADIAFBACgCgIkBIgBBA3Q2AgggAUEAKAKEiQFBA3QgAEEddnI2AgxBgAhBOEH4ACAAQT9xIgBBOEkbIABrEAMgAUEIakEIEANBAEEAKAKIiQE2AoAJQQBBACkCjIkBNwKECUEAQQApApSJATcCjAkgAUEQaiQACwtLAQBBgAgLRIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABcAAAA\";\nvar hash$4 = \"42f1de39\";\nvar wasmJson$4 = {\n\tname: name$4,\n\tdata: data$4,\n\thash: hash$4\n};\n\nconst mutex$2 = new Mutex();\nlet wasmCache$2 = null;\n/**\n * Calculates RIPEMD-160 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction ripemd160(data) {\n if (wasmCache$2 === null) {\n return lockedCreate(mutex$2, wasmJson$4, 20)\n .then((wasm) => {\n wasmCache$2 = wasm;\n return wasmCache$2.calculate(data);\n });\n }\n try {\n const hash = wasmCache$2.calculate(data);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new RIPEMD-160 hash instance\n */\nfunction createRIPEMD160() {\n return WASMInterface(wasmJson$4, 20).then((wasm) => {\n wasm.init();\n const obj = {\n init: () => { wasm.init(); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 64,\n digestSize: 20,\n };\n return obj;\n });\n}\n\nfunction calculateKeyBuffer(hasher, key) {\n const { blockSize } = hasher;\n const buf = getUInt8Buffer(key);\n if (buf.length > blockSize) {\n hasher.update(buf);\n const uintArr = hasher.digest('binary');\n hasher.init();\n return uintArr;\n }\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.length);\n}\nfunction calculateHmac(hasher, key) {\n hasher.init();\n const { blockSize } = hasher;\n const keyBuf = calculateKeyBuffer(hasher, key);\n const keyBuffer = new Uint8Array(blockSize);\n keyBuffer.set(keyBuf);\n const opad = new Uint8Array(blockSize);\n for (let i = 0; i < blockSize; i++) {\n const v = keyBuffer[i];\n opad[i] = v ^ 0x5C;\n keyBuffer[i] = v ^ 0x36;\n }\n hasher.update(keyBuffer);\n const obj = {\n init: () => {\n hasher.init();\n hasher.update(keyBuffer);\n return obj;\n },\n update: (data) => {\n hasher.update(data);\n return obj;\n },\n digest: ((outputType) => {\n const uintArr = hasher.digest('binary');\n hasher.init();\n hasher.update(opad);\n hasher.update(uintArr);\n return hasher.digest(outputType);\n }),\n save: () => {\n throw new Error('save() not supported');\n },\n load: () => {\n throw new Error('load() not supported');\n },\n blockSize: hasher.blockSize,\n digestSize: hasher.digestSize,\n };\n return obj;\n}\n/**\n * Calculates HMAC hash\n * @param hash Hash algorithm to use. It has to be the return value of a function like createSHA1()\n * @param key Key (string, Buffer or TypedArray)\n */\nfunction createHMAC(hash, key) {\n if (!hash || !hash.then) {\n throw new Error('Invalid hash function is provided! Usage: createHMAC(createMD5(), \"key\").');\n }\n return hash.then((hasher) => calculateHmac(hasher, key));\n}\n\nfunction calculatePBKDF2(digest, salt, iterations, hashLength, outputType) {\n return __awaiter(this, void 0, void 0, function* () {\n const DK = new Uint8Array(hashLength);\n const block1 = new Uint8Array(salt.length + 4);\n const block1View = new DataView(block1.buffer);\n const saltBuffer = getUInt8Buffer(salt);\n const saltUIntBuffer = new Uint8Array(saltBuffer.buffer, saltBuffer.byteOffset, saltBuffer.length);\n block1.set(saltUIntBuffer);\n let destPos = 0;\n const hLen = digest.digestSize;\n const l = Math.ceil(hashLength / hLen);\n let T = null;\n let U = null;\n for (let i = 1; i <= l; i++) {\n block1View.setUint32(salt.length, i);\n digest.init();\n digest.update(block1);\n T = digest.digest('binary');\n U = T.slice();\n for (let j = 1; j < iterations; j++) {\n digest.init();\n digest.update(U);\n U = digest.digest('binary');\n for (let k = 0; k < hLen; k++) {\n T[k] ^= U[k];\n }\n }\n DK.set(T.subarray(0, hashLength - destPos), destPos);\n destPos += hLen;\n }\n if (outputType === 'binary') {\n return DK;\n }\n const digestChars = new Uint8Array(hashLength * 2);\n return getDigestHex(digestChars, DK, hashLength);\n });\n}\nconst validateOptions$2 = (options) => {\n if (!options || typeof options !== 'object') {\n throw new Error('Invalid options parameter. It requires an object.');\n }\n if (!options.hashFunction || !options.hashFunction.then) {\n throw new Error('Invalid hash function is provided! Usage: pbkdf2(\"password\", \"salt\", 1000, 32, createSHA1()).');\n }\n if (!Number.isInteger(options.iterations) || options.iterations < 1) {\n throw new Error('Iterations should be a positive number');\n }\n if (!Number.isInteger(options.hashLength) || options.hashLength < 1) {\n throw new Error('Hash length should be a positive number');\n }\n if (options.outputType === undefined) {\n options.outputType = 'hex';\n }\n if (!['hex', 'binary'].includes(options.outputType)) {\n throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary']`);\n }\n};\n/**\n * Generates a new PBKDF2 hash for the supplied password\n */\nfunction pbkdf2(options) {\n return __awaiter(this, void 0, void 0, function* () {\n validateOptions$2(options);\n const hmac = yield createHMAC(options.hashFunction, options.password);\n return calculatePBKDF2(hmac, options.salt, options.iterations, options.hashLength, options.outputType);\n });\n}\n\nvar name$3 = \"scrypt\";\nvar data$3 = \"AGFzbQEAAAABIwZgAX8Bf2AAAX9gBX9/fn9/AGAEf39/fwBgAX8AYAN/f38AAwcGAAECAwQFBAUBcAEBAQUGAQECgIACBggBfwFBkIgECwc5BAZtZW1vcnkCABJIYXNoX1NldE1lbW9yeVNpemUAAA5IYXNoX0dldEJ1ZmZlcgABBnNjcnlwdAAFCpcmBlsBAX9BACEBAkAgAEEAKAKACGsiAEUNAAJAIABBEHYgAEGAgHxxIABJaiIAQABBf0cNAEH/ASEBDAELQQAhAUEAQQApA4AIIABBEHStfDcDgAgLIAFBGHRBGHULagECfwJAQQAoAogIIgANAEEAPwBBEHQiADYCiAhBgIAgQQAoAoAIayIBRQ0AAkAgAUEQdiABQYCAfHEgAUlqIgBAAEF/Rw0AQQAPC0EAQQApA4AIIABBEHStfDcDgAhBACgCiAghAAsgAAu5EAMMfwl+An8gAUEFdCEFIAQgAUEIdGohBiAEIAFBB3QiB2ohCAJAAkACQAJAIAFFDQBBACEJIAAhCiAEIQsDQCALIAooAgA2AgAgCkEEaiEKIAtBBGohCyAJQQFqIgkgBUkNAAsgAlANAiABQQh0IQxBACENIAMhDgNAQQAhCSABIQ8DQCAOIAlqIgogBCAJaiILKQMANwMAIApBCGogC0EIaikDADcDACAKQRBqIAtBEGopAwA3AwAgCkEYaiALQRhqKQMANwMAIApBIGogC0EgaikDADcDACAKQShqIAtBKGopAwA3AwAgCkEwaiALQTBqKQMANwMAIApBOGogC0E4aikDADcDACAKQcAAaiALQcAAaikDADcDACAKQcgAaiALQcgAaikDADcDACAKQdAAaiALQdAAaikDADcDACAKQdgAaiALQdgAaikDADcDACAKQeAAaiALQeAAaikDADcDACAKQegAaiALQegAaikDADcDACAKQfAAaiALQfAAaikDADcDACAKQfgAaiALQfgAaikDADcDACAJQYABaiEJIA9Bf2oiDw0ACyAEIAggBiABEAMgDiEJIAQhDyABIRADQCAJIAdqIgogDyAHaiILKQMANwMAIApBCGogC0EIaikDADcDACAKQRBqIAtBEGopAwA3AwAgCkEYaiALQRhqKQMANwMAIApBIGogC0EgaikDADcDACAKQShqIAtBKGopAwA3AwAgCkEwaiALQTBqKQMANwMAIApBOGogC0E4aikDADcDACAKQcAAaiALQcAAaikDADcDACAKQcgAaiALQcgAaikDADcDACAKQdAAaiALQdAAaikDADcDACAKQdgAaiALQdgAaikDADcDACAKQeAAaiALQeAAaikDADcDACAKQegAaiALQegAaikDADcDACAKQfAAaiALQfAAaikDADcDACAKQfgAaiALQfgAaikDADcDACAJQYABaiEJIA9BgAFqIQ8gEEF/aiIQDQALIAggBCAGIAEQAyAOIAxqIQ4gDUECaiINrSACVA0ADAILCyACUA0CIAhBQGoiCikDOCERIAopAzAhEiAKKQMoIRMgCikDICEUIAopAxghFSAKKQMQIRYgCikDCCEXIAopAwAhGEECIQoDQCAKrSEZIApBAmohCiAZIAJUDQALIAYgETcDOCAGIBI3AzAgBiATNwMoIAYgFDcDICAGIBU3AxggBiAWNwMQIAYgFzcDCCAGIBg3AwALAkAgAUUNACAHQUBqIgogCGohGiACp0F/aiEOIAogBGohGyABQQd0IQ1BACEMA0AgAyANIBsoAgAgDnFsaiEHQQAhCSABIQ8DQCAEIAlqIgogCikDACAHIAlqIgspAwCFNwMAIApBCGoiECAQKQMAIAtBCGopAwCFNwMAIApBEGoiECAQKQMAIAtBEGopAwCFNwMAIApBGGoiECAQKQMAIAtBGGopAwCFNwMAIApBIGoiECAQKQMAIAtBIGopAwCFNwMAIApBKGoiECAQKQMAIAtBKGopAwCFNwMAIApBMGoiECAQKQMAIAtBMGopAwCFNwMAIApBOGoiECAQKQMAIAtBOGopAwCFNwMAIApBwABqIhAgECkDACALQcAAaikDAIU3AwAgCkHIAGoiECAQKQMAIAtByABqKQMAhT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AgiAyAAIAGtIgQgAyAAQQd0IgUgAmxqIgMgAyAFIAFsaiIGEAIgAkEBRg0AIAJBf2ohASAFIQIDQEEAKAKICCACaiAAIAQgAyAGEAIgAiAFaiECIAFBf2oiAQ0ACwsL\";\nvar hash$3 = \"d96fb75f\";\nvar wasmJson$3 = {\n\tname: name$3,\n\tdata: data$3,\n\thash: hash$3\n};\n\nfunction scryptInternal(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { costFactor, blockSize, parallelism, hashLength, } = options;\n const SHA256Hasher = createSHA256();\n const blockData = yield pbkdf2({\n password: options.password,\n salt: options.salt,\n iterations: 1,\n hashLength: 128 * blockSize * parallelism,\n hashFunction: SHA256Hasher,\n outputType: 'binary',\n });\n const scryptInterface = yield WASMInterface(wasmJson$3, 0);\n // last block is for storing the temporary vectors\n const VSize = 128 * blockSize * costFactor;\n const XYSize = 256 * blockSize;\n scryptInterface.setMemorySize(blockData.length + VSize + XYSize);\n scryptInterface.writeMemory(blockData, 0);\n // mix blocks\n scryptInterface.getExports().scrypt(blockSize, costFactor, parallelism);\n const expensiveSalt = scryptInterface\n .getMemory()\n .subarray(0, 128 * blockSize * parallelism);\n const outputData = yield pbkdf2({\n password: options.password,\n salt: expensiveSalt,\n iterations: 1,\n hashLength,\n hashFunction: SHA256Hasher,\n outputType: 'binary',\n });\n if (options.outputType === 'hex') {\n const digestChars = new Uint8Array(hashLength * 2);\n return getDigestHex(digestChars, outputData, hashLength);\n }\n // return binary format\n return outputData;\n });\n}\n// eslint-disable-next-line no-bitwise\nconst isPowerOfTwo = (v) => v && !(v & (v - 1));\nconst validateOptions$1 = (options) => {\n if (!options || typeof options !== 'object') {\n throw new Error('Invalid options parameter. It requires an object.');\n }\n if (!Number.isInteger(options.blockSize) || options.blockSize < 1) {\n throw new Error('Block size should be a positive number');\n }\n if (!Number.isInteger(options.costFactor)\n || options.costFactor < 2\n || !isPowerOfTwo(options.costFactor)) {\n throw new Error('Cost factor should be a power of 2, greater than 1');\n }\n if (!Number.isInteger(options.parallelism) || options.parallelism < 1) {\n throw new Error('Parallelism should be a positive number');\n }\n if (!Number.isInteger(options.hashLength) || options.hashLength < 1) {\n throw new Error('Hash length should be a positive number.');\n }\n if (options.outputType === undefined) {\n options.outputType = 'hex';\n }\n if (!['hex', 'binary'].includes(options.outputType)) {\n throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary']`);\n }\n};\n/**\n * Calculates hash using the scrypt password-based key derivation function\n * @returns Computed hash as a hexadecimal string or as\n * Uint8Array depending on the outputType option\n */\nfunction scrypt(options) {\n return __awaiter(this, void 0, void 0, function* () {\n validateOptions$1(options);\n return scryptInternal(options);\n });\n}\n\nvar name$2 = \"bcrypt\";\nvar data$2 = \"AGFzbQEAAAABFwRgAAF/YAR/f39/AGADf39/AGABfwF/AwUEAAECAwQFAXABAQEFBAEBAgIGCAF/AUGQqwULBzQEBm1lbW9yeQIADkhhc2hfR2V0QnVmZmVyAAAGYmNyeXB0AAINYmNyeXB0X3ZlcmlmeQADCuRbBAUAQYArC5FVAxJ/BX4HfyMAQfAAayEEIAJBADoAAiACQargADsAAAJAIAEtAABBKkcNACABLQABQTBHDQAgAkExOgABCwJAIAEsAAUgASwABEEKbGpB8HtqIgVBBEkNAEEBIAV0IQYgAUEHaiEFIARBGGohByAEQQhqIQgDQCAFLQAAQWBqIglB3wBLDQEgCUGACGotAAAiCkE/Sw0BIAVBAWotAABBYGoiCUHfAEsNASAJQYAIai0AACIJQT9LDQEgCCAJQQR2IApBAnRyOgAAAkAgCEEBaiIIIAdPDQAgBUECai0AAEFgaiIKQd8ASw0CIApBgAhqLQAAIgpBP0sNAiAIIApBAnYgCUEEdHI6AAAgCEEBaiIIIAdPDQAgBUEDai0AAEFgaiIJQd8ASw0CIAlBgAhqLQAAIglBP0sNAiAIIAkgCkEGdHI6AAAgBUEEaiEFIAhBAWoiCCAHSQ0BCwsgBCAEKAIIIgVBGHQgBUEIdEGAgPwHcXIgBUEIdkGA/gNxIAVBGH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pM5ZHY2h7PeWLOb34+zWaxGBYFHSz9xdKPhJki+/ZX8yP1I3YypjE1qJMCzcxWYoHwrLXrdVqXNhZuzHPSiJJilt7QSbmBG5BQTBRWxnG9x8bmChR6MgbQ4UWae/LD/VOqyQAPqGLivyW79tK9NQVpEnEiAgSyfM/Ltiucds3APhFT0+NAFmC9qzjwrUclnCA4unbORvfFoa93YGB1IE7+y4XYjeiKsPmqen6q+UxcwkgZjIr7AuRqwwH54evWafjUkKDeXKYtJQk/n+YIwjJhTrdb4nfO49+PV+ZywzqIaj8k0wijhS6KGRNEc3ADIjgJpNAxnymY+i4IiWxO7OYhKEV3E9A4z2ZUvmwM6TS3KazA3VB8ybXVhD8XCUe12dUWkhv7eYk=\";\nvar hash$2 = \"9f4c7b9e\";\nvar wasmJson$2 = {\n\tname: name$2,\n\tdata: data$2,\n\thash: hash$2\n};\n\nfunction bcryptInternal(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const { costFactor, password, salt } = options;\n const bcryptInterface = yield WASMInterface(wasmJson$2, 0);\n bcryptInterface.writeMemory(getUInt8Buffer(salt), 0);\n const passwordBuffer = getUInt8Buffer(password);\n bcryptInterface.writeMemory(passwordBuffer, 16);\n const shouldEncode = options.outputType === 'encoded' ? 1 : 0;\n bcryptInterface.getExports().bcrypt(passwordBuffer.length, costFactor, shouldEncode);\n const memory = bcryptInterface.getMemory();\n if (options.outputType === 'encoded') {\n return intArrayToString(memory, 60);\n }\n if (options.outputType === 'hex') {\n const digestChars = new Uint8Array(24 * 2);\n return getDigestHex(digestChars, memory, 24);\n }\n // return binary format\n // the data is copied to allow GC of the original memory buffer\n return memory.slice(0, 24);\n });\n}\nconst validateOptions = (options) => {\n if (!options || typeof options !== 'object') {\n throw new Error('Invalid options parameter. It requires an object.');\n }\n if (!Number.isInteger(options.costFactor) || options.costFactor < 4 || options.costFactor > 31) {\n throw new Error('Cost factor should be a number between 4 and 31');\n }\n options.password = getUInt8Buffer(options.password);\n if (options.password.length < 1) {\n throw new Error('Password should be at least 1 byte long');\n }\n if (options.password.length > 72) {\n throw new Error('Password should be at most 72 bytes long');\n }\n options.salt = getUInt8Buffer(options.salt);\n if (options.salt.length !== 16) {\n throw new Error('Salt should be 16 bytes long');\n }\n if (options.outputType === undefined) {\n options.outputType = 'encoded';\n }\n if (!['hex', 'binary', 'encoded'].includes(options.outputType)) {\n throw new Error(`Insupported output type ${options.outputType}. Valid values: ['hex', 'binary', 'encoded']`);\n }\n};\n/**\n * Calculates hash using the bcrypt password-hashing function\n * @returns Computed hash\n */\nfunction bcrypt(options) {\n return __awaiter(this, void 0, void 0, function* () {\n validateOptions(options);\n return bcryptInternal(options);\n });\n}\nconst validateHashCharacters = (hash) => {\n if (!/^\\$2[axyb]\\$[0-3][0-9]\\$[./A-Za-z0-9]{53}$/.test(hash)) {\n return false;\n }\n if (hash[4] === '0' && parseInt(hash[5], 10) < 4) {\n return false;\n }\n if (hash[4] === '3' && parseInt(hash[5], 10) > 1) {\n return false;\n }\n return true;\n};\nconst validateVerifyOptions = (options) => {\n if (!options || typeof options !== 'object') {\n throw new Error('Invalid options parameter. It requires an object.');\n }\n if (options.hash === undefined || typeof options.hash !== 'string') {\n throw new Error('Hash should be specified');\n }\n if (options.hash.length !== 60) {\n throw new Error('Hash should be 60 bytes long');\n }\n if (!validateHashCharacters(options.hash)) {\n throw new Error('Invalid hash');\n }\n options.password = getUInt8Buffer(options.password);\n if (options.password.length < 1) {\n throw new Error('Password should be at least 1 byte long');\n }\n if (options.password.length > 72) {\n throw new Error('Password should be at most 72 bytes long');\n }\n};\n/**\n * Verifies password using bcrypt password-hashing function\n * @returns True if the encoded hash matches the password\n */\nfunction bcryptVerify(options) {\n return __awaiter(this, void 0, void 0, function* () {\n validateVerifyOptions(options);\n const { hash, password } = options;\n const bcryptInterface = yield WASMInterface(wasmJson$2, 0);\n bcryptInterface.writeMemory(getUInt8Buffer(hash), 0);\n const passwordBuffer = getUInt8Buffer(password);\n bcryptInterface.writeMemory(passwordBuffer, 60);\n return !!bcryptInterface.getExports().bcrypt_verify(passwordBuffer.length);\n });\n}\n\nvar name$1 = \"whirlpool\";\nvar data$1 = \"AGFzbQEAAAABEQRgAAF/YAF/AGACf38AYAAAAwkIAAECAwEDAAEEBQFwAQEBBQQBAQICBg4CfwFB0JsFC38AQYAYCwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAADC0hhc2hfVXBkYXRlAAQKSGFzaF9GaW5hbAAFDUhhc2hfR2V0U3RhdGUABg5IYXNoX0NhbGN1bGF0ZQAHClNUQVRFX1NJWkUDAQrgGggFAEGAGQv0BgEIfiAAKQMAIQFBAEEAKQOAmwEiAjcDgJkBIAApAxghAyAAKQMQIQQgACkDCCEFQQBBACkDmJsBIgY3A5iZAUEAQQApA5CbASIHNwOQmQFBAEEAKQOImwEiCDcDiJkBQQAgASAChTcDwJkBQQAgBSAIhTcDyJkBQQAgBCAHhTcD0JkBQQAgAyAGhTcD2JkBIAApAyAhAUEAQQApA6CbASICNwOgmQFBACABIAKFNwPgmQEgACkDKCEBQQBBACkDqJsBIgI3A6iZAUEAIAEgAoU3A+iZASAAKQMwIQFBAEEAKQOwmwEiAjcDsJkBQQAgASAChTcD8JkBIAApAzghAUEAQQApA7ibASICNwO4mQFBACABIAKFNwP4mQFBAEKYxpjG/pDugM8ANwOAmgFBgJkBQYCaARACQcCZAUGAmQEQAkEAQrbMyq6f79vI0gA3A4CaAUGAmQFBgJoBEAJBwJkBQYCZARACQQBC4Pju9LiUw701NwOAmgFBgJkBQYCaARACQcCZAUGAmQEQAkEAQp3A35bs5ZL/1wA3A4CaAUGAmQFBgJoBEAJBwJkBQYCZARACQQBCle7dqf6TvKVaNwOAmgFBgJkBQYCaARACQcCZAUGAmQEQAkEAQtiSp9GQlui1hX83A4CaAUGAmQFBgJoBEAJBwJkBQYCZARACQQBCvbvBoL/Zz4LnADcDgJoBQYCZAUGAmgEQAkHAmQFBgJkBEAJBAELkz4Ta+LTfylg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SgooChdiFB1XFxtXNoxuIb4+Mf4kz/ta4aGIoZEpBHCkAAAAA==\";\nvar hash$1 = \"358808f8\";\nvar wasmJson$1 = {\n\tname: name$1,\n\tdata: data$1,\n\thash: hash$1\n};\n\nconst mutex$1 = new Mutex();\nlet wasmCache$1 = null;\n/**\n * Calculates Whirlpool hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction whirlpool(data) {\n if (wasmCache$1 === null) {\n return lockedCreate(mutex$1, wasmJson$1, 64)\n .then((wasm) => {\n wasmCache$1 = wasm;\n return wasmCache$1.calculate(data);\n });\n }\n try {\n const hash = wasmCache$1.calculate(data);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new Whirlpool hash instance\n */\nfunction createWhirlpool() {\n return WASMInterface(wasmJson$1, 64).then((wasm) => {\n wasm.init();\n const obj = {\n init: () => { wasm.init(); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 64,\n digestSize: 64,\n };\n return obj;\n });\n}\n\nvar name = \"sm3\";\nvar data = \"AGFzbQEAAAABDANgAAF/YAAAYAF/AAMIBwABAgIBAAIEBQFwAQEBBQQBAQICBg4CfwFB8IkFC38AQYAICwdwCAZtZW1vcnkCAA5IYXNoX0dldEJ1ZmZlcgAACUhhc2hfSW5pdAABC0hhc2hfVXBkYXRlAAIKSGFzaF9GaW5hbAAEDUhhc2hfR2V0U3RhdGUABQ5IYXNoX0NhbGN1bGF0ZQAGClNUQVRFX1NJWkUDAQq4GAcFAEGACQtRAEEAQs3ct5zuycP9sH83AqCJAUEAQrzhvMuqlc6YFjcCmIkBQQBC14WRuYHAgcVaNwKQiQFBAELvrICcl9esiskANwKIiQFBAEIANwKAiQELiAIBBH8CQCAARQ0AQQAhAUEAQQAoAoCJASICIABqIgM2AoCJASACQT9xIQQCQCAD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EYdCABQQh0QYCA/AdxciABQQh2QYD+A3EgAUEYdnJyNgKECUEAQQAoApCJASIBQRh0IAFBCHRBgID8B3FyIAFBCHZBgP4DcSABQRh2cnI2AogJQQBBACgClIkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYCjAlBAEEAKAKYiQEiAUEYdCABQQh0QYCA/AdxciABQQh2QYD+A3EgAUEYdnJyNgKQCUEAQQAoApyJASIBQRh0IAFBCHRBgID8B3FyIAFBCHZBgP4DcSABQRh2cnI2ApQJQQBBACgCoIkBIgFBGHQgAUEIdEGAgPwHcXIgAUEIdkGA/gNxIAFBGHZycjYCmAlBAEEAKAKkiQEiAUEYdCABQQh0QYCA/AdxciABQQh2QYD+A3EgAUEYdnJyNgKcCSAAQRBqJAALBgBBgIkBC8ABAQJ/QQBCzdy3nO7Jw/2wfzcCoIkBQQBCvOG8y6qVzpgWNwKYiQFBAELXhZG5gcCBxVo3ApCJAUEAQu+sgJyX16yKyQA3AoiJAUEAQgA3AoCJAQJAIABFDQBBACAANgKAiQFBgAkhAQJAIABBwABJDQBBgAkhAQNAIAEQAyABQcAAaiEBIABBQGoiAEE/Sw0ACyAARQ0BC0EAIQIDQCACQaiJAWogASACai0AADoAACAAIAJBAWoiAkcNAAsLEAQLC1ECAEGACAsEaAAAAABBkAgLQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\";\nvar hash = \"6e6f46ad\";\nvar wasmJson = {\n\tname: name,\n\tdata: data,\n\thash: hash\n};\n\nconst mutex = new Mutex();\nlet wasmCache = null;\n/**\n * Calculates SM3 hash\n * @param data Input data (string, Buffer or TypedArray)\n * @returns Computed hash as a hexadecimal string\n */\nfunction sm3(data) {\n if (wasmCache === null) {\n return lockedCreate(mutex, wasmJson, 32)\n .then((wasm) => {\n wasmCache = wasm;\n return wasmCache.calculate(data);\n });\n }\n try {\n const hash = wasmCache.calculate(data);\n return Promise.resolve(hash);\n }\n catch (err) {\n return Promise.reject(err);\n }\n}\n/**\n * Creates a new SM3 hash instance\n */\nfunction createSM3() {\n return WASMInterface(wasmJson, 32).then((wasm) => {\n wasm.init();\n const obj = {\n init: () => { wasm.init(); return obj; },\n update: (data) => { wasm.update(data); return obj; },\n digest: (outputType) => wasm.digest(outputType),\n save: () => wasm.save(),\n load: (data) => { wasm.load(data); return obj; },\n blockSize: 64,\n digestSize: 32,\n };\n return obj;\n });\n}\n\nexport { adler32, argon2Verify, argon2d, argon2i, argon2id, bcrypt, bcryptVerify, blake2b, blake2s, blake3, crc32, crc32c, createAdler32, createBLAKE2b, createBLAKE2s, createBLAKE3, createCRC32, createCRC32C, createHMAC, createKeccak, createMD4, createMD5, createRIPEMD160, createSHA1, createSHA224, createSHA256, createSHA3, createSHA384, createSHA512, createSM3, createWhirlpool, createXXHash128, createXXHash3, createXXHash32, createXXHash64, keccak, md4, md5, pbkdf2, ripemd160, scrypt, sha1, sha224, sha256, sha3, sha384, sha512, sm3, whirlpool, xxhash128, xxhash3, xxhash32, xxhash64 };\n","import { type WritableStreamBuffer } from \"stream-buffers\";\n\nimport { WARCParser } from \"./warcparser\";\nimport { type WARCRecord } from \"./warcrecord\";\nimport { postToGetUrl, getSurt } from \"./utils\";\nimport { type IndexCommandArgs, type CdxIndexCommandArgs } from \"../commands\";\nimport {\n type StreamResults,\n type Request,\n type IndexerOffsetLength,\n} from \"./types\";\n\nexport const DEFAULT_FIELDS = [\"offset\", \"warc-type\", \"warc-target-uri\"];\n\n// ===========================================================================\nabstract class BaseIndexer {\n opts: Partial;\n fields: string[];\n reqFields: string[];\n parseHttp: boolean;\n\n constructor(\n opts: Partial = {},\n defaultFields: string[] = DEFAULT_FIELDS,\n ) {\n this.opts = opts;\n if (opts.fields) {\n this.fields = opts.fields;\n this.reqFields = this.fields.filter((x) => isRequestHeader(x));\n } else {\n this.fields = defaultFields;\n this.reqFields = [];\n }\n this.parseHttp = false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n serialize(result: Record) {\n return JSON.stringify(result) + \"\\n\";\n }\n\n write(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result: Record,\n out: WritableStreamBuffer | NodeJS.WriteStream,\n ) {\n // @ts-expect-error incompatible function signatures are actually the same\n out.write(this.serialize(result));\n }\n\n async writeAll(\n files: StreamResults,\n out: WritableStreamBuffer | NodeJS.WriteStream,\n ) {\n for await (const result of this.iterIndex(files)) {\n this.write(result, out);\n }\n }\n\n async *iterIndex(files: StreamResults) {\n const params = { strictHeaders: true, parseHttp: this.parseHttp };\n\n for (const { filename, reader } of files) {\n const parser = new WARCParser(reader, params);\n\n yield* this.iterRecords(parser, filename);\n }\n }\n\n async *iterRecords(parser: WARCParser, filename: string) {\n for await (const record of parser) {\n await record.skipFully();\n const result = this.indexRecord(record, parser, filename);\n if (result) {\n yield result;\n }\n }\n }\n\n filterRecord?(record: WARCRecord): boolean;\n\n indexRecord(\n record: WARCRecord,\n indexerOffset: IndexerOffsetLength,\n filename: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ): Record | null {\n if (this.filterRecord && !this.filterRecord(record)) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record = {};\n\n const { offset, recordLength: length } = indexerOffset;\n\n const special = { offset, length, filename };\n\n for (const field of this.fields) {\n if (field in special) {\n result[field] = special[field as keyof typeof special];\n } else {\n this.setField(field, record, result);\n }\n }\n\n return result;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setField(field: string, record: WARCRecord, result: Record) {\n const value = this.getField(field, record);\n if (value !== null) {\n result[field] = value;\n }\n }\n\n getField(\n field: string,\n record: WARCRecord,\n ): string | number | null | undefined {\n // only handle req. fields for 'request' records\n if (field.startsWith(\"req.\")) {\n if (record.warcType === \"request\") {\n field = field.slice(4);\n } else {\n return null;\n }\n }\n\n if (field === \"http:status\") {\n if (\n record.httpHeaders &&\n (record.warcType === \"response\" || record.warcType === \"revisit\")\n ) {\n return record.httpHeaders.statusCode;\n }\n return null;\n }\n\n if (field.startsWith(\"http:\")) {\n if (record.httpHeaders) {\n const headers: Headers | Map = record.httpHeaders.headers;\n const name = field.slice(5);\n let value = headers.get(name);\n // just do lower-case search to avoid conversion in case there may be errors\n if (headers instanceof Map) {\n const nameLower = name.toLowerCase();\n for (const keyName of headers.keys()) {\n if (nameLower === keyName.toLowerCase()) {\n value = headers.get(keyName);\n }\n }\n }\n return value;\n }\n return null;\n }\n\n return record.warcHeaders.headers.get(field) || null;\n }\n}\n\n// ===========================================================================\nexport class Indexer extends BaseIndexer {\n constructor(opts?: Partial, defaultFields?: string[]) {\n super(opts, defaultFields);\n\n for (const field of this.fields) {\n if (field.startsWith(\"http:\")) {\n this.parseHttp = true;\n break;\n }\n }\n }\n}\n\n// ===========================================================================\nexport const DEFAULT_CDX_FIELDS =\n \"urlkey,timestamp,url,mime,status,digest,length,offset,filename\".split(\",\");\nexport const DEFAULT_LEGACY_CDX_FIELDS =\n \"urlkey,timestamp,url,mime,status,digest,redirect,meta,length,offset,filename\".split(\n \",\",\n );\n\n// ===========================================================================\nexport interface CDXAndRecord {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n cdx: Record;\n record: WARCRecord;\n reqRecord: WARCRecord | null;\n}\n\n// ===========================================================================\nexport class CDXIndexer extends Indexer {\n includeAll: boolean;\n overrideIndexForAll: boolean;\n noSurt: boolean;\n _lastRecord: WARCRecord | null;\n\n constructor(opts?: Partial) {\n super(opts, DEFAULT_CDX_FIELDS);\n this.includeAll = Boolean(opts?.all);\n this.overrideIndexForAll = Boolean(opts?.all);\n this.parseHttp = true;\n this.noSurt = Boolean(opts?.noSurt);\n this._lastRecord = null;\n\n switch (opts?.format) {\n case \"cdxj\":\n this.serialize = this.serializeCDXJ;\n break;\n\n case \"cdx\":\n this.serialize = this.serializeCDX11;\n break;\n\n case \"json\":\n default:\n // default write\n break;\n }\n }\n\n override async *iterRecords(parser: WARCParser, filename: string) {\n this._lastRecord = null;\n\n for await (const record of parser) {\n await record.readFully();\n\n const result = this.indexRecord(record, parser, filename);\n if (result) {\n yield result;\n }\n }\n\n const result = this.indexRecord(null, parser, filename);\n if (result) {\n yield result;\n }\n }\n\n override filterRecord(record: WARCRecord) {\n if (this.includeAll) {\n return true;\n }\n\n const type = record.warcType;\n if (type === \"request\" || type === \"warcinfo\") {\n return false;\n }\n\n if (type === \"metadata\" || type === \"resource\") {\n if (record.warcContentType === \"application/warc-fields\") {\n return false;\n }\n }\n\n return true;\n }\n\n override indexRecord(\n record: WARCRecord | null,\n indexOffset: IndexerOffsetLength,\n filename: string,\n ) {\n if (this.overrideIndexForAll) {\n if (!record) {\n return null;\n }\n return super.indexRecord(record, indexOffset, filename);\n }\n\n const lastRecord = this._lastRecord;\n this._lastRecord = record;\n\n if (record) {\n record._offset = indexOffset.offset;\n record._length = indexOffset.recordLength;\n }\n\n if (!lastRecord) {\n return null;\n }\n\n if (!record || lastRecord.warcTargetURI != record.warcTargetURI) {\n return this.indexRecordPair(lastRecord, null, indexOffset, filename);\n }\n\n const warcType = record.warcType;\n const lastWarcType = lastRecord.warcType;\n\n if (\n warcType === \"request\" &&\n (lastWarcType === \"response\" || lastWarcType === \"revisit\")\n ) {\n this._lastRecord = null;\n return this.indexRecordPair(lastRecord, record, indexOffset, filename);\n } else if (\n (warcType === \"response\" || warcType === \"revisit\") &&\n lastWarcType === \"request\"\n ) {\n this._lastRecord = null;\n return this.indexRecordPair(record, lastRecord, indexOffset, filename);\n } else {\n return this.indexRecordPair(lastRecord, null, indexOffset, filename);\n }\n }\n\n indexRecordPair(\n record: WARCRecord,\n reqRecord: WARCRecord | null,\n indexOffset: IndexerOffsetLength,\n filename: string,\n ) {\n let method;\n let requestBody;\n let url = record.warcTargetURI || \"\";\n\n if (reqRecord?.httpHeaders && reqRecord.httpHeaders.method !== \"GET\") {\n const request: Request = {\n url,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n method: reqRecord.httpHeaders.method!,\n headers: reqRecord.httpHeaders.headers,\n postData: reqRecord.payload,\n };\n\n method = request.method;\n\n if (postToGetUrl(request)) {\n requestBody = request.requestBody;\n url = request.url;\n }\n }\n\n record._urlkey = url;\n\n const res = super.indexRecord(record, indexOffset, filename);\n if (res) {\n if (record._offset !== undefined) {\n res[\"offset\"] = record._offset;\n res[\"length\"] = record._length;\n }\n if (method) {\n res[\"method\"] = method;\n }\n if (requestBody) {\n res[\"requestBody\"] = requestBody;\n }\n\n if (reqRecord && this.reqFields.length) {\n for (const field of this.reqFields) {\n this.setField(field, reqRecord, res);\n }\n }\n }\n\n return res;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n serializeCDXJ(result: Record) {\n const { urlkey, timestamp } = result;\n delete result[\"urlkey\"];\n delete result[\"timestamp\"];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const replacer = (key: string, value: any): any => {\n if ([\"offset\", \"length\", \"status\"].includes(key)) {\n return value === null || value === undefined ? \"\" : \"\" + value;\n }\n return value;\n };\n\n return `${urlkey} ${timestamp} ${JSON.stringify(result, replacer)}\\n`;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n serializeCDX11(result: Record) {\n const value = [];\n\n for (const field of DEFAULT_LEGACY_CDX_FIELDS) {\n value.push(result[field] != undefined ? result[field] : \"-\");\n }\n\n return value.join(\" \") + \"\\n\";\n }\n\n override getField(field: string, record: WARCRecord) {\n let value = null;\n\n switch (field) {\n case \"urlkey\":\n value = record._urlkey || record.warcTargetURI || null;\n return this.noSurt || value === null ? value : getSurt(value);\n\n case \"timestamp\":\n value = record.warcDate ?? \"\";\n return value.replace(/[-:T]/g, \"\").slice(0, 14);\n\n case \"url\":\n return record.warcTargetURI;\n\n case \"mime\":\n switch (record.warcType) {\n case \"revisit\":\n return \"warc/revisit\";\n\n case \"response\":\n case \"request\":\n field = \"http:content-type\";\n break;\n\n default:\n return record.warcContentType;\n }\n value = super.getField(field, record);\n return value ? value.toString().split(\";\", 1)[0]?.trim() : null;\n\n case \"status\":\n return super.getField(\"http:status\", record);\n\n case \"referrer\":\n return super.getField(\"req.http:referer\", record);\n\n case \"digest\":\n value = record.warcPayloadDigest;\n return value ? value.split(\":\", 2)[1] : null;\n\n default:\n return super.getField(field, record);\n }\n }\n}\n\n// ===========================================================================\nexport class CDXAndRecordIndexer extends CDXIndexer {\n constructor(opts?: Partial) {\n super(opts);\n this.overrideIndexForAll = false;\n }\n\n override indexRecordPair(\n record: WARCRecord,\n reqRecord: WARCRecord | null,\n indexOffset: IndexerOffsetLength,\n filename: string,\n ): CDXAndRecord | null {\n const cdx = super.indexRecordPair(record, reqRecord, indexOffset, filename);\n return cdx && { cdx, record, reqRecord };\n }\n}\n\nexport function isRequestHeader(header: string) {\n return header.startsWith(\"req.\") || header.toLowerCase() === \"referrer\";\n}\n"],"mappings":"mxBAAA,IAAAA,EAAAC,EAAAC,GAAA,cAGA,IAAIC,GAAa,OAAO,WAAe,KACtB,OAAO,YAAgB,KACvB,OAAO,WAAe,IAEvC,SAASC,GAAKC,EAAKC,EAAK,CACtB,OAAO,OAAO,UAAU,eAAe,KAAKD,EAAKC,CAAG,CACtD,CAEAJ,EAAQ,OAAS,SAAUG,EAAkC,CAE3D,QADIE,EAAU,MAAM,UAAU,MAAM,KAAK,UAAW,CAAC,EAC9CA,EAAQ,QAAQ,CACrB,IAAIC,EAASD,EAAQ,MAAM,EAC3B,GAAKC,EAEL,IAAI,OAAOA,GAAW,SACpB,MAAM,IAAI,UAAUA,EAAS,oBAAoB,EAGnD,QAASC,KAAKD,EACRJ,GAAKI,EAAQC,CAAC,IAChBJ,EAAII,CAAC,EAAID,EAAOC,CAAC,GAGvB,CAEA,OAAOJ,CACT,EAIAH,EAAQ,UAAY,SAAUQ,EAAKC,EAAM,CACvC,OAAID,EAAI,SAAWC,EAAeD,EAC9BA,EAAI,SAAmBA,EAAI,SAAS,EAAGC,CAAI,GAC/CD,EAAI,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,QACE,OAAOL,EAAO,eAClB,CACA,OAAAM,EAAQ,MAAM,SAASD,EAAOL,CAAM,EAC7BM,EAAQA,EAAM,SAAS,EAAE,MAAM,IAAK,CAAC,EAAE,CAAC,GAAG,KAAK,EAAI,KAE7D,IAAK,SACH,OAAO,MAAM,SAAS,cAAeN,CAAM,EAE7C,IAAK,WACH,OAAO,MAAM,SAAS,mBAAoBA,CAAM,EAElD,IAAK,SACH,OAAAM,EAAQN,EAAO,kBACRM,EAAQA,EAAM,MAAM,IAAK,CAAC,EAAE,CAAC,EAAI,KAE1C,QACE,OAAO,MAAM,SAASD,EAAOL,CAAM,CACvC,CACF,CACF,EAGa+B,GAAN,cAAkCjB,EAAW,CAClD,YAAY1B,EAAqC,CAC/C,MAAMA,CAAI,EACV,KAAK,oBAAsB,EAC7B,CAES,gBACPY,EACAoB,EACAJ,EACApB,EACqB,CACrB,IAAMoC,EAAM,MAAM,gBAAgBhC,EAAQoB,EAAWJ,EAAapB,CAAQ,EAC1E,OAAOoC,GAAO,CAAE,IAAAA,EAAK,OAAAhC,EAAQ,UAAAoB,CAAU,CACzC,CACF,EAEO,SAAS7B,GAAgB0C,EAAgB,CAC9C,OAAOA,EAAO,WAAW,MAAM,GAAKA,EAAO,YAAY,IAAM,UAC/D","names":["require_common","__commonJSMin","exports","TYPED_OK","_has","obj","key","sources","source","p","buf","size","fnTyped","dest","src","src_offs","len","dest_offs","i","chunks","l","pos","chunk","result","fnUntyped","on","require_trees","__commonJSMin","exports","utils","Z_FIXED","Z_BINARY","Z_TEXT","Z_UNKNOWN","zero","buf","len","STORED_BLOCK","STATIC_TREES","DYN_TREES","MIN_MATCH","MAX_MATCH","LENGTH_CODES","LITERALS","L_CODES","D_CODES","BL_CODES","HEAP_SIZE","MAX_BITS","Buf_size","MAX_BL_BITS","END_BLOCK","REP_3_6","REPZ_3_10","REPZ_11_138","extra_lbits","extra_dbits","extra_blbits","bl_order","DIST_CODE_LEN","static_ltree","static_dtree","_dist_code","_length_code","base_length","base_dist","StaticTreeDesc","static_tree","extra_bits","extra_base","elems","max_length","static_l_desc","static_d_desc","static_bl_desc","TreeDesc","dyn_tree","stat_desc","d_code","dist","put_short","s","w","send_bits","value","length","send_code","c","tree","bi_reverse","code","res","bi_flush","gen_bitlen","desc","max_code","stree","has_stree","extra","base","h","n","m","bits","xbits","f","overflow","gen_codes","bl_count","next_code","tr_static_init","init_block","bi_windup","copy_block","header","smaller","depth","_n2","_m2","pqdownheap","k","v","j","compress_block","ltree","dtree","lc","lx","build_tree","node","scan_tree","prevlen","curlen","nextlen","count","max_count","min_count","send_tree","build_bl_tree","max_blindex","send_all_trees","lcodes","dcodes","blcodes","rank","detect_data_type","black_mask","static_init_done","_tr_init","_tr_stored_block","stored_len","last","_tr_align","_tr_flush_block","opt_lenb","static_lenb","_tr_tally","require_adler32","__commonJSMin","exports","module","adler32","adler","buf","len","pos","s1","s2","n","require_crc32","__commonJSMin","exports","module","makeTable","c","table","n","k","crcTable","crc32","crc","buf","len","pos","t","end","i","require_messages","__commonJSMin","exports","module","require_deflate","__commonJSMin","exports","utils","trees","adler32","crc32","msg","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Z_OK","Z_STREAM_END","Z_STREAM_ERROR","Z_DATA_ERROR","Z_BUF_ERROR","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_DEFAULT_STRATEGY","Z_UNKNOWN","Z_DEFLATED","MAX_MEM_LEVEL","MAX_WBITS","DEF_MEM_LEVEL","LENGTH_CODES","LITERALS","L_CODES","D_CODES","BL_CODES","HEAP_SIZE","MAX_BITS","MIN_MATCH","MAX_MATCH","MIN_LOOKAHEAD","PRESET_DICT","INIT_STATE","EXTRA_STATE","NAME_STATE","COMMENT_STATE","HCRC_STATE","BUSY_STATE","FINISH_STATE","BS_NEED_MORE","BS_BLOCK_DONE","BS_FINISH_STARTED","BS_FINISH_DONE","OS_CODE","err","strm","errorCode","rank","f","zero","buf","len","flush_pending","s","flush_block_only","last","put_byte","b","putShortMSB","read_buf","start","size","longest_match","cur_match","chain_length","scan","match","best_len","nice_match","limit","_win","wmask","prev","strend","scan_end1","scan_end","fill_window","_w_size","p","n","m","more","str","deflate_stored","flush","max_block_size","max_start","deflate_fast","hash_head","bflush","deflate_slow","max_insert","deflate_rle","deflate_huff","Config","good_length","max_lazy","nice_length","max_chain","func","configuration_table","lm_init","DeflateState","deflateResetKeep","deflateReset","ret","deflateSetHeader","head","deflateInit2","level","method","windowBits","memLevel","strategy","wrap","deflateInit","deflate","old_flush","beg","val","header","level_flags","bstate","deflateEnd","status","deflateSetDictionary","dictionary","dictLength","avail","next","input","tmpDict","require_strings","__commonJSMin","exports","utils","STR_APPLY_OK","STR_APPLY_UIA_OK","_utf8len","q","str","buf","c","c2","m_pos","i","str_len","buf_len","buf2binstring","len","result","max","out","c_len","utf16buf","pos","require_zstream","__commonJSMin","exports","module","ZStream","require_deflate","__commonJSMin","exports","zlib_deflate","utils","strings","msg","ZStream","toString","Z_NO_FLUSH","Z_FINISH","Z_OK","Z_STREAM_END","Z_SYNC_FLUSH","Z_DEFAULT_COMPRESSION","Z_DEFAULT_STRATEGY","Z_DEFLATED","Deflate","options","opt","status","dict","data","mode","strm","chunkSize","_mode","chunk","deflate","input","deflator","deflateRaw","gzip","require_inffast","__commonJSMin","exports","module","BAD","TYPE","strm","start","state","_in","last","_out","beg","end","dmax","wsize","whave","wnext","s_window","hold","bits","lcode","dcode","lmask","dmask","here","op","len","dist","from","from_source","input","output","top","dolen","dodist","require_inftrees","__commonJSMin","exports","module","utils","MAXBITS","ENOUGH_LENS","ENOUGH_DISTS","CODES","LENS","DISTS","lbase","lext","dbase","dext","type","lens","lens_index","codes","table","table_index","work","opts","bits","len","sym","min","max","root","curr","drop","left","used","huff","incr","fill","low","mask","next","base","base_index","end","count","offs","extra","extra_index","here_bits","here_op","here_val","require_inflate","__commonJSMin","exports","utils","adler32","crc32","inflate_fast","inflate_table","CODES","LENS","DISTS","Z_FINISH","Z_BLOCK","Z_TREES","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","Z_BUF_ERROR","Z_DEFLATED","HEAD","FLAGS","TIME","OS","EXLEN","EXTRA","NAME","COMMENT","HCRC","DICTID","DICT","TYPE","TYPEDO","STORED","COPY_","COPY","TABLE","LENLENS","CODELENS","LEN_","LEN","LENEXT","DIST","DISTEXT","MATCH","LIT","CHECK","LENGTH","DONE","BAD","MEM","SYNC","ENOUGH_LENS","ENOUGH_DISTS","MAX_WBITS","DEF_WBITS","zswap32","q","InflateState","inflateResetKeep","strm","state","inflateReset","inflateReset2","windowBits","wrap","inflateInit2","ret","inflateInit","virgin","lenfix","distfix","fixedtables","sym","updatewindow","src","end","copy","dist","inflate","flush","input","output","next","put","have","left","hold","bits","_in","_out","from","from_source","here","here_bits","here_op","here_val","last_bits","last_op","last_val","len","hbuf","opts","n","order","inf_leave","inflateEnd","inflateGetHeader","head","inflateSetDictionary","dictionary","dictLength","dictid","require_constants","__commonJSMin","exports","module","require_gzheader","__commonJSMin","exports","module","GZheader","require_inflate","__commonJSMin","exports","zlib_inflate","utils","strings","c","msg","ZStream","GZheader","toString","Inflate","options","opt","status","data","mode","strm","chunkSize","dictionary","_mode","next_out_utf8","tail","utf8str","allowBufError","chunk","inflate","input","inflator","inflateRaw","require_pako","__commonJSMin","exports","module","assign","deflate","inflate","constants","pako","require_uuid_random","__commonJSMin","exports","module","buf","bufIdx","hexBytes","uuid","uuidBin","crypt0","__require","n","bytes","i","r","randomBytesBuffered","b","import_pako","binaryToString","data","string","accumulator","value","rxEscape","getSurt","url","urlLower","urlObj","surt","args","postToGetUrl","request","method","headers","postData","contentType","ct","key","requestMime","decodeIfNeeded","query","jsonToQueryString","mfdToQueryString","appendRequestQuery","start","jsonToQueryParams","json","ignoreInvalid","q","dupes","getKey","parser","jsonObj","queryValue","i","mfdToQueryParams","mfd","params","boundary","parts","part","m","concatChunks","chunks","size","buffer","offset","chunk","splitChunk","inx","UTFToLatin1","buf","str","x","latin1ToUTF","MULTI_VALUE_ALLOWED","JOIN_MARKER","multiValueHeader","name","HeadersMultiMap","headersInit","entry","prev","v","decoder","NoConcatInflator","pako","options","reader","status","BaseAsyncIterReader","_BaseAsyncIterReader","iter","chunks","size","chunk","concatChunks","streamIter","controller","result","maxLength","lineBuff","line","isIterable","input","isAsyncIterable","AsyncIterReader","_AsyncIterReader","streamOrIter","compressed","dechunk","source","res","first","sep","newValue","value","original","avail_in","inx","lastChunk","lineInx","remainder","splitChunk","sizeLimit","skip","prevOffset","LimitReader","limit","origLimit","CRLF","CRLFCRLF","decoder","StatusAndHeaders","statusline","headers","reencodeHeaders","buff","isHeaders","name","value","latin1ToUTF","encoder","parts","splitRemainder","StatusAndHeadersParser","reader","headersClass","firstLine","HeadersMultiMap","fullStatusLine","headerBuff","readToDoubleCRLF","start","nameEnd","valueStart","valueEnd","reencoded","UTFToLatin1","str","sep","limit","newParts","indexOfDoubleCRLF","buffer","iter","inx","newBuff","chunks","size","lastChunk","chunk","first","remainder","splitChunk","concatChunks","import_uuid_random","decoder","encoder","WARC_1_1","WARC_1_0","REVISIT_PROFILE_1_0","REVISIT_PROFILE_1_1","defaultRecordCT","WARCRecord","_WARCRecord","BaseAsyncIterReader","warcHeaders","reader","url","date","type","filename","httpHeaders","statusline","warcVersion","keepHeadersCase","refersToUrl","refersToDate","checkDate","d","warcHeadersMap","HeadersMultiMap","warcHeadersObj","StatusAndHeaders","uuid","emptyReader","record","headers","isEmpty","opts","info","genInfo","name","value","uri","isContent","source","contentEnc","transferEnc","chunked","AsyncIterReader","maxLength","payload","chunk","LimitReader","res","decoder","EMPTY","WARCParser","_WARCParser","source","options","keepHeadersCase","parseHttp","HeadersMultiMap","AsyncIterReader","nextline","lineLen","value","warcHeaders","LimitReader","firstLineBuff","firstLine","headersParser","StatusAndHeadersParser","record","WARCRecord","httpHeaders","headersLen","toDataView","data","RFC4648","RFC4648_HEX","CROCKFORD","base32Encode","data","variant","options","alphabet","defaultPadding","padding","view","toDataView","bits","value","output","i","import_pako","__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","reject","fulfilled","step","e","rejected","result","Mutex","begin","res","fn","unlock","_a","getGlobal","globalObject","nodeBuffer","textEncoder","hexCharCodesToInt","a","b","writeHexToUInt8","buf","str","size","index","hexStringEqualsUInt8","i","strIndex","alpha","digit","getDigestHex","tmpBuffer","input","hashLength","p","nibble","getUInt8Buffer","nodeBuffer","data","textEncoder","base64Chars","base64Lookup","getDecodeBase64Length","data","bufferLength","len","decodeBase64","bytes","p","i","encoded1","base64Lookup","encoded2","encoded3","encoded4","MAX_HEAP","WASM_FUNC_HASH_LENGTH","wasmMutex","Mutex","wasmModuleCache","WASMInterface","binary","hashLength","__awaiter","wasmInstance","memoryView","initialized","writeMemory","offset","getMemory","getExports","setMemorySize","totalSize","arrayOffset","memoryBuffer","getStateSize","loadWASMPromise","asm","promise","module","setupInterface","init","bits","updateUInt8Array","read","chunk","update","Uint8Buffer","getUInt8Buffer","digestChars","digest","outputType","padding","getDigestHex","save","stateOffset","stateLength","internalState","prefixedState","writeHexToUInt8","load","state","overallLength","hexStringEqualsUInt8","isDataShort","canSimplify","initParam","calculate","digestParam","buffer","mutex$l","Mutex","mutex$k","Mutex","uint32View","mutex$j","Mutex","mutex$i","Mutex","mutex$h","Mutex","mutex$g","Mutex","mutex$f","Mutex","mutex$e","Mutex","name$c","data$c","hash$c","wasmJson$c","mutex$d","Mutex","createSHA1","WASMInterface","wasmJson$c","wasm","obj","data","outputType","mutex$c","Mutex","mutex$b","Mutex","name$a","data$a","hash$a","wasmJson$a","mutex$a","Mutex","mutex$9","Mutex","createSHA256","WASMInterface","wasmJson$a","wasm","obj","data","outputType","mutex$8","Mutex","mutex$7","Mutex","mutex$6","Mutex","mutex$5","Mutex","seedBuffer$2","mutex$4","Mutex","seedBuffer$1","mutex$3","Mutex","seedBuffer","mutex$2","Mutex","mutex$1","Mutex","mutex","Mutex","encoder","BaseSerializerBuffer","SerializerInMemBuffer","chunk","buff","WARCSerializer","_WARCSerializer","BaseAsyncIterReader","record","opts","externalBuffer","digestOpts","cs","maxLength","deflater","pako","lastChunk","recordIter","controller","res","reader","createSHA256","createSHA1","hasher","base32Encode","blockHasher","payloadHasher","size","CRLF","CRLFCRLF","DEFAULT_FIELDS","BaseIndexer","opts","defaultFields","x","isRequestHeader","result","out","files","params","filename","reader","parser","WARCParser","record","indexerOffset","offset","length","special","field","value","headers","name","nameLower","keyName","Indexer","DEFAULT_CDX_FIELDS","DEFAULT_LEGACY_CDX_FIELDS","CDXIndexer","type","indexOffset","lastRecord","warcType","lastWarcType","reqRecord","method","requestBody","url","request","postToGetUrl","res","urlkey","timestamp","key","getSurt","CDXAndRecordIndexer","cdx","header"]} \ No newline at end of file diff --git a/dist/index.cjs b/dist/index.cjs new file mode 100644 index 0000000..f67182b --- /dev/null +++ b/dist/index.cjs @@ -0,0 +1,10 @@ +"use strict";var be=Object.create;var W=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var He=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty;var Ie=(n,r)=>{for(var e in r)W(n,e,{get:r[e],enumerable:!0})},se=(n,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of He(r))!Se.call(n,s)&&s!==e&&W(n,s,{get:()=>r[s],enumerable:!(t=xe(r,s))||t.enumerable});return n};var q=(n,r,e)=>(e=n!=null?be(ke(n)):{},se(r||!n||!n.__esModule?W(e,"default",{value:n,enumerable:!0}):e,n)),Te=n=>se(W({},"__esModule",{value:!0}),n);var $e={};Ie($e,{AsyncIterReader:()=>R,BaseAsyncIterReader:()=>p,BaseSerializerBuffer:()=>P,CDXAndRecordIndexer:()=>ee,CDXIndexer:()=>B,CRLF:()=>D,CRLFCRLF:()=>J,DEFAULT_CDX_FIELDS:()=>me,DEFAULT_FIELDS:()=>Re,DEFAULT_LEGACY_CDX_FIELDS:()=>Ae,HeadersMultiMap:()=>f,Indexer:()=>E,LimitReader:()=>m,NoConcatInflator:()=>x,SerializerInMemBuffer:()=>U,StatusAndHeaders:()=>b,StatusAndHeadersParser:()=>k,UTFToLatin1:()=>V,WARCParser:()=>I,WARCRecord:()=>S,WARCSerializer:()=>Z,WARC_1_0:()=>X,WARC_1_1:()=>pe,appendRequestQuery:()=>ne,binaryToString:()=>M,concatChunks:()=>_,getSurt:()=>N,indexOfDoubleCRLF:()=>ce,isRequestHeader:()=>Ce,jsonToQueryParams:()=>ie,jsonToQueryString:()=>z,latin1ToUTF:()=>G,mfdToQueryParams:()=>ae,mfdToQueryString:()=>oe,multiValueHeader:()=>Le,postToGetUrl:()=>$,readToDoubleCRLF:()=>ue,rxEscape:()=>Ue,splitChunk:()=>w});module.exports=Te($e);var le=q(require("pako"),1);function M(n){let r;typeof n=="string"?r=n:n?.length?r=n.reduce((e,t)=>(e+=String.fromCharCode(t),e),""):n?r=n.toString():r="";try{return"__wb_post_data="+btoa(r)}catch{return"__wb_post_data="}}function Ue(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function N(n){try{if(!n.startsWith("https:")&&!n.startsWith("http:"))return n;n=n.replace(/^(https?:\/\/)www\d*\./,"$1");let r=n.toLowerCase(),e=new URL(r),s=e.hostname.split(".").reverse().join(",");if(e.port&&(s+=":"+e.port),s+=")",s+=e.pathname,e.search){let i=e.search.slice(1).split("&");i.sort(),s+="?"+i.join("&")}return s}catch{return n}}function $(n){let{method:r,headers:e,postData:t=""}=n;if(r==="GET")return!1;let i=(d=>{let c=d.get("content-type");if(c)return c;if(!(d instanceof Headers)){for(let[u,A]of d.entries())if(u&&u.toLowerCase()==="content-type")return A}return""})(e),a=i.split(";")[0];function o(d){return d instanceof Uint8Array&&(d=new TextDecoder().decode(d)),d}let l="";switch(a){case"application/x-www-form-urlencoded":l=o(t);break;case"application/json":l=z(o(t));break;case"text/plain":try{l=z(o(t),!1)}catch{l=M(t)}break;case"multipart/form-data":{if(!i)throw new Error("utils cannot call postToGetURL when missing content-type header");l=oe(o(t),i);break}default:l=M(t)}return l!=null?(n.url=ne(n.url,decodeURI(l),n.method),n.method="GET",n.requestBody=l,!0):!1}function ne(n,r,e){if(!e)return n;let t=n.indexOf("?")>0?"&":"?";return`${n}${t}__wb_method=${e}&${r}`}function ie(n,r=!0){if(typeof n=="string")try{n=JSON.parse(n)}catch{n={}}let e=new URLSearchParams,t={},s=a=>e.has(a)?(a in t||(t[a]=1),a+"."+ ++t[a]+"_"):a,i=(a,o="")=>{let l="";if(typeof a=="object"&&!(a instanceof Array))try{for(let[d,c]of Object.entries(a))i(c,d)}catch{a===null&&(l="null")}else if(a instanceof Array)for(let d=0;de+=String.fromCharCode(t)),e}function G(n){let r=new Uint8Array(n.length);for(let e=0;e{t.done||!t.value?e.close():e.enqueue(t.value)})}})}async readFully(){return await n.readFully(this)}async readline(r=0){let e=await this.readlineRaw(r);return e?de.decode(e):""}async*iterLines(r=0){let e=null;for(;e=await this.readline(r);)yield e}};function We(n){return!!(n&&Symbol.iterator in Object(n))}function ve(n){return!!(n&&Symbol.asyncIterator in Object(n))}var R=class n extends p{constructor(e,t="gzip",s=!1){super();this.compressed=t,this.opts={raw:t==="deflateRaw"},this.inflator=t?new x(this.opts,this):null;let i;if(ve(e))i=e;else if(typeof e=="object"&&"read"in e&&typeof e.read=="function")i=n.fromReadable(e);else if(e instanceof ReadableStream)i=n.fromReadable(e.getReader());else if(We(e))i=n.fromIter(e);else throw new TypeError("Invalid Stream Source");s?this._sourceIter=this.dechunk(i):this._sourceIter=i[Symbol.asyncIterator](),this.lastValue=null,this.errored=!1,this._savedChunk=null,this._rawOffset=0,this._readOffset=0,this.numChunks=0}async _loadNext(){let e=await this._sourceIter.next();return e.done?null:e.value}async*dechunk(e){let t=e instanceof n?e:new n(e,null),s=-1,i=!0;for(;s!=0;){let a=await t.readlineRaw(64),o=new Uint8Array;if(s=a?parseInt(de.decode(a),16):0,!s||s>2**32){if(Number.isNaN(s)||s>2**32){i||(this.errored=!0),yield a;break}}else if(o=await t.readSize(s),o.length!=s){i?yield a:this.errored=!0,yield o;break}let l=await t.readSize(2);if(l[0]!=13||l[1]!=10){i?yield a:this.errored=!0,yield o,yield l;break}else{if(i=!1,!o||s===0)return;yield o}}yield*t}unread(e){e.length&&(this._readOffset-=e.length,this._savedChunk&&console.log("Already have chunk!"),this._savedChunk=e)}async _next(){if(this._savedChunk){let t=this._savedChunk;return this._savedChunk=null,t}if(this.compressed){let t=this._getNextChunk();if(t)return t}let e=await this._loadNext();for(;this.compressed&&e;){this._push(e);let t=this._getNextChunk(e);if(t)return t;e=await this._loadNext()}return e}_push(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _push when this.compressed is null");this.lastValue=e,this.inflator.ended&&(this.inflator=new x(this.opts,this)),this.inflator.push(e),this.inflator.err&&this.inflator.ended&&this.compressed==="deflate"&&!this.opts.raw&&this.numChunks===0&&(this.opts.raw=!0,this.compressed="deflateRaw",this.inflator=new x(this.opts,this),this.inflator.push(e))}_getNextChunk(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _getNextChunk when this.compressed is null");for(;;){if(this.inflator.chunks.length>0)return this.numChunks++,this.inflator.chunks.shift();if(this.inflator.ended){if(this.inflator.err!==0)return this.compressed=null,e;let t=this.inflator.strm.avail_in;if(t&&this.lastValue){this._push(this.lastValue.slice(-t));continue}}return null}}async*[Symbol.asyncIterator](){let e=null;for(;e=await this._next();)this._readOffset+=e.length,yield e}async readlineRaw(e){let t=[],s=0,i=-1,a=null;for await(let o of this){if(e&&s+o.byteLength>e){a=o,i=e-s-1;let l=o.slice(0,i+1).indexOf(10);l>=0&&(i=l);break}if(i=o.indexOf(10),i>=0){a=o;break}t.push(o),s+=o.byteLength}if(a){let[o,l]=w(a,i+1);t.push(o),s+=o.byteLength,this.unread(l)}else if(!t.length)return null;return _(t,s)}async readFully(){return(await this._readOrSkip())[1]}async readSize(e){return(await this._readOrSkip(e))[1]}async skipSize(e){return(await this._readOrSkip(e,!0))[0]}async _readOrSkip(e=-1,t=!1){let s=[],i=0;for await(let a of this){if(e>=0)if(a.length>e){let[o,l]=w(a,e);t||s.push(o),i+=o.byteLength,this.unread(l);break}else if(a.length===e){t||s.push(a),i+=a.byteLength,e=0;break}else e-=a.length;t||s.push(a),i+=a.byteLength}return t?[i,new Uint8Array]:[i,_(s,i)]}getReadOffset(){return this._readOffset}getRawOffset(){return this.compressed?this._rawOffset:this._readOffset}getRawLength(e){return this.compressed?this.inflator.strm.total_in:this._readOffset-e}static fromReadable(e){return{async*[Symbol.asyncIterator](){let s=null;for(;(s=await e.read())&&!s.done;)yield s.value}}}static fromIter(e){return{async*[Symbol.asyncIterator](){for(let s of e)yield s}}}},m=class extends p{constructor(e,t,s=0){super();this.sourceIter=e,this.length=t,this.limit=t,this.skip=s}setLimitSkip(e,t=0){this.limit=e,this.skip=t}async*[Symbol.asyncIterator](){if(!(this.limit<=0))for await(let e of this.sourceIter){if(this.skip>0)if(e.length>=this.skip){let[,t]=w(e,this.skip);e=t,this.skip=0}else{this.skip-=e.length;continue}if(e.length>this.limit){let[t,s]=w(e,this.limit);e=t,this.sourceIter.unread&&this.sourceIter.unread(s)}if(e.length&&(this.limit-=e.length,yield e),this.limit<=0)break}}async readlineRaw(e){if(this.limit<=0)return null;let t=await this.sourceIter.readlineRaw(e?Math.min(e,this.limit):this.limit);return this.limit-=t?.length||0,t}async skipFully(){let e=this.limit;for(;this.limit>0;)this.limit-=await this.sourceIter.skipSize(this.limit);return e}};var D=new Uint8Array([13,10]),J=new Uint8Array([13,10,13,10]),Fe=new TextDecoder("utf-8"),b=class{constructor({statusline:r,headers:e,reencodeHeaders:t}){this.statusline=r,this.headers=e,this.reencodeHeaders=t}toString(){let r=[this.statusline],e=this.headers instanceof Headers;for(let[t,s]of this.headers)e&&this.reencodeHeaders?.has(t)?r.push(`${t}: ${G(s)}`):r.push(`${t}: ${s}`);return r.join(`\r +`)+`\r +`}async*iterSerialize(r){yield r.encode(this.statusline),yield D;for(let[e,t]of this.headers)yield r.encode(`${e}: ${t}\r +`)}_parseResponseStatusLine(){let r=De(this.statusline," ",2);this._protocol=r[0]??"",this._statusCode=r.length>1?Number(r[1]):"",this._statusText=r.length>2?r[2]:""}get statusCode(){return this._statusCode===void 0&&this._parseResponseStatusLine(),this._statusCode}get protocol(){return this._protocol===void 0&&this._parseResponseStatusLine(),this._protocol}get statusText(){return this._statusText===void 0&&this._parseResponseStatusLine(),this._statusText}_parseRequestStatusLine(){let r=this.statusline.split(" ",2);this._method=r[0]??"",this._requestPath=r.length>1?r[1]:""}get method(){return this._method===void 0&&this._parseRequestStatusLine(),this._method}get requestPath(){return this._requestPath===void 0&&this._parseRequestStatusLine(),this._requestPath}},k=class{constructor(){this.reencodeHeaders=new Set}async parse(r,{headersClass:e,firstLine:t}={headersClass:f}){let s=t||await r.readline();if(!s)return null;let i=s.trimEnd();if(!i)return null;let a=new e,o=await ue(r),l=0,d,c,u,A="",h;for(;l=0&&d0&&s.push(t.slice(e).join(r)),s}async function ce(n,r){let e=0;for(let t=0;t=n.length){let{value:i}=await r.next();if(!i)break;let a=new Uint8Array(i.length+n.length);a.set(n,0),a.set(i,n.length),n=a}if(n[s+1]===10&&n[s+2]===13&&n[s+3]===10)return[s+3,n];e=s+1}return[-1,n]}async function ue(n){let r=[],e=0,t=0,s=null,i=n[Symbol.asyncIterator]();for await(let a of i){if([t,a]=await ce(a,i),t>=0){s=a;break}r.push(a),e+=a.byteLength}if(s){let[a,o]=w(s,t+1);r.push(a),e+=a.byteLength,n.unread(o)}else if(!r.length)return"";return Fe.decode(_(r,e))}var fe=q(require("uuid-random"),1);var Pe=new TextDecoder("utf-8"),Ee=new TextEncoder,pe="WARC/1.1",X="WARC/1.0",Be="http://netpreserve.org/warc/1.0/revisit/identical-payload-digest",Oe="http://netpreserve.org/warc/1.1/revisit/identical-payload-digest",qe={warcinfo:"application/warc-fields",response:"application/http; msgtype=response",revisit:"application/http; msgtype=response",request:"application/http; msgtype=request",metadata:"application/warc-fields"},S=class n extends p{constructor({warcHeaders:e,reader:t}){super();this._offset=0;this._length=0;this._urlkey="";this.warcHeaders=e,this._reader=t,this._contentReader=null,this.payload=null,this.httpHeaders=null,this.consumed="",this.fixUp()}static create({url:e,date:t,type:s,warcHeaders:i={},filename:a="",httpHeaders:o={},statusline:l="HTTP/1.1 200 OK",warcVersion:d=X,keepHeadersCase:c=!0,refersToUrl:u=void 0,refersToDate:A=void 0}={},h){function te(C){let _e=C;return d===X&&(C=C.split(".")[0],C.charAt(_e.length-1)!="Z"&&(C+="Z")),C}t=te(t||new Date().toISOString());let y=new f(i);if(s==="warcinfo")a&&y.set("WARC-Filename",a);else if(e)try{y.set("WARC-Target-URI",new URL(e).href)}catch{y.set("WARC-Target-URI",e)}y.set("WARC-Date",t),s&&y.set("WARC-Type",s),s==="revisit"&&(y.set("WARC-Profile",d===pe?Oe:Be),u&&(y.set("WARC-Refers-To-Target-URI",u),y.set("WARC-Refers-To-Date",te(A||new Date().toISOString()))));let H=new b({statusline:d,headers:y});H.headers.get("WARC-Record-ID")||H.headers.set("WARC-Record-ID",``),H.headers.get("Content-Type")||H.headers.set("Content-Type",s&&qe[s]||"application/octet-stream"),h||(h=he());let re=new n({warcHeaders:H,reader:h}),L=null,O=!1;switch(s){case"response":case"request":case"revisit":c?(L=new f(o),O=!L.size):(L=new Headers(o),O=!Object.entries(o).length),(!O||s!=="revisit")&&(re.httpHeaders=new b({statusline:l,headers:L}));break}return re}static createWARCInfo(e={},t){async function*s(){for(let[i,a]of Object.entries(t))yield Ee.encode(`${i}: ${a}\r +`)}return e.type="warcinfo",n.create(e,s())}getResponseInfo(){let e=this.httpHeaders;return e?{headers:e.headers,status:e.statusCode,statusText:e.statusText}:null}fixUp(){let e=this.warcHeaders.headers.get("WARC-Target-URI");e&&e.startsWith("<")&&e.endsWith(">")&&this.warcHeaders.headers.set("WARC-Target-URI",e.slice(1,-1))}async readFully(e=!1){if(this.httpHeaders){if(this.payload&&!this.payload.length)return this.payload;if(this._contentReader&&!e)throw new TypeError("WARC Record decoding already started, but requesting raw payload");if(e&&this.consumed==="raw"&&this.payload)return await this._createDecodingReader([this.payload]).readFully()}return this.payload?this.payload:(e?(this.payload=await super.readFully(),this.consumed="content"):(this.payload=await p.readFully(this._reader),this.consumed="raw"),this.payload)}get reader(){if(this.payload&&!this.payload.length)return he();if(this._contentReader)throw new TypeError("WARC Record decoding already started, but requesting raw payload");return this._reader}get contentReader(){return this.httpHeaders?(this._contentReader||(this._contentReader=this._createDecodingReader(this._reader)),this._contentReader):this._reader}_createDecodingReader(e){if(!this.httpHeaders)throw new Error("WARCRecord cannot call _createDecodingReader when this.httpHeaders === null");let t=this.httpHeaders.headers.get("Content-Encoding"),s=this.httpHeaders.headers.get("Transfer-Encoding"),i=s==="chunked";return!t&&!i&&(t=s),new R(e,t,i)}async readlineRaw(e){if(this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");if(this.contentReader instanceof p)return this.contentReader.readlineRaw(e);throw new Error("WARCRecord cannot call readlineRaw on this.contentReader if it does not extend BaseAsyncIterReader")}async contentText(){let e=await this.readFully(!0);return Pe.decode(e)}async*[Symbol.asyncIterator](){for await(let e of this.contentReader)if(yield e,this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");this.consumed="content"}async skipFully(){if(!this.consumed){if(this._reader instanceof m){let e=await this._reader.skipFully();return this.consumed="skipped",e}throw new Error("WARCRecord cannot call skipFully on this._reader if it is not a LimitReader")}}warcHeader(e){return this.warcHeaders.headers.get(e)}get warcType(){return this.warcHeaders.headers.get("WARC-Type")}get warcTargetURI(){return this.warcHeaders.headers.get("WARC-Target-URI")}get warcDate(){return this.warcHeaders.headers.get("WARC-Date")}get warcRefersToTargetURI(){return this.warcHeaders.headers.get("WARC-Refers-To-Target-URI")}get warcRefersToDate(){return this.warcHeaders.headers.get("WARC-Refers-To-Date")}get warcPayloadDigest(){return this.warcHeaders.headers.get("WARC-Payload-Digest")}get warcBlockDigest(){return this.warcHeaders.headers.get("WARC-Block-Digest")}get warcContentType(){return this.warcHeaders.headers.get("Content-Type")}get warcContentLength(){return Number(this.warcHeaders.headers.get("Content-Length"))}get warcConcurrentTo(){if(this.warcHeaders.headers instanceof f)return this.warcHeaders.headers.getMultiple("WARC-Concurrent-To");{let e=this.warcHeaders.headers.get("WARC-Concurrent-To");return e?e.split(","):[]}}};async function*he(){}var ye=new TextDecoder,Q=new Uint8Array([]),I=class n{static async parse(r,e){return new n(r,e).parse()}static iterRecords(r,e){return new n(r,e)[Symbol.asyncIterator]()}constructor(r,{keepHeadersCase:e=!1,parseHttp:t=!0}={}){this._offset=0,this._warcHeadersLength=0,this._headersClass=e?f:Headers,this._parseHttp=t,r instanceof R?this._reader=r:this._reader=new R(r),this._record=null}async readToNextRecord(){if(!this._reader||!this._record)return Q;await this._record.skipFully(),this._reader.compressed&&(this._offset=this._reader.getRawOffset());let r=await this._reader.readlineRaw(),e=0;if(!r)r=Q;else{if(e=r.byteLength-1,e===9&&ye.decode(r).startsWith("WARC/"))return r;for(;e>0;){let t=r[e-1];if(t!==10&&t!==13)break;e--}e&&console.warn(`Content-Length Too Small: Record not followed by newline, Remainder Length: ${e}, Offset: ${this._reader.getRawOffset()-r.byteLength}`)}if(this._reader.compressed)await this._reader.skipSize(2),r=Q;else{for(r=await this._reader.readlineRaw();r&&r.byteLength===2;)r=await this._reader.readlineRaw();this._offset=this._reader.getRawOffset(),r&&(this._offset-=r.length)}return r}_initRecordReader(r){return new m(this._reader,Number(r.headers.get("Content-Length")||0))}async parse(){let r=await this.readToNextRecord(),e=r?ye.decode(r):"",t=new k,s=await t.parse(this._reader,{firstLine:e,headersClass:this._headersClass});if(!s)return null;this._warcHeadersLength=this._reader.getReadOffset();let i=new S({warcHeaders:s,reader:this._initRecordReader(s)});if(this._record=i,this._parseHttp)switch(i.warcType){case"response":case"request":await this._addHttpHeaders(i,t);break;case"revisit":i.warcContentLength>0&&await this._addHttpHeaders(i,t);break}return i}get offset(){return this._offset}get recordLength(){return this._reader.getRawLength(this._offset)}async*[Symbol.asyncIterator](){let r=null;for(;(r=await this.parse())!==null;)yield r;this._record=null}async _addHttpHeaders(r,e){let t=await e.parse(this._reader,{headersClass:this._headersClass});r.httpHeaders=t;let s=this._reader.getReadOffset()-this._warcHeadersLength;r.reader instanceof m&&r.reader.setLimitSkip(r.warcContentLength-s)}};function K(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}var Me="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",ze="0123456789ABCDEFGHIJKLMNOPQRSTUV",Ne="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Y(n,r,e){e=e||{};let t,s;switch(r){case"RFC3548":case"RFC4648":t=Me,s=!0;break;case"RFC4648-HEX":t=ze,s=!0;break;case"Crockford":t=Ne,s=!1;break;default:throw new Error("Unknown base32 variant: "+r)}let i=e.padding!==void 0?e.padding:s,a=K(n),o=0,l=0,d="";for(let c=0;c=5;)d+=t[l>>>o-5&31],o-=5;if(o>0&&(d+=t[l<<5-o&31]),i)for(;d.length%8!==0;)d+="=";return d}var we=q(require("pako"),1),T=require("hash-wasm");var ge=new TextEncoder,P=class{},U=class extends P{constructor(){super(...arguments);this.buffers=[]}write(e){this.buffers.push(e)}async*readAll(){for(let e of this.buffers)yield e}clear(){this.buffers=[]}},Z=class n extends p{constructor(e,t={},s=new U){super();this.gzip=!1;this.digestAlgo="";this.digestAlgoPrefix="";this.digestBase32=!1;this.preferPako=!1;this._alreadyDigested=!1;this.blockHasher=null;this.payloadHasher=null;this.httpHeadersBuff=null;this.warcHeadersBuff=null;this.gzip=!!t.gzip,this.record=e;let i=t.digest||{};this.digestAlgo=i.algo||"sha-256",this.digestAlgoPrefix=i.prefix||"sha256:",this.digestBase32=!!i.base32,this.preferPako=!!t.preferPako,n.noComputeDigest(e)&&(this.digestAlgo=""),this.externalBuffer=s}static async serialize(e,t,s=new U){return await new n(e,t,s).readFully()}static noComputeDigest(e){return e.warcType==="revisit"||e.warcType==="warcinfo"||e.warcPayloadDigest&&e.warcBlockDigest}async*[Symbol.asyncIterator](){if(!this.gzip){yield*this.generateRecord();return}if("CompressionStream"in globalThis&&!this.preferPako){let e=new globalThis.CompressionStream("gzip");yield*this.streamCompress(e)}else yield*this.pakoCompress()}async readlineRaw(e){return null}async*pakoCompress(){let e=new we.default.Deflate({gzip:!0}),t=null;for await(let s of this.generateRecord())for(t&&t.length>0&&e.push(t),t=s;e.chunks.length;)yield e.chunks.shift();t&&e.push(t,!0),yield e.result}async*streamCompress(e){let t=this.generateRecord();new ReadableStream({async pull(o){let l=await t.next();l.done?o.close():o.enqueue(l.value)}}).pipeThrough(e);let i=null,a=e.readable.getReader();for(;(i=await a.read())&&!i.done;)yield i.value}async newHasher(){switch(this.digestAlgo){case"sha-256":return(0,T.createSHA256)();case"sha-1":return(0,T.createSHA1)();case"":return null;default:return(0,T.createSHA256)()}}getDigest(e){return this.digestAlgoPrefix+(this.digestBase32?Y(e.digest("binary"),"RFC4648"):e.digest("hex"))}async digestRecord(){let e=this.record;if(this._alreadyDigested)return Number(e.warcHeaders.headers.get("Content-Length"));let t=await this.newHasher(),s=await this.newHasher(),i=0;e.httpHeaders&&(this.httpHeadersBuff=ge.encode(e.httpHeaders.toString()+`\r +`),i+=this.httpHeadersBuff.length,t?.update(this.httpHeadersBuff));for await(let a of e.reader)t?.update(a),s?.update(a),this.externalBuffer.write(a),i+=a.length;return s&&e.warcHeaders.headers.set("WARC-Payload-Digest",this.getDigest(s)),t&&e.warcHeaders.headers.set("WARC-Block-Digest",this.getDigest(t)),e.warcHeaders.headers.set("Content-Length",i.toString()),this.warcHeadersBuff=ge.encode(e.warcHeaders.toString()),this._alreadyDigested=!0,i}async*generateRecord(){if(await this.digestRecord(),this.warcHeadersBuff&&(yield this.warcHeadersBuff),yield D,this.httpHeadersBuff&&(yield this.httpHeadersBuff),this.externalBuffer)for await(let e of this.externalBuffer.readAll())yield e;yield J}};var Re=["offset","warc-type","warc-target-uri"],j=class{constructor(r={},e=Re){this.opts=r,r.fields?(this.fields=r.fields,this.reqFields=this.fields.filter(t=>Ce(t))):(this.fields=e,this.reqFields=[]),this.parseHttp=!1}serialize(r){return JSON.stringify(r)+` +`}write(r,e){e.write(this.serialize(r))}async writeAll(r,e){for await(let t of this.iterIndex(r))this.write(t,e)}async*iterIndex(r){let e={strictHeaders:!0,parseHttp:this.parseHttp};for(let{filename:t,reader:s}of r){let i=new I(s,e);yield*this.iterRecords(i,t)}}async*iterRecords(r,e){for await(let t of r){await t.skipFully();let s=this.indexRecord(t,r,e);s&&(yield s)}}indexRecord(r,e,t){if(this.filterRecord&&!this.filterRecord(r))return null;let s={},{offset:i,recordLength:a}=e,o={offset:i,length:a,filename:t};for(let l of this.fields)l in o?s[l]=o[l]:this.setField(l,r,s);return s}setField(r,e,t){let s=this.getField(r,e);s!==null&&(t[r]=s)}getField(r,e){if(r.startsWith("req."))if(e.warcType==="request")r=r.slice(4);else return null;if(r==="http:status")return e.httpHeaders&&(e.warcType==="response"||e.warcType==="revisit")?e.httpHeaders.statusCode:null;if(r.startsWith("http:")){if(e.httpHeaders){let t=e.httpHeaders.headers,s=r.slice(5),i=t.get(s);if(t instanceof Map){let a=s.toLowerCase();for(let o of t.keys())a===o.toLowerCase()&&(i=t.get(o))}return i}return null}return e.warcHeaders.headers.get(r)||null}},E=class extends j{constructor(r,e){super(r,e);for(let t of this.fields)if(t.startsWith("http:")){this.parseHttp=!0;break}}},me="urlkey,timestamp,url,mime,status,digest,length,offset,filename".split(","),Ae="urlkey,timestamp,url,mime,status,digest,redirect,meta,length,offset,filename".split(","),B=class extends E{constructor(e){super(e,me);switch(this.includeAll=!!e?.all,this.overrideIndexForAll=!!e?.all,this.parseHttp=!0,this.noSurt=!!e?.noSurt,this._lastRecord=null,e?.format){case"cdxj":this.serialize=this.serializeCDXJ;break;case"cdx":this.serialize=this.serializeCDX11;break;case"json":default:break}}async*iterRecords(e,t){this._lastRecord=null;for await(let i of e){await i.readFully();let a=this.indexRecord(i,e,t);a&&(yield a)}let s=this.indexRecord(null,e,t);s&&(yield s)}filterRecord(e){if(this.includeAll)return!0;let t=e.warcType;return!(t==="request"||t==="warcinfo"||(t==="metadata"||t==="resource")&&e.warcContentType==="application/warc-fields")}indexRecord(e,t,s){if(this.overrideIndexForAll)return e?super.indexRecord(e,t,s):null;let i=this._lastRecord;if(this._lastRecord=e,e&&(e._offset=t.offset,e._length=t.recordLength),!i)return null;if(!e||i.warcTargetURI!=e.warcTargetURI)return this.indexRecordPair(i,null,t,s);let a=e.warcType,o=i.warcType;return a==="request"&&(o==="response"||o==="revisit")?(this._lastRecord=null,this.indexRecordPair(i,e,t,s)):(a==="response"||a==="revisit")&&o==="request"?(this._lastRecord=null,this.indexRecordPair(e,i,t,s)):this.indexRecordPair(i,null,t,s)}indexRecordPair(e,t,s,i){let a,o,l=e.warcTargetURI||"";if(t?.httpHeaders&&t.httpHeaders.method!=="GET"){let c={url:l,method:t.httpHeaders.method,headers:t.httpHeaders.headers,postData:t.payload};a=c.method,$(c)&&(o=c.requestBody,l=c.url)}e._urlkey=l;let d=super.indexRecord(e,s,i);if(d&&(e._offset!==void 0&&(d.offset=e._offset,d.length=e._length),a&&(d.method=a),o&&(d.requestBody=o),t&&this.reqFields.length))for(let c of this.reqFields)this.setField(c,t,d);return d}serializeCDXJ(e){let{urlkey:t,timestamp:s}=e;return delete e.urlkey,delete e.timestamp,`${t} ${s} ${JSON.stringify(e,(a,o)=>["offset","length","status"].includes(a)?o==null?"":""+o:o)} +`}serializeCDX11(e){let t=[];for(let s of Ae)t.push(e[s]!=null?e[s]:"-");return t.join(" ")+` +`}getField(e,t){let s=null;switch(e){case"urlkey":return s=t._urlkey||t.warcTargetURI||null,this.noSurt||s===null?s:N(s);case"timestamp":return s=t.warcDate??"",s.replace(/[-:T]/g,"").slice(0,14);case"url":return t.warcTargetURI;case"mime":switch(t.warcType){case"revisit":return"warc/revisit";case"response":case"request":e="http:content-type";break;default:return t.warcContentType}return s=super.getField(e,t),s?s.toString().split(";",1)[0]?.trim():null;case"status":return super.getField("http:status",t);case"referrer":return super.getField("req.http:referer",t);case"digest":return s=t.warcPayloadDigest,s?s.split(":",2)[1]:null;default:return super.getField(e,t)}}},ee=class extends B{constructor(r){super(r),this.overrideIndexForAll=!1}indexRecordPair(r,e,t,s){let i=super.indexRecordPair(r,e,t,s);return i&&{cdx:i,record:r,reqRecord:e}}};function Ce(n){return n.startsWith("req.")||n.toLowerCase()==="referrer"}0&&(module.exports={AsyncIterReader,BaseAsyncIterReader,BaseSerializerBuffer,CDXAndRecordIndexer,CDXIndexer,CRLF,CRLFCRLF,DEFAULT_CDX_FIELDS,DEFAULT_FIELDS,DEFAULT_LEGACY_CDX_FIELDS,HeadersMultiMap,Indexer,LimitReader,NoConcatInflator,SerializerInMemBuffer,StatusAndHeaders,StatusAndHeadersParser,UTFToLatin1,WARCParser,WARCRecord,WARCSerializer,WARC_1_0,WARC_1_1,appendRequestQuery,binaryToString,concatChunks,getSurt,indexOfDoubleCRLF,isRequestHeader,jsonToQueryParams,jsonToQueryString,latin1ToUTF,mfdToQueryParams,mfdToQueryString,multiValueHeader,postToGetUrl,readToDoubleCRLF,rxEscape,splitChunk}); diff --git a/dist/index.d.cts b/dist/index.d.cts new file mode 100644 index 0000000..23e1230 --- /dev/null +++ b/dist/index.d.cts @@ -0,0 +1,99 @@ +import { b as WARCRecord, A as AsyncIterReader, c as StatusAndHeaders, L as LimitReader, d as StatusAndHeadersParser } from './warcserializer-a7845700.js'; +export { e as AsyncIterReaderOpts, B as BaseAsyncIterReader, g as BaseSerializerBuffer, C as CRLF, f as CRLFCRLF, N as NoConcatInflator, S as SerializerInMemBuffer, l as WARCRecordOpts, a as WARCSerializer, W as WARCSerializerOpts, k as WARCType, j as WARC_1_0, h as WARC_1_1, i as indexOfDoubleCRLF, r as readToDoubleCRLF } from './warcserializer-a7845700.js'; +import { I as IndexerOffsetLength, S as Source, H as HeadersMultiMap, a as StreamResults } from './utils-dfea30f1.js'; +export { R as Request, o as Response, k as SourceReadable, i as SourceReader, n as StreamResult, U as UTFToLatin1, c as appendRequestQuery, b as binaryToString, f as concatChunks, g as getSurt, j as jsonToQueryParams, d as jsonToQueryString, l as latin1ToUTF, m as mfdToQueryParams, e as mfdToQueryString, h as multiValueHeader, p as postToGetUrl, r as rxEscape, s as splitChunk } from './utils-dfea30f1.js'; +import { WritableStreamBuffer } from 'stream-buffers'; +import { Argv } from 'yargs'; +import 'hash-wasm/dist/lib/WASMInterface.js'; +import 'pako'; + +type WARCParserOpts = { + keepHeadersCase?: boolean; + parseHttp?: boolean; +}; +declare class WARCParser implements IndexerOffsetLength { + static parse(source: Source, options?: WARCParserOpts): Promise; + static iterRecords(source: Source, options?: WARCParserOpts): AsyncGenerator; + _offset: number; + _warcHeadersLength: number; + _headersClass: typeof HeadersMultiMap | typeof Headers; + _parseHttp: boolean; + _reader: AsyncIterReader; + _record: WARCRecord | null; + constructor(source: Source, { keepHeadersCase, parseHttp }?: WARCParserOpts); + readToNextRecord(): Promise; + _initRecordReader(warcHeaders: StatusAndHeaders): LimitReader; + parse(): Promise; + get offset(): number; + get recordLength(): number; + [Symbol.asyncIterator](): AsyncGenerator; + _addHttpHeaders(record: WARCRecord, headersParser: StatusAndHeadersParser): Promise; +} + +declare const indexCommandArgs: (yarg: Argv) => Argv<{ + filenames: string[]; +} & { + fields: string[]; +}>; +type IndexCommandArgs = Awaited["argv"]>; +declare const cdxIndexCommandArgs: (yarg: Argv) => Argv<{ + filenames: string[]; +} & { + all: boolean | undefined; +} & { + format: string; +} & { + noSurt: boolean | undefined; +} & { + fields: string[]; +}>; +type CdxIndexCommandArgs = Awaited["argv"]>; + +declare const DEFAULT_FIELDS: string[]; +declare abstract class BaseIndexer { + opts: Partial; + fields: string[]; + reqFields: string[]; + parseHttp: boolean; + constructor(opts?: Partial, defaultFields?: string[]); + serialize(result: Record): string; + write(result: Record, out: WritableStreamBuffer | NodeJS.WriteStream): void; + writeAll(files: StreamResults, out: WritableStreamBuffer | NodeJS.WriteStream): Promise; + iterIndex(files: StreamResults): AsyncGenerator, void, unknown>; + iterRecords(parser: WARCParser, filename: string): AsyncGenerator, void, unknown>; + filterRecord?(record: WARCRecord): boolean; + indexRecord(record: WARCRecord, indexerOffset: IndexerOffsetLength, filename: string): Record | null; + setField(field: string, record: WARCRecord, result: Record): void; + getField(field: string, record: WARCRecord): string | number | null | undefined; +} +declare class Indexer extends BaseIndexer { + constructor(opts?: Partial, defaultFields?: string[]); +} +declare const DEFAULT_CDX_FIELDS: string[]; +declare const DEFAULT_LEGACY_CDX_FIELDS: string[]; +interface CDXAndRecord { + cdx: Record; + record: WARCRecord; + reqRecord: WARCRecord | null; +} +declare class CDXIndexer extends Indexer { + includeAll: boolean; + overrideIndexForAll: boolean; + noSurt: boolean; + _lastRecord: WARCRecord | null; + constructor(opts?: Partial); + iterRecords(parser: WARCParser, filename: string): AsyncGenerator, void, unknown>; + filterRecord(record: WARCRecord): boolean; + indexRecord(record: WARCRecord | null, indexOffset: IndexerOffsetLength, filename: string): Record | null; + indexRecordPair(record: WARCRecord, reqRecord: WARCRecord | null, indexOffset: IndexerOffsetLength, filename: string): Record | null; + serializeCDXJ(result: Record): string; + serializeCDX11(result: Record): string; + getField(field: string, record: WARCRecord): string | number | null | undefined; +} +declare class CDXAndRecordIndexer extends CDXIndexer { + constructor(opts?: Partial); + indexRecordPair(record: WARCRecord, reqRecord: WARCRecord | null, indexOffset: IndexerOffsetLength, filename: string): CDXAndRecord | null; +} +declare function isRequestHeader(header: string): boolean; + +export { AsyncIterReader, CDXAndRecord, CDXAndRecordIndexer, CDXIndexer, DEFAULT_CDX_FIELDS, DEFAULT_FIELDS, DEFAULT_LEGACY_CDX_FIELDS, HeadersMultiMap, Indexer, IndexerOffsetLength, LimitReader, Source, StatusAndHeaders, StatusAndHeadersParser, StreamResults, WARCParser, WARCParserOpts, WARCRecord, isRequestHeader }; diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..8e22c56 --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,350 @@ +import pako from 'pako'; +import { IHasher } from 'hash-wasm/dist/lib/WASMInterface.js'; +import { WritableStreamBuffer } from 'stream-buffers'; +import { Argv } from 'yargs'; + +type SourceReader = { + read: Function; +}; +type SourceReadable = { + getReader: (...args: any) => { + read: Function; + }; +}; +type Source = SourceReader | SourceReadable | AsyncIterable | Iterable; +type StreamResult = { + filename: string; + reader: AsyncIterable; +}; +type StreamResults = StreamResult[]; +type IndexerOffsetLength = { + offset: number; + recordLength: number; +}; +type Request = { + method: string; + url: string; + headers: Map | Headers; + postData?: Uint8Array | string | undefined | null; + requestBody?: any; +}; +type Response = Request; + +declare class NoConcatInflator extends pako.Inflate { + reader: T; + ended: boolean; + chunks: Uint8Array[]; + constructor(options: pako.InflateOptions, reader: T); + onEnd(status: pako.ReturnCodes): void; +} +declare abstract class BaseAsyncIterReader { + static readFully(iter: AsyncIterable | Iterable): Promise; + abstract [Symbol.asyncIterator](): AsyncIterator; + getReadableStream(): ReadableStream; + readFully(): Promise; + abstract readlineRaw(maxLength?: number): Promise; + readline(maxLength?: number): Promise; + iterLines(maxLength?: number): AsyncGenerator; +} +type AsyncIterReaderOpts = { + raw: boolean; +}; +declare class AsyncIterReader extends BaseAsyncIterReader { + compressed: string | null; + opts: AsyncIterReaderOpts; + inflator: NoConcatInflator | null; + _sourceIter: AsyncIterator; + lastValue: Uint8Array | null; + errored: boolean; + _savedChunk: Uint8Array | null; + _rawOffset: number; + _readOffset: number; + numChunks: number; + constructor(streamOrIter: Source, compressed?: string | null, dechunk?: boolean); + _loadNext(): Promise; + dechunk(source: AsyncIterable): AsyncIterator; + unread(chunk: Uint8Array): void; + _next(): Promise; + _push(value: Uint8Array): void; + _getNextChunk(original?: Uint8Array): Uint8Array | null | undefined; + [Symbol.asyncIterator](): AsyncGenerator; + readlineRaw(maxLength?: number): Promise; + readFully(): Promise; + readSize(sizeLimit: number): Promise; + skipSize(sizeLimit: number): Promise; + _readOrSkip(sizeLimit?: number, skip?: boolean): Promise; + getReadOffset(): number; + getRawOffset(): number; + getRawLength(prevOffset: number): number; + static fromReadable(source: Readable): { + [Symbol.asyncIterator](): AsyncGenerator; + }; + static fromIter(source: Iterable): { + [Symbol.asyncIterator](): AsyncGenerator; + }; +} +declare class LimitReader extends BaseAsyncIterReader { + sourceIter: AsyncIterReader; + length: number; + limit: number; + skip: number; + constructor(streamIter: AsyncIterReader, limit: number, skip?: number); + setLimitSkip(limit: number, skip?: number): void; + [Symbol.asyncIterator](): AsyncGenerator; + readlineRaw(maxLength?: number): Promise; + skipFully(): Promise; +} + +declare function binaryToString(data: Uint8Array | string | undefined | null): string; +declare function rxEscape(string: string): string; +declare function getSurt(url: string): string; +declare function postToGetUrl(request: Request): boolean; +declare function appendRequestQuery(url: string, query: string, method: string): string; +declare function jsonToQueryParams(json: unknown, ignoreInvalid?: boolean): URLSearchParams; +declare function mfdToQueryParams(mfd: string | Uint8Array | null | undefined, contentType: string): URLSearchParams; +declare function jsonToQueryString(json?: string | Record | undefined | null, ignoreInvalid?: boolean): string; +declare function mfdToQueryString(mfd: string | Uint8Array | undefined | null, contentType: string): string; +declare function concatChunks(chunks: Uint8Array[], size: number): Uint8Array; +declare function splitChunk(chunk: Uint8Array, inx: number): [Uint8Array, Uint8Array]; +declare function UTFToLatin1(value: string): string; +declare function latin1ToUTF(str: string): string; +declare function multiValueHeader(name: string, value: string[]): string; +declare class HeadersMultiMap extends Map { + constructor(headersInit?: HeadersInit); + getMultiple(name: string): string[] | undefined; + append(name: string, value: string): void; + [Symbol.iterator](): IterableIterator<[string, string]>; +} + +declare const CRLF: Uint8Array; +declare const CRLFCRLF: Uint8Array; +declare class StatusAndHeaders { + statusline: string; + headers: HeadersMultiMap | Headers; + readonly reencodeHeaders?: Set; + constructor({ statusline, headers, reencodeHeaders, }: { + statusline: string; + headers: HeadersMultiMap | Headers; + reencodeHeaders?: Set; + }); + toString(): string; + iterSerialize(encoder: TextEncoder): AsyncGenerator; + _protocol: string | undefined; + _statusCode: number | string | undefined; + _statusText: string | undefined; + _parseResponseStatusLine(): void; + get statusCode(): string | number | undefined; + get protocol(): string | undefined; + get statusText(): string | undefined; + _method: string | undefined; + _requestPath: string | undefined; + _parseRequestStatusLine(): void; + get method(): string | undefined; + get requestPath(): string | undefined; +} +declare class StatusAndHeadersParser { + reencodeHeaders: Set; + parse(reader: AsyncIterReader, { headersClass, firstLine, }?: { + firstLine?: string; + headersClass: typeof HeadersMultiMap | typeof Headers; + }): Promise; + setHeader(name: string, value: string, headers: Headers | HeadersMultiMap, reencoded?: boolean): void; +} +declare function indexOfDoubleCRLF(buffer: Uint8Array, iter: AsyncIterator): Promise; +declare function readToDoubleCRLF(reader: AsyncIterReader): Promise; + +declare const WARC_1_1 = "WARC/1.1"; +declare const WARC_1_0 = "WARC/1.0"; +type WARCType = "warcinfo" | "response" | "resource" | "request" | "metadata" | "revisit" | "conversion" | "continuation"; +type WARCRecordOpts = { + url?: string; + date?: string; + type?: WARCType; + warcHeaders?: Record | [string, string][]; + filename?: string; + httpHeaders?: HeadersInit; + statusline?: string; + warcVersion?: typeof WARC_1_0 | typeof WARC_1_1; + keepHeadersCase?: boolean; + refersToUrl?: string; + refersToDate?: string; +}; +declare class WARCRecord extends BaseAsyncIterReader { + static create({ url, date, type, warcHeaders, filename, httpHeaders, statusline, warcVersion, keepHeadersCase, refersToUrl, refersToDate, }?: WARCRecordOpts, reader?: AsyncIterable | Iterable): WARCRecord; + static createWARCInfo(opts: WARCRecordOpts | undefined, info: Record): WARCRecord; + warcHeaders: StatusAndHeaders; + _reader: AsyncIterable | Iterable; + _contentReader: BaseAsyncIterReader | null; + payload: Uint8Array | null; + httpHeaders: StatusAndHeaders | null; + consumed: "content" | "raw" | "skipped" | ""; + _offset: number | undefined; + _length: number; + _urlkey: string; + constructor({ warcHeaders, reader, }: { + warcHeaders: StatusAndHeaders; + reader: AsyncIterable | Iterable; + }); + getResponseInfo(): { + headers: Headers | HeadersMultiMap; + status: string | number | undefined; + statusText: string | undefined; + } | null; + fixUp(): void; + readFully(isContent?: boolean): Promise; + get reader(): AsyncIterable | Iterable; + get contentReader(): AsyncIterable | Iterable; + _createDecodingReader(source: Source): AsyncIterReader; + readlineRaw(maxLength?: number): Promise; + contentText(): Promise; + [Symbol.asyncIterator](): AsyncGenerator; + skipFully(): Promise; + warcHeader(name: string): string | null | undefined; + get warcType(): string | null | undefined; + get warcTargetURI(): string | null | undefined; + get warcDate(): string | null | undefined; + get warcRefersToTargetURI(): string | null | undefined; + get warcRefersToDate(): string | null | undefined; + get warcPayloadDigest(): string | null | undefined; + get warcBlockDigest(): string | null | undefined; + get warcContentType(): string | null | undefined; + get warcContentLength(): number; + get warcConcurrentTo(): string[] | undefined; +} + +type WARCParserOpts = { + keepHeadersCase?: boolean; + parseHttp?: boolean; +}; +declare class WARCParser implements IndexerOffsetLength { + static parse(source: Source, options?: WARCParserOpts): Promise; + static iterRecords(source: Source, options?: WARCParserOpts): AsyncGenerator; + _offset: number; + _warcHeadersLength: number; + _headersClass: typeof HeadersMultiMap | typeof Headers; + _parseHttp: boolean; + _reader: AsyncIterReader; + _record: WARCRecord | null; + constructor(source: Source, { keepHeadersCase, parseHttp }?: WARCParserOpts); + readToNextRecord(): Promise; + _initRecordReader(warcHeaders: StatusAndHeaders): LimitReader; + parse(): Promise; + get offset(): number; + get recordLength(): number; + [Symbol.asyncIterator](): AsyncGenerator; + _addHttpHeaders(record: WARCRecord, headersParser: StatusAndHeadersParser): Promise; +} + +type WARCSerializerOpts = { + gzip?: boolean; + digest?: { + algo?: AlgorithmIdentifier; + prefix?: string; + base32?: boolean; + }; + preferPako?: boolean; +}; +declare abstract class BaseSerializerBuffer { + abstract write(chunk: Uint8Array): void; + abstract readAll(): AsyncIterable; + abstract clear(): void; +} +declare class SerializerInMemBuffer extends BaseSerializerBuffer { + buffers: Uint8Array[]; + write(chunk: Uint8Array): void; + readAll(): AsyncIterable; + clear(): void; +} +declare class WARCSerializer extends BaseAsyncIterReader { + gzip: boolean; + digestAlgo: AlgorithmIdentifier; + digestAlgoPrefix: string; + digestBase32: boolean; + preferPako: boolean; + record: WARCRecord; + externalBuffer: BaseSerializerBuffer | undefined; + _alreadyDigested: boolean; + blockHasher: IHasher | null; + payloadHasher: IHasher | null; + httpHeadersBuff: Uint8Array | null; + warcHeadersBuff: Uint8Array | null; + static serialize(record: WARCRecord, opts?: WARCSerializerOpts, externalBuffer?: BaseSerializerBuffer): Promise; + constructor(record: WARCRecord, opts?: WARCSerializerOpts, externalBuffer?: BaseSerializerBuffer); + static noComputeDigest(record: WARCRecord): string | true | null | undefined; + [Symbol.asyncIterator](): AsyncGenerator; + readlineRaw(maxLength?: number): Promise; + pakoCompress(): AsyncGenerator; + streamCompress(cs: CompressionStream): AsyncGenerator; + newHasher(): Promise; + getDigest(hasher: IHasher): string; + digestRecord(): Promise; + generateRecord(): AsyncGenerator; +} + +declare const indexCommandArgs: (yarg: Argv) => Argv<{ + filenames: string[]; +} & { + fields: string[]; +}>; +type IndexCommandArgs = Awaited["argv"]>; +declare const cdxIndexCommandArgs: (yarg: Argv) => Argv<{ + filenames: string[]; +} & { + all: boolean | undefined; +} & { + format: string; +} & { + noSurt: boolean | undefined; +} & { + fields: string[]; +}>; +type CdxIndexCommandArgs = Awaited["argv"]>; + +declare const DEFAULT_FIELDS: string[]; +declare abstract class BaseIndexer { + opts: Partial; + fields: string[]; + reqFields: string[]; + parseHttp: boolean; + constructor(opts?: Partial, defaultFields?: string[]); + serialize(result: Record): string; + write(result: Record, out: WritableStreamBuffer | NodeJS.WriteStream): void; + writeAll(files: StreamResults, out: WritableStreamBuffer | NodeJS.WriteStream): Promise; + iterIndex(files: StreamResults): AsyncGenerator, void, unknown>; + iterRecords(parser: WARCParser, filename: string): AsyncGenerator, void, unknown>; + filterRecord?(record: WARCRecord): boolean; + indexRecord(record: WARCRecord, indexerOffset: IndexerOffsetLength, filename: string): Record | null; + setField(field: string, record: WARCRecord, result: Record): void; + getField(field: string, record: WARCRecord): string | number | null | undefined; +} +declare class Indexer extends BaseIndexer { + constructor(opts?: Partial, defaultFields?: string[]); +} +declare const DEFAULT_CDX_FIELDS: string[]; +declare const DEFAULT_LEGACY_CDX_FIELDS: string[]; +interface CDXAndRecord { + cdx: Record; + record: WARCRecord; + reqRecord: WARCRecord | null; +} +declare class CDXIndexer extends Indexer { + includeAll: boolean; + overrideIndexForAll: boolean; + noSurt: boolean; + _lastRecord: WARCRecord | null; + constructor(opts?: Partial); + iterRecords(parser: WARCParser, filename: string): AsyncGenerator, void, unknown>; + filterRecord(record: WARCRecord): boolean; + indexRecord(record: WARCRecord | null, indexOffset: IndexerOffsetLength, filename: string): Record | null; + indexRecordPair(record: WARCRecord, reqRecord: WARCRecord | null, indexOffset: IndexerOffsetLength, filename: string): Record | null; + serializeCDXJ(result: Record): string; + serializeCDX11(result: Record): string; + getField(field: string, record: WARCRecord): string | number | null | undefined; +} +declare class CDXAndRecordIndexer extends CDXIndexer { + constructor(opts?: Partial); + indexRecordPair(record: WARCRecord, reqRecord: WARCRecord | null, indexOffset: IndexerOffsetLength, filename: string): CDXAndRecord | null; +} +declare function isRequestHeader(header: string): boolean; + +export { AsyncIterReader, AsyncIterReaderOpts, BaseAsyncIterReader, BaseSerializerBuffer, CDXAndRecord, CDXAndRecordIndexer, CDXIndexer, CRLF, CRLFCRLF, DEFAULT_CDX_FIELDS, DEFAULT_FIELDS, DEFAULT_LEGACY_CDX_FIELDS, HeadersMultiMap, Indexer, IndexerOffsetLength, LimitReader, NoConcatInflator, Request, Response, SerializerInMemBuffer, Source, SourceReadable, SourceReader, StatusAndHeaders, StatusAndHeadersParser, StreamResult, StreamResults, UTFToLatin1, WARCParser, WARCParserOpts, WARCRecord, WARCRecordOpts, WARCSerializer, WARCSerializerOpts, WARCType, WARC_1_0, WARC_1_1, appendRequestQuery, binaryToString, concatChunks, getSurt, indexOfDoubleCRLF, isRequestHeader, jsonToQueryParams, jsonToQueryString, latin1ToUTF, mfdToQueryParams, mfdToQueryString, multiValueHeader, postToGetUrl, readToDoubleCRLF, rxEscape, splitChunk }; diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..e57fe33 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,10 @@ +import ue from"pako";function V(n){let r;typeof n=="string"?r=n:n?.length?r=n.reduce((e,t)=>(e+=String.fromCharCode(t),e),""):n?r=n.toString():r="";try{return"__wb_post_data="+btoa(r)}catch{return"__wb_post_data="}}function Fe(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function J(n){try{if(!n.startsWith("https:")&&!n.startsWith("http:"))return n;n=n.replace(/^(https?:\/\/)www\d*\./,"$1");let r=n.toLowerCase(),e=new URL(r),s=e.hostname.split(".").reverse().join(",");if(e.port&&(s+=":"+e.port),s+=")",s+=e.pathname,e.search){let i=e.search.slice(1).split("&");i.sort(),s+="?"+i.join("&")}return s}catch{return n}}function X(n){let{method:r,headers:e,postData:t=""}=n;if(r==="GET")return!1;let i=(d=>{let c=d.get("content-type");if(c)return c;if(!(d instanceof Headers)){for(let[u,R]of d.entries())if(u&&u.toLowerCase()==="content-type")return R}return""})(e),a=i.split(";")[0];function o(d){return d instanceof Uint8Array&&(d=new TextDecoder().decode(d)),d}let l="";switch(a){case"application/x-www-form-urlencoded":l=o(t);break;case"application/json":l=G(o(t));break;case"text/plain":try{l=G(o(t),!1)}catch{l=V(t)}break;case"multipart/form-data":{if(!i)throw new Error("utils cannot call postToGetURL when missing content-type header");l=ce(o(t),i);break}default:l=V(t)}return l!=null?(n.url=oe(n.url,decodeURI(l),n.method),n.method="GET",n.requestBody=l,!0):!1}function oe(n,r,e){if(!e)return n;let t=n.indexOf("?")>0?"&":"?";return`${n}${t}__wb_method=${e}&${r}`}function le(n,r=!0){if(typeof n=="string")try{n=JSON.parse(n)}catch{n={}}let e=new URLSearchParams,t={},s=a=>e.has(a)?(a in t||(t[a]=1),a+"."+ ++t[a]+"_"):a,i=(a,o="")=>{let l="";if(typeof a=="object"&&!(a instanceof Array))try{for(let[d,c]of Object.entries(a))i(c,d)}catch{a===null&&(l="null")}else if(a instanceof Array)for(let d=0;de+=String.fromCharCode(t)),e}function K(n){let r=new Uint8Array(n.length);for(let e=0;e{t.done||!t.value?e.close():e.enqueue(t.value)})}})}async readFully(){return await n.readFully(this)}async readline(r=0){let e=await this.readlineRaw(r);return e?Y.decode(e):""}async*iterLines(r=0){let e=null;for(;e=await this.readline(r);)yield e}};function he(n){return!!(n&&Symbol.iterator in Object(n))}function fe(n){return!!(n&&Symbol.asyncIterator in Object(n))}var C=class n extends p{constructor(e,t="gzip",s=!1){super();this.compressed=t,this.opts={raw:t==="deflateRaw"},this.inflator=t?new k(this.opts,this):null;let i;if(fe(e))i=e;else if(typeof e=="object"&&"read"in e&&typeof e.read=="function")i=n.fromReadable(e);else if(e instanceof ReadableStream)i=n.fromReadable(e.getReader());else if(he(e))i=n.fromIter(e);else throw new TypeError("Invalid Stream Source");s?this._sourceIter=this.dechunk(i):this._sourceIter=i[Symbol.asyncIterator](),this.lastValue=null,this.errored=!1,this._savedChunk=null,this._rawOffset=0,this._readOffset=0,this.numChunks=0}async _loadNext(){let e=await this._sourceIter.next();return e.done?null:e.value}async*dechunk(e){let t=e instanceof n?e:new n(e,null),s=-1,i=!0;for(;s!=0;){let a=await t.readlineRaw(64),o=new Uint8Array;if(s=a?parseInt(Y.decode(a),16):0,!s||s>2**32){if(Number.isNaN(s)||s>2**32){i||(this.errored=!0),yield a;break}}else if(o=await t.readSize(s),o.length!=s){i?yield a:this.errored=!0,yield o;break}let l=await t.readSize(2);if(l[0]!=13||l[1]!=10){i?yield a:this.errored=!0,yield o,yield l;break}else{if(i=!1,!o||s===0)return;yield o}}yield*t}unread(e){e.length&&(this._readOffset-=e.length,this._savedChunk&&console.log("Already have chunk!"),this._savedChunk=e)}async _next(){if(this._savedChunk){let t=this._savedChunk;return this._savedChunk=null,t}if(this.compressed){let t=this._getNextChunk();if(t)return t}let e=await this._loadNext();for(;this.compressed&&e;){this._push(e);let t=this._getNextChunk(e);if(t)return t;e=await this._loadNext()}return e}_push(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _push when this.compressed is null");this.lastValue=e,this.inflator.ended&&(this.inflator=new k(this.opts,this)),this.inflator.push(e),this.inflator.err&&this.inflator.ended&&this.compressed==="deflate"&&!this.opts.raw&&this.numChunks===0&&(this.opts.raw=!0,this.compressed="deflateRaw",this.inflator=new k(this.opts,this),this.inflator.push(e))}_getNextChunk(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _getNextChunk when this.compressed is null");for(;;){if(this.inflator.chunks.length>0)return this.numChunks++,this.inflator.chunks.shift();if(this.inflator.ended){if(this.inflator.err!==0)return this.compressed=null,e;let t=this.inflator.strm.avail_in;if(t&&this.lastValue){this._push(this.lastValue.slice(-t));continue}}return null}}async*[Symbol.asyncIterator](){let e=null;for(;e=await this._next();)this._readOffset+=e.length,yield e}async readlineRaw(e){let t=[],s=0,i=-1,a=null;for await(let o of this){if(e&&s+o.byteLength>e){a=o,i=e-s-1;let l=o.slice(0,i+1).indexOf(10);l>=0&&(i=l);break}if(i=o.indexOf(10),i>=0){a=o;break}t.push(o),s+=o.byteLength}if(a){let[o,l]=A(a,i+1);t.push(o),s+=o.byteLength,this.unread(l)}else if(!t.length)return null;return b(t,s)}async readFully(){return(await this._readOrSkip())[1]}async readSize(e){return(await this._readOrSkip(e))[1]}async skipSize(e){return(await this._readOrSkip(e,!0))[0]}async _readOrSkip(e=-1,t=!1){let s=[],i=0;for await(let a of this){if(e>=0)if(a.length>e){let[o,l]=A(a,e);t||s.push(o),i+=o.byteLength,this.unread(l);break}else if(a.length===e){t||s.push(a),i+=a.byteLength,e=0;break}else e-=a.length;t||s.push(a),i+=a.byteLength}return t?[i,new Uint8Array]:[i,b(s,i)]}getReadOffset(){return this._readOffset}getRawOffset(){return this.compressed?this._rawOffset:this._readOffset}getRawLength(e){return this.compressed?this.inflator.strm.total_in:this._readOffset-e}static fromReadable(e){return{async*[Symbol.asyncIterator](){let s=null;for(;(s=await e.read())&&!s.done;)yield s.value}}}static fromIter(e){return{async*[Symbol.asyncIterator](){for(let s of e)yield s}}}},_=class extends p{constructor(e,t,s=0){super();this.sourceIter=e,this.length=t,this.limit=t,this.skip=s}setLimitSkip(e,t=0){this.limit=e,this.skip=t}async*[Symbol.asyncIterator](){if(!(this.limit<=0))for await(let e of this.sourceIter){if(this.skip>0)if(e.length>=this.skip){let[,t]=A(e,this.skip);e=t,this.skip=0}else{this.skip-=e.length;continue}if(e.length>this.limit){let[t,s]=A(e,this.limit);e=t,this.sourceIter.unread&&this.sourceIter.unread(s)}if(e.length&&(this.limit-=e.length,yield e),this.limit<=0)break}}async readlineRaw(e){if(this.limit<=0)return null;let t=await this.sourceIter.readlineRaw(e?Math.min(e,this.limit):this.limit);return this.limit-=t?.length||0,t}async skipFully(){let e=this.limit;for(;this.limit>0;)this.limit-=await this.sourceIter.skipSize(this.limit);return e}};var D=new Uint8Array([13,10]),Z=new Uint8Array([13,10,13,10]),pe=new TextDecoder("utf-8"),x=class{constructor({statusline:r,headers:e,reencodeHeaders:t}){this.statusline=r,this.headers=e,this.reencodeHeaders=t}toString(){let r=[this.statusline],e=this.headers instanceof Headers;for(let[t,s]of this.headers)e&&this.reencodeHeaders?.has(t)?r.push(`${t}: ${K(s)}`):r.push(`${t}: ${s}`);return r.join(`\r +`)+`\r +`}async*iterSerialize(r){yield r.encode(this.statusline),yield D;for(let[e,t]of this.headers)yield r.encode(`${e}: ${t}\r +`)}_parseResponseStatusLine(){let r=ye(this.statusline," ",2);this._protocol=r[0]??"",this._statusCode=r.length>1?Number(r[1]):"",this._statusText=r.length>2?r[2]:""}get statusCode(){return this._statusCode===void 0&&this._parseResponseStatusLine(),this._statusCode}get protocol(){return this._protocol===void 0&&this._parseResponseStatusLine(),this._protocol}get statusText(){return this._statusText===void 0&&this._parseResponseStatusLine(),this._statusText}_parseRequestStatusLine(){let r=this.statusline.split(" ",2);this._method=r[0]??"",this._requestPath=r.length>1?r[1]:""}get method(){return this._method===void 0&&this._parseRequestStatusLine(),this._method}get requestPath(){return this._requestPath===void 0&&this._parseRequestStatusLine(),this._requestPath}},U=class{constructor(){this.reencodeHeaders=new Set}async parse(r,{headersClass:e,firstLine:t}={headersClass:f}){let s=t||await r.readline();if(!s)return null;let i=s.trimEnd();if(!i)return null;let a=new e,o=await we(r),l=0,d,c,u,R="",h;for(;l=0&&d0&&s.push(t.slice(e).join(r)),s}async function ge(n,r){let e=0;for(let t=0;t=n.length){let{value:i}=await r.next();if(!i)break;let a=new Uint8Array(i.length+n.length);a.set(n,0),a.set(i,n.length),n=a}if(n[s+1]===10&&n[s+2]===13&&n[s+3]===10)return[s+3,n];e=s+1}return[-1,n]}async function we(n){let r=[],e=0,t=0,s=null,i=n[Symbol.asyncIterator]();for await(let a of i){if([t,a]=await ge(a,i),t>=0){s=a;break}r.push(a),e+=a.byteLength}if(s){let[a,o]=A(s,t+1);r.push(a),e+=a.byteLength,n.unread(o)}else if(!r.length)return"";return pe.decode(b(r,e))}import Re from"uuid-random";var me=new TextDecoder("utf-8"),Ae=new TextEncoder,Ce="WARC/1.1",j="WARC/1.0",_e="http://netpreserve.org/warc/1.0/revisit/identical-payload-digest",be="http://netpreserve.org/warc/1.1/revisit/identical-payload-digest",xe={warcinfo:"application/warc-fields",response:"application/http; msgtype=response",revisit:"application/http; msgtype=response",request:"application/http; msgtype=request",metadata:"application/warc-fields"},L=class n extends p{constructor({warcHeaders:e,reader:t}){super();this._offset=0;this._length=0;this._urlkey="";this.warcHeaders=e,this._reader=t,this._contentReader=null,this.payload=null,this.httpHeaders=null,this.consumed="",this.fixUp()}static create({url:e,date:t,type:s,warcHeaders:i={},filename:a="",httpHeaders:o={},statusline:l="HTTP/1.1 200 OK",warcVersion:d=j,keepHeadersCase:c=!0,refersToUrl:u=void 0,refersToDate:R=void 0}={},h){function N(m){let ae=m;return d===j&&(m=m.split(".")[0],m.charAt(ae.length-1)!="Z"&&(m+="Z")),m}t=N(t||new Date().toISOString());let y=new f(i);if(s==="warcinfo")a&&y.set("WARC-Filename",a);else if(e)try{y.set("WARC-Target-URI",new URL(e).href)}catch{y.set("WARC-Target-URI",e)}y.set("WARC-Date",t),s&&y.set("WARC-Type",s),s==="revisit"&&(y.set("WARC-Profile",d===Ce?be:_e),u&&(y.set("WARC-Refers-To-Target-URI",u),y.set("WARC-Refers-To-Date",N(R||new Date().toISOString()))));let H=new x({statusline:d,headers:y});H.headers.get("WARC-Record-ID")||H.headers.set("WARC-Record-ID",``),H.headers.get("Content-Type")||H.headers.set("Content-Type",s&&xe[s]||"application/octet-stream"),h||(h=ee());let $=new n({warcHeaders:H,reader:h}),S=null,F=!1;switch(s){case"response":case"request":case"revisit":c?(S=new f(o),F=!S.size):(S=new Headers(o),F=!Object.entries(o).length),(!F||s!=="revisit")&&($.httpHeaders=new x({statusline:l,headers:S}));break}return $}static createWARCInfo(e={},t){async function*s(){for(let[i,a]of Object.entries(t))yield Ae.encode(`${i}: ${a}\r +`)}return e.type="warcinfo",n.create(e,s())}getResponseInfo(){let e=this.httpHeaders;return e?{headers:e.headers,status:e.statusCode,statusText:e.statusText}:null}fixUp(){let e=this.warcHeaders.headers.get("WARC-Target-URI");e&&e.startsWith("<")&&e.endsWith(">")&&this.warcHeaders.headers.set("WARC-Target-URI",e.slice(1,-1))}async readFully(e=!1){if(this.httpHeaders){if(this.payload&&!this.payload.length)return this.payload;if(this._contentReader&&!e)throw new TypeError("WARC Record decoding already started, but requesting raw payload");if(e&&this.consumed==="raw"&&this.payload)return await this._createDecodingReader([this.payload]).readFully()}return this.payload?this.payload:(e?(this.payload=await super.readFully(),this.consumed="content"):(this.payload=await p.readFully(this._reader),this.consumed="raw"),this.payload)}get reader(){if(this.payload&&!this.payload.length)return ee();if(this._contentReader)throw new TypeError("WARC Record decoding already started, but requesting raw payload");return this._reader}get contentReader(){return this.httpHeaders?(this._contentReader||(this._contentReader=this._createDecodingReader(this._reader)),this._contentReader):this._reader}_createDecodingReader(e){if(!this.httpHeaders)throw new Error("WARCRecord cannot call _createDecodingReader when this.httpHeaders === null");let t=this.httpHeaders.headers.get("Content-Encoding"),s=this.httpHeaders.headers.get("Transfer-Encoding"),i=s==="chunked";return!t&&!i&&(t=s),new C(e,t,i)}async readlineRaw(e){if(this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");if(this.contentReader instanceof p)return this.contentReader.readlineRaw(e);throw new Error("WARCRecord cannot call readlineRaw on this.contentReader if it does not extend BaseAsyncIterReader")}async contentText(){let e=await this.readFully(!0);return me.decode(e)}async*[Symbol.asyncIterator](){for await(let e of this.contentReader)if(yield e,this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");this.consumed="content"}async skipFully(){if(!this.consumed){if(this._reader instanceof _){let e=await this._reader.skipFully();return this.consumed="skipped",e}throw new Error("WARCRecord cannot call skipFully on this._reader if it is not a LimitReader")}}warcHeader(e){return this.warcHeaders.headers.get(e)}get warcType(){return this.warcHeaders.headers.get("WARC-Type")}get warcTargetURI(){return this.warcHeaders.headers.get("WARC-Target-URI")}get warcDate(){return this.warcHeaders.headers.get("WARC-Date")}get warcRefersToTargetURI(){return this.warcHeaders.headers.get("WARC-Refers-To-Target-URI")}get warcRefersToDate(){return this.warcHeaders.headers.get("WARC-Refers-To-Date")}get warcPayloadDigest(){return this.warcHeaders.headers.get("WARC-Payload-Digest")}get warcBlockDigest(){return this.warcHeaders.headers.get("WARC-Block-Digest")}get warcContentType(){return this.warcHeaders.headers.get("Content-Type")}get warcContentLength(){return Number(this.warcHeaders.headers.get("Content-Length"))}get warcConcurrentTo(){if(this.warcHeaders.headers instanceof f)return this.warcHeaders.headers.getMultiple("WARC-Concurrent-To");{let e=this.warcHeaders.headers.get("WARC-Concurrent-To");return e?e.split(","):[]}}};async function*ee(){}var te=new TextDecoder,P=new Uint8Array([]),W=class n{static async parse(r,e){return new n(r,e).parse()}static iterRecords(r,e){return new n(r,e)[Symbol.asyncIterator]()}constructor(r,{keepHeadersCase:e=!1,parseHttp:t=!0}={}){this._offset=0,this._warcHeadersLength=0,this._headersClass=e?f:Headers,this._parseHttp=t,r instanceof C?this._reader=r:this._reader=new C(r),this._record=null}async readToNextRecord(){if(!this._reader||!this._record)return P;await this._record.skipFully(),this._reader.compressed&&(this._offset=this._reader.getRawOffset());let r=await this._reader.readlineRaw(),e=0;if(!r)r=P;else{if(e=r.byteLength-1,e===9&&te.decode(r).startsWith("WARC/"))return r;for(;e>0;){let t=r[e-1];if(t!==10&&t!==13)break;e--}e&&console.warn(`Content-Length Too Small: Record not followed by newline, Remainder Length: ${e}, Offset: ${this._reader.getRawOffset()-r.byteLength}`)}if(this._reader.compressed)await this._reader.skipSize(2),r=P;else{for(r=await this._reader.readlineRaw();r&&r.byteLength===2;)r=await this._reader.readlineRaw();this._offset=this._reader.getRawOffset(),r&&(this._offset-=r.length)}return r}_initRecordReader(r){return new _(this._reader,Number(r.headers.get("Content-Length")||0))}async parse(){let r=await this.readToNextRecord(),e=r?te.decode(r):"",t=new U,s=await t.parse(this._reader,{firstLine:e,headersClass:this._headersClass});if(!s)return null;this._warcHeadersLength=this._reader.getReadOffset();let i=new L({warcHeaders:s,reader:this._initRecordReader(s)});if(this._record=i,this._parseHttp)switch(i.warcType){case"response":case"request":await this._addHttpHeaders(i,t);break;case"revisit":i.warcContentLength>0&&await this._addHttpHeaders(i,t);break}return i}get offset(){return this._offset}get recordLength(){return this._reader.getRawLength(this._offset)}async*[Symbol.asyncIterator](){let r=null;for(;(r=await this.parse())!==null;)yield r;this._record=null}async _addHttpHeaders(r,e){let t=await e.parse(this._reader,{headersClass:this._headersClass});r.httpHeaders=t;let s=this._reader.getReadOffset()-this._warcHeadersLength;r.reader instanceof _&&r.reader.setLimitSkip(r.warcContentLength-s)}};function E(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}var He="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",ke="0123456789ABCDEFGHIJKLMNOPQRSTUV",Se="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function B(n,r,e){e=e||{};let t,s;switch(r){case"RFC3548":case"RFC4648":t=He,s=!0;break;case"RFC4648-HEX":t=ke,s=!0;break;case"Crockford":t=Se,s=!1;break;default:throw new Error("Unknown base32 variant: "+r)}let i=e.padding!==void 0?e.padding:s,a=E(n),o=0,l=0,d="";for(let c=0;c=5;)d+=t[l>>>o-5&31],o-=5;if(o>0&&(d+=t[l<<5-o&31]),i)for(;d.length%8!==0;)d+="=";return d}import Ie from"pako";import{createSHA256 as re,createSHA1 as Te}from"hash-wasm";var se=new TextEncoder,O=class{},v=class extends O{constructor(){super(...arguments);this.buffers=[]}write(e){this.buffers.push(e)}async*readAll(){for(let e of this.buffers)yield e}clear(){this.buffers=[]}},ne=class n extends p{constructor(e,t={},s=new v){super();this.gzip=!1;this.digestAlgo="";this.digestAlgoPrefix="";this.digestBase32=!1;this.preferPako=!1;this._alreadyDigested=!1;this.blockHasher=null;this.payloadHasher=null;this.httpHeadersBuff=null;this.warcHeadersBuff=null;this.gzip=!!t.gzip,this.record=e;let i=t.digest||{};this.digestAlgo=i.algo||"sha-256",this.digestAlgoPrefix=i.prefix||"sha256:",this.digestBase32=!!i.base32,this.preferPako=!!t.preferPako,n.noComputeDigest(e)&&(this.digestAlgo=""),this.externalBuffer=s}static async serialize(e,t,s=new v){return await new n(e,t,s).readFully()}static noComputeDigest(e){return e.warcType==="revisit"||e.warcType==="warcinfo"||e.warcPayloadDigest&&e.warcBlockDigest}async*[Symbol.asyncIterator](){if(!this.gzip){yield*this.generateRecord();return}if("CompressionStream"in globalThis&&!this.preferPako){let e=new globalThis.CompressionStream("gzip");yield*this.streamCompress(e)}else yield*this.pakoCompress()}async readlineRaw(e){return null}async*pakoCompress(){let e=new Ie.Deflate({gzip:!0}),t=null;for await(let s of this.generateRecord())for(t&&t.length>0&&e.push(t),t=s;e.chunks.length;)yield e.chunks.shift();t&&e.push(t,!0),yield e.result}async*streamCompress(e){let t=this.generateRecord();new ReadableStream({async pull(o){let l=await t.next();l.done?o.close():o.enqueue(l.value)}}).pipeThrough(e);let i=null,a=e.readable.getReader();for(;(i=await a.read())&&!i.done;)yield i.value}async newHasher(){switch(this.digestAlgo){case"sha-256":return re();case"sha-1":return Te();case"":return null;default:return re()}}getDigest(e){return this.digestAlgoPrefix+(this.digestBase32?B(e.digest("binary"),"RFC4648"):e.digest("hex"))}async digestRecord(){let e=this.record;if(this._alreadyDigested)return Number(e.warcHeaders.headers.get("Content-Length"));let t=await this.newHasher(),s=await this.newHasher(),i=0;e.httpHeaders&&(this.httpHeadersBuff=se.encode(e.httpHeaders.toString()+`\r +`),i+=this.httpHeadersBuff.length,t?.update(this.httpHeadersBuff));for await(let a of e.reader)t?.update(a),s?.update(a),this.externalBuffer.write(a),i+=a.length;return s&&e.warcHeaders.headers.set("WARC-Payload-Digest",this.getDigest(s)),t&&e.warcHeaders.headers.set("WARC-Block-Digest",this.getDigest(t)),e.warcHeaders.headers.set("Content-Length",i.toString()),this.warcHeadersBuff=se.encode(e.warcHeaders.toString()),this._alreadyDigested=!0,i}async*generateRecord(){if(await this.digestRecord(),this.warcHeadersBuff&&(yield this.warcHeadersBuff),yield D,this.httpHeadersBuff&&(yield this.httpHeadersBuff),this.externalBuffer)for await(let e of this.externalBuffer.readAll())yield e;yield Z}};var Ue=["offset","warc-type","warc-target-uri"],q=class{constructor(r={},e=Ue){this.opts=r,r.fields?(this.fields=r.fields,this.reqFields=this.fields.filter(t=>ve(t))):(this.fields=e,this.reqFields=[]),this.parseHttp=!1}serialize(r){return JSON.stringify(r)+` +`}write(r,e){e.write(this.serialize(r))}async writeAll(r,e){for await(let t of this.iterIndex(r))this.write(t,e)}async*iterIndex(r){let e={strictHeaders:!0,parseHttp:this.parseHttp};for(let{filename:t,reader:s}of r){let i=new W(s,e);yield*this.iterRecords(i,t)}}async*iterRecords(r,e){for await(let t of r){await t.skipFully();let s=this.indexRecord(t,r,e);s&&(yield s)}}indexRecord(r,e,t){if(this.filterRecord&&!this.filterRecord(r))return null;let s={},{offset:i,recordLength:a}=e,o={offset:i,length:a,filename:t};for(let l of this.fields)l in o?s[l]=o[l]:this.setField(l,r,s);return s}setField(r,e,t){let s=this.getField(r,e);s!==null&&(t[r]=s)}getField(r,e){if(r.startsWith("req."))if(e.warcType==="request")r=r.slice(4);else return null;if(r==="http:status")return e.httpHeaders&&(e.warcType==="response"||e.warcType==="revisit")?e.httpHeaders.statusCode:null;if(r.startsWith("http:")){if(e.httpHeaders){let t=e.httpHeaders.headers,s=r.slice(5),i=t.get(s);if(t instanceof Map){let a=s.toLowerCase();for(let o of t.keys())a===o.toLowerCase()&&(i=t.get(o))}return i}return null}return e.warcHeaders.headers.get(r)||null}},M=class extends q{constructor(r,e){super(r,e);for(let t of this.fields)if(t.startsWith("http:")){this.parseHttp=!0;break}}},Le="urlkey,timestamp,url,mime,status,digest,length,offset,filename".split(","),We="urlkey,timestamp,url,mime,status,digest,redirect,meta,length,offset,filename".split(","),z=class extends M{constructor(e){super(e,Le);switch(this.includeAll=!!e?.all,this.overrideIndexForAll=!!e?.all,this.parseHttp=!0,this.noSurt=!!e?.noSurt,this._lastRecord=null,e?.format){case"cdxj":this.serialize=this.serializeCDXJ;break;case"cdx":this.serialize=this.serializeCDX11;break;case"json":default:break}}async*iterRecords(e,t){this._lastRecord=null;for await(let i of e){await i.readFully();let a=this.indexRecord(i,e,t);a&&(yield a)}let s=this.indexRecord(null,e,t);s&&(yield s)}filterRecord(e){if(this.includeAll)return!0;let t=e.warcType;return!(t==="request"||t==="warcinfo"||(t==="metadata"||t==="resource")&&e.warcContentType==="application/warc-fields")}indexRecord(e,t,s){if(this.overrideIndexForAll)return e?super.indexRecord(e,t,s):null;let i=this._lastRecord;if(this._lastRecord=e,e&&(e._offset=t.offset,e._length=t.recordLength),!i)return null;if(!e||i.warcTargetURI!=e.warcTargetURI)return this.indexRecordPair(i,null,t,s);let a=e.warcType,o=i.warcType;return a==="request"&&(o==="response"||o==="revisit")?(this._lastRecord=null,this.indexRecordPair(i,e,t,s)):(a==="response"||a==="revisit")&&o==="request"?(this._lastRecord=null,this.indexRecordPair(e,i,t,s)):this.indexRecordPair(i,null,t,s)}indexRecordPair(e,t,s,i){let a,o,l=e.warcTargetURI||"";if(t?.httpHeaders&&t.httpHeaders.method!=="GET"){let c={url:l,method:t.httpHeaders.method,headers:t.httpHeaders.headers,postData:t.payload};a=c.method,X(c)&&(o=c.requestBody,l=c.url)}e._urlkey=l;let d=super.indexRecord(e,s,i);if(d&&(e._offset!==void 0&&(d.offset=e._offset,d.length=e._length),a&&(d.method=a),o&&(d.requestBody=o),t&&this.reqFields.length))for(let c of this.reqFields)this.setField(c,t,d);return d}serializeCDXJ(e){let{urlkey:t,timestamp:s}=e;return delete e.urlkey,delete e.timestamp,`${t} ${s} ${JSON.stringify(e,(a,o)=>["offset","length","status"].includes(a)?o==null?"":""+o:o)} +`}serializeCDX11(e){let t=[];for(let s of We)t.push(e[s]!=null?e[s]:"-");return t.join(" ")+` +`}getField(e,t){let s=null;switch(e){case"urlkey":return s=t._urlkey||t.warcTargetURI||null,this.noSurt||s===null?s:J(s);case"timestamp":return s=t.warcDate??"",s.replace(/[-:T]/g,"").slice(0,14);case"url":return t.warcTargetURI;case"mime":switch(t.warcType){case"revisit":return"warc/revisit";case"response":case"request":e="http:content-type";break;default:return t.warcContentType}return s=super.getField(e,t),s?s.toString().split(";",1)[0]?.trim():null;case"status":return super.getField("http:status",t);case"referrer":return super.getField("req.http:referer",t);case"digest":return s=t.warcPayloadDigest,s?s.split(":",2)[1]:null;default:return super.getField(e,t)}}},ie=class extends z{constructor(r){super(r),this.overrideIndexForAll=!1}indexRecordPair(r,e,t,s){let i=super.indexRecordPair(r,e,t,s);return i&&{cdx:i,record:r,reqRecord:e}}};function ve(n){return n.startsWith("req.")||n.toLowerCase()==="referrer"}export{C as AsyncIterReader,p as BaseAsyncIterReader,O as BaseSerializerBuffer,ie as CDXAndRecordIndexer,z as CDXIndexer,D as CRLF,Z as CRLFCRLF,Le as DEFAULT_CDX_FIELDS,Ue as DEFAULT_FIELDS,We as DEFAULT_LEGACY_CDX_FIELDS,f as HeadersMultiMap,M as Indexer,_ as LimitReader,k as NoConcatInflator,v as SerializerInMemBuffer,x as StatusAndHeaders,U as StatusAndHeadersParser,Q as UTFToLatin1,W as WARCParser,L as WARCRecord,ne as WARCSerializer,j as WARC_1_0,Ce as WARC_1_1,oe as appendRequestQuery,V as binaryToString,b as concatChunks,J as getSurt,ge as indexOfDoubleCRLF,ve as isRequestHeader,le as jsonToQueryParams,G as jsonToQueryString,K as latin1ToUTF,de as mfdToQueryParams,ce as mfdToQueryString,De as multiValueHeader,X as postToGetUrl,we as readToDoubleCRLF,Fe as rxEscape,A as splitChunk}; diff --git a/dist/node/index.cjs b/dist/node/index.cjs new file mode 100644 index 0000000..0e63d5b --- /dev/null +++ b/dist/node/index.cjs @@ -0,0 +1,2 @@ +"use strict";var V=Object.create;var g=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var K=(n,s)=>{for(var e in s)g(n,e,{get:s[e],enumerable:!0})},L=(n,s,e,t)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of $(s))!G.call(n,r)&&r!==e&&g(n,r,{get:()=>s[r],enumerable:!(t=q(s,r))||t.enumerable});return n};var R=(n,s,e)=>(e=n!=null?V(Q(n)):{},L(s||!n||!n.__esModule?g(e,"default",{value:n,enumerable:!0}):e,n)),J=n=>L(g({},"__esModule",{value:!0}),n);var re={};K(re,{DEFAULT_MEM_SIZE:()=>H,TempFileBuffer:()=>b,WARCSerializer:()=>I,streamFinish:()=>N});module.exports=J(re);var U=R(require("fs"),1),W=require("fs/promises"),M=require("tempy");function x(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}var X="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Z="0123456789ABCDEFGHIJKLMNOPQRSTUV",Y="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function C(n,s,e){e=e||{};let t,r;switch(s){case"RFC3548":case"RFC4648":t=X,r=!0;break;case"RFC4648-HEX":t=Z,r=!0;break;case"Crockford":t=Y,r=!1;break;default:throw new Error("Unknown base32 variant: "+s)}let i=e.padding!==void 0?e.padding:r,o=x(n),a=0,l=0,f="";for(let A=0;A=5;)f+=t[l>>>a-5&31],a-=5;if(a>0&&(f+=t[l<<5-a&31]),i)for(;f.length%8!==0;)f+="=";return f}var D=R(require("pako"),1),y=require("hash-wasm");var z=R(require("pako"),1);function m(n,s){if(n.length===1)return n[0];let e=new Uint8Array(s),t=0;for(let r of n)e.set(r,t),t+=r.byteLength;return e}function d(n,s){return[n.slice(0,s),n.slice(s)]}var k=["set-cookie","warc-concurrent-to","warc-protocol"],S=",,,";var T=class extends Map{constructor(s){if(s instanceof Array){super();for(let e of s)if(e instanceof Array){let t=e[0],r=e[1];this.append(t,r)}}else super(s?Object.entries(s):void 0)}getMultiple(s){let e=super.get(s);if(e)return k.includes(s.toLowerCase())?e.split(S):[e]}append(s,e){if(k.includes(s.toLowerCase())){let t=this.get(s);this.set(s,t!==void 0?t+S+e:e)}else this.set(s,e)}*[Symbol.iterator](){for(let[s,e]of super[Symbol.iterator]())if(k.includes(s.toLowerCase()))for(let t of e.split(S))yield[s,t];else yield[s,e]}};var E=new TextDecoder("utf-8"),p=class extends z.default.Inflate{constructor(e,t){super(e);this.ended=!1;this.chunks=[];this.reader=t}onEnd(e){this.err=e,this.err||(this.reader._rawOffset+=this.strm.total_in)}},c=class n{static async readFully(s){let e=[],t=0;for await(let r of s)e.push(r),t+=r.byteLength;return m(e,t)}getReadableStream(){let s=this[Symbol.asyncIterator]();return new ReadableStream({async pull(e){return s.next().then(t=>{t.done||!t.value?e.close():e.enqueue(t.value)})}})}async readFully(){return await n.readFully(this)}async readline(s=0){let e=await this.readlineRaw(s);return e?E.decode(e):""}async*iterLines(s=0){let e=null;for(;e=await this.readline(s);)yield e}};function j(n){return!!(n&&Symbol.iterator in Object(n))}function ee(n){return!!(n&&Symbol.asyncIterator in Object(n))}var v=class n extends c{constructor(e,t="gzip",r=!1){super();this.compressed=t,this.opts={raw:t==="deflateRaw"},this.inflator=t?new p(this.opts,this):null;let i;if(ee(e))i=e;else if(typeof e=="object"&&"read"in e&&typeof e.read=="function")i=n.fromReadable(e);else if(e instanceof ReadableStream)i=n.fromReadable(e.getReader());else if(j(e))i=n.fromIter(e);else throw new TypeError("Invalid Stream Source");r?this._sourceIter=this.dechunk(i):this._sourceIter=i[Symbol.asyncIterator](),this.lastValue=null,this.errored=!1,this._savedChunk=null,this._rawOffset=0,this._readOffset=0,this.numChunks=0}async _loadNext(){let e=await this._sourceIter.next();return e.done?null:e.value}async*dechunk(e){let t=e instanceof n?e:new n(e,null),r=-1,i=!0;for(;r!=0;){let o=await t.readlineRaw(64),a=new Uint8Array;if(r=o?parseInt(E.decode(o),16):0,!r||r>2**32){if(Number.isNaN(r)||r>2**32){i||(this.errored=!0),yield o;break}}else if(a=await t.readSize(r),a.length!=r){i?yield o:this.errored=!0,yield a;break}let l=await t.readSize(2);if(l[0]!=13||l[1]!=10){i?yield o:this.errored=!0,yield a,yield l;break}else{if(i=!1,!a||r===0)return;yield a}}yield*t}unread(e){e.length&&(this._readOffset-=e.length,this._savedChunk&&console.log("Already have chunk!"),this._savedChunk=e)}async _next(){if(this._savedChunk){let t=this._savedChunk;return this._savedChunk=null,t}if(this.compressed){let t=this._getNextChunk();if(t)return t}let e=await this._loadNext();for(;this.compressed&&e;){this._push(e);let t=this._getNextChunk(e);if(t)return t;e=await this._loadNext()}return e}_push(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _push when this.compressed is null");this.lastValue=e,this.inflator.ended&&(this.inflator=new p(this.opts,this)),this.inflator.push(e),this.inflator.err&&this.inflator.ended&&this.compressed==="deflate"&&!this.opts.raw&&this.numChunks===0&&(this.opts.raw=!0,this.compressed="deflateRaw",this.inflator=new p(this.opts,this),this.inflator.push(e))}_getNextChunk(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _getNextChunk when this.compressed is null");for(;;){if(this.inflator.chunks.length>0)return this.numChunks++,this.inflator.chunks.shift();if(this.inflator.ended){if(this.inflator.err!==0)return this.compressed=null,e;let t=this.inflator.strm.avail_in;if(t&&this.lastValue){this._push(this.lastValue.slice(-t));continue}}return null}}async*[Symbol.asyncIterator](){let e=null;for(;e=await this._next();)this._readOffset+=e.length,yield e}async readlineRaw(e){let t=[],r=0,i=-1,o=null;for await(let a of this){if(e&&r+a.byteLength>e){o=a,i=e-r-1;let l=a.slice(0,i+1).indexOf(10);l>=0&&(i=l);break}if(i=a.indexOf(10),i>=0){o=a;break}t.push(a),r+=a.byteLength}if(o){let[a,l]=d(o,i+1);t.push(a),r+=a.byteLength,this.unread(l)}else if(!t.length)return null;return m(t,r)}async readFully(){return(await this._readOrSkip())[1]}async readSize(e){return(await this._readOrSkip(e))[1]}async skipSize(e){return(await this._readOrSkip(e,!0))[0]}async _readOrSkip(e=-1,t=!1){let r=[],i=0;for await(let o of this){if(e>=0)if(o.length>e){let[a,l]=d(o,e);t||r.push(a),i+=a.byteLength,this.unread(l);break}else if(o.length===e){t||r.push(o),i+=o.byteLength,e=0;break}else e-=o.length;t||r.push(o),i+=o.byteLength}return t?[i,new Uint8Array]:[i,m(r,i)]}getReadOffset(){return this._readOffset}getRawOffset(){return this.compressed?this._rawOffset:this._readOffset}getRawLength(e){return this.compressed?this.inflator.strm.total_in:this._readOffset-e}static fromReadable(e){return{async*[Symbol.asyncIterator](){let r=null;for(;(r=await e.read())&&!r.done;)yield r.value}}}static fromIter(e){return{async*[Symbol.asyncIterator](){for(let r of e)yield r}}}},B=class extends c{constructor(e,t,r=0){super();this.sourceIter=e,this.length=t,this.limit=t,this.skip=r}setLimitSkip(e,t=0){this.limit=e,this.skip=t}async*[Symbol.asyncIterator](){if(!(this.limit<=0))for await(let e of this.sourceIter){if(this.skip>0)if(e.length>=this.skip){let[,t]=d(e,this.skip);e=t,this.skip=0}else{this.skip-=e.length;continue}if(e.length>this.limit){let[t,r]=d(e,this.limit);e=t,this.sourceIter.unread&&this.sourceIter.unread(r)}if(e.length&&(this.limit-=e.length,yield e),this.limit<=0)break}}async readlineRaw(e){if(this.limit<=0)return null;let t=await this.sourceIter.readlineRaw(e?Math.min(e,this.limit):this.limit);return this.limit-=t?.length||0,t}async skipFully(){let e=this.limit;for(;this.limit>0;)this.limit-=await this.sourceIter.skipSize(this.limit);return e}};var P=new Uint8Array([13,10]),F=new Uint8Array([13,10,13,10]),pe=new TextDecoder("utf-8");var O=new TextEncoder,_=class{},h=class extends _{constructor(){super(...arguments);this.buffers=[]}write(e){this.buffers.push(e)}async*readAll(){for(let e of this.buffers)yield e}clear(){this.buffers=[]}},w=class n extends c{constructor(e,t={},r=new h){super();this.gzip=!1;this.digestAlgo="";this.digestAlgoPrefix="";this.digestBase32=!1;this.preferPako=!1;this._alreadyDigested=!1;this.blockHasher=null;this.payloadHasher=null;this.httpHeadersBuff=null;this.warcHeadersBuff=null;this.gzip=!!t.gzip,this.record=e;let i=t.digest||{};this.digestAlgo=i.algo||"sha-256",this.digestAlgoPrefix=i.prefix||"sha256:",this.digestBase32=!!i.base32,this.preferPako=!!t.preferPako,n.noComputeDigest(e)&&(this.digestAlgo=""),this.externalBuffer=r}static async serialize(e,t,r=new h){return await new n(e,t,r).readFully()}static noComputeDigest(e){return e.warcType==="revisit"||e.warcType==="warcinfo"||e.warcPayloadDigest&&e.warcBlockDigest}async*[Symbol.asyncIterator](){if(!this.gzip){yield*this.generateRecord();return}if("CompressionStream"in globalThis&&!this.preferPako){let e=new globalThis.CompressionStream("gzip");yield*this.streamCompress(e)}else yield*this.pakoCompress()}async readlineRaw(e){return null}async*pakoCompress(){let e=new D.default.Deflate({gzip:!0}),t=null;for await(let r of this.generateRecord())for(t&&t.length>0&&e.push(t),t=r;e.chunks.length;)yield e.chunks.shift();t&&e.push(t,!0),yield e.result}async*streamCompress(e){let t=this.generateRecord();new ReadableStream({async pull(a){let l=await t.next();l.done?a.close():a.enqueue(l.value)}}).pipeThrough(e);let i=null,o=e.readable.getReader();for(;(i=await o.read())&&!i.done;)yield i.value}async newHasher(){switch(this.digestAlgo){case"sha-256":return(0,y.createSHA256)();case"sha-1":return(0,y.createSHA1)();case"":return null;default:return(0,y.createSHA256)()}}getDigest(e){return this.digestAlgoPrefix+(this.digestBase32?C(e.digest("binary"),"RFC4648"):e.digest("hex"))}async digestRecord(){let e=this.record;if(this._alreadyDigested)return Number(e.warcHeaders.headers.get("Content-Length"));let t=await this.newHasher(),r=await this.newHasher(),i=0;e.httpHeaders&&(this.httpHeadersBuff=O.encode(e.httpHeaders.toString()+`\r +`),i+=this.httpHeadersBuff.length,t?.update(this.httpHeadersBuff));for await(let o of e.reader)t?.update(o),r?.update(o),this.externalBuffer.write(o),i+=o.length;return r&&e.warcHeaders.headers.set("WARC-Payload-Digest",this.getDigest(r)),t&&e.warcHeaders.headers.set("WARC-Block-Digest",this.getDigest(t)),e.warcHeaders.headers.set("Content-Length",i.toString()),this.warcHeadersBuff=O.encode(e.warcHeaders.toString()),this._alreadyDigested=!0,i}async*generateRecord(){if(await this.digestRecord(),this.warcHeadersBuff&&(yield this.warcHeadersBuff),yield P,this.httpHeadersBuff&&(yield this.httpHeadersBuff),this.externalBuffer)for await(let e of this.externalBuffer.readAll())yield e;yield F}};var H=1024*1024*2,I=class n extends w{static async serialize(s,e){return await new n(s,e).readFully()}constructor(s,e={}){super(s,e,new b(e.maxMemSize||H))}},b=class extends h{constructor(e=H){super();this.currSize=0;this.fh=null;this.filename="";this.memSize=e}write(e){this.currSize+e.length<=this.memSize?this.buffers.push(e):(this.fh||(this.filename=(0,M.temporaryFile)(),this.fh=U.default.createWriteStream(this.filename)),this.fh.write(e)),this.currSize+=e.length}async*readAll(){for(let t of this.buffers)yield t;if(!this.fh)return;await N(this.fh),this.fh=null;let e=U.default.createReadStream(this.filename);for await(let t of e)yield t;await this.clear()}async clear(){this.filename&&(await(0,W.unlink)(this.filename),this.filename="")}};async function N(n){let s=new Promise(e=>{n.once("finish",()=>e())});return n.end(),s}0&&(module.exports={DEFAULT_MEM_SIZE,TempFileBuffer,WARCSerializer,streamFinish}); diff --git a/dist/node/index.d.cts b/dist/node/index.d.cts new file mode 100644 index 0000000..d863fbd --- /dev/null +++ b/dist/node/index.d.cts @@ -0,0 +1,27 @@ +import { WriteStream } from 'node:fs'; +import { W as WARCSerializerOpts$1, a as WARCSerializer$1, b as WARCRecord, S as SerializerInMemBuffer } from '../warcserializer-a7845700.js'; +import 'hash-wasm/dist/lib/WASMInterface.js'; +import 'pako'; +import '../utils-dfea30f1.js'; + +declare const DEFAULT_MEM_SIZE: number; +type WARCSerializerOpts = WARCSerializerOpts$1 & { + maxMemSize?: number; +}; +declare class WARCSerializer extends WARCSerializer$1 { + static serialize(record: WARCRecord, opts?: WARCSerializerOpts): Promise; + constructor(record: WARCRecord, opts?: WARCSerializerOpts); +} +declare class TempFileBuffer extends SerializerInMemBuffer { + memSize: number; + currSize: number; + fh: WriteStream | null; + filename: string; + constructor(memSize?: number); + write(chunk: Uint8Array): void; + readAll(): AsyncIterable; + clear(): Promise; +} +declare function streamFinish(fh: WriteStream): Promise; + +export { DEFAULT_MEM_SIZE, TempFileBuffer, WARCSerializer, WARCSerializerOpts, streamFinish }; diff --git a/dist/node/index.d.ts b/dist/node/index.d.ts new file mode 100644 index 0000000..d863fbd --- /dev/null +++ b/dist/node/index.d.ts @@ -0,0 +1,27 @@ +import { WriteStream } from 'node:fs'; +import { W as WARCSerializerOpts$1, a as WARCSerializer$1, b as WARCRecord, S as SerializerInMemBuffer } from '../warcserializer-a7845700.js'; +import 'hash-wasm/dist/lib/WASMInterface.js'; +import 'pako'; +import '../utils-dfea30f1.js'; + +declare const DEFAULT_MEM_SIZE: number; +type WARCSerializerOpts = WARCSerializerOpts$1 & { + maxMemSize?: number; +}; +declare class WARCSerializer extends WARCSerializer$1 { + static serialize(record: WARCRecord, opts?: WARCSerializerOpts): Promise; + constructor(record: WARCRecord, opts?: WARCSerializerOpts); +} +declare class TempFileBuffer extends SerializerInMemBuffer { + memSize: number; + currSize: number; + fh: WriteStream | null; + filename: string; + constructor(memSize?: number); + write(chunk: Uint8Array): void; + readAll(): AsyncIterable; + clear(): Promise; +} +declare function streamFinish(fh: WriteStream): Promise; + +export { DEFAULT_MEM_SIZE, TempFileBuffer, WARCSerializer, WARCSerializerOpts, streamFinish }; diff --git a/dist/node/index.js b/dist/node/index.js new file mode 100644 index 0000000..b34f007 --- /dev/null +++ b/dist/node/index.js @@ -0,0 +1,2 @@ +import B from"fs";import{unlink as $}from"fs/promises";import{temporaryFile as Q}from"tempy";function b(n){if(n instanceof Int8Array||n instanceof Uint8Array||n instanceof Uint8ClampedArray)return new DataView(n.buffer,n.byteOffset,n.byteLength);if(n instanceof ArrayBuffer)return new DataView(n);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}var P="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",F="0123456789ABCDEFGHIJKLMNOPQRSTUV",O="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function A(n,s,e){e=e||{};let t,r;switch(s){case"RFC3548":case"RFC4648":t=P,r=!0;break;case"RFC4648-HEX":t=F,r=!0;break;case"Crockford":t=O,r=!1;break;default:throw new Error("Unknown base32 variant: "+s)}let i=e.padding!==void 0?e.padding:r,o=b(n),a=0,l=0,d="";for(let w=0;w=5;)d+=t[l>>>a-5&31],a-=5;if(a>0&&(d+=t[l<<5-a&31]),i)for(;d.length%8!==0;)d+="=";return d}import N from"pako";import{createSHA256 as T,createSHA1 as V}from"hash-wasm";import D from"pako";function g(n,s){if(n.length===1)return n[0];let e=new Uint8Array(s),t=0;for(let r of n)e.set(r,t),t+=r.byteLength;return e}function p(n,s){return[n.slice(0,s),n.slice(s)]}var R=["set-cookie","warc-concurrent-to","warc-protocol"],x=",,,";var S=class extends Map{constructor(s){if(s instanceof Array){super();for(let e of s)if(e instanceof Array){let t=e[0],r=e[1];this.append(t,r)}}else super(s?Object.entries(s):void 0)}getMultiple(s){let e=super.get(s);if(e)return R.includes(s.toLowerCase())?e.split(x):[e]}append(s,e){if(R.includes(s.toLowerCase())){let t=this.get(s);this.set(s,t!==void 0?t+x+e:e)}else this.set(s,e)}*[Symbol.iterator](){for(let[s,e]of super[Symbol.iterator]())if(R.includes(s.toLowerCase()))for(let t of e.split(x))yield[s,t];else yield[s,e]}};var I=new TextDecoder("utf-8"),y=class extends D.Inflate{constructor(e,t){super(e);this.ended=!1;this.chunks=[];this.reader=t}onEnd(e){this.err=e,this.err||(this.reader._rawOffset+=this.strm.total_in)}},h=class n{static async readFully(s){let e=[],t=0;for await(let r of s)e.push(r),t+=r.byteLength;return g(e,t)}getReadableStream(){let s=this[Symbol.asyncIterator]();return new ReadableStream({async pull(e){return s.next().then(t=>{t.done||!t.value?e.close():e.enqueue(t.value)})}})}async readFully(){return await n.readFully(this)}async readline(s=0){let e=await this.readlineRaw(s);return e?I.decode(e):""}async*iterLines(s=0){let e=null;for(;e=await this.readline(s);)yield e}};function W(n){return!!(n&&Symbol.iterator in Object(n))}function M(n){return!!(n&&Symbol.asyncIterator in Object(n))}var _=class n extends h{constructor(e,t="gzip",r=!1){super();this.compressed=t,this.opts={raw:t==="deflateRaw"},this.inflator=t?new y(this.opts,this):null;let i;if(M(e))i=e;else if(typeof e=="object"&&"read"in e&&typeof e.read=="function")i=n.fromReadable(e);else if(e instanceof ReadableStream)i=n.fromReadable(e.getReader());else if(W(e))i=n.fromIter(e);else throw new TypeError("Invalid Stream Source");r?this._sourceIter=this.dechunk(i):this._sourceIter=i[Symbol.asyncIterator](),this.lastValue=null,this.errored=!1,this._savedChunk=null,this._rawOffset=0,this._readOffset=0,this.numChunks=0}async _loadNext(){let e=await this._sourceIter.next();return e.done?null:e.value}async*dechunk(e){let t=e instanceof n?e:new n(e,null),r=-1,i=!0;for(;r!=0;){let o=await t.readlineRaw(64),a=new Uint8Array;if(r=o?parseInt(I.decode(o),16):0,!r||r>2**32){if(Number.isNaN(r)||r>2**32){i||(this.errored=!0),yield o;break}}else if(a=await t.readSize(r),a.length!=r){i?yield o:this.errored=!0,yield a;break}let l=await t.readSize(2);if(l[0]!=13||l[1]!=10){i?yield o:this.errored=!0,yield a,yield l;break}else{if(i=!1,!a||r===0)return;yield a}}yield*t}unread(e){e.length&&(this._readOffset-=e.length,this._savedChunk&&console.log("Already have chunk!"),this._savedChunk=e)}async _next(){if(this._savedChunk){let t=this._savedChunk;return this._savedChunk=null,t}if(this.compressed){let t=this._getNextChunk();if(t)return t}let e=await this._loadNext();for(;this.compressed&&e;){this._push(e);let t=this._getNextChunk(e);if(t)return t;e=await this._loadNext()}return e}_push(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _push when this.compressed is null");this.lastValue=e,this.inflator.ended&&(this.inflator=new y(this.opts,this)),this.inflator.push(e),this.inflator.err&&this.inflator.ended&&this.compressed==="deflate"&&!this.opts.raw&&this.numChunks===0&&(this.opts.raw=!0,this.compressed="deflateRaw",this.inflator=new y(this.opts,this),this.inflator.push(e))}_getNextChunk(e){if(!this.inflator)throw new Error("AsyncIterReader cannot call _getNextChunk when this.compressed is null");for(;;){if(this.inflator.chunks.length>0)return this.numChunks++,this.inflator.chunks.shift();if(this.inflator.ended){if(this.inflator.err!==0)return this.compressed=null,e;let t=this.inflator.strm.avail_in;if(t&&this.lastValue){this._push(this.lastValue.slice(-t));continue}}return null}}async*[Symbol.asyncIterator](){let e=null;for(;e=await this._next();)this._readOffset+=e.length,yield e}async readlineRaw(e){let t=[],r=0,i=-1,o=null;for await(let a of this){if(e&&r+a.byteLength>e){o=a,i=e-r-1;let l=a.slice(0,i+1).indexOf(10);l>=0&&(i=l);break}if(i=a.indexOf(10),i>=0){o=a;break}t.push(a),r+=a.byteLength}if(o){let[a,l]=p(o,i+1);t.push(a),r+=a.byteLength,this.unread(l)}else if(!t.length)return null;return g(t,r)}async readFully(){return(await this._readOrSkip())[1]}async readSize(e){return(await this._readOrSkip(e))[1]}async skipSize(e){return(await this._readOrSkip(e,!0))[0]}async _readOrSkip(e=-1,t=!1){let r=[],i=0;for await(let o of this){if(e>=0)if(o.length>e){let[a,l]=p(o,e);t||r.push(a),i+=a.byteLength,this.unread(l);break}else if(o.length===e){t||r.push(o),i+=o.byteLength,e=0;break}else e-=o.length;t||r.push(o),i+=o.byteLength}return t?[i,new Uint8Array]:[i,g(r,i)]}getReadOffset(){return this._readOffset}getRawOffset(){return this.compressed?this._rawOffset:this._readOffset}getRawLength(e){return this.compressed?this.inflator.strm.total_in:this._readOffset-e}static fromReadable(e){return{async*[Symbol.asyncIterator](){let r=null;for(;(r=await e.read())&&!r.done;)yield r.value}}}static fromIter(e){return{async*[Symbol.asyncIterator](){for(let r of e)yield r}}}},U=class extends h{constructor(e,t,r=0){super();this.sourceIter=e,this.length=t,this.limit=t,this.skip=r}setLimitSkip(e,t=0){this.limit=e,this.skip=t}async*[Symbol.asyncIterator](){if(!(this.limit<=0))for await(let e of this.sourceIter){if(this.skip>0)if(e.length>=this.skip){let[,t]=p(e,this.skip);e=t,this.skip=0}else{this.skip-=e.length;continue}if(e.length>this.limit){let[t,r]=p(e,this.limit);e=t,this.sourceIter.unread&&this.sourceIter.unread(r)}if(e.length&&(this.limit-=e.length,yield e),this.limit<=0)break}}async readlineRaw(e){if(this.limit<=0)return null;let t=await this.sourceIter.readlineRaw(e?Math.min(e,this.limit):this.limit);return this.limit-=t?.length||0,t}async skipFully(){let e=this.limit;for(;this.limit>0;)this.limit-=await this.sourceIter.skipSize(this.limit);return e}};var H=new Uint8Array([13,10]),L=new Uint8Array([13,10,13,10]),ie=new TextDecoder("utf-8");var v=new TextEncoder,C=class{},f=class extends C{constructor(){super(...arguments);this.buffers=[]}write(e){this.buffers.push(e)}async*readAll(){for(let e of this.buffers)yield e}clear(){this.buffers=[]}},m=class n extends h{constructor(e,t={},r=new f){super();this.gzip=!1;this.digestAlgo="";this.digestAlgoPrefix="";this.digestBase32=!1;this.preferPako=!1;this._alreadyDigested=!1;this.blockHasher=null;this.payloadHasher=null;this.httpHeadersBuff=null;this.warcHeadersBuff=null;this.gzip=!!t.gzip,this.record=e;let i=t.digest||{};this.digestAlgo=i.algo||"sha-256",this.digestAlgoPrefix=i.prefix||"sha256:",this.digestBase32=!!i.base32,this.preferPako=!!t.preferPako,n.noComputeDigest(e)&&(this.digestAlgo=""),this.externalBuffer=r}static async serialize(e,t,r=new f){return await new n(e,t,r).readFully()}static noComputeDigest(e){return e.warcType==="revisit"||e.warcType==="warcinfo"||e.warcPayloadDigest&&e.warcBlockDigest}async*[Symbol.asyncIterator](){if(!this.gzip){yield*this.generateRecord();return}if("CompressionStream"in globalThis&&!this.preferPako){let e=new globalThis.CompressionStream("gzip");yield*this.streamCompress(e)}else yield*this.pakoCompress()}async readlineRaw(e){return null}async*pakoCompress(){let e=new N.Deflate({gzip:!0}),t=null;for await(let r of this.generateRecord())for(t&&t.length>0&&e.push(t),t=r;e.chunks.length;)yield e.chunks.shift();t&&e.push(t,!0),yield e.result}async*streamCompress(e){let t=this.generateRecord();new ReadableStream({async pull(a){let l=await t.next();l.done?a.close():a.enqueue(l.value)}}).pipeThrough(e);let i=null,o=e.readable.getReader();for(;(i=await o.read())&&!i.done;)yield i.value}async newHasher(){switch(this.digestAlgo){case"sha-256":return T();case"sha-1":return V();case"":return null;default:return T()}}getDigest(e){return this.digestAlgoPrefix+(this.digestBase32?A(e.digest("binary"),"RFC4648"):e.digest("hex"))}async digestRecord(){let e=this.record;if(this._alreadyDigested)return Number(e.warcHeaders.headers.get("Content-Length"));let t=await this.newHasher(),r=await this.newHasher(),i=0;e.httpHeaders&&(this.httpHeadersBuff=v.encode(e.httpHeaders.toString()+`\r +`),i+=this.httpHeadersBuff.length,t?.update(this.httpHeadersBuff));for await(let o of e.reader)t?.update(o),r?.update(o),this.externalBuffer.write(o),i+=o.length;return r&&e.warcHeaders.headers.set("WARC-Payload-Digest",this.getDigest(r)),t&&e.warcHeaders.headers.set("WARC-Block-Digest",this.getDigest(t)),e.warcHeaders.headers.set("Content-Length",i.toString()),this.warcHeadersBuff=v.encode(e.warcHeaders.toString()),this._alreadyDigested=!0,i}async*generateRecord(){if(await this.digestRecord(),this.warcHeadersBuff&&(yield this.warcHeadersBuff),yield H,this.httpHeadersBuff&&(yield this.httpHeadersBuff),this.externalBuffer)for await(let e of this.externalBuffer.readAll())yield e;yield L}};var E=1024*1024*2,z=class n extends m{static async serialize(s,e){return await new n(s,e).readFully()}constructor(s,e={}){super(s,e,new k(e.maxMemSize||E))}},k=class extends f{constructor(e=E){super();this.currSize=0;this.fh=null;this.filename="";this.memSize=e}write(e){this.currSize+e.length<=this.memSize?this.buffers.push(e):(this.fh||(this.filename=Q(),this.fh=B.createWriteStream(this.filename)),this.fh.write(e)),this.currSize+=e.length}async*readAll(){for(let t of this.buffers)yield t;if(!this.fh)return;await G(this.fh),this.fh=null;let e=B.createReadStream(this.filename);for await(let t of e)yield t;await this.clear()}async clear(){this.filename&&(await $(this.filename),this.filename="")}};async function G(n){let s=new Promise(e=>{n.once("finish",()=>e())});return n.end(),s}export{E as DEFAULT_MEM_SIZE,k as TempFileBuffer,z as WARCSerializer,G as streamFinish}; diff --git a/dist/utils-dfea30f1.d.ts b/dist/utils-dfea30f1.d.ts new file mode 100644 index 0000000..bab8419 --- /dev/null +++ b/dist/utils-dfea30f1.d.ts @@ -0,0 +1,49 @@ +type SourceReader = { + read: Function; +}; +type SourceReadable = { + getReader: (...args: any) => { + read: Function; + }; +}; +type Source = SourceReader | SourceReadable | AsyncIterable | Iterable; +type StreamResult = { + filename: string; + reader: AsyncIterable; +}; +type StreamResults = StreamResult[]; +type IndexerOffsetLength = { + offset: number; + recordLength: number; +}; +type Request = { + method: string; + url: string; + headers: Map | Headers; + postData?: Uint8Array | string | undefined | null; + requestBody?: any; +}; +type Response = Request; + +declare function binaryToString(data: Uint8Array | string | undefined | null): string; +declare function rxEscape(string: string): string; +declare function getSurt(url: string): string; +declare function postToGetUrl(request: Request): boolean; +declare function appendRequestQuery(url: string, query: string, method: string): string; +declare function jsonToQueryParams(json: unknown, ignoreInvalid?: boolean): URLSearchParams; +declare function mfdToQueryParams(mfd: string | Uint8Array | null | undefined, contentType: string): URLSearchParams; +declare function jsonToQueryString(json?: string | Record | undefined | null, ignoreInvalid?: boolean): string; +declare function mfdToQueryString(mfd: string | Uint8Array | undefined | null, contentType: string): string; +declare function concatChunks(chunks: Uint8Array[], size: number): Uint8Array; +declare function splitChunk(chunk: Uint8Array, inx: number): [Uint8Array, Uint8Array]; +declare function UTFToLatin1(value: string): string; +declare function latin1ToUTF(str: string): string; +declare function multiValueHeader(name: string, value: string[]): string; +declare class HeadersMultiMap extends Map { + constructor(headersInit?: HeadersInit); + getMultiple(name: string): string[] | undefined; + append(name: string, value: string): void; + [Symbol.iterator](): IterableIterator<[string, string]>; +} + +export { HeadersMultiMap as H, IndexerOffsetLength as I, Request as R, Source as S, UTFToLatin1 as U, StreamResults as a, binaryToString as b, appendRequestQuery as c, jsonToQueryString as d, mfdToQueryString as e, concatChunks as f, getSurt as g, multiValueHeader as h, SourceReader as i, jsonToQueryParams as j, SourceReadable as k, latin1ToUTF as l, mfdToQueryParams as m, StreamResult as n, Response as o, postToGetUrl as p, rxEscape as r, splitChunk as s }; diff --git a/dist/utils.cjs b/dist/utils.cjs new file mode 100644 index 0000000..9c61b3f --- /dev/null +++ b/dist/utils.cjs @@ -0,0 +1 @@ +"use strict";var p=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var Q=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},v=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of R(e))!E.call(t,i)&&i!==r&&p(t,i,{get:()=>e[i],enumerable:!(n=L(e,i))||n.enumerable});return t};var P=t=>v(p({},"__esModule",{value:!0}),t);var k={};Q(k,{appendRequestQuery:()=>y,concatChunks:()=>b,getSurt:()=>A,jsonToQueryParams:()=>h,jsonToQueryString:()=>l,mfdToQueryParams:()=>w,mfdToQueryString:()=>m,postToGetUrl:()=>_,splitChunk:()=>S});module.exports=P(k);function T(t){let e;typeof t=="string"?e=t:t?.length?e=t.reduce((r,n)=>(r+=String.fromCharCode(n),r),""):t?e=t.toString():e="";try{return"__wb_post_data="+btoa(e)}catch{return"__wb_post_data="}}function A(t){try{if(!t.startsWith("https:")&&!t.startsWith("http:"))return t;t=t.replace(/^(https?:\/\/)www\d*\./,"$1");let e=t.toLowerCase(),r=new URL(e),i=r.hostname.split(".").reverse().join(",");if(r.port&&(i+=":"+r.port),i+=")",i+=r.pathname,r.search){let u=r.search.slice(1).split("&");u.sort(),i+="?"+u.join("&")}return i}catch{return t}}function _(t){let{method:e,headers:r,postData:n=""}=t;if(e==="GET")return!1;let u=(s=>{let f=s.get("content-type");if(f)return f;if(!(s instanceof Headers)){for(let[x,C]of s.entries())if(x&&x.toLowerCase()==="content-type")return C}return""})(r),o=u.split(";")[0];function a(s){return s instanceof Uint8Array&&(s=new TextDecoder().decode(s)),s}let c="";switch(o){case"application/x-www-form-urlencoded":c=a(n);break;case"application/json":c=l(a(n));break;case"text/plain":try{c=l(a(n),!1)}catch{c=T(n)}break;case"multipart/form-data":{if(!u)throw new Error("utils cannot call postToGetURL when missing content-type header");c=m(a(n),u);break}default:c=T(n)}return c!=null?(t.url=y(t.url,decodeURI(c),t.method),t.method="GET",t.requestBody=c,!0):!1}function y(t,e,r){if(!r)return t;let n=t.indexOf("?")>0?"&":"?";return`${t}${n}__wb_method=${r}&${e}`}function h(t,e=!0){if(typeof t=="string")try{t=JSON.parse(t)}catch{t={}}let r=new URLSearchParams,n={},i=o=>r.has(o)?(o in n||(n[o]=1),o+"."+ ++n[o]+"_"):o,u=(o,a="")=>{let c="";if(typeof o=="object"&&!(o instanceof Array))try{for(let[s,f]of Object.entries(o))u(f,s)}catch{o===null&&(c="null")}else if(o instanceof Array)for(let s=0;s(r+=String.fromCharCode(n),r),""):t?e=t.toString():e="";try{return"__wb_post_data="+btoa(e)}catch{return"__wb_post_data="}}function b(t){try{if(!t.startsWith("https:")&&!t.startsWith("http:"))return t;t=t.replace(/^(https?:\/\/)www\d*\./,"$1");let e=t.toLowerCase(),r=new URL(e),s=r.hostname.split(".").reverse().join(",");if(r.port&&(s+=":"+r.port),s+=")",s+=r.pathname,r.search){let u=r.search.slice(1).split("&");u.sort(),s+="?"+u.join("&")}return s}catch{return t}}function S(t){let{method:e,headers:r,postData:n=""}=t;if(e==="GET")return!1;let u=(i=>{let f=i.get("content-type");if(f)return f;if(!(i instanceof Headers)){for(let[g,U]of i.entries())if(g&&g.toLowerCase()==="content-type")return U}return""})(r),o=u.split(";")[0];function a(i){return i instanceof Uint8Array&&(i=new TextDecoder().decode(i)),i}let c="";switch(o){case"application/x-www-form-urlencoded":c=a(n);break;case"application/json":c=d(a(n));break;case"text/plain":try{c=d(a(n),!1)}catch{c=y(n)}break;case"multipart/form-data":{if(!u)throw new Error("utils cannot call postToGetURL when missing content-type header");c=T(a(n),u);break}default:c=y(n)}return c!=null?(t.url=w(t.url,decodeURI(c),t.method),t.method="GET",t.requestBody=c,!0):!1}function w(t,e,r){if(!r)return t;let n=t.indexOf("?")>0?"&":"?";return`${t}${n}__wb_method=${r}&${e}`}function m(t,e=!0){if(typeof t=="string")try{t=JSON.parse(t)}catch{t={}}let r=new URLSearchParams,n={},s=o=>r.has(o)?(o in n||(n[o]=1),o+"."+ ++n[o]+"_"):o,u=(o,a="")=>{let c="";if(typeof o=="object"&&!(o instanceof Array))try{for(let[i,f]of Object.entries(o))u(f,i)}catch{o===null&&(c="null")}else if(o instanceof Array)for(let i=0;i extends pako.Inflate { + reader: T; + ended: boolean; + chunks: Uint8Array[]; + constructor(options: pako.InflateOptions, reader: T); + onEnd(status: pako.ReturnCodes): void; +} +declare abstract class BaseAsyncIterReader { + static readFully(iter: AsyncIterable | Iterable): Promise; + abstract [Symbol.asyncIterator](): AsyncIterator; + getReadableStream(): ReadableStream; + readFully(): Promise; + abstract readlineRaw(maxLength?: number): Promise; + readline(maxLength?: number): Promise; + iterLines(maxLength?: number): AsyncGenerator; +} +type AsyncIterReaderOpts = { + raw: boolean; +}; +declare class AsyncIterReader extends BaseAsyncIterReader { + compressed: string | null; + opts: AsyncIterReaderOpts; + inflator: NoConcatInflator | null; + _sourceIter: AsyncIterator; + lastValue: Uint8Array | null; + errored: boolean; + _savedChunk: Uint8Array | null; + _rawOffset: number; + _readOffset: number; + numChunks: number; + constructor(streamOrIter: Source, compressed?: string | null, dechunk?: boolean); + _loadNext(): Promise; + dechunk(source: AsyncIterable): AsyncIterator; + unread(chunk: Uint8Array): void; + _next(): Promise; + _push(value: Uint8Array): void; + _getNextChunk(original?: Uint8Array): Uint8Array | null | undefined; + [Symbol.asyncIterator](): AsyncGenerator; + readlineRaw(maxLength?: number): Promise; + readFully(): Promise; + readSize(sizeLimit: number): Promise; + skipSize(sizeLimit: number): Promise; + _readOrSkip(sizeLimit?: number, skip?: boolean): Promise; + getReadOffset(): number; + getRawOffset(): number; + getRawLength(prevOffset: number): number; + static fromReadable(source: Readable): { + [Symbol.asyncIterator](): AsyncGenerator; + }; + static fromIter(source: Iterable): { + [Symbol.asyncIterator](): AsyncGenerator; + }; +} +declare class LimitReader extends BaseAsyncIterReader { + sourceIter: AsyncIterReader; + length: number; + limit: number; + skip: number; + constructor(streamIter: AsyncIterReader, limit: number, skip?: number); + setLimitSkip(limit: number, skip?: number): void; + [Symbol.asyncIterator](): AsyncGenerator; + readlineRaw(maxLength?: number): Promise; + skipFully(): Promise; +} + +declare const CRLF: Uint8Array; +declare const CRLFCRLF: Uint8Array; +declare class StatusAndHeaders { + statusline: string; + headers: HeadersMultiMap | Headers; + readonly reencodeHeaders?: Set; + constructor({ statusline, headers, reencodeHeaders, }: { + statusline: string; + headers: HeadersMultiMap | Headers; + reencodeHeaders?: Set; + }); + toString(): string; + iterSerialize(encoder: TextEncoder): AsyncGenerator; + _protocol: string | undefined; + _statusCode: number | string | undefined; + _statusText: string | undefined; + _parseResponseStatusLine(): void; + get statusCode(): string | number | undefined; + get protocol(): string | undefined; + get statusText(): string | undefined; + _method: string | undefined; + _requestPath: string | undefined; + _parseRequestStatusLine(): void; + get method(): string | undefined; + get requestPath(): string | undefined; +} +declare class StatusAndHeadersParser { + reencodeHeaders: Set; + parse(reader: AsyncIterReader, { headersClass, firstLine, }?: { + firstLine?: string; + headersClass: typeof HeadersMultiMap | typeof Headers; + }): Promise; + setHeader(name: string, value: string, headers: Headers | HeadersMultiMap, reencoded?: boolean): void; +} +declare function indexOfDoubleCRLF(buffer: Uint8Array, iter: AsyncIterator): Promise; +declare function readToDoubleCRLF(reader: AsyncIterReader): Promise; + +declare const WARC_1_1 = "WARC/1.1"; +declare const WARC_1_0 = "WARC/1.0"; +type WARCType = "warcinfo" | "response" | "resource" | "request" | "metadata" | "revisit" | "conversion" | "continuation"; +type WARCRecordOpts = { + url?: string; + date?: string; + type?: WARCType; + warcHeaders?: Record | [string, string][]; + filename?: string; + httpHeaders?: HeadersInit; + statusline?: string; + warcVersion?: typeof WARC_1_0 | typeof WARC_1_1; + keepHeadersCase?: boolean; + refersToUrl?: string; + refersToDate?: string; +}; +declare class WARCRecord extends BaseAsyncIterReader { + static create({ url, date, type, warcHeaders, filename, httpHeaders, statusline, warcVersion, keepHeadersCase, refersToUrl, refersToDate, }?: WARCRecordOpts, reader?: AsyncIterable | Iterable): WARCRecord; + static createWARCInfo(opts: WARCRecordOpts | undefined, info: Record): WARCRecord; + warcHeaders: StatusAndHeaders; + _reader: AsyncIterable | Iterable; + _contentReader: BaseAsyncIterReader | null; + payload: Uint8Array | null; + httpHeaders: StatusAndHeaders | null; + consumed: "content" | "raw" | "skipped" | ""; + _offset: number | undefined; + _length: number; + _urlkey: string; + constructor({ warcHeaders, reader, }: { + warcHeaders: StatusAndHeaders; + reader: AsyncIterable | Iterable; + }); + getResponseInfo(): { + headers: Headers | HeadersMultiMap; + status: string | number | undefined; + statusText: string | undefined; + } | null; + fixUp(): void; + readFully(isContent?: boolean): Promise; + get reader(): AsyncIterable | Iterable; + get contentReader(): AsyncIterable | Iterable; + _createDecodingReader(source: Source): AsyncIterReader; + readlineRaw(maxLength?: number): Promise; + contentText(): Promise; + [Symbol.asyncIterator](): AsyncGenerator; + skipFully(): Promise; + warcHeader(name: string): string | null | undefined; + get warcType(): string | null | undefined; + get warcTargetURI(): string | null | undefined; + get warcDate(): string | null | undefined; + get warcRefersToTargetURI(): string | null | undefined; + get warcRefersToDate(): string | null | undefined; + get warcPayloadDigest(): string | null | undefined; + get warcBlockDigest(): string | null | undefined; + get warcContentType(): string | null | undefined; + get warcContentLength(): number; + get warcConcurrentTo(): string[] | undefined; +} + +type WARCSerializerOpts = { + gzip?: boolean; + digest?: { + algo?: AlgorithmIdentifier; + prefix?: string; + base32?: boolean; + }; + preferPako?: boolean; +}; +declare abstract class BaseSerializerBuffer { + abstract write(chunk: Uint8Array): void; + abstract readAll(): AsyncIterable; + abstract clear(): void; +} +declare class SerializerInMemBuffer extends BaseSerializerBuffer { + buffers: Uint8Array[]; + write(chunk: Uint8Array): void; + readAll(): AsyncIterable; + clear(): void; +} +declare class WARCSerializer extends BaseAsyncIterReader { + gzip: boolean; + digestAlgo: AlgorithmIdentifier; + digestAlgoPrefix: string; + digestBase32: boolean; + preferPako: boolean; + record: WARCRecord; + externalBuffer: BaseSerializerBuffer | undefined; + _alreadyDigested: boolean; + blockHasher: IHasher | null; + payloadHasher: IHasher | null; + httpHeadersBuff: Uint8Array | null; + warcHeadersBuff: Uint8Array | null; + static serialize(record: WARCRecord, opts?: WARCSerializerOpts, externalBuffer?: BaseSerializerBuffer): Promise; + constructor(record: WARCRecord, opts?: WARCSerializerOpts, externalBuffer?: BaseSerializerBuffer); + static noComputeDigest(record: WARCRecord): string | true | null | undefined; + [Symbol.asyncIterator](): AsyncGenerator; + readlineRaw(maxLength?: number): Promise; + pakoCompress(): AsyncGenerator; + streamCompress(cs: CompressionStream): AsyncGenerator; + newHasher(): Promise; + getDigest(hasher: IHasher): string; + digestRecord(): Promise; + generateRecord(): AsyncGenerator; +} + +export { AsyncIterReader as A, BaseAsyncIterReader as B, CRLF as C, LimitReader as L, NoConcatInflator as N, SerializerInMemBuffer as S, WARCSerializerOpts as W, WARCSerializer as a, WARCRecord as b, StatusAndHeaders as c, StatusAndHeadersParser as d, AsyncIterReaderOpts as e, CRLFCRLF as f, BaseSerializerBuffer as g, WARC_1_1 as h, indexOfDoubleCRLF as i, WARC_1_0 as j, WARCType as k, WARCRecordOpts as l, readToDoubleCRLF as r };