georaster
Version:
Wrapper around Georeferenced Rasters like GeoTIFF, NetCDF, JPG, and PNG that provides a standard interface
1 lines • 45.7 kB
JavaScript
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){e.exports=function(){return r(1)('!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){e.exports=function(){return r(1)(\'!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=21)}([function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(e[n]=r[n])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,s;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],s.set(o,i),i+=o.length;return s}},s={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,o)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(n)},function(e,t,r){"use strict";(function(e){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.expose=t.isWorkerRuntime=t.Transfer=t.registerSerializer=void 0;const o=i(r(6)),s=r(2),a=r(3),l=r(9),f=i(r(10));var c=r(2);Object.defineProperty(t,"registerSerializer",{enumerable:!0,get:function(){return c.registerSerializer}});var u=r(3);Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return u.Transfer}}),t.isWorkerRuntime=f.default.isWorkerRuntime;let d=!1;const h=new Map,b=e=>e&&e.type===l.MasterMessageType.run,m=e=>o.default(e)||function(e){return e&&"object"==typeof e&&"function"==typeof e.subscribe}(e);function p(e){return a.isTransferDescriptor(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function w(e,t){const{payload:r,transferables:n}=p(t),i={type:l.WorkerMessageType.error,uid:e,error:s.serialize(r)};f.default.postMessageToMaster(i,n)}function g(e,t,r){const{payload:n,transferables:i}=p(r),o={type:l.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:n};f.default.postMessageToMaster(o,i)}function k(e){try{const t={type:l.WorkerMessageType.uncaughtError,error:s.serialize(e)};f.default.postMessageToMaster(t)}catch(t){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already.\\\\nLatest error:",t,"\\\\nOriginal error:",e)}}function y(e,t,r){return n(this,void 0,void 0,(function*(){let n;try{n=t(...r)}catch(t){return w(e,t)}const i=m(n)?"observable":"promise";if(function(e,t){const r={type:l.WorkerMessageType.running,uid:e,resultType:t};f.default.postMessageToMaster(r)}(e,i),m(n)){const t=n.subscribe(t=>g(e,!1,s.serialize(t)),t=>{w(e,s.serialize(t)),h.delete(e)},()=>{g(e,!0),h.delete(e)});h.set(e,t)}else try{const t=yield n;g(e,!0,s.serialize(t))}catch(t){w(e,s.serialize(t))}}))}t.expose=function(e){if(!f.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(d)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(d=!0,"function"==typeof e)f.default.subscribeToMasterMessages(t=>{b(t)&&!t.method&&y(t.uid,e,t.args.map(s.deserialize))}),function(){const e={type:l.WorkerMessageType.init,exposed:{type:"function"}};f.default.postMessageToMaster(e)}();else{if("object"!=typeof e||!e)throw Error("Invalid argument passed to expose(). Expected a function or an object, got: "+e);f.default.subscribeToMasterMessages(t=>{b(t)&&t.method&&y(t.uid,e[t.method],t.args.map(s.deserialize))});!function(e){const t={type:l.WorkerMessageType.init,exposed:{type:"module",methods:e}};f.default.postMessageToMaster(t)}(Object.keys(e).filter(t=>"function"==typeof e[t]))}f.default.subscribeToMasterMessages(e=>{if((t=e)&&t.type===l.MasterMessageType.cancel){const t=e.uid,r=h.get(t);r&&(r.unsubscribe(),h.delete(t))}var t})},"undefined"!=typeof self&&"function"==typeof self.addEventListener&&f.default.isWorkerRuntime()&&(self.addEventListener("error",e=>{setTimeout(()=>k(e.error||e),250)}),self.addEventListener("unhandledrejection",e=>{const t=e.reason;t&&"string"==typeof t.message&&setTimeout(()=>k(t),250)})),void 0!==e&&"function"==typeof e.on&&f.default.isWorkerRuntime()&&(e.on("uncaughtException",e=>{setTimeout(()=>k(e),250)}),e.on("unhandledRejection",e=>{e&&"string"==typeof e.message&&setTimeout(()=>k(e),250)}))}).call(this,r(5))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.deserialize=t.registerSerializer=void 0;const n=r(7);let i=n.DefaultSerializer;t.registerSerializer=function(e){i=n.extendSerializer(i,e)},t.deserialize=function(e){return i.deserialize(e)},t.serialize=function(e){return i.serialize(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Transfer=t.isTransferDescriptor=void 0;const n=r(8);t.isTransferDescriptor=function(e){return e&&"object"==typeof e&&e[n.$transferable]},t.Transfer=function(e,t){if(!t){if(!(r=e)||"object"!=typeof r)throw Error();t=[e]}var r;return{[n.$transferable]:!0,send:e,transferables:t}}},function(e,t,r){"use strict";var n=r(11),i=r(0),o=r(16),s=r(17),a=r(18),l=r(19),f=r(20),c=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==s.Z_OK)throw new Error(a[r]);if(this.header=new f,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==s.Z_OK))throw new Error(a[r])}function d(e,t){var r=new u(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}u.prototype.push=function(e,t){var r,a,l,f,u,d=this.strm,h=this.options.chunkSize,b=this.options.dictionary,m=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?d.input=o.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(h),d.next_out=0,d.avail_out=h),(r=n.inflate(d,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&b&&(r=n.inflateSetDictionary(this.strm,b)),r===s.Z_BUF_ERROR&&!0===m&&(r=s.Z_OK,m=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==s.Z_STREAM_END&&(0!==d.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(d.output,d.next_out),f=d.next_out-l,u=o.buf2string(d.output,l),d.next_out=f,d.avail_out=h-f,f&&i.arraySet(d.output,d.output,l,f,0),this.onData(u)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),d.avail_out=0,!0)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=u,t.inflate=d,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.ungzip=d},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var l,f=[],c=!1,u=-1;function d(){c&&l&&(c=!1,l.length?f=l.concat(f):u=-1,f.length&&h())}function h(){if(!c){var e=a(d);c=!0;for(var t=f.length;t;){for(l=f,f=[];++u<t;)l&&l[u].run();u=-1,t=f.length}l=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function b(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];f.push(new b(e,t)),1!==f.length||c||a(h)},b.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,r){"use strict";e.exports=e=>!!e&&("symbol"==typeof Symbol.observable&&"function"==typeof e[Symbol.observable]?e===e[Symbol.observable]():"function"==typeof e["@@observable"]&&e===e["@@observable"]())},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultSerializer=t.extendSerializer=void 0,t.extendSerializer=function(e,t){const r=e.deserialize.bind(e),n=e.serialize.bind(e);return{deserialize:e=>t.deserialize(e,r),serialize:e=>t.serialize(e,n)}};const n={deserialize:e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),serialize:e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack})};t.DefaultSerializer={deserialize(e){return(t=e)&&"object"==typeof t&&"__error_marker"in t&&"$$error"===t.__error_marker?n.deserialize(e):e;var t},serialize:e=>e instanceof Error?n.serialize(e):e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.$worker=t.$transferable=t.$terminate=t.$events=t.$errors=void 0,t.$errors=Symbol("thread.errors"),t.$events=Symbol("thread.events"),t.$terminate=Symbol("thread.terminate"),t.$transferable=Symbol("thread.transferable"),t.$worker=Symbol("thread.worker")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerMessageType=t.MasterMessageType=void 0,function(e){e.cancel="cancel",e.run="run"}(t.MasterMessageType||(t.MasterMessageType={})),function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(t.WorkerMessageType||(t.WorkerMessageType={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={isWorkerRuntime:function(){const e="undefined"!=typeof self&&"undefined"!=typeof Window&&self instanceof Window;return!("undefined"==typeof self||!self.postMessage||e)},postMessageToMaster:function(e,t){self.postMessage(e,t)},subscribeToMasterMessages:function(e){const t=t=>{e(t.data)};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}}},function(e,t,r){"use strict";var n=r(0),i=r(12),o=r(13),s=r(14),a=r(15);function l(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function f(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):-2}function u(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,c(e)):-2}function d(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,u(e))):-2}function h(e,t){var r,n;return e?(n=new f,e.state=n,n.window=null,0!==(r=d(e,t))&&(e.state=null),r):-2}var b,m,p=!0;function w(e){if(p){var t;for(b=new n.Buf32(512),m=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,b,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,m,0,e.work,{bits:5}),p=!1}e.lencode=b,e.lenbits=9,e.distcode=m,e.distbits=5}function g(e,t,r,i){var o,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,t,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}t.inflateReset=u,t.inflateReset2=d,t.inflateResetKeep=c,t.inflateInit=function(e){return h(e,15)},t.inflateInit2=h,t.inflate=function(e,t){var r,f,c,u,d,h,b,m,p,k,y,v,_,x,T,E,S,M,A,z,O,B,C,P,L=0,Z=new n.Buf8(4),R=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(r=e.state).mode&&(r.mode=13),d=e.next_out,c=e.output,b=e.avail_out,u=e.next_in,f=e.input,h=e.avail_in,m=r.hold,p=r.bits,k=h,y=b,B=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;p<16;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}if(2&r.wrap&&35615===m){r.check=0,Z[0]=255&m,Z[1]=m>>>8&255,r.check=o(r.check,Z,2,0),m=0,p=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&m)){e.msg="unknown compression method",r.mode=30;break}if(p-=4,O=8+(15&(m>>>=4)),0===r.wbits)r.wbits=O;else if(O>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<O,e.adler=r.check=1,r.mode=512&m?10:12,m=0,p=0;break;case 2:for(;p<16;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}if(r.flags=m,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=m>>8&1),512&r.flags&&(Z[0]=255&m,Z[1]=m>>>8&255,r.check=o(r.check,Z,2,0)),m=0,p=0,r.mode=3;case 3:for(;p<32;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}r.head&&(r.head.time=m),512&r.flags&&(Z[0]=255&m,Z[1]=m>>>8&255,Z[2]=m>>>16&255,Z[3]=m>>>24&255,r.check=o(r.check,Z,4,0)),m=0,p=0,r.mode=4;case 4:for(;p<16;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}r.head&&(r.head.xflags=255&m,r.head.os=m>>8),512&r.flags&&(Z[0]=255&m,Z[1]=m>>>8&255,r.check=o(r.check,Z,2,0)),m=0,p=0,r.mode=5;case 5:if(1024&r.flags){for(;p<16;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}r.length=m,r.head&&(r.head.extra_len=m),512&r.flags&&(Z[0]=255&m,Z[1]=m>>>8&255,r.check=o(r.check,Z,2,0)),m=0,p=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((v=r.length)>h&&(v=h),v&&(r.head&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,f,u,v,O)),512&r.flags&&(r.check=o(r.check,f,v,u)),h-=v,u+=v,r.length-=v),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===h)break e;v=0;do{O=f[u+v++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O))}while(O&&v<h);if(512&r.flags&&(r.check=o(r.check,f,v,u)),h-=v,u+=v,O)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===h)break e;v=0;do{O=f[u+v++],r.head&&O&&r.length<65536&&(r.head.comment+=String.fromCharCode(O))}while(O&&v<h);if(512&r.flags&&(r.check=o(r.check,f,v,u)),h-=v,u+=v,O)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;p<16;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}if(m!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}m=0,p=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;p<32;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}e.adler=r.check=l(m),m=0,p=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=d,e.avail_out=b,e.next_in=u,e.avail_in=h,r.hold=m,r.bits=p,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){m>>>=7&p,p-=7&p,r.mode=27;break}for(;p<3;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}switch(r.last=1&m,p-=1,3&(m>>>=1)){case 0:r.mode=14;break;case 1:if(w(r),r.mode=20,6===t){m>>>=2,p-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}m>>>=2,p-=2;break;case 14:for(m>>>=7&p,p-=7&p;p<32;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}if((65535&m)!=(m>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&m,m=0,p=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(v=r.length){if(v>h&&(v=h),v>b&&(v=b),0===v)break e;n.arraySet(c,f,u,v,d),h-=v,u+=v,b-=v,d+=v,r.length-=v;break}r.mode=12;break;case 17:for(;p<14;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}if(r.nlen=257+(31&m),m>>>=5,p-=5,r.ndist=1+(31&m),m>>>=5,p-=5,r.ncode=4+(15&m),m>>>=4,p-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;p<3;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}r.lens[R[r.have++]]=7&m,m>>>=3,p-=3}for(;r.have<19;)r.lens[R[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,C={bits:r.lenbits},B=a(0,r.lens,0,19,r.lencode,0,r.work,C),r.lenbits=C.bits,B){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;E=(L=r.lencode[m&(1<<r.lenbits)-1])>>>16&255,S=65535&L,!((T=L>>>24)<=p);){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}if(S<16)m>>>=T,p-=T,r.lens[r.have++]=S;else{if(16===S){for(P=T+2;p<P;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}if(m>>>=T,p-=T,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}O=r.lens[r.have-1],v=3+(3&m),m>>>=2,p-=2}else if(17===S){for(P=T+3;p<P;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}p-=T,O=0,v=3+(7&(m>>>=T)),m>>>=3,p-=3}else{for(P=T+7;p<P;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}p-=T,O=0,v=11+(127&(m>>>=T)),m>>>=7,p-=7}if(r.have+v>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;v--;)r.lens[r.have++]=O}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,C={bits:r.lenbits},B=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,C),r.lenbits=C.bits,B){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,C={bits:r.distbits},B=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,C),r.distbits=C.bits,B){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(h>=6&&b>=258){e.next_out=d,e.avail_out=b,e.next_in=u,e.avail_in=h,r.hold=m,r.bits=p,s(e,y),d=e.next_out,c=e.output,b=e.avail_out,u=e.next_in,f=e.input,h=e.avail_in,m=r.hold,p=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;E=(L=r.lencode[m&(1<<r.lenbits)-1])>>>16&255,S=65535&L,!((T=L>>>24)<=p);){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}if(E&&0==(240&E)){for(M=T,A=E,z=S;E=(L=r.lencode[z+((m&(1<<M+A)-1)>>M)])>>>16&255,S=65535&L,!(M+(T=L>>>24)<=p);){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}m>>>=M,p-=M,r.back+=M}if(m>>>=T,p-=T,r.back+=T,r.length=S,0===E){r.mode=26;break}if(32&E){r.back=-1,r.mode=12;break}if(64&E){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&E,r.mode=22;case 22:if(r.extra){for(P=r.extra;p<P;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}r.length+=m&(1<<r.extra)-1,m>>>=r.extra,p-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;E=(L=r.distcode[m&(1<<r.distbits)-1])>>>16&255,S=65535&L,!((T=L>>>24)<=p);){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}if(0==(240&E)){for(M=T,A=E,z=S;E=(L=r.distcode[z+((m&(1<<M+A)-1)>>M)])>>>16&255,S=65535&L,!(M+(T=L>>>24)<=p);){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}m>>>=M,p-=M,r.back+=M}if(m>>>=T,p-=T,r.back+=T,64&E){e.msg="invalid distance code",r.mode=30;break}r.offset=S,r.extra=15&E,r.mode=24;case 24:if(r.extra){for(P=r.extra;p<P;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}r.offset+=m&(1<<r.extra)-1,m>>>=r.extra,p-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===b)break e;if(v=y-b,r.offset>v){if((v=r.offset-v)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}v>r.wnext?(v-=r.wnext,_=r.wsize-v):_=r.wnext-v,v>r.length&&(v=r.length),x=r.window}else x=c,_=d-r.offset,v=r.length;v>b&&(v=b),b-=v,r.length-=v;do{c[d++]=x[_++]}while(--v);0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;c[d++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;p<32;){if(0===h)break e;h--,m|=f[u++]<<p,p+=8}if(y-=b,e.total_out+=y,r.total+=y,y&&(e.adler=r.check=r.flags?o(r.check,c,y,d-y):i(r.check,c,y,d-y)),y=b,(r.flags?m:l(m))!==r.check){e.msg="incorrect data check",r.mode=30;break}m=0,p=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;p<32;){if(0===h)break e;h--,m+=f[u++]<<p,p+=8}if(m!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}m=0,p=0}r.mode=29;case 29:B=1;break e;case 30:B=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=d,e.avail_out=b,e.next_in=u,e.avail_in=h,r.hold=m,r.bits=p,(r.wsize||y!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&g(e,e.output,e.next_out,y-e.avail_out)?(r.mode=31,-4):(k-=e.avail_in,y-=e.avail_out,e.total_in+=k,e.total_out+=y,r.total+=y,r.wrap&&y&&(e.adler=r.check=r.flags?o(r.check,c,y,e.next_out-y):i(r.check,c,y,e.next_out-y)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===k&&0===y||4===t)&&0===B&&(B=-5),B)},t.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?-2:(r.head=t,t.done=!1,0):-2},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?-2:11===r.mode&&i(1,t,n,0)!==r.check?-3:g(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):-2},t.inflateInfo="pako inflate (from Nodeca project)"},function(e,t,r){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16|0}},function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,i){var o=n,s=i+r;e^=-1;for(var a=i;a<s;a++)e=e>>>8^o[255&(e^t[a])];return-1^e}},function(e,t,r){"use strict";e.exports=function(e,t){var r,n,i,o,s,a,l,f,c,u,d,h,b,m,p,w,g,k,y,v,_,x,T,E,S;r=e.state,n=e.next_in,E=e.input,i=n+(e.avail_in-5),o=e.next_out,S=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),l=r.dmax,f=r.wsize,c=r.whave,u=r.wnext,d=r.window,h=r.hold,b=r.bits,m=r.lencode,p=r.distcode,w=(1<<r.lenbits)-1,g=(1<<r.distbits)-1;e:do{b<15&&(h+=E[n++]<<b,b+=8,h+=E[n++]<<b,b+=8),k=m[h&w];t:for(;;){if(h>>>=y=k>>>24,b-=y,0===(y=k>>>16&255))S[o++]=65535&k;else{if(!(16&y)){if(0==(64&y)){k=m[(65535&k)+(h&(1<<y)-1)];continue t}if(32&y){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}v=65535&k,(y&=15)&&(b<y&&(h+=E[n++]<<b,b+=8),v+=h&(1<<y)-1,h>>>=y,b-=y),b<15&&(h+=E[n++]<<b,b+=8,h+=E[n++]<<b,b+=8),k=p[h&g];r:for(;;){if(h>>>=y=k>>>24,b-=y,!(16&(y=k>>>16&255))){if(0==(64&y)){k=p[(65535&k)+(h&(1<<y)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(_=65535&k,b<(y&=15)&&(h+=E[n++]<<b,(b+=8)<y&&(h+=E[n++]<<b,b+=8)),(_+=h&(1<<y)-1)>l){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=y,b-=y,_>(y=o-s)){if((y=_-y)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,T=d,0===u){if(x+=f-y,y<v){v-=y;do{S[o++]=d[x++]}while(--y);x=o-_,T=S}}else if(u<y){if(x+=f+u-y,(y-=u)<v){v-=y;do{S[o++]=d[x++]}while(--y);if(x=0,u<v){v-=y=u;do{S[o++]=d[x++]}while(--y);x=o-_,T=S}}}else if(x+=u-y,y<v){v-=y;do{S[o++]=d[x++]}while(--y);x=o-_,T=S}for(;v>2;)S[o++]=T[x++],S[o++]=T[x++],S[o++]=T[x++],v-=3;v&&(S[o++]=T[x++],v>1&&(S[o++]=T[x++]))}else{x=o-_;do{S[o++]=S[x++],S[o++]=S[x++],S[o++]=S[x++],v-=3}while(v>2);v&&(S[o++]=S[x++],v>1&&(S[o++]=S[x++]))}break}}break}}while(n<i&&o<a);n-=v=b>>3,h&=(1<<(b-=v<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<a?a-o+257:257-(o-a),r.hold=h,r.bits=b}},function(e,t,r){"use strict";var n=r(0),i=[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],o=[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],s=[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],a=[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];e.exports=function(e,t,r,l,f,c,u,d){var h,b,m,p,w,g,k,y,v,_=d.bits,x=0,T=0,E=0,S=0,M=0,A=0,z=0,O=0,B=0,C=0,P=null,L=0,Z=new n.Buf16(16),R=new n.Buf16(16),U=null,D=0;for(x=0;x<=15;x++)Z[x]=0;for(T=0;T<l;T++)Z[t[r+T]]++;for(M=_,S=15;S>=1&&0===Z[S];S--);if(M>S&&(M=S),0===S)return f[c++]=20971520,f[c++]=20971520,d.bits=1,0;for(E=1;E<S&&0===Z[E];E++);for(M<E&&(M=E),O=1,x=1;x<=15;x++)if(O<<=1,(O-=Z[x])<0)return-1;if(O>0&&(0===e||1!==S))return-1;for(R[1]=0,x=1;x<15;x++)R[x+1]=R[x]+Z[x];for(T=0;T<l;T++)0!==t[r+T]&&(u[R[t[r+T]]++]=T);if(0===e?(P=U=u,g=19):1===e?(P=i,L-=257,U=o,D-=257,g=256):(P=s,U=a,g=-1),C=0,T=0,x=E,w=c,A=M,z=0,m=-1,p=(B=1<<M)-1,1===e&&B>852||2===e&&B>592)return 1;for(;;){k=x-z,u[T]<g?(y=0,v=u[T]):u[T]>g?(y=U[D+u[T]],v=P[L+u[T]]):(y=96,v=0),h=1<<x-z,E=b=1<<A;do{f[w+(C>>z)+(b-=h)]=k<<24|y<<16|v|0}while(0!==b);for(h=1<<x-1;C&h;)h>>=1;if(0!==h?(C&=h-1,C+=h):C=0,T++,0==--Z[x]){if(x===S)break;x=t[r+u[T]]}if(x>M&&(C&p)!==m){for(0===z&&(z=M),w+=E,O=1<<(A=x-z);A+z<S&&!((O-=Z[A+z])<=0);)A++,O<<=1;if(B+=1<<A,1===e&&B>852||2===e&&B>592)return 1;f[m=C&p]=M<<24|A<<16|w-c|0}}return 0!==C&&(f[w+C]=x-z<<24|64<<16|0),d.bits=M,0}},function(e,t,r){"use strict";var n=r(0),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",s=0;s<t;s++)r+=String.fromCharCode(e[s]);return r}s[254]=s[254]=1,t.string2buf=function(e){var t,r,i,o,s,a=e.length,l=0;for(o=0;o<a;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(l),s=0,o=0;s<l;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,n,i,o,a=t||e.length,f=new Array(2*a);for(n=0,r=0;r<a;)if((i=e[r++])<128)f[n++]=i;else if((o=s[i])>4)f[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<a;)i=i<<6|63&e[r++],o--;o>1?f[n++]=65533:i<65536?f[n++]=i:(i-=65536,f[n++]=55296|i>>10&1023,f[n++]=56320|1023&i)}return l(f,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";e.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"}},function(e,t,r){"use strict";e.exports=function(){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}},function(e,t,r){"use strict";e.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(e,t,r){"use strict";r.r(t);var n=r(1);const i=n.expose;n.registerSerializer,n.Transfer;function o(e,t){let r=e.length-t,n=0;do{for(let r=t;r>0;r--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function s(e,t,r){let n=0,i=e.length;const o=i/r;for(;i>t;){for(let r=t;r>0;--r)e[n+t]+=e[n],++n;i-=t}const s=e.slice();for(let t=0;t<o;++t)for(let n=0;n<r;++n)e[r*t+n]=s[(r-n-1)*o+t]}class a{decode(e,t){const r=this.decodeBlock(t),n=e.Predictor||1;if(1!==n){const t=!e.StripOffsets;return function(e,t,r,n,i,a){if(!t||1===t)return e;for(let e=0;e<i.length;++e){if(i[e]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(i[e]!==i[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const l=i[0]/8,f=2===a?1:i.length;for(let a=0;a<n&&!(a*f*r*l>=e.byteLength);++a){let n;if(2===t){switch(i[0]){case 8:n=new Uint8Array(e,a*f*r*l,f*r*l);break;case 16:n=new Uint16Array(e,a*f*r*l,f*r*l/2);break;case 32:n=new Uint32Array(e,a*f*r*l,f*r*l/4);break;default:throw new Error(`Predictor 2 not allowed with ${i[0]} bits per sample.`)}o(n,f)}else 3===t&&(n=new Uint8Array(e,a*f*r*l,f*r*l),s(n,f,l))}return e}(r,n,t?e.TileWidth:e.ImageWidth,t?e.TileLength:e.RowsPerStrip||e.ImageLength,e.BitsPerSample,e.PlanarConfiguration)}return r}}class l extends a{decodeBlock(e){return e}}function f(e,t){for(let r=t.length-1;r>=0;r--)e.push(t[r]);return e}function c(e){const t=new Uint16Array(4093),r=new Uint8Array(4093);for(let e=0;e<=257;e++)t[e]=4096,r[e]=e;let n=258,i=9,o=0;function s(){n=258,i=9}function a(e){const t=function(e,t,r){const n=t%8,i=Math.floor(t/8),o=8-n,s=t+r-8*(i+1);let a=8*(i+2)-(t+r);const l=8*(i+2)-t;if(a=Math.max(0,a),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),257;let f=e[i]&2**(8-n)-1;f<<=r-o;let c=f;if(i+1<e.length){let t=e[i+1]>>>a;t<<=Math.max(0,r-l),c+=t}if(s>8&&i+2<e.length){const n=8*(i+3)-(t+r);c+=e[i+2]>>>n}return c}(e,o,i);return o+=i,t}function l(e,i){return r[n]=i,t[n]=e,n++,n-1}function c(e){const n=[];for(let i=e;4096!==i;i=t[i])n.push(r[i]);return n}const u=[];s();const d=new Uint8Array(e);let h,b=a(d);for(;257!==b;){if(256===b){for(s(),b=a(d);256===b;)b=a(d);if(257===b)break;if(b>256)throw new Error("corrupted code at scanline "+b);f(u,c(b)),h=b}else if(b<n){const e=c(b);f(u,e),l(h,e[e.length-1]),h=b}else{const e=c(h);if(!e)throw new Error(`Bogus entry. Not in dictionary, ${h} / ${n}, position: ${o}`);f(u,e),u.push(e[e.length-1]),l(h,e[e.length-1]),h=b}n+1>=2**i&&(12===i?h=void 0:i++),b=a(d)}return new Uint8Array(u)}class u extends a{decodeBlock(e){return c(e).buffer}}const d=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);function h(e,t){let r=0;const n=[];let i=16;for(;i>0&&!e[i-1];)--i;n.push({children:[],index:0});let o,s=n[0];for(let a=0;a<i;a++){for(let i=0;i<e[a];i++){for(s=n.pop(),s.children[s.index]=t[r];s.index>0;)s=n.pop();for(s.index++,n.push(s);n.length<=a;)n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o;r++}a+1<i&&(n.push(o={children:[],index:0}),s.children[s.index]=o.children,s=o)}return n[0].children}function b(e,t,r,n,i,o,s,a,l){const{mcusPerLine:f,progressive:c}=r,u=t;let h=t,b=0,m=0;function p(){if(m>0)return m--,b>>m&1;if(b=e[h++],255===b){const t=e[h++];if(t)throw new Error("unexpected marker: "+(b<<8|t).toString(16))}return m=7,b>>>7}function w(e){let t,r=e;for(;null!==(t=p());){if(r=r[t],"number"==typeof r)return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function g(e){let t=e,r=0;for(;t>0;){const e=p();if(null===e)return;r=r<<1|e,--t}return r}function k(e){const t=g(e);return t>=1<<e-1?t:t+(-1<<e)+1}let y=0;let v,_=0;function x(e,t,r,n,i){const o=r%f,s=(r/f|0)*e.v+n,a=o*e.h+i;t(e,e.blocks[s][a])}function T(e,t,r){const n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}const E=n.length;let S,M,A,z,O,B;B=c?0===o?0===a?function(e,t){const r=w(e.huffmanTableDC),n=0===r?0:k(r)<<l;e.pred+=n,t[0]=e.pred}:function(e,t){t[0]|=p()<<l}:0===a?function(e,t){if(y>0)return void y--;let r=o;const n=s;for(;r<=n;){const n=w(e.huffmanTableAC),i=15&n,o=n>>4;if(0===i){if(o<15){y=g(o)+(1<<o)-1;break}r+=16}else{r+=o;t[d[r]]=k(i)*(1<<l),r++}}}:function(e,t){let r=o;const n=s;let i=0;for(;r<=n;){const n=d[r],o=t[n]<0?-1:1;switch(_){case 0:{const t=w(e.huffmanTableAC),r=15&t;if(i=t>>4,0===r)i<15?(y=g(i)+(1<<i),_=4):(i=16,_=1);else{if(1!==r)throw new Error("invalid ACn encoding");v=k(r),_=i?2:3}continue}case 1:case 2:t[n]?t[n]+=(p()<<l)*o:(i--,0===i&&(_=2===_?3:0));break;case 3:t[n]?t[n]+=(p()<<l)*o:(t[n]=v<<l,_=0);break;case 4:t[n]&&(t[n]+=(p()<<l)*o)}r++}4===_&&(y--,0===y&&(_=0))}:function(e,t){const r=w(e.huffmanTableDC),n=0===r?0:k(r);e.pred+=n,t[0]=e.pred;let i=1;for(;i<64;){const r=w(e.huffmanTableAC),n=15&r,o=r>>4;if(0===n){if(o<15)break;i+=16}else{i+=o;t[d[i]]=k(n),i++}}};let C,P,L=0;P=1===E?n[0].blocksPerLine*n[0].blocksPerColumn:f*r.mcusPerColumn;const Z=i||P;for(;L<P;){for(M=0;M<E;M++)n[M].pred=0;if(y=0,1===E)for(S=n[0],O=0;O<Z;O++)T(S,B,L),L++;else for(O=0;O<Z;O++){for(M=0;M<E;M++){S=n[M];const{h:e,v:t}=S;for(A=0;A<t;A++)for(z=0;z<e;z++)x(S,B,L,A,z)}if(L++,L===P)break}if(m=0,C=e[h]<<8|e[h+1],C<65280)throw new Error("marker was not found");if(!(C>=65488&&C<=65495))break;h+=2}return h-u}function m(e,t){const r=[],{blocksPerLine:n,blocksPerColumn:i}=t,o=n<<3,s=new Int32Array(64),a=new Uint8Array(64);function l(e,r,n){const i=t.quantizationTable;let o,s,a,l,f,c,u,d,h;const b=n;let m;for(m=0;m<64;m++)b[m]=e[m]*i[m];for(m=0;m<8;++m){const e=8*m;0!==b[1+e]||0!==b[2+e]||0!==b[3+e]||0!==b[4+e]||0!==b[5+e]||0!==b[6+e]||0!==b[7+e]?(o=5793*b[0+e]+128>>8,s=5793*b[4+e]+128>>8,a=b[2+e],l=b[6+e],f=2896*(b[1+e]-b[7+e])+128>>8,d=2896*(b[1+e]+b[7+e])+128>>8,c=b[3+e]<<4,u=b[5+e]<<4,h=o-s+1>>1,o=o+s+1>>1,s=h,h=3784*a+1567*l+128>>8,a=1567*a-3784*l+128>>8,l=h,h=f-u+1>>1,f=f+u+1>>1,u=h,h=d+c+1>>1,c=d-c+1>>1,d=h,h=o-l+1>>1,o=o+l+1>>1,l=h,h=s-a+1>>1,s=s+a+1>>1,a=h,h=2276*f+3406*d+2048>>12,f=3406*f-2276*d+2048>>12,d=h,h=799*c+4017*u+2048>>12,c=4017*c-799*u+2048>>12,u=h,b[0+e]=o+d,b[7+e]=o-d,b[1+e]=s+u,b[6+e]=s-u,b[2+e]=a+c,b[5+e]=a-c,b[3+e]=l+f,b[4+e]=l-f):(h=5793*b[0+e]+512>>10,b[0+e]=h,b[1+e]=h,b[2+e]=h,b[3+e]=h,b[4+e]=h,b[5+e]=h,b[6+e]=h,b[7+e]=h)}for(m=0;m<8;++m){const e=m;0!==b[8+e]||0!==b[16+e]||0!==b[24+e]||0!==b[32+e]||0!==b[40+e]||0!==b[48+e]||0!==b[56+e]?(o=5793*b[0+e]+2048>>12,s=5793*b[32+e]+2048>>12,a=b[16+e],l=b[48+e],f=2896*(b[8+e]-b[56+e])+2048>>12,d=2896*(b[8+e]+b[56+e])+2048>>12,c=b[24+e],u=b[40+e],h=o-s+1>>1,o=o+s+1>>1,s=h,h=3784*a+1567*l+2048>>12,a=1567*a-3784*l+2048>>12,l=h,h=f-u+1>>1,f=f+u+1>>1,u=h,h=d+c+1>>1,c=d-c+1>>1,d=h,h=o-l+1>>1,o=o+l+1>>1,l=h,h=s-a+1>>1,s=s+a+1>>1,a=h,h=2276*f+3406*d+2048>>12,f=3406*f-2276*d+2048>>12,d=h,h=799*c+4017*u+2048>>12,c=4017*c-799*u+2048>>12,u=h,b[0+e]=o+d,b[56+e]=o-d,b[8+e]=s+u,b[48+e]=s-u,b[16+e]=a+c,b[40+e]=a-c,b[24+e]=l+f,b[32+e]=l-f):(h=5793*n[m+0]+8192>>14,b[0+e]=h,b[8+e]=h,b[16+e]=h,b[24+e]=h,b[32+e]=h,b[40+e]=h,b[48+e]=h,b[56+e]=h)}for(m=0;m<64;++m){const e=128+(b[m]+8>>4);r[m]=e<0?0:e>255?255:e}}for(let e=0;e<i;e++){const i=e<<3;for(let e=0;e<8;e++)r.push(new Uint8Array(o));for(let o=0;o<n;o++){l(t.blocks[e][o],a,s);let n=0;const f=o<<3;for(let e=0;e<8;e++){const t=r[i+e];for(let e=0;e<8;e++)t[f+e]=a[n++]}}}return r}class p{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let t=0;function r(){const r=e[t]<<8|e[t+1];return t+=2,r}function n(){const n=r(),i=e.subarray(t,t+n-2);return t+=i.length,i}function i(e){let t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(t=e.components[r],n<t.h&&(n=t.h),i<t.v&&(i=t.v));const o=Math.ceil(e.samplesPerLine/8/n),s=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];const a=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),l=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),f=o*t.h,c=s*t.v,u=[];for(let e=0;e<c;e++){const e=[];for(let t=0;t<f;t++)e.push(new Int32Array(64));u.push(e)}t.blocksPerLine=a,t.blocksPerColumn=l,t.blocks=u}e.maxH=n,e.maxV=i,e.mcusPerLine=o,e.mcusPerColumn=s}let o=r();if(65496!==o)throw new Error("SOI not found");for(o=r();65497!==o;){switch(o){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const e=n();65504===o&&74===e[0]&&70===e[1]&&73===e[2]&&70===e[3]&&0===e[4]&&(this.jfif={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),65518===o&&65===e[0]&&100===e[1]&&111===e[2]&&98===e[3]&&101===e[4]&&0===e[5]&&(this.adobe={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{const n=r()+t-2;for(;t<n;){const n=e[t++],i=new Int32Array(64);if(n>>4==0)for(let r=0;r<64;r++){i[d[r]]=e[t++]}else{if(n>>4!=1)throw new Error("DQT: invalid table spec");for(let e=0;e<64;e++){i[d[e]]=r()}}this.quantizationTables[15&n]=i}break}case 65472:case 65473:case 65474:{r();const n={extended:65473===o,progressive:65474===o,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},s=e[t++];let a;for(let r=0;r<s;r++){a=e[t];const r=e[t+1]>>4,i=15&e[t+1],o=e[t+2];n.componentsOrder.push(a),n.components[a]={h:r,v:i,quantizationIdx:o},t+=3}i(n),this.frames.push(n);break}case 65476:{const n=r();for(let r=2;r<n;){const n=e[t++],i=new Uint8Array(16);let o=0;for(let r=0;r<16;r++,t++)i[r]=e[t],o+=i[r];const s=new Uint8Array(o);for(let r=0;r<o;r++,t++)s[r]=e[t];r+=17+o,n>>4==0?this.huffmanTablesDC[15&n]=h(i,s):this.huffmanTablesAC[15&n]=h(i,s)}break}case 65501:r(),this.resetInterval=r();break;case 65498:{r();const n=e[t++],i=[],o=this.frames[0];for(let r=0;r<n;r++){const r=o.components[e[t++]],n=e[t++];r.huffmanTableDC=this.huffmanTablesDC[n>>4],r.huffmanTableAC=this.huffmanTablesAC[15&n],i.push(r)}const s=e[t++],a=e[t++],l=e[t++],f=b(e,t,o,i,this.resetInterval,s,a,l>>4,15&l);t+=f;break}case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker "+o.toString(16))}o=r()}}getResult(){const{frames:e}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let e=0;e<this.frames.length;e++){const t=this.frames[e].components;for(const e of Object.keys(t))t[e].quantizationTable=this.quantizationTables[t[e].quantizationIdx],delete t[e].quantizationIdx}const t=e[0],{components:r,componentsOrder:n}=t,i=[],o=t.samplesPerLine,s=t.scanLines;for(let e=0;e<n.length;e++){const o=r[n[e]];i.push({lines:m(0,o),scaleX:o.h/t.maxH,scaleY:o.v/t.maxV})}const a=new Uint8Array(o*s*i.length);let l=0;for(let e=0;e<s;++e)for(let t=0;t<o;++t)for(let r=0;r<i.length;++r){const n=i[r];a[l]=n.lines[0|e*n.scaleY][0|t*n.scaleX],++l}return a}}class w extends a{constructor(e){super(),this.reader=new p,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}var g=r(4);class k extends a{decodeBlock(e){return Object(g.inflate)(new Uint8Array(e)).buffer}}class y extends a{decodeBlock(e){const t=new DataView(e),r=[];for(let n=0;n<e.byteLength;++n){let e=t.getInt8(n);if(e<0){const i=t.getUint8(n+1);e=-e;for(let t=0;t<=e;++t)r.push(i);n+=1}else{for(let i=0;i<=e;++i)r.push(t.getUint8(n+i+1));n+=e+1}}return new Uint8Array(r).buffer}}i((function(e,t){return function(e){switch(e.Compression){case void 0:case 1:return new l;case 5:return new u;case 6:throw new Error("old style JPEG compression is not supported.");case 7:return new w(e);case 8:case 32946:return new k;case 32773:return new y;default:throw new Error("Unknown compression method identifier: "+e.Compression)}}(e).decode(e,t)}))}]);\',null)}},function(e,t,r){"use strict";var n=window.URL||window.webkitURL;e.exports=function(e,t){try{try{var r;try{(r=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(e),r=r.getBlob()}catch(t){r=new Blob([e])}return new Worker(n.createObjectURL(r))}catch(t){return new Worker("data:application/javascript,"+encodeURIComponent(e))}}catch(e){if(!t)throw Error("Inline worker is not supported");return new Worker(t)}}}]);',null)}},function(e,t,r){"use strict";var n=window.URL||window.webkitURL;e.exports=function(e,t){try{try{var r;try{(r=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(e),r=r.getBlob()}catch(t){r=new Blob([e])}return new Worker(n.createObjectURL(r))}catch(t){return new Worker("data:application/javascript,"+encodeURIComponent(e))}}catch(e){if(!t)throw Error("Inline worker is not supported");return new Worker(t)}}}]);