diff --git a/_config.yml b/_config.yml index 5bee4f8..e50a8ea 100644 --- a/_config.yml +++ b/_config.yml @@ -34,7 +34,8 @@ exclude: - yarn-error.log - yarn.lock - local-examples/ - - build/ + - build/*.js + - build/*.plist - src/ - dist/ - node_modules/ diff --git a/index.html b/index.html index a60994e..505f1d5 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,7 @@
+ diff --git a/sw.js b/sw.js index 433456c..59c79a5 100644 --- a/sw.js +++ b/sw.js @@ -1,13 +1,13 @@ -!function(t,e){for(var r in e)t[r]=e[r]}(self,function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=112)}([,,,function(t,e,r){"use strict";function i(t,e){for(const r of e)if(t.startsWith(r))return!0;return!1}function n(t,e){for(const r of e)if(t.indexOf(r)>=0)return!0;return!1}function s(t){return t.replace(/[-:T]/g,"").slice(0,14)}function o(t){if(!t)return new Date;t.length<14&&(t+="00000101000000".substr(t.length));const e=t.substring(0,4)+"-"+t.substring(4,6)+"-"+t.substring(6,8)+"T"+t.substring(8,10)+":"+t.substring(10,12)+":"+t.substring(12,14)+"-00:00";return new Date(e)}function a(t){if(!t)return"";try{return""+parseInt(t.getTime()/1e3)}catch(t){return""}}async function u(t,e){const r="string"==typeof t?(new TextEncoder).encode(t):t,i=await crypto.subtle.digest(e,r);return e+":"+Array.from(new Uint8Array(i)).map(t=>t.toString(16).padStart(2,"0")).join("")}function h(t){try{return new Headers(t)}catch(e){for(let e of Object.keys(t)){const r=t[e],i=r.replace(/[\r\n]+/g,", ");r!=i&&(t[e]=i)}return new Headers(t)}}r.d(e,"k",(function(){return i})),r.d(e,"c",(function(){return n})),r.d(e,"f",(function(){return s})),r.d(e,"l",(function(){return o})),r.d(e,"e",(function(){return a})),r.d(e,"d",(function(){return u})),r.d(e,"h",(function(){return l})),r.d(e,"i",(function(){return h})),r.d(e,"j",(function(){return d})),r.d(e,"g",(function(){return p})),r.d(e,"a",(function(){return f})),r.d(e,"b",(function(){return m}));const c=[101,204,205,304];function l(t){return c.includes(t)}function p(t){return"XMLHttpRequest"===t.headers.get("X-Pywb-Requested-With")}function d(t,e){let r,i;return e||(e="Sorry, this url was not found in the archive."),"script"===t.destination||t.headers.get("x-pywb-requested-with")?(r=JSON.stringify(e),i="application/json"):(r=e,i="text/html"),new Response(r,{status:404,statusText:"Not Found",headers:{"Content-Type":i}})}class f extends class{constructor(t,e){this.url=t,this.status=e}}{}class m{}},,,,function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return a})),r.d(e,"d",(function(){return f})),r.d(e,"c",(function(){return y}));var i=r(100);const n=new TextDecoder("utf-8");class s extends i.Inflate{constructor(t,e){super(t),this.reader=e}onEnd(t){this.err=t,this.err||(this.reader._rawOffset+=this.strm.total_in)}}class o{static concatChunks(t,e){if(1===t.length)return t[0];const r=new Uint8Array(e);let i=0;for(const e of t)r.set(e,i),i+=e.byteLength;return r}static splitChunk(t,e){return[t.slice(0,e),t.slice(e)]}getReadableStream(){const t=this[Symbol.asyncIterator]();return new ReadableStream({pull:e=>t.next().then(t=>{t.done||!t.value?e.close():e.enqueue(t.value)})})}async readFully(){const t=[];let e=0;for await(const r of this)t.push(r),e+=r.byteLength;return o.concatChunks(t,e)}async readline(t=0){const e=await this.readlineRaw(t);return e?n.decode(e):""}async*iterLines(t=0){let e=null;for(;e=await this.readline(t);)yield e}}class a extends o{constructor(t,e="gzip",r=!1){if(super(),this.compressed=e,this.opts={raw:"deflateRaw"===e},this.inflator=e?new s(this.opts,this):null,"function"!=typeof t[Symbol.asyncIterator])if("function"==typeof t.getReader)t=a.fromReadable(t.getReader());else if("function"==typeof t.read)t=a.fromReadable(t);else{if("function"!=typeof t[Symbol.iterator])throw new TypeError("Invalid Stream Source");t=a.fromIter(t)}this._sourceIter=t[Symbol.asyncIterator](),r&&(this._sourceIter=this.dechunk(this._sourceIter)),this.lastValue=null,this.errored=!1,this._savedChunk=null,this._rawOffset=0,this._readOffset=0,this.numChunks=0}async _loadNext(){const t=await this._sourceIter.next();return t.done?null:t.value}async*dechunk(t){const e=new a(t,null);let r=-1,i=!0;for(;0!=r;){const t=await e.readlineRaw(64);let s=null;if(r=parseInt(n.decode(t),16),!r||r>2**32){if(Number.isNaN(r)||r>2**32){i||(this.errored=!0),yield t;break}}else if(s=await e.readSize(r),s.length!=r){i?yield t:this.errored=!0,yield s;break}const o=await e.readSize(2);if(13!=o[0]||10!=o[1]){i?yield t:this.errored=!0,yield s,yield o;break}yield s,i=!1}yield*e}_unread(t){t.length&&(this._readOffset-=t.length,this._savedChunk&&console.log("Already have chunk!"),this._savedChunk=t)}async _next(){if(this._savedChunk){const t=this._savedChunk;return this._savedChunk=null,t}if(this.compressed){const t=this._getNextChunk();if(t)return t}let t=await this._loadNext();for(;this.compressed&&t;){this._push(t);const e=this._getNextChunk(t);if(e)return e;t=await this._loadNext()}return t}_push(t){this.lastValue=t,this.inflator.ended&&(this.inflator=new s(this.opts,this)),this.inflator.push(t),this.inflator.err&&this.inflator.ended&&"deflate"===this.compressed&&!1===this.opts.raw&&0===this.numChunks&&(this.opts.raw=!0,this.compressed="deflateRaw",this.inflator=new s(this.opts,this),this.inflator.push(t))}_getNextChunk(t){for(;;){if(this.inflator.chunks.length>0)return this.numChunks++,this.inflator.chunks.shift();if(this.inflator.ended){if(0!==this.inflator.err)return this.compressed=null,t;const e=this.inflator.strm.avail_in;if(e&&this.lastValue){this._push(this.lastValue.slice(-e));continue}}return null}}async*[Symbol.asyncIterator](){let t=null;for(;t=await this._next();)this._readOffset+=t.length,yield t}async readlineRaw(t){const e=[];let r,i=0,n=null;for await(const s of this){if(t&&i+s.byteLength>t){n=s,r=t-i-1;const e=s.slice(0,r+1).indexOf(10);e>=0&&(r=e);break}if(r=s.indexOf(10),r>=0){n=s;break}e.push(s),i+=s.byteLength}if(n){const[t,s]=a.splitChunk(n,r+1);e.push(t),i+=t.byteLength,this._unread(s)}else if(!e.length)return null;return a.concatChunks(e,i)}readFully(){return this.readSize()}async readSize(t=-1,e=!1){const r=[];let i=0;for await(const n of this){if(t>=0){if(n.length>t){const[s,o]=a.splitChunk(n,t);e||r.push(s),i+=s.byteLength,this._unread(o);break}if(n.length===t){e||r.push(n),i+=n.byteLength,t=0;break}t-=n.length}e||r.push(n),i+=n.byteLength}return e?i:a.concatChunks(r,i)}getReadOffset(){return this._readOffset}getRawOffset(){return this.compressed?this._rawOffset:this._readOffset}getRawLength(t){return this.compressed?this.inflator.strm.total_in:this._readOffset-t}static fromReadable(t){return{async*[Symbol.asyncIterator](){let e=null;for(;(e=await t.read())&&!e.done;)yield e.value}}}static fromIter(t){return{async*[Symbol.asyncIterator](){for(const e of t)yield e}}}}class u extends o{constructor(t,e,r=0){super(),this.sourceIter=t,this.length=e,this.limit=e,this.skip=r}setLimitSkip(t,e=0){this.limit=t,this.skip=e}async*[Symbol.asyncIterator](){if(!(this.limit<=0))for await(let t of this.sourceIter){if(this.skip>0){if(!(t.length>=this.skip)){this.skip-=t.length;continue}{const[e,r]=u.splitChunk(t,this.skip);t=r,this.skip=0}}if(t.length>this.limit){const[e,r]=u.splitChunk(t,this.limit);t=e,this.sourceIter._unread(r)}if(t.length&&(this.limit-=t.length,yield t),this.limit<=0)break}}async readlineRaw(t){if(this.limit<=0)return null;const e=await this.sourceIter.readlineRaw(t?Math.min(t,this.limit):this.limit);return this.limit-=e.length,e}async skipFully(){const t=this.limit;for(;this.limit>0;)this.limit-=await this.sourceIter.readSize(this.limit,!0);return t}}class h{constructor({statusline:t,headers:e}){this.statusline=t,this.headers=e}toString(){const t=[this.statusline];for(const[e,r]of this.headers)t.push(`${e}: ${r}`);return t.join("\r\n")+"\r\n"}_parseResponseStatusLine(){const t=l(this.statusline," ",2);this._protocol=t[0],this._statusCode=t.length>1?Number(t[1]):"",this._statusText=t.length>2?t[2]:""}get statusCode(){return void 0===this._statusCode&&this._parseResponseStatusLine(),this._statusCode}get protocol(){return void 0===this._protocol&&this._parseResponseStatusLine(),this._protocol}get statusText(){return void 0===this._statusText&&this._parseResponseStatusLine(),this._statusText}_parseRequestStatusLine(){const t=this.statusline.split(" ",2);this._method=t[0],this._requestPath=t.length>1?t[1]:""}get method(){return void 0===this._method&&this._parseRequestStatusLine(),this._method}get requestPath(){return void 0===this._requestPath&&this._parseRequestStatusLine(),this._requestPath}}class c{startsWithSpace(t){const e=t.charAt(0);return" "===e||"\t"===e}async parse(t,{headersClass:e=Map}={}){const r=await t.readline();if(!r)return null;let i=r.trimEnd();const n=new e;if(!i)return null;let s=(await t.readline()).trimEnd();for(;s;){let[e,r]=l(s,":",1);r&&(e=e.trimStart(),r=r.trim());let i=(await t.readline()).trimEnd();for(;this.startsWithSpace(i);)r&&(r+=i),i=(await t.readline()).trimEnd();if(r)try{n.set(e,r)}catch(t){}s=i}return new h({statusline:i,headers:n,totalRead:this.totalRead})}}function l(t,e,r){const i=t.split(e),n=i.slice(0,r);return i.slice(r).length>0&&n.push(i.slice(r).join(e)),n}const p=new TextDecoder("utf-8");class d extends o{constructor({warcHeaders:t,reader:e}){super(),this.warcHeaders=t,this.headersLen=0,this._reader=new u(e,this.warcContentLength),this._contentReader=null,this.payload=null,this.httpHeaders=null,this.consumed=!1,this.fixUp()}_addHttpHeaders(t,e){this.httpHeaders=t,this.headersLen=e,this._reader.setLimitSkip(this.warcContentLength-this.headersLen)}getResponseInfo(){const t=this.httpHeaders;return t?{headers:t.headers,status:t.statusCode,statusText:t.statusText}:null}fixUp(){const t=this.warcHeaders.headers.get("WARC-Target-URI");t&&t.startsWith("<")&&t.endsWith(">")&&this.warcHeaders.headers.set("WARC-Target-URI",t.slice(1,-1))}async readFully(t=!1){if(this.httpHeaders){if(this._contentReader&&!t)throw new TypeError("WARC Record decoding already started, but requesting raw payload");if(t&&"raw"===this.consumed&&this.payload)return await this._createDecodingReader([this.payload]).readFully()}return this.payload||(t?(this.payload=await super.readFully(),this.consumed="content"):(this.payload=await this._reader.readFully(),this.consumed="raw")),this.payload}get reader(){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(t){let e=this.httpHeaders.headers.get("content-encoding"),r=this.httpHeaders.headers.get("transfer-encoding");const i="chunked"===r;return e||i||(e=r),new a(t,e,i)}async readlineRaw(t){if(this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");return this.contentReader.readlineRaw(t)}async contentText(){const t=await this.readFully(!0);return p.decode(t)}async*[Symbol.asyncIterator](){for await(const t of this.contentReader)if(yield t,this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");this.consumed="content"}async skipFully(){if(this.consumed)return;const t=await this._reader.skipFully();return this.consumed="skipped",t}warcHeader(t){return this.warcHeaders.headers.get(t)}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 warcContentType(){return this.warcHeaders.headers.get("Content-Type")}get warcContentLength(){return Number(this.warcHeaders.headers.get("Content-Length"))}}class f{static parse(t,e){return new f(t,e).parse()}static iterRecords(t,e){return new f(t,e)}constructor(t,{keepHeadersCase:e=!1,parseHttp:r=!0}={}){this._offset=0,this._warcHeadersLength=0,this._headersClass=e?Map:Headers,this._parseHttp=r,this._atRecordBoundary=!0,t instanceof a||(t=new a(t)),this._reader=t,this._record=null}async readToNextRecord(){!this._atRecordBoundary&&this._reader&&this._record&&(await this._record.skipFully(),await this._reader.readSize(4,!0),this._atRecordBoundary=!0)}async parse(){await this.readToNextRecord(),this._offset=this._reader.getRawOffset();const t=new c,e=await t.parse(this._reader,{headersClass:this._headersClass});if(!e)return null;this._warcHeadersLength=this._reader.getReadOffset();const r=new d({warcHeaders:e,reader:this._reader});if(this._atRecordBoundary=!1,this._record=r,this._parseHttp)switch(r.warcType){case"response":case"request":await this._addHttpHeaders(r,t,this._reader);break;case"revisit":r.warcContentLength>0&&await this._addHttpHeaders(r,t,this._reader)}return r}get offset(){return this._offset}get recordLength(){return this._reader.getRawLength(this._offset)}async*[Symbol.asyncIterator](){let t=null;for(;t=await this.parse(this._reader);)yield t;this._record=null}async _addHttpHeaders(t,e,r){const i=await e.parse(r,{headersClass:this._headersClass});t._addHttpHeaders(i,r.getReadOffset()-this._warcHeadersLength)}}const m="offset,warc-type,warc-target-uri".split(",");const w="urlkey,timestamp,url,mime,status,digest,length,offset,filename".split(","),g="urlkey,timestamp,url,mime,status,digest,redirect,meta,length,offset,filename".split(",");class y extends class extends class{constructor(t,e){this.opts=t,this.out=e}write(t){this.out.write(JSON.stringify(t)+"\n")}async run(t){for await(const e of this.iterIndex(t))this.write(e)}async*iterIndex(t){const e={strictHeaders:!0,parseHttp:this.parseHttp};for(const{filename:r,reader:i}of t){if(!r||!i)continue;const t=new f(i,e);for await(const e of t){await e.skipFully();const i=this.indexRecord(e,t,r);i&&(yield i)}}}indexRecord(t,e,r){if(this.filterRecord&&!this.filterRecord(t))return null;const i={},n={offset:e.offset,length:e.recordLength,filename:r};for(const e of this.fields)null!=n[e]?i[e]=n[e]:this.setField(e,t,i);return i}setField(t,e,r){const i=this.getField(t,e);null!=i&&(r[t]=i)}getField(t,e){return"http:status"===t?!e.httpHeaders||"response"!==e.warcType&&"revisit"!==e.warcType?null:e.httpHeaders.statusCode:t.startsWith("http:")?e.httpHeaders?e.httpHeaders.headers.get(t.slice(5)):null:e.warcHeaders.headers.get(t)}}{constructor(t={},e=null){if(super(t,e),t.fields){this.fields=t.fields.split(","),this.parseHttp=!1;for(const t of this.fields)if(t.startsWith("http:")){this.parseHttp=!0;break}}else this.fields=m,this.parseHttp=!1}}{constructor(t={},e=null){switch(super(t,e),this.includeAll=t.all,this.fields=w,this.parseHttp=!0,t.format){case"cdxj":this.write=this.writeCDXJ;break;case"cdx":this.write=this.writeCDX11}}filterRecord(t){if(this.includeAll)return!0;const e=t.warcType;return"request"!==e&&"warcinfo"!==e}writeCDXJ(t){const{urlkey:e,timestamp:r}=t;delete t.urlkey,delete t.timestamp,this.out.write(`${e} ${r} ${JSON.stringify(t)}\n`)}writeCDX11(t){const e=[];for(const r of g)e.push(null!=t[r]?t[r]:"-");this.out.write(e.join(" ")+"\n")}getField(t,e){let r=null;switch(t){case"urlkey":return this.getSurt(e.warcTargetURI);case"timestamp":return r=e.warcDate,r.replace(/[-:T]/g,"").slice(0,14);case"url":return e.warcTargetURI;case"mime":switch(e.warcType){case"revisit":return"warc/revisit";case"response":case"request":t="http:content-type";break;default:t="content-type"}return r=super.getField(t,e),r?r.split(";",1)[0].trim():null;case"status":return super.getField("http:status",e);case"digest":return r=e.warcPayloadDigest,r?r.split(":",2)[1]:null}}getSurt(t){try{const e=new URL(t);let r=e.hostname.split(".").reverse().join(",");return e.port&&(r+=":"+e.port),r+=")",r+=e.pathname,r.toLowerCase()}catch(e){return t}}}},,,,function(t,e,r){"use strict";var i=r(32),n=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];t.exports=function(t,e){var r,o;if(e=e||{},Object.keys(e).forEach((function(e){if(-1===n.indexOf(e))throw new i('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(r=e.styleAliases||null,o={},null!==r&&Object.keys(r).forEach((function(t){r[t].forEach((function(e){o[String(e)]=t}))})),o),-1===s.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},,,function(t,e,r){"use strict";(function(t){ +!function(t,e){for(var r in e)t[r]=e[r]}(self,function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=113)}([,,,function(t,e,r){"use strict";function i(t,e){for(const r of e)if(t.startsWith(r))return!0;return!1}function n(t,e){for(const r of e)if(t.indexOf(r)>=0)return!0;return!1}function s(t){return t.replace(/[-:T]/g,"").slice(0,14)}function o(t){if(!t)return new Date;t.length<14&&(t+="00000101000000".substr(t.length));const e=t.substring(0,4)+"-"+t.substring(4,6)+"-"+t.substring(6,8)+"T"+t.substring(8,10)+":"+t.substring(10,12)+":"+t.substring(12,14)+"-00:00";return new Date(e)}function a(t){if(!t)return"";try{return""+parseInt(t.getTime()/1e3)}catch(t){return""}}async function u(t,e){const r="string"==typeof t?(new TextEncoder).encode(t):t,i=await crypto.subtle.digest(e,r);return e+":"+Array.from(new Uint8Array(i)).map(t=>t.toString(16).padStart(2,"0")).join("")}function h(t){try{return new Headers(t)}catch(e){for(let e of Object.keys(t)){const r=t[e],i=r.replace(/[\r\n]+/g,", ");r!=i&&(t[e]=i)}return new Headers(t)}}r.d(e,"k",(function(){return i})),r.d(e,"c",(function(){return n})),r.d(e,"f",(function(){return s})),r.d(e,"l",(function(){return o})),r.d(e,"e",(function(){return a})),r.d(e,"d",(function(){return u})),r.d(e,"h",(function(){return l})),r.d(e,"i",(function(){return h})),r.d(e,"j",(function(){return d})),r.d(e,"g",(function(){return p})),r.d(e,"a",(function(){return f})),r.d(e,"b",(function(){return m}));const c=[101,204,205,304];function l(t){return c.includes(t)}function p(t){return"XMLHttpRequest"===t.headers.get("X-Pywb-Requested-With")}function d(t,e){let r,i;return e||(e="Sorry, this url was not found in the archive."),"script"===t.destination||t.headers.get("x-pywb-requested-with")?(r=JSON.stringify(e),i="application/json"):(r=e,i="text/html"),new Response(r,{status:404,statusText:"Not Found",headers:{"Content-Type":i}})}class f extends class{constructor(t,e){this.url=t,this.status=e}}{}class m{}},,,,function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return a})),r.d(e,"d",(function(){return f})),r.d(e,"c",(function(){return y}));var i=r(101);const n=new TextDecoder("utf-8");class s extends i.Inflate{constructor(t,e){super(t),this.reader=e}onEnd(t){this.err=t,this.err||(this.reader._rawOffset+=this.strm.total_in)}}class o{static concatChunks(t,e){if(1===t.length)return t[0];const r=new Uint8Array(e);let i=0;for(const e of t)r.set(e,i),i+=e.byteLength;return r}static splitChunk(t,e){return[t.slice(0,e),t.slice(e)]}getReadableStream(){const t=this[Symbol.asyncIterator]();return new ReadableStream({pull:e=>t.next().then(t=>{t.done||!t.value?e.close():e.enqueue(t.value)})})}async readFully(){const t=[];let e=0;for await(const r of this)t.push(r),e+=r.byteLength;return o.concatChunks(t,e)}async readline(t=0){const e=await this.readlineRaw(t);return e?n.decode(e):""}async*iterLines(t=0){let e=null;for(;e=await this.readline(t);)yield e}}class a extends o{constructor(t,e="gzip",r=!1){if(super(),this.compressed=e,this.opts={raw:"deflateRaw"===e},this.inflator=e?new s(this.opts,this):null,"function"!=typeof t[Symbol.asyncIterator])if("function"==typeof t.getReader)t=a.fromReadable(t.getReader());else if("function"==typeof t.read)t=a.fromReadable(t);else{if("function"!=typeof t[Symbol.iterator])throw new TypeError("Invalid Stream Source");t=a.fromIter(t)}this._sourceIter=t[Symbol.asyncIterator](),r&&(this._sourceIter=this.dechunk(this._sourceIter)),this.lastValue=null,this.errored=!1,this._savedChunk=null,this._rawOffset=0,this._readOffset=0,this.numChunks=0}async _loadNext(){const t=await this._sourceIter.next();return t.done?null:t.value}async*dechunk(t){const e=new a(t,null);let r=-1,i=!0;for(;0!=r;){const t=await e.readlineRaw(64);let s=null;if(r=parseInt(n.decode(t),16),!r||r>2**32){if(Number.isNaN(r)||r>2**32){i||(this.errored=!0),yield t;break}}else if(s=await e.readSize(r),s.length!=r){i?yield t:this.errored=!0,yield s;break}const o=await e.readSize(2);if(13!=o[0]||10!=o[1]){i?yield t:this.errored=!0,yield s,yield o;break}yield s,i=!1}yield*e}_unread(t){t.length&&(this._readOffset-=t.length,this._savedChunk&&console.log("Already have chunk!"),this._savedChunk=t)}async _next(){if(this._savedChunk){const t=this._savedChunk;return this._savedChunk=null,t}if(this.compressed){const t=this._getNextChunk();if(t)return t}let t=await this._loadNext();for(;this.compressed&&t;){this._push(t);const e=this._getNextChunk(t);if(e)return e;t=await this._loadNext()}return t}_push(t){this.lastValue=t,this.inflator.ended&&(this.inflator=new s(this.opts,this)),this.inflator.push(t),this.inflator.err&&this.inflator.ended&&"deflate"===this.compressed&&!1===this.opts.raw&&0===this.numChunks&&(this.opts.raw=!0,this.compressed="deflateRaw",this.inflator=new s(this.opts,this),this.inflator.push(t))}_getNextChunk(t){for(;;){if(this.inflator.chunks.length>0)return this.numChunks++,this.inflator.chunks.shift();if(this.inflator.ended){if(0!==this.inflator.err)return this.compressed=null,t;const e=this.inflator.strm.avail_in;if(e&&this.lastValue){this._push(this.lastValue.slice(-e));continue}}return null}}async*[Symbol.asyncIterator](){let t=null;for(;t=await this._next();)this._readOffset+=t.length,yield t}async readlineRaw(t){const e=[];let r,i=0,n=null;for await(const s of this){if(t&&i+s.byteLength>t){n=s,r=t-i-1;const e=s.slice(0,r+1).indexOf(10);e>=0&&(r=e);break}if(r=s.indexOf(10),r>=0){n=s;break}e.push(s),i+=s.byteLength}if(n){const[t,s]=a.splitChunk(n,r+1);e.push(t),i+=t.byteLength,this._unread(s)}else if(!e.length)return null;return a.concatChunks(e,i)}readFully(){return this.readSize()}async readSize(t=-1,e=!1){const r=[];let i=0;for await(const n of this){if(t>=0){if(n.length>t){const[s,o]=a.splitChunk(n,t);e||r.push(s),i+=s.byteLength,this._unread(o);break}if(n.length===t){e||r.push(n),i+=n.byteLength,t=0;break}t-=n.length}e||r.push(n),i+=n.byteLength}return e?i:a.concatChunks(r,i)}getReadOffset(){return this._readOffset}getRawOffset(){return this.compressed?this._rawOffset:this._readOffset}getRawLength(t){return this.compressed?this.inflator.strm.total_in:this._readOffset-t}static fromReadable(t){return{async*[Symbol.asyncIterator](){let e=null;for(;(e=await t.read())&&!e.done;)yield e.value}}}static fromIter(t){return{async*[Symbol.asyncIterator](){for(const e of t)yield e}}}}class u extends o{constructor(t,e,r=0){super(),this.sourceIter=t,this.length=e,this.limit=e,this.skip=r}setLimitSkip(t,e=0){this.limit=t,this.skip=e}async*[Symbol.asyncIterator](){if(!(this.limit<=0))for await(let t of this.sourceIter){if(this.skip>0){if(!(t.length>=this.skip)){this.skip-=t.length;continue}{const[e,r]=u.splitChunk(t,this.skip);t=r,this.skip=0}}if(t.length>this.limit){const[e,r]=u.splitChunk(t,this.limit);t=e,this.sourceIter._unread(r)}if(t.length&&(this.limit-=t.length,yield t),this.limit<=0)break}}async readlineRaw(t){if(this.limit<=0)return null;const e=await this.sourceIter.readlineRaw(t?Math.min(t,this.limit):this.limit);return this.limit-=e.length,e}async skipFully(){const t=this.limit;for(;this.limit>0;)this.limit-=await this.sourceIter.readSize(this.limit,!0);return t}}class h{constructor({statusline:t,headers:e}){this.statusline=t,this.headers=e}toString(){const t=[this.statusline];for(const[e,r]of this.headers)t.push(`${e}: ${r}`);return t.join("\r\n")+"\r\n"}_parseResponseStatusLine(){const t=l(this.statusline," ",2);this._protocol=t[0],this._statusCode=t.length>1?Number(t[1]):"",this._statusText=t.length>2?t[2]:""}get statusCode(){return void 0===this._statusCode&&this._parseResponseStatusLine(),this._statusCode}get protocol(){return void 0===this._protocol&&this._parseResponseStatusLine(),this._protocol}get statusText(){return void 0===this._statusText&&this._parseResponseStatusLine(),this._statusText}_parseRequestStatusLine(){const t=this.statusline.split(" ",2);this._method=t[0],this._requestPath=t.length>1?t[1]:""}get method(){return void 0===this._method&&this._parseRequestStatusLine(),this._method}get requestPath(){return void 0===this._requestPath&&this._parseRequestStatusLine(),this._requestPath}}class c{startsWithSpace(t){const e=t.charAt(0);return" "===e||"\t"===e}async parse(t,{headersClass:e=Map}={}){const r=await t.readline();if(!r)return null;let i=r.trimEnd();const n=new e;if(!i)return null;let s=(await t.readline()).trimEnd();for(;s;){let[e,r]=l(s,":",1);r&&(e=e.trimStart(),r=r.trim());let i=(await t.readline()).trimEnd();for(;this.startsWithSpace(i);)r&&(r+=i),i=(await t.readline()).trimEnd();if(r)try{n.set(e,r)}catch(t){}s=i}return new h({statusline:i,headers:n,totalRead:this.totalRead})}}function l(t,e,r){const i=t.split(e),n=i.slice(0,r);return i.slice(r).length>0&&n.push(i.slice(r).join(e)),n}const p=new TextDecoder("utf-8");class d extends o{constructor({warcHeaders:t,reader:e}){super(),this.warcHeaders=t,this.headersLen=0,this._reader=new u(e,this.warcContentLength),this._contentReader=null,this.payload=null,this.httpHeaders=null,this.consumed=!1,this.fixUp()}_addHttpHeaders(t,e){this.httpHeaders=t,this.headersLen=e,this._reader.setLimitSkip(this.warcContentLength-this.headersLen)}getResponseInfo(){const t=this.httpHeaders;return t?{headers:t.headers,status:t.statusCode,statusText:t.statusText}:null}fixUp(){const t=this.warcHeaders.headers.get("WARC-Target-URI");t&&t.startsWith("<")&&t.endsWith(">")&&this.warcHeaders.headers.set("WARC-Target-URI",t.slice(1,-1))}async readFully(t=!1){if(this.httpHeaders){if(this._contentReader&&!t)throw new TypeError("WARC Record decoding already started, but requesting raw payload");if(t&&"raw"===this.consumed&&this.payload)return await this._createDecodingReader([this.payload]).readFully()}return this.payload||(t?(this.payload=await super.readFully(),this.consumed="content"):(this.payload=await this._reader.readFully(),this.consumed="raw")),this.payload}get reader(){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(t){let e=this.httpHeaders.headers.get("content-encoding"),r=this.httpHeaders.headers.get("transfer-encoding");const i="chunked"===r;return e||i||(e=r),new a(t,e,i)}async readlineRaw(t){if(this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");return this.contentReader.readlineRaw(t)}async contentText(){const t=await this.readFully(!0);return p.decode(t)}async*[Symbol.asyncIterator](){for await(const t of this.contentReader)if(yield t,this.consumed)throw new Error("Record already consumed.. Perhaps a promise was not awaited?");this.consumed="content"}async skipFully(){if(this.consumed)return;const t=await this._reader.skipFully();return this.consumed="skipped",t}warcHeader(t){return this.warcHeaders.headers.get(t)}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 warcContentType(){return this.warcHeaders.headers.get("Content-Type")}get warcContentLength(){return Number(this.warcHeaders.headers.get("Content-Length"))}}class f{static parse(t,e){return new f(t,e).parse()}static iterRecords(t,e){return new f(t,e)}constructor(t,{keepHeadersCase:e=!1,parseHttp:r=!0}={}){this._offset=0,this._warcHeadersLength=0,this._headersClass=e?Map:Headers,this._parseHttp=r,this._atRecordBoundary=!0,t instanceof a||(t=new a(t)),this._reader=t,this._record=null}async readToNextRecord(){!this._atRecordBoundary&&this._reader&&this._record&&(await this._record.skipFully(),await this._reader.readSize(4,!0),this._atRecordBoundary=!0)}async parse(){await this.readToNextRecord(),this._offset=this._reader.getRawOffset();const t=new c,e=await t.parse(this._reader,{headersClass:this._headersClass});if(!e)return null;this._warcHeadersLength=this._reader.getReadOffset();const r=new d({warcHeaders:e,reader:this._reader});if(this._atRecordBoundary=!1,this._record=r,this._parseHttp)switch(r.warcType){case"response":case"request":await this._addHttpHeaders(r,t,this._reader);break;case"revisit":r.warcContentLength>0&&await this._addHttpHeaders(r,t,this._reader)}return r}get offset(){return this._offset}get recordLength(){return this._reader.getRawLength(this._offset)}async*[Symbol.asyncIterator](){let t=null;for(;t=await this.parse(this._reader);)yield t;this._record=null}async _addHttpHeaders(t,e,r){const i=await e.parse(r,{headersClass:this._headersClass});t._addHttpHeaders(i,r.getReadOffset()-this._warcHeadersLength)}}const m="offset,warc-type,warc-target-uri".split(",");const w="urlkey,timestamp,url,mime,status,digest,length,offset,filename".split(","),g="urlkey,timestamp,url,mime,status,digest,redirect,meta,length,offset,filename".split(",");class y extends class extends class{constructor(t,e){this.opts=t,this.out=e}write(t){this.out.write(JSON.stringify(t)+"\n")}async run(t){for await(const e of this.iterIndex(t))this.write(e)}async*iterIndex(t){const e={strictHeaders:!0,parseHttp:this.parseHttp};for(const{filename:r,reader:i}of t){if(!r||!i)continue;const t=new f(i,e);for await(const e of t){await e.skipFully();const i=this.indexRecord(e,t,r);i&&(yield i)}}}indexRecord(t,e,r){if(this.filterRecord&&!this.filterRecord(t))return null;const i={},n={offset:e.offset,length:e.recordLength,filename:r};for(const e of this.fields)null!=n[e]?i[e]=n[e]:this.setField(e,t,i);return i}setField(t,e,r){const i=this.getField(t,e);null!=i&&(r[t]=i)}getField(t,e){return"http:status"===t?!e.httpHeaders||"response"!==e.warcType&&"revisit"!==e.warcType?null:e.httpHeaders.statusCode:t.startsWith("http:")?e.httpHeaders?e.httpHeaders.headers.get(t.slice(5)):null:e.warcHeaders.headers.get(t)}}{constructor(t={},e=null){if(super(t,e),t.fields){this.fields=t.fields.split(","),this.parseHttp=!1;for(const t of this.fields)if(t.startsWith("http:")){this.parseHttp=!0;break}}else this.fields=m,this.parseHttp=!1}}{constructor(t={},e=null){switch(super(t,e),this.includeAll=t.all,this.fields=w,this.parseHttp=!0,t.format){case"cdxj":this.write=this.writeCDXJ;break;case"cdx":this.write=this.writeCDX11}}filterRecord(t){if(this.includeAll)return!0;const e=t.warcType;return"request"!==e&&"warcinfo"!==e}writeCDXJ(t){const{urlkey:e,timestamp:r}=t;delete t.urlkey,delete t.timestamp,this.out.write(`${e} ${r} ${JSON.stringify(t)}\n`)}writeCDX11(t){const e=[];for(const r of g)e.push(null!=t[r]?t[r]:"-");this.out.write(e.join(" ")+"\n")}getField(t,e){let r=null;switch(t){case"urlkey":return this.getSurt(e.warcTargetURI);case"timestamp":return r=e.warcDate,r.replace(/[-:T]/g,"").slice(0,14);case"url":return e.warcTargetURI;case"mime":switch(e.warcType){case"revisit":return"warc/revisit";case"response":case"request":t="http:content-type";break;default:t="content-type"}return r=super.getField(t,e),r?r.split(";",1)[0].trim():null;case"status":return super.getField("http:status",e);case"digest":return r=e.warcPayloadDigest,r?r.split(":",2)[1]:null}}getSurt(t){try{const e=new URL(t);let r=e.hostname.split(".").reverse().join(",");return e.port&&(r+=":"+e.port),r+=")",r+=e.pathname,r.toLowerCase()}catch(e){return t}}}},,,,function(t,e,r){"use strict";var i=r(32),n=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];t.exports=function(t,e){var r,o;if(e=e||{},Object.keys(e).forEach((function(e){if(-1===n.indexOf(e))throw new i('Unknown option "'+e+'" is met in definition of "'+t+'" YAML type.')})),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=(r=e.styleAliases||null,o={},null!==r&&Object.keys(r).forEach((function(t){r[t].forEach((function(e){o[String(e)]=t}))})),o),-1===s.indexOf(this.kind))throw new i('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}},,,function(t,e,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh=0;){for(r=0,d=_[n]%1e7,m=_[n]/1e7|0,s=n+(o=u);s>n;)r=((h=d*(h=b[--o]%1e7)+(a=m*h+(c=b[o]/1e7|0)*d)%1e7*1e7+w[s]+r)/g|0)+(a/1e7|0)+m*c,w[s--]=h%g;w[s]=r}return r?++i:w.splice(0,1),H(t,w,i)},S.negated=function(){var t=new M(this);return t.s=-t.s||null,t},S.plus=function(t,e){var r,i=this,n=i.s;if(e=(t=new M(t,e)).s,!n||!e)return new M(NaN);if(n!=e)return t.s=-e,i.minus(t);var s=i.e/14,o=t.e/14,a=i.c,u=t.c;if(!s||!o){if(!a||!u)return new M(n/0);if(!a[0]||!u[0])return u[0]?t:new M(a[0]?i:0*n)}if(s=f(s),o=f(o),a=a.slice(),n=s-o){for(n>0?(o=s,r=u):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(e=u.length)<0&&(r=u,u=a,a=r,e=n),n=0;e;)n=(a[--e]=a[e]+u[e]+n)/l|0,a[e]=l===a[e]?0:a[e]%l;return n&&(a=[n].concat(a),++o),H(t,a,o)},S.precision=S.sd=function(t,e){var r,i,n,s=this;if(null!=t&&t!==!!t)return g(t,1,d),null==e?e=k:g(e,0,8),G(new M(s),t,e);if(!(r=s.c))return null;if(i=14*(n=r.length-1)+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return t&&s.e+1>i&&(i=s.e+1),i},S.shiftedBy=function(t){return g(t,-9007199254740991,9007199254740991),this.times("1e"+t)},S.squareRoot=S.sqrt=function(){var t,e,i,n,s,o=this,a=o.c,u=o.s,h=o.e,c=D+4,l=new M("0.5");if(1!==u||!a||!a[0])return new M(!u||u<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(u=Math.sqrt(+z(o)))||u==1/0?(((e=m(a)).length+h)%2==0&&(e+="0"),u=Math.sqrt(+e),h=f((h+1)/2)-(h<0||h%2),i=new M(e=u==1/0?"1e"+h:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+h)):i=new M(u+""),i.c[0])for((u=(h=i.e)+c)<3&&(u=0);;)if(s=i,i=l.times(s.plus(r(o,s,c,1))),m(s.c).slice(0,u)===(e=m(i.c)).slice(0,u)){if(i.e o){if(t.match_start=e,o=i,i>=a)break;d=h[s+o-1],f=h[s+o]}}}while((e=l[e&c])>u&&0!=--n);return o<=t.lookahead?o:t.lookahead}function g(t){var e,r,i,s,u,h,c,l,p,d,f=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-262)){n.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=r=t.hash_size;do{i=t.head[--e],t.head[e]=i>=f?i-f:0}while(--r);e=r=f;do{i=t.prev[--e],t.prev[e]=i>=f?i-f:0}while(--r);s+=f}if(0===t.strm.avail_in)break;if(h=t.strm,c=t.window,l=t.strstart+t.lookahead,p=s,d=void 0,(d=h.avail_in)>p&&(d=p),r=0===d?0:(h.avail_in-=d,n.arraySet(c,h.input,h.next_in,d,l),1===h.state.wrap?h.adler=o(h.adler,c,d,l):2===h.state.wrap&&(h.adler=a(h.adler,c,d,l)),h.next_in+=d,h.total_in+=d,d),t.lookahead+=r,t.lookahead+t.insert>=3)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),f(r)?i.showHidden=r:r&&e._extend(i,r),y(i.showHidden)&&(i.showHidden=!1),y(i.depth)&&(i.depth=2),y(i.colors)&&(i.colors=!1),y(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=u),c(i,t,i.depth)}function u(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function h(t,e){return t}function c(t,r,i){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(i,t);return g(n)||(n=c(t,n,i)),n}var s=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(w(e))return t.stylize(""+e,"number");if(f(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,r);if(s)return s;var o=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),v(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(r);if(0===o.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(b(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return t.stylize(Date.prototype.toString.call(r),"date");if(v(r))return l(r)}var h,_="",T=!1,x=["{","}"];(d(r)&&(T=!0,x=["[","]"]),A(r))&&(_=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(_=" "+RegExp.prototype.toString.call(r)),E(r)&&(_=" "+Date.prototype.toUTCString.call(r)),v(r)&&(_=" "+l(r)),0!==o.length||T&&0!=r.length?i<0?b(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),h=T?function(t,e,r,i,n){for(var s=[],o=0,a=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(h,_,x)):x[0]+_+x[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,r,i,n,s){var o,a,u;if((u=Object.getOwnPropertyDescriptor(e,n)||{value:e[n]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),D(i,n)||(o="["+n+"]"),a||(t.seen.indexOf(u.value)<0?(a=m(r)?c(t,u.value,null):c(t,u.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),y(o)){if(s&&n.match(/^\d+$/))return a;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+a}function d(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function m(t){return null===t}function w(t){return"number"==typeof t}function g(t){return"string"==typeof t}function y(t){return void 0===t}function b(t){return _(t)&&"[object RegExp]"===T(t)}function _(t){return"object"==typeof t&&null!==t}function E(t){return _(t)&&"[object Date]"===T(t)}function v(t){return _(t)&&("[object Error]"===T(t)||t instanceof Error)}function A(t){return"function"==typeof t}function T(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(r){if(y(s)&&(s=t.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(s)){var i=t.pid;o[r]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",r,i,t)}}else o[r]=function(){};return o[r]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=f,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=w,e.isString=g,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=y,e.isRegExp=b,e.isObject=_,e.isDate=E,e.isError=v,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(193);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),S[t.getMonth()],e].join(" ")}function D(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",C(),e.format.apply(e,arguments))},e.inherits=r(194),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),i=r.length;i--;)t[r[i]]=e[r[i]];return t};var k="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(k&&t[k]){var e;if("function"!=typeof(e=t[k]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,k,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,i=new Promise((function(t,i){e=t,r=i})),n=[],s=0;s0&&(u=this._consume(),i++),u===a.EOF){n=!1;break}if(h=t[o],u!==h&&(r||u!==b(h))){n=!1;break}}if(!n)for(;i--;)this._unconsume();return n}_isTempBufferEqualToScriptString(){if(this.tempBuff.length!==u.SCRIPT_STRING.length)return!1;for(let t=0;t{const s=[],o=new C(r);o.on("data",t=>s.push(t)),o.on("error",n),o.on("finish",()=>i(e.concat(s))),o.pushAny(t),o.end()})}}t.exports=C}).call(this,r(14).Buffer)},,,,,,,,,,,,,,,,function(t,e,r){"use strict";const i=r(127),{escapeString:n}=r(135);t.exports=class extends i{constructor(){super({sourceCodeLocationInfo:!0}),this.posTracker=this.locInfoMixin.posTracker}_transformChunk(t){super._transformChunk(t)}_getRawHtml(t){const e=this.posTracker.droppedBufferSize,r=t.startOffset-e,i=t.endOffset-e;return this.tokenizer.preprocessor.html.slice(r,i)}_handleToken(t){super._handleToken(t)||this.emitRaw(this._getRawHtml(t.location)),this.parserFeedbackSimulator.skipNextNewLine=!1}_emitToken(t,e){this.emit(t,e,this._getRawHtml(e.sourceCodeLocation))}emitDoctype(t){let e="",this.push(e)}emitStartTag(t){let e="<"+t.tagName;const r=t.attrs;for(let t=0;t0&&(0===t||1!==S))return-1;for(B[1]=0,A=1;A<15;A++)B[A+1]=B[A]+P[A];for(T=0;T852||2===t&&N>592)return 1;for(;;){b=A-k,l[T]852||2===t&&N>592)return 1;h[m=I&w]=C<<24|D<<16|g-c|0}}return 0!==I&&(h[g+I]=A-k<<24|64<<16|0),p.bits=C,0}},function(t,e,r){"use strict";t.exports=function(){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}},function(t,e,r){"use strict";var i=r(39),n=r(154),s=r(155),o=r(156),a=r(157);function u(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function h(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(852),e.distcode=e.distdyn=new i.Buf32(592),e.sane=1,e.back=-1,0):-2}function l(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,c(t)):-2}function p(t,e){var r,i;return t&&t.state?(i=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?-2:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,l(t))):-2}function d(t,e){var r,i;return t?(i=new h,t.state=i,i.window=null,0!==(r=p(t,e))&&(t.state=null),r):-2}var f,m,w=!0;function g(t){if(w){var e;for(f=new i.Buf32(512),m=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(1,t.lens,0,288,f,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(2,t.lens,0,32,m,0,t.work,{bits:5}),w=!1}t.lencode=f,t.lenbits=9,t.distcode=m,t.distbits=5}function y(t,e,r,n){var s,o=t.state;return null===o.window&&(o.wsize=1<0&&(0===t||1!==S))return-1;for(B[1]=0,A=1;A<15;A++)B[A+1]=B[A]+P[A];for(T=0;T852||2===t&&N>592)return 1;for(;;){b=A-k,l[T]852||2===t&&N>592)return 1;h[m=I&w]=C<<24|D<<16|g-c|0}}return 0!==I&&(h[g+I]=A-k<<24|64<<16|0),p.bits=C,0}},function(t,e,r){"use strict";var i=r(39),n=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var o=new i.Buf8(256),a=0;a<256;a++)o[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function u(t,e){if(e<65534&&(t.subarray&&s||!t.subarray&&n))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var r="",o=0;o=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function f(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return W(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(t).length;default:if(i)return W(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var i=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return C(this,e,r);case"latin1":case"binary":return D(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}function w(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function g(t,e,r,i,n){if(0===t.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof e&&(e=u.from(e,i)),u.isBuffer(e))return 0===e.length?-1:y(t,e,r,i,n);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):y(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function y(t,e,r,i,n){var s,o=1,a=t.length,u=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,r/=2}function h(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(n){var c=-1;for(s=r;sa&&(r=a-u),s=r;s>=0;s--){for(var l=!0,p=0;pn&&(i=n):i=n;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o>8,n=r%256,s.push(n),s.push(i);return s}(e,t.length-r),t,r,i)}function x(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var i=[],n=e;nt.length)throw new RangeError("Index out of range")}function O(t,e,r,i){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-r,2);n>>8*(i?n:1-n)}function F(t,e,r,i){e<0&&(e=4294967295+e+1);for(var n=0,s=Math.min(t.length-r,4);n