mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-05 16:00:01 +01:00
1 line
1.6 MiB
1 line
1.6 MiB
require=function(){return function e(t,r,n){function i(o,a){if(!r[o]){if(!t[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){return i(t[o][1][e]||e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}}()({1:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("fs");r.FILE_SYSTEM_ADAPTER={lstat:n.lstat,stat:n.stat,lstatSync:n.lstatSync,statSync:n.statSync,readdir:n.readdir,readdirSync:n.readdirSync},r.createFileSystemAdapter=function(e){return e?Object.assign({},r.FILE_SYSTEM_ADAPTER,e):r.FILE_SYSTEM_ADAPTER}},{fs:298}],2:[function(e,t,r){(function(e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const t=e.versions.node.split("."),n=parseInt(t[0],10),i=parseInt(t[1],10);r.IS_SUPPORT_READDIR_WITH_FILE_TYPES=n>10||10===n&&i>=10}).call(this,e("_process"))},{_process:437}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./providers/async"),i=e("./providers/sync"),s=e("./settings");function o(e={}){return e instanceof s.default?e:new s.default(e)}r.Settings=s.default,r.scandir=function(e,t,r){if("function"==typeof t)return n.read(e,o(),t);n.read(e,o(t),r)},r.scandirSync=function(e,t){const r=o(t);return i.read(e,r)}},{"./providers/async":4,"./providers/sync":5,"./settings":6}],4:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("@nodelib/fs.stat"),i=e("run-parallel"),s=e("../constants"),o=e("../utils/index");function a(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(n,s)=>{if(n)return l(r,n);const a=s.map(r=>({dirent:r,name:r.name,path:`${e}${t.pathSegmentSeparator}${r.name}`}));if(!t.followSymbolicLinks)return c(r,a);const u=a.map(e=>(function(e,t){return r=>{if(!e.dirent.isSymbolicLink())return r(null,e);t.fs.stat(e.path,(n,i)=>n?t.throwErrorOnBrokenSymbolicLink?r(n):r(null,e):(e.dirent=o.fs.createDirentFromStats(e.name,i),r(null,e)))}})(e,t));i(u,(e,t)=>{if(e)return l(r,e);c(r,t)})})}function u(e,t,r){t.fs.readdir(e,(s,a)=>{if(s)return l(r,s);const u=a.map(r=>`${e}${t.pathSegmentSeparator}${r}`),h=u.map(e=>r=>n.stat(e,t.fsStatSettings,r));i(h,(e,n)=>{if(e)return l(r,e);const i=[];for(let e=0;e<a.length;e++){const r=a[e],s=n[e],l={name:r,path:u[e],dirent:o.fs.createDirentFromStats(r,s)};t.stats&&(l.stats=s),i.push(l)}c(r,i)})})}function l(e,t){e(t)}function c(e,t){e(null,t)}r.read=function(e,t,r){return!t.stats&&s.IS_SUPPORT_READDIR_WITH_FILE_TYPES?a(e,t,r):u(e,t,r)},r.readdirWithFileTypes=a,r.readdir=u},{"../constants":2,"../utils/index":8,"@nodelib/fs.stat":10,"run-parallel":494}],5:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("@nodelib/fs.stat"),i=e("../constants"),s=e("../utils/index");function o(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(r=>{const n={dirent:r,name:r.name,path:`${e}${t.pathSegmentSeparator}${r.name}`};if(n.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{const e=t.fs.statSync(n.path);n.dirent=s.fs.createDirentFromStats(n.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return n})}function a(e,t){return t.fs.readdirSync(e).map(r=>{const i=`${e}${t.pathSegmentSeparator}${r}`,o=n.statSync(i,t.fsStatSettings),a={name:r,path:i,dirent:s.fs.createDirentFromStats(r,o)};return t.stats&&(a.stats=o),a})}r.read=function(e,t){return!t.stats&&i.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):a(e,t)},r.readdirWithFileTypes=o,r.readdir=a},{"../constants":2,"../utils/index":8,"@nodelib/fs.stat":10}],6:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path"),i=e("@nodelib/fs.stat"),s=e("./adapters/fs");r.default=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=s.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,n.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new i.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return void 0===e?t:e}}},{"./adapters/fs":1,"@nodelib/fs.stat":10,path:404}],7:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});class n{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}}r.createDirentFromStats=function(e,t){return new n(e,t)}},{}],8:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./fs");r.fs=n},{"./fs":7}],9:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("fs");r.FILE_SYSTEM_ADAPTER={lstat:n.lstat,stat:n.stat,lstatSync:n.lstatSync,statSync:n.statSync},r.createFileSystemAdapter=function(e){return e?Object.assign({},r.FILE_SYSTEM_ADAPTER,e):r.FILE_SYSTEM_ADAPTER}},{fs:298}],10:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./providers/async"),i=e("./providers/sync"),s=e("./settings");function o(e={}){return e instanceof s.default?e:new s.default(e)}r.Settings=s.default,r.stat=function(e,t,r){if("function"==typeof t)return n.read(e,o(),t);n.read(e,o(t),r)},r.statSync=function(e,t){const r=o(t);return i.read(e,r)}},{"./providers/async":11,"./providers/sync":12,"./settings":13}],11:[function(e,t,r){"use strict";function n(e,t){e(t)}function i(e,t){e(null,t)}Object.defineProperty(r,"__esModule",{value:!0}),r.read=function(e,t,r){t.fs.lstat(e,(s,o)=>s?n(r,s):o.isSymbolicLink()&&t.followSymbolicLink?void t.fs.stat(e,(e,s)=>{if(e)return t.throwErrorOnBrokenSymbolicLink?n(r,e):i(r,o);t.markSymbolicLink&&(s.isSymbolicLink=(()=>!0)),i(r,s)}):i(r,o))}},{}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.read=function(e,t){const r=t.fs.lstatSync(e);if(!r.isSymbolicLink()||!t.followSymbolicLink)return r;try{const n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=(()=>!0)),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return r;throw e}}},{}],13:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./adapters/fs");r.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=n.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return void 0===e?t:e}}},{"./adapters/fs":9}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./providers/async"),i=e("./providers/stream"),s=e("./providers/sync"),o=e("./settings");function a(e={}){return e instanceof o.default?e:new o.default(e)}r.Settings=o.default,r.walk=function(e,t,r){if("function"==typeof t)return new n.default(e,a()).read(t);new n.default(e,a(t)).read(r)},r.walkSync=function(e,t){const r=a(t);return new s.default(e,r).read()},r.walkStream=function(e,t){const r=a(t);return new i.default(e,r).read()}},{"./providers/async":15,"./providers/stream":16,"./providers/sync":17,"./settings":22}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../readers/async");r.default=class{constructor(e,t){this._root=e,this._settings=t,this._reader=new n.default(this._root,this._settings),this._storage=new Set}read(e){this._reader.onError(t=>{!function(e,t){e(t)}(e,t)}),this._reader.onEntry(e=>{this._storage.add(e)}),this._reader.onEnd(()=>{!function(e,t){e(null,t)}(e,Array.from(this._storage))}),this._reader.read()}}},{"../readers/async":18}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("stream"),i=e("../readers/async");r.default=class{constructor(e,t){this._root=e,this._settings=t,this._reader=new i.default(this._root,this._settings),this._stream=new n.Readable({objectMode:!0,read:()=>{},destroy:this._reader.destroy.bind(this._reader)})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}}},{"../readers/async":18,stream:503}],17:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../readers/sync");r.default=class{constructor(e,t){this._root=e,this._settings=t,this._reader=new n.default(this._root,this._settings)}read(){return this._reader.read()}}},{"../readers/sync":21}],18:[function(e,t,r){(function(t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("events"),i=e("@nodelib/fs.scandir"),s=e("fastq"),o=e("./common"),a=e("./reader");r.default=class extends a.default{constructor(e,t){super(e,t),this._settings=t,this._scandir=i.scandir,this._emitter=new n.EventEmitter,this._queue=s(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=(()=>{this._isFatalError||this._emitter.emit("end")})}read(){return this._isFatalError=!1,this._isDestroyed=!1,t(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,t){const r={dir:e,base:t};this._queue.push(r,e=>{e&&this._handleError(e)})}_worker(e,t){this._scandir(e.dir,this._settings.fsScandirSettings,(r,n)=>{if(r)return t(r,void 0);for(const t of n)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){o.isFatalError(this._settings,e)&&(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;const r=e.path;void 0!==t&&(e.path=o.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),o.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&o.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,e.path)}_emitEntry(e){this._emitter.emit("entry",e)}}}).call(this,e("timers").setImmediate)},{"./common":19,"./reader":20,"@nodelib/fs.scandir":3,events:300,fastq:106,timers:514}],19:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isFatalError=function(e,t){return null===e.errorFilter||!e.errorFilter(t)},r.isAppliedFilter=function(e,t){return null===e||e(t)},r.replacePathSegmentSeparator=function(e,t){return e.split(/[\\\/]/).join(t)},r.joinPathSegments=function(e,t,r){return""===e?t:e+r+t}},{}],20:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./common");r.default=class{constructor(e,t){this._root=e,this._settings=t,this._root=n.replacePathSegmentSeparator(e,t.pathSegmentSeparator)}}},{"./common":19}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("@nodelib/fs.scandir"),i=e("./common"),s=e("./reader");r.default=class extends s.default{constructor(){super(...arguments),this._scandir=n.scandirSync,this._storage=new Set,this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),Array.from(this._storage)}_pushToQueue(e,t){this._queue.add({dir:e,base:t})}_handleQueue(){for(const e of this._queue.values())this._handleDirectory(e.dir,e.base)}_handleDirectory(e,t){try{const r=this._scandir(e,this._settings.fsScandirSettings);for(const e of r)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(i.isFatalError(this._settings,e))throw e}_handleEntry(e,t){const r=e.path;void 0!==t&&(e.path=i.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),i.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&i.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,e.path)}_pushToStorage(e){this._storage.add(e)}}},{"./common":19,"./reader":20,"@nodelib/fs.scandir":3}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path"),i=e("@nodelib/fs.scandir");r.default=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,n.sep),this.fsScandirSettings=new i.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return void 0===e?t:e}}},{"@nodelib/fs.scandir":3,path:404}],23:[function(e,t,r){var n,i;n=this,i=function(e){"use strict";var t={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},r="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",n={5:r,"5module":r+" export import",6:r+" const class extends export import super"},i=/^in(stanceof)?$/,s="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࢠ-ࢴࢶ-ࣇऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-鿼ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞿꟂ-ꟊꟵ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",o="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿᫀᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷹᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",a=new RegExp("["+s+"]"),u=new RegExp("["+s+o+"]");s=o=null;var l=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,107,20,28,22,13,52,76,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,190,0,80,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8952,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42717,35,4148,12,221,3,5761,15,7472,3104,541,1507,4938],c=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,154,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,4759,9,787719,239];function h(e,t){for(var r=65536,n=0;n<t.length;n+=2){if((r+=t[n])>e)return!1;if((r+=t[n+1])>=e)return!0}}function p(e,t){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&a.test(String.fromCharCode(e)):!1!==t&&h(e,l)))}function f(e,t){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&u.test(String.fromCharCode(e)):!1!==t&&(h(e,l)||h(e,c)))))}var d=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function m(e,t){return new d(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},v={startsExpr:!0},y={};function _(e,t){return void 0===t&&(t={}),t.keyword=e,y[e]=new d(e,t)}var b={num:new d("num",v),regexp:new d("regexp",v),string:new d("string",v),name:new d("name",v),eof:new d("eof"),bracketL:new d("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new d("]"),braceL:new d("{",{beforeExpr:!0,startsExpr:!0}),braceR:new d("}"),parenL:new d("(",{beforeExpr:!0,startsExpr:!0}),parenR:new d(")"),comma:new d(",",g),semi:new d(";",g),colon:new d(":",g),dot:new d("."),question:new d("?",g),questionDot:new d("?."),arrow:new d("=>",g),template:new d("template"),invalidTemplate:new d("invalidTemplate"),ellipsis:new d("...",g),backQuote:new d("`",v),dollarBraceL:new d("${",{beforeExpr:!0,startsExpr:!0}),eq:new d("=",{beforeExpr:!0,isAssign:!0}),assign:new d("_=",{beforeExpr:!0,isAssign:!0}),incDec:new d("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new d("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:m("||",1),logicalAND:m("&&",2),bitwiseOR:m("|",3),bitwiseXOR:m("^",4),bitwiseAND:m("&",5),equality:m("==/!=/===/!==",6),relational:m("</>/<=/>=",7),bitShift:m("<</>>/>>>",8),plusMin:new d("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:m("%",10),star:m("*",10),slash:m("/",10),starstar:new d("**",{beforeExpr:!0}),coalesce:m("??",1),_break:_("break"),_case:_("case",g),_catch:_("catch"),_continue:_("continue"),_debugger:_("debugger"),_default:_("default",g),_do:_("do",{isLoop:!0,beforeExpr:!0}),_else:_("else",g),_finally:_("finally"),_for:_("for",{isLoop:!0}),_function:_("function",v),_if:_("if"),_return:_("return",g),_switch:_("switch"),_throw:_("throw",g),_try:_("try"),_var:_("var"),_const:_("const"),_while:_("while",{isLoop:!0}),_with:_("with"),_new:_("new",{beforeExpr:!0,startsExpr:!0}),_this:_("this",v),_super:_("super",v),_class:_("class",v),_extends:_("extends",g),_export:_("export"),_import:_("import",v),_null:_("null",v),_true:_("true",v),_false:_("false",v),_in:_("in",{beforeExpr:!0,binop:7}),_instanceof:_("instanceof",{beforeExpr:!0,binop:7}),_typeof:_("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:_("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:_("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,w=new RegExp(x.source,"g");function E(e,t){return 10===e||13===e||!t&&(8232===e||8233===e)}var T=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,A=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,S=Object.prototype,k=S.hasOwnProperty,C=S.toString;function I(e,t){return k.call(e,t)}var R=Array.isArray||function(e){return"[object Array]"===C.call(e)};function L(e){return new RegExp("^(?:"+e.replace(/ /g,"|")+")$")}var O=function(e,t){this.line=e,this.column=t};O.prototype.offset=function(e){return new O(this.line,this.column+e)};var M=function(e,t,r){this.start=t,this.end=r,null!==e.sourceFile&&(this.source=e.sourceFile)};function P(e,t){for(var r=1,n=0;;){w.lastIndex=n;var i=w.exec(e);if(!(i&&i.index<t))return new O(r,t-n);++r,n=i.index+i[0].length}}var B={ecmaVersion:10,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1};function N(e){var t={};for(var r in B)t[r]=e&&I(e,r)?e[r]:B[r];if(t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),R(t.onToken)){var n=t.onToken;t.onToken=function(e){return n.push(e)}}return R(t.onComment)&&(t.onComment=function(e,t){return function(r,n,i,s,o,a){var u={type:r?"Block":"Line",value:n,start:i,end:s};e.locations&&(u.loc=new M(this,o,a)),e.ranges&&(u.range=[i,s]),t.push(u)}}(t,t.onComment)),t}var D=2,F=1|D,j=4,U=8;function $(e,t){return D|(e?j:0)|(t?U:0)}var V=function(e,r,i){this.options=e=N(e),this.sourceFile=e.sourceFile,this.keywords=L(n[e.ecmaVersion>=6?6:"module"===e.sourceType?"5module":5]);var s="";if(!0!==e.allowReserved){for(var o=e.ecmaVersion;!(s=t[o]);o--);"module"===e.sourceType&&(s+=" await")}this.reservedWords=L(s);var a=(s?s+" ":"")+t.strict;this.reservedWordsStrict=L(a),this.reservedWordsStrictBind=L(a+" "+t.strictBind),this.input=String(r),this.containsEsc=!1,i?(this.pos=i,this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(x).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===e.sourceType,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports={},0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(1),this.regexpState=null},G={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0}};V.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},G.inFunction.get=function(){return(this.currentVarScope().flags&D)>0},G.inGenerator.get=function(){return(this.currentVarScope().flags&U)>0},G.inAsync.get=function(){return(this.currentVarScope().flags&j)>0},G.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0},G.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},G.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},V.prototype.inNonArrowFunction=function(){return(this.currentThisScope().flags&D)>0},V.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r=this,n=0;n<e.length;n++)r=e[n](r);return r},V.parse=function(e,t){return new this(t,e).parse()},V.parseExpressionAt=function(e,t,r){var n=new this(r,e,t);return n.nextToken(),n.parseExpression()},V.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(V.prototype,G);var z=V.prototype,W=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;function H(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1}z.strictDirective=function(e){for(;;){A.lastIndex=e,e+=A.exec(this.input)[0].length;var t=W.exec(this.input.slice(e));if(!t)return!1;if("use strict"===(t[1]||t[2])){A.lastIndex=e+t[0].length;var r=A.exec(this.input),n=r.index+r[0].length,i=this.input.charAt(n);return";"===i||"}"===i||x.test(r[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||"!"===i&&"="===this.input.charAt(n+1))}e+=t[0].length,A.lastIndex=e,e+=A.exec(this.input)[0].length,";"===this.input[e]&&e++}},z.eat=function(e){return this.type===e&&(this.next(),!0)},z.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},z.eatContextual=function(e){return!!this.isContextual(e)&&(this.next(),!0)},z.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},z.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},z.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},z.semicolon=function(){this.eat(b.semi)||this.insertSemicolon()||this.unexpected()},z.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},z.expect=function(e){this.eat(e)||this.unexpected()},z.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")},z.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var r=t?e.parenthesizedAssign:e.parenthesizedBind;r>-1&&this.raiseRecoverable(r,"Parenthesized pattern")}},z.checkExpressionErrors=function(e,t){if(!e)return!1;var r=e.shorthandAssign,n=e.doubleProto;if(!t)return r>=0||n>=0;r>=0&&this.raise(r,"Shorthand property assignments are valid only in destructuring patterns"),n>=0&&this.raiseRecoverable(n,"Redefinition of __proto__ property")},z.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},z.isSimpleAssignTarget=function(e){return"ParenthesizedExpression"===e.type?this.isSimpleAssignTarget(e.expression):"Identifier"===e.type||"MemberExpression"===e.type};var K=V.prototype;K.parseTopLevel=function(e){var t={};for(e.body||(e.body=[]);this.type!==b.eof;){var r=this.parseStatement(null,!0,t);e.body.push(r)}if(this.inModule)for(var n=0,i=Object.keys(this.undefinedExports);n<i.length;n+=1){var s=i[n];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var q={kind:"loop"},X={kind:"switch"};K.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;A.lastIndex=this.pos;var t=A.exec(this.input),r=this.pos+t[0].length,n=this.input.charCodeAt(r);if(91===n)return!0;if(e)return!1;if(123===n)return!0;if(p(n,!0)){for(var s=r+1;f(this.input.charCodeAt(s),!0);)++s;var o=this.input.slice(r,s);if(!i.test(o))return!0}return!1},K.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;A.lastIndex=this.pos;var e=A.exec(this.input),t=this.pos+e[0].length;return!(x.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!==this.input.length&&f(this.input.charAt(t+8)))},K.parseStatement=function(e,t,r){var n,i=this.type,s=this.startNode();switch(this.isLet(e)&&(i=b._var,n="let"),i){case b._break:case b._continue:return this.parseBreakContinueStatement(s,i.keyword);case b._debugger:return this.parseDebuggerStatement(s);case b._do:return this.parseDoStatement(s);case b._for:return this.parseForStatement(s);case b._function:return e&&(this.strict||"if"!==e&&"label"!==e)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(s,!0);case b._if:return this.parseIfStatement(s);case b._return:return this.parseReturnStatement(s);case b._switch:return this.parseSwitchStatement(s);case b._throw:return this.parseThrowStatement(s);case b._try:return this.parseTryStatement(s);case b._const:case b._var:return n=n||this.value,e&&"var"!==n&&this.unexpected(),this.parseVarStatement(s,n);case b._while:return this.parseWhileStatement(s);case b._with:return this.parseWithStatement(s);case b.braceL:return this.parseBlock(!0,s);case b.semi:return this.parseEmptyStatement(s);case b._export:case b._import:if(this.options.ecmaVersion>10&&i===b._import){A.lastIndex=this.pos;var o=A.exec(this.input),a=this.pos+o[0].length,u=this.input.charCodeAt(a);if(40===u||46===u)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===b._import?this.parseImport(s):this.parseExport(s,r);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!e);var l=this.value,c=this.parseExpression();return i===b.name&&"Identifier"===c.type&&this.eat(b.colon)?this.parseLabeledStatement(s,l,c,e):this.parseExpressionStatement(s,c)}},K.parseBreakContinueStatement=function(e,t){var r="break"===t;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type!==b.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var n=0;n<this.labels.length;++n){var i=this.labels[n];if(null==e.label||i.name===e.label.name){if(null!=i.kind&&(r||"loop"===i.kind))break;if(e.label&&r)break}}return n===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,r?"BreakStatement":"ContinueStatement")},K.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")},K.parseDoStatement=function(e){return this.next(),this.labels.push(q),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(b._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},K.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction)&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(q),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var r=this.isLet();if(this.type===b._var||this.type===b._const||r){var n=this.startNode(),i=r?"let":this.value;return this.next(),this.parseVar(n,!0,i),this.finishNode(n,"VariableDeclaration"),(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===n.declarations.length?(this.options.ecmaVersion>=9&&(this.type===b._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,n)):(t>-1&&this.unexpected(t),this.parseFor(e,n))}var s=new H,o=this.parseExpression(!0,s);return this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.options.ecmaVersion>=9&&(this.type===b._in?t>-1&&this.unexpected(t):e.await=t>-1),this.toAssignable(o,!1,s),this.checkLVal(o),this.parseForIn(e,o)):(this.checkExpressionErrors(s,!0),t>-1&&this.unexpected(t),this.parseFor(e,o))},K.parseFunctionStatement=function(e,t,r){return this.next(),this.parseFunction(e,Z|(r?0:J),!1,t)},K.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(b._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")},K.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},K.parseSwitchStatement=function(e){var t;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(X),this.enterScope(0);for(var r=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var n=this.type===b._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),n?t.test=this.parseExpression():(r&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),r=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},K.parseThrowStatement=function(e){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Y=[];K.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();if(this.next(),this.eat(b.parenL)){t.param=this.parseBindingAtom();var r="Identifier"===t.param.type;this.enterScope(r?32:0),this.checkLVal(t.param,r?4:2),this.expect(b.parenR)}else this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0);t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},K.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},K.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(q),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")},K.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")},K.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},K.parseLabeledStatement=function(e,t,r,n){for(var i=0,s=this.labels;i<s.length;i+=1){s[i].name===t&&this.raise(r.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===b._switch?"switch":null,a=this.labels.length-1;a>=0;a--){var u=this.labels[a];if(u.statementStart!==e.start)break;u.statementStart=this.start,u.kind=o}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(n?-1===n.indexOf("label")?n+"label":n:"label"),this.labels.pop(),e.label=r,this.finishNode(e,"LabeledStatement")},K.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},K.parseBlock=function(e,t,r){for(void 0===e&&(e=!0),void 0===t&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var n=this.parseStatement(null);t.body.push(n)}return r&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")},K.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")},K.parseForIn=function(e,t){var r=this.type===b._in;return this.next(),"VariableDeclaration"===t.type&&null!=t.declarations[0].init&&(!r||this.options.ecmaVersion<8||this.strict||"var"!==t.kind||"Identifier"!==t.declarations[0].id.type)?this.raise(t.start,(r?"for-in":"for-of")+" loop variable declaration may not have an initializer"):"AssignmentPattern"===t.type&&this.raise(t.start,"Invalid left-hand side in for-loop"),e.left=t,e.right=r?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,r?"ForInStatement":"ForOfStatement")},K.parseVar=function(e,t,r){for(e.declarations=[],e.kind=r;;){var n=this.startNode();if(this.parseVarId(n,r),this.eat(b.eq)?n.init=this.parseMaybeAssign(t):"const"!==r||this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual("of")?"Identifier"===n.id.type||t&&(this.type===b._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(b.comma))break}return e},K.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLVal(e.id,"var"===t?1:2,!1)};var Z=1,J=2;K.parseFunction=function(e,t,r,n){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!n)&&(this.type===b.star&&t&J&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!n),t&Z&&(e.id=4&t&&this.type!==b.name?null:this.parseIdent(),!e.id||t&J||this.checkLVal(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?1:2:3));var i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope($(e.async,e.generator)),t&Z||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,r,!1),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(e,t&Z?"FunctionDeclaration":"FunctionExpression")},K.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},K.parseClass=function(e,t){this.next();var r=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var n=this.startNode(),i=!1;for(n.body=[],this.expect(b.braceL);this.type!==b.braceR;){var s=this.parseClassElement(null!==e.superClass);s&&(n.body.push(s),"MethodDefinition"===s.type&&"constructor"===s.kind&&(i&&this.raise(s.start,"Duplicate constructor in the same class"),i=!0))}return this.strict=r,this.next(),e.body=this.finishNode(n,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},K.parseClassElement=function(e){var t=this;if(this.eat(b.semi))return null;var r=this.startNode(),n=function(e,n){void 0===n&&(n=!1);var i=t.start,s=t.startLoc;return!!t.eatContextual(e)&&(!(t.type===b.parenL||n&&t.canInsertSemicolon())||(r.key&&t.unexpected(),r.computed=!1,r.key=t.startNodeAt(i,s),r.key.name=e,t.finishNode(r.key,"Identifier"),!1))};r.kind="method",r.static=n("static");var i=this.eat(b.star),s=!1;i||(this.options.ecmaVersion>=8&&n("async",!0)?(s=!0,i=this.options.ecmaVersion>=9&&this.eat(b.star)):n("get")?r.kind="get":n("set")&&(r.kind="set")),r.key||this.parsePropertyName(r);var o=r.key,a=!1;return r.computed||r.static||!("Identifier"===o.type&&"constructor"===o.name||"Literal"===o.type&&"constructor"===o.value)?r.static&&"Identifier"===o.type&&"prototype"===o.name&&this.raise(o.start,"Classes may not have a static property named prototype"):("method"!==r.kind&&this.raise(o.start,"Constructor can't have get/set modifier"),i&&this.raise(o.start,"Constructor can't be a generator"),s&&this.raise(o.start,"Constructor can't be an async method"),r.kind="constructor",a=e),this.parseClassMethod(r,i,s,a),"get"===r.kind&&0!==r.value.params.length&&this.raiseRecoverable(r.value.start,"getter should have no params"),"set"===r.kind&&1!==r.value.params.length&&this.raiseRecoverable(r.value.start,"setter should have exactly one param"),"set"===r.kind&&"RestElement"===r.value.params[0].type&&this.raiseRecoverable(r.value.params[0].start,"Setter cannot use rest params"),r},K.parseClassMethod=function(e,t,r,n){return e.value=this.parseMethod(t,r,n),this.finishNode(e,"MethodDefinition")},K.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLVal(e.id,2,!1)):(!0===t&&this.unexpected(),e.id=null)},K.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts():null},K.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseIdent(!0),this.checkExport(t,e.exported.name,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(b._default)){var r;if(this.checkExport(t,"default",this.lastTokStart),this.type===b._function||(r=this.isAsyncFunction())){var n=this.startNode();this.next(),r&&this.next(),e.declaration=this.parseFunction(n,4|Z,!1,r)}else if(this.type===b._class){var i=this.startNode();e.declaration=this.parseClass(i,"nullableID")}else e.declaration=this.parseMaybeAssign(),this.semicolon();return this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(null),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var s=0,o=e.specifiers;s<o.length;s+=1){var a=o[s];this.checkUnreserved(a.local),this.checkLocalExport(a.local)}e.source=null}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")},K.checkExport=function(e,t,r){e&&(I(e,t)&&this.raiseRecoverable(r,"Duplicate export '"+t+"'"),e[t]=!0)},K.checkPatternExport=function(e,t){var r=t.type;if("Identifier"===r)this.checkExport(e,t.name,t.start);else if("ObjectPattern"===r)for(var n=0,i=t.properties;n<i.length;n+=1){var s=i[n];this.checkPatternExport(e,s)}else if("ArrayPattern"===r)for(var o=0,a=t.elements;o<a.length;o+=1){var u=a[o];u&&this.checkPatternExport(e,u)}else"Property"===r?this.checkPatternExport(e,t.value):"AssignmentPattern"===r?this.checkPatternExport(e,t.left):"RestElement"===r?this.checkPatternExport(e,t.argument):"ParenthesizedExpression"===r&&this.checkPatternExport(e,t.expression)},K.checkVariableExport=function(e,t){if(e)for(var r=0,n=t;r<n.length;r+=1){var i=n[r];this.checkPatternExport(e,i.id)}},K.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},K.parseExportSpecifiers=function(e){var t=[],r=!0;for(this.expect(b.braceL);!this.eat(b.braceR);){if(r)r=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var n=this.startNode();n.local=this.parseIdent(!0),n.exported=this.eatContextual("as")?this.parseIdent(!0):n.local,this.checkExport(e,n.exported.name,n.exported.start),t.push(this.finishNode(n,"ExportSpecifier"))}return t},K.parseImport=function(e){return this.next(),this.type===b.string?(e.specifiers=Y,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===b.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},K.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===b.name){var r=this.startNode();if(r.local=this.parseIdent(),this.checkLVal(r.local,2),e.push(this.finishNode(r,"ImportDefaultSpecifier")),!this.eat(b.comma))return e}if(this.type===b.star){var n=this.startNode();return this.next(),this.expectContextual("as"),n.local=this.parseIdent(),this.checkLVal(n.local,2),e.push(this.finishNode(n,"ImportNamespaceSpecifier")),e}for(this.expect(b.braceL);!this.eat(b.braceR);){if(t)t=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var i=this.startNode();i.imported=this.parseIdent(!0),this.eatContextual("as")?i.local=this.parseIdent():(this.checkUnreserved(i.imported),i.local=i.imported),this.checkLVal(i.local,2),e.push(this.finishNode(i,"ImportSpecifier"))}return e},K.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},K.isDirectiveCandidate=function(e){return"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"string"==typeof e.expression.value&&('"'===this.input[e.start]||"'"===this.input[e.start])};var Q=V.prototype;Q.toAssignable=function(e,t,r){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",r&&this.checkPatternErrors(r,!0);for(var n=0,i=e.properties;n<i.length;n+=1){var s=i[n];this.toAssignable(s,t),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==e.kind&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",r&&this.checkPatternErrors(r,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),"AssignmentPattern"===e.argument.type&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==e.operator&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);case"AssignmentPattern":break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,r);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else r&&this.checkPatternErrors(r,!0);return e},Q.toAssignableList=function(e,t){for(var r=e.length,n=0;n<r;n++){var i=e[n];i&&this.toAssignable(i,t)}if(r){var s=e[r-1];6===this.options.ecmaVersion&&t&&s&&"RestElement"===s.type&&"Identifier"!==s.argument.type&&this.unexpected(s.argument.start)}return e},Q.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")},Q.parseRestBinding=function(){var e=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==b.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")},Q.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case b.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(b.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case b.braceL:return this.parseObj(!0)}return this.parseIdent()},Q.parseBindingList=function(e,t,r){for(var n=[],i=!0;!this.eat(e);)if(i?i=!1:this.expect(b.comma),t&&this.type===b.comma)n.push(null);else{if(r&&this.afterTrailingComma(e))break;if(this.type===b.ellipsis){var s=this.parseRestBinding();this.parseBindingListItem(s),n.push(s),this.type===b.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}var o=this.parseMaybeDefault(this.start,this.startLoc);this.parseBindingListItem(o),n.push(o)}return n},Q.parseBindingListItem=function(e){return e},Q.parseMaybeDefault=function(e,t,r){if(r=r||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(b.eq))return r;var n=this.startNodeAt(e,t);return n.left=r,n.right=this.parseMaybeAssign(),this.finishNode(n,"AssignmentPattern")},Q.checkLVal=function(e,t,r){switch(void 0===t&&(t=0),e.type){case"Identifier":2===t&&"let"===e.name&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(t?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(I(r,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),r[e.name]=!0),0!==t&&5!==t&&this.declareName(e.name,t,e.start);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":t&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ObjectPattern":for(var n=0,i=e.properties;n<i.length;n+=1){var s=i[n];this.checkLVal(s,t,r)}break;case"Property":this.checkLVal(e.value,t,r);break;case"ArrayPattern":for(var o=0,a=e.elements;o<a.length;o+=1){var u=a[o];u&&this.checkLVal(u,t,r)}break;case"AssignmentPattern":this.checkLVal(e.left,t,r);break;case"RestElement":this.checkLVal(e.argument,t,r);break;case"ParenthesizedExpression":this.checkLVal(e.expression,t,r);break;default:this.raise(e.start,(t?"Binding":"Assigning to")+" rvalue")}};var ee=V.prototype;ee.checkPropClash=function(e,t,r){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===e.type||this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var n,i=e.key;switch(i.type){case"Identifier":n=i.name;break;case"Literal":n=String(i.value);break;default:return}var s=e.kind;if(this.options.ecmaVersion>=6)"__proto__"===n&&"init"===s&&(t.proto&&(r?r.doubleProto<0&&(r.doubleProto=i.start):this.raiseRecoverable(i.start,"Redefinition of __proto__ property")),t.proto=!0);else{var o=t[n="$"+n];if(o)("init"===s?this.strict&&o.init||o.get||o.set:o.init||o[s])&&this.raiseRecoverable(i.start,"Redefinition of property");else o=t[n]={init:!1,get:!1,set:!1};o[s]=!0}}},ee.parseExpression=function(e,t){var r=this.start,n=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===b.comma){var s=this.startNodeAt(r,n);for(s.expressions=[i];this.eat(b.comma);)s.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(s,"SequenceExpression")}return i},ee.parseMaybeAssign=function(e,t,r){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var n=!1,i=-1,s=-1;t?(i=t.parenthesizedAssign,s=t.trailingComma,t.parenthesizedAssign=t.trailingComma=-1):(t=new H,n=!0);var o=this.start,a=this.startLoc;this.type!==b.parenL&&this.type!==b.name||(this.potentialArrowAt=this.start);var u=this.parseMaybeConditional(e,t);if(r&&(u=r.call(this,u,o,a)),this.type.isAssign){var l=this.startNodeAt(o,a);return l.operator=this.value,l.left=this.type===b.eq?this.toAssignable(u,!1,t):u,n||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.left.start&&(t.shorthandAssign=-1),this.checkLVal(u),this.next(),l.right=this.parseMaybeAssign(e),this.finishNode(l,"AssignmentExpression")}return n&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),s>-1&&(t.trailingComma=s),u},ee.parseMaybeConditional=function(e,t){var r=this.start,n=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(b.question)){var s=this.startNodeAt(r,n);return s.test=i,s.consequent=this.parseMaybeAssign(),this.expect(b.colon),s.alternate=this.parseMaybeAssign(e),this.finishNode(s,"ConditionalExpression")}return i},ee.parseExprOps=function(e,t){var r=this.start,n=this.startLoc,i=this.parseMaybeUnary(t,!1);return this.checkExpressionErrors(t)?i:i.start===r&&"ArrowFunctionExpression"===i.type?i:this.parseExprOp(i,r,n,-1,e)},ee.parseExprOp=function(e,t,r,n,i){var s=this.type.binop;if(null!=s&&(!i||this.type!==b._in)&&s>n){var o=this.type===b.logicalOR||this.type===b.logicalAND,a=this.type===b.coalesce;a&&(s=b.logicalAND.binop);var u=this.value;this.next();var l=this.start,c=this.startLoc,h=this.parseExprOp(this.parseMaybeUnary(null,!1),l,c,s,i),p=this.buildBinary(t,r,e,h,u,o||a);return(o&&this.type===b.coalesce||a&&(this.type===b.logicalOR||this.type===b.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(p,t,r,n,i)}return e},ee.buildBinary=function(e,t,r,n,i,s){var o=this.startNodeAt(e,t);return o.left=r,o.operator=i,o.right=n,this.finishNode(o,s?"LogicalExpression":"BinaryExpression")},ee.parseMaybeUnary=function(e,t){var r,n=this.start,i=this.startLoc;if(this.isContextual("await")&&(this.inAsync||!this.inFunction&&this.options.allowAwaitOutsideFunction))r=this.parseAwait(),t=!0;else if(this.type.prefix){var s=this.startNode(),o=this.type===b.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(e,!0),o?this.checkLVal(s.argument):this.strict&&"delete"===s.operator&&"Identifier"===s.argument.type?this.raiseRecoverable(s.start,"Deleting local variable in strict mode"):t=!0,r=this.finishNode(s,o?"UpdateExpression":"UnaryExpression")}else{if(r=this.parseExprSubscripts(e),this.checkExpressionErrors(e))return r;for(;this.type.postfix&&!this.canInsertSemicolon();){var a=this.startNodeAt(n,i);a.operator=this.value,a.prefix=!1,a.argument=r,this.checkLVal(r),this.next(),r=this.finishNode(a,"UpdateExpression")}}return!t&&this.eat(b.starstar)?this.buildBinary(n,i,r,this.parseMaybeUnary(null,!1),"**",!1):r},ee.parseExprSubscripts=function(e){var t=this.start,r=this.startLoc,n=this.parseExprAtom(e);if("ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return n;var i=this.parseSubscripts(n,t,r);return e&&"MemberExpression"===i.type&&(e.parenthesizedAssign>=i.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=i.start&&(e.parenthesizedBind=-1)),i},ee.parseSubscripts=function(e,t,r,n){for(var i=this.options.ecmaVersion>=8&&"Identifier"===e.type&&"async"===e.name&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start==5&&this.potentialArrowAt===e.start,s=!1;;){var o=this.parseSubscript(e,t,r,n,i,s);if(o.optional&&(s=!0),o===e||"ArrowFunctionExpression"===o.type){if(s){var a=this.startNodeAt(t,r);a.expression=o,o=this.finishNode(a,"ChainExpression")}return o}e=o}},ee.parseSubscript=function(e,t,r,n,i,s){var o=this.options.ecmaVersion>=11,a=o&&this.eat(b.questionDot);n&&a&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var u=this.eat(b.bracketL);if(u||a&&this.type!==b.parenL&&this.type!==b.backQuote||this.eat(b.dot)){var l=this.startNodeAt(t,r);l.object=e,l.property=u?this.parseExpression():this.parseIdent("never"!==this.options.allowReserved),l.computed=!!u,u&&this.expect(b.bracketR),o&&(l.optional=a),e=this.finishNode(l,"MemberExpression")}else if(!n&&this.eat(b.parenL)){var c=new H,h=this.yieldPos,p=this.awaitPos,f=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var d=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,c);if(i&&!a&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(c,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=h,this.awaitPos=p,this.awaitIdentPos=f,this.parseArrowExpression(this.startNodeAt(t,r),d,!0);this.checkExpressionErrors(c,!0),this.yieldPos=h||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=f||this.awaitIdentPos;var m=this.startNodeAt(t,r);m.callee=e,m.arguments=d,o&&(m.optional=a),e=this.finishNode(m,"CallExpression")}else if(this.type===b.backQuote){(a||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var g=this.startNodeAt(t,r);g.tag=e,g.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(g,"TaggedTemplateExpression")}return e},ee.parseExprAtom=function(e){this.type===b.slash&&this.readRegexp();var t,r=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),t=this.startNode(),this.next(),this.type!==b.parenL||this.allowDirectSuper||this.raise(t.start,"super() call outside constructor of a subclass"),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(t,"Super");case b._this:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case b.name:var n=this.start,i=this.startLoc,s=this.containsEsc,o=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(b._function))return this.parseFunction(this.startNodeAt(n,i),0,!1,!0);if(r&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(n,i),[o],!1);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===b.name&&!s)return o=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(b.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,i),[o],!0)}return o;case b.regexp:var a=this.value;return(t=this.parseLiteral(a.value)).regex={pattern:a.pattern,flags:a.flags},t;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return(t=this.startNode()).value=this.type===b._null?null:this.type===b._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case b.parenL:var u=this.start,l=this.parseParenAndDistinguishExpression(r);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(l)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),l;case b.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case b.braceL:return this.parseObj(!1,e);case b._function:return t=this.startNode(),this.next(),this.parseFunction(t,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport():this.unexpected();default:this.unexpected()}},ee.parseExprImport=function(){var e=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var t=this.parseIdent(!0);switch(this.type){case b.parenL:return this.parseDynamicImport(e);case b.dot:return e.meta=t,this.parseImportMeta(e);default:this.unexpected()}},ee.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")},ee.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),"meta"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),"module"!==this.options.sourceType&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")},ee.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),110===t.raw.charCodeAt(t.raw.length-1)&&(t.bigint=t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")},ee.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},ee.parseParenAndDistinguishExpression=function(e){var t,r=this.start,n=this.startLoc,i=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var s,o=this.start,a=this.startLoc,u=[],l=!0,c=!1,h=new H,p=this.yieldPos,f=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(l?l=!1:this.expect(b.comma),i&&this.afterTrailingComma(b.parenR,!0)){c=!0;break}if(this.type===b.ellipsis){s=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raise(this.start,"Comma is not permitted after the rest element");break}u.push(this.parseMaybeAssign(!1,h,this.parseParenItem))}var d=this.start,m=this.startLoc;if(this.expect(b.parenR),e&&!this.canInsertSemicolon()&&this.eat(b.arrow))return this.checkPatternErrors(h,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=f,this.parseParenArrowList(r,n,u);u.length&&!c||this.unexpected(this.lastTokStart),s&&this.unexpected(s),this.checkExpressionErrors(h,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=f||this.awaitPos,u.length>1?((t=this.startNodeAt(o,a)).expressions=u,this.finishNodeAt(t,"SequenceExpression",d,m)):t=u[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(r,n);return g.expression=t,this.finishNode(g,"ParenthesizedExpression")}return t},ee.parseParenItem=function(e){return e},ee.parseParenArrowList=function(e,t,r){return this.parseArrowExpression(this.startNodeAt(e,t),r)};var te=[];ee.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(b.dot)){e.meta=t;var r=this.containsEsc;return e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),r&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.inNonArrowFunction()||this.raiseRecoverable(e.start,"'new.target' can only be used in functions"),this.finishNode(e,"MetaProperty")}var n=this.start,i=this.startLoc,s=this.type===b._import;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,i,!0),s&&"ImportExpression"===e.callee.type&&this.raise(n,"Cannot use new with import()"),this.eat(b.parenL)?e.arguments=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):e.arguments=te,this.finishNode(e,"NewExpression")},ee.parseTemplateElement=function(e){var t=e.isTagged,r=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),r.value={raw:this.value,cooked:null}):r.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),r.tail=this.type===b.backQuote,this.finishNode(r,"TemplateElement")},ee.parseTemplate=function(e){void 0===e&&(e={});var t=e.isTagged;void 0===t&&(t=!1);var r=this.startNode();this.next(),r.expressions=[];var n=this.parseTemplateElement({isTagged:t});for(r.quasis=[n];!n.tail;)this.type===b.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(b.dollarBraceL),r.expressions.push(this.parseExpression()),this.expect(b.braceR),r.quasis.push(n=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(r,"TemplateLiteral")},ee.isAsyncProp=function(e){return!e.computed&&"Identifier"===e.key.type&&"async"===e.key.name&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!x.test(this.input.slice(this.lastTokEnd,this.start))},ee.parseObj=function(e,t){var r=this.startNode(),n=!0,i={};for(r.properties=[],this.next();!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(b.braceR))break;var s=this.parseProperty(e,t);e||this.checkPropClash(s,i,t),r.properties.push(s)}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")},ee.parseProperty=function(e,t){var r,n,i,s,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return e?(o.argument=this.parseIdent(!1),this.type===b.comma&&this.raise(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(this.type===b.parenL&&t&&(t.parenthesizedAssign<0&&(t.parenthesizedAssign=this.start),t.parenthesizedBind<0&&(t.parenthesizedBind=this.start)),o.argument=this.parseMaybeAssign(!1,t),this.type===b.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(e||t)&&(i=this.start,s=this.startLoc),e||(r=this.eat(b.star)));var a=this.containsEsc;return this.parsePropertyName(o),!e&&!a&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(o)?(n=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(o,t)):n=!1,this.parsePropertyValue(o,e,r,n,i,s,t,a),this.finishNode(o,"Property")},ee.parsePropertyValue=function(e,t,r,n,i,s,o,a){if((r||n)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===b.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(r,n);else if(t||a||!(this.options.ecmaVersion>=5)||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.type===b.comma||this.type===b.braceR||this.type===b.eq)this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((r||n)&&this.unexpected(),this.checkUnreserved(e.key),"await"!==e.key.name||this.awaitIdentPos||(this.awaitIdentPos=i),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,e.key):this.type===b.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected();else{(r||n)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var u="get"===e.kind?0:1;if(e.value.params.length!==u){var l=e.value.start;"get"===e.kind?this.raiseRecoverable(l,"getter should have no params"):this.raiseRecoverable(l,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}},ee.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},ee.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},ee.parseMethod=function(e,t,r){var n=this.startNode(),i=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|$(t,n.generator)|(r?128:0)),this.expect(b.parenL),n.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1,!0),this.yieldPos=i,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(n,"FunctionExpression")},ee.parseArrowExpression=function(e,t,r){var n=this.yieldPos,i=this.awaitPos,s=this.awaitIdentPos;return this.enterScope(16|$(r,!1)),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!r),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1),this.yieldPos=n,this.awaitPos=i,this.awaitIdentPos=s,this.finishNode(e,"ArrowFunctionExpression")},ee.parseFunctionBody=function(e,t,r){var n=t&&this.type!==b.braceL,i=this.strict,s=!1;if(n)e.body=this.parseMaybeAssign(),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);i&&!o||(s=this.strictDirective(this.end))&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list");var a=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(e,!i&&!s&&!t&&!r&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLVal(e.id,5),e.body=this.parseBlock(!1,void 0,s&&!i),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=a}this.exitScope()},ee.isSimpleParamList=function(e){for(var t=0,r=e;t<r.length;t+=1){if("Identifier"!==r[t].type)return!1}return!0},ee.checkParams=function(e,t){for(var r={},n=0,i=e.params;n<i.length;n+=1){var s=i[n];this.checkLVal(s,1,t?null:r)}},ee.parseExprList=function(e,t,r,n){for(var i=[],s=!0;!this.eat(e);){if(s)s=!1;else if(this.expect(b.comma),t&&this.afterTrailingComma(e))break;var o=void 0;r&&this.type===b.comma?o=null:this.type===b.ellipsis?(o=this.parseSpread(n),n&&this.type===b.comma&&n.trailingComma<0&&(n.trailingComma=this.start)):o=this.parseMaybeAssign(!1,n),i.push(o)}return i},ee.checkUnreserved=function(e){var t=e.start,r=e.end,n=e.name;(this.inGenerator&&"yield"===n&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===n&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.keywords.test(n)&&this.raise(t,"Unexpected keyword '"+n+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(t,r).indexOf("\\"))||(this.strict?this.reservedWordsStrict:this.reservedWords).test(n)&&(this.inAsync||"await"!==n||this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+n+"' is reserved"))},ee.parseIdent=function(e,t){var r=this.startNode();return this.type===b.name?r.name=this.value:this.type.keyword?(r.name=this.type.keyword,"class"!==r.name&&"function"!==r.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop()):this.unexpected(),this.next(!!e),this.finishNode(r,"Identifier"),e||(this.checkUnreserved(r),"await"!==r.name||this.awaitIdentPos||(this.awaitIdentPos=r.start)),r},ee.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===b.semi||this.canInsertSemicolon()||this.type!==b.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(b.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")},ee.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!1),this.finishNode(e,"AwaitExpression")};var re=V.prototype;re.raise=function(e,t){var r=P(this.input,e);t+=" ("+r.line+":"+r.column+")";var n=new SyntaxError(t);throw n.pos=e,n.loc=r,n.raisedAt=this.pos,n},re.raiseRecoverable=re.raise,re.curPosition=function(){if(this.options.locations)return new O(this.curLine,this.pos-this.lineStart)};var ne=V.prototype;ne.enterScope=function(e){this.scopeStack.push(new function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]}(e))},ne.exitScope=function(){this.scopeStack.pop()},ne.treatFunctionsAsVarInScope=function(e){return e.flags&D||!this.inModule&&1&e.flags},ne.declareName=function(e,t,r){var n=!1;if(2===t){var i=this.currentScope();n=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&1&i.flags&&delete this.undefinedExports[e]}else if(4===t){this.currentScope().lexical.push(e)}else if(3===t){var s=this.currentScope();n=this.treatFunctionsAsVar?s.lexical.indexOf(e)>-1:s.lexical.indexOf(e)>-1||s.var.indexOf(e)>-1,s.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(e)>-1&&!(32&a.flags&&a.lexical[0]===e)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(e)>-1){n=!0;break}if(a.var.push(e),this.inModule&&1&a.flags&&delete this.undefinedExports[e],a.flags&F)break}n&&this.raiseRecoverable(r,"Identifier '"+e+"' has already been declared")},ne.checkLocalExport=function(e){-1===this.scopeStack[0].lexical.indexOf(e.name)&&-1===this.scopeStack[0].var.indexOf(e.name)&&(this.undefinedExports[e.name]=e)},ne.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},ne.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&F)return t}},ne.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&F&&!(16&t.flags))return t}};var ie=function(e,t,r){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new M(e,r)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},se=V.prototype;function oe(e,t,r,n){return e.type=t,e.end=r,this.options.locations&&(e.loc.end=n),this.options.ranges&&(e.range[1]=r),e}se.startNode=function(){return new ie(this,this.start,this.startLoc)},se.startNodeAt=function(e,t){return new ie(this,e,t)},se.finishNode=function(e,t){return oe.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},se.finishNodeAt=function(e,t,r,n){return oe.call(this,e,t,r,n)};var ae=function(e,t,r,n,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!r,this.override=n,this.generator=!!i},ue={b_stat:new ae("{",!1),b_expr:new ae("{",!0),b_tmpl:new ae("${",!1),p_stat:new ae("(",!1),p_expr:new ae("(",!0),q_tmpl:new ae("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new ae("function",!1),f_expr:new ae("function",!0),f_expr_gen:new ae("function",!0,!1,null,!0),f_gen:new ae("function",!1,!1,null,!0)},le=V.prototype;le.initialContext=function(){return[ue.b_stat]},le.braceIsBlock=function(e){var t=this.curContext();return t===ue.f_expr||t===ue.f_stat||(e!==b.colon||t!==ue.b_stat&&t!==ue.b_expr?e===b._return||e===b.name&&this.exprAllowed?x.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow||(e===b.braceL?t===ue.b_stat:e!==b._var&&e!==b._const&&e!==b.name&&!this.exprAllowed):!t.isExpr)},le.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if("function"===t.token)return t.generator}return!1},le.updateContext=function(e){var t,r=this.type;r.keyword&&e===b.dot?this.exprAllowed=!1:(t=r.updateContext)?t.call(this,e):this.exprAllowed=r.beforeExpr},b.parenR.updateContext=b.braceR.updateContext=function(){if(1!==this.context.length){var e=this.context.pop();e===ue.b_stat&&"function"===this.curContext().token&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}else this.exprAllowed=!0},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ue.b_stat:ue.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(ue.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?ue.p_stat:ue.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){!e.beforeExpr||e===b.semi||e===b._else||e===b._return&&x.test(this.input.slice(this.lastTokEnd,this.start))||(e===b.colon||e===b.braceL)&&this.curContext()===ue.b_stat?this.context.push(ue.f_stat):this.context.push(ue.f_expr),this.exprAllowed=!1},b.backQuote.updateContext=function(){this.curContext()===ue.q_tmpl?this.context.pop():this.context.push(ue.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===ue.f_expr?this.context[t]=ue.f_expr_gen:this.context[t]=ue.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var ce="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",he=ce+" Extended_Pictographic",pe={9:ce,10:he,11:"ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS Extended_Pictographic"},fe="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",de="Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",me=de+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",ge={9:de,10:me,11:"Adlam Adlm Ahom Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho"},ve={};function ye(e){var t=ve[e]={binary:L(pe[e]+" "+fe),nonBinary:{General_Category:L(fe),Script:L(ge[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}ye(9),ye(10),ye(11);var _e=V.prototype,be=function(e){this.parser=e,this.validFlags="gim"+(e.options.ecmaVersion>=6?"uy":"")+(e.options.ecmaVersion>=9?"s":""),this.unicodeProperties=ve[e.options.ecmaVersion>=11?11:e.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};function xe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function we(e){return 36===e||e>=40&&e<=43||46===e||63===e||e>=91&&e<=94||e>=123&&e<=125}function Ee(e){return e>=65&&e<=90||e>=97&&e<=122}function Te(e){return Ee(e)||95===e}function Ae(e){return Te(e)||Se(e)}function Se(e){return e>=48&&e<=57}function ke(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ce(e){return e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:e-48}function Ie(e){return e>=48&&e<=55}be.prototype.reset=function(e,t,r){var n=-1!==r.indexOf("u");this.start=0|e,this.source=t+"",this.flags=r,this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchN=n&&this.parser.options.ecmaVersion>=9},be.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+e)},be.prototype.at=function(e,t){void 0===t&&(t=!1);var r=this.source,n=r.length;if(e>=n)return-1;var i=r.charCodeAt(e);if(!t&&!this.switchU||i<=55295||i>=57344||e+1>=n)return i;var s=r.charCodeAt(e+1);return s>=56320&&s<=57343?(i<<10)+s-56613888:i},be.prototype.nextIndex=function(e,t){void 0===t&&(t=!1);var r=this.source,n=r.length;if(e>=n)return n;var i,s=r.charCodeAt(e);return!t&&!this.switchU||s<=55295||s>=57344||e+1>=n||(i=r.charCodeAt(e+1))<56320||i>57343?e+1:e+2},be.prototype.current=function(e){return void 0===e&&(e=!1),this.at(this.pos,e)},be.prototype.lookahead=function(e){return void 0===e&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},be.prototype.advance=function(e){void 0===e&&(e=!1),this.pos=this.nextIndex(this.pos,e)},be.prototype.eat=function(e,t){return void 0===t&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},_e.validateRegExpFlags=function(e){for(var t=e.validFlags,r=e.flags,n=0;n<r.length;n++){var i=r.charAt(n);-1===t.indexOf(i)&&this.raise(e.start,"Invalid regular expression flag"),r.indexOf(i,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag")}},_e.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))},_e.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,r=e.backReferenceNames;t<r.length;t+=1){var n=r[t];-1===e.groupNames.indexOf(n)&&e.raise("Invalid named capture referenced")}},_e.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")},_e.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},_e.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):!(e.switchU?!this.regexp_eatAtom(e):!this.regexp_eatExtendedAtom(e))&&(this.regexp_eatQuantifier(e),!0)},_e.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var r=!1;if(this.options.ecmaVersion>=9&&(r=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!r,!0}return e.pos=t,!1},_e.regexp_eatQuantifier=function(e,t){return void 0===t&&(t=!1),!!this.regexp_eatQuantifierPrefix(e,t)&&(e.eat(63),!0)},_e.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},_e.regexp_eatBracedQuantifier=function(e,t){var r=e.pos;if(e.eat(123)){var n=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(n=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return-1!==i&&i<n&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=r}return!1},_e.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},_e.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},_e.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1},_e.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):63===e.current()&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1},_e.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},_e.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1},_e.regexp_eatSyntaxCharacter=function(e){var t=e.current();return!!we(t)&&(e.lastIntValue=t,e.advance(),!0)},_e.regexp_eatPatternCharacters=function(e){for(var t=e.pos,r=0;-1!==(r=e.current())&&!we(r);)e.advance();return e.pos!==t},_e.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return!(-1===t||36===t||t>=40&&t<=43||46===t||63===t||91===t||94===t||124===t)&&(e.advance(),!0)},_e.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e))return-1!==e.groupNames.indexOf(e.lastStringValue)&&e.raise("Duplicate capture group name"),void e.groupNames.push(e.lastStringValue);e.raise("Invalid group")}},_e.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1},_e.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=xe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=xe(e.lastIntValue);return!0}return!1},_e.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),function(e){return p(e,!0)||36===e||95===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},_e.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,r=this.options.ecmaVersion>=11,n=e.current(r);return e.advance(r),92===n&&this.regexp_eatRegExpUnicodeEscapeSequence(e,r)&&(n=e.lastIntValue),function(e){return f(e,!0)||36===e||95===e||8204===e||8205===e}(n)?(e.lastIntValue=n,!0):(e.pos=t,!1)},_e.regexp_eatAtomEscape=function(e){return!!(this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e))||(e.switchU&&(99===e.current()&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)},_e.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var r=e.lastIntValue;if(e.switchU)return r>e.maxBackReference&&(e.maxBackReference=r),!0;if(r<=e.numCapturingParens)return!0;e.pos=t}return!1},_e.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1},_e.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},_e.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},_e.regexp_eatZero=function(e){return 48===e.current()&&!Se(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},_e.regexp_eatControlEscape=function(e){var t=e.current();return 116===t?(e.lastIntValue=9,e.advance(),!0):110===t?(e.lastIntValue=10,e.advance(),!0):118===t?(e.lastIntValue=11,e.advance(),!0):102===t?(e.lastIntValue=12,e.advance(),!0):114===t&&(e.lastIntValue=13,e.advance(),!0)},_e.regexp_eatControlLetter=function(e){var t=e.current();return!!Ee(t)&&(e.lastIntValue=t%32,e.advance(),!0)},_e.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){void 0===t&&(t=!1);var r,n=e.pos,i=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(i&&s>=55296&&s<=56319){var o=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=1024*(s-55296)+(a-56320)+65536,!0}e.pos=o,e.lastIntValue=s}return!0}if(i&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&((r=e.lastIntValue)>=0&&r<=1114111))return!0;i&&e.raise("Invalid unicode escape"),e.pos=n}return!1},_e.regexp_eatIdentityEscape=function(e){if(e.switchU)return!!this.regexp_eatSyntaxCharacter(e)||!!e.eat(47)&&(e.lastIntValue=47,!0);var t=e.current();return!(99===t||e.switchN&&107===t)&&(e.lastIntValue=t,e.advance(),!0)},_e.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do{e.lastIntValue=10*e.lastIntValue+(t-48),e.advance()}while((t=e.current())>=48&&t<=57);return!0}return!1},_e.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(function(e){return 100===e||68===e||115===e||83===e||119===e||87===e}(t))return e.lastIntValue=-1,e.advance(),!0;if(e.switchU&&this.options.ecmaVersion>=9&&(80===t||112===t)){if(e.lastIntValue=-1,e.advance(),e.eat(123)&&this.regexp_eatUnicodePropertyValueExpression(e)&&e.eat(125))return!0;e.raise("Invalid property name")}return!1},_e.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var r=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var n=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,r,n),!0}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i),!0}return!1},_e.regexp_validateUnicodePropertyNameAndValue=function(e,t,r){I(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(r)||e.raise("Invalid property value")},_e.regexp_validateUnicodePropertyNameOrValue=function(e,t){e.unicodeProperties.binary.test(t)||e.raise("Invalid property name")},_e.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Te(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},_e.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ae(t=e.current());)e.lastStringValue+=xe(t),e.advance();return""!==e.lastStringValue},_e.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},_e.regexp_eatCharacterClass=function(e){if(e.eat(91)){if(e.eat(94),this.regexp_classRanges(e),e.eat(93))return!0;e.raise("Unterminated character class")}return!1},_e.regexp_classRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var r=e.lastIntValue;!e.switchU||-1!==t&&-1!==r||e.raise("Invalid character class"),-1!==t&&-1!==r&&t>r&&e.raise("Range out of order in character class")}}},_e.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var r=e.current();(99===r||Ie(r))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var n=e.current();return 93!==n&&(e.lastIntValue=n,e.advance(),!0)},_e.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},_e.regexp_eatClassControlLetter=function(e){var t=e.current();return!(!Se(t)&&95!==t)&&(e.lastIntValue=t%32,e.advance(),!0)},_e.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1},_e.regexp_eatDecimalDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;Se(r=e.current());)e.lastIntValue=10*e.lastIntValue+(r-48),e.advance();return e.pos!==t},_e.regexp_eatHexDigits=function(e){var t=e.pos,r=0;for(e.lastIntValue=0;ke(r=e.current());)e.lastIntValue=16*e.lastIntValue+Ce(r),e.advance();return e.pos!==t},_e.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var r=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=64*t+8*r+e.lastIntValue:e.lastIntValue=8*t+r}else e.lastIntValue=t;return!0}return!1},_e.regexp_eatOctalDigit=function(e){var t=e.current();return Ie(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)},_e.regexp_eatFixedHexDigits=function(e,t){var r=e.pos;e.lastIntValue=0;for(var n=0;n<t;++n){var i=e.current();if(!ke(i))return e.pos=r,!1;e.lastIntValue=16*e.lastIntValue+Ce(i),e.advance()}return!0};var Re=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new M(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Le=V.prototype;function Oe(e){return"function"!=typeof BigInt?null:BigInt(e.replace(/_/g,""))}function Me(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}Le.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Re(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Le.getToken=function(){return this.next(),new Re(this)},"undefined"!=typeof Symbol&&(Le[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),Le.curContext=function(){return this.context[this.context.length-1]},Le.nextToken=function(){var e=this.curContext();return e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(b.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},Le.readToken=function(e){return p(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},Le.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},Le.skipBlockComment=function(){var e,t=this.options.onComment&&this.curPosition(),r=this.pos,n=this.input.indexOf("*/",this.pos+=2);if(-1===n&&this.raise(this.pos-2,"Unterminated comment"),this.pos=n+2,this.options.locations)for(w.lastIndex=r;(e=w.exec(this.input))&&e.index<this.pos;)++this.curLine,this.lineStart=e.index+e[0].length;this.options.onComment&&this.options.onComment(!0,this.input.slice(r+2,n),r,this.pos,t,this.curPosition())},Le.skipLineComment=function(e){for(var t=this.pos,r=this.options.onComment&&this.curPosition(),n=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!E(n);)n=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,r,this.curPosition())},Le.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(!(e>8&&e<14||e>=5760&&T.test(String.fromCharCode(e))))break e;++this.pos}}},Le.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var r=this.type;this.type=e,this.value=t,this.updateContext(r)},Le.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},Le.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},Le.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),r=1,n=42===e?b.star:b.modulo;return this.options.ecmaVersion>=7&&42===e&&42===t&&(++r,n=b.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(b.assign,r+1):this.finishOp(n,r)},Le.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(b.assign,3);return this.finishOp(124===e?b.logicalOR:b.logicalAND,2)}return 61===t?this.finishOp(b.assign,2):this.finishOp(124===e?b.bitwiseOR:b.bitwiseAND,1)},Le.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},Le.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45!==t||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!x.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(b.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===t?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},Le.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),r=1;return t===e?(r=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+r)?this.finishOp(b.assign,r+1):this.finishOp(b.bitShift,r)):33!==t||60!==e||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===t&&(r=2),this.finishOp(b.relational,r)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},Le.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(b.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(61===e?b.eq:b.prefix,1)},Le.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(46===t){var r=this.input.charCodeAt(this.pos+2);if(r<48||r>57)return this.finishOp(b.questionDot,2)}if(63===t){if(e>=12)if(61===this.input.charCodeAt(this.pos+2))return this.finishOp(b.assign,3);return this.finishOp(b.coalesce,2)}}return this.finishOp(b.question,1)},Le.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(b.prefix,1)}this.raise(this.pos,"Unexpected character '"+Me(e)+"'")},Le.finishOp=function(e,t){var r=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,r)},Le.readRegexp=function(){for(var e,t,r=this.pos;;){this.pos>=this.input.length&&this.raise(r,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(x.test(n)&&this.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===n)t=!0;else if("]"===n&&t)t=!1;else if("/"===n&&!t)break;e="\\"===n}++this.pos}var i=this.input.slice(r,this.pos);++this.pos;var s=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(s);var a=this.regexpState||(this.regexpState=new be(this));a.reset(r,i,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var u=null;try{u=new RegExp(i,o)}catch(e){}return this.finishToken(b.regexp,{pattern:i,flags:o,value:u})},Le.readInt=function(e,t,r){for(var n=this.options.ecmaVersion>=12&&void 0===t,i=r&&48===this.input.charCodeAt(this.pos),s=this.pos,o=0,a=0,u=0,l=null==t?1/0:t;u<l;++u,++this.pos){var c=this.input.charCodeAt(this.pos),h=void 0;if(n&&95===c)i&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===a&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===u&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),a=c;else{if((h=c>=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0)>=e)break;a=c,o=o*e+h}}return n&&95===a&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||null!=t&&this.pos-s!==t?null:o},Le.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var r=this.readInt(e);return null==r&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(r=Oe(this.input.slice(t,this.pos)),++this.pos):p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,r)},Le.readNumber=function(e){var t=this.pos;e||null!==this.readInt(10,void 0,!0)||this.raise(t,"Invalid number");var r=this.pos-t>=2&&48===this.input.charCodeAt(t);r&&this.strict&&this.raise(t,"Invalid number");var n=this.input.charCodeAt(this.pos);if(!r&&!e&&this.options.ecmaVersion>=11&&110===n){var i=Oe(this.input.slice(t,this.pos));return++this.pos,p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(b.num,i)}r&&/[89]/.test(this.input.slice(t,this.pos))&&(r=!1),46!==n||r||(++this.pos,this.readInt(10),n=this.input.charCodeAt(this.pos)),69!==n&&101!==n||r||(43!==(n=this.input.charCodeAt(++this.pos))&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number")),p(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s,o=(s=this.input.slice(t,this.pos),r?parseInt(s,8):parseFloat(s.replace(/_/g,"")));return this.finishToken(b.num,o)},Le.readCodePoint=function(){var e;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var t=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.invalidStringToken(t,"Code point out of bounds")}else e=this.readHexChar(4);return e},Le.readString=function(e){for(var t="",r=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var n=this.input.charCodeAt(this.pos);if(n===e)break;92===n?(t+=this.input.slice(r,this.pos),t+=this.readEscapedChar(!1),r=this.pos):(E(n,this.options.ecmaVersion>=10)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(r,this.pos++),this.finishToken(b.string,t)};var Pe={};Le.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e!==Pe)throw e;this.readInvalidTemplateToken()}this.inTemplateElement=!1},Le.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Pe;this.raise(e,t)},Le.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var r=this.input.charCodeAt(this.pos);if(96===r||36===r&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==b.template&&this.type!==b.invalidTemplate?(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e)):36===r?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote));if(92===r)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(E(r)){switch(e+=this.input.slice(t,this.pos),++this.pos,r){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(r)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Le.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(b.invalidTemplate,this.input.slice(this.start,this.pos))}this.raise(this.start,"Unterminated template")},Le.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Me(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(e){var r=this.pos-1;return this.invalidStringToken(r,"Invalid escape sequence in template string"),null}default:if(t>=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(n,8);return i>255&&(n=n.slice(0,-1),i=parseInt(n,8)),this.pos+=n.length-1,t=this.input.charCodeAt(this.pos),"0"===n&&56!==t&&57!==t||!this.strict&&!e||this.invalidStringToken(this.pos-1-n.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(i)}return E(t)?"":String.fromCharCode(t)}},Le.readHexChar=function(e){var t=this.pos,r=this.readInt(16,e);return null===r&&this.invalidStringToken(t,"Bad character escape sequence"),r},Le.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,r=this.pos,n=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(f(i,n))this.pos+=i<=65535?1:2;else{if(92!==i)break;this.containsEsc=!0,e+=this.input.slice(r,this.pos);var s=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var o=this.readCodePoint();(t?p:f)(o,n)||this.invalidStringToken(s,"Invalid Unicode escape"),e+=Me(o),r=this.pos}t=!1}return e+this.input.slice(r,this.pos)},Le.readWord=function(){var e=this.readWord1(),t=b.name;return this.keywords.test(e)&&(t=y[e]),this.finishToken(t,e)};V.acorn={Parser:V,version:"7.4.1",defaultOptions:B,Position:O,SourceLocation:M,getLineInfo:P,Node:ie,TokenType:d,tokTypes:b,keywordTypes:y,TokContext:ae,tokContexts:ue,isIdentifierChar:f,isIdentifierStart:p,Token:Re,isNewLine:E,lineBreak:x,lineBreakG:w,nonASCIIwhitespace:T},e.Node=ie,e.Parser=V,e.Position=O,e.SourceLocation=M,e.TokContext=ae,e.Token=Re,e.TokenType=d,e.defaultOptions=B,e.getLineInfo=P,e.isIdentifierChar=f,e.isIdentifierStart=p,e.isNewLine=E,e.keywordTypes=y,e.lineBreak=x,e.lineBreakG=w,e.nonASCIIwhitespace=T,e.parse=function(e,t){return V.parse(e,t)},e.parseExpressionAt=function(e,t,r){return V.parseExpressionAt(e,t,r)},e.tokContexts=ue,e.tokTypes=b,e.tokenizer=function(e,t){return V.tokenizer(e,t)},e.version="7.4.1",Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?i(r):"function"==typeof define&&define.amd?define(["exports"],i):i((n=n||self).acorn={})},{}],24:[function(e,t,r){(function(r){var n=e("http"),i=e("utils-extend"),s=e("url"),o=e("path"),a=e("querystring"),u=e("file-system");function l(e,t){var o={headers:{"Content-Type":"application/json"},method:"GET",encoding:"utf8",isBuffer:!1,json:!1};i.isString(e)?o.url=e:i.extend(o,e),o.data&&("GET"===o.method?o.url+="?"+a.stringify(o.data):(o.data=JSON.stringify(o.data),o.headers["Content-Length"]=new r(o.data).length)),i.extend(o,i.pick(s.parse(o.url),"hostname","port","path","auth")),delete o.url;var u=n.request(o,function(e){var n=[],i=0;e.on("data",function(e){n.push(e),i+=e.length}),e.on("end",function(){var s="";if(o.isBuffer)s=r.concat(n,i);else{for(var a=new r(i),u=0,l=0,c=n.length;u<c;u++){var h=n[u];h.copy(a,l),l+=h.length}s=a.toString(o.encoding),o.json&&(s=JSON.parse(s))}t(null,e,s)})});u.on("error",t),"GET"!==o.method&&o.data&&u.write(o.data),u.end()}l.post=function(e,t){i.isString(e)&&(e={url:e}),e.method="POST",l(e,t)},l.download=function(e,t){var r=i.extend({rootPath:"",ignore:!1},e);l({url:r.url,isBuffer:!0},function(n,a,l){if(n)return t(n);if(200!==a.statusCode)return t(n,a,l);var c,h=s.parse(e.url).pathname.replace(/^\//,"");c=r.destPath?i.isFunction(r.destPath)?r.destPath(o.basename(h)):r.destPath:o.join(e.rootPath,h),r.ignore&&(c=c.toLowerCase()),u.writeFile(c,l,function(e){if(e)return t(e);t(null,a,l,c)})})},t.exports=l}).call(this,e("buffer").Buffer)},{buffer:299,"file-system":108,http:504,path:404,querystring:471,url:519,"utils-extend":524}],25:[function(e,t,r){"use strict";t.exports=((...e)=>[...new Set([].concat(...e))])},{}],26:[function(e,t,r){"use strict";function n(e,t,r){e instanceof RegExp&&(e=i(e,r)),t instanceof RegExp&&(t=i(t,r));var n=s(e,t,r);return n&&{start:n[0],end:n[1],pre:r.slice(0,n[0]),body:r.slice(n[0]+e.length,n[1]),post:r.slice(n[1]+t.length)}}function i(e,t){var r=t.match(e);return r?r[0]:null}function s(e,t,r){var n,i,s,o,a,u=r.indexOf(e),l=r.indexOf(t,u+1),c=u;if(u>=0&&l>0){for(n=[],s=r.length;c>=0&&!a;)c==u?(n.push(c),u=r.indexOf(e,c+1)):1==n.length?a=[n.pop(),l]:((i=n.pop())<s&&(s=i,o=l),l=r.indexOf(t,c+1)),c=u<l&&u>=0?u:l;n.length&&(a=[s,o])}return a}t.exports=n,n.range=s},{}],27:[function(e,t,r){var n=e("file-system"),i=e("path"),s=e("ajax-request");function o(e,t){var r=i.extname(e).substr(1);return"svg"===(r=r||"png")&&(r="svg+xml"),"data:image/"+r+";base64,"+t.toString("base64")}function a(e){var t=e.match(/^data:image\/([\w+]+);base64,([\s\S]+)/),r={jpeg:"jpg","svg+xml":"svg"};if(!t)throw new Error("image base64 data error");return{extname:"."+(r[t[1]]?r[t[1]]:t[1]),base64:t[2]}}r.base64=function(e,t){t||(t=util.noop),n.readFile(e,function(r,n){if(r)return t(r);t(null,o(e,n))})},r.base64Sync=function(e){return o(e,n.readFileSync(e))},r.requestBase64=function(e,t){s({url:e,isBuffer:!0},function(e,r,n){if(e)return t(e);var i="data:"+r.headers["content-type"]+";base64,"+n.toString("base64");t(e,r,i)})},r.img=function(e,t,r,s){var o=a(e),u=i.join(t,r+o.extname);n.writeFile(u,o.base64,{encoding:"base64"},function(e){s(e,u)})},r.imgSync=function(e,t,r){var s=a(e),o=i.join(t,r+s.extname);return n.writeFileSync(o,s.base64,{encoding:"base64"}),o}},{"ajax-request":24,"file-system":108,path:404}],28:[function(e,t,r){"use strict";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){for(var t,r=l(e),n=r[0],o=r[1],a=new s(function(e,t,r){return 3*(t+r)/4-r}(0,n,o)),u=0,c=o>0?n-4:n,h=0;h<c;h+=4)t=i[e.charCodeAt(h)]<<18|i[e.charCodeAt(h+1)]<<12|i[e.charCodeAt(h+2)]<<6|i[e.charCodeAt(h+3)],a[u++]=t>>16&255,a[u++]=t>>8&255,a[u++]=255&t;2===o&&(t=i[e.charCodeAt(h)]<<2|i[e.charCodeAt(h+1)]>>4,a[u++]=255&t);1===o&&(t=i[e.charCodeAt(h)]<<10|i[e.charCodeAt(h+1)]<<4|i[e.charCodeAt(h+2)]>>2,a[u++]=t>>8&255,a[u++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(c(e,o,o+16383>a?a:o+16383));1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=o.length;a<u;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,s,o=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],29:[function(e,t,r){"use strict";const n=e("fs"),i=e("path"),s=e("url"),o=e("pify"),a=e("import-lazy")(e),u=a("bin-check"),l=a("bin-version-check"),c=a("download"),h=a("os-filter-obj"),p=o(n.stat),f=o(n.chmod);t.exports=class{constructor(e={}){this.options=e,this.options.strip<=0?this.options.strip=0:this.options.strip||(this.options.strip=1)}src(e,t,r){return 0===arguments.length?this._src:(this._src=this._src||[],this._src.push({url:e,os:t,arch:r}),this)}dest(e){return 0===arguments.length?this._dest:(this._dest=e,this)}use(e){return 0===arguments.length?this._use:(this._use=e,this)}version(e){return 0===arguments.length?this._version:(this._version=e,this)}path(){return i.join(this.dest(),this.use())}run(e=["--version"]){return this.findExisting().then(()=>{if(!this.options.skipCheck)return this.runCheck(e)})}runCheck(e){return u(this.path(),e).then(e=>{if(!e)throw new Error(`The \`${this.path()}\` binary doesn't seem to work correctly`);return this.version()?l(this.path(),this.version()):Promise.resolve()})}findExisting(){return p(this.path()).catch(e=>e&&"ENOENT"===e.code?this.download():Promise.reject(e))}download(){const e=h(this.src()||[]),t=[];return 0===e.length?Promise.reject(new Error("No binary found matching your system. It's probably not supported.")):(e.forEach(e=>t.push(e.url)),Promise.all(t.map(e=>c(e,this.dest(),{extract:!0,strip:this.options.strip}))).then(t=>{const r=t.map((t,r)=>{if(Array.isArray(t))return t.map(e=>e.path);const n=s.parse(e[r].url);return i.parse(n.pathname).base}).reduce((e,t)=>(Array.isArray(t)?e.push(...t):e.push(t),e),[]);return Promise.all(r.map(e=>f(i.join(this.dest(),e),493)))}))}}},{fs:298,"import-lazy":357,path:404,pify:30,url:519}],30:[function(e,t,r){"use strict";const n=(e,t)=>(function(...r){return new(0,t.promiseModule)((n,i)=>{t.multiArgs?r.push((...e)=>{t.errorFirst?e[0]?i(e):(e.shift(),n(e)):n(e)}):t.errorFirst?r.push((e,t)=>{e?i(e):n(t)}):r.push(n),e.apply(this,r)})});t.exports=((e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=typeof e;if(null===e||"object"!==r&&"function"!==r)throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${null===e?"null":r}\``);const i=e=>{const r=t=>"string"==typeof t?e===t:t.test(e);return t.include?t.include.some(r):!t.exclude.some(r)};let s;s="function"===r?function(...r){return t.excludeMain?e(...r):n(e,t).apply(this,r)}:Object.create(Object.getPrototypeOf(e));for(const r in e){const o=e[r];s[r]="function"==typeof o&&i(r)?n(o,t):o}return s})},{}],31:[function(e,t,r){(function(n,i){var s=e("fs"),o=e("path"),a=e("file-uri-to-path"),u=o.join,l=o.dirname,c=s.accessSync&&function(e){try{s.accessSync(e)}catch(e){return!1}return!0}||s.existsSync||o.existsSync,h={arrow:n.env.NODE_BINDINGS_ARROW||" → ",compiled:n.env.NODE_BINDINGS_COMPILED_DIR||"compiled",platform:n.platform,arch:n.arch,nodePreGyp:"node-v"+n.versions.modules+"-"+n.platform+"-"+n.arch,version:n.versions.node,bindings:"bindings.node",try:[["module_root","build","bindings"],["module_root","build","Debug","bindings"],["module_root","build","Release","bindings"],["module_root","out","Debug","bindings"],["module_root","Debug","bindings"],["module_root","out","Release","bindings"],["module_root","Release","bindings"],["module_root","build","default","bindings"],["module_root","compiled","version","platform","arch","bindings"],["module_root","addon-build","release","install-root","bindings"],["module_root","addon-build","debug","install-root","bindings"],["module_root","addon-build","default","install-root","bindings"],["module_root","lib","binding","nodePreGyp","bindings"]]};t.exports=r=function(t){"string"==typeof t?t={bindings:t}:t||(t={}),Object.keys(h).map(function(e){e in t||(t[e]=h[e])}),t.module_root||(t.module_root=r.getRoot(r.getFileName())),".node"!=o.extname(t.bindings)&&(t.bindings+=".node");for(var n,i,s,a="function"==typeof __webpack_require__?__non_webpack_require__:e,l=[],c=0,p=t.try.length;c<p;c++){n=u.apply(null,t.try[c].map(function(e){return t[e]||e})),l.push(n);try{return i=t.path?a.resolve(n):a(n),t.path||(i.path=n),i}catch(e){if("MODULE_NOT_FOUND"!==e.code&&"QUALIFIED_PATH_RESOLUTION_FAILED"!==e.code&&!/not find/i.test(e.message))throw e}}throw(s=new Error("Could not locate the bindings file. Tried:\n"+l.map(function(e){return t.arrow+e}).join("\n"))).tries=l,s},r.getFileName=function(e){var t,r=Error.prepareStackTrace,n=Error.stackTraceLimit,s={};Error.stackTraceLimit=10,Error.prepareStackTrace=function(r,n){for(var s=0,o=n.length;s<o;s++)if((t=n[s].getFileName())!==i){if(!e)return;if(t!==e)return}},Error.captureStackTrace(s),Error.prepareStackTrace=r,Error.stackTraceLimit=n;return 0===t.indexOf("file://")&&(t=a(t)),t},r.getRoot=function(e){for(var t,r=l(e);;){if("."===r&&(r=n.cwd()),c(u(r,"package.json"))||c(u(r,"node_modules")))return r;if(t===r)throw new Error('Could not find module root given file: "'+e+'". Do you have a `package.json` file? ');t=r,r=u(r,"..")}}}).call(this,e("_process"),"/node_modules/bindings/bindings.js")},{_process:437,"file-uri-to-path":112,fs:298,path:404}],32:[function(e,t,r){"use strict";"use restrict";function n(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(e){return(e>0)-(e<0)},r.abs=function(e){var t=e>>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e<t)},r.max=function(e,t){return e^(e^t)&-(e<t)},r.isPow2=function(e){return!(e&e-1||!e)},r.log2=function(e){var t,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},r.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var i=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<<i&255}}(i),r.reverse=function(e){return i[255&e]<<24|i[e>>>8&255]<<16|i[e>>>16&255]<<8|i[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>n(e)+1}},{}],33:[function(e,t,r){(function(e,n,i){!function(e){if("object"==typeof r&&void 0!==t)t.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i;"undefined"!=typeof window?i=window:void 0!==n?i=n:"undefined"!=typeof self&&(i=self),i.Promise=e()}}(function(){var t,r,s;return function e(t,r,n){function i(o,a){if(!r[o]){if(!t[o]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r||e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var s="function"==typeof _dereq_&&_dereq_,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){"use strict";t.exports=function(e){var t=e._SomePromiseArray;function r(e){var r=new t(e),n=r.promise();return r.setHowMany(1),r.setUnwrap(),r.init(),n}e.any=function(e){return r(e)},e.prototype.any=function(){return r(this)}}},{}],2:[function(t,r,n){"use strict";var i;try{throw new Error}catch(e){i=e}var s=t("./schedule"),o=t("./queue"),a=t("./util");function u(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new o(16),this._normalQueue=new o(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=s}function l(e,t,r){this._lateQueue.push(e,t,r),this._queueTick()}function c(e,t,r){this._normalQueue.push(e,t,r),this._queueTick()}function h(e){this._normalQueue._pushOne(e),this._queueTick()}function p(e){for(;e.length()>0;)f(e)}function f(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var r=e.shift(),n=e.shift();t.call(r,n)}}u.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},u.prototype.hasCustomScheduler=function(){return this._customScheduler},u.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},u.prototype.disableTrampolineIfNecessary=function(){a.hasDevTools&&(this._trampolineEnabled=!1)},u.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},u.prototype.fatalError=function(t,r){r?(e.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),e.exit(2)):this.throwLater(t)},u.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},a.hasDevTools?(u.prototype.invokeLater=function(e,t,r){this._trampolineEnabled?l.call(this,e,t,r):this._schedule(function(){setTimeout(function(){e.call(t,r)},100)})},u.prototype.invoke=function(e,t,r){this._trampolineEnabled?c.call(this,e,t,r):this._schedule(function(){e.call(t,r)})},u.prototype.settlePromises=function(e){this._trampolineEnabled?h.call(this,e):this._schedule(function(){e._settlePromises()})}):(u.prototype.invokeLater=l,u.prototype.invoke=c,u.prototype.settlePromises=h),u.prototype._drainQueues=function(){p(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,p(this._lateQueue)},u.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},u.prototype._reset=function(){this._isTickUsed=!1},r.exports=u,r.exports.firstLineError=i},{"./queue":26,"./schedule":29,"./util":36}],3:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var i=!1,s=function(e,t){this._reject(t)},o=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(s,s,null,this,e)},a=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},u=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(s){i||(i=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var l=r(s),c=new e(t);c._propagateFrom(this,1);var h=this._target();if(c._setBoundTo(l),l instanceof e){var p={promiseRejectionQueued:!1,promise:c,target:h,bindingPromise:l};h._then(t,o,void 0,c,p),l._then(a,u,void 0,c,p),c._setOnCancel(l)}else c._resolveCallback(h);return c},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,r){return e.resolve(r).bind(t)}}},{}],4:[function(e,t,r){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=e("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(e){}return i},t.exports=i},{"./promise":22}],5:[function(e,t,r){"use strict";var n=Object.create;if(n){var i=n(null),s=n(null);i[" size"]=s[" size"]=0}t.exports=function(t){var r,n=e("./util"),i=n.canEvaluate;n.isIdentifier;function s(e,r){var i;if(null!=e&&(i=e[r]),"function"!=typeof i){var s="Object "+n.classString(e)+" has no method '"+n.toString(r)+"'";throw new t.TypeError(s)}return i}function o(e){return s(e,this.pop()).apply(e,this)}function a(e){return e[this]}function u(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(o,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t;if("number"==typeof e)t=u;else if(i){var n=r(e);t=null!==n?n:a}else t=a;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,r){"use strict";t.exports=function(t,r,n,i){var s=e("./util"),o=s.tryCatch,a=s.errorObj,u=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var r=e._cancellationParent;if(null==r||!r._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=r}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(s.isArray(e))for(var r=0;r<e.length;++r)this._doInvokeOnCancel(e[r],t);else if(void 0!==e)if("function"==typeof e){if(!t){var n=o(e).call(this._boundValue());n===a&&(this._attachExtraTrace(n.e),u.throwLater(n.e))}}else e._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),u.invoke(this._doInvokeOnCancel,this,e)},t.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},t.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(e,t,r){"use strict";t.exports=function(t){var r=e("./util"),n=e("./es5").keys,i=r.tryCatch,s=r.errorObj;return function(e,o,a){return function(u){var l=a._boundValue();e:for(var c=0;c<e.length;++c){var h=e[c];if(h===Error||null!=h&&h.prototype instanceof Error){if(u instanceof h)return i(o).call(l,u)}else if("function"==typeof h){var p=i(h).call(l,u);if(p===s)return p;if(p)return i(o).call(l,u)}else if(r.isObject(u)){for(var f=n(h),d=0;d<f.length;++d){var m=f[d];if(h[m]!=u[m])continue e}return i(o).call(l,u)}}return t}}}},{"./es5":13,"./util":36}],8:[function(e,t,r){"use strict";t.exports=function(e){var t=!1,r=[];function n(){this._trace=new n.CapturedTrace(i())}function i(){var e=r.length-1;if(e>=0)return r[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var e=r.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},n.CapturedTrace=null,n.create=function(){if(t)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=e.prototype._pushContext,s=e.prototype._popContext,o=e._peekContext,a=e.prototype._peekContext,u=e.prototype._promiseCreated;n.deactivateLongStackTraces=function(){e.prototype._pushContext=r,e.prototype._popContext=s,e._peekContext=o,e.prototype._peekContext=a,e.prototype._promiseCreated=u,t=!1},t=!0,e.prototype._pushContext=n.prototype._pushContext,e.prototype._popContext=n.prototype._popContext,e._peekContext=e.prototype._peekContext=i,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},n}},{}],9:[function(t,r,n){"use strict";r.exports=function(r,n){var i,s,o,a=r._getDomain,u=r._async,l=t("./errors").Warning,c=t("./util"),h=t("./es5"),p=c.canAttachTrace,f=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,m=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,g=null,v=null,y=!1,_=!(0==c.env("BLUEBIRD_DEBUG")),b=!(0==c.env("BLUEBIRD_WARNINGS")||!_&&!c.env("BLUEBIRD_WARNINGS")),x=!(0==c.env("BLUEBIRD_LONG_STACK_TRACES")||!_&&!c.env("BLUEBIRD_LONG_STACK_TRACES")),w=0!=c.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!c.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},r.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var e=this;setTimeout(function(){e._notifyUnhandledRejection()},1)}},r.prototype._notifyUnhandledRejectionIsHandled=function(){W("rejectionHandled",i,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),W("unhandledRejection",s,e,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(e,t,r){return $(e,t,r||this)},r.onPossiblyUnhandledRejection=function(e){var t=a();s="function"==typeof e?null===t?e:c.domainBind(t,e):void 0},r.onUnhandledRejectionHandled=function(e){var t=a();i="function"==typeof e?null===t?e:c.domainBind(t,e):void 0};var E=function(){};r.longStackTraces=function(){if(u.haveItemsQueued()&&!Q.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!Q.longStackTraces&&K()){var e=r.prototype._captureStackTrace,t=r.prototype._attachExtraTrace,i=r.prototype._dereferenceTrace;Q.longStackTraces=!0,E=function(){if(u.haveItemsQueued()&&!Q.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=e,r.prototype._attachExtraTrace=t,r.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),u.enableTrampoline(),Q.longStackTraces=!1},r.prototype._captureStackTrace=F,r.prototype._attachExtraTrace=j,r.prototype._dereferenceTrace=U,n.activateLongStackTraces(),u.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return Q.longStackTraces&&K()};var T=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return c.global.dispatchEvent(e),function(e,t){var r={detail:t,cancelable:!0};h.defineProperty(r,"promise",{value:t.promise}),h.defineProperty(r,"reason",{value:t.reason});var n=new CustomEvent(e.toLowerCase(),r);return!c.global.dispatchEvent(n)}}if("function"==typeof Event){e=new Event("CustomEvent");return c.global.dispatchEvent(e),function(e,t){var r=new Event(e.toLowerCase(),{cancelable:!0});return r.detail=t,h.defineProperty(r,"promise",{value:t.promise}),h.defineProperty(r,"reason",{value:t.reason}),!c.global.dispatchEvent(r)}}return(e=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),c.global.dispatchEvent(e),function(e,t){var r=document.createEvent("CustomEvent");return r.initCustomEvent(e.toLowerCase(),!1,!0,t),!c.global.dispatchEvent(r)}}catch(e){}return function(){return!1}}(),A=c.isNode?function(){return e.emit.apply(e,arguments)}:c.global?function(e){var t="on"+e.toLowerCase(),r=c.global[t];return!!r&&(r.apply(c.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function S(e,t){return{promise:t}}var k={promiseCreated:S,promiseFulfilled:S,promiseRejected:S,promiseResolved:S,promiseCancelled:S,promiseChained:function(e,t,r){return{promise:t,child:r}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,r){return{reason:t,promise:r}},rejectionHandled:S},C=function(e){var t=!1;try{t=A.apply(null,arguments)}catch(e){u.throwLater(e),t=!0}var r=!1;try{r=T(e,k[e].apply(null,arguments))}catch(e){u.throwLater(e),r=!0}return r||t};function I(){return!1}function R(e,t,r){var n=this;try{e(t,r,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+c.toString(e));n._attachCancellationCallback(e)})}catch(e){return e}}function L(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?c.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function O(){return this._onCancelField}function M(e){this._onCancelField=e}function P(){this._cancellationParent=void 0,this._onCancelField=void 0}function B(e,t){if(0!=(1&t)){this._cancellationParent=e;var r=e._branchesRemainingToCancel;void 0===r&&(r=0),e._branchesRemainingToCancel=r+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}r.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?r.longStackTraces():!e.longStackTraces&&r.hasLongStackTraces()&&E()),"warnings"in e){var t=e.warnings;Q.warnings=!!t,w=Q.warnings,c.isObject(t)&&"wForgottenReturn"in t&&(w=!!t.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!Q.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=P,r.prototype._propagateFrom=B,r.prototype._onCancel=O,r.prototype._setOnCancel=M,r.prototype._attachCancellationCallback=L,r.prototype._execute=R,N=B,Q.cancellation=!0}return"monitoring"in e&&(e.monitoring&&!Q.monitoring?(Q.monitoring=!0,r.prototype._fireEvent=C):!e.monitoring&&Q.monitoring&&(Q.monitoring=!1,r.prototype._fireEvent=I)),r},r.prototype._fireEvent=I,r.prototype._execute=function(e,t,r){try{e(t,r)}catch(e){return e}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(e){},r.prototype._attachCancellationCallback=function(e){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._dereferenceTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(e,t){};var N=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function D(){var e=this._boundTo;return void 0!==e&&e instanceof r?e.isFulfilled()?e.value():void 0:e}function F(){this._trace=new Z(this._peekContext())}function j(e,t){if(p(e)){var r=this._trace;if(void 0!==r&&t&&(r=r._parent),void 0!==r)r.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=G(e);c.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),c.notEnumerableProp(e,"__stackCleaned__",!0)}}}function U(){this._trace=void 0}function $(e,t,n){if(Q.warnings){var i,s=new l(e);if(t)n._attachExtraTrace(s);else if(Q.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(s);else{var o=G(s);s.stack=o.message+"\n"+o.stack.join("\n")}C("warning",s)||z(s,"",!0)}}function V(e){for(var t=[],r=0;r<e.length;++r){var n=e[r],i=" (No stack trace)"===n||g.test(n),s=i&&q(n);i&&!s&&(y&&" "!==n.charAt(0)&&(n=" "+n),t.push(n))}return t}function G(e){var t=e.stack,r=e.toString();return t="string"==typeof t&&t.length>0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),r=0;r<t.length;++r){var n=t[r];if(" (No stack trace)"===n||g.test(n))break}return r>0&&"SyntaxError"!=e.name&&(t=t.slice(r)),t}(e):[" (No stack trace)"],{message:r,stack:"SyntaxError"==e.name?t:V(t)}}function z(e,t,r){if("undefined"!=typeof console){var n;if(c.isObject(e)){var i=e.stack;n=t+v(i,e)}else n=t+String(e);"function"==typeof o?o(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function W(e,t,r,n){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(n):t(r,n))}catch(e){u.throwLater(e)}"unhandledRejection"===e?C(e,r,n)||i||z(r,"Unhandled rejection "):C(e,n)}function H(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():c.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){if(e.length<41)return e;return e.substr(0,38)+"..."}(t)+">, no stack trace)"}function K(){return"function"==typeof J}var q=function(){return!1},X=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Y(e){var t=e.match(X);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function Z(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);J(this,Z),t>32&&this.uncycle()}c.inherits(Z,Error),n.CapturedTrace=Z,Z.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],r={},n=0,i=this;void 0!==i;++n)t.push(i),i=i._parent;for(n=(e=this._length=n)-1;n>=0;--n){var s=t[n].stack;void 0===r[s]&&(r[s]=n)}for(n=0;n<e;++n){var o=r[t[n].stack];if(void 0!==o&&o!==n){o>0&&(t[o-1]._parent=void 0,t[o-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var a=n>0?t[n-1]:this;o<e-1?(a._parent=t[o+1],a._parent.uncycle(),a._length=a._parent._length+1):(a._parent=void 0,a._length=1);for(var u=a._length+1,l=n-2;l>=0;--l)t[l]._length=u,u++;return}}}},Z.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=G(e),r=t.message,n=[t.stack],i=this;void 0!==i;)n.push(V(i.stack.split("\n"))),i=i._parent;!function(e){for(var t=e[0],r=1;r<e.length;++r){for(var n=e[r],i=t.length-1,s=t[i],o=-1,a=n.length-1;a>=0;--a)if(n[a]===s){o=a;break}for(a=o;a>=0;--a){var u=n[a];if(t[i]!==u)break;t.pop(),i--}t=n}}(n),function(e){for(var t=0;t<e.length;++t)(0===e[t].length||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}(n),c.notEnumerableProp(e,"stack",function(e,t){for(var r=0;r<t.length-1;++r)t[r].push("From previous event:"),t[r]=t[r].join("\n");return r<t.length&&(t[r]=t[r].join("\n")),e+"\n"+t.join("\n")}(r,n)),c.notEnumerableProp(e,"__stackCleaned__",!0)}};var J=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():H(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,g=e,v=t;var r=Error.captureStackTrace;return q=function(e){return f.test(e)},function(e,t){Error.stackTraceLimit+=6,r(e,t),Error.stackTraceLimit-=6}}var n,i=new Error;if("string"==typeof i.stack&&i.stack.split("\n")[0].indexOf("stackDetection@")>=0)return g=/@/,v=t,y=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){n="stack"in e}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(v=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?H(t):t.toString()},null):(g=e,v=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(o=function(e){console.warn(e)},c.isNode&&e.stderr.isTTY?o=function(e,t){var r=t?"[33m":"[31m";console.warn(r+e+"[0m\n")}:c.isNode||"string"!=typeof(new Error).stack||(o=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var Q={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1};return x&&r.longStackTraces(),{longStackTraces:function(){return Q.longStackTraces},warnings:function(){return Q.warnings},cancellation:function(){return Q.cancellation},monitoring:function(){return Q.monitoring},propagateFromFunction:function(){return N},boundValueFunction:function(){return D},checkForgottenReturns:function(e,t,r,n,i){if(void 0===e&&null!==t&&w){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var s="",o="";if(t._trace){for(var a=t._trace.stack.split("\n"),u=V(a),l=u.length-1;l>=0;--l){var c=u[l];if(!d.test(c)){var h=c.match(m);h&&(s="at "+h[1]+":"+h[2]+":"+h[3]+" ");break}}if(u.length>0){var p=u[0];for(l=0;l<a.length;++l)if(a[l]===p){l>0&&(o="\n"+a[l-1]);break}}}var f="a promise was created in a "+r+"handler "+s+"but was not returned from it, see http://goo.gl/rRqMUw"+o;n._warn(f,!0,t)}},setBounds:function(e,t){if(K()){for(var r,n,i=e.stack.split("\n"),s=t.stack.split("\n"),o=-1,a=-1,u=0;u<i.length;++u)if(l=Y(i[u])){r=l.fileName,o=l.line;break}for(u=0;u<s.length;++u){var l;if(l=Y(s[u])){n=l.fileName,a=l.line;break}}o<0||a<0||!r||!n||r!==n||o>=a||(q=function(e){if(f.test(e))return!0;var t=Y(e);return!!(t&&t.fileName===r&&o<=t.line&&t.line<=a)})}},warn:$,deprecated:function(e,t){var r=e+" is deprecated and will be removed in a future version.";return t&&(r+=" Use "+t+" instead."),$(r)},CapturedTrace:Z,fireDomEvent:T,fireGlobalEvent:A}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(e,t,r){"use strict";t.exports=function(e){function t(){return this.value}function r(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(r){return r instanceof e&&r.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:r},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(r,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof e&&r.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:r},void 0);var n=arguments[1];n instanceof e&&n.suppressUnhandledRejections();return this.caught(r,function(){return n})}}},{}],11:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.reduce,n=e.all;function i(){return n(this)}e.prototype.each=function(e){return r(this,e,t,0)._then(i,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,n){return r(e,n,t,0)._then(i,void 0,void 0,e,void 0)},e.mapSeries=function(e,n){return r(e,n,t,t)}}},{}],12:[function(e,t,r){"use strict";var n,i,s=e("./es5"),o=s.freeze,a=e("./util"),u=a.inherits,l=a.notEnumerableProp;function c(e,t){function r(n){if(!(this instanceof r))return new r(n);l(this,"message","string"==typeof n?n:t),l(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return u(r,Error),r}var h=c("Warning","warning"),p=c("CancellationError","cancellation error"),f=c("TimeoutError","timeout error"),d=c("AggregateError","aggregate error");try{n=TypeError,i=RangeError}catch(e){n=c("TypeError","type error"),i=c("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g<m.length;++g)"function"==typeof Array.prototype[m[g]]&&(d.prototype[m[g]]=Array.prototype[m[g]]);s.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var v=0;function y(e){if(!(this instanceof y))return new y(e);l(this,"name","OperationalError"),l(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(l(this,"message",e.message),l(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}d.prototype.toString=function(){var e=Array(4*v+1).join(" "),t="\n"+e+"AggregateError of:\n";v++,e=Array(4*v+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",i=n.split("\n"),s=0;s<i.length;++s)i[s]=e+i[s];t+=(n=i.join("\n"))+"\n"}return v--,t},u(y,Error);var _=Error.__BluebirdErrorTypes__;_||(_=o({CancellationError:p,TimeoutError:f,OperationalError:y,RejectionError:y,AggregateError:d}),s.defineProperty(Error,"__BluebirdErrorTypes__",{value:_,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error:Error,TypeError:n,RangeError:i,CancellationError:_.CancellationError,OperationalError:_.OperationalError,TimeoutError:_.TimeoutError,AggregateError:_.AggregateError,Warning:h}},{"./es5":13,"./util":36}],13:[function(e,t,r){var n=function(){"use strict";return void 0===this}();if(n)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:n,propertyIsWritable:function(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!(r&&!r.writable&&!r.set)}};else{var i={}.hasOwnProperty,s={}.toString,o={}.constructor.prototype,a=function(e){var t=[];for(var r in e)i.call(e,r)&&t.push(r);return t};t.exports={isArray:function(e){try{return"[object Array]"===s.call(e)}catch(e){return!1}},keys:a,names:a,defineProperty:function(e,t,r){return e[t]=r.value,e},getDescriptor:function(e,t){return{value:e[t]}},freeze:function(e){return e},getPrototypeOf:function(e){try{return Object(e).constructor.prototype}catch(e){return o}},isES5:n,propertyIsWritable:function(){return!0}}}},{}],14:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.map;e.prototype.filter=function(e,n){return r(this,e,n,t)},e.filter=function(e,n,i){return r(e,n,i,t)}}},{}],15:[function(e,t,r){"use strict";t.exports=function(t,r,n){var i=e("./util"),s=t.CancellationError,o=i.errorObj,a=e("./catch_filter")(n);function u(e,t,r){this.promise=e,this.type=t,this.handler=r,this.called=!1,this.cancelPromise=null}function l(e){this.finallyHandler=e}function c(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function h(){return f.call(this,this.promise._target()._settledValue())}function p(e){if(!c(this,e))return o.e=e,o}function f(e){var i=this.promise,a=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?a.call(i._boundValue()):a.call(i._boundValue(),e);if(u===n)return u;if(void 0!==u){i._setReturnedNonUndefined();var f=r(u,i);if(f instanceof t){if(null!=this.cancelPromise){if(f._isCancelled()){var d=new s("late cancellation observer");return i._attachExtraTrace(d),o.e=d,o}f.isPending()&&f._attachCancellationCallback(new l(this))}return f._then(h,p,void 0,this,void 0)}}}return i.isRejected()?(c(this),o.e=e,o):(c(this),e)}return u.prototype.isFinallyHandler=function(){return 0===this.type},l.prototype._resultCancelled=function(){c(this.finallyHandler)},t.prototype._passThrough=function(e,t,r,n){return"function"!=typeof e?this.then():this._then(r,n,void 0,new u(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,f,f)},t.prototype.tap=function(e){return this._passThrough(e,1,f)},t.prototype.tapCatch=function(e){var r=arguments.length;if(1===r)return this._passThrough(e,1,void 0,f);var n,s=new Array(r-1),o=0;for(n=0;n<r-1;++n){var u=arguments[n];if(!i.isObject(u))return t.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+i.classString(u)));s[o++]=u}s.length=o;var l=arguments[n];return this._passThrough(a(s,l,this),1,void 0,f)},u}},{"./catch_filter":7,"./util":36}],16:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,s,o){var a=e("./errors").TypeError,u=e("./util"),l=u.errorObj,c=u.tryCatch,h=[];function p(e,r,i,s){if(o.cancellation()){var a=new t(n),u=this._finallyPromise=new t(n);this._promise=a.lastly(function(){return u}),a._captureStackTrace(),a._setOnCancel(this)}else{(this._promise=new t(n))._captureStackTrace()}this._stack=s,this._generatorFunction=e,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(h):h,this._yieldedPromise=null,this._cancellationPhase=!1}u.inherits(p,s),p.prototype._isResolved=function(){return null===this._promise},p.prototype._cleanup=function(){this._promise=this._generator=null,o.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},p.prototype._promiseCancelled=function(){if(!this._isResolved()){var e;if(void 0!==this._generator.return)this._promise._pushContext(),e=c(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new t.CancellationError("generator .return() sentinel");t.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),e=c(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(e)}},p.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=c(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},p.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=c(this._generator.throw).call(this._generator,e);this._promise._popContext(),this._continue(t)},p.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof t){var e=this._yieldedPromise;this._yieldedPromise=null,e.cancel()}},p.prototype.promise=function(){return this._promise},p.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},p.prototype._continue=function(e){var r=this._promise;if(e===l)return this._cleanup(),this._cancellationPhase?r.cancel():r._rejectCallback(e.e,!1);var n=e.value;if(!0===e.done)return this._cleanup(),this._cancellationPhase?r.cancel():r._resolveCallback(n);var s=i(n,this._promise);if(s instanceof t||null!==(s=function(e,r,n){for(var s=0;s<r.length;++s){n._pushContext();var o=c(r[s])(e);if(n._popContext(),o===l){n._pushContext();var a=t.reject(l.e);return n._popContext(),a}var u=i(o,n);if(u instanceof t)return u}return null}(s,this._yieldHandlers,this._promise))){var o=(s=s._target())._bitField;0==(50397184&o)?(this._yieldedPromise=s,s._proxy(this,null)):0!=(33554432&o)?t._async.invoke(this._promiseFulfilled,this,s._value()):0!=(16777216&o)?t._async.invoke(this._promiseRejected,this,s._reason()):this._promiseCancelled()}else this._promiseRejected(new a("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(n))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},t.coroutine=function(e,t){if("function"!=typeof e)throw new a("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=Object(t).yieldHandler,n=p,i=(new Error).stack;return function(){var t=e.apply(this,arguments),s=new n(void 0,void 0,r,i),o=s.promise();return s._generator=t,s._promiseFulfilled(void 0),o}},t.coroutine.addYieldHandler=function(e){if("function"!=typeof e)throw new a("expecting a function but got "+u.classString(e));h.push(e)},t.spawn=function(e){if(o.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof e)return r("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=new p(e,this),i=n.promise();return n._run(t.spawn),i}}},{"./errors":12,"./util":36}],17:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,s,o){var a=e("./util");a.canEvaluate,a.tryCatch,a.errorObj;t.join=function(){var e,t=arguments.length-1;t>0&&"function"==typeof arguments[t]&&(e=arguments[t]);var n=[].slice.call(arguments);e&&n.pop();var i=new r(n).promise();return void 0!==e?i.spread(e):i}}},{"./util":36}],18:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,s,o){var a=t._getDomain,u=e("./util"),l=u.tryCatch,c=u.errorObj,h=t._async;function p(e,t,r,n){this.constructor$(e),this._promise._captureStackTrace();var i=a();this._callback=null===i?t:u.domainBind(i,t),this._preservedValues=n===s?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function f(e,r,i,s){if("function"!=typeof r)return n("expecting a function but got "+u.classString(r));var o=0;if(void 0!==i){if("object"!=typeof i||null===i)return t.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));o=i.concurrency}return new p(e,r,o="number"==typeof o&&isFinite(o)&&o>=1?o:0,s).promise()}u.inherits(p,r),p.prototype._asyncInit=function(){this._init$(void 0,-2)},p.prototype._init=function(){},p.prototype._promiseFulfilled=function(e,r){var n=this._values,s=this.length(),a=this._preservedValues,u=this._limit;if(r<0){if(n[r=-1*r-1]=e,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return n[r]=e,this._queue.push(r),!1;null!==a&&(a[r]=e);var h=this._promise,p=this._callback,f=h._boundValue();h._pushContext();var d=l(p).call(f,e,r,s),m=h._popContext();if(o.checkForgottenReturns(d,m,null!==a?"Promise.filter":"Promise.map",h),d===c)return this._reject(d.e),!0;var g=i(d,this._promise);if(g instanceof t){var v=(g=g._target())._bitField;if(0==(50397184&v))return u>=1&&this._inFlight++,n[r]=g,g._proxy(this,-1*(r+1)),!1;if(0==(33554432&v))return 0!=(16777216&v)?(this._reject(g._reason()),!0):(this._cancel(),!0);d=g._value()}n[r]=d}return++this._totalResolved>=s&&(null!==a?this._filter(n,a):this._resolve(n),!0)},p.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var n=e.pop();this._promiseFulfilled(r[n],n)}},p.prototype._filter=function(e,t){for(var r=t.length,n=new Array(r),i=0,s=0;s<r;++s)e[s]&&(n[i++]=t[s]);n.length=i,this._resolve(n)},p.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(e,t){return f(this,e,t,null)},t.map=function(e,t,r,n){return f(e,t,r,n)}}},{"./util":36}],19:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,s){var o=e("./util"),a=o.tryCatch;t.method=function(e){if("function"!=typeof e)throw new t.TypeError("expecting a function but got "+o.classString(e));return function(){var n=new t(r);n._captureStackTrace(),n._pushContext();var i=a(e).apply(this,arguments),o=n._popContext();return s.checkForgottenReturns(i,o,"Promise.method",n),n._resolveFromSyncValue(i),n}},t.attempt=t.try=function(e){if("function"!=typeof e)return i("expecting a function but got "+o.classString(e));var n,u=new t(r);if(u._captureStackTrace(),u._pushContext(),arguments.length>1){s.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],c=arguments[2];n=o.isArray(l)?a(e).apply(c,l):a(e).call(c,l)}else n=a(e)();var h=u._popContext();return s.checkForgottenReturns(n,h,"Promise.try",u),u._resolveFromSyncValue(n),u},t.prototype._resolveFromSyncValue=function(e){e===o.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,r){"use strict";var n=e("./util"),i=n.maybeWrapAsError,s=e("./errors").OperationalError,o=e("./es5");var a=/^(?:name|message|stack|cause)$/;function u(e){var t;if(function(e){return e instanceof Error&&o.getPrototypeOf(e)===Error.prototype}(e)){(t=new s(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var r=o.keys(e),i=0;i<r.length;++i){var u=r[i];a.test(u)||(t[u]=e[u])}return t}return n.markAsOriginatingFromRejection(e),e}t.exports=function(e,t){return function(r,n){if(null!==e){if(r){var s=u(i(r));e._attachExtraTrace(s),e._reject(s)}else if(t){var o=[].slice.call(arguments,1);e._fulfill(o)}else e._fulfill(n);e=null}}}},{"./errors":12,"./es5":13,"./util":36}],21:[function(e,t,r){"use strict";t.exports=function(t){var r=e("./util"),n=t._async,i=r.tryCatch,s=r.errorObj;function o(e,t){if(!r.isArray(e))return a.call(this,e,t);var o=i(t).apply(this._boundValue(),[null].concat(e));o===s&&n.throwLater(o.e)}function a(e,t){var r=this._boundValue(),o=void 0===e?i(t).call(r,null):i(t).call(r,null,e);o===s&&n.throwLater(o.e)}function u(e,t){if(!e){var r=new Error(e+"");r.cause=e,e=r}var o=i(t).call(this._boundValue(),e);o===s&&n.throwLater(o.e)}t.prototype.asCallback=t.prototype.nodeify=function(e,t){if("function"==typeof e){var r=a;void 0!==t&&Object(t).spread&&(r=o),this._then(r,u,void 0,this,e)}return this}}},{"./util":36}],22:[function(t,r,n){"use strict";r.exports=function(){var n=function(){return new d("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},i=function(){return new I.PromiseInspection(this._target())},s=function(e){return I.reject(new d(e))};function o(){}var a,u={},l=t("./util");a=l.isNode?function(){var t=e.domain;return void 0===t&&(t=null),t}:function(){return null},l.notEnumerableProp(I,"_getDomain",a);var c=t("./es5"),h=t("./async"),p=new h;c.defineProperty(I,"_async",{value:p});var f=t("./errors"),d=I.TypeError=f.TypeError;I.RangeError=f.RangeError;var m=I.CancellationError=f.CancellationError;I.TimeoutError=f.TimeoutError,I.OperationalError=f.OperationalError,I.RejectionError=f.OperationalError,I.AggregateError=f.AggregateError;var g=function(){},v={},y={},_=t("./thenables")(I,g),b=t("./promise_array")(I,g,_,s,o),x=t("./context")(I),w=x.create,E=t("./debuggability")(I,x),T=(E.CapturedTrace,t("./finally")(I,_,y)),A=t("./catch_filter")(y),S=t("./nodeback"),k=l.errorObj,C=l.tryCatch;function I(e){e!==g&&function(e,t){if(null==e||e.constructor!==I)throw new d("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof t)throw new d("expecting a function but got "+l.classString(t))}(this,e),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(e),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function R(e){this.promise._resolveCallback(e)}function L(e){this.promise._rejectCallback(e,!1)}function O(e){var t=new I(g);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}return I.prototype.toString=function(){return"[object Promise]"},I.prototype.caught=I.prototype.catch=function(e){var t=arguments.length;if(t>1){var r,n=new Array(t-1),i=0;for(r=0;r<t-1;++r){var o=arguments[r];if(!l.isObject(o))return s("Catch statement predicate: expecting an object but got "+l.classString(o));n[i++]=o}return n.length=i,e=arguments[r],this.then(void 0,A(n,e,this))}return this.then(void 0,e)},I.prototype.reflect=function(){return this._then(i,i,void 0,this,void 0)},I.prototype.then=function(e,t){if(E.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var r=".then() only accepts functions but was passed: "+l.classString(e);arguments.length>1&&(r+=", "+l.classString(t)),this._warn(r)}return this._then(e,t,void 0,void 0,void 0)},I.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},I.prototype.spread=function(e){return"function"!=typeof e?s("expecting a function but got "+l.classString(e)):this.all()._then(e,void 0,void 0,v,void 0)},I.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},I.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new b(this).promise()},I.prototype.error=function(e){return this.caught(l.originatesFromRejection,e)},I.getNewLibraryCopy=r.exports,I.is=function(e){return e instanceof I},I.fromNode=I.fromCallback=function(e){var t=new I(g);t._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=C(e)(S(t,r));return n===k&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},I.all=function(e){return new b(e).promise()},I.cast=function(e){var t=_(e);return t instanceof I||((t=new I(g))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},I.resolve=I.fulfilled=I.cast,I.reject=I.rejected=function(e){var t=new I(g);return t._captureStackTrace(),t._rejectCallback(e,!0),t},I.setScheduler=function(e){if("function"!=typeof e)throw new d("expecting a function but got "+l.classString(e));return p.setScheduler(e)},I.prototype._then=function(e,t,r,n,i){var s=void 0!==i,o=s?i:new I(g),u=this._target(),c=u._bitField;s||(o._propagateFrom(this,3),o._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&c)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,o));var h=a();if(0!=(50397184&c)){var f,d,v=u._settlePromiseCtx;0!=(33554432&c)?(d=u._rejectionHandler0,f=e):0!=(16777216&c)?(d=u._fulfillmentHandler0,f=t,u._unsetRejectionIsUnhandled()):(v=u._settlePromiseLateCancellationObserver,d=new m("late cancellation observer"),u._attachExtraTrace(d),f=t),p.invoke(v,u,{handler:null===h?f:"function"==typeof f&&l.domainBind(h,f),promise:o,receiver:n,value:d})}else u._addCallbacks(e,t,o,n,h);return o},I.prototype._length=function(){return 65535&this._bitField},I.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},I.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},I.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},I.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},I.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},I.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},I.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},I.prototype._isFinal=function(){return(4194304&this._bitField)>0},I.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},I.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},I.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},I.prototype._setAsyncGuaranteed=function(){p.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},I.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==u)return void 0===t&&this._isBound()?this._boundValue():t},I.prototype._promiseAt=function(e){return this[4*e-4+2]},I.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},I.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},I.prototype._boundValue=function(){},I.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,r=e._rejectionHandler0,n=e._promise0,i=e._receiverAt(0);void 0===i&&(i=u),this._addCallbacks(t,r,n,i,null)},I.prototype._migrateCallbackAt=function(e,t){var r=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),i=e._promiseAt(t),s=e._receiverAt(t);void 0===s&&(s=u),this._addCallbacks(r,n,i,s,null)},I.prototype._addCallbacks=function(e,t,r,n,i){var s=this._length();if(s>=65531&&(s=0,this._setLength(0)),0===s)this._promise0=r,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=null===i?e:l.domainBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=null===i?t:l.domainBind(i,t));else{var o=4*s-4;this[o+2]=r,this[o+3]=n,"function"==typeof e&&(this[o+0]=null===i?e:l.domainBind(i,e)),"function"==typeof t&&(this[o+1]=null===i?t:l.domainBind(i,t))}return this._setLength(s+1),s},I.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},I.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(n(),!1);var r=_(e,this);if(!(r instanceof I))return this._fulfill(e);t&&this._propagateFrom(r,2);var i=r._target();if(i!==this){var s=i._bitField;if(0==(50397184&s)){var o=this._length();o>0&&i._migrateCallback0(this);for(var a=1;a<o;++a)i._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(i)}else if(0!=(33554432&s))this._fulfill(i._value());else if(0!=(16777216&s))this._reject(i._reason());else{var u=new m("late cancellation observer");i._attachExtraTrace(u),this._reject(u)}}else this._reject(n())}},I.prototype._rejectCallback=function(e,t,r){var n=l.ensureErrorObject(e),i=n===e;if(!i&&!r&&E.warnings()){var s="a promise was rejected with a non-error: "+l.classString(e);this._warn(s,!0)}this._attachExtraTrace(n,!!t&&i),this._reject(e)},I.prototype._resolveFromExecutor=function(e){if(e!==g){var t=this;this._captureStackTrace(),this._pushContext();var r=!0,n=this._execute(e,function(e){t._resolveCallback(e)},function(e){t._rejectCallback(e,r)});r=!1,this._popContext(),void 0!==n&&t._rejectCallback(n,!0)}},I.prototype._settlePromiseFromHandler=function(e,t,r,n){var i=n._bitField;if(0==(65536&i)){var s;n._pushContext(),t===v?r&&"number"==typeof r.length?s=C(e).apply(this._boundValue(),r):(s=k).e=new d("cannot .spread() a non-array: "+l.classString(r)):s=C(e).call(t,r);var o=n._popContext();0==(65536&(i=n._bitField))&&(s===y?n._reject(r):s===k?n._rejectCallback(s.e,!1):(E.checkForgottenReturns(s,o,"",n,this),n._resolveCallback(s)))}},I.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},I.prototype._followee=function(){return this._rejectionHandler0},I.prototype._setFollowee=function(e){this._rejectionHandler0=e},I.prototype._settlePromise=function(e,t,r,n){var s=e instanceof I,a=this._bitField,u=0!=(134217728&a);0!=(65536&a)?(s&&e._invokeInternalOnCancel(),r instanceof T&&r.isFinallyHandler()?(r.cancelPromise=e,C(t).call(r,n)===k&&e._reject(k.e)):t===i?e._fulfill(i.call(r)):r instanceof o?r._promiseCancelled(e):s||e instanceof b?e._cancel():r.cancel()):"function"==typeof t?s?(u&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,r,n,e)):t.call(r,n,e):r instanceof o?r._isResolved()||(0!=(33554432&a)?r._promiseFulfilled(n,e):r._promiseRejected(n,e)):s&&(u&&e._setAsyncGuaranteed(),0!=(33554432&a)?e._fulfill(n):e._reject(n))},I.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,r=e.promise,n=e.receiver,i=e.value;"function"==typeof t?r instanceof I?this._settlePromiseFromHandler(t,n,i,r):t.call(n,i,r):r instanceof I&&r._reject(i)},I.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},I.prototype._settlePromise0=function(e,t,r){var n=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,e,i,t)},I.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},I.prototype._fulfill=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(e===this){var r=n();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():p.settlePromises(this),this._dereferenceTrace())}},I.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return p.fatalError(e,l.isNode);(65535&t)>0?p.settlePromises(this):this._ensurePossibleRejectionHandled()}},I.prototype._fulfillPromises=function(e,t){for(var r=1;r<e;r++){var n=this._fulfillmentHandlerAt(r),i=this._promiseAt(r),s=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(i,n,s,t)}},I.prototype._rejectPromises=function(e,t){for(var r=1;r<e;r++){var n=this._rejectionHandlerAt(r),i=this._promiseAt(r),s=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(i,n,s,t)}},I.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(0!=(16842752&e)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,e),this._rejectPromises(t,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},I.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},I.defer=I.pending=function(){return E.deprecated("Promise.defer","new Promise"),{promise:new I(g),resolve:R,reject:L}},l.notEnumerableProp(I,"_makeSelfResolutionError",n),t("./method")(I,g,_,s,E),t("./bind")(I,g,_,E),t("./cancel")(I,b,s,E),t("./direct_resolve")(I),t("./synchronous_inspection")(I),t("./join")(I,b,_,g,p,a),I.Promise=I,I.version="3.5.3",t("./map.js")(I,b,s,_,g,E),t("./call_get.js")(I),t("./using.js")(I,s,_,w,g,E),t("./timers.js")(I,g,E),t("./generators.js")(I,s,g,_,o,E),t("./nodeify.js")(I),t("./promisify.js")(I,g),t("./props.js")(I,b,_,s),t("./race.js")(I,g,_,s),t("./reduce.js")(I,b,s,_,g,E),t("./settle.js")(I,b,E),t("./some.js")(I,b,s),t("./filter.js")(I,g),t("./each.js")(I,g),t("./any.js")(I),l.toFastProperties(I),l.toFastProperties(I.prototype),O({a:1}),O({b:2}),O({c:3}),O(1),O(function(){}),O(void 0),O(!1),O(new I(g)),E.setBounds(h.firstLineError,l.lastLineError),I}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,s){var o=e("./util");o.isArray;function a(e){var n=this._promise=new t(r);e instanceof t&&n._propagateFrom(e,3),n._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return o.inherits(a,s),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function e(r,s){var a=n(this._values,this._promise);if(a instanceof t){var u=(a=a._target())._bitField;if(this._values=a,0==(50397184&u))return this._promise._setAsyncGuaranteed(),a._then(e,this._reject,void 0,this,s);if(0==(33554432&u))return 0!=(16777216&u)?this._reject(a._reason()):this._cancel();a=a._value()}if(null!==(a=o.asArray(a)))0!==a.length?this._iterate(a):-5===s?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(s));else{var l=i("expecting an array or an iterable object but got "+o.classString(a)).reason();this._promise._rejectCallback(l,!1)}},a.prototype._iterate=function(e){var r=this.getActualLength(e.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,s=!1,o=null,a=0;a<r;++a){var u=n(e[a],i);o=u instanceof t?(u=u._target())._bitField:null,s?null!==o&&u.suppressUnhandledRejections():null!==o?0==(50397184&o)?(u._proxy(this,a),this._values[a]=u):s=0!=(33554432&o)?this._promiseFulfilled(u._value(),a):0!=(16777216&o)?this._promiseRejected(u._reason(),a):this._promiseCancelled(a):s=this._promiseFulfilled(u,a)}s||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(e){this._values=null,this._promise._fulfill(e)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(e){this._values=null,this._promise._rejectCallback(e,!1)},a.prototype._promiseFulfilled=function(e,t){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var r=0;r<e.length;++r)e[r]instanceof t&&e[r].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(e){return e},a}},{"./util":36}],24:[function(e,t,r){"use strict";t.exports=function(t,r){var n={},i=e("./util"),s=e("./nodeback"),o=i.withAppended,a=i.maybeWrapAsError,u=i.canEvaluate,l=e("./errors").TypeError,c={__isPromisified__:!0},h=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),p=function(e){return i.isIdentifier(e)&&"_"!==e.charAt(0)&&"constructor"!==e};function f(e){return!h.test(e)}function d(e){try{return!0===e.__isPromisified__}catch(e){return!1}}function m(e,t,r){var n=i.getDataPropertyOrDefault(e,t+r,c);return!!n&&d(n)}function g(e,t,r,n){for(var s=i.inheritedDataKeys(e),o=[],a=0;a<s.length;++a){var u=s[a],c=e[u],h=n===p||p(u,c,e);"function"!=typeof c||d(c)||m(e,u,t)||!n(u,c,e,h)||o.push(u,c)}return function(e,t,r){for(var n=0;n<e.length;n+=2){var i=e[n];if(r.test(i))for(var s=i.replace(r,""),o=0;o<e.length;o+=2)if(e[o]===s)throw new l("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",t))}}(o,t,r),o}var v,y=function(e){return e.replace(/([$])/,"\\$")};var _=u?v:function(e,u,l,c,h,p){var f=function(){return this}(),d=e;function m(){var i=u;u===n&&(i=this);var l=new t(r);l._captureStackTrace();var c="string"==typeof d&&this!==f?this[d]:e,h=s(l,p);try{c.apply(i,o(arguments,h))}catch(e){l._rejectCallback(a(e),!0,!0)}return l._isFateSealed()||l._setAsyncGuaranteed(),l}return"string"==typeof d&&(e=c),i.notEnumerableProp(m,"__isPromisified__",!0),m};function b(e,t,r,s,o){for(var a=new RegExp(y(t)+"$"),u=g(e,t,a,r),l=0,c=u.length;l<c;l+=2){var h=u[l],p=u[l+1],f=h+t;if(s===_)e[f]=_(h,n,h,p,t,o);else{var d=s(p,function(){return _(h,n,h,p,t,o)});i.notEnumerableProp(d,"__isPromisified__",!0),e[f]=d}}return i.toFastProperties(e),e}t.promisify=function(e,t){if("function"!=typeof e)throw new l("expecting a function but got "+i.classString(e));if(d(e))return e;var r=function(e,t,r){return _(e,t,void 0,e,null,r)}(e,void 0===(t=Object(t)).context?n:t.context,!!t.multiArgs);return i.copyDescriptors(e,r,f),r},t.promisifyAll=function(e,t){if("function"!=typeof e&&"object"!=typeof e)throw new l("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var r=!!(t=Object(t)).multiArgs,n=t.suffix;"string"!=typeof n&&(n="Async");var s=t.filter;"function"!=typeof s&&(s=p);var o=t.promisifier;if("function"!=typeof o&&(o=_),!i.isIdentifier(n))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var a=i.inheritedDataKeys(e),u=0;u<a.length;++u){var c=e[a[u]];"constructor"!==a[u]&&i.isClass(c)&&(b(c.prototype,n,s,o,r),b(c,n,s,o,r))}return b(e,n,s,o,r)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(e,t,r){"use strict";t.exports=function(t,r,n,i){var s,o=e("./util"),a=o.isObject,u=e("./es5");"function"==typeof Map&&(s=Map);var l=function(){var e=0,t=0;function r(r,n){this[e]=r,this[e+t]=n,e++}return function(n){t=n.size,e=0;var i=new Array(2*n.size);return n.forEach(r,i),i}}();function c(e){var t,r=!1;if(void 0!==s&&e instanceof s)t=l(e),r=!0;else{var n=u.keys(e),i=n.length;t=new Array(2*i);for(var o=0;o<i;++o){var a=n[o];t[o]=e[a],t[o+i]=a}}this.constructor$(t),this._isMap=r,this._init$(void 0,r?-6:-3)}function h(e){var r,s=n(e);return a(s)?(r=s instanceof t?s._then(t.props,void 0,void 0,void 0,void 0):new c(s).promise(),s instanceof t&&r._propagateFrom(s,2),r):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}o.inherits(c,r),c.prototype._init=function(){},c.prototype._promiseFulfilled=function(e,t){if(this._values[t]=e,++this._totalResolved>=this._length){var r;if(this._isMap)r=function(e){for(var t=new s,r=e.length/2|0,n=0;n<r;++n){var i=e[r+n],o=e[n];t.set(i,o)}return t}(this._values);else{r={};for(var n=this.length(),i=0,o=this.length();i<o;++i)r[this._values[i+n]]=this._values[i]}return this._resolve(r),!0}return!1},c.prototype.shouldCopyValues=function(){return!1},c.prototype.getActualLength=function(e){return e>>1},t.prototype.props=function(){return h(this)},t.props=function(e){return h(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function n(e){this._capacity=e,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(e){return this._capacity<e},n.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1),this[this._front+t&this._capacity-1]=e,this._length=t+1},n.prototype.push=function(e,t,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(e),this._pushOne(t),void this._pushOne(r);var i=this._front+n-3;this._checkCapacity(n);var s=this._capacity-1;this[i+0&s]=e,this[i+1&s]=t,this[i+2&s]=r,this._length=n},n.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t},n.prototype.length=function(){return this._length},n.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},n.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e,function(e,t,r,n,i){for(var s=0;s<i;++s)r[s+n]=e[s+t],e[s+t]=void 0}(this,0,this,t,this._front+this._length&t-1)},t.exports=n},{}],27:[function(e,t,r){"use strict";t.exports=function(t,r,n,i){var s=e("./util"),o=function(e){return e.then(function(t){return a(t,e)})};function a(e,a){var u=n(e);if(u instanceof t)return o(u);if(null===(e=s.asArray(e)))return i("expecting an array or an iterable object but got "+s.classString(e));var l=new t(r);void 0!==a&&l._propagateFrom(a,3);for(var c=l._fulfill,h=l._reject,p=0,f=e.length;p<f;++p){var d=e[p];(void 0!==d||p in e)&&t.cast(d)._then(c,h,void 0,l,null)}return l}t.race=function(e){return a(e,void 0)},t.prototype.race=function(){return a(this,void 0)}}},{"./util":36}],28:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,s,o){var a=t._getDomain,u=e("./util"),l=u.tryCatch;function c(e,r,n,i){this.constructor$(e);var o=a();this._fn=null===o?r:u.domainBind(o,r),void 0!==n&&(n=t.resolve(n))._attachCancellationCallback(this),this._initialValue=n,this._currentCancellable=null,this._eachValues=i===s?Array(this._length):0===i?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function h(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function p(e,t,r,i){return"function"!=typeof t?n("expecting a function but got "+u.classString(t)):new c(e,t,r,i).promise()}function f(e){this.accum=e,this.array._gotAccum(e);var r=i(this.value,this.array._promise);return r instanceof t?(this.array._currentCancellable=r,r._then(d,void 0,void 0,this,void 0)):d.call(this,r)}function d(e){var r,n=this.array,i=n._promise,s=l(n._fn);i._pushContext(),(r=void 0!==n._eachValues?s.call(i._boundValue(),e,this.index,this.length):s.call(i._boundValue(),this.accum,e,this.index,this.length))instanceof t&&(n._currentCancellable=r);var a=i._popContext();return o.checkForgottenReturns(r,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",i),r}u.inherits(c,r),c.prototype._gotAccum=function(e){void 0!==this._eachValues&&null!==this._eachValues&&e!==s&&this._eachValues.push(e)},c.prototype._eachComplete=function(e){return null!==this._eachValues&&this._eachValues.push(e),this._eachValues},c.prototype._init=function(){},c.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},c.prototype.shouldCopyValues=function(){return!1},c.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},c.prototype._resultCancelled=function(e){if(e===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel())},c.prototype._iterate=function(e){var r,n;this._values=e;var i=e.length;if(void 0!==this._initialValue?(r=this._initialValue,n=0):(r=t.resolve(e[0]),n=1),this._currentCancellable=r,!r.isRejected())for(;n<i;++n){var s={accum:null,value:e[n],index:n,length:i,array:this};r=r._then(f,void 0,void 0,s,void 0)}void 0!==this._eachValues&&(r=r._then(this._eachComplete,void 0,void 0,this,void 0)),r._then(h,h,void 0,r,this)},t.prototype.reduce=function(e,t){return p(this,e,t,null)},t.reduce=function(e,t,r,n){return p(e,t,r,n)}}},{"./util":36}],29:[function(t,r,s){"use strict";var o,a=t("./util"),u=a.getNativePromise();if(a.isNode&&"undefined"==typeof MutationObserver){var l=n.setImmediate,c=e.nextTick;o=a.isRecentNode?function(e){l.call(n,e)}:function(t){c.call(e,t)}}else if("function"==typeof u&&"function"==typeof u.resolve){var h=u.resolve();o=function(e){h.then(e)}}else o="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?void 0!==i?function(e){i(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var e=document.createElement("div"),t={attributes:!0},r=!1,n=document.createElement("div");new MutationObserver(function(){e.classList.toggle("foo"),r=!1}).observe(n,t);return function(i){var s=new MutationObserver(function(){s.disconnect(),i()});s.observe(e,t),r||(r=!0,n.classList.toggle("foo"))}}();r.exports=o},{"./util":36}],30:[function(e,t,r){"use strict";t.exports=function(t,r,n){var i=t.PromiseInspection;function s(e){this.constructor$(e)}e("./util").inherits(s,r),s.prototype._promiseResolved=function(e,t){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},s.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},t.settle=function(e){return n.deprecated(".settle()",".reflect()"),new s(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,r){"use strict";t.exports=function(t,r,n){var i=e("./util"),s=e("./errors").RangeError,o=e("./errors").AggregateError,a=i.isArray,u={};function l(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function c(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new l(e),i=r.promise();return r.setHowMany(t),r.init(),i}i.inherits(l,r),l.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=a(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},l.prototype.init=function(){this._initialized=!0,this._init()},l.prototype.setUnwrap=function(){this._unwrap=!0},l.prototype.howMany=function(){return this._howMany},l.prototype.setHowMany=function(e){this._howMany=e},l.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},l.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},l.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},l.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new o,t=this.length();t<this._values.length;++t)this._values[t]!==u&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},l.prototype._fulfilled=function(){return this._totalResolved},l.prototype._rejected=function(){return this._values.length-this.length()},l.prototype._addRejected=function(e){this._values.push(e)},l.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},l.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},l.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new s(t)},l.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return c(e,t)},t.prototype.some=function(e){return c(this,e)},t._SomePromiseArray=l}},{"./errors":12,"./util":36}],32:[function(e,t,r){"use strict";t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var r=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},s=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},o=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},a=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return o.call(this._target())},e.prototype.isRejected=function(){return s.call(this._target())},e.prototype.isFulfilled=function(){return i.call(this._target())},e.prototype.isResolved=function(){return a.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),n.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,r){"use strict";t.exports=function(t,r){var n=e("./util"),i=n.errorObj,s=n.isObject;var o={}.hasOwnProperty;return function(e,a){if(s(e)){if(e instanceof t)return e;var u=function(e){try{return function(e){return e.then}(e)}catch(e){return i.e=e,i}}(e);if(u===i){a&&a._pushContext();var l=t.reject(u.e);return a&&a._popContext(),l}if("function"==typeof u)return function(e){try{return o.call(e,"_promise0")}catch(e){return!1}}(e)?(l=new t(r),e._then(l._fulfill,l._reject,void 0,l,null),l):function(e,s,o){var a=new t(r),u=a;o&&o._pushContext(),a._captureStackTrace(),o&&o._popContext();var l=!0,c=n.tryCatch(s).call(e,function(e){a&&(a._resolveCallback(e),a=null)},function(e){a&&(a._rejectCallback(e,l,!0),a=null)});return l=!1,a&&c===i&&(a._rejectCallback(c.e,!0,!0),a=null),u}(e,u,a)}return e}}},{"./util":36}],34:[function(e,t,r){"use strict";t.exports=function(t,r,n){var i=e("./util"),s=t.TimeoutError;function o(e){this.handle=e}o.prototype._resultCancelled=function(){clearTimeout(this.handle)};var a=function(e){return u(+this).thenReturn(e)},u=t.delay=function(e,i){var s,u;return void 0!==i?(s=t.resolve(i)._then(a,null,null,e,void 0),n.cancellation()&&i instanceof t&&s._setOnCancel(i)):(s=new t(r),u=setTimeout(function(){s._fulfill()},+e),n.cancellation()&&s._setOnCancel(new o(u)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};t.prototype.delay=function(e){return u(e,this)};function l(e){return clearTimeout(this.handle),e}function c(e){throw clearTimeout(this.handle),e}t.prototype.timeout=function(e,t){var r,a;e=+e;var u=new o(setTimeout(function(){r.isPending()&&function(e,t,r){var n;n="string"!=typeof t?t instanceof Error?t:new s("operation timed out"):new s(t),i.markAsOriginatingFromRejection(n),e._attachExtraTrace(n),e._reject(n),null!=r&&r.cancel()}(r,t,a)},e));return n.cancellation()?(a=this.then(),(r=a._then(l,c,void 0,u,void 0))._setOnCancel(u)):r=this._then(l,c,void 0,u,void 0),r}}},{"./util":36}],35:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,s,o){var a=e("./util"),u=e("./errors").TypeError,l=e("./util").inherits,c=a.errorObj,h=a.tryCatch,p={};function f(e){setTimeout(function(){throw e},0)}function d(e,r){var i=0,o=e.length,a=new t(s);return function s(){if(i>=o)return a._fulfill();var u=function(e){var t=n(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(e[i++]);if(u instanceof t&&u._isDisposable()){try{u=n(u._getDisposer().tryDispose(r),e.promise)}catch(e){return f(e)}if(u instanceof t)return u._then(s,f,null,null,null)}s()}(),a}function m(e,t,r){this._data=e,this._promise=t,this._context=r}function g(e,t,r){this.constructor$(e,t,r)}function v(e){return m.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function y(e){this.length=e,this.promise=null,this[e-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():p},m.prototype.tryDispose=function(e){var t=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=t!==p?this.doDispose(t,e):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},m.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},l(g,m),g.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},y.prototype._resultCancelled=function(){for(var e=this.length,r=0;r<e;++r){var n=this[r];n instanceof t&&n.cancel()}},t.using=function(){var e=arguments.length;if(e<2)return r("you must pass at least 2 arguments to Promise.using");var i,s=arguments[e-1];if("function"!=typeof s)return r("expecting a function but got "+a.classString(s));var u=!0;2===e&&Array.isArray(arguments[0])?(e=(i=arguments[0]).length,u=!1):(i=arguments,e--);for(var l=new y(e),p=0;p<e;++p){var f=i[p];if(m.isDisposer(f)){var g=f;(f=f.promise())._setDisposable(g)}else{var _=n(f);_ instanceof t&&(f=_._then(v,null,null,{resources:l,index:p},void 0))}l[p]=f}var b=new Array(l.length);for(p=0;p<b.length;++p)b[p]=t.resolve(l[p]).reflect();var x=t.all(b).then(function(e){for(var t=0;t<e.length;++t){var r=e[t];if(r.isRejected())return c.e=r.error(),c;if(!r.isFulfilled())return void x.cancel();e[t]=r.value()}w._pushContext(),s=h(s);var n=u?s.apply(void 0,e):s(e),i=w._popContext();return o.checkForgottenReturns(n,i,"Promise.using",w),n}),w=x.lastly(function(){var e=new t.PromiseInspection(x);return d(l,e)});return l.promise=w,w._setOnCancel(l),w},t.prototype._setDisposable=function(e){this._bitField=131072|this._bitField,this._disposer=e},t.prototype._isDisposable=function(){return(131072&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new g(e,this,i());throw new u}}},{"./errors":12,"./util":36}],36:[function(t,r,i){"use strict";var s=t("./es5"),o="undefined"==typeof navigator,a={e:{}},u,l="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:void 0!==this?this:null;function c(){try{var e=u;return u=null,e.apply(this,arguments)}catch(e){return a.e=e,a}}function h(e){return u=e,c}var p=function(e,t){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=e,this.constructor$=t,t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}return n.prototype=t.prototype,e.prototype=new n,e.prototype};function f(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function d(e){return"function"==typeof e||"object"==typeof e&&null!==e}function m(e){return f(e)?new Error(k(e)):e}function g(e,t){var r,n=e.length,i=new Array(n+1);for(r=0;r<n;++r)i[r]=e[r];return i[r]=t,i}function v(e,t,r){if(!s.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var n=Object.getOwnPropertyDescriptor(e,t);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function y(e,t,r){if(f(e))return e;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return s.defineProperty(e,t,n),e}function _(e){throw e}var b=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1};if(s.isES5){var r=Object.getOwnPropertyNames;return function(e){for(var n=[],i=Object.create(null);null!=e&&!t(e);){var o;try{o=r(e)}catch(e){return n}for(var a=0;a<o.length;++a){var u=o[a];if(!i[u]){i[u]=!0;var l=Object.getOwnPropertyDescriptor(e,u);null!=l&&null==l.get&&null==l.set&&n.push(u)}}e=s.getPrototypeOf(e)}return n}}var n={}.hasOwnProperty;return function(r){if(t(r))return[];var i=[];e:for(var s in r)if(n.call(r,s))i.push(s);else{for(var o=0;o<e.length;++o)if(n.call(e[o],s))continue e;i.push(s)}return i}}(),x=/this\s*\.\s*\S+\s*=/;function w(e){try{if("function"==typeof e){var t=s.names(e.prototype),r=s.isES5&&t.length>1,n=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=x.test(e+"")&&s.names(e).length>0;if(r||n||i)return!0}return!1}catch(e){return!1}}function E(e){function t(){}t.prototype=e;var r=new t;function n(){return typeof r.foo}return n(),n(),e}var T=/^[a-z$_][a-z$_0-9]*$/i;function A(e){return T.test(e)}function S(e,t,r){for(var n=new Array(e),i=0;i<e;++i)n[i]=t+i+r;return n}function k(e){try{return e+""}catch(e){return"[no string representation]"}}function C(e){return e instanceof Error||null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name}function I(e){try{y(e,"isOperational",!0)}catch(e){}}function R(e){return null!=e&&(e instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===e.isOperational)}function L(e){return C(e)&&s.propertyIsWritable(e,"stack")}var O="stack"in new Error?function(e){return L(e)?e:new Error(k(e))}:function(e){if(L(e))return e;try{throw new Error(k(e))}catch(e){return e}};function M(e){return{}.toString.call(e)}function P(e,t,r){for(var n=s.names(e),i=0;i<n.length;++i){var o=n[i];if(r(o))try{s.defineProperty(t,o,s.getDescriptor(e,o))}catch(e){}}}var B=function(e){return s.isArray(e)?e:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var N="function"==typeof Array.from?function(e){return Array.from(e)}:function(e){for(var t,r=[],n=e[Symbol.iterator]();!(t=n.next()).done;)r.push(t.value);return r};B=function(e){return s.isArray(e)?e:null!=e&&"function"==typeof e[Symbol.iterator]?N(e):null}}var D=void 0!==e&&"[object process]"===M(e).toLowerCase(),F=void 0!==e&&void 0!==e.env;function j(t){return F?e.env[t]:void 0}function U(){if("function"==typeof Promise)try{var e=new Promise(function(){});if("[object Promise]"==={}.toString.call(e))return Promise}catch(e){}}function $(e,t){return e.bind(t)}var V={isClass:w,isIdentifier:A,inheritedDataKeys:b,getDataPropertyOrDefault:v,thrower:_,isArray:s.isArray,asArray:B,notEnumerableProp:y,isPrimitive:f,isObject:d,isError:C,canEvaluate:o,errorObj:a,tryCatch:h,inherits:p,withAppended:g,maybeWrapAsError:m,toFastProperties:E,filledRange:S,toString:k,canAttachTrace:L,ensureErrorObject:O,originatesFromRejection:R,markAsOriginatingFromRejection:I,classString:M,copyDescriptors:P,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:D,hasEnvVariables:F,env:j,global:l,getNativePromise:U,domainBind:$},G;V.isRecentNode=V.isNode&&(G=e.versions.node.split(".").map(Number),0===G[0]&&G[1]>10||G[0]>0),V.isNode&&V.toFastProperties(e);try{throw new Error}catch(e){V.lastLineError=e}r.exports=V},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{_process:437,timers:514}],34:[function(e,t,r){var n=e("concat-map"),i=e("balanced-match");t.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function e(t,r){var s=[];var o=i("{","}",t);if(!o||/\$$/.test(o.pre))return[t];var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body);var l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body);var h=u||l;var g=o.body.indexOf(",")>=0;if(!h&&!g)return o.post.match(/,.*\}/)?(t=o.pre+"{"+o.body+a+o.post,e(t)):[t];var v;if(h)v=o.body.split(/\.\./);else if(1===(v=function e(t){if(!t)return[""];var r=[];var n=i("{","}",t);if(!n)return t.split(",");var s=n.pre;var o=n.body;var a=n.post;var u=s.split(",");u[u.length-1]+="{"+o+"}";var l=e(a);a.length&&(u[u.length-1]+=l.shift(),u.push.apply(u,l));r.push.apply(r,u);return r}(o.body)).length&&1===(v=e(v[0],!1).map(p)).length){var y=o.post.length?e(o.post,!1):[""];return y.map(function(e){return o.pre+v[0]+e})}var _=o.pre;var y=o.post.length?e(o.post,!1):[""];var b;if(h){var x=c(v[0]),w=c(v[1]),E=Math.max(v[0].length,v[1].length),T=3==v.length?Math.abs(c(v[2])):1,A=d,S=w<x;S&&(T*=-1,A=m);var k=v.some(f);b=[];for(var C=x;A(C,w);C+=T){var I;if(l)"\\"===(I=String.fromCharCode(C))&&(I="");else if(I=String(C),k){var R=E-I.length;if(R>0){var L=new Array(R+1).join("0");I=C<0?"-"+L+I.slice(1):L+I}}b.push(I)}}else b=n(v,function(t){return e(t,!1)});for(var O=0;O<b.length;O++)for(var M=0;M<y.length;M++){var P=_+b[O]+y[M];(!r||h||P)&&s.push(P)}return s}(function(e){return e.split("\\\\").join(s).split("\\{").join(o).split("\\}").join(a).split("\\,").join(u).split("\\.").join(l)}(e),!0).map(h)};var s="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",u="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function h(e){return e.split(s).join("\\").split(o).join("{").split(a).join("}").split(u).join(",").split(l).join(".")}function p(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function d(e,t){return e<=t}function m(e,t){return e>=t}},{"balanced-match":26,"concat-map":38}],35:[function(e,t,r){},{}],36:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],37:[function(e,t,r){var n,i;n=this,i=function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function t(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach(function(e){n(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function r(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s,o={exports:{}};s=o,"undefined"!=typeof window&&function(e){var t=e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype,r=e.Blob&&function(){try{return Boolean(new Blob)}catch(e){return!1}}(),n=r&&e.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(e){return!1}}(),i=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||e.MSBlobBuilder,o=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,a=(r||i)&&e.atob&&e.ArrayBuffer&&e.Uint8Array&&function(e){var t,s,a,u,l,c,h,p,f;if(!(t=e.match(o)))throw new Error("invalid data URI");for(s=t[2]?t[1]:"text/plain"+(t[3]||";charset=US-ASCII"),a=!!t[4],u=e.slice(t[0].length),l=a?atob(u):decodeURIComponent(u),c=new ArrayBuffer(l.length),h=new Uint8Array(c),p=0;p<l.length;p+=1)h[p]=l.charCodeAt(p);return r?new Blob([n?h:c],{type:s}):((f=new i).append(c),f.getBlob(s))};e.HTMLCanvasElement&&!t.toBlob&&(t.mozGetAsFile?t.toBlob=function(e,r,n){var i=this;setTimeout(function(){n&&t.toDataURL&&a?e(a(i.toDataURL(r,n))):e(i.mozGetAsFile("blob",r))})}:t.toDataURL&&a&&(t.msToBlob?t.toBlob=function(e,r,n){var i=this;setTimeout(function(){(r&&"image/png"!==r||n)&&t.toDataURL&&a?e(a(i.toDataURL(r,n))):e(i.msToBlob(r))})}:t.toBlob=function(e,t,r){var n=this;setTimeout(function(){e(a(n.toDataURL(t,r)))})})),s.exports?s.exports=a:e.dataURLtoBlob=a}(window);var a=o.exports,u={strict:!0,checkOrientation:!0,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},l="undefined"!=typeof window&&void 0!==window.document?window:{},c=function(e){return e>0&&e<1/0},h=Array.prototype.slice;var p=/^image\/.+$/;function f(e){return p.test(e)}var d=String.fromCharCode;var m=l.btoa;function g(e){var t,r=new DataView(e);try{var n,i,s;if(255===r.getUint8(0)&&216===r.getUint8(1))for(var o=r.byteLength,a=2;a+1<o;){if(255===r.getUint8(a)&&225===r.getUint8(a+1)){i=a;break}a+=1}if(i){var u=i+10;if("Exif"===function(e,t,r){var n,i="";for(r+=t,n=t;n<r;n+=1)i+=d(e.getUint8(n));return i}(r,i+4,4)){var l=r.getUint16(u);if(((n=18761===l)||19789===l)&&42===r.getUint16(u+2,n)){var c=r.getUint32(u+4,n);c>=8&&(s=u+c)}}}if(s){var h,p,f=r.getUint16(s,n);for(p=0;p<f;p+=1)if(h=s+12*p+2,274===r.getUint16(h,n)){h+=8,t=r.getUint16(h,n),r.setUint16(h,1,n);break}}}catch(e){t=1}return t}var v=/\.\d*(?:0|9){12}\d*$/;function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return v.test(e)?Math.round(e*t)/t:e}function _(e){var t=e.aspectRatio,r=e.height,n=e.width,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",s=c(n),o=c(r);if(s&&o){var a=r*t;("contain"===i||"none"===i)&&a>n||"cover"===i&&a<n?r=n/t:n=r*t}else s?r=n/t:o&&(n=r*t);return{width:n,height:r}}var b=l.ArrayBuffer,x=l.FileReader,w=l.URL||l.webkitURL,E=/\.\w+$/,T=l.Compressor;return function(){function e(r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.file=r,this.image=new Image,this.options=t(t({},u),n),this.aborted=!1,this.result=null,this.init()}var n,s,o;return n=e,o=[{key:"noConflict",value:function(){return window.Compressor=T,e}},{key:"setDefaults",value:function(e){i(u,e)}}],(s=[{key:"init",value:function(){var e=this,t=this.file,r=this.options;if(n=t,"undefined"!=typeof Blob&&(n instanceof Blob||"[object Blob]"===Object.prototype.toString.call(n))){var n,s=t.type;if(f(s))if(w&&x)if(b||(r.checkOrientation=!1),w&&!r.checkOrientation)this.load({url:w.createObjectURL(t)});else{var o=new x,a=r.checkOrientation&&"image/jpeg"===s;this.reader=o,o.onload=function(r){var n=r.target.result,o={};if(a){var u=g(n);u>1||!w?(o.url=function(e,t){for(var r,n=[],i=new Uint8Array(e);i.length>0;)n.push(d.apply(null,(r=i.subarray(0,8192),Array.from?Array.from(r):h.call(r)))),i=i.subarray(8192);return"data:".concat(t,";base64,").concat(m(n.join("")))}(n,s),u>1&&i(o,function(e){var t=0,r=1,n=1;switch(e){case 2:r=-1;break;case 3:t=-180;break;case 4:n=-1;break;case 5:t=90,n=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90}return{rotate:t,scaleX:r,scaleY:n}}(u))):o.url=w.createObjectURL(t)}else o.url=n;e.load(o)},o.onabort=function(){e.fail(new Error("Aborted to read the image with FileReader."))},o.onerror=function(){e.fail(new Error("Failed to read the image with FileReader."))},o.onloadend=function(){e.reader=null},a?o.readAsArrayBuffer(t):o.readAsDataURL(t)}else this.fail(new Error("The current browser does not support image compression."));else this.fail(new Error("The first argument must be an image File or Blob object."))}else this.fail(new Error("The first argument must be a File or Blob object."))}},{key:"load",value:function(e){var r=this,n=this.file,i=this.image;i.onload=function(){r.draw(t(t({},e),{},{naturalWidth:i.naturalWidth,naturalHeight:i.naturalHeight}))},i.onabort=function(){r.fail(new Error("Aborted to load the image."))},i.onerror=function(){r.fail(new Error("Failed to load the image."))},l.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(l.navigator.userAgent)&&(i.crossOrigin="anonymous"),i.alt=n.name,i.src=e.url}},{key:"draw",value:function(e){var t=this,r=e.naturalWidth,n=e.naturalHeight,i=e.rotate,s=void 0===i?0:i,o=e.scaleX,u=void 0===o?1:o,l=e.scaleY,h=void 0===l?1:l,p=this.file,d=this.image,m=this.options,g=document.createElement("canvas"),v=g.getContext("2d"),b=Math.abs(s)%180==90,x=("contain"===m.resize||"cover"===m.resize)&&c(m.width)&&c(m.height),w=Math.max(m.maxWidth,0)||1/0,E=Math.max(m.maxHeight,0)||1/0,T=Math.max(m.minWidth,0)||0,A=Math.max(m.minHeight,0)||0,S=r/n,k=m.width,C=m.height;if(b){var I=[E,w];w=I[0],E=I[1];var R=[A,T];T=R[0],A=R[1];var L=[C,k];k=L[0],C=L[1]}x&&(S=k/C);var O=_({aspectRatio:S,width:w,height:E},"contain");w=O.width,E=O.height;var M=_({aspectRatio:S,width:T,height:A},"cover");if(T=M.width,A=M.height,x){var P=_({aspectRatio:S,width:k,height:C},m.resize);k=P.width,C=P.height}else{var B=_({aspectRatio:S,width:k,height:C}),N=B.width;k=void 0===N?r:N;var D=B.height;C=void 0===D?n:D}var F=-(k=Math.floor(y(Math.min(Math.max(k,T),w))))/2,j=-(C=Math.floor(y(Math.min(Math.max(C,A),E))))/2,U=k,$=C,V=[];if(x){var G,z,W,H,K=_({aspectRatio:S,width:r,height:n},{contain:"cover",cover:"contain"}[m.resize]);W=K.width,H=K.height,G=(r-W)/2,z=(n-H)/2,V.push(G,z,W,H)}if(V.push(F,j,U,$),b){var q=[C,k];k=q[0],C=q[1]}g.width=k,g.height=C,f(m.mimeType)||(m.mimeType=p.type);var X="transparent";if(p.size>m.convertSize&&m.convertTypes.indexOf(m.mimeType)>=0&&(m.mimeType="image/jpeg"),"image/jpeg"===m.mimeType&&(X="#fff"),v.fillStyle=X,v.fillRect(0,0,k,C),m.beforeDraw&&m.beforeDraw.call(this,v,g),!this.aborted&&(v.save(),v.translate(k/2,C/2),v.rotate(s*Math.PI/180),v.scale(u,h),v.drawImage.apply(v,[d].concat(V)),v.restore(),m.drew&&m.drew.call(this,v,g),!this.aborted)){var Y=function(e){t.aborted||t.done({naturalWidth:r,naturalHeight:n,result:e})};g.toBlob?g.toBlob(Y,m.mimeType,m.quality):Y(a(g.toDataURL(m.mimeType,m.quality)))}}},{key:"done",value:function(e){var t,r,n=e.naturalWidth,i=e.naturalHeight,s=e.result,o=this.file,a=this.image,u=this.options;if(w&&!u.checkOrientation&&w.revokeObjectURL(a.src),s)if(u.strict&&s.size>o.size&&u.mimeType===o.type&&!(u.width>n||u.height>i||u.minWidth>n||u.minHeight>i||u.maxWidth<n||u.maxHeight<i))s=o;else{var l=new Date;s.lastModified=l.getTime(),s.lastModifiedDate=l,s.name=o.name,s.name&&s.type!==o.type&&(s.name=s.name.replace(E,(t=s.type,"jpeg"===(r=f(t)?t.substr(6):"")&&(r="jpg"),".".concat(r))))}else s=o;this.result=s,u.success&&u.success.call(this,s)}},{key:"fail",value:function(e){var t=this.options;if(!t.error)throw e;t.error.call(this,e)}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}])&&r(n.prototype,s),o&&r(n,o),e}()},"object"==typeof r&&void 0!==t?t.exports=i():"function"==typeof define&&define.amd?define(i):(n="undefined"!=typeof globalThis?globalThis:n||self).Compressor=i()},{}],38:[function(e,t,r){t.exports=function(e,t){for(var r=[],i=0;i<e.length;i++){var s=t(e[i],i);n(s)?r.push.apply(r,s):r.push(s)}return r};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],39:[function(e,t,r){t.exports={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:512,O_EXCL:2048,O_NOCTTY:131072,O_TRUNC:1024,O_APPEND:8,O_DIRECTORY:1048576,O_NOFOLLOW:256,O_SYNC:128,O_SYMLINK:2097152,O_NONBLOCK:4,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,E2BIG:7,EACCES:13,EADDRINUSE:48,EADDRNOTAVAIL:49,EAFNOSUPPORT:47,EAGAIN:35,EALREADY:37,EBADF:9,EBADMSG:94,EBUSY:16,ECANCELED:89,ECHILD:10,ECONNABORTED:53,ECONNREFUSED:61,ECONNRESET:54,EDEADLK:11,EDESTADDRREQ:39,EDOM:33,EDQUOT:69,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:65,EIDRM:90,EILSEQ:92,EINPROGRESS:36,EINTR:4,EINVAL:22,EIO:5,EISCONN:56,EISDIR:21,ELOOP:62,EMFILE:24,EMLINK:31,EMSGSIZE:40,EMULTIHOP:95,ENAMETOOLONG:63,ENETDOWN:50,ENETRESET:52,ENETUNREACH:51,ENFILE:23,ENOBUFS:55,ENODATA:96,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:77,ENOLINK:97,ENOMEM:12,ENOMSG:91,ENOPROTOOPT:42,ENOSPC:28,ENOSR:98,ENOSTR:99,ENOSYS:78,ENOTCONN:57,ENOTDIR:20,ENOTEMPTY:66,ENOTSOCK:38,ENOTSUP:45,ENOTTY:25,ENXIO:6,EOPNOTSUPP:102,EOVERFLOW:84,EPERM:1,EPIPE:32,EPROTO:100,EPROTONOSUPPORT:43,EPROTOTYPE:41,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:70,ETIME:101,ETIMEDOUT:60,ETXTBSY:26,EWOULDBLOCK:35,EXDEV:18,SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGILL:4,SIGTRAP:5,SIGABRT:6,SIGIOT:6,SIGBUS:10,SIGFPE:8,SIGKILL:9,SIGUSR1:30,SIGSEGV:11,SIGUSR2:31,SIGPIPE:13,SIGALRM:14,SIGTERM:15,SIGCHLD:20,SIGCONT:19,SIGSTOP:17,SIGTSTP:18,SIGTTIN:21,SIGTTOU:22,SIGURG:16,SIGXCPU:24,SIGXFSZ:25,SIGVTALRM:26,SIGPROF:27,SIGWINCH:28,SIGIO:23,SIGSYS:12,SSL_OP_ALL:2147486719,SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION:262144,SSL_OP_CIPHER_SERVER_PREFERENCE:4194304,SSL_OP_CISCO_ANYCONNECT:32768,SSL_OP_COOKIE_EXCHANGE:8192,SSL_OP_CRYPTOPRO_TLSEXT_BUG:2147483648,SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS:2048,SSL_OP_EPHEMERAL_RSA:0,SSL_OP_LEGACY_SERVER_CONNECT:4,SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER:32,SSL_OP_MICROSOFT_SESS_ID_BUG:1,SSL_OP_MSIE_SSLV2_RSA_PADDING:0,SSL_OP_NETSCAPE_CA_DN_BUG:536870912,SSL_OP_NETSCAPE_CHALLENGE_BUG:2,SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG:1073741824,SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG:8,SSL_OP_NO_COMPRESSION:131072,SSL_OP_NO_QUERY_MTU:4096,SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION:65536,SSL_OP_NO_SSLv2:16777216,SSL_OP_NO_SSLv3:33554432,SSL_OP_NO_TICKET:16384,SSL_OP_NO_TLSv1:67108864,SSL_OP_NO_TLSv1_1:268435456,SSL_OP_NO_TLSv1_2:134217728,SSL_OP_PKCS1_CHECK_1:0,SSL_OP_PKCS1_CHECK_2:0,SSL_OP_SINGLE_DH_USE:1048576,SSL_OP_SINGLE_ECDH_USE:524288,SSL_OP_SSLEAY_080_CLIENT_DH_BUG:128,SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG:0,SSL_OP_TLS_BLOCK_PADDING_BUG:512,SSL_OP_TLS_D5_BUG:256,SSL_OP_TLS_ROLLBACK_BUG:8388608,ENGINE_METHOD_DSA:2,ENGINE_METHOD_DH:4,ENGINE_METHOD_RAND:8,ENGINE_METHOD_ECDH:16,ENGINE_METHOD_ECDSA:32,ENGINE_METHOD_CIPHERS:64,ENGINE_METHOD_DIGESTS:128,ENGINE_METHOD_STORE:256,ENGINE_METHOD_PKEY_METHS:512,ENGINE_METHOD_PKEY_ASN1_METHS:1024,ENGINE_METHOD_ALL:65535,ENGINE_METHOD_NONE:0,DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_UDP_REUSEADDR:4}},{}],40:[function(e,t,r){(function(r){"use strict";var n=e("readable-stream").Readable,i=e("util");function s(e,t){if(!(this instanceof s))return new s(e,t);n.call(this,t),null!==e&&void 0!==e||(e=String(e)),this._obj=e}t.exports=s,i.inherits(s,n),s.prototype._read=function(e){var t=this._obj;"string"==typeof t?this.push(new r(t)):r.isBuffer(t)?this.push(t):this.push(new r(JSON.stringify(t))),this.push(null)}}).call(this,e("buffer").Buffer)},{buffer:299,"readable-stream":46,util:523}],41:[function(e,t,r){(function(r){t.exports=a;var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},i=e("core-util-is");i.inherits=e("inherits");var s=e("./_stream_readable"),o=e("./_stream_writable");function a(e){if(!(this instanceof a))return new a(e);s.call(this,e),o.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",u)}function u(){this.allowHalfOpen||this._writableState.ended||r.nextTick(this.end.bind(this))}i.inherits(a,s),function(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}(n(o.prototype),function(e){a.prototype[e]||(a.prototype[e]=o.prototype[e])})}).call(this,e("_process"))},{"./_stream_readable":43,"./_stream_writable":45,_process:437,"core-util-is":47,inherits:359}],42:[function(e,t,r){t.exports=s;var n=e("./_stream_transform"),i=e("core-util-is");function s(e){if(!(this instanceof s))return new s(e);n.call(this,e)}i.inherits=e("inherits"),i.inherits(s,n),s.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":44,"core-util-is":47,inherits:359}],43:[function(e,t,r){(function(r){t.exports=c;var n=e("isarray"),i=e("buffer").Buffer;c.ReadableState=l;var s=e("events").EventEmitter;s.listenerCount||(s.listenerCount=function(e,t){return e.listeners(t).length});var o,a=e("stream"),u=e("core-util-is");function l(t,r){var n=(t=t||{}).highWaterMark;this.highWaterMark=n||0===n?n:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(o||(o=e("string_decoder/").StringDecoder),this.decoder=new o(t.encoding),this.encoding=t.encoding)}function c(e){if(!(this instanceof c))return new c(e);this._readableState=new l(e,this),this.readable=!0,a.call(this)}function h(e,t,n,s,o){var a=function(e,t){var r=null;i.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,n);if(a)e.emit("error",a);else if(null===n||void 0===n)t.reading=!1,t.ended||function(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.length>0?d(e):b(e)}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!o){var u=new Error("stream.push() after EOF");e.emit("error",u)}else if(t.endEmitted&&o){u=new Error("stream.unshift() after end event");e.emit("error",u)}else!t.decoder||o||s||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,o?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&d(e),function(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(function(){!function(e,t){var r=t.length;for(;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}(e,t)}))}(e,t);else o||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}u.inherits=e("inherits"),u.inherits(c,a),c.prototype.push=function(e,t){var r=this._readableState;return"string"!=typeof e||r.objectMode||(t=t||r.defaultEncoding)!==r.encoding&&(e=new i(e,t),t=""),h(this,r,e,t,!1)},c.prototype.unshift=function(e){return h(this,this._readableState,e,"",!0)},c.prototype.setEncoding=function(t){o||(o=e("string_decoder/").StringDecoder),this._readableState.decoder=new o(t),this._readableState.encoding=t};var p=8388608;function f(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>=p)e=p;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function d(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?r.nextTick(function(){m(e)}):m(e))}function m(e){e.emit("readable")}function g(e){var t,r=e._readableState;function n(e,n,i){!1===e.write(t)&&r.awaitDrain++}for(r.awaitDrain=0;r.pipesCount&&null!==(t=e.read());)if(1===r.pipesCount?n(r.pipes):x(r.pipes,n),e.emit("data",t),r.awaitDrain>0)return;if(0===r.pipesCount)return r.flowing=!1,void(s.listenerCount(e,"data")>0&&y(e));r.ranOut=!0}function v(){this._readableState.ranOut&&(this._readableState.ranOut=!1,g(this))}function y(e,t){if(e._readableState.flowing)throw new Error("Cannot switch to old mode now.");var n=t||!1,i=!1;e.readable=!0,e.pipe=a.prototype.pipe,e.on=e.addListener=a.prototype.on,e.on("readable",function(){var t;for(i=!0;!n&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){n=!0,this.emit("pause")},e.resume=function(){n=!1,i?r.nextTick(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function _(e,t){var r,n=t.buffer,s=t.length,o=!!t.decoder,a=!!t.objectMode;if(0===n.length)return null;if(0===s)r=null;else if(a)r=n.shift();else if(!e||e>=s)r=o?n.join(""):i.concat(n,s),n.length=0;else{if(e<n[0].length)r=(h=n[0]).slice(0,e),n[0]=h.slice(e);else if(e===n[0].length)r=n.shift();else{r=o?"":new i(e);for(var u=0,l=0,c=n.length;l<c&&u<e;l++){var h=n[0],p=Math.min(e-u,h.length);o?r+=h.slice(0,p):h.copy(r,u,0,p),p<h.length?n[0]=h.slice(p):n.shift(),u+=p}}}return r}function b(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,r.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function x(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}c.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var r,n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return d(this),null;if(0===(e=f(e,t))&&t.ended)return r=null,t.length>0&&t.decoder&&(r=_(e,t),t.length-=r.length),0===t.length&&b(this),r;var i=t.needReadable;return t.length-e<=t.highWaterMark&&(i=!0),(t.ended||t.reading)&&(i=!1),i&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),i&&!t.reading&&(e=f(n,t)),null===(r=e>0?_(e,t):null)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&b(this),r},c.prototype._read=function(e){this.emit("error",new Error("not implemented"))},c.prototype.pipe=function(e,t){var i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1;var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:h;function u(e){e===i&&h()}function l(){e.end()}o.endEmitted?r.nextTick(a):i.once("end",a),e.on("unpipe",u);var c=function(e){return function(){var t=e._readableState;t.awaitDrain--,0===t.awaitDrain&&g(e)}}(i);function h(){e.removeListener("close",f),e.removeListener("finish",d),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",u),i.removeListener("end",l),i.removeListener("end",h),e._writableState&&!e._writableState.needDrain||c()}function p(t){m(),e.removeListener("error",p),0===s.listenerCount(e,"error")&&e.emit("error",t)}function f(){e.removeListener("finish",d),m()}function d(){e.removeListener("close",f),m()}function m(){i.unpipe(e)}return e.on("drain",c),e._events&&e._events.error?n(e._events.error)?e._events.error.unshift(p):e._events.error=[p,e._events.error]:e.on("error",p),e.once("close",f),e.once("finish",d),e.emit("pipe",i),o.flowing||(this.on("readable",v),o.flowing=!0,r.nextTick(function(){g(i)})),e},c.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",v),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",v),t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}return-1===(i=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}(t.pipes,e))?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},c.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||y(this),"readable"===e&&this.readable){var n=this._readableState;n.readableListening||(n.readableListening=!0,n.emittedReadable=!1,n.needReadable=!0,n.reading?n.length&&d(this):this.read(0))}return r},c.prototype.addListener=c.prototype.on,c.prototype.resume=function(){y(this),this.read(0),this.emit("resume")},c.prototype.pause=function(){y(this,!0),this.emit("pause")},c.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var i in e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),e.on("data",function(i){(t.decoder&&(i=t.decoder.write(i)),!t.objectMode||null!==i&&void 0!==i)&&((t.objectMode||i&&i.length)&&(n.push(i)||(r=!0,e.pause())))}),e)"function"==typeof e[i]&&void 0===this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return x(["error","close","destroy","pause","resume"],function(t){e.on(t,n.emit.bind(n,t))}),n._read=function(t){r&&(r=!1,e.resume())},n},c._fromList=_}).call(this,e("_process"))},{_process:437,buffer:299,"core-util-is":47,events:300,inherits:359,isarray:367,stream:503,"string_decoder/":508}],44:[function(e,t,r){t.exports=o;var n=e("./_stream_duplex"),i=e("core-util-is");function s(e,t){this.afterTransform=function(e,r){return function(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,null!==r&&void 0!==r&&e.push(r);i&&i(t);var s=e._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&e._read(s.highWaterMark)}(t,e,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function o(e){if(!(this instanceof o))return new o(e);n.call(this,e);this._transformState=new s(e,this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",function(){"function"==typeof this._flush?this._flush(function(e){a(t,e)}):a(t)})}function a(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=(e._readableState,e._transformState);if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}i.inherits=e("inherits"),i.inherits(o,n),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{"./_stream_duplex":41,"core-util-is":47,inherits:359}],45:[function(e,t,r){(function(r){t.exports=a;var n=e("buffer").Buffer;a.WritableState=o;var i=e("core-util-is");i.inherits=e("inherits");var s=e("stream");function o(e,t){var n=(e=e||{}).highWaterMark;this.highWaterMark=n||0===n?n:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,s=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,s){n?r.nextTick(function(){s(i)}):s(i);e._writableState.errorEmitted=!0,e.emit("error",i)}(e,0,i,t,s);else{var o=c(e,n);o||n.bufferProcessing||!n.buffer.length||function(e,t){t.bufferProcessing=!0;for(var r=0;r<t.buffer.length;r++){var n=t.buffer[r],i=n.chunk,s=n.encoding,o=n.callback,a=t.objectMode?1:i.length;if(u(e,t,a,i,s,o),t.writing){r++;break}}t.bufferProcessing=!1,r<t.buffer.length?t.buffer=t.buffer.slice(r):t.buffer.length=0}(e,n),i?r.nextTick(function(){l(e,n,o,s)}):l(e,n,o,s)}}(t,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.errorEmitted=!1}function a(t){var r=e("./_stream_duplex");if(!(this instanceof a||this instanceof r))return new a(t);this._writableState=new o(t,this),this.writable=!0,s.call(this)}function u(e,t,r,n,i,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,e._write(n,i,t.onwrite),t.sync=!1}function l(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),n(),r&&h(e,t)}function c(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function h(e,t){var r=c(0,t);return r&&(t.finished=!0,e.emit("finish")),r}i.inherits(a,s),a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},a.prototype.write=function(e,t,i){var s=this._writableState,o=!1;return"function"==typeof t&&(i=t,t=null),n.isBuffer(e)?t="buffer":t||(t=s.defaultEncoding),"function"!=typeof i&&(i=function(){}),s.ended?function(e,t,n){var i=new Error("write after end");e.emit("error",i),r.nextTick(function(){n(i)})}(this,0,i):function(e,t,i,s){var o=!0;if(!n.isBuffer(i)&&"string"!=typeof i&&null!==i&&void 0!==i&&!t.objectMode){var a=new TypeError("Invalid non-string/buffer chunk");e.emit("error",a),r.nextTick(function(){s(a)}),o=!1}return o}(this,s,e,i)&&(o=function(e,t,r,i,s){r=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=new n(t,r)),t}(t,r,i),n.isBuffer(r)&&(i="buffer");var o=t.objectMode?1:r.length;t.length+=o;var a=t.length<t.highWaterMark;a||(t.needDrain=!0);t.writing?t.buffer.push(new function(e,t,r){this.chunk=e,this.encoding=t,this.callback=r}(r,i,s)):u(e,t,o,r,i,s);return a}(this,s,e,t,i)),o},a.prototype._write=function(e,t,r){r(new Error("not implemented"))},a.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),void 0!==e&&null!==e&&this.write(e,t),i.ending||i.finished||function(e,t,n){t.ending=!0,h(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0}(this,i,n)}}).call(this,e("_process"))},{"./_stream_duplex":41,_process:437,buffer:299,"core-util-is":47,inherits:359,stream:503}],46:[function(e,t,r){(function(n){var i=e("stream");(r=t.exports=e("./lib/_stream_readable.js")).Stream=i,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),n.browser||"disable"!==n.env.READABLE_STREAM||(t.exports=e("stream"))}).call(this,e("_process"))},{"./lib/_stream_duplex.js":41,"./lib/_stream_passthrough.js":42,"./lib/_stream_readable.js":43,"./lib/_stream_transform.js":44,"./lib/_stream_writable.js":45,_process:437,stream:503}],47:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":361}],48:[function(e,t,r){"use strict";var n=e("./lib/thunk.js");t.exports=function(e){var t=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};t.pre=e.pre,t.body=e.body,t.post=e.post;var r=e.args.slice(0);t.argTypes=r;for(var i=0;i<r.length;++i){var s=r[i];if("array"===s||"object"==typeof s&&s.blockIndices){if(t.argTypes[i]="array",t.arrayArgs.push(i),t.arrayBlockIndices.push(s.blockIndices?s.blockIndices:0),t.shimArgs.push("array"+i),i<t.pre.args.length&&t.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array args");if(i<t.post.args.length&&t.post.args[i].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===s)t.scalarArgs.push(i),t.shimArgs.push("scalar"+i);else if("index"===s){if(t.indexArgs.push(i),i<t.pre.args.length&&t.pre.args[i].count>0)throw new Error("cwise: pre() block may not reference array index");if(i<t.body.args.length&&t.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array index");if(i<t.post.args.length&&t.post.args[i].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===s){if(t.shapeArgs.push(i),i<t.pre.args.length&&t.pre.args[i].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(i<t.body.args.length&&t.body.args[i].lvalue)throw new Error("cwise: body() block may not write to array shape");if(i<t.post.args.length&&t.post.args[i].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof s||!s.offset)throw new Error("cwise: Unknown argument type "+r[i]);t.argTypes[i]="offset",t.offsetArgs.push({array:s.array,offset:s.offset}),t.offsetArgIndex.push(i)}}if(t.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(t.pre.args.length>r.length)throw new Error("cwise: Too many arguments in pre() block");if(t.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(t.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return t.debug=!!e.printCode||!!e.debug,t.funcName=e.funcName||"cwise",t.blockSize=e.blockSize||64,n(t)}},{"./lib/thunk.js":50}],49:[function(e,t,r){"use strict";var n=e("uniq");function i(e,t,r){var n,i,s=e.length,o=t.arrayArgs.length,a=t.indexArgs.length>0,u=[],l=[],c=0,h=0;for(n=0;n<s;++n)l.push(["i",n,"=0"].join(""));for(i=0;i<o;++i)for(n=0;n<s;++n)h=c,c=e[n],0===n?l.push(["d",i,"s",n,"=t",i,"p",c].join("")):l.push(["d",i,"s",n,"=(t",i,"p",c,"-s",h,"*t",i,"p",h,")"].join(""));for(l.length>0&&u.push("var "+l.join(",")),n=s-1;n>=0;--n)c=e[n],u.push(["for(i",n,"=0;i",n,"<s",c,";++i",n,"){"].join(""));for(u.push(r),n=0;n<s;++n){for(h=c,c=e[n],i=0;i<o;++i)u.push(["p",i,"+=d",i,"s",n].join(""));a&&(n>0&&u.push(["index[",h,"]-=s",h].join("")),u.push(["++index[",c,"]"].join(""))),u.push("}")}return u.join("\n")}function s(e,t,r){for(var n=e.body,i=[],s=[],o=0;o<e.args.length;++o){var a=e.args[o];if(!(a.count<=0)){var u=new RegExp(a.name,"g"),l="",c=t.arrayArgs.indexOf(o);switch(t.argTypes[o]){case"offset":var h=t.offsetArgIndex.indexOf(o);c=t.offsetArgs[h].array,l="+q"+h;case"array":l="p"+c+l;var p="l"+o,f="a"+c;if(0===t.arrayBlockIndices[c])1===a.count?"generic"===r[c]?a.lvalue?(i.push(["var ",p,"=",f,".get(",l,")"].join("")),n=n.replace(u,p),s.push([f,".set(",l,",",p,")"].join(""))):n=n.replace(u,[f,".get(",l,")"].join("")):n=n.replace(u,[f,"[",l,"]"].join("")):"generic"===r[c]?(i.push(["var ",p,"=",f,".get(",l,")"].join("")),n=n.replace(u,p),a.lvalue&&s.push([f,".set(",l,",",p,")"].join(""))):(i.push(["var ",p,"=",f,"[",l,"]"].join("")),n=n.replace(u,p),a.lvalue&&s.push([f,"[",l,"]=",p].join("")));else{for(var d=[a.name],m=[l],g=0;g<Math.abs(t.arrayBlockIndices[c]);g++)d.push("\\s*\\[([^\\]]+)\\]"),m.push("$"+(g+1)+"*t"+c+"b"+g);if(u=new RegExp(d.join(""),"g"),l=m.join("+"),"generic"===r[c])throw new Error("cwise: Generic arrays not supported in combination with blocks!");n=n.replace(u,[f,"[",l,"]"].join(""))}break;case"scalar":n=n.replace(u,"Y"+t.scalarArgs.indexOf(o));break;case"index":n=n.replace(u,"index");break;case"shape":n=n.replace(u,"shape")}}}return[i.join("\n"),n,s.join("\n")].join("\n").trim()}t.exports=function(e,t){for(var r=t[1].length-Math.abs(e.arrayBlockIndices[0])|0,o=new Array(e.arrayArgs.length),a=new Array(e.arrayArgs.length),u=0;u<e.arrayArgs.length;++u)a[u]=t[2*u],o[u]=t[2*u+1];var l=[],c=[],h=[],p=[],f=[];for(u=0;u<e.arrayArgs.length;++u){e.arrayBlockIndices[u]<0?(h.push(0),p.push(r),l.push(r),c.push(r+e.arrayBlockIndices[u])):(h.push(e.arrayBlockIndices[u]),p.push(e.arrayBlockIndices[u]+r),l.push(0),c.push(e.arrayBlockIndices[u]));for(var d=[],m=0;m<o[u].length;m++)h[u]<=o[u][m]&&o[u][m]<p[u]&&d.push(o[u][m]-h[u]);f.push(d)}var g=["SS"],v=["'use strict'"],y=[];for(m=0;m<r;++m)y.push(["s",m,"=SS[",m,"]"].join(""));for(u=0;u<e.arrayArgs.length;++u){for(g.push("a"+u),g.push("t"+u),g.push("p"+u),m=0;m<r;++m)y.push(["t",u,"p",m,"=t",u,"[",h[u]+m,"]"].join(""));for(m=0;m<Math.abs(e.arrayBlockIndices[u]);++m)y.push(["t",u,"b",m,"=t",u,"[",l[u]+m,"]"].join(""))}for(u=0;u<e.scalarArgs.length;++u)g.push("Y"+u);if(e.shapeArgs.length>0&&y.push("shape=SS.slice(0)"),e.indexArgs.length>0){var _=new Array(r);for(u=0;u<r;++u)_[u]="0";y.push(["index=[",_.join(","),"]"].join(""))}for(u=0;u<e.offsetArgs.length;++u){var b=e.offsetArgs[u],x=[];for(m=0;m<b.offset.length;++m)0!==b.offset[m]&&(1===b.offset[m]?x.push(["t",b.array,"p",m].join("")):x.push([b.offset[m],"*t",b.array,"p",m].join("")));0===x.length?y.push("q"+u+"=0"):y.push(["q",u,"=",x.join("+")].join(""))}var w=n([].concat(e.pre.thisVars).concat(e.body.thisVars).concat(e.post.thisVars));for((y=y.concat(w)).length>0&&v.push("var "+y.join(",")),u=0;u<e.arrayArgs.length;++u)v.push("p"+u+"|=0");e.pre.body.length>3&&v.push(s(e.pre,e,a));var E=s(e.body,e,a),T=function(e){for(var t=0,r=e[0].length;t<r;){for(var n=1;n<e.length;++n)if(e[n][t]!==e[0][t])return t;++t}return t}(f);T<r?v.push(function(e,t,r,n){for(var s=t.length,o=r.arrayArgs.length,a=r.blockSize,u=r.indexArgs.length>0,l=[],c=0;c<o;++c)l.push(["var offset",c,"=p",c].join(""));for(c=e;c<s;++c)l.push(["for(var j"+c+"=SS[",t[c],"]|0;j",c,">0;){"].join("")),l.push(["if(j",c,"<",a,"){"].join("")),l.push(["s",t[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",t[c],"=",a].join("")),l.push(["j",c,"-=",a,"}"].join("")),u&&l.push(["index[",t[c],"]=j",c].join(""));for(c=0;c<o;++c){for(var h=["offset"+c],p=e;p<s;++p)h.push(["j",p,"*t",c,"p",t[p]].join(""));l.push(["p",c,"=(",h.join("+"),")"].join(""))}for(l.push(i(t,r,n)),c=e;c<s;++c)l.push("}");return l.join("\n")}(T,f[0],e,E)):v.push(i(f[0],e,E)),e.post.body.length>3&&v.push(s(e.post,e,a)),e.debug&&console.log("-----Generated cwise routine for ",t,":\n"+v.join("\n")+"\n----------");var A=[e.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",T,function(e){for(var t=new Array(e.length),r=!0,n=0;n<e.length;++n){var i=e[n],s=i.match(/\d+/);s=s?s[0]:"",0===i.charAt(0)?t[n]="u"+i.charAt(1)+s:t[n]=i.charAt(0)+s,n>0&&(r=r&&t[n]===t[n-1])}return r?t[0]:t.join("")}(a)].join("");return new Function(["function ",A,"(",g.join(","),"){",v.join("\n"),"} return ",A].join(""))()}},{uniq:517}],50:[function(e,t,r){"use strict";var n=e("./compile.js");t.exports=function(e){var t=["'use strict'","var CACHED={}"],r=[],i=e.funcName+"_cwise_thunk";t.push(["return function ",i,"(",e.shimArgs.join(","),"){"].join(""));for(var s=[],o=[],a=[["array",e.arrayArgs[0],".shape.slice(",Math.max(0,e.arrayBlockIndices[0]),e.arrayBlockIndices[0]<0?","+e.arrayBlockIndices[0]+")":")"].join("")],u=[],l=[],c=0;c<e.arrayArgs.length;++c){var h=e.arrayArgs[c];r.push(["t",h,"=array",h,".dtype,","r",h,"=array",h,".order"].join("")),s.push("t"+h),s.push("r"+h),o.push("t"+h),o.push("r"+h+".join()"),a.push("array"+h+".data"),a.push("array"+h+".stride"),a.push("array"+h+".offset|0"),c>0&&(u.push("array"+e.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(e.arrayBlockIndices[0])-Math.abs(e.arrayBlockIndices[c]))),l.push("array"+e.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,e.arrayBlockIndices[c])+"]"))}for(e.arrayArgs.length>1&&(t.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),t.push("for(var shapeIndex=array"+e.arrayArgs[0]+".shape.length-"+Math.abs(e.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),t.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),t.push("}")),c=0;c<e.scalarArgs.length;++c)a.push("scalar"+e.scalarArgs[c]);return r.push(["type=[",o.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),t.push("var "+r.join(",")),t.push(["if(!proc){","CACHED[type]=proc=compile([",s.join(","),"])}","return proc(",a.join(","),")}"].join("")),e.debug&&console.log("-----Generated thunk:\n"+t.join("\n")+"\n----------"),new Function("compile",t.join("\n"))(n.bind(void 0,e))}},{"./compile.js":49}],51:[function(e,t,r){(function(e){"use strict";t.exports=function(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');const r=(t=t.replace(/\r?\n/g,"")).indexOf(",");if(-1===r||r<=4)throw new TypeError("malformed data: URI");const n=t.substring(5,r).split(";");let i="",s=!1;const o=n[0]||"text/plain";let a=o;for(let e=1;e<n.length;e++)"base64"===n[e]?s=!0:(a+=`;${n[e]}`,0===n[e].indexOf("charset=")&&(i=n[e].substring(8)));n[0]||i.length||(a+=";charset=US-ASCII",i="US-ASCII");const u=s?"base64":"ascii",l=unescape(t.substring(r+1)),c=e.from(l,u);return c.type=o,c.typeFull=a,c.charset=i,c}}).call(this,e("buffer").Buffer)},{buffer:299}],52:[function(e,t,r){"use strict";var n={single_source_shortest_paths:function(e,t,r){var i={},s={};s[t]=0;var o,a,u,l,c,h,p,f=n.PriorityQueue.make();for(f.push(t,0);!f.empty();)for(u in a=(o=f.pop()).value,l=o.cost,c=e[a]||{})c.hasOwnProperty(u)&&(h=l+c[u],p=s[u],(void 0===s[u]||p>h)&&(s[u]=h,f.push(u,h),i[u]=a));if(void 0!==r&&void 0===s[r]){var d=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(d)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t,r=n.PriorityQueue,i={};for(t in e=e||{},r)r.hasOwnProperty(t)&&(i[t]=r[t]);return i.queue=[],i.sorter=e.sorter||r.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==t&&(t.exports=n)},{}],53:[function(e,t,r){(function(r){"use strict";const n=e("path"),i=e("path-type"),s=e=>e.length>1?`{${e.join(",")}}`:e[0],o=(e,t)=>{const r="!"===e[0]?e.slice(1):e;return n.isAbsolute(r)?r:n.join(t,r)},a=(e,t)=>{if(t.files&&!Array.isArray(t.files))throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof t.files}\``);if(t.extensions&&!Array.isArray(t.extensions))throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof t.extensions}\``);return t.files&&t.extensions?t.files.map(r=>n.posix.join(e,((e,t)=>n.extname(e)?`**/${e}`:`**/${e}.${s(t)}`)(r,t.extensions))):t.files?t.files.map(t=>n.posix.join(e,`**/${t}`)):t.extensions?[n.posix.join(e,`**/*.${s(t.extensions)}`)]:[n.posix.join(e,"**")]};t.exports=(async(e,t)=>{if("string"!=typeof(t={cwd:r.cwd(),...t}).cwd)throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof t.cwd}\``);const n=await Promise.all([].concat(e).map(async e=>{return await i.isDirectory(o(e,t.cwd))?a(e,t):e}));return[].concat.apply([],n)}),t.exports.sync=((e,t)=>{if("string"!=typeof(t={cwd:r.cwd(),...t}).cwd)throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof t.cwd}\``);const n=[].concat(e).map(e=>i.isDirectorySync(o(e,t.cwd))?a(e,t):e);return[].concat.apply([],n)})}).call(this,e("_process"))},{_process:437,path:404,"path-type":54}],54:[function(e,t,r){"use strict";const{promisify:n}=e("util"),i=e("fs");async function s(e,t,r){if("string"!=typeof r)throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await n(i[e])(r))[t]()}catch(e){if("ENOENT"===e.code)return!1;throw e}}function o(e,t,r){if("string"!=typeof r)throw new TypeError(`Expected a string, got ${typeof r}`);try{return i[e](r)[t]()}catch(e){if("ENOENT"===e.code)return!1;throw e}}r.isFile=s.bind(null,"stat","isFile"),r.isDirectory=s.bind(null,"stat","isDirectory"),r.isSymlink=s.bind(null,"lstat","isSymbolicLink"),r.isFileSync=o.bind(null,"statSync","isFile"),r.isDirectorySync=o.bind(null,"statSync","isDirectory"),r.isSymlinkSync=o.bind(null,"lstatSync","isSymbolicLink")},{fs:298,util:523}],55:[function(e,t,r){"use strict";t.exports=function(e){for(var t=[],r=e.length,n=0;n<r;n++){var i=e.charCodeAt(n);if(i>=55296&&i<=56319&&r>n+1){var s=e.charCodeAt(n+1);s>=56320&&s<=57343&&(i=1024*(i-55296)+s-56320+65536,n+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}},{}],56:[function(e,t,r){var n=e("once"),i=function(){},s=function(e,t,r){if("function"==typeof t)return s(e,null,t);t||(t={}),r=n(r||i);var o=e._writableState,a=e._readableState,u=t.readable||!1!==t.readable&&e.readable,l=t.writable||!1!==t.writable&&e.writable,c=function(){e.writable||h()},h=function(){l=!1,u||r.call(e)},p=function(){u=!1,l||r.call(e)},f=function(t){r.call(e,t?new Error("exited with error code: "+t):null)},d=function(t){r.call(e,t)},m=function(){return(!u||a&&a.ended)&&(!l||o&&o.ended)?void 0:r.call(e,new Error("premature close"))},g=function(){e.req.on("finish",h)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?l&&!o&&(e.on("end",c),e.on("close",c)):(e.on("complete",h),e.on("abort",m),e.req?g():e.on("request",g)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",f),e.on("end",p),e.on("finish",h),!1!==t.error&&e.on("error",d),e.on("close",m),function(){e.removeListener("complete",h),e.removeListener("abort",m),e.removeListener("request",g),e.req&&e.req.removeListener("finish",h),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",h),e.removeListener("exit",f),e.removeListener("end",p),e.removeListener("error",d),e.removeListener("close",m)}};t.exports=s},{once:399}],57:[function(e,t,r){(function(r){"use strict";const n=e("fs"),i=e("execa"),s=e("p-finally"),o=e("pify"),a=e("rimraf"),u=e("tempfile"),l=o(n),c=o(a),h=Symbol("inputPath"),p=Symbol("outputPath");t.exports=(e=>{if(e=Object.assign({},e),!r.isBuffer(e.input))return Promise.reject(new Error("Input is required"));if("string"!=typeof e.bin)return Promise.reject(new Error("Binary is required"));if(!Array.isArray(e.args))return Promise.reject(new Error("Arguments are required"));const t=e.inputPath||u(),n=e.outputPath||u();e.args=e.args.map(e=>e===h?t:e===p?n:e);const o=l.writeFile(t,e.input).then(()=>i(e.bin,e.args)).then(()=>l.readFile(n));return s(o,()=>Promise.all([c(t),c(n)]))}),t.exports.input=h,t.exports.output=p}).call(this,{isBuffer:e("../is-buffer/index.js")})},{"../is-buffer/index.js":361,execa:66,fs:298,"p-finally":402,pify:71,rimraf:493,tempfile:512}],58:[function(e,t,r){"use strict";var n=e("child_process"),i=e("./lib/parse"),s=e("./lib/enoent"),o=n.spawnSync;function a(e,t,r){var o,a;return o=i(e,t,r),a=n.spawn(o.command,o.args,o.options),s.hookChildProcess(a,o),a}t.exports=a,t.exports.spawn=a,t.exports.sync=function(t,r,n){var a,u;if(!o)try{o=e("spawn-sync")}catch(e){throw new Error("In order to use spawnSync on node 0.10 or older, you must install spawn-sync:\n\n npm install spawn-sync --save")}return a=i(t,r,n),(u=o(a.command,a.args,a.options)).error=u.error||s.verifyENOENTSync(u.status,a),u},t.exports._parse=i,t.exports._enoent=s},{"./lib/enoent":59,"./lib/parse":60,child_process:298,"spawn-sync":502}],59:[function(e,t,r){(function(r){"use strict";var n="win32"===r.platform,i=e("./util/resolveCommand"),s=0===r.version.indexOf("v0.10.");function o(e,t){var r;return(r=new Error(t+" "+e+" ENOENT")).code=r.errno="ENOENT",r.syscall=t+" "+e,r}function a(e,t){return n&&1===e&&!t.file?o(t.original,"spawn"):null}t.exports.hookChildProcess=function(e,t){var r;n&&(r=e.emit,e.emit=function(n,i){var s;return"exit"===n&&(s=a(i,t))?r.call(e,"error",s):r.apply(e,arguments)})},t.exports.verifyENOENT=a,t.exports.verifyENOENTSync=function(e,t){return n&&1===e&&!t.file?o(t.original,"spawnSync"):s&&-1===e&&(t.file=n?t.file:i(t.original),!t.file)?o(t.original,"spawnSync"):null},t.exports.notFoundError=o}).call(this,e("_process"))},{"./util/resolveCommand":65,_process:437}],60:[function(e,t,r){(function(r){"use strict";var n=e("./util/resolveCommand"),i=e("./util/hasEmptyArgumentBug"),s=e("./util/escapeArgument"),o=e("./util/escapeCommand"),a=e("./util/readShebang"),u="win32"===r.platform,l=/\.(?:com|exe)$/i,c=parseInt(r.version.substr(1).split(".")[0],10)>=6||4===parseInt(r.version.substr(1).split(".")[0],10)&&parseInt(r.version.substr(1).split(".")[1],10)>=8;t.exports=function(e,t,h){var p;return t&&!Array.isArray(t)&&(h=t,t=null),p={command:e,args:t=t?t.slice(0):[],options:h=h||{},file:void 0,original:e},h.shell?function(e){var t;return c?e:(t=[e.command].concat(e.args).join(" "),u?(e.command="string"==typeof e.options.shell?e.options.shell:r.env.comspec||"cmd.exe",e.args=["/d","/s","/c",'"'+t+'"'],e.options.windowsVerbatimArguments=!0):("string"==typeof e.options.shell?e.command=e.options.shell:"android"===r.platform?e.command="/system/bin/sh":e.command="/bin/sh",e.args=["-c",t]),e)}(p):function(e){var t,c,h;return u?(e.file=n(e.command),e.file=e.file||n(e.command,!0),(t=e.file&&a(e.file))?(e.args.unshift(e.file),e.command=t,c=i||!l.test(n(t)||n(t,!0))):c=i||!l.test(e.file),c&&(h="echo"!==e.command,e.command=o(e.command),e.args=e.args.map(function(e){return s(e,h)}),e.args=["/d","/s","/c",'"'+e.command+(e.args.length?" "+e.args.join(" "):"")+'"'],e.command=r.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0),e):e}(p)}}).call(this,e("_process"))},{"./util/escapeArgument":61,"./util/escapeCommand":62,"./util/hasEmptyArgumentBug":63,"./util/readShebang":64,"./util/resolveCommand":65,_process:437}],61:[function(e,t,r){"use strict";t.exports=function(e,t){return e=""+e,e=t?'"'+(e=(e=e.replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1"))+'"':e.replace(/([()%!^<>&|;,"'\s])/g,"^$1")}},{}],62:[function(e,t,r){"use strict";var n=e("./escapeArgument");t.exports=function(e){return/^[a-z0-9_-]+$/i.test(e)?e:n(e,!0)}},{"./escapeArgument":61}],63:[function(e,t,r){(function(e){"use strict";var r;t.exports="win32"===e.platform&&0===(r=e.version.substr(1).split(".").map(function(e){return parseInt(e,10)}))[0]&&r[1]<12}).call(this,e("_process"))},{_process:437}],64:[function(e,t,r){(function(r){"use strict";var n=e("fs"),i=e("lru-cache"),s=e("shebang-command"),o=new i({max:50,maxAge:3e4});t.exports=function(e){var t,i,a;if(o.has(e))return o.get(e);t=new r(150);try{i=n.openSync(e,"r"),n.readSync(i,t,0,150,0),n.closeSync(i)}catch(e){}return a=s(t.toString()),o.set(e,a),a}}).call(this,e("buffer").Buffer)},{buffer:299,fs:298,"lru-cache":377,"shebang-command":497}],65:[function(e,t,r){(function(r){"use strict";var n=e("path"),i=e("which"),s=new(e("lru-cache"))({max:50,maxAge:3e4});t.exports=function(e,t){var o;if(t=!!t,o=s.get(e+"!"+t),s.has(e))return s.get(e);try{o=t?i.sync(e,{pathExt:n.delimiter+(r.env.PATHEXT||"")}):i.sync(e)}catch(e){}return s.set(e+"!"+t,o),o}}).call(this,e("_process"))},{_process:437,"lru-cache":377,path:404,which:530}],66:[function(e,t,r){(function(r){"use strict";const n=e("child_process"),i=e("util"),s=e("cross-spawn"),o=e("strip-eof"),a=e("npm-run-path"),u=e("is-stream"),l=e("get-stream"),c=e("p-finally"),h=e("signal-exit"),p=e("./lib/errname"),f=e("./lib/stdio"),d=1e7;function m(e,t,n){let i;return n&&n.env&&!1!==n.extendEnv&&(n.env=Object.assign({},r.env,n.env)),n&&!0===n.__winShell?(delete n.__winShell,i={command:e,args:t,options:n,file:e,original:e}):i=s._parse(e,t,n),(n=Object.assign({maxBuffer:d,stripEof:!0,preferLocal:!0,localDir:i.options.cwd||r.cwd(),encoding:"utf8",reject:!0,cleanup:!0},i.options)).stdio=f(n),n.preferLocal&&(n.env=a.env(Object.assign({},n,{cwd:n.localDir}))),{cmd:i.command,args:i.args,opts:n,parsed:i}}function g(e,t){return t&&e.stripEof&&(t=o(t)),t}function v(e,t,n){let i="/bin/sh",s=["-c",t];return n=Object.assign({},n),"win32"===r.platform&&(n.__winShell=!0,i=r.env.comspec||"cmd.exe",s=["/s","/c",`"${t}"`],n.windowsVerbatimArguments=!0),n.shell&&(i=n.shell,delete n.shell),e(i,s,n)}function y(e,t,r,n){if(!e[t])return null;let i;return(i=r?l(e[t],{encoding:r,maxBuffer:n}):l.buffer(e[t],{maxBuffer:n})).catch(e=>{throw e.stream=t,e.message=`${t} ${e.message}`,e})}t.exports=((e,t,r)=>{let i=e;Array.isArray(t)&&t.length>0&&(i+=" "+t.join(" "));const o=m(e,t,r),a=o.opts.encoding,l=o.opts.maxBuffer;let f,d;try{f=n.spawn(o.cmd,o.args,o.opts)}catch(e){return Promise.reject(e)}o.opts.cleanup&&(d=h(()=>{f.kill()}));let v=null,_=!1;const b=()=>{v&&(clearTimeout(v),v=null)};o.opts.timeout>0&&(v=setTimeout(()=>{v=null,_=!0,f.kill(o.opts.killSignal)},o.opts.timeout));const x=new Promise(e=>{f.on("exit",(t,r)=>{b(),e({code:t,signal:r})}),f.on("error",t=>{b(),e({err:t})}),f.stdin&&f.stdin.on("error",t=>{b(),e({err:t})})});const w=c(Promise.all([x,y(f,"stdout",a,l),y(f,"stderr",a,l)]).then(e=>{const t=e[0],r=e[1],n=e[2];let s=t.err;const a=t.code,u=t.signal;if(d&&d(),s||0!==a||null!==u){if(!s){let e="";Array.isArray(o.opts.stdio)?("inherit"!==o.opts.stdio[2]&&(e+=e.length>0?n:`\n${n}`),"inherit"!==o.opts.stdio[1]&&(e+=`\n${r}`)):"inherit"!==o.opts.stdio&&(e=`\n${n}${r}`),(s=new Error(`Command failed: ${i}${e}`)).code=a<0?p(a):a}if(s.killed=s.killed||f.killed,s.stdout=r,s.stderr=n,s.failed=!0,s.signal=u||null,s.cmd=i,s.timedOut=_,!o.opts.reject)return s;throw s}return{stdout:g(o.opts,r),stderr:g(o.opts,n),code:0,failed:!1,killed:!1,signal:null,cmd:i,timedOut:!1}}),function(){f.stdout&&f.stdout.destroy(),f.stderr&&f.stderr.destroy()});return s._enoent.hookChildProcess(f,o.parsed),function(e,t){const r=t.input;null!==r&&void 0!==r&&(u(r)?r.pipe(e.stdin):e.stdin.end(r))}(f,o.opts),f.then=w.then.bind(w),f.catch=w.catch.bind(w),f}),t.exports.stdout=function(){return t.exports.apply(null,arguments).then(e=>e.stdout)},t.exports.stderr=function(){return t.exports.apply(null,arguments).then(e=>e.stderr)},t.exports.shell=((e,r)=>v(t.exports,e,r)),t.exports.sync=((e,t,r)=>{const i=m(e,t,r);if(u(i.opts.input))throw new TypeError("The `input` option cannot be a stream in sync mode");const s=n.spawnSync(i.cmd,i.args,i.opts);if(s.error||0!==s.status)throw s.error||new Error(""===s.stderr?s.stdout:s.stderr);return s.stdout=g(i.opts,s.stdout),s.stderr=g(i.opts,s.stderr),s}),t.exports.shellSync=((e,r)=>v(t.exports.sync,e,r)),t.exports.spawn=i.deprecate(t.exports,"execa.spawn() is deprecated. Use execa() instead.")}).call(this,e("_process"))},{"./lib/errname":67,"./lib/stdio":68,_process:437,child_process:298,"cross-spawn":58,"get-stream":70,"is-stream":366,"npm-run-path":397,"p-finally":402,"signal-exit":499,"strip-eof":509,util:523}],67:[function(e,t,r){(function(e){"use strict";let r;try{if("function"!=typeof(r=e.binding("uv")).errname)throw new TypeError("uv.errname is not a function")}catch(e){console.error("execa/lib/errname: unable to establish process.binding('uv')",e),r=null}function n(e,t){if(e)return e.errname(t);if(!(t<0))throw new Error("err >= 0");return`Unknown system error ${t}`}t.exports=(e=>n(r,e)),t.exports.__test__=n}).call(this,e("_process"))},{_process:437}],68:[function(e,t,r){"use strict";const n=["stdin","stdout","stderr"];t.exports=(e=>{if(!e)return null;if(e.stdio&&(e=>n.some(t=>Boolean(e[t])))(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${n.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof e.stdio)return e.stdio;const t=e.stdio||[];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const r=[],i=Math.max(t.length,n.length);for(let s=0;s<i;s++){let i=null;void 0!==t[s]?i=t[s]:void 0!==e[n[s]]&&(i=e[n[s]]),r[s]=i}return r})},{}],69:[function(e,t,r){(function(r){"use strict";const n=e("stream").PassThrough;t.exports=(e=>{const t=(e=Object.assign({},e)).array;let i=e.encoding;const s="buffer"===i;let o=!1;t?o=!(i||s):i=i||"utf8",s&&(i=null);let a=0;const u=[],l=new n({objectMode:o});return i&&l.setEncoding(i),l.on("data",e=>{u.push(e),o?a=u.length:a+=e.length}),l.getBufferedValue=(()=>t?u:s?r.concat(u,a):u.join("")),l.getBufferedLength=(()=>a),l})}).call(this,e("buffer").Buffer)},{buffer:299,stream:503}],70:[function(e,t,r){"use strict";const n=e("./buffer-stream");function i(e,t){if(!e)return Promise.reject(new Error("Expected a stream"));const r=(t=Object.assign({maxBuffer:1/0},t)).maxBuffer;let i,s;const o=new Promise((o,a)=>{const u=e=>{e&&(e.bufferedData=i.getBufferedValue()),a(e)};i=n(t),e.once("error",u),e.pipe(i),i.on("data",()=>{i.getBufferedLength()>r&&a(new Error("maxBuffer exceeded"))}),i.once("error",u),i.on("end",o),s=(()=>{e.unpipe&&e.unpipe(i)})});return o.then(s,s),o.then(()=>i.getBufferedValue())}t.exports=i,t.exports.buffer=((e,t)=>i(e,Object.assign({},t,{encoding:"buffer"}))),t.exports.array=((e,t)=>i(e,Object.assign({},t,{array:!0})))},{"./buffer-stream":69}],71:[function(e,t,r){"use strict";const n=(e,t)=>(function(){const r=t.promiseModule,n=new Array(arguments.length);for(let e=0;e<arguments.length;e++)n[e]=arguments[e];return new r((r,i)=>{t.errorFirst?n.push(function(e,n){if(t.multiArgs){const t=new Array(arguments.length-1);for(let e=1;e<arguments.length;e++)t[e-1]=arguments[e];e?(t.unshift(e),i(t)):r(t)}else e?i(e):r(n)}):n.push(function(e){if(t.multiArgs){const e=new Array(arguments.length-1);for(let t=0;t<arguments.length;t++)e[t]=arguments[t];r(e)}else r(e)}),e.apply(this,n)})});t.exports=((e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=e=>{const r=t=>"string"==typeof t?e===t:t.test(e);return t.include?t.include.some(r):!t.exclude.some(r)};let i;i="function"==typeof e?function(){return t.excludeMain?e.apply(this,arguments):n(e,t).apply(this,arguments)}:Object.create(Object.getPrototypeOf(e));for(const s in e){const o=e[s];i[s]="function"==typeof o&&r(s)?n(o,t):o}return i})},{}],72:[function(e,t,r){var n,i;n=this,i=function(e){"use strict";var t="INUMBER",r="IOP1",n="IOP2",i="IOP3",s="IVAR",o="IVARNAME",a="IFUNCALL",u="IFUNDEF",l="IEXPR",c="IEXPREVAL",h="IMEMBER",p="IENDSTATEMENT",f="IARRAY";function d(e,t){this.type=e,this.value=void 0!==t&&null!==t?t:0}function m(e){return new d(r,e)}function g(e){return new d(n,e)}function v(e){return new d(i,e)}function y(e,d,m){var g,v,w,E,T,A,S=[];if(b(e))return x(e,m);for(var k=e.length,C=0;C<k;C++){var I=e[C],R=I.type;if(R===t||R===o)S.push(I.value);else if(R===n)v=S.pop(),g=S.pop(),"and"===I.value?S.push(!!g&&!!y(v,d,m)):"or"===I.value?S.push(!!g||!!y(v,d,m)):"="===I.value?(E=d.binaryOps[I.value],S.push(E(g,y(v,d,m),m))):(E=d.binaryOps[I.value],S.push(E(x(g,m),x(v,m))));else if(R===i)w=S.pop(),v=S.pop(),g=S.pop(),"?"===I.value?S.push(y(g?v:w,d,m)):(E=d.ternaryOps[I.value],S.push(E(x(g,m),x(v,m),x(w,m))));else if(R===s)if(I.value in d.functions)S.push(d.functions[I.value]);else if(I.value in d.unaryOps&&d.parser.isOperatorEnabled(I.value))S.push(d.unaryOps[I.value]);else{var L=m[I.value];if(void 0===L)throw new Error("undefined variable: "+I.value);S.push(L)}else if(R===r)g=S.pop(),E=d.unaryOps[I.value],S.push(E(x(g,m)));else if(R===a){for(A=I.value,T=[];A-- >0;)T.unshift(x(S.pop(),m));if(!(E=S.pop()).apply||!E.call)throw new Error(E+" is not a function");S.push(E.apply(void 0,T))}else if(R===u)S.push(function(){for(var e=S.pop(),t=[],r=I.value;r-- >0;)t.unshift(S.pop());var n=S.pop(),i=function(){for(var r=Object.assign({},m),n=0,i=t.length;n<i;n++)r[t[n]]=arguments[n];return y(e,d,r)};return Object.defineProperty(i,"name",{value:n,writable:!1}),m[n]=i,i}());else if(R===l)S.push(_(I,d));else if(R===c)S.push(I);else if(R===h)g=S.pop(),S.push(g[I.value]);else if(R===p)S.pop();else{if(R!==f)throw new Error("invalid Expression");for(A=I.value,T=[];A-- >0;)T.unshift(S.pop());S.push(T)}}if(S.length>1)throw new Error("invalid Expression (parity)");return 0===S[0]?0:x(S[0],m)}function _(e,t,r){return b(e)?e:{type:c,value:function(r){return y(e.value,t,r)}}}function b(e){return e&&e.type===c}function x(e,t){return b(e)?e.value(t):e}function w(e,c){for(var d,m,g,v,y,_,b=[],x=0;x<e.length;x++){var T=e[x],A=T.type;if(A===t)"number"==typeof T.value&&T.value<0?b.push("("+T.value+")"):Array.isArray(T.value)?b.push("["+T.value.map(E).join(", ")+"]"):b.push(E(T.value));else if(A===n)m=b.pop(),d=b.pop(),v=T.value,c?"^"===v?b.push("Math.pow("+d+", "+m+")"):"and"===v?b.push("(!!"+d+" && !!"+m+")"):"or"===v?b.push("(!!"+d+" || !!"+m+")"):"||"===v?b.push("(function(a,b){ return Array.isArray(a) && Array.isArray(b) ? a.concat(b) : String(a) + String(b); }(("+d+"),("+m+")))"):"=="===v?b.push("("+d+" === "+m+")"):"!="===v?b.push("("+d+" !== "+m+")"):"["===v?b.push(d+"[("+m+") | 0]"):b.push("("+d+" "+v+" "+m+")"):"["===v?b.push(d+"["+m+"]"):b.push("("+d+" "+v+" "+m+")");else if(A===i){if(g=b.pop(),m=b.pop(),d=b.pop(),"?"!==(v=T.value))throw new Error("invalid Expression");b.push("("+d+" ? "+m+" : "+g+")")}else if(A===s||A===o)b.push(T.value);else if(A===r)d=b.pop(),"-"===(v=T.value)||"+"===v?b.push("("+v+d+")"):c?"not"===v?b.push("(!"+d+")"):"!"===v?b.push("fac("+d+")"):b.push(v+"("+d+")"):"!"===v?b.push("("+d+"!)"):b.push("("+v+" "+d+")");else if(A===a){for(_=T.value,y=[];_-- >0;)y.unshift(b.pop());v=b.pop(),b.push(v+"("+y.join(", ")+")")}else if(A===u){for(m=b.pop(),_=T.value,y=[];_-- >0;)y.unshift(b.pop());d=b.pop(),c?b.push("("+d+" = function("+y.join(", ")+") { return "+m+" })"):b.push("("+d+"("+y.join(", ")+") = "+m+")")}else if(A===h)d=b.pop(),b.push(d+"."+T.value);else if(A===f){for(_=T.value,y=[];_-- >0;)y.unshift(b.pop());b.push("["+y.join(", ")+"]")}else if(A===l)b.push("("+w(T.value,c)+")");else if(A!==p)throw new Error("invalid Expression")}return b.length>1&&(b=c?[b.join(",")]:[b.join(";")]),String(b[0])}function E(e){return"string"==typeof e?JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"):e}function T(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return!0;return!1}function A(e,t,r){for(var n=!!(r=r||{}).withMembers,i=null,a=0;a<e.length;a++){var u=e[a];u.type===s||u.type===o?n||T(t,u.value)?null!==i?(T(t,i)||t.push(i),i=u.value):i=u.value:t.push(u.value):u.type===h&&n&&null!==i?i+="."+u.value:u.type===l?A(u.value,t,r):null!==i&&(T(t,i)||t.push(i),i=null)}null===i||T(t,i)||t.push(i)}function S(e,t){this.tokens=e,this.parser=t,this.unaryOps=t.unaryOps,this.binaryOps=t.binaryOps,this.ternaryOps=t.ternaryOps,this.functions=t.functions}d.prototype.toString=function(){switch(this.type){case t:case r:case n:case i:case s:case o:case p:return this.value;case a:return"CALL "+this.value;case u:return"DEF "+this.value;case f:return"ARRAY "+this.value;case h:return"."+this.value;default:return"Invalid Instruction"}},S.prototype.simplify=function(e){return e=e||{},new S(function e(a,u,c,p,m){for(var g,v,y,_,b=[],x=[],w=0;w<a.length;w++){var E=a[w],T=E.type;if(T===t||T===o)Array.isArray(E.value)?b.push.apply(b,e(E.value.map(function(e){return new d(t,e)}).concat(new d(f,E.value.length)),u,c,p,m)):b.push(E);else if(T===s&&m.hasOwnProperty(E.value))E=new d(t,m[E.value]),b.push(E);else if(T===n&&b.length>1)v=b.pop(),g=b.pop(),_=c[E.value],E=new d(t,_(g.value,v.value)),b.push(E);else if(T===i&&b.length>2)y=b.pop(),v=b.pop(),g=b.pop(),"?"===E.value?b.push(g.value?v.value:y.value):(_=p[E.value],E=new d(t,_(g.value,v.value,y.value)),b.push(E));else if(T===r&&b.length>0)g=b.pop(),_=u[E.value],E=new d(t,_(g.value)),b.push(E);else if(T===l){for(;b.length>0;)x.push(b.shift());x.push(new d(l,e(E.value,u,c,p,m)))}else if(T===h&&b.length>0)g=b.pop(),b.push(new d(t,g.value[E.value]));else{for(;b.length>0;)x.push(b.shift());x.push(E)}}for(;b.length>0;)x.push(b.shift());return x}(this.tokens,this.unaryOps,this.binaryOps,this.ternaryOps,e),this.parser)},S.prototype.substitute=function(e,t){return t instanceof S||(t=this.parser.parse(String(t))),new S(function e(t,o,a){for(var u=[],c=0;c<t.length;c++){var h=t[c],p=h.type;if(p===s&&h.value===o)for(var f=0;f<a.tokens.length;f++){var y,_=a.tokens[f];y=_.type===r?m(_.value):_.type===n?g(_.value):_.type===i?v(_.value):new d(_.type,_.value),u.push(y)}else p===l?u.push(new d(l,e(h.value,o,a))):u.push(h)}return u}(this.tokens,e,t),this.parser)},S.prototype.evaluate=function(e){return e=e||{},y(this.tokens,this,e)},S.prototype.toString=function(){return w(this.tokens,!1)},S.prototype.symbols=function(e){e=e||{};var t=[];return A(this.tokens,t,e),t},S.prototype.variables=function(e){e=e||{};var t=[];A(this.tokens,t,e);var r=this.functions;return t.filter(function(e){return!(e in r)})},S.prototype.toJSFunction=function(e,t){var r=this,n=new Function(e,"with(this.functions) with (this.ternaryOps) with (this.binaryOps) with (this.unaryOps) { return "+w(this.simplify(t).tokens,!0)+"; }");return function(){return n.apply(r,arguments)}};var k="TOP",C="TPAREN";function I(e,t,r){this.type=e,this.value=t,this.index=r}function R(e,t){this.pos=0,this.current=null,this.unaryOps=e.unaryOps,this.binaryOps=e.binaryOps,this.ternaryOps=e.ternaryOps,this.consts=e.consts,this.expression=t,this.savedPosition=0,this.savedCurrent=null,this.options=e.options,this.parser=e}I.prototype.toString=function(){return this.type+": "+this.value},R.prototype.newToken=function(e,t,r){return new I(e,t,null!=r?r:this.pos)},R.prototype.save=function(){this.savedPosition=this.pos,this.savedCurrent=this.current},R.prototype.restore=function(){this.pos=this.savedPosition,this.current=this.savedCurrent},R.prototype.next=function(){return this.pos>=this.expression.length?this.newToken("TEOF","EOF"):this.isWhitespace()||this.isComment()?this.next():this.isRadixInteger()||this.isNumber()||this.isOperator()||this.isString()||this.isParen()||this.isBracket()||this.isComma()||this.isSemicolon()||this.isNamedOp()||this.isConst()||this.isName()?this.current:void this.parseError('Unknown character "'+this.expression.charAt(this.pos)+'"')},R.prototype.isString=function(){var e=!1,t=this.pos,r=this.expression.charAt(t);if("'"===r||'"'===r)for(var n=this.expression.indexOf(r,t+1);n>=0&&this.pos<this.expression.length;){if(this.pos=n+1,"\\"!==this.expression.charAt(n-1)){var i=this.expression.substring(t+1,n);this.current=this.newToken("TSTRING",this.unescape(i),t),e=!0;break}n=this.expression.indexOf(r,n+1)}return e},R.prototype.isParen=function(){var e=this.expression.charAt(this.pos);return("("===e||")"===e)&&(this.current=this.newToken(C,e),this.pos++,!0)},R.prototype.isBracket=function(){var e=this.expression.charAt(this.pos);return!("["!==e&&"]"!==e||!this.isOperatorEnabled("["))&&(this.current=this.newToken("TBRACKET",e),this.pos++,!0)},R.prototype.isComma=function(){return","===this.expression.charAt(this.pos)&&(this.current=this.newToken("TCOMMA",","),this.pos++,!0)},R.prototype.isSemicolon=function(){return";"===this.expression.charAt(this.pos)&&(this.current=this.newToken("TSEMICOLON",";"),this.pos++,!0)},R.prototype.isConst=function(){for(var e=this.pos,t=e;t<this.expression.length;t++){var r=this.expression.charAt(t);if(r.toUpperCase()===r.toLowerCase()&&(t===this.pos||"_"!==r&&"."!==r&&(r<"0"||r>"9")))break}if(t>e){var n=this.expression.substring(e,t);if(n in this.consts)return this.current=this.newToken("TNUMBER",this.consts[n]),this.pos+=n.length,!0}return!1},R.prototype.isNamedOp=function(){for(var e=this.pos,t=e;t<this.expression.length;t++){var r=this.expression.charAt(t);if(r.toUpperCase()===r.toLowerCase()&&(t===this.pos||"_"!==r&&(r<"0"||r>"9")))break}if(t>e){var n=this.expression.substring(e,t);if(this.isOperatorEnabled(n)&&(n in this.binaryOps||n in this.unaryOps||n in this.ternaryOps))return this.current=this.newToken(k,n),this.pos+=n.length,!0}return!1},R.prototype.isName=function(){for(var e=this.pos,t=e,r=!1;t<this.expression.length;t++){var n=this.expression.charAt(t);if(n.toUpperCase()===n.toLowerCase()){if(t===this.pos&&("$"===n||"_"===n)){"_"===n&&(r=!0);continue}if(t===this.pos||!r||"_"!==n&&(n<"0"||n>"9"))break}else r=!0}if(r){var i=this.expression.substring(e,t);return this.current=this.newToken("TNAME",i),this.pos+=i.length,!0}return!1},R.prototype.isWhitespace=function(){for(var e=!1,t=this.expression.charAt(this.pos);!(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t||(e=!0,this.pos++,this.pos>=this.expression.length));)t=this.expression.charAt(this.pos);return e};var L=/^[0-9a-f]{4}$/i;function O(e,t,r){this.parser=e,this.tokens=t,this.current=null,this.nextToken=null,this.next(),this.savedCurrent=null,this.savedNextToken=null,this.allowMemberAccess=!1!==r.allowMemberAccess}R.prototype.unescape=function(e){var t=e.indexOf("\\");if(t<0)return e;for(var r=e.substring(0,t);t>=0;){var n=e.charAt(++t);switch(n){case"'":r+="'";break;case'"':r+='"';break;case"\\":r+="\\";break;case"/":r+="/";break;case"b":r+="\b";break;case"f":r+="\f";break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"u":var i=e.substring(t+1,t+5);L.test(i)||this.parseError("Illegal escape sequence: \\u"+i),r+=String.fromCharCode(parseInt(i,16)),t+=4;break;default:throw this.parseError('Illegal escape sequence: "\\'+n+'"')}++t;var s=e.indexOf("\\",t);r+=e.substring(t,s<0?e.length:s),t=s}return r},R.prototype.isComment=function(){return"/"===this.expression.charAt(this.pos)&&"*"===this.expression.charAt(this.pos+1)&&(this.pos=this.expression.indexOf("*/",this.pos)+2,1===this.pos&&(this.pos=this.expression.length),!0)},R.prototype.isRadixInteger=function(){var e,t,r=this.pos;if(r>=this.expression.length-2||"0"!==this.expression.charAt(r))return!1;if(++r,"x"===this.expression.charAt(r))e=16,t=/^[0-9a-f]$/i,++r;else{if("b"!==this.expression.charAt(r))return!1;e=2,t=/^[01]$/i,++r}for(var n=!1,i=r;r<this.expression.length;){var s=this.expression.charAt(r);if(!t.test(s))break;r++,n=!0}return n&&(this.current=this.newToken("TNUMBER",parseInt(this.expression.substring(i,r),e)),this.pos=r),n},R.prototype.isNumber=function(){for(var e,t=!1,r=this.pos,n=r,i=r,s=!1,o=!1;r<this.expression.length&&((e=this.expression.charAt(r))>="0"&&e<="9"||!s&&"."===e);)"."===e?s=!0:o=!0,r++,t=o;if(t&&(i=r),"e"===e||"E"===e){r++;for(var a=!0,u=!1;r<this.expression.length;){if(e=this.expression.charAt(r),!a||"+"!==e&&"-"!==e){if(!(e>="0"&&e<="9"))break;u=!0,a=!1}else a=!1;r++}u||(r=i)}return t?(this.current=this.newToken("TNUMBER",parseFloat(this.expression.substring(n,r))),this.pos=r):this.pos=i,t},R.prototype.isOperator=function(){var e=this.pos,t=this.expression.charAt(this.pos);if("+"===t||"-"===t||"*"===t||"/"===t||"%"===t||"^"===t||"?"===t||":"===t||"."===t)this.current=this.newToken(k,t);else if("∙"===t||"•"===t)this.current=this.newToken(k,"*");else if(">"===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(k,">="),this.pos++):this.current=this.newToken(k,">");else if("<"===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(k,"<="),this.pos++):this.current=this.newToken(k,"<");else if("|"===t){if("|"!==this.expression.charAt(this.pos+1))return!1;this.current=this.newToken(k,"||"),this.pos++}else if("="===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(k,"=="),this.pos++):this.current=this.newToken(k,t);else{if("!"!==t)return!1;"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(k,"!="),this.pos++):this.current=this.newToken(k,t)}return this.pos++,!!this.isOperatorEnabled(this.current.value)||(this.pos=e,!1)},R.prototype.isOperatorEnabled=function(e){return this.parser.isOperatorEnabled(e)},R.prototype.getCoordinates=function(){var e,t=0,r=-1;do{t++,e=this.pos-r,r=this.expression.indexOf("\n",r+1)}while(r>=0&&r<this.pos);return{line:t,column:e}},R.prototype.parseError=function(e){var t=this.getCoordinates();throw new Error("parse error ["+t.line+":"+t.column+"]: "+e)},O.prototype.next=function(){return this.current=this.nextToken,this.nextToken=this.tokens.next()},O.prototype.tokenMatches=function(e,t){return void 0===t||(Array.isArray(t)?T(t,e.value):"function"==typeof t?t(e):e.value===t)},O.prototype.save=function(){this.savedCurrent=this.current,this.savedNextToken=this.nextToken,this.tokens.save()},O.prototype.restore=function(){this.tokens.restore(),this.current=this.savedCurrent,this.nextToken=this.savedNextToken},O.prototype.accept=function(e,t){return!(this.nextToken.type!==e||!this.tokenMatches(this.nextToken,t))&&(this.next(),!0)},O.prototype.expect=function(e,t){if(!this.accept(e,t)){var r=this.tokens.getCoordinates();throw new Error("parse error ["+r.line+":"+r.column+"]: Expected "+(t||e))}},O.prototype.parseAtom=function(e){var r=this.tokens.unaryOps;if(this.accept("TNAME")||this.accept(k,function(e){return e.value in r}))e.push(new d(s,this.current.value));else if(this.accept("TNUMBER"))e.push(new d(t,this.current.value));else if(this.accept("TSTRING"))e.push(new d(t,this.current.value));else if(this.accept(C,"("))this.parseExpression(e),this.expect(C,")");else{if(!this.accept("TBRACKET","["))throw new Error("unexpected "+this.nextToken);if(this.accept("TBRACKET","]"))e.push(new d(f,0));else{var n=this.parseArrayList(e);e.push(new d(f,n))}}},O.prototype.parseExpression=function(e){var t=[];this.parseUntilEndStatement(e,t)||(this.parseVariableAssignmentExpression(t),this.parseUntilEndStatement(e,t)||this.pushExpression(e,t))},O.prototype.pushExpression=function(e,t){for(var r=0,n=t.length;r<n;r++)e.push(t[r])},O.prototype.parseUntilEndStatement=function(e,t){return!!this.accept("TSEMICOLON")&&(!this.nextToken||"TEOF"===this.nextToken.type||this.nextToken.type===C&&")"===this.nextToken.value||t.push(new d(p)),"TEOF"!==this.nextToken.type&&this.parseExpression(t),e.push(new d(l,t)),!0)},O.prototype.parseArrayList=function(e){for(var t=0;!this.accept("TBRACKET","]");)for(this.parseExpression(e),++t;this.accept("TCOMMA");)this.parseExpression(e),++t;return t},O.prototype.parseVariableAssignmentExpression=function(e){for(this.parseConditionalExpression(e);this.accept(k,"=");){var t=e.pop(),r=[],n=e.length-1;if(t.type!==a){if(t.type!==s&&t.type!==h)throw new Error("expected variable for assignment");this.parseVariableAssignmentExpression(r),e.push(new d(o,t.value)),e.push(new d(l,r)),e.push(g("="))}else{if(!this.tokens.isOperatorEnabled("()="))throw new Error("function definition is not permitted");for(var i=0,c=t.value+1;i<c;i++){var p=n-i;e[p].type===s&&(e[p]=new d(o,e[p].value))}this.parseVariableAssignmentExpression(r),e.push(new d(l,r)),e.push(new d(u,t.value))}}},O.prototype.parseConditionalExpression=function(e){for(this.parseOrExpression(e);this.accept(k,"?");){var t=[],r=[];this.parseConditionalExpression(t),this.expect(k,":"),this.parseConditionalExpression(r),e.push(new d(l,t)),e.push(new d(l,r)),e.push(v("?"))}},O.prototype.parseOrExpression=function(e){for(this.parseAndExpression(e);this.accept(k,"or");){var t=[];this.parseAndExpression(t),e.push(new d(l,t)),e.push(g("or"))}},O.prototype.parseAndExpression=function(e){for(this.parseComparison(e);this.accept(k,"and");){var t=[];this.parseComparison(t),e.push(new d(l,t)),e.push(g("and"))}};var M=["==","!=","<","<=",">=",">","in"];O.prototype.parseComparison=function(e){for(this.parseAddSub(e);this.accept(k,M);){var t=this.current;this.parseAddSub(e),e.push(g(t.value))}};var P=["+","-","||"];O.prototype.parseAddSub=function(e){for(this.parseTerm(e);this.accept(k,P);){var t=this.current;this.parseTerm(e),e.push(g(t.value))}};var B=["*","/","%"];function N(e,t){return Number(e)+Number(t)}function D(e,t){return e-t}function F(e,t){return e*t}function j(e,t){return e/t}function U(e,t){return e%t}function $(e,t){return Array.isArray(e)&&Array.isArray(t)?e.concat(t):""+e+t}function V(e,t){return e===t}function G(e,t){return e!==t}function z(e,t){return e>t}function W(e,t){return e<t}function H(e,t){return e>=t}function K(e,t){return e<=t}function q(e,t){return Boolean(e&&t)}function X(e,t){return Boolean(e||t)}function Y(e,t){return T(t,e)}function Z(e){return(Math.exp(e)-Math.exp(-e))/2}function J(e){return(Math.exp(e)+Math.exp(-e))/2}function Q(e){return e===1/0?1:e===-1/0?-1:(Math.exp(e)-Math.exp(-e))/(Math.exp(e)+Math.exp(-e))}function ee(e){return e===-1/0?e:Math.log(e+Math.sqrt(e*e+1))}function te(e){return Math.log(e+Math.sqrt(e*e-1))}function re(e){return Math.log((1+e)/(1-e))/2}function ne(e){return Math.log(e)*Math.LOG10E}function ie(e){return-e}function se(e){return!e}function oe(e){return e<0?Math.ceil(e):Math.floor(e)}function ae(e){return Math.random()*(e||1)}function ue(e){return he(e+1)}O.prototype.parseTerm=function(e){for(this.parseFactor(e);this.accept(k,B);){var t=this.current;this.parseFactor(e),e.push(g(t.value))}},O.prototype.parseFactor=function(e){var t=this.tokens.unaryOps;if(this.save(),this.accept(k,function(e){return e.value in t})){if("-"!==this.current.value&&"+"!==this.current.value){if(this.nextToken.type===C&&"("===this.nextToken.value)return this.restore(),void this.parseExponential(e);if("TSEMICOLON"===this.nextToken.type||"TCOMMA"===this.nextToken.type||"TEOF"===this.nextToken.type||this.nextToken.type===C&&")"===this.nextToken.value)return this.restore(),void this.parseAtom(e)}var r=this.current;this.parseFactor(e),e.push(m(r.value))}else this.parseExponential(e)},O.prototype.parseExponential=function(e){for(this.parsePostfixExpression(e);this.accept(k,"^");)this.parseFactor(e),e.push(g("^"))},O.prototype.parsePostfixExpression=function(e){for(this.parseFunctionCall(e);this.accept(k,"!");)e.push(m("!"))},O.prototype.parseFunctionCall=function(e){var t=this.tokens.unaryOps;if(this.accept(k,function(e){return e.value in t})){var r=this.current;this.parseAtom(e),e.push(m(r.value))}else for(this.parseMemberExpression(e);this.accept(C,"(");)if(this.accept(C,")"))e.push(new d(a,0));else{var n=this.parseArgumentList(e);e.push(new d(a,n))}},O.prototype.parseArgumentList=function(e){for(var t=0;!this.accept(C,")");)for(this.parseExpression(e),++t;this.accept("TCOMMA");)this.parseExpression(e),++t;return t},O.prototype.parseMemberExpression=function(e){for(this.parseAtom(e);this.accept(k,".")||this.accept("TBRACKET","[");){var t=this.current;if("."===t.value){if(!this.allowMemberAccess)throw new Error('unexpected ".", member access is not permitted');this.expect("TNAME"),e.push(new d(h,this.current.value))}else{if("["!==t.value)throw new Error("unexpected symbol: "+t.value);if(!this.tokens.isOperatorEnabled("["))throw new Error('unexpected "[]", arrays are disabled');this.parseExpression(e),this.expect("TBRACKET","]"),e.push(g("["))}}};var le=4.7421875,ce=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function he(e){var t,r;if(function(e){return isFinite(e)&&e===Math.round(e)}(e)){if(e<=0)return isFinite(e)?1/0:NaN;if(e>171)return 1/0;for(var n=e-2,i=e-1;n>1;)i*=n,n--;return 0===i&&(i=1),i}if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*he(1-e));if(e>=171.35)return 1/0;if(e>85){var s=e*e,o=s*e,a=o*e,u=a*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*s)-139/(51840*o)-571/(2488320*a)+163879/(209018880*u)+5246819/(75246796800*u*e))}--e,r=ce[0];for(var l=1;l<ce.length;++l)r+=ce[l]/(e+l);return t=e+le+.5,Math.sqrt(2*Math.PI)*Math.pow(t,e+.5)*Math.exp(-t)*r}function pe(e){return Array.isArray(e)?e.length:String(e).length}function fe(){for(var e=0,t=0,r=0;r<arguments.length;r++){var n,i=Math.abs(arguments[r]);t<i?(e=e*(n=t/i)*n+1,t=i):e+=i>0?(n=i/t)*n:i}return t===1/0?1/0:t*Math.sqrt(e)}function de(e,t,r){return e?t:r}function me(e,t){return void 0===t||0==+t?Math.round(e):(e=+e,t=-+t,isNaN(e)||"number"!=typeof t||t%1!=0?NaN:(e=e.toString().split("e"),+((e=(e=Math.round(+(e[0]+"e"+(e[1]?+e[1]-t:-t)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]+t:t))))}function ge(e,t,r){return r&&(r[e]=t),t}function ve(e,t){return e[0|t]}function ye(e){return 1===arguments.length&&Array.isArray(e)?Math.max.apply(Math,e):Math.max.apply(Math,arguments)}function _e(e){return 1===arguments.length&&Array.isArray(e)?Math.min.apply(Math,e):Math.min.apply(Math,arguments)}function be(e,t){if("function"!=typeof e)throw new Error("First argument to map is not a function");if(!Array.isArray(t))throw new Error("Second argument to map is not an array");return t.map(function(t,r){return e(t,r)})}function xe(e,t,r){if("function"!=typeof e)throw new Error("First argument to fold is not a function");if(!Array.isArray(r))throw new Error("Second argument to fold is not an array");return r.reduce(function(t,r,n){return e(t,r,n)},t)}function we(e,t){if("function"!=typeof e)throw new Error("First argument to filter is not a function");if(!Array.isArray(t))throw new Error("Second argument to filter is not an array");return t.filter(function(t,r){return e(t,r)})}function Ee(e,t){if(!Array.isArray(t)&&"string"!=typeof t)throw new Error("Second argument to indexOf is not a string or array");return t.indexOf(e)}function Te(e,t){if(!Array.isArray(t))throw new Error("Second argument to join is not an array");return t.join(e)}function Ae(e){return(e>0)-(e<0)||+e}var Se=1/3;function ke(e){return e<0?-Math.pow(-e,Se):Math.pow(e,Se)}function Ce(e){return Math.exp(e)-1}function Ie(e){return Math.log(1+e)}function Re(e){return Math.log(e)/Math.LN2}function Le(e){this.options=e||{},this.unaryOps={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,sinh:Math.sinh||Z,cosh:Math.cosh||J,tanh:Math.tanh||Q,asinh:Math.asinh||ee,acosh:Math.acosh||te,atanh:Math.atanh||re,sqrt:Math.sqrt,cbrt:Math.cbrt||ke,log:Math.log,log2:Math.log2||Re,ln:Math.log,lg:Math.log10||ne,log10:Math.log10||ne,expm1:Math.expm1||Ce,log1p:Math.log1p||Ie,abs:Math.abs,ceil:Math.ceil,floor:Math.floor,round:Math.round,trunc:Math.trunc||oe,"-":ie,"+":Number,exp:Math.exp,not:se,length:pe,"!":ue,sign:Math.sign||Ae},this.binaryOps={"+":N,"-":D,"*":F,"/":j,"%":U,"^":Math.pow,"||":$,"==":V,"!=":G,">":z,"<":W,">=":H,"<=":K,and:q,or:X,in:Y,"=":ge,"[":ve},this.ternaryOps={"?":de},this.functions={random:ae,fac:ue,min:_e,max:ye,hypot:Math.hypot||fe,pyt:Math.hypot||fe,pow:Math.pow,atan2:Math.atan2,if:de,gamma:he,roundTo:me,map:be,fold:xe,filter:we,indexOf:Ee,join:Te},this.consts={E:Math.E,PI:Math.PI,true:!0,false:!1}}Le.prototype.parse=function(e){var t=[],r=new O(this,new R(this,e),{allowMemberAccess:this.options.allowMemberAccess});return r.parseExpression(t),r.expect("TEOF","EOF"),new S(t,this)},Le.prototype.evaluate=function(e,t){return this.parse(e).evaluate(t)};var Oe=new Le;Le.parse=function(e){return Oe.parse(e)},Le.evaluate=function(e,t){return Oe.parse(e).evaluate(t)};var Me={"+":"add","-":"subtract","*":"multiply","/":"divide","%":"remainder","^":"power","!":"factorial","<":"comparison",">":"comparison","<=":"comparison",">=":"comparison","==":"comparison","!=":"comparison","||":"concatenate",and:"logical",or:"logical",not:"logical","?":"conditional",":":"conditional","=":"assignment","[":"array","()=":"fndef"};Le.prototype.isOperatorEnabled=function(e){var t=function(e){return Me.hasOwnProperty(e)?Me[e]:e}(e),r=this.options.operators||{};return!(t in r&&!r[t])};var Pe={Parser:Le,Expression:S};e.Expression=S,e.Parser=Le,e.default=Pe,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof r&&void 0!==t?i(r):"function"==typeof define&&define.amd?define(["exports"],i):i((n=n||self).exprEval={})},{}],73:[function(e,t,r){"use strict";const n=e("./lib/stringify"),i=e("./lib/compile"),s=e("./lib/expand"),o=e("./lib/parse"),a=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let e=a.create(n,t);Array.isArray(e)?r.push(...e):r.push(e)}else r=[].concat(a.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(r=[...new Set(r)]),r};a.parse=((e,t={})=>o(e,t)),a.stringify=((e,t={})=>n("string"==typeof e?a.parse(e,t):e,t)),a.compile=((e,t={})=>("string"==typeof e&&(e=a.parse(e,t)),i(e,t))),a.expand=((e,t={})=>{"string"==typeof e&&(e=a.parse(e,t));let r=s(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r}),a.create=((e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?a.compile(e,t):a.expand(e,t)),t.exports=a},{"./lib/compile":74,"./lib/expand":76,"./lib/parse":77,"./lib/stringify":78}],74:[function(e,t,r){"use strict";const n=e("fill-range"),i=e("./utils");t.exports=((e,t={})=>{let r=(e,s={})=>{let o=i.isInvalidBrace(s),a=!0===e.invalid&&!0===t.escapeInvalid,u=!0===o||!0===a,l=!0===t.escapeInvalid?"\\":"",c="";if(!0===e.isOpen)return l+e.value;if(!0===e.isClose)return l+e.value;if("open"===e.type)return u?l+e.value:"(";if("close"===e.type)return u?l+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":u?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){let r=i.reduce(e.nodes),s=n(...r,{...t,wrap:!1,toRegex:!0});if(0!==s.length)return r.length>1&&s.length>1?`(${s})`:s}if(e.nodes)for(let t of e.nodes)c+=r(t,e);return c};return r(e)})},{"./utils":79,"fill-range":80}],75:[function(e,t,r){"use strict";t.exports={MAX_LENGTH:65536,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},{}],76:[function(e,t,r){"use strict";const n=e("fill-range"),i=e("./stringify"),s=e("./utils"),o=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return r?s.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)n.push(o(e,t,r));else for(let e of t)!0===r&&"string"==typeof e&&(e=`{${e}}`),n.push(Array.isArray(e)?o(i,e,r):i+e);return s.flatten(n)};t.exports=((e,t={})=>{let r=void 0===t.rangeLimit?1e3:t.rangeLimit,a=(e,u={})=>{e.queue=[];let l=u,c=u.queue;for(;"brace"!==l.type&&"root"!==l.type&&l.parent;)c=(l=l.parent).queue;if(e.invalid||e.dollar)return void c.push(o(c.pop(),i(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void c.push(o(c.pop(),["{}"]));if(e.nodes&&e.ranges>0){let a=s.reduce(e.nodes);if(s.exceedsLimit(...a,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let u=n(...a,t);return 0===u.length&&(u=i(e,t)),c.push(o(c.pop(),u)),void(e.nodes=[])}let h=s.encloseBrace(e),p=e.queue,f=e;for(;"brace"!==f.type&&"root"!==f.type&&f.parent;)p=(f=f.parent).queue;for(let t=0;t<e.nodes.length;t++){let r=e.nodes[t];"comma"!==r.type||"brace"!==e.type?"close"!==r.type?r.value&&"open"!==r.type?p.push(o(p.pop(),r.value)):r.nodes&&a(r,e):c.push(o(c.pop(),p,h)):(1===t&&p.push(""),p.push(""))}return p};return s.flatten(a(e))})},{"./stringify":78,"./utils":79,"fill-range":80}],77:[function(e,t,r){"use strict";const n=e("./stringify"),{MAX_LENGTH:i,CHAR_BACKSLASH:s,CHAR_BACKTICK:o,CHAR_COMMA:a,CHAR_DOT:u,CHAR_LEFT_PARENTHESES:l,CHAR_RIGHT_PARENTHESES:c,CHAR_LEFT_CURLY_BRACE:h,CHAR_RIGHT_CURLY_BRACE:p,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_RIGHT_SQUARE_BRACKET:d,CHAR_DOUBLE_QUOTE:m,CHAR_SINGLE_QUOTE:g,CHAR_NO_BREAK_SPACE:v,CHAR_ZERO_WIDTH_NOBREAK_SPACE:y}=e("./constants");t.exports=((e,t={})=>{if("string"!=typeof e)throw new TypeError("Expected a string");let r=t||{},_="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;if(e.length>_)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${_})`);let b,x={type:"root",input:e,nodes:[]},w=[x],E=x,T=x,A=0,S=e.length,k=0,C=0;const I=()=>e[k++],R=e=>{if("text"===e.type&&"dot"===T.type&&(T.type="text"),!T||"text"!==T.type||"text"!==e.type)return E.nodes.push(e),e.parent=E,e.prev=T,T=e,e;T.value+=e.value};for(R({type:"bos"});k<S;)if(E=w[w.length-1],(b=I())!==y&&b!==v)if(b!==s)if(b!==d)if(b!==f)if(b!==l)if(b!==c)if(b!==m&&b!==g&&b!==o)if(b!==h)if(b!==p)if(b===a&&C>0){if(E.ranges>0){E.ranges=0;let e=E.nodes.shift();E.nodes=[e,{type:"text",value:n(E)}]}R({type:"comma",value:b}),E.commas++}else if(b===u&&C>0&&0===E.commas){let e=E.nodes;if(0===C||0===e.length){R({type:"text",value:b});continue}if("dot"===T.type){if(E.range=[],T.value+=b,T.type="range",3!==E.nodes.length&&5!==E.nodes.length){E.invalid=!0,E.ranges=0,T.type="text";continue}E.ranges++,E.args=[];continue}if("range"===T.type){e.pop();let t=e[e.length-1];t.value+=T.value+b,T=t,E.ranges--;continue}R({type:"dot",value:b})}else R({type:"text",value:b});else{if("brace"!==E.type){R({type:"text",value:b});continue}let e="close";(E=w.pop()).close=!0,R({type:e,value:b}),C--,E=w[w.length-1]}else{C++;let e=T.value&&"$"===T.value.slice(-1)||!0===E.dollar;E=R({type:"brace",open:!0,close:!1,dollar:e,depth:C,commas:0,ranges:0,nodes:[]}),w.push(E),R({type:"open",value:b})}else{let e,r=b;for(!0!==t.keepQuotes&&(b="");k<S&&(e=I());)if(e!==s){if(e===r){!0===t.keepQuotes&&(b+=e);break}b+=e}else b+=e+I();R({type:"text",value:b})}else{if("paren"!==E.type){R({type:"text",value:b});continue}E=w.pop(),R({type:"text",value:b}),E=w[w.length-1]}else E=R({type:"paren",nodes:[]}),w.push(E),R({type:"text",value:b});else{let e;for(A++;k<S&&(e=I());)if(b+=e,e!==f)if(e!==s){if(e===d&&0==--A)break}else b+=I();else A++;R({type:"text",value:b})}else R({type:"text",value:"\\"+b});else R({type:"text",value:(t.keepEscaping?b:"")+I()});do{if("root"!==(E=w.pop()).type){E.nodes.forEach(e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)});let e=w[w.length-1],t=e.nodes.indexOf(E);e.nodes.splice(t,1,...E.nodes)}}while(w.length>0);return R({type:"eos"}),x})},{"./constants":75,"./stringify":78}],78:[function(e,t,r){"use strict";const n=e("./utils");t.exports=((e,t={})=>{let r=(e,i={})=>{let s=t.escapeInvalid&&n.isInvalidBrace(i),o=!0===e.invalid&&!0===t.escapeInvalid,a="";if(e.value)return(s||o)&&n.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)a+=r(t);return a};return r(e)})},{"./utils":79}],79:[function(e,t,r){"use strict";r.isInteger=(e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e))),r.find=((e,t)=>e.nodes.find(e=>e.type===t)),r.exceedsLimit=((e,t,n=1,i)=>!1!==i&&(!(!r.isInteger(e)||!r.isInteger(t))&&(Number(t)-Number(e))/Number(n)>=i)),r.escapeNode=((e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||"open"===n.type||"close"===n.type)&&!0!==n.escaped&&(n.value="\\"+n.value,n.escaped=!0)}),r.encloseBrace=(e=>"brace"===e.type&&(e.commas>>0+e.ranges>>0==0&&(e.invalid=!0,!0))),r.isInvalidBrace=(e=>"brace"===e.type&&(!(!0!==e.invalid&&!e.dollar)||(e.commas>>0+e.ranges>>0==0?(e.invalid=!0,!0):(!0!==e.open||!0!==e.close)&&(e.invalid=!0,!0)))),r.isOpenOrClose=(e=>"open"===e.type||"close"===e.type||(!0===e.open||!0===e.close)),r.reduce=(e=>e.reduce((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e),[])),r.flatten=((...e)=>{const t=[],r=e=>{for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?r(i,t):void 0!==i&&t.push(i)}return t};return r(e),t})},{}],80:[function(e,t,r){"use strict";const n=e("util"),i=e("to-regex-range"),s=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),o=e=>"number"==typeof e||"string"==typeof e&&""!==e,a=e=>Number.isInteger(+e),u=e=>{let t=`${e}`,r=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++r];);return r>0},l=(e,t,r)=>{if(t>0){let r="-"===e[0]?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return!1===r?String(e):e},c=(e,t)=>{let r="-"===e[0]?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},h=(e,t,r,n)=>{if(r)return i(e,t,{wrap:!1,...n});let s=String.fromCharCode(e);return e===t?s:`[${s}-${String.fromCharCode(t)}]`},p=(e,t,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,n=r.capture?"":"?:";return t?`(${n}${e.join("|")})`:e.join("|")}return i(e,t,r)},f=(...e)=>new RangeError("Invalid range arguments: "+n.inspect(...e)),d=(e,t,r)=>{if(!0===r.strictRanges)throw f([e,t]);return[]},m=(e,t,r=1,n={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(!0===n.strictRanges)throw f([e,t]);return[]}0===i&&(i=0),0===s&&(s=0);let o=i>s,a=String(e),d=String(t),m=String(r);r=Math.max(Math.abs(r),1);let g=u(a)||u(d)||u(m),v=g?Math.max(a.length,d.length,m.length):0,y=!1===g&&!1===((e,t,r)=>"string"==typeof e||"string"==typeof t||!0===r.stringify)(e,t,n),_=n.transform||(e=>t=>!0===e?Number(t):String(t))(y);if(n.toRegex&&1===r)return h(c(e,v),c(t,v),!0,n);let b={negatives:[],positives:[]},x=e=>b[e<0?"negatives":"positives"].push(Math.abs(e)),w=[],E=0;for(;o?i>=s:i<=s;)!0===n.toRegex&&r>1?x(i):w.push(l(_(i,E),v,y)),i=o?i-r:i+r,E++;return!0===n.toRegex?r>1?((e,t)=>{e.negatives.sort((e,t)=>e<t?-1:e>t?1:0),e.positives.sort((e,t)=>e<t?-1:e>t?1:0);let r,n=t.capture?"":"?:",i="",s="";return e.positives.length&&(i=e.positives.join("|")),e.negatives.length&&(s=`-(${n}${e.negatives.join("|")})`),r=i&&s?`${i}|${s}`:i||s,t.wrap?`(${n}${r})`:r})(b,n):p(w,null,{wrap:!1,...n}):w},g=(e,t,r,n={})=>{if(null==t&&o(e))return[e];if(!o(e)||!o(t))return d(e,t,n);if("function"==typeof r)return g(e,t,1,{transform:r});if(s(r))return g(e,t,0,r);let i={...n};return!0===i.capture&&(i.wrap=!0),r=r||i.step||1,a(r)?a(e)&&a(t)?m(e,t,r,i):((e,t,r=1,n={})=>{if(!a(e)&&e.length>1||!a(t)&&t.length>1)return d(e,t,n);let i=n.transform||(e=>String.fromCharCode(e)),s=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),u=s>o,l=Math.min(s,o),c=Math.max(s,o);if(n.toRegex&&1===r)return h(l,c,!1,n);let f=[],m=0;for(;u?s>=o:s<=o;)f.push(i(s,m)),s=u?s-r:s+r,m++;return!0===n.toRegex?p(f,null,{wrap:!1,options:n}):f})(e,t,Math.max(Math.abs(r),1),i):null==r||s(r)?g(e,t,1,r):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(r,i)};t.exports=g},{"to-regex-range":84,util:523}],81:[function(e,t,r){"use strict";var n=e("is-glob"),i=e("path").posix.dirname,s="win32"===e("os").platform(),o=/\\/g,a=/[\{\[].*[\/]*.*[\}\]]$/,u=/(^|[^\\])([\{\[]|\([^\)]+$)/,l=/\\([\*\?\|\[\]\(\)\{\}])/g;t.exports=function(e){s&&e.indexOf("/")<0&&(e=e.replace(o,"/")),a.test(e)&&(e+="/"),e+="a";do{e=i(e)}while(n(e)||u.test(e));return e.replace(l,"$1")}},{"is-glob":363,os:301,path:404}],82:[function(e,t,r){"use strict";t.exports=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))}},{}],83:[function(e,t,r){"use strict";const n=e("util"),i=e("braces"),s=e("picomatch"),o=e("picomatch/lib/utils"),a=e=>"string"==typeof e&&(""===e||"./"===e),u=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,i=new Set,o=new Set,a=0,u=e=>{o.add(e.output),r&&r.onResult&&r.onResult(e)};for(let o=0;o<t.length;o++){let l=s(String(t[o]),{...r,onResult:u},!0),c=l.state.negated||l.state.negatedExtglob;c&&a++;for(let t of e){let e=l(t,!0);(c?!e.isMatch:e.isMatch)&&(c?n.add(e.output):(n.delete(e.output),i.add(e.output)))}}let l=(a===t.length?[...o]:[...i]).filter(e=>!n.has(e));if(r&&0===l.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map(e=>e.replace(/\\/g,"")):t}return l};u.match=u,u.matcher=((e,t)=>s(e,t)),u.any=u.isMatch=((e,t,r)=>s(t,r)(e)),u.not=((e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,i=[],s=u(e,t,{...r,onResult:e=>{r.onResult&&r.onResult(e),i.push(e.output)}});for(let e of i)s.includes(e)||n.add(e);return[...n]}),u.contains=((e,t,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${n.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>u.contains(e,t,r));if("string"==typeof t){if(a(e)||a(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return u.isMatch(e,t,{...r,contains:!0})}),u.matchKeys=((e,t,r)=>{if(!o.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=u(Object.keys(e),t,r),i={};for(let t of n)i[t]=e[t];return i}),u.some=((e,t,r)=>{let n=[].concat(e);for(let e of[].concat(t)){let t=s(String(e),r);if(n.some(e=>t(e)))return!0}return!1}),u.every=((e,t,r)=>{let n=[].concat(e);for(let e of[].concat(t)){let t=s(String(e),r);if(!n.every(e=>t(e)))return!1}return!0}),u.all=((e,t,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${n.inspect(e)}"`);return[].concat(t).every(t=>s(t,r)(e))}),u.capture=((e,t,r)=>{let n=o.isWindows(r),i=s.makeRe(String(e),{...r,capture:!0}).exec(n?o.toPosixSlashes(t):t);if(i)return i.slice(1).map(e=>void 0===e?"":e)}),u.makeRe=((...e)=>s.makeRe(...e)),u.scan=((...e)=>s.scan(...e)),u.parse=((e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let e of i(String(n),t))r.push(s.parse(e,t));return r}),u.braces=((e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return t&&!0===t.nobrace||!/\{.*\}/.test(e)?[e]:i(e,t)}),u.braceExpand=((e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return u.braces(e,{...t,expand:!0})}),t.exports=u},{braces:73,picomatch:407,"picomatch/lib/utils":412,util:523}],84:[function(e,t,r){"use strict";const n=e("is-number"),i=(e,t,r)=>{if(!1===n(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===n(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let s={relaxZeros:!0,...r};"boolean"==typeof s.strictZeros&&(s.relaxZeros=!1===s.strictZeros);let u=e+":"+t+"="+String(s.relaxZeros)+String(s.shorthand)+String(s.capture)+String(s.wrap);if(i.cache.hasOwnProperty(u))return i.cache[u].result;let l=Math.min(e,t),c=Math.max(e,t);if(1===Math.abs(l-c)){let r=e+"|"+t;return s.capture?`(${r})`:!1===s.wrap?r:`(?:${r})`}let h=d(e)||d(t),p={min:e,max:t,a:l,b:c},f=[],m=[];if(h&&(p.isPadded=h,p.maxLen=String(p.max).length),l<0){m=o(c<0?Math.abs(c):1,Math.abs(l),p,s),l=p.a=0}return c>=0&&(f=o(l,c,p,s)),p.negatives=m,p.positives=f,p.result=function(e,t,r){let n=a(e,t,"-",!1,r)||[],i=a(t,e,"",!1,r)||[],s=a(e,t,"-?",!0,r)||[];return n.concat(s).concat(i).join("|")}(m,f,s),!0===s.capture?p.result=`(${p.result})`:!1!==s.wrap&&f.length+m.length>1&&(p.result=`(?:${p.result})`),i.cache[u]=p,p.result};function s(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=function(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}(e,t),i=n.length,s="",o=0;for(let e=0;e<i;e++){let[t,i]=n[e];t===i?s+=t:"0"!==t||"9"!==i?s+=f(t,i,r):o++}return o&&(s+=!0===r.shorthand?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function o(e,t,r,n){let i,o=function(e,t){let r=1,n=1,i=c(e,r),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),i=c(e,r+=1);for(i=h(t+1,n)-1;e<i&&i<=t;)s.add(i),i=h(t+1,n+=1)-1;return(s=[...s]).sort(u),s}(e,t),a=[],l=e;for(let e=0;e<o.length;e++){let t=o[e],u=s(String(l),String(t),n),c="";r.isPadded||!i||i.pattern!==u.pattern?(r.isPadded&&(c=m(t,r,n)),u.string=c+u.pattern+p(u.count),a.push(u),l=t+1,i=u):(i.count.length>1&&i.count.pop(),i.count.push(u.count[0]),i.string=i.pattern+p(i.count),l=t+1)}return a}function a(e,t,r,n,i){let s=[];for(let i of e){let{string:e}=i;n||l(t,"string",e)||s.push(r+e),n&&l(t,"string",e)&&s.push(r+e)}return s}function u(e,t){return e>t?1:t>e?-1:0}function l(e,t,r){return e.some(e=>e[t]===r)}function c(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function h(e,t){return e-e%Math.pow(10,t)}function p(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function f(e,t,r){return`[${e}${t-e==1?"":"-"}${t}]`}function d(e){return/^-?(0+)\d/.test(e)}function m(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),i=!1!==r.relaxZeros;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}i.cache={},i.clearCache=(()=>i.cache={}),t.exports=i},{"is-number":82}],85:[function(e,t,r){"use strict";const n=e("./managers/tasks"),i=e("./providers/async"),s=e("./providers/stream"),o=e("./providers/sync"),a=e("./settings"),u=e("./utils/index");function l(e,t){try{h(e)}catch(e){return Promise.reject(e)}const r=c(e,i.default,t);return Promise.all(r).then(u.array.flatten)}function c(e,t,r){const i=[].concat(e),s=new a.default(r),o=n.generate(i,s),u=new t(s);return o.map(u.read,u)}function h(e){if(![].concat(e).every(p))throw new TypeError("Patterns must be a string or an array of strings")}function p(e){return"string"==typeof e}!function(e){e.sync=function(e,t){h(e);const r=c(e,o.default,t);return u.array.flatten(r)},e.stream=function(e,t){h(e);const r=c(e,s.default,t);return u.stream.merge(r)},e.generateTasks=function(e,t){h(e);const r=[].concat(e),i=new a.default(t);return n.generate(r,i)}}(l||(l={})),t.exports=l},{"./managers/tasks":86,"./providers/async":87,"./providers/stream":92,"./providers/sync":93,"./settings":98,"./utils/index":102}],86:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../utils/index");function i(e,t,r){const n=a(e);if("."in n){return[l(".",e,t,r)]}return u(n,t,r)}function s(e){return n.pattern.getPositivePatterns(e)}function o(e,t){return n.pattern.getNegativePatterns(e).concat(t).map(n.pattern.convertToPositivePattern)}function a(e){return e.reduce((e,t)=>{const r=n.pattern.getBaseDirectory(t);return r in e?e[r].push(t):e[r]=[t],e},{})}function u(e,t,r){return Object.keys(e).map(n=>l(n,e[n],t,r))}function l(e,t,r,i){return{dynamic:i,positive:t,negative:r,base:e,patterns:[].concat(t,r.map(n.pattern.convertToNegativePattern))}}r.generate=function(e,t){const r=s(e),a=o(e,t.ignore),u=t.caseSensitiveMatch?r.filter(n.pattern.isStaticPattern):[],l=t.caseSensitiveMatch?r.filter(n.pattern.isDynamicPattern):r,c=i(u,a,!1),h=i(l,a,!0);return c.concat(h)},r.convertPatternsToTasks=i,r.getPositivePatterns=s,r.getNegativePatternsAsPositive=o,r.groupPatternsByBaseDirectory=a,r.convertPatternGroupsToTasks=u,r.convertPatternGroupToTask=l},{"../utils/index":102}],87:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../readers/stream"),i=e("./provider");r.default=class extends i.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){const t=this._getRootDirectory(e),r=this._getReaderOptions(e),n=[];return new Promise((i,s)=>{const o=this.api(t,e,r);o.once("error",s),o.on("data",e=>n.push(r.transform(e))),o.once("end",()=>i(n))})}api(e,t,r){return t.dynamic?this._reader.dynamic(e,r):this._reader.static(t.patterns,r)}}},{"../readers/stream":96,"./provider":91}],88:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../../utils/index");r.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,r){const n=this._getMaxPatternDepth(t),i=this._getNegativePatternsRe(r);return t=>this._filter(e,t,i,n)}_getMaxPatternDepth(e){return e.some(n.pattern.hasGlobStar)?1/0:n.pattern.getMaxNaivePatternsDepth(e)}_getNegativePatternsRe(e){const t=e.filter(n.pattern.isAffectDepthOfReadingPattern);return n.pattern.convertPatternsToRe(t,this._micromatchOptions)}_filter(e,t,r,n){const i=this._getEntryDepth(e,t.path);return!this._isSkippedByDeep(i)&&!this._isSkippedByMaxPatternDepth(i,n)&&!this._isSkippedSymbolicLink(t)&&!this._isSkippedDotDirectory(t)&&this._isSkippedByNegativePatterns(t,r)}_getEntryDepth(e,t){const r=e.split("/").length;return t.split("/").length-(""===e?0:r)}_isSkippedByDeep(e){return e>=this._settings.deep}_isSkippedByMaxPatternDepth(e,t){return!this._settings.baseNameMatch&&t!==1/0&&e>t}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedDotDirectory(e){return!this._settings.dot&&e.name.startsWith(".")}_isSkippedByNegativePatterns(e,t){return!n.pattern.matchAny(e.path,t)}}},{"../../utils/index":102}],89:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../../utils/index");r.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,t){const r=n.pattern.convertPatternsToRe(e,this._micromatchOptions),i=n.pattern.convertPatternsToRe(t,this._micromatchOptions);return e=>this._filter(e,r,i)}_filter(e,t,r){if(this._settings.unique){if(this._isDuplicateEntry(e))return!1;this._createIndexRecord(e)}if(this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;if(this._isSkippedByAbsoluteNegativePatterns(e,r))return!1;const n=this._settings.baseNameMatch?e.name:e.path;return this._isMatchToPatterns(n,t)&&!this._isMatchToPatterns(e.path,r)}_isDuplicateEntry(e){return this.index.has(e.path)}_createIndexRecord(e){this.index.set(e.path,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,t){if(!this._settings.absolute)return!1;const r=n.path.makeAbsolute(this._settings.cwd,e.path);return this._isMatchToPatterns(r,t)}_isMatchToPatterns(e,t){return n.pattern.matchAny(e,t)}}},{"../../utils/index":102}],90:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../../utils/index");r.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return n.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}},{"../../utils/index":102}],91:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path"),i=e("./filters/deep"),s=e("./filters/entry"),o=e("./filters/error"),a=e("./transformers/entry");r.default=class{constructor(e){this._settings=e,this.errorFilter=new o.default(this._settings),this.entryFilter=new s.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new i.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a.default(this._settings)}_getRootDirectory(e){return n.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){const t="."===e.base?"":e.base;return{basePath:t,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0}}}},{"./filters/deep":88,"./filters/entry":89,"./filters/error":90,"./transformers/entry":94,path:404}],92:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("stream"),i=e("../readers/stream"),s=e("./provider");r.default=class extends s.default{constructor(){super(...arguments),this._reader=new i.default(this._settings)}read(e){const t=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(t,e,r),s=new n.Readable({objectMode:!0,read:()=>{}});return i.once("error",e=>s.emit("error",e)).on("data",e=>s.emit("data",r.transform(e))).once("end",()=>s.emit("end")),s}api(e,t,r){return t.dynamic?this._reader.dynamic(e,r):this._reader.static(t.patterns,r)}}},{"../readers/stream":96,"./provider":91,stream:503}],93:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../readers/sync"),i=e("./provider");r.default=class extends i.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){const t=this._getRootDirectory(e),r=this._getReaderOptions(e);return this.api(t,e,r).map(r.transform)}api(e,t,r){return t.dynamic?this._reader.dynamic(e,r):this._reader.static(t.patterns,r)}}},{"../readers/sync":97,"./provider":91}],94:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("../../utils/index");r.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let t=e.path;return this._settings.absolute&&(t=n.path.makeAbsolute(this._settings.cwd,t),t=n.path.unixify(t)),this._settings.markDirectories&&e.dirent.isDirectory()&&(t+="/"),this._settings.objectMode?Object.assign({},e,{path:t}):t}}},{"../../utils/index":102}],95:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path"),i=e("@nodelib/fs.stat"),s=e("../utils/index");r.default=class{constructor(e){this._settings=e,this._fsStatSettings=new i.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return n.resolve(this._settings.cwd,e)}_makeEntry(e,t){const r={name:t,path:t,dirent:s.fs.createDirentFromStats(t,e)};return this._settings.stats&&(r.stats=e),r}_isFatalError(e){return!s.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}},{"../utils/index":102,"@nodelib/fs.stat":10,path:404}],96:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("stream"),i=e("@nodelib/fs.stat"),s=e("@nodelib/fs.walk"),o=e("./reader");r.default=class extends o.default{constructor(){super(...arguments),this._walkStream=s.walkStream,this._stat=i.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,t){const r=e.map(this._getFullEntryPath,this),i=new n.PassThrough({objectMode:!0});i._write=((n,s,o)=>this._getEntry(r[n],e[n],t).then(e=>{null!==e&&t.entryFilter(e)&&i.push(e),n===r.length-1&&i.end(),o()}).catch(o));for(let e=0;e<r.length;e++)i.write(e);return i}_getEntry(e,t,r){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(r.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,r)=>{this._stat(e,this._fsStatSettings,(e,n)=>{e?r(e):t(n)})})}}},{"./reader":95,"@nodelib/fs.stat":10,"@nodelib/fs.walk":14,stream:503}],97:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("@nodelib/fs.stat"),i=e("@nodelib/fs.walk"),s=e("./reader");r.default=class extends s.default{constructor(){super(...arguments),this._walkSync=i.walkSync,this._statSync=n.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){const r=[];for(const n of e){const e=this._getFullEntryPath(n),i=this._getEntry(e,n,t);null!==i&&t.entryFilter(i)&&r.push(i)}return r}_getEntry(e,t,r){try{const n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(r.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}},{"./reader":95,"@nodelib/fs.stat":10,"@nodelib/fs.walk":14}],98:[function(e,t,r){(function(t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("fs"),i=e("os").cpus().length;r.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:n.lstat,lstatSync:n.lstatSync,stat:n.stat,statSync:n.statSync,readdir:n.readdir,readdirSync:n.readdirSync};r.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,i),this.cwd=this._getValue(this._options.cwd,t.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0)}_getValue(e,t){return void 0===e?t:e}_getFileSystemMethods(e={}){return Object.assign({},r.DEFAULT_FILE_SYSTEM_ADAPTER,e)}}}).call(this,e("_process"))},{_process:437,fs:298,os:301}],99:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.flatten=function(e){return e.reduce((e,t)=>[].concat(e,t),[])}},{}],100:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isEnoentCodeError=function(e){return"ENOENT"===e.code}},{}],101:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{dup:7}],102:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("./array");r.array=n;const i=e("./errno");r.errno=i;const s=e("./fs");r.fs=s;const o=e("./path");r.path=o;const a=e("./pattern");r.pattern=a;const u=e("./stream");r.stream=u},{"./array":99,"./errno":100,"./fs":101,"./path":103,"./pattern":104,"./stream":105}],103:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path");r.unixify=function(e){return e.replace(/\\/g,"/")},r.makeAbsolute=function(e,t){return n.resolve(e,t)}},{path:404}],104:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("path"),i=e("glob-parent"),s=e("is-glob"),o=e("micromatch"),a="**";function u(e){return!l(e)}function l(e){return s(e,{strict:!1})}function c(e){return e.startsWith("!")&&"("!==e[1]}function h(e){return!c(e)}function p(e){return i(e)}function f(e){return e.endsWith("/"+a)}function d(e){const t=p(e),r=e.split("/").length,n=t.split("/").length;return"."===t?r-n:r-n-1}function m(e,t){return o.makeRe(e,t)}r.isStaticPattern=u,r.isDynamicPattern=l,r.convertToPositivePattern=function(e){return c(e)?e.slice(1):e},r.convertToNegativePattern=function(e){return"!"+e},r.isNegativePattern=c,r.isPositivePattern=h,r.getNegativePatterns=function(e){return e.filter(c)},r.getPositivePatterns=function(e){return e.filter(h)},r.getBaseDirectory=p,r.hasGlobStar=function(e){return-1!==e.indexOf(a)},r.endsWithSlashGlobStar=f,r.isAffectDepthOfReadingPattern=function(e){const t=n.basename(e);return f(e)||u(t)},r.getNaiveDepth=d,r.getMaxNaivePatternsDepth=function(e){return e.reduce((e,t)=>{const r=d(t);return r>e?r:e},0)},r.makeRe=m,r.convertPatternsToRe=function(e,t){return e.map(e=>m(e,t))},r.matchAny=function(e,t){const r=e.replace(/^\.[\\\/]/,"");return t.some(e=>e.test(r))}},{"glob-parent":81,"is-glob":363,micromatch:83,path:404}],105:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=e("merge2");r.merge=function(e){const t=n(e);return e.forEach(e=>{e.once("error",e=>t.emit("error",e))}),t}},{merge2:381}],106:[function(e,t,r){"use strict";var n=e("reusify");function i(){}function s(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null;var e=this;this.worked=function(t,r){var n=e.callback;e.value=null,e.callback=i,n.call(e.context,t,r),e.release(e)}}t.exports=function(e,t,r){"function"==typeof e&&(r=t,t=e,e=null);var o=n(s),a=null,u=null,l=0,c={push:function(r,n){var s=o.get();s.context=e,s.release=h,s.value=r,s.callback=n||i,l===c.concurrency||c.paused?u?(u.next=s,u=s):(a=s,u=s,c.saturated()):(l++,t.call(e,s.value,s.worked))},drain:i,saturated:i,pause:function(){c.paused=!0},paused:!1,concurrency:r,running:function(){return l},resume:function(){if(c.paused){c.paused=!1;for(var e=0;e<c.concurrency;e++)l++,h()}},idle:function(){return 0===l&&0===c.length()},length:function(){for(var e=a,t=0;e;)e=e.next,t++;return t},unshift:function(r,n){var s=o.get();s.context=e,s.release=h,s.value=r,s.callback=n||i,l===c.concurrency||c.paused?a?(s.next=a,a=s):(a=s,u=s,c.saturated()):(l++,t.call(e,s.value,s.worked))},empty:i,kill:function(){a=null,u=null,c.drain=i},killAndDrain:function(){a=null,u=null,c.drain(),c.drain=i}};return c;function h(r){r&&o.release(r);var n=a;n?c.paused?l--:(u===a&&(u=null),a=n.next,n.next=null,t.call(e,n.value,n.worked),null===u&&c.empty()):0==--l&&c.drain()}}},{reusify:489}],107:[function(e,t,r){var n=e("utils-extend");t.exports=function(e,t){if(null===e)return function(){return!0};if(""===e||n.isArray(e)&&!e.length)return function(){return!1};n.isString(e)&&(e=[e]);var r=[],i=[],s=t?"i":"";return e.forEach(function(e){var t=0===e.indexOf("!");e="(^"+(e=e.replace(/^!/,"").replace(/\*(?![\/*])/,"[^/]*?").replace("**/","([^/]+/)*").replace(/\{([^\}]+)\}/g,function(e,t){var r=t.split(","),n=r.length,i="(?:";return r.forEach(function(e,t){i+="("+e.trim()+")",t+1!==n&&(i+="|")}),i+=")"}).replace(/([\/\.])/g,"\\$1"))+"$)",t?i.push(e):r.push(e)}),r=r.length?new RegExp(r.join("|"),s):null,i=i.length?new RegExp(i.join("|"),s):null,function(e){return e=n.path.unixifyPath(e),!(i&&i.test(e)||!r||!r.test(e))}}},{"utils-extend":524}],108:[function(e,t,r){var n=e("fs"),i=e("utils-extend"),s=e("path"),o=e("file-match");function a(e){return n.existsSync(e)?e:a(s.dirname(e))}i.extend(r,n),r.fs=n,r.fileMatch=o,r.mkdir=function(e,t,r){var o=a(e),u=s.relative(o,e);if(i.isFunction(t)&&(r=t,t=null),i.isFunction(r)||(r=i.noop),t=t||511,!u)return r();function l(e){if(l.count===u.length)return r();e=s.join(e,u[l.count]),n.mkdir(e,t,function(t){l.count++,l(e)})}u=u.split(s.sep),l.count=0,l(o)},r.mkdirSync=function(e,t){var r=a(e),i=s.relative(r,e);i&&(i=i.split(s.sep)).forEach(function(e){r=s.join(r,e),n.mkdirSync(r,t)})},r.writeFile=function(e,t,o,a){var u=function(e,t){return i.isFunction(e)?{options:null,callback:e}:i.isObject(e)?{options:e,callback:t}:{options:null,callback:i.noop}}(o,a),l=s.dirname(e);o=u.options,a=u.callback,r.mkdir(l,function(){n.writeFile(e,t,o,a)})},r.writeFileSync=function(e,t,i){var o=s.dirname(e);r.mkdirSync(o),n.writeFileSync(e,t,i)},r.copyFile=function(e,t,s){(s=i.extend({encoding:"utf8",done:i.noop},s||{})).process||(s.encoding=null),n.readFile(e,{encoding:s.encoding},function(e,n){if(e)return s.done(e);s.process&&(n=s.process(n)),r.writeFile(t,n,s,s.done)})},r.copyFileSync=function(e,t,s){var o;(s=i.extend({encoding:"utf8"},s||{})).process?(o=n.readFileSync(e,s),o=s.process(o,e,s.relative),i.isObject(o)&&o.filepath&&(t=o.filepath,o=o.contents),r.writeFileSync(t,o,s)):(o=n.readFileSync(e),r.writeFileSync(t,o))},r.recurse=function(e,t,r){i.isFunction(t)&&(r=t,t=null);var a=o(t),u=e;!function e(t){n.readdir(t,function(i,o){if(i)return r(i);o.forEach(function(i){var o=s.join(t,i);n.stat(o,function(t,n){var l=s.relative(u,o),c=a(l);n.isDirectory()?(e(o),c&&r(o,l)):c&&r(o,l,i)})})})}(e)},r.recurseSync=function(e,t,r){i.isFunction(t)&&(r=t,t=null);var a=o(t),u=e;!function e(t){n.readdirSync(t).forEach(function(i){var o=s.join(t,i),l=n.statSync(o),c=s.relative(u,o),h=a(c);l.isDirectory()?(e(o),h&&r(o,c)):h&&r(o,c,i)})}(e)},r.rmdirSync=function(e){r.recurseSync(e,function(e,t,r){r?n.unlinkSync(e):n.rmdirSync(e)}),n.rmdirSync(e)},r.copySync=function(e,t,n){n=i.extend({encoding:"utf8",filter:null,noProcess:""},n||{});var a=o(n.noProcess);r.mkdirSync(t),r.recurseSync(e,n.filter,function(e,i,o){if(o){var u=s.join(t,i),l={relative:i};n.process&&!a(i)&&(l.encoding=n.encoding,l.process=n.process),r.copyFileSync(e,u,l)}})}},{"file-match":107,fs:298,path:404,"utils-extend":524}],109:[function(require,module,exports){(function(Buffer){"use strict";const{multiByteIndexOf:multiByteIndexOf,stringToBytes:stringToBytes,readUInt64LE:readUInt64LE,tarHeaderChecksumMatches:tarHeaderChecksumMatches,uint8ArrayUtf8ByteString:uint8ArrayUtf8ByteString}=require("./util"),supported=require("./supported"),xpiZipFilename=stringToBytes("META-INF/mozilla.rsa"),oxmlContentTypes=stringToBytes("[Content_Types].xml"),oxmlRels=stringToBytes("_rels/.rels"),fileType=e=>{if(!(e instanceof Uint8Array||e instanceof ArrayBuffer||Buffer.isBuffer(e)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Uint8Array?e:new Uint8Array(e);if(!(t&&t.length>1))return;const r=(e,r)=>{r={offset:0,...r};for(let n=0;n<e.length;n++)if(r.mask){if(e[n]!==(r.mask[n]&t[n+r.offset]))return!1}else if(e[n]!==t[n+r.offset])return!1;return!0},n=(e,t)=>r(stringToBytes(e),t);if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([137,80,78,71,13,10,26,10])){const e=33,r=t.findIndex((r,n)=>n>=e&&73===t[n]&&68===t[n+1]&&65===t[n+2]&&84===t[n+3]),n=t.subarray(e,r);return n.findIndex((e,t)=>97===n[t]&&99===n[t+1]&&84===n[t+2]&&76===n[t+3])>=0?{ext:"apng",mime:"image/apng"}:{ext:"png",mime:"image/png"}}if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(r([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(r([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((r([73,73,42,0])||r([77,77,0,42]))&&r([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(r([73,73,42,0])&&(r([16,251,134,1],{offset:4})||r([8,0,0,0],{offset:4}))&&r([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9}))return{ext:"arw",mime:"image/x-sony-arw"};if(r([73,73,42,0,8,0,0,0])&&(r([45,0,254,0],{offset:8})||r([39,0,254,0],{offset:8})))return{ext:"dng",mime:"image/x-adobe-dng"};if(r([73,73,42,0])&&r([28,0,254,0],{offset:8}))return{ext:"nef",mime:"image/x-nikon-nef"};if(r([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(n("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(r([73,73,42,0])||r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};const i=[80,75,3,4];if(r(i)){if(r([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(r(xpiZipFilename,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(n("mimetypeapplication/vnd.oasis.opendocument.text",{offset:30}))return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};if(n("mimetypeapplication/vnd.oasis.opendocument.spreadsheet",{offset:30}))return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};if(n("mimetypeapplication/vnd.oasis.opendocument.presentation",{offset:30}))return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};let e,s=0,o=!1;do{const a=s+30;if(o||(o=r(oxmlContentTypes,{offset:a})||r(oxmlRels,{offset:a})),e||(n("word/",{offset:a})?e={ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:n("ppt/",{offset:a})?e={ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:n("xl/",{offset:a})&&(e={ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),o&&e)return e;s=multiByteIndexOf(t,i,a)}while(s>=0);if(e)return e}if(r([80,75])&&(3===t[2]||5===t[2]||7===t[2])&&(4===t[3]||6===t[3]||8===t[3]))return{ext:"zip",mime:"application/zip"};if(r([48,48,48,48,48,48],{offset:148,mask:[248,248,248,248,248,248]})&&tarHeaderChecksumMatches(t))return{ext:"tar",mime:"application/x-tar"};if(r([82,97,114,33,26,7])&&(0===t[6]||1===t[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([102,114,101,101],{offset:4})||r([109,100,97,116],{offset:4})||r([109,111,111,118],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(n("ftyp",{offset:4})&&0!=(96&t[8])){const e=uint8ArrayUtf8ByteString(t,8,12).replace("\0"," ").trim();switch(e){case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};default:return e.startsWith("3g")?e.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(r([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(r([26,69,223,163])){const e=t.subarray(4,4100),r=e.findIndex((e,t,r)=>66===r[t]&&130===r[t+1]);if(-1!==r){const t=r+3,n=r=>[...r].every((r,n)=>e[t+n]===r.charCodeAt(0));if(n("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(n("webm"))return{ext:"webm",mime:"video/webm"}}}if(r([82,73,70,70])){if(r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(r([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(r([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(r([48,38,178,117,142,102,207,17,166,217])){let e=30;do{const n=readUInt64LE(t,e+16);if(r([145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101],{offset:e})){if(r([64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43],{offset:e+24}))return{ext:"wma",mime:"audio/x-ms-wma"};if(r([192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43],{offset:e+24}))return{ext:"wmv",mime:"video/x-ms-asf"};break}e+=n}while(e+24<=t.length);return{ext:"asf",mime:"application/vnd.ms-asf"}}if(r([0,0,1,186])||r([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};for(let e=0;e<2&&e<t.length-16;e++){if(r([73,68,51],{offset:e})||r([255,226],{offset:e,mask:[255,230]}))return{ext:"mp3",mime:"audio/mpeg"};if(r([255,228],{offset:e,mask:[255,230]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([255,248],{offset:e,mask:[255,252]}))return{ext:"mp2",mime:"audio/mpeg"};if(r([255,240],{offset:e,mask:[255,252]}))return{ext:"mp4",mime:"audio/mpeg"}}if(r([79,112,117,115,72,101,97,100],{offset:28}))return{ext:"opus",mime:"audio/opus"};if(r([79,103,103,83]))return r([128,116,104,101,111,114,97],{offset:28})?{ext:"ogv",mime:"video/ogg"}:r([1,118,105,100,101,111,0],{offset:28})?{ext:"ogm",mime:"video/ogg"}:r([127,70,76,65,67],{offset:28})?{ext:"oga",mime:"audio/ogg"}:r([83,112,101,101,120,32,32],{offset:28})?{ext:"spx",mime:"audio/ogg"}:r([1,118,111,114,98,105,115],{offset:28})?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"};if(r([102,76,97,67]))return{ext:"flac",mime:"audio/x-flac"};if(r([77,65,67,32]))return{ext:"ape",mime:"audio/ape"};if(r([119,118,112,107]))return{ext:"wv",mime:"audio/wavpack"};if(r([35,33,65,77,82,10]))return{ext:"amr",mime:"audio/amr"};if(r([37,80,68,70]))return{ext:"pdf",mime:"application/pdf"};if(r([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if((67===t[0]||70===t[0])&&r([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(r([123,92,114,116,102]))return{ext:"rtf",mime:"application/rtf"};if(r([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(r([119,79,70,70])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4})))return{ext:"woff",mime:"font/woff"};if(r([119,79,70,50])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(r([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(r([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(r([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(r([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(r([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(r([37,33]))return{ext:"ps",mime:"application/postscript"};if(r([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(r([83,81,76,105]))return{ext:"sqlite",mime:"application/x-sqlite3"};if(r([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(r([67,114,50,52]))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(r([77,83,67,70])||r([73,83,99,40]))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(r([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121]))return{ext:"deb",mime:"application/x-deb"};if(r([33,60,97,114,99,104,62]))return{ext:"ar",mime:"application/x-unix-archive"};if(r([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(r([31,160])||r([31,157]))return{ext:"Z",mime:"application/x-compress"};if(r([76,90,73,80]))return{ext:"lz",mime:"application/x-lzip"};if(r([208,207,17,224,161,177,26,225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62]))return{ext:"msi",mime:"application/x-msi"};if(r([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(r([66,76,69,78,68,69,82]))return{ext:"blend",mime:"application/x-blender"};if(r([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(r([0,0,0,12,106,80,32,32,13,10,135,10])){if(r([106,112,50,32],{offset:20}))return{ext:"jp2",mime:"image/jp2"};if(r([106,112,120,32],{offset:20}))return{ext:"jpx",mime:"image/jpx"};if(r([106,112,109,32],{offset:20}))return{ext:"jpm",mime:"image/jpm"};if(r([109,106,112,50],{offset:20}))return{ext:"mj2",mime:"image/mj2"}}return r([70,79,82,77])?{ext:"aif",mime:"audio/aiff"}:n("<?xml ")?{ext:"xml",mime:"application/xml"}:r([66,79,79,75,77,79,66,73],{offset:60})?{ext:"mobi",mime:"application/x-mobipocket-ebook"}:r([171,75,84,88,32,49,49,187,13,10,26,10])?{ext:"ktx",mime:"image/ktx"}:r([68,73,67,77],{offset:128})?{ext:"dcm",mime:"application/dicom"}:r([77,80,43])?{ext:"mpc",mime:"audio/x-musepack"}:r([77,80,67,75])?{ext:"mpc",mime:"audio/x-musepack"}:r([66,69,71,73,78,58])?{ext:"ics",mime:"text/calendar"}:r([103,108,84,70,2,0,0,0])?{ext:"glb",mime:"model/gltf-binary"}:r([212,195,178,161])||r([161,178,195,212])?{ext:"pcap",mime:"application/vnd.tcpdump.pcap"}:r([68,83,68,32])?{ext:"dsf",mime:"audio/x-dsf"}:r([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70])?{ext:"lnk",mime:"application/x.ms.shortcut"}:r([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0])?{ext:"alias",mime:"application/x.apple.alias"}:n("Creative Voice File")?{ext:"voc",mime:"audio/x-voc"}:r([11,119])?{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"}:(r([126,16,4])||r([126,24,4]))&&r([48,77,73,69],{offset:4})?{ext:"mie",mime:"application/x-mie"}:r([65,82,82,79,87,49,0,0])?{ext:"arrow",mime:"application/x-apache-arrow"}:r([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2})?{ext:"shp",mime:"application/x-esri-shape"}:void 0};module.exports=fileType,Object.defineProperty(fileType,"minimumBytes",{value:4100}),fileType.stream=(readableStream=>new Promise((resolve,reject)=>{const stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",()=>{const e=new stream.PassThrough,t=readableStream.read(module.exports.minimumBytes)||readableStream.read();try{e.fileType=fileType(t)}catch(e){reject(e)}readableStream.unshift(t),stream.pipeline?resolve(stream.pipeline(readableStream,e,()=>{})):resolve(readableStream.pipe(e))})})),Object.defineProperty(fileType,"extensions",{get:()=>new Set(supported.extensions)}),Object.defineProperty(fileType,"mimeTypes",{get:()=>new Set(supported.mimeTypes)})}).call(this,{isBuffer:require("../is-buffer/index.js")})},{"../is-buffer/index.js":361,"./supported":110,"./util":111}],110:[function(e,t,r){"use strict";t.exports={extensions:["jpg","png","apng","gif","webp","flif","cr2","orf","arw","dng","nef","rw2","raf","tif","bmp","jxr","psd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","msi","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","wmv","wma","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-canon-cr2","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-wma","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-msi","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/ktx","application/dicom","audio/x-musepack","text/calendar","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape"]}},{}],111:[function(e,t,r){(function(e){"use strict";r.stringToBytes=(e=>[...e].map(e=>e.charCodeAt(0)));const t=(e,t,r)=>String.fromCharCode(...e.slice(t,r));r.readUInt64LE=((e,t=0)=>{let r=e[t],n=1,i=0;for(;++i<8;)n*=256,r+=e[t+i]*n;return r}),r.tarHeaderChecksumMatches=(e=>{if(e.length<512)return!1;let r=256,n=0;for(let t=0;t<148;t++){const i=e[t];r+=i,n+=128&i}for(let t=156;t<512;t++){const i=e[t];r+=i,n+=128&i}const i=parseInt(t(e,148,154),8);return i===r||i===r-(n<<1)}),r.multiByteIndexOf=((t,r,n=0)=>{if(e&&e.isBuffer(t))return t.indexOf(e.from(r),n);const i=(e,t,r)=>{for(let n=1;n<t.length;n++)if(t[n]!==e[r+n])return!1;return!0};let s=t.indexOf(r[0],n);for(;s>=0;){if(i(t,r,s))return s;s=t.indexOf(r[0],s+1)}return-1}),r.uint8ArrayUtf8ByteString=t}).call(this,e("buffer").Buffer)},{buffer:299}],112:[function(e,t,r){var n=e("path").sep||"/";t.exports=function(e){if("string"!=typeof e||e.length<=7||"file://"!=e.substring(0,7))throw new TypeError("must pass in a file:// URI to convert to a file path");var t=decodeURI(e.substring(7)),r=t.indexOf("/"),i=t.substring(0,r),s=t.substring(r+1);"localhost"==i&&(i="");i&&(i=n+n+i);s=s.replace(/^(.+)\|/,"$1:"),"\\"==n&&(s=s.replace(/\//g,"\\"));/^.+\:/.test(s)||(s=n+s);return i+s}},{path:404}],113:[function(e,t,r){var n=function(t){(t=t||{}).width=t.width||800,t.height=t.height||600;var r=t.model||{vertex:[-1,-1,0,1,-1,0,1,1,0,-1,1,0],indices:[0,1,2,0,2,3,2,1,0,3,2,0],textureCoords:[0,0,1,0,1,1,0,1]},n=t.lens||{a:1,b:1,Fx:0,Fy:0,scale:1.5},i=t.fov||{x:1,y:1},s=t.image||"images/barrel-distortion.png",o=function(e){var t=document.querySelector(e);if(null==t)throw new Error("there is no canvas on this page");for(var r=["webgl","experimental-webgl","webkit-3d","moz-webgl"],n=0;n<r.length;++n){var i;try{i=t.getContext(r[n],{preserveDrawingBuffer:!0})}catch(e){continue}if(i)return i}throw new Error("WebGL is not supported!")}(t.selector||"#canvas"),a=e("./shaders"),u=x(t.vertexSrc||"vertex"),l=x(t.fragmentSrc||"fragment3"),c=function(e,t,r){var n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t),e.compileShader(n),o(n);var i=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(i,r),e.compileShader(i),o(i);var s=e.createProgram();return e.attachShader(s,n),e.attachShader(s,i),e.linkProgram(s),s;function o(t){if(!e.getShaderParameter(t,e.COMPILE_STATUS))throw new Error(e.getShaderInfoLog(t))}}(o,u,l);o.useProgram(c);var h,p,f,d,m=o.getAttribLocation(c,"aVertexPosition"),g=o.getAttribLocation(c,"aTextureCoord"),v=o.getUniformLocation(c,"uSampler"),y=o.getUniformLocation(c,"uLensS"),_=o.getUniformLocation(c,"uLensF"),b=o.getUniformLocation(c,"uFov");function x(e,t){if(a.hasOwnProperty(e))return a[e];var r=new XMLHttpRequest;if(t)r.addEventListener("readystatechange",function(){4===r.readyState&&(200===r.status?t(null,r.responseText):t(new Error("fail to load!")))}),r.open("GET",e,!0),r.send(null);else if(r.open("GET",e,!1),r.send(null),200==r.status)return r.responseText}function w(e,r){var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;if(!0===e){if(!n)throw new Error("do not support 'requestAnimationFram'");n(s)}else n(s);var i=null;function s(o){i||(i=o);var a=o-i;i=o,t.runner(a),r&&r(),!0===e&&n(s)}}function E(e,t){o.viewport(0,0,e,t),o.canvas.width=e,o.canvas.height=t}function T(e,r){d=function(e,r,n){var i=e.createTexture(),s=new Image;return s.addEventListener("load",function(){!function(e,t,r,n){n=n||e.createTexture(),e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),r&&r(null,n)}(e,s,n,i),t.width=s.width,t.height=s.height,E(t.width,t.height)}),s.src=r,i}(o,e,function(){w(t.animate,r)})}return h=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,h),o.bufferData(o.ARRAY_BUFFER,new Float32Array(r.vertex),o.STATIC_DRAW),o.bindBuffer(o.ARRAY_BUFFER,null),p=o.createBuffer(),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p),o.bufferData(o.ELEMENT_ARRAY_BUFFER,new Uint16Array(r.indices),o.STATIC_DRAW),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,null),f=o.createBuffer(),o.bindBuffer(o.ARRAY_BUFFER,f),o.bufferData(o.ARRAY_BUFFER,new Float32Array(r.textureCoords),o.STATIC_DRAW),o.bindBuffer(o.ARRAY_BUFFER,null),t.runner=t.runner||function(e){o.clearColor(0,0,0,1),o.enable(o.DEPTH_TEST),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.enableVertexAttribArray(m),o.bindBuffer(o.ARRAY_BUFFER,h),o.vertexAttribPointer(m,3,o.FLOAT,!1,0,0),o.enableVertexAttribArray(g),o.bindBuffer(o.ARRAY_BUFFER,f),o.vertexAttribPointer(g,2,o.FLOAT,!1,0,0),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,d),o.uniform1i(v,0),o.uniform3fv(y,[n.a,n.b,n.scale]),o.uniform2fv(_,[n.Fx,n.Fy]),o.uniform2fv(b,[i.x,i.y]),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,p),o.drawElements(o.TRIANGLES,r.indices.length,o.UNSIGNED_SHORT,0)},T(s),{options:t,gl:o,lens:n,fov:i,run:w,getImage:function(e){var t=new Image;return t.src=o.canvas.toDataURL(e||"image/jpeg"),t},setImage:T}};"undefined"!=typeof document?window.FisheyeGl=n:t.exports=n},{"./shaders":114}],114:[function(e,t,r){t.exports={fragment:e("./shaders/fragment.glfs"),fragment2:e("./shaders/fragment2.glfs"),fragment3:e("./shaders/fragment3.glfs"),method1:e("./shaders/method1.glfs"),method2:e("./shaders/method2.glfs"),vertex:e("./shaders/vertex.glvs")}},{"./shaders/fragment.glfs":115,"./shaders/fragment2.glfs":116,"./shaders/fragment3.glfs":117,"./shaders/method1.glfs":118,"./shaders/method2.glfs":119,"./shaders/vertex.glvs":120}],115:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord * vec2(1.0, -1.0)/ 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tfloat scale = uLens.w;\n\tfloat F = uLens.z;\n\t\n\tfloat L = length(vec3(vPosition.xy/scale, F));\n\tvec2 vMapping = vPosition.xy * F / L;\n\tvMapping = vMapping * uLens.xy;\n\tvMapping = GLCoord2TextureCoord(vMapping/scale);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],116:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tfloat correctionRadius = 0.5;\n\tfloat distance = sqrt(vPosition.x * vPosition.x + vPosition.y * vPosition.y) / correctionRadius;\n\tfloat theta = 1.0;\n\tif(distance != 0.0){\n\t\ttheta = atan(distance);\n\t}\n\tvec2 vMapping = theta * vPosition.xy;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\t\t\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],117:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec3 uLensS;\nuniform vec2 uLensF;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord * vec2(1.0, -1.0)/ 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tfloat scale = uLensS.z;\n\tvec3 vPos = vPosition;\n\tfloat Fx = uLensF.x;\n\tfloat Fy = uLensF.y;\n\tvec2 vMapping = vPos.xy;\n\tvMapping.x = vMapping.x + ((pow(vPos.y, 2.0)/scale)*vPos.x/scale)*-Fx;\n\tvMapping.y = vMapping.y + ((pow(vPos.x, 2.0)/scale)*vPos.y/scale)*-Fy;\n\tvMapping = vMapping * uLensS.xy;\n\tvMapping = GLCoord2TextureCoord(vMapping/scale);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\tgl_FragColor = texture;\n}\n"},{}],118:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tvec2 vMapping = vec2(vTextureCoord.x, 1.0 - vTextureCoord.y);\n\tvMapping = TextureCoord2GLCoord(vMapping);\n\t//TODO insert Code\n\tfloat F = uLens.x/ uLens.w;\n\tfloat seta = length(vMapping) / F;\n\tvMapping = sin(seta) * F / length(vMapping) * vMapping;\n\tvMapping *= uLens.w * 1.414;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],119:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tvec2 vMapping = vec2(vTextureCoord.x, 1.0 - vTextureCoord.y);\n\tvMapping = TextureCoord2GLCoord(vMapping);\n\t//TOD insert Code\n\tfloat F = uLens.x/ uLens.w;\n\tfloat seta = length(vMapping) / F;\n\tvMapping = sin(seta) * F / length(vMapping) * vMapping;\n\tvMapping *= uLens.w * 1.414;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],120:[function(e,t,r){t.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nattribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvoid main(void){\n\tvPosition = aVertexPosition;\n\tvTextureCoord = aTextureCoord;\n\tgl_Position = vec4(vPosition,1.0);\n}\n"},{}],121:[function(e,t,r){(function(r){t.exports=c,c.realpath=c,c.sync=h,c.realpathSync=h,c.monkeypatch=function(){n.realpath=c,n.realpathSync=h},c.unmonkeypatch=function(){n.realpath=i,n.realpathSync=s};var n=e("fs"),i=n.realpath,s=n.realpathSync,o=r.version,a=/^v[0-5]\./.test(o),u=e("./old.js");function l(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function c(e,t,r){if(a)return i(e,t,r);"function"==typeof t&&(r=t,t=null),i(e,t,function(n,i){l(n)?u.realpath(e,t,r):r(n,i)})}function h(e,t){if(a)return s(e,t);try{return s(e,t)}catch(r){if(l(r))return u.realpathSync(e,t);throw r}}}).call(this,e("_process"))},{"./old.js":122,_process:437,fs:298}],122:[function(e,t,r){(function(t){var n=e("path"),i="win32"===t.platform,s=e("fs"),o=t.env.NODE_DEBUG&&/fs/.test(t.env.NODE_DEBUG);function a(e){return"function"==typeof e?e:function(){var e;if(o){var r=new Error;e=function(e){e&&(r.message=e.message,n(e=r))}}else e=n;return e;function n(e){if(e){if(t.throwDeprecation)throw e;if(!t.noDeprecation){var r="fs: missing callback "+(e.stack||e.message);t.traceDeprecation?console.trace(r):console.error(r)}}}}()}n.normalize;if(i)var u=/(.*?)(?:[\/\\]+|$)/g;else u=/(.*?)(?:[\/]+|$)/g;if(i)var l=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else l=/^[\/]*/;r.realpathSync=function(e,t){if(e=n.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var r,o,a,c,h=e,p={},f={};function d(){var t=l.exec(e);r=t[0].length,o=t[0],a=t[0],c="",i&&!f[a]&&(s.lstatSync(a),f[a]=!0)}for(d();r<e.length;){u.lastIndex=r;var m=u.exec(e);if(c=o,o+=m[0],a=c+m[1],r=u.lastIndex,!(f[a]||t&&t[a]===a)){var g;if(t&&Object.prototype.hasOwnProperty.call(t,a))g=t[a];else{var v=s.lstatSync(a);if(!v.isSymbolicLink()){f[a]=!0,t&&(t[a]=a);continue}var y=null;if(!i){var _=v.dev.toString(32)+":"+v.ino.toString(32);p.hasOwnProperty(_)&&(y=p[_])}null===y&&(s.statSync(a),y=s.readlinkSync(a)),g=n.resolve(c,y),t&&(t[a]=g),i||(p[_]=y)}e=n.resolve(g,e.slice(r)),d()}}return t&&(t[h]=e),e},r.realpath=function(e,r,o){if("function"!=typeof o&&(o=a(r),r=null),e=n.resolve(e),r&&Object.prototype.hasOwnProperty.call(r,e))return t.nextTick(o.bind(null,null,r[e]));var c,h,p,f,d=e,m={},g={};function v(){var r=l.exec(e);c=r[0].length,h=r[0],p=r[0],f="",i&&!g[p]?s.lstat(p,function(e){if(e)return o(e);g[p]=!0,y()}):t.nextTick(y)}function y(){if(c>=e.length)return r&&(r[d]=e),o(null,e);u.lastIndex=c;var n=u.exec(e);return f=h,h+=n[0],p=f+n[1],c=u.lastIndex,g[p]||r&&r[p]===p?t.nextTick(y):r&&Object.prototype.hasOwnProperty.call(r,p)?x(r[p]):s.lstat(p,_)}function _(e,n){if(e)return o(e);if(!n.isSymbolicLink())return g[p]=!0,r&&(r[p]=p),t.nextTick(y);if(!i){var a=n.dev.toString(32)+":"+n.ino.toString(32);if(m.hasOwnProperty(a))return b(null,m[a],p)}s.stat(p,function(e){if(e)return o(e);s.readlink(p,function(e,t){i||(m[a]=t),b(e,t)})})}function b(e,t,i){if(e)return o(e);var s=n.resolve(f,t);r&&(r[i]=s),x(s)}function x(t){e=n.resolve(t,e.slice(c)),v()}v()}}).call(this,e("_process"))},{_process:437,fs:298,path:404}],123:[function(e,t,r){(function(r,n){"use strict";var i=e("path"),s=e("ndarray"),o=e("omggif").GifReader,a=(e("ndarray-pack"),e("through"),e("data-uri-to-buffer"));function u(e,t){var r;try{r=new o(e)}catch(e){return void t(e)}if(r.numFrames()>0){var n=[r.numFrames(),r.height,r.width,4],i=new Uint8Array(n[0]*n[1]*n[2]*n[3]),a=s(i,n);try{for(var u=0;u<r.numFrames();++u)r.decodeAndBlitFrameRGBA(u,i.subarray(a.index(u,0,0,0),a.index(u+1,0,0,0)))}catch(e){return void t(e)}t(null,a.transpose(0,2,1))}else{n=[r.height,r.width,4],i=new Uint8Array(n[0]*n[1]*n[2]),a=s(i,n);try{r.decodeAndBlitFrameRGBA(0,i)}catch(e){return void t(e)}t(null,a.transpose(1,0))}}function l(e,t){n.nextTick(function(){try{var r=a(e);r?u(function(e){if(void 0===e[0]){for(var t=e.length,r=new Uint8Array(t),n=0;n<t;++n)r[n]=e.get(n);return r}return new Uint8Array(e)}(r),t):t(new Error("Error parsing data URI"))}catch(e){t(e)}})}t.exports=function(e,t,n){n||(n=t,t="");var o=i.extname(e);switch(t||o.toUpperCase()){case".GIF":!function(e,t){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.overrideMimeType&&r.overrideMimeType("application/binary"),r.onerror=function(e){t(e)},r.onload=function(){4===r.readyState&&u(new Uint8Array(r.response),t)},r.send()}(e,n);break;default:r.isBuffer(e)&&(e="data:"+t+";base64,"+e.toString("base64")),0===e.indexOf("data:image/gif;")?l(e,n):function(e,t){var r=new Image;r.crossOrigin="Anonymous",r.onload=function(){var e=document.createElement("canvas");e.width=r.width,e.height=r.height;var n=e.getContext("2d");n.drawImage(r,0,0);var i=n.getImageData(0,0,r.width,r.height);t(null,s(new Uint8Array(i.data),[r.width,r.height,4],[4,4*r.width,1],0))},r.onerror=function(e){t(e)},r.src=e}(e,n)}}}).call(this,{isBuffer:e("../is-buffer/index.js")},e("_process"))},{"../is-buffer/index.js":361,_process:437,"data-uri-to-buffer":124,ndarray:389,"ndarray-pack":387,omggif:398,path:404,through:513}],124:[function(e,t,r){(function(e){t.exports=function(t){if(!/^data\:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');var r=(t=t.replace(/\r?\n/g,"")).indexOf(",");if(-1===r||r<=4)throw new TypeError("malformed data: URI");for(var n=t.substring(5,r).split(";"),i=!1,s="US-ASCII",o=0;o<n.length;o++)"base64"==n[o]?i=!0:0==n[o].indexOf("charset=")&&(s=n[o].substring(8));var a=unescape(t.substring(r+1)),u=new e(a,i?"base64":"ascii");return u.type=n[0]||"text/plain",u.charset=s,u}}).call(this,e("buffer").Buffer)},{buffer:299}],125:[function(e,t,r){(function(r){e("assert"),e("events").EventEmitter;var n=e("readable-stream"),i=e("util"),s=e("./TypedNeuQuant.js"),o=e("./LZWEncoder.js");function a(e){n.call(this,e),this.okayToPush=!0,this.resetData()}function u(e,t,r){var n=(r=r||{}).highWaterMark;a.call(this,{highWaterMark:n||0===n?n:65536}),this.width=~~e,this.height=~~t,this.transparent=null,this.transIndex=0,this.repeat=-1,this.delay=0,this.pixels=null,this.indexedPixels=null,this.colorDepth=null,this.colorTab=null,this.usedEntry=[],this.palSize=7,this.dispose=-1,this.firstFrame=!0,this.sample=10;var i=this;function s(){i.flushData()}this.on("writeHeader#stop",s),this.on("frame#stop",s),this.on("finish#stop",function(){s(),i.push(null)})}i.inherits(a,n),a.prototype._read=function(){this.okayToPush=!0},a.prototype.resetData=function(){this.data=[]},a.prototype.flushData=function(){if(!this.okayToPush){var e=new Error("GIF memory limit exceeded. Please `read` from GIF before writing additional frames/information.");return this.emit("error",e)}var t=new r(this.data);this.resetData(),this.okayToPush=this.push(t)},a.prototype.writeByte=function(e){this.data.push(e)},a.prototype.writeUTFBytes=function(e){for(var t=e.length,r=0;r<t;r++)this.writeByte(e.charCodeAt(r))},a.prototype.writeBytes=function(e,t,r){for(var n=r||e.length,i=t||0;i<n;i++)this.writeByte(e[i])},i.inherits(u,a),u.prototype.setDelay=function(e){this.delay=Math.round(e/10)},u.prototype.setFrameRate=function(e){this.delay=Math.round(100/e)},u.prototype.setDispose=function(e){e>=0&&(this.dispose=e)},u.prototype.setRepeat=function(e){this.repeat=e},u.prototype.setTransparent=function(e){this.transparent=e},u.prototype.analyzeImage=function(e){this.setImagePixels(this.removeAlphaChannel(e)),this.analyzePixels()},u.prototype.writeImageInfo=function(){this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.firstFrame=!1},u.prototype.outputImage=function(){this.writePixels()},u.prototype.addFrame=function(e){this.emit("frame#start"),this.analyzeImage(e),this.writeImageInfo(),this.outputImage(),this.emit("frame#stop")},u.prototype.finish=function(){this.emit("finish#start"),this.writeByte(59),this.emit("finish#stop")},u.prototype.setQuality=function(e){e<1&&(e=1),this.sample=e},u.prototype.writeHeader=function(){this.emit("writeHeader#start"),this.writeUTFBytes("GIF89a"),this.emit("writeHeader#stop")},u.prototype.analyzePixels=function(){var e=this.pixels.length/3;this.indexedPixels=new Uint8Array(e);var t=new s(this.pixels,this.sample);t.buildColormap(),this.colorTab=t.getColormap();for(var r=0,n=0;n<e;n++){var i=t.lookupRGB(255&this.pixels[r++],255&this.pixels[r++],255&this.pixels[r++]);this.usedEntry[i]=!0,this.indexedPixels[n]=i}this.pixels=null,this.colorDepth=8,this.palSize=7,null!==this.transparent&&(this.transIndex=this.findClosest(this.transparent))},u.prototype.findClosest=function(e){if(null===this.colorTab)return-1;for(var t=(16711680&e)>>16,r=(65280&e)>>8,n=255&e,i=0,s=16777216,o=this.colorTab.length,a=0;a<o;){var u=t-(255&this.colorTab[a++]),l=r-(255&this.colorTab[a++]),c=n-(255&this.colorTab[a]),h=u*u+l*l+c*c,p=a/3;this.usedEntry[p]&&h<s&&(s=h,i=p),a++}return i},u.prototype.removeAlphaChannel=function(e){for(var t=this.width,r=this.height,n=new Uint8Array(t*r*3),i=0,s=0;s<r;s++)for(var o=0;o<t;o++){var a=s*t*4+4*o;n[i++]=e[a],n[i++]=e[a+1],n[i++]=e[a+2]}return n},u.prototype.setImagePixels=function(e){this.pixels=e},u.prototype.writeGraphicCtrlExt=function(){var e,t;this.writeByte(33),this.writeByte(249),this.writeByte(4),null===this.transparent?(e=0,t=0):(e=1,t=2),this.dispose>=0&&(t=7&dispose),t<<=2,this.writeByte(0|t|e),this.writeShort(this.delay),this.writeByte(this.transIndex),this.writeByte(0)},u.prototype.writeImageDesc=function(){this.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.writeByte(0):this.writeByte(128|this.palSize)},u.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.writeByte(240|this.palSize),this.writeByte(0),this.writeByte(0)},u.prototype.writeNetscapeExt=function(){this.writeByte(33),this.writeByte(255),this.writeByte(11),this.writeUTFBytes("NETSCAPE2.0"),this.writeByte(3),this.writeByte(1),this.writeShort(this.repeat),this.writeByte(0)},u.prototype.writePalette=function(){this.writeBytes(this.colorTab);for(var e=768-this.colorTab.length,t=0;t<e;t++)this.writeByte(0)},u.prototype.writeShort=function(e){this.writeByte(255&e),this.writeByte(e>>8&255)},u.prototype.writePixels=function(){new o(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this)},u.prototype.stream=function(){return this},u.ByteCapacitor=a,t.exports=u}).call(this,e("buffer").Buffer)},{"./LZWEncoder.js":126,"./TypedNeuQuant.js":127,assert:292,buffer:299,events:300,"readable-stream":133,util:523}],126:[function(e,t,r){var n=-1,i=12,s=5003,o=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];t.exports=function(e,t,r,a){var u,l,c,h,p,f,d,m,g,v=Math.max(2,a),y=new Uint8Array(256),_=new Int32Array(s),b=new Int32Array(s),x=0,w=0,E=!1;function T(e,t){y[l++]=e,l>=254&&k(t)}function A(e){S(s),w=m+2,E=!0,R(m,e)}function S(e){for(var t=0;t<e;++t)_[t]=-1}function k(e){l>0&&(e.writeByte(l),e.writeBytes(y,0,l),l=0)}function C(e){return(1<<e)-1}function I(){return 0===h?n:(--h,255&r[p++])}function R(e,t){for(u&=o[x],x>0?u|=e<<x:u=e,x+=f;x>=8;)T(255&u,t),u>>=8,x-=8;if((w>c||E)&&(E?(c=C(f=d),E=!1):c=++f==i?1<<i:C(f)),e==g){for(;x>0;)T(255&u,t),u>>=8,x-=8;k(t)}}this.encode=function(r){r.writeByte(v),h=e*t,p=0,function(e,t){var r,o,a,u,h,p,v;for(E=!1,c=C(f=d=e),g=1+(m=1<<e-1),w=m+2,l=0,u=I(),v=0,r=s;r<65536;r*=2)++v;v=8-v,S(p=s),R(m,t);e:for(;(o=I())!=n;)if(r=(o<<i)+u,_[a=o<<v^u]!==r){if(_[a]>=0){h=p-a,0===a&&(h=1);do{if((a-=h)<0&&(a+=p),_[a]===r){u=b[a];continue e}}while(_[a]>=0)}R(u,t),u=o,w<1<<i?(b[a]=w++,_[a]=r):A(t)}else u=b[a];R(u,t),R(g,t)}(v+1,r),r.writeByte(0)}}},{}],127:[function(e,t,r){var n=100,i=256,s=i-1,o=4,a=16,u=1<<a,l=10,c=10,h=u>>c,p=u<<l-c,f=6,d=(i>>3)*(1<<f),m=30,g=1024,v=256,y=1<<18,_=499,b=491,x=487,w=503,E=3*w;t.exports=function(e,t){var r,T,A,S,k;function C(e,t,n,i,s){r[t][0]-=e*(r[t][0]-n)/g,r[t][1]-=e*(r[t][1]-i)/g,r[t][2]-=e*(r[t][2]-s)/g}function I(e,t,n,s,o){for(var a,u,l=Math.abs(t-e),c=Math.min(t+e,i),h=t+1,p=t-1,f=1;h<c||p>l;)u=k[f++],h<c&&((a=r[h++])[0]-=u*(a[0]-n)/y,a[1]-=u*(a[1]-s)/y,a[2]-=u*(a[2]-o)/y),p>l&&((a=r[p--])[0]-=u*(a[0]-n)/y,a[1]-=u*(a[1]-s)/y,a[2]-=u*(a[2]-o)/y)}function R(e,t,n){var s,u,f,d,m,g=~(1<<31),v=g,y=-1,_=y;for(s=0;s<i;s++)u=r[s],(f=Math.abs(u[0]-e)+Math.abs(u[1]-t)+Math.abs(u[2]-n))<g&&(g=f,y=s),(d=f-(A[s]>>a-o))<v&&(v=d,_=s),m=S[s]>>c,S[s]-=m,A[s]+=m<<l;return S[y]+=h,A[y]-=p,_}this.buildColormap=function(){!function(){var e,t;for(r=[],T=new Int32Array(256),A=new Int32Array(i),S=new Int32Array(i),k=new Int32Array(i>>3),e=0;e<i;e++)t=(e<<o+8)/i,r[e]=new Float64Array([t,t,t,0]),S[e]=u/i,A[e]=0}(),function(){var r,i,s,a,u,l,c=e.length,h=30+(t-1)/3,p=c/(3*t),y=~~(p/n),T=g,A=d,S=A>>f;for(S<=1&&(S=0),r=0;r<S;r++)k[r]=T*((S*S-r*r)*v/(S*S));c<E?(t=1,i=3):i=c%_!=0?3*_:c%b!=0?3*b:c%x!=0?3*x:3*w;var L=0;for(r=0;r<p;)if(C(T,l=R(s=(255&e[L])<<o,a=(255&e[L+1])<<o,u=(255&e[L+2])<<o),s,a,u),0!==S&&I(S,l,s,a,u),(L+=i)>=c&&(L-=c),r++,0===y&&(y=1),r%y==0)for(T-=T/h,(S=(A-=A/m)>>f)<=1&&(S=0),l=0;l<S;l++)k[l]=T*((S*S-l*l)*v/(S*S))}(),function(){for(var e=0;e<i;e++)r[e][0]>>=o,r[e][1]>>=o,r[e][2]>>=o,r[e][3]=e}(),function(){var e,t,n,o,a,u,l=0,c=0;for(e=0;e<i;e++){for(a=e,u=(n=r[e])[1],t=e+1;t<i;t++)(o=r[t])[1]<u&&(a=t,u=o[1]);if(o=r[a],e!=a&&(t=o[0],o[0]=n[0],n[0]=t,t=o[1],o[1]=n[1],n[1]=t,t=o[2],o[2]=n[2],n[2]=t,t=o[3],o[3]=n[3],n[3]=t),u!=l){for(T[l]=c+e>>1,t=l+1;t<u;t++)T[t]=e;l=u,c=e}}for(T[l]=c+s>>1,t=l+1;t<256;t++)T[t]=s}()},this.getColormap=function(){for(var e=[],t=[],n=0;n<i;n++)t[r[n][3]]=n;for(var s=0,o=0;o<i;o++){var a=t[o];e[s++]=r[a][0],e[s++]=r[a][1],e[s++]=r[a][2]}return e},this.lookupRGB=function(e,t,n){for(var s,o,a,u=1e3,l=-1,c=T[t],h=c-1;c<i||h>=0;)c<i&&((a=(o=r[c])[1]-t)>=u?c=i:(c++,a<0&&(a=-a),(s=o[0]-e)<0&&(s=-s),(a+=s)<u&&((s=o[2]-n)<0&&(s=-s),(a+=s)<u&&(u=a,l=o[3])))),h>=0&&((a=t-(o=r[h])[1])>=u?h=-1:(h--,a<0&&(a=-a),(s=o[0]-e)<0&&(s=-s),(a+=s)<u&&((s=o[2]-n)<0&&(s=-s),(a+=s)<u&&(u=a,l=o[3]))));return l}}},{}],128:[function(e,t,r){arguments[4][41][0].apply(r,arguments)},{"./_stream_readable":130,"./_stream_writable":132,_process:437,"core-util-is":47,dup:41,inherits:359}],129:[function(e,t,r){arguments[4][42][0].apply(r,arguments)},{"./_stream_transform":131,"core-util-is":47,dup:42,inherits:359}],130:[function(e,t,r){(function(r){t.exports=h;var n=e("isarray"),i=e("buffer").Buffer;h.ReadableState=c;var s=e("events").EventEmitter;s.listenerCount||(s.listenerCount=function(e,t){return e.listeners(t).length});var o,a=e("stream"),u=e("core-util-is");u.inherits=e("inherits");var l=e("util");function c(t,r){var n=e("./_stream_duplex"),i=(t=t||{}).highWaterMark,s=t.objectMode?16:16384;this.highWaterMark=i||0===i?i:s,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,r instanceof n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(o||(o=e("string_decoder/").StringDecoder),this.decoder=new o(t.encoding),this.encoding=t.encoding)}function h(t){e("./_stream_duplex");if(!(this instanceof h))return new h(t);this._readableState=new c(t,this),this.readable=!0,a.call(this)}function p(e,t,n,i,s){var o=function(e,t){var r=null;u.isBuffer(t)||u.isString(t)||u.isNullOrUndefined(t)||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,n);if(o)e.emit("error",o);else if(u.isNullOrUndefined(n))t.reading=!1,t.ended||function(e,t){if(t.decoder&&!t.ended){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,m(e)}(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!s){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&s){a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||s||i||(n=t.decoder.write(n)),s||(t.reading=!1),t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,s?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&m(e)),function(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(function(){!function(e,t){var r=t.length;for(;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(l("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}(e,t)}))}(e,t);else s||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(t)}l=l&&l.debuglog?l.debuglog("stream"):function(){},u.inherits(h,a),h.prototype.push=function(e,t){var r=this._readableState;return u.isString(e)&&!r.objectMode&&(t=t||r.defaultEncoding)!==r.encoding&&(e=new i(e,t),t=""),p(this,r,e,t,!1)},h.prototype.unshift=function(e){return p(this,this._readableState,e,"",!0)},h.prototype.setEncoding=function(t){return o||(o=e("string_decoder/").StringDecoder),this._readableState.decoder=new o(t),this._readableState.encoding=t,this};var f=8388608;function d(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||u.isNull(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>=f)e=f;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function m(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?r.nextTick(function(){g(e)}):g(e))}function g(e){l("emit readable"),e.emit("readable"),v(e)}function v(e){var t=e._readableState;if(l("flow",t.flowing),t.flowing)do{var r=e.read()}while(null!==r&&t.flowing)}function y(e,t){var r,n=t.buffer,s=t.length,o=!!t.decoder,a=!!t.objectMode;if(0===n.length)return null;if(0===s)r=null;else if(a)r=n.shift();else if(!e||e>=s)r=o?n.join(""):i.concat(n,s),n.length=0;else{if(e<n[0].length)r=(h=n[0]).slice(0,e),n[0]=h.slice(e);else if(e===n[0].length)r=n.shift();else{r=o?"":new i(e);for(var u=0,l=0,c=n.length;l<c&&u<e;l++){var h=n[0],p=Math.min(e-u,h.length);o?r+=h.slice(0,p):h.copy(r,u,0,p),p<h.length?n[0]=h.slice(p):n.shift(),u+=p}}}return r}function _(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");t.endEmitted||(t.ended=!0,r.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}h.prototype.read=function(e){l("read",e);var t=this._readableState,r=e;if((!u.isNumber(e)||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?_(this):m(this),null;if(0===(e=d(e,t))&&t.ended)return 0===t.length&&_(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),(t.ended||t.reading)&&l("reading or ended",i=!1),i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),i&&!t.reading&&(e=d(r,t)),n=e>0?y(e,t):null,u.isNull(n)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),r!==e&&t.ended&&0===t.length&&_(this),u.isNull(n)||this.emit("data",n),n},h.prototype._read=function(e){this.emit("error",new Error("not implemented"))},h.prototype.pipe=function(e,t){var i=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var a=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:p;function u(e){l("onunpipe"),e===i&&p()}function c(){l("onend"),e.end()}o.endEmitted?r.nextTick(a):i.once("end",a),e.on("unpipe",u);var h=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s.listenerCount(e,"data")&&(t.flowing=!0,v(e))}}(i);function p(){l("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",h),e.removeListener("error",d),e.removeListener("unpipe",u),i.removeListener("end",c),i.removeListener("end",p),i.removeListener("data",f),!o.awaitDrain||e._writableState&&!e._writableState.needDrain||h()}function f(t){l("ondata"),!1===e.write(t)&&(l("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,i.pause())}function d(t){l("onerror",t),y(),e.removeListener("error",d),0===s.listenerCount(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),y()}function g(){l("onfinish"),e.removeListener("close",m),y()}function y(){l("unpipe"),i.unpipe(e)}return e.on("drain",h),i.on("data",f),e._events&&e._events.error?n(e._events.error)?e._events.error.unshift(d):e._events.error=[d,e._events.error]:e.on("error",d),e.once("close",m),e.once("finish",g),e.emit("pipe",i),o.flowing||(l("pipe resume"),i.resume()),e},h.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<n;i++)r[i].emit("unpipe",this);return this}return-1===(i=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}(t.pipes,e))?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},h.prototype.on=function(e,t){var n=a.prototype.on.call(this,e,t);if("data"===e&&!1!==this._readableState.flowing&&this.resume(),"readable"===e&&this.readable){var i=this._readableState;if(!i.readableListening)if(i.readableListening=!0,i.emittedReadable=!1,i.needReadable=!0,i.reading)i.length&&m(this);else{var s=this;r.nextTick(function(){l("readable nexttick read 0"),s.read(0)})}}return n},h.prototype.addListener=h.prototype.on,h.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!0,e.reading||(l("resume read 0"),this.read(0)),function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(function(){!function(e,t){t.resumeScheduled=!1,e.emit("resume"),v(e),t.flowing&&!t.reading&&e.read(0)}(e,t)}))}(this,e)),this},h.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this},h.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var i in e.on("end",function(){if(l("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),e.on("data",function(i){(l("wrapped data"),t.decoder&&(i=t.decoder.write(i)),i&&(t.objectMode||i.length))&&(n.push(i)||(r=!0,e.pause()))}),e)u.isFunction(e[i])&&u.isUndefined(this[i])&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return function(e,t){for(var r=0,n=e.length;r<n;r++)t(e[r],r)}(["error","close","destroy","pause","resume"],function(t){e.on(t,n.emit.bind(n,t))}),n._read=function(t){l("wrapped _read",t),r&&(r=!1,e.resume())},n},h._fromList=y}).call(this,e("_process"))},{"./_stream_duplex":128,_process:437,buffer:299,"core-util-is":47,events:300,inherits:359,isarray:367,stream:503,"string_decoder/":508,util:35}],131:[function(e,t,r){t.exports=o;var n=e("./_stream_duplex"),i=e("core-util-is");function s(e,t){this.afterTransform=function(e,r){return function(e,t,r){var n=e._transformState;n.transforming=!1;var s=n.writecb;if(!s)return e.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,i.isNullOrUndefined(r)||e.push(r);s&&s(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}(t,e,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function o(e){if(!(this instanceof o))return new o(e);n.call(this,e),this._transformState=new s(e,this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("prefinish",function(){i.isFunction(this._flush)?this._flush(function(e){a(t,e)}):a(t)})}function a(e,t){if(t)return e.emit("error",t);var r=e._writableState,n=e._transformState;if(r.length)throw new Error("calling transform done when ws.length != 0");if(n.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}i.inherits=e("inherits"),i.inherits(o,n),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;i.isNull(t.writechunk)||!t.writecb||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))}},{"./_stream_duplex":128,"core-util-is":47,inherits:359}],132:[function(e,t,r){(function(r){t.exports=a;var n=e("buffer").Buffer;a.WritableState=o;var i=e("core-util-is");i.inherits=e("inherits");var s=e("stream");function o(t,n){var i=e("./_stream_duplex"),s=(t=t||{}).highWaterMark,o=t.objectMode?16:16384;this.highWaterMark=s||0===s?s:o,this.objectMode=!!t.objectMode,n instanceof i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,s=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,s){n?r.nextTick(function(){t.pendingcb--,s(i)}):(t.pendingcb--,s(i));e._writableState.errorEmitted=!0,e.emit("error",i)}(e,n,i,t,s);else{var o=h(e,n);o||n.corked||n.bufferProcessing||!n.buffer.length||c(e,n),i?r.nextTick(function(){l(e,n,o,s)}):l(e,n,o,s)}}(n,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1}function a(t){var r=e("./_stream_duplex");if(!(this instanceof a||this instanceof r))return new a(t);this._writableState=new o(t,this),this.writable=!0,s.call(this)}function u(e,t,r,n,i,s,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function l(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),f(e,t)}function c(e,t){if(t.bufferProcessing=!0,e._writev&&t.buffer.length>1){for(var r=[],n=0;n<t.buffer.length;n++)r.push(t.buffer[n].callback);t.pendingcb++,u(e,t,!0,t.length,t.buffer,"",function(e){for(var n=0;n<r.length;n++)t.pendingcb--,r[n](e)}),t.buffer=[]}else{for(n=0;n<t.buffer.length;n++){var i=t.buffer[n],s=i.chunk,o=i.encoding,a=i.callback,l=t.objectMode?1:s.length;if(u(e,t,!1,l,s,o,a),t.writing){n++;break}}n<t.buffer.length?t.buffer=t.buffer.slice(n):t.buffer.length=0}t.bufferProcessing=!1}function h(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function p(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function f(e,t){var r=h(0,t);return r&&(0===t.pendingcb?(p(e,t),t.finished=!0,e.emit("finish")):p(e,t)),r}i.inherits(a,s),a.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},a.prototype.write=function(e,t,s){var o=this._writableState,a=!1;return i.isFunction(t)&&(s=t,t=null),i.isBuffer(e)?t="buffer":t||(t=o.defaultEncoding),i.isFunction(s)||(s=function(){}),o.ended?function(e,t,n){var i=new Error("write after end");e.emit("error",i),r.nextTick(function(){n(i)})}(this,0,s):function(e,t,n,s){var o=!0;if(!(i.isBuffer(n)||i.isString(n)||i.isNullOrUndefined(n)||t.objectMode)){var a=new TypeError("Invalid non-string/buffer chunk");e.emit("error",a),r.nextTick(function(){s(a)}),o=!1}return o}(this,o,e,s)&&(o.pendingcb++,a=function(e,t,r,s,o){r=function(e,t,r){return!e.objectMode&&!1!==e.decodeStrings&&i.isString(t)&&(t=new n(t,r)),t}(t,r,s),i.isBuffer(r)&&(s="buffer");var a=t.objectMode?1:r.length;t.length+=a;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);t.writing||t.corked?t.buffer.push(new function(e,t,r){this.chunk=e,this.encoding=t,this.callback=r}(r,s,o)):u(e,t,!1,a,r,s,o);return l}(this,o,e,t,s)),a},a.prototype.cork=function(){this._writableState.corked++},a.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.buffer.length||c(this,e))},a.prototype._write=function(e,t,r){r(new Error("not implemented"))},a.prototype._writev=null,a.prototype.end=function(e,t,n){var s=this._writableState;i.isFunction(e)?(n=e,e=null,t=null):i.isFunction(t)&&(n=t,t=null),i.isNullOrUndefined(e)||this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||s.finished||function(e,t,n){t.ending=!0,f(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0}(this,s,n)}}).call(this,e("_process"))},{"./_stream_duplex":128,_process:437,buffer:299,"core-util-is":47,inherits:359,stream:503}],133:[function(e,t,r){(function(n){(r=t.exports=e("./lib/_stream_readable.js")).Stream=e("stream"),r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),n.browser||"disable"!==n.env.READABLE_STREAM||(t.exports=e("stream"))}).call(this,e("_process"))},{"./lib/_stream_duplex.js":128,"./lib/_stream_passthrough.js":129,"./lib/_stream_readable.js":130,"./lib/_stream_transform.js":131,"./lib/_stream_writable.js":132,_process:437,stream:503}],134:[function(e,t,r){!function(e,n,i,s){"use strict";var o,a,u={URL:e.URL||e.webkitURL||e.mozURL||e.msURL,getUserMedia:(a=i.getUserMedia||i.webkitGetUserMedia||i.mozGetUserMedia||i.msGetUserMedia,a?a.bind(i):a),requestAnimFrame:e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame,requestTimeout:function(e,t){if(e=e||u.noop,t=t||0,!u.requestAnimFrame)return setTimeout(e,t);var r=(new Date).getTime(),n=new Object,i=u.requestAnimFrame;return n.value=i(function s(){(new Date).getTime()-r>=t?e.call():n.value=i(s)}),n},Blob:e.Blob||e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||e.MSBlobBuilder,btoa:(o=e.btoa||function(e){for(var t="",r=0,n=e.length,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=void 0,o=void 0,a=void 0,u=void 0,l=void 0,c=void 0,h=void 0;r<n;)u=(s=e.charCodeAt(r++))>>2,l=(3&s)<<4|(o=e.charCodeAt(r++))>>4,c=(15&o)<<2|(a=e.charCodeAt(r++))>>6,h=63&a,isNaN(o)?c=h=64:isNaN(a)&&(h=64),t=t+i.charAt(u)+i.charAt(l)+i.charAt(c)+i.charAt(h);return t},o?o.bind(e):u.noop),isObject:function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)},isEmptyObject:function(e){return u.isObject(e)&&!Object.keys(e).length},isArray:function(e){return e&&Array.isArray(e)},isFunction:function(e){return e&&"function"==typeof e},isElement:function(e){return e&&1===e.nodeType},isString:function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},isSupported:{canvas:function(){var e=n.createElement("canvas");return e&&e.getContext&&e.getContext("2d")},webworkers:function(){return e.Worker},blob:function(){return u.Blob},Uint8Array:function(){return e.Uint8Array},Uint32Array:function(){return e.Uint32Array},videoCodecs:function(){var e=n.createElement("video"),t={mp4:!1,h264:!1,ogv:!1,ogg:!1,webm:!1};try{e&&e.canPlayType&&(t.mp4=""!==e.canPlayType('video/mp4; codecs="mp4v.20.8"'),t.h264=""!==(e.canPlayType('video/mp4; codecs="avc1.42E01E"')||e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')),t.ogv=""!==e.canPlayType('video/ogg; codecs="theora"'),t.ogg=""!==e.canPlayType('video/ogg; codecs="theora"'),t.webm=-1!==e.canPlayType('video/webm; codecs="vp8, vorbis"'))}catch(e){}return t}()},noop:function(){},each:function(e,t){var r=void 0,n=void 0;if(u.isArray(e))for(r=-1,n=e.length;++r<n&&!1!==t(r,e[r]););else if(u.isObject(e))for(r in e)if(e.hasOwnProperty(r)&&!1===t(r,e[r]))break},mergeOptions:function(e,t){if(u.isObject(e)&&u.isObject(t)&&Object.keys){var r={};return u.each(e,function(t,n){r[t]=e[t]}),u.each(t,function(n,i){var s=t[n];u.isObject(s)&&e[n]?r[n]=u.mergeOptions(e[n],s):r[n]=s}),r}},setCSSAttr:function(e,t,r){u.isElement(e)&&(u.isString(t)&&u.isString(r)?e.style[t]=r:u.isObject(t)&&u.each(t,function(t,r){e.style[t]=r}))},removeElement:function(e){u.isElement(e)&&e.parentNode&&e.parentNode.removeChild(e)},createWebWorker:function(e){if(!u.isString(e))return{};try{var t=new u.Blob([e],{type:"text/javascript"}),r=u.URL.createObjectURL(t);return{objectUrl:r,worker:new Worker(r)}}catch(e){return""+e}},getExtension:function(e){return e.substr(e.lastIndexOf(".")+1,e.length)},getFontSize:function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{};if(!n.body||!1===e.resizeFont)return e.fontSize;var t=e.text,r=e.gifWidth,i=parseInt(e.fontSize,10),o=parseInt(e.minFontSize,10),a=n.createElement("div"),u=n.createElement("span");for(a.setAttribute("width",r),a.appendChild(u),u.innerHTML=t,u.style.fontSize=i+"px",u.style.textIndent="-9999px",u.style.visibility="hidden",n.body.appendChild(u);u.offsetWidth>r&&i>=o;)u.style.fontSize=--i+"px";return n.body.removeChild(u),i+"px"},webWorkerError:!1},l=Object.freeze({default:u}),c={validate:function(e){e=u.isObject(e)?e:{};var t={};return u.each(c.validators,function(r,n){var i=n.errorCode;if(!e[i]&&!n.condition)return(t=n).error=!0,!1}),delete t.condition,t},isValid:function(e){var t=!0!==c.validate(e).error;return t},validators:[{condition:u.isFunction(u.getUserMedia),errorCode:"getUserMedia",errorMsg:"The getUserMedia API is not supported in your browser"},{condition:u.isSupported.canvas(),errorCode:"canvas",errorMsg:"Canvas elements are not supported in your browser"},{condition:u.isSupported.webworkers(),errorCode:"webworkers",errorMsg:"The Web Workers API is not supported in your browser"},{condition:u.isFunction(u.URL),errorCode:"window.URL",errorMsg:"The window.URL API is not supported in your browser"},{condition:u.isSupported.blob(),errorCode:"window.Blob",errorMsg:"The window.Blob File API is not supported in your browser"},{condition:u.isSupported.Uint8Array(),errorCode:"window.Uint8Array",errorMsg:"The window.Uint8Array function constructor is not supported in your browser"},{condition:u.isSupported.Uint32Array(),errorCode:"window.Uint32Array",errorMsg:"The window.Uint32Array function constructor is not supported in your browser"}],messages:{videoCodecs:{errorCode:"videocodec",errorMsg:"The video codec you are trying to use is not supported in your browser"}}},h=Object.freeze({default:c}),p=function(){},f={sampleInterval:10,numWorkers:2,filter:"",gifWidth:200,gifHeight:200,interval:.1,numFrames:10,frameDuration:1,keepCameraOn:!1,images:[],video:null,webcamVideoElement:null,cameraStream:null,text:"",fontWeight:"normal",fontSize:"16px",minFontSize:"10px",resizeFont:!1,fontFamily:"sans-serif",fontColor:"#ffffff",textAlign:"center",textBaseline:"bottom",textXCoordinate:null,textYCoordinate:null,progressCallback:p,completeCallback:p,saveRenderingContexts:!1,savedRenderingContexts:[],crossOrigin:"Anonymous"},d=Object.freeze({default:f});function m(){return c.isValid()}function g(){var e,t,r,n,i,s=256,o=499,a=491,u=487,l=503,c=3*l,h=s-1,p=4,f=100,d=16,m=1<<d,g=10,v=10,y=m>>v,_=m<<g-v,b=6,x=(s>>3)*(1<<b),w=30,E=1024,T=256,A=1<<18,S=[],k=[],C=[],I=[];function R(e,t,r,n,o){var a,u,l,c,h,p,f;for((l=t-e)<-1&&(l=-1),(c=t+e)>s&&(c=s),a=t+1,u=t-1,p=1;a<c||u>l;){if(h=I[p++],a<c){f=i[a++];try{f[0]-=h*(f[0]-r)/A|0,f[1]-=h*(f[1]-n)/A|0,f[2]-=h*(f[2]-o)/A|0}catch(e){}}if(u>l){f=i[u--];try{f[0]-=h*(f[0]-r)/A|0,f[1]-=h*(f[1]-n)/A|0,f[2]-=h*(f[2]-o)/A|0}catch(e){}}}}function L(e,t,r,n,s){var o=i[t],a=e/E;o[0]-=a*(o[0]-r)|0,o[1]-=a*(o[1]-n)|0,o[2]-=a*(o[2]-s)|0}function O(e,t,r){var n,o,a,u,l,c,h,f,m,b;for(m=f=~(1<<31),h=c=-1,n=0;n<s;n++)(o=(b=i[n])[0]-e)<0&&(o=-o),(a=b[1]-t)<0&&(a=-a),o+=a,(a=b[2]-r)<0&&(a=-a),(o+=a)<f&&(f=o,c=n),(u=o-(k[n]>>d-p))<m&&(m=u,h=n),l=C[n]>>v,C[n]-=l,k[n]+=l<<g;return C[c]+=y,k[c]-=_,h}(function(e,o,a){var u,l;for(t=e,r=o,n=a,i=new Array(s),u=0;u<s;u++)i[u]=new Array(4),(l=i[u])[0]=l[1]=l[2]=(u<<p+8)/s|0,C[u]=m/s|0,k[u]=0}).apply(this,arguments);var M={map:function(e,t,r){var n,o,a,u,l,c,h;for(l=1e3,h=-1,o=(n=S[t])-1;n<s||o>=0;)n<s&&((a=(c=i[n])[1]-t)>=l?n=s:(n++,a<0&&(a=-a),(u=c[0]-e)<0&&(u=-u),(a+=u)<l&&((u=c[2]-r)<0&&(u=-u),(a+=u)<l&&(l=a,h=c[3])))),o>=0&&((a=t-(c=i[o])[1])>=l?o=-1:(o--,a<0&&(a=-a),(u=c[0]-e)<0&&(u=-u),(a+=u)<l&&((u=c[2]-r)<0&&(u=-u),(a+=u)<l&&(l=a,h=c[3]))));return h}};return M.process=function(){return function(){var i,s,h,d,m,g,v,y,_,A,S,k,C,M;for(r<c&&(n=1),e=30+(n-1)/3,k=t,C=0,M=r,A=(S=r/(3*n))/f|0,y=E,(v=(g=x)>>b)<=1&&(v=0),i=0;i<v;i++)I[i]=y*((v*v-i*i)*T/(v*v));for(_=r<c?3:r%o!=0?3*o:r%a!=0?3*a:r%u!=0?3*u:3*l,i=0;i<S;)if(L(y,s=O(h=(255&k[C+0])<<p,d=(255&k[C+1])<<p,m=(255&k[C+2])<<p),h,d,m),0!==v&&R(v,s,h,d,m),(C+=_)>=M&&(C-=r),i++,0===A&&(A=1),i%A==0)for(y-=y/e,(v=(g-=g/w)>>b)<=1&&(v=0),s=0;s<v;s++)I[s]=y*((v*v-s*s)*T/(v*v))}(),function(){var e;for(e=0;e<s;e++)i[e][0]>>=p,i[e][1]>>=p,i[e][2]>>=p,i[e][3]=e}(),function(){var e,t,r,n,o,a,u,l;for(u=0,l=0,e=0;e<s;e++){for(r=e,n=(o=i[e])[1],t=e+1;t<s;t++)(a=i[t])[1]<n&&(r=t,n=a[1]);if(a=i[r],e!=r&&(t=a[0],a[0]=o[0],o[0]=t,t=a[1],a[1]=o[1],o[1]=t,t=a[2],a[2]=o[2],o[2]=t,t=a[3],a[3]=o[3],o[3]=t),n!=u){for(S[u]=l+e>>1,t=u+1;t<n;t++)S[t]=e;u=n,l=e}}for(S[u]=l+h>>1,t=u+1;t<256;t++)S[t]=h}(),function(){for(var e=[],t=new Array(s),r=0;r<s;r++)t[i[r][3]]=r;for(var n=0,o=0;o<s;o++){var a=t[o];e[n++]=i[a][0],e[n++]=i[a][1],e[n++]=i[a][2]}return e}()},M}function v(){try{this.onmessage=function(t){var r,n=t.data||{};n.gifshot&&(r=e.run(n),postMessage(r))}}catch(e){}var e={dataToRGB:function(e,t,r){for(var n=t*r*4,i=0,s=[];i<n;)s.push(e[i++]),s.push(e[i++]),s.push(e[i++]),i++;return s},componentizedPaletteToArray:function(e){e=e||[];for(var t=[],r=0;r<e.length;r+=3){var n=e[r],i=e[r+1],s=e[r+2];t.push(n<<16|i<<8|s)}return t},processFrameWithQuantizer:function(e,t,r,n){for(var i=this.dataToRGB(e,t,r),s=new g(i,i.length,n),o=s.process(),a=new Uint32Array(this.componentizedPaletteToArray(o)),u=t*r,l=new Uint8Array(u),c=0,h=0;h<u;h++){var p=i[c++],f=i[c++],d=i[c++];l[h]=s.map(p,f,d)}return{pixels:l,palette:a}},run:function(e){var t=e=e||{},r=t.height,n=(t.palette,t.sampleInterval),i=t.width,s=e.data;return this.processFrameWithQuantizer(s,i,r,n)}};return e}function y(e,t,r,n){var i=0,o=(n=n===s?{}:n).loop===s?null:n.loop,a=n.palette===s?null:n.palette;if(t<=0||r<=0||t>65535||r>65535)throw"Width/Height invalid.";e[i++]=71,e[i++]=73,e[i++]=70,e[i++]=56,e[i++]=57,e[i++]=97;if(e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=0|(null!==a?128:0),e[i++]=0,e[i++]=0,null!==o){if(o<0||o>65535)throw"Loop count invalid.";e[i++]=33,e[i++]=255,e[i++]=11,e[i++]=78,e[i++]=69,e[i++]=84,e[i++]=83,e[i++]=67,e[i++]=65,e[i++]=80,e[i++]=69,e[i++]=50,e[i++]=46,e[i++]=48,e[i++]=3,e[i++]=1,e[i++]=255&o,e[i++]=o>>8&255,e[i++]=0}var u=!1;this.addFrame=function(t,r,n,o,l,c){if(!0===u&&(--i,u=!1),c=c===s?{}:c,t<0||r<0||t>65535||r>65535)throw"x/y invalid.";if(n<=0||o<=0||n>65535||o>65535)throw"Width/Height invalid.";if(l.length<n*o)throw"Not enough pixels for the frame size.";var h=!0,p=c.palette;if(p!==s&&null!==p||(h=!1,p=a),p===s||null===p)throw"Must supply either a local or global palette.";for(var f=function(e){var t=e.length;if(t<2||t>256||t&t-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return t}(p),d=0;f>>=1;)++d;f=1<<d;var m=c.delay===s?0:c.delay,g=c.disposal===s?0:c.disposal;if(g<0||g>3)throw"Disposal out of range.";var v=!1,y=0;if(c.transparent!==s&&null!==c.transparent&&(v=!0,(y=c.transparent)<0||y>=f))throw"Transparent color index.";if((0!==g||v||0!==m)&&(e[i++]=33,e[i++]=249,e[i++]=4,e[i++]=g<<2|(!0===v?1:0),e[i++]=255&m,e[i++]=m>>8&255,e[i++]=y,e[i++]=0),e[i++]=44,e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=255&n,e[i++]=n>>8&255,e[i++]=255&o,e[i++]=o>>8&255,e[i++]=!0===h?128|d-1:0,!0===h)for(var _=0,b=p.length;_<b;++_){var x=p[_];e[i++]=x>>16&255,e[i++]=x>>8&255,e[i++]=255&x}i=function(e,t,r,n){e[t++]=r;var i=t++,o=1<<r,a=o-1,u=o+1,l=u+1,c=r+1,h=0,p=0;function f(r){for(;h>=r;)e[t++]=255&p,p>>=8,h-=8,t===i+256&&(e[i]=255,i=t++)}function d(e){p|=e<<h,h+=c,f(8)}var m=n[0]&a,g={};d(o);for(var v=1,y=n.length;v<y;++v){var _=n[v]&a,b=m<<8|_,x=g[b];if(x===s){for(p|=m<<h,h+=c;h>=8;)e[t++]=255&p,p>>=8,h-=8,t===i+256&&(e[i]=255,i=t++);4096===l?(d(o),l=u+1,c=r+1,g={}):(l>=1<<c&&++c,g[b]=l++),m=_}else m=x}d(m),d(u),f(1),i+1===t?e[i]=0:(e[i]=t-i-1,e[t++]=0);return t}(e,i,d<2?2:d,l)},this.end=function(){return!1===u&&(e[i++]=59,u=!0),i}}var _=function(){},b=function(e){this.canvas=null,this.ctx=null,this.repeat=0,this.frames=[],this.numRenderedFrames=0,this.onRenderCompleteCallback=_,this.onRenderProgressCallback=_,this.workers=[],this.availableWorkers=[],this.generatingGIF=!1,this.options=e,this.initializeWebWorkers(e)};b.prototype={workerMethods:v(),initializeWebWorkers:function(e){var t,r=g.toString()+"("+v.toString()+"());",i=void 0,s=void 0,o=void 0,a=-1,l="";for(t=e.numWorkers;++a<t;)i=u.createWebWorker(r),u.isObject(i)?(s=i.objectUrl,o=i.worker,this.workers.push({worker:o,objectUrl:s}),this.availableWorkers.push(o)):(l=i,u.webWorkerError=!!i);this.workerError=l,this.canvas=n.createElement("canvas"),this.canvas.width=e.gifWidth,this.canvas.height=e.gifHeight,this.ctx=this.canvas.getContext("2d"),this.frames=[]},getWorker:function(){return this.availableWorkers.pop()},freeWorker:function(e){this.availableWorkers.push(e)},byteMap:function(){for(var e=[],t=0;t<256;t++)e[t]=String.fromCharCode(t);return e}(),bufferToString:function(e){for(var t=e.length,r="",n=-1;++n<t;)r+=this.byteMap[e[n]];return r},onFrameFinished:function(e){var t=this,r=t.frames,n=!!(t.options.images||[]).length,i=r.every(function(e){return!e.beingProcessed&&e.done});t.numRenderedFrames++,n&&e(t.numRenderedFrames/r.length),t.onRenderProgressCallback(.75*t.numRenderedFrames/r.length),i?t.generatingGIF||t.generateGIF(r,t.onRenderCompleteCallback):u.requestTimeout(function(){t.processNextFrame()},1)},processFrame:function(e){var t=this,r=(this.options,this.options),n=r.progressCallback,i=r.sampleInterval,o=this.frames,a=void 0,u=void 0,l=function(){var e=(arguments.length>0&&arguments[0]!==s?arguments[0]:{}).data;delete a.data,a.pixels=Array.prototype.slice.call(e.pixels),a.palette=Array.prototype.slice.call(e.palette),a.done=!0,a.beingProcessed=!1,t.freeWorker(u),t.onFrameFinished(n)};(a=o[e]).beingProcessed||a.done?this.onFrameFinished():(a.sampleInterval=i,a.beingProcessed=!0,a.gifshot=!0,(u=this.getWorker())?(u.onmessage=l,u.postMessage(a)):l({data:t.workerMethods.run(a)}))},startRendering:function(e){this.onRenderCompleteCallback=e;for(var t=0;t<this.options.numWorkers&&t<this.frames.length;t++)this.processFrame(t)},processNextFrame:function(){for(var e=-1,t=0;t<this.frames.length;t++){var r=this.frames[t];if(!r.done&&!r.beingProcessed){e=t;break}}e>=0&&this.processFrame(e)},generateGIF:function(e,t){var r=[],n={loop:this.repeat},i=this.options,s=i.interval,o=i.frameDuration,a=!!i.images.length,l=i.gifHeight,c=i.gifWidth,h=new y(r,c,l,n),p=this.onRenderProgressCallback,f=a?100*s:0,d=void 0;this.generatingGIF=!0,u.each(e,function(t,r){var n=r.palette;p(.75+.25*r.position*1/e.length);for(var i=0;i<o;i++)h.addFrame(0,0,c,l,r.pixels,{palette:n,delay:f})}),h.end(),p(1),this.frames=[],this.generatingGIF=!1,u.isFunction(t)&&(d=this.bufferToString(r),t("data:image/gif;base64,"+u.btoa(d)))},setRepeat:function(e){this.repeat=e},addFrame:function(e,t){t=u.isObject(t)?t:{};var r=this.ctx,n=this.options,i=n.gifWidth,s=n.gifHeight,o=u.getFontSize(t),a=t,l=a.filter,c=a.fontColor,h=a.fontFamily,p=a.fontWeight,f=(a.gifHeight,a.gifWidth,a.text),d=a.textAlign,m=a.textBaseline,g=t.textXCoordinate?t.textXCoordinate:"left"===d?1:"right"===d?i:i/2,v=t.textYCoordinate?t.textYCoordinate:"top"===m?1:"center"===m?s/2:s,y=p+" "+o+" "+h,_=void 0;try{r.filter=l,r.drawImage(e,0,0,i,s),f&&(r.font=y,r.fillStyle=c,r.textAlign=d,r.textBaseline=m,r.fillText(f,g,v)),_=r.getImageData(0,0,i,s),this.addFrameImageData(_)}catch(e){return""+e}},addFrameImageData:function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=this.frames,r=e.data;this.frames.push({data:r,width:e.width,height:e.height,palette:null,dithering:null,done:!1,beingProcessed:!1,position:t.length})},onRenderProgress:function(e){this.onRenderProgressCallback=e},isRendering:function(){return this.generatingGIF},getBase64GIF:function(e){var t=this;t.startRendering(function(r){t.destroyWorkers(),u.requestTimeout(function(){e(r)},0)})},destroyWorkers:function(){if(!this.workerError){var e=this.workers;u.each(e,function(e,t){var r=t.worker,n=t.objectUrl;r.terminate(),u.URL.revokeObjectURL(n)})}}};var x=function(){},w={getGIF:function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=arguments[1];t=u.isFunction(t)?t:x;var r=n.createElement("canvas"),i=void 0,o=!!e.images.length,a=e.cameraStream,l=e.crop,c=e.filter,h=e.fontColor,p=e.fontFamily,f=e.fontWeight,d=e.keepCameraOn,m=(e.numWorkers,e.progressCallback),g=e.saveRenderingContexts,v=e.savedRenderingContexts,y=e.text,_=e.textAlign,w=e.textBaseline,E=e.videoElement,T=e.videoHeight,A=e.videoWidth,S=e.webcamVideoElement,k=Number(e.gifWidth),C=Number(e.gifHeight),I=Number(e.interval),R=(Number(e.sampleInterval),o?0:1e3*I),L=[],O=v.length?v.length:e.numFrames,M=O,P=new b(e),B=u.getFontSize(e),N=e.textXCoordinate?e.textXCoordinate:"left"===_?1:"right"===_?k:k/2,D=e.textYCoordinate?e.textYCoordinate:"top"===w?1:"center"===w?C/2:C,F=f+" "+B+" "+p,j=l?Math.floor(l.scaledWidth/2):0,U=l?A-l.scaledWidth:0,$=l?Math.floor(l.scaledHeight/2):0,V=l?T-l.scaledHeight:0;O=O!==s?O:10,I=I!==s?I:.1,r.width=k,r.height=C,i=r.getContext("2d"),function e(){v.length||0!==E.currentTime?function e(){var r=M-1;function n(){var n;g&&L.push(i.getImageData(0,0,k,C)),y&&(i.font=F,i.fillStyle=h,i.textAlign=_,i.textBaseline=w,i.fillText(y,N,D)),n=i.getImageData(0,0,k,C),P.addFrameImageData(n),m((O-(M=r))/O),r>0&&u.requestTimeout(e,R),M||P.getBase64GIF(function(e){t({error:!1,errorCode:"",errorMsg:"",image:e,cameraStream:a,videoElement:E,webcamVideoElement:S,savedRenderingContexts:L,keepCameraOn:d})})}v.length?(i.putImageData(v[O-M],0,0),n()):function e(){try{U>A&&(U=A),V>T&&(V=T),j<0&&(j=0),$<0&&($=0),i.filter=c,i.drawImage(E,j,$,U,V,0,0,k,C),n()}catch(t){if("NS_ERROR_NOT_AVAILABLE"!==t.name)throw t;u.requestTimeout(e,100)}}()}():u.requestTimeout(e,100)}()},getCropDimensions:function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=e.videoWidth,r=e.videoHeight,n=e.gifWidth,i=e.gifHeight,o={width:0,height:0,scaledWidth:0,scaledHeight:0};return t>r?(o.width=Math.round(t*(i/r))-n,o.scaledWidth=Math.round(o.width*(r/i))):(o.height=Math.round(r*(n/t))-i,o.scaledHeight=Math.round(o.height*(t/n))),o}},E={loadedData:!1,defaultVideoDimensions:{width:640,height:480},findVideoSize:function e(t){e.attempts=e.attempts||0;var r=t.cameraStream,n=t.completedCallback,i=t.videoElement;i&&(i.videoWidth>0&&i.videoHeight>0?(i.removeEventListener("loadeddata",E.findVideoSize),n({videoElement:i,cameraStream:r,videoWidth:i.videoWidth,videoHeight:i.videoHeight})):e.attempts<10?(e.attempts+=1,u.requestTimeout(function(){E.findVideoSize(t)},400)):n({videoElement:i,cameraStream:r,videoWidth:E.defaultVideoDimensions.width,videoHeight:E.defaultVideoDimensions.height}))},onStreamingTimeout:function(e){u.isFunction(e)&&e({error:!0,errorCode:"getUserMedia",errorMsg:"There was an issue with the getUserMedia API - Timed out while trying to start streaming",image:null,cameraStream:{}})},stream:function(e){var t=u.isArray(e.existingVideo)?e.existingVideo[0]:e.existingVideo,r=e.cameraStream,n=e.completedCallback,i=e.streamedCallback,s=e.videoElement;if(u.isFunction(i)&&i(),t){if(u.isString(t))s.src=t,s.innerHTML='<source src="'+t+'" type="video/'+u.getExtension(t)+'" />';else if(t instanceof Blob){try{s.src=u.URL.createObjectURL(t)}catch(e){}s.innerHTML='<source src="'+t+'" type="'+t.type+'" />'}}else if(s.mozSrcObject)s.mozSrcObject=r;else if(u.URL)try{s.srcObject=r,s.src=u.URL.createObjectURL(r)}catch(e){s.srcObject=r}s.play(),u.requestTimeout(function e(){e.count=e.count||0,!0===E.loadedData?(E.findVideoSize({videoElement:s,cameraStream:r,completedCallback:n}),E.loadedData=!1):(e.count+=1)>10?E.findVideoSize({videoElement:s,cameraStream:r,completedCallback:n}):e()},0)},startStreaming:function(e){var t=u.isFunction(e.error)?e.error:u.noop,r=u.isFunction(e.streamed)?e.streamed:u.noop,i=u.isFunction(e.completed)?e.completed:u.noop,s=e.crossOrigin,o=e.existingVideo,a=e.lastCameraStream,l=e.options,c=e.webcamVideoElement,h=u.isElement(o)?o:c||n.createElement("video");s&&(h.crossOrigin=l.crossOrigin),h.autoplay=!0,h.loop=!0,h.muted=!0,h.addEventListener("loadeddata",function(e){E.loadedData=!0,l.offset&&(h.currentTime=l.offset)}),o?E.stream({videoElement:h,existingVideo:o,completedCallback:i}):a?E.stream({videoElement:h,cameraStream:a,streamedCallback:r,completedCallback:i}):u.getUserMedia({video:!0},function(e){E.stream({videoElement:h,cameraStream:e,streamedCallback:r,completedCallback:i})},t)},startVideoStreaming:function(e){var t=arguments.length>1&&arguments[1]!==s?arguments[1]:{},r=t.timeout!==s?t.timeout:0,n=t.callback,i=t.webcamVideoElement,o=void 0;r>0&&(o=u.requestTimeout(function(){E.onStreamingTimeout(n)},1e4)),E.startStreaming({error:function(){n({error:!0,errorCode:"getUserMedia",errorMsg:"There was an issue with the getUserMedia API - the user probably denied permission",image:null,cameraStream:{}})},streamed:function(){clearTimeout(o)},completed:function(){var t=arguments.length>0&&arguments[0]!==s?arguments[0]:{},r=t.cameraStream,n=t.videoElement,i=t.videoHeight,o=t.videoWidth;e({cameraStream:r,videoElement:n,videoHeight:i,videoWidth:o})},lastCameraStream:t.lastCameraStream,webcamVideoElement:i,crossOrigin:t.crossOrigin,options:t})},stopVideoStreaming:function(e){var t=e=u.isObject(e)?e:{},r=t.keepCameraOn,n=t.videoElement,i=t.webcamVideoElement,s=e.cameraStream||{},o=s.getTracks&&s.getTracks()||[],a=!!o.length,l=o[0];!r&&a&&u.isFunction(l.stop)&&l.stop(),u.isElement(n)&&!i&&(n.pause(),u.isFunction(u.URL.revokeObjectURL)&&!u.webWorkerError&&n.src&&u.URL.revokeObjectURL(n.src),u.removeElement(n))}};function T(e){e=u.isObject(e)?e:{},E.stopVideoStreaming(e)}function A(e,t){var r=e.options||{},i=r.images,s=r.video,o=Number(r.gifWidth),a=Number(r.gifHeight),l=(Number(r.numFrames),e.cameraStream),c=e.videoElement,h=e.videoWidth,p=e.videoHeight,f=w.getCropDimensions({videoWidth:h,videoHeight:p,gifHeight:a,gifWidth:o}),d=t;r.crop=f,r.videoElement=c,r.videoWidth=h,r.videoHeight=p,r.cameraStream=l,u.isElement(c)&&(c.width=o+f.width,c.height=a+f.height,r.webcamVideoElement||(u.setCSSAttr(c,{position:"fixed",opacity:"0"}),n.body.appendChild(c)),c.play(),w.getGIF(r,function(e){i&&i.length||s&&s.length||T(e),d(e)}))}function S(e,t){if(t=u.isFunction(e)?e:t,e=u.isObject(e)?e:{},u.isFunction(t)){var r=u.mergeOptions(f,e)||{},i=e.cameraStream,o=r.images,a=o?o.length:0,l=r.video,h=r.webcamVideoElement;r=u.mergeOptions(r,{gifWidth:Math.floor(r.gifWidth),gifHeight:Math.floor(r.gifHeight)}),a?function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=e.callback,r=e.images,i=e.options,o=e.imagesLength,a=c.validate({getUserMedia:!0,"window.URL":!0}),l=[],h=0,p=void 0,f=void 0;if(a.error)return t(a);function d(){u.each(l,function(e,t){t&&(t.text?f.addFrame(t.img,i,t.text):f.addFrame(t,i))}),function(e,t){e.getBase64GIF(function(e){t({error:!1,errorCode:"",errorMsg:"",image:e})})}(f,t)}f=new b(i),u.each(r,function(e,r){var s=r;r.src&&(s=s.src),u.isElement(s)?(i.crossOrigin&&(s.crossOrigin=i.crossOrigin),l[e]=s,(h+=1)===o&&d()):u.isString(s)&&(p=new Image,i.crossOrigin&&(p.crossOrigin=i.crossOrigin),function(n){r.text&&(n.text=r.text),n.onerror=function(e){var r=void 0;if(0==--o)return(r={}).error="None of the requested images was capable of being retrieved",t(r)},n.onload=function(t){r.text?l[e]={img:n,text:n.text}:l[e]=n,(h+=1)===o&&d(),u.removeElement(n)},n.src=s}(p),u.setCSSAttr(p,{position:"fixed",opacity:"0"}),n.body.appendChild(p))})}({images:o,imagesLength:a,callback:t,options:r}):l?function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=e.callback,r=e.existingVideo,n=e.options,i=c.validate({getUserMedia:!0,"window.URL":!0}),o=void 0,a=void 0;if(i.error)return t(i);if(u.isElement(r)&&r.src){if(a=r.src,o=u.getExtension(a),!u.isSupported.videoCodecs[o])return t(c.messages.videoCodecs)}else u.isArray(r)&&u.each(r,function(e,t){if(o=t instanceof Blob?t.type.substr(t.type.lastIndexOf("/")+1,t.length):t.substr(t.lastIndexOf(".")+1,t.length),u.isSupported.videoCodecs[o])return r=t,!1});E.startStreaming({completed:function(e){e.options=n||{},A(e,t)},existingVideo:r,crossOrigin:n.crossOrigin,options:n})}({existingVideo:l,callback:t,options:r}):function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{},t=e.callback,r=e.lastCameraStream,n=e.options,i=e.webcamVideoElement;if(!m())return t(c.validate());n.savedRenderingContexts.length?w.getGIF(n,function(e){t(e)}):E.startVideoStreaming(function(){var e=arguments.length>0&&arguments[0]!==s?arguments[0]:{};e.options=n||{},A(e,t)},{lastCameraStream:r,callback:t,webcamVideoElement:i,crossOrigin:n.crossOrigin})}({lastCameraStream:i,callback:t,webcamVideoElement:h,options:r})}}var k={utils:l,error:h,defaultOptions:d,createGIF:S,takeSnapShot:function(e,t){if(t=u.isFunction(e)?e:t,e=u.isObject(e)?e:{},u.isFunction(t)){var r=u.mergeOptions(f,e);S(u.mergeOptions(r,{interval:.1,numFrames:1,gifWidth:Math.floor(r.gifWidth),gifHeight:Math.floor(r.gifHeight)}),t)}},stopVideoStreaming:T,isSupported:function(){return c.isValid()},isWebCamGIFSupported:m,isExistingVideoGIFSupported:function(e){var t=!1;if(u.isArray(e)&&e.length){if(u.each(e,function(e,r){u.isSupported.videoCodecs[r]&&(t=!0)}),!t)return!1}else if(u.isString(e)&&e.length&&!u.isSupported.videoCodecs[e])return!1;return c.isValid({getUserMedia:!0})},isExistingImagesGIFSupported:function(){return c.isValid({getUserMedia:!0})},VERSION:"0.4.5"};"function"==typeof define&&define.amd?define([],function(){return k}):void 0!==r?t.exports=k:e.gifshot=k}("undefined"!=typeof window?window:{},"undefined"!=typeof document?document:{createElement:function(){}},"undefined"!=typeof window?window.navigator:{})},{}],135:[function(e,t,r){function n(e,t={}){const{contextName:r="gl",throwGetError:n,useTrackablePrimitives:a,readPixelsFile:u,recording:l=[],variables:c={},onReadPixels:h,onUnrecognizedArgumentLookup:p}=t,f=new Proxy(e,{get:function(t,f){switch(f){case"addComment":return A;case"checkThrowError":return S;case"getReadPixelsVariableName":return g;case"insertVariable":return x;case"reset":return b;case"setIndent":return E;case"toString":return _;case"getContextVariableName":return C}if("function"==typeof e[f])return function(){switch(f){case"getError":return n?l.push(`${y}if (${r}.getError() !== ${r}.NONE) throw new Error('error');`):l.push(`${y}${r}.getError();`),e.getError();case"getExtension":{const t=`${r}Variables${d.length}`;l.push(`${y}const ${t} = ${r}.getExtension('${arguments[0]}');`);const n=e.getExtension(arguments[0]);if(n&&"object"==typeof n){const e=i(n,{getEntity:w,useTrackablePrimitives:a,recording:l,contextName:t,contextVariables:d,variables:c,indent:y,onUnrecognizedArgumentLookup:p});return d.push(e),e}return d.push(null),n}case"readPixels":const t=d.indexOf(arguments[6]);let o;if(-1===t){const e=function(e){if(c)for(const t in c)if(c[t]===e)return t;return null}(arguments[6]);e?(o=e,l.push(`${y}${e}`)):(o=`${r}Variable${d.length}`,d.push(arguments[6]),l.push(`${y}const ${o} = new ${arguments[6].constructor.name}(${arguments[6].length});`))}else o=`${r}Variable${t}`;g=o;const m=[arguments[0],arguments[1],arguments[2],arguments[3],w(arguments[4]),w(arguments[5]),o];return l.push(`${y}${r}.readPixels(${m.join(", ")});`),u&&function(e,t){const n=`${r}Variable${d.length}`,i=`imageDatum${v}`;l.push(`${y}let ${i} = ["P3\\n# ${u}.ppm\\n", ${e}, ' ', ${t}, "\\n255\\n"].join("");`),l.push(`${y}for (let i = 0; i < ${i}.length; i += 4) {`),l.push(`${y} ${i} += ${n}[i] + ' ' + ${n}[i + 1] + ' ' + ${n}[i + 2] + ' ';`),l.push(`${y}}`),l.push(`${y}if (typeof require !== "undefined") {`),l.push(`${y} require('fs').writeFileSync('./${u}.ppm', ${i});`),l.push(`${y}}`),v++}(arguments[2],arguments[3]),h&&h(o,m),e.readPixels.apply(e,arguments);case"drawBuffers":return l.push(`${y}${r}.drawBuffers([${s(arguments[0],{contextName:r,contextVariables:d,getEntity:w,addVariable:T,variables:c,onUnrecognizedArgumentLookup:p})}]);`),e.drawBuffers(arguments[0])}let t=e[f].apply(e,arguments);switch(typeof t){case"undefined":return void l.push(`${y}${k(f,arguments)};`);case"number":case"boolean":if(a&&-1===d.indexOf(o(t))){l.push(`${y}const ${r}Variable${d.length} = ${k(f,arguments)};`),d.push(t=o(t));break}default:null===t?l.push(`${k(f,arguments)};`):l.push(`${y}const ${r}Variable${d.length} = ${k(f,arguments)};`),d.push(t)}return t};return m[e[f]]=f,e[f]}}),d=[],m={};let g,v=0,y="";return f;function _(){return l.join("\n")}function b(){for(;l.length>0;)l.pop()}function x(e,t){c[e]=t}function w(e){const t=m[e];return t?r+"."+t:e}function E(e){y=" ".repeat(e)}function T(e,t){const n=`${r}Variable${d.length}`;return l.push(`${y}const ${n} = ${t};`),d.push(e),n}function A(e){l.push(`${y}// ${e}`)}function S(){l.push(`${y}(() => {\n${y}const error = ${r}.getError();\n${y}if (error !== ${r}.NONE) {\n${y} const names = Object.getOwnPropertyNames(gl);\n${y} for (let i = 0; i < names.length; i++) {\n${y} const name = names[i];\n${y} if (${r}[name] === error) {\n${y} throw new Error('${r} threw ' + name);\n${y} }\n${y} }\n${y}}\n${y}})();`)}function k(e,t){return`${r}.${e}(${s(t,{contextName:r,contextVariables:d,getEntity:w,addVariable:T,variables:c,onUnrecognizedArgumentLookup:p})})`}function C(e){const t=d.indexOf(e);return-1!==t?`${r}Variable${t}`:null}}function i(e,t){const r=new Proxy(e,{get:function(t,r){if("function"==typeof t[r])return function(){switch(r){case"drawBuffersWEBGL":return c.push(`${p}${i}.drawBuffersWEBGL([${s(arguments[0],{contextName:i,contextVariables:a,getEntity:d,addVariable:g,variables:h,onUnrecognizedArgumentLookup:f})}]);`),e.drawBuffersWEBGL(arguments[0])}let t=e[r].apply(e,arguments);switch(typeof t){case"undefined":return void c.push(`${p}${m(r,arguments)};`);case"number":case"boolean":l&&-1===a.indexOf(o(t))?(c.push(`${p}const ${i}Variable${a.length} = ${m(r,arguments)};`),a.push(t=o(t))):(c.push(`${p}const ${i}Variable${a.length} = ${m(r,arguments)};`),a.push(t));break;default:null===t?c.push(`${m(r,arguments)};`):c.push(`${p}const ${i}Variable${a.length} = ${m(r,arguments)};`),a.push(t)}return t};return n[e[r]]=r,e[r]}}),n={},{contextName:i,contextVariables:a,getEntity:u,useTrackablePrimitives:l,recording:c,variables:h,indent:p,onUnrecognizedArgumentLookup:f}=t;return r;function d(e){return n.hasOwnProperty(e)?`${i}.${n[e]}`:u(e)}function m(e,t){return`${i}.${e}(${s(t,{contextName:i,contextVariables:a,getEntity:d,addVariable:g,variables:h,onUnrecognizedArgumentLookup:f})})`}function g(e,t){const r=`${i}Variable${a.length}`;return a.push(e),c.push(`${p}const ${r} = ${t};`),r}}function s(e,t){const{variables:r,onUnrecognizedArgumentLookup:n}=t;return Array.from(e).map(e=>{const i=function(e){if(r)for(const t in r)if(r.hasOwnProperty(t)&&r[t]===e)return t;if(n)return n(e);return null}(e);return i||function(e,t){const{contextName:r,contextVariables:n,getEntity:i,addVariable:s,onUnrecognizedArgumentLookup:o}=t;if(void 0===e)return"undefined";if(null===e)return"null";const a=n.indexOf(e);if(a>-1)return`${r}Variable${a}`;switch(e.constructor.name){case"String":const t=/\n/.test(e),r=/'/.test(e),n=/"/.test(e);return t?"`"+e+"`":r&&!n?'"'+e+'"':"'"+e+"'";case"Number":case"Boolean":return i(e);case"Array":return s(e,`new ${e.constructor.name}([${Array.from(e).join(",")}])`);case"Float32Array":case"Uint8Array":case"Uint16Array":case"Int32Array":return s(e,`new ${e.constructor.name}(${JSON.stringify(Array.from(e))})`);default:if(o){const t=o(e);if(t)return t}throw new Error(`unrecognized argument type ${e.constructor.name}`)}}(e,t)}).join(", ")}function o(e){return new e.constructor(e)}void 0!==t&&(t.exports={glWiretap:n,glExtensionWiretap:i}),"undefined"!=typeof window&&(n.glExtensionWiretap=i,window.glWiretap=n)},{}],136:[function(e,t,r){"undefined"!=typeof WebGLRenderingContext?t.exports=e("./src/javascript/browser-index"):t.exports=e("./src/javascript/node-index")},{"./src/javascript/browser-index":138,"./src/javascript/node-index":152}],137:[function(e,t,r){t.exports={name:"gl",version:"4.9.0",description:"Creates a WebGL context without a window",main:"index.js",directories:{test:"test"},browser:"browser_index.js",engines:{node:">=8.0.0"},scripts:{test:"standard | snazzy && tape test/*.js | faucet",rebuild:"node-gyp rebuild --verbose",prebuild:"prebuild --all --strip",install:"prebuild-install || node-gyp rebuild"},dependencies:{bindings:"^1.5.0","bit-twiddle":"^1.0.2","glsl-tokenizer":"^2.0.2",nan:"^2.14.1","node-abi":"^2.18.0","node-gyp":"^7.1.0","prebuild-install":"^5.3.5"},devDependencies:{"angle-normals":"^1.0.0",bunny:"^1.0.1",faucet:"0.0.1","gl-conformance":"^2.0.9",prebuild:"^10.0.1",snazzy:"^8.0.0",standard:"^14.3.4",tape:"^5.0.1"},repository:{type:"git",url:"git://github.com/stackgl/headless-gl.git"},keywords:["webgl","opengl","gl","headless","server","gpgpu"],author:"Mikola Lysenko",license:"BSD-2-Clause",gypfile:!0}},{}],138:[function(e,t,r){t.exports=function(e,t,r){if(t|=0,!((e|=0)>0&&t>0))return null;const n=document.createElement("canvas");if(!n)return null;let i;n.width=e,n.height=t;try{i=n.getContext("webgl",r)}catch(e){try{i=n.getContext("experimental-webgl",r)}catch(e){return null}}const s=i.getExtension,o={destroy:function(){const e=s.call(i,"WEBGL_lose_context");e&&e.loseContext()}},a={resize:function(e,t){n.width=e,n.height=t}},u=i.getSupportedExtensions().slice();return u.push("STACKGL_destroy_context","STACKGL_resize_drawingbuffer"),i.getSupportedExtensions=function(){return u.slice()},i.getExtension=function(e){const t=e.toLowerCase();return"stackgl_resize_drawingbuffer"===t?a:"stackgl_destroy_context"===t?o:s.call(i,e)},i||null}},{}],139:[function(e,t,r){const{gl:n}=e("../native-gl"),{vertexCount:i}=e("../utils");class s{constructor(e){this.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE=35070,this.ctx=e,this._drawArraysInstanced=n._drawArraysInstanced.bind(e),this._drawElementsInstanced=n._drawElementsInstanced.bind(e),this._vertexAttribDivisor=n._vertexAttribDivisor.bind(e)}drawArraysInstancedANGLE(e,t,r,s){const{ctx:o}=this;if(e|=0,r|=0,s|=0,(t|=0)<0||r<0||s<0)return void o.setError(n.INVALID_VALUE);if(!o._checkStencilState())return;const a=i(e,r);if(a<0)return void o.setError(n.INVALID_ENUM);if(!o._framebufferOk())return;if(0===r||0===s)return;let u=t;return r>0&&(u=r+t-1>>>0),this.checkInstancedVertexAttribState(u,s)?this._drawArraysInstanced(e,t,a,s):void 0}drawElementsInstancedANGLE(e,t,r,i,s){const{ctx:o}=this;if(e|=0,r|=0,i|=0,s|=0,(t|=0)<0||i<0||s<0)return void o.setError(n.INVALID_VALUE);if(!o._checkStencilState())return;const a=o._vertexObjectState._elementArrayBufferBinding;if(!a)return void o.setError(n.INVALID_OPERATION);let u=null,l=i;if(r===n.UNSIGNED_SHORT){if(l%2)return void o.setError(n.INVALID_OPERATION);l>>=1,u=new Uint16Array(a._elements.buffer)}else if(o._extensions.oes_element_index_uint&&r===n.UNSIGNED_INT){if(l%4)return void o.setError(n.INVALID_OPERATION);l>>=2,u=new Uint32Array(a._elements.buffer)}else{if(r!==n.UNSIGNED_BYTE)return void o.setError(n.INVALID_ENUM);u=a._elements}let c=t;switch(e){case n.TRIANGLES:t%3&&(c-=t%3);break;case n.LINES:t%2&&(c-=t%2);break;case n.POINTS:break;case n.LINE_LOOP:case n.LINE_STRIP:if(t<2)return void o.setError(n.INVALID_OPERATION);break;case n.TRIANGLE_FAN:case n.TRIANGLE_STRIP:if(t<3)return void o.setError(n.INVALID_OPERATION);break;default:return void o.setError(n.INVALID_ENUM)}if(!o._framebufferOk())return;if(0===t||0===s)return void this.checkInstancedVertexAttribState(0,0);if(t+l>>>0>u.length)return void o.setError(n.INVALID_OPERATION);let h=-1;for(let e=l;e<l+t;++e)h=Math.max(h,u[e]);h<0?this.checkInstancedVertexAttribState(0,0):this.checkInstancedVertexAttribState(h,s)&&c>0&&this._drawElementsInstanced(e,c,r,i,s)}vertexAttribDivisorANGLE(e,t){const{ctx:r}=this;e|=0,(t|=0)<0||e<0||e>=r._vertexObjectState._attribs.length?r.setError(n.INVALID_VALUE):(r._vertexObjectState._attribs[e]._divisor=t,this._vertexAttribDivisor(e,t))}checkInstancedVertexAttribState(e,t){const{ctx:r}=this,i=r._activeProgram;if(!i)return r.setError(n.INVALID_OPERATION),!1;const s=r._vertexObjectState._attribs;let o=!1;for(let a=0;a<s.length;++a){const u=s[a];if(u._isPointer){const s=u._pointerBuffer;if(i._attributes.indexOf(a)>=0){if(!s)return r.setError(n.INVALID_OPERATION),!1;let i=0;if(0===u._divisor?(o=!0,i=u._pointerStride*e+u._pointerSize+u._pointerOffset):i=u._pointerStride*(Math.ceil(t/u._divisor)-1)+u._pointerSize+u._pointerOffset,i>s._size)return r.setError(n.INVALID_OPERATION),!1}}}return!!o||(r.setError(n.INVALID_OPERATION),!1)}}t.exports={ANGLEInstancedArrays:s,getANGLEInstancedArrays:function(e){return new s(e)}}},{"../native-gl":151,"../utils":153}],140:[function(e,t,r){class n{constructor(){this.MIN_EXT=32775,this.MAX_EXT=32776}}t.exports={getEXTBlendMinMax:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("EXT_blend_minmax")>=0&&(t=new n),t},EXTBlendMinMax:n}},{}],141:[function(e,t,r){class n{constructor(){this.TEXTURE_MAX_ANISOTROPY_EXT=34046,this.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047}}t.exports={getEXTTextureFilterAnisotropic:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("EXT_texture_filter_anisotropic")>=0&&(t=new n),t},EXTTextureFilterAnisotropic:n}},{}],142:[function(e,t,r){class n{}t.exports={getOESElementIndexUint:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_element_index_uint")>=0&&(t=new n),t},OESElementIndexUint:n}},{}],143:[function(e,t,r){class n{constructor(){this.FRAGMENT_SHADER_DERIVATIVE_HINT_OES=35723}}t.exports={getOESStandardDerivatives:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_standard_derivatives")>=0&&(t=new n),t},OESStandardDerivatives:n}},{}],144:[function(e,t,r){class n{}t.exports={getOESTextureFloatLinear:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_texture_float_linear")>=0&&(t=new n),t},OESTextureFloatLinear:n}},{}],145:[function(e,t,r){class n{}t.exports={getOESTextureFloat:function(e){let t=null;const r=e.getSupportedExtensions();return r&&r.indexOf("OES_texture_float")>=0&&(t=new n),t},OESTextureFloat:n}},{}],146:[function(e,t,r){const{Linkable:n}=e("../linkable"),{gl:i}=e("../native-gl"),{checkObject:s}=e("../utils"),{WebGLVertexArrayObjectState:o}=e("../webgl-vertex-attribute");class a extends n{constructor(e,t,r){super(e),this._ctx=t,this._ext=r,this._vertexState=new o(t)}_performDelete(){this._vertexState.cleanUp(),delete this._vertexState,delete this._ext._vaos[this._],i.deleteVertexArrayOES.call(this._ctx,0|this._)}}class u{constructor(e){this.VERTEX_ARRAY_BINDING_OES=34229,this._ctx=e,this._vaos={},this._activeVertexArrayObject=null}createVertexArrayOES(){const{_ctx:e}=this,t=i.createVertexArrayOES.call(e);if(t<=0)return null;const r=new a(t,e,this);return this._vaos[t]=r,r}deleteVertexArrayOES(e){const{_ctx:t}=this;if(!s(e))throw new TypeError("deleteVertexArrayOES(WebGLVertexArrayObjectOES)");e instanceof a&&t._checkOwns(e)?e._pendingDelete||(this._activeVertexArrayObject===e&&this.bindVertexArrayOES(null),e._pendingDelete=!0,e._checkDelete()):t.setError(i.INVALID_OPERATION)}bindVertexArrayOES(e){const{_ctx:t,_activeVertexArrayObject:r}=this;if(!s(e))throw new TypeError("bindVertexArrayOES(WebGLVertexArrayObjectOES)");if(e){if(e instanceof a&&e._pendingDelete)return void t.setError(i.INVALID_OPERATION);if(!t._checkWrapper(e,a))return;i.bindVertexArrayOES.call(t,e._)}else e=null,i.bindVertexArrayOES.call(t,null);r!==e&&(r&&(r._refCount-=1,r._checkDelete()),e&&(e._refCount+=1)),t._vertexObjectState=null===e?t._defaultVertexObjectState:e._vertexState,this._activeVertexArrayObject=e}isVertexArrayOES(e){const{_ctx:t}=this;return!!t._isObject(e,"isVertexArrayOES",a)&&i.isVertexArrayOES.call(t,0|e._)}}t.exports={WebGLVertexArrayObjectOES:a,OESVertexArrayObject:u,getOESVertexArrayObject:function(e){const t=e.getSupportedExtensions();return t&&t.indexOf("OES_vertex_array_object")>=0?new u(e):null}}},{"../linkable":150,"../native-gl":151,"../utils":153,"../webgl-vertex-attribute":167}],147:[function(e,t,r){class n{constructor(e){this.destroy=e.destroy.bind(e)}}t.exports={getSTACKGLDestroyContext:function(e){return new n(e)},STACKGLDestroyContext:n}},{}],148:[function(e,t,r){class n{constructor(e){this.resize=e.resize.bind(e)}}t.exports={getSTACKGLResizeDrawingBuffer:function(e){return new n(e)},STACKGLResizeDrawingBuffer:n}},{}],149:[function(e,t,r){const{gl:n}=e("../native-gl");class i{constructor(e){this.ctx=e;const t=e.getSupportedExtensions();if(t&&t.indexOf("WEBGL_draw_buffers")>=0){Object.assign(this,e.extWEBGL_draw_buffers()),this._buffersState=[e.BACK],this._maxDrawBuffers=e._getParameterDirect(this.MAX_DRAW_BUFFERS_WEBGL),this._ALL_ATTACHMENTS=[],this._ALL_COLOR_ATTACHMENTS=[];const t=[this.COLOR_ATTACHMENT0_WEBGL,this.COLOR_ATTACHMENT1_WEBGL,this.COLOR_ATTACHMENT2_WEBGL,this.COLOR_ATTACHMENT3_WEBGL,this.COLOR_ATTACHMENT4_WEBGL,this.COLOR_ATTACHMENT5_WEBGL,this.COLOR_ATTACHMENT6_WEBGL,this.COLOR_ATTACHMENT7_WEBGL,this.COLOR_ATTACHMENT8_WEBGL,this.COLOR_ATTACHMENT9_WEBGL,this.COLOR_ATTACHMENT10_WEBGL,this.COLOR_ATTACHMENT11_WEBGL,this.COLOR_ATTACHMENT12_WEBGL,this.COLOR_ATTACHMENT13_WEBGL,this.COLOR_ATTACHMENT14_WEBGL,this.COLOR_ATTACHMENT15_WEBGL];for(;this._ALL_ATTACHMENTS.length<this._maxDrawBuffers;){const e=t.shift();this._ALL_ATTACHMENTS.push(e),this._ALL_COLOR_ATTACHMENTS.push(e)}this._ALL_ATTACHMENTS.push(n.DEPTH_ATTACHMENT,n.STENCIL_ATTACHMENT,n.DEPTH_STENCIL_ATTACHMENT)}}drawBuffersWEBGL(e){const{ctx:t}=this;if(e.length<1)t.setError(n.INVALID_OPERATION);else{if(1===e.length&&e[0]===n.BACK)return this._buffersState=e,void t.drawBuffersWEBGL([this.COLOR_ATTACHMENT0_WEBGL]);if(!t._activeFramebuffer){if(e.length>1)return void t.setError(n.INVALID_OPERATION);for(let r=0;r<e.length;r++)if(e[r]>n.NONE)return void t.setError(n.INVALID_OPERATION)}this._buffersState=e,t.drawBuffersWEBGL(e)}}}t.exports={getWebGLDrawBuffers:function(e){const t=e.getSupportedExtensions();return t&&t.indexOf("WEBGL_draw_buffers")>=0?new i(e):null},WebGLDrawBuffers:i}},{"../native-gl":151}],150:[function(e,t,r){t.exports={Linkable:class{constructor(e){this._=e,this._references=[],this._refCount=0,this._pendingDelete=!1,this._binding=0}_link(e){return this._references.push(e),e._refCount+=1,!0}_unlink(e){let t=this._references.indexOf(e);if(t<0)return!1;for(;t>=0;)this._references[t]=this._references[this._references.length-1],this._references.pop(),e._refCount-=1,e._checkDelete(),t=this._references.indexOf(e);return!0}_linked(e){return this._references.indexOf(e)>=0}_checkDelete(){if(this._refCount<=0&&this._pendingDelete&&0!==this._){for(;this._references.length>0;)this._unlink(this._references[0]);this._performDelete(),this._=0}}_performDelete(){}}}},{}],151:[function(e,t,r){(function(r){const n=e("bindings")("webgl"),{WebGLRenderingContext:i}=n;r.on("exit",n.cleanup);const s=i.prototype;delete s["1.0.0"],delete i["1.0.0"],t.exports={gl:s,NativeWebGL:n,NativeWebGLRenderingContext:i}}).call(this,e("_process"))},{_process:437,bindings:31}],152:[function(e,t,r){const n=e("bit-twiddle"),{WebGLContextAttributes:i}=e("./webgl-context-attributes"),{WebGLRenderingContext:s,wrapContext:o}=e("./webgl-rendering-context"),{WebGLTextureUnit:a}=e("./webgl-texture-unit"),{WebGLVertexArrayObjectState:u,WebGLVertexArrayGlobalState:l}=e("./webgl-vertex-attribute");let c=0;function h(e,t,r){return e&&"object"==typeof e&&t in e?!!e[t]:r}t.exports=function(e,t,r){if(t|=0,!((e|=0)>0&&t>0))return null;const p=new i(h(r,"alpha",!0),h(r,"depth",!0),h(r,"stencil",!1),!1,h(r,"premultipliedAlpha",!0),h(r,"preserveDrawingBuffer",!1),h(r,"preferLowPowerToHighPerformance",!1),h(r,"failIfMajorPerformanceCaveat",!1));let f;p.premultipliedAlpha=p.premultipliedAlpha&&p.alpha;try{f=new s(1,1,p.alpha,p.depth,p.stencil,p.antialias,p.premultipliedAlpha,p.preserveDrawingBuffer,p.preferLowPowerToHighPerformance,p.failIfMajorPerformanceCaveat)}catch(e){}if(!f)return null;f.drawingBufferWidth=e,f.drawingBufferHeight=t,f._=c++,f._contextAttributes=p,f._extensions={},f._programs={},f._shaders={},f._buffers={},f._textures={},f._framebuffers={},f._renderbuffers={},f._activeProgram=null,f._activeFramebuffer=null,f._activeRenderbuffer=null,f._checkStencil=!1,f._stencilState=!0;const d=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS);f._textureUnits=new Array(d);for(let e=0;e<d;++e)f._textureUnits[e]=new a(e);f._activeTextureUnit=0,f.activeTexture(f.TEXTURE0),f._errorStack=[],f._defaultVertexObjectState=new u(f),f._vertexObjectState=f._defaultVertexObjectState,f._vertexGlobalState=new l(f),f._maxTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE),f._maxTextureLevel=n.log2(n.nextPow2(f._maxTextureSize)),f._maxCubeMapSize=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),f._maxCubeMapLevel=n.log2(n.nextPow2(f._maxCubeMapSize)),f._unpackAlignment=4,f._packAlignment=4,f._allocateDrawingBuffer(e,t);const m=f.createBuffer();return f._attrib0Buffer=m,f.bindBuffer(f.ARRAY_BUFFER,null),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,null),f.bindFramebuffer(f.FRAMEBUFFER,null),f.bindRenderbuffer(f.RENDERBUFFER,null),f.viewport(0,0,e,t),f.scissor(0,0,e,t),f.clearDepth(1),f.clearColor(0,0,0,0),f.clearStencil(0),f.clear(f.COLOR_BUFFER_BIT|f.DEPTH_BUFFER_BIT|f.STENCIL_BUFFER_BIT),o(f)}},{"./webgl-context-attributes":156,"./webgl-rendering-context":161,"./webgl-texture-unit":164,"./webgl-vertex-attribute":167,"bit-twiddle":32}],153:[function(e,t,r){(function(r){const{gl:n}=e("./native-gl"),{WebGLUniformLocation:i}=e("./webgl-uniform-location");function s(e){return new Uint8Array(e.buffer).subarray(e.byteOffset,e.byteLength+e.byteOffset)}t.exports={bindPublics:function(e,t,r,n){for(let i=0;i<e.length;i++){const s=e[i],o=r[s];if("function"==typeof o)-1===n.indexOf(s)&&(t[s]=o.bind(r));else{if("_"===s[0]||"0"===s[0]||"1"===s[0])continue;t[s]=o}}},checkObject:function(e){return"object"==typeof e||void 0===e},isTypedArray:function(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Uint32Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array},isValidString:function(e){const t=e.replace(/(?:\/\*(?:[\s\S]*?)\*\/)|(?:([\s;])+\/\/(?:.*)$)/gm,"");return!/["$`@\\'\0]/.test(t)},vertexCount:function(e,t){switch(e){case n.TRIANGLES:return t-t%3;case n.LINES:return t-t%2;case n.LINE_LOOP:case n.POINTS:return t;case n.TRIANGLE_FAN:case n.LINE_STRIP:return t<2?0:t;case n.TRIANGLE_STRIP:return t<3?0:t;default:return-1}},typeSize:function(e){switch(e){case n.UNSIGNED_BYTE:case n.BYTE:return 1;case n.UNSIGNED_SHORT:case n.SHORT:return 2;case n.UNSIGNED_INT:case n.INT:case n.FLOAT:return 4}return 0},uniformTypeSize:function(e){switch(e){case n.BOOL_VEC4:case n.INT_VEC4:case n.FLOAT_VEC4:return 4;case n.BOOL_VEC3:case n.INT_VEC3:case n.FLOAT_VEC3:return 3;case n.BOOL_VEC2:case n.INT_VEC2:case n.FLOAT_VEC2:return 2;case n.BOOL:case n.INT:case n.FLOAT:case n.SAMPLER_2D:case n.SAMPLER_CUBE:return 1;default:return 0}},unpackTypedArray:s,extractImageData:function(e){if("object"==typeof e&&void 0!==e.width&&void 0!==e.height){if(void 0!==e.data)return e;let t=null;if("function"==typeof e.getContext)t=e.getContext("2d");else if(void 0!==e.src&&"object"==typeof document&&"function"==typeof document.createElement){const r=document.createElement("canvas");"object"==typeof r&&"function"==typeof r.getContext&&null!==(t=r.getContext("2d"))&&t.drawImage(e,0,0)}if(null!==t)return t.getImageData(0,0,e.width,e.height)}return null},formatSize:function(e){switch(e){case n.ALPHA:case n.LUMINANCE:return 1;case n.LUMINANCE_ALPHA:return 2;case n.RGB:return 3;case n.RGBA:return 4}return 0},checkFormat:function(e){return e===n.ALPHA||e===n.LUMINANCE_ALPHA||e===n.LUMINANCE||e===n.RGB||e===n.RGBA},checkUniform:function(e,t){return t instanceof i&&t._program===e&&t._linkCount===e._linkCount},convertPixels:function(e){if("object"==typeof e&&null!==e){if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint8ClampedArray||e instanceof Float32Array)return s(e);if(e instanceof r)return new Uint8Array(e)}return null},validCubeTarget:function(e){return e===n.TEXTURE_CUBE_MAP_POSITIVE_X||e===n.TEXTURE_CUBE_MAP_NEGATIVE_X||e===n.TEXTURE_CUBE_MAP_POSITIVE_Y||e===n.TEXTURE_CUBE_MAP_NEGATIVE_Y||e===n.TEXTURE_CUBE_MAP_POSITIVE_Z||e===n.TEXTURE_CUBE_MAP_NEGATIVE_Z}}}).call(this,e("buffer").Buffer)},{"./native-gl":151,"./webgl-uniform-location":166,buffer:299}],154:[function(e,t,r){t.exports={WebGLActiveInfo:class{constructor(e){this.size=e.size,this.type=e.type,this.name=e.name}}}},{}],155:[function(e,t,r){const{Linkable:n}=e("./linkable"),{gl:i}=e("./native-gl");t.exports={WebGLBuffer:class extends n{constructor(e,t){super(e),this._ctx=t,this._size=0,this._elements=new Uint8Array(0)}_performDelete(){const e=this._ctx;delete e._buffers[0|this._],i.deleteBuffer.call(e,0|this._)}}}},{"./linkable":150,"./native-gl":151}],156:[function(e,t,r){t.exports={WebGLContextAttributes:class{constructor(e,t,r,n,i,s,o,a){this.alpha=e,this.depth=t,this.stencil=r,this.antialias=n,this.premultipliedAlpha=i,this.preserveDrawingBuffer=s,this.preferLowPowerToHighPerformance=o,this.failIfMajorPerformanceCaveat=a}}}},{}],157:[function(e,t,r){t.exports={WebGLDrawingBufferWrapper:class{constructor(e,t,r){this._framebuffer=e,this._color=t,this._depthStencil=r}}}},{}],158:[function(e,t,r){const{Linkable:n}=e("./linkable"),{gl:i}=e("./native-gl");t.exports={WebGLFramebuffer:class extends n{constructor(e,t){if(super(e),this._ctx=t,this._binding=0,this._width=0,this._height=0,this._status=null,this._attachments={},this._attachments[i.COLOR_ATTACHMENT0]=null,this._attachments[i.DEPTH_ATTACHMENT]=null,this._attachments[i.STENCIL_ATTACHMENT]=null,this._attachments[i.DEPTH_STENCIL_ATTACHMENT]=null,this._attachmentLevel={},this._attachmentLevel[i.COLOR_ATTACHMENT0]=0,this._attachmentLevel[i.DEPTH_ATTACHMENT]=0,this._attachmentLevel[i.STENCIL_ATTACHMENT]=0,this._attachmentLevel[i.DEPTH_STENCIL_ATTACHMENT]=0,this._attachmentFace={},this._attachmentFace[i.COLOR_ATTACHMENT0]=0,this._attachmentFace[i.DEPTH_ATTACHMENT]=0,this._attachmentFace[i.STENCIL_ATTACHMENT]=0,this._attachmentFace[i.DEPTH_STENCIL_ATTACHMENT]=0,t._extensions.webgl_draw_buffers){const{webgl_draw_buffers:e}=t._extensions;this._attachments[e.COLOR_ATTACHMENT1_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT2_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT3_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT4_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT5_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT6_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT7_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT8_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT9_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT10_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT11_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT12_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT13_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT14_WEBGL]=null,this._attachments[e.COLOR_ATTACHMENT15_WEBGL]=null,this._attachments[i.NONE]=null,this._attachments[i.BACK]=null,this._attachmentLevel[e.COLOR_ATTACHMENT1_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT2_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT3_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT4_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT5_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT6_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT7_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT8_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT9_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT10_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT11_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT12_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT13_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT14_WEBGL]=0,this._attachmentLevel[e.COLOR_ATTACHMENT15_WEBGL]=0,this._attachmentLevel[i.NONE]=null,this._attachmentLevel[i.BACK]=null,this._attachmentFace[e.COLOR_ATTACHMENT1_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT2_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT3_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT4_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT5_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT6_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT7_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT8_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT9_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT10_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT11_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT12_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT13_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT14_WEBGL]=0,this._attachmentFace[e.COLOR_ATTACHMENT15_WEBGL]=0,this._attachmentFace[i.NONE]=null,this._attachmentFace[i.BACK]=null}}_clearAttachment(e){const t=this._attachments[e];t&&(this._attachments[e]=null,this._unlink(t))}_setAttachment(e,t){this._attachments[t]!==e&&(this._clearAttachment(t),e&&(this._attachments[t]=e,this._link(e)))}_performDelete(){const e=this._ctx;delete e._framebuffers[0|this._],i.deleteFramebuffer.call(e,0|this._)}}}},{"./linkable":150,"./native-gl":151}],159:[function(e,t,r){const{Linkable:n}=e("./linkable"),{gl:i}=e("./native-gl");t.exports={WebGLProgram:class extends n{constructor(e,t){super(e),this._ctx=t,this._linkCount=0,this._linkStatus=!1,this._linkInfoLog="not linked",this._attributes=[],this._uniforms=[]}_performDelete(){const e=this._ctx;delete e._programs[0|this._],i.deleteProgram.call(e,0|this._)}}}},{"./linkable":150,"./native-gl":151}],160:[function(e,t,r){const{Linkable:n}=e("./linkable"),{gl:i}=e("./native-gl");t.exports={WebGLRenderbuffer:class extends n{constructor(e,t){super(e),this._ctx=t,this._binding=0,this._width=0,this._height=0,this._format=0}_performDelete(){const e=this._ctx;delete e._renderbuffers[0|this._],i.deleteRenderbuffer.call(e,0|this._)}}}},{"./linkable":150,"./native-gl":151}],161:[function(e,t,r){const n=e("bit-twiddle"),i=e("glsl-tokenizer/string"),s=e("../../package.json").version,{gl:o,NativeWebGLRenderingContext:a,NativeWebGL:u}=e("./native-gl"),{getANGLEInstancedArrays:l}=e("./extensions/angle-instanced-arrays"),{getOESElementIndexUint:c}=e("./extensions/oes-element-index-unit"),{getOESStandardDerivatives:h}=e("./extensions/oes-standard-derivatives"),{getOESTextureFloat:p}=e("./extensions/oes-texture-float"),{getOESTextureFloatLinear:f}=e("./extensions/oes-texture-float-linear"),{getSTACKGLDestroyContext:d}=e("./extensions/stackgl-destroy-context"),{getSTACKGLResizeDrawingBuffer:m}=e("./extensions/stackgl-resize-drawing-buffer"),{getWebGLDrawBuffers:g}=e("./extensions/webgl-draw-buffers"),{getEXTBlendMinMax:v}=e("./extensions/ext-blend-minmax"),{getEXTTextureFilterAnisotropic:y}=e("./extensions/ext-texture-filter-anisotropic"),{getOESVertexArrayObject:_}=e("./extensions/oes-vertex-array-object"),{bindPublics:b,checkObject:x,checkUniform:w,formatSize:E,isValidString:T,typeSize:A,uniformTypeSize:S,extractImageData:k,vertexCount:C,isTypedArray:I,unpackTypedArray:R,convertPixels:L,checkFormat:O,validCubeTarget:M}=e("./utils"),{WebGLActiveInfo:P}=e("./webgl-active-info"),{WebGLFramebuffer:B}=e("./webgl-framebuffer"),{WebGLBuffer:N}=e("./webgl-buffer"),{WebGLDrawingBufferWrapper:D}=e("./webgl-drawing-buffer-wrapper"),{WebGLProgram:F}=e("./webgl-program"),{WebGLRenderbuffer:j}=e("./webgl-renderbuffer"),{WebGLShader:U}=e("./webgl-shader"),{WebGLShaderPrecisionFormat:$}=e("./webgl-shader-precision-format"),{WebGLTexture:V}=e("./webgl-texture"),{WebGLUniformLocation:G}=e("./webgl-uniform-location"),z=256,W=256,H=[o.COLOR_ATTACHMENT0,o.DEPTH_ATTACHMENT,o.STENCIL_ATTACHMENT,o.DEPTH_STENCIL_ATTACHMENT],K=[o.COLOR_ATTACHMENT0],q={angle_instanced_arrays:l,oes_element_index_uint:c,oes_texture_float:p,oes_texture_float_linear:f,oes_standard_derivatives:h,oes_vertex_array_object:_,stackgl_destroy_context:d,stackgl_resize_drawingbuffer:m,webgl_draw_buffers:g,ext_blend_minmax:v,ext_texture_filter_anisotropic:y},X=["resize","destroy"];class Y extends a{_checkDimensions(e,t,r,n){if(n<0||t<0||r<0)return this.setError(o.INVALID_VALUE),!1;if(e===o.TEXTURE_2D){if(t>this._maxTextureSize||r>this._maxTextureSize||n>this._maxTextureLevel)return this.setError(o.INVALID_VALUE),!1}else{if(!this._validCubeTarget(e))return this.setError(o.INVALID_ENUM),!1;if(t>this._maxCubeMapSize||r>this._maxCubeMapSize||n>this._maxCubeMapLevel)return this.setError(o.INVALID_VALUE),!1}return!0}_checkLocation(e){return e instanceof G?e._program._ctx===this&&e._linkCount===e._program._linkCount||(this.setError(o.INVALID_OPERATION),!1):(this.setError(o.INVALID_VALUE),!1)}_checkLocationActive(e){return!!e&&(!!this._checkLocation(e)&&(e._program===this._activeProgram||(this.setError(o.INVALID_OPERATION),!1)))}_checkOwns(e){return"object"==typeof e&&e._ctx===this}_checkShaderSource(e){const t=e._source,r=i(t);let n=!1;const s=[];for(let e=0;e<r.length;++e){const t=r[e];switch(t.type){case"ident":this._validGLSLIdentifier(t.data)||(n=!0,s.push(t.line+":"+t.column+" invalid identifier - "+t.data));break;case"preprocessor":{const e=i(t.data.match(/^\s*#\s*(.*)$/)[1]);for(let r=0;r<e.length;++r){const i=e[r];"ident"!==i.type&&void 0!==i.type||this._validGLSLIdentifier(i.data)||(n=!0,s.push(t.line+":"+i.column+" invalid identifier - "+i.data))}break}case"keyword":switch(t.data){case"do":n=!0,s.push(t.line+":"+t.column+" do not supported")}break;case"builtin":switch(t.data){case"dFdx":case"dFdy":case"fwidth":this._extensions.oes_standard_derivatives||(n=!0,s.push(t.line+":"+t.column+" "+t.data+" not supported"))}}}return n&&(e._compileInfo=s.join("\n")),!n}_checkStencilState(){return this._checkStencil?(this._checkStencil=!1,this._stencilState=!0,this.getParameter(o.STENCIL_WRITEMASK)===this.getParameter(o.STENCIL_BACK_WRITEMASK)&&this.getParameter(o.STENCIL_VALUE_MASK)===this.getParameter(o.STENCIL_BACK_VALUE_MASK)&&this.getParameter(o.STENCIL_REF)===this.getParameter(o.STENCIL_BACK_REF)||(this.setError(o.INVALID_OPERATION),this._stencilState=!1),this._stencilState):this._stencilState}_checkTextureTarget(e){const t=this._getActiveTextureUnit();let r=null;if(e===o.TEXTURE_2D)r=t._bind2D;else{if(e!==o.TEXTURE_CUBE_MAP)return this.setError(o.INVALID_ENUM),!1;r=t._bindCube}return!!r||(this.setError(o.INVALID_OPERATION),!1)}_checkWrapper(e,t){return this._checkValid(e,t)?!!this._checkOwns(e)||(this.setError(o.INVALID_OPERATION),!1):(this.setError(o.INVALID_VALUE),!1)}_checkValid(e,t){return e instanceof t&&0!==e._}_checkVertexAttribState(e){const t=this._activeProgram;if(!t)return this.setError(o.INVALID_OPERATION),!1;const r=this._vertexObjectState._attribs;for(let n=0;n<r.length;++n){const i=r[n];if(i._isPointer){const r=i._pointerBuffer;if(!r)return this.setError(o.INVALID_OPERATION),!1;if(t._attributes.indexOf(n)>=0){let t=0;if((t=i._divisor?i._pointerSize+i._pointerOffset:i._pointerStride*e+i._pointerSize+i._pointerOffset)>r._size)return this.setError(o.INVALID_OPERATION),!1}}}return!0}_checkVertexIndex(e){return!(e<0||e>=this._vertexObjectState._attribs.length)||(this.setError(o.INVALID_VALUE),!1)}_computePixelSize(e,t){const r=E(t);if(0===r)return this.setError(o.INVALID_ENUM),0;switch(e){case o.UNSIGNED_BYTE:return r;case o.UNSIGNED_SHORT_5_6_5:if(t!==o.RGB){this.setError(o.INVALID_OPERATION);break}return 2;case o.UNSIGNED_SHORT_4_4_4_4:case o.UNSIGNED_SHORT_5_5_5_1:if(t!==o.RGBA){this.setError(o.INVALID_OPERATION);break}return 2;case o.FLOAT:return 1}return this.setError(o.INVALID_ENUM),0}_computeRowStride(e,t){let r=e*t;return r%this._unpackAlignment&&(r+=this._unpackAlignment-r%this._unpackAlignment),r}_fixupLink(e){if(!super.getProgramParameter(e._,o.LINK_STATUS))return e._linkInfoLog=super.getProgramInfoLog(e),!1;const t=this.getProgramParameter(e,o.ACTIVE_ATTRIBUTES),r=new Array(t);e._attributes.length=t;for(let n=0;n<t;++n)r[n]=this.getActiveAttrib(e,n).name,e._attributes[n]=0|this.getAttribLocation(e,r[n]);for(let t=0;t<r.length;++t)if(r[t].length>W)return e._linkInfoLog="attribute "+r[t]+" is too long",!1;for(let n=0;n<t;++n)super.bindAttribLocation(0|e._,e._attributes[n],r[n]);super.linkProgram(0|e._);const n=this.getProgramParameter(e,o.ACTIVE_UNIFORMS);e._uniforms.length=n;for(let t=0;t<n;++t)e._uniforms[t]=this.getActiveUniform(e,t);for(let t=0;t<e._uniforms.length;++t)if(e._uniforms[t].name.length>z)return e._linkInfoLog="uniform "+e._uniforms[t].name+" is too long",!1;return e._linkInfoLog="",!0}_framebufferOk(){const e=this._activeFramebuffer;return!e||this._preCheckFramebufferStatus(e)===o.FRAMEBUFFER_COMPLETE||(this.setError(o.INVALID_FRAMEBUFFER_OPERATION),!1)}_getActiveBuffer(e){return e===o.ARRAY_BUFFER?this._vertexGlobalState._arrayBufferBinding:e===o.ELEMENT_ARRAY_BUFFER?this._vertexObjectState._elementArrayBufferBinding:null}_getActiveTextureUnit(){return this._textureUnits[this._activeTextureUnit]}_getActiveTexture(e){const t=this._getActiveTextureUnit();return e===o.TEXTURE_2D?t._bind2D:e===o.TEXTURE_CUBE_MAP?t._bindCube:null}_getAttachments(){return this._extensions.webgl_draw_buffers?this._extensions.webgl_draw_buffers._ALL_ATTACHMENTS:H}_getColorAttachments(){return this._extensions.webgl_draw_buffers?this._extensions.webgl_draw_buffers._ALL_COLOR_ATTACHMENTS:K}_getParameterDirect(e){return super.getParameter(e)}_getTexImage(e){const t=this._getActiveTextureUnit();return e===o.TEXTURE_2D?t._bind2D:M(e)?t._bindCube:(this.setError(o.INVALID_ENUM),null)}_preCheckFramebufferStatus(e){const t=e._attachments,r=[],n=[],i=t[o.DEPTH_ATTACHMENT],s=t[o.DEPTH_STENCIL_ATTACHMENT],a=t[o.STENCIL_ATTACHMENT];if(s&&(a||i)||a&&i)return o.FRAMEBUFFER_UNSUPPORTED;const u=this._getColorAttachments();let l=0;for(const e in t)t[e]&&-1!==u.indexOf(1*e)&&l++;if(0===l)return o.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;if(s instanceof V)return o.FRAMEBUFFER_UNSUPPORTED;if(s instanceof j){if(s._format!==o.DEPTH_STENCIL)return o.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;r.push(s._width),n.push(s._height)}if(i instanceof V)return o.FRAMEBUFFER_UNSUPPORTED;if(i instanceof j){if(i._format!==o.DEPTH_COMPONENT16)return o.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;r.push(i._width),n.push(i._height)}if(a instanceof V)return o.FRAMEBUFFER_UNSUPPORTED;if(a instanceof j){if(a._format!==o.STENCIL_INDEX8)return o.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;r.push(a._width),n.push(a._height)}let c=!1;for(let i=0;i<u.length;++i){const s=t[u[i]];if(s instanceof V){if(s._format!==o.RGBA||s._type!==o.UNSIGNED_BYTE&&s._type!==o.FLOAT)return o.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;c=!0;const t=e._attachmentLevel[o.COLOR_ATTACHMENT0];r.push(s._levelWidth[t]),n.push(s._levelHeight[t])}else if(s instanceof j){const e=s._format;if(e!==o.RGBA4&&e!==o.RGB565&&e!==o.RGB5_A1)return o.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;c=!0,r.push(s._width),n.push(s._height)}}if(!(c||a||i||s))return o.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;if(r.length<=0||n.length<=0)return o.FRAMEBUFFER_INCOMPLETE_ATTACHMENT;for(let e=1;e<r.length;++e)if(r[e-1]!==r[e]||n[e-1]!==n[e])return o.FRAMEBUFFER_INCOMPLETE_DIMENSIONS;return 0===r[0]||0===n[0]?o.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:(e._width=r[0],e._height=n[0],o.FRAMEBUFFER_COMPLETE)}_isConstantBlendFunc(e){return e===o.CONSTANT_COLOR||e===o.ONE_MINUS_CONSTANT_COLOR||e===o.CONSTANT_ALPHA||e===o.ONE_MINUS_CONSTANT_ALPHA}_isObject(e,t,r){if(null!==e&&void 0!==e&&!(e instanceof r))throw new TypeError(t+"("+r.name+")");return!(!this._checkValid(e,r)||!this._checkOwns(e))}_resizeDrawingBuffer(e,t){const r=this._activeFramebuffer,n=this._getActiveTexture(o.TEXTURE_2D),i=this._activeRenderbuffer,s=this._contextAttributes,a=this._drawingBuffer;super.bindFramebuffer(o.FRAMEBUFFER,a._framebuffer);const u=this._getAttachments();for(let e=0;e<u.length;++e)super.framebufferTexture2D(o.FRAMEBUFFER,u[e],o.TEXTURE_2D,0,0);super.bindTexture(o.TEXTURE_2D,a._color);const l=s.alpha?o.RGBA:o.RGB;super.texImage2D(o.TEXTURE_2D,0,l,e,t,0,l,o.UNSIGNED_BYTE,null),super.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.NEAREST),super.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.NEAREST),super.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,a._color,0);let c=0,h=0;s.depth&&s.stencil?(c=o.DEPTH_STENCIL,h=o.DEPTH_STENCIL_ATTACHMENT):s.depth?(c=33191,h=o.DEPTH_ATTACHMENT):s.stencil&&(c=o.STENCIL_INDEX8,h=o.STENCIL_ATTACHMENT),c&&(super.bindRenderbuffer(o.RENDERBUFFER,a._depthStencil),super.renderbufferStorage(o.RENDERBUFFER,c,e,t),super.framebufferRenderbuffer(o.FRAMEBUFFER,h,o.RENDERBUFFER,a._depthStencil)),this.bindFramebuffer(o.FRAMEBUFFER,r),this.bindTexture(o.TEXTURE_2D,n),this.bindRenderbuffer(o.RENDERBUFFER,i)}_restoreError(e){const t=this._errorStack.pop();t===o.NO_ERROR?this.setError(e):this.setError(t)}_saveError(){this._errorStack.push(this.getError())}_switchActiveProgram(e){e&&(e._refCount-=1,e._checkDelete())}_tryDetachFramebuffer(e,t){if(e&&e._linked(t)){const r=this._getAttachments(),n=Object.keys(e._attachments);for(let i=0;i<n.length;++i)e._attachments[r[i]]===t&&this.framebufferTexture2D(o.FRAMEBUFFER,0|r[i],o.TEXTURE_2D,null)}}_updateFramebufferAttachments(e){const t=e._status,r=this._getAttachments();if(e._status=this._preCheckFramebufferStatus(e),e._status===o.FRAMEBUFFER_COMPLETE){for(let t=0;t<r.length;++t){const n=r[t];super.framebufferTexture2D(o.FRAMEBUFFER,n,e._attachmentFace[n],0,e._attachmentLevel[n])}for(let t=0;t<r.length;++t){const n=r[t],i=e._attachments[n];i instanceof V?super.framebufferTexture2D(o.FRAMEBUFFER,n,e._attachmentFace[n],0|i._,e._attachmentLevel[n]):i instanceof j&&super.framebufferRenderbuffer(o.FRAMEBUFFER,n,o.RENDERBUFFER,0|i._)}}else if(t===o.FRAMEBUFFER_COMPLETE)for(let t=0;t<r.length;++t){const n=r[t];super.framebufferTexture2D(o.FRAMEBUFFER,n,e._attachmentFace[n],0,e._attachmentLevel[n])}}_validBlendFunc(e){return e===o.ZERO||e===o.ONE||e===o.SRC_COLOR||e===o.ONE_MINUS_SRC_COLOR||e===o.DST_COLOR||e===o.ONE_MINUS_DST_COLOR||e===o.SRC_ALPHA||e===o.ONE_MINUS_SRC_ALPHA||e===o.DST_ALPHA||e===o.ONE_MINUS_DST_ALPHA||e===o.SRC_ALPHA_SATURATE||e===o.CONSTANT_COLOR||e===o.ONE_MINUS_CONSTANT_COLOR||e===o.CONSTANT_ALPHA||e===o.ONE_MINUS_CONSTANT_ALPHA}_validBlendMode(e){return e===o.FUNC_ADD||e===o.FUNC_SUBTRACT||e===o.FUNC_REVERSE_SUBTRACT||this._extensions.ext_blend_minmax&&(e===this._extensions.ext_blend_minmax.MIN_EXT||e===this._extensions.ext_blend_minmax.MAX_EXT)}_validCubeTarget(e){return e===o.TEXTURE_CUBE_MAP_POSITIVE_X||e===o.TEXTURE_CUBE_MAP_NEGATIVE_X||e===o.TEXTURE_CUBE_MAP_POSITIVE_Y||e===o.TEXTURE_CUBE_MAP_NEGATIVE_Y||e===o.TEXTURE_CUBE_MAP_POSITIVE_Z||e===o.TEXTURE_CUBE_MAP_NEGATIVE_Z}_validFramebufferAttachment(e){switch(e){case o.DEPTH_ATTACHMENT:case o.STENCIL_ATTACHMENT:case o.DEPTH_STENCIL_ATTACHMENT:case o.COLOR_ATTACHMENT0:return!0}if(this._extensions.webgl_draw_buffers){const{webgl_draw_buffers:t}=this._extensions;return e<t.COLOR_ATTACHMENT0_WEBGL+t._maxDrawBuffers}return!1}_validGLSLIdentifier(e){return!(0===e.indexOf("webgl_")||0===e.indexOf("_webgl_")||e.length>256)}_validTextureTarget(e){return e===o.TEXTURE_2D||e===o.TEXTURE_CUBE_MAP}_verifyTextureCompleteness(e,t,r){const n=this._getActiveTextureUnit();let i=null;if(e===o.TEXTURE_2D?i=n._bind2D:this._validCubeTarget(e)&&(i=n._bindCube),this._extensions.oes_texture_float&&!this._extensions.oes_texture_float_linear&&i&&i._type===o.FLOAT&&(t===o.TEXTURE_MAG_FILTER||t===o.TEXTURE_MIN_FILTER)&&(r===o.LINEAR||r===o.LINEAR_MIPMAP_NEAREST||r===o.NEAREST_MIPMAP_LINEAR||r===o.LINEAR_MIPMAP_LINEAR))return i._complete=!1,void this.bindTexture(e,i);i&&!1===i._complete&&(i._complete=!0,this.bindTexture(e,i))}_wrapShader(e,t){return!this._extensions.oes_standard_derivatives&&/#ifdef\s+GL_OES_standard_derivatives/.test(t)&&(t="#undef GL_OES_standard_derivatives\n"+t),this._extensions.webgl_draw_buffers?t:"#define gl_MaxDrawBuffers 1\n"+t}_beginAttrib0Hack(){super.bindBuffer(o.ARRAY_BUFFER,this._attrib0Buffer._),super.bufferData(o.ARRAY_BUFFER,this._vertexGlobalState._attribs[0]._data,o.STREAM_DRAW),super.enableVertexAttribArray(0),super.vertexAttribPointer(0,4,o.FLOAT,!1,0,0),super._vertexAttribDivisor(0,1)}_endAttrib0Hack(){const e=this._vertexObjectState._attribs[0];e._pointerBuffer?super.bindBuffer(o.ARRAY_BUFFER,e._pointerBuffer._):super.bindBuffer(o.ARRAY_BUFFER,0),super.vertexAttribPointer(0,e._inputSize,e._pointerType,e._pointerNormal,e._inputStride,e._pointerOffset),super._vertexAttribDivisor(0,e._divisor),super.disableVertexAttribArray(0),this._vertexGlobalState._arrayBufferBinding?super.bindBuffer(o.ARRAY_BUFFER,this._vertexGlobalState._arrayBufferBinding._):super.bindBuffer(o.ARRAY_BUFFER,0)}activeTexture(e){const t=(e|=0)-o.TEXTURE0;if(t>=0&&t<this._textureUnits.length)return this._activeTextureUnit=t,super.activeTexture(e);this.setError(o.INVALID_ENUM)}attachShader(e,t){if(!x(e)||!x(t))throw new TypeError("attachShader(WebGLProgram, WebGLShader)");if(e&&t){if(e instanceof F&&t instanceof U&&this._checkOwns(e)&&this._checkOwns(t)&&!e._linked(t)){this._saveError(),super.attachShader(0|e._,0|t._);const r=this.getError();return this._restoreError(r),void(r===o.NO_ERROR&&e._link(t))}this.setError(o.INVALID_OPERATION)}else this.setError(o.INVALID_VALUE)}bindAttribLocation(e,t,r){if(!x(e)||"string"!=typeof r)throw new TypeError("bindAttribLocation(WebGLProgram, GLint, String)");if(!T(r+="")||r.length>W)this.setError(o.INVALID_VALUE);else if(/^_?webgl_a/.test(r))this.setError(o.INVALID_OPERATION);else if(this._checkWrapper(e,F))return super.bindAttribLocation(0|e._,0|t,r)}bindFramebuffer(e,t){if(!x(t))throw new TypeError("bindFramebuffer(GLenum, WebGLFramebuffer)");if(e!==o.FRAMEBUFFER)return void this.setError(o.INVALID_ENUM);if(t){if(t._pendingDelete)return;if(!this._checkWrapper(t,B))return;super.bindFramebuffer(o.FRAMEBUFFER,0|t._)}else super.bindFramebuffer(o.FRAMEBUFFER,this._drawingBuffer._framebuffer);const r=this._activeFramebuffer;r!==t&&(r&&(r._refCount-=1,r._checkDelete()),t&&(t._refCount+=1)),this._activeFramebuffer=t,t&&this._updateFramebufferAttachments(t)}bindBuffer(e,t){if(e|=0,!x(t))throw new TypeError("bindBuffer(GLenum, WebGLBuffer)");if(e===o.ARRAY_BUFFER||e===o.ELEMENT_ARRAY_BUFFER){if(t){if(t._pendingDelete)return;if(!this._checkWrapper(t,N))return;if(t._binding&&t._binding!==e)return void this.setError(o.INVALID_OPERATION);t._binding=0|e,super.bindBuffer(e,0|t._)}else t=null,super.bindBuffer(e,0);e===o.ARRAY_BUFFER?this._vertexGlobalState.setArrayBuffer(t):this._vertexObjectState.setElementArrayBuffer(t)}else this.setError(o.INVALID_ENUM)}bindRenderbuffer(e,t){if(!x(t))throw new TypeError("bindRenderbuffer(GLenum, WebGLRenderbuffer)");if(e!==o.RENDERBUFFER)return void this.setError(o.INVALID_ENUM);if(t){if(t._pendingDelete)return;if(!this._checkWrapper(t,j))return;super.bindRenderbuffer(0|e,0|t._)}else super.bindRenderbuffer(0|e,0);const r=this._activeRenderbuffer;r!==t&&(r&&(r._refCount-=1,r._checkDelete()),t&&(t._refCount+=1)),this._activeRenderbuffer=t}bindTexture(e,t){if(e|=0,!x(t))throw new TypeError("bindTexture(GLenum, WebGLTexture)");if(!this._validTextureTarget(e))return void this.setError(o.INVALID_ENUM);let r=0;if(t){if(t instanceof V&&t._pendingDelete)return;if(!this._checkWrapper(t,V))return;if(t._binding&&t._binding!==e)return void this.setError(o.INVALID_OPERATION);t._binding=e,t._complete&&(r=0|t._)}else t=null;this._saveError(),super.bindTexture(e,r);const n=this.getError();if(this._restoreError(n),n!==o.NO_ERROR)return;const i=this._getActiveTextureUnit(),s=this._getActiveTexture(e);s!==t&&(s&&(s._refCount-=1,s._checkDelete()),t&&(t._refCount+=1)),e===o.TEXTURE_2D?i._bind2D=t:e===o.TEXTURE_CUBE_MAP&&(i._bindCube=t)}blendColor(e,t,r,n){return super.blendColor(+e,+t,+r,+n)}blendEquation(e){if(e|=0,this._validBlendMode(e))return super.blendEquation(e);this.setError(o.INVALID_ENUM)}blendEquationSeparate(e,t){if(e|=0,t|=0,this._validBlendMode(e)&&this._validBlendMode(t))return super.blendEquationSeparate(e,t);this.setError(o.INVALID_ENUM)}createBuffer(){const e=super.createBuffer();if(e<=0)return null;const t=new N(e,this);return this._buffers[e]=t,t}createFramebuffer(){const e=super.createFramebuffer();if(e<=0)return null;const t=new B(e,this);return this._framebuffers[e]=t,t}createProgram(){const e=super.createProgram();if(e<=0)return null;const t=new F(e,this);return this._programs[e]=t,t}createRenderbuffer(){const e=super.createRenderbuffer();if(e<=0)return null;const t=new j(e,this);return this._renderbuffers[e]=t,t}createTexture(){const e=super.createTexture();if(e<=0)return null;const t=new V(e,this);return this._textures[e]=t,t}getContextAttributes(){return this._contextAttributes}getExtension(e){const t=e.toLowerCase();if(t in this._extensions)return this._extensions[t];const r=q[t]?q[t](this):null;return r&&(this._extensions[t]=r),r}getSupportedExtensions(){const e=["ANGLE_instanced_arrays","STACKGL_resize_drawingbuffer","STACKGL_destroy_context"],t=super.getSupportedExtensions();return t.indexOf("GL_OES_element_index_uint")>=0&&e.push("OES_element_index_uint"),t.indexOf("GL_OES_standard_derivatives")>=0&&e.push("OES_standard_derivatives"),t.indexOf("GL_OES_texture_float")>=0&&e.push("OES_texture_float"),t.indexOf("GL_OES_texture_float_linear")>=0&&e.push("OES_texture_float_linear"),t.indexOf("EXT_draw_buffers")>=0&&e.push("WEBGL_draw_buffers"),t.indexOf("EXT_blend_minmax")>=0&&e.push("EXT_blend_minmax"),t.indexOf("EXT_texture_filter_anisotropic")>=0&&e.push("EXT_texture_filter_anisotropic"),t.indexOf("GL_OES_vertex_array_object")>=0&&e.push("OES_vertex_array_object"),e}setError(e){u.setError.call(this,0|e)}blendFunc(e,t){e|=0,t|=0,this._validBlendFunc(e)&&this._validBlendFunc(t)?this._isConstantBlendFunc(e)&&this._isConstantBlendFunc(t)?this.setError(o.INVALID_OPERATION):super.blendFunc(e,t):this.setError(o.INVALID_ENUM)}blendFuncSeparate(e,t,r,n){e|=0,t|=0,r|=0,n|=0,this._validBlendFunc(e)&&this._validBlendFunc(t)&&this._validBlendFunc(r)&&this._validBlendFunc(n)?this._isConstantBlendFunc(e)&&this._isConstantBlendFunc(t)||this._isConstantBlendFunc(r)&&this._isConstantBlendFunc(n)?this.setError(o.INVALID_OPERATION):super.blendFuncSeparate(e,t,r,n):this.setError(o.INVALID_ENUM)}bufferData(e,t,r){if(e|=0,(r|=0)!==o.STREAM_DRAW&&r!==o.STATIC_DRAW&&r!==o.DYNAMIC_DRAW)return void this.setError(o.INVALID_ENUM);if(e!==o.ARRAY_BUFFER&&e!==o.ELEMENT_ARRAY_BUFFER)return void this.setError(o.INVALID_ENUM);const n=this._getActiveBuffer(e);if(n)if("object"==typeof t){let i=null;if(I(t))i=R(t);else{if(!(t instanceof ArrayBuffer))return void this.setError(o.INVALID_VALUE);i=new Uint8Array(t)}this._saveError(),super.bufferData(e,i,r);const s=this.getError();if(this._restoreError(s),s!==o.NO_ERROR)return;n._size=i.length,e===o.ELEMENT_ARRAY_BUFFER&&(n._elements=new Uint8Array(i))}else if("number"==typeof t){const i=0|t;if(i<0)return void this.setError(o.INVALID_VALUE);this._saveError(),super.bufferData(e,i,r);const s=this.getError();if(this._restoreError(s),s!==o.NO_ERROR)return;n._size=i,e===o.ELEMENT_ARRAY_BUFFER&&(n._elements=new Uint8Array(i))}else this.setError(o.INVALID_VALUE);else this.setError(o.INVALID_OPERATION)}bufferSubData(e,t,r){if(t|=0,(e|=0)!==o.ARRAY_BUFFER&&e!==o.ELEMENT_ARRAY_BUFFER)return void this.setError(o.INVALID_ENUM);if(null===r)return;if(!r||"object"!=typeof r)return void this.setError(o.INVALID_VALUE);const n=this._getActiveBuffer(e);if(!n)return void this.setError(o.INVALID_OPERATION);if(t<0||t>=n._size)return void this.setError(o.INVALID_VALUE);let i=null;if(I(r))i=R(r);else{if(!(r instanceof ArrayBuffer))return void this.setError(o.INVALID_VALUE);i=new Uint8Array(r)}t+i.length>n._size?this.setError(o.INVALID_VALUE):(e===o.ELEMENT_ARRAY_BUFFER&&n._elements.set(i,t),super.bufferSubData(e,t,i))}checkFramebufferStatus(e){if(e!==o.FRAMEBUFFER)return this.setError(o.INVALID_ENUM),0;const t=this._activeFramebuffer;return t?this._preCheckFramebufferStatus(t):o.FRAMEBUFFER_COMPLETE}clear(e){if(this._framebufferOk())return super.clear(0|e)}clearColor(e,t,r,n){return super.clearColor(+e,+t,+r,+n)}clearDepth(e){return super.clearDepth(+e)}clearStencil(e){return this._checkStencil=!1,super.clearStencil(0|e)}colorMask(e,t,r,n){return super.colorMask(!!e,!!t,!!r,!!n)}compileShader(e){if(!x(e))throw new TypeError("compileShader(WebGLShader)");if(this._checkWrapper(e,U)&&this._checkShaderSource(e)){const t=this.getError();super.compileShader(0|e._);const r=this.getError();e._compileStatus=!!super.getShaderParameter(0|e._,o.COMPILE_STATUS),e._compileInfo=super.getShaderInfoLog(0|e._),this.getError(),this.setError(t||r)}}copyTexImage2D(e,t,r,i,s,a,u,l){e|=0,t|=0,r|=0,i|=0,s|=0,a|=0,u|=0,l|=0;const c=this._getTexImage(e);if(!c)return void this.setError(o.INVALID_OPERATION);if(r!==o.RGBA&&r!==o.RGB&&r!==o.ALPHA&&r!==o.LUMINANCE&&r!==o.LUMINANCE_ALPHA)return void this.setError(o.INVALID_ENUM);if(t<0||a<0||u<0||0!==l)return void this.setError(o.INVALID_VALUE);if(t>0&&(!n.isPow2(a)||!n.isPow2(u)))return void this.setError(o.INVALID_VALUE);this._saveError(),super.copyTexImage2D(e,t,r,i,s,a,u,l);const h=this.getError();this._restoreError(h),h===o.NO_ERROR&&(c._levelWidth[t]=a,c._levelHeight[t]=u,c._format=o.RGBA,c._type=o.UNSIGNED_BYTE)}copyTexSubImage2D(e,t,r,n,i,s,a,u){e|=0,t|=0,r|=0,n|=0,i|=0,s|=0,a|=0,u|=0,this._getTexImage(e)?a<0||u<0||r<0||n<0||t<0?this.setError(o.INVALID_VALUE):super.copyTexSubImage2D(e,t,r,n,i,s,a,u):this.setError(o.INVALID_OPERATION)}cullFace(e){return super.cullFace(0|e)}createShader(e){if((e|=0)!==o.FRAGMENT_SHADER&&e!==o.VERTEX_SHADER)return this.setError(o.INVALID_ENUM),null;const t=super.createShader(e);if(t<0)return null;const r=new U(t,this,e);return this._shaders[t]=r,r}deleteProgram(e){return this._deleteLinkable("deleteProgram",e,F)}deleteShader(e){return this._deleteLinkable("deleteShader",e,U)}_deleteLinkable(e,t,r){if(!x(t))throw new TypeError(e+"("+r.name+")");if(t instanceof r&&this._checkOwns(t))return t._pendingDelete=!0,void t._checkDelete();this.setError(o.INVALID_OPERATION)}deleteBuffer(e){if(!x(e)||null!==e&&!(e instanceof N))throw new TypeError("deleteBuffer(WebGLBuffer)");e instanceof N&&this._checkOwns(e)?(this._vertexGlobalState._arrayBufferBinding===e&&this.bindBuffer(o.ARRAY_BUFFER,null),this._vertexObjectState._elementArrayBufferBinding===e&&this.bindBuffer(o.ELEMENT_ARRAY_BUFFER,null),this._vertexObjectState===this._defaultVertexObjectState&&this._vertexObjectState.releaseArrayBuffer(e),e._pendingDelete=!0,e._checkDelete()):this.setError(o.INVALID_OPERATION)}deleteFramebuffer(e){if(!x(e))throw new TypeError("deleteFramebuffer(WebGLFramebuffer)");e instanceof B&&this._checkOwns(e)?(this._activeFramebuffer===e&&this.bindFramebuffer(o.FRAMEBUFFER,null),e._pendingDelete=!0,e._checkDelete()):this.setError(o.INVALID_OPERATION)}deleteRenderbuffer(e){if(!x(e))throw new TypeError("deleteRenderbuffer(WebGLRenderbuffer)");if(!(e instanceof j&&this._checkOwns(e)))return void this.setError(o.INVALID_OPERATION);this._activeRenderbuffer===e&&this.bindRenderbuffer(o.RENDERBUFFER,null);const t=this._activeFramebuffer;this._tryDetachFramebuffer(t,e),e._pendingDelete=!0,e._checkDelete()}deleteTexture(e){if(!x(e))throw new TypeError("deleteTexture(WebGLTexture)");if(!(e instanceof V))return;if(!this._checkOwns(e))return void this.setError(o.INVALID_OPERATION);const t=this._activeTextureUnit;for(let t=0;t<this._textureUnits.length;++t){const r=this._textureUnits[t];r._bind2D===e?(this.activeTexture(o.TEXTURE0+t),this.bindTexture(o.TEXTURE_2D,null)):r._bindCube===e&&(this.activeTexture(o.TEXTURE0+t),this.bindTexture(o.TEXTURE_CUBE_MAP,null))}this.activeTexture(o.TEXTURE0+t);const r=this;!function(t){if(t&&t._linked(e)){const n=r._getAttachments();for(let i=0;i<n.length;++i){const s=n[i];t._attachments[s]===e&&r.framebufferTexture2D(o.FRAMEBUFFER,s,o.TEXTURE_2D,null)}}}(this._activeFramebuffer),e._pendingDelete=!0,e._checkDelete()}depthFunc(e){switch(e|=0){case o.NEVER:case o.LESS:case o.EQUAL:case o.LEQUAL:case o.GREATER:case o.NOTEQUAL:case o.GEQUAL:case o.ALWAYS:return super.depthFunc(e);default:this.setError(o.INVALID_ENUM)}}depthMask(e){return super.depthMask(!!e)}depthRange(e,t){if((e=+e)<=(t=+t))return super.depthRange(e,t);this.setError(o.INVALID_OPERATION)}destroy(){super.destroy()}detachShader(e,t){if(!x(e)||!x(t))throw new TypeError("detachShader(WebGLProgram, WebGLShader)");this._checkWrapper(e,F)&&this._checkWrapper(t,U)&&(e._linked(t)?(super.detachShader(e._,t._),e._unlink(t)):this.setError(o.INVALID_OPERATION))}disable(e){if(e|=0,super.disable(e),e===o.TEXTURE_2D||e===o.TEXTURE_CUBE_MAP){const t=this._getActiveTextureUnit();t._mode===e&&(t._mode=0)}}disableVertexAttribArray(e){(e|=0)<0||e>=this._vertexObjectState._attribs.length?this.setError(o.INVALID_VALUE):(super.disableVertexAttribArray(e),this._vertexObjectState._attribs[e]._isPointer=!1)}drawArrays(e,t,r){if(e|=0,r|=0,(t|=0)<0||r<0)return void this.setError(o.INVALID_VALUE);if(!this._checkStencilState())return;const n=C(e,r);if(n<0)return void this.setError(o.INVALID_ENUM);if(!this._framebufferOk())return;if(0===r)return;let i=t;if(r>0&&(i=r+t-1>>>0),this._checkVertexAttribState(i)){if(this._vertexObjectState._attribs[0]._isPointer||this._extensions.webgl_draw_buffers&&this._extensions.webgl_draw_buffers._buffersState&&this._extensions.webgl_draw_buffers._buffersState.length>0)return super.drawArrays(e,t,n);this._beginAttrib0Hack(),super._drawArraysInstanced(e,t,n,1),this._endAttrib0Hack()}}drawElements(e,t,r,n){if(e|=0,r|=0,n|=0,(t|=0)<0||n<0)return void this.setError(o.INVALID_VALUE);if(!this._checkStencilState())return;const i=this._vertexObjectState._elementArrayBufferBinding;if(!i)return void this.setError(o.INVALID_OPERATION);let s=null,a=n;if(r===o.UNSIGNED_SHORT){if(a%2)return void this.setError(o.INVALID_OPERATION);a>>=1,s=new Uint16Array(i._elements.buffer)}else if(this._extensions.oes_element_index_uint&&r===o.UNSIGNED_INT){if(a%4)return void this.setError(o.INVALID_OPERATION);a>>=2,s=new Uint32Array(i._elements.buffer)}else{if(r!==o.UNSIGNED_BYTE)return void this.setError(o.INVALID_ENUM);s=i._elements}let u=t;switch(e){case o.TRIANGLES:t%3&&(u-=t%3);break;case o.LINES:t%2&&(u-=t%2);break;case o.POINTS:break;case o.LINE_LOOP:case o.LINE_STRIP:if(t<2)return void this.setError(o.INVALID_OPERATION);break;case o.TRIANGLE_FAN:case o.TRIANGLE_STRIP:if(t<3)return void this.setError(o.INVALID_OPERATION);break;default:return void this.setError(o.INVALID_ENUM)}if(!this._framebufferOk())return;if(0===t)return void this._checkVertexAttribState(0);if(t+a>>>0>s.length)return void this.setError(o.INVALID_OPERATION);let l=-1;for(let e=a;e<a+t;++e)l=Math.max(l,s[e]);if(l<0)this._checkVertexAttribState(0);else if(this._checkVertexAttribState(l)&&u>0){if(this._vertexObjectState._attribs[0]._isPointer)return super.drawElements(e,u,r,n);this._beginAttrib0Hack(),super._drawElementsInstanced(e,u,r,n,1),this._endAttrib0Hack()}}enable(e){e|=0,super.enable(e)}enableVertexAttribArray(e){(e|=0)<0||e>=this._vertexObjectState._attribs.length?this.setError(o.INVALID_VALUE):(super.enableVertexAttribArray(e),this._vertexObjectState._attribs[e]._isPointer=!0)}finish(){return super.finish()}flush(){return super.flush()}framebufferRenderbuffer(e,t,r,n){if(e|=0,t|=0,r|=0,!x(n))throw new TypeError("framebufferRenderbuffer(GLenum, GLenum, GLenum, WebGLRenderbuffer)");if(e!==o.FRAMEBUFFER||!this._validFramebufferAttachment(t)||r!==o.RENDERBUFFER)return void this.setError(o.INVALID_ENUM);const i=this._activeFramebuffer;i?n&&!this._checkWrapper(n,j)||(i._setAttachment(n,t),this._updateFramebufferAttachments(i)):this.setError(o.INVALID_OPERATION)}framebufferTexture2D(e,t,r,n,i){if(e|=0,t|=0,r|=0,i|=0,!x(n))throw new TypeError("framebufferTexture2D(GLenum, GLenum, GLenum, WebGLTexture, GLint)");if(e!==o.FRAMEBUFFER||!this._validFramebufferAttachment(t))return void this.setError(o.INVALID_ENUM);if(0!==i)return void this.setError(o.INVALID_VALUE);if(n&&!this._checkWrapper(n,V))return;if(r===o.TEXTURE_2D){if(n&&n._binding!==o.TEXTURE_2D)return void this.setError(o.INVALID_OPERATION)}else{if(!this._validCubeTarget(r))return void this.setError(o.INVALID_ENUM);if(n&&n._binding!==o.TEXTURE_CUBE_MAP)return void this.setError(o.INVALID_OPERATION)}const s=this._activeFramebuffer;s?(s._attachmentLevel[t]=i,s._attachmentFace[t]=r,s._setAttachment(n,t),this._updateFramebufferAttachments(s)):this.setError(o.INVALID_OPERATION)}frontFace(e){return super.frontFace(0|e)}generateMipmap(e){return 0|super.generateMipmap(0|e)}getActiveAttrib(e,t){if(!x(e))throw new TypeError("getActiveAttrib(WebGLProgram)");if(e){if(this._checkWrapper(e,F)){const r=super.getActiveAttrib(0|e._,0|t);if(r)return new P(r)}}else this.setError(o.INVALID_VALUE);return null}getActiveUniform(e,t){if(!x(e))throw new TypeError("getActiveUniform(WebGLProgram, GLint)");if(e){if(this._checkWrapper(e,F)){const r=super.getActiveUniform(0|e._,0|t);if(r)return new P(r)}}else this.setError(o.INVALID_VALUE);return null}getAttachedShaders(e){if(!x(e)||"object"==typeof e&&null!==e&&!(e instanceof F))throw new TypeError("getAttachedShaders(WebGLProgram)");if(e){if(this._checkWrapper(e,F)){const t=super.getAttachedShaders(0|e._);if(!t)return null;const r=new Array(t.length);for(let e=0;e<t.length;++e)r[e]=this._shaders[t[e]];return r}}else this.setError(o.INVALID_VALUE);return null}getAttribLocation(e,t){if(!x(e))throw new TypeError("getAttribLocation(WebGLProgram, String)");if(!T(t+="")||t.length>W)this.setError(o.INVALID_VALUE);else if(this._checkWrapper(e,F))return super.getAttribLocation(0|e._,t+"");return-1}getParameter(e){switch(e|=0){case o.ARRAY_BUFFER_BINDING:return this._vertexGlobalState._arrayBufferBinding;case o.ELEMENT_ARRAY_BUFFER_BINDING:return this._vertexObjectState._elementArrayBufferBinding;case o.CURRENT_PROGRAM:return this._activeProgram;case o.FRAMEBUFFER_BINDING:return this._activeFramebuffer;case o.RENDERBUFFER_BINDING:return this._activeRenderbuffer;case o.TEXTURE_BINDING_2D:return this._getActiveTextureUnit()._bind2D;case o.TEXTURE_BINDING_CUBE_MAP:return this._getActiveTextureUnit()._bindCube;case o.VERSION:return"WebGL 1.0 stack-gl "+s;case o.VENDOR:return"stack-gl";case o.RENDERER:return"ANGLE";case o.SHADING_LANGUAGE_VERSION:return"WebGL GLSL ES 1.0 stack-gl";case o.COMPRESSED_TEXTURE_FORMATS:return new Uint32Array(0);case o.MAX_VIEWPORT_DIMS:case o.SCISSOR_BOX:case o.VIEWPORT:return new Int32Array(super.getParameter(e));case o.ALIASED_LINE_WIDTH_RANGE:case o.ALIASED_POINT_SIZE_RANGE:case o.DEPTH_RANGE:case o.BLEND_COLOR:case o.COLOR_CLEAR_VALUE:return new Float32Array(super.getParameter(e));case o.COLOR_WRITEMASK:return super.getParameter(e);case o.DEPTH_CLEAR_VALUE:case o.LINE_WIDTH:case o.POLYGON_OFFSET_FACTOR:case o.POLYGON_OFFSET_UNITS:case o.SAMPLE_COVERAGE_VALUE:return+super.getParameter(e);case o.BLEND:case o.CULL_FACE:case o.DEPTH_TEST:case o.DEPTH_WRITEMASK:case o.DITHER:case o.POLYGON_OFFSET_FILL:case o.SAMPLE_COVERAGE_INVERT:case o.SCISSOR_TEST:case o.STENCIL_TEST:case o.UNPACK_FLIP_Y_WEBGL:case o.UNPACK_PREMULTIPLY_ALPHA_WEBGL:return!!super.getParameter(e);case o.ACTIVE_TEXTURE:case o.ALPHA_BITS:case o.BLEND_DST_ALPHA:case o.BLEND_DST_RGB:case o.BLEND_EQUATION_ALPHA:case o.BLEND_EQUATION_RGB:case o.BLEND_SRC_ALPHA:case o.BLEND_SRC_RGB:case o.BLUE_BITS:case o.CULL_FACE_MODE:case o.DEPTH_BITS:case o.DEPTH_FUNC:case o.FRONT_FACE:case o.GENERATE_MIPMAP_HINT:case o.GREEN_BITS:case o.MAX_COMBINED_TEXTURE_IMAGE_UNITS:case o.MAX_CUBE_MAP_TEXTURE_SIZE:case o.MAX_FRAGMENT_UNIFORM_VECTORS:case o.MAX_RENDERBUFFER_SIZE:case o.MAX_TEXTURE_IMAGE_UNITS:case o.MAX_TEXTURE_SIZE:case o.MAX_VARYING_VECTORS:case o.MAX_VERTEX_ATTRIBS:case o.MAX_VERTEX_TEXTURE_IMAGE_UNITS:case o.MAX_VERTEX_UNIFORM_VECTORS:case o.PACK_ALIGNMENT:case o.RED_BITS:case o.SAMPLE_BUFFERS:case o.SAMPLES:case o.STENCIL_BACK_FAIL:case o.STENCIL_BACK_FUNC:case o.STENCIL_BACK_PASS_DEPTH_FAIL:case o.STENCIL_BACK_PASS_DEPTH_PASS:case o.STENCIL_BACK_REF:case o.STENCIL_BACK_VALUE_MASK:case o.STENCIL_BACK_WRITEMASK:case o.STENCIL_BITS:case o.STENCIL_CLEAR_VALUE:case o.STENCIL_FAIL:case o.STENCIL_FUNC:case o.STENCIL_PASS_DEPTH_FAIL:case o.STENCIL_PASS_DEPTH_PASS:case o.STENCIL_REF:case o.STENCIL_VALUE_MASK:case o.STENCIL_WRITEMASK:case o.SUBPIXEL_BITS:case o.UNPACK_ALIGNMENT:case o.UNPACK_COLORSPACE_CONVERSION_WEBGL:return 0|super.getParameter(e);case o.IMPLEMENTATION_COLOR_READ_FORMAT:case o.IMPLEMENTATION_COLOR_READ_TYPE:return super.getParameter(e);default:if(this._extensions.webgl_draw_buffers){const t=this._extensions.webgl_draw_buffers;switch(e){case t.DRAW_BUFFER0_WEBGL:case t.DRAW_BUFFER1_WEBGL:case t.DRAW_BUFFER2_WEBGL:case t.DRAW_BUFFER3_WEBGL:case t.DRAW_BUFFER4_WEBGL:case t.DRAW_BUFFER5_WEBGL:case t.DRAW_BUFFER6_WEBGL:case t.DRAW_BUFFER7_WEBGL:case t.DRAW_BUFFER8_WEBGL:case t.DRAW_BUFFER9_WEBGL:case t.DRAW_BUFFER10_WEBGL:case t.DRAW_BUFFER11_WEBGL:case t.DRAW_BUFFER12_WEBGL:case t.DRAW_BUFFER13_WEBGL:case t.DRAW_BUFFER14_WEBGL:case t.DRAW_BUFFER15_WEBGL:return 1===t._buffersState.length&&t._buffersState[0]===o.BACK?o.BACK:super.getParameter(e);case t.MAX_DRAW_BUFFERS_WEBGL:case t.MAX_COLOR_ATTACHMENTS_WEBGL:return super.getParameter(e)}}return this._extensions.oes_standard_derivatives&&e===this._extensions.oes_standard_derivatives.FRAGMENT_SHADER_DERIVATIVE_HINT_OES?super.getParameter(e):this._extensions.ext_texture_filter_anisotropic&&e===this._extensions.ext_texture_filter_anisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT?super.getParameter(e):this._extensions.oes_vertex_array_object&&e===this._extensions.oes_vertex_array_object.VERTEX_ARRAY_BINDING_OES?this._extensions.oes_vertex_array_object._activeVertexArrayObject:(this.setError(o.INVALID_ENUM),null)}}getShaderPrecisionFormat(e,t){if(t|=0,(e|=0)!==o.FRAGMENT_SHADER&&e!==o.VERTEX_SHADER||t!==o.LOW_FLOAT&&t!==o.MEDIUM_FLOAT&&t!==o.HIGH_FLOAT&&t!==o.LOW_INT&&t!==o.MEDIUM_INT&&t!==o.HIGH_INT)return void this.setError(o.INVALID_ENUM);const r=super.getShaderPrecisionFormat(e,t);return r?new $(r):null}getBufferParameter(e,t){if(t|=0,(e|=0)!==o.ARRAY_BUFFER&&e!==o.ELEMENT_ARRAY_BUFFER)return this.setError(o.INVALID_ENUM),null;switch(t){case o.BUFFER_SIZE:case o.BUFFER_USAGE:return super.getBufferParameter(0|e,0|t);default:return this.setError(o.INVALID_ENUM),null}}getError(){return super.getError()}getFramebufferAttachmentParameter(e,t,r){if(t|=0,r|=0,(e|=0)!==o.FRAMEBUFFER||!this._validFramebufferAttachment(t))return this.setError(o.INVALID_ENUM),null;const n=this._activeFramebuffer;if(!n)return this.setError(o.INVALID_OPERATION),null;const i=n._attachments[t];if(null===i){if(r===o.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)return o.NONE}else if(i instanceof V)switch(r){case o.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return i;case o.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:return o.TEXTURE;case o.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:return n._attachmentLevel[t];case o.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:{const e=n._attachmentFace[t];return e===o.TEXTURE_2D?0:e}}else if(i instanceof j)switch(r){case o.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:return i;case o.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:return o.RENDERBUFFER}return this.setError(o.INVALID_ENUM),null}getProgramParameter(e,t){if(t|=0,!x(e))throw new TypeError("getProgramParameter(WebGLProgram, GLenum)");if(this._checkWrapper(e,F)){switch(t){case o.DELETE_STATUS:return e._pendingDelete;case o.LINK_STATUS:return e._linkStatus;case o.VALIDATE_STATUS:return!!super.getProgramParameter(e._,t);case o.ATTACHED_SHADERS:case o.ACTIVE_ATTRIBUTES:case o.ACTIVE_UNIFORMS:return super.getProgramParameter(e._,t)}this.setError(o.INVALID_ENUM)}return null}getProgramInfoLog(e){if(!x(e))throw new TypeError("getProgramInfoLog(WebGLProgram)");return this._checkWrapper(e,F)?e._linkInfoLog:null}getRenderbufferParameter(e,t){if(t|=0,(e|=0)!==o.RENDERBUFFER)return this.setError(o.INVALID_ENUM),null;const r=this._activeRenderbuffer;if(!r)return this.setError(o.INVALID_OPERATION),null;switch(t){case o.RENDERBUFFER_INTERNAL_FORMAT:return r._format;case o.RENDERBUFFER_WIDTH:return r._width;case o.RENDERBUFFER_HEIGHT:return r._height;case o.RENDERBUFFER_SIZE:case o.RENDERBUFFER_RED_SIZE:case o.RENDERBUFFER_GREEN_SIZE:case o.RENDERBUFFER_BLUE_SIZE:case o.RENDERBUFFER_ALPHA_SIZE:case o.RENDERBUFFER_DEPTH_SIZE:case o.RENDERBUFFER_STENCIL_SIZE:return super.getRenderbufferParameter(e,t)}return this.setError(o.INVALID_ENUM),null}getShaderParameter(e,t){if(t|=0,!x(e))throw new TypeError("getShaderParameter(WebGLShader, GLenum)");if(this._checkWrapper(e,U)){switch(t){case o.DELETE_STATUS:return e._pendingDelete;case o.COMPILE_STATUS:return e._compileStatus;case o.SHADER_TYPE:return e._type}this.setError(o.INVALID_ENUM)}return null}getShaderInfoLog(e){if(!x(e))throw new TypeError("getShaderInfoLog(WebGLShader)");return this._checkWrapper(e,U)?e._compileInfo:null}getShaderSource(e){if(!x(e))throw new TypeError("Input to getShaderSource must be an object");return this._checkWrapper(e,U)?e._source:null}getTexParameter(e,t){if(e|=0,t|=0,!this._checkTextureTarget(e))return null;const r=this._getActiveTextureUnit();if(e===o.TEXTURE_2D&&!r._bind2D||e===o.TEXTURE_CUBE_MAP&&!r._bindCube)return this.setError(o.INVALID_OPERATION),null;switch(t){case o.TEXTURE_MAG_FILTER:case o.TEXTURE_MIN_FILTER:case o.TEXTURE_WRAP_S:case o.TEXTURE_WRAP_T:return super.getTexParameter(e,t)}return this._extensions.ext_texture_filter_anisotropic&&t===this._extensions.ext_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT?super.getTexParameter(e,t):(this.setError(o.INVALID_ENUM),null)}getUniform(e,t){if(!x(e)||!x(t))throw new TypeError("getUniform(WebGLProgram, WebGLUniformLocation)");if(!e)return this.setError(o.INVALID_VALUE),null;if(!t)return null;if(this._checkWrapper(e,F)){if(!w(e,t))return this.setError(o.INVALID_OPERATION),null;const r=super.getUniform(0|e._,0|t._);if(!r)return null;switch(t._activeInfo.type){case o.FLOAT:return r[0];case o.FLOAT_VEC2:return new Float32Array(r.slice(0,2));case o.FLOAT_VEC3:return new Float32Array(r.slice(0,3));case o.FLOAT_VEC4:return new Float32Array(r.slice(0,4));case o.INT:return 0|r[0];case o.INT_VEC2:return new Int32Array(r.slice(0,2));case o.INT_VEC3:return new Int32Array(r.slice(0,3));case o.INT_VEC4:return new Int32Array(r.slice(0,4));case o.BOOL:return!!r[0];case o.BOOL_VEC2:return[!!r[0],!!r[1]];case o.BOOL_VEC3:return[!!r[0],!!r[1],!!r[2]];case o.BOOL_VEC4:return[!!r[0],!!r[1],!!r[2],!!r[3]];case o.FLOAT_MAT2:return new Float32Array(r.slice(0,4));case o.FLOAT_MAT3:return new Float32Array(r.slice(0,9));case o.FLOAT_MAT4:return new Float32Array(r.slice(0,16));case o.SAMPLER_2D:case o.SAMPLER_CUBE:return 0|r[0];default:return null}}return null}getUniformLocation(e,t){if(!x(e))throw new TypeError("getUniformLocation(WebGLProgram, String)");if(T(t+="")){if(this._checkWrapper(e,F)){const r=super.getUniformLocation(0|e._,t);if(r>=0){let n=t;/\[\d+\]$/.test(t)&&(n=t.replace(/\[\d+\]$/,"[0]"));let i=null;for(let t=0;t<e._uniforms.length;++t){const r=e._uniforms[t];r.name===n&&(i={size:r.size,type:r.type,name:r.name})}if(!i)return null;const s=new G(r,e,i);if(/\[0\]$/.test(t)){const r=t.replace(/\[0\]$/,""),n=[];this._saveError();for(let t=0;this.getError()===o.NO_ERROR;++t){const i=super.getUniformLocation(0|e._,r+"["+t+"]");if(this.getError()!==o.NO_ERROR||i<0)break;n.push(i)}this._restoreError(o.NO_ERROR),s._array=n}else if(/\[(\d+)\]$/.test(t)){const e=+/\[(\d+)\]$/.exec(t)[1];if(e<0||e>=i.size)return null}return s}}return null}this.setError(o.INVALID_VALUE)}getVertexAttrib(e,t){if(t|=0,(e|=0)<0||e>=this._vertexObjectState._attribs.length)return this.setError(o.INVALID_VALUE),null;const r=this._vertexObjectState._attribs[e],n=this._vertexGlobalState._attribs[e]._data,i=this._extensions.angle_instanced_arrays;if(i&&t===i.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE)return r._divisor;switch(t){case o.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:return r._pointerBuffer;case o.VERTEX_ATTRIB_ARRAY_ENABLED:return r._isPointer;case o.VERTEX_ATTRIB_ARRAY_SIZE:return r._inputSize;case o.VERTEX_ATTRIB_ARRAY_STRIDE:return r._inputStride;case o.VERTEX_ATTRIB_ARRAY_TYPE:return r._pointerType;case o.VERTEX_ATTRIB_ARRAY_NORMALIZED:return r._pointerNormal;case o.CURRENT_VERTEX_ATTRIB:return new Float32Array(n);default:return this.setError(o.INVALID_ENUM),null}}getVertexAttribOffset(e,t){return t|=0,(e|=0)<0||e>=this._vertexObjectState._attribs.length?(this.setError(o.INVALID_VALUE),null):t===o.VERTEX_ATTRIB_ARRAY_POINTER?this._vertexObjectState._attribs[e]._pointerOffset:(this.setError(o.INVALID_ENUM),null)}hint(e,t){if(t|=0,(e|=0)===o.GENERATE_MIPMAP_HINT||this._extensions.oes_standard_derivatives&&e===this._extensions.oes_standard_derivatives.FRAGMENT_SHADER_DERIVATIVE_HINT_OES){if(t===o.FASTEST||t===o.NICEST||t===o.DONT_CARE)return super.hint(e,t);this.setError(o.INVALID_ENUM)}else this.setError(o.INVALID_ENUM)}isBuffer(e){return!!this._isObject(e,"isBuffer",N)&&super.isBuffer(0|e._)}isFramebuffer(e){return!!this._isObject(e,"isFramebuffer",B)&&super.isFramebuffer(0|e._)}isProgram(e){return!!this._isObject(e,"isProgram",F)&&super.isProgram(0|e._)}isRenderbuffer(e){return!!this._isObject(e,"isRenderbuffer",j)&&super.isRenderbuffer(0|e._)}isShader(e){return!!this._isObject(e,"isShader",U)&&super.isShader(0|e._)}isTexture(e){return!!this._isObject(e,"isTexture",V)&&super.isTexture(0|e._)}isEnabled(e){return super.isEnabled(0|e)}lineWidth(e){if(!isNaN(e))return super.lineWidth(+e);this.setError(o.INVALID_VALUE)}linkProgram(e){if(!x(e))throw new TypeError("linkProgram(WebGLProgram)");if(this._checkWrapper(e,F)){e._linkCount+=1,e._attributes=[];const t=this.getError();super.linkProgram(0|e._);const r=this.getError();r===o.NO_ERROR&&(e._linkStatus=this._fixupLink(e)),this.getError(),this.setError(t||r)}}pixelStorei(e,t){if(t|=0,(e|=0)===o.UNPACK_ALIGNMENT){if(1!==t&&2!==t&&4!==t&&8!==t)return void this.setError(o.INVALID_VALUE);this._unpackAlignment=t}else if(e===o.PACK_ALIGNMENT){if(1!==t&&2!==t&&4!==t&&8!==t)return void this.setError(o.INVALID_VALUE);this._packAlignment=t}else if(e===o.UNPACK_COLORSPACE_CONVERSION_WEBGL&&t!==o.NONE&&t!==o.BROWSER_DEFAULT_WEBGL)return void this.setError(o.INVALID_VALUE);return super.pixelStorei(e,t)}polygonOffset(e,t){return super.polygonOffset(+e,+t)}readPixels(e,t,r,n,i,s,a){if(e|=0,t|=0,r|=0,n|=0,this._extensions.oes_texture_float&&s===o.FLOAT&&i===o.RGBA);else{if(i===o.RGB||i===o.ALPHA||s!==o.UNSIGNED_BYTE)return void this.setError(o.INVALID_OPERATION);if(i!==o.RGBA)return void this.setError(o.INVALID_ENUM);if(r<0||n<0||!(a instanceof Uint8Array))return void this.setError(o.INVALID_VALUE)}if(!this._framebufferOk())return;let u=4*r;u%this._packAlignment!=0&&(u+=this._packAlignment-u%this._packAlignment);const l=u*(n-1)+4*r;if(l<=0)return;if(a.length<l)return void this.setError(o.INVALID_VALUE);let c=this.drawingBufferWidth,h=this.drawingBufferHeight;this._activeFramebuffer&&(c=this._activeFramebuffer._width,h=this._activeFramebuffer._height);const p=R(a);if(e>=c||e+r<=0||t>=h||t+n<=0)for(let e=0;e<p.length;++e)p[e]=0;else if(e<0||e+r>c||t<0||t+n>h){for(let e=0;e<p.length;++e)p[e]=0;let o=e,a=r;e<0&&(a+=e,o=0),o+r>c&&(a=c-o);let l=t,f=n;t<0&&(f+=t,l=0),l+n>h&&(f=h-l);let d=4*a;if(d%this._packAlignment!=0&&(d+=this._packAlignment-d%this._packAlignment),a>0&&f>0){const r=new Uint8Array(d*f);super.readPixels(o,l,a,f,i,s,r);const n=4*(o-e)+(l-t)*u;for(let e=0;e<f;++e)for(let t=0;t<a;++t)for(let i=0;i<4;++i)p[n+e*u+4*t+i]=r[e*d+4*t+i]}}else super.readPixels(e,t,r,n,i,s,p)}renderbufferStorage(e,t,r,n){if(t|=0,r|=0,n|=0,(e|=0)!==o.RENDERBUFFER)return void this.setError(o.INVALID_ENUM);const i=this._activeRenderbuffer;if(!i)return void this.setError(o.INVALID_OPERATION);if(t!==o.RGBA4&&t!==o.RGB565&&t!==o.RGB5_A1&&t!==o.DEPTH_COMPONENT16&&t!==o.STENCIL_INDEX&&t!==o.STENCIL_INDEX8&&t!==o.DEPTH_STENCIL)return void this.setError(o.INVALID_ENUM);this._saveError(),super.renderbufferStorage(e,t,r,n);const s=this.getError();if(this._restoreError(s),s!==o.NO_ERROR)return;i._width=r,i._height=n,i._format=t;const a=this._activeFramebuffer;if(a){let e=!1;const t=this._getAttachments();for(let r=0;r<t.length;++r)if(a._attachments[t[r]]===i){e=!0;break}e&&this._updateFramebufferAttachments(this._activeFramebuffer)}}resize(e,t){if(t|=0,!((e|=0)>0&&t>0))throw new Error("Invalid surface dimensions");e===this.drawingBufferWidth&&t===this.drawingBufferHeight||(this._resizeDrawingBuffer(e,t),this.drawingBufferWidth=e,this.drawingBufferHeight=t)}sampleCoverage(e,t){return super.sampleCoverage(+e,!!t)}scissor(e,t,r,n){return super.scissor(0|e,0|t,0|r,0|n)}shaderSource(e,t){if(!x(e))throw new TypeError("shaderSource(WebGLShader, String)");e&&(t||"string"==typeof t)&&T(t+="")?this._checkWrapper(e,U)&&(super.shaderSource(0|e._,this._wrapShader(e._type,t)),e._source=t):this.setError(o.INVALID_VALUE)}stencilFunc(e,t,r){return this._checkStencil=!0,super.stencilFunc(0|e,0|t,0|r)}stencilFuncSeparate(e,t,r,n){return this._checkStencil=!0,super.stencilFuncSeparate(0|e,0|t,0|r,0|n)}stencilMask(e){return this._checkStencil=!0,super.stencilMask(0|e)}stencilMaskSeparate(e,t){return this._checkStencil=!0,super.stencilMaskSeparate(0|e,0|t)}stencilOp(e,t,r){return this._checkStencil=!0,super.stencilOp(0|e,0|t,0|r)}stencilOpSeparate(e,t,r,n){return this._checkStencil=!0,super.stencilOpSeparate(0|e,0|t,0|r,0|n)}texImage2D(e,t,r,n,i,s,a,u,l){if(6===arguments.length){if(u=i,a=n,null==(l=k(l=s)))throw new TypeError("texImage2D(GLenum, GLint, GLenum, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)");n=l.width,i=l.height,l=l.data}if(e|=0,t|=0,r|=0,n|=0,i|=0,s|=0,a|=0,u|=0,"object"!=typeof l&&void 0!==l)throw new TypeError("texImage2D(GLenum, GLint, GLenum, GLint, GLint, GLint, GLenum, GLenum, Uint8Array)");if(!O(a)||!O(r))return void this.setError(o.INVALID_ENUM);if(u===o.FLOAT&&!this._extensions.oes_texture_float)return void this.setError(o.INVALID_ENUM);const c=this._getTexImage(e);if(!c||a!==r)return void this.setError(o.INVALID_OPERATION);const h=this._computePixelSize(u,a);if(0===h)return;if(!this._checkDimensions(e,n,i,t))return;const p=L(l),f=this._computeRowStride(n,h)*i;if(p&&p.length<f)return void this.setError(o.INVALID_OPERATION);if(0!==s||M(e)&&n!==i)return void this.setError(o.INVALID_VALUE);this._saveError(),super.texImage2D(e,t,r,n,i,s,a,u,p);const d=this.getError();if(this._restoreError(d),d!==o.NO_ERROR)return;c._levelWidth[t]=n,c._levelHeight[t]=i,c._format=a,c._type=u;const m=this._activeFramebuffer;if(m){let e=!1;const t=this._getAttachments();for(let r=0;r<t.length;++r)if(m._attachments[t[r]]===c){e=!0;break}e&&this._updateFramebufferAttachments(this._activeFramebuffer)}}texSubImage2D(e,t,r,n,i,s,a,u,l){if(7===arguments.length){if(l=a,u=s,a=i,null==(l=k(l)))throw new TypeError("texSubImage2D(GLenum, GLint, GLint, GLint, GLenum, GLenum, ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement)");i=l.width,s=l.height,l=l.data}if("object"!=typeof l)throw new TypeError("texSubImage2D(GLenum, GLint, GLint, GLint, GLint, GLint, GLenum, GLenum, Uint8Array)");if(e|=0,t|=0,r|=0,n|=0,i|=0,s|=0,a|=0,u|=0,!this._getTexImage(e))return void this.setError(o.INVALID_OPERATION);if(u===o.FLOAT&&!this._extensions.oes_texture_float)return void this.setError(o.INVALID_ENUM);const c=this._computePixelSize(u,a);if(0===c)return;if(!this._checkDimensions(e,i,s,t))return;if(r<0||n<0)return void this.setError(o.INVALID_VALUE);const h=L(l),p=this._computeRowStride(i,c)*s;!h||h.length<p?this.setError(o.INVALID_OPERATION):super.texSubImage2D(e,t,r,n,i,s,a,u,h)}texParameterf(e,t,r){if(e|=0,t|=0,r=+r,this._checkTextureTarget(e)){switch(this._verifyTextureCompleteness(e,t,r),t){case o.TEXTURE_MIN_FILTER:case o.TEXTURE_MAG_FILTER:case o.TEXTURE_WRAP_S:case o.TEXTURE_WRAP_T:return super.texParameterf(e,t,r)}if(this._extensions.ext_texture_filter_anisotropic&&t===this._extensions.ext_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT)return super.texParameterf(e,t,r);this.setError(o.INVALID_ENUM)}}texParameteri(e,t,r){if(e|=0,t|=0,r|=0,this._checkTextureTarget(e)){switch(this._verifyTextureCompleteness(e,t,r),t){case o.TEXTURE_MIN_FILTER:case o.TEXTURE_MAG_FILTER:case o.TEXTURE_WRAP_S:case o.TEXTURE_WRAP_T:return super.texParameteri(e,t,r)}if(this._extensions.ext_texture_filter_anisotropic&&t===this._extensions.ext_texture_filter_anisotropic.TEXTURE_MAX_ANISOTROPY_EXT)return super.texParameteri(e,t,r);this.setError(o.INVALID_ENUM)}}useProgram(e){if(!x(e))throw new TypeError("useProgram(WebGLProgram)");return e?this._checkWrapper(e,F)?(this._activeProgram!==e&&(this._switchActiveProgram(this._activeProgram),this._activeProgram=e,e._refCount+=1),super.useProgram(0|e._)):void 0:(this._switchActiveProgram(this._activeProgram),this._activeProgram=null,super.useProgram(0))}validateProgram(e){if(this._checkWrapper(e,F)){super.validateProgram(0|e._);const t=this.getError();t===o.NO_ERROR&&(e._linkInfoLog=super.getProgramInfoLog(0|e._)),this.getError(),this.setError(t)}}vertexAttribPointer(e,t,r,n,i,s){if(i<0||s<0)return void this.setError(o.INVALID_VALUE);if(e|=0,t|=0,r|=0,n=!!n,s|=0,(i|=0)<0||s<0||e<0||e>=this._vertexObjectState._attribs.length||1!==t&&2!==t&&3!==t&&4!==t)return void this.setError(o.INVALID_VALUE);if(null===this._vertexGlobalState._arrayBufferBinding)return void this.setError(o.INVALID_OPERATION);const a=A(r);0!==a&&r!==o.INT&&r!==o.UNSIGNED_INT?i>255||i<0?this.setError(o.INVALID_VALUE):i%a==0&&s%a==0?(super.vertexAttribPointer(e,t,r,n,i,s),this._vertexObjectState.setVertexAttribPointer(this._vertexGlobalState._arrayBufferBinding,e,t*a,s,i||t*a,r,n,i,t)):this.setError(o.INVALID_OPERATION):this.setError(o.INVALID_ENUM)}viewport(e,t,r,n){return super.viewport(0|e,0|t,0|r,0|n)}_allocateDrawingBuffer(e,t){this._drawingBuffer=new D(super.createFramebuffer(),super.createTexture(),super.createRenderbuffer()),this._resizeDrawingBuffer(e,t)}isContextLost(){return!1}compressedTexImage2D(){}compressedTexSubImage2D(){}_checkUniformValid(e,t,r,n,i){if(!x(e))throw new TypeError(`${r}(WebGLUniformLocation, ...)`);if(!e)return!1;if(this._checkLocationActive(e)){const r=e._activeInfo.type;if(r===o.SAMPLER_2D||r===o.SAMPLER_CUBE){if(1!==n)return void this.setError(o.INVALID_VALUE);if("i"!==i)return void this.setError(o.INVALID_OPERATION);if(t<0||t>=this._textureUnits.length)return this.setError(o.INVALID_VALUE),!1}return!(S(r)>n)||(this.setError(o.INVALID_OPERATION),!1)}return!1}_checkUniformValueValid(e,t,r,n,i){if(!x(e)||!x(t))throw new TypeError(`${r}v(WebGLUniformLocation, Array)`);if(!e)return!1;if(!this._checkLocationActive(e))return!1;if("object"!=typeof t||!t||"number"!=typeof t.length)throw new TypeError(`Second argument to ${r} must be array`);return S(e._activeInfo.type)>n?(this.setError(o.INVALID_OPERATION),!1):t.length>=n&&t.length%n==0?!!e._array||(t.length===n||(this.setError(o.INVALID_OPERATION),!1)):(this.setError(o.INVALID_VALUE),!1)}uniform1f(e,t){this._checkUniformValid(e,t,"uniform1f",1,"f")&&super.uniform1f(0|e._,t)}uniform1fv(e,t){if(this._checkUniformValueValid(e,t,"uniform1fv",1,"f"))if(e._array){const r=e._array;for(let e=0;e<r.length&&e<t.length;++e){const n=r[e];super.uniform1f(n,t[e])}}else super.uniform1f(0|e._,t[0])}uniform1i(e,t){this._checkUniformValid(e,t,"uniform1i",1,"i")&&super.uniform1i(0|e._,t)}uniform1iv(e,t){if(this._checkUniformValueValid(e,t,"uniform1iv",1,"i"))if(e._array){const r=e._array;for(let e=0;e<r.length&&e<t.length;++e){const n=r[e];super.uniform1i(n,t[e])}}else this.uniform1i(e,t[0])}uniform2f(e,t,r){this._checkUniformValid(e,t,"uniform2f",2,"f")&&super.uniform2f(0|e._,t,r)}uniform2fv(e,t){if(this._checkUniformValueValid(e,t,"uniform2fv",2,"f"))if(e._array){const r=e._array;for(let e=0;e<r.length&&2*e<t.length;++e){const n=r[e];super.uniform2f(n,t[2*e],t[2*e+1])}}else super.uniform2f(0|e._,t[0],t[1])}uniform2i(e,t,r){this._checkUniformValid(e,t,"uniform2i",2,"i")&&super.uniform2i(0|e._,t,r)}uniform2iv(e,t){if(this._checkUniformValueValid(e,t,"uniform2iv",2,"i"))if(e._array){const r=e._array;for(let e=0;e<r.length&&2*e<t.length;++e){const n=r[e];super.uniform2i(n,t[2*e],t[2*e+1])}}else this.uniform2i(e,t[0],t[1])}uniform3f(e,t,r,n){this._checkUniformValid(e,t,"uniform3f",3,"f")&&super.uniform3f(0|e._,t,r,n)}uniform3fv(e,t){if(this._checkUniformValueValid(e,t,"uniform3fv",3,"f"))if(e._array){const r=e._array;for(let e=0;e<r.length&&3*e<t.length;++e){const n=r[e];super.uniform3f(n,t[3*e],t[3*e+1],t[3*e+2])}}else super.uniform3f(0|e._,t[0],t[1],t[2])}uniform3i(e,t,r,n){this._checkUniformValid(e,t,"uniform3i",3,"i")&&super.uniform3i(0|e._,t,r,n)}uniform3iv(e,t){if(this._checkUniformValueValid(e,t,"uniform3iv",3,"i"))if(e._array){const r=e._array;for(let e=0;e<r.length&&3*e<t.length;++e){const n=r[e];super.uniform3i(n,t[3*e],t[3*e+1],t[3*e+2])}}else this.uniform3i(e,t[0],t[1],t[2])}uniform4f(e,t,r,n,i){this._checkUniformValid(e,t,"uniform4f",4,"f")&&super.uniform4f(0|e._,t,r,n,i)}uniform4fv(e,t){if(this._checkUniformValueValid(e,t,"uniform4fv",4,"f"))if(e._array){const r=e._array;for(let e=0;e<r.length&&4*e<t.length;++e){const n=r[e];super.uniform4f(n,t[4*e],t[4*e+1],t[4*e+2],t[4*e+3])}}else super.uniform4f(0|e._,t[0],t[1],t[2],t[3])}uniform4i(e,t,r,n,i){this._checkUniformValid(e,t,"uniform4i",4,"i")&&super.uniform4i(0|e._,t,r,n,i)}uniform4iv(e,t){if(this._checkUniformValueValid(e,t,"uniform4iv",4,"i"))if(e._array){const r=e._array;for(let e=0;e<r.length&&4*e<t.length;++e){const n=r[e];super.uniform4i(n,t[4*e],t[4*e+1],t[4*e+2],t[4*e+3])}}else this.uniform4i(e,t[0],t[1],t[2],t[3])}_checkUniformMatrix(e,t,r,n,i){if(!x(e)||"object"!=typeof r)throw new TypeError(n+"(WebGLUniformLocation, Boolean, Array)");return t||"object"!=typeof r||null===r||!r.length||r.length%i*i!=0?(this.setError(o.INVALID_VALUE),!1):!!e&&(!!this._checkLocationActive(e)&&(r.length===i*i||(!!e._array||(this.setError(o.INVALID_VALUE),!1))))}uniformMatrix2fv(e,t,r){if(!this._checkUniformMatrix(e,t,r,"uniformMatrix2fv",2))return;const n=new Float32Array(r);super.uniformMatrix2fv(0|e._,!!t,n)}uniformMatrix3fv(e,t,r){if(!this._checkUniformMatrix(e,t,r,"uniformMatrix3fv",3))return;const n=new Float32Array(r);super.uniformMatrix3fv(0|e._,!!t,n)}uniformMatrix4fv(e,t,r){if(!this._checkUniformMatrix(e,t,r,"uniformMatrix4fv",4))return;const n=new Float32Array(r);super.uniformMatrix4fv(0|e._,!!t,n)}vertexAttrib1f(e,t){if(e|=0,!this._checkVertexIndex(e))return;const r=this._vertexGlobalState._attribs[e]._data;return r[3]=1,r[1]=r[2]=0,r[0]=t,super.vertexAttrib1f(0|e,+t)}vertexAttrib2f(e,t,r){if(e|=0,!this._checkVertexIndex(e))return;const n=this._vertexGlobalState._attribs[e]._data;return n[3]=1,n[2]=0,n[1]=r,n[0]=t,super.vertexAttrib2f(0|e,+t,+r)}vertexAttrib3f(e,t,r,n){if(e|=0,!this._checkVertexIndex(e))return;const i=this._vertexGlobalState._attribs[e]._data;return i[3]=1,i[2]=n,i[1]=r,i[0]=t,super.vertexAttrib3f(0|e,+t,+r,+n)}vertexAttrib4f(e,t,r,n,i){if(e|=0,!this._checkVertexIndex(e))return;const s=this._vertexGlobalState._attribs[e]._data;return s[3]=i,s[2]=n,s[1]=r,s[0]=t,super.vertexAttrib4f(0|e,+t,+r,+n,+i)}vertexAttrib1fv(e,t){if("object"!=typeof t||null===t||t.length<1)return void this.setError(o.INVALID_OPERATION);const r=this._vertexGlobalState._attribs[e]._data;return r[3]=1,r[2]=0,r[1]=0,r[0]=t[0],super.vertexAttrib1f(0|e,+t[0])}vertexAttrib2fv(e,t){if("object"!=typeof t||null===t||t.length<2)return void this.setError(o.INVALID_OPERATION);const r=this._vertexGlobalState._attribs[e]._data;return r[3]=1,r[2]=0,r[1]=t[1],r[0]=t[0],super.vertexAttrib2f(0|e,+t[0],+t[1])}vertexAttrib3fv(e,t){if("object"!=typeof t||null===t||t.length<3)return void this.setError(o.INVALID_OPERATION);const r=this._vertexGlobalState._attribs[e]._data;return r[3]=1,r[2]=t[2],r[1]=t[1],r[0]=t[0],super.vertexAttrib3f(0|e,+t[0],+t[1],+t[2])}vertexAttrib4fv(e,t){if("object"!=typeof t||null===t||t.length<4)return void this.setError(o.INVALID_OPERATION);const r=this._vertexGlobalState._attribs[e]._data;return r[3]=t[3],r[2]=t[2],r[1]=t[1],r[0]=t[0],super.vertexAttrib4f(0|e,+t[0],+t[1],+t[2],+t[3])}}t.exports={WebGLRenderingContext:Y,wrapContext:function(e){const t=new Y;return b(Object.keys(e),t,e,X),b(Object.keys(e.constructor.prototype),t,e,X),b(Object.getOwnPropertyNames(e),t,e,X),b(Object.getOwnPropertyNames(e.constructor.prototype),t,e,X),Object.defineProperties(t,{drawingBufferWidth:{get:()=>e.drawingBufferWidth,set(t){e.drawingBufferWidth=t}},drawingBufferHeight:{get:()=>e.drawingBufferHeight,set(t){e.drawingBufferHeight=t}}}),t}}},{"../../package.json":137,"./extensions/angle-instanced-arrays":139,"./extensions/ext-blend-minmax":140,"./extensions/ext-texture-filter-anisotropic":141,"./extensions/oes-element-index-unit":142,"./extensions/oes-standard-derivatives":143,"./extensions/oes-texture-float":145,"./extensions/oes-texture-float-linear":144,"./extensions/oes-vertex-array-object":146,"./extensions/stackgl-destroy-context":147,"./extensions/stackgl-resize-drawing-buffer":148,"./extensions/webgl-draw-buffers":149,"./native-gl":151,"./utils":153,"./webgl-active-info":154,"./webgl-buffer":155,"./webgl-drawing-buffer-wrapper":157,"./webgl-framebuffer":158,"./webgl-program":159,"./webgl-renderbuffer":160,"./webgl-shader":163,"./webgl-shader-precision-format":162,"./webgl-texture":165,"./webgl-uniform-location":166,"bit-twiddle":32,"glsl-tokenizer/string":182}],162:[function(e,t,r){t.exports={WebGLShaderPrecisionFormat:class{constructor(e){this.rangeMin=e.rangeMin,this.rangeMax=e.rangeMax,this.precision=e.precision}}}},{}],163:[function(e,t,r){const{gl:n}=e("./native-gl"),{Linkable:i}=e("./linkable");t.exports={WebGLShader:class extends i{constructor(e,t,r){super(e),this._type=r,this._ctx=t,this._source="",this._compileStatus=!1,this._compileInfo=""}_performDelete(){const e=this._ctx;delete e._shaders[0|this._],n.deleteShader.call(e,0|this._)}}}},{"./linkable":150,"./native-gl":151}],164:[function(e,t,r){t.exports={WebGLTextureUnit:class{constructor(e,t){this._ctx=e,this._idx=t,this._mode=0,this._bind2D=null,this._bindCube=null}}}},{}],165:[function(e,t,r){const{Linkable:n}=e("./linkable"),{gl:i}=e("./native-gl");t.exports={WebGLTexture:class extends n{constructor(e,t){super(e),this._ctx=t,this._binding=0,this._levelWidth=new Int32Array(32),this._levelHeight=new Int32Array(32),this._format=0,this._type=0,this._complete=!0}_performDelete(){const e=this._ctx;delete e._textures[0|this._],i.deleteTexture.call(e,0|this._)}}}},{"./linkable":150,"./native-gl":151}],166:[function(e,t,r){t.exports={WebGLUniformLocation:class{constructor(e,t,r){this._=e,this._program=t,this._linkCount=t._linkCount,this._activeInfo=r,this._array=null}}}},{}],167:[function(e,t,r){const{gl:n}=e("./native-gl"),{WebGLBuffer:i}=e("./webgl-buffer");class s{constructor(e,t){this._ctx=e,this._idx=t,this._clear()}_clear(){this._isPointer=!1,this._pointerBuffer=null,this._pointerOffset=0,this._pointerSize=0,this._pointerStride=0,this._pointerType=n.FLOAT,this._pointerNormal=!1,this._divisor=0,this._inputSize=4,this._inputStride=0}}class o{constructor(e){this._idx=e,this._data=new Float32Array([0,0,0,1])}}t.exports={WebGLVertexArrayObjectAttribute:s,WebGLVertexArrayGlobalAttribute:o,WebGLVertexArrayObjectState:class{constructor(e){const t=e.getParameter(e.MAX_VERTEX_ATTRIBS);this._attribs=new Array(t);for(let r=0;r<t;++r)this._attribs[r]=new s(e,r);this._elementArrayBufferBinding=null}setElementArrayBuffer(e){if(null!==e&&!(e instanceof i))throw new TypeError("setElementArrayBuffer(WebGLBuffer?)");const t=this._elementArrayBufferBinding;t!==e&&(t&&(t._refCount-=1,t._checkDelete()),e&&(e._refCount+=1),this._elementArrayBufferBinding=e)}cleanUp(){const e=this._elementArrayBufferBinding;e&&(e._refCount-=1,e._checkDelete(),this._elementArrayBufferBinding=null);for(let e=0;e<this._attribs.length;++e){const t=this._attribs[e];t._pointerBuffer&&(t._pointerBuffer._refCount-=1,t._pointerBuffer._checkDelete()),t._clear()}}releaseArrayBuffer(e){if(e)for(let t=0;t<this._attribs.length;++t){const r=this._attribs[t];r._pointerBuffer===e&&(r._pointerBuffer._refCount-=1,r._pointerBuffer._checkDelete(),r._clear())}}setVertexAttribPointer(e,t,r,n,i,s,o,a,u){const l=this._attribs[t];e!==l._pointerBuffer&&(l._pointerBuffer&&(l._pointerBuffer._refCount-=1,l._pointerBuffer._checkDelete()),e&&(e._refCount+=1),l._pointerBuffer=e),l._pointerSize=r,l._pointerOffset=n,l._pointerStride=i,l._pointerType=s,l._pointerNormal=o,l._inputStride=a,l._inputSize=u}},WebGLVertexArrayGlobalState:class{constructor(e){const t=e.getParameter(e.MAX_VERTEX_ATTRIBS);this._attribs=new Array(t);for(let e=0;e<t;++e)this._attribs[e]=new o(e);this._arrayBufferBinding=null}setArrayBuffer(e){if(null!==e&&!(e instanceof i))throw new TypeError("setArrayBuffer(WebGLBuffer?)");const t=this._arrayBufferBinding;t!==e&&(t&&(t._refCount-=1,t._checkDelete()),e&&(e._refCount+=1),this._arrayBufferBinding=e)}}}},{"./native-gl":151,"./webgl-buffer":155}],168:[function(e,t,r){var n=function(){function e(e,t,r){return Math.max(e,Math.min(t,r))}function t(e){return{_:e,loadContentsOf:function(e){F=this._.gl,this._.loadContentsOf(e)},destroy:function(){F=this._.gl,this._.destroy()}}}function r(e){return t(U.fromElement(e))}function n(e,t){var r=F.UNSIGNED_BYTE;if(F.getExtension("OES_texture_float")&&F.getExtension("OES_texture_float_linear")){var n=new U(100,100,F.RGBA,F.FLOAT);try{n.drawTo(function(){r=F.FLOAT})}catch(e){}n.destroy()}this._.texture&&this._.texture.destroy(),this._.spareTexture&&this._.spareTexture.destroy(),this.width=e,this.height=t,this._.texture=new U(e,t,F.RGBA,r),this._.spareTexture=new U(e,t,F.RGBA,r),this._.extraTexture=this._.extraTexture||new U(0,0,F.RGBA,r),this._.flippedShader=this._.flippedShader||new $(null,"uniform sampler2D texture;varying vec2 texCoord;void main(){gl_FragColor=texture2D(texture,vec2(texCoord.x,1.0-texCoord.y));}"),this._.isInitialized=!0}function i(e,t,r){return this._.isInitialized&&e._.width==this.width&&e._.height==this.height||n.call(this,t||e._.width,r||e._.height),e._.use(),this._.texture.drawTo(function(){$.getDefaultShader().drawRect()}),this}function s(){return this._.texture.use(),this._.flippedShader.drawRect(),this}function o(e,t,r,n){(r||this._.texture).use(),this._.spareTexture.drawTo(function(){e.uniforms(t).drawRect()}),this._.spareTexture.swapWith(n||this._.texture)}function a(e){return e.parentNode.insertBefore(this,e),e.parentNode.removeChild(e),this}function u(){var e=new U(this._.texture.width,this._.texture.height,F.RGBA,F.UNSIGNED_BYTE);return this._.texture.use(),e.drawTo(function(){$.getDefaultShader().drawRect()}),t(e)}function l(){var e=this._.texture.width,t=this._.texture.height,r=new Uint8Array(4*e*t);return this._.texture.drawTo(function(){F.readPixels(0,0,e,t,F.RGBA,F.UNSIGNED_BYTE,r)}),r}function c(e){return function(){return F=this._.gl,e.apply(this,arguments)}}function h(e,t,r,n,i,s,o,a){var u,l,c=n-s,h=a-s,p=(l=r-i)*h-(u=o-i)*c;return[r-e+(u=((i=e-r+i-o)*h-u*(s=t-n+s-a))/p)*r,n-t+u*n,u,o-e+(l=(l*s-i*c)/p)*o,a-t+l*a,l,e,t,1]}function p(e){var t=e[0],r=e[1],n=e[2],i=e[3],s=e[4],o=e[5],a=e[6],u=e[7],l=t*s*(e=e[8])-t*o*u-r*i*e+r*o*a+n*i*u-n*s*a;return[(s*e-o*u)/l,(n*u-r*e)/l,(r*o-n*s)/l,(o*a-i*e)/l,(t*e-n*a)/l,(n*i-t*o)/l,(i*u-s*a)/l,(r*a-t*u)/l,(t*s-r*i)/l]}function f(e){var t=e.length;this.xa=[],this.ya=[],this.u=[],this.y2=[],e.sort(function(e,t){return e[0]-t[0]});for(var r=0;r<t;r++)this.xa.push(e[r][0]),this.ya.push(e[r][1]);for(this.u[0]=0,this.y2[0]=0,r=1;r<t-1;++r){e=this.xa[r+1]-this.xa[r-1];var n=(this.xa[r]-this.xa[r-1])/e,i=n*this.y2[r-1]+2;this.y2[r]=(n-1)/i,this.u[r]=(6*((this.ya[r+1]-this.ya[r])/(this.xa[r+1]-this.xa[r])-(this.ya[r]-this.ya[r-1])/(this.xa[r]-this.xa[r-1]))/e-n*this.u[r-1])/i}for(this.y2[t-1]=0,r=t-2;0<=r;--r)this.y2[r]=this.y2[r]*this.y2[r+1]+this.u[r]}function d(e,t){return new $(null,e+"uniform sampler2D texture;uniform vec2 texSize;varying vec2 texCoord;void main(){vec2 coord=texCoord*texSize;"+t+"gl_FragColor=texture2D(texture,coord/texSize);vec2 clampedCoord=clamp(coord,vec2(0.0),texSize);if(coord!=clampedCoord){gl_FragColor.a*=max(0.0,1.0-length(coord-clampedCoord));}}")}function m(t){return F.noise=F.noise||new $(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;float rand(vec2 co){return fract(sin(dot(co.xy,vec2(12.9898,78.233)))*43758.5453);}void main(){vec4 color=texture2D(texture,texCoord);float diff=(rand(texCoord)-0.5)*amount;color.r+=diff;color.g+=diff;color.b+=diff;gl_FragColor=color;}"),o.call(this,F.noise,{amount:e(0,t,1)}),this}function g(t){return F.vibrance=F.vibrance||new $(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;float mx=max(color.r,max(color.g,color.b));float amt=(mx-average)*(-amount*3.0);color.rgb=mix(color.rgb,vec3(mx),amt);gl_FragColor=color;}"),o.call(this,F.vibrance,{amount:e(-1,t,1)}),this}function v(t,r){return F.vignette=F.vignette||new $(null,"uniform sampler2D texture;uniform float size;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float dist=distance(texCoord,vec2(0.5,0.5));color.rgb*=smoothstep(0.8,size*0.799,dist*(amount+size));gl_FragColor=color;}"),o.call(this,F.vignette,{size:e(0,t,1),amount:e(0,r,1)}),this}function y(e){F.denoise=F.denoise||new $(null,"uniform sampler2D texture;uniform float exponent;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;void main(){vec4 center=texture2D(texture,texCoord);vec4 color=vec4(0.0);float total=0.0;for(float x=-4.0;x<=4.0;x+=1.0){for(float y=-4.0;y<=4.0;y+=1.0){vec4 sample=texture2D(texture,texCoord+vec2(x,y)/texSize);float weight=1.0-abs(dot(sample.rgb-center.rgb,vec3(0.25)));weight=pow(weight,exponent);color+=sample*weight;total+=weight;}}gl_FragColor=color/total;}");for(var t=0;2>t;t++)o.call(this,F.denoise,{exponent:Math.max(0,e),texSize:[this.width,this.height]});return this}function _(t,r){return F.brightnessContrast=F.brightnessContrast||new $(null,"uniform sampler2D texture;uniform float brightness;uniform float contrast;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color.rgb+=brightness;if(contrast>0.0){color.rgb=(color.rgb-0.5)/(1.0-contrast)+0.5;}else{color.rgb=(color.rgb-0.5)*(1.0+contrast)+0.5;}gl_FragColor=color;}"),o.call(this,F.brightnessContrast,{brightness:e(-1,t,1),contrast:e(-1,r,1)}),this}function b(t){t=new f(t);for(var r=[],n=0;256>n;n++)r.push(e(0,Math.floor(256*t.interpolate(n/255)),255));return r}function x(e,t,r){e=b(e),1==arguments.length?t=r=e:(t=b(t),r=b(r));for(var n=[],i=0;256>i;i++)n.splice(n.length,0,e[i],t[i],r[i],255);return this._.extraTexture.initFromBytes(256,1,n),this._.extraTexture.use(1),F.curves=F.curves||new $(null,"uniform sampler2D texture;uniform sampler2D map;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color.r=texture2D(map,vec2(color.r)).r;color.g=texture2D(map,vec2(color.g)).g;color.b=texture2D(map,vec2(color.b)).b;gl_FragColor=color;}"),F.curves.textures({map:1}),o.call(this,F.curves,{}),this}function w(e,t){return F.unsharpMask=F.unsharpMask||new $(null,"uniform sampler2D blurredTexture;uniform sampler2D originalTexture;uniform float strength;uniform float threshold;varying vec2 texCoord;void main(){vec4 blurred=texture2D(blurredTexture,texCoord);vec4 original=texture2D(originalTexture,texCoord);gl_FragColor=mix(blurred,original,1.0+strength);}"),this._.extraTexture.ensureFormat(this._.texture),this._.texture.use(),this._.extraTexture.drawTo(function(){$.getDefaultShader().drawRect()}),this._.extraTexture.use(1),this.triangleBlur(e),F.unsharpMask.textures({originalTexture:1}),o.call(this,F.unsharpMask,{strength:t}),this._.extraTexture.unuse(1),this}function E(t){return F.sepia=F.sepia||new $(null,"uniform sampler2D texture;uniform float amount;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float r=color.r;float g=color.g;float b=color.b;color.r=min(1.0,(r*(1.0-(0.607*amount)))+(g*(0.769*amount))+(b*(0.189*amount)));color.g=min(1.0,(r*0.349*amount)+(g*(1.0-(0.314*amount)))+(b*0.168*amount));color.b=min(1.0,(r*0.272*amount)+(g*0.534*amount)+(b*(1.0-(0.869*amount))));gl_FragColor=color;}"),o.call(this,F.sepia,{amount:e(0,t,1)}),this}function T(t,r){return F.hueSaturation=F.hueSaturation||new $(null,"uniform sampler2D texture;uniform float hue;uniform float saturation;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);float angle=hue*3.14159265;float s=sin(angle),c=cos(angle);vec3 weights=(vec3(2.0*c,-sqrt(3.0)*s-c,sqrt(3.0)*s-c)+1.0)/3.0;float len=length(color.rgb);color.rgb=vec3(dot(color.rgb,weights.xyz),dot(color.rgb,weights.zxy),dot(color.rgb,weights.yzx));float average=(color.r+color.g+color.b)/3.0;if(saturation>0.0){color.rgb+=(average-color.rgb)*(1.0-1.0/(1.001-saturation));}else{color.rgb+=(average-color.rgb)*(-saturation);}gl_FragColor=color;}"),o.call(this,F.hueSaturation,{hue:e(-1,t,1),saturation:e(-1,r,1)}),this}function A(e,t,r){return F.zoomBlur=F.zoomBlur||new $(null,"uniform sampler2D texture;uniform vec2 center;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;"+V+"void main(){vec4 color=vec4(0.0);float total=0.0;vec2 toCenter=center-texCoord*texSize;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=0.0;t<=40.0;t++){float percent=(t+offset)/40.0;float weight=4.0*(percent-percent*percent);vec4 sample=texture2D(texture,texCoord+toCenter*percent*strength/texSize);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"),o.call(this,F.zoomBlur,{center:[e,t],strength:r,texSize:[this.width,this.height]}),this}function S(e,t,r,n,i,s){F.tiltShift=F.tiltShift||new $(null,"uniform sampler2D texture;uniform float blurRadius;uniform float gradientRadius;uniform vec2 start;uniform vec2 end;uniform vec2 delta;uniform vec2 texSize;varying vec2 texCoord;"+V+"void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);vec2 normal=normalize(vec2(start.y-end.y,end.x-start.x));float radius=smoothstep(0.0,1.0,abs(dot(texCoord*texSize-start,normal))/gradientRadius)*blurRadius;for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta/texSize*percent*radius);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}");var a=r-e,u=n-t,l=Math.sqrt(a*a+u*u);return o.call(this,F.tiltShift,{blurRadius:i,gradientRadius:s,start:[e,t],end:[r,n],delta:[a/l,u/l],texSize:[this.width,this.height]}),o.call(this,F.tiltShift,{blurRadius:i,gradientRadius:s,start:[e,t],end:[r,n],delta:[-u/l,a/l],texSize:[this.width,this.height]}),this}function k(t,r,n){F.lensBlurPrePass=F.lensBlurPrePass||new $(null,"uniform sampler2D texture;uniform float power;varying vec2 texCoord;void main(){vec4 color=texture2D(texture,texCoord);color=pow(color,vec4(power));gl_FragColor=vec4(color);}");var i="uniform sampler2D texture0;uniform sampler2D texture1;uniform vec2 delta0;uniform vec2 delta1;uniform float power;varying vec2 texCoord;"+V+"vec4 sample(vec2 delta){float offset=random(vec3(delta,151.7182),0.0);vec4 color=vec4(0.0);float total=0.0;for(float t=0.0;t<=30.0;t++){float percent=(t+offset)/30.0;color+=texture2D(texture0,texCoord+delta*percent);total+=1.0;}return color/total;}";F.lensBlur0=F.lensBlur0||new $(null,i+"void main(){gl_FragColor=sample(delta0);}"),F.lensBlur1=F.lensBlur1||new $(null,i+"void main(){gl_FragColor=(sample(delta0)+sample(delta1))*0.5;}"),F.lensBlur2=F.lensBlur2||new $(null,i+"void main(){vec4 color=(sample(delta0)+2.0*texture2D(texture1,texCoord))/3.0;gl_FragColor=pow(color,vec4(power));}").textures({texture1:1});i=[];for(var s=0;3>s;s++){var a=n+2*s*Math.PI/3;i.push([t*Math.sin(a)/this.width,t*Math.cos(a)/this.height])}return t=Math.pow(10,e(-1,r,1)),o.call(this,F.lensBlurPrePass,{power:t}),this._.extraTexture.ensureFormat(this._.texture),o.call(this,F.lensBlur0,{delta0:i[0]},this._.texture,this._.extraTexture),o.call(this,F.lensBlur1,{delta0:i[1],delta1:i[2]},this._.extraTexture,this._.extraTexture),o.call(this,F.lensBlur0,{delta0:i[1]}),this._.extraTexture.use(1),o.call(this,F.lensBlur2,{power:1/t,delta0:i[2]}),this}function C(e){return F.triangleBlur=F.triangleBlur||new $(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+V+"void main(){vec4 color=vec4(0.0);float total=0.0;float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec4 sample=texture2D(texture,texCoord+delta*percent);sample.rgb*=sample.a;color+=sample*weight;total+=weight;}gl_FragColor=color/total;gl_FragColor.rgb/=gl_FragColor.a+0.00001;}"),o.call(this,F.triangleBlur,{delta:[e/this.width,0]}),o.call(this,F.triangleBlur,{delta:[0,e/this.height]}),this}function I(e){return F.edgeWork1=F.edgeWork1||new $(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+V+"void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec3 sample=texture2D(texture,texCoord+delta*percent).rgb;float average=(sample.r+sample.g+sample.b)/3.0;color.x+=average*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=average*weight;total.y+=weight;}}gl_FragColor=vec4(color/total,0.0,1.0);}"),F.edgeWork2=F.edgeWork2||new $(null,"uniform sampler2D texture;uniform vec2 delta;varying vec2 texCoord;"+V+"void main(){vec2 color=vec2(0.0);vec2 total=vec2(0.0);float offset=random(vec3(12.9898,78.233,151.7182),0.0);for(float t=-30.0;t<=30.0;t++){float percent=(t+offset-0.5)/30.0;float weight=1.0-abs(percent);vec2 sample=texture2D(texture,texCoord+delta*percent).xy;color.x+=sample.x*weight;total.x+=weight;if(abs(t)<15.0){weight=weight*2.0-1.0;color.y+=sample.y*weight;total.y+=weight;}}float c=clamp(10000.0*(color.y/total.y-color.x/total.x)+0.5,0.0,1.0);gl_FragColor=vec4(c,c,c,1.0);}"),o.call(this,F.edgeWork1,{delta:[e/this.width,0]}),o.call(this,F.edgeWork2,{delta:[0,e/this.height]}),this}function R(e,t,r){return F.hexagonalPixelate=F.hexagonalPixelate||new $(null,"uniform sampler2D texture;uniform vec2 center;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;void main(){vec2 tex=(texCoord*texSize-center)/scale;tex.y/=0.866025404;tex.x-=tex.y*0.5;vec2 a;if(tex.x+tex.y-floor(tex.x)-floor(tex.y)<1.0)a=vec2(floor(tex.x),floor(tex.y));else a=vec2(ceil(tex.x),ceil(tex.y));vec2 b=vec2(ceil(tex.x),floor(tex.y));vec2 c=vec2(floor(tex.x),ceil(tex.y));vec3 TEX=vec3(tex.x,tex.y,1.0-tex.x-tex.y);vec3 A=vec3(a.x,a.y,1.0-a.x-a.y);vec3 B=vec3(b.x,b.y,1.0-b.x-b.y);vec3 C=vec3(c.x,c.y,1.0-c.x-c.y);float alen=length(TEX-A);float blen=length(TEX-B);float clen=length(TEX-C);vec2 choice;if(alen<blen){if(alen<clen)choice=a;else choice=c;}else{if(blen<clen)choice=b;else choice=c;}choice.x+=choice.y*0.5;choice.y*=0.866025404;choice*=scale/texSize;gl_FragColor=texture2D(texture,choice+center/texSize);}"),o.call(this,F.hexagonalPixelate,{center:[e,t],scale:r,texSize:[this.width,this.height]}),this}function L(e,t,r,n){return F.colorHalftone=F.colorHalftone||new $(null,"uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(float angle){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);vec3 cmy=1.0-color.rgb;float k=min(cmy.x,min(cmy.y,cmy.z));cmy=(cmy-k)/(1.0-k);cmy=clamp(cmy*10.0-3.0+vec3(pattern(angle+0.26179),pattern(angle+1.30899),pattern(angle)),0.0,1.0);k=clamp(k*10.0-5.0+pattern(angle+0.78539),0.0,1.0);gl_FragColor=vec4(1.0-cmy-k,color.a);}"),o.call(this,F.colorHalftone,{center:[e,t],angle:r,scale:Math.PI/n,texSize:[this.width,this.height]}),this}function O(e){return F.ink=F.ink||new $(null,"uniform sampler2D texture;uniform float strength;uniform vec2 texSize;varying vec2 texCoord;void main(){vec2 dx=vec2(1.0/texSize.x,0.0);vec2 dy=vec2(0.0,1.0/texSize.y);vec4 color=texture2D(texture,texCoord);float bigTotal=0.0;float smallTotal=0.0;vec3 bigAverage=vec3(0.0);vec3 smallAverage=vec3(0.0);for(float x=-2.0;x<=2.0;x+=1.0){for(float y=-2.0;y<=2.0;y+=1.0){vec3 sample=texture2D(texture,texCoord+dx*x+dy*y).rgb;bigAverage+=sample;bigTotal+=1.0;if(abs(x)+abs(y)<2.0){smallAverage+=sample;smallTotal+=1.0;}}}vec3 edge=max(vec3(0.0),bigAverage/bigTotal-smallAverage/smallTotal);gl_FragColor=vec4(color.rgb-dot(edge,edge)*strength*100000.0,color.a);}"),o.call(this,F.ink,{strength:e*e*e*e*e,texSize:[this.width,this.height]}),this}function M(e,t,r,n){return F.dotScreen=F.dotScreen||new $(null,"uniform sampler2D texture;uniform vec2 center;uniform float angle;uniform float scale;uniform vec2 texSize;varying vec2 texCoord;float pattern(){float s=sin(angle),c=cos(angle);vec2 tex=texCoord*texSize-center;vec2 point=vec2(c*tex.x-s*tex.y,s*tex.x+c*tex.y)*scale;return(sin(point.x)*sin(point.y))*4.0;}void main(){vec4 color=texture2D(texture,texCoord);float average=(color.r+color.g+color.b)/3.0;gl_FragColor=vec4(vec3(average*10.0-5.0+pattern()),color.a);}"),o.call(this,F.dotScreen,{center:[e,t],angle:r,scale:Math.PI/n,texSize:[this.width,this.height]}),this}function P(e,t,r){if(F.matrixWarp=F.matrixWarp||d("uniform mat3 matrix;uniform bool useTextureSpace;","if(useTextureSpace)coord=coord/texSize*2.0-1.0;vec3 warp=matrix*vec3(coord,1.0);coord=warp.xy/warp.z;if(useTextureSpace)coord=(coord*0.5+0.5)*texSize;"),4==(e=Array.prototype.concat.apply([],e)).length)e=[e[0],e[1],0,e[2],e[3],0,0,0,1];else if(9!=e.length)throw"can only warp with 2x2 or 3x3 matrix";return o.call(this,F.matrixWarp,{matrix:t?p(e):e,texSize:[this.width,this.height],useTextureSpace:0|r}),this}function B(e,t,r,n){return F.swirl=F.swirl||d("uniform float radius;uniform float angle;uniform vec2 center;","coord-=center;float distance=length(coord);if(distance<radius){float percent=(radius-distance)/radius;float theta=percent*percent*angle;float s=sin(theta);float c=cos(theta);coord=vec2(coord.x*c-coord.y*s,coord.x*s+coord.y*c);}coord+=center;"),o.call(this,F.swirl,{radius:r,center:[e,t],angle:n,texSize:[this.width,this.height]}),this}function N(t,r,n,i){return F.bulgePinch=F.bulgePinch||d("uniform float radius;uniform float strength;uniform vec2 center;","coord-=center;float distance=length(coord);if(distance<radius){float percent=distance/radius;if(strength>0.0){coord*=mix(1.0,smoothstep(0.0,radius/distance,percent),strength*0.75);}else{coord*=mix(1.0,pow(percent,1.0+strength*0.75)*radius/distance,1.0-percent);}}coord+=center;"),o.call(this,F.bulgePinch,{radius:n,strength:e(-1,i,1),center:[t,r],texSize:[this.width,this.height]}),this}function D(e,t){var r=h.apply(null,t),n=h.apply(null,e);r=p(r);return this.matrixWarp([r[0]*n[0]+r[1]*n[3]+r[2]*n[6],r[0]*n[1]+r[1]*n[4]+r[2]*n[7],r[0]*n[2]+r[1]*n[5]+r[2]*n[8],r[3]*n[0]+r[4]*n[3]+r[5]*n[6],r[3]*n[1]+r[4]*n[4]+r[5]*n[7],r[3]*n[2]+r[4]*n[5]+r[5]*n[8],r[6]*n[0]+r[7]*n[3]+r[8]*n[6],r[6]*n[1]+r[7]*n[4]+r[8]*n[7],r[6]*n[2]+r[7]*n[5]+r[8]*n[8]])}var F,j={};!function(){try{var e=document.createElement("canvas").getContext("experimental-webgl")}catch(e){}if(e&&-1===e.getSupportedExtensions().indexOf("OES_texture_float_linear")&&function(e){if(!e.getExtension("OES_texture_float"))return!1;var t=e.createFramebuffer(),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0),t=e.createTexture(),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,2,2,0,e.RGBA,e.FLOAT,new Float32Array([2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])),r=e.createProgram();var n=e.createShader(e.VERTEX_SHADER),i=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(n,"attribute vec2 vertex;void main(){gl_Position=vec4(vertex,0.0,1.0);}"),e.shaderSource(i,"uniform sampler2D texture;void main(){gl_FragColor=texture2D(texture,vec2(0.5));}"),e.compileShader(n),e.compileShader(i),e.attachShader(r,n),e.attachShader(r,i),e.linkProgram(r),n=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,new Float32Array([0,0]),e.STREAM_DRAW),e.enableVertexAttribArray(0),e.vertexAttribPointer(0,2,e.FLOAT,!1,0,0),n=new Uint8Array(4),e.useProgram(r),e.viewport(0,0,1,1),e.bindTexture(e.TEXTURE_2D,t),e.drawArrays(e.POINTS,0,1),e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,n),127===n[0]||128===n[0]}(e)){var t=WebGLRenderingContext.prototype.getExtension,r=WebGLRenderingContext.prototype.getSupportedExtensions;WebGLRenderingContext.prototype.getExtension=function(e){return"OES_texture_float_linear"===e?(void 0===this.$OES_texture_float_linear$&&Object.defineProperty(this,"$OES_texture_float_linear$",{enumerable:!1,configurable:!1,writable:!1,value:new function(){}}),e=this.$OES_texture_float_linear$):e=t.call(this,e),e},WebGLRenderingContext.prototype.getSupportedExtensions=function(){var e=r.call(this);return-1===e.indexOf("OES_texture_float_linear")&&e.push("OES_texture_float_linear"),e}}}(),j.canvas=function(){var e=document.createElement("canvas");try{F=e.getContext("experimental-webgl",{premultipliedAlpha:!1})}catch(e){F=null}if(!F)throw"This browser does not support WebGL";return e._={gl:F,isInitialized:!1,texture:null,spareTexture:null,flippedShader:null},e.texture=c(r),e.draw=c(i),e.update=c(s),e.replace=c(a),e.contents=c(u),e.getPixelArray=c(l),e.brightnessContrast=c(_),e.hexagonalPixelate=c(R),e.hueSaturation=c(T),e.colorHalftone=c(L),e.triangleBlur=c(C),e.unsharpMask=c(w),e.perspective=c(D),e.matrixWarp=c(P),e.bulgePinch=c(N),e.tiltShift=c(S),e.dotScreen=c(M),e.edgeWork=c(I),e.lensBlur=c(k),e.zoomBlur=c(A),e.noise=c(m),e.denoise=c(y),e.curves=c(x),e.swirl=c(B),e.ink=c(O),e.vignette=c(v),e.vibrance=c(g),e.sepia=c(E),e},j.splineInterpolate=b;var U=function(){function e(e,t,r,n){this.gl=F,this.id=F.createTexture(),this.width=e,this.height=t,this.format=r,this.type=n,F.bindTexture(F.TEXTURE_2D,this.id),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MAG_FILTER,F.LINEAR),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MIN_FILTER,F.LINEAR),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_S,F.CLAMP_TO_EDGE),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_T,F.CLAMP_TO_EDGE),e&&t&&F.texImage2D(F.TEXTURE_2D,0,this.format,e,t,0,this.format,this.type,null)}function t(e){return null==r&&(r=document.createElement("canvas")),r.width=e.width,r.height=e.height,(e=r.getContext("2d")).clearRect(0,0,r.width,r.height),e}e.fromElement=function(t){var r=new e(0,0,F.RGBA,F.UNSIGNED_BYTE);return r.loadContentsOf(t),r},e.prototype.loadContentsOf=function(e){this.width=e.width||e.videoWidth,this.height=e.height||e.videoHeight,F.bindTexture(F.TEXTURE_2D,this.id),F.texImage2D(F.TEXTURE_2D,0,this.format,this.format,this.type,e)},e.prototype.initFromBytes=function(e,t,r){this.width=e,this.height=t,this.format=F.RGBA,this.type=F.UNSIGNED_BYTE,F.bindTexture(F.TEXTURE_2D,this.id),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,e,t,0,F.RGBA,this.type,new Uint8Array(r))},e.prototype.destroy=function(){F.deleteTexture(this.id),this.id=null},e.prototype.use=function(e){F.activeTexture(F.TEXTURE0+(e||0)),F.bindTexture(F.TEXTURE_2D,this.id)},e.prototype.unuse=function(e){F.activeTexture(F.TEXTURE0+(e||0)),F.bindTexture(F.TEXTURE_2D,null)},e.prototype.ensureFormat=function(e,t,r,n){if(1==arguments.length){var i=arguments[0];e=i.width,t=i.height,r=i.format,n=i.type}e==this.width&&t==this.height&&r==this.format&&n==this.type||(this.width=e,this.height=t,this.format=r,this.type=n,F.bindTexture(F.TEXTURE_2D,this.id),F.texImage2D(F.TEXTURE_2D,0,this.format,e,t,0,this.format,this.type,null))},e.prototype.drawTo=function(e){if(F.framebuffer=F.framebuffer||F.createFramebuffer(),F.bindFramebuffer(F.FRAMEBUFFER,F.framebuffer),F.framebufferTexture2D(F.FRAMEBUFFER,F.COLOR_ATTACHMENT0,F.TEXTURE_2D,this.id,0),F.checkFramebufferStatus(F.FRAMEBUFFER)!==F.FRAMEBUFFER_COMPLETE)throw Error("incomplete framebuffer");F.viewport(0,0,this.width,this.height),e(),F.bindFramebuffer(F.FRAMEBUFFER,null)};var r=null;return e.prototype.fillUsingCanvas=function(e){return e(t(this)),this.format=F.RGBA,this.type=F.UNSIGNED_BYTE,F.bindTexture(F.TEXTURE_2D,this.id),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,F.RGBA,F.UNSIGNED_BYTE,r),this},e.prototype.toImage=function(e){this.use(),$.getDefaultShader().drawRect();var n=4*this.width*this.height,i=new Uint8Array(n),s=t(this),o=s.createImageData(this.width,this.height);F.readPixels(0,0,this.width,this.height,F.RGBA,F.UNSIGNED_BYTE,i);for(var a=0;a<n;a++)o.data[a]=i[a];s.putImageData(o,0,0),e.src=r.toDataURL()},e.prototype.swapWith=function(e){var t;t=e.id,e.id=this.id,this.id=t,t=e.width,e.width=this.width,this.width=t,t=e.height,e.height=this.height,this.height=t,t=e.format,e.format=this.format,this.format=t},e}();f.prototype.interpolate=function(e){for(var t=0,r=this.ya.length-1;1<r-t;){var n=r+t>>1;this.xa[n]>e?r=n:t=n}n=this.xa[r]-this.xa[t];var i=(this.xa[r]-e)/n;return e=(e-this.xa[t])/n,i*this.ya[t]+e*this.ya[r]+((i*i*i-i)*this.y2[t]+(e*e*e-e)*this.y2[r])*n*n/6};var $=function(){function e(e,t){var r=F.createShader(e);if(F.shaderSource(r,t),F.compileShader(r),!F.getShaderParameter(r,F.COMPILE_STATUS))throw"compile error: "+F.getShaderInfoLog(r);return r}function t(t,i){if(this.texCoordAttribute=this.vertexAttribute=null,this.program=F.createProgram(),t=t||r,i="precision highp float;"+(i=i||n),F.attachShader(this.program,e(F.VERTEX_SHADER,t)),F.attachShader(this.program,e(F.FRAGMENT_SHADER,i)),F.linkProgram(this.program),!F.getProgramParameter(this.program,F.LINK_STATUS))throw"link error: "+F.getProgramInfoLog(this.program)}var r="attribute vec2 vertex;attribute vec2 _texCoord;varying vec2 texCoord;void main(){texCoord=_texCoord;gl_Position=vec4(vertex*2.0-1.0,0.0,1.0);}",n="uniform sampler2D texture;varying vec2 texCoord;void main(){gl_FragColor=texture2D(texture,texCoord);}";return t.prototype.destroy=function(){F.deleteProgram(this.program),this.program=null},t.prototype.uniforms=function(e){for(var t in F.useProgram(this.program),e)if(e.hasOwnProperty(t)){var r=F.getUniformLocation(this.program,t);if(null!==r){var n=e[t];if("[object Array]"==Object.prototype.toString.call(n))switch(n.length){case 1:F.uniform1fv(r,new Float32Array(n));break;case 2:F.uniform2fv(r,new Float32Array(n));break;case 3:F.uniform3fv(r,new Float32Array(n));break;case 4:F.uniform4fv(r,new Float32Array(n));break;case 9:F.uniformMatrix3fv(r,!1,new Float32Array(n));break;case 16:F.uniformMatrix4fv(r,!1,new Float32Array(n));break;default:throw"dont't know how to load uniform \""+t+'" of length '+n.length}else{if("[object Number]"!=Object.prototype.toString.call(n))throw'attempted to set uniform "'+t+'" to invalid value '+(n||"undefined").toString();F.uniform1f(r,n)}}}return this},t.prototype.textures=function(e){for(var t in F.useProgram(this.program),e)e.hasOwnProperty(t)&&F.uniform1i(F.getUniformLocation(this.program,t),e[t]);return this},t.prototype.drawRect=function(e,t,r,n){var i=F.getParameter(F.VIEWPORT);t=void 0!==t?(t-i[1])/i[3]:0,e=void 0!==e?(e-i[0])/i[2]:0,r=void 0!==r?(r-i[0])/i[2]:1,n=void 0!==n?(n-i[1])/i[3]:1,null==F.vertexBuffer&&(F.vertexBuffer=F.createBuffer()),F.bindBuffer(F.ARRAY_BUFFER,F.vertexBuffer),F.bufferData(F.ARRAY_BUFFER,new Float32Array([e,t,e,n,r,t,r,n]),F.STATIC_DRAW),null==F.texCoordBuffer&&(F.texCoordBuffer=F.createBuffer(),F.bindBuffer(F.ARRAY_BUFFER,F.texCoordBuffer),F.bufferData(F.ARRAY_BUFFER,new Float32Array([0,0,0,1,1,0,1,1]),F.STATIC_DRAW)),null==this.vertexAttribute&&(this.vertexAttribute=F.getAttribLocation(this.program,"vertex"),F.enableVertexAttribArray(this.vertexAttribute)),null==this.texCoordAttribute&&(this.texCoordAttribute=F.getAttribLocation(this.program,"_texCoord"),F.enableVertexAttribArray(this.texCoordAttribute)),F.useProgram(this.program),F.bindBuffer(F.ARRAY_BUFFER,F.vertexBuffer),F.vertexAttribPointer(this.vertexAttribute,2,F.FLOAT,!1,0,0),F.bindBuffer(F.ARRAY_BUFFER,F.texCoordBuffer),F.vertexAttribPointer(this.texCoordAttribute,2,F.FLOAT,!1,0,0),F.drawArrays(F.TRIANGLE_STRIP,0,4)},t.getDefaultShader=function(){return F.defaultShader=F.defaultShader||new t,F.defaultShader},t}(),V="float random(vec3 scale,float seed){return fract(sin(dot(gl_FragCoord.xyz+seed,scale))*43758.5453+seed);}";return j}();"object"==typeof t?t.exports=n:window.fx=n},{}],169:[function(e,t,r){(function(r){"use strict";const{promisify:n}=e("util"),i=e("fs"),s=e("path"),o=e("fast-glob"),a=e("ignore"),u=e("slash"),l=["**/node_modules/**","**/flow-typed/**","**/coverage/**","**/.git"],c=n(i.readFile),h=(e,t)=>{const r=u(s.relative(t.cwd,s.dirname(t.fileName)));return e.split(/\r?\n/).filter(Boolean).filter(e=>!e.startsWith("#")).map((e=>t=>t.startsWith("!")?"!"+s.posix.join(e,t.slice(1)):s.posix.join(e,t))(r))},p=e=>e.reduce((e,t)=>(e.add(h(t.content,{cwd:t.cwd,fileName:t.filePath})),e),a()),f=(e,t)=>r=>e.ignores(u(s.relative(t,((e,t)=>{if(s.isAbsolute(t)){if(t.startsWith(e))return t;throw new Error(`Path ${t} is not in cwd ${e}`)}return s.join(e,t)})(t,r)))),d=({ignore:e=[],cwd:t=r.cwd()}={})=>({ignore:e,cwd:t});t.exports=(async e=>{e=d(e);const t=await o("**/.gitignore",{ignore:l.concat(e.ignore),cwd:e.cwd}),r=await Promise.all(t.map(t=>(async(e,t)=>{const r=s.join(t,e);return{cwd:t,filePath:r,content:await c(r,"utf8")}})(t,e.cwd))),n=p(r);return f(n,e.cwd)}),t.exports.sync=(e=>{e=d(e);const t=o.sync("**/.gitignore",{ignore:l.concat(e.ignore),cwd:e.cwd}).map(t=>((e,t)=>{const r=s.join(t,e);return{cwd:t,filePath:r,content:i.readFileSync(r,"utf8")}})(t,e.cwd)),r=p(t);return f(r,e.cwd)})}).call(this,e("_process"))},{_process:437,"fast-glob":85,fs:298,ignore:174,path:404,slash:501,util:523}],170:[function(e,t,r){"use strict";const n=e("fs"),i=e("array-union"),s=e("merge2"),o=e("glob"),a=e("fast-glob"),u=e("dir-glob"),l=e("./gitignore"),{FilterStream:c,UniqueStream:h}=e("./stream-utils"),p=()=>!1,f=e=>"!"===e[0],d=(e,t)=>{(e=>{if(!e.every(e=>"string"==typeof e))throw new TypeError("Patterns must be a string or an array of strings")})(e=i([].concat(e))),((e={})=>{if(!e.cwd)return;let t;try{t=n.statSync(e.cwd)}catch(e){return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")})(t);const r=[];t={ignore:[],expandDirectories:!0,...t};for(const[n,i]of e.entries()){if(f(i))continue;const s=e.slice(n).filter(f).map(e=>e.slice(1)),o={...t,ignore:t.ignore.concat(s)};r.push({pattern:i,options:o})}return r},m=(e,t)=>e.options.expandDirectories?((e,t)=>{let r={};return e.options.cwd&&(r.cwd=e.options.cwd),Array.isArray(e.options.expandDirectories)?r={...r,files:e.options.expandDirectories}:"object"==typeof e.options.expandDirectories&&(r={...r,...e.options.expandDirectories}),t(e.pattern,r)})(e,t):[e.pattern],g=e=>e&&e.gitignore?l.sync({cwd:e.cwd,ignore:e.ignore}):p,v=e=>t=>{const{options:r}=e;return r.ignore&&Array.isArray(r.ignore)&&r.expandDirectories&&(r.ignore=u.sync(r.ignore)),{pattern:t,options:r}};t.exports=(async(e,t)=>{const r=d(e,t),[s,o]=await Promise.all([(async()=>t&&t.gitignore?l({cwd:t.cwd,ignore:t.ignore}):p)(),(async()=>{const e=await Promise.all(r.map(async e=>{const t=await m(e,u);return Promise.all(t.map(v(e)))}));return i(...e)})()]),c=await Promise.all(o.map(e=>a(e.pattern,e.options)));return i(...c).filter(e=>!s((e=>e.stats instanceof n.Stats?e.path:e)(e)))}),t.exports.sync=((e,t)=>{const r=d(e,t).reduce((e,t)=>{const r=m(t,u.sync).map(v(t));return e.concat(r)},[]),n=g(t);return r.reduce((e,t)=>i(e,a.sync(t.pattern,t.options)),[]).filter(e=>!n(e))}),t.exports.stream=((e,t)=>{const r=d(e,t).reduce((e,t)=>{const r=m(t,u.sync).map(v(t));return e.concat(r)},[]),n=g(t),i=new c(e=>!n(e)),o=new h;return s(r.map(e=>a.stream(e.pattern,e.options))).pipe(i).pipe(o)}),t.exports.generateGlobTasks=d,t.exports.hasMagic=((e,t)=>[].concat(e).some(e=>o.hasMagic(e,t))),t.exports.gitignore=l},{"./gitignore":169,"./stream-utils":175,"array-union":25,"dir-glob":53,"fast-glob":85,fs:298,glob:172,merge2:381}],171:[function(e,t,r){(function(t){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.alphasort=l,r.alphasorti=u,r.setopts=function(e,r,s){s||(s={});if(s.matchBase&&-1===r.indexOf("/")){if(s.noglobstar)throw new Error("base matching requires globstar");r="**/"+r}e.silent=!!s.silent,e.pattern=r,e.strict=!1!==s.strict,e.realpath=!!s.realpath,e.realpathCache=s.realpathCache||Object.create(null),e.follow=!!s.follow,e.dot=!!s.dot,e.mark=!!s.mark,e.nodir=!!s.nodir,e.nodir&&(e.mark=!0);e.sync=!!s.sync,e.nounique=!!s.nounique,e.nonull=!!s.nonull,e.nosort=!!s.nosort,e.nocase=!!s.nocase,e.stat=!!s.stat,e.noprocess=!!s.noprocess,e.absolute=!!s.absolute,e.maxLength=s.maxLength||1/0,e.cache=s.cache||Object.create(null),e.statCache=s.statCache||Object.create(null),e.symlinks=s.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]);e.ignore.length&&(e.ignore=e.ignore.map(c))}(e,s),e.changedCwd=!1;var u=t.cwd();n(s,"cwd")?(e.cwd=i.resolve(s.cwd),e.changedCwd=e.cwd!==u):e.cwd=u;e.root=s.root||i.resolve(e.cwd,"/"),e.root=i.resolve(e.root),"win32"===t.platform&&(e.root=e.root.replace(/\\/g,"/"));e.cwdAbs=o(e.cwd)?e.cwd:h(e,e.cwd),"win32"===t.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/"));e.nomount=!!s.nomount,s.nonegate=!0,s.nocomment=!0,e.minimatch=new a(r,s),e.options=e.minimatch.options},r.ownProp=n,r.makeAbs=h,r.finish=function(e){for(var t=e.nounique,r=t?[]:Object.create(null),n=0,i=e.matches.length;n<i;n++){var s=e.matches[n];if(s&&0!==Object.keys(s).length){var o=Object.keys(s);t?r.push.apply(r,o):o.forEach(function(e){r[e]=!0})}else if(e.nonull){var a=e.minimatch.globSet[n];t?r.push(a):r[a]=!0}}t||(r=Object.keys(r));e.nosort||(r=r.sort(e.nocase?u:l));if(e.mark){for(var n=0;n<r.length;n++)r[n]=e._mark(r[n]);e.nodir&&(r=r.filter(function(t){var r=!/\/$/.test(t),n=e.cache[t]||e.cache[h(e,t)];return r&&n&&(r="DIR"!==n&&!Array.isArray(n)),r}))}e.ignore.length&&(r=r.filter(function(t){return!p(e,t)}));e.found=r},r.mark=function(e,t){var r=h(e,t),n=e.cache[r],i=t;if(n){var s="DIR"===n||Array.isArray(n),o="/"===t.slice(-1);if(s&&!o?i+="/":!s&&o&&(i=i.slice(0,-1)),i!==t){var a=h(e,i);e.statCache[a]=e.statCache[r],e.cache[a]=e.cache[r]}}return i},r.isIgnored=p,r.childrenIgnored=function(e,t){return!!e.ignore.length&&e.ignore.some(function(e){return!(!e.gmatcher||!e.gmatcher.match(t))})};var i=e("path"),s=e("minimatch"),o=e("path-is-absolute"),a=s.Minimatch;function u(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}function l(e,t){return e.localeCompare(t)}function c(e){var t=null;if("/**"===e.slice(-3)){var r=e.replace(/(\/\*\*)+$/,"");t=new a(r,{dot:!0})}return{matcher:new a(e,{dot:!0}),gmatcher:t}}function h(e,r){var n=r;return n="/"===r.charAt(0)?i.join(e.root,r):o(r)||""===r?r:e.changedCwd?i.resolve(e.cwd,r):i.resolve(r),"win32"===t.platform&&(n=n.replace(/\\/g,"/")),n}function p(e,t){return!!e.ignore.length&&e.ignore.some(function(e){return e.matcher.match(t)||!(!e.gmatcher||!e.gmatcher.match(t))})}}).call(this,e("_process"))},{_process:437,minimatch:385,path:404,"path-is-absolute":405}],172:[function(e,t,r){(function(r){t.exports=_;var n=e("fs"),i=e("fs.realpath"),s=e("minimatch"),o=(s.Minimatch,e("inherits")),a=e("events").EventEmitter,u=e("path"),l=e("assert"),c=e("path-is-absolute"),h=e("./sync.js"),p=e("./common.js"),f=(p.alphasort,p.alphasorti,p.setopts),d=p.ownProp,m=e("inflight"),g=(e("util"),p.childrenIgnored),v=p.isIgnored,y=e("once");function _(e,t,r){if("function"==typeof t&&(r=t,t={}),t||(t={}),t.sync){if(r)throw new TypeError("callback provided to sync glob");return h(e,t)}return new x(e,t,r)}_.sync=h;var b=_.GlobSync=h.GlobSync;function x(e,t,n){if("function"==typeof t&&(n=t,t=null),t&&t.sync){if(n)throw new TypeError("callback provided to sync glob");return new b(e,t)}if(!(this instanceof x))return new x(e,t,n);f(this,e,t),this._didRealPath=!1;var i=this.minimatch.set.length;this.matches=new Array(i),"function"==typeof n&&(n=y(n),this.on("error",n),this.on("end",function(e){n(null,e)}));var s=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===i)return u();for(var o=!0,a=0;a<i;a++)this._process(this.minimatch.set[a],a,!1,u);function u(){--s._processing,s._processing<=0&&(o?r.nextTick(function(){s._finish()}):s._finish())}o=!1}_.glob=_,_.hasMagic=function(e,t){var r=function(e,t){if(null===t||"object"!=typeof t)return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}({},t);r.noprocess=!0;var n=new x(e,r).minimatch.set;if(!e)return!1;if(n.length>1)return!0;for(var i=0;i<n[0].length;i++)if("string"!=typeof n[0][i])return!0;return!1},_.Glob=x,o(x,a),x.prototype._finish=function(){if(l(this instanceof x),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();p.finish(this),this.emit("end",this.found)}},x.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var t=this,r=0;r<this.matches.length;r++)this._realpathSet(r,n)}function n(){0==--e&&t._finish()}},x.prototype._realpathSet=function(e,t){var r=this.matches[e];if(!r)return t();var n=Object.keys(r),s=this,o=n.length;if(0===o)return t();var a=this.matches[e]=Object.create(null);n.forEach(function(r,n){r=s._makeAbs(r),i.realpath(r,s.realpathCache,function(n,i){n?"stat"===n.syscall?a[r]=!0:s.emit("error",n):a[i]=!0,0==--o&&(s.matches[e]=a,t())})})},x.prototype._mark=function(e){return p.mark(this,e)},x.prototype._makeAbs=function(e){return p.makeAbs(this,e)},x.prototype.abort=function(){this.aborted=!0,this.emit("abort")},x.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},x.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(t=0;t<n.length;t++){var i=n[t];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}},x.prototype._process=function(e,t,r,n){if(l(this instanceof x),l("function"==typeof n),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([e,t,r,n]);else{for(var i,o=0;"string"==typeof e[o];)o++;switch(o){case e.length:return void this._processSimple(e.join("/"),t,n);case 0:i=null;break;default:i=e.slice(0,o).join("/")}var a,u=e.slice(o);null===i?a=".":c(i)||c(e.join("/"))?(i&&c(i)||(i="/"+i),a=i):a=i;var h=this._makeAbs(a);if(g(this,a))return n();u[0]===s.GLOBSTAR?this._processGlobStar(i,a,h,u,t,r,n):this._processReaddir(i,a,h,u,t,r,n)}},x.prototype._processReaddir=function(e,t,r,n,i,s,o){var a=this;this._readdir(r,s,function(u,l){return a._processReaddir2(e,t,r,n,i,s,l,o)})},x.prototype._processReaddir2=function(e,t,r,n,i,s,o,a){if(!o)return a();for(var l=n[0],c=!!this.minimatch.negate,h=l._glob,p=this.dot||"."===h.charAt(0),f=[],d=0;d<o.length;d++){if("."!==(g=o[d]).charAt(0)||p)(c&&!e?!g.match(l):g.match(l))&&f.push(g)}var m=f.length;if(0===m)return a();if(1===n.length&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(d=0;d<m;d++){var g=f[d];e&&(g="/"!==e?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=u.join(this.root,g)),this._emitMatch(i,g)}return a()}n.shift();for(d=0;d<m;d++){g=f[d];e&&(g="/"!==e?e+"/"+g:e+g),this._process([g].concat(n),i,s,a)}a()},x.prototype._emitMatch=function(e,t){if(!this.aborted&&!v(this,t))if(this.paused)this._emitQueue.push([e,t]);else{var r=c(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=r),!this.matches[e][t]){if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.matches[e][t]=!0;var i=this.statCache[r];i&&this.emit("stat",t,i),this.emit("match",t)}}},x.prototype._readdirInGlobStar=function(e,t){if(!this.aborted){if(this.follow)return this._readdir(e,!1,t);var r=this,i=m("lstat\0"+e,function(n,i){if(n&&"ENOENT"===n.code)return t();var s=i&&i.isSymbolicLink();r.symlinks[e]=s,s||!i||i.isDirectory()?r._readdir(e,!1,t):(r.cache[e]="FILE",t())});i&&n.lstat(e,i)}},x.prototype._readdir=function(e,t,r){if(!this.aborted&&(r=m("readdir\0"+e+"\0"+t,r))){if(t&&!d(this.symlinks,e))return this._readdirInGlobStar(e,r);if(d(this.cache,e)){var i=this.cache[e];if(!i||"FILE"===i)return r();if(Array.isArray(i))return r(null,i)}n.readdir(e,function(e,t,r){return function(n,i){n?e._readdirError(t,n,r):e._readdirEntries(t,i,r)}}(this,e,r))}},x.prototype._readdirEntries=function(e,t,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var i=t[n];i="/"===e?e+i:e+"/"+i,this.cache[i]=!0}return this.cache[e]=t,r(null,t)}},x.prototype._readdirError=function(e,t,r){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=t.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t)}return r()}},x.prototype._processGlobStar=function(e,t,r,n,i,s,o){var a=this;this._readdir(r,s,function(u,l){a._processGlobStar2(e,t,r,n,i,s,l,o)})},x.prototype._processGlobStar2=function(e,t,r,n,i,s,o,a){if(!o)return a();var u=n.slice(1),l=e?[e]:[],c=l.concat(u);this._process(c,i,!1,a);var h=this.symlinks[r],p=o.length;if(h&&s)return a();for(var f=0;f<p;f++){if("."!==o[f].charAt(0)||this.dot){var d=l.concat(o[f],u);this._process(d,i,!0,a);var m=l.concat(o[f],n);this._process(m,i,!0,a)}}a()},x.prototype._processSimple=function(e,t,r){var n=this;this._stat(e,function(i,s){n._processSimple2(e,t,i,s,r)})},x.prototype._processSimple2=function(e,t,n,i,s){if(this.matches[t]||(this.matches[t]=Object.create(null)),!i)return s();if(e&&c(e)&&!this.nomount){var o=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=u.join(this.root,e):(e=u.resolve(this.root,e),o&&(e+="/"))}"win32"===r.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),s()},x.prototype._stat=function(e,t){var r=this._makeAbs(e),i="/"===e.slice(-1);if(e.length>this.maxLength)return t();if(!this.stat&&d(this.cache,r)){var s=this.cache[r];if(Array.isArray(s)&&(s="DIR"),!i||"DIR"===s)return t(null,s);if(i&&"FILE"===s)return t()}var o=this.statCache[r];if(void 0!==o){if(!1===o)return t(null,o);var a=o.isDirectory()?"DIR":"FILE";return i&&"FILE"===a?t():t(null,a,o)}var u=this,l=m("stat\0"+r,function(i,s){if(s&&s.isSymbolicLink())return n.stat(r,function(n,i){n?u._stat2(e,r,null,s,t):u._stat2(e,r,n,i,t)});u._stat2(e,r,i,s,t)});l&&n.lstat(r,l)},x.prototype._stat2=function(e,t,r,n,i){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[t]=!1,i();var s="/"===e.slice(-1);if(this.statCache[t]=n,"/"===t.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var o=!0;return n&&(o=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,s&&"FILE"===o?i():i(null,o,n)}}).call(this,e("_process"))},{"./common.js":171,"./sync.js":173,_process:437,assert:292,events:300,fs:298,"fs.realpath":121,inflight:358,inherits:359,minimatch:385,once:399,path:404,"path-is-absolute":405,util:523}],173:[function(e,t,r){(function(r){t.exports=d,d.GlobSync=m;var n=e("fs"),i=e("fs.realpath"),s=e("minimatch"),o=(s.Minimatch,e("./glob.js").Glob,e("util"),e("path")),a=e("assert"),u=e("path-is-absolute"),l=e("./common.js"),c=(l.alphasort,l.alphasorti,l.setopts),h=l.ownProp,p=l.childrenIgnored,f=l.isIgnored;function d(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new m(e,t).found}function m(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof m))return new m(e,t);if(c(this,e,t),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}m.prototype._finish=function(){if(a(this instanceof m),this.realpath){var e=this;this.matches.forEach(function(t,r){var n=e.matches[r]=Object.create(null);for(var s in t)try{s=e._makeAbs(s),n[i.realpathSync(s,e.realpathCache)]=!0}catch(t){if("stat"!==t.syscall)throw t;n[e._makeAbs(s)]=!0}})}l.finish(this)},m.prototype._process=function(e,t,r){a(this instanceof m);for(var n,i=0;"string"==typeof e[i];)i++;switch(i){case e.length:return void this._processSimple(e.join("/"),t);case 0:n=null;break;default:n=e.slice(0,i).join("/")}var o,l=e.slice(i);null===n?o=".":u(n)||u(e.join("/"))?(n&&u(n)||(n="/"+n),o=n):o=n;var c=this._makeAbs(o);p(this,o)||(l[0]===s.GLOBSTAR?this._processGlobStar(n,o,c,l,t,r):this._processReaddir(n,o,c,l,t,r))},m.prototype._processReaddir=function(e,t,r,n,i,s){var a=this._readdir(r,s);if(a){for(var u=n[0],l=!!this.minimatch.negate,c=u._glob,h=this.dot||"."===c.charAt(0),p=[],f=0;f<a.length;f++){if("."!==(g=a[f]).charAt(0)||h)(l&&!e?!g.match(u):g.match(u))&&p.push(g)}var d=p.length;if(0!==d)if(1!==n.length||this.mark||this.stat){n.shift();for(f=0;f<d;f++){var m;g=p[f];m=e?[e,g]:[g],this._process(m.concat(n),i,s)}}else{this.matches[i]||(this.matches[i]=Object.create(null));for(var f=0;f<d;f++){var g=p[f];e&&(g="/"!==e.slice(-1)?e+"/"+g:e+g),"/"!==g.charAt(0)||this.nomount||(g=o.join(this.root,g)),this._emitMatch(i,g)}}}},m.prototype._emitMatch=function(e,t){if(!f(this,t)){var r=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=r),!this.matches[e][t]){if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}},m.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,r;try{r=n.lstatSync(e)}catch(e){if("ENOENT"===e.code)return null}var i=r&&r.isSymbolicLink();return this.symlinks[e]=i,i||!r||r.isDirectory()?t=this._readdir(e,!1):this.cache[e]="FILE",t},m.prototype._readdir=function(e,t){if(t&&!h(this.symlinks,e))return this._readdirInGlobStar(e);if(h(this.cache,e)){var r=this.cache[e];if(!r||"FILE"===r)return null;if(Array.isArray(r))return r}try{return this._readdirEntries(e,n.readdirSync(e))}catch(t){return this._readdirError(e,t),null}},m.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var n=t[r];n="/"===e?e+n:e+"/"+n,this.cache[n]=!0}return this.cache[e]=t,t},m.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);throw n.path=this.cwd,n.code=t.code,n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error("glob error",t)}},m.prototype._processGlobStar=function(e,t,r,n,i,s){var o=this._readdir(r,s);if(o){var a=n.slice(1),u=e?[e]:[],l=u.concat(a);this._process(l,i,!1);var c=o.length;if(!this.symlinks[r]||!s)for(var h=0;h<c;h++){if("."!==o[h].charAt(0)||this.dot){var p=u.concat(o[h],a);this._process(p,i,!0);var f=u.concat(o[h],n);this._process(f,i,!0)}}}},m.prototype._processSimple=function(e,t){var n=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),n){if(e&&u(e)&&!this.nomount){var i=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=o.join(this.root,e):(e=o.resolve(this.root,e),i&&(e+="/"))}"win32"===r.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}},m.prototype._stat=function(e){var t=this._makeAbs(e),r="/"===e.slice(-1);if(e.length>this.maxLength)return!1;if(!this.stat&&h(this.cache,t)){var i=this.cache[t];if(Array.isArray(i)&&(i="DIR"),!r||"DIR"===i)return i;if(r&&"FILE"===i)return!1}var s=this.statCache[t];if(!s){var o;try{o=n.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(o&&o.isSymbolicLink())try{s=n.statSync(t)}catch(e){s=o}else s=o}this.statCache[t]=s;i=!0;return s&&(i=s.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||i,(!r||"FILE"!==i)&&i},m.prototype._mark=function(e){return l.mark(this,e)},m.prototype._makeAbs=function(e){return l.makeAbs(this,e)}}).call(this,e("_process"))},{"./common.js":171,"./glob.js":172,_process:437,assert:292,fs:298,"fs.realpath":121,minimatch:385,path:404,"path-is-absolute":405,util:523}],174:[function(e,t,r){(function(e){function r(e){return Array.isArray(e)?e:[e]}const n=/^\s+$/,i=/^\\!/,s=/^\\#/,o=/\r?\n/g,a=/^\.*\/|^\.+$/,u="/",l="undefined"!=typeof Symbol?Symbol.for("node-ignore"):"node-ignore",c=(e,t,r)=>Object.defineProperty(e,t,{value:r}),h=/([0-z])-([0-z])/g,p=[[/\\?\s+$/,e=>0===e.indexOf("\\")?" ":""],[/\\\s/g,()=>" "],[/[\\^$.|*+(){]/g,e=>`\\${e}`],[/\[([^\]/]*)($|\])/g,(e,t,r)=>"]"===r?`[${(e=>e.replace(h,(e,t,r)=>t.charCodeAt(0)<=r.charCodeAt(0)?e:""))(t)}]`:`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,r)=>t+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)\\\*(?=.+)/g,(e,t)=>`${t}[^\\/]*`],[/(\^|\\\/)?\\\*$/,(e,t)=>{return`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`}],[/\\\\\\/g,()=>"\\"]],f=Object.create(null),d=e=>"string"==typeof e,m=e=>e&&d(e)&&!n.test(e)&&0!==e.indexOf("#"),g=e=>e.split(o);const v=(e,t)=>{const r=e;let n=!1;return 0===e.indexOf("!")&&(n=!0,e=e.substr(1)),new class{constructor(e,t,r,n){this.origin=e,this.pattern=t,this.negative=r,this.regex=n}}(r,e=e.replace(i,"!").replace(s,"#"),n,((e,t,r)=>{const n=f[e];if(n)return n;const i=p.reduce((t,r)=>t.replace(r[0],r[1].bind(e)),e);return f[e]=r?new RegExp(i,"i"):new RegExp(i)})(e,0,t))},y=(e,t)=>{throw new t(e)},_=(e,t,r)=>{if(!d(e))return r(`path must be a string, but got \`${t}\``,TypeError);if(!e)return r("path must not be empty",TypeError);if(_.isNotRelative(e)){return r(`path should be a ${"`path.relative()`d"} string, but got "${t}"`,RangeError)}return!0},b=e=>a.test(e);_.isNotRelative=b,_.convert=(e=>e);const x=e=>new class{constructor({ignorecase:e=!0}={}){this._rules=[],this._ignorecase=e,c(this,l,!0),this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[l])return this._rules=this._rules.concat(e._rules),void(this._added=!0);if(m(e)){const t=v(e,this._ignorecase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,r(d(e)?g(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let r=!1,n=!1;return this._rules.forEach(i=>{const{negative:s}=i;n===s&&r!==n||s&&!r&&!n&&!t||i.regex.test(e)&&(r=!s,n=s)}),{ignored:r,unignored:n}}_test(e,t,r,n){const i=e&&_.convert(e);return _(i,e,y),this._t(i,t,r,n)}_t(e,t,r,n){if(e in t)return t[e];if(n||(n=e.split(u)),n.pop(),!n.length)return t[e]=this._testOne(e,r);const i=this._t(n.join(u)+u,t,r,n);return t[e]=i.ignored?i:this._testOne(e,r)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return r(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}(e),w=()=>!1;if(x.isPathValid=(e=>_(e&&_.convert(e),e,w)),x.default=x,t.exports=x,void 0!==e&&(e.env&&e.env.IGNORE_TEST_WIN32||"win32"===e.platform)){const e=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");_.convert=e;const t=/^[a-z]:\//i;_.isNotRelative=(e=>t.test(e)||b(e))}}).call(this,e("_process"))},{_process:437}],175:[function(e,t,r){"use strict";const{Transform:n}=e("stream");class i extends n{constructor(){super({objectMode:!0})}}t.exports={FilterStream:class extends i{constructor(e){super(),this._filter=e}_transform(e,t,r){this._filter(e)&&this.push(e),r()}},UniqueStream:class extends i{constructor(){super(),this._pushed=new Set}_transform(e,t,r){this._pushed.has(e)||(this.push(e),this._pushed.add(e)),r()}}}},{stream:503}],176:[function(e,t,r){t.exports=function(e){var t,r,E,T=0,A=0,S=u,k=[],C=[],I=1,R=0,L=0,O=!1,M=!1,P="",B=s,N=n;"300 es"===(e=e||{}).version&&(B=a,N=o);for(var D={},F={},T=0;T<B.length;T++)D[B[T]]=!0;for(var T=0;T<N.length;T++)F[N[T]]=!0;return function(e){return C=[],null!==e?function(e){T=0,e.toString&&(e=e.toString());var r;P+=e.replace(/\r\n/g,"\n"),E=P.length;for(;t=P[T],T<E;){switch(r=T,S){case c:T=G();break;case h:case p:T=V();break;case f:T=z();break;case d:T=K();break;case x:T=H();break;case m:T=q();break;case l:T=X();break;case _:T=$();break;case u:T=U()}if(r!==T)switch(P[r]){case"\n":R=0,++I;break;default:++R}}return A+=T,P=P.slice(T),C}(e):function(e){k.length&&j(k.join(""));return S=b,j("(eof)"),C}()};function j(e){e.length&&C.push({type:w[S],data:e,position:L,line:I,column:R})}function U(){return k=k.length?[]:k,"/"===r&&"*"===t?(L=A+T-1,S=c,r=t,T+1):"/"===r&&"/"===t?(L=A+T-1,S=h,r=t,T+1):"#"===t?(S=p,L=A+T,T):/\s/.test(t)?(S=_,L=A+T,T):(O=/\d/.test(t),M=/[^\w_]/.test(t),L=A+T,S=O?d:M?f:l,T)}function $(){return/[^\s]/g.test(t)?(j(k.join("")),S=u,T):(k.push(t),r=t,T+1)}function V(){return"\r"!==t&&"\n"!==t||"\\"===r?(k.push(t),r=t,T+1):(j(k.join("")),S=u,T)}function G(){return"/"===t&&"*"===r?(k.push(t),j(k.join("")),S=u,T+1):(k.push(t),r=t,T+1)}function z(){if("."===r&&/\d/.test(t))return S=m,T;if("/"===r&&"*"===t)return S=c,T;if("/"===r&&"/"===t)return S=h,T;if("."===t&&k.length){for(;W(k););return S=m,T}if(";"===t||")"===t||"("===t){if(k.length)for(;W(k););return j(t),S=u,T+1}var e=2===k.length&&"="!==t;if(/[\w_\d\s]/.test(t)||e){for(;W(k););return S=u,T}return k.push(t),r=t,T+1}function W(e){for(var t,r,n=0;;){if(t=i.indexOf(e.slice(0,e.length+n).join("")),r=i[t],-1===t){if(n--+e.length>0)continue;r=e.slice(0,1).join("")}return j(r),L+=r.length,(k=k.slice(r.length)).length}}function H(){return/[^a-fA-F0-9]/.test(t)?(j(k.join("")),S=u,T):(k.push(t),r=t,T+1)}function K(){return"."===t?(k.push(t),S=m,r=t,T+1):/[eE]/.test(t)?(k.push(t),S=m,r=t,T+1):"x"===t&&1===k.length&&"0"===k[0]?(S=x,k.push(t),r=t,T+1):/[^\d]/.test(t)?(j(k.join("")),S=u,T):(k.push(t),r=t,T+1)}function q(){return"f"===t&&(k.push(t),r=t,T+=1),/[eE]/.test(t)?(k.push(t),r=t,T+1):("-"!==t&&"+"!==t||!/[eE]/.test(r))&&/[^\d]/.test(t)?(j(k.join("")),S=u,T):(k.push(t),r=t,T+1)}function X(){if(/[^\d\w_]/.test(t)){var e=k.join("");return S=F[e]?y:D[e]?v:g,j(k.join("")),S=u,T}return k.push(t),r=t,T+1}};var n=e("./lib/literals"),i=e("./lib/operators"),s=e("./lib/builtins"),o=e("./lib/literals-300es"),a=e("./lib/builtins-300es"),u=999,l=9999,c=0,h=1,p=2,f=3,d=4,m=5,g=6,v=7,y=8,_=9,b=10,x=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":178,"./lib/builtins-300es":177,"./lib/literals":180,"./lib/literals-300es":179,"./lib/operators":181}],177:[function(e,t,r){var n=e("./builtins");n=n.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),t.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":178}],178:[function(e,t,r){t.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],179:[function(e,t,r){var n=e("./literals");t.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":180}],180:[function(e,t,r){t.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],181:[function(e,t,r){t.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],182:[function(e,t,r){var n=e("./index");t.exports=function(e,t){var r=n(t),i=[];return i=(i=i.concat(r(e))).concat(r(null))}},{"./index":176}],183:[function(e,t,r){function n(e){const t=new Array(e.length);for(let r=0;r<e.length;r++){const n=e[r];n.toArray?t[r]=n.toArray():t[r]=n}return t}function i(e){e.setOutput=(t=>{e.output=o(t),e.graphical&&s(e)}),e.toJSON=(()=>{throw new Error("Not usable with gpuMock")}),e.setConstants=(t=>(e.constants=t,e)),e.setGraphical=(t=>(e.graphical=t,e)),e.setCanvas=(t=>(e.canvas=t,e)),e.setContext=(t=>(e.context=t,e)),e.destroy=(()=>{}),e.validateSettings=(()=>{}),e.graphical&&e.output&&s(e),e.exec=function(){return new Promise((t,r)=>{try{t(e.apply(e,arguments))}catch(e){r(e)}})},e.getPixels=(t=>{const{x:r,y:n}=e.output;return t?function(e,t,r){const n=r/2|0,i=4*t,s=new Uint8ClampedArray(4*t),o=e.slice(0);for(let e=0;e<n;++e){const t=e*i,n=(r-e-1)*i;s.set(o.subarray(t,t+i)),o.copyWithin(t,n,n+i),o.set(s,n)}return o}(e._imageData.data,r,n):e._imageData.data.slice(0)}),e.color=function(t,r,n,i){void 0===i&&(i=1),t=Math.floor(255*t),r=Math.floor(255*r),n=Math.floor(255*n),i=Math.floor(255*i);const s=e.output.x,o=e.output.y,a=e.thread.x+(o-e.thread.y-1)*s;e._colorData[4*a+0]=t,e._colorData[4*a+1]=r,e._colorData[4*a+2]=n,e._colorData[4*a+3]=i};const t=()=>e,r=["setWarnVarUsage","setArgumentTypes","setTactic","setOptimizeFloatMemory","setDebug","setLoopMaxIterations","setConstantTypes","setFunctions","setNativeFunctions","setInjectedNative","setPipeline","setPrecision","setOutputToTexture","setImmutable","setStrictIntegers","setDynamicOutput","setHardcodeConstants","setDynamicArguments","setUseLegacyEncoder","setWarnVarUsage","addSubKernel"];for(let n=0;n<r.length;n++)e[r[n]]=t;return e}function s(e){const{x:t,y:r}=e.output;if(e.context&&e.context.createImageData){const n=new Uint8ClampedArray(t*r*4);e._imageData=e.context.createImageData(t,r),e._colorData=n}else{const n=new Uint8ClampedArray(t*r*4);e._imageData={data:n},e._colorData=n}}function o(e){let t=null;if(e.length)if(3===e.length){const[r,n,i]=e;t={x:r,y:n,z:i}}else if(2===e.length){const[r,n]=e;t={x:r,y:n}}else{const[r]=e;t={x:r}}else t=e;return t}t.exports={gpuMock:function(e,t={}){const r=t.output?o(t.output):null;function s(){return s.output.z?function(){const e=n(arguments),t=new Array(this.output.z);for(let r=0;r<this.output.z;r++){const n=new Array(this.output.y);for(let t=0;t<this.output.y;t++){const i=new Float32Array(this.output.x);for(let n=0;n<this.output.x;n++)this.thread.x=n,this.thread.y=t,this.thread.z=r,i[n]=this._fn.apply(this,e);n[t]=i}t[r]=n}return t}.apply(s,arguments):s.output.y?s.graphical?function(){const e=n(arguments);for(let t=0;t<this.output.y;t++)for(let r=0;r<this.output.x;r++)this.thread.x=r,this.thread.y=t,this.thread.z=0,this._fn.apply(this,e)}.apply(s,arguments):function(){const e=n(arguments),t=new Array(this.output.y);for(let r=0;r<this.output.y;r++){const n=new Float32Array(this.output.x);for(let t=0;t<this.output.x;t++)this.thread.x=t,this.thread.y=r,this.thread.z=0,n[t]=this._fn.apply(this,e);t[r]=n}return t}.apply(s,arguments):function(){const e=n(arguments),t=new Float32Array(this.output.x);for(let r=0;r<this.output.x;r++)this.thread.x=r,this.thread.y=0,this.thread.z=0,t[r]=this._fn.apply(this,e);return t}.apply(s,arguments)}return s._fn=e,s.constants=t.constants||null,s.context=t.context||null,s.canvas=t.canvas||null,s.graphical=t.graphical||!1,s._imageData=null,s._colorData=null,s.output=r,s.thread={x:0,y:0,z:0},i(s)}}},{}],184:[function(e,t,r){const{utils:n}=e("./utils");t.exports={alias:function(e,t){const r=t.toString();return new Function(`return function ${e} (${n.getArgumentNamesFromString(r).join(", ")}) {\n ${n.getFunctionBodyFromString(r)}\n}`)()}}},{"./utils":291}],185:[function(e,t,r){const{FunctionNode:n}=e("../function-node");t.exports={CPUFunctionNode:class extends n{astFunction(e,t){if(!this.isRootKernel){t.push("function"),t.push(" "),t.push(this.name),t.push("(");for(let e=0;e<this.argumentNames.length;++e){const r=this.argumentNames[e];e>0&&t.push(", "),t.push("user_"),t.push(r)}t.push(") {\n")}for(let r=0;r<e.body.body.length;++r)this.astGeneric(e.body.body[r],t),t.push("\n");return this.isRootKernel||t.push("}\n"),t}astReturnStatement(e,t){const r=this.returnType||this.getType(e.argument);return this.returnType||(this.returnType=r),this.isRootKernel?(t.push(this.leadingReturnStatement),this.astGeneric(e.argument,t),t.push(";\n"),t.push(this.followingReturnStatement),t.push("continue;\n")):this.isSubKernel?(t.push(`subKernelResult_${this.name} = `),this.astGeneric(e.argument,t),t.push(";"),t.push(`return subKernelResult_${this.name};`)):(t.push("return "),this.astGeneric(e.argument,t),t.push(";")),t}astLiteral(e,t){if(isNaN(e.value))throw this.astErrorOutput("Non-numeric literal not supported : "+e.value,e);return t.push(e.value),t}astBinaryExpression(e,t){return t.push("("),this.astGeneric(e.left,t),t.push(e.operator),this.astGeneric(e.right,t),t.push(")"),t}astIdentifierExpression(e,t){if("Identifier"!==e.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",e);switch(e.name){case"Infinity":t.push("Infinity");break;default:this.constants&&this.constants.hasOwnProperty(e.name)?t.push("constants_"+e.name):t.push("user_"+e.name)}return t}astForStatement(e,t){if("ForStatement"!==e.type)throw this.astErrorOutput("Invalid for statement",e);const r=[],n=[],i=[],s=[];let o=null;if(e.init){this.pushState("in-for-loop-init"),this.astGeneric(e.init,r);for(let e=0;e<r.length;e++)r[e].includes&&r[e].includes(",")&&(o=!1);this.popState("in-for-loop-init")}else o=!1;if(e.test?this.astGeneric(e.test,n):o=!1,e.update?this.astGeneric(e.update,i):o=!1,e.body&&(this.pushState("loop-body"),this.astGeneric(e.body,s),this.popState("loop-body")),null===o&&(o=this.isSafe(e.init)&&this.isSafe(e.test)),o)t.push(`for (${r.join("")};${n.join("")};${i.join("")}){\n`),t.push(s.join("")),t.push("}\n");else{const e=this.getInternalVariableName("safeI");r.length>0&&t.push(r.join(""),";\n"),t.push(`for (let ${e}=0;${e}<LOOP_MAX;${e}++){\n`),n.length>0&&t.push(`if (!${n.join("")}) break;\n`),t.push(s.join("")),t.push(`\n${i.join("")};`),t.push("}\n")}return t}astWhileStatement(e,t){if("WhileStatement"!==e.type)throw this.astErrorOutput("Invalid while statement",e);return t.push("for (let i = 0; i < LOOP_MAX; i++) {"),t.push("if ("),this.astGeneric(e.test,t),t.push(") {\n"),this.astGeneric(e.body,t),t.push("} else {\n"),t.push("break;\n"),t.push("}\n"),t.push("}\n"),t}astDoWhileStatement(e,t){if("DoWhileStatement"!==e.type)throw this.astErrorOutput("Invalid while statement",e);return t.push("for (let i = 0; i < LOOP_MAX; i++) {"),this.astGeneric(e.body,t),t.push("if (!"),this.astGeneric(e.test,t),t.push(") {\n"),t.push("break;\n"),t.push("}\n"),t.push("}\n"),t}astAssignmentExpression(e,t){const r=this.getDeclaration(e.left);if(r&&!r.assignable)throw this.astErrorOutput(`Variable ${e.left.name} is not assignable here`,e);return this.astGeneric(e.left,t),t.push(e.operator),this.astGeneric(e.right,t),t}astBlockStatement(e,t){if(this.isState("loop-body")){this.pushState("block-body");for(let r=0;r<e.body.length;r++)this.astGeneric(e.body[r],t);this.popState("block-body")}else{t.push("{\n");for(let r=0;r<e.body.length;r++)this.astGeneric(e.body[r],t);t.push("}\n")}return t}astVariableDeclaration(e,t){t.push(`${e.kind} `);const{declarations:r}=e;for(let e=0;e<r.length;e++){e>0&&t.push(",");const n=r[e],i=this.getDeclaration(n.id);i.valueType||(i.valueType=this.getType(n.init)),this.astGeneric(n,t)}return this.isState("in-for-loop-init")||t.push(";"),t}astIfStatement(e,t){return t.push("if ("),this.astGeneric(e.test,t),t.push(")"),"BlockStatement"===e.consequent.type?this.astGeneric(e.consequent,t):(t.push(" {\n"),this.astGeneric(e.consequent,t),t.push("\n}\n")),e.alternate&&(t.push("else "),"BlockStatement"===e.alternate.type||"IfStatement"===e.alternate.type?this.astGeneric(e.alternate,t):(t.push(" {\n"),this.astGeneric(e.alternate,t),t.push("\n}\n"))),t}astSwitchStatement(e,t){const{discriminant:r,cases:n}=e;t.push("switch ("),this.astGeneric(r,t),t.push(") {\n");for(let e=0;e<n.length;e++)null!==n[e].test?(t.push("case "),this.astGeneric(n[e].test,t),t.push(":\n"),n[e].consequent&&n[e].consequent.length>0&&(this.astGeneric(n[e].consequent,t),t.push("break;\n"))):(t.push("default:\n"),this.astGeneric(n[e].consequent,t),n[e].consequent&&n[e].consequent.length>0&&t.push("break;\n"));t.push("\n}")}astThisExpression(e,t){return t.push("_this"),t}astMemberExpression(e,t){const{signature:r,type:n,property:i,xProperty:s,yProperty:o,zProperty:a,name:u,origin:l}=this.getMemberExpressionDetails(e);switch(r){case"this.thread.value":return t.push(`_this.thread.${u}`),t;case"this.output.value":switch(u){case"x":t.push("outputX");break;case"y":t.push("outputY");break;case"z":t.push("outputZ");break;default:throw this.astErrorOutput("Unexpected expression",e)}return t;case"value":throw this.astErrorOutput("Unexpected expression",e);case"value[]":case"value[][]":case"value[][][]":case"value.value":if("Math"===l)return t.push(Math[u]),t;switch(i){case"r":return t.push(`user_${u}[0]`),t;case"g":return t.push(`user_${u}[1]`),t;case"b":return t.push(`user_${u}[2]`),t;case"a":return t.push(`user_${u}[3]`),t}break;case"this.constants.value":case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":break;case"fn()[]":return this.astGeneric(e.object,t),t.push("["),this.astGeneric(e.property,t),t.push("]"),t;case"fn()[][]":return this.astGeneric(e.object.object,t),t.push("["),this.astGeneric(e.object.property,t),t.push("]"),t.push("["),this.astGeneric(e.property,t),t.push("]"),t;default:throw this.astErrorOutput("Unexpected expression",e)}if(!e.computed)switch(n){case"Number":case"Integer":case"Float":case"Boolean":return t.push(`${l}_${u}`),t}const c=`${l}_${u}`;switch(n){case"Array(2)":case"Array(3)":case"Array(4)":case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":case"HTMLImageArray":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"HTMLImage":default:let e,r;if("constants"===l){const t=this.constants[u];e=(r="Input"===this.constantTypes[u])?t.size:null}else e=(r=this.isInput(u))?this.argumentSizes[this.argumentNames.indexOf(u)]:null;t.push(`${c}`),a&&o?r?(t.push("[("),this.astGeneric(a,t),t.push(`*${this.dynamicArguments?"(outputY * outputX)":e[1]*e[0]})+(`),this.astGeneric(o,t),t.push(`*${this.dynamicArguments?"outputX":e[0]})+`),this.astGeneric(s,t),t.push("]")):(t.push("["),this.astGeneric(a,t),t.push("]"),t.push("["),this.astGeneric(o,t),t.push("]"),t.push("["),this.astGeneric(s,t),t.push("]")):o?r?(t.push("[("),this.astGeneric(o,t),t.push(`*${this.dynamicArguments?"outputX":e[0]})+`),this.astGeneric(s,t),t.push("]")):(t.push("["),this.astGeneric(o,t),t.push("]"),t.push("["),this.astGeneric(s,t),t.push("]")):void 0!==s&&(t.push("["),this.astGeneric(s,t),t.push("]"))}return t}astCallExpression(e,t){if("CallExpression"!==e.type)throw this.astErrorOutput("Unknown CallExpression",e);let r=this.astMemberExpressionUnroll(e.callee);this.calledFunctions.indexOf(r)<0&&this.calledFunctions.push(r),this.isAstMathFunction(e),this.onFunctionCall&&this.onFunctionCall(this.name,r,e.arguments),t.push(r),t.push("(");const n=this.lookupFunctionArgumentTypes(r)||[];for(let i=0;i<e.arguments.length;++i){const s=e.arguments[i];let o=this.getType(s);n[i]||this.triggerImplyArgumentType(r,i,o,this),i>0&&t.push(", "),this.astGeneric(s,t)}return t.push(")"),t}astArrayExpression(e,t){const r=this.getType(e),n=e.elements.length,i=[];for(let t=0;t<n;++t){const r=[];this.astGeneric(e.elements[t],r),i.push(r.join(""))}switch(r){case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":t.push(`[${i.join(", ")}]`);break;default:t.push(`new Float32Array([${i.join(", ")}])`)}return t}astDebuggerStatement(e,t){return t.push("debugger;"),t}}}},{"../function-node":189}],186:[function(e,t,r){const{utils:n}=e("../../utils");t.exports={cpuKernelString:function(e,t){const r=[],i=[],s=[],o=!/^function/.test(e.color.toString());if(r.push(" const { context, canvas, constants: incomingConstants } = settings;",` const output = new Int32Array(${JSON.stringify(Array.from(e.output))});`,` const _constantTypes = ${JSON.stringify(e.constantTypes)};`,` const _constants = ${function(e,t){const r=[];for(const n in t){if(!t.hasOwnProperty(n))continue;const i=t[n],s=e[n];switch(i){case"Number":case"Integer":case"Float":case"Boolean":r.push(`${n}:${s}`);break;case"Array(2)":case"Array(3)":case"Array(4)":case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":r.push(`${n}:new ${s.constructor.name}(${JSON.stringify(Array.from(s))})`)}}return`{ ${r.join()} }`}(e.constants,e.constantTypes)};`),i.push(" constants: _constants,"," context,"," output,"," thread: {x: 0, y: 0, z: 0},"),e.graphical){r.push(` const _imageData = context.createImageData(${e.output[0]}, ${e.output[1]});`),r.push(` const _colorData = new Uint8ClampedArray(${e.output[0]} * ${e.output[1]} * 4);`);const t=n.flattenFunctionToString((o?"function ":"")+e.color.toString(),{thisLookup:t=>{switch(t){case"_colorData":return"_colorData";case"_imageData":return"_imageData";case"output":return"output";case"thread":return"this.thread"}return JSON.stringify(e[t])},findDependency:(e,t)=>null}),a=n.flattenFunctionToString((o?"function ":"")+e.getPixels.toString(),{thisLookup:t=>{switch(t){case"_colorData":return"_colorData";case"_imageData":return"_imageData";case"output":return"output";case"thread":return"this.thread"}return JSON.stringify(e[t])},findDependency:()=>null});i.push(" _imageData,"," _colorData,",` color: ${t},`),s.push(` kernel.getPixels = ${a};`)}const a=[],u=Object.keys(e.constantTypes);for(let t=0;t<u.length;t++)a.push(e.constantTypes[u]);if(-1!==e.argumentTypes.indexOf("HTMLImageArray")||-1!==a.indexOf("HTMLImageArray")){const t=n.flattenFunctionToString((o?"function ":"")+e._imageTo3DArray.toString(),{doNotDefine:["canvas"],findDependency:(t,r)=>"this"===t?(o?"function ":"")+e[r].toString():null,thisLookup:e=>{switch(e){case"canvas":return;case"context":return"context"}}});s.push(t),i.push(" _mediaTo2DArray,"),i.push(" _imageTo3DArray,")}else if(-1!==e.argumentTypes.indexOf("HTMLImage")||-1!==a.indexOf("HTMLImage")){const t=n.flattenFunctionToString((o?"function ":"")+e._mediaTo2DArray.toString(),{findDependency:(e,t)=>null,thisLookup:e=>{switch(e){case"canvas":return"settings.canvas";case"context":return"settings.context"}throw new Error("unhandled thisLookup")}});s.push(t),i.push(" _mediaTo2DArray,")}return`function(settings) {\n${r.join("\n")}\n for (const p in _constantTypes) {\n if (!_constantTypes.hasOwnProperty(p)) continue;\n const type = _constantTypes[p];\n switch (type) {\n case 'Number':\n case 'Integer':\n case 'Float':\n case 'Boolean':\n case 'Array(2)':\n case 'Array(3)':\n case 'Array(4)':\n case 'Matrix(2)':\n case 'Matrix(3)':\n case 'Matrix(4)':\n if (incomingConstants.hasOwnProperty(p)) {\n console.warn('constant ' + p + ' of type ' + type + ' cannot be resigned');\n }\n continue;\n }\n if (!incomingConstants.hasOwnProperty(p)) {\n throw new Error('constant ' + p + ' not found');\n }\n _constants[p] = incomingConstants[p];\n }\n const kernel = (function() {\n${e._kernelString}\n })\n .apply({ ${i.join("\n")} });\n ${s.join("\n")}\n return kernel;\n}`}}},{"../../utils":291}],187:[function(e,t,r){const{Kernel:n}=e("../kernel"),{FunctionBuilder:i}=e("../function-builder"),{CPUFunctionNode:s}=e("./function-node"),{utils:o}=e("../../utils"),{cpuKernelString:a}=e("./kernel-string");t.exports={CPUKernel:class extends n{static getFeatures(){return this.features}static get features(){return Object.freeze({kernelMap:!0,isIntegerDivisionAccurate:!0})}static get isSupported(){return!0}static isContextMatch(e){return!1}static get mode(){return"cpu"}static nativeFunctionArguments(){return null}static nativeFunctionReturnType(){throw new Error(`Looking up native function return type not supported on ${this.name}`)}static combineKernels(e){return e}static getSignature(e,t){return"cpu"+(t.length>0?":"+t.join(","):"")}constructor(e,t){super(e,t),this.mergeSettings(e.settings||t),this._imageData=null,this._colorData=null,this._kernelString=null,this._prependedString=[],this.thread={x:0,y:0,z:0},this.translatedSources=null}initCanvas(){return"undefined"!=typeof document?document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(0,0):void 0}initContext(){return this.canvas?this.canvas.getContext("2d"):null}initPlugins(e){return[]}validateSettings(e){if(!this.output||0===this.output.length){if(1!==e.length)throw new Error("Auto output only supported for kernels with only one input");const t=o.getVariableType(e[0],this.strictIntegers);if("Array"===t)this.output=o.getDimensions(t);else{if("NumberTexture"!==t&&"ArrayTexture(4)"!==t)throw new Error("Auto output not supported for input type: "+t);this.output=e[0].output}}if(this.graphical&&2!==this.output.length)throw new Error("Output must have 2 dimensions on graphical mode");this.checkOutput()}translateSource(){if(this.leadingReturnStatement=this.output.length>1?"resultX[x] = ":"result[x] = ",this.subKernels){const e=[];for(let t=0;t<this.subKernels.length;t++){const{name:r}=this.subKernels[t];e.push(this.output.length>1?`resultX_${r}[x] = subKernelResult_${r};\n`:`result_${r}[x] = subKernelResult_${r};\n`)}this.followingReturnStatement=e.join("")}const e=i.fromKernel(this,s);this.translatedSources=e.getPrototypes("kernel"),this.graphical||this.returnType||(this.returnType=e.getKernelResultType())}build(){if(this.built)return;if(this.setupConstants(),this.setupArguments(arguments),this.validateSettings(arguments),this.translateSource(),this.graphical){const{canvas:e,output:t}=this;if(!e)throw new Error("no canvas available for using graphical output");const r=t[0],n=t[1]||1;e.width=r,e.height=n,this._imageData=this.context.createImageData(r,n),this._colorData=new Uint8ClampedArray(r*n*4)}const e=this.getKernelString();this.kernelString=e,this.debug&&(console.log("Function output:"),console.log(e));try{this.run=new Function([],e).bind(this)()}catch(e){console.error("An error occurred compiling the javascript: ",e)}this.buildSignature(arguments),this.built=!0}color(e,t,r,n){void 0===n&&(n=1),e=Math.floor(255*e),t=Math.floor(255*t),r=Math.floor(255*r),n=Math.floor(255*n);const i=this.output[0],s=this.output[1],o=this.thread.x+(s-this.thread.y-1)*i;this._colorData[4*o+0]=e,this._colorData[4*o+1]=t,this._colorData[4*o+2]=r,this._colorData[4*o+3]=n}getKernelString(){if(null!==this._kernelString)return this._kernelString;let e=null,{translatedSources:t}=this;return t.length>1?t=t.filter(t=>/^function/.test(t)?t:(e=t,!1)):e=t.shift(),this._kernelString=` const LOOP_MAX = ${this._getLoopMaxString()};\n ${this.injectedNative||""}\n const _this = this;\n ${this._resultKernelHeader()}\n ${this._processConstants()}\n return (${this.argumentNames.map(e=>"user_"+e).join(", ")}) => {\n ${this._prependedString.join("")}\n ${this._earlyThrows()}\n ${this._processArguments()}\n ${this.graphical?this._graphicalKernelBody(e):this._resultKernelBody(e)}\n ${t.length>0?t.join("\n"):""}\n };`}toString(){return a(this)}_getLoopMaxString(){return this.loopMaxIterations?` ${parseInt(this.loopMaxIterations)};`:" 1000;"}_processConstants(){if(!this.constants)return"";const e=[];for(let t in this.constants)switch(this.constantTypes[t]){case"HTMLCanvas":case"HTMLImage":case"HTMLVideo":e.push(` const constants_${t} = this._mediaTo2DArray(this.constants.${t});\n`);break;case"HTMLImageArray":e.push(` const constants_${t} = this._imageTo3DArray(this.constants.${t});\n`);break;case"Input":e.push(` const constants_${t} = this.constants.${t}.value;\n`);break;default:e.push(` const constants_${t} = this.constants.${t};\n`)}return e.join("")}_earlyThrows(){if(this.graphical)return"";if(this.immutable)return"";if(!this.pipeline)return"";const e=[];for(let t=0;t<this.argumentTypes.length;t++)"Array"===this.argumentTypes[t]&&e.push(this.argumentNames[t]);if(0===e.length)return"";const t=[];for(let r=0;r<e.length;r++){const n=e[r],i=this._mapSubKernels(e=>`user_${n} === result_${e.name}`).join(" || ");t.push(`user_${n} === result${i?` || ${i}`:""}`)}return`if (${t.join(" || ")}) throw new Error('Source and destination arrays are the same. Use immutable = true');`}_processArguments(){const e=[];for(let t=0;t<this.argumentTypes.length;t++){const r=`user_${this.argumentNames[t]}`;switch(this.argumentTypes[t]){case"HTMLCanvas":case"HTMLImage":case"HTMLVideo":e.push(` ${r} = this._mediaTo2DArray(${r});\n`);break;case"HTMLImageArray":e.push(` ${r} = this._imageTo3DArray(${r});\n`);break;case"Input":e.push(` ${r} = ${r}.value;\n`);break;case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"NumberTexture":case"MemoryOptimizedNumberTexture":e.push(`\n if (${r}.toArray) {\n if (!_this.textureCache) {\n _this.textureCache = [];\n _this.arrayCache = [];\n }\n const textureIndex = _this.textureCache.indexOf(${r});\n if (textureIndex !== -1) {\n ${r} = _this.arrayCache[textureIndex];\n } else {\n _this.textureCache.push(${r});\n ${r} = ${r}.toArray();\n _this.arrayCache.push(${r});\n }\n }`)}}return e.join("")}_mediaTo2DArray(e){const t=this.canvas,r=e.width>0?e.width:e.videoWidth,n=e.height>0?e.height:e.videoHeight;t.width<r&&(t.width=r),t.height<n&&(t.height=n);const i=this.context;i.drawImage(e,0,0,r,n);const s=i.getImageData(0,0,r,n).data,o=new Array(n);let a=0;for(let e=n-1;e>=0;e--){const t=o[e]=new Array(r);for(let e=0;e<r;e++){const r=new Float32Array(4);r[0]=s[a++]/255,r[1]=s[a++]/255,r[2]=s[a++]/255,r[3]=s[a++]/255,t[e]=r}}return o}getPixels(e){const[t,r]=this.output;return e?o.flipPixels(this._imageData.data,t,r):this._imageData.data.slice(0)}_imageTo3DArray(e){const t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=this._mediaTo2DArray(e[r]);return t}_resultKernelHeader(){if(this.graphical)return"";if(this.immutable)return"";if(!this.pipeline)return"";switch(this.output.length){case 1:return this._mutableKernel1DResults();case 2:return this._mutableKernel2DResults();case 3:return this._mutableKernel3DResults()}}_resultKernelBody(e){switch(this.output.length){case 1:return(!this.immutable&&this.pipeline?this._resultMutableKernel1DLoop(e):this._resultImmutableKernel1DLoop(e))+this._kernelOutput();case 2:return(!this.immutable&&this.pipeline?this._resultMutableKernel2DLoop(e):this._resultImmutableKernel2DLoop(e))+this._kernelOutput();case 3:return(!this.immutable&&this.pipeline?this._resultMutableKernel3DLoop(e):this._resultImmutableKernel3DLoop(e))+this._kernelOutput();default:throw new Error("unsupported size kernel")}}_graphicalKernelBody(e){switch(this.output.length){case 2:return this._graphicalKernel2DLoop(e)+this._graphicalOutput();default:throw new Error("unsupported size kernel")}}_graphicalOutput(){return"\n this._imageData.data.set(this._colorData);\n this.context.putImageData(this._imageData, 0, 0);\n return;"}_getKernelResultTypeConstructorString(){switch(this.returnType){case"LiteralInteger":case"Number":case"Integer":case"Float":return"Float32Array";case"Array(2)":case"Array(3)":case"Array(4)":return"Array";default:if(this.graphical)return"Float32Array";throw new Error(`unhandled returnType ${this.returnType}`)}}_resultImmutableKernel1DLoop(e){const t=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const result = new ${t}(outputX);\n ${this._mapSubKernels(e=>`const result_${e.name} = new ${t}(outputX);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n this.thread.y = 0;\n this.thread.z = 0;\n ${e}\n }`}_mutableKernel1DResults(){const e=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const result = new ${e}(outputX);\n ${this._mapSubKernels(t=>`const result_${t.name} = new ${e}(outputX);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}`}_resultMutableKernel1DLoop(e){return` const outputX = _this.output[0];\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n this.thread.y = 0;\n this.thread.z = 0;\n ${e}\n }`}_resultImmutableKernel2DLoop(e){const t=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const result = new Array(outputY);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputY);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n const resultX = result[y] = new ${t}(outputX);\n ${this._mapSubKernels(e=>`const resultX_${e.name} = result_${e.name}[y] = new ${t}(outputX);\n`).join("")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }`}_mutableKernel2DResults(){const e=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const result = new Array(outputY);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputY);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n const resultX = result[y] = new ${e}(outputX);\n ${this._mapSubKernels(t=>`const resultX_${t.name} = result_${t.name}[y] = new ${e}(outputX);\n`).join("")}\n }`}_resultMutableKernel2DLoop(e){const t=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n for (let y = 0; y < outputY; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n const resultX = result[y];\n ${this._mapSubKernels(e=>`const resultX_${e.name} = result_${e.name}[y] = new ${t}(outputX);\n`).join("")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }`}_graphicalKernel2DLoop(e){return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n for (let y = 0; y < outputY; y++) {\n this.thread.z = 0;\n this.thread.y = y;\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }`}_resultImmutableKernel3DLoop(e){const t=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const outputZ = _this.output[2];\n const result = new Array(outputZ);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputZ);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let z = 0; z < outputZ; z++) {\n this.thread.z = z;\n const resultY = result[z] = new Array(outputY);\n ${this._mapSubKernels(e=>`const resultY_${e.name} = result_${e.name}[z] = new Array(outputY);\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n this.thread.y = y;\n const resultX = resultY[y] = new ${t}(outputX);\n ${this._mapSubKernels(e=>`const resultX_${e.name} = resultY_${e.name}[y] = new ${t}(outputX);\n`).join(" ")}\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }\n }`}_mutableKernel3DResults(){const e=this._getKernelResultTypeConstructorString();return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const outputZ = _this.output[2];\n const result = new Array(outputZ);\n ${this._mapSubKernels(e=>`const result_${e.name} = new Array(outputZ);\n`).join(" ")}\n ${this._mapSubKernels(e=>`let subKernelResult_${e.name};\n`).join(" ")}\n for (let z = 0; z < outputZ; z++) {\n const resultY = result[z] = new Array(outputY);\n ${this._mapSubKernels(e=>`const resultY_${e.name} = result_${e.name}[z] = new Array(outputY);\n`).join(" ")}\n for (let y = 0; y < outputY; y++) {\n const resultX = resultY[y] = new ${e}(outputX);\n ${this._mapSubKernels(t=>`const resultX_${t.name} = resultY_${t.name}[y] = new ${e}(outputX);\n`).join(" ")}\n }\n }`}_resultMutableKernel3DLoop(e){return` const outputX = _this.output[0];\n const outputY = _this.output[1];\n const outputZ = _this.output[2];\n for (let z = 0; z < outputZ; z++) {\n this.thread.z = z;\n const resultY = result[z];\n for (let y = 0; y < outputY; y++) {\n this.thread.y = y;\n const resultX = resultY[y];\n for (let x = 0; x < outputX; x++) {\n this.thread.x = x;\n ${e}\n }\n }\n }`}_kernelOutput(){return this.subKernels?`\n return {\n result: result,\n ${this.subKernels.map(e=>`${e.property}: result_${e.name}`).join(",\n ")}\n };`:"\n return result;"}_mapSubKernels(e){return null===this.subKernels?[""]:this.subKernels.map(e)}destroy(e){e&&delete this.canvas}static destroyContext(e){}toJSON(){const e=super.toJSON();return e.functionNodes=i.fromKernel(this,s).toJSON(),e}setOutput(e){super.setOutput(e);const[t,r]=this.output;this.graphical&&(this._imageData=this.context.createImageData(t,r),this._colorData=new Uint8ClampedArray(t*r*4))}prependString(e){if(this._kernelString)throw new Error("Kernel already built");this._prependedString.push(e)}hasPrependString(e){return this._prependedString.indexOf(e)>-1}}}},{"../../utils":291,"../function-builder":188,"../kernel":215,"./function-node":185,"./kernel-string":186}],188:[function(e,t,r){class n{static fromKernel(e,t,r){const{kernelArguments:i,kernelConstants:s,argumentNames:o,argumentSizes:a,argumentBitRatios:u,constants:l,constantBitRatios:c,debug:h,loopMaxIterations:p,nativeFunctions:f,output:d,optimizeFloatMemory:m,precision:g,plugins:v,source:y,subKernels:_,functions:b,leadingReturnStatement:x,followingReturnStatement:w,dynamicArguments:E,dynamicOutput:T}=e,A=new Array(i.length),S={};for(let e=0;e<i.length;e++)A[e]=i[e].type;for(let e=0;e<s.length;e++){const t=s[e];S[t.name]=t.type}const k=(e,t)=>V.needsArgumentType(e,t),C=(e,t,r)=>{V.assignArgumentType(e,t,r)},I=(e,t,r)=>V.lookupReturnType(e,t,r),R=e=>V.lookupFunctionArgumentTypes(e),L=(e,t)=>V.lookupFunctionArgumentName(e,t),O=(e,t)=>V.lookupFunctionArgumentBitRatio(e,t),M=(e,t,r,n)=>{V.assignArgumentType(e,t,r,n)},P=(e,t,r,n)=>{V.assignArgumentBitRatio(e,t,r,n)},B=(e,t,r)=>{V.trackFunctionCall(e,t,r)},N=(e,r)=>{const n=[];for(let t=0;t<e.params.length;t++)n.push(e.params[t].name);const i=new t(r,Object.assign({},D,{returnType:null,ast:e,name:e.id.name,argumentNames:n,lookupReturnType:I,lookupFunctionArgumentTypes:R,lookupFunctionArgumentName:L,lookupFunctionArgumentBitRatio:O,needsArgumentType:k,assignArgumentType:C,triggerImplyArgumentType:M,triggerImplyArgumentBitRatio:P,onFunctionCall:B}));i.traceFunctionAST(e),V.addFunctionNode(i)},D=Object.assign({isRootKernel:!1,onNestedFunction:N,lookupReturnType:I,lookupFunctionArgumentTypes:R,lookupFunctionArgumentName:L,lookupFunctionArgumentBitRatio:O,needsArgumentType:k,assignArgumentType:C,triggerImplyArgumentType:M,triggerImplyArgumentBitRatio:P,onFunctionCall:B,optimizeFloatMemory:m,precision:g,constants:l,constantTypes:S,constantBitRatios:c,debug:h,loopMaxIterations:p,output:d,plugins:v,dynamicArguments:E,dynamicOutput:T},r||{}),F=Object.assign({},D,{isRootKernel:!0,name:"kernel",argumentNames:o,argumentTypes:A,argumentSizes:a,argumentBitRatios:u,leadingReturnStatement:x,followingReturnStatement:w});if("object"==typeof y&&y.functionNodes)return(new n).fromJSON(y.functionNodes,t);const j=new t(y,F);let U=null;b&&(U=b.map(e=>new t(e.source,{returnType:e.returnType,argumentTypes:e.argumentTypes,output:d,plugins:v,constants:l,constantTypes:S,constantBitRatios:c,optimizeFloatMemory:m,precision:g,lookupReturnType:I,lookupFunctionArgumentTypes:R,lookupFunctionArgumentName:L,lookupFunctionArgumentBitRatio:O,needsArgumentType:k,assignArgumentType:C,triggerImplyArgumentType:M,triggerImplyArgumentBitRatio:P,onFunctionCall:B,onNestedFunction:N})));let $=null;_&&($=_.map(e=>{const{name:r,source:n}=e;return new t(n,Object.assign({},D,{name:r,isSubKernel:!0,isRootKernel:!1}))}));const V=new n({kernel:e,rootNode:j,functionNodes:U,nativeFunctions:f,subKernelNodes:$});return V}constructor(e){if(e=e||{},this.kernel=e.kernel,this.rootNode=e.rootNode,this.functionNodes=e.functionNodes||[],this.subKernelNodes=e.subKernelNodes||[],this.nativeFunctions=e.nativeFunctions||[],this.functionMap={},this.nativeFunctionNames=[],this.lookupChain=[],this.functionNodeDependencies={},this.functionCalls={},this.rootNode&&(this.functionMap.kernel=this.rootNode),this.functionNodes)for(let e=0;e<this.functionNodes.length;e++)this.functionMap[this.functionNodes[e].name]=this.functionNodes[e];if(this.subKernelNodes)for(let e=0;e<this.subKernelNodes.length;e++)this.functionMap[this.subKernelNodes[e].name]=this.subKernelNodes[e];if(this.nativeFunctions)for(let e=0;e<this.nativeFunctions.length;e++){const t=this.nativeFunctions[e];this.nativeFunctionNames.push(t.name)}}addFunctionNode(e){if(!e.name)throw new Error("functionNode.name needs set");this.functionMap[e.name]=e,e.isRootKernel&&(this.rootNode=e)}traceFunctionCalls(e,t){if(e=e||"kernel",t=t||[],this.nativeFunctionNames.indexOf(e)>-1){const r=t.indexOf(e);if(-1===r)t.push(e);else{const e=t.splice(r,1)[0];t.push(e)}return t}const r=this.functionMap[e];if(r){const n=t.indexOf(e);if(-1===n){t.push(e),r.toString();for(let e=0;e<r.calledFunctions.length;++e)this.traceFunctionCalls(r.calledFunctions[e],t)}else{const e=t.splice(n,1)[0];t.push(e)}}return t}getPrototypeString(e){return this.getPrototypes(e).join("\n")}getPrototypes(e){return this.rootNode&&this.rootNode.toString(),e?this.getPrototypesFromFunctionNames(this.traceFunctionCalls(e,[]).reverse()):this.getPrototypesFromFunctionNames(Object.keys(this.functionMap))}getStringFromFunctionNames(e){const t=[];for(let r=0;r<e.length;++r){this.functionMap[e[r]]&&t.push(this.functionMap[e[r]].toString())}return t.join("\n")}getPrototypesFromFunctionNames(e){const t=[];for(let r=0;r<e.length;++r){const n=e[r],i=this.nativeFunctionNames.indexOf(n);if(i>-1){t.push(this.nativeFunctions[i].source);continue}const s=this.functionMap[n];s&&t.push(s.toString())}return t}toJSON(){return this.traceFunctionCalls(this.rootNode.name).reverse().map(e=>{const t=this.nativeFunctions.indexOf(e);if(t>-1)return{name:e,source:this.nativeFunctions[t].source};if(this.functionMap[e])return this.functionMap[e].toJSON();throw new Error(`function ${e} not found`)})}fromJSON(e,t){this.functionMap={};for(let r=0;r<e.length;r++){const n=e[r];this.functionMap[n.settings.name]=new t(n.ast,n.settings)}return this}getString(e){return e?this.getStringFromFunctionNames(this.traceFunctionCalls(e).reverse()):this.getStringFromFunctionNames(Object.keys(this.functionMap))}lookupReturnType(e,t,r){if("CallExpression"!==t.type)throw new Error(`expected ast type of "CallExpression", but is ${t.type}`);if(this._isNativeFunction(e))return this._lookupNativeFunctionReturnType(e);if(this._isFunction(e)){const n=this._getFunction(e);if(n.returnType)return n.returnType;{for(let e=0;e<this.lookupChain.length;e++)if(this.lookupChain[e].ast===t){if(0===n.argumentTypes.length&&t.arguments.length>0){const i=t.arguments;for(let t=0;t<i.length;t++)this.lookupChain.push({name:r.name,ast:i[e],requestingNode:r}),n.argumentTypes[t]=r.getType(i[t]),this.lookupChain.pop();return n.returnType=n.getType(n.getJsAST())}throw new Error("circlical logic detected!")}this.lookupChain.push({name:r.name,ast:t,requestingNode:r});const e=n.getType(n.getJsAST());return this.lookupChain.pop(),n.returnType=e}}return null}_getFunction(e){return this._isFunction(e)||new Error(`Function ${e} not found`),this.functionMap[e]}_isFunction(e){return Boolean(this.functionMap[e])}_getNativeFunction(e){for(let t=0;t<this.nativeFunctions.length;t++)if(this.nativeFunctions[t].name===e)return this.nativeFunctions[t];return null}_isNativeFunction(e){return Boolean(this._getNativeFunction(e))}_lookupNativeFunctionReturnType(e){let t=this._getNativeFunction(e);if(t)return t.returnType;throw new Error(`Native function ${e} not found`)}lookupFunctionArgumentTypes(e){return this._isNativeFunction(e)?this._getNativeFunction(e).argumentTypes:this._isFunction(e)?this._getFunction(e).argumentTypes:null}lookupFunctionArgumentName(e,t){return this._getFunction(e).argumentNames[t]}lookupFunctionArgumentBitRatio(e,t){if(!this._isFunction(e))throw new Error("function not found");if(this.rootNode.name===e){const e=this.rootNode.argumentNames.indexOf(t);if(-1!==e)return this.rootNode.argumentBitRatios[e]}const r=this._getFunction(e),n=r.argumentNames.indexOf(t);if(-1===n)throw new Error("argument not found");const i=r.argumentBitRatios[n];if("number"!=typeof i)throw new Error("argument bit ratio not found");return i}needsArgumentType(e,t){if(!this._isFunction(e))return!1;return!this._getFunction(e).argumentTypes[t]}assignArgumentType(e,t,r,n){if(!this._isFunction(e))return;const i=this._getFunction(e);i.argumentTypes[t]||(i.argumentTypes[t]=r)}assignArgumentBitRatio(e,t,r,n){const i=this._getFunction(e);if(this._isNativeFunction(r))return null;const s=this._getFunction(r),o=i.argumentNames.indexOf(t);if(-1===o)throw new Error(`Argument ${t} not found in arguments from function ${e}`);const a=i.argumentBitRatios[o];if("number"!=typeof a)throw new Error(`Bit ratio for argument ${t} not found in function ${e}`);s.argumentBitRatios||(s.argumentBitRatios=new Array(s.argumentNames.length));const u=s.argumentBitRatios[o];if("number"==typeof u){if(u!==a)throw new Error(`Incompatible bit ratio found at function ${e} at argument ${t}`);return u}return s.argumentBitRatios[o]=a,a}trackFunctionCall(e,t,r){this.functionNodeDependencies[e]||(this.functionNodeDependencies[e]=new Set,this.functionCalls[e]=[]),this.functionNodeDependencies[e].add(t),this.functionCalls[e].push(r)}getKernelResultType(){return this.rootNode.returnType||this.rootNode.getType(this.rootNode.ast)}getSubKernelResultType(e){const t=this.subKernelNodes[e];let r=!1;for(let e=0;e<this.rootNode.functionCalls.length;e++){this.rootNode.functionCalls[e].ast.callee.name===t.name&&(r=!0)}if(!r)throw new Error(`SubKernel ${t.name} never called by kernel`);return t.returnType||t.getType(t.getJsAST())}getReturnTypes(){const e={[this.rootNode.name]:this.rootNode.getType(this.rootNode.ast)},t=this.traceFunctionCalls(this.rootNode.name);for(let r=0;r<t.length;r++){const n=t[r],i=this.functionMap[n];e[n]=i.getType(i.ast)}return e}}t.exports={FunctionBuilder:n}},{}],189:[function(e,t,r){const n=e("acorn"),{utils:i}=e("../utils"),{FunctionTracer:s}=e("./function-tracer");const o={Number:"Number",Float:"Float",Integer:"Integer",Array:"Number","Array(2)":"Number","Array(3)":"Number","Array(4)":"Number","Matrix(2)":"Number","Matrix(3)":"Number","Matrix(4)":"Number",Array2D:"Number",Array3D:"Number",Input:"Number",HTMLCanvas:"Array(4)",HTMLImage:"Array(4)",HTMLVideo:"Array(4)",HTMLImageArray:"Array(4)",NumberTexture:"Number",MemoryOptimizedNumberTexture:"Number","Array1D(2)":"Array(2)","Array1D(3)":"Array(3)","Array1D(4)":"Array(4)","Array2D(2)":"Array(2)","Array2D(3)":"Array(3)","Array2D(4)":"Array(4)","Array3D(2)":"Array(2)","Array3D(3)":"Array(3)","Array3D(4)":"Array(4)","ArrayTexture(1)":"Number","ArrayTexture(2)":"Array(2)","ArrayTexture(3)":"Array(3)","ArrayTexture(4)":"Array(4)"};t.exports={FunctionNode:class{constructor(e,t){if(!e&&!t.ast)throw new Error("source parameter is missing");if(t=t||{},this.source=e,this.ast=null,this.name="string"==typeof e?t.isRootKernel?"kernel":t.name||i.getFunctionNameFromString(e):null,this.calledFunctions=[],this.constants={},this.constantTypes={},this.constantBitRatios={},this.isRootKernel=!1,this.isSubKernel=!1,this.debug=null,this.functions=null,this.identifiers=null,this.contexts=null,this.functionCalls=null,this.states=[],this.needsArgumentType=null,this.assignArgumentType=null,this.lookupReturnType=null,this.lookupFunctionArgumentTypes=null,this.lookupFunctionArgumentBitRatio=null,this.triggerImplyArgumentType=null,this.triggerImplyArgumentBitRatio=null,this.onNestedFunction=null,this.onFunctionCall=null,this.optimizeFloatMemory=null,this.precision=null,this.loopMaxIterations=null,this.argumentNames="string"==typeof this.source?i.getArgumentNamesFromString(this.source):null,this.argumentTypes=[],this.argumentSizes=[],this.argumentBitRatios=null,this.returnType=null,this.output=[],this.plugins=null,this.leadingReturnStatement=null,this.followingReturnStatement=null,this.dynamicOutput=null,this.dynamicArguments=null,this.strictTypingChecking=!1,this.fixIntegerDivisionAccuracy=null,t)for(const e in t)t.hasOwnProperty(e)&&this.hasOwnProperty(e)&&(this[e]=t[e]);this.literalTypes={},this.validate(),this._string=null,this._internalVariableNames={}}validate(){if("string"!=typeof this.source&&!this.ast)throw new Error("this.source not a string");if(!this.ast&&!i.isFunctionString(this.source))throw new Error("this.source not a function string");if(!this.name)throw new Error("this.name could not be set");if(this.argumentTypes.length>0&&this.argumentTypes.length!==this.argumentNames.length)throw new Error(`argumentTypes count of ${this.argumentTypes.length} exceeds ${this.argumentNames.length}`);if(this.output.length<1)throw new Error("this.output is not big enough")}isIdentifierConstant(e){return!!this.constants&&this.constants.hasOwnProperty(e)}isInput(e){return"Input"===this.argumentTypes[this.argumentNames.indexOf(e)]}pushState(e){this.states.push(e)}popState(e){if(this.state!==e)throw new Error(`Cannot popState ${e} when in ${this.state}`);this.states.pop()}isState(e){return this.state===e}get state(){return this.states[this.states.length-1]}astMemberExpressionUnroll(e){if("Identifier"===e.type)return e.name;if("ThisExpression"===e.type)return"this";if("MemberExpression"===e.type&&e.object&&e.property)return e.object.hasOwnProperty("name")&&"Math"!==e.object.name?this.astMemberExpressionUnroll(e.property):this.astMemberExpressionUnroll(e.object)+"."+this.astMemberExpressionUnroll(e.property);if(e.hasOwnProperty("expressions")){const t=e.expressions[0];if("Literal"===t.type&&0===t.value&&2===e.expressions.length)return this.astMemberExpressionUnroll(e.expressions[1])}throw this.astErrorOutput("Unknown astMemberExpressionUnroll",e)}getJsAST(e){if(this.ast)return this.ast;if("object"==typeof this.source)return this.traceFunctionAST(this.source),this.ast=this.source;if(null===(e=e||n))throw new Error("Missing JS to AST parser");const t=Object.freeze(e.parse(`const parser_${this.name} = ${this.source};`,{locations:!0})),r=t.body[0].declarations[0].init;if(this.traceFunctionAST(r),!t)throw new Error("Failed to parse JS code");return this.ast=r}traceFunctionAST(e){const{contexts:t,declarations:r,functions:n,identifiers:i,functionCalls:o}=new s(e);this.contexts=t,this.identifiers=i,this.functionCalls=o,this.functions=n;for(let e=0;e<r.length;e++){const t=r[e],{ast:n,inForLoopInit:i,inForLoopTest:s}=t,{init:o}=n,a=this.getDependencies(o);let u=null;if(i&&s)u="Integer";else if(o){const e=this.getType(o);switch(e){case"Integer":case"Float":case"Number":u="MemberExpression"===o.type?e:"Number";break;case"LiteralInteger":u="Number";break;default:u=e}}t.valueType=u,t.dependencies=a,t.isSafe=this.isSafeDependencies(a)}for(let e=0;e<n.length;e++)this.onNestedFunction(n[e],this.source)}getDeclaration(e){for(let t=0;t<this.identifiers.length;t++){const r=this.identifiers[t];if(e===r.ast)return r.declaration}return null}getVariableType(e){if("Identifier"!==e.type)throw new Error(`ast of ${e.type} not "Identifier"`);let t=null;const r=this.argumentNames.indexOf(e.name);if(-1===r){const t=this.getDeclaration(e);if(t)return t.valueType}else{const e=this.argumentTypes[r];e&&(t=e)}if(!t&&this.strictTypingChecking)throw new Error(`Declaration of ${name} not found`);return t}getLookupType(e){if(!o.hasOwnProperty(e))throw new Error(`unknown typeLookupMap ${e}`);return o[e]}getConstantType(e){if(this.constantTypes[e]){const t=this.constantTypes[e];return"Float"===t?"Number":t}throw new Error(`Type for constant "${e}" not declared`)}toString(){return this._string?this._string:this._string=this.astGeneric(this.getJsAST(),[]).join("").trim()}toJSON(){const e={source:this.source,name:this.name,constants:this.constants,constantTypes:this.constantTypes,isRootKernel:this.isRootKernel,isSubKernel:this.isSubKernel,debug:this.debug,output:this.output,loopMaxIterations:this.loopMaxIterations,argumentNames:this.argumentNames,argumentTypes:this.argumentTypes,argumentSizes:this.argumentSizes,returnType:this.returnType,leadingReturnStatement:this.leadingReturnStatement,followingReturnStatement:this.followingReturnStatement};return{ast:this.ast,settings:e}}getType(e){if(Array.isArray(e))return this.getType(e[e.length-1]);switch(e.type){case"BlockStatement":return this.getType(e.body);case"ArrayExpression":switch(this.getType(e.elements[0])){case"Array(2)":case"Array(3)":case"Array(4)":return`Matrix(${e.elements.length})`}return`Array(${e.elements.length})`;case"Literal":const t=this.astKey(e);return this.literalTypes[t]?this.literalTypes[t]:Number.isInteger(e.value)?"LiteralInteger":!0===e.value||!1===e.value?"Boolean":"Number";case"AssignmentExpression":return this.getType(e.left);case"CallExpression":if(this.isAstMathFunction(e))return"Number";if(!e.callee||!e.callee.name){if("SequenceExpression"===e.callee.type&&e.callee.expressions[e.callee.expressions.length-1].property.name){const t=e.callee.expressions[e.callee.expressions.length-1].property.name;return this.inferArgumentTypesIfNeeded(t,e.arguments),this.lookupReturnType(t,e,this)}if("this.color"===this.getVariableSignature(e.callee,!0))return null;if("MemberExpression"===e.callee.type&&e.callee.object&&e.callee.property&&e.callee.property.name&&e.arguments){const t=e.callee.property.name;return this.inferArgumentTypesIfNeeded(t,e.arguments),this.lookupReturnType(t,e,this)}throw this.astErrorOutput("Unknown call expression",e)}if(e.callee&&e.callee.name){const t=e.callee.name;return this.inferArgumentTypesIfNeeded(t,e.arguments),this.lookupReturnType(t,e,this)}throw this.astErrorOutput(`Unhandled getType Type "${e.type}"`,e);case"LogicalExpression":return"Boolean";case"BinaryExpression":switch(e.operator){case"%":case"/":if(this.fixIntegerDivisionAccuracy)return"Number";break;case">":case"<":return"Boolean";case"&":case"|":case"^":case"<<":case">>":case">>>":return"Integer"}const r=this.getType(e.left);if(this.isState("skip-literal-correction"))return r;if("LiteralInteger"===r){const t=this.getType(e.right);return"LiteralInteger"===t?e.left.value%1==0?"Integer":"Float":t}return o[r]||r;case"UpdateExpression":return this.getType(e.argument);case"UnaryExpression":return"~"===e.operator?"Integer":this.getType(e.argument);case"VariableDeclaration":{const t=e.declarations;let r;for(let e=0;e<t.length;e++){const n=t[e];r=this.getType(n)}if(!r)throw this.astErrorOutput("Unable to find type for declaration",e);return r}case"VariableDeclarator":const n=this.getDeclaration(e.id);if(!n)throw this.astErrorOutput("Unable to find declarator",e);if(!n.valueType)throw this.astErrorOutput("Unable to find declarator valueType",e);return n.valueType;case"Identifier":if("Infinity"===e.name)return"Number";if(this.isAstVariable(e)&&"value"===this.getVariableSignature(e))return this.getCheckVariableType(e);const i=this.findIdentifierOrigin(e);return i&&i.init?this.getType(i.init):null;case"ReturnStatement":return this.getType(e.argument);case"MemberExpression":if(this.isAstMathFunction(e)){switch(e.property.name){case"ceil":case"floor":case"round":return"Integer"}return"Number"}if(this.isAstVariable(e)){switch(this.getVariableSignature(e)){case"value[]":return this.getLookupType(this.getCheckVariableType(e.object));case"value[][]":return this.getLookupType(this.getCheckVariableType(e.object.object));case"value[][][]":return this.getLookupType(this.getCheckVariableType(e.object.object.object));case"value[][][][]":return this.getLookupType(this.getCheckVariableType(e.object.object.object.object));case"value.thread.value":case"this.thread.value":return"Integer";case"this.output.value":return this.dynamicOutput?"Integer":"LiteralInteger";case"this.constants.value":return this.getConstantType(e.property.name);case"this.constants.value[]":return this.getLookupType(this.getConstantType(e.object.property.name));case"this.constants.value[][]":return this.getLookupType(this.getConstantType(e.object.object.property.name));case"this.constants.value[][][]":return this.getLookupType(this.getConstantType(e.object.object.object.property.name));case"this.constants.value[][][][]":return this.getLookupType(this.getConstantType(e.object.object.object.object.property.name));case"fn()[]":case"fn()[][]":case"fn()[][][]":return this.getLookupType(this.getType(e.object));case"value.value":if(this.isAstMathVariable(e))return"Number";switch(e.property.name){case"r":case"g":case"b":case"a":return this.getLookupType(this.getCheckVariableType(e.object))}case"[][]":return"Number"}throw this.astErrorOutput("Unhandled getType MemberExpression",e)}throw this.astErrorOutput("Unhandled getType MemberExpression",e);case"ConditionalExpression":return this.getType(e.consequent);case"FunctionDeclaration":case"FunctionExpression":const s=this.findLastReturn(e.body);return s?this.getType(s):null;case"IfStatement":return this.getType(e.consequent);case"SequenceExpression":return this.getType(e.expressions[e.expressions.length-1]);default:throw this.astErrorOutput(`Unhandled getType Type "${e.type}"`,e)}}getCheckVariableType(e){const t=this.getVariableType(e);if(!t)throw this.astErrorOutput(`${e.type} is not defined`,e);return t}inferArgumentTypesIfNeeded(e,t){for(let r=0;r<t.length;r++){if(!this.needsArgumentType(e,r))continue;const n=this.getType(t[r]);if(!n)throw this.astErrorOutput(`Unable to infer argument ${r}`,t[r]);this.assignArgumentType(e,r,n)}}isAstMathVariable(e){return"MemberExpression"===e.type&&e.object&&"Identifier"===e.object.type&&"Math"===e.object.name&&e.property&&"Identifier"===e.property.type&&["E","PI","SQRT2","SQRT1_2","LN2","LN10","LOG2E","LOG10E"].indexOf(e.property.name)>-1}isAstMathFunction(e){return"CallExpression"===e.type&&e.callee&&"MemberExpression"===e.callee.type&&e.callee.object&&"Identifier"===e.callee.object.type&&"Math"===e.callee.object.name&&e.callee.property&&"Identifier"===e.callee.property.type&&["abs","acos","acosh","asin","asinh","atan","atan2","atanh","cbrt","ceil","clz32","cos","cosh","expm1","exp","floor","fround","imul","log","log2","log10","log1p","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc"].indexOf(e.callee.property.name)>-1}isAstVariable(e){return"Identifier"===e.type||"MemberExpression"===e.type}isSafe(e){return this.isSafeDependencies(this.getDependencies(e))}isSafeDependencies(e){return!e||!e.every||e.every(e=>e.isSafe)}getDependencies(e,t,r){if(t||(t=[]),!e)return null;if(Array.isArray(e)){for(let n=0;n<e.length;n++)this.getDependencies(e[n],t,r);return t}switch(e.type){case"AssignmentExpression":return this.getDependencies(e.left,t,r),this.getDependencies(e.right,t,r),t;case"ConditionalExpression":return this.getDependencies(e.test,t,r),this.getDependencies(e.alternate,t,r),this.getDependencies(e.consequent,t,r),t;case"Literal":t.push({origin:"literal",value:e.value,isSafe:!0!==r&&e.value>-1/0&&e.value<1/0&&!isNaN(e.value)});break;case"VariableDeclarator":return this.getDependencies(e.init,t,r);case"Identifier":const n=this.getDeclaration(e);if(n)t.push({name:e.name,origin:"declaration",isSafe:!r&&this.isSafeDependencies(n.dependencies)});else if(this.argumentNames.indexOf(e.name)>-1)t.push({name:e.name,origin:"argument",isSafe:!1});else if(this.strictTypingChecking)throw new Error(`Cannot find identifier origin "${e.name}"`);break;case"FunctionDeclaration":return this.getDependencies(e.body.body[e.body.body.length-1],t,r);case"ReturnStatement":return this.getDependencies(e.argument,t);case"BinaryExpression":case"LogicalExpression":return r="/"===e.operator||"*"===e.operator,this.getDependencies(e.left,t,r),this.getDependencies(e.right,t,r),t;case"UnaryExpression":case"UpdateExpression":return this.getDependencies(e.argument,t,r);case"VariableDeclaration":return this.getDependencies(e.declarations,t,r);case"ArrayExpression":return t.push({origin:"declaration",isSafe:!0}),t;case"CallExpression":return t.push({origin:"function",isSafe:!0}),t;case"MemberExpression":const i=this.getMemberExpressionDetails(e);switch(i.signature){case"value[]":this.getDependencies(e.object,t,r);break;case"value[][]":this.getDependencies(e.object.object,t,r);break;case"value[][][]":this.getDependencies(e.object.object.object,t,r);break;case"this.output.value":this.dynamicOutput&&t.push({name:i.name,origin:"output",isSafe:!1})}if(i)return i.property&&this.getDependencies(i.property,t,r),i.xProperty&&this.getDependencies(i.xProperty,t,r),i.yProperty&&this.getDependencies(i.yProperty,t,r),i.zProperty&&this.getDependencies(i.zProperty,t,r),t;case"SequenceExpression":return this.getDependencies(e.expressions,t,r);default:throw this.astErrorOutput(`Unhandled type ${e.type} in getDependencies`,e)}return t}getVariableSignature(e,t){if(!this.isAstVariable(e))throw new Error(`ast of type "${e.type}" is not a variable signature`);if("Identifier"===e.type)return"value";const r=[];for(;e;)e.computed?r.push("[]"):"ThisExpression"===e.type?r.unshift("this"):e.property&&e.property.name?"x"===e.property.name||"y"===e.property.name||"z"===e.property.name?r.unshift(t?"."+e.property.name:".value"):"constants"===e.property.name||"thread"===e.property.name||"output"===e.property.name?r.unshift("."+e.property.name):r.unshift(t?"."+e.property.name:".value"):e.name?r.unshift(t?e.name:"value"):e.callee&&e.callee.name?r.unshift(t?e.callee.name+"()":"fn()"):e.elements?r.unshift("[]"):r.unshift("unknown"),e=e.object;const n=r.join("");return t?n:["value","value[]","value[][]","value[][][]","value[][][][]","value.value","value.thread.value","this.thread.value","this.output.value","this.constants.value","this.constants.value[]","this.constants.value[][]","this.constants.value[][][]","this.constants.value[][][][]","fn()[]","fn()[][]","fn()[][][]","[][]"].indexOf(n)>-1?n:null}build(){return this.toString().length>0}astGeneric(e,t){if(null===e)throw this.astErrorOutput("NULL ast",e);if(Array.isArray(e)){for(let r=0;r<e.length;r++)this.astGeneric(e[r],t);return t}switch(e.type){case"FunctionDeclaration":return this.astFunctionDeclaration(e,t);case"FunctionExpression":return this.astFunctionExpression(e,t);case"ReturnStatement":return this.astReturnStatement(e,t);case"Literal":return this.astLiteral(e,t);case"BinaryExpression":return this.astBinaryExpression(e,t);case"Identifier":return this.astIdentifierExpression(e,t);case"AssignmentExpression":return this.astAssignmentExpression(e,t);case"ExpressionStatement":return this.astExpressionStatement(e,t);case"EmptyStatement":return this.astEmptyStatement(e,t);case"BlockStatement":return this.astBlockStatement(e,t);case"IfStatement":return this.astIfStatement(e,t);case"SwitchStatement":return this.astSwitchStatement(e,t);case"BreakStatement":return this.astBreakStatement(e,t);case"ContinueStatement":return this.astContinueStatement(e,t);case"ForStatement":return this.astForStatement(e,t);case"WhileStatement":return this.astWhileStatement(e,t);case"DoWhileStatement":return this.astDoWhileStatement(e,t);case"VariableDeclaration":return this.astVariableDeclaration(e,t);case"VariableDeclarator":return this.astVariableDeclarator(e,t);case"ThisExpression":return this.astThisExpression(e,t);case"SequenceExpression":return this.astSequenceExpression(e,t);case"UnaryExpression":return this.astUnaryExpression(e,t);case"UpdateExpression":return this.astUpdateExpression(e,t);case"LogicalExpression":return this.astLogicalExpression(e,t);case"MemberExpression":return this.astMemberExpression(e,t);case"CallExpression":return this.astCallExpression(e,t);case"ArrayExpression":return this.astArrayExpression(e,t);case"DebuggerStatement":return this.astDebuggerStatement(e,t);case"ConditionalExpression":return this.astConditionalExpression(e,t)}throw this.astErrorOutput("Unknown ast type : "+e.type,e)}astErrorOutput(e,t){if("string"!=typeof this.source)return new Error(e);const r=i.getAstString(this.source,t),n=this.source.substr(t.start).split(/\n/),s=n.length>0?n[n.length-1]:0;return new Error(`${e} on line ${n.length}, position ${s.length}:\n ${r}`)}astDebuggerStatement(e,t){return t}astConditionalExpression(e,t){if("ConditionalExpression"!==e.type)throw this.astErrorOutput("Not a conditional expression",e);return t.push("("),this.astGeneric(e.test,t),t.push("?"),this.astGeneric(e.consequent,t),t.push(":"),this.astGeneric(e.alternate,t),t.push(")"),t}astFunction(e,t){throw new Error(`"astFunction" not defined on ${this.constructor.name}`)}astFunctionDeclaration(e,t){return this.isChildFunction(e)?t:this.astFunction(e,t)}astFunctionExpression(e,t){return this.isChildFunction(e)?t:this.astFunction(e,t)}isChildFunction(e){for(let t=0;t<this.functions.length;t++)if(this.functions[t]===e)return!0;return!1}astReturnStatement(e,t){return t}astLiteral(e,t){return this.literalTypes[this.astKey(e)]="Number",t}astBinaryExpression(e,t){return t}astIdentifierExpression(e,t){return t}astAssignmentExpression(e,t){return t}astExpressionStatement(e,t){return this.astGeneric(e.expression,t),t.push(";"),t}astEmptyStatement(e,t){return t}astBlockStatement(e,t){return t}astIfStatement(e,t){return t}astSwitchStatement(e,t){return t}astBreakStatement(e,t){return t.push("break;"),t}astContinueStatement(e,t){return t.push("continue;\n"),t}astForStatement(e,t){return t}astWhileStatement(e,t){return t}astDoWhileStatement(e,t){return t}astVariableDeclarator(e,t){return this.astGeneric(e.id,t),null!==e.init&&(t.push("="),this.astGeneric(e.init,t)),t}astThisExpression(e,t){return t}astSequenceExpression(e,t){const{expressions:r}=e,n=[];for(let e=0;e<r.length;e++){const t=r[e],i=[];this.astGeneric(t,i),n.push(i.join(""))}return n.length>1?t.push("(",n.join(","),")"):t.push(n[0]),t}astUnaryExpression(e,t){return this.checkAndUpconvertBitwiseUnary(e,t)?t:(e.prefix?(t.push(e.operator),this.astGeneric(e.argument,t)):(this.astGeneric(e.argument,t),t.push(e.operator)),t)}checkAndUpconvertBitwiseUnary(e,t){}astUpdateExpression(e,t){return e.prefix?(t.push(e.operator),this.astGeneric(e.argument,t)):(this.astGeneric(e.argument,t),t.push(e.operator)),t}astLogicalExpression(e,t){return t.push("("),this.astGeneric(e.left,t),t.push(e.operator),this.astGeneric(e.right,t),t.push(")"),t}astMemberExpression(e,t){return t}astCallExpression(e,t){return t}astArrayExpression(e,t){return t}getMemberExpressionDetails(e){if("MemberExpression"!==e.type)throw this.astErrorOutput(`Expression ${e.type} not a MemberExpression`,e);let t=null,r=null;const n=this.getVariableSignature(e);switch(n){case"value":return null;case"value.thread.value":case"this.thread.value":case"this.output.value":return{signature:n,type:"Integer",name:e.property.name};case"value[]":if("string"!=typeof e.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.name,origin:"user",signature:n,type:this.getVariableType(e.object),xProperty:e.property};case"value[][]":if("string"!=typeof e.object.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.object.name,origin:"user",signature:n,type:this.getVariableType(e.object.object),yProperty:e.object.property,xProperty:e.property};case"value[][][]":if("string"!=typeof e.object.object.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.object.object.name,origin:"user",signature:n,type:this.getVariableType(e.object.object.object),zProperty:e.object.object.property,yProperty:e.object.property,xProperty:e.property};case"value[][][][]":if("string"!=typeof e.object.object.object.object.name)throw this.astErrorOutput("Unexpected expression",e);return{name:t=e.object.object.object.object.name,origin:"user",signature:n,type:this.getVariableType(e.object.object.object.object),zProperty:e.object.object.property,yProperty:e.object.property,xProperty:e.property};case"value.value":if("string"!=typeof e.property.name)throw this.astErrorOutput("Unexpected expression",e);if(this.isAstMathVariable(e))return{name:t=e.property.name,origin:"Math",type:"Number",signature:n};switch(e.property.name){case"r":case"g":case"b":case"a":return{name:t=e.object.name,property:e.property.name,origin:"user",signature:n,type:"Number"};default:throw this.astErrorOutput("Unexpected expression",e)}case"this.constants.value":if("string"!=typeof e.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n};case"this.constants.value[]":if("string"!=typeof e.object.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.object.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n,xProperty:e.property};case"this.constants.value[][]":if("string"!=typeof e.object.object.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.object.object.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n,yProperty:e.object.property,xProperty:e.property};case"this.constants.value[][][]":if("string"!=typeof e.object.object.object.property.name)throw this.astErrorOutput("Unexpected expression",e);if(t=e.object.object.object.property.name,!(r=this.getConstantType(t)))throw this.astErrorOutput("Constant has no type",e);return{name:t,type:r,origin:"constants",signature:n,zProperty:e.object.object.property,yProperty:e.object.property,xProperty:e.property};case"fn()[]":case"fn()[][]":case"[][]":return{signature:n,property:e.property};default:throw this.astErrorOutput("Unexpected expression",e)}}findIdentifierOrigin(e){const t=[this.ast];for(;t.length>0;){const r=t[0];if("VariableDeclarator"===r.type&&r.id&&r.id.name&&r.id.name===e.name)return r;if(t.shift(),r.argument)t.push(r.argument);else if(r.body)t.push(r.body);else if(r.declarations)t.push(r.declarations);else if(Array.isArray(r))for(let e=0;e<r.length;e++)t.push(r[e])}return null}findLastReturn(e){const t=[e||this.ast];for(;t.length>0;){const e=t.pop();if("ReturnStatement"===e.type)return e;if("FunctionDeclaration"!==e.type)if(e.argument)t.push(e.argument);else if(e.body)t.push(e.body);else if(e.declarations)t.push(e.declarations);else if(Array.isArray(e))for(let r=0;r<e.length;r++)t.push(e[r]);else e.consequent?t.push(e.consequent):e.cases&&t.push(e.cases)}return null}getInternalVariableName(e){return this._internalVariableNames.hasOwnProperty(e)||(this._internalVariableNames[e]=0),this._internalVariableNames[e]++,1===this._internalVariableNames[e]?e:e+this._internalVariableNames[e]}astKey(e,t=","){if(!e.start||!e.end)throw new Error("AST start and end needed");return`${e.start}${t}${e.end}`}}}},{"../utils":291,"./function-tracer":190,acorn:23}],190:[function(e,t,r){const{utils:n}=e("../utils");function i(e){return e.length>0?e[e.length-1]:null}const s={trackIdentifiers:"trackIdentifiers",memberExpression:"memberExpression",inForLoopInit:"inForLoopInit"};t.exports={FunctionTracer:class{constructor(e){this.runningContexts=[],this.functionContexts=[],this.contexts=[],this.functionCalls=[],this.declarations=[],this.identifiers=[],this.functions=[],this.returnStatements=[],this.trackedIdentifiers=null,this.states=[],this.newFunctionContext(),this.scan(e)}isState(e){return this.states[this.states.length-1]===e}hasState(e){return this.states.indexOf(e)>-1}pushState(e){this.states.push(e)}popState(e){if(!this.isState(e))throw new Error(`Cannot pop the non-active state "${e}"`);this.states.pop()}get currentFunctionContext(){return i(this.functionContexts)}get currentContext(){return i(this.runningContexts)}newFunctionContext(){const e={"@contextType":"function"};this.contexts.push(e),this.functionContexts.push(e)}newContext(e){const t=Object.assign({"@contextType":"const/let"},this.currentContext);this.contexts.push(t),this.runningContexts.push(t),e();const{currentFunctionContext:r}=this;for(const e in r)r.hasOwnProperty(e)&&!t.hasOwnProperty(e)&&(t[e]=r[e]);return this.runningContexts.pop(),t}useFunctionContext(e){const t=i(this.functionContexts);this.runningContexts.push(t),e(),this.runningContexts.pop()}getIdentifiers(e){const t=this.trackedIdentifiers=[];return this.pushState(s.trackIdentifiers),e(),this.trackedIdentifiers=null,this.popState(s.trackIdentifiers),t}getDeclaration(e){const{currentContext:t,currentFunctionContext:r,runningContexts:n}=this,i=t[e]||r[e]||null;if(!i&&t===r&&n.length>0){const t=n[n.length-2];if(t[e])return t[e]}return i}scan(e){if(e)if(Array.isArray(e))for(let t=0;t<e.length;t++)this.scan(e[t]);else switch(e.type){case"Program":this.useFunctionContext(()=>{this.scan(e.body)});break;case"BlockStatement":this.newContext(()=>{this.scan(e.body)});break;case"AssignmentExpression":case"LogicalExpression":case"BinaryExpression":this.scan(e.left),this.scan(e.right);break;case"UpdateExpression":if("++"===e.operator){const t=this.getDeclaration(e.argument.name);t&&(t.suggestedType="Integer")}this.scan(e.argument);break;case"UnaryExpression":this.scan(e.argument);break;case"VariableDeclaration":"var"===e.kind?this.useFunctionContext(()=>{e.declarations=n.normalizeDeclarations(e),this.scan(e.declarations)}):(e.declarations=n.normalizeDeclarations(e),this.scan(e.declarations));break;case"VariableDeclarator":{const{currentContext:t}=this,r=this.hasState(s.inForLoopInit),n={ast:e,context:t,name:e.id.name,origin:"declaration",inForLoopInit:r,inForLoopTest:null,assignable:t===this.currentFunctionContext||!r&&!t.hasOwnProperty(e.id.name),suggestedType:null,valueType:null,dependencies:null,isSafe:null};t[e.id.name]||(t[e.id.name]=n),this.declarations.push(n),this.scan(e.id),this.scan(e.init);break}case"FunctionExpression":case"FunctionDeclaration":0===this.runningContexts.length?this.scan(e.body):this.functions.push(e);break;case"IfStatement":this.scan(e.test),this.scan(e.consequent),e.alternate&&this.scan(e.alternate);break;case"ForStatement":{let t;const r=this.newContext(()=>{this.pushState(s.inForLoopInit),this.scan(e.init),this.popState(s.inForLoopInit),t=this.getIdentifiers(()=>{this.scan(e.test)}),this.scan(e.update),this.newContext(()=>{this.scan(e.body)})});if(t)for(const e in r)"@contextType"!==e&&t.indexOf(e)>-1&&(r[e].inForLoopTest=!0);break}case"DoWhileStatement":case"WhileStatement":this.newContext(()=>{this.scan(e.body),this.scan(e.test)});break;case"Identifier":this.isState(s.trackIdentifiers)&&this.trackedIdentifiers.push(e.name),this.identifiers.push({context:this.currentContext,declaration:this.getDeclaration(e.name),ast:e});break;case"ReturnStatement":this.returnStatements.push(e),this.scan(e.argument);break;case"MemberExpression":this.pushState(s.memberExpression),this.scan(e.object),this.scan(e.property),this.popState(s.memberExpression);break;case"ExpressionStatement":this.scan(e.expression);break;case"SequenceExpression":this.scan(e.expressions);break;case"CallExpression":this.functionCalls.push({context:this.currentContext,ast:e}),this.scan(e.arguments);break;case"ArrayExpression":this.scan(e.elements);break;case"ConditionalExpression":this.scan(e.test),this.scan(e.alternate),this.scan(e.consequent);break;case"SwitchStatement":this.scan(e.discriminant),this.scan(e.cases);break;case"SwitchCase":this.scan(e.test),this.scan(e.consequent);break;case"ThisExpression":case"Literal":case"DebuggerStatement":case"EmptyStatement":case"BreakStatement":case"ContinueStatement":break;default:throw new Error(`unhandled type "${e.type}"`)}}}}},{"../utils":291}],191:[function(e,t,r){const{glWiretap:n}=e("gl-wiretap"),{utils:i}=e("../../utils");function s(e){return e.toString().replace("=>","").replace(/^function /,"").replace(/utils[.]/g,"/*utils.*/")}function o(e,t){const r="single"===t.precision?e:`new Float32Array(${e}.buffer)`;return t.output[2]?`renderOutput(${r}, ${t.output[0]}, ${t.output[1]}, ${t.output[2]})`:t.output[1]?`renderOutput(${r}, ${t.output[0]}, ${t.output[1]})`:`renderOutput(${r}, ${t.output[0]})`}function a(e,t,r){const n=e.toArray.toString(),s=!/^function/.test(n);return`() => {\n function framebuffer() { return ${r}; };\n ${i.flattenFunctionToString(`${s?"function ":""}${n}`,{findDependency:(t,r)=>{if("utils"===t)return`const ${r} = ${i[r].toString()};`;if("this"===t)return"framebuffer"===r?"":`${s?"function ":""}${e[r].toString()}`;throw new Error("unhandled fromObject")},thisLookup:(r,n)=>{if("texture"===r)return t;if("context"===r)return n?null:"gl";if(e.hasOwnProperty(r))return JSON.stringify(e[r]);throw new Error(`unhandled thisLookup ${r}`)}})}\n return toArray();\n }`}function u(e,t,r,n,i){if(null===e)return null;if(null===t)return null;switch(typeof e){case"boolean":case"number":return null}if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)for(let i=0;i<t.length;i++){const s=t[i];if("HTMLImageArray"!==s.type&&s)continue;if(s.uploadValue!==e)continue;const o=r[i].indexOf(e);if(-1===o)continue;const a=`uploadValue_${s.name}[${o}]`;return n.insertVariable(a,e),a}for(let r=0;r<t.length;r++){const i=t[r];if(e!==i.uploadValue)continue;const s=`uploadValue_${i.name}`;return n.insertVariable(s,i),s}return null}t.exports={glKernelString:function(e,t,r,l,c){r.built||r.build.apply(r,t),t=t?Array.from(t).map(e=>{switch(typeof e){case"boolean":return new Boolean(e);case"number":return new Number(e);default:return e}}):null;const h=[],p=n(r.context,{useTrackablePrimitives:!0,onReadPixels:e=>{if(P.subKernels){if(f){const t=P.subKernels[d++].property;h.push(` result${isNaN(t)?"."+t:`[${t}]`} = ${o(e,P)};`)}else h.push(` const result = { result: ${o(e,P)} };`),f=!0;d===P.subKernels.length&&h.push(" return result;")}else e?h.push(` return ${o(e,P)};`):h.push(" return null;")},onUnrecognizedArgumentLookup:e=>{const t=u(e,P.kernelArguments,[],p);if(t)return t;const r=u(e,P.kernelConstants,x?Object.keys(x).map(e=>x[e]):[],p);return r||null}});let f=!1,d=0;const{source:m,canvas:g,output:v,pipeline:y,graphical:_,loopMaxIterations:b,constants:x,optimizeFloatMemory:w,precision:E,fixIntegerDivisionAccuracy:T,functions:A,nativeFunctions:S,subKernels:k,immutable:C,argumentTypes:I,constantTypes:R,kernelArguments:L,kernelConstants:O,tactic:M}=r,P=new e(m,{canvas:g,context:p,checkContext:!1,output:v,pipeline:y,graphical:_,loopMaxIterations:b,constants:x,optimizeFloatMemory:w,precision:E,fixIntegerDivisionAccuracy:T,functions:A,nativeFunctions:S,subKernels:k,immutable:C,argumentTypes:I,constantTypes:R,tactic:M});let B=[];if(p.setIndent(2),P.build.apply(P,t),B.push(p.toString()),p.reset(),P.kernelArguments.forEach((e,r)=>{switch(e.type){case"Integer":case"Boolean":case"Number":case"Float":case"Array":case"Array(2)":case"Array(3)":case"Array(4)":case"HTMLCanvas":case"HTMLImage":case"HTMLVideo":p.insertVariable(`uploadValue_${e.name}`,e.uploadValue);break;case"HTMLImageArray":for(let n=0;n<t[r].length;n++){const i=t[r];p.insertVariable(`uploadValue_${e.name}[${n}]`,i[n])}break;case"Input":p.insertVariable(`uploadValue_${e.name}`,e.uploadValue);break;case"MemoryOptimizedNumberTexture":case"NumberTexture":case"Array1D(2)":case"Array1D(3)":case"Array1D(4)":case"Array2D(2)":case"Array2D(3)":case"Array2D(4)":case"Array3D(2)":case"Array3D(3)":case"Array3D(4)":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":p.insertVariable(`uploadValue_${e.name}`,t[r].texture);break;default:throw new Error(`unhandled kernelArgumentType insertion for glWiretap of type ${e.type}`)}}),B.push("/** start of injected functions **/"),B.push(`function ${s(i.flattenTo)}`),B.push(`function ${s(i.flatten2dArrayTo)}`),B.push(`function ${s(i.flatten3dArrayTo)}`),B.push(`function ${s(i.flatten4dArrayTo)}`),B.push(`function ${s(i.isArray)}`),P.renderOutput!==P.renderTexture&&P.formatValues&&B.push(` const renderOutput = function ${s(P.formatValues)};`),B.push("/** end of injected functions **/"),B.push(` const innerKernel = function (${P.kernelArguments.map(e=>e.varName).join(", ")}) {`),p.setIndent(4),P.run.apply(P,t),P.renderKernels?P.renderKernels():P.renderOutput&&P.renderOutput(),B.push(" /** start setup uploads for kernel values **/"),P.kernelArguments.forEach(e=>{B.push(" "+e.getStringValueHandler().split("\n").join("\n "))}),B.push(" /** end setup uploads for kernel values **/"),B.push(p.toString()),P.renderOutput===P.renderTexture){p.reset();const e=p.getContextVariableName(P.framebuffer);if(P.renderKernels){const t=P.renderKernels(),r=p.getContextVariableName(P.texture.texture);B.push(` return {\n result: {\n texture: ${r},\n type: '${t.result.type}',\n toArray: ${a(t.result,r,e)}\n },`);const{subKernels:n,mappedTextures:i}=P;for(let r=0;r<n.length;r++){const s=i[r],o=n[r],u=t[o.property],l=p.getContextVariableName(s.texture);B.push(`\n ${o.property}: {\n texture: ${l},\n type: '${u.type}',\n toArray: ${a(u,l,e)}\n },`)}B.push(" };")}else{const t=P.renderOutput(),r=p.getContextVariableName(P.texture.texture);B.push(` return {\n texture: ${r},\n type: '${t.type}',\n toArray: ${a(t,r,e)}\n };`)}}B.push(` ${c?"\n"+c+" ":""}`),B.push(h.join("\n")),B.push(" };"),P.graphical&&(B.push(function(e){const t=e.getPixels.toString(),r=!/^function/.test(t);return i.flattenFunctionToString(`${r?"function ":""}${t}`,{findDependency:(e,t)=>"utils"===e?`const ${t} = ${i[t].toString()};`:null,thisLookup:t=>{if("context"===t)return null;if(e.hasOwnProperty(t))return JSON.stringify(e[t]);throw new Error(`unhandled thisLookup ${t}`)}})}(P)),B.push(" innerKernel.getPixels = getPixels;")),B.push(" return innerKernel;");let N=[];return O.forEach(e=>{N.push(`${e.getStringValueHandler()}`)}),`function kernel(settings) {\n const { context, constants } = settings;\n ${N.join("")}\n ${l||""}\n${B.join("\n")}\n}`}}},{"../../utils":291,"gl-wiretap":135}],192:[function(e,t,r){const{Kernel:n}=e("../kernel"),{utils:i}=e("../../utils"),{GLTextureArray2Float:s}=e("./texture/array-2-float"),{GLTextureArray2Float2D:o}=e("./texture/array-2-float-2d"),{GLTextureArray2Float3D:a}=e("./texture/array-2-float-3d"),{GLTextureArray3Float:u}=e("./texture/array-3-float"),{GLTextureArray3Float2D:l}=e("./texture/array-3-float-2d"),{GLTextureArray3Float3D:c}=e("./texture/array-3-float-3d"),{GLTextureArray4Float:h}=e("./texture/array-4-float"),{GLTextureArray4Float2D:p}=e("./texture/array-4-float-2d"),{GLTextureArray4Float3D:f}=e("./texture/array-4-float-3d"),{GLTextureFloat:d}=e("./texture/float"),{GLTextureFloat2D:m}=e("./texture/float-2d"),{GLTextureFloat3D:g}=e("./texture/float-3d"),{GLTextureMemoryOptimized:v}=e("./texture/memory-optimized"),{GLTextureMemoryOptimized2D:y}=e("./texture/memory-optimized-2d"),{GLTextureMemoryOptimized3D:_}=e("./texture/memory-optimized-3d"),{GLTextureUnsigned:b}=e("./texture/unsigned"),{GLTextureUnsigned2D:x}=e("./texture/unsigned-2d"),{GLTextureUnsigned3D:w}=e("./texture/unsigned-3d"),{GLTextureGraphical:E}=e("./texture/graphical");const T={int:"Integer",float:"Number",vec2:"Array(2)",vec3:"Array(3)",vec4:"Array(4)"};t.exports={GLKernel:class extends n{static get mode(){return"gpu"}static getIsFloatRead(){const e=new this("function kernelFunction() {\n return 1;\n }",{context:this.testContext,canvas:this.testCanvas,validate:!1,output:[1],precision:"single",returnType:"Number",tactic:"speed"});e.build(),e.run();const t=e.renderOutput();return e.destroy(!0),1===t[0]}static getIsIntegerDivisionAccurate(){const e=new this(function(e,t){return e[this.thread.x]/t[this.thread.x]}.toString(),{context:this.testContext,canvas:this.testCanvas,validate:!1,output:[2],returnType:"Number",precision:"unsigned",tactic:"speed"}),t=[[6,6030401],[3,3991]];e.build.apply(e,t),e.run.apply(e,t);const r=e.renderOutput();return e.destroy(!0),2===r[0]&&1511===r[1]}static getIsSpeedTacticSupported(){const e=new this(function(e){return e[this.thread.x]}.toString(),{context:this.testContext,canvas:this.testCanvas,validate:!1,output:[4],returnType:"Number",precision:"unsigned",tactic:"speed"}),t=[[0,1,2,3]];e.build.apply(e,t),e.run.apply(e,t);const r=e.renderOutput();return e.destroy(!0),0===Math.round(r[0])&&1===Math.round(r[1])&&2===Math.round(r[2])&&3===Math.round(r[3])}static get testCanvas(){throw new Error(`"testCanvas" not defined on ${this.name}`)}static get testContext(){throw new Error(`"testContext" not defined on ${this.name}`)}static getFeatures(){const e=this.testContext,t=this.getIsDrawBuffers();return Object.freeze({isFloatRead:this.getIsFloatRead(),isIntegerDivisionAccurate:this.getIsIntegerDivisionAccurate(),isSpeedTacticSupported:this.getIsSpeedTacticSupported(),isTextureFloat:this.getIsTextureFloat(),isDrawBuffers:t,kernelMap:t,channelCount:this.getChannelCount(),maxTextureSize:this.getMaxTextureSize(),lowIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT),lowFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT),mediumIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT),mediumFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT),highIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT),highFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT)})}static setupFeatureChecks(){throw new Error(`"setupFeatureChecks" not defined on ${this.name}`)}static getSignature(e,t){return e.getVariablePrecisionString()+(t.length>0?":"+t.join(","):"")}setFixIntegerDivisionAccuracy(e){return this.fixIntegerDivisionAccuracy=e,this}setPrecision(e){return this.precision=e,this}setFloatTextures(e){return i.warnDeprecated("method","setFloatTextures","setOptimizeFloatMemory"),this.floatTextures=e,this}static nativeFunctionArguments(e){const t=[],r=[],n=[],i=/^[a-zA-Z_]/,s=/[a-zA-Z_0-9]/;let o=0,a=null,u=null;for(;o<e.length;){const l=e[o],c=e[o+1],h=n.length>0?n[n.length-1]:null;if("FUNCTION_ARGUMENTS"!==h||"/"!==l||"*"!==c)if("MULTI_LINE_COMMENT"!==h||"*"!==l||"/"!==c)if("FUNCTION_ARGUMENTS"!==h||"/"!==l||"/"!==c)if("COMMENT"!==h||"\n"!==l)if(null!==h||"("!==l){if("FUNCTION_ARGUMENTS"===h){if(")"===l){n.pop();break}if("f"===l&&"l"===c&&"o"===e[o+2]&&"a"===e[o+3]&&"t"===e[o+4]&&" "===e[o+5]){n.push("DECLARE_VARIABLE"),u="float",a="",o+=6;continue}if("i"===l&&"n"===c&&"t"===e[o+2]&&" "===e[o+3]){n.push("DECLARE_VARIABLE"),u="int",a="",o+=4;continue}if("v"===l&&"e"===c&&"c"===e[o+2]&&"2"===e[o+3]&&" "===e[o+4]){n.push("DECLARE_VARIABLE"),u="vec2",a="",o+=5;continue}if("v"===l&&"e"===c&&"c"===e[o+2]&&"3"===e[o+3]&&" "===e[o+4]){n.push("DECLARE_VARIABLE"),u="vec3",a="",o+=5;continue}if("v"===l&&"e"===c&&"c"===e[o+2]&&"4"===e[o+3]&&" "===e[o+4]){n.push("DECLARE_VARIABLE"),u="vec4",a="",o+=5;continue}}else if("DECLARE_VARIABLE"===h){if(""===a){if(" "===l){o++;continue}if(!i.test(l))throw new Error("variable name is not expected string")}a+=l,s.test(c)||(n.pop(),r.push(a),t.push(T[u]))}o++}else n.push("FUNCTION_ARGUMENTS"),o++;else n.pop(),o++;else n.push("COMMENT"),o+=2;else n.pop(),o+=2;else n.push("MULTI_LINE_COMMENT"),o+=2}if(n.length>0)throw new Error("GLSL function was not parsable");return{argumentNames:r,argumentTypes:t}}static nativeFunctionReturnType(e){return T[e.match(/int|float|vec[2-4]/)[0]]}static combineKernels(e,t){e.apply(null,arguments);const{texSize:r,context:n,threadDim:s}=t.texSize;let o;if("single"===t.precision){const e=r[0],t=Math.ceil(r[1]/4);o=new Float32Array(e*t*4*4),n.readPixels(0,0,e,4*t,n.RGBA,n.FLOAT,o)}else{const e=new Uint8Array(r[0]*r[1]*4);n.readPixels(0,0,r[0],r[1],n.RGBA,n.UNSIGNED_BYTE,e),o=new Float32Array(e.buffer)}return o=o.subarray(0,s[0]*s[1]*s[2]),1===t.output.length?o:2===t.output.length?i.splitArray(o,t.output[0]):3===t.output.length?i.splitArray(o,t.output[0]*t.output[1]).map(function(e){return i.splitArray(e,t.output[0])}):void 0}constructor(e,t){super(e,t),this.transferValues=null,this.formatValues=null,this.TextureConstructor=null,this.renderOutput=null,this.renderRawOutput=null,this.texSize=null,this.translatedSource=null,this.compiledFragmentShader=null,this.compiledVertexShader=null,this.switchingKernels=null,this._textureSwitched=null,this._mappedTextureSwitched=null}checkTextureSize(){const{features:e}=this.constructor;if(this.texSize[0]>e.maxTextureSize||this.texSize[1]>e.maxTextureSize)throw new Error(`Texture size [${this.texSize[0]},${this.texSize[1]}] generated by kernel is larger than supported size [${e.maxTextureSize},${e.maxTextureSize}]`)}translateSource(){throw new Error(`"translateSource" not defined on ${this.constructor.name}`)}pickRenderStrategy(e){if(this.graphical)return this.renderRawOutput=this.readPackedPixelsToUint8Array,this.transferValues=(e=>e),this.TextureConstructor=E,null;if("unsigned"===this.precision)if(this.renderRawOutput=this.readPackedPixelsToUint8Array,this.transferValues=this.readPackedPixelsToFloat32Array,this.pipeline)switch(this.renderOutput=this.renderTexture,null!==this.subKernels&&(this.renderKernels=this.renderKernelsToTextures),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=w,null):this.output[1]>0?(this.TextureConstructor=x,null):(this.TextureConstructor=b,null);case"Array(2)":case"Array(3)":case"Array(4)":return this.requestFallback(e)}else switch(null!==this.subKernels&&(this.renderKernels=this.renderKernelsToArrays),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.renderOutput=this.renderValues,this.output[2]>0?(this.TextureConstructor=w,this.formatValues=i.erect3DPackedFloat,null):this.output[1]>0?(this.TextureConstructor=x,this.formatValues=i.erect2DPackedFloat,null):(this.TextureConstructor=b,this.formatValues=i.erectPackedFloat,null);case"Array(2)":case"Array(3)":case"Array(4)":return this.requestFallback(e)}else{if("single"!==this.precision)throw new Error(`unhandled precision of "${this.precision}"`);if(this.renderRawOutput=this.readFloatPixelsToFloat32Array,this.transferValues=this.readFloatPixelsToFloat32Array,this.pipeline)switch(this.renderOutput=this.renderTexture,null!==this.subKernels&&(this.renderKernels=this.renderKernelsToTextures),this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.optimizeFloatMemory?this.output[2]>0?(this.TextureConstructor=_,null):this.output[1]>0?(this.TextureConstructor=y,null):(this.TextureConstructor=v,null):this.output[2]>0?(this.TextureConstructor=g,null):this.output[1]>0?(this.TextureConstructor=m,null):(this.TextureConstructor=d,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=a,null):this.output[1]>0?(this.TextureConstructor=o,null):(this.TextureConstructor=s,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=c,null):this.output[1]>0?(this.TextureConstructor=l,null):(this.TextureConstructor=u,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=f,null):this.output[1]>0?(this.TextureConstructor=p,null):(this.TextureConstructor=h,null)}if(this.renderOutput=this.renderValues,null!==this.subKernels&&(this.renderKernels=this.renderKernelsToArrays),this.optimizeFloatMemory)switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=_,this.formatValues=i.erectMemoryOptimized3DFloat,null):this.output[1]>0?(this.TextureConstructor=y,this.formatValues=i.erectMemoryOptimized2DFloat,null):(this.TextureConstructor=v,this.formatValues=i.erectMemoryOptimizedFloat,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=a,this.formatValues=i.erect3DArray2,null):this.output[1]>0?(this.TextureConstructor=o,this.formatValues=i.erect2DArray2,null):(this.TextureConstructor=s,this.formatValues=i.erectArray2,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=c,this.formatValues=i.erect3DArray3,null):this.output[1]>0?(this.TextureConstructor=l,this.formatValues=i.erect2DArray3,null):(this.TextureConstructor=u,this.formatValues=i.erectArray3,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=f,this.formatValues=i.erect3DArray4,null):this.output[1]>0?(this.TextureConstructor=p,this.formatValues=i.erect2DArray4,null):(this.TextureConstructor=h,this.formatValues=i.erectArray4,null)}else switch(this.returnType){case"LiteralInteger":case"Float":case"Number":case"Integer":return this.output[2]>0?(this.TextureConstructor=g,this.formatValues=i.erect3DFloat,null):this.output[1]>0?(this.TextureConstructor=m,this.formatValues=i.erect2DFloat,null):(this.TextureConstructor=d,this.formatValues=i.erectFloat,null);case"Array(2)":return this.output[2]>0?(this.TextureConstructor=a,this.formatValues=i.erect3DArray2,null):this.output[1]>0?(this.TextureConstructor=o,this.formatValues=i.erect2DArray2,null):(this.TextureConstructor=s,this.formatValues=i.erectArray2,null);case"Array(3)":return this.output[2]>0?(this.TextureConstructor=c,this.formatValues=i.erect3DArray3,null):this.output[1]>0?(this.TextureConstructor=l,this.formatValues=i.erect2DArray3,null):(this.TextureConstructor=u,this.formatValues=i.erectArray3,null);case"Array(4)":return this.output[2]>0?(this.TextureConstructor=f,this.formatValues=i.erect3DArray4,null):this.output[1]>0?(this.TextureConstructor=p,this.formatValues=i.erect2DArray4,null):(this.TextureConstructor=h,this.formatValues=i.erectArray4,null)}}throw new Error(`unhandled return type "${this.returnType}"`)}getKernelString(){throw new Error("abstract method call")}getMainResultTexture(){switch(this.returnType){case"LiteralInteger":case"Float":case"Integer":case"Number":return this.getMainResultNumberTexture();case"Array(2)":return this.getMainResultArray2Texture();case"Array(3)":return this.getMainResultArray3Texture();case"Array(4)":return this.getMainResultArray4Texture();default:throw new Error(`unhandled returnType type ${this.returnType}`)}}getMainResultKernelNumberTexture(){throw new Error("abstract method call")}getMainResultSubKernelNumberTexture(){throw new Error("abstract method call")}getMainResultKernelArray2Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray2Texture(){throw new Error("abstract method call")}getMainResultKernelArray3Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray3Texture(){throw new Error("abstract method call")}getMainResultKernelArray4Texture(){throw new Error("abstract method call")}getMainResultSubKernelArray4Texture(){throw new Error("abstract method call")}getMainResultGraphical(){throw new Error("abstract method call")}getMainResultMemoryOptimizedFloats(){throw new Error("abstract method call")}getMainResultPackedPixels(){throw new Error("abstract method call")}getMainResultString(){return this.graphical?this.getMainResultGraphical():"single"===this.precision?this.optimizeFloatMemory?this.getMainResultMemoryOptimizedFloats():this.getMainResultTexture():this.getMainResultPackedPixels()}getMainResultNumberTexture(){return i.linesToString(this.getMainResultKernelNumberTexture())+i.linesToString(this.getMainResultSubKernelNumberTexture())}getMainResultArray2Texture(){return i.linesToString(this.getMainResultKernelArray2Texture())+i.linesToString(this.getMainResultSubKernelArray2Texture())}getMainResultArray3Texture(){return i.linesToString(this.getMainResultKernelArray3Texture())+i.linesToString(this.getMainResultSubKernelArray3Texture())}getMainResultArray4Texture(){return i.linesToString(this.getMainResultKernelArray4Texture())+i.linesToString(this.getMainResultSubKernelArray4Texture())}getFloatTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} float;\n`}getIntTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic,!0)} int;\n`}getSampler2DTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} sampler2D;\n`}getSampler2DArrayTacticDeclaration(){return`precision ${this.getVariablePrecisionString(this.texSize,this.tactic)} sampler2DArray;\n`}renderTexture(){return this.immutable?this.texture.clone():this.texture}readPackedPixelsToUint8Array(){if("unsigned"!==this.precision)throw new Error('Requires this.precision to be "unsigned"');const{texSize:e,context:t}=this,r=new Uint8Array(e[0]*e[1]*4);return t.readPixels(0,0,e[0],e[1],t.RGBA,t.UNSIGNED_BYTE,r),r}readPackedPixelsToFloat32Array(){return new Float32Array(this.readPackedPixelsToUint8Array().buffer)}readFloatPixelsToFloat32Array(){if("single"!==this.precision)throw new Error('Requires this.precision to be "single"');const{texSize:e,context:t}=this,r=e[0],n=e[1],i=new Float32Array(r*n*4);return t.readPixels(0,0,r,n,t.RGBA,t.FLOAT,i),i}getPixels(e){const{context:t,output:r}=this,[n,s]=r,o=new Uint8Array(n*s*4);return t.readPixels(0,0,n,s,t.RGBA,t.UNSIGNED_BYTE,o),new Uint8ClampedArray((e?o:i.flipPixels(o,n,s)).buffer)}renderKernelsToArrays(){const e={result:this.renderOutput()};for(let t=0;t<this.subKernels.length;t++)e[this.subKernels[t].property]=this.mappedTextures[t].toArray();return e}renderKernelsToTextures(){const e={result:this.renderOutput()};if(this.immutable)for(let t=0;t<this.subKernels.length;t++)e[this.subKernels[t].property]=this.mappedTextures[t].clone();else for(let t=0;t<this.subKernels.length;t++)e[this.subKernels[t].property]=this.mappedTextures[t];return e}resetSwitchingKernels(){const e=this.switchingKernels;return this.switchingKernels=null,e}setOutput(e){const t=this.toKernelOutput(e);if(this.program){if(!this.dynamicOutput)throw new Error("Resizing a kernel with dynamicOutput: false is not possible");const r=[t[0],t[1]||1,t[2]||1],n=i.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},r),s=this.texSize;if(s){const t=this.getVariablePrecisionString(s,this.tactic),r=this.getVariablePrecisionString(n,this.tactic);if(t!==r)return this.debug&&console.warn("Precision requirement changed, asking GPU instance to recompile"),void this.switchKernels({type:"outputPrecisionMismatch",precision:r,needed:e})}this.output=t,this.threadDim=r,this.texSize=n;const{context:o}=this;if(o.bindFramebuffer(o.FRAMEBUFFER,this.framebuffer),this.updateMaxTexSize(),this.framebuffer.width=this.texSize[0],this.framebuffer.height=this.texSize[1],o.viewport(0,0,this.maxTexSize[0],this.maxTexSize[1]),this.canvas.width=this.maxTexSize[0],this.canvas.height=this.maxTexSize[1],this.texture&&this.texture.delete(),this.texture=null,this._setupOutputTexture(),this.mappedTextures&&this.mappedTextures.length>0){for(let e=0;e<this.mappedTextures.length;e++)this.mappedTextures[e].delete();this.mappedTextures=null,this._setupSubOutputTextures()}}else this.output=t;return this}renderValues(){return this.formatValues(this.transferValues(),this.output[0],this.output[1],this.output[2])}switchKernels(e){this.switchingKernels?this.switchingKernels.push(e):this.switchingKernels=[e]}getVariablePrecisionString(e=this.texSize,t=this.tactic,r=!1){if(!t){if(!this.constructor.features.isSpeedTacticSupported)return"highp";const t=this.constructor.features[r?"lowIntPrecision":"lowFloatPrecision"],n=this.constructor.features[r?"mediumIntPrecision":"mediumFloatPrecision"],i=this.constructor.features[r?"highIntPrecision":"highFloatPrecision"],s=Math.log2(e[0]*e[1]);if(s<=t.rangeMax)return"lowp";if(s<=n.rangeMax)return"mediump";if(s<=i.rangeMax)return"highp";throw new Error("The required size exceeds that of the ability of your system")}switch(t){case"speed":return"lowp";case"balanced":return"mediump";case"precision":return"highp";default:throw new Error(`Unknown tactic "${t}" use "speed", "balanced", "precision", or empty for auto`)}}updateTextureArgumentRefs(e,t){if(this.immutable)if(this.texture.texture===t.texture){const{prevArg:r}=e;r&&(1===r.texture._refs&&(this.texture.delete(),this.texture=r.clone(),this._textureSwitched=!0),r.delete()),e.prevArg=t.clone()}else if(this.mappedTextures&&this.mappedTextures.length>0){const{mappedTextures:r}=this;for(let n=0;n<r.length;n++){const i=r[n];if(i.texture===t.texture){const{prevArg:s}=e;return s&&(1===s.texture._refs&&(i.delete(),r[n]=s.clone(),this._mappedTextureSwitched[n]=!0),s.delete()),void(e.prevArg=t.clone())}}}}onActivate(e){if(this._textureSwitched=!0,this.texture=e.texture,this.mappedTextures){for(let e=0;e<this.mappedTextures.length;e++)this._mappedTextureSwitched[e]=!0;this.mappedTextures=e.mappedTextures}}initCanvas(){}}}},{"../../utils":291,"../kernel":215,"./texture/array-2-float":195,"./texture/array-2-float-2d":193,"./texture/array-2-float-3d":194,"./texture/array-3-float":198,"./texture/array-3-float-2d":196,"./texture/array-3-float-3d":197,"./texture/array-4-float":201,"./texture/array-4-float-2d":199,"./texture/array-4-float-3d":200,"./texture/float":204,"./texture/float-2d":202,"./texture/float-3d":203,"./texture/graphical":205,"./texture/memory-optimized":209,"./texture/memory-optimized-2d":207,"./texture/memory-optimized-3d":208,"./texture/unsigned":212,"./texture/unsigned-2d":210,"./texture/unsigned-3d":211}],193:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureArray2Float2D:class extends i{constructor(e){super(e),this.type="ArrayTexture(2)"}toArray(){return n.erect2DArray2(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":291,"./float":204}],194:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureArray2Float3D:class extends i{constructor(e){super(e),this.type="ArrayTexture(2)"}toArray(){return n.erect3DArray2(this.renderValues(),this.output[0],this.output[1],this.output[2])}}}},{"../../../utils":291,"./float":204}],195:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureArray2Float:class extends i{constructor(e){super(e),this.type="ArrayTexture(2)"}toArray(){return n.erectArray2(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":291,"./float":204}],196:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureArray3Float2D:class extends i{constructor(e){super(e),this.type="ArrayTexture(3)"}toArray(){return n.erect2DArray3(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":291,"./float":204}],197:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureArray3Float3D:class extends i{constructor(e){super(e),this.type="ArrayTexture(3)"}toArray(){return n.erect3DArray3(this.renderValues(),this.output[0],this.output[1],this.output[2])}}}},{"../../../utils":291,"./float":204}],198:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureArray3Float:class extends i{constructor(e){super(e),this.type="ArrayTexture(3)"}toArray(){return n.erectArray3(this.renderValues(),this.output[0])}}}},{"../../../utils":291,"./float":204}],199:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureArray4Float2D:class extends i{constructor(e){super(e),this.type="ArrayTexture(4)"}toArray(){return n.erect2DArray4(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":291,"./float":204}],200:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureArray4Float3D:class extends i{constructor(e){super(e),this.type="ArrayTexture(4)"}toArray(){return n.erect3DArray4(this.renderValues(),this.output[0],this.output[1],this.output[2])}}}},{"../../../utils":291,"./float":204}],201:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureArray4Float:class extends i{constructor(e){super(e),this.type="ArrayTexture(4)"}toArray(){return n.erectArray4(this.renderValues(),this.output[0])}}}},{"../../../utils":291,"./float":204}],202:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureFloat2D:class extends i{constructor(e){super(e),this.type="ArrayTexture(1)"}toArray(){return n.erect2DFloat(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":291,"./float":204}],203:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureFloat3D:class extends i{constructor(e){super(e),this.type="ArrayTexture(1)"}toArray(){return n.erect3DFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}}},{"../../../utils":291,"./float":204}],204:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTexture:i}=e("./index");t.exports={GLTextureFloat:class extends i{get textureType(){return this.context.FLOAT}constructor(e){super(e),this.type="ArrayTexture(1)"}renderRawOutput(){const e=this.context,t=this.size;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer()),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0);const r=new Float32Array(t[0]*t[1]*4);return e.readPixels(0,0,t[0],t[1],e.RGBA,e.FLOAT,r),r}renderValues(){return this._deleted?null:this.renderRawOutput()}toArray(){return n.erectFloat(this.renderValues(),this.output[0])}}}},{"../../../utils":291,"./index":206}],205:[function(e,t,r){const{GLTextureUnsigned:n}=e("./unsigned");t.exports={GLTextureGraphical:class extends n{constructor(e){super(e),this.type="ArrayTexture(4)"}toArray(){return this.renderValues()}}}},{"./unsigned":212}],206:[function(e,t,r){const{Texture:n}=e("../../../texture");function i(e,t){e.activeTexture(e.TEXTURE15),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST)}t.exports={GLTexture:class extends n{get textureType(){throw new Error(`"textureType" not implemented on ${this.name}`)}clone(){return new this.constructor(this)}beforeMutate(){return this.texture._refs>1&&(this.newTexture(),!0)}cloneTexture(){this.texture._refs--;const{context:e,size:t,texture:r,kernel:n}=this;n.debug&&console.warn("cloning internal texture"),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer()),i(e,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0);const s=e.createTexture();i(e,s),e.texImage2D(e.TEXTURE_2D,0,this.internalFormat,t[0],t[1],0,this.textureFormat,this.textureType,null),e.copyTexSubImage2D(e.TEXTURE_2D,0,0,0,0,0,t[0],t[1]),s._refs=1,this.texture=s}newTexture(){this.texture._refs--;const e=this.context,t=this.size;this.kernel.debug&&console.warn("new internal texture");const r=e.createTexture();i(e,r),e.texImage2D(e.TEXTURE_2D,0,this.internalFormat,t[0],t[1],0,this.textureFormat,this.textureType,null),r._refs=1,this.texture=r}clear(){if(this.texture._refs){this.texture._refs--;const e=this.context,t=this.texture=e.createTexture();i(e,t);const r=this.size;t._refs=1,e.texImage2D(e.TEXTURE_2D,0,this.internalFormat,r[0],r[1],0,this.textureFormat,this.textureType,null)}const{context:e,texture:t}=this;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer()),e.bindTexture(e.TEXTURE_2D,t),i(e,t),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}delete(){this._deleted||(this._deleted=!0,this.texture._refs&&(this.texture._refs--,this.texture._refs)||this.context.deleteTexture(this.texture))}framebuffer(){return this._framebuffer||(this._framebuffer=this.kernel.getRawValueFramebuffer(this.size[0],this.size[1])),this._framebuffer}}}},{"../../../texture":290}],207:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureMemoryOptimized2D:class extends i{constructor(e){super(e),this.type="MemoryOptimizedNumberTexture"}toArray(){return n.erectMemoryOptimized2DFloat(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":291,"./float":204}],208:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureMemoryOptimized3D:class extends i{constructor(e){super(e),this.type="MemoryOptimizedNumberTexture"}toArray(){return n.erectMemoryOptimized3DFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}}},{"../../../utils":291,"./float":204}],209:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureFloat:i}=e("./float");t.exports={GLTextureMemoryOptimized:class extends i{constructor(e){super(e),this.type="MemoryOptimizedNumberTexture"}toArray(){return n.erectMemoryOptimizedFloat(this.renderValues(),this.output[0])}}}},{"../../../utils":291,"./float":204}],210:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureUnsigned:i}=e("./unsigned");t.exports={GLTextureUnsigned2D:class extends i{constructor(e){super(e),this.type="NumberTexture"}toArray(){return n.erect2DPackedFloat(this.renderValues(),this.output[0],this.output[1])}}}},{"../../../utils":291,"./unsigned":212}],211:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTextureUnsigned:i}=e("./unsigned");t.exports={GLTextureUnsigned3D:class extends i{constructor(e){super(e),this.type="NumberTexture"}toArray(){return n.erect3DPackedFloat(this.renderValues(),this.output[0],this.output[1],this.output[2])}}}},{"../../../utils":291,"./unsigned":212}],212:[function(e,t,r){const{utils:n}=e("../../../utils"),{GLTexture:i}=e("./index");t.exports={GLTextureUnsigned:class extends i{get textureType(){return this.context.UNSIGNED_BYTE}constructor(e){super(e),this.type="NumberTexture"}renderRawOutput(){const{context:e}=this;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer()),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture,0);const t=new Uint8Array(this.size[0]*this.size[1]*4);return e.readPixels(0,0,this.size[0],this.size[1],e.RGBA,e.UNSIGNED_BYTE,t),t}renderValues(){return this._deleted?null:new Float32Array(this.renderRawOutput().buffer)}toArray(){return n.erectPackedFloat(this.renderValues(),this.output[0])}}}},{"../../../utils":291,"./index":206}],213:[function(e,t,r){const n=e("gl"),{WebGLKernel:i}=e("../web-gl/kernel"),{glKernelString:s}=e("../gl/kernel-string");let o=null,a=null,u=null,l=null,c=null;t.exports={HeadlessGLKernel:class extends i{static get isSupported(){return null!==o?o:(this.setupFeatureChecks(),o=null!==u)}static setupFeatureChecks(){if(a=null,l=null,"function"==typeof n)try{if(!(u=n(2,2,{preserveDrawingBuffer:!0}))||!u.getExtension)return;l={STACKGL_resize_drawingbuffer:u.getExtension("STACKGL_resize_drawingbuffer"),STACKGL_destroy_context:u.getExtension("STACKGL_destroy_context"),OES_texture_float:u.getExtension("OES_texture_float"),OES_texture_float_linear:u.getExtension("OES_texture_float_linear"),OES_element_index_uint:u.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:u.getExtension("WEBGL_draw_buffers"),WEBGL_color_buffer_float:u.getExtension("WEBGL_color_buffer_float")},c=this.getFeatures()}catch(e){console.warn(e)}}static isContextMatch(e){try{return"ANGLE"===e.getParameter(e.RENDERER)}catch(e){return!1}}static getIsTextureFloat(){return Boolean(l.OES_texture_float)}static getIsDrawBuffers(){return Boolean(l.WEBGL_draw_buffers)}static getChannelCount(){return l.WEBGL_draw_buffers?u.getParameter(l.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL):1}static getMaxTextureSize(){return u.getParameter(u.MAX_TEXTURE_SIZE)}static get testCanvas(){return a}static get testContext(){return u}static get features(){return c}initCanvas(){return{}}initContext(){return n(2,2,{preserveDrawingBuffer:!0})}initExtensions(){this.extensions={STACKGL_resize_drawingbuffer:this.context.getExtension("STACKGL_resize_drawingbuffer"),STACKGL_destroy_context:this.context.getExtension("STACKGL_destroy_context"),OES_texture_float:this.context.getExtension("OES_texture_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear"),OES_element_index_uint:this.context.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:this.context.getExtension("WEBGL_draw_buffers")}}build(){super.build.apply(this,arguments),this.fallbackRequested||this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0],this.maxTexSize[1])}destroyExtensions(){this.extensions.STACKGL_resize_drawingbuffer=null,this.extensions.STACKGL_destroy_context=null,this.extensions.OES_texture_float=null,this.extensions.OES_texture_float_linear=null,this.extensions.OES_element_index_uint=null,this.extensions.WEBGL_draw_buffers=null}static destroyContext(e){const t=e.getExtension("STACKGL_destroy_context");t&&t.destroy&&t.destroy()}toString(){return s(this.constructor,arguments,this,"const gl = context || require('gl')(1, 1);\n"," if (!context) { gl.getExtension('STACKGL_destroy_context').destroy(); }\n")}setOutput(e){return super.setOutput(e),this.graphical&&this.extensions.STACKGL_resize_drawingbuffer&&this.extensions.STACKGL_resize_drawingbuffer.resize(this.maxTexSize[0],this.maxTexSize[1]),this}}}},{"../gl/kernel-string":191,"../web-gl/kernel":249,gl:136}],214:[function(e,t,r){t.exports={KernelValue:class{constructor(e,t){const{name:r,kernel:n,context:i,checkContext:s,onRequestContextHandle:o,onUpdateValueMismatch:a,origin:u,strictIntegers:l,type:c,tactic:h}=t;if(!r)throw new Error("name not set");if(!c)throw new Error("type not set");if(!u)throw new Error("origin not set");if("user"!==u&&"constants"!==u)throw new Error(`origin must be "user" or "constants" value is "${u}"`);if(!o)throw new Error("onRequestContextHandle is not set");this.name=r,this.origin=u,this.tactic=h,this.varName="constants"===u?`constants.${r}`:r,this.kernel=n,this.strictIntegers=l,this.type=e.type||c,this.size=e.size||null,this.index=null,this.context=i,this.checkContext=null===s||void 0===s||s,this.contextHandle=null,this.onRequestContextHandle=o,this.onUpdateValueMismatch=a,this.forceUploadEachRun=null}get id(){return`${this.origin}_${name}`}getSource(){throw new Error(`"getSource" not defined on ${this.constructor.name}`)}updateValue(e){throw new Error(`"updateValue" not defined on ${this.constructor.name}`)}}}},{}],215:[function(e,t,r){const{utils:n}=e("../utils"),{Input:i}=e("../input");t.exports={Kernel:class{static get isSupported(){throw new Error(`"isSupported" not implemented on ${this.name}`)}static isContextMatch(e){throw new Error(`"isContextMatch" not implemented on ${this.name}`)}static getFeatures(){throw new Error(`"getFeatures" not implemented on ${this.name}`)}static destroyContext(e){throw new Error(`"destroyContext" called on ${this.name}`)}static nativeFunctionArguments(){throw new Error(`"nativeFunctionArguments" called on ${this.name}`)}static nativeFunctionReturnType(){throw new Error(`"nativeFunctionReturnType" called on ${this.name}`)}static combineKernels(){throw new Error(`"combineKernels" called on ${this.name}`)}constructor(e,t){if("object"!=typeof e){if("string"!=typeof e)throw new Error("source not a string");if(!n.isFunctionString(e))throw new Error("source not a function string")}this.useLegacyEncoder=!1,this.fallbackRequested=!1,this.onRequestFallback=null,this.argumentNames="string"==typeof e?n.getArgumentNamesFromString(e):null,this.argumentTypes=null,this.argumentSizes=null,this.argumentBitRatios=null,this.kernelArguments=null,this.kernelConstants=null,this.forceUploadKernelConstants=null,this.source=e,this.output=null,this.debug=!1,this.graphical=!1,this.loopMaxIterations=0,this.constants=null,this.constantTypes=null,this.constantBitRatios=null,this.dynamicArguments=!1,this.dynamicOutput=!1,this.canvas=null,this.context=null,this.checkContext=null,this.gpu=null,this.functions=null,this.nativeFunctions=null,this.injectedNative=null,this.subKernels=null,this.validate=!0,this.immutable=!1,this.pipeline=!1,this.precision=null,this.tactic=null,this.plugins=null,this.returnType=null,this.leadingReturnStatement=null,this.followingReturnStatement=null,this.optimizeFloatMemory=null,this.strictIntegers=!1,this.fixIntegerDivisionAccuracy=null,this.built=!1,this.signature=null}mergeSettings(e){for(let t in e)if(e.hasOwnProperty(t)&&this.hasOwnProperty(t)){switch(t){case"output":if(!Array.isArray(e.output)){this.setOutput(e.output);continue}break;case"functions":this.functions=[];for(let t=0;t<e.functions.length;t++)this.addFunction(e.functions[t]);continue;case"graphical":e[t]&&!e.hasOwnProperty("precision")&&(this.precision="unsigned"),this[t]=e[t];continue;case"nativeFunctions":if(!e.nativeFunctions)continue;this.nativeFunctions=[];for(let t=0;t<e.nativeFunctions.length;t++){const r=e.nativeFunctions[t],{name:n,source:i}=r;this.addNativeFunction(n,i,r)}continue}this[t]=e[t]}this.canvas||(this.canvas=this.initCanvas()),this.context||(this.context=this.initContext()),this.plugins||(this.plugins=this.initPlugins(e))}build(){throw new Error(`"build" not defined on ${this.constructor.name}`)}run(){throw new Error(`"run" not defined on ${this.constructor.name}`)}initCanvas(){throw new Error(`"initCanvas" not defined on ${this.constructor.name}`)}initContext(){throw new Error(`"initContext" not defined on ${this.constructor.name}`)}initPlugins(e){throw new Error(`"initPlugins" not defined on ${this.constructor.name}`)}addFunction(e,t={}){if(e.name&&e.source&&e.argumentTypes&&"returnType"in e)this.functions.push(e);else if("settings"in e&&"source"in e)this.functions.push(this.functionToIGPUFunction(e.source,e.settings));else{if("string"!=typeof e&&"function"!=typeof e)throw new Error("function not properly defined");this.functions.push(this.functionToIGPUFunction(e,t))}return this}addNativeFunction(e,t,r={}){const{argumentTypes:n,argumentNames:i}=r.argumentTypes?function(e){const t=Object.keys(e),r=[];for(let n=0;n<t.length;n++){const i=t[n];r.push(e[i])}return{argumentTypes:r,argumentNames:t}}(r.argumentTypes):this.constructor.nativeFunctionArguments(t)||{};return this.nativeFunctions.push({name:e,source:t,settings:r,argumentTypes:n,argumentNames:i,returnType:r.returnType||this.constructor.nativeFunctionReturnType(t)}),this}setupArguments(e){if(this.kernelArguments=[],this.argumentTypes)for(let e=0;e<this.argumentTypes.length;e++)this.kernelArguments.push({type:this.argumentTypes[e]});else if(!this.argumentTypes){this.argumentTypes=[];for(let t=0;t<e.length;t++){const r=n.getVariableType(e[t],this.strictIntegers),i="Integer"===r?"Number":r;this.argumentTypes.push(i),this.kernelArguments.push({type:i})}}this.argumentSizes=new Array(e.length),this.argumentBitRatios=new Int32Array(e.length);for(let t=0;t<e.length;t++){const r=e[t];this.argumentSizes[t]=r.constructor===i?r.size:null,this.argumentBitRatios[t]=this.getBitRatio(r)}if(this.argumentNames.length!==e.length)throw new Error("arguments are miss-aligned")}setupConstants(){this.kernelConstants=[];let e=null===this.constantTypes;if(e&&(this.constantTypes={}),this.constantBitRatios={},this.constants)for(let t in this.constants){if(e){const e=n.getVariableType(this.constants[t],this.strictIntegers);this.constantTypes[t]=e,this.kernelConstants.push({name:t,type:e})}else this.kernelConstants.push({name:t,type:this.constantTypes[t]});this.constantBitRatios[t]=this.getBitRatio(this.constants[t])}}setOptimizeFloatMemory(e){return this.optimizeFloatMemory=e,this}toKernelOutput(e){return e.hasOwnProperty("x")?e.hasOwnProperty("y")?e.hasOwnProperty("z")?[e.x,e.y,e.z]:[e.x,e.y]:[e.x]:e}setOutput(e){return this.output=this.toKernelOutput(e),this}setDebug(e){return this.debug=e,this}setGraphical(e){return this.graphical=e,this.precision="unsigned",this}setLoopMaxIterations(e){return this.loopMaxIterations=e,this}setConstants(e){return this.constants=e,this}setConstantTypes(e){return this.constantTypes=e,this}setFunctions(e){for(let t=0;t<e.length;t++)this.addFunction(e[t]);return this}setNativeFunctions(e){for(let t=0;t<e.length;t++){const r=e[t],{name:n,source:i}=r;this.addNativeFunction(n,i,r)}return this}setInjectedNative(e){return this.injectedNative=e,this}setPipeline(e){return this.pipeline=e,this}setPrecision(e){return this.precision=e,this}setDimensions(e){return n.warnDeprecated("method","setDimensions","setOutput"),this.output=e,this}setOutputToTexture(e){return n.warnDeprecated("method","setOutputToTexture","setPipeline"),this.pipeline=e,this}setImmutable(e){return this.immutable=e,this}setCanvas(e){return this.canvas=e,this}setStrictIntegers(e){return this.strictIntegers=e,this}setDynamicOutput(e){return this.dynamicOutput=e,this}setHardcodeConstants(e){return n.warnDeprecated("method","setHardcodeConstants"),this.setDynamicOutput(e),this.setDynamicArguments(e),this}setDynamicArguments(e){return this.dynamicArguments=e,this}setUseLegacyEncoder(e){return this.useLegacyEncoder=e,this}setWarnVarUsage(e){return n.warnDeprecated("method","setWarnVarUsage"),this}getCanvas(){return n.warnDeprecated("method","getCanvas"),this.canvas}getWebGl(){return n.warnDeprecated("method","getWebGl"),this.context}setContext(e){return this.context=e,this}setArgumentTypes(e){if(Array.isArray(e))this.argumentTypes=e;else{this.argumentTypes=[];for(const t in e){if(!e.hasOwnProperty(t))continue;const r=this.argumentNames.indexOf(t);if(-1===r)throw new Error(`unable to find argument ${t}`);this.argumentTypes[r]=e[t]}}return this}setTactic(e){return this.tactic=e,this}requestFallback(e){if(!this.onRequestFallback)throw new Error(`"onRequestFallback" not defined on ${this.constructor.name}`);return this.fallbackRequested=!0,this.onRequestFallback(e)}validateSettings(){throw new Error(`"validateSettings" not defined on ${this.constructor.name}`)}addSubKernel(e){if(null===this.subKernels&&(this.subKernels=[]),!e.source)throw new Error('subKernel missing "source" property');if(!e.property&&isNaN(e.property))throw new Error('subKernel missing "property" property');if(!e.name)throw new Error('subKernel missing "name" property');return this.subKernels.push(e),this}destroy(e){throw new Error(`"destroy" called on ${this.constructor.name}`)}getBitRatio(e){if("single"===this.precision)return 4;if(Array.isArray(e[0]))return this.getBitRatio(e[0]);if(e.constructor===i)return this.getBitRatio(e.value);switch(e.constructor){case Uint8ClampedArray:case Uint8Array:case Int8Array:return 1;case Uint16Array:case Int16Array:return 2;case Float32Array:case Int32Array:default:return 4}}getPixels(e){throw new Error(`"getPixels" called on ${this.constructor.name}`)}checkOutput(){if(!this.output||!n.isArray(this.output))throw new Error("kernel.output not an array");if(this.output.length<1)throw new Error("kernel.output is empty, needs at least 1 value");for(let e=0;e<this.output.length;e++)if(isNaN(this.output[e])||this.output[e]<1)throw new Error(`${this.constructor.name}.output[${e}] incorrectly defined as \`${this.output[e]}\`, needs to be numeric, and greater than 0`)}prependString(e){throw new Error(`"prependString" called on ${this.constructor.name}`)}hasPrependString(e){throw new Error(`"hasPrependString" called on ${this.constructor.name}`)}toJSON(){return{settings:{output:this.output,pipeline:this.pipeline,argumentNames:this.argumentNames,argumentsTypes:this.argumentTypes,constants:this.constants,pluginNames:this.plugins?this.plugins.map(e=>e.name):null,returnType:this.returnType}}}buildSignature(e){const t=this.constructor;this.signature=t.getSignature(this,t.getArgumentTypes(this,e))}static getArgumentTypes(e,t){const r=new Array(t.length);for(let i=0;i<t.length;i++){const s=t[i],o=e.argumentTypes[i];if(s.type)r[i]=s.type;else switch(o){case"Number":case"Integer":case"Float":case"ArrayTexture(1)":r[i]=n.getVariableType(s);break;default:r[i]=o}}return r}static getSignature(e,t){throw new Error(`"getSignature" not implemented on ${this.name}`)}functionToIGPUFunction(e,t={}){if("string"!=typeof e&&"function"!=typeof e)throw new Error("source not a string or function");const r="string"==typeof e?e:e.toString();let i=[];return i=Array.isArray(t.argumentTypes)?t.argumentTypes:"object"==typeof t.argumentTypes?n.getArgumentNamesFromString(r).map(e=>t.argumentTypes[e])||[]:t.argumentTypes||[],{name:n.getFunctionNameFromString(r)||null,source:r,argumentTypes:i,returnType:t.returnType||null}}onActivate(e){}}}},{"../input":287,"../utils":291}],216:[function(e,t,r){const n=`__HEADER__;\n__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DECLARATION__;\n\nconst int LOOP_MAX = __LOOP_MAX__;\n\n__PLUGINS__;\n__CONSTANTS__;\n\nvarying vec2 vTexCoord;\n\nfloat acosh(float x) {\n return log(x + sqrt(x * x - 1.0));\n}\n\nfloat sinh(float x) {\n return (pow(${Math.E}, x) - pow(${Math.E}, -x)) / 2.0;\n}\n\nfloat asinh(float x) {\n return log(x + sqrt(x * x + 1.0));\n}\n\nfloat atan2(float v1, float v2) {\n if (v1 == 0.0 || v2 == 0.0) return 0.0;\n return atan(v1 / v2);\n}\n\nfloat atanh(float x) {\n x = (x + 1.0) / (x - 1.0);\n if (x < 0.0) {\n return 0.5 * log(-x);\n }\n return 0.5 * log(x);\n}\n\nfloat cbrt(float x) {\n if (x >= 0.0) {\n return pow(x, 1.0 / 3.0);\n } else {\n return -pow(x, 1.0 / 3.0);\n }\n}\n\nfloat cosh(float x) {\n return (pow(${Math.E}, x) + pow(${Math.E}, -x)) / 2.0; \n}\n\nfloat expm1(float x) {\n return pow(${Math.E}, x) - 1.0; \n}\n\nfloat fround(highp float x) {\n return x;\n}\n\nfloat imul(float v1, float v2) {\n return float(int(v1) * int(v2));\n}\n\nfloat log10(float x) {\n return log2(x) * (1.0 / log2(10.0));\n}\n\nfloat log1p(float x) {\n return log(1.0 + x);\n}\n\nfloat _pow(float v1, float v2) {\n if (v2 == 0.0) return 1.0;\n return pow(v1, v2);\n}\n\nfloat tanh(float x) {\n float e = exp(2.0 * x);\n return (e - 1.0) / (e + 1.0);\n}\n\nfloat trunc(float x) {\n if (x >= 0.0) {\n return floor(x); \n } else {\n return ceil(x);\n }\n}\n\nvec4 _round(vec4 x) {\n return floor(x + 0.5);\n}\n\nfloat _round(float x) {\n return floor(x + 0.5);\n}\n\nconst int BIT_COUNT = 32;\nint modi(int x, int y) {\n return x - y * (x / y);\n}\n\nint bitwiseOr(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) || (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseXOR(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) != (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseAnd(int a, int b) {\n int result = 0;\n int n = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) && (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 && b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseNot(int a) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if (modi(a, 2) == 0) {\n result += n; \n }\n a = a / 2;\n n = n * 2;\n }\n return result;\n}\nint bitwiseZeroFillLeftShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n *= 2;\n }\n\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nint bitwiseSignedRightShift(int num, int shifts) {\n return int(floor(float(num) / pow(2.0, float(shifts))));\n}\n\nint bitwiseZeroFillRightShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n /= 2;\n }\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nvec2 integerMod(vec2 x, float y) {\n vec2 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec3 integerMod(vec3 x, float y) {\n vec3 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec4 integerMod(vec4 x, vec4 y) {\n vec4 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nfloat integerMod(float x, float y) {\n float res = floor(mod(x, y));\n return res * (res > floor(y) - 1.0 ? 0.0 : 1.0);\n}\n\nint integerMod(int x, int y) {\n return x - (y * int(x / y));\n}\n\n__DIVIDE_WITH_INTEGER_CHECK__;\n\n// Here be dragons!\n// DO NOT OPTIMIZE THIS CODE\n// YOU WILL BREAK SOMETHING ON SOMEBODY'S MACHINE\n// LEAVE IT AS IT IS, LEST YOU WASTE YOUR OWN TIME\nconst vec2 MAGIC_VEC = vec2(1.0, -256.0);\nconst vec4 SCALE_FACTOR = vec4(1.0, 256.0, 65536.0, 0.0);\nconst vec4 SCALE_FACTOR_INV = vec4(1.0, 0.00390625, 0.0000152587890625, 0.0); // 1, 1/256, 1/65536\nfloat decode32(vec4 texel) {\n __DECODE32_ENDIANNESS__;\n texel *= 255.0;\n vec2 gte128;\n gte128.x = texel.b >= 128.0 ? 1.0 : 0.0;\n gte128.y = texel.a >= 128.0 ? 1.0 : 0.0;\n float exponent = 2.0 * texel.a - 127.0 + dot(gte128, MAGIC_VEC);\n float res = exp2(_round(exponent));\n texel.b = texel.b - 128.0 * gte128.x;\n res = dot(texel, SCALE_FACTOR) * exp2(_round(exponent-23.0)) + res;\n res *= gte128.y * -2.0 + 1.0;\n return res;\n}\n\nfloat decode16(vec4 texel, int index) {\n int channel = integerMod(index, 2);\n if (channel == 0) return texel.r * 255.0 + texel.g * 65280.0;\n if (channel == 1) return texel.b * 255.0 + texel.a * 65280.0;\n return 0.0;\n}\n\nfloat decode8(vec4 texel, int index) {\n int channel = integerMod(index, 4);\n if (channel == 0) return texel.r * 255.0;\n if (channel == 1) return texel.g * 255.0;\n if (channel == 2) return texel.b * 255.0;\n if (channel == 3) return texel.a * 255.0;\n return 0.0;\n}\n\nvec4 legacyEncode32(float f) {\n float F = abs(f);\n float sign = f < 0.0 ? 1.0 : 0.0;\n float exponent = floor(log2(F));\n float mantissa = (exp2(-exponent) * F);\n // exponent += floor(log2(mantissa));\n vec4 texel = vec4(F * exp2(23.0-exponent)) * SCALE_FACTOR_INV;\n texel.rg = integerMod(texel.rg, 256.0);\n texel.b = integerMod(texel.b, 128.0);\n texel.a = exponent*0.5 + 63.5;\n texel.ba += vec2(integerMod(exponent+127.0, 2.0), sign) * 128.0;\n texel = floor(texel);\n texel *= 0.003921569; // 1/255\n __ENCODE32_ENDIANNESS__;\n return texel;\n}\n\n// https://github.com/gpujs/gpu.js/wiki/Encoder-details\nvec4 encode32(float value) {\n if (value == 0.0) return vec4(0, 0, 0, 0);\n\n float exponent;\n float mantissa;\n vec4 result;\n float sgn;\n\n sgn = step(0.0, -value);\n value = abs(value);\n\n exponent = floor(log2(value));\n\n mantissa = value*pow(2.0, -exponent)-1.0;\n exponent = exponent+127.0;\n result = vec4(0,0,0,0);\n\n result.a = floor(exponent/2.0);\n exponent = exponent - result.a*2.0;\n result.a = result.a + 128.0*sgn;\n\n result.b = floor(mantissa * 128.0);\n mantissa = mantissa - result.b / 128.0;\n result.b = result.b + exponent*128.0;\n\n result.g = floor(mantissa*32768.0);\n mantissa = mantissa - result.g/32768.0;\n\n result.r = floor(mantissa*8388608.0);\n return result/255.0;\n}\n// Dragons end here\n\nint index;\nivec3 threadId;\n\nivec3 indexTo3D(int idx, ivec3 texDim) {\n int z = int(idx / (texDim.x * texDim.y));\n idx -= z * int(texDim.x * texDim.y);\n int y = int(idx / texDim.x);\n int x = int(integerMod(idx, texDim.x));\n return ivec3(x, y, z);\n}\n\nfloat get32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n return decode32(texel);\n}\n\nfloat get16(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x * 2;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize.x * 2, texSize.y));\n return decode16(texel, index);\n}\n\nfloat get8(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x * 4;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize.x * 4, texSize.y));\n return decode8(texel, index);\n}\n\nfloat getMemoryOptimized32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 4);\n index = index / 4;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n if (channel == 0) return texel.r;\n if (channel == 1) return texel.g;\n if (channel == 2) return texel.b;\n if (channel == 3) return texel.a;\n return 0.0;\n}\n\nvec4 getImage2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n return texture2D(tex, st / vec2(texSize));\n}\n\nfloat getFloatFromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return result[0];\n}\n\nvec2 getVec2FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec2(result[0], result[1]);\n}\n\nvec2 getMemoryOptimizedVec2(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int channel = integerMod(index, 2);\n index = index / 2;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n if (channel == 0) return vec2(texel.r, texel.g);\n if (channel == 1) return vec2(texel.b, texel.a);\n return vec2(0.0, 0.0);\n}\n\nvec3 getVec3FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec3(result[0], result[1], result[2]);\n}\n\nvec3 getMemoryOptimizedVec3(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int fieldIndex = 3 * (x + texDim.x * (y + texDim.y * z));\n int vectorIndex = fieldIndex / 4;\n int vectorOffset = fieldIndex - vectorIndex * 4;\n int readY = vectorIndex / texSize.x;\n int readX = vectorIndex - readY * texSize.x;\n vec4 tex1 = texture2D(tex, (vec2(readX, readY) + 0.5) / vec2(texSize));\n \n if (vectorOffset == 0) {\n return tex1.xyz;\n } else if (vectorOffset == 1) {\n return tex1.yzw;\n } else {\n readX++;\n if (readX >= texSize.x) {\n readX = 0;\n readY++;\n }\n vec4 tex2 = texture2D(tex, vec2(readX, readY) / vec2(texSize));\n if (vectorOffset == 2) {\n return vec3(tex1.z, tex1.w, tex2.x);\n } else {\n return vec3(tex1.w, tex2.x, tex2.y);\n }\n }\n}\n\nvec4 getVec4FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n return getImage2D(tex, texSize, texDim, z, y, x);\n}\n\nvec4 getMemoryOptimizedVec4(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 2);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture2D(tex, st / vec2(texSize));\n return vec4(texel.r, texel.g, texel.b, texel.a);\n}\n\nvec4 actualColor;\nvoid color(float r, float g, float b, float a) {\n actualColor = vec4(r,g,b,a);\n}\n\nvoid color(float r, float g, float b) {\n color(r,g,b,1.0);\n}\n\nvoid color(sampler2D image) {\n actualColor = texture2D(image, vTexCoord);\n}\n\nfloat modulo(float number, float divisor) {\n if (number < 0.0) {\n number = abs(number);\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return -mod(number, divisor);\n }\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return mod(number, divisor);\n}\n\n__INJECTED_NATIVE__;\n__MAIN_CONSTANTS__;\n__MAIN_ARGUMENTS__;\n__KERNEL__;\n\nvoid main(void) {\n index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x;\n __MAIN_RESULT__;\n}`;t.exports={fragmentShader:n}},{}],217:[function(e,t,r){const{utils:n}=e("../../utils"),{FunctionNode:i}=e("../function-node");const s={Array:"sampler2D","Array(2)":"vec2","Array(3)":"vec3","Array(4)":"vec4","Matrix(2)":"mat2","Matrix(3)":"mat3","Matrix(4)":"mat4",Array2D:"sampler2D",Array3D:"sampler2D",Boolean:"bool",Float:"float",Input:"sampler2D",Integer:"int",Number:"float",LiteralInteger:"float",NumberTexture:"sampler2D",MemoryOptimizedNumberTexture:"sampler2D","ArrayTexture(1)":"sampler2D","ArrayTexture(2)":"sampler2D","ArrayTexture(3)":"sampler2D","ArrayTexture(4)":"sampler2D",HTMLVideo:"sampler2D",HTMLCanvas:"sampler2D",HTMLImage:"sampler2D",HTMLImageArray:"sampler2DArray"},o={"===":"==","!==":"!="};t.exports={WebGLFunctionNode:class extends i{constructor(e,t){super(e,t),t&&t.hasOwnProperty("fixIntegerDivisionAccuracy")&&(this.fixIntegerDivisionAccuracy=t.fixIntegerDivisionAccuracy)}astConditionalExpression(e,t){if("ConditionalExpression"!==e.type)throw this.astErrorOutput("Not a conditional expression",e);const r=this.getType(e.consequent),n=this.getType(e.alternate);return null===r&&null===n?(t.push("if ("),this.astGeneric(e.test,t),t.push(") {"),this.astGeneric(e.consequent,t),t.push(";"),t.push("} else {"),this.astGeneric(e.alternate,t),t.push(";"),t.push("}"),t):(t.push("("),this.astGeneric(e.test,t),t.push("?"),this.astGeneric(e.consequent,t),t.push(":"),this.astGeneric(e.alternate,t),t.push(")"),t)}astFunction(e,t){if(this.isRootKernel)t.push("void");else{this.returnType||this.findLastReturn()&&(this.returnType=this.getType(e.body),"LiteralInteger"===this.returnType&&(this.returnType="Number"));const{returnType:r}=this;if(r){const e=s[r];if(!e)throw new Error(`unknown type ${r}`);t.push(e)}else t.push("void")}if(t.push(" "),t.push(this.name),t.push("("),!this.isRootKernel)for(let r=0;r<this.argumentNames.length;++r){const i=this.argumentNames[r];r>0&&t.push(", ");let o=this.argumentTypes[this.argumentNames.indexOf(i)];if(!o)throw this.astErrorOutput(`Unknown argument ${i} type`,e);"LiteralInteger"===o&&(this.argumentTypes[r]=o="Number");const a=s[o];if(!a)throw this.astErrorOutput("Unexpected expression",e);const u=n.sanitizeName(i);"sampler2D"===a||"sampler2DArray"===a?t.push(`${a} user_${u},ivec2 user_${u}Size,ivec3 user_${u}Dim`):t.push(`${a} user_${u}`)}t.push(") {\n");for(let r=0;r<e.body.body.length;++r)this.astGeneric(e.body.body[r],t),t.push("\n");return t.push("}\n"),t}astReturnStatement(e,t){if(!e.argument)throw this.astErrorOutput("Unexpected return statement",e);this.pushState("skip-literal-correction");const r=this.getType(e.argument);this.popState("skip-literal-correction");const n=[];switch(this.returnType||(this.returnType="LiteralInteger"===r||"Integer"===r?"Number":r),this.returnType){case"LiteralInteger":case"Number":case"Float":switch(r){case"Integer":n.push("float("),this.astGeneric(e.argument,n),n.push(")");break;case"LiteralInteger":this.castLiteralToFloat(e.argument,n),"Integer"===this.getType(e)&&(n.unshift("float("),n.push(")"));break;default:this.astGeneric(e.argument,n)}break;case"Integer":switch(r){case"Float":case"Number":this.castValueToInteger(e.argument,n);break;case"LiteralInteger":this.castLiteralToInteger(e.argument,n);break;default:this.astGeneric(e.argument,n)}break;case"Array(4)":case"Array(3)":case"Array(2)":case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":case"Input":this.astGeneric(e.argument,n);break;default:throw this.astErrorOutput(`unhandled return type ${this.returnType}`,e)}return this.isRootKernel?(t.push(`kernelResult = ${n.join("")};`),t.push("return;")):this.isSubKernel?(t.push(`subKernelResult_${this.name} = ${n.join("")};`),t.push(`return subKernelResult_${this.name};`)):t.push(`return ${n.join("")};`),t}astLiteral(e,t){if(isNaN(e.value))throw this.astErrorOutput("Non-numeric literal not supported : "+e.value,e);const r=this.astKey(e);return Number.isInteger(e.value)?this.isState("casting-to-integer")||this.isState("building-integer")?(this.literalTypes[r]="Integer",t.push(`${e.value}`)):(this.isState("casting-to-float")||this.isState("building-float"),this.literalTypes[r]="Number",t.push(`${e.value}.0`)):this.isState("casting-to-integer")||this.isState("building-integer")?(this.literalTypes[r]="Integer",t.push(Math.round(e.value))):(this.literalTypes[r]="Number",t.push(`${e.value}`)),t}astBinaryExpression(e,t){if(this.checkAndUpconvertOperator(e,t))return t;if(this.fixIntegerDivisionAccuracy&&"/"===e.operator){switch(t.push("divWithIntCheck("),this.pushState("building-float"),this.getType(e.left)){case"Integer":this.castValueToFloat(e.left,t);break;case"LiteralInteger":this.castLiteralToFloat(e.left,t);break;default:this.astGeneric(e.left,t)}switch(t.push(", "),this.getType(e.right)){case"Integer":this.castValueToFloat(e.right,t);break;case"LiteralInteger":this.castLiteralToFloat(e.right,t);break;default:this.astGeneric(e.right,t)}return this.popState("building-float"),t.push(")"),t}t.push("(");const r=this.getType(e.left)||"Number",n=this.getType(e.right)||"Number";if(!r||!n)throw this.astErrorOutput("Unhandled binary expression",e);const i=r+" & "+n;switch(i){case"Integer & Integer":this.pushState("building-integer"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-integer");break;case"Number & Float":case"Float & Number":case"Float & Float":case"Number & Number":this.pushState("building-float"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-float");break;case"LiteralInteger & LiteralInteger":this.isState("casting-to-integer")||this.isState("building-integer")?(this.pushState("building-integer"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-integer")):(this.pushState("building-float"),this.castLiteralToFloat(e.left,t),t.push(o[e.operator]||e.operator),this.castLiteralToFloat(e.right,t),this.popState("building-float"));break;case"Integer & Float":case"Integer & Number":if((">"===e.operator||"<"===e.operator&&"Literal"===e.right.type)&&!Number.isInteger(e.right.value)){this.pushState("building-float"),this.castValueToFloat(e.left,t),t.push(o[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-float");break}if(this.pushState("building-integer"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.pushState("casting-to-integer"),"Literal"===e.right.type){const r=[];if(this.astGeneric(e.right,r),"Integer"!==this.getType(e.right))throw this.astErrorOutput("Unhandled binary expression with literal",e);t.push(r.join(""))}else t.push("int("),this.astGeneric(e.right,t),t.push(")");this.popState("casting-to-integer"),this.popState("building-integer");break;case"Integer & LiteralInteger":this.pushState("building-integer"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.castLiteralToInteger(e.right,t),this.popState("building-integer");break;case"Number & Integer":this.pushState("building-float"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.castValueToFloat(e.right,t),this.popState("building-float");break;case"Float & LiteralInteger":case"Number & LiteralInteger":this.pushState("building-float"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.castLiteralToFloat(e.right,t),this.popState("building-float");break;case"LiteralInteger & Float":case"LiteralInteger & Number":this.isState("casting-to-integer")?(this.pushState("building-integer"),this.castLiteralToInteger(e.left,t),t.push(o[e.operator]||e.operator),this.castValueToInteger(e.right,t),this.popState("building-integer")):(this.pushState("building-float"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.pushState("casting-to-float"),this.astGeneric(e.right,t),this.popState("casting-to-float"),this.popState("building-float"));break;case"LiteralInteger & Integer":this.pushState("building-integer"),this.castLiteralToInteger(e.left,t),t.push(o[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-integer");break;case"Boolean & Boolean":this.pushState("building-boolean"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.astGeneric(e.right,t),this.popState("building-boolean");break;case"Float & Integer":this.pushState("building-float"),this.astGeneric(e.left,t),t.push(o[e.operator]||e.operator),this.castValueToFloat(e.right,t),this.popState("building-float");break;default:throw this.astErrorOutput(`Unhandled binary expression between ${i}`,e)}return t.push(")"),t}checkAndUpconvertOperator(e,t){const r=this.checkAndUpconvertBitwiseOperators(e,t);if(r)return r;const n={"%":this.fixIntegerDivisionAccuracy?"integerCorrectionModulo":"modulo","**":"pow"}[e.operator];if(!n)return null;switch(t.push(n),t.push("("),this.getType(e.left)){case"Integer":this.castValueToFloat(e.left,t);break;case"LiteralInteger":this.castLiteralToFloat(e.left,t);break;default:this.astGeneric(e.left,t)}switch(t.push(","),this.getType(e.right)){case"Integer":this.castValueToFloat(e.right,t);break;case"LiteralInteger":this.castLiteralToFloat(e.right,t);break;default:this.astGeneric(e.right,t)}return t.push(")"),t}checkAndUpconvertBitwiseOperators(e,t){const r={"&":"bitwiseAnd","|":"bitwiseOr","^":"bitwiseXOR","<<":"bitwiseZeroFillLeftShift",">>":"bitwiseSignedRightShift",">>>":"bitwiseZeroFillRightShift"}[e.operator];if(!r)return null;switch(t.push(r),t.push("("),this.getType(e.left)){case"Number":case"Float":this.castValueToInteger(e.left,t);break;case"LiteralInteger":this.castLiteralToInteger(e.left,t);break;default:this.astGeneric(e.left,t)}switch(t.push(","),this.getType(e.right)){case"Number":case"Float":this.castValueToInteger(e.right,t);break;case"LiteralInteger":this.castLiteralToInteger(e.right,t);break;default:this.astGeneric(e.right,t)}return t.push(")"),t}checkAndUpconvertBitwiseUnary(e,t){const r={"~":"bitwiseNot"}[e.operator];if(!r)return null;switch(t.push(r),t.push("("),this.getType(e.argument)){case"Number":case"Float":this.castValueToInteger(e.argument,t);break;case"LiteralInteger":this.castLiteralToInteger(e.argument,t);break;default:this.astGeneric(e.argument,t)}return t.push(")"),t}castLiteralToInteger(e,t){return this.pushState("casting-to-integer"),this.astGeneric(e,t),this.popState("casting-to-integer"),t}castLiteralToFloat(e,t){return this.pushState("casting-to-float"),this.astGeneric(e,t),this.popState("casting-to-float"),t}castValueToInteger(e,t){return this.pushState("casting-to-integer"),t.push("int("),this.astGeneric(e,t),t.push(")"),this.popState("casting-to-integer"),t}castValueToFloat(e,t){return this.pushState("casting-to-float"),t.push("float("),this.astGeneric(e,t),t.push(")"),this.popState("casting-to-float"),t}astIdentifierExpression(e,t){if("Identifier"!==e.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",e);const r=this.getType(e),i=n.sanitizeName(e.name);return"Infinity"===e.name?t.push("3.402823466e+38"):"Boolean"===r&&this.argumentNames.indexOf(i)>-1?t.push(`bool(user_${i})`):t.push(`user_${i}`),t}astForStatement(e,t){if("ForStatement"!==e.type)throw this.astErrorOutput("Invalid for statement",e);const r=[],n=[],i=[],s=[];let o=null;if(e.init){const{declarations:t}=e.init;t.length>1&&(o=!1),this.astGeneric(e.init,r);for(let e=0;e<t.length;e++)t[e].init&&"Literal"!==t[e].init.type&&(o=!1)}else o=!1;if(e.test?this.astGeneric(e.test,n):o=!1,e.update?this.astGeneric(e.update,i):o=!1,e.body&&(this.pushState("loop-body"),this.astGeneric(e.body,s),this.popState("loop-body")),null===o&&(o=this.isSafe(e.init)&&this.isSafe(e.test)),o){const e=r.join(""),o=";"!==e[e.length-1];t.push(`for (${e}${o?";":""}${n.join("")};${i.join("")}){\n`),t.push(s.join("")),t.push("}\n")}else{const e=this.getInternalVariableName("safeI");r.length>0&&t.push(r.join(""),"\n"),t.push(`for (int ${e}=0;${e}<LOOP_MAX;${e}++){\n`),n.length>0&&t.push(`if (!${n.join("")}) break;\n`),t.push(s.join("")),t.push(`\n${i.join("")};`),t.push("}\n")}return t}astWhileStatement(e,t){if("WhileStatement"!==e.type)throw this.astErrorOutput("Invalid while statement",e);const r=this.getInternalVariableName("safeI");return t.push(`for (int ${r}=0;${r}<LOOP_MAX;${r}++){\n`),t.push("if (!"),this.astGeneric(e.test,t),t.push(") break;\n"),this.astGeneric(e.body,t),t.push("}\n"),t}astDoWhileStatement(e,t){if("DoWhileStatement"!==e.type)throw this.astErrorOutput("Invalid while statement",e);const r=this.getInternalVariableName("safeI");return t.push(`for (int ${r}=0;${r}<LOOP_MAX;${r}++){\n`),this.astGeneric(e.body,t),t.push("if (!"),this.astGeneric(e.test,t),t.push(") break;\n"),t.push("}\n"),t}astAssignmentExpression(e,t){if("%="===e.operator)this.astGeneric(e.left,t),t.push("="),t.push("mod("),this.astGeneric(e.left,t),t.push(","),this.astGeneric(e.right,t),t.push(")");else{if("**="!==e.operator){const r=this.getType(e.left),n=this.getType(e.right);return this.astGeneric(e.left,t),t.push(e.operator),"Integer"!==r&&"Integer"===n?(t.push("float("),this.astGeneric(e.right,t),t.push(")")):this.astGeneric(e.right,t),t}this.astGeneric(e.left,t),t.push("="),t.push("pow("),this.astGeneric(e.left,t),t.push(","),this.astGeneric(e.right,t),t.push(")")}}astBlockStatement(e,t){if(this.isState("loop-body")){this.pushState("block-body");for(let r=0;r<e.body.length;r++)this.astGeneric(e.body[r],t);this.popState("block-body")}else{t.push("{\n");for(let r=0;r<e.body.length;r++)this.astGeneric(e.body[r],t);t.push("}\n")}return t}astVariableDeclaration(e,t){const r=e.declarations;if(!r||!r[0]||!r[0].init)throw this.astErrorOutput("Unexpected expression",e);const i=[];let o=null;const a=[];let u=[];for(let t=0;t<r.length;t++){const i=r[t],l=i.init,c=this.getDeclaration(i.id),h=this.getType(i.init);let p=h;"LiteralInteger"===p&&(p="Integer"===c.suggestedType?"Integer":"Number");const f=s[p];if(!f)throw this.astErrorOutput(`Markup type ${p} not handled`,e);const d=[];if("Integer"===h&&"Integer"===p){if(c.valueType="Number",0===t||null===o)d.push("float ");else if(p!==o)throw new Error("Unhandled declaration");o=p,d.push(`user_${n.sanitizeName(i.id.name)}=`),d.push("float("),this.astGeneric(l,d),d.push(")")}else c.valueType=p,0===t||null===o?d.push(`${f} `):p!==o&&(a.push(u.join(",")),u=[],d.push(`${f} `)),o=p,d.push(`user_${n.sanitizeName(i.id.name)}=`),"Number"===h&&"Integer"===p?l.left&&"Literal"===l.left.type?this.astGeneric(l,d):(d.push("int("),this.astGeneric(l,d),d.push(")")):"LiteralInteger"===h&&"Integer"===p?this.castLiteralToInteger(l,d):this.astGeneric(l,d);u.push(d.join(""))}return u.length>0&&a.push(u.join(",")),i.push(a.join(";")),t.push(i.join("")),t.push(";"),t}astIfStatement(e,t){return t.push("if ("),this.astGeneric(e.test,t),t.push(")"),"BlockStatement"===e.consequent.type?this.astGeneric(e.consequent,t):(t.push(" {\n"),this.astGeneric(e.consequent,t),t.push("\n}\n")),e.alternate&&(t.push("else "),"BlockStatement"===e.alternate.type||"IfStatement"===e.alternate.type?this.astGeneric(e.alternate,t):(t.push(" {\n"),this.astGeneric(e.alternate,t),t.push("\n}\n"))),t}astSwitchStatement(e,t){if("SwitchStatement"!==e.type)throw this.astErrorOutput("Invalid switch statement",e);const{discriminant:r,cases:n}=e,i=this.getType(r),s=`switchDiscriminant${this.astKey(e,"_")}`;switch(i){case"Float":case"Number":t.push(`float ${s} = `),this.astGeneric(r,t),t.push(";\n");break;case"Integer":t.push(`int ${s} = `),this.astGeneric(r,t),t.push(";\n")}if(1===n.length&&!n[0].test)return this.astGeneric(n[0].consequent,t),t;let o=!1,a=[],u=!1,l=!1;for(let e=0;e<n.length;e++){if(n[e].test){if(0!==e&&l?o?(t.push(`${s} == `),o=!1):t.push(` else if (${s} == `):(l=!0,t.push(`if (${s} == `)),"Integer"===i)switch(this.getType(n[e].test)){case"Number":case"Float":this.castValueToInteger(n[e].test,t);break;case"LiteralInteger":this.castLiteralToInteger(n[e].test,t)}else{if("Float"!==i)throw new Error("unhanlded");switch(this.getType(n[e].test)){case"LiteralInteger":this.castLiteralToFloat(n[e].test,t);break;case"Integer":this.castValueToFloat(n[e].test,t)}}if(!n[e].consequent||0===n[e].consequent.length){o=!0,t.push(" || ");continue}t.push(") {\n")}else{if(n.length>e+1){u=!0,this.astGeneric(n[e].consequent,a);continue}t.push(" else {\n")}this.astGeneric(n[e].consequent,t),t.push("\n}")}return u&&(t.push(" else {"),t.push(a.join("")),t.push("}")),t}astThisExpression(e,t){return t.push("this"),t}astMemberExpression(e,t){const{property:r,name:i,signature:s,origin:o,type:a,xProperty:u,yProperty:l,zProperty:c}=this.getMemberExpressionDetails(e);switch(s){case"value.thread.value":case"this.thread.value":if("x"!==i&&"y"!==i&&"z"!==i)throw this.astErrorOutput("Unexpected expression, expected `this.thread.x`, `this.thread.y`, or `this.thread.z`",e);return t.push(`threadId.${i}`),t;case"this.output.value":if(this.dynamicOutput)switch(i){case"x":this.isState("casting-to-float")?t.push("float(uOutputDim.x)"):t.push("uOutputDim.x");break;case"y":this.isState("casting-to-float")?t.push("float(uOutputDim.y)"):t.push("uOutputDim.y");break;case"z":this.isState("casting-to-float")?t.push("float(uOutputDim.z)"):t.push("uOutputDim.z");break;default:throw this.astErrorOutput("Unexpected expression",e)}else switch(i){case"x":this.isState("casting-to-integer")?t.push(this.output[0]):t.push(this.output[0],".0");break;case"y":this.isState("casting-to-integer")?t.push(this.output[1]):t.push(this.output[1],".0");break;case"z":this.isState("casting-to-integer")?t.push(this.output[2]):t.push(this.output[2],".0");break;default:throw this.astErrorOutput("Unexpected expression",e)}return t;case"value":throw this.astErrorOutput("Unexpected expression",e);case"value[]":case"value[][]":case"value[][][]":case"value[][][][]":case"value.value":if("Math"===o)return t.push(Math[i]),t;const l=n.sanitizeName(i);switch(r){case"r":return t.push(`user_${l}.r`),t;case"g":return t.push(`user_${l}.g`),t;case"b":return t.push(`user_${l}.b`),t;case"a":return t.push(`user_${l}.a`),t}break;case"this.constants.value":if(void 0===u)switch(a){case"Array(2)":case"Array(3)":case"Array(4)":return t.push(`constants_${n.sanitizeName(i)}`),t}case"this.constants.value[]":case"this.constants.value[][]":case"this.constants.value[][][]":case"this.constants.value[][][][]":break;case"fn()[]":return this.astCallExpression(e.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(r)),t.push("]"),t;case"fn()[][]":return this.astCallExpression(e.object.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(e.object.property)),t.push("]"),t.push("["),t.push(this.memberExpressionPropertyMarkup(e.property)),t.push("]"),t;case"[][]":return this.astArrayExpression(e.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(r)),t.push("]"),t;default:throw this.astErrorOutput("Unexpected expression",e)}if(!1===e.computed)switch(a){case"Number":case"Integer":case"Float":case"Boolean":return t.push(`${o}_${n.sanitizeName(i)}`),t}const h=`${o}_${n.sanitizeName(i)}`;switch(a){case"Array(2)":case"Array(3)":case"Array(4)":this.astGeneric(e.object,t),t.push("["),t.push(this.memberExpressionPropertyMarkup(u)),t.push("]");break;case"HTMLImageArray":t.push(`getImage3D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(1)":t.push(`getFloatFromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Array1D(2)":case"Array2D(2)":case"Array3D(2)":t.push(`getMemoryOptimizedVec2(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(2)":t.push(`getVec2FromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Array1D(3)":case"Array2D(3)":case"Array3D(3)":t.push(`getMemoryOptimizedVec3(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(3)":t.push(`getVec3FromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Array1D(4)":case"Array2D(4)":case"Array3D(4)":t.push(`getMemoryOptimizedVec4(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"ArrayTexture(4)":case"HTMLCanvas":case"HTMLImage":case"HTMLVideo":t.push(`getVec4FromSampler2D(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"NumberTexture":case"Array":case"Array2D":case"Array3D":case"Array4D":case"Input":case"Number":case"Float":case"Integer":if("single"===this.precision)t.push(`getMemoryOptimized32(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");else{const e="user"===o?this.lookupFunctionArgumentBitRatio(this.name,i):this.constantBitRatios[i];switch(e){case 1:t.push(`get8(${h}, ${h}Size, ${h}Dim, `);break;case 2:t.push(`get16(${h}, ${h}Size, ${h}Dim, `);break;case 4:case 0:t.push(`get32(${h}, ${h}Size, ${h}Dim, `);break;default:throw new Error(`unhandled bit ratio of ${e}`)}this.memberExpressionXYZ(u,l,c,t),t.push(")")}break;case"MemoryOptimizedNumberTexture":t.push(`getMemoryOptimized32(${h}, ${h}Size, ${h}Dim, `),this.memberExpressionXYZ(u,l,c,t),t.push(")");break;case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":t.push(`${h}[${this.memberExpressionPropertyMarkup(l)}]`),l&&t.push(`[${this.memberExpressionPropertyMarkup(u)}]`);break;default:throw new Error(`unhandled member expression "${a}"`)}return t}astCallExpression(e,t){if(!e.callee)throw this.astErrorOutput("Unknown CallExpression",e);let r=null;const i=this.isAstMathFunction(e);if(!(r=i||e.callee.object&&"ThisExpression"===e.callee.object.type?e.callee.property.name:"SequenceExpression"!==e.callee.type||"Literal"!==e.callee.expressions[0].type||isNaN(e.callee.expressions[0].raw)?e.callee.name:e.callee.expressions[1].property.name))throw this.astErrorOutput("Unhandled function, couldn't find name",e);switch(r){case"pow":r="_pow";break;case"round":r="_round"}if(this.calledFunctions.indexOf(r)<0&&this.calledFunctions.push(r),"random"===r&&this.plugins&&this.plugins.length>0)for(let e=0;e<this.plugins.length;e++){const r=this.plugins[e];if("Math.random()"===r.functionMatch&&r.functionReplace)return t.push(r.functionReplace),t}if(this.onFunctionCall&&this.onFunctionCall(this.name,r,e.arguments),t.push(r),t.push("("),i)for(let r=0;r<e.arguments.length;++r){const n=e.arguments[r],i=this.getType(n);switch(r>0&&t.push(", "),i){case"Integer":this.castValueToFloat(n,t);break;default:this.astGeneric(n,t)}}else{const i=this.lookupFunctionArgumentTypes(r)||[];for(let s=0;s<e.arguments.length;++s){const o=e.arguments[s];let a=i[s];s>0&&t.push(", ");const u=this.getType(o);switch(a||(this.triggerImplyArgumentType(r,s,u,this),a=u),u){case"Boolean":this.astGeneric(o,t);continue;case"Number":case"Float":if("Integer"===a){t.push("int("),this.astGeneric(o,t),t.push(")");continue}if("Number"===a||"Float"===a){this.astGeneric(o,t);continue}if("LiteralInteger"===a){this.castLiteralToFloat(o,t);continue}break;case"Integer":if("Number"===a||"Float"===a){t.push("float("),this.astGeneric(o,t),t.push(")");continue}if("Integer"===a){this.astGeneric(o,t);continue}break;case"LiteralInteger":if("Integer"===a){this.castLiteralToInteger(o,t);continue}if("Number"===a||"Float"===a){this.castLiteralToFloat(o,t);continue}if("LiteralInteger"===a){this.astGeneric(o,t);continue}break;case"Array(2)":case"Array(3)":case"Array(4)":if(a===u){if("Identifier"===o.type)t.push(`user_${n.sanitizeName(o.name)}`);else{if("ArrayExpression"!==o.type&&"MemberExpression"!==o.type&&"CallExpression"!==o.type)throw this.astErrorOutput(`Unhandled argument type ${o.type}`,e);this.astGeneric(o,t)}continue}break;case"HTMLCanvas":case"HTMLImage":case"HTMLImageArray":case"HTMLVideo":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":case"Array":case"Input":if(a===u){if("Identifier"!==o.type)throw this.astErrorOutput(`Unhandled argument type ${o.type}`,e);this.triggerImplyArgumentBitRatio(this.name,o.name,r,s);const i=n.sanitizeName(o.name);t.push(`user_${i},user_${i}Size,user_${i}Dim`);continue}}throw this.astErrorOutput(`Unhandled argument combination of ${u} and ${a} for argument named "${o.name}"`,e)}}return t.push(")"),t}astArrayExpression(e,t){const r=this.getType(e),n=e.elements.length;switch(r){case"Matrix(2)":case"Matrix(3)":case"Matrix(4)":t.push(`mat${n}(`);break;default:t.push(`vec${n}(`)}for(let r=0;r<n;++r){r>0&&t.push(", ");const n=e.elements[r];this.astGeneric(n,t)}return t.push(")"),t}memberExpressionXYZ(e,t,r,n){return r?n.push(this.memberExpressionPropertyMarkup(r),", "):n.push("0, "),t?n.push(this.memberExpressionPropertyMarkup(t),", "):n.push("0, "),n.push(this.memberExpressionPropertyMarkup(e)),n}memberExpressionPropertyMarkup(e){if(!e)throw new Error("Property not set");const t=[];switch(this.getType(e)){case"Number":case"Float":this.castValueToInteger(e,t);break;case"LiteralInteger":this.castLiteralToInteger(e,t);break;default:this.astGeneric(e,t)}return t.join("")}}}},{"../../utils":291,"../function-node":189}],218:[function(e,t,r){const{WebGLKernelValueBoolean:n}=e("./kernel-value/boolean"),{WebGLKernelValueFloat:i}=e("./kernel-value/float"),{WebGLKernelValueInteger:s}=e("./kernel-value/integer"),{WebGLKernelValueHTMLImage:o}=e("./kernel-value/html-image"),{WebGLKernelValueDynamicHTMLImage:a}=e("./kernel-value/dynamic-html-image"),{WebGLKernelValueHTMLVideo:u}=e("./kernel-value/html-video"),{WebGLKernelValueDynamicHTMLVideo:l}=e("./kernel-value/dynamic-html-video"),{WebGLKernelValueSingleInput:c}=e("./kernel-value/single-input"),{WebGLKernelValueDynamicSingleInput:h}=e("./kernel-value/dynamic-single-input"),{WebGLKernelValueUnsignedInput:p}=e("./kernel-value/unsigned-input"),{WebGLKernelValueDynamicUnsignedInput:f}=e("./kernel-value/dynamic-unsigned-input"),{WebGLKernelValueMemoryOptimizedNumberTexture:d}=e("./kernel-value/memory-optimized-number-texture"),{WebGLKernelValueDynamicMemoryOptimizedNumberTexture:m}=e("./kernel-value/dynamic-memory-optimized-number-texture"),{WebGLKernelValueNumberTexture:g}=e("./kernel-value/number-texture"),{WebGLKernelValueDynamicNumberTexture:v}=e("./kernel-value/dynamic-number-texture"),{WebGLKernelValueSingleArray:y}=e("./kernel-value/single-array"),{WebGLKernelValueDynamicSingleArray:_}=e("./kernel-value/dynamic-single-array"),{WebGLKernelValueSingleArray1DI:b}=e("./kernel-value/single-array1d-i"),{WebGLKernelValueDynamicSingleArray1DI:x}=e("./kernel-value/dynamic-single-array1d-i"),{WebGLKernelValueSingleArray2DI:w}=e("./kernel-value/single-array2d-i"),{WebGLKernelValueDynamicSingleArray2DI:E}=e("./kernel-value/dynamic-single-array2d-i"),{WebGLKernelValueSingleArray3DI:T}=e("./kernel-value/single-array3d-i"),{WebGLKernelValueDynamicSingleArray3DI:A}=e("./kernel-value/dynamic-single-array3d-i"),{WebGLKernelValueArray2:S}=e("./kernel-value/array2"),{WebGLKernelValueArray3:k}=e("./kernel-value/array3"),{WebGLKernelValueArray4:C}=e("./kernel-value/array4"),{WebGLKernelValueUnsignedArray:I}=e("./kernel-value/unsigned-array"),{WebGLKernelValueDynamicUnsignedArray:R}=e("./kernel-value/dynamic-unsigned-array"),L={unsigned:{dynamic:{Boolean:n,Integer:s,Float:i,Array:R,"Array(2)":S,"Array(3)":k,"Array(4)":C,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:f,NumberTexture:v,"ArrayTexture(1)":v,"ArrayTexture(2)":v,"ArrayTexture(3)":v,"ArrayTexture(4)":v,MemoryOptimizedNumberTexture:m,HTMLCanvas:a,HTMLImage:a,HTMLImageArray:!1,HTMLVideo:l},static:{Boolean:n,Float:i,Integer:s,Array:I,"Array(2)":S,"Array(3)":k,"Array(4)":C,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:p,NumberTexture:g,"ArrayTexture(1)":g,"ArrayTexture(2)":g,"ArrayTexture(3)":g,"ArrayTexture(4)":g,MemoryOptimizedNumberTexture:d,HTMLCanvas:o,HTMLImage:o,HTMLImageArray:!1,HTMLVideo:u}},single:{dynamic:{Boolean:n,Integer:s,Float:i,Array:_,"Array(2)":S,"Array(3)":k,"Array(4)":C,"Array1D(2)":x,"Array1D(3)":x,"Array1D(4)":x,"Array2D(2)":E,"Array2D(3)":E,"Array2D(4)":E,"Array3D(2)":A,"Array3D(3)":A,"Array3D(4)":A,Input:h,NumberTexture:v,"ArrayTexture(1)":v,"ArrayTexture(2)":v,"ArrayTexture(3)":v,"ArrayTexture(4)":v,MemoryOptimizedNumberTexture:m,HTMLCanvas:a,HTMLImage:a,HTMLImageArray:!1,HTMLVideo:l},static:{Boolean:n,Float:i,Integer:s,Array:y,"Array(2)":S,"Array(3)":k,"Array(4)":C,"Array1D(2)":b,"Array1D(3)":b,"Array1D(4)":b,"Array2D(2)":w,"Array2D(3)":w,"Array2D(4)":w,"Array3D(2)":T,"Array3D(3)":T,"Array3D(4)":T,Input:c,NumberTexture:g,"ArrayTexture(1)":g,"ArrayTexture(2)":g,"ArrayTexture(3)":g,"ArrayTexture(4)":g,MemoryOptimizedNumberTexture:d,HTMLCanvas:o,HTMLImage:o,HTMLImageArray:!1,HTMLVideo:u}}};t.exports={lookupKernelValueType:function(e,t,r,n){if(!e)throw new Error("type missing");if(!t)throw new Error("dynamic missing");if(!r)throw new Error("precision missing");n.type&&(e=n.type);const i=L[r][t];if(!1===i[e])return null;if(void 0===i[e])throw new Error(`Could not find a KernelValue for ${e}`);return i[e]},kernelValueMaps:L}},{"./kernel-value/array2":220,"./kernel-value/array3":221,"./kernel-value/array4":222,"./kernel-value/boolean":223,"./kernel-value/dynamic-html-image":224,"./kernel-value/dynamic-html-video":225,"./kernel-value/dynamic-memory-optimized-number-texture":226,"./kernel-value/dynamic-number-texture":227,"./kernel-value/dynamic-single-array":228,"./kernel-value/dynamic-single-array1d-i":229,"./kernel-value/dynamic-single-array2d-i":230,"./kernel-value/dynamic-single-array3d-i":231,"./kernel-value/dynamic-single-input":232,"./kernel-value/dynamic-unsigned-array":233,"./kernel-value/dynamic-unsigned-input":234,"./kernel-value/float":235,"./kernel-value/html-image":236,"./kernel-value/html-video":237,"./kernel-value/integer":239,"./kernel-value/memory-optimized-number-texture":240,"./kernel-value/number-texture":241,"./kernel-value/single-array":242,"./kernel-value/single-array1d-i":243,"./kernel-value/single-array2d-i":244,"./kernel-value/single-array3d-i":245,"./kernel-value/single-input":246,"./kernel-value/unsigned-array":247,"./kernel-value/unsigned-input":248}],219:[function(e,t,r){const{WebGLKernelValue:n}=e("./index"),{Input:i}=e("../../../input");t.exports={WebGLKernelArray:class extends n{checkSize(e,t){if(!this.kernel.validate)return;const{maxTextureSize:r}=this.kernel.constructor.features;if(e>r||t>r)throw e>t?new Error(`Argument texture width of ${e} larger than maximum size of ${r} for your GPU`):e<t?new Error(`Argument texture height of ${t} larger than maximum size of ${r} for your GPU`):new Error(`Argument texture height and width of ${t} larger than maximum size of ${r} for your GPU`)}setup(){this.requestTexture(),this.setupTexture(),this.defineTexture()}requestTexture(){this.texture=this.onRequestTexture()}defineTexture(){const{context:e}=this;e.activeTexture(this.contextHandle),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST)}setupTexture(){this.contextHandle=this.onRequestContextHandle(),this.index=this.onRequestIndex(),this.dimensionsId=this.id+"Dim",this.sizeId=this.id+"Size"}getBitRatio(e){if(Array.isArray(e[0]))return this.getBitRatio(e[0]);if(e.constructor===i)return this.getBitRatio(e.value);switch(e.constructor){case Uint8ClampedArray:case Uint8Array:case Int8Array:return 1;case Uint16Array:case Int16Array:return 2;case Float32Array:case Int32Array:default:return 4}}destroy(){this.prevArg&&this.prevArg.delete(),this.context.deleteTexture(this.texture)}}}},{"../../../input":287,"./index":238}],220:[function(e,t,r){const{WebGLKernelValue:n}=e("./index");t.exports={WebGLKernelValueArray2:class extends n{constructor(e,t){super(e,t),this.uploadValue=e}getSource(e){return"constants"===this.origin?`const vec2 ${this.id} = vec2(${e[0]},${e[1]});\n`:`uniform vec2 ${this.id};\n`}getStringValueHandler(){return"constants"===this.origin?"":`const uploadValue_${this.name} = ${this.varName};\n`}updateValue(e){"constants"!==this.origin&&this.kernel.setUniform2fv(this.id,this.uploadValue=e)}}}},{"./index":238}],221:[function(e,t,r){const{WebGLKernelValue:n}=e("./index");t.exports={WebGLKernelValueArray3:class extends n{constructor(e,t){super(e,t),this.uploadValue=e}getSource(e){return"constants"===this.origin?`const vec3 ${this.id} = vec3(${e[0]},${e[1]},${e[2]});\n`:`uniform vec3 ${this.id};\n`}getStringValueHandler(){return"constants"===this.origin?"":`const uploadValue_${this.name} = ${this.varName};\n`}updateValue(e){"constants"!==this.origin&&this.kernel.setUniform3fv(this.id,this.uploadValue=e)}}}},{"./index":238}],222:[function(e,t,r){const{WebGLKernelValue:n}=e("./index");t.exports={WebGLKernelValueArray4:class extends n{constructor(e,t){super(e,t),this.uploadValue=e}getSource(e){return"constants"===this.origin?`const vec4 ${this.id} = vec4(${e[0]},${e[1]},${e[2]},${e[3]});\n`:`uniform vec4 ${this.id};\n`}getStringValueHandler(){return"constants"===this.origin?"":`const uploadValue_${this.name} = ${this.varName};\n`}updateValue(e){"constants"!==this.origin&&this.kernel.setUniform4fv(this.id,this.uploadValue=e)}}}},{"./index":238}],223:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValue:i}=e("./index");t.exports={WebGLKernelValueBoolean:class extends i{constructor(e,t){super(e,t),this.uploadValue=e}getSource(e){return"constants"===this.origin?`const bool ${this.id} = ${e};\n`:`uniform bool ${this.id};\n`}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName};\n`}updateValue(e){"constants"!==this.origin&&this.kernel.setUniform1i(this.id,this.uploadValue=e)}}}},{"../../../utils":291,"./index":238}],224:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueHTMLImage:i}=e("./html-image");t.exports={WebGLKernelValueDynamicHTMLImage:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}updateValue(e){const{width:t,height:r}=e;this.checkSize(t,r),this.dimensions=[t,r,1],this.textureSize=[t,r],this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./html-image":236}],225:[function(e,t,r){const{WebGLKernelValueDynamicHTMLImage:n}=e("./dynamic-html-image");t.exports={WebGLKernelValueDynamicHTMLVideo:class extends n{}}},{"./dynamic-html-image":224}],226:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueMemoryOptimizedNumberTexture:i}=e("./memory-optimized-number-texture");t.exports={WebGLKernelValueDynamicMemoryOptimizedNumberTexture:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}updateValue(e){this.dimensions=e.dimensions,this.checkSize(e.size[0],e.size[1]),this.textureSize=e.size,this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./memory-optimized-number-texture":240}],227:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueNumberTexture:i}=e("./number-texture");t.exports={WebGLKernelValueDynamicNumberTexture:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}updateValue(e){this.dimensions=e.dimensions,this.checkSize(e.size[0],e.size[1]),this.textureSize=e.size,this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./number-texture":241}],228:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueSingleArray:i}=e("./single-array");t.exports={WebGLKernelValueDynamicSingleArray:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}updateValue(e){this.dimensions=n.getDimensions(e,!0),this.textureSize=n.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./single-array":242}],229:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueSingleArray1DI:i}=e("./single-array1d-i");t.exports={WebGLKernelValueDynamicSingleArray1DI:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./single-array1d-i":243}],230:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueSingleArray2DI:i}=e("./single-array2d-i");t.exports={WebGLKernelValueDynamicSingleArray2DI:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./single-array2d-i":244}],231:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueSingleArray3DI:i}=e("./single-array3d-i");t.exports={WebGLKernelValueDynamicSingleArray3DI:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./single-array3d-i":245}],232:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueSingleInput:i}=e("./single-input");t.exports={WebGLKernelValueDynamicSingleInput:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}updateValue(e){let[t,r,i]=e.size;this.dimensions=new Int32Array([t||1,r||1,i||1]),this.textureSize=n.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./single-input":246}],233:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueUnsignedArray:i}=e("./unsigned-array");t.exports={WebGLKernelValueDynamicUnsignedArray:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}updateValue(e){this.dimensions=n.getDimensions(e,!0),this.textureSize=n.getMemoryOptimizedPackedTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*(4/this.bitRatio),this.checkSize(this.textureSize[0],this.textureSize[1]);const t=this.getTransferArrayType(e);this.preUploadValue=new t(this.uploadArrayLength),this.uploadValue=new Uint8Array(this.preUploadValue.buffer),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./unsigned-array":247}],234:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueUnsignedInput:i}=e("./unsigned-input");t.exports={WebGLKernelValueDynamicUnsignedInput:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}updateValue(e){let[t,r,i]=e.size;this.dimensions=new Int32Array([t||1,r||1,i||1]),this.textureSize=n.getMemoryOptimizedPackedTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*(4/this.bitRatio),this.checkSize(this.textureSize[0],this.textureSize[1]);const s=this.getTransferArrayType(e.value);this.preUploadValue=new s(this.uploadArrayLength),this.uploadValue=new Uint8Array(this.preUploadValue.buffer),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./unsigned-input":248}],235:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValue:i}=e("./index");t.exports={WebGLKernelValueFloat:class extends i{constructor(e,t){super(e,t),this.uploadValue=e}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName};\n`}getSource(e){return"constants"===this.origin?Number.isInteger(e)?`const float ${this.id} = ${e}.0;\n`:`const float ${this.id} = ${e};\n`:`uniform float ${this.id};\n`}updateValue(e){"constants"!==this.origin&&this.kernel.setUniform1f(this.id,this.uploadValue=e)}}}},{"../../../utils":291,"./index":238}],236:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("./array");t.exports={WebGLKernelValueHTMLImage:class extends i{constructor(e,t){super(e,t);const{width:r,height:n}=e;this.checkSize(r,n),this.dimensions=[r,n,1],this.textureSize=[r,n],this.uploadValue=e}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName};\n`}getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.uploadValue=e),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"./array":219}],237:[function(e,t,r){const{WebGLKernelValueHTMLImage:n}=e("./html-image");t.exports={WebGLKernelValueHTMLVideo:class extends n{}}},{"./html-image":236}],238:[function(e,t,r){const{utils:n}=e("../../../utils"),{KernelValue:i}=e("../../kernel-value");t.exports={WebGLKernelValue:class extends i{constructor(e,t){super(e,t),this.dimensionsId=null,this.sizeId=null,this.initialValueConstructor=e.constructor,this.onRequestTexture=t.onRequestTexture,this.onRequestIndex=t.onRequestIndex,this.uploadValue=null,this.textureSize=null,this.bitRatio=null,this.prevArg=null}get id(){return`${this.origin}_${n.sanitizeName(this.name)}`}setup(){}getTransferArrayType(e){if(Array.isArray(e[0]))return this.getTransferArrayType(e[0]);switch(e.constructor){case Array:case Int32Array:case Int16Array:case Int8Array:return Float32Array;case Uint8ClampedArray:case Uint8Array:case Uint16Array:case Uint32Array:case Float32Array:case Float64Array:return e.constructor}return console.warn("Unfamiliar constructor type. Will go ahead and use, but likley this may result in a transfer of zeros"),e.constructor}getStringValueHandler(){throw new Error(`"getStringValueHandler" not implemented on ${this.constructor.name}`)}getVariablePrecisionString(){return this.kernel.getVariablePrecisionString(this.textureSize||void 0,this.tactic||void 0)}destroy(){}}}},{"../../../utils":291,"../../kernel-value":214}],239:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValue:i}=e("./index");t.exports={WebGLKernelValueInteger:class extends i{constructor(e,t){super(e,t),this.uploadValue=e}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName};\n`}getSource(e){return"constants"===this.origin?`const int ${this.id} = ${parseInt(e)};\n`:`uniform int ${this.id};\n`}updateValue(e){"constants"!==this.origin&&this.kernel.setUniform1i(this.id,this.uploadValue=e)}}}},{"../../../utils":291,"./index":238}],240:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("./array"),s="Source and destination textures are the same. Use immutable = true and manually cleanup kernel output texture memory with texture.delete()";t.exports={WebGLKernelValueMemoryOptimizedNumberTexture:class extends i{constructor(e,t){super(e,t);const[r,n]=e.size;this.checkSize(r,n),this.dimensions=e.dimensions,this.textureSize=e.size,this.uploadValue=e.texture,this.forceUploadEachRun=!0}setup(){this.setupTexture()}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName}.texture;\n`}getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);if(this.checkContext&&e.context!==this.context)throw new Error(`Value ${this.name} (${this.type}) must be from same context`);const{kernel:t,context:r}=this;if(t.pipeline)if(t.immutable)t.updateTextureArgumentRefs(this,e);else{if(t.texture&&t.texture.texture===e.texture)throw new Error(s);if(t.mappedTextures){const{mappedTextures:r}=t;for(let t=0;t<r.length;t++)if(r[t].texture===e.texture)throw new Error(s)}}r.activeTexture(this.contextHandle),r.bindTexture(r.TEXTURE_2D,this.uploadValue=e.texture),this.kernel.setUniform1i(this.id,this.index)}},sameError:s}},{"../../../utils":291,"./array":219}],241:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("./array"),{sameError:s}=e("./memory-optimized-number-texture");t.exports={WebGLKernelValueNumberTexture:class extends i{constructor(e,t){super(e,t);const[r,n]=e.size;this.checkSize(r,n);const{size:i,dimensions:s}=e;this.bitRatio=this.getBitRatio(e),this.dimensions=s,this.textureSize=i,this.uploadValue=e.texture,this.forceUploadEachRun=!0}setup(){this.setupTexture()}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName}.texture;\n`}getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);if(this.checkContext&&e.context!==this.context)throw new Error(`Value ${this.name} (${this.type}) must be from same context`);const{kernel:t,context:r}=this;if(t.pipeline)if(t.immutable)t.updateTextureArgumentRefs(this,e);else{if(t.texture&&t.texture.texture===e.texture)throw new Error(s);if(t.mappedTextures){const{mappedTextures:r}=t;for(let t=0;t<r.length;t++)if(r[t].texture===e.texture)throw new Error(s)}}r.activeTexture(this.contextHandle),r.bindTexture(r.TEXTURE_2D,this.uploadValue=e.texture),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"./array":219,"./memory-optimized-number-texture":240}],242:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("./array");t.exports={WebGLKernelValueSingleArray:class extends i{constructor(e,t){super(e,t),this.bitRatio=4,this.dimensions=n.getDimensions(e,!0),this.textureSize=n.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength)}getStringValueHandler(){return n.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`,`flattenTo(${this.varName}, uploadValue_${this.name})`])}getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;n.flattenTo(e,this.uploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.FLOAT,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"./array":219}],243:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("./array");t.exports={WebGLKernelValueSingleArray1DI:class extends i{constructor(e,t){super(e,t),this.bitRatio=4,this.setShape(e)}setShape(e){const t=n.getDimensions(e,!0);this.textureSize=n.getMemoryOptimizedFloatTextureSize(t,this.bitRatio),this.dimensions=new Int32Array([t[1],1,1]),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength)}getStringValueHandler(){return n.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`,`flattenTo(${this.varName}, uploadValue_${this.name})`])}getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;n.flatten2dArrayTo(e,this.uploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.FLOAT,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"./array":219}],244:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("./array");t.exports={WebGLKernelValueSingleArray2DI:class extends i{constructor(e,t){super(e,t),this.bitRatio=4,this.setShape(e)}setShape(e){const t=n.getDimensions(e,!0);this.textureSize=n.getMemoryOptimizedFloatTextureSize(t,this.bitRatio),this.dimensions=new Int32Array([t[1],t[2],1]),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength)}getStringValueHandler(){return n.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`,`flattenTo(${this.varName}, uploadValue_${this.name})`])}getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;n.flatten3dArrayTo(e,this.uploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.FLOAT,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"./array":219}],245:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("./array");t.exports={WebGLKernelValueSingleArray3DI:class extends i{constructor(e,t){super(e,t),this.bitRatio=4,this.setShape(e)}setShape(e){const t=n.getDimensions(e,!0);this.textureSize=n.getMemoryOptimizedFloatTextureSize(t,this.bitRatio),this.dimensions=new Int32Array([t[1],t[2],t[3]]),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength)}getStringValueHandler(){return n.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`,`flattenTo(${this.varName}, uploadValue_${this.name})`])}getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;n.flatten4dArrayTo(e,this.uploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.FLOAT,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"./array":219}],246:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("./array");t.exports={WebGLKernelValueSingleInput:class extends i{constructor(e,t){super(e,t),this.bitRatio=4;let[r,i,s]=e.size;this.dimensions=new Int32Array([r||1,i||1,s||1]),this.textureSize=n.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength)}getStringValueHandler(){return n.linesToString([`const uploadValue_${this.name} = new Float32Array(${this.uploadArrayLength})`,`flattenTo(${this.varName}.value, uploadValue_${this.name})`])}getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;n.flattenTo(e.value,this.uploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.FLOAT,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"./array":219}],247:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("./array");t.exports={WebGLKernelValueUnsignedArray:class extends i{constructor(e,t){super(e,t),this.bitRatio=this.getBitRatio(e),this.dimensions=n.getDimensions(e,!0),this.textureSize=n.getMemoryOptimizedPackedTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*(4/this.bitRatio),this.checkSize(this.textureSize[0],this.textureSize[1]),this.TranserArrayType=this.getTransferArrayType(e),this.preUploadValue=new this.TranserArrayType(this.uploadArrayLength),this.uploadValue=new Uint8Array(this.preUploadValue.buffer)}getStringValueHandler(){return n.linesToString([`const preUploadValue_${this.name} = new ${this.TranserArrayType.name}(${this.uploadArrayLength})`,`const uploadValue_${this.name} = new Uint8Array(preUploadValue_${this.name}.buffer)`,`flattenTo(${this.varName}, preUploadValue_${this.name})`])}getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;n.flattenTo(e,this.preUploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.UNSIGNED_BYTE,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"./array":219}],248:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("./array");t.exports={WebGLKernelValueUnsignedInput:class extends i{constructor(e,t){super(e,t),this.bitRatio=this.getBitRatio(e);const[r,i,s]=e.size;this.dimensions=new Int32Array([r||1,i||1,s||1]),this.textureSize=n.getMemoryOptimizedPackedTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*(4/this.bitRatio),this.checkSize(this.textureSize[0],this.textureSize[1]),this.TranserArrayType=this.getTransferArrayType(e.value),this.preUploadValue=new this.TranserArrayType(this.uploadArrayLength),this.uploadValue=new Uint8Array(this.preUploadValue.buffer)}getStringValueHandler(){return n.linesToString([`const preUploadValue_${this.name} = new ${this.TranserArrayType.name}(${this.uploadArrayLength})`,`const uploadValue_${this.name} = new Uint8Array(preUploadValue_${this.name}.buffer)`,`flattenTo(${this.varName}.value, preUploadValue_${this.name})`])}getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(value.constructor);const{context:t}=this;n.flattenTo(e.value,this.preUploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.UNSIGNED_BYTE,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"./array":219}],249:[function(e,t,r){const{GLKernel:n}=e("../gl/kernel"),{FunctionBuilder:i}=e("../function-builder"),{WebGLFunctionNode:s}=e("./function-node"),{utils:o}=e("../../utils"),a=e("../../plugins/math-random-uniformly-distributed"),{fragmentShader:u}=e("./fragment-shader"),{vertexShader:l}=e("./vertex-shader"),{glKernelString:c}=e("../gl/kernel-string"),{lookupKernelValueType:h}=e("./kernel-value-maps");let p=null,f=null,d=null,m=null,g=null;const v=[a],y=[],_={};t.exports={WebGLKernel:class extends n{static get isSupported(){return null!==p?p:(this.setupFeatureChecks(),p=this.isContextMatch(d))}static setupFeatureChecks(){"undefined"!=typeof document?f=document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas&&(f=new OffscreenCanvas(0,0)),f&&(d=f.getContext("webgl")||f.getContext("experimental-webgl"))&&d.getExtension&&(m={OES_texture_float:d.getExtension("OES_texture_float"),OES_texture_float_linear:d.getExtension("OES_texture_float_linear"),OES_element_index_uint:d.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:d.getExtension("WEBGL_draw_buffers")},g=this.getFeatures())}static isContextMatch(e){return"undefined"!=typeof WebGLRenderingContext&&e instanceof WebGLRenderingContext}static getIsTextureFloat(){return Boolean(m.OES_texture_float)}static getIsDrawBuffers(){return Boolean(m.WEBGL_draw_buffers)}static getChannelCount(){return m.WEBGL_draw_buffers?d.getParameter(m.WEBGL_draw_buffers.MAX_DRAW_BUFFERS_WEBGL):1}static getMaxTextureSize(){return d.getParameter(d.MAX_TEXTURE_SIZE)}static lookupKernelValueType(e,t,r,n){return h(e,t,r,n)}static get testCanvas(){return f}static get testContext(){return d}static get features(){return g}static get fragmentShader(){return u}static get vertexShader(){return l}constructor(e,t){super(e,t),this.program=null,this.pipeline=t.pipeline,this.endianness=o.systemEndianness(),this.extensions={},this.argumentTextureCount=0,this.constantTextureCount=0,this.fragShader=null,this.vertShader=null,this.drawBuffersMap=null,this.maxTexSize=null,this.onRequestSwitchKernel=null,this.texture=null,this.mappedTextures=null,this.mergeSettings(e.settings||t),this.threadDim=null,this.framebuffer=null,this.buffer=null,this.textureCache=[],this.programUniformLocationCache={},this.uniform1fCache={},this.uniform1iCache={},this.uniform2fCache={},this.uniform2fvCache={},this.uniform2ivCache={},this.uniform3fvCache={},this.uniform3ivCache={},this.uniform4fvCache={},this.uniform4ivCache={}}initCanvas(){if("undefined"!=typeof document){const e=document.createElement("canvas");return e.width=2,e.height=2,e}if("undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(0,0)}initContext(){const e={alpha:!1,depth:!1,antialias:!1};return this.canvas.getContext("webgl",e)||this.canvas.getContext("experimental-webgl",e)}initPlugins(e){const t=[],{source:r}=this;if("string"==typeof r)for(let e=0;e<v.length;e++){const n=v[e];r.match(n.functionMatch)&&t.push(n)}else if("object"==typeof r&&e.pluginNames)for(let r=0;r<v.length;r++){const n=v[r];e.pluginNames.some(e=>e===n.name)&&t.push(n)}return t}initExtensions(){this.extensions={OES_texture_float:this.context.getExtension("OES_texture_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear"),OES_element_index_uint:this.context.getExtension("OES_element_index_uint"),WEBGL_draw_buffers:this.context.getExtension("WEBGL_draw_buffers"),WEBGL_color_buffer_float:this.context.getExtension("WEBGL_color_buffer_float")}}validateSettings(e){if(!this.validate)return void(this.texSize=o.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output));const{features:t}=this.constructor;if(!0===this.optimizeFloatMemory&&!t.isTextureFloat)throw new Error("Float textures are not supported");if("single"===this.precision&&!t.isFloatRead)throw new Error("Single precision not supported");if(!this.graphical&&null===this.precision&&t.isTextureFloat&&(this.precision=t.isFloatRead?"single":"unsigned"),this.subKernels&&this.subKernels.length>0&&!this.extensions.WEBGL_draw_buffers)throw new Error("could not instantiate draw buffers extension");if(null===this.fixIntegerDivisionAccuracy?this.fixIntegerDivisionAccuracy=!t.isIntegerDivisionAccurate:this.fixIntegerDivisionAccuracy&&t.isIntegerDivisionAccurate&&(this.fixIntegerDivisionAccuracy=!1),this.checkOutput(),!this.output||0===this.output.length){if(1!==e.length)throw new Error("Auto output only supported for kernels with only one input");const t=o.getVariableType(e[0],this.strictIntegers);switch(t){case"Array":this.output=o.getDimensions(t);break;case"NumberTexture":case"MemoryOptimizedNumberTexture":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":this.output=e[0].output;break;default:throw new Error("Auto output not supported for input type: "+t)}}if(this.graphical){if(2!==this.output.length)throw new Error("Output must have 2 dimensions on graphical mode");return"precision"===this.precision&&(this.precision="unsigned",console.warn("Cannot use graphical mode and single precision at the same time")),void(this.texSize=o.clone(this.output))}null===this.precision&&t.isTextureFloat&&(this.precision="single"),this.texSize=o.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output),this.checkTextureSize()}updateMaxTexSize(){const{texSize:e,canvas:t}=this;if(null===this.maxTexSize){let r=y.indexOf(t);-1===r&&(r=y.length,y.push(t),_[r]=[e[0],e[1]]),this.maxTexSize=_[r]}this.maxTexSize[0]<e[0]&&(this.maxTexSize[0]=e[0]),this.maxTexSize[1]<e[1]&&(this.maxTexSize[1]=e[1])}setupArguments(e){this.kernelArguments=[],this.argumentTextureCount=0;const t=null===this.argumentTypes;if(t&&(this.argumentTypes=[]),this.argumentSizes=[],this.argumentBitRatios=[],e.length<this.argumentNames.length)throw new Error("not enough arguments for kernel");if(e.length>this.argumentNames.length)throw new Error("too many arguments for kernel");const{context:r}=this;let n=0;const i=()=>this.createTexture(),s=()=>this.constantTextureCount+n++,a=e=>{this.switchKernels({type:"argumentMismatch",needed:e})},u=()=>r.TEXTURE0+this.constantTextureCount+this.argumentTextureCount++;for(let n=0;n<e.length;n++){const l=e[n],c=this.argumentNames[n];let h;t?(h=o.getVariableType(l,this.strictIntegers),this.argumentTypes.push(h)):h=this.argumentTypes[n];const p=this.constructor.lookupKernelValueType(h,this.dynamicArguments?"dynamic":"static",this.precision,e[n]);if(null===p)return this.requestFallback(e);const f=new p(l,{name:c,type:h,tactic:this.tactic,origin:"user",context:r,checkContext:this.checkContext,kernel:this,strictIntegers:this.strictIntegers,onRequestTexture:i,onRequestIndex:s,onUpdateValueMismatch:a,onRequestContextHandle:u});this.kernelArguments.push(f),f.setup(),this.argumentSizes.push(f.textureSize),this.argumentBitRatios[n]=f.bitRatio}}createTexture(){const e=this.context.createTexture();return this.textureCache.push(e),e}setupConstants(e){const{context:t}=this;this.kernelConstants=[],this.forceUploadKernelConstants=[];let r=null===this.constantTypes;r&&(this.constantTypes={}),this.constantBitRatios={};let n=0;for(const i in this.constants){const s=this.constants[i];let a;r?(a=o.getVariableType(s,this.strictIntegers),this.constantTypes[i]=a):a=this.constantTypes[i];const u=this.constructor.lookupKernelValueType(a,"static",this.precision,s);if(null===u)return this.requestFallback(e);const l=new u(s,{name:i,type:a,tactic:this.tactic,origin:"constants",context:this.context,checkContext:this.checkContext,kernel:this,strictIntegers:this.strictIntegers,onRequestTexture:()=>this.createTexture(),onRequestIndex:()=>n++,onRequestContextHandle:()=>t.TEXTURE0+this.constantTextureCount++});this.constantBitRatios[i]=l.bitRatio,this.kernelConstants.push(l),l.setup(),l.forceUploadEachRun&&this.forceUploadKernelConstants.push(l)}}build(){if(this.built)return;if(this.initExtensions(),this.validateSettings(arguments),this.setupConstants(arguments),this.fallbackRequested)return;if(this.setupArguments(arguments),this.fallbackRequested)return;this.updateMaxTexSize(),this.translateSource();const e=this.pickRenderStrategy(arguments);if(e)return e;const{texSize:t,context:r,canvas:n}=this;r.enable(r.SCISSOR_TEST),this.pipeline&&this.precision,r.viewport(0,0,this.maxTexSize[0],this.maxTexSize[1]),n.width=this.maxTexSize[0],n.height=this.maxTexSize[1];const i=this.threadDim=Array.from(this.output);for(;i.length<3;)i.push(1);const s=this.getVertexShader(arguments),o=r.createShader(r.VERTEX_SHADER);r.shaderSource(o,s),r.compileShader(o),this.vertShader=o;const a=this.getFragmentShader(arguments),u=r.createShader(r.FRAGMENT_SHADER);if(r.shaderSource(u,a),r.compileShader(u),this.fragShader=u,this.debug&&(console.log("GLSL Shader Output:"),console.log(a)),!r.getShaderParameter(o,r.COMPILE_STATUS))throw new Error("Error compiling vertex shader: "+r.getShaderInfoLog(o));if(!r.getShaderParameter(u,r.COMPILE_STATUS))throw new Error("Error compiling fragment shader: "+r.getShaderInfoLog(u));const l=this.program=r.createProgram();r.attachShader(l,o),r.attachShader(l,u),r.linkProgram(l),this.framebuffer=r.createFramebuffer(),this.framebuffer.width=t[0],this.framebuffer.height=t[1],this.rawValueFramebuffers={};const c=new Float32Array([-1,-1,1,-1,-1,1,1,1]),h=new Float32Array([0,0,1,0,0,1,1,1]),p=c.byteLength;let f=this.buffer;f?r.bindBuffer(r.ARRAY_BUFFER,f):(f=this.buffer=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,f),r.bufferData(r.ARRAY_BUFFER,c.byteLength+h.byteLength,r.STATIC_DRAW)),r.bufferSubData(r.ARRAY_BUFFER,0,c),r.bufferSubData(r.ARRAY_BUFFER,p,h);const d=r.getAttribLocation(this.program,"aPos");r.enableVertexAttribArray(d),r.vertexAttribPointer(d,2,r.FLOAT,!1,0,0);const m=r.getAttribLocation(this.program,"aTexCoord");r.enableVertexAttribArray(m),r.vertexAttribPointer(m,2,r.FLOAT,!1,0,p),r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer);let g=0;r.useProgram(this.program);for(let e in this.constants)this.kernelConstants[g++].updateValue(this.constants[e]);this._setupOutputTexture(),null!==this.subKernels&&this.subKernels.length>0&&(this._mappedTextureSwitched={},this._setupSubOutputTextures()),this.buildSignature(arguments),this.built=!0}translateSource(){const e=i.fromKernel(this,s,{fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy});this.translatedSource=e.getPrototypeString("kernel"),this.setupReturnTypes(e)}setupReturnTypes(e){if(this.graphical||this.returnType||(this.returnType=e.getKernelResultType()),this.subKernels&&this.subKernels.length>0)for(let t=0;t<this.subKernels.length;t++){const r=this.subKernels[t];r.returnType||(r.returnType=e.getSubKernelResultType(t))}}run(){const{kernelArguments:e,texSize:t,forceUploadKernelConstants:r,context:n}=this;n.useProgram(this.program),n.scissor(0,0,t[0],t[1]),this.dynamicOutput&&(this.setUniform3iv("uOutputDim",new Int32Array(this.threadDim)),this.setUniform2iv("uTexSize",t)),this.setUniform2f("ratio",t[0]/this.maxTexSize[0],t[1]/this.maxTexSize[1]);for(let e=0;e<r.length;e++){const t=r[e];if(t.updateValue(this.constants[t.name]),this.switchingKernels)return}for(let t=0;t<e.length;t++)if(e[t].updateValue(arguments[t]),this.switchingKernels)return;if(this.plugins)for(let e=0;e<this.plugins.length;e++){const t=this.plugins[e];t.onBeforeRun&&t.onBeforeRun(this)}if(this.graphical)return this.pipeline?(n.bindRenderbuffer(n.RENDERBUFFER,null),n.bindFramebuffer(n.FRAMEBUFFER,this.framebuffer),this.immutable&&this._replaceOutputTexture(),n.drawArrays(n.TRIANGLE_STRIP,0,4),this.immutable?this.texture.clone():this.texture):(n.bindRenderbuffer(n.RENDERBUFFER,null),n.bindFramebuffer(n.FRAMEBUFFER,null),void n.drawArrays(n.TRIANGLE_STRIP,0,4));n.bindFramebuffer(n.FRAMEBUFFER,this.framebuffer),this.immutable&&this._replaceOutputTexture(),null!==this.subKernels&&(this.immutable&&this._replaceSubOutputTextures(),this.drawBuffers()),n.drawArrays(n.TRIANGLE_STRIP,0,4)}drawBuffers(){this.extensions.WEBGL_draw_buffers.drawBuffersWEBGL(this.drawBuffersMap)}getInternalFormat(){return this.context.RGBA}getTextureFormat(){const{context:e}=this;switch(this.getInternalFormat()){case e.RGBA:return e.RGBA;default:throw new Error("Unknown internal format")}}_replaceOutputTexture(){if(this.texture.beforeMutate()||this._textureSwitched){const e=this.context;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture.texture,0),this._textureSwitched=!1}}_setupOutputTexture(){const e=this.context,t=this.texSize;if(this.texture)return void e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture.texture,0);const r=this.createTexture();e.activeTexture(e.TEXTURE0+this.constantTextureCount+this.argumentTextureCount),e.bindTexture(e.TEXTURE_2D,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST);const n=this.getInternalFormat();"single"===this.precision?e.texImage2D(e.TEXTURE_2D,0,n,t[0],t[1],0,e.RGBA,e.FLOAT,null):e.texImage2D(e.TEXTURE_2D,0,n,t[0],t[1],0,n,e.UNSIGNED_BYTE,null),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0),this.texture=new this.TextureConstructor({texture:r,size:t,dimensions:this.threadDim,output:this.output,context:this.context,internalFormat:this.getInternalFormat(),textureFormat:this.getTextureFormat(),kernel:this})}_replaceSubOutputTextures(){const e=this.context;for(let t=0;t<this.mappedTextures.length;t++){const r=this.mappedTextures[t];(r.beforeMutate()||this._mappedTextureSwitched[t])&&(e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t+1,e.TEXTURE_2D,r.texture,0),this._mappedTextureSwitched[t]=!1)}}_setupSubOutputTextures(){const e=this.context;if(this.mappedTextures){for(let t=0;t<this.subKernels.length;t++)e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t+1,e.TEXTURE_2D,this.mappedTextures[t].texture,0);return}const t=this.texSize;this.drawBuffersMap=[e.COLOR_ATTACHMENT0],this.mappedTextures=[];for(let r=0;r<this.subKernels.length;r++){const n=this.createTexture();this.drawBuffersMap.push(e.COLOR_ATTACHMENT0+r+1),e.activeTexture(e.TEXTURE0+this.constantTextureCount+this.argumentTextureCount+r),e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),"single"===this.precision?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t[0],t[1],0,e.RGBA,e.FLOAT,null):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t[0],t[1],0,e.RGBA,e.UNSIGNED_BYTE,null),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+r+1,e.TEXTURE_2D,n,0),this.mappedTextures.push(new this.TextureConstructor({texture:n,size:t,dimensions:this.threadDim,output:this.output,context:this.context,internalFormat:this.getInternalFormat(),textureFormat:this.getTextureFormat(),kernel:this}))}}setUniform1f(e,t){if(this.uniform1fCache.hasOwnProperty(e)&&t===this.uniform1fCache[e])return;this.uniform1fCache[e]=t;const r=this.getUniformLocation(e);this.context.uniform1f(r,t)}setUniform1i(e,t){if(this.uniform1iCache.hasOwnProperty(e)&&t===this.uniform1iCache[e])return;this.uniform1iCache[e]=t;const r=this.getUniformLocation(e);this.context.uniform1i(r,t)}setUniform2f(e,t,r){if(this.uniform2fCache.hasOwnProperty(e)){const n=this.uniform2fCache[e];if(t===n[0]&&r===n[1])return}this.uniform2fCache[e]=[t,r];const n=this.getUniformLocation(e);this.context.uniform2f(n,t,r)}setUniform2fv(e,t){if(this.uniform2fvCache.hasOwnProperty(e)){const r=this.uniform2fvCache[e];if(t[0]===r[0]&&t[1]===r[1])return}this.uniform2fvCache[e]=t;const r=this.getUniformLocation(e);this.context.uniform2fv(r,t)}setUniform2iv(e,t){if(this.uniform2ivCache.hasOwnProperty(e)){const r=this.uniform2ivCache[e];if(t[0]===r[0]&&t[1]===r[1])return}this.uniform2ivCache[e]=t;const r=this.getUniformLocation(e);this.context.uniform2iv(r,t)}setUniform3fv(e,t){if(this.uniform3fvCache.hasOwnProperty(e)){const r=this.uniform3fvCache[e];if(t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2])return}this.uniform3fvCache[e]=t;const r=this.getUniformLocation(e);this.context.uniform3fv(r,t)}setUniform3iv(e,t){if(this.uniform3ivCache.hasOwnProperty(e)){const r=this.uniform3ivCache[e];if(t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2])return}this.uniform3ivCache[e]=t;const r=this.getUniformLocation(e);this.context.uniform3iv(r,t)}setUniform4fv(e,t){if(this.uniform4fvCache.hasOwnProperty(e)){const r=this.uniform4fvCache[e];if(t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3])return}this.uniform4fvCache[e]=t;const r=this.getUniformLocation(e);this.context.uniform4fv(r,t)}setUniform4iv(e,t){if(this.uniform4ivCache.hasOwnProperty(e)){const r=this.uniform4ivCache[e];if(t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3])return}this.uniform4ivCache[e]=t;const r=this.getUniformLocation(e);this.context.uniform4iv(r,t)}getUniformLocation(e){return this.programUniformLocationCache.hasOwnProperty(e)?this.programUniformLocationCache[e]:this.programUniformLocationCache[e]=this.context.getUniformLocation(this.program,e)}_getFragShaderArtifactMap(e){return{HEADER:this._getHeaderString(),LOOP_MAX:this._getLoopMaxString(),PLUGINS:this._getPluginsString(),CONSTANTS:this._getConstantsString(),DECODE32_ENDIANNESS:this._getDecode32EndiannessString(),ENCODE32_ENDIANNESS:this._getEncode32EndiannessString(),DIVIDE_WITH_INTEGER_CHECK:this._getDivideWithIntegerCheckString(),INJECTED_NATIVE:this._getInjectedNative(),MAIN_CONSTANTS:this._getMainConstantsString(),MAIN_ARGUMENTS:this._getMainArgumentsString(e),KERNEL:this.getKernelString(),MAIN_RESULT:this.getMainResultString(),FLOAT_TACTIC_DECLARATION:this.getFloatTacticDeclaration(),INT_TACTIC_DECLARATION:this.getIntTacticDeclaration(),SAMPLER_2D_TACTIC_DECLARATION:this.getSampler2DTacticDeclaration(),SAMPLER_2D_ARRAY_TACTIC_DECLARATION:this.getSampler2DArrayTacticDeclaration()}}_getVertShaderArtifactMap(e){return{FLOAT_TACTIC_DECLARATION:this.getFloatTacticDeclaration(),INT_TACTIC_DECLARATION:this.getIntTacticDeclaration(),SAMPLER_2D_TACTIC_DECLARATION:this.getSampler2DTacticDeclaration(),SAMPLER_2D_ARRAY_TACTIC_DECLARATION:this.getSampler2DArrayTacticDeclaration()}}_getHeaderString(){return null!==this.subKernels?"#extension GL_EXT_draw_buffers : require\n":""}_getLoopMaxString(){return this.loopMaxIterations?` ${parseInt(this.loopMaxIterations)};\n`:" 1000;\n"}_getPluginsString(){return this.plugins?this.plugins.map(e=>e.source&&this.source.match(e.functionMatch)?e.source:"").join("\n"):"\n"}_getConstantsString(){const e=[],{threadDim:t,texSize:r}=this;return this.dynamicOutput?e.push("uniform ivec3 uOutputDim","uniform ivec2 uTexSize"):e.push(`ivec3 uOutputDim = ivec3(${t[0]}, ${t[1]}, ${t[2]})`,`ivec2 uTexSize = ivec2(${r[0]}, ${r[1]})`),o.linesToString(e)}_getTextureCoordinate(){const e=this.subKernels;return null===e||e.length<1?"varying vec2 vTexCoord;\n":"out vec2 vTexCoord;\n"}_getDecode32EndiannessString(){return"LE"===this.endianness?"":" texel.rgba = texel.abgr;\n"}_getEncode32EndiannessString(){return"LE"===this.endianness?"":" texel.rgba = texel.abgr;\n"}_getDivideWithIntegerCheckString(){return this.fixIntegerDivisionAccuracy?"float divWithIntCheck(float x, float y) {\n if (floor(x) == x && floor(y) == y && integerMod(x, y) == 0.0) {\n return float(int(x) / int(y));\n }\n return x / y;\n}\n\nfloat integerCorrectionModulo(float number, float divisor) {\n if (number < 0.0) {\n number = abs(number);\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return -(number - (divisor * floor(divWithIntCheck(number, divisor))));\n }\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return number - (divisor * floor(divWithIntCheck(number, divisor)));\n}":""}_getMainArgumentsString(e){const t=[],{argumentNames:r}=this;for(let n=0;n<r.length;n++)t.push(this.kernelArguments[n].getSource(e[n]));return t.join("")}_getInjectedNative(){return this.injectedNative||""}_getMainConstantsString(){const e=[],{constants:t}=this;if(t){let r=0;for(const n in t)this.constants.hasOwnProperty(n)&&e.push(this.kernelConstants[r++].getSource(this.constants[n]))}return e.join("")}getRawValueFramebuffer(e,t){if(this.rawValueFramebuffers[e]||(this.rawValueFramebuffers[e]={}),!this.rawValueFramebuffers[e][t]){const r=this.context.createFramebuffer();r.width=e,r.height=t,this.rawValueFramebuffers[e][t]=r}return this.rawValueFramebuffers[e][t]}getKernelResultDeclaration(){switch(this.returnType){case"Array(2)":return"vec2 kernelResult";case"Array(3)":return"vec3 kernelResult";case"Array(4)":return"vec4 kernelResult";case"LiteralInteger":case"Float":case"Number":case"Integer":return"float kernelResult";default:if(this.graphical)return"float kernelResult";throw new Error(`unrecognized output type "${this.returnType}"`)}}getKernelString(){const e=[this.getKernelResultDeclaration()],{subKernels:t}=this;if(null!==t)switch(this.returnType){case"Number":case"Float":case"Integer":for(let r=0;r<t.length;r++){const n=t[r];e.push("Integer"===n.returnType?`int subKernelResult_${n.name} = 0`:`float subKernelResult_${n.name} = 0.0`)}break;case"Array(2)":for(let r=0;r<t.length;r++)e.push(`vec2 subKernelResult_${t[r].name}`);break;case"Array(3)":for(let r=0;r<t.length;r++)e.push(`vec3 subKernelResult_${t[r].name}`);break;case"Array(4)":for(let r=0;r<t.length;r++)e.push(`vec4 subKernelResult_${t[r].name}`)}return o.linesToString(e)+this.translatedSource}getMainResultGraphical(){return o.linesToString([" threadId = indexTo3D(index, uOutputDim)"," kernel()"," gl_FragColor = actualColor"])}getMainResultPackedPixels(){switch(this.returnType){case"LiteralInteger":case"Number":case"Integer":case"Float":return this.getMainResultKernelPackedPixels()+this.getMainResultSubKernelPackedPixels();default:throw new Error(`packed output only usable with Numbers, "${this.returnType}" specified`)}}getMainResultKernelPackedPixels(){return o.linesToString([" threadId = indexTo3D(index, uOutputDim)"," kernel()",` gl_FragData[0] = ${this.useLegacyEncoder?"legacyEncode32":"encode32"}(kernelResult)`])}getMainResultSubKernelPackedPixels(){const e=[];if(!this.subKernels)return"";for(let t=0;t<this.subKernels.length;t++)"Integer"===this.subKernels[t].returnType?e.push(` gl_FragData[${t+1}] = ${this.useLegacyEncoder?"legacyEncode32":"encode32"}(float(subKernelResult_${this.subKernels[t].name}))`):e.push(` gl_FragData[${t+1}] = ${this.useLegacyEncoder?"legacyEncode32":"encode32"}(subKernelResult_${this.subKernels[t].name})`);return o.linesToString(e)}getMainResultMemoryOptimizedFloats(){const e=[" index *= 4"];switch(this.returnType){case"Number":case"Integer":case"Float":const t=["r","g","b","a"];for(let r=0;r<t.length;r++){const n=t[r];this.getMainResultKernelMemoryOptimizedFloats(e,n),this.getMainResultSubKernelMemoryOptimizedFloats(e,n),r+1<t.length&&e.push(" index += 1")}break;default:throw new Error(`optimized output only usable with Numbers, ${this.returnType} specified`)}return o.linesToString(e)}getMainResultKernelMemoryOptimizedFloats(e,t){e.push(" threadId = indexTo3D(index, uOutputDim)"," kernel()",` gl_FragData[0].${t} = kernelResult`)}getMainResultSubKernelMemoryOptimizedFloats(e,t){if(!this.subKernels)return e;for(let r=0;r<this.subKernels.length;r++)"Integer"===this.subKernels[r].returnType?e.push(` gl_FragData[${r+1}].${t} = float(subKernelResult_${this.subKernels[r].name})`):e.push(` gl_FragData[${r+1}].${t} = subKernelResult_${this.subKernels[r].name}`)}getMainResultKernelNumberTexture(){return[" threadId = indexTo3D(index, uOutputDim)"," kernel()"," gl_FragData[0][0] = kernelResult"]}getMainResultSubKernelNumberTexture(){const e=[];if(!this.subKernels)return e;for(let t=0;t<this.subKernels.length;++t){const r=this.subKernels[t];"Integer"===r.returnType?e.push(` gl_FragData[${t+1}][0] = float(subKernelResult_${r.name})`):e.push(` gl_FragData[${t+1}][0] = subKernelResult_${r.name}`)}return e}getMainResultKernelArray2Texture(){return[" threadId = indexTo3D(index, uOutputDim)"," kernel()"," gl_FragData[0][0] = kernelResult[0]"," gl_FragData[0][1] = kernelResult[1]"]}getMainResultSubKernelArray2Texture(){const e=[];if(!this.subKernels)return e;for(let t=0;t<this.subKernels.length;++t)e.push(` gl_FragData[${t+1}][0] = subKernelResult_${this.subKernels[t].name}[0]`,` gl_FragData[${t+1}][1] = subKernelResult_${this.subKernels[t].name}[1]`);return e}getMainResultKernelArray3Texture(){return[" threadId = indexTo3D(index, uOutputDim)"," kernel()"," gl_FragData[0][0] = kernelResult[0]"," gl_FragData[0][1] = kernelResult[1]"," gl_FragData[0][2] = kernelResult[2]"]}getMainResultSubKernelArray3Texture(){const e=[];if(!this.subKernels)return e;for(let t=0;t<this.subKernels.length;++t)e.push(` gl_FragData[${t+1}][0] = subKernelResult_${this.subKernels[t].name}[0]`,` gl_FragData[${t+1}][1] = subKernelResult_${this.subKernels[t].name}[1]`,` gl_FragData[${t+1}][2] = subKernelResult_${this.subKernels[t].name}[2]`);return e}getMainResultKernelArray4Texture(){return[" threadId = indexTo3D(index, uOutputDim)"," kernel()"," gl_FragData[0] = kernelResult"]}getMainResultSubKernelArray4Texture(){const e=[];if(!this.subKernels)return e;switch(this.returnType){case"Number":case"Float":case"Integer":for(let t=0;t<this.subKernels.length;++t)"Integer"===this.subKernels[t].returnType?e.push(` gl_FragData[${t+1}] = float(subKernelResult_${this.subKernels[t].name})`):e.push(` gl_FragData[${t+1}] = subKernelResult_${this.subKernels[t].name}`);break;case"Array(2)":for(let t=0;t<this.subKernels.length;++t)e.push(` gl_FragData[${t+1}][0] = subKernelResult_${this.subKernels[t].name}[0]`,` gl_FragData[${t+1}][1] = subKernelResult_${this.subKernels[t].name}[1]`);break;case"Array(3)":for(let t=0;t<this.subKernels.length;++t)e.push(` gl_FragData[${t+1}][0] = subKernelResult_${this.subKernels[t].name}[0]`,` gl_FragData[${t+1}][1] = subKernelResult_${this.subKernels[t].name}[1]`,` gl_FragData[${t+1}][2] = subKernelResult_${this.subKernels[t].name}[2]`);break;case"Array(4)":for(let t=0;t<this.subKernels.length;++t)e.push(` gl_FragData[${t+1}][0] = subKernelResult_${this.subKernels[t].name}[0]`,` gl_FragData[${t+1}][1] = subKernelResult_${this.subKernels[t].name}[1]`,` gl_FragData[${t+1}][2] = subKernelResult_${this.subKernels[t].name}[2]`,` gl_FragData[${t+1}][3] = subKernelResult_${this.subKernels[t].name}[3]`)}return e}replaceArtifacts(e,t){return e.replace(/[ ]*__([A-Z]+[0-9]*([_]?[A-Z]*[0-9]?)*)__;\n/g,(e,r)=>{if(t.hasOwnProperty(r))return t[r];throw`unhandled artifact ${r}`})}getFragmentShader(e){return null!==this.compiledFragmentShader?this.compiledFragmentShader:this.compiledFragmentShader=this.replaceArtifacts(this.constructor.fragmentShader,this._getFragShaderArtifactMap(e))}getVertexShader(e){return null!==this.compiledVertexShader?this.compiledVertexShader:this.compiledVertexShader=this.replaceArtifacts(this.constructor.vertexShader,this._getVertShaderArtifactMap(e))}toString(){const e=o.linesToString(["const gl = context"]);return c(this.constructor,arguments,this,e)}destroy(e){if(!this.context)return;this.buffer&&this.context.deleteBuffer(this.buffer),this.framebuffer&&this.context.deleteFramebuffer(this.framebuffer);for(const e in this.rawValueFramebuffers){for(const t in this.rawValueFramebuffers[e])this.context.deleteFramebuffer(this.rawValueFramebuffers[e][t]),delete this.rawValueFramebuffers[e][t];delete this.rawValueFramebuffers[e]}if(this.vertShader&&this.context.deleteShader(this.vertShader),this.fragShader&&this.context.deleteShader(this.fragShader),this.program&&this.context.deleteProgram(this.program),this.texture){this.texture.delete();const e=this.textureCache.indexOf(this.texture.texture);e>-1&&this.textureCache.splice(e,1),this.texture=null}if(this.mappedTextures&&this.mappedTextures.length){for(let e=0;e<this.mappedTextures.length;e++){const t=this.mappedTextures[e];t.delete();const r=this.textureCache.indexOf(t.texture);r>-1&&this.textureCache.splice(r,1)}this.mappedTextures=null}if(this.kernelArguments)for(let e=0;e<this.kernelArguments.length;e++)this.kernelArguments[e].destroy();if(this.kernelConstants)for(let e=0;e<this.kernelConstants.length;e++)this.kernelConstants[e].destroy();for(;this.textureCache.length>0;){const e=this.textureCache.pop();this.context.deleteTexture(e)}if(e){const e=y.indexOf(this.canvas);e>=0&&(y[e]=null,_[e]=null)}if(this.destroyExtensions(),delete this.context,delete this.canvas,!this.gpu)return;const t=this.gpu.kernels.indexOf(this);-1!==t&&this.gpu.kernels.splice(t,1)}destroyExtensions(){this.extensions.OES_texture_float=null,this.extensions.OES_texture_float_linear=null,this.extensions.OES_element_index_uint=null,this.extensions.WEBGL_draw_buffers=null}static destroyContext(e){const t=e.getExtension("WEBGL_lose_context");t&&t.loseContext()}toJSON(){const e=super.toJSON();return e.functionNodes=i.fromKernel(this,s).toJSON(),e.settings.threadDim=this.threadDim,e}}}},{"../../plugins/math-random-uniformly-distributed":289,"../../utils":291,"../function-builder":188,"../gl/kernel":192,"../gl/kernel-string":191,"./fragment-shader":216,"./function-node":217,"./kernel-value-maps":218,"./vertex-shader":250}],250:[function(e,t,r){t.exports={vertexShader:"__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DECLARATION__;\n\nattribute vec2 aPos;\nattribute vec2 aTexCoord;\n\nvarying vec2 vTexCoord;\nuniform vec2 ratio;\n\nvoid main(void) {\n gl_Position = vec4((aPos + vec2(1)) * ratio + vec2(-1), 0, 1);\n vTexCoord = aTexCoord;\n}"}},{}],251:[function(e,t,r){const n=`#version 300 es\n__HEADER__;\n__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DECLARATION__;\n__SAMPLER_2D_ARRAY_TACTIC_DECLARATION__;\n\nconst int LOOP_MAX = __LOOP_MAX__;\n\n__PLUGINS__;\n__CONSTANTS__;\n\nin vec2 vTexCoord;\n\nfloat atan2(float v1, float v2) {\n if (v1 == 0.0 || v2 == 0.0) return 0.0;\n return atan(v1 / v2);\n}\n\nfloat cbrt(float x) {\n if (x >= 0.0) {\n return pow(x, 1.0 / 3.0);\n } else {\n return -pow(x, 1.0 / 3.0);\n }\n}\n\nfloat expm1(float x) {\n return pow(${Math.E}, x) - 1.0; \n}\n\nfloat fround(highp float x) {\n return x;\n}\n\nfloat imul(float v1, float v2) {\n return float(int(v1) * int(v2));\n}\n\nfloat log10(float x) {\n return log2(x) * (1.0 / log2(10.0));\n}\n\nfloat log1p(float x) {\n return log(1.0 + x);\n}\n\nfloat _pow(float v1, float v2) {\n if (v2 == 0.0) return 1.0;\n return pow(v1, v2);\n}\n\nfloat _round(float x) {\n return floor(x + 0.5);\n}\n\n\nconst int BIT_COUNT = 32;\nint modi(int x, int y) {\n return x - y * (x / y);\n}\n\nint bitwiseOr(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) || (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseXOR(int a, int b) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) != (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 || b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseAnd(int a, int b) {\n int result = 0;\n int n = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if ((modi(a, 2) == 1) && (modi(b, 2) == 1)) {\n result += n;\n }\n a = a / 2;\n b = b / 2;\n n = n * 2;\n if(!(a > 0 && b > 0)) {\n break;\n }\n }\n return result;\n}\nint bitwiseNot(int a) {\n int result = 0;\n int n = 1;\n \n for (int i = 0; i < BIT_COUNT; i++) {\n if (modi(a, 2) == 0) {\n result += n; \n }\n a = a / 2;\n n = n * 2;\n }\n return result;\n}\nint bitwiseZeroFillLeftShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n *= 2;\n }\n\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nint bitwiseSignedRightShift(int num, int shifts) {\n return int(floor(float(num) / pow(2.0, float(shifts))));\n}\n\nint bitwiseZeroFillRightShift(int n, int shift) {\n int maxBytes = BIT_COUNT;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (maxBytes >= n) {\n break;\n }\n maxBytes *= 2;\n }\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= shift) {\n break;\n }\n n /= 2;\n }\n int result = 0;\n int byteVal = 1;\n for (int i = 0; i < BIT_COUNT; i++) {\n if (i >= maxBytes) break;\n if (modi(n, 2) > 0) { result += byteVal; }\n n = int(n / 2);\n byteVal *= 2;\n }\n return result;\n}\n\nvec2 integerMod(vec2 x, float y) {\n vec2 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec3 integerMod(vec3 x, float y) {\n vec3 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nvec4 integerMod(vec4 x, vec4 y) {\n vec4 res = floor(mod(x, y));\n return res * step(1.0 - floor(y), -res);\n}\n\nfloat integerMod(float x, float y) {\n float res = floor(mod(x, y));\n return res * (res > floor(y) - 1.0 ? 0.0 : 1.0);\n}\n\nint integerMod(int x, int y) {\n return x - (y * int(x/y));\n}\n\n__DIVIDE_WITH_INTEGER_CHECK__;\n\n// Here be dragons!\n// DO NOT OPTIMIZE THIS CODE\n// YOU WILL BREAK SOMETHING ON SOMEBODY'S MACHINE\n// LEAVE IT AS IT IS, LEST YOU WASTE YOUR OWN TIME\nconst vec2 MAGIC_VEC = vec2(1.0, -256.0);\nconst vec4 SCALE_FACTOR = vec4(1.0, 256.0, 65536.0, 0.0);\nconst vec4 SCALE_FACTOR_INV = vec4(1.0, 0.00390625, 0.0000152587890625, 0.0); // 1, 1/256, 1/65536\nfloat decode32(vec4 texel) {\n __DECODE32_ENDIANNESS__;\n texel *= 255.0;\n vec2 gte128;\n gte128.x = texel.b >= 128.0 ? 1.0 : 0.0;\n gte128.y = texel.a >= 128.0 ? 1.0 : 0.0;\n float exponent = 2.0 * texel.a - 127.0 + dot(gte128, MAGIC_VEC);\n float res = exp2(round(exponent));\n texel.b = texel.b - 128.0 * gte128.x;\n res = dot(texel, SCALE_FACTOR) * exp2(round(exponent-23.0)) + res;\n res *= gte128.y * -2.0 + 1.0;\n return res;\n}\n\nfloat decode16(vec4 texel, int index) {\n int channel = integerMod(index, 2);\n return texel[channel*2] * 255.0 + texel[channel*2 + 1] * 65280.0;\n}\n\nfloat decode8(vec4 texel, int index) {\n int channel = integerMod(index, 4);\n return texel[channel] * 255.0;\n}\n\nvec4 legacyEncode32(float f) {\n float F = abs(f);\n float sign = f < 0.0 ? 1.0 : 0.0;\n float exponent = floor(log2(F));\n float mantissa = (exp2(-exponent) * F);\n // exponent += floor(log2(mantissa));\n vec4 texel = vec4(F * exp2(23.0-exponent)) * SCALE_FACTOR_INV;\n texel.rg = integerMod(texel.rg, 256.0);\n texel.b = integerMod(texel.b, 128.0);\n texel.a = exponent*0.5 + 63.5;\n texel.ba += vec2(integerMod(exponent+127.0, 2.0), sign) * 128.0;\n texel = floor(texel);\n texel *= 0.003921569; // 1/255\n __ENCODE32_ENDIANNESS__;\n return texel;\n}\n\n// https://github.com/gpujs/gpu.js/wiki/Encoder-details\nvec4 encode32(float value) {\n if (value == 0.0) return vec4(0, 0, 0, 0);\n\n float exponent;\n float mantissa;\n vec4 result;\n float sgn;\n\n sgn = step(0.0, -value);\n value = abs(value);\n\n exponent = floor(log2(value));\n\n mantissa = value*pow(2.0, -exponent)-1.0;\n exponent = exponent+127.0;\n result = vec4(0,0,0,0);\n\n result.a = floor(exponent/2.0);\n exponent = exponent - result.a*2.0;\n result.a = result.a + 128.0*sgn;\n\n result.b = floor(mantissa * 128.0);\n mantissa = mantissa - result.b / 128.0;\n result.b = result.b + exponent*128.0;\n\n result.g = floor(mantissa*32768.0);\n mantissa = mantissa - result.g/32768.0;\n\n result.r = floor(mantissa*8388608.0);\n return result/255.0;\n}\n// Dragons end here\n\nint index;\nivec3 threadId;\n\nivec3 indexTo3D(int idx, ivec3 texDim) {\n int z = int(idx / (texDim.x * texDim.y));\n idx -= z * int(texDim.x * texDim.y);\n int y = int(idx / texDim.x);\n int x = int(integerMod(idx, texDim.x));\n return ivec3(x, y, z);\n}\n\nfloat get32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize));\n return decode32(texel);\n}\n\nfloat get16(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int w = texSize.x * 2;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize.x * 2, texSize.y));\n return decode16(texel, index);\n}\n\nfloat get8(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int w = texSize.x * 4;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize.x * 4, texSize.y));\n return decode8(texel, index);\n}\n\nfloat getMemoryOptimized32(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + (texDim.x * (y + (texDim.y * z)));\n int channel = integerMod(index, 4);\n index = index / 4;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n index = index / 4;\n vec4 texel = texture(tex, st / vec2(texSize));\n return texel[channel];\n}\n\nvec4 getImage2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n return texture(tex, st / vec2(texSize));\n}\n\nvec4 getImage3D(sampler2DArray tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n return texture(tex, vec3(st / vec2(texSize), z));\n}\n\nfloat getFloatFromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return result[0];\n}\n\nvec2 getVec2FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec2(result[0], result[1]);\n}\n\nvec2 getMemoryOptimizedVec2(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 2);\n index = index / 2;\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize));\n if (channel == 0) return vec2(texel.r, texel.g);\n if (channel == 1) return vec2(texel.b, texel.a);\n return vec2(0.0, 0.0);\n}\n\nvec3 getVec3FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n vec4 result = getImage2D(tex, texSize, texDim, z, y, x);\n return vec3(result[0], result[1], result[2]);\n}\n\nvec3 getMemoryOptimizedVec3(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int fieldIndex = 3 * (x + texDim.x * (y + texDim.y * z));\n int vectorIndex = fieldIndex / 4;\n int vectorOffset = fieldIndex - vectorIndex * 4;\n int readY = vectorIndex / texSize.x;\n int readX = vectorIndex - readY * texSize.x;\n vec4 tex1 = texture(tex, (vec2(readX, readY) + 0.5) / vec2(texSize));\n\n if (vectorOffset == 0) {\n return tex1.xyz;\n } else if (vectorOffset == 1) {\n return tex1.yzw;\n } else {\n readX++;\n if (readX >= texSize.x) {\n readX = 0;\n readY++;\n }\n vec4 tex2 = texture(tex, vec2(readX, readY) / vec2(texSize));\n if (vectorOffset == 2) {\n return vec3(tex1.z, tex1.w, tex2.x);\n } else {\n return vec3(tex1.w, tex2.x, tex2.y);\n }\n }\n}\n\nvec4 getVec4FromSampler2D(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n return getImage2D(tex, texSize, texDim, z, y, x);\n}\n\nvec4 getMemoryOptimizedVec4(sampler2D tex, ivec2 texSize, ivec3 texDim, int z, int y, int x) {\n int index = x + texDim.x * (y + texDim.y * z);\n int channel = integerMod(index, 2);\n int w = texSize.x;\n vec2 st = vec2(float(integerMod(index, w)), float(index / w)) + 0.5;\n vec4 texel = texture(tex, st / vec2(texSize));\n return vec4(texel.r, texel.g, texel.b, texel.a);\n}\n\nvec4 actualColor;\nvoid color(float r, float g, float b, float a) {\n actualColor = vec4(r,g,b,a);\n}\n\nvoid color(float r, float g, float b) {\n color(r,g,b,1.0);\n}\n\nfloat modulo(float number, float divisor) {\n if (number < 0.0) {\n number = abs(number);\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return -mod(number, divisor);\n }\n if (divisor < 0.0) {\n divisor = abs(divisor);\n }\n return mod(number, divisor);\n}\n\n__INJECTED_NATIVE__;\n__MAIN_CONSTANTS__;\n__MAIN_ARGUMENTS__;\n__KERNEL__;\n\nvoid main(void) {\n index = int(vTexCoord.s * float(uTexSize.x)) + int(vTexCoord.t * float(uTexSize.y)) * uTexSize.x;\n __MAIN_RESULT__;\n}`;t.exports={fragmentShader:n}},{}],252:[function(e,t,r){const{utils:n}=e("../../utils"),{WebGLFunctionNode:i}=e("../web-gl/function-node");t.exports={WebGL2FunctionNode:class extends i{astIdentifierExpression(e,t){if("Identifier"!==e.type)throw this.astErrorOutput("IdentifierExpression - not an Identifier",e);const r=this.getType(e),i=n.sanitizeName(e.name);return"Infinity"===e.name?t.push("intBitsToFloat(2139095039)"):"Boolean"===r&&this.argumentNames.indexOf(i)>-1?t.push(`bool(user_${i})`):t.push(`user_${i}`),t}}}},{"../../utils":291,"../web-gl/function-node":217}],253:[function(e,t,r){const{WebGL2KernelValueBoolean:n}=e("./kernel-value/boolean"),{WebGL2KernelValueFloat:i}=e("./kernel-value/float"),{WebGL2KernelValueInteger:s}=e("./kernel-value/integer"),{WebGL2KernelValueHTMLImage:o}=e("./kernel-value/html-image"),{WebGL2KernelValueDynamicHTMLImage:a}=e("./kernel-value/dynamic-html-image"),{WebGL2KernelValueHTMLImageArray:u}=e("./kernel-value/html-image-array"),{WebGL2KernelValueDynamicHTMLImageArray:l}=e("./kernel-value/dynamic-html-image-array"),{WebGL2KernelValueHTMLVideo:c}=e("./kernel-value/html-video"),{WebGL2KernelValueDynamicHTMLVideo:h}=e("./kernel-value/dynamic-html-video"),{WebGL2KernelValueSingleInput:p}=e("./kernel-value/single-input"),{WebGL2KernelValueDynamicSingleInput:f}=e("./kernel-value/dynamic-single-input"),{WebGL2KernelValueUnsignedInput:d}=e("./kernel-value/unsigned-input"),{WebGL2KernelValueDynamicUnsignedInput:m}=e("./kernel-value/dynamic-unsigned-input"),{WebGL2KernelValueMemoryOptimizedNumberTexture:g}=e("./kernel-value/memory-optimized-number-texture"),{WebGL2KernelValueDynamicMemoryOptimizedNumberTexture:v}=e("./kernel-value/dynamic-memory-optimized-number-texture"),{WebGL2KernelValueNumberTexture:y}=e("./kernel-value/number-texture"),{WebGL2KernelValueDynamicNumberTexture:_}=e("./kernel-value/dynamic-number-texture"),{WebGL2KernelValueSingleArray:b}=e("./kernel-value/single-array"),{WebGL2KernelValueDynamicSingleArray:x}=e("./kernel-value/dynamic-single-array"),{WebGL2KernelValueSingleArray1DI:w}=e("./kernel-value/single-array1d-i"),{WebGL2KernelValueDynamicSingleArray1DI:E}=e("./kernel-value/dynamic-single-array1d-i"),{WebGL2KernelValueSingleArray2DI:T}=e("./kernel-value/single-array2d-i"),{WebGL2KernelValueDynamicSingleArray2DI:A}=e("./kernel-value/dynamic-single-array2d-i"),{WebGL2KernelValueSingleArray3DI:S}=e("./kernel-value/single-array3d-i"),{WebGL2KernelValueDynamicSingleArray3DI:k}=e("./kernel-value/dynamic-single-array3d-i"),{WebGL2KernelValueArray2:C}=e("./kernel-value/array2"),{WebGL2KernelValueArray3:I}=e("./kernel-value/array3"),{WebGL2KernelValueArray4:R}=e("./kernel-value/array4"),{WebGL2KernelValueUnsignedArray:L}=e("./kernel-value/unsigned-array"),{WebGL2KernelValueDynamicUnsignedArray:O}=e("./kernel-value/dynamic-unsigned-array"),M={unsigned:{dynamic:{Boolean:n,Integer:s,Float:i,Array:O,"Array(2)":C,"Array(3)":I,"Array(4)":R,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:m,NumberTexture:_,"ArrayTexture(1)":_,"ArrayTexture(2)":_,"ArrayTexture(3)":_,"ArrayTexture(4)":_,MemoryOptimizedNumberTexture:v,HTMLCanvas:a,HTMLImage:a,HTMLImageArray:l,HTMLVideo:h},static:{Boolean:n,Float:i,Integer:s,Array:L,"Array(2)":C,"Array(3)":I,"Array(4)":R,"Array1D(2)":!1,"Array1D(3)":!1,"Array1D(4)":!1,"Array2D(2)":!1,"Array2D(3)":!1,"Array2D(4)":!1,"Array3D(2)":!1,"Array3D(3)":!1,"Array3D(4)":!1,Input:d,NumberTexture:y,"ArrayTexture(1)":y,"ArrayTexture(2)":y,"ArrayTexture(3)":y,"ArrayTexture(4)":y,MemoryOptimizedNumberTexture:v,HTMLCanvas:o,HTMLImage:o,HTMLImageArray:u,HTMLVideo:c}},single:{dynamic:{Boolean:n,Integer:s,Float:i,Array:x,"Array(2)":C,"Array(3)":I,"Array(4)":R,"Array1D(2)":E,"Array1D(3)":E,"Array1D(4)":E,"Array2D(2)":A,"Array2D(3)":A,"Array2D(4)":A,"Array3D(2)":k,"Array3D(3)":k,"Array3D(4)":k,Input:f,NumberTexture:_,"ArrayTexture(1)":_,"ArrayTexture(2)":_,"ArrayTexture(3)":_,"ArrayTexture(4)":_,MemoryOptimizedNumberTexture:v,HTMLCanvas:a,HTMLImage:a,HTMLImageArray:l,HTMLVideo:h},static:{Boolean:n,Float:i,Integer:s,Array:b,"Array(2)":C,"Array(3)":I,"Array(4)":R,"Array1D(2)":w,"Array1D(3)":w,"Array1D(4)":w,"Array2D(2)":T,"Array2D(3)":T,"Array2D(4)":T,"Array3D(2)":S,"Array3D(3)":S,"Array3D(4)":S,Input:p,NumberTexture:y,"ArrayTexture(1)":y,"ArrayTexture(2)":y,"ArrayTexture(3)":y,"ArrayTexture(4)":y,MemoryOptimizedNumberTexture:g,HTMLCanvas:o,HTMLImage:o,HTMLImageArray:u,HTMLVideo:c}}};t.exports={kernelValueMaps:M,lookupKernelValueType:function(e,t,r,n){if(!e)throw new Error("type missing");if(!t)throw new Error("dynamic missing");if(!r)throw new Error("precision missing");n.type&&(e=n.type);const i=M[r][t];if(!1===i[e])return null;if(void 0===i[e])throw new Error(`Could not find a KernelValue for ${e}`);return i[e]}}},{"./kernel-value/array2":254,"./kernel-value/array3":255,"./kernel-value/array4":256,"./kernel-value/boolean":257,"./kernel-value/dynamic-html-image":259,"./kernel-value/dynamic-html-image-array":258,"./kernel-value/dynamic-html-video":260,"./kernel-value/dynamic-memory-optimized-number-texture":261,"./kernel-value/dynamic-number-texture":262,"./kernel-value/dynamic-single-array":263,"./kernel-value/dynamic-single-array1d-i":264,"./kernel-value/dynamic-single-array2d-i":265,"./kernel-value/dynamic-single-array3d-i":266,"./kernel-value/dynamic-single-input":267,"./kernel-value/dynamic-unsigned-array":268,"./kernel-value/dynamic-unsigned-input":269,"./kernel-value/float":270,"./kernel-value/html-image":272,"./kernel-value/html-image-array":271,"./kernel-value/html-video":273,"./kernel-value/integer":274,"./kernel-value/memory-optimized-number-texture":275,"./kernel-value/number-texture":276,"./kernel-value/single-array":277,"./kernel-value/single-array1d-i":278,"./kernel-value/single-array2d-i":279,"./kernel-value/single-array3d-i":280,"./kernel-value/single-input":281,"./kernel-value/unsigned-array":282,"./kernel-value/unsigned-input":283}],254:[function(e,t,r){const{WebGLKernelValueArray2:n}=e("../../web-gl/kernel-value/array2");t.exports={WebGL2KernelValueArray2:class extends n{}}},{"../../web-gl/kernel-value/array2":220}],255:[function(e,t,r){const{WebGLKernelValueArray3:n}=e("../../web-gl/kernel-value/array3");t.exports={WebGL2KernelValueArray3:class extends n{}}},{"../../web-gl/kernel-value/array3":221}],256:[function(e,t,r){const{WebGLKernelValueArray4:n}=e("../../web-gl/kernel-value/array4");t.exports={WebGL2KernelValueArray4:class extends n{}}},{"../../web-gl/kernel-value/array4":222}],257:[function(e,t,r){const{WebGLKernelValueBoolean:n}=e("../../web-gl/kernel-value/boolean");t.exports={WebGL2KernelValueBoolean:class extends n{}}},{"../../web-gl/kernel-value/boolean":223}],258:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueHTMLImageArray:i}=e("./html-image-array");t.exports={WebGL2KernelValueDynamicHTMLImageArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2DArray ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){const{width:t,height:r}=e[0];this.checkSize(t,r),this.dimensions=[t,r,e.length],this.textureSize=[t,r],this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"./html-image-array":271}],259:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicHTMLImage:i}=e("../../web-gl/kernel-value/dynamic-html-image");t.exports={WebGL2KernelValueDynamicHTMLImage:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":291,"../../web-gl/kernel-value/dynamic-html-image":224}],260:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueDynamicHTMLImage:i}=e("./dynamic-html-image");t.exports={WebGL2KernelValueDynamicHTMLVideo:class extends i{}}},{"../../../utils":291,"./dynamic-html-image":259}],261:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicMemoryOptimizedNumberTexture:i}=e("../../web-gl/kernel-value/dynamic-memory-optimized-number-texture");t.exports={WebGL2KernelValueDynamicMemoryOptimizedNumberTexture:class extends i{getSource(){return n.linesToString([`uniform sampler2D ${this.id}`,`uniform ivec2 ${this.sizeId}`,`uniform ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":291,"../../web-gl/kernel-value/dynamic-memory-optimized-number-texture":226}],262:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicNumberTexture:i}=e("../../web-gl/kernel-value/dynamic-number-texture");t.exports={WebGL2KernelValueDynamicNumberTexture:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":291,"../../web-gl/kernel-value/dynamic-number-texture":227}],263:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray:i}=e("../../web-gl2/kernel-value/single-array");t.exports={WebGL2KernelValueDynamicSingleArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.dimensions=n.getDimensions(e,!0),this.textureSize=n.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"../../web-gl2/kernel-value/single-array":277}],264:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray1DI:i}=e("../../web-gl2/kernel-value/single-array1d-i");t.exports={WebGL2KernelValueDynamicSingleArray1DI:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"../../web-gl2/kernel-value/single-array1d-i":278}],265:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray2DI:i}=e("../../web-gl2/kernel-value/single-array2d-i");t.exports={WebGL2KernelValueDynamicSingleArray2DI:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"../../web-gl2/kernel-value/single-array2d-i":279}],266:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleArray3DI:i}=e("../../web-gl2/kernel-value/single-array3d-i");t.exports={WebGL2KernelValueDynamicSingleArray3DI:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){this.setShape(e),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"../../web-gl2/kernel-value/single-array3d-i":280}],267:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueSingleInput:i}=e("../../web-gl2/kernel-value/single-input");t.exports={WebGL2KernelValueDynamicSingleInput:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}updateValue(e){let[t,r,i]=e.size;this.dimensions=new Int32Array([t||1,r||1,i||1]),this.textureSize=n.getMemoryOptimizedFloatTextureSize(this.dimensions,this.bitRatio),this.uploadArrayLength=this.textureSize[0]*this.textureSize[1]*this.bitRatio,this.checkSize(this.textureSize[0],this.textureSize[1]),this.uploadValue=new Float32Array(this.uploadArrayLength),this.kernel.setUniform3iv(this.dimensionsId,this.dimensions),this.kernel.setUniform2iv(this.sizeId,this.textureSize),super.updateValue(e)}}}},{"../../../utils":291,"../../web-gl2/kernel-value/single-input":281}],268:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicUnsignedArray:i}=e("../../web-gl/kernel-value/dynamic-unsigned-array");t.exports={WebGL2KernelValueDynamicUnsignedArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":291,"../../web-gl/kernel-value/dynamic-unsigned-array":233}],269:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueDynamicUnsignedInput:i}=e("../../web-gl/kernel-value/dynamic-unsigned-input");t.exports={WebGL2KernelValueDynamicUnsignedInput:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`uniform ${e} ivec2 ${this.sizeId}`,`uniform ${e} ivec3 ${this.dimensionsId}`])}}}},{"../../../utils":291,"../../web-gl/kernel-value/dynamic-unsigned-input":234}],270:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueFloat:i}=e("../../web-gl/kernel-value/float");t.exports={WebGL2KernelValueFloat:class extends i{}}},{"../../../utils":291,"../../web-gl/kernel-value/float":235}],271:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelArray:i}=e("../../web-gl/kernel-value/array");t.exports={WebGL2KernelValueHTMLImageArray:class extends i{constructor(e,t){super(e,t),this.checkSize(e[0].width,e[0].height),this.dimensions=[e[0].width,e[0].height,e.length],this.textureSize=[e[0].width,e[0].height]}defineTexture(){const{context:e}=this;e.activeTexture(this.contextHandle),e.bindTexture(e.TEXTURE_2D_ARRAY,this.texture),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MIN_FILTER,e.NEAREST)}getStringValueHandler(){return`const uploadValue_${this.name} = ${this.varName};\n`}getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2DArray ${this.id}`,`${e} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`${e} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){const{context:t}=this;t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D_ARRAY,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.texImage3D(t.TEXTURE_2D_ARRAY,0,t.RGBA,e[0].width,e[0].height,e.length,0,t.RGBA,t.UNSIGNED_BYTE,null);for(let r=0;r<e.length;r++){const n=0,i=0,s=1;t.texSubImage3D(t.TEXTURE_2D_ARRAY,0,n,i,r,e[r].width,e[r].height,s,t.RGBA,t.UNSIGNED_BYTE,this.uploadValue=e[r])}this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"../../web-gl/kernel-value/array":219}],272:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueHTMLImage:i}=e("../../web-gl/kernel-value/html-image");t.exports={WebGL2KernelValueHTMLImage:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`${e} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`${e} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}}}},{"../../../utils":291,"../../web-gl/kernel-value/html-image":236}],273:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGL2KernelValueHTMLImage:i}=e("./html-image");t.exports={WebGL2KernelValueHTMLVideo:class extends i{}}},{"../../../utils":291,"./html-image":272}],274:[function(e,t,r){const{WebGLKernelValueInteger:n}=e("../../web-gl/kernel-value/integer");t.exports={WebGL2KernelValueInteger:class extends n{getSource(e){const t=this.getVariablePrecisionString();return"constants"===this.origin?`const ${t} int ${this.id} = ${parseInt(e)};\n`:`uniform ${t} int ${this.id};\n`}updateValue(e){"constants"!==this.origin&&this.kernel.setUniform1i(this.id,this.uploadValue=e)}}}},{"../../web-gl/kernel-value/integer":239}],275:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueMemoryOptimizedNumberTexture:i}=e("../../web-gl/kernel-value/memory-optimized-number-texture");t.exports={WebGL2KernelValueMemoryOptimizedNumberTexture:class extends i{getSource(){const{id:e,sizeId:t,textureSize:r,dimensionsId:i,dimensions:s}=this,o=this.getVariablePrecisionString();return n.linesToString([`uniform sampler2D ${e}`,`${o} ivec2 ${t} = ivec2(${r[0]}, ${r[1]})`,`${o} ivec3 ${i} = ivec3(${s[0]}, ${s[1]}, ${s[2]})`])}}}},{"../../../utils":291,"../../web-gl/kernel-value/memory-optimized-number-texture":240}],276:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueNumberTexture:i}=e("../../web-gl/kernel-value/number-texture");t.exports={WebGL2KernelValueNumberTexture:class extends i{getSource(){const{id:e,sizeId:t,textureSize:r,dimensionsId:i,dimensions:s}=this,o=this.getVariablePrecisionString();return n.linesToString([`uniform ${o} sampler2D ${e}`,`${o} ivec2 ${t} = ivec2(${r[0]}, ${r[1]})`,`${o} ivec3 ${i} = ivec3(${s[0]}, ${s[1]}, ${s[2]})`])}}}},{"../../../utils":291,"../../web-gl/kernel-value/number-texture":241}],277:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueSingleArray:i}=e("../../web-gl/kernel-value/single-array");t.exports={WebGL2KernelValueSingleArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`${e} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`${e} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;n.flattenTo(e,this.uploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA32F,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.FLOAT,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"../../web-gl/kernel-value/single-array":242}],278:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueSingleArray1DI:i}=e("../../web-gl/kernel-value/single-array1d-i");t.exports={WebGL2KernelValueSingleArray1DI:class extends i{updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;n.flattenTo(e,this.uploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA32F,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.FLOAT,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"../../web-gl/kernel-value/single-array1d-i":243}],279:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueSingleArray2DI:i}=e("../../web-gl/kernel-value/single-array2d-i");t.exports={WebGL2KernelValueSingleArray2DI:class extends i{updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;n.flattenTo(e,this.uploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA32F,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.FLOAT,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"../../web-gl/kernel-value/single-array2d-i":244}],280:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueSingleArray3DI:i}=e("../../web-gl/kernel-value/single-array3d-i");t.exports={WebGL2KernelValueSingleArray3DI:class extends i{updateValue(e){if(e.constructor!==this.initialValueConstructor)return void this.onUpdateValueMismatch(e.constructor);const{context:t}=this;n.flattenTo(e,this.uploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA32F,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.FLOAT,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"../../web-gl/kernel-value/single-array3d-i":245}],281:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueSingleInput:i}=e("../../web-gl/kernel-value/single-input");t.exports={WebGL2KernelValueSingleInput:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`${e} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`${e} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}updateValue(e){const{context:t}=this;n.flattenTo(e.value,this.uploadValue),t.activeTexture(this.contextHandle),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA32F,this.textureSize[0],this.textureSize[1],0,t.RGBA,t.FLOAT,this.uploadValue),this.kernel.setUniform1i(this.id,this.index)}}}},{"../../../utils":291,"../../web-gl/kernel-value/single-input":246}],282:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueUnsignedArray:i}=e("../../web-gl/kernel-value/unsigned-array");t.exports={WebGL2KernelValueUnsignedArray:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`${e} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`${e} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}}}},{"../../../utils":291,"../../web-gl/kernel-value/unsigned-array":247}],283:[function(e,t,r){const{utils:n}=e("../../../utils"),{WebGLKernelValueUnsignedInput:i}=e("../../web-gl/kernel-value/unsigned-input");t.exports={WebGL2KernelValueUnsignedInput:class extends i{getSource(){const e=this.getVariablePrecisionString();return n.linesToString([`uniform ${e} sampler2D ${this.id}`,`${e} ivec2 ${this.sizeId} = ivec2(${this.textureSize[0]}, ${this.textureSize[1]})`,`${e} ivec3 ${this.dimensionsId} = ivec3(${this.dimensions[0]}, ${this.dimensions[1]}, ${this.dimensions[2]})`])}}}},{"../../../utils":291,"../../web-gl/kernel-value/unsigned-input":248}],284:[function(e,t,r){const{WebGLKernel:n}=e("../web-gl/kernel"),{WebGL2FunctionNode:i}=e("./function-node"),{FunctionBuilder:s}=e("../function-builder"),{utils:o}=e("../../utils"),{fragmentShader:a}=e("./fragment-shader"),{vertexShader:u}=e("./vertex-shader"),{lookupKernelValueType:l}=e("./kernel-value-maps");let c=null,h=null,p=null,f=null,d=null;t.exports={WebGL2Kernel:class extends n{static get isSupported(){return null!==c?c:(this.setupFeatureChecks(),c=this.isContextMatch(p))}static setupFeatureChecks(){"undefined"!=typeof document?h=document.createElement("canvas"):"undefined"!=typeof OffscreenCanvas&&(h=new OffscreenCanvas(0,0)),h&&(p=h.getContext("webgl2"))&&p.getExtension&&(f={EXT_color_buffer_float:p.getExtension("EXT_color_buffer_float"),OES_texture_float_linear:p.getExtension("OES_texture_float_linear")},d=this.getFeatures())}static isContextMatch(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext}static getFeatures(){const e=this.testContext;return Object.freeze({isFloatRead:this.getIsFloatRead(),isIntegerDivisionAccurate:this.getIsIntegerDivisionAccurate(),isSpeedTacticSupported:this.getIsSpeedTacticSupported(),kernelMap:!0,isTextureFloat:!0,isDrawBuffers:!0,channelCount:this.getChannelCount(),maxTextureSize:this.getMaxTextureSize(),lowIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT),lowFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT),mediumIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT),mediumFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT),highIntPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT),highFloatPrecision:e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT)})}static getIsTextureFloat(){return!0}static getChannelCount(){return p.getParameter(p.MAX_DRAW_BUFFERS)}static getMaxTextureSize(){return p.getParameter(p.MAX_TEXTURE_SIZE)}static lookupKernelValueType(e,t,r,n){return l(e,t,r,n)}static get testCanvas(){return h}static get testContext(){return p}static get features(){return d}static get fragmentShader(){return a}static get vertexShader(){return u}initContext(){return this.canvas.getContext("webgl2",{alpha:!1,depth:!1,antialias:!1})}initExtensions(){this.extensions={EXT_color_buffer_float:this.context.getExtension("EXT_color_buffer_float"),OES_texture_float_linear:this.context.getExtension("OES_texture_float_linear")}}validateSettings(e){if(!this.validate)return void(this.texSize=o.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output));const{features:t}=this.constructor;if("single"===this.precision&&!t.isFloatRead)throw new Error("Float texture outputs are not supported");if(this.graphical||null!==this.precision||(this.precision=t.isFloatRead?"single":"unsigned"),null===this.fixIntegerDivisionAccuracy?this.fixIntegerDivisionAccuracy=!t.isIntegerDivisionAccurate:this.fixIntegerDivisionAccuracy&&t.isIntegerDivisionAccurate&&(this.fixIntegerDivisionAccuracy=!1),this.checkOutput(),!this.output||0===this.output.length){if(1!==e.length)throw new Error("Auto output only supported for kernels with only one input");const t=o.getVariableType(e[0],this.strictIntegers);switch(t){case"Array":this.output=o.getDimensions(t);break;case"NumberTexture":case"MemoryOptimizedNumberTexture":case"ArrayTexture(1)":case"ArrayTexture(2)":case"ArrayTexture(3)":case"ArrayTexture(4)":this.output=e[0].output;break;default:throw new Error("Auto output not supported for input type: "+t)}}if(this.graphical){if(2!==this.output.length)throw new Error("Output must have 2 dimensions on graphical mode");return"single"===this.precision&&(console.warn("Cannot use graphical mode and single precision at the same time"),this.precision="unsigned"),void(this.texSize=o.clone(this.output))}!this.graphical&&null===this.precision&&t.isTextureFloat&&(this.precision="single"),this.texSize=o.getKernelTextureSize({optimizeFloatMemory:this.optimizeFloatMemory,precision:this.precision},this.output),this.checkTextureSize()}translateSource(){const e=s.fromKernel(this,i,{fixIntegerDivisionAccuracy:this.fixIntegerDivisionAccuracy});this.translatedSource=e.getPrototypeString("kernel"),this.setupReturnTypes(e)}drawBuffers(){this.context.drawBuffers(this.drawBuffersMap)}getTextureFormat(){const{context:e}=this;switch(this.getInternalFormat()){case e.R32F:return e.RED;case e.RG32F:return e.RG;case e.RGBA32F:case e.RGBA:return e.RGBA;default:throw new Error("Unknown internal format")}}getInternalFormat(){const{context:e}=this;if("single"===this.precision){if(this.pipeline)switch(this.returnType){case"Number":case"Float":case"Integer":return this.optimizeFloatMemory?e.RGBA32F:e.R32F;case"Array(2)":return e.RG32F;case"Array(3)":case"Array(4)":return e.RGBA32F;default:throw new Error("Unhandled return type")}return e.RGBA32F}return e.RGBA}_setupOutputTexture(){const e=this.context;if(this.texture)return void e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture.texture,0);e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer);const t=e.createTexture(),r=this.texSize;e.activeTexture(e.TEXTURE0+this.constantTextureCount+this.argumentTextureCount),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST);const n=this.getInternalFormat();"single"===this.precision?e.texStorage2D(e.TEXTURE_2D,1,n,r[0],r[1]):e.texImage2D(e.TEXTURE_2D,0,n,r[0],r[1],0,n,e.UNSIGNED_BYTE,null),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.texture=new this.TextureConstructor({texture:t,size:r,dimensions:this.threadDim,output:this.output,context:this.context,internalFormat:this.getInternalFormat(),textureFormat:this.getTextureFormat(),kernel:this})}_setupSubOutputTextures(){const e=this.context;if(this.mappedTextures){for(let t=0;t<this.subKernels.length;t++)e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t+1,e.TEXTURE_2D,this.mappedTextures[t].texture,0);return}const t=this.texSize;this.drawBuffersMap=[e.COLOR_ATTACHMENT0],this.mappedTextures=[];for(let r=0;r<this.subKernels.length;r++){const n=this.createTexture();this.drawBuffersMap.push(e.COLOR_ATTACHMENT0+r+1),e.activeTexture(e.TEXTURE0+this.constantTextureCount+this.argumentTextureCount+r),e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST);const i=this.getInternalFormat();"single"===this.precision?e.texStorage2D(e.TEXTURE_2D,1,i,t[0],t[1]):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t[0],t[1],0,e.RGBA,e.UNSIGNED_BYTE,null),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+r+1,e.TEXTURE_2D,n,0),this.mappedTextures.push(new this.TextureConstructor({texture:n,size:t,dimensions:this.threadDim,output:this.output,context:this.context,internalFormat:this.getInternalFormat(),textureFormat:this.getTextureFormat(),kernel:this}))}}_getHeaderString(){return""}_getTextureCoordinate(){const e=this.subKernels,t=this.getVariablePrecisionString(this.texSize,this.tactic);return null===e||e.length<1?`in ${t} vec2 vTexCoord;\n`:`out ${t} vec2 vTexCoord;\n`}_getMainArgumentsString(e){const t=[],r=this.argumentNames;for(let n=0;n<r.length;n++)t.push(this.kernelArguments[n].getSource(e[n]));return t.join("")}getKernelString(){const e=[this.getKernelResultDeclaration()],t=this.subKernels;if(null!==t)switch(e.push("layout(location = 0) out vec4 data0"),this.returnType){case"Number":case"Float":case"Integer":for(let r=0;r<t.length;r++){const n=t[r];e.push("Integer"===n.returnType?`int subKernelResult_${n.name} = 0`:`float subKernelResult_${n.name} = 0.0`,`layout(location = ${r+1}) out vec4 data${r+1}`)}break;case"Array(2)":for(let r=0;r<t.length;r++)e.push(`vec2 subKernelResult_${t[r].name}`,`layout(location = ${r+1}) out vec4 data${r+1}`);break;case"Array(3)":for(let r=0;r<t.length;r++)e.push(`vec3 subKernelResult_${t[r].name}`,`layout(location = ${r+1}) out vec4 data${r+1}`);break;case"Array(4)":for(let r=0;r<t.length;r++)e.push(`vec4 subKernelResult_${t[r].name}`,`layout(location = ${r+1}) out vec4 data${r+1}`)}else e.push("out vec4 data0");return o.linesToString(e)+this.translatedSource}getMainResultGraphical(){return o.linesToString([" threadId = indexTo3D(index, uOutputDim)"," kernel()"," data0 = actualColor"])}getMainResultPackedPixels(){switch(this.returnType){case"LiteralInteger":case"Number":case"Integer":case"Float":return this.getMainResultKernelPackedPixels()+this.getMainResultSubKernelPackedPixels();default:throw new Error(`packed output only usable with Numbers, "${this.returnType}" specified`)}}getMainResultKernelPackedPixels(){return o.linesToString([" threadId = indexTo3D(index, uOutputDim)"," kernel()",` data0 = ${this.useLegacyEncoder?"legacyEncode32":"encode32"}(kernelResult)`])}getMainResultSubKernelPackedPixels(){const e=[];if(!this.subKernels)return"";for(let t=0;t<this.subKernels.length;t++)"Integer"===this.subKernels[t].returnType?e.push(` data${t+1} = ${this.useLegacyEncoder?"legacyEncode32":"encode32"}(float(subKernelResult_${this.subKernels[t].name}))`):e.push(` data${t+1} = ${this.useLegacyEncoder?"legacyEncode32":"encode32"}(subKernelResult_${this.subKernels[t].name})`);return o.linesToString(e)}getMainResultKernelMemoryOptimizedFloats(e,t){e.push(" threadId = indexTo3D(index, uOutputDim)"," kernel()",` data0.${t} = kernelResult`)}getMainResultSubKernelMemoryOptimizedFloats(e,t){if(!this.subKernels)return e;for(let r=0;r<this.subKernels.length;r++){const n=this.subKernels[r];"Integer"===n.returnType?e.push(` data${r+1}.${t} = float(subKernelResult_${n.name})`):e.push(` data${r+1}.${t} = subKernelResult_${n.name}`)}}getMainResultKernelNumberTexture(){return[" threadId = indexTo3D(index, uOutputDim)"," kernel()"," data0[0] = kernelResult"]}getMainResultSubKernelNumberTexture(){const e=[];if(!this.subKernels)return e;for(let t=0;t<this.subKernels.length;++t){const r=this.subKernels[t];"Integer"===r.returnType?e.push(` data${t+1}[0] = float(subKernelResult_${r.name})`):e.push(` data${t+1}[0] = subKernelResult_${r.name}`)}return e}getMainResultKernelArray2Texture(){return[" threadId = indexTo3D(index, uOutputDim)"," kernel()"," data0[0] = kernelResult[0]"," data0[1] = kernelResult[1]"]}getMainResultSubKernelArray2Texture(){const e=[];if(!this.subKernels)return e;for(let t=0;t<this.subKernels.length;++t){const r=this.subKernels[t];e.push(` data${t+1}[0] = subKernelResult_${r.name}[0]`,` data${t+1}[1] = subKernelResult_${r.name}[1]`)}return e}getMainResultKernelArray3Texture(){return[" threadId = indexTo3D(index, uOutputDim)"," kernel()"," data0[0] = kernelResult[0]"," data0[1] = kernelResult[1]"," data0[2] = kernelResult[2]"]}getMainResultSubKernelArray3Texture(){const e=[];if(!this.subKernels)return e;for(let t=0;t<this.subKernels.length;++t){const r=this.subKernels[t];e.push(` data${t+1}[0] = subKernelResult_${r.name}[0]`,` data${t+1}[1] = subKernelResult_${r.name}[1]`,` data${t+1}[2] = subKernelResult_${r.name}[2]`)}return e}getMainResultKernelArray4Texture(){return[" threadId = indexTo3D(index, uOutputDim)"," kernel()"," data0 = kernelResult"]}getMainResultSubKernelArray4Texture(){const e=[];if(!this.subKernels)return e;for(let t=0;t<this.subKernels.length;++t)e.push(` data${t+1} = subKernelResult_${this.subKernels[t].name}`);return e}destroyExtensions(){this.extensions.EXT_color_buffer_float=null,this.extensions.OES_texture_float_linear=null}toJSON(){const e=super.toJSON();return e.functionNodes=s.fromKernel(this,i).toJSON(),e.settings.threadDim=this.threadDim,e}}}},{"../../utils":291,"../function-builder":188,"../web-gl/kernel":249,"./fragment-shader":251,"./function-node":252,"./kernel-value-maps":253,"./vertex-shader":285}],285:[function(e,t,r){t.exports={vertexShader:"#version 300 es\n__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DECLARATION__;\n\nin vec2 aPos;\nin vec2 aTexCoord;\n\nout vec2 vTexCoord;\nuniform vec2 ratio;\n\nvoid main(void) {\n gl_Position = vec4((aPos + vec2(1)) * ratio + vec2(-1), 0, 1);\n vTexCoord = aTexCoord;\n}"}},{}],286:[function(e,t,r){const{gpuMock:n}=e("gpu-mock.js"),{utils:i}=e("./utils"),{Kernel:s}=e("./backend/kernel"),{CPUKernel:o}=e("./backend/cpu/kernel"),{HeadlessGLKernel:a}=e("./backend/headless-gl/kernel"),{WebGL2Kernel:u}=e("./backend/web-gl2/kernel"),{WebGLKernel:l}=e("./backend/web-gl/kernel"),{kernelRunShortcut:c}=e("./kernel-run-shortcut"),h=[a,u,l],p=["gpu","cpu"],f={headlessgl:a,webgl2:u,webgl:l};let d=!0;function m(e){if(!e)return{};const t=Object.assign({},e);return e.hasOwnProperty("floatOutput")&&(i.warnDeprecated("setting","floatOutput","precision"),t.precision=e.floatOutput?"single":"unsigned"),e.hasOwnProperty("outputToTexture")&&(i.warnDeprecated("setting","outputToTexture","pipeline"),t.pipeline=Boolean(e.outputToTexture)),e.hasOwnProperty("outputImmutable")&&(i.warnDeprecated("setting","outputImmutable","immutable"),t.immutable=Boolean(e.outputImmutable)),e.hasOwnProperty("floatTextures")&&(i.warnDeprecated("setting","floatTextures","optimizeFloatMemory"),t.optimizeFloatMemory=Boolean(e.floatTextures)),t}t.exports={GPU:class{static disableValidation(){d=!1}static enableValidation(){d=!0}static get isGPUSupported(){return h.some(e=>e.isSupported)}static get isKernelMapSupported(){return h.some(e=>e.isSupported&&e.features.kernelMap)}static get isOffscreenCanvasSupported(){return"undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas||"undefined"!=typeof importScripts}static get isWebGLSupported(){return l.isSupported}static get isWebGL2Supported(){return u.isSupported}static get isHeadlessGLSupported(){return a.isSupported}static get isCanvasSupported(){return"undefined"!=typeof HTMLCanvasElement}static get isGPUHTMLImageArraySupported(){return u.isSupported}static get isSinglePrecisionSupported(){return h.some(e=>e.isSupported&&e.features.isFloatRead&&e.features.isTextureFloat)}constructor(e){if(e=e||{},this.canvas=e.canvas||null,this.context=e.context||null,this.mode=e.mode,this.Kernel=null,this.kernels=[],this.functions=[],this.nativeFunctions=[],this.injectedNative=null,"dev"!==this.mode){if(this.chooseKernel(),e.functions)for(let t=0;t<e.functions.length;t++)this.addFunction(e.functions[t]);if(e.nativeFunctions)for(const t in e.nativeFunctions){if(!e.nativeFunctions.hasOwnProperty(t))continue;const r=e.nativeFunctions[t],{name:n,source:i}=r;this.addNativeFunction(n,i,r)}}}chooseKernel(){if(this.Kernel)return;let e=null;if(this.context){for(let t=0;t<h.length;t++){const r=h[t];if(r.isContextMatch(this.context)){if(!r.isSupported)throw new Error(`Kernel type ${r.name} not supported`);e=r;break}}if(null===e)throw new Error("unknown Context")}else if(this.mode){if(this.mode in f)d&&!f[this.mode].isSupported||(e=f[this.mode]);else if("gpu"===this.mode){for(let t=0;t<h.length;t++)if(h[t].isSupported){e=h[t];break}}else"cpu"===this.mode&&(e=o);if(!e)throw new Error(`A requested mode of "${this.mode}" and is not supported`)}else{for(let t=0;t<h.length;t++)if(h[t].isSupported){e=h[t];break}e||(e=o)}this.mode||(this.mode=e.mode),this.Kernel=e}createKernel(e,t){if(void 0===e)throw new Error("Missing source parameter");if("object"!=typeof e&&!i.isFunction(e)&&"string"!=typeof e)throw new Error("source parameter not a function");const r=this.kernels;if("dev"===this.mode){const i=n(e,m(t));return r.push(i),i}e="function"==typeof e?e.toString():e;const s={},a=m(t)||{};function u(t){console.warn("Falling back to CPU");const r=new o(e,{argumentTypes:p.argumentTypes,constantTypes:p.constantTypes,graphical:p.graphical,loopMaxIterations:p.loopMaxIterations,constants:p.constants,dynamicOutput:p.dynamicOutput,dynamicArgument:p.dynamicArguments,output:p.output,precision:p.precision,pipeline:p.pipeline,immutable:p.immutable,optimizeFloatMemory:p.optimizeFloatMemory,fixIntegerDivisionAccuracy:p.fixIntegerDivisionAccuracy,functions:p.functions,nativeFunctions:p.nativeFunctions,injectedNative:p.injectedNative,subKernels:p.subKernels,strictIntegers:p.strictIntegers,debug:p.debug});r.build.apply(r,t);const n=r.run.apply(r,t);return p.replaceKernel(r),n}t&&"object"==typeof t.argumentTypes&&(a.argumentTypes=Object.keys(t.argumentTypes).map(e=>t.argumentTypes[e]));const l=Object.assign({context:this.context,canvas:this.canvas,functions:this.functions,nativeFunctions:this.nativeFunctions,injectedNative:this.injectedNative,gpu:this,validate:d,onRequestFallback:u,onRequestSwitchKernel:function t(n,i,o){o.debug&&console.warn("Switching kernels");let a=null;if(o.signature&&!s[o.signature]&&(s[o.signature]=o),o.dynamicOutput)for(let e=n.length-1;e>=0;e--){const t=n[e];"outputPrecisionMismatch"===t.type&&(a=t.needed)}const l=o.constructor,c=l.getArgumentTypes(o,i),h=l.getSignature(o,c),f=s[h];if(f)return f.onActivate(o),f;const m=s[h]=new l(e,{argumentTypes:c,constantTypes:o.constantTypes,graphical:o.graphical,loopMaxIterations:o.loopMaxIterations,constants:o.constants,dynamicOutput:o.dynamicOutput,dynamicArgument:o.dynamicArguments,context:o.context,canvas:o.canvas,output:a||o.output,precision:o.precision,pipeline:o.pipeline,immutable:o.immutable,optimizeFloatMemory:o.optimizeFloatMemory,fixIntegerDivisionAccuracy:o.fixIntegerDivisionAccuracy,functions:o.functions,nativeFunctions:o.nativeFunctions,injectedNative:o.injectedNative,subKernels:o.subKernels,strictIntegers:o.strictIntegers,debug:o.debug,gpu:o.gpu,validate:d,returnType:o.returnType,tactic:o.tactic,onRequestFallback:u,onRequestSwitchKernel:t,texture:o.texture,mappedTextures:o.mappedTextures,drawBuffersMap:o.drawBuffersMap});return m.build.apply(m,i),p.replaceKernel(m),r.push(m),m}},a),h=new this.Kernel(e,l),p=c(h);return this.canvas||(this.canvas=h.canvas),this.context||(this.context=h.context),r.push(h),p}createKernelMap(){let e,t;const r=typeof arguments[arguments.length-2];if("function"===r||"string"===r?(e=arguments[arguments.length-2],t=arguments[arguments.length-1]):e=arguments[arguments.length-1],"dev"!==this.mode&&(!this.Kernel.isSupported||!this.Kernel.features.kernelMap)&&this.mode&&p.indexOf(this.mode)<0)throw new Error(`kernelMap not supported on ${this.Kernel.name}`);const n=m(t);if(t&&"object"==typeof t.argumentTypes&&(n.argumentTypes=Object.keys(t.argumentTypes).map(e=>t.argumentTypes[e])),Array.isArray(arguments[0])){n.subKernels=[];const e=arguments[0];for(let t=0;t<e.length;t++){const r=e[t].toString(),s=i.getFunctionNameFromString(r);n.subKernels.push({name:s,source:r,property:t})}}else{n.subKernels=[];const e=arguments[0];for(let t in e){if(!e.hasOwnProperty(t))continue;const r=e[t].toString(),s=i.getFunctionNameFromString(r);n.subKernels.push({name:s||t,source:r,property:t})}}return this.createKernel(e,n)}combineKernels(){const e=arguments[0],t=arguments[arguments.length-1];if("cpu"===e.kernel.constructor.mode)return t;const r=arguments[0].canvas,n=arguments[0].context,i=arguments.length-1;for(let e=0;e<i;e++)arguments[e].setCanvas(r).setContext(n).setPipeline(!0);return function(){const e=t.apply(this,arguments);return e.toArray?e.toArray():e}}setFunctions(e){return this.functions=e,this}setNativeFunctions(e){return this.nativeFunctions=e,this}addFunction(e,t){return this.functions.push({source:e,settings:t}),this}addNativeFunction(e,t,r){if(this.kernels.length>0)throw new Error('Cannot call "addNativeFunction" after "createKernels" has been called.');return this.nativeFunctions.push(Object.assign({name:e,source:t},r)),this}injectNative(e){return this.injectedNative=e,this}destroy(){return new Promise((e,t)=>{this.kernels||e(),setTimeout(()=>{try{for(let e=0;e<this.kernels.length;e++)this.kernels[e].destroy(!0);let e=this.kernels[0];e&&(e.kernel&&(e=e.kernel),e.constructor.destroyContext&&e.constructor.destroyContext(this.context))}catch(e){t(e)}e()},0)})}},kernelOrder:h,kernelTypes:p}},{"./backend/cpu/kernel":187,"./backend/headless-gl/kernel":213,"./backend/kernel":215,"./backend/web-gl/kernel":249,"./backend/web-gl2/kernel":284,"./kernel-run-shortcut":288,"./utils":291,"gpu-mock.js":183}],287:[function(e,t,r){class n{constructor(e,t){this.value=e,Array.isArray(t)?this.size=t:(this.size=new Int32Array(3),t.z?this.size=new Int32Array([t.x,t.y,t.z]):t.y?this.size=new Int32Array([t.x,t.y]):this.size=new Int32Array([t.x]));const[r,n,i]=this.size;if(i){if(this.value.length!==r*n*i)throw new Error(`Input size ${this.value.length} does not match ${r} * ${n} * ${i} = ${n*r*i}`)}else if(n){if(this.value.length!==r*n)throw new Error(`Input size ${this.value.length} does not match ${r} * ${n} = ${n*r}`)}else if(this.value.length!==r)throw new Error(`Input size ${this.value.length} does not match ${r}`)}toArray(){const{utils:t}=e("./utils"),[r,n,i]=this.size;return i?t.erectMemoryOptimized3DFloat(this.value.subarray?this.value:new Float32Array(this.value),r,n,i):n?t.erectMemoryOptimized2DFloat(this.value.subarray?this.value:new Float32Array(this.value),r,n):this.value}}t.exports={Input:n,input:function(e,t){return new n(e,t)}}},{"./utils":291}],288:[function(e,t,r){const{utils:n}=e("./utils");function i(e,t){if(t.kernel)return void(t.kernel=e);const r=n.allPropertiesOf(e);for(let n=0;n<r.length;n++){const i=r[n];"_"===i[0]&&"_"===i[1]||("function"==typeof e[i]?"add"===i.substring(0,3)||"set"===i.substring(0,3)?t[i]=function(){return t.kernel[i].apply(t.kernel,arguments),t}:t[i]=function(){return t.kernel[i].apply(t.kernel,arguments)}:(t.__defineGetter__(i,()=>t.kernel[i]),t.__defineSetter__(i,e=>{t.kernel[i]=e})))}t.kernel=e}t.exports={kernelRunShortcut:function(e){let t=function(){return e.build.apply(e,arguments),(t=function(){let t=e.run.apply(e,arguments);if(e.switchingKernels){const n=e.resetSwitchingKernels(),i=e.onRequestSwitchKernel(n,arguments,e);r.kernel=e=i,t=i.run.apply(i,arguments)}return e.renderKernels?e.renderKernels():e.renderOutput?e.renderOutput():t}).apply(e,arguments)};const r=function(){return t.apply(e,arguments)};return r.exec=function(){return new Promise((e,r)=>{try{e(t.apply(this,arguments))}catch(e){r(e)}})},r.replaceKernel=function(t){i(e=t,r)},i(e,r),r}}},{"./utils":291}],289:[function(e,t,r){const n={name:"math-random-uniformly-distributed",onBeforeRun:e=>{e.setUniform1f("randomSeed1",Math.random()),e.setUniform1f("randomSeed2",Math.random())},functionMatch:"Math.random()",functionReplace:"nrand(vTexCoord)",functionReturnType:"Number",source:"// https://www.shadertoy.com/view/4t2SDh\n//note: uniformly distributed, normalized rand, [0,1]\nhighp float randomSeedShift = 1.0;\nhighp float slide = 1.0;\nuniform highp float randomSeed1;\nuniform highp float randomSeed2;\n\nhighp float nrand(highp vec2 n) {\n highp float result = fract(sin(dot((n.xy + 1.0) * vec2(randomSeed1 * slide, randomSeed2 * randomSeedShift), vec2(12.9898, 78.233))) * 43758.5453);\n randomSeedShift = result;\n if (randomSeedShift > 0.5) {\n slide += 0.00009; \n } else {\n slide += 0.0009;\n }\n return result;\n}"};t.exports=n},{}],290:[function(e,t,r){t.exports={Texture:class{constructor(e){const{texture:t,size:r,dimensions:n,output:i,context:s,type:o="NumberTexture",kernel:a,internalFormat:u,textureFormat:l}=e;if(!i)throw new Error('settings property "output" required.');if(!s)throw new Error('settings property "context" required.');if(!t)throw new Error('settings property "texture" required.');if(!a)throw new Error('settings property "kernel" required.');this.texture=t,t._refs?t._refs++:t._refs=1,this.size=r,this.dimensions=n,this.output=i,this.context=s,this.kernel=a,this.type=o,this._deleted=!1,this.internalFormat=u,this.textureFormat=l}toArray(){throw new Error(`Not implemented on ${this.constructor.name}`)}clone(){throw new Error(`Not implemented on ${this.constructor.name}`)}delete(){throw new Error(`Not implemented on ${this.constructor.name}`)}clear(){throw new Error(`Not implemented on ${this.constructor.name}`)}}}},{}],291:[function(e,t,r){const n=e("acorn"),{Input:i}=e("./input"),{Texture:s}=e("./texture"),o=/function ([^(]*)/,a=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,u=/([^\s,]+)/g,l={systemEndianness:()=>f,getSystemEndianness(){const e=new ArrayBuffer(4),t=new Uint32Array(e),r=new Uint8Array(e);if(t[0]=3735928559,239===r[0])return"LE";if(222===r[0])return"BE";throw new Error("unknown endianness")},isFunction:e=>"function"==typeof e,isFunctionString:e=>"string"==typeof e&&"function"===e.slice(0,"function".length).toLowerCase(),getFunctionNameFromString(e){const t=o.exec(e);return t&&0!==t.length?t[1].trim():null},getFunctionBodyFromString:e=>e.substring(e.indexOf("{")+1,e.lastIndexOf("}")),getArgumentNamesFromString(e){const t=e.replace(a,"");let r=t.slice(t.indexOf("(")+1,t.indexOf(")")).match(u);return null===r&&(r=[]),r},clone(e){if(null===e||"object"!=typeof e||e.hasOwnProperty("isActiveClone"))return e;const t=e.constructor();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e.isActiveClone=null,t[r]=l.clone(e[r]),delete e.isActiveClone);return t},isArray:e=>!isNaN(e.length),getVariableType(e,t){if(l.isArray(e))return e.length>0&&"IMG"===e[0].nodeName?"HTMLImageArray":"Array";switch(e.constructor){case Boolean:return"Boolean";case Number:return t&&Number.isInteger(e)?"Integer":"Float";case s:return e.type;case i:return"Input"}switch(e.nodeName){case"IMG":case"CANVAS":return"HTMLImage";case"VIDEO":return"HTMLVideo"}return e.hasOwnProperty("type")?e.type:"Unknown"},getKernelTextureSize(e,t){let[r,n,i]=t,s=(r||1)*(n||1)*(i||1);return e.optimizeFloatMemory&&"single"===e.precision&&(r=s=Math.ceil(s/4)),n>1&&r*n===s?new Int32Array([r,n]):l.closestSquareDimensions(s)},closestSquareDimensions(e){const t=Math.sqrt(e);let r=Math.ceil(t),n=Math.floor(t);for(;r*n<e;)r--,n=Math.ceil(e/r);return new Int32Array([n,Math.ceil(e/n)])},getMemoryOptimizedFloatTextureSize(e,t){const r=l.roundTo((e[0]||1)*(e[1]||1)*(e[2]||1)*(e[3]||1),4)/t;return l.closestSquareDimensions(r)},getMemoryOptimizedPackedTextureSize(e,t){const[r,n,i]=e,s=l.roundTo((r||1)*(n||1)*(i||1),4)/(4/t);return l.closestSquareDimensions(s)},roundTo:(e,t)=>Math.floor((e+t-1)/t)*t,getDimensions(e,t){let r;if(l.isArray(e)){const t=[];let n=e;for(;l.isArray(n);)t.push(n.length),n=n[0];r=t.reverse()}else if(e instanceof s)r=e.output;else{if(!(e instanceof i))throw new Error(`Unknown dimensions of ${e}`);r=e.size}if(t)for(r=Array.from(r);r.length<3;)r.push(1);return new Int32Array(r)},flatten2dArrayTo(e,t){let r=0;for(let n=0;n<e.length;n++)t.set(e[n],r),r+=e[n].length},flatten3dArrayTo(e,t){let r=0;for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)t.set(e[n][i],r),r+=e[n][i].length},flatten4dArrayTo(e,t){let r=0;for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)for(let s=0;s<e[n][i].length;s++)t.set(e[n][i][s],r),r+=e[n][i][s].length},flattenTo(e,t){l.isArray(e[0])?l.isArray(e[0][0])?l.isArray(e[0][0][0])?l.flatten4dArrayTo(e,t):l.flatten3dArrayTo(e,t):l.flatten2dArrayTo(e,t):t.set(e)},splitArray(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(new e.constructor(e.buffer,4*n+e.byteOffset,t));return r},getAstString(e,t){const r=Array.isArray(e)?e:e.split(/\r?\n/g),n=t.loc.start,i=t.loc.end,s=[];if(n.line===i.line)s.push(r[n.line-1].substring(n.column,i.column));else{s.push(r[n.line-1].slice(n.column));for(let e=n.line;e<i.line;e++)s.push(r[e]);s.push(r[i.line-1].slice(0,i.column))}return s.join("\n")},allPropertiesOf(e){const t=[];do{t.push.apply(t,Object.getOwnPropertyNames(e))}while(e=Object.getPrototypeOf(e));return t},linesToString:e=>e.length>0?e.join(";\n")+";\n":"\n",warnDeprecated(e,t,r){r?console.warn(`You are using a deprecated ${e} "${t}". It has been replaced with "${r}". Fixing, but please upgrade as it will soon be removed.`):console.warn(`You are using a deprecated ${e} "${t}". It has been removed. Fixing, but please upgrade as it will soon be removed.`)},flipPixels:(e,t,r)=>{const n=r/2|0,i=4*t,s=new Uint8ClampedArray(4*t),o=e.slice(0);for(let e=0;e<n;++e){const t=e*i,n=(r-e-1)*i;s.set(o.subarray(t,t+i)),o.copyWithin(t,n,n+i),o.set(s,n)}return o},erectPackedFloat:(e,t)=>e.subarray(0,t),erect2DPackedFloat:(e,t,r)=>{const n=new Array(r);for(let i=0;i<r;i++){const r=i*t,s=r+t;n[i]=e.subarray(r,s)}return n},erect3DPackedFloat:(e,t,r,n)=>{const i=new Array(n);for(let s=0;s<n;s++){const n=new Array(r);for(let i=0;i<r;i++){const o=s*r*t+i*t,a=o+t;n[i]=e.subarray(o,a)}i[s]=n}return i},erectMemoryOptimizedFloat:(e,t)=>e.subarray(0,t),erectMemoryOptimized2DFloat:(e,t,r)=>{const n=new Array(r);for(let i=0;i<r;i++){const r=i*t;n[i]=e.subarray(r,r+t)}return n},erectMemoryOptimized3DFloat:(e,t,r,n)=>{const i=new Array(n);for(let s=0;s<n;s++){const n=new Array(r);for(let i=0;i<r;i++){const o=s*r*t+i*t;n[i]=e.subarray(o,o+t)}i[s]=n}return i},erectFloat:(e,t)=>{const r=new Float32Array(t);let n=0;for(let i=0;i<t;i++)r[i]=e[n],n+=4;return r},erect2DFloat:(e,t,r)=>{const n=new Array(r);let i=0;for(let s=0;s<r;s++){const r=new Float32Array(t);for(let n=0;n<t;n++)r[n]=e[i],i+=4;n[s]=r}return n},erect3DFloat:(e,t,r,n)=>{const i=new Array(n);let s=0;for(let o=0;o<n;o++){const n=new Array(r);for(let i=0;i<r;i++){const r=new Float32Array(t);for(let n=0;n<t;n++)r[n]=e[s],s+=4;n[i]=r}i[o]=n}return i},erectArray2:(e,t)=>{const r=new Array(t),n=4*t;let i=0;for(let t=0;t<n;t+=4)r[i++]=e.subarray(t,t+2);return r},erect2DArray2:(e,t,r)=>{const n=new Array(r),i=4*t;for(let s=0;s<r;s++){const r=new Array(t),o=s*i;let a=0;for(let t=0;t<i;t+=4)r[a++]=e.subarray(t+o,t+o+2);n[s]=r}return n},erect3DArray2:(e,t,r,n)=>{const i=4*t,s=new Array(n);for(let o=0;o<n;o++){const n=new Array(r);for(let s=0;s<r;s++){const a=new Array(t),u=o*i*r+s*i;let l=0;for(let t=0;t<i;t+=4)a[l++]=e.subarray(t+u,t+u+2);n[s]=a}s[o]=n}return s},erectArray3:(e,t)=>{const r=new Array(t),n=4*t;let i=0;for(let t=0;t<n;t+=4)r[i++]=e.subarray(t,t+3);return r},erect2DArray3:(e,t,r)=>{const n=4*t,i=new Array(r);for(let s=0;s<r;s++){const r=new Array(t),o=s*n;let a=0;for(let t=0;t<n;t+=4)r[a++]=e.subarray(t+o,t+o+3);i[s]=r}return i},erect3DArray3:(e,t,r,n)=>{const i=4*t,s=new Array(n);for(let o=0;o<n;o++){const n=new Array(r);for(let s=0;s<r;s++){const a=new Array(t),u=o*i*r+s*i;let l=0;for(let t=0;t<i;t+=4)a[l++]=e.subarray(t+u,t+u+3);n[s]=a}s[o]=n}return s},erectArray4:(e,t)=>{const r=new Array(e),n=4*t;let i=0;for(let t=0;t<n;t+=4)r[i++]=e.subarray(t,t+4);return r},erect2DArray4:(e,t,r)=>{const n=4*t,i=new Array(r);for(let s=0;s<r;s++){const r=new Array(t),o=s*n;let a=0;for(let t=0;t<n;t+=4)r[a++]=e.subarray(t+o,t+o+4);i[s]=r}return i},erect3DArray4:(e,t,r,n)=>{const i=4*t,s=new Array(n);for(let o=0;o<n;o++){const n=new Array(r);for(let s=0;s<r;s++){const a=new Array(t),u=o*i*r+s*i;let l=0;for(let t=0;t<i;t+=4)a[l++]=e.subarray(t+u,t+u+4);n[s]=a}s[o]=n}return s},flattenFunctionToString:(e,t)=>{const{findDependency:r,thisLookup:i,doNotDefine:s}=t;let o=t.flattened;o||(o=t.flattened={});const a=[];let u=0;const c=function e(t){if(Array.isArray(t)){const r=[];for(let n=0;n<t.length;n++)r.push(e(t[n]));return r.join("")}switch(t.type){case"Program":return e(t.body)+("VariableDeclaration"===t.body[0].type?";":"");case"FunctionDeclaration":return`function ${t.id.name}(${t.params.map(e).join(", ")}) ${e(t.body)}`;case"BlockStatement":{const r=[];u+=2;for(let n=0;n<t.body.length;n++){const i=e(t.body[n]);i&&r.push(" ".repeat(u)+i,";\n")}return u-=2,`{\n${r.join("")}}`}case"VariableDeclaration":const n=l.normalizeDeclarations(t).map(e).filter(e=>null!==e);return n.length<1?"":`${t.kind} ${n.join(",")}`;case"VariableDeclarator":return t.init.object&&"ThisExpression"===t.init.object.type?i(t.init.property.name,!0)?`${t.id.name} = ${e(t.init)}`:null:`${t.id.name} = ${e(t.init)}`;case"CallExpression":if("subarray"===t.callee.property.name)return`${e(t.callee.object)}.${e(t.callee.property)}(${t.arguments.map(t=>e(t)).join(", ")})`;if("gl"===t.callee.object.name||"context"===t.callee.object.name)return`${e(t.callee.object)}.${e(t.callee.property)}(${t.arguments.map(t=>e(t)).join(", ")})`;if("ThisExpression"===t.callee.object.type)return a.push(r("this",t.callee.property.name)),`${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`;if(t.callee.object.name){const n=r(t.callee.object.name,t.callee.property.name);return null===n?`${t.callee.object.name}.${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`:(a.push(n),`${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`)}if("MemberExpression"===t.callee.object.type)return`${e(t.callee.object)}.${t.callee.property.name}(${t.arguments.map(t=>e(t)).join(", ")})`;throw new Error("unknown ast.callee");case"ReturnStatement":return`return ${e(t.argument)}`;case"BinaryExpression":return`(${e(t.left)}${t.operator}${e(t.right)})`;case"UnaryExpression":return t.prefix?`${t.operator} ${e(t.argument)}`:`${e(t.argument)} ${t.operator}`;case"ExpressionStatement":return`${e(t.expression)}`;case"SequenceExpression":return`(${e(t.expressions)})`;case"ArrowFunctionExpression":return`(${t.params.map(e).join(", ")}) => ${e(t.body)}`;case"Literal":return t.raw;case"Identifier":return t.name;case"MemberExpression":return"ThisExpression"===t.object.type?i(t.property.name):t.computed?`${e(t.object)}[${e(t.property)}]`:e(t.object)+"."+e(t.property);case"ThisExpression":return"this";case"NewExpression":return`new ${e(t.callee)}(${t.arguments.map(t=>e(t)).join(", ")})`;case"ForStatement":return`for (${e(t.init)};${e(t.test)};${e(t.update)}) ${e(t.body)}`;case"AssignmentExpression":return`${e(t.left)}${t.operator}${e(t.right)}`;case"UpdateExpression":return`${e(t.argument)}${t.operator}`;case"IfStatement":return`if (${e(t.test)}) ${e(t.consequent)}`;case"ThrowStatement":return`throw ${e(t.argument)}`;case"ObjectPattern":return t.properties.map(e).join(", ");case"ArrayPattern":return t.elements.map(e).join(", ");case"DebuggerStatement":return"debugger;";case"ConditionalExpression":return`${e(t.test)}?${e(t.consequent)}:${e(t.alternate)}`;case"Property":if("init"===t.kind)return e(t.key)}throw new Error(`unhandled ast.type of ${t.type}`)}(n.parse(e));if(a.length>0){const e=[];for(let r=0;r<a.length;r++){const n=a[r];o[n]||(o[n]=!0),n&&e.push(l.flattenFunctionToString(n,t)+"\n")}return e.join("")+c}return c},normalizeDeclarations:e=>{if("VariableDeclaration"!==e.type)throw new Error('Ast is not of type "VariableDeclaration"');const t=[];for(let r=0;r<e.declarations.length;r++){const n=e.declarations[r];if(n.id&&"ObjectPattern"===n.id.type&&n.id.properties){const{properties:e}=n.id;for(let r=0;r<e.length;r++){const i=e[r];if("ObjectPattern"===i.value.type&&i.value.properties)for(let e=0;e<i.value.properties.length;e++){const r=i.value.properties[e];if("Property"!==r.type)throw new Error("unexpected state");t.push({type:"VariableDeclarator",id:{type:"Identifier",name:r.key.name},init:{type:"MemberExpression",object:{type:"MemberExpression",object:n.init,property:{type:"Identifier",name:i.key.name},computed:!1},property:{type:"Identifier",name:r.key.name},computed:!1}})}else{if("Identifier"!==i.value.type)throw new Error("unexpected state");t.push({type:"VariableDeclarator",id:{type:"Identifier",name:i.value&&i.value.name?i.value.name:i.key.name},init:{type:"MemberExpression",object:n.init,property:{type:"Identifier",name:i.key.name},computed:!1}})}}}else if(n.id&&"ArrayPattern"===n.id.type&&n.id.elements){const{elements:e}=n.id;for(let r=0;r<e.length;r++){const i=e[r];if("Identifier"!==i.type)throw new Error("unexpected state");t.push({type:"VariableDeclarator",id:{type:"Identifier",name:i.name},init:{type:"MemberExpression",object:n.init,property:{type:"Literal",value:r,raw:r.toString(),start:i.start,end:i.end},computed:!0}})}}else t.push(n)}return t},splitHTMLImageToRGB:(e,t)=>{const r=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].r},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),n=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].g},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),i=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].b},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),s=e.createKernel(function(e){return 255*e[this.thread.y][this.thread.x].a},{output:[t.width,t.height],precision:"unsigned",argumentTypes:{a:"HTMLImage"}}),o=[r(t),n(t),i(t),s(t)];return o.rKernel=r,o.gKernel=n,o.bKernel=i,o.aKernel=s,o.gpu=e,o},splitRGBAToCanvases:(e,t,r,n)=>{const i=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(t.r/255,0,0,255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});i(t);const s=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(0,t.g/255,0,255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});s(t);const o=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(0,0,t.b/255,255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});o(t);const a=e.createKernel(function(e){const t=e[this.thread.y][this.thread.x];this.color(255,255,255,t.a/255)},{output:[r,n],graphical:!0,argumentTypes:{v:"Array2D(4)"}});return a(t),[i.canvas,s.canvas,o.canvas,a.canvas]},getMinifySafeName:e=>{try{const t=n.parse(`const value = ${e.toString()}`),{init:r}=t.body[0].declarations[0];return r.body.name||r.body.body[0].argument.name}catch(e){throw new Error("Unrecognized function type. Please use `() => yourFunctionVariableHere` or function() { return yourFunctionVariableHere; }")}},sanitizeName:function(e){return c.test(e)&&(e=e.replace(c,"S_S")),h.test(e)?e=e.replace(h,"U_U"):p.test(e)&&(e=e.replace(p,"u_u")),e}},c=/\$/,h=/__/,p=/_/,f=l.getSystemEndianness();t.exports={utils:l}},{"./input":287,"./texture":290,acorn:23}],292:[function(e,t,r){(function(r){"use strict";function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function i(e){return r.Buffer&&"function"==typeof r.Buffer.isBuffer?r.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var s=e("util/"),o=Object.prototype.hasOwnProperty,a=Array.prototype.slice,u="foo"===function(){}.name;function l(e){return Object.prototype.toString.call(e)}function c(e){return!i(e)&&("function"==typeof r.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var h=t.exports=v,p=/\s*function\s+([^\(\s]*)\s*/;function f(e){if(s.isFunction(e)){if(u)return e.name;var t=e.toString().match(p);return t&&t[1]}}function d(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function m(e){if(u||!s.isFunction(e))return s.inspect(e);var t=f(e);return"[Function"+(t?": "+t:"")+"]"}function g(e,t,r,n,i){throw new h.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function v(e,t){e||g(e,!0,t,"==",h.ok)}function y(e,t,r,o){if(e===t)return!0;if(i(e)&&i(t))return 0===n(e,t);if(s.isDate(e)&&s.isDate(t))return e.getTime()===t.getTime();if(s.isRegExp(e)&&s.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(c(e)&&c(t)&&l(e)===l(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===n(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;var u=(o=o||{actual:[],expected:[]}).actual.indexOf(e);return-1!==u&&u===o.expected.indexOf(t)||(o.actual.push(e),o.expected.push(t),function(e,t,r,n){if(null===e||void 0===e||null===t||void 0===t)return!1;if(s.isPrimitive(e)||s.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=_(e),o=_(t);if(i&&!o||!i&&o)return!1;if(i)return e=a.call(e),t=a.call(t),y(e,t,r);var u,l,c=w(e),h=w(t);if(c.length!==h.length)return!1;for(c.sort(),h.sort(),l=c.length-1;l>=0;l--)if(c[l]!==h[l])return!1;for(l=c.length-1;l>=0;l--)if(u=c[l],!y(e[u],t[u],r,n))return!1;return!0}(e,t,r,o))}return r?e===t:e==t}function _(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function b(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function x(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&g(i,r,"Missing expected exception"+n);var o="string"==typeof n,a=!e&&s.isError(i),u=!e&&i&&!r;if((a&&o&&b(i,r)||u)&&g(i,r,"Got unwanted exception"+n),e&&i&&r&&!b(i,r)||!e&&i)throw i}h.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(m((t=this).actual),128)+" "+t.operator+" "+d(m(t.expected),128),this.generatedMessage=!0);var r=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,s=f(r),o=i.indexOf("\n"+s);if(o>=0){var a=i.indexOf("\n",o+1);i=i.substring(a+1)}this.stack=i}}},s.inherits(h.AssertionError,Error),h.fail=g,h.ok=v,h.equal=function(e,t,r){e!=t&&g(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){y(e,t,!1)||g(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){y(e,t,!0)||g(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){y(e,t,!1)&&g(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){y(t,r,!0)&&g(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){x(!0,e,t,r)},h.doesNotThrow=function(e,t,r){x(!1,e,t,r)},h.ifError=function(e){if(e)throw e};var w=Object.keys||function(e){var t=[];for(var r in e)o.call(e,r)&&t.push(r);return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":295}],293:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],294:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],295:[function(e,t,r){(function(t,n){var i=/%[sdj%]/g;r.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(a(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,s=n.length,o=String(e).replace(i,function(e){if("%%"===e)return"%";if(r>=s)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r<s;u=n[++r])m(u)||!b(u)?o+=" "+u:o+=" "+a(u);return o},r.deprecate=function(e,i){if(y(n.process))return function(){return r.deprecate(e,i).apply(this,arguments)};if(!0===t.noDeprecation)return e;var s=!1;return function(){if(!s){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),s=!0}return e.apply(this,arguments)}};var s,o={};function a(e,t){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(t)?n.showHidden=t:t&&r._extend(n,t),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,e,n.depth)}function u(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function l(e,t){return e}function c(e,t,n){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return v(i)||(i=c(e,i,n)),i}var s=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(g(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,t);if(s)return s;var o=Object.keys(t),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),w(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(t);if(0===o.length){if(E(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(x(t))return e.stylize(Date.prototype.toString.call(t),"date");if(w(t))return h(t)}var l,b="",T=!1,A=["{","}"];(f(t)&&(T=!0,A=["[","]"]),E(t))&&(b=" [Function"+(t.name?": "+t.name:"")+"]");return _(t)&&(b=" "+RegExp.prototype.toString.call(t)),x(t)&&(b=" "+Date.prototype.toUTCString.call(t)),w(t)&&(b=" "+h(t)),0!==o.length||T&&0!=t.length?n<0?_(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=T?function(e,t,r,n,i){for(var s=[],o=0,a=t.length;o<a;++o)k(t,String(o))?s.push(p(e,t,r,n,String(o),!0)):s.push("");return i.forEach(function(i){i.match(/^\d+$/)||s.push(p(e,t,r,n,i,!0))}),s}(e,t,n,a,o):o.map(function(r){return p(e,t,n,a,r,T)}),e.seen.pop(),function(e,t,r){if(e.reduce(function(e,t){return 0,t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,b,A)):A[0]+b+A[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,s){var o,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),k(n,i)||(o="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=m(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),y(o)){if(s&&i.match(/^\d+$/))return a;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function f(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function y(e){return void 0===e}function _(e){return b(e)&&"[object RegExp]"===T(e)}function b(e){return"object"==typeof e&&null!==e}function x(e){return b(e)&&"[object Date]"===T(e)}function w(e){return b(e)&&("[object Error]"===T(e)||e instanceof Error)}function E(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(y(s)&&(s=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(s)){var n=t.pid;o[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else o[e]=function(){};return o[e]},r.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"},r.isArray=f,r.isBoolean=d,r.isNull=m,r.isNullOrUndefined=function(e){return null==e},r.isNumber=g,r.isString=v,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=y,r.isRegExp=_,r.isObject=b,r.isDate=x,r.isError=w,r.isFunction=E,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":"),[e.getDate(),S[e.getMonth()],t].join(" ")),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!b(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":294,_process:437,inherits:293}],296:[function(e,t,r){(function(t,n){"use strict";var i=e("assert"),s=e("pako/lib/zlib/zstream"),o=e("pako/lib/zlib/deflate.js"),a=e("pako/lib/zlib/inflate.js"),u=e("pako/lib/zlib/constants");for(var l in u)r[l]=u[l];r.NONE=0,r.DEFLATE=1,r.INFLATE=2,r.GZIP=3,r.GUNZIP=4,r.DEFLATERAW=5,r.INFLATERAW=6,r.UNZIP=7;function c(e){if("number"!=typeof e||e<r.DEFLATE||e>r.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=r.UNZIP),this.mode===r.DEFLATE||this.mode===r.GZIP||this.mode===r.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==r.INFLATE&&this.mode!==r.GUNZIP&&this.mode!==r.INFLATERAW&&this.mode!==r.UNZIP||a.inflateEnd(this.strm),this.mode=r.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,n,i,s,o){return this._write(!0,e,t,r,n,i,s,o)},c.prototype.writeSync=function(e,t,r,n,i,s,o){return this._write(!1,e,t,r,n,i,s,o)},c.prototype._write=function(e,s,o,a,u,l,c,h){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==r.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===s,"must provide flush value"),this.write_in_progress=!0,s!==r.Z_NO_FLUSH&&s!==r.Z_PARTIAL_FLUSH&&s!==r.Z_SYNC_FLUSH&&s!==r.Z_FULL_FLUSH&&s!==r.Z_FINISH&&s!==r.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=n.alloc(0),u=0,a=0),this.strm.avail_in=u,this.strm.input=o,this.strm.next_in=a,this.strm.avail_out=h,this.strm.output=l,this.strm.next_out=c,this.flush=s,!e)return this._process(),this._checkError()?this._afterSync():void 0;var p=this;return t.nextTick(function(){p._process(),p._after()}),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case r.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=r.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=r.GUNZIP):this.mode=r.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:for(this.err=a.inflate(this.strm,this.flush),this.err===r.Z_NEED_DICT&&this.dictionary&&(this.err=a.inflateSetDictionary(this.strm,this.dictionary),this.err===r.Z_OK?this.err=a.inflate(this.strm,this.flush):this.err===r.Z_DATA_ERROR&&(this.err=r.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===r.GUNZIP&&this.err===r.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=a.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case r.Z_OK:case r.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===r.Z_FINISH)return this._error("unexpected end of file"),!1;break;case r.Z_STREAM_END:break;case r.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,t,n,s,o){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(e>=8&&e<=15,"invalid windowBits"),i(t>=-1&&t<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(s===r.Z_FILTERED||s===r.Z_HUFFMAN_ONLY||s===r.Z_RLE||s===r.Z_FIXED||s===r.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,n,s,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,t,n,i,u){switch(this.level=e,this.windowBits=t,this.memLevel=n,this.strategy=i,this.flush=r.Z_NO_FLUSH,this.err=r.Z_OK,this.mode!==r.GZIP&&this.mode!==r.GUNZIP||(this.windowBits+=16),this.mode===r.UNZIP&&(this.windowBits+=32),this.mode!==r.DEFLATERAW&&this.mode!==r.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new s,this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,r.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:case r.UNZIP:this.err=a.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==r.Z_OK&&this._error("Init error"),this.dictionary=u,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==r.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:case r.GZIP:this.err=o.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:case r.GUNZIP:this.err=a.inflateReset(this.strm)}this.err!==r.Z_OK&&this._error("Failed to reset stream")},r.Zlib=c}).call(this,e("_process"),e("buffer").Buffer)},{_process:437,assert:292,buffer:299,"pako/lib/zlib/constants":304,"pako/lib/zlib/deflate.js":306,"pako/lib/zlib/inflate.js":308,"pako/lib/zlib/zstream":312}],297:[function(e,t,r){(function(t){"use strict";var n=e("buffer").Buffer,i=e("stream").Transform,s=e("./binding"),o=e("util"),a=e("assert").ok,u=e("buffer").kMaxLength,l="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";s.Z_MIN_WINDOWBITS=8,s.Z_MAX_WINDOWBITS=15,s.Z_DEFAULT_WINDOWBITS=15,s.Z_MIN_CHUNK=64,s.Z_MAX_CHUNK=1/0,s.Z_DEFAULT_CHUNK=16384,s.Z_MIN_MEMLEVEL=1,s.Z_MAX_MEMLEVEL=9,s.Z_DEFAULT_MEMLEVEL=8,s.Z_MIN_LEVEL=-1,s.Z_MAX_LEVEL=9,s.Z_DEFAULT_LEVEL=s.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(s),h=0;h<c.length;h++){var p=c[h];p.match(/^Z/)&&Object.defineProperty(r,p,{enumerable:!0,value:s[p],writable:!1})}for(var f={Z_OK:s.Z_OK,Z_STREAM_END:s.Z_STREAM_END,Z_NEED_DICT:s.Z_NEED_DICT,Z_ERRNO:s.Z_ERRNO,Z_STREAM_ERROR:s.Z_STREAM_ERROR,Z_DATA_ERROR:s.Z_DATA_ERROR,Z_MEM_ERROR:s.Z_MEM_ERROR,Z_BUF_ERROR:s.Z_BUF_ERROR,Z_VERSION_ERROR:s.Z_VERSION_ERROR},d=Object.keys(f),m=0;m<d.length;m++){var g=d[m];f[f[g]]=g}function v(e,t,r){var i=[],s=0;function o(){for(var t;null!==(t=e.read());)i.push(t),s+=t.length;e.once("readable",o)}function a(){var t,o=null;s>=u?o=new RangeError(l):t=n.concat(i,s),i=[],e.close(),r(o,t)}e.on("error",function(t){e.removeListener("end",a),e.removeListener("readable",o),r(t)}),e.on("end",a),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function _(e){if(!(this instanceof _))return new _(e);k.call(this,e,s.DEFLATE)}function b(e){if(!(this instanceof b))return new b(e);k.call(this,e,s.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);k.call(this,e,s.GZIP)}function w(e){if(!(this instanceof w))return new w(e);k.call(this,e,s.GUNZIP)}function E(e){if(!(this instanceof E))return new E(e);k.call(this,e,s.DEFLATERAW)}function T(e){if(!(this instanceof T))return new T(e);k.call(this,e,s.INFLATERAW)}function A(e){if(!(this instanceof A))return new A(e);k.call(this,e,s.UNZIP)}function S(e){return e===s.Z_NO_FLUSH||e===s.Z_PARTIAL_FLUSH||e===s.Z_SYNC_FLUSH||e===s.Z_FULL_FLUSH||e===s.Z_FINISH||e===s.Z_BLOCK}function k(e,t){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||r.Z_DEFAULT_CHUNK,i.call(this,e),e.flush&&!S(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!S(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||s.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:s.Z_FINISH,e.chunkSize&&(e.chunkSize<r.Z_MIN_CHUNK||e.chunkSize>r.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<r.Z_MIN_WINDOWBITS||e.windowBits>r.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<r.Z_MIN_LEVEL||e.level>r.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<r.Z_MIN_MEMLEVEL||e.memLevel>r.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=r.Z_FILTERED&&e.strategy!=r.Z_HUFFMAN_ONLY&&e.strategy!=r.Z_RLE&&e.strategy!=r.Z_FIXED&&e.strategy!=r.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!n.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new s.Zlib(t);var a=this;this._hadError=!1,this._handle.onerror=function(e,t){C(a),a._hadError=!0;var n=new Error(e);n.errno=t,n.code=r.codes[t],a.emit("error",n)};var u=r.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var l=r.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(l=e.strategy),this._handle.init(e.windowBits||r.Z_DEFAULT_WINDOWBITS,u,e.memLevel||r.Z_DEFAULT_MEMLEVEL,l,e.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=l,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function C(e,r){r&&t.nextTick(r),e._handle&&(e._handle.close(),e._handle=null)}function I(e){e.emit("close")}Object.defineProperty(r,"codes",{enumerable:!0,value:Object.freeze(f),writable:!1}),r.Deflate=_,r.Inflate=b,r.Gzip=x,r.Gunzip=w,r.DeflateRaw=E,r.InflateRaw=T,r.Unzip=A,r.createDeflate=function(e){return new _(e)},r.createInflate=function(e){return new b(e)},r.createDeflateRaw=function(e){return new E(e)},r.createInflateRaw=function(e){return new T(e)},r.createGzip=function(e){return new x(e)},r.createGunzip=function(e){return new w(e)},r.createUnzip=function(e){return new A(e)},r.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new _(t),e,r)},r.deflateSync=function(e,t){return y(new _(t),e)},r.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new x(t),e,r)},r.gzipSync=function(e,t){return y(new x(t),e)},r.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new E(t),e,r)},r.deflateRawSync=function(e,t){return y(new E(t),e)},r.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new A(t),e,r)},r.unzipSync=function(e,t){return y(new A(t),e)},r.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new b(t),e,r)},r.inflateSync=function(e,t){return y(new b(t),e)},r.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new w(t),e,r)},r.gunzipSync=function(e,t){return y(new w(t),e)},r.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new T(t),e,r)},r.inflateRawSync=function(e,t){return y(new T(t),e)},o.inherits(k,i),k.prototype.params=function(e,n,i){if(e<r.Z_MIN_LEVEL||e>r.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(n!=r.Z_FILTERED&&n!=r.Z_HUFFMAN_ONLY&&n!=r.Z_RLE&&n!=r.Z_FIXED&&n!=r.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==e||this._strategy!==n){var o=this;this.flush(s.Z_SYNC_FLUSH,function(){a(o._handle,"zlib binding closed"),o._handle.params(e,n),o._hadError||(o._level=e,o._strategy=n,i&&i())})}else t.nextTick(i)},k.prototype.reset=function(){return a(this._handle,"zlib binding closed"),this._handle.reset()},k.prototype._flush=function(e){this._transform(n.alloc(0),"",e)},k.prototype.flush=function(e,r){var i=this,o=this._writableState;("function"==typeof e||void 0===e&&!r)&&(r=e,e=s.Z_FULL_FLUSH),o.ended?r&&t.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",function(){return i.flush(e,r)}):(this._flushFlag=e,this.write(n.alloc(0),"",r))},k.prototype.close=function(e){C(this,e),t.nextTick(I,this)},k.prototype._transform=function(e,t,r){var i,o=this._writableState,a=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||n.isBuffer(e)?this._handle?(a?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||s.Z_NO_FLUSH)),void this._processChunk(e,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},k.prototype._processChunk=function(e,t,r){var i=e&&e.length,s=this._chunkSize-this._offset,o=0,c=this,h="function"==typeof r;if(!h){var p,f=[],d=0;this.on("error",function(e){p=e}),a(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,i,this._buffer,this._offset,s)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw p;if(d>=u)throw C(this),new RangeError(l);var g=n.concat(f,d);return C(this),g}a(this._handle,"zlib binding closed");var v=this._handle.write(t,e,o,i,this._buffer,this._offset,s);function y(u,l){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var p=s-l;if(a(p>=0,"have should not go down"),p>0){var m=c._buffer.slice(c._offset,c._offset+p);c._offset+=p,h?c.push(m):(f.push(m),d+=m.length)}if((0===l||c._offset>=c._chunkSize)&&(s=c._chunkSize,c._offset=0,c._buffer=n.allocUnsafe(c._chunkSize)),0===l){if(o+=i-u,i=u,!h)return!0;var g=c._handle.write(t,e,o,i,c._buffer,c._offset,c._chunkSize);return g.callback=y,void(g.buffer=e)}if(!h)return!1;r()}}v.buffer=e,v.callback=y},o.inherits(_,k),o.inherits(b,k),o.inherits(x,k),o.inherits(w,k),o.inherits(E,k),o.inherits(T,k),o.inherits(A,k)}).call(this,e("_process"))},{"./binding":296,_process:437,assert:292,buffer:299,stream:503,util:523}],298:[function(e,t,r){arguments[4][35][0].apply(r,arguments)},{dup:35}],299:[function(e,t,r){"use strict";var n=e("base64-js"),i=e("ieee754");r.Buffer=a,r.SlowBuffer=function(e){+e!=e&&(e=0);return a.alloc(+e)},r.INSPECT_MAX_BYTES=50;var s=2147483647;function o(e){if(e>s)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(e)}return u(e,t,r)}function u(e,t,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return U(e)?function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(r||0))throw new RangeError("'length' is out of bounds");var n;n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);return n.__proto__=a.prototype,n}(e,t,r):"string"==typeof e?function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(e,t),n=o(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t):function(e){if(a.isBuffer(e)){var t=0|p(e.length),r=o(t);return 0===r.length?r:(e.copy(r,0,0,t),r)}if(e){if($(e)||"length"in e)return"number"!=typeof e.length||V(e.length)?o(0):h(e);if("Buffer"===e.type&&Array.isArray(e.data))return h(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function c(e){return l(e),o(e<0?0:0|p(e))}function h(e){for(var t=e.length<0?0:0|p(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function f(e,t){if(a.isBuffer(e))return e.length;if($(e)||U(e))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(e).length;default:if(n)return D(e).length;t=(""+t).toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var s,o=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,r/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(s=r;s<a;s++)if(l(e,s)===l(t,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===u)return c*o}else-1!==c&&(s-=s-c),c=-1}else for(r+u>a&&(r=a-u),s=r;s>=0;s--){for(var h=!0,p=0;p<u;p++)if(l(e,s+p)!==l(t,p)){h=!1;break}if(h)return s}return-1}function v(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;o<n;++o){var a=parseInt(t.substr(2*o,2),16);if(V(a))return o;e[r+o]=a}return o}function y(e,t,r,n){return j(D(t,e.length-r),e,r,n)}function _(e,t,r,n){return j(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return _(e,t,r,n)}function x(e,t,r,n){return j(F(t),e,r,n)}function w(e,t,r,n){return j(function(e,t){for(var r,n,i,s=[],o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s,o,a,u,l=e[i],c=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h<=r)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(s=e[i+1]))&&(u=(31&l)<<6|63&s)>127&&(c=u);break;case 3:s=e[i+1],o=e[i+2],128==(192&s)&&128==(192&o)&&(u=(15&l)<<12|(63&s)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:s=e[i+1],o=e[i+2],a=e[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(u=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}r.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(e,t,r){return u(e,t,r)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=a.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},a.byteLength=f,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)d(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},a.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):function(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},a.prototype.compare=function(e,t,r,n,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,o=r-t,u=Math.min(s,o),l=this.slice(n,i),c=e.slice(t,r),h=0;h<u;++h)if(l[h]!==c[h]){s=l[h],o=c[h];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},a.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},a.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},a.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return b(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function S(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function C(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=N(e[s]);return i}function I(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,s){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function O(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,t,r,n,s){return t=+t,r>>>=0,s||O(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function P(e,t,r,n,s){return t=+t,r>>>=0,s||O(e,0,r,8),i.write(e,t,r,n,52,8),r+8}a.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=a.prototype,n},a.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},a.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||L(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},a.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||L(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s<r&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,e,t,r,i-1,-i)}var s=r-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,s=n-r;if(this===e&&r<t&&t<n)for(i=s-1;i>=0;--i)e[i+t]=this[i+r];else if(s<1e3)for(i=0;i<s;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),t);return s},a.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var s;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var o=a.isBuffer(e)?e:new a(e,n),u=o.length;for(s=0;s<r-t;++s)this[s+t]=o[s%u]}return this};var B=/[^+/0-9A-Za-z-_]/g;function N(e){return e<16?"0"+e.toString(16):e.toString(16)}function D(e,t){var r;t=t||1/0;for(var n=e.length,i=null,s=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function F(e){return n.toByteArray(function(e){if((e=e.trim().replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function U(e){return e instanceof ArrayBuffer||null!=e&&null!=e.constructor&&"ArrayBuffer"===e.constructor.name&&"number"==typeof e.byteLength}function $(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function V(e){return e!=e}},{"base64-js":28,ieee754:317}],300:[function(e,t,r){var n=Object.create||function(e){var t=function(){};return t.prototype=e,new t},i=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return r},s=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function o(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}t.exports=o,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._maxListeners=void 0;var a,u=10;try{var l={};Object.defineProperty&&Object.defineProperty(l,"x",{value:0}),a=0===l.x}catch(e){a=!1}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function h(e,t,r,i){var s,o,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]):(o=e._events=n(null),e._eventsCount=0),a){if("function"==typeof a?a=o[t]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),!a.warned&&(s=c(e))&&s>0&&a.length>s){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else a=o[t]=r,++e._eventsCount;return e}function p(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=s.call(p,n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(!n)return[];var i=n[t];return i?"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):g(i,i.length):[]}function m(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function g(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}a?Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');u=e}}):o.defaultMaxListeners=u,o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){var t,r,n,i,s,o,a="error"===e;if(o=this._events)a=a&&null==o.error;else if(!a)return!1;if(a){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(r=o[e]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,i=g(e,n),s=0;s<n;++s)i[s].call(r)}(r,l,this);break;case 2:!function(e,t,r,n){if(t)e.call(r,n);else for(var i=e.length,s=g(e,i),o=0;o<i;++o)s[o].call(r,n)}(r,l,this,arguments[1]);break;case 3:!function(e,t,r,n,i){if(t)e.call(r,n,i);else for(var s=e.length,o=g(e,s),a=0;a<s;++a)o[a].call(r,n,i)}(r,l,this,arguments[1],arguments[2]);break;case 4:!function(e,t,r,n,i,s){if(t)e.call(r,n,i,s);else for(var o=e.length,a=g(e,o),u=0;u<o;++u)a[u].call(r,n,i,s)}(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),s=1;s<n;s++)i[s-1]=arguments[s];!function(e,t,r,n){if(t)e.apply(r,n);else for(var i=e.length,s=g(e,i),o=0;o<i;++o)s[o].apply(r,n)}(r,l,this,i)}return!0},o.prototype.addListener=function(e,t){return h(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return h(this,e,t,!0)},o.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,i,s,o,a;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=n(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(s=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,s=o;break}if(s<0)return this;0===s?r.shift():function(e,t){for(var r=t,n=r+1,i=e.length;n<i;r+=1,n+=1)e[r]=e[n];e.pop()}(r,s),1===r.length&&(i[e]=r[0]),i.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.removeAllListeners=function(e){var t,r,s;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=n(null):delete r[e]),this;if(0===arguments.length){var o,a=i(r);for(s=0;s<a.length;++s)"removeListener"!==(o=a[s])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],301:[function(e,t,r){r.endianness=function(){return"LE"},r.hostname=function(){return"undefined"!=typeof location?location.hostname:""},r.loadavg=function(){return[]},r.uptime=function(){return 0},r.freemem=function(){return Number.MAX_VALUE},r.totalmem=function(){return Number.MAX_VALUE},r.cpus=function(){return[]},r.type=function(){return"Browser"},r.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},r.networkInterfaces=r.getNetworkInterfaces=function(){return{}},r.arch=function(){return"javascript"},r.platform=function(){return"browser"},r.tmpdir=r.tmpDir=function(){return"/tmp"},r.EOL="\n",r.homedir=function(){return"/"}},{}],302:[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)}r.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},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var s={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var s=0;s<n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){var t,r,n,i,s,o;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(o=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)s=e[t],o.set(s,i),i+=s.length;return o}},o={arraySet:function(e,t,r,n,i){for(var s=0;s<n;s++)e[i+s]=t[r+s]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,s)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(n)},{}],303:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{s=s+(i=i+t[n++]|0)|0}while(--o);i%=65521,s%=65521}return i|s<<16|0}},{}],304:[function(e,t,r){"use strict";t.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}},{}],305:[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}();t.exports=function(e,t,r,i){var s=n,o=i+r;e^=-1;for(var a=i;a<o;a++)e=e>>>8^s[255&(e^t[a])];return-1^e}},{}],306:[function(e,t,r){"use strict";var n,i=e("../utils/common"),s=e("./trees"),o=e("./adler32"),a=e("./crc32"),u=e("./messages"),l=0,c=1,h=3,p=4,f=5,d=0,m=1,g=-2,v=-3,y=-5,_=-1,b=1,x=2,w=3,E=4,T=0,A=2,S=8,k=9,C=15,I=8,R=286,L=30,O=19,M=2*R+1,P=15,B=3,N=258,D=N+B+1,F=32,j=42,U=69,$=73,V=91,G=103,z=113,W=666,H=1,K=2,q=3,X=4,Y=3;function Z(e,t){return e.msg=u[t],t}function J(e){return(e<<1)-(e>4?9:0)}function Q(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){s._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ne(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ie(e,t){var r,n,i=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,u=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,l=e.window,c=e.w_mask,h=e.prev,p=e.strstart+N,f=l[s+o-1],d=l[s+o];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(l[(r=t)+o]===d&&l[r+o-1]===f&&l[r]===l[s]&&l[++r]===l[s+1]){s+=2,r++;do{}while(l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&s<p);if(n=N-(p-s),s=p-N,n>o){if(e.match_start=t,o=n,n>=a)break;f=l[s+o-1],d=l[s+o]}}}while((t=h[t&c])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead}function se(e){var t,r,n,s,u,l,c,h,p,f,d=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-D)){i.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=d?n-d:0}while(--r);t=r=d;do{n=e.prev[--t],e.prev[t]=n>=d?n-d:0}while(--r);s+=d}if(0===e.strm.avail_in)break;if(l=e.strm,c=e.window,h=e.strstart+e.lookahead,p=s,f=void 0,(f=l.avail_in)>p&&(f=p),r=0===f?0:(l.avail_in-=f,i.arraySet(c,l.input,l.next_in,f,h),1===l.state.wrap?l.adler=o(l.adler,c,f,h):2===l.state.wrap&&(l.adler=a(l.adler,c,f,h)),l.next_in+=f,l.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=B)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+B-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<B)););}while(e.lookahead<D&&0!==e.strm.avail_in)}function oe(e,t){for(var r,n;;){if(e.lookahead<D){if(se(e),e.lookahead<D&&t===l)return H;if(0===e.lookahead)break}if(r=0,e.lookahead>=B&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+B-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-D&&(e.match_length=ie(e,r)),e.match_length>=B)if(n=s._tr_tally(e,e.strstart-e.match_start,e.match_length-B),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=B){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+B-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(te(e,!1),0===e.strm.avail_out))return H}return e.insert=e.strstart<B-1?e.strstart:B-1,t===p?(te(e,!0),0===e.strm.avail_out?q:X):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?H:K}function ae(e,t){for(var r,n,i;;){if(e.lookahead<D){if(se(e),e.lookahead<D&&t===l)return H;if(0===e.lookahead)break}if(r=0,e.lookahead>=B&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+B-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=B-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-D&&(e.match_length=ie(e,r),e.match_length<=5&&(e.strategy===b||e.match_length===B&&e.strstart-e.match_start>4096)&&(e.match_length=B-1)),e.prev_length>=B&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-B,n=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-B),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+B-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=B-1,e.strstart++,n&&(te(e,!1),0===e.strm.avail_out))return H}else if(e.match_available){if((n=s._tr_tally(e,0,e.window[e.strstart-1]))&&te(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return H}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=s._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<B-1?e.strstart:B-1,t===p?(te(e,!0),0===e.strm.avail_out?q:X):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?H:K}function ue(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function le(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=A,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?j:z,e.adler=2===t.wrap?0:1,t.last_flush=l,s._tr_init(t),d):Z(e,g)}function ce(e){var t,r=le(e);return r===d&&((t=e.state).window_size=2*t.w_size,Q(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=B-1,t.match_available=0,t.ins_h=0),r}function he(e,t,r,n,s,o){if(!e)return g;var a=1;if(t===_&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),s<1||s>k||r!==S||n<8||n>15||t<0||t>9||o<0||o>E)return Z(e,g);8===n&&(n=9);var u=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=S,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*M),this.dyn_dtree=new i.Buf16(2*(2*L+1)),this.bl_tree=new i.Buf16(2*(2*O+1)),Q(this.dyn_ltree),Q(this.dyn_dtree),Q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(P+1),this.heap=new i.Buf16(2*R+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*R+1),Q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return e.state=u,u.strm=e,u.wrap=a,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=s+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+B-1)/B),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<s+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=o,u.method=r,ce(e)}n=[new ue(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(se(e),0===e.lookahead&&t===l)return H;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,te(e,!1),0===e.strm.avail_out))return H;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return H}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?q:X):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),H)}),new ue(4,4,8,4,oe),new ue(4,5,16,8,oe),new ue(4,6,32,32,oe),new ue(4,4,16,16,ae),new ue(8,16,32,32,ae),new ue(8,16,128,128,ae),new ue(8,32,128,256,ae),new ue(32,128,258,1024,ae),new ue(32,258,258,4096,ae)],r.deflateInit=function(e,t){return he(e,t,S,C,I,T)},r.deflateInit2=he,r.deflateReset=ce,r.deflateResetKeep=le,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?g:(e.state.gzhead=t,d):g},r.deflate=function(e,t){var r,i,o,u;if(!e||!e.state||t>f||t<0)return e?Z(e,g):g;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===W&&t!==p)return Z(e,0===e.avail_out?y:g);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===j)if(2===i.wrap)e.adler=0,re(i,31),re(i,139),re(i,8),i.gzhead?(re(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),re(i,255&i.gzhead.time),re(i,i.gzhead.time>>8&255),re(i,i.gzhead.time>>16&255),re(i,i.gzhead.time>>24&255),re(i,9===i.level?2:i.strategy>=x||i.level<2?4:0),re(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(re(i,255&i.gzhead.extra.length),re(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=U):(re(i,0),re(i,0),re(i,0),re(i,0),re(i,0),re(i,9===i.level?2:i.strategy>=x||i.level<2?4:0),re(i,Y),i.status=z);else{var v=S+(i.w_bits-8<<4)<<8;v|=(i.strategy>=x||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(v|=F),v+=31-v%31,i.status=z,ne(i,v),0!==i.strstart&&(ne(i,e.adler>>>16),ne(i,65535&e.adler)),e.adler=1}if(i.status===U)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),ee(e),o=i.pending,i.pending!==i.pending_buf_size));)re(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=$)}else i.status=$;if(i.status===$)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),ee(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,re(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=V)}else i.status=V;if(i.status===V)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),ee(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,re(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>o&&(e.adler=a(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=G)}else i.status=G;if(i.status===G&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ee(e),i.pending+2<=i.pending_buf_size&&(re(i,255&e.adler),re(i,e.adler>>8&255),e.adler=0,i.status=z)):i.status=z),0!==i.pending){if(ee(e),0===e.avail_out)return i.last_flush=-1,d}else if(0===e.avail_in&&J(t)<=J(r)&&t!==p)return Z(e,y);if(i.status===W&&0!==e.avail_in)return Z(e,y);if(0!==e.avail_in||0!==i.lookahead||t!==l&&i.status!==W){var _=i.strategy===x?function(e,t){for(var r;;){if(0===e.lookahead&&(se(e),0===e.lookahead)){if(t===l)return H;break}if(e.match_length=0,r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return H}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?q:X):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?H:K}(i,t):i.strategy===w?function(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=N){if(se(e),e.lookahead<=N&&t===l)return H;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=B&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=e.strstart+N;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=N-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=B?(r=s._tr_tally(e,1,e.match_length-B),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return H}return e.insert=0,t===p?(te(e,!0),0===e.strm.avail_out?q:X):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?H:K}(i,t):n[i.level].func(i,t);if(_!==q&&_!==X||(i.status=W),_===H||_===q)return 0===e.avail_out&&(i.last_flush=-1),d;if(_===K&&(t===c?s._tr_align(i):t!==f&&(s._tr_stored_block(i,0,0,!1),t===h&&(Q(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ee(e),0===e.avail_out))return i.last_flush=-1,d}return t!==p?d:i.wrap<=0?m:(2===i.wrap?(re(i,255&e.adler),re(i,e.adler>>8&255),re(i,e.adler>>16&255),re(i,e.adler>>24&255),re(i,255&e.total_in),re(i,e.total_in>>8&255),re(i,e.total_in>>16&255),re(i,e.total_in>>24&255)):(ne(i,e.adler>>>16),ne(i,65535&e.adler)),ee(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?d:m)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==U&&t!==$&&t!==V&&t!==G&&t!==z&&t!==W?Z(e,g):(e.state=null,t===z?Z(e,v):d):g},r.deflateSetDictionary=function(e,t){var r,n,s,a,u,l,c,h,p=t.length;if(!e||!e.state)return g;if(2===(a=(r=e.state).wrap)||1===a&&r.status!==j||r.lookahead)return g;for(1===a&&(e.adler=o(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===a&&(Q(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,p-r.w_size,r.w_size,0),t=h,p=r.w_size),u=e.avail_in,l=e.next_in,c=e.input,e.avail_in=p,e.next_in=0,e.input=t,se(r);r.lookahead>=B;){n=r.strstart,s=r.lookahead-(B-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+B-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--s);r.strstart=n,r.lookahead=B-1,se(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=B-1,r.match_available=0,e.next_in=l,e.input=c,e.avail_in=u,r.wrap=a,d},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":302,"./adler32":303,"./crc32":305,"./messages":310,"./trees":311}],307:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,i,s,o,a,u,l,c,h,p,f,d,m,g,v,y,_,b,x,w,E,T,A,S;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),s=e.next_out,S=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),u=r.dmax,l=r.wsize,c=r.whave,h=r.wnext,p=r.window,f=r.hold,d=r.bits,m=r.lencode,g=r.distcode,v=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;e:do{d<15&&(f+=A[n++]<<d,d+=8,f+=A[n++]<<d,d+=8),_=m[f&v];t:for(;;){if(f>>>=b=_>>>24,d-=b,0===(b=_>>>16&255))S[s++]=65535&_;else{if(!(16&b)){if(0==(64&b)){_=m[(65535&_)+(f&(1<<b)-1)];continue t}if(32&b){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}x=65535&_,(b&=15)&&(d<b&&(f+=A[n++]<<d,d+=8),x+=f&(1<<b)-1,f>>>=b,d-=b),d<15&&(f+=A[n++]<<d,d+=8,f+=A[n++]<<d,d+=8),_=g[f&y];r:for(;;){if(f>>>=b=_>>>24,d-=b,!(16&(b=_>>>16&255))){if(0==(64&b)){_=g[(65535&_)+(f&(1<<b)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(w=65535&_,d<(b&=15)&&(f+=A[n++]<<d,(d+=8)<b&&(f+=A[n++]<<d,d+=8)),(w+=f&(1<<b)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(f>>>=b,d-=b,w>(b=s-o)){if((b=w-b)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(E=0,T=p,0===h){if(E+=l-b,b<x){x-=b;do{S[s++]=p[E++]}while(--b);E=s-w,T=S}}else if(h<b){if(E+=l+h-b,(b-=h)<x){x-=b;do{S[s++]=p[E++]}while(--b);if(E=0,h<x){x-=b=h;do{S[s++]=p[E++]}while(--b);E=s-w,T=S}}}else if(E+=h-b,b<x){x-=b;do{S[s++]=p[E++]}while(--b);E=s-w,T=S}for(;x>2;)S[s++]=T[E++],S[s++]=T[E++],S[s++]=T[E++],x-=3;x&&(S[s++]=T[E++],x>1&&(S[s++]=T[E++]))}else{E=s-w;do{S[s++]=S[E++],S[s++]=S[E++],S[s++]=S[E++],x-=3}while(x>2);x&&(S[s++]=S[E++],x>1&&(S[s++]=S[E++]))}break}}break}}while(n<i&&s<a);n-=x=d>>3,f&=(1<<(d-=x<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=s<a?a-s+257:257-(s-a),r.hold=f,r.bits=d}},{}],308:[function(e,t,r){"use strict";var n=e("../utils/common"),i=e("./adler32"),s=e("./crc32"),o=e("./inffast"),a=e("./inftrees"),u=0,l=1,c=2,h=4,p=5,f=6,d=0,m=1,g=2,v=-2,y=-3,_=-4,b=-5,x=8,w=1,E=2,T=3,A=4,S=5,k=6,C=7,I=8,R=9,L=10,O=11,M=12,P=13,B=14,N=15,D=16,F=17,j=18,U=19,$=20,V=21,G=22,z=23,W=24,H=25,K=26,q=27,X=28,Y=29,Z=30,J=31,Q=32,ee=852,te=592,re=15;function ne(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ie(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=w,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(ee),t.distcode=t.distdyn=new n.Buf32(te),t.sane=1,t.back=-1,d):v}function se(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):v}function oe(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)?v:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,se(e))):v}function ae(e,t){var r,i;return e?(i=new function(){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},e.state=i,i.window=null,(r=oe(e,t))!==d&&(e.state=null),r):v}var ue,le,ce=!0;function he(e){if(ce){var t;for(ue=new n.Buf32(512),le=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(l,e.lens,0,288,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(c,e.lens,0,32,le,0,e.work,{bits:5}),ce=!1}e.lencode=ue,e.lenbits=9,e.distcode=le,e.distbits=5}function pe(e,t,r,i){var s,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),i>=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((s=o.wsize-o.wnext)>i&&(s=i),n.arraySet(o.window,t,r-i,s,o.wnext),(i-=s)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}r.inflateReset=se,r.inflateReset2=oe,r.inflateResetKeep=ie,r.inflateInit=function(e){return ae(e,re)},r.inflateInit2=ae,r.inflate=function(e,t){var r,ee,te,re,ie,se,oe,ae,ue,le,ce,fe,de,me,ge,ve,ye,_e,be,xe,we,Ee,Te,Ae,Se=0,ke=new n.Buf8(4),Ce=[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 v;(r=e.state).mode===M&&(r.mode=P),ie=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,se=e.avail_in,ae=r.hold,ue=r.bits,le=se,ce=oe,Ee=d;e:for(;;)switch(r.mode){case w:if(0===r.wrap){r.mode=P;break}for(;ue<16;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}if(2&r.wrap&&35615===ae){r.check=0,ke[0]=255&ae,ke[1]=ae>>>8&255,r.check=s(r.check,ke,2,0),ae=0,ue=0,r.mode=E;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&ae)<<8)+(ae>>8))%31){e.msg="incorrect header check",r.mode=Z;break}if((15&ae)!==x){e.msg="unknown compression method",r.mode=Z;break}if(ue-=4,we=8+(15&(ae>>>=4)),0===r.wbits)r.wbits=we;else if(we>r.wbits){e.msg="invalid window size",r.mode=Z;break}r.dmax=1<<we,e.adler=r.check=1,r.mode=512&ae?L:M,ae=0,ue=0;break;case E:for(;ue<16;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}if(r.flags=ae,(255&r.flags)!==x){e.msg="unknown compression method",r.mode=Z;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Z;break}r.head&&(r.head.text=ae>>8&1),512&r.flags&&(ke[0]=255&ae,ke[1]=ae>>>8&255,r.check=s(r.check,ke,2,0)),ae=0,ue=0,r.mode=T;case T:for(;ue<32;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}r.head&&(r.head.time=ae),512&r.flags&&(ke[0]=255&ae,ke[1]=ae>>>8&255,ke[2]=ae>>>16&255,ke[3]=ae>>>24&255,r.check=s(r.check,ke,4,0)),ae=0,ue=0,r.mode=A;case A:for(;ue<16;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}r.head&&(r.head.xflags=255&ae,r.head.os=ae>>8),512&r.flags&&(ke[0]=255&ae,ke[1]=ae>>>8&255,r.check=s(r.check,ke,2,0)),ae=0,ue=0,r.mode=S;case S:if(1024&r.flags){for(;ue<16;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}r.length=ae,r.head&&(r.head.extra_len=ae),512&r.flags&&(ke[0]=255&ae,ke[1]=ae>>>8&255,r.check=s(r.check,ke,2,0)),ae=0,ue=0}else r.head&&(r.head.extra=null);r.mode=k;case k:if(1024&r.flags&&((fe=r.length)>se&&(fe=se),fe&&(r.head&&(we=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,ee,re,fe,we)),512&r.flags&&(r.check=s(r.check,ee,fe,re)),se-=fe,re+=fe,r.length-=fe),r.length))break e;r.length=0,r.mode=C;case C:if(2048&r.flags){if(0===se)break e;fe=0;do{we=ee[re+fe++],r.head&&we&&r.length<65536&&(r.head.name+=String.fromCharCode(we))}while(we&&fe<se);if(512&r.flags&&(r.check=s(r.check,ee,fe,re)),se-=fe,re+=fe,we)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=I;case I:if(4096&r.flags){if(0===se)break e;fe=0;do{we=ee[re+fe++],r.head&&we&&r.length<65536&&(r.head.comment+=String.fromCharCode(we))}while(we&&fe<se);if(512&r.flags&&(r.check=s(r.check,ee,fe,re)),se-=fe,re+=fe,we)break e}else r.head&&(r.head.comment=null);r.mode=R;case R:if(512&r.flags){for(;ue<16;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}if(ae!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Z;break}ae=0,ue=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=M;break;case L:for(;ue<32;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}e.adler=r.check=ne(ae),ae=0,ue=0,r.mode=O;case O:if(0===r.havedict)return e.next_out=ie,e.avail_out=oe,e.next_in=re,e.avail_in=se,r.hold=ae,r.bits=ue,g;e.adler=r.check=1,r.mode=M;case M:if(t===p||t===f)break e;case P:if(r.last){ae>>>=7&ue,ue-=7&ue,r.mode=q;break}for(;ue<3;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}switch(r.last=1&ae,ue-=1,3&(ae>>>=1)){case 0:r.mode=B;break;case 1:if(he(r),r.mode=$,t===f){ae>>>=2,ue-=2;break e}break;case 2:r.mode=F;break;case 3:e.msg="invalid block type",r.mode=Z}ae>>>=2,ue-=2;break;case B:for(ae>>>=7&ue,ue-=7&ue;ue<32;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}if((65535&ae)!=(ae>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Z;break}if(r.length=65535&ae,ae=0,ue=0,r.mode=N,t===f)break e;case N:r.mode=D;case D:if(fe=r.length){if(fe>se&&(fe=se),fe>oe&&(fe=oe),0===fe)break e;n.arraySet(te,ee,re,fe,ie),se-=fe,re+=fe,oe-=fe,ie+=fe,r.length-=fe;break}r.mode=M;break;case F:for(;ue<14;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}if(r.nlen=257+(31&ae),ae>>>=5,ue-=5,r.ndist=1+(31&ae),ae>>>=5,ue-=5,r.ncode=4+(15&ae),ae>>>=4,ue-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Z;break}r.have=0,r.mode=j;case j:for(;r.have<r.ncode;){for(;ue<3;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}r.lens[Ce[r.have++]]=7&ae,ae>>>=3,ue-=3}for(;r.have<19;)r.lens[Ce[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Te={bits:r.lenbits},Ee=a(u,r.lens,0,19,r.lencode,0,r.work,Te),r.lenbits=Te.bits,Ee){e.msg="invalid code lengths set",r.mode=Z;break}r.have=0,r.mode=U;case U:for(;r.have<r.nlen+r.ndist;){for(;ve=(Se=r.lencode[ae&(1<<r.lenbits)-1])>>>16&255,ye=65535&Se,!((ge=Se>>>24)<=ue);){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}if(ye<16)ae>>>=ge,ue-=ge,r.lens[r.have++]=ye;else{if(16===ye){for(Ae=ge+2;ue<Ae;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}if(ae>>>=ge,ue-=ge,0===r.have){e.msg="invalid bit length repeat",r.mode=Z;break}we=r.lens[r.have-1],fe=3+(3&ae),ae>>>=2,ue-=2}else if(17===ye){for(Ae=ge+3;ue<Ae;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}ue-=ge,we=0,fe=3+(7&(ae>>>=ge)),ae>>>=3,ue-=3}else{for(Ae=ge+7;ue<Ae;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}ue-=ge,we=0,fe=11+(127&(ae>>>=ge)),ae>>>=7,ue-=7}if(r.have+fe>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Z;break}for(;fe--;)r.lens[r.have++]=we}}if(r.mode===Z)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Z;break}if(r.lenbits=9,Te={bits:r.lenbits},Ee=a(l,r.lens,0,r.nlen,r.lencode,0,r.work,Te),r.lenbits=Te.bits,Ee){e.msg="invalid literal/lengths set",r.mode=Z;break}if(r.distbits=6,r.distcode=r.distdyn,Te={bits:r.distbits},Ee=a(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Te),r.distbits=Te.bits,Ee){e.msg="invalid distances set",r.mode=Z;break}if(r.mode=$,t===f)break e;case $:r.mode=V;case V:if(se>=6&&oe>=258){e.next_out=ie,e.avail_out=oe,e.next_in=re,e.avail_in=se,r.hold=ae,r.bits=ue,o(e,ce),ie=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,se=e.avail_in,ae=r.hold,ue=r.bits,r.mode===M&&(r.back=-1);break}for(r.back=0;ve=(Se=r.lencode[ae&(1<<r.lenbits)-1])>>>16&255,ye=65535&Se,!((ge=Se>>>24)<=ue);){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}if(ve&&0==(240&ve)){for(_e=ge,be=ve,xe=ye;ve=(Se=r.lencode[xe+((ae&(1<<_e+be)-1)>>_e)])>>>16&255,ye=65535&Se,!(_e+(ge=Se>>>24)<=ue);){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}ae>>>=_e,ue-=_e,r.back+=_e}if(ae>>>=ge,ue-=ge,r.back+=ge,r.length=ye,0===ve){r.mode=K;break}if(32&ve){r.back=-1,r.mode=M;break}if(64&ve){e.msg="invalid literal/length code",r.mode=Z;break}r.extra=15&ve,r.mode=G;case G:if(r.extra){for(Ae=r.extra;ue<Ae;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}r.length+=ae&(1<<r.extra)-1,ae>>>=r.extra,ue-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=z;case z:for(;ve=(Se=r.distcode[ae&(1<<r.distbits)-1])>>>16&255,ye=65535&Se,!((ge=Se>>>24)<=ue);){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}if(0==(240&ve)){for(_e=ge,be=ve,xe=ye;ve=(Se=r.distcode[xe+((ae&(1<<_e+be)-1)>>_e)])>>>16&255,ye=65535&Se,!(_e+(ge=Se>>>24)<=ue);){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}ae>>>=_e,ue-=_e,r.back+=_e}if(ae>>>=ge,ue-=ge,r.back+=ge,64&ve){e.msg="invalid distance code",r.mode=Z;break}r.offset=ye,r.extra=15&ve,r.mode=W;case W:if(r.extra){for(Ae=r.extra;ue<Ae;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}r.offset+=ae&(1<<r.extra)-1,ae>>>=r.extra,ue-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Z;break}r.mode=H;case H:if(0===oe)break e;if(fe=ce-oe,r.offset>fe){if((fe=r.offset-fe)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Z;break}fe>r.wnext?(fe-=r.wnext,de=r.wsize-fe):de=r.wnext-fe,fe>r.length&&(fe=r.length),me=r.window}else me=te,de=ie-r.offset,fe=r.length;fe>oe&&(fe=oe),oe-=fe,r.length-=fe;do{te[ie++]=me[de++]}while(--fe);0===r.length&&(r.mode=V);break;case K:if(0===oe)break e;te[ie++]=r.length,oe--,r.mode=V;break;case q:if(r.wrap){for(;ue<32;){if(0===se)break e;se--,ae|=ee[re++]<<ue,ue+=8}if(ce-=oe,e.total_out+=ce,r.total+=ce,ce&&(e.adler=r.check=r.flags?s(r.check,te,ce,ie-ce):i(r.check,te,ce,ie-ce)),ce=oe,(r.flags?ae:ne(ae))!==r.check){e.msg="incorrect data check",r.mode=Z;break}ae=0,ue=0}r.mode=X;case X:if(r.wrap&&r.flags){for(;ue<32;){if(0===se)break e;se--,ae+=ee[re++]<<ue,ue+=8}if(ae!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Z;break}ae=0,ue=0}r.mode=Y;case Y:Ee=m;break e;case Z:Ee=y;break e;case J:return _;case Q:default:return v}return e.next_out=ie,e.avail_out=oe,e.next_in=re,e.avail_in=se,r.hold=ae,r.bits=ue,(r.wsize||ce!==e.avail_out&&r.mode<Z&&(r.mode<q||t!==h))&&pe(e,e.output,e.next_out,ce-e.avail_out)?(r.mode=J,_):(le-=e.avail_in,ce-=e.avail_out,e.total_in+=le,e.total_out+=ce,r.total+=ce,r.wrap&&ce&&(e.adler=r.check=r.flags?s(r.check,te,ce,e.next_out-ce):i(r.check,te,ce,e.next_out-ce)),e.data_type=r.bits+(r.last?64:0)+(r.mode===M?128:0)+(r.mode===$||r.mode===N?256:0),(0===le&&0===ce||t===h)&&Ee===d&&(Ee=b),Ee)},r.inflateEnd=function(e){if(!e||!e.state)return v;var t=e.state;return t.window&&(t.window=null),e.state=null,d},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?v:(r.head=t,t.done=!1,d):v},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&r.mode!==O?v:r.mode===O&&i(1,t,n,0)!==r.check?y:pe(e,t,n,n)?(r.mode=J,_):(r.havedict=1,d):v},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":302,"./adler32":303,"./crc32":305,"./inffast":307,"./inftrees":309}],309:[function(e,t,r){"use strict";var n=e("../utils/common"),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],s=[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],o=[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];t.exports=function(e,t,r,u,l,c,h,p){var f,d,m,g,v,y,_,b,x,w=p.bits,E=0,T=0,A=0,S=0,k=0,C=0,I=0,R=0,L=0,O=0,M=null,P=0,B=new n.Buf16(16),N=new n.Buf16(16),D=null,F=0;for(E=0;E<=15;E++)B[E]=0;for(T=0;T<u;T++)B[t[r+T]]++;for(k=w,S=15;S>=1&&0===B[S];S--);if(k>S&&(k=S),0===S)return l[c++]=20971520,l[c++]=20971520,p.bits=1,0;for(A=1;A<S&&0===B[A];A++);for(k<A&&(k=A),R=1,E=1;E<=15;E++)if(R<<=1,(R-=B[E])<0)return-1;if(R>0&&(0===e||1!==S))return-1;for(N[1]=0,E=1;E<15;E++)N[E+1]=N[E]+B[E];for(T=0;T<u;T++)0!==t[r+T]&&(h[N[t[r+T]]++]=T);if(0===e?(M=D=h,y=19):1===e?(M=i,P-=257,D=s,F-=257,y=256):(M=o,D=a,y=-1),O=0,T=0,E=A,v=c,C=k,I=0,m=-1,g=(L=1<<k)-1,1===e&&L>852||2===e&&L>592)return 1;for(;;){_=E-I,h[T]<y?(b=0,x=h[T]):h[T]>y?(b=D[F+h[T]],x=M[P+h[T]]):(b=96,x=0),f=1<<E-I,A=d=1<<C;do{l[v+(O>>I)+(d-=f)]=_<<24|b<<16|x|0}while(0!==d);for(f=1<<E-1;O&f;)f>>=1;if(0!==f?(O&=f-1,O+=f):O=0,T++,0==--B[E]){if(E===S)break;E=t[r+h[T]]}if(E>k&&(O&g)!==m){for(0===I&&(I=k),v+=A,R=1<<(C=E-I);C+I<S&&!((R-=B[C+I])<=0);)C++,R<<=1;if(L+=1<<C,1===e&&L>852||2===e&&L>592)return 1;l[m=O&g]=k<<24|C<<16|v-c|0}}return 0!==O&&(l[v+O]=E-I<<24|64<<16|0),p.bits=k,0}},{"../utils/common":302}],310:[function(e,t,r){"use strict";t.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"}},{}],311:[function(e,t,r){"use strict";var n=e("../utils/common"),i=4,s=0,o=1,a=2;function u(e){for(var t=e.length;--t>=0;)e[t]=0}var l=0,c=1,h=2,p=29,f=256,d=f+1+p,m=30,g=19,v=2*d+1,y=15,_=16,b=7,x=256,w=16,E=17,T=18,A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],S=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],k=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],I=new Array(2*(d+2));u(I);var R=new Array(2*m);u(R);var L=new Array(512);u(L);var O=new Array(256);u(O);var M=new Array(p);u(M);var P,B,N,D=new Array(m);function F(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function U(e){return e<256?L[e]:L[256+(e>>>7)]}function $(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function V(e,t,r){e.bi_valid>_-r?(e.bi_buf|=t<<e.bi_valid&65535,$(e,e.bi_buf),e.bi_buf=t>>_-e.bi_valid,e.bi_valid+=r-_):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function G(e,t,r){V(e,r[2*t],r[2*t+1])}function z(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function W(e,t,r){var n,i,s=new Array(y+1),o=0;for(n=1;n<=y;n++)s[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=z(s[a]++,a))}}function H(e){var t;for(t=0;t<d;t++)e.dyn_ltree[2*t]=0;for(t=0;t<m;t++)e.dyn_dtree[2*t]=0;for(t=0;t<g;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*x]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function K(e){e.bi_valid>8?$(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,n){var i=2*t,s=2*r;return e[i]<e[s]||e[i]===e[s]&&n[t]<=n[r]}function X(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&q(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!q(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function Y(e,t,r){var n,i,s,o,a=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*a]<<8|e.pending_buf[e.d_buf+2*a+1],i=e.pending_buf[e.l_buf+a],a++,0===n?G(e,i,t):(G(e,(s=O[i])+f+1,t),0!==(o=A[s])&&V(e,i-=M[s],o),G(e,s=U(--n),r),0!==(o=S[s])&&V(e,n-=D[s],o))}while(a<e.last_lit);G(e,x,t)}function Z(e,t){var r,n,i,s=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,u=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=v,r=0;r<u;r++)0!==s[2*r]?(e.heap[++e.heap_len]=l=r,e.depth[r]=0):s[2*r+1]=0;for(;e.heap_len<2;)s[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,a&&(e.static_len-=o[2*i+1]);for(t.max_code=l,r=e.heap_len>>1;r>=1;r--)X(e,s,r);i=u;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],X(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,X(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,o,a,u=t.dyn_tree,l=t.max_code,c=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,d=t.stat_desc.max_length,m=0;for(s=0;s<=y;s++)e.bl_count[s]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<v;r++)(s=u[2*u[2*(n=e.heap[r])+1]+1]+1)>d&&(s=d,m++),u[2*n+1]=s,n>l||(e.bl_count[s]++,o=0,n>=f&&(o=p[n-f]),a=u[2*n],e.opt_len+=a*(s+o),h&&(e.static_len+=a*(c[2*n+1]+o)));if(0!==m){do{for(s=d-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[d]--,m-=2}while(m>0);for(s=d;0!==s;s--)for(n=e.bl_count[s];0!==n;)(i=e.heap[--r])>l||(u[2*i+1]!==s&&(e.opt_len+=(s-u[2*i+1])*u[2*i],u[2*i+1]=s),n--)}}(e,t),W(s,l,e.bl_count)}function J(e,t,r){var n,i,s=-1,o=t[1],a=0,u=7,l=4;for(0===o&&(u=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++a<u&&i===o||(a<l?e.bl_tree[2*i]+=a:0!==i?(i!==s&&e.bl_tree[2*i]++,e.bl_tree[2*w]++):a<=10?e.bl_tree[2*E]++:e.bl_tree[2*T]++,a=0,s=i,0===o?(u=138,l=3):i===o?(u=6,l=3):(u=7,l=4))}function Q(e,t,r){var n,i,s=-1,o=t[1],a=0,u=7,l=4;for(0===o&&(u=138,l=3),n=0;n<=r;n++)if(i=o,o=t[2*(n+1)+1],!(++a<u&&i===o)){if(a<l)do{G(e,i,e.bl_tree)}while(0!=--a);else 0!==i?(i!==s&&(G(e,i,e.bl_tree),a--),G(e,w,e.bl_tree),V(e,a-3,2)):a<=10?(G(e,E,e.bl_tree),V(e,a-3,3)):(G(e,T,e.bl_tree),V(e,a-11,7));a=0,s=i,0===o?(u=138,l=3):i===o?(u=6,l=3):(u=7,l=4)}}u(D);var ee=!1;function te(e,t,r,i){V(e,(l<<1)+(i?1:0),3),function(e,t,r,i){K(e),i&&($(e,r),$(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}r._tr_init=function(e){ee||(function(){var e,t,r,n,i,s=new Array(y+1);for(r=0,n=0;n<p-1;n++)for(M[n]=r,e=0;e<1<<A[n];e++)O[r++]=n;for(O[r-1]=n,i=0,n=0;n<16;n++)for(D[n]=i,e=0;e<1<<S[n];e++)L[i++]=n;for(i>>=7;n<m;n++)for(D[n]=i<<7,e=0;e<1<<S[n]-7;e++)L[256+i++]=n;for(t=0;t<=y;t++)s[t]=0;for(e=0;e<=143;)I[2*e+1]=8,e++,s[8]++;for(;e<=255;)I[2*e+1]=9,e++,s[9]++;for(;e<=279;)I[2*e+1]=7,e++,s[7]++;for(;e<=287;)I[2*e+1]=8,e++,s[8]++;for(W(I,d+1,s),e=0;e<m;e++)R[2*e+1]=5,R[2*e]=z(e,5);P=new F(I,A,f+1,d,y),B=new F(R,S,0,m,y),N=new F(new Array(0),k,0,g,b)}(),ee=!0),e.l_desc=new j(e.dyn_ltree,P),e.d_desc=new j(e.dyn_dtree,B),e.bl_desc=new j(e.bl_tree,N),e.bi_buf=0,e.bi_valid=0,H(e)},r._tr_stored_block=te,r._tr_flush_block=function(e,t,r,n){var u,l,p=0;e.level>0?(e.strm.data_type===a&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return s;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t<f;t++)if(0!==e.dyn_ltree[2*t])return o;return s}(e)),Z(e,e.l_desc),Z(e,e.d_desc),p=function(e){var t;for(J(e,e.dyn_ltree,e.l_desc.max_code),J(e,e.dyn_dtree,e.d_desc.max_code),Z(e,e.bl_desc),t=g-1;t>=3&&0===e.bl_tree[2*C[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),u=e.opt_len+3+7>>>3,(l=e.static_len+3+7>>>3)<=u&&(u=l)):u=l=r+5,r+4<=u&&-1!==t?te(e,t,r,n):e.strategy===i||l===u?(V(e,(c<<1)+(n?1:0),3),Y(e,I,R)):(V(e,(h<<1)+(n?1:0),3),function(e,t,r,n){var i;for(V(e,t-257,5),V(e,r-1,5),V(e,n-4,4),i=0;i<n;i++)V(e,e.bl_tree[2*C[i]+1],3);Q(e,e.dyn_ltree,t-1),Q(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,p+1),Y(e,e.dyn_ltree,e.dyn_dtree)),H(e),n&&K(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(O[r]+f+1)]++,e.dyn_dtree[2*U(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){V(e,c<<1,3),G(e,x,I),function(e){16===e.bi_valid?($(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":302}],312:[function(e,t,r){"use strict";t.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}},{}],313:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SIGNALS=void 0;r.SIGNALS=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}]},{}],314:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.signalsByNumber=r.signalsByName=void 0;var n=e("os"),i=e("./signals.js"),s=e("./realtime.js");const o=function(e,{name:t,number:r,description:n,supported:i,action:s,forced:o,standard:a}){return{...e,[t]:{name:t,number:r,description:n,supported:i,action:s,forced:o,standard:a}}},a=(0,i.getSignals)().reduce(o,{});r.signalsByName=a;const u=function(e,t){const r=l(e,t);if(void 0===r)return{};const{name:n,description:i,supported:s,action:o,forced:a,standard:u}=r;return{[e]:{name:n,number:e,description:i,supported:s,action:o,forced:a,standard:u}}},l=function(e,t){const r=t.find(({name:t})=>n.constants.signals[t]===e);return void 0!==r?r:t.find(t=>t.number===e)},c=function(){const e=(0,i.getSignals)(),t=s.SIGRTMAX+1,r=Array.from({length:t},(t,r)=>u(r,e));return Object.assign({},...r)}();r.signalsByNumber=c},{"./realtime.js":315,"./signals.js":316,os:301}],315:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SIGRTMAX=r.getRealtimeSignals=void 0;r.getRealtimeSignals=function(){const e=s-i+1;return Array.from({length:e},n)};const n=function(e,t){return{name:`SIGRT${t+1}`,number:i+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},i=34,s=64;r.SIGRTMAX=s},{}],316:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getSignals=void 0;var n=e("os"),i=e("./core.js"),s=e("./realtime.js");r.getSignals=function(){const e=(0,s.getRealtimeSignals)();return[...i.SIGNALS,...e].map(o)};const o=function({name:e,number:t,description:r,action:i,forced:s=!1,standard:o}){const{signals:{[e]:a}}=n.constants,u=void 0!==a;return{name:e,number:u?a:t,description:r,supported:u,action:i,forced:s,standard:o}}},{"./core.js":313,"./realtime.js":315,os:301}],317:[function(e,t,r){r.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,h=r?i-1:0,p=r?-1:1,f=e[t+h];for(h+=p,s=f&(1<<-c)-1,f>>=-c,c+=a;c>0;s=256*s+e[t+h],h+=p,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=256*o+e[t+h],h+=p,c-=8);if(0===s)s=1-l;else{if(s===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),s-=l}return(f?-1:1)*o*Math.pow(2,s-n)},r.write=function(e,t,r,n,i,s){var o,a,u,l=8*s-i-1,c=(1<<l)-1,h=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(o++,u/=2),o+h>=c?(a=0,o=c):o+h>=1?(a=(t*u-1)*Math.pow(2,i),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&a,f+=d,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;e[r+f]=255&o,f+=d,o/=256,l-=8);e[r+f-d]|=128*m}},{}],318:[function(e,t,r){"use strict";var n=e("underscore"),i=t.exports={Bitmap:e("./lib/bitmap")};n.extend(i,e("./lib/enums"))},{"./lib/bitmap":319,"./lib/enums":320,underscore:516}],319:[function(e,t,r){(function(r){"use strict";var n=e("fs"),i=(e("underscore"),e("bluebird")),s=e("jpeg-js"),o=e("node-png").PNG,a=e("./enums"),u=e("./utils"),l=e("./resize"),c={r:0,g:0,b:0,a:0},h=t.exports=function(e){e&&(e instanceof h?this._data={data:new r(e.data.data),width:e.width,height:e.height}:e.data?this._data=e:e.width&&e.height&&(this._data={data:new r(4*e.width*e.height),width:e.width,height:e.height},e.color&&this._fill(e.color)))};h.prototype={get width(){return this._data.width},get height(){return this._data.height},attach:function(e){var t=this._data;return this._data=e,t},detach:function(){var e=this._data;return delete this._data,e},_deduceFileType:function(e){if(!e)throw new Error("Can't determine image type");switch(e.substr(-4).toLowerCase()){case".jpg":return a.ImageType.JPG;case".png":return a.ImageType.PNG}if(".jpeg"==e.substr(-5).toLowerCase())return a.ImageType.JPG;throw new Error("Can't recognise image type: "+e)},_readStream:function(e){var t=i.defer(),n=[];return e.on("data",function(e){n.push(e)}),e.on("end",function(){var e=r.concat(n);t.resolve(e)}),e.on("error",function(e){t.reject(e)}),t.promise},_readPNG:function(e){var t=i.defer(),r=new o({filterType:4});return r.on("parsed",function(){t.resolve(r)}),r.on("error",function(e){t.rejecyt(e)}),e.pipe(r),t.promise},_parseOptions:function(e,t){return"number"==typeof(e=e||{})&&(e={type:e}),e.type=e.type||this._deduceFileType(t),e},read:function(e,t){var r=this;switch((t=this._parseOptions(t)).type){case a.ImageType.JPG:return this._readStream(e).then(function(e){r._data=s.decode(e)});case a.ImageType.PNG:return this._readPNG(e).then(function(e){r._data={data:e.data,width:e.width,height:e.height}});default:return i.reject(new Error("Not supported: ImageType "+t.type))}},readFile:function(e,t){var r=this;return u.fs.exists(e).then(function(i){if(i){t=r._parseOptions(t,e);var s=n.createReadStream(e);return r.read(s,t)}throw new Error("File Not Found: "+e)})},write:function(e,t){t=this._parseOptions(t);var r=i.defer();try{switch(e.on("finish",function(){r.resolve()}),e.on("error",function(e){r.reject(e)}),t.type){case a.ImageType.JPG:var n=s.encode(this._data,t.quality||90).data;e.write(n),e.end();break;case a.ImageType.PNG:var u=new o;u.width=this.width,u.height=this.height,u.data=this._data.data,u.on("end",function(){r.resolve()}),u.on("error",function(e){r.reject(e)}),u.pack().pipe(e);break;default:throw new Error("Not supported: ImageType "+t.type)}}catch(e){r.reject(e)}return r.promise},writeFile:function(e,t){t=this._parseOptions(t,e);var r=n.createWriteStream(e);return this.write(r,t)},clone:function(){return new h({width:this.width,height:this.height,data:new r(this._data.data)})},setPixel:function(e,t,r,n,i,s){if(void 0===n){var o=r;r=o.r,n=o.g,i=o.b,s=o.a}void 0===s&&(s=255);var a=4*(t*this.width+e),u=this._data.data;u[a++]=r,u[a++]=n,u[a++]=i,u[a++]=s},getPixel:function(e,t,r){var n=4*(t*this.width+e);r=r||{};var i=this._data.data;return r.r=i[n++],r.g=i[n++],r.b=i[n++],r.a=i[n++],r},negative:function(){for(var e=new h({width:this.width,height:this.height}),t=this.width*this.height,r=this._data.data,n=e._data.data,i=0,s=0,o=0;o<t;o++)n[s++]=255-r[i++],n[s++]=255-r[i++],n[s++]=255-r[i++],n[s++]=r[i++];return e},resize:function(e){var t,r=new h(e);switch(e.fit){case"pad":var n=e.padColor||c,i=this.width/this.height,s=Math.round(i*r.height),o=Math.round(r.width/i),a=0,u=0;s<r.width?(t=new h({width:s,height:r.height}),a=(r.width-s)/2,r._fill(n,0,0,Math.floor(a),r.height),r._fill(n,r.width-Math.ceil(a),0,Math.ceil(a),r.height),l[e.algorithm](this,t,e),r._blt(t,{left:Math.floor(a),top:Math.floor(u)})):o<r.height?(t=new h({width:r.width,height:o}),u=(r.height-o)/2,r._fill(n,0,0,r.width,Math.floor(u)),r._fill(n,0,r.height-Math.ceil(u),r.width,Math.ceil(u)),l[e.algorithm](this,t,e),r._blt(t,{left:Math.floor(a),top:Math.floor(u)})):l[e.algorithm](this,r,e);break;case"crop":var p=e.gravity||{x:.5,y:.5},f=r.width/r.height;s=Math.round(f*this.height),o=Math.round(this.width/f);if(s<this.width){var d=this.width-s;t=this.crop({left:Math.round(p.x*d),top:0,width:s,height:this.height})}else if(o<this.height){var m=this.height-o;t=this.crop({left:0,top:Math.round(p.y*m),width:this.width,height:o})}else t=this;l[e.algorithm](t,r,e);break;case"stretch":default:l[e.algorithm](this,r,e)}return r},rotate:function(e){var t=void 0!==e.radians?e.radians:3.141592653589793*e.degrees/180;if(t<1e-9)return new h(this);var r,n,i={forward:{cos:Math.cos(t),sin:Math.sin(t)},backward:{cos:Math.cos(-t),sin:Math.sin(-t)}},s=this.width,o=this.height,a=s/2,u=o/2,l=e.padColor||c,p=[l.r,l.g,l.b,l.a],f=function(e,t){var r=t.cos*e.x-t.sin*e.y,n=t.sin*e.x+t.cos*e.y;return e.x=r,e.y=n,e},d=function(e){var t=Math.abs(e.x/a),r=Math.abs(e.y/u);return Math.max(t,r)};switch(e.fit){case"custom":r=e.width,n=e.height;break;case"pad":var m=f({x:-a,y:u},i.forward),g=f({x:a,y:u},i.forward),v=f({x:-a,y:-u},i.forward),y=f({x:a,y:-u},i.forward);r=Math.round(Math.max(m.x,g.x,v.x,y.x)-Math.min(m.x,g.x,v.x,y.x)),n=Math.round(Math.max(m.y,g.y,v.y,y.y)-Math.min(m.y,g.y,v.y,y.y));break;case"crop":m=f({x:-a,y:u},i.forward),g=f({x:a,y:u},i.forward),v=f({x:-a,y:-u},i.forward),y=f({x:a,y:-u},i.forward);var _=Math.max(d(m),d(g),d(v),d(y));r=Math.floor(s/_),n=Math.floor(o/_);break;case"same":default:r=s,n=o}for(var b=new h({width:r,height:n}),x=this._data.data,w=b._data.data,E={},T=r/2,A=n/2,S=4*s,k=0;k<n;k++)for(var C=0;C<r;C++){E.x=C-T,E.y=A-k,f(E,i.backward);var I=E.x+a,R=u-E.y,L=4*(k*r+C);if(I>-1&&I<s&&R>-1&&R<o)for(var O=Math.floor(I),M=Math.floor(R),P=4*(M*s+O),B=0;B<4;B++){var N=P+B,D=p[B],F=I-O,j=R-M,U=(1-F)*(m=I>=0&&R>=0?x[N]:D)+F*(g=I<s-1&&R>=0?x[N+4]:D),$=(1-F)*(v=I>=0&&R<o-1?x[N+S]:D)+F*(y=I<s-1&&R<o-1?x[N+S+4]:D);w[L++]=(1-j)*U+j*$}else w[L++]=l.r,w[L++]=l.g,w[L++]=l.b,w[L++]=l.a}return b},crop:function(e){for(var t=e.top,r=e.left,n=e.width,i=e.height,s=new h({width:n,height:i}),o=this._data.data,a=s._data.data,u=4*n,l=0;l<i;l++){var c=4*((l+t)*this.width+r),p=l*n*4;o.copy(a,p,c,c+u)}return s},blur:function(e){for(var t=new h({width:this.width,height:this.height}),r=this.width,n=this.height,i=r-1,s=n-1,o=4*r,a=this._data.data,u=t._data.data,l=0;l<n;l++)for(var c=0;c<r;c++)for(var p=0;p<4;p++){var f=4*(l*r+c)+p,d=1*a[f-(l>0?o:0)-(c>0?4:0)]+2*a[f-(l>0?o:0)]+1*a[f-(l>0?o:0)+(c<i?4:0)]+2*a[f-(c>0?4:0)]+4*a[f]+2*a[f+(c<i?4:0)]+1*a[f+(l<s?o:0)-(c>0?4:0)]+2*a[f+(l<s?o:0)]+1*a[f+(l<s?o:0)+(c<i?4:0)];u[f]=Math.round(d/16)}return t},_fill:function(e,t,r,n,i){t=t||0,r=r||0,n=n||this.width-t,i=i||this.height-r;for(var s=(e=e||c).r||0,o=e.g||0,a=e.b||0,u=e.a||0,l=this._data.data,h=r+i,p=t+n,f=this.width,d=4*(r*f+t),m=d,g=t;g<p;g++)l[m++]=s,l[m++]=o,l[m++]=a,l[m++]=u;for(var v=d+4*n,y=r;y<h;y++){m=4*(y*f+t);l.copy(l,m,d,v)}},_blt:function(e,t){for(var r=t.left,n=t.top,i=Math.min(this.width-r,e.width),s=Math.min(this.height-n,e.height),o=4*i,a=e._data.data,u=this._data.data,l=0;l<s;l++){var c=l*e.width*4,h=4*((l+n)*this.width+r);a.copy(u,h,c,c+o)}}}}).call(this,e("buffer").Buffer)},{"./enums":320,"./resize":321,"./utils":322,bluebird:33,buffer:299,fs:298,"jpeg-js":323,"node-png":396,underscore:516}],320:[function(e,t,r){"use strict";t.exports={ImageType:{JPG:1,PNG:2}}},{}],321:[function(e,t,r){(function(r){"use strict";e("underscore"),e("bluebird");t.exports={_writeFile:function(t,r,n,i){new(e("./bitmap"))({width:t,height:r,data:n}).writeFile(i)},nearestNeighbor:function(e,t,r){for(var n=e.width,i=e.height,s=t.width,o=t.height,a=e._data.data,u=t._data.data,l=0;l<o;l++)for(var c=0;c<s;c++){var h=4*(l*s+c),p=4*(Math.round(l*i/o)*n+Math.round(c*n/s));u[h++]=a[p++],u[h++]=a[p++],u[h++]=a[p++],u[h++]=a[p++]}},bilinearInterpolation:function(e,t,r){for(var n=e.width,i=e.height,s=t.width,o=t.height,a=e._data.data,u=t._data.data,l=function(e,t,r,n,i){return t===n?r:Math.round((e-t)*i+(n-e)*r)},c=function(e,t,r,i,s,o,c,h){var p=4*(c*n+i)+t,f=4*(c*n+s)+t,d=l(r,i,a[p],s,a[f]);if(h===c)u[e+t]=d;else{f=4*(h*n+s)+t;var m=l(r,i,a[p=4*(h*n+i)+t],s,a[f]);u[e+t]=l(o,c,d,h,m)}},h=0;h<o;h++)for(var p=0;p<s;p++){var f=4*(h*s+p),d=p*n/s,m=Math.floor(d),g=Math.min(Math.ceil(d),n-1),v=h*i/o,y=Math.floor(v),_=Math.min(Math.ceil(v),i-1);c(f,0,d,m,g,v,y,_),c(f,1,d,m,g,v,y,_),c(f,2,d,m,g,v,y,_),c(f,3,d,m,g,v,y,_)}},_interpolate2D:function(e,t,n,i){for(var s=e._data.data,o=t._data.data,a=e.width,u=e.height,l=t.width,c=t.height,h=Math.max(1,Math.floor(a/l)),p=l*h,f=Math.max(1,Math.floor(u/c)),d=c*f,m=new r(p*u*4),g=0;g<u;g++)for(var v=0;v<p;v++)for(var y=(U=v*(a-1)/p)-($=Math.floor(U)),_=4*(g*a+$),b=4*(g*p+v),x=0;x<4;x++){var w=_+x,E=$>0?s[w-4]:2*s[w]-s[w+4],T=s[w],A=s[w+4],S=$<a-2?s[w+8]:2*s[w+4]-s[w];m[b+x]=i(E,T,A,S,y)}var k=new r(p*d*4);for(g=0;g<d;g++)for(v=0;v<p;v++){y=(F=g*(u-1)/d)-(j=Math.floor(F)),b=4*(j*p+v);var C=4*(g*p+v);for(x=0;x<4;x++){w=b+x;var I=j>0?m[w-4*p]:2*m[w]-m[w+4*p],R=m[w],L=m[w+4*p],O=j<u-2?m[w+8*p]:2*m[w+4*p]-m[w];k[C+x]=i(I,R,L,O,y)}}var M=h*f;if(M>1)for(g=0;g<c;g++)for(v=0;v<l;v++){for(var P=0,B=0,N=0,D=0,F=0;F<f;F++)for(var j=g*f+F,U=0;U<h;U++){var $,V=4*(j*p+($=v*h+U));P+=k[V],B+=k[V+1],N+=k[V+2],D+=k[V+3]}var G=4*(g*l+v);o[G]=Math.round(P/M),o[G+1]=Math.round(B/M),o[G+2]=Math.round(N/M),o[G+3]=Math.round(D/M)}else t._data.data=k},bicubicInterpolation:function(e,t,r){return this._interpolate2D(e,t,r,function(e,t,r,n,i){var s=n-r-e+t,o=e-t-s,a=r-e,u=t;return Math.max(0,Math.min(255,s*(i*i*i)+o*(i*i)+a*i+u))})},hermiteInterpolation:function(e,t,r){return this._interpolate2D(e,t,r,function(e,t,r,n,i){var s=t,o=.5*(r-e),a=e-2.5*t+2*r-.5*n,u=.5*(n-e)+1.5*(t-r);return Math.max(0,Math.min(255,Math.round(((u*i+a)*i+o)*i+s)))})},bezierInterpolation:function(e,t,r){return this._interpolate2D(e,t,r,function(e,t,r,n,i){var s=1-i,o=t*s*s*s,a=3*(t+(r-e)/4)*s*s*i,u=3*(r-(n-t)/4)*s*i*i,l=r*i*i*i;return Math.max(0,Math.min(255,Math.round(o+a+u+l)))})}}}).call(this,e("buffer").Buffer)},{"./bitmap":319,bluebird:33,buffer:299,underscore:516}],322:[function(e,t,r){"use strict";var n=e("fs"),i=(e("underscore"),e("bluebird"));t.exports={fs:{exists:function(e){var t=i.defer();return n.exists(e,function(e){t.resolve(e)}),t.promise}}}},{bluebird:33,fs:298,underscore:516}],323:[function(e,t,r){var n=e("./lib/encoder"),i=e("./lib/decoder");t.exports={encode:n,decode:i}},{"./lib/decoder":324,"./lib/encoder":325}],324:[function(e,t,r){(function(e){var r=function(){"use strict";var e=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]),t=4017,r=799,n=3406,i=2276,s=1567,o=3784,a=5793,u=2896;function l(){}function c(e,t){for(var r,n,i=0,s=[],o=16;o>0&&!e[o-1];)o--;s.push({children:[],index:0});var a,u=s[0];for(r=0;r<o;r++){for(n=0;n<e[r];n++){for((u=s.pop()).children[u.index]=t[i];u.index>0;)u=s.pop();for(u.index++,s.push(u);s.length<=r;)s.push(a={children:[],index:0}),u.children[u.index]=a.children,u=a;i++}r+1<o&&(s.push(a={children:[],index:0}),u.children[u.index]=a.children,u=a)}return s[0].children}function h(t,r,n,i,s,o,a,u,l){n.precision,n.samplesPerLine,n.scanLines;var c=n.mcusPerLine,h=n.progressive,p=(n.maxH,n.maxV,r),f=0,d=0;function m(){if(d>0)return f>>--d&1;if(255==(f=t[r++])){var e=t[r++];if(e)throw"unexpected marker: "+(f<<8|e).toString(16)}return d=7,f>>>7}function g(e){for(var t,r=e;null!==(t=m());){if("number"==typeof(r=r[t]))return r;if("object"!=typeof r)throw"invalid huffman sequence"}return null}function v(e){for(var t=0;e>0;){var r=m();if(null===r)return;t=t<<1|r,e--}return t}function y(e){var t=v(e);return t>=1<<e-1?t:t+(-1<<e)+1}var _=0;var b,x=0;function w(e,t,r,n,i){var s=r%c,o=(r/c|0)*e.v+n,a=s*e.h+i;t(e,e.blocks[o][a])}function E(e,t,r){var n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}var T,A,S,k,C,I,R=i.length;I=h?0===o?0===u?function(e,t){var r=g(e.huffmanTableDC),n=0===r?0:y(r)<<l;t[0]=e.pred+=n}:function(e,t){t[0]|=m()<<l}:0===u?function(t,r){if(_>0)_--;else for(var n=o,i=a;n<=i;){var s=g(t.huffmanTableAC),u=15&s,c=s>>4;if(0!==u)r[e[n+=c]]=y(u)*(1<<l),n++;else{if(c<15){_=v(c)+(1<<c)-1;break}n+=16}}}:function(t,r){for(var n=o,i=a,s=0;n<=i;){var u=e[n];switch(x){case 0:var c=g(t.huffmanTableAC),h=15&c;if(s=c>>4,0===h)s<15?(_=v(s)+(1<<s),x=4):(s=16,x=1);else{if(1!==h)throw"invalid ACn encoding";b=y(h),x=s?2:3}continue;case 1:case 2:r[u]?r[u]+=m()<<l:0==--s&&(x=2==x?3:0);break;case 3:r[u]?r[u]+=m()<<l:(r[u]=b<<l,x=0);break;case 4:r[u]&&(r[u]+=m()<<l)}n++}4===x&&0==--_&&(x=0)}:function(t,r){var n=g(t.huffmanTableDC),i=0===n?0:y(n);r[0]=t.pred+=i;for(var s=1;s<64;){var o=g(t.huffmanTableAC),a=15&o,u=o>>4;if(0!==a)r[e[s+=u]]=y(a),s++;else{if(u<15)break;s+=16}}};var L,O,M,P,B=0;for(O=1==R?i[0].blocksPerLine*i[0].blocksPerColumn:c*n.mcusPerColumn,s||(s=O);B<O;){for(A=0;A<R;A++)i[A].pred=0;if(_=0,1==R)for(T=i[0],C=0;C<s;C++)E(T,I,B),B++;else for(C=0;C<s;C++){for(A=0;A<R;A++)for(M=(T=i[A]).h,P=T.v,S=0;S<P;S++)for(k=0;k<M;k++)w(T,I,B,S,k);if(++B===O)break}if(d=0,(L=t[r]<<8|t[r+1])<65280)throw"marker was not found";if(!(L>=65488&&L<=65495))break;r+=2}return r-p}function p(e,l){var c,h,p=[],f=l.blocksPerLine,d=l.blocksPerColumn,m=f<<3,g=new Int32Array(64),v=new Uint8Array(64);function y(e,c,h){var p,f,d,m,g,v,y,_,b,x,w=l.quantizationTable,E=h;for(x=0;x<64;x++)E[x]=e[x]*w[x];for(x=0;x<8;++x){var T=8*x;0!=E[1+T]||0!=E[2+T]||0!=E[3+T]||0!=E[4+T]||0!=E[5+T]||0!=E[6+T]||0!=E[7+T]?(p=a*E[0+T]+128>>8,f=a*E[4+T]+128>>8,d=E[2+T],m=E[6+T],g=u*(E[1+T]-E[7+T])+128>>8,_=u*(E[1+T]+E[7+T])+128>>8,v=E[3+T]<<4,y=E[5+T]<<4,b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*o+m*s+128>>8,d=d*s-m*o+128>>8,m=b,b=g-y+1>>1,g=g+y+1>>1,y=b,b=_+v+1>>1,v=_-v+1>>1,_=b,b=p-m+1>>1,p=p+m+1>>1,m=b,b=f-d+1>>1,f=f+d+1>>1,d=b,b=g*i+_*n+2048>>12,g=g*n-_*i+2048>>12,_=b,b=v*r+y*t+2048>>12,v=v*t-y*r+2048>>12,y=b,E[0+T]=p+_,E[7+T]=p-_,E[1+T]=f+y,E[6+T]=f-y,E[2+T]=d+v,E[5+T]=d-v,E[3+T]=m+g,E[4+T]=m-g):(b=a*E[0+T]+512>>10,E[0+T]=b,E[1+T]=b,E[2+T]=b,E[3+T]=b,E[4+T]=b,E[5+T]=b,E[6+T]=b,E[7+T]=b)}for(x=0;x<8;++x){var A=x;0!=E[8+A]||0!=E[16+A]||0!=E[24+A]||0!=E[32+A]||0!=E[40+A]||0!=E[48+A]||0!=E[56+A]?(p=a*E[0+A]+2048>>12,f=a*E[32+A]+2048>>12,d=E[16+A],m=E[48+A],g=u*(E[8+A]-E[56+A])+2048>>12,_=u*(E[8+A]+E[56+A])+2048>>12,v=E[24+A],y=E[40+A],b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*o+m*s+2048>>12,d=d*s-m*o+2048>>12,m=b,b=g-y+1>>1,g=g+y+1>>1,y=b,b=_+v+1>>1,v=_-v+1>>1,_=b,b=p-m+1>>1,p=p+m+1>>1,m=b,b=f-d+1>>1,f=f+d+1>>1,d=b,b=g*i+_*n+2048>>12,g=g*n-_*i+2048>>12,_=b,b=v*r+y*t+2048>>12,v=v*t-y*r+2048>>12,y=b,E[0+A]=p+_,E[56+A]=p-_,E[8+A]=f+y,E[48+A]=f-y,E[16+A]=d+v,E[40+A]=d-v,E[24+A]=m+g,E[32+A]=m-g):(b=a*h[x+0]+8192>>14,E[0+A]=b,E[8+A]=b,E[16+A]=b,E[24+A]=b,E[32+A]=b,E[40+A]=b,E[48+A]=b,E[56+A]=b)}for(x=0;x<64;++x){var S=128+(E[x]+8>>4);c[x]=S<0?0:S>255?255:S}}for(var _=0;_<d;_++){var b=_<<3;for(c=0;c<8;c++)p.push(new Uint8Array(m));for(var x=0;x<f;x++){y(l.blocks[_][x],v,g);var w=0,E=x<<3;for(h=0;h<8;h++){var T=p[b+h];for(c=0;c<8;c++)T[E+c]=v[w++]}}}return p}function f(e){return e<0?0:e>255?255:e}return l.prototype={load:function(e){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="arraybuffer",t.onload=function(){var e=new Uint8Array(t.response||t.mozResponseArrayBuffer);this.parse(e),this.onload&&this.onload()}.bind(this),t.send(null)},parse:function(t){var r=0;t.length;function n(){var e=t[r]<<8|t[r+1];return r+=2,e}function i(){var e=n(),i=t.subarray(r,r+e-2);return r+=i.length,i}function s(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i<t.v&&(i=t.v));var s=Math.ceil(e.samplesPerLine/8/n),o=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];for(var a=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),u=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),l=s*t.h,c=o*t.v,h=[],p=0;p<c;p++){for(var f=[],d=0;d<l;d++)f.push(new Int32Array(64));h.push(f)}t.blocksPerLine=a,t.blocksPerColumn=u,t.blocks=h}e.maxH=n,e.maxV=i,e.mcusPerLine=s,e.mcusPerColumn=o}var o,a,u=null,l=null,f=[],d=[],m=[],g=[],v=n();if(65496!=v)throw"SOI not found";for(v=n();65497!=v;){switch(v){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:var y=i();65504===v&&74===y[0]&&70===y[1]&&73===y[2]&&70===y[3]&&0===y[4]&&(u={version:{major:y[5],minor:y[6]},densityUnits:y[7],xDensity:y[8]<<8|y[9],yDensity:y[10]<<8|y[11],thumbWidth:y[12],thumbHeight:y[13],thumbData:y.subarray(14,14+3*y[12]*y[13])}),65518===v&&65===y[0]&&100===y[1]&&111===y[2]&&98===y[3]&&101===y[4]&&0===y[5]&&(l={version:y[6],flags0:y[7]<<8|y[8],flags1:y[9]<<8|y[10],transformCode:y[11]});break;case 65499:for(var _=n()+r-2;r<_;){var b=t[r++],x=new Int32Array(64);if(b>>4==0)for($=0;$<64;$++){x[e[$]]=t[r++]}else{if(b>>4!=1)throw"DQT: invalid table spec";for($=0;$<64;$++){x[e[$]]=n()}}f[15&b]=x}break;case 65472:case 65473:case 65474:n(),(o={}).extended=65473===v,o.progressive=65474===v,o.precision=t[r++],o.scanLines=n(),o.samplesPerLine=n(),o.components={},o.componentsOrder=[];var w,E=t[r++];for(j=0;j<E;j++){w=t[r];var T=t[r+1]>>4,A=15&t[r+1],S=t[r+2];o.componentsOrder.push(w),o.components[w]={h:T,v:A,quantizationIdx:S},r+=3}s(o),d.push(o);break;case 65476:var k=n();for(j=2;j<k;){var C=t[r++],I=new Uint8Array(16),R=0;for($=0;$<16;$++,r++)R+=I[$]=t[r];var L=new Uint8Array(R);for($=0;$<R;$++,r++)L[$]=t[r];j+=17+R,(C>>4==0?g:m)[15&C]=c(I,L)}break;case 65501:n(),a=n();break;case 65498:n();var O=t[r++],M=[];for(j=0;j<O;j++){V=o.components[t[r++]];var P=t[r++];V.huffmanTableDC=g[P>>4],V.huffmanTableAC=m[15&P],M.push(V)}var B=t[r++],N=t[r++],D=t[r++],F=h(t,r,o,M,a,B,N,D>>4,15&D);r+=F;break;default:if(255==t[r-3]&&t[r-2]>=192&&t[r-2]<=254){r-=3;break}throw"unknown JPEG marker "+v.toString(16)}v=n()}if(1!=d.length)throw"only single frame JPEGs supported";for(var j=0;j<d.length;j++){var U=d[j].components;for(var $ in U)U[$].quantizationTable=f[U[$].quantizationIdx],delete U[$].quantizationIdx}this.width=o.samplesPerLine,this.height=o.scanLines,this.jfif=u,this.adobe=l,this.components=[];for(j=0;j<o.componentsOrder.length;j++){var V=o.components[o.componentsOrder[j]];this.components.push({lines:p(0,V),scaleX:V.h/o.maxH,scaleY:V.v/o.maxV})}},getData:function(e,t){var r,n,i,s,o,a,u,l,c,h,p,d,m,g,v,y,_,b,x,w,E,T=this.width/e,A=this.height/t,S=0,k=e*t*this.components.length,C=new Uint8Array(k);switch(this.components.length){case 1:for(r=this.components[0],h=0;h<t;h++)for(o=r.lines[0|h*r.scaleY*A],c=0;c<e;c++)p=o[0|c*r.scaleX*T],C[S++]=p;break;case 2:for(r=this.components[0],n=this.components[1],h=0;h<t;h++)for(o=r.lines[0|h*r.scaleY*A],a=n.lines[0|h*n.scaleY*A],c=0;c<e;c++)p=o[0|c*r.scaleX*T],C[S++]=p,p=a[0|c*n.scaleX*T],C[S++]=p;break;case 3:for(E=!0,this.adobe&&this.adobe.transformCode?E=!0:void 0!==this.colorTransform&&(E=!!this.colorTransform),r=this.components[0],n=this.components[1],i=this.components[2],h=0;h<t;h++)for(o=r.lines[0|h*r.scaleY*A],a=n.lines[0|h*n.scaleY*A],u=i.lines[0|h*i.scaleY*A],c=0;c<e;c++)E?(p=o[0|c*r.scaleX*T],d=a[0|c*n.scaleX*T],b=f(p+1.402*((m=u[0|c*i.scaleX*T])-128)),x=f(p-.3441363*(d-128)-.71413636*(m-128)),w=f(p+1.772*(d-128))):(b=o[0|c*r.scaleX*T],x=a[0|c*n.scaleX*T],w=u[0|c*i.scaleX*T]),C[S++]=b,C[S++]=x,C[S++]=w;break;case 4:if(!this.adobe)throw"Unsupported color mode (4 components)";for(E=!1,this.adobe&&this.adobe.transformCode?E=!0:void 0!==this.colorTransform&&(E=!!this.colorTransform),r=this.components[0],n=this.components[1],i=this.components[2],s=this.components[3],h=0;h<t;h++)for(o=r.lines[0|h*r.scaleY*A],a=n.lines[0|h*n.scaleY*A],u=i.lines[0|h*i.scaleY*A],l=s.lines[0|h*s.scaleY*A],c=0;c<e;c++)E?(p=o[0|c*r.scaleX*T],d=a[0|c*n.scaleX*T],m=u[0|c*i.scaleX*T],g=l[0|c*s.scaleX*T],v=255-f(p+1.402*(m-128)),y=255-f(p-.3441363*(d-128)-.71413636*(m-128)),_=255-f(p+1.772*(d-128))):(v=o[0|c*r.scaleX*T],y=a[0|c*n.scaleX*T],_=u[0|c*i.scaleX*T],g=l[0|c*s.scaleX*T]),C[S++]=v,C[S++]=y,C[S++]=_,C[S++]=g;break;default:throw"Unsupported color mode"}return C},copyToImageData:function(e){var t,r,n,i,s,o,a,u,l,c=e.width,h=e.height,p=e.data,d=this.getData(c,h),m=0,g=0;switch(this.components.length){case 1:for(r=0;r<h;r++)for(t=0;t<c;t++)n=d[m++],p[g++]=n,p[g++]=n,p[g++]=n,p[g++]=255;break;case 3:for(r=0;r<h;r++)for(t=0;t<c;t++)a=d[m++],u=d[m++],l=d[m++],p[g++]=a,p[g++]=u,p[g++]=l,p[g++]=255;break;case 4:for(r=0;r<h;r++)for(t=0;t<c;t++)s=d[m++],o=d[m++],n=d[m++],a=255-f(s*(1-(i=d[m++])/255)+i),u=255-f(o*(1-i/255)+i),l=255-f(n*(1-i/255)+i),p[g++]=a,p[g++]=u,p[g++]=l,p[g++]=255;break;default:throw"Unsupported color mode"}}},l}();t.exports=function(t){var n=new Uint8Array(t),i=new r;i.parse(n);var s={width:i.width,height:i.height,data:new e(i.width*i.height*4)};return i.copyToImageData(s),s}}).call(this,e("buffer").Buffer)},{buffer:299}],325:[function(e,t,r){(function(e){function r(t){Math.round;var r,n,i,s,o,a=Math.floor,u=new Array(64),l=new Array(64),c=new Array(64),h=new Array(64),p=new Array(65535),f=new Array(65535),d=new Array(64),m=new Array(64),g=[],v=0,y=7,_=new Array(64),b=new Array(64),x=new Array(64),w=new Array(256),E=new Array(2048),T=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],A=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],S=[0,1,2,3,4,5,6,7,8,9,10,11],k=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],C=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],I=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],R=[0,1,2,3,4,5,6,7,8,9,10,11],L=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],O=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function M(e,t){for(var r=0,n=0,i=new Array,s=1;s<=16;s++){for(var o=1;o<=e[s];o++)i[t[n]]=[],i[t[n]][0]=r,i[t[n]][1]=s,n++,r++;r*=2}return i}function P(e){for(var t=e[0],r=e[1]-1;r>=0;)t&1<<r&&(v|=1<<y),r--,--y<0&&(255==v?(B(255),B(0)):B(v),y=7,v=0)}function B(e){g.push(e)}function N(e){B(e>>8&255),B(255&e)}function D(e,t,r,n,i){var s,o=i[0],a=i[240];for(var u=function(e,t){var r,n,i,s,o,a,u,l,c,h,p=0;for(c=0;c<8;++c){r=e[p],n=e[p+1],i=e[p+2],s=e[p+3],o=e[p+4],a=e[p+5],u=e[p+6];var f=r+(l=e[p+7]),m=r-l,g=n+u,v=n-u,y=i+a,_=i-a,b=s+o,x=s-o,w=f+b,E=f-b,T=g+y,A=g-y;e[p]=w+T,e[p+4]=w-T;var S=.707106781*(A+E);e[p+2]=E+S,e[p+6]=E-S;var k=.382683433*((w=x+_)-(A=v+m)),C=.5411961*w+k,I=1.306562965*A+k,R=.707106781*(T=_+v),L=m+R,O=m-R;e[p+5]=O+C,e[p+3]=O-C,e[p+1]=L+I,e[p+7]=L-I,p+=8}for(p=0,c=0;c<8;++c){r=e[p],n=e[p+8],i=e[p+16],s=e[p+24],o=e[p+32],a=e[p+40],u=e[p+48];var M=r+(l=e[p+56]),P=r-l,B=n+u,N=n-u,D=i+a,F=i-a,j=s+o,U=s-o,$=M+j,V=M-j,G=B+D,z=B-D;e[p]=$+G,e[p+32]=$-G;var W=.707106781*(z+V);e[p+16]=V+W,e[p+48]=V-W;var H=.382683433*(($=U+F)-(z=N+P)),K=.5411961*$+H,q=1.306562965*z+H,X=.707106781*(G=F+N),Y=P+X,Z=P-X;e[p+40]=Z+K,e[p+24]=Z-K,e[p+8]=Y+q,e[p+56]=Y-q,p++}for(c=0;c<64;++c)h=e[c]*t[c],d[c]=h>0?h+.5|0:h-.5|0;return d}(e,t),l=0;l<64;++l)m[T[l]]=u[l];var c=m[0]-r;r=m[0],0==c?P(n[0]):(P(n[f[s=32767+c]]),P(p[s]));for(var h=63;h>0&&0==m[h];h--);if(0==h)return P(o),r;for(var g,v=1;v<=h;){for(var y=v;0==m[v]&&v<=h;++v);var _=v-y;if(_>=16){g=_>>4;for(var b=1;b<=g;++b)P(a);_&=15}s=32767+m[v],P(i[(_<<4)+f[s]]),P(p[s]),v++}return 63!=h&&P(o),r}function F(e){if(e<=0&&(e=1),e>100&&(e=100),o!=e){(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],r=0;r<64;r++){var n=a((t[r]*e+50)/100);n<1?n=1:n>255&&(n=255),u[T[r]]=n}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],s=0;s<64;s++){var o=a((i[s]*e+50)/100);o<1?o=1:o>255&&(o=255),l[T[s]]=o}for(var p=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],f=0,d=0;d<8;d++)for(var m=0;m<8;m++)c[f]=1/(u[T[f]]*p[d]*p[m]*8),h[f]=1/(l[T[f]]*p[d]*p[m]*8),f++})(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),o=e}}this.encode=function(t,o){(new Date).getTime();o&&F(o),g=new Array,v=0,y=7,N(65496),N(65504),N(16),B(74),B(70),B(73),B(70),B(0),B(1),B(1),B(0),N(1),N(1),B(0),B(0),function(){N(65499),N(132),B(0);for(var e=0;e<64;e++)B(u[e]);B(1);for(var t=0;t<64;t++)B(l[t])}(),function(e,t){N(65472),N(17),B(8),N(t),N(e),B(3),B(1),B(17),B(0),B(2),B(17),B(1),B(3),B(17),B(1)}(t.width,t.height),function(){N(65476),N(418),B(0);for(var e=0;e<16;e++)B(A[e+1]);for(var t=0;t<=11;t++)B(S[t]);B(16);for(var r=0;r<16;r++)B(k[r+1]);for(var n=0;n<=161;n++)B(C[n]);B(1);for(var i=0;i<16;i++)B(I[i+1]);for(var s=0;s<=11;s++)B(R[s]);B(17);for(var o=0;o<16;o++)B(L[o+1]);for(var a=0;a<=161;a++)B(O[a])}(),N(65498),N(12),B(3),B(1),B(0),B(2),B(17),B(3),B(17),B(0),B(63),B(0);var a=0,p=0,f=0;v=0,y=7,this.encode.displayName="_encode_";for(var d,m,w,T,M,j,U,$,V,G=t.data,z=t.width,W=t.height,H=4*z,K=0;K<W;){for(d=0;d<H;){for(j=M=H*K+d,U=-1,$=0,V=0;V<64;V++)j=M+($=V>>3)*H+(U=4*(7&V)),K+$>=W&&(j-=H*(K+1+$-W)),d+U>=H&&(j-=d+U-H+4),m=G[j++],w=G[j++],T=G[j++],_[V]=(E[m]+E[w+256>>0]+E[T+512>>0]>>16)-128,b[V]=(E[m+768>>0]+E[w+1024>>0]+E[T+1280>>0]>>16)-128,x[V]=(E[m+1280>>0]+E[w+1536>>0]+E[T+1792>>0]>>16)-128;a=D(_,c,a,r,i),p=D(b,h,p,n,s),f=D(x,h,f,n,s),d+=32}K+=8}if(y>=0){var q=[];q[1]=y+1,q[0]=(1<<y+1)-1,P(q)}return N(65497),new e(g)},function(){(new Date).getTime();t||(t=50),function(){for(var e=String.fromCharCode,t=0;t<256;t++)w[t]=e(t)}(),r=M(A,S),n=M(I,R),i=M(k,C),s=M(L,O),function(){for(var e=1,t=2,r=1;r<=15;r++){for(var n=e;n<t;n++)f[32767+n]=r,p[32767+n]=[],p[32767+n][1]=r,p[32767+n][0]=n;for(var i=-(t-1);i<=-e;i++)f[32767+i]=r,p[32767+i]=[],p[32767+i][1]=r,p[32767+i][0]=t-1+i;e<<=1,t<<=1}}(),function(){for(var e=0;e<256;e++)E[e]=19595*e,E[e+256>>0]=38470*e,E[e+512>>0]=7471*e+32768,E[e+768>>0]=-11059*e,E[e+1024>>0]=-21709*e,E[e+1280>>0]=32768*e+8421375,E[e+1536>>0]=-27439*e,E[e+1792>>0]=-5329*e}(),F(t),(new Date).getTime()}()}t.exports=function(e,t){void 0===t&&(t=50);return{data:new r(t).encode(e,t),width:e.width,height:e.height}}}).call(this,e("buffer").Buffer)},{buffer:299}],326:[function(e,t,r){(function(r){"use strict";const n=e("exec-buffer"),i=e("is-jpg"),s=e("jpegtran-bin");t.exports=(e=>t=>{if(e={...e},!r.isBuffer(t))return Promise.reject(new TypeError("Expected a buffer"));if(!i(t))return Promise.resolve(t);const o=["-copy","none"];return e.progressive&&o.push("-progressive"),e.arithmetic?o.push("-arithmetic"):o.push("-optimize"),o.push("-outfile",n.output,n.input),n({input:t,bin:s,args:o}).catch(e=>{throw e.message=e.stderr||e.message,e})})}).call(this,{isBuffer:e("../is-buffer/index.js")})},{"../is-buffer/index.js":361,"exec-buffer":57,"is-jpg":364,"jpegtran-bin":327}],327:[function(e,t,r){"use strict";t.exports=e("./lib").path()},{"./lib":328}],328:[function(e,t,r){(function(r,n){"use strict";const i=e("path"),s=e("bin-wrapper"),o=`https://raw.githubusercontent.com/imagemin/jpegtran-bin/v${e("../package.json").version}/vendor/`;t.exports=(new s).src(`${o}macos/jpegtran`,"darwin").src(`${o}linux/x86/jpegtran`,"linux","x86").src(`${o}linux/x64/jpegtran`,"linux","x64").src(`${o}freebsd/x86/jpegtran`,"freebsd","x86").src(`${o}freebsd/x64/jpegtran`,"freebsd","x64").src(`${o}sunos/x86/jpegtran`,"sunos","x86").src(`${o}sunos/x64/jpegtran`,"sunos","x64").src(`${o}win/x86/jpegtran.exe`,"win32","x86").src(`${o}win/x64/jpegtran.exe`,"win32","x64").src(`${o}win/x86/libjpeg-62.dll`,"win32","x86").src(`${o}win/x64/libjpeg-62.dll`,"win32","x64").dest(i.join(n,"../vendor")).use("win32"===r.platform?"jpegtran.exe":"jpegtran")}).call(this,e("_process"),"/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin/lib")},{"../package.json":329,_process:437,"bin-wrapper":29,path:404}],329:[function(e,t,r){t.exports={name:"jpegtran-bin",version:"5.0.2",description:"jpegtran (part of libjpeg-turbo) bin-wrapper that makes it seamlessly available as a local dependency",license:"MIT",repository:"imagemin/jpegtran-bin",author:{name:"Sindre Sorhus",email:"sindresorhus@gmail.com",url:"sindresorhus.com"},maintainers:[{name:"Kevin Mårtensson",email:"kevinmartensson@gmail.com",url:"github.com/kevva"},{name:"Shinnosuke Watanabe",url:"github.com/shinnn"}],bin:{jpegtran:"cli.js"},engines:{node:">=10"},scripts:{postinstall:"node lib/install.js",test:"xo && ava --timeout=120s"},files:["index.js","cli.js","lib","test","vendor/source"],keywords:["imagemin","compress","image","img","jpeg","jpg","minify","optimize","jpegtran"],dependencies:{"bin-build":"^3.0.0","bin-wrapper":"^4.0.0",logalot:"^2.0.0"},devDependencies:{ava:"^3.8.0","bin-check":"^4.0.1","compare-size":"^3.0.0",execa:"^4.0.0",tempy:"^0.5.0",xo:"^0.30.0"}}},{}],330:[function(e,t,r){(function(r){"use strict";const n=e("execa"),i=e("is-png"),s=e("is-stream"),o=e("pngquant-bin"),a=e("ow"),u=(e={})=>t=>{const u=r.isBuffer(t);if(!u&&!s(t))return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof t}`));if(u&&!i(t))return Promise.resolve(t);const l=["-"];if(void 0!==e.speed&&(a(e.speed,a.number.integer.inRange(1,11)),l.push("--speed",e.speed)),void 0!==e.strip&&(a(e.strip,a.boolean),e.strip&&l.push("--strip")),void 0!==e.quality){a(e.quality,a.array.length(2).ofType(a.number.inRange(0,1)));const[t,r]=e.quality;l.push("--quality",`${Math.round(100*t)}-${Math.round(100*r)}`)}void 0!==e.dithering&&(a(e.dithering,a.any(a.number.inRange(0,1),a.boolean.false)),"number"==typeof e.dithering?l.push(`--floyd=${e.dithering}`):!1===e.dithering&&l.push("--ordered")),void 0!==e.posterize&&(a(e.posterize,a.number),l.push("--posterize",e.posterize)),void 0!==e.verbose&&(a(e.verbose,a.boolean),l.push("--verbose"));const c=n(o,l,{encoding:null,maxBuffer:1/0,input:t}),h=c.then(e=>e.stdout).catch(e=>{if(99===e.exitCode)return t;throw e.message=e.stderr||e.message,e});return c.stdout.then=h.then.bind(h),c.stdout.catch=h.catch.bind(h),c.stdout};t.exports=u,t.exports.default=u}).call(this,{isBuffer:e("../is-buffer/index.js")})},{"../is-buffer/index.js":361,execa:337,"is-png":365,"is-stream":346,ow:401,"pngquant-bin":434}],331:[function(e,t,r){"use strict";const n=e("child_process"),i=e("./lib/parse"),s=e("./lib/enoent");function o(e,t,r){const o=i(e,t,r),a=n.spawn(o.command,o.args,o.options);return s.hookChildProcess(a,o),a}t.exports=o,t.exports.spawn=o,t.exports.sync=function(e,t,r){const o=i(e,t,r),a=n.spawnSync(o.command,o.args,o.options);return a.error=a.error||s.verifyENOENTSync(a.status,o),a},t.exports._parse=i,t.exports._enoent=s},{"./lib/enoent":332,"./lib/parse":333,child_process:298}],332:[function(e,t,r){(function(e){"use strict";const r="win32"===e.platform;function n(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){return r&&1===e&&!t.file?n(t.original,"spawn"):null}t.exports={hookChildProcess:function(e,t){if(!r)return;const n=e.emit;e.emit=function(r,s){if("exit"===r){const r=i(s,t);if(r)return n.call(e,"error",r)}return n.apply(e,arguments)}},verifyENOENT:i,verifyENOENTSync:function(e,t){return r&&1===e&&!t.file?n(t.original,"spawnSync"):null},notFoundError:n}}).call(this,e("_process"))},{_process:437}],333:[function(e,t,r){(function(r){"use strict";const n=e("path"),i=e("./util/resolveCommand"),s=e("./util/escape"),o=e("./util/readShebang"),a="win32"===r.platform,u=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function c(e){if(!a)return e;const t=function(e){e.file=i(e);const t=e.file&&o(e.file);return t?(e.args.unshift(e.file),e.command=t,i(e)):e.file}(e),c=!u.test(t);if(e.options.forceShell||c){const i=l.test(t);e.command=n.normalize(e.command),e.command=s.command(e.command),e.args=e.args.map(e=>s.argument(e,i));const o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=r.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}t.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);const n={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?n:c(n)}}).call(this,e("_process"))},{"./util/escape":334,"./util/readShebang":335,"./util/resolveCommand":336,_process:437,path:404}],334:[function(e,t,r){"use strict";const n=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(e){return e=e.replace(n,"^$1")},t.exports.argument=function(e,t){return e=(e=`"${e=(e=(e=`${e}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(n,"^$1"),t&&(e=e.replace(n,"^$1")),e}},{}],335:[function(e,t,r){(function(r){"use strict";const n=e("fs"),i=e("shebang-command");t.exports=function(e){const t=r.alloc(150);let s;try{s=n.openSync(e,"r"),n.readSync(s,t,0,150,0),n.closeSync(s)}catch(e){}return i(t.toString())}}).call(this,e("buffer").Buffer)},{buffer:299,fs:298,"shebang-command":349}],336:[function(e,t,r){(function(r){"use strict";const n=e("path"),i=e("which"),s=e("path-key");function o(e,t){const o=e.options.env||r.env,a=r.cwd(),u=null!=e.options.cwd,l=u&&void 0!==r.chdir&&!r.chdir.disabled;if(l)try{r.chdir(e.options.cwd)}catch(e){}let c;try{c=i.sync(e.command,{path:o[s({env:o})],pathExt:t?n.delimiter:void 0})}catch(e){}finally{l&&r.chdir(a)}return c&&(c=n.resolve(u?e.options.cwd:"",c)),c}t.exports=function(e){return o(e)||o(e,!0)}}).call(this,e("_process"))},{_process:437,path:404,"path-key":348,which:351}],337:[function(e,t,r){(function(r,n){"use strict";const i=e("path"),s=e("child_process"),o=e("cross-spawn"),a=e("strip-final-newline"),u=e("npm-run-path"),l=e("onetime"),c=e("./lib/error"),h=e("./lib/stdio"),{spawnedKill:p,spawnedCancel:f,setupTimeout:d,setExitHandler:m}=e("./lib/kill"),{handleInput:g,getSpawnedResult:v,makeAllStream:y,validateInputSync:_}=e("./lib/stream.js"),{mergePromise:b,getSpawnedPromise:x}=e("./lib/promise.js"),{joinCommand:w,parseCommand:E}=e("./lib/command.js"),T=(e,t,r={})=>{const s=o._parse(e,t,r);return e=s.command,t=s.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=s.options).cwd||n.cwd(),execPath:n.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r}).env=(({env:e,extendEnv:t,preferLocal:r,localDir:i,execPath:s})=>{const o=t?{...n.env,...e}:e;return r?u.env({env:o,cwd:i,execPath:s}):o})(r),r.stdio=h(r),"win32"===n.platform&&"cmd"===i.basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:s}},A=(e,t,n)=>"string"==typeof t||r.isBuffer(t)?e.stripFinalNewline?a(t):t:void 0===n?void 0:"",S=(e,t,r)=>{const n=T(e,t,r),i=w(e,t);let a;try{a=s.spawn(n.file,n.args,n.options)}catch(e){const t=new s.ChildProcess,r=Promise.reject(c({error:e,stdout:"",stderr:"",all:"",command:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return b(t,r)}const u=x(a),h=d(a,n.options,u),_=m(a,n.options,h),E={isCanceled:!1};a.kill=p.bind(null,a.kill.bind(a)),a.cancel=f.bind(null,a,E);const S=l(async()=>{const[{error:e,exitCode:t,signal:r,timedOut:s},o,u,l]=await v(a,n.options,_),h=A(n.options,o),p=A(n.options,u),f=A(n.options,l);if(e||0!==t||null!==r){const o=c({error:e,exitCode:t,signal:r,stdout:h,stderr:p,all:f,command:i,parsed:n,timedOut:s,isCanceled:E.isCanceled,killed:a.killed});if(!n.options.reject)return o;throw o}return{command:i,exitCode:0,stdout:h,stderr:p,all:f,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return o._enoent.hookChildProcess(a,n.parsed),g(a,n.options.input),a.all=y(a,n.options),b(a,S)};t.exports=S,t.exports.sync=((e,t,r)=>{const n=T(e,t,r),i=w(e,t);let o;_(n.options);try{o=s.spawnSync(n.file,n.args,n.options)}catch(e){throw c({error:e,stdout:"",stderr:"",all:"",command:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}const a=A(n.options,o.stdout,o.error),u=A(n.options,o.stderr,o.error);if(o.error||0!==o.status||null!==o.signal){const e=c({stdout:a,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,parsed:n,timedOut:o.error&&"ETIMEDOUT"===o.error.code,isCanceled:!1,killed:null!==o.signal});if(!n.options.reject)return e;throw e}return{command:i,exitCode:0,stdout:a,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}),t.exports.command=((e,t)=>{const[r,...n]=E(e);return S(r,n,t)}),t.exports.commandSync=((e,t)=>{const[r,...n]=E(e);return S.sync(r,n,t)}),t.exports.node=((e,t,r={})=>{t&&!Array.isArray(t)&&"object"==typeof t&&(r=t,t=[]);const i=h.node(r),s=n.execArgv.filter(e=>!e.startsWith("--inspect")),{nodePath:o=n.execPath,nodeOptions:a=s}=r;return S(o,[...a,e,...Array.isArray(t)?t:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:i,shell:!1})})}).call(this,{isBuffer:e("../../../is-buffer/index.js")},e("_process"))},{"../../../is-buffer/index.js":361,"./lib/command.js":338,"./lib/error":339,"./lib/kill":340,"./lib/promise.js":341,"./lib/stdio":342,"./lib/stream.js":343,_process:437,child_process:298,"cross-spawn":331,"npm-run-path":347,onetime:400,path:404,"strip-final-newline":510}],338:[function(e,t,r){"use strict";const n=/ +/g;t.exports={joinCommand:(e,t=[])=>Array.isArray(t)?[e,...t].join(" "):e,parseCommand:e=>{const t=[];for(const r of e.trim().split(n)){const e=t[t.length-1];e&&e.endsWith("\\")?t[t.length-1]=`${e.slice(0,-1)} ${r}`:t.push(r)}return t}}},{}],339:[function(e,t,r){"use strict";const{signalsByName:n}=e("human-signals");t.exports=(({stdout:e,stderr:t,all:r,error:i,signal:s,exitCode:o,command:a,timedOut:u,isCanceled:l,killed:c,parsed:{options:{timeout:h}}})=>{o=null===o?void 0:o;const p=void 0===(s=null===s?void 0:s)?void 0:n[s].description,f=`Command ${(({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:i,exitCode:s,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":void 0!==r?`failed with ${r}`:void 0!==n?`was killed with ${n} (${i})`:void 0!==s?`failed with exit code ${s}`:"failed")({timedOut:u,timeout:h,errorCode:i&&i.code,signal:s,signalDescription:p,exitCode:o,isCanceled:l})}: ${a}`,d="[object Error]"===Object.prototype.toString.call(i),m=d?`${f}\n${i.message}`:f,g=[m,t,e].filter(Boolean).join("\n");return d?(i.originalMessage=i.message,i.message=g):i=new Error(g),i.shortMessage=m,i.command=a,i.exitCode=o,i.signal=s,i.signalDescription=p,i.stdout=e,i.stderr=t,void 0!==r&&(i.all=r),"bufferedData"in i&&delete i.bufferedData,i.failed=!0,i.timedOut=Boolean(u),i.isCanceled=l,i.killed=c&&!u,i})},{"human-signals":314}],340:[function(e,t,r){"use strict";const n=e("os"),i=e("signal-exit"),s=(e,t,r,n)=>{if(!o(t,r,n))return;const i=u(r),s=setTimeout(()=>{e("SIGKILL")},i);s.unref&&s.unref()},o=(e,{forceKillAfterTimeout:t},r)=>a(e)&&!1!==t&&r,a=e=>e===n.constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),u=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e};var l,c;t.exports={spawnedKill:(e,t="SIGTERM",r={})=>{const n=e(t);return s(e,t,r,n),n},spawnedCancel:(e,t)=>{e.kill()&&(t.isCanceled=!0)},setupTimeout:(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(0===t||void 0===t)return n;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);let i;const s=new Promise((n,s)=>{i=setTimeout(()=>{l=r,s=s,e.kill(l),s(Object.assign(new Error("Timed out"),{timedOut:!0,signal:l}))},t)}),o=n.finally(()=>{clearTimeout(i)});return Promise.race([s,o])},setExitHandler:async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;const s=i(()=>{e.kill()});return n.finally(()=>{s()})}}},{os:301,"signal-exit":499}],341:[function(e,t,r){"use strict";const n=(async()=>{})().constructor.prototype,i=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(n,e)]);t.exports={mergePromise:(e,t)=>{for(const[r,n]of i){const i="function"==typeof t?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:i})}return e},getSpawnedPromise:e=>new Promise((t,r)=>{e.on("exit",(e,r)=>{t({exitCode:e,signal:r})}),e.on("error",e=>{r(e)}),e.stdin&&e.stdin.on("error",e=>{r(e)})})}},{}],342:[function(e,t,r){"use strict";const n=["stdin","stdout","stderr"],i=e=>{if(!e)return;const{stdio:t}=e;if(void 0===t)return n.map(t=>e[t]);if((e=>n.some(t=>void 0!==e[t]))(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${n.map(e=>`\`${e}\``).join(", ")}`);if("string"==typeof t)return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const r=Math.max(t.length,n.length);return Array.from({length:r},(e,r)=>t[r])};t.exports=i,t.exports.node=(e=>{const t=i(e);return"ipc"===t?"ipc":void 0===t||"string"==typeof t?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]})},{}],343:[function(e,t,r){"use strict";const n=e("is-stream"),i=e("get-stream"),s=e("merge-stream"),o=async(e,t)=>{if(e){e.destroy();try{return await t}catch(e){return e.bufferedData}}},a=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(e&&r)return t?i(e,{encoding:t,maxBuffer:n}):i.buffer(e,{maxBuffer:n})};t.exports={handleInput:(e,t)=>{void 0!==t&&void 0!==e.stdin&&(n(t)?t.pipe(e.stdin):e.stdin.end(t))},makeAllStream:(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const r=s();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},getSpawnedResult:async({stdout:e,stderr:t,all:r},{encoding:n,buffer:i,maxBuffer:s},u)=>{const l=a(e,{encoding:n,buffer:i,maxBuffer:s}),c=a(t,{encoding:n,buffer:i,maxBuffer:s}),h=a(r,{encoding:n,buffer:i,maxBuffer:2*s});try{return await Promise.all([u,l,c,h])}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},o(e,l),o(t,c),o(r,h)])}},validateInputSync:({input:e})=>{if(n(e))throw new TypeError("The `input` option cannot be a stream in sync mode")}}},{"get-stream":345,"is-stream":346,"merge-stream":380}],344:[function(e,t,r){(function(r){"use strict";const{PassThrough:n}=e("stream");t.exports=(e=>{e={...e};const{array:t}=e;let{encoding:i}=e;const s="buffer"===i;let o=!1;t?o=!(i||s):i=i||"utf8",s&&(i=null);const a=new n({objectMode:o});i&&a.setEncoding(i);let u=0;const l=[];return a.on("data",e=>{l.push(e),o?u=l.length:u+=e.length}),a.getBufferedValue=(()=>t?l:s?r.concat(l,u):l.join("")),a.getBufferedLength=(()=>u),a})}).call(this,e("buffer").Buffer)},{buffer:299,stream:503}],345:[function(e,t,r){"use strict";const{constants:n}=e("buffer"),i=e("pump"),s=e("./buffer-stream");class o extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function a(e,t){if(!e)return Promise.reject(new Error("Expected a stream"));t={maxBuffer:1/0,...t};const{maxBuffer:r}=t;let a;return await new Promise((u,l)=>{const c=e=>{e&&a.getBufferedLength()<=n.MAX_LENGTH&&(e.bufferedData=a.getBufferedValue()),l(e)};(a=i(e,s(t),e=>{e?c(e):u()})).on("data",()=>{a.getBufferedLength()>r&&c(new o)})}),a.getBufferedValue()}t.exports=a,t.exports.default=a,t.exports.buffer=((e,t)=>a(e,{...t,encoding:"buffer"})),t.exports.array=((e,t)=>a(e,{...t,array:!0})),t.exports.MaxBufferError=o},{"./buffer-stream":344,buffer:299,pump:440}],346:[function(e,t,r){"use strict";const n=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;n.writable=(e=>n(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState),n.readable=(e=>n(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState),n.duplex=(e=>n.writable(e)&&n.readable(e)),n.transform=(e=>n.duplex(e)&&"function"==typeof e._transform&&"object"==typeof e._transformState),t.exports=n},{}],347:[function(e,t,r){(function(r){"use strict";const n=e("path"),i=e("path-key"),s=e=>{let t;e={cwd:r.cwd(),path:r.env[i()],execPath:r.execPath,...e};let s=n.resolve(e.cwd);const o=[];for(;t!==s;)o.push(n.join(s,"node_modules/.bin")),t=s,s=n.resolve(s,"..");const a=n.resolve(e.cwd,e.execPath,"..");return o.push(a),o.concat(e.path).join(n.delimiter)};t.exports=s,t.exports.default=s,t.exports.env=(e=>{const n={...(e={env:r.env,...e}).env},s=i({env:n});return e.path=n[s],n[s]=t.exports(e),n})}).call(this,e("_process"))},{_process:437,path:404,"path-key":348}],348:[function(e,t,r){(function(e){"use strict";const r=(t={})=>{const r=t.env||e.env;return"win32"!==(t.platform||e.platform)?"PATH":Object.keys(r).reverse().find(e=>"PATH"===e.toUpperCase())||"Path"};t.exports=r,t.exports.default=r}).call(this,e("_process"))},{_process:437}],349:[function(e,t,r){"use strict";const n=e("shebang-regex");t.exports=((e="")=>{const t=e.match(n);if(!t)return null;const[r,i]=t[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return"env"===s?i:i?`${s} ${i}`:s})},{"shebang-regex":350}],350:[function(e,t,r){"use strict";t.exports=/^#!(.*)/},{}],351:[function(e,t,r){(function(r){const n="win32"===r.platform||"cygwin"===r.env.OSTYPE||"msys"===r.env.OSTYPE,i=e("path"),s=n?";":":",o=e("isexe"),a=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),u=(e,t)=>{const i=t.colon||s,o=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[r.cwd()]:[],...(t.path||r.env.PATH||"").split(i)],a=n?t.pathExt||r.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",u=n?a.split(i):[""];return n&&-1!==e.indexOf(".")&&""!==u[0]&&u.unshift(""),{pathEnv:o,pathExt:u,pathExtExe:a}},l=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});const{pathEnv:n,pathExt:s,pathExtExe:l}=u(e,t),c=[],h=r=>new Promise((s,o)=>{if(r===n.length)return t.all&&c.length?s(c):o(a(e));const u=n[r],l=/^".*"$/.test(u)?u.slice(1,-1):u,h=i.join(l,e),f=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;s(p(f,r,0))}),p=(e,r,n)=>new Promise((i,a)=>{if(n===s.length)return i(h(r+1));const u=s[n];o(e+u,{pathExt:l},(s,o)=>{if(!s&&o){if(!t.all)return i(e+u);c.push(e+u)}return i(p(e,r,n+1))})});return r?h(0).then(e=>r(null,e),r):h(0)};t.exports=l,l.sync=((e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:s}=u(e,t),l=[];for(let a=0;a<r.length;a++){const u=r[a],c=/^".*"$/.test(u)?u.slice(1,-1):u,h=i.join(c,e),p=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;for(let e=0;e<n.length;e++){const r=p+n[e];try{if(o.sync(r,{pathExt:s})){if(!t.all)return r;l.push(r)}}catch(e){}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw a(e)})}).call(this,e("_process"))},{_process:437,isexe:368,path:404}],352:[function(e,t,r){(function(r){"use strict";const{promisify:n}=e("util"),i=e("path"),s=e("graceful-fs"),o=e("file-type"),a=e("globby"),u=e("make-dir"),l=e("p-pipe"),c=e("replace-ext"),h=e("junk"),p=n(s.readFile),f=n(s.writeFile);t.exports=(async(e,{glob:t=!0,...r}={})=>{if(!Array.isArray(e))throw new TypeError(`Expected an \`Array\`, got \`${typeof e}\``);const n=t?await a(e,{onlyFiles:!0}):e;return Promise.all(n.filter(e=>h.not(i.basename(e))).map(async t=>{try{return await(async(e,{destination:t,plugins:r=[]})=>{if(r&&!Array.isArray(r))throw new TypeError("The `plugins` option should be an `Array`");let n=await p(e);n=await(r.length>0?l(...r)(n):n);let s=t?i.join(t,i.basename(e)):void 0;const a={data:n,sourcePath:e,destinationPath:s=o(n)&&"webp"===o(n).ext?c(s,".webp"):s};return s?(await u(i.dirname(a.destinationPath)),await f(a.destinationPath,a.data),a):a})(t,r)}catch(t){throw t.message=`Error occurred when handling file: ${e}\n\n${t.stack}`,t}}))}),t.exports.buffer=(async(e,{plugins:t=[]}={})=>{if(!r.isBuffer(e))throw new TypeError(`Expected a \`Buffer\`, got \`${typeof e}\``);return 0===t.length?e:l(...t)(e)})}).call(this,{isBuffer:e("../is-buffer/index.js")})},{"../is-buffer/index.js":361,"file-type":109,globby:170,"graceful-fs":354,junk:375,"make-dir":378,"p-pipe":403,path:404,"replace-ext":488,util:523}],353:[function(e,t,r){"use strict";t.exports=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:e.__proto__};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}},{}],354:[function(e,t,r){(function(r,n){var i,s,o=e("fs"),a=e("./polyfills.js"),u=e("./legacy-streams.js"),l=e("./clone.js"),c=e("util");"function"==typeof Symbol&&"function"==typeof Symbol.for?(i=Symbol.for("graceful-fs.queue"),s=Symbol.for("graceful-fs.previous")):(i="___graceful-fs.queue",s="___graceful-fs.previous");var h=function(){};if(c.debuglog?h=c.debuglog("gfs4"):/\bgfs4\b/i.test(r.env.NODE_DEBUG||"")&&(h=function(){var e=c.format.apply(c,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!n[i]){var p=[];Object.defineProperty(n,i,{get:function(){return p}}),o.close=function(e){function t(t,r){return e.call(o,t,function(e){e||m(),"function"==typeof r&&r.apply(this,arguments)})}return Object.defineProperty(t,s,{value:e}),t}(o.close),o.closeSync=function(e){function t(t){e.apply(o,arguments),m()}return Object.defineProperty(t,s,{value:e}),t}(o.closeSync),/\bgfs4\b/i.test(r.env.NODE_DEBUG||"")&&r.on("exit",function(){h(n[i]),e("assert").equal(n[i].length,0)})}function f(e){a(e),e.gracefulify=f,e.createReadStream=function(t,r){return new e.ReadStream(t,r)},e.createWriteStream=function(t,r){return new e.WriteStream(t,r)};var t=e.readFile;e.readFile=function(e,r,n){"function"==typeof r&&(n=r,r=null);return function e(r,n,i){return t(r,n,function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?("function"==typeof i&&i.apply(this,arguments),m()):d([e,[r,n,i]])})}(e,r,n)};var n=e.writeFile;e.writeFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,s){return n(t,r,i,function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?("function"==typeof s&&s.apply(this,arguments),m()):d([e,[t,r,i,s]])})}(e,t,r,i)};var i=e.appendFile;i&&(e.appendFile=function(e,t,r,n){"function"==typeof r&&(n=r,r=null);return function e(t,r,n,s){return i(t,r,n,function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?("function"==typeof s&&s.apply(this,arguments),m()):d([e,[t,r,n,s]])})}(e,t,r,n)});var s=e.readdir;function o(t){return s.apply(e,t)}if(e.readdir=function(e,t,r){var n=[e];"function"!=typeof t?n.push(t):r=t;return n.push(function(e,t){t&&t.sort&&t.sort(),!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?("function"==typeof r&&r.apply(this,arguments),m()):d([o,[n]])}),o(n)},"v0.8"===r.version.substr(0,4)){var l=u(e);v=l.ReadStream,y=l.WriteStream}var c=e.ReadStream;c&&(v.prototype=Object.create(c.prototype),v.prototype.open=function(){var e=this;b(e.path,e.flags,e.mode,function(t,r){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r),e.read())})});var h=e.WriteStream;h&&(y.prototype=Object.create(h.prototype),y.prototype.open=function(){var e=this;b(e.path,e.flags,e.mode,function(t,r){t?(e.destroy(),e.emit("error",t)):(e.fd=r,e.emit("open",r))})}),Object.defineProperty(e,"ReadStream",{get:function(){return v},set:function(e){v=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return y},set:function(e){y=e},enumerable:!0,configurable:!0});var p=v;Object.defineProperty(e,"FileReadStream",{get:function(){return p},set:function(e){p=e},enumerable:!0,configurable:!0});var g=y;function v(e,t){return this instanceof v?(c.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function y(e,t){return this instanceof y?(h.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return g},set:function(e){g=e},enumerable:!0,configurable:!0});var _=e.open;function b(e,t,r,n){return"function"==typeof r&&(n=r,r=null),function e(t,r,n,i){return _(t,r,n,function(s,o){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?("function"==typeof i&&i.apply(this,arguments),m()):d([e,[t,r,n,i]])})}(e,t,r,n)}return e.open=b,e}function d(e){h("ENQUEUE",e[0].name,e[1]),n[i].push(e)}function m(){var e=n[i].shift();e&&(h("RETRY",e[0].name,e[1]),e[0].apply(null,e[1]))}t.exports=f(l(o)),r.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!o.__patched&&(t.exports=f(o),o.__patched=!0)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./clone.js":353,"./legacy-streams.js":355,"./polyfills.js":356,_process:437,assert:292,fs:298,util:523}],355:[function(e,t,r){(function(r){var n=e("stream").Stream;t.exports=function(e){return{ReadStream:function t(i,s){if(!(this instanceof t))return new t(i,s);n.call(this);var o=this;this.path=i;this.fd=null;this.readable=!0;this.paused=!1;this.flags="r";this.mode=438;this.bufferSize=65536;s=s||{};var a=Object.keys(s);for(var u=0,l=a.length;u<l;u++){var c=a[u];this[c]=s[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void r.nextTick(function(){o._read()});e.open(this.path,this.flags,this.mode,function(e,t){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=t,o.emit("open",t),o._read()})},WriteStream:function t(r,i){if(!(this instanceof t))return new t(r,i);n.call(this);this.path=r;this.fd=null;this.writable=!0;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var s=Object.keys(i);for(var o=0,a=s.length;o<a;o++){var u=s[o];this[u]=i[u]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1;this._queue=[];null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}}).call(this,e("_process"))},{_process:437,stream:503}],356:[function(e,t,r){(function(r){var n=e("constants"),i=r.cwd,s=null,o=r.env.GRACEFUL_FS_PLATFORM||r.platform;r.cwd=function(){return s||(s=i.call(r)),s};try{r.cwd()}catch(e){}var a=r.chdir;r.chdir=function(e){s=null,a.call(r,e)},t.exports=function(e){n.hasOwnProperty("O_SYMLINK")&&r.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,r,i){e.open(t,n.O_WRONLY|n.O_SYMLINK,r,function(t,n){t?i&&i(t):e.fchmod(n,r,function(t){e.close(n,function(e){i&&i(t||e)})})})},e.lchmodSync=function(t,r){var i,s=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,r),o=!0;try{i=e.fchmodSync(s,r),o=!1}finally{if(o)try{e.closeSync(s)}catch(e){}else e.closeSync(s)}return i}}(e);e.lutimes||function(e){n.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(t,r,i,s){e.open(t,n.O_SYMLINK,function(t,n){t?s&&s(t):e.futimes(n,r,i,function(t){e.close(n,function(e){s&&s(t||e)})})})},e.lutimesSync=function(t,r,i){var s,o=e.openSync(t,n.O_SYMLINK),a=!0;try{s=e.futimesSync(o,r,i),a=!1}finally{if(a)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return s}):(e.lutimes=function(e,t,n,i){i&&r.nextTick(i)},e.lutimesSync=function(){})}(e);e.chown=a(e.chown),e.fchown=a(e.fchown),e.lchown=a(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=s(e.chmodSync),e.fchmodSync=s(e.fchmodSync),e.lchmodSync=s(e.lchmodSync),e.stat=l(e.stat),e.fstat=l(e.fstat),e.lstat=l(e.lstat),e.statSync=c(e.statSync),e.fstatSync=c(e.fstatSync),e.lstatSync=c(e.lstatSync),e.lchmod||(e.lchmod=function(e,t,n){n&&r.nextTick(n)},e.lchmodSync=function(){});e.lchown||(e.lchown=function(e,t,n,i){i&&r.nextTick(i)},e.lchownSync=function(){});"win32"===o&&(e.rename=(t=e.rename,function(r,n,i){var s=Date.now(),o=0;t(r,n,function a(u){if(u&&("EACCES"===u.code||"EPERM"===u.code)&&Date.now()-s<6e4)return setTimeout(function(){e.stat(n,function(e,s){e&&"ENOENT"===e.code?t(r,n,a):i(u)})},o),void(o<100&&(o+=10));i&&i(u)})}));var t;function i(t){return t?function(r,n,i){return t.call(e,r,n,function(e){h(e)&&(e=null),i&&i.apply(this,arguments)})}:t}function s(t){return t?function(r,n){try{return t.call(e,r,n)}catch(e){if(!h(e))throw e}}:t}function a(t){return t?function(r,n,i,s){return t.call(e,r,n,i,function(e){h(e)&&(e=null),s&&s.apply(this,arguments)})}:t}function u(t){return t?function(r,n,i){try{return t.call(e,r,n,i)}catch(e){if(!h(e))throw e}}:t}function l(t){return t?function(r,n,i){function s(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof n&&(i=n,n=null),n?t.call(e,r,n,s):t.call(e,r,s)}:t}function c(t){return t?function(r,n){var i=n?t.call(e,r,n):t.call(e,r);return i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296),i}:t}function h(e){if(!e)return!0;if("ENOSYS"===e.code)return!0;var t=!r.getuid||0!==r.getuid();return!(!t||"EINVAL"!==e.code&&"EPERM"!==e.code)}e.read=function(t){function r(r,n,i,s,o,a){var u;if(a&&"function"==typeof a){var l=0;u=function(c,h,p){if(c&&"EAGAIN"===c.code&&l<10)return l++,t.call(e,r,n,i,s,o,u);a.apply(this,arguments)}}return t.call(e,r,n,i,s,o,u)}return r.__proto__=t,r}(e.read),e.readSync=(p=e.readSync,function(t,r,n,i,s){for(var o=0;;)try{return p.call(e,t,r,n,i,s)}catch(e){if("EAGAIN"===e.code&&o<10){o++;continue}throw e}});var p}}).call(this,e("_process"))},{_process:437,constants:39}],357:[function(e,t,r){"use strict";const n=(e,t,r)=>void 0===e?t(r):e;t.exports=(e=>t=>{let r;return new Proxy(function(){},{get:(i,s)=>(r=n(r,e,t),Reflect.get(r,s)),apply:(i,s,o)=>(r=n(r,e,t),Reflect.apply(r,s,o)),construct:(i,s)=>(r=n(r,e,t),Reflect.construct(r,s))})})},{}],358:[function(e,t,r){(function(r){var n=e("wrappy"),i=Object.create(null),s=e("once");t.exports=n(function(e,t){return i[e]?(i[e].push(t),null):(i[e]=[t],function(e){return s(function t(){var n=i[e],s=n.length,o=function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n]=e[n];return r}(arguments);try{for(var a=0;a<s;a++)n[a].apply(null,o)}finally{n.length>s?(n.splice(0,s),r.nextTick(function(){t.apply(null,o)})):delete i[e]}})}(e))})}).call(this,e("_process"))},{_process:437,once:399,wrappy:531}],359:[function(e,t,r){arguments[4][293][0].apply(r,arguments)},{dup:293}],360:[function(e,t,r){"use strict";t.exports=function(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=r;return t}},{}],361:[function(e,t,r){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],362:[function(e,t,r){t.exports=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}},{}],363:[function(e,t,r){var n=e("is-extglob"),i={"{":"}","(":")","[":"]"},s=/\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/,o=/\\(.)|(^!|[*?{}()[\]]|\(\?)/;t.exports=function(e,t){if("string"!=typeof e||""===e)return!1;if(n(e))return!0;var r,a=s;for(t&&!1===t.strict&&(a=o);r=a.exec(e);){if(r[2])return!0;var u=r.index+r[0].length,l=r[1],c=l?i[l]:null;if(l&&c){var h=e.indexOf(c,u);-1!==h&&(u=h+1)}e=e.slice(u)}return!1}},{"is-extglob":362}],364:[function(e,t,r){"use strict";t.exports=(e=>!(!e||e.length<3)&&(255===e[0]&&216===e[1]&&255===e[2]))},{}],365:[function(e,t,r){"use strict";t.exports=(e=>!(!e||e.length<8)&&(137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]&&13===e[4]&&10===e[5]&&26===e[6]&&10===e[7]))},{}],366:[function(e,t,r){"use strict";var n=t.exports=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe};n.writable=function(e){return n(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState},n.readable=function(e){return n(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState},n.duplex=function(e){return n.writable(e)&&n.readable(e)},n.transform=function(e){return n.duplex(e)&&"function"==typeof e._transform&&"object"==typeof e._transformState}},{}],367:[function(e,t,r){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],368:[function(e,t,r){(function(r,n){var i;e("fs");function s(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise(function(r,n){s(e,t||{},function(e,t){e?n(e):r(t)})})}i(e,t||{},function(e,n){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,n=!1),r(e,n)})}i="win32"===r.platform||n.TESTING_WINDOWS?e("./windows.js"):e("./mode.js"),t.exports=s,s.sync=function(e,t){try{return i.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./mode.js":369,"./windows.js":370,_process:437,fs:298}],369:[function(e,t,r){(function(r){t.exports=i,i.sync=function(e,t){return s(n.statSync(e),t)};var n=e("fs");function i(e,t,r){n.stat(e,function(e,n){r(e,!e&&s(n,t))})}function s(e,t){return e.isFile()&&function(e,t){var n=e.mode,i=e.uid,s=e.gid,o=void 0!==t.uid?t.uid:r.getuid&&r.getuid(),a=void 0!==t.gid?t.gid:r.getgid&&r.getgid(),u=parseInt("100",8),l=parseInt("010",8),c=parseInt("001",8);return n&c||n&l&&s===a||n&u&&i===o||n&(u|l)&&0===o}(e,t)}}).call(this,e("_process"))},{_process:437,fs:298}],370:[function(e,t,r){(function(r){t.exports=s,s.sync=function(e,t){return i(n.statSync(e),e,t)};var n=e("fs");function i(e,t,n){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var n=void 0!==t.pathExt?t.pathExt:r.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var i=0;i<n.length;i++){var s=n[i].toLowerCase();if(s&&e.substr(-s.length).toLowerCase()===s)return!0}return!1}(t,n)}function s(e,t,r){n.stat(e,function(n,s){r(n,!n&&i(s,e,t))})}}).call(this,e("_process"))},{_process:437,fs:298}],371:[function(e,t,r){arguments[4][323][0].apply(r,arguments)},{"./lib/decoder":372,"./lib/encoder":373,dup:323}],372:[function(e,t,r){(function(e){var r=function(){"use strict";var e=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]),t=4017,r=799,n=3406,i=2276,s=1567,o=3784,a=5793,u=2896;function l(){}function c(e,t){for(var r,n,i=0,s=[],o=16;o>0&&!e[o-1];)o--;s.push({children:[],index:0});var a,u=s[0];for(r=0;r<o;r++){for(n=0;n<e[r];n++){for((u=s.pop()).children[u.index]=t[i];u.index>0;){if(0===s.length)throw new Error("Could not recreate Huffman Table");u=s.pop()}for(u.index++,s.push(u);s.length<=r;)s.push(a={children:[],index:0}),u.children[u.index]=a.children,u=a;i++}r+1<o&&(s.push(a={children:[],index:0}),u.children[u.index]=a.children,u=a)}return s[0].children}function h(t,r,n,i,s,o,a,u,l,c){n.precision,n.samplesPerLine,n.scanLines;var h=n.mcusPerLine,p=n.progressive,f=(n.maxH,n.maxV,r),d=0,m=0;function g(){if(m>0)return d>>--m&1;if(255==(d=t[r++])){var e=t[r++];if(e)throw new Error("unexpected marker: "+(d<<8|e).toString(16))}return m=7,d>>>7}function v(e){for(var t,r=e;null!==(t=g());){if("number"==typeof(r=r[t]))return r;if("object"!=typeof r)throw new Error("invalid huffman sequence")}return null}function y(e){for(var t=0;e>0;){var r=g();if(null===r)return;t=t<<1|r,e--}return t}function _(e){var t=y(e);return t>=1<<e-1?t:t+(-1<<e)+1}var b=0;var x,w=0;function E(e,t,r,n,i){var s=r%h,o=(r/h|0)*e.v+n,a=s*e.h+i;void 0===e.blocks[o]&&c.tolerantDecoding||t(e,e.blocks[o][a])}function T(e,t,r){var n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;void 0===e.blocks[n]&&c.tolerantDecoding||t(e,e.blocks[n][i])}var A,S,k,C,I,R,L=i.length;R=p?0===o?0===u?function(e,t){var r=v(e.huffmanTableDC),n=0===r?0:_(r)<<l;t[0]=e.pred+=n}:function(e,t){t[0]|=g()<<l}:0===u?function(t,r){if(b>0)b--;else for(var n=o,i=a;n<=i;){var s=v(t.huffmanTableAC),u=15&s,c=s>>4;if(0!==u)r[e[n+=c]]=_(u)*(1<<l),n++;else{if(c<15){b=y(c)+(1<<c)-1;break}n+=16}}}:function(t,r){for(var n=o,i=a,s=0;n<=i;){var u=e[n],c=r[u]<0?-1:1;switch(w){case 0:var h=v(t.huffmanTableAC),p=15&h;if(s=h>>4,0===p)s<15?(b=y(s)+(1<<s),w=4):(s=16,w=1);else{if(1!==p)throw new Error("invalid ACn encoding");x=_(p),w=s?2:3}continue;case 1:case 2:r[u]?r[u]+=(g()<<l)*c:0==--s&&(w=2==w?3:0);break;case 3:r[u]?r[u]+=(g()<<l)*c:(r[u]=x<<l,w=0);break;case 4:r[u]&&(r[u]+=(g()<<l)*c)}n++}4===w&&0==--b&&(w=0)}:function(t,r){var n=v(t.huffmanTableDC),i=0===n?0:_(n);r[0]=t.pred+=i;for(var s=1;s<64;){var o=v(t.huffmanTableAC),a=15&o,u=o>>4;if(0!==a)r[e[s+=u]]=_(a),s++;else{if(u<15)break;s+=16}}};var O,M,P,B,N=0;for(M=1==L?i[0].blocksPerLine*i[0].blocksPerColumn:h*n.mcusPerColumn,s||(s=M);N<M;){for(S=0;S<L;S++)i[S].pred=0;if(b=0,1==L)for(A=i[0],I=0;I<s;I++)T(A,R,N),N++;else for(I=0;I<s;I++){for(S=0;S<L;S++)for(P=(A=i[S]).h,B=A.v,k=0;k<B;k++)for(C=0;C<P;C++)E(A,R,N,k,C);if(++N===M)break}if(N===M)do{if(255===t[r]&&0!==t[r+1])break;r+=1}while(r<t.length-2);if(m=0,(O=t[r]<<8|t[r+1])<65280)throw new Error("marker was not found");if(!(O>=65488&&O<=65495))break;r+=2}return r-f}function p(e,l){var c,h,p=[],f=l.blocksPerLine,d=l.blocksPerColumn,m=f<<3,v=new Int32Array(64),y=new Uint8Array(64);function _(e,c,h){var p,f,d,m,g,v,y,_,b,x,w=l.quantizationTable,E=h;for(x=0;x<64;x++)E[x]=e[x]*w[x];for(x=0;x<8;++x){var T=8*x;0!=E[1+T]||0!=E[2+T]||0!=E[3+T]||0!=E[4+T]||0!=E[5+T]||0!=E[6+T]||0!=E[7+T]?(p=a*E[0+T]+128>>8,f=a*E[4+T]+128>>8,d=E[2+T],m=E[6+T],g=u*(E[1+T]-E[7+T])+128>>8,_=u*(E[1+T]+E[7+T])+128>>8,v=E[3+T]<<4,y=E[5+T]<<4,b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*o+m*s+128>>8,d=d*s-m*o+128>>8,m=b,b=g-y+1>>1,g=g+y+1>>1,y=b,b=_+v+1>>1,v=_-v+1>>1,_=b,b=p-m+1>>1,p=p+m+1>>1,m=b,b=f-d+1>>1,f=f+d+1>>1,d=b,b=g*i+_*n+2048>>12,g=g*n-_*i+2048>>12,_=b,b=v*r+y*t+2048>>12,v=v*t-y*r+2048>>12,y=b,E[0+T]=p+_,E[7+T]=p-_,E[1+T]=f+y,E[6+T]=f-y,E[2+T]=d+v,E[5+T]=d-v,E[3+T]=m+g,E[4+T]=m-g):(b=a*E[0+T]+512>>10,E[0+T]=b,E[1+T]=b,E[2+T]=b,E[3+T]=b,E[4+T]=b,E[5+T]=b,E[6+T]=b,E[7+T]=b)}for(x=0;x<8;++x){var A=x;0!=E[8+A]||0!=E[16+A]||0!=E[24+A]||0!=E[32+A]||0!=E[40+A]||0!=E[48+A]||0!=E[56+A]?(p=a*E[0+A]+2048>>12,f=a*E[32+A]+2048>>12,d=E[16+A],m=E[48+A],g=u*(E[8+A]-E[56+A])+2048>>12,_=u*(E[8+A]+E[56+A])+2048>>12,v=E[24+A],y=E[40+A],b=p-f+1>>1,p=p+f+1>>1,f=b,b=d*o+m*s+2048>>12,d=d*s-m*o+2048>>12,m=b,b=g-y+1>>1,g=g+y+1>>1,y=b,b=_+v+1>>1,v=_-v+1>>1,_=b,b=p-m+1>>1,p=p+m+1>>1,m=b,b=f-d+1>>1,f=f+d+1>>1,d=b,b=g*i+_*n+2048>>12,g=g*n-_*i+2048>>12,_=b,b=v*r+y*t+2048>>12,v=v*t-y*r+2048>>12,y=b,E[0+A]=p+_,E[56+A]=p-_,E[8+A]=f+y,E[48+A]=f-y,E[16+A]=d+v,E[40+A]=d-v,E[24+A]=m+g,E[32+A]=m-g):(b=a*h[x+0]+8192>>14,E[0+A]=b,E[8+A]=b,E[16+A]=b,E[24+A]=b,E[32+A]=b,E[40+A]=b,E[48+A]=b,E[56+A]=b)}for(x=0;x<64;++x){var S=128+(E[x]+8>>4);c[x]=S<0?0:S>255?255:S}}g(m*d*8);for(var b=0;b<d;b++){var x=b<<3;for(c=0;c<8;c++)p.push(new Uint8Array(m));for(var w=0;w<f;w++){_(l.blocks[b][w],y,v);var E=0,T=w<<3;for(h=0;h<8;h++){var A=p[x+h];for(c=0;c<8;c++)A[T+c]=y[E++]}}}return p}function f(e){return e<0?0:e>255?255:e}l.prototype={load:function(e){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="arraybuffer",t.onload=function(){var e=new Uint8Array(t.response||t.mozResponseArrayBuffer);this.parse(e),this.onload&&this.onload()}.bind(this),t.send(null)},parse:function(t){var r=1e3*this.opts.maxResolutionInMP*1e3,n=0;t.length;function i(){var e=t[n]<<8|t[n+1];return n+=2,e}function s(){var e=i(),r=t.subarray(n,n+e-2);return n+=r.length,r}function o(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i<t.v&&(i=t.v));var s=Math.ceil(e.samplesPerLine/8/n),o=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];var a=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),u=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),l=s*t.h,c=o*t.v,h=[];g(256*(c*l));for(var p=0;p<c;p++){for(var f=[],d=0;d<l;d++)f.push(new Int32Array(64));h.push(f)}t.blocksPerLine=a,t.blocksPerColumn=u,t.blocks=h}e.maxH=n,e.maxV=i,e.mcusPerLine=s,e.mcusPerColumn=o}var a,u,l=null,f=null,d=[],m=[],v=[],y=[],_=i(),b=-1;if(this.comments=[],65496!=_)throw new Error("SOI not found");for(_=i();65497!=_;){switch(_){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:var x=s();if(65534===_){var w=String.fromCharCode.apply(null,x);this.comments.push(w)}65504===_&&74===x[0]&&70===x[1]&&73===x[2]&&70===x[3]&&0===x[4]&&(l={version:{major:x[5],minor:x[6]},densityUnits:x[7],xDensity:x[8]<<8|x[9],yDensity:x[10]<<8|x[11],thumbWidth:x[12],thumbHeight:x[13],thumbData:x.subarray(14,14+3*x[12]*x[13])}),65505===_&&69===x[0]&&120===x[1]&&105===x[2]&&102===x[3]&&0===x[4]&&(this.exifBuffer=x.subarray(5,x.length)),65518===_&&65===x[0]&&100===x[1]&&111===x[2]&&98===x[3]&&101===x[4]&&0===x[5]&&(f={version:x[6],flags0:x[7]<<8|x[8],flags1:x[9]<<8|x[10],transformCode:x[11]});break;case 65499:for(var E=i()+n-2;n<E;){var T=t[n++];g(256);var A=new Int32Array(64);if(T>>4==0)for(K=0;K<64;K++){A[e[K]]=t[n++]}else{if(T>>4!=1)throw new Error("DQT: invalid table spec");for(K=0;K<64;K++){A[e[K]]=i()}}d[15&T]=A}break;case 65472:case 65473:case 65474:i(),(a={}).extended=65473===_,a.progressive=65474===_,a.precision=t[n++],a.scanLines=i(),a.samplesPerLine=i(),a.components={},a.componentsOrder=[];var S=a.scanLines*a.samplesPerLine;if(S>r){var k=Math.ceil((S-r)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${k}MP`)}var C,I=t[n++];for(W=0;W<I;W++){C=t[n];var R=t[n+1]>>4,L=15&t[n+1],O=t[n+2];a.componentsOrder.push(C),a.components[C]={h:R,v:L,quantizationIdx:O},n+=3}o(a),m.push(a);break;case 65476:var M=i();for(W=2;W<M;){var P=t[n++],B=new Uint8Array(16),N=0;for(K=0;K<16;K++,n++)N+=B[K]=t[n];g(16+N);var D=new Uint8Array(N);for(K=0;K<N;K++,n++)D[K]=t[n];W+=17+N,(P>>4==0?y:v)[15&P]=c(B,D)}break;case 65501:i(),u=i();break;case 65500:i(),i();break;case 65498:i();var F=t[n++],j=[];for(W=0;W<F;W++){q=a.components[t[n++]];var U=t[n++];q.huffmanTableDC=y[U>>4],q.huffmanTableAC=v[15&U],j.push(q)}var $=t[n++],V=t[n++],G=t[n++],z=h(t,n,a,j,u,$,V,G>>4,15&G,this.opts);n+=z;break;case 65535:255!==t[n]&&n--;break;default:if(255==t[n-3]&&t[n-2]>=192&&t[n-2]<=254){n-=3;break}if(224===_||225==_){if(-1!==b)throw new Error(`first unknown JPEG marker at offset ${b.toString(16)}, second unknown JPEG marker ${_.toString(16)} at offset ${(n-1).toString(16)}`);b=n-1;const e=i();if(255===t[n+e-2]){n+=e-2;break}}throw new Error("unknown JPEG marker "+_.toString(16))}_=i()}if(1!=m.length)throw new Error("only single frame JPEGs supported");for(var W=0;W<m.length;W++){var H=m[W].components;for(var K in H)H[K].quantizationTable=d[H[K].quantizationIdx],delete H[K].quantizationIdx}this.width=a.samplesPerLine,this.height=a.scanLines,this.jfif=l,this.adobe=f,this.components=[];for(W=0;W<a.componentsOrder.length;W++){var q=a.components[a.componentsOrder[W]];this.components.push({lines:p(0,q),scaleX:q.h/a.maxH,scaleY:q.v/a.maxV})}},getData:function(e,t){var r,n,i,s,o,a,u,l,c,h,p,d,m,v,y,_,b,x,w,E,T,A=this.width/e,S=this.height/t,k=0,C=e*t*this.components.length;g(C);var I=new Uint8Array(C);switch(this.components.length){case 1:for(r=this.components[0],h=0;h<t;h++)for(o=r.lines[0|h*r.scaleY*S],c=0;c<e;c++)p=o[0|c*r.scaleX*A],I[k++]=p;break;case 2:for(r=this.components[0],n=this.components[1],h=0;h<t;h++)for(o=r.lines[0|h*r.scaleY*S],a=n.lines[0|h*n.scaleY*S],c=0;c<e;c++)p=o[0|c*r.scaleX*A],I[k++]=p,p=a[0|c*n.scaleX*A],I[k++]=p;break;case 3:for(T=!0,this.adobe&&this.adobe.transformCode?T=!0:void 0!==this.opts.colorTransform&&(T=!!this.opts.colorTransform),r=this.components[0],n=this.components[1],i=this.components[2],h=0;h<t;h++)for(o=r.lines[0|h*r.scaleY*S],a=n.lines[0|h*n.scaleY*S],u=i.lines[0|h*i.scaleY*S],c=0;c<e;c++)T?(p=o[0|c*r.scaleX*A],d=a[0|c*n.scaleX*A],x=f(p+1.402*((m=u[0|c*i.scaleX*A])-128)),w=f(p-.3441363*(d-128)-.71413636*(m-128)),E=f(p+1.772*(d-128))):(x=o[0|c*r.scaleX*A],w=a[0|c*n.scaleX*A],E=u[0|c*i.scaleX*A]),I[k++]=x,I[k++]=w,I[k++]=E;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(T=!1,this.adobe&&this.adobe.transformCode?T=!0:void 0!==this.opts.colorTransform&&(T=!!this.opts.colorTransform),r=this.components[0],n=this.components[1],i=this.components[2],s=this.components[3],h=0;h<t;h++)for(o=r.lines[0|h*r.scaleY*S],a=n.lines[0|h*n.scaleY*S],u=i.lines[0|h*i.scaleY*S],l=s.lines[0|h*s.scaleY*S],c=0;c<e;c++)T?(p=o[0|c*r.scaleX*A],d=a[0|c*n.scaleX*A],m=u[0|c*i.scaleX*A],v=l[0|c*s.scaleX*A],y=255-f(p+1.402*(m-128)),_=255-f(p-.3441363*(d-128)-.71413636*(m-128)),b=255-f(p+1.772*(d-128))):(y=o[0|c*r.scaleX*A],_=a[0|c*n.scaleX*A],b=u[0|c*i.scaleX*A],v=l[0|c*s.scaleX*A]),I[k++]=255-y,I[k++]=255-_,I[k++]=255-b,I[k++]=255-v;break;default:throw new Error("Unsupported color mode")}return I},copyToImageData:function(e,t){var r,n,i,s,o,a,u,l,c,h=e.width,p=e.height,d=e.data,m=this.getData(h,p),g=0,v=0;switch(this.components.length){case 1:for(n=0;n<p;n++)for(r=0;r<h;r++)i=m[g++],d[v++]=i,d[v++]=i,d[v++]=i,t&&(d[v++]=255);break;case 3:for(n=0;n<p;n++)for(r=0;r<h;r++)u=m[g++],l=m[g++],c=m[g++],d[v++]=u,d[v++]=l,d[v++]=c,t&&(d[v++]=255);break;case 4:for(n=0;n<p;n++)for(r=0;r<h;r++)o=m[g++],a=m[g++],i=m[g++],u=255-f(o*(1-(s=m[g++])/255)+s),l=255-f(a*(1-s/255)+s),c=255-f(i*(1-s/255)+s),d[v++]=u,d[v++]=l,d[v++]=c,t&&(d[v++]=255);break;default:throw new Error("Unsupported color mode")}}};var d=0,m=0;function g(e=0){var t=d+e;if(t>m){var r=Math.ceil((t-m)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${r}MB`)}d=t}return l.resetMaxMemoryUsage=function(e){d=0,m=e},l.getBytesAllocated=function(){return d},l.requestMemoryAllocation=g,l}();function n(t,n={}){var i={...{colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512},...n},s=new Uint8Array(t),o=new r;o.opts=i,r.resetMaxMemoryUsage(1024*i.maxMemoryUsageInMB*1024),o.parse(s);var a=i.formatAsRGBA?4:3,u=o.width*o.height*a;try{r.requestMemoryAllocation(u);var l={width:o.width,height:o.height,exifBuffer:o.exifBuffer,data:i.useTArray?new Uint8Array(u):e.alloc(u)};o.comments.length>0&&(l.comments=o.comments)}catch(e){throw e instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+u):e}return o.copyToImageData(l,i.formatAsRGBA),l}void 0!==t?t.exports=n:"undefined"!=typeof window&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].decode=n)}).call(this,e("buffer").Buffer)},{buffer:299}],373:[function(e,t,r){(function(e){function r(r){Math.round;var n,i,s,o,a,u=Math.floor,l=new Array(64),c=new Array(64),h=new Array(64),p=new Array(64),f=new Array(65535),d=new Array(65535),m=new Array(64),g=new Array(64),v=[],y=0,_=7,b=new Array(64),x=new Array(64),w=new Array(64),E=new Array(256),T=new Array(2048),A=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],S=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],k=[0,1,2,3,4,5,6,7,8,9,10,11],C=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],I=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],R=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],L=[0,1,2,3,4,5,6,7,8,9,10,11],O=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],M=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function P(e,t){for(var r=0,n=0,i=new Array,s=1;s<=16;s++){for(var o=1;o<=e[s];o++)i[t[n]]=[],i[t[n]][0]=r,i[t[n]][1]=s,n++,r++;r*=2}return i}function B(e){for(var t=e[0],r=e[1]-1;r>=0;)t&1<<r&&(y|=1<<_),r--,--_<0&&(255==y?(N(255),N(0)):N(y),_=7,y=0)}function N(e){v.push(e)}function D(e){N(e>>8&255),N(255&e)}function F(e,t,r,n,i){for(var s,o=i[0],a=i[240],u=function(e,t){var r,n,i,s,o,a,u,l,c,h,p=0;for(c=0;c<8;++c){r=e[p],n=e[p+1],i=e[p+2],s=e[p+3],o=e[p+4],a=e[p+5],u=e[p+6];var f=r+(l=e[p+7]),d=r-l,g=n+u,v=n-u,y=i+a,_=i-a,b=s+o,x=s-o,w=f+b,E=f-b,T=g+y,A=g-y;e[p]=w+T,e[p+4]=w-T;var S=.707106781*(A+E);e[p+2]=E+S,e[p+6]=E-S;var k=.382683433*((w=x+_)-(A=v+d)),C=.5411961*w+k,I=1.306562965*A+k,R=.707106781*(T=_+v),L=d+R,O=d-R;e[p+5]=O+C,e[p+3]=O-C,e[p+1]=L+I,e[p+7]=L-I,p+=8}for(p=0,c=0;c<8;++c){r=e[p],n=e[p+8],i=e[p+16],s=e[p+24],o=e[p+32],a=e[p+40],u=e[p+48];var M=r+(l=e[p+56]),P=r-l,B=n+u,N=n-u,D=i+a,F=i-a,j=s+o,U=s-o,$=M+j,V=M-j,G=B+D,z=B-D;e[p]=$+G,e[p+32]=$-G;var W=.707106781*(z+V);e[p+16]=V+W,e[p+48]=V-W;var H=.382683433*(($=U+F)-(z=N+P)),K=.5411961*$+H,q=1.306562965*z+H,X=.707106781*(G=F+N),Y=P+X,Z=P-X;e[p+40]=Z+K,e[p+24]=Z-K,e[p+8]=Y+q,e[p+56]=Y-q,p++}for(c=0;c<64;++c)h=e[c]*t[c],m[c]=h>0?h+.5|0:h-.5|0;return m}(e,t),l=0;l<64;++l)g[A[l]]=u[l];var c=g[0]-r;r=g[0],0==c?B(n[0]):(B(n[d[s=32767+c]]),B(f[s]));for(var h=63;h>0&&0==g[h];h--);if(0==h)return B(o),r;for(var p,v=1;v<=h;){for(var y=v;0==g[v]&&v<=h;++v);var _=v-y;if(_>=16){p=_>>4;for(var b=1;b<=p;++b)B(a);_&=15}s=32767+g[v],B(i[(_<<4)+d[s]]),B(f[s]),v++}return 63!=h&&B(o),r}function j(e){if(e<=0&&(e=1),e>100&&(e=100),a!=e){(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],r=0;r<64;r++){var n=u((t[r]*e+50)/100);n<1?n=1:n>255&&(n=255),l[A[r]]=n}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],s=0;s<64;s++){var o=u((i[s]*e+50)/100);o<1?o=1:o>255&&(o=255),c[A[s]]=o}for(var a=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],f=0,d=0;d<8;d++)for(var m=0;m<8;m++)h[f]=1/(l[A[f]]*a[d]*a[m]*8),p[f]=1/(c[A[f]]*a[d]*a[m]*8),f++})(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),a=e}}this.encode=function(r,a){(new Date).getTime();a&&j(a),v=new Array,y=0,_=7,D(65496),D(65504),D(16),N(74),N(70),N(73),N(70),N(0),N(1),N(1),N(0),D(1),D(1),N(0),N(0),function(e){if(e){D(65505),69===e[0]&&120===e[1]&&105===e[2]&&102===e[3]?D(e.length+2):(D(e.length+5+2),N(69),N(120),N(105),N(102),N(0));for(var t=0;t<e.length;t++)N(e[t])}}(r.exifBuffer),function(){D(65499),D(132),N(0);for(var e=0;e<64;e++)N(l[e]);N(1);for(var t=0;t<64;t++)N(c[t])}(),function(e,t){D(65472),D(17),N(8),D(t),D(e),N(3),N(1),N(17),N(0),N(2),N(17),N(1),N(3),N(17),N(1)}(r.width,r.height),function(){D(65476),D(418),N(0);for(var e=0;e<16;e++)N(S[e+1]);for(var t=0;t<=11;t++)N(k[t]);N(16);for(var r=0;r<16;r++)N(C[r+1]);for(var n=0;n<=161;n++)N(I[n]);N(1);for(var i=0;i<16;i++)N(R[i+1]);for(var s=0;s<=11;s++)N(L[s]);N(17);for(var o=0;o<16;o++)N(O[o+1]);for(var a=0;a<=161;a++)N(M[a])}(),D(65498),D(12),N(3),N(1),N(0),N(2),N(17),N(3),N(17),N(0),N(63),N(0);var u=0,f=0,d=0;y=0,_=7,this.encode.displayName="_encode_";for(var m,g,E,A,P,U,$,V,G,z=r.data,W=r.width,H=r.height,K=4*W,q=0;q<H;){for(m=0;m<K;){for(U=P=K*q+m,$=-1,V=0,G=0;G<64;G++)U=P+(V=G>>3)*K+($=4*(7&G)),q+V>=H&&(U-=K*(q+1+V-H)),m+$>=K&&(U-=m+$-K+4),g=z[U++],E=z[U++],A=z[U++],b[G]=(T[g]+T[E+256>>0]+T[A+512>>0]>>16)-128,x[G]=(T[g+768>>0]+T[E+1024>>0]+T[A+1280>>0]>>16)-128,w[G]=(T[g+1280>>0]+T[E+1536>>0]+T[A+1792>>0]>>16)-128;u=F(b,h,u,n,s),f=F(x,p,f,i,o),d=F(w,p,d,i,o),m+=32}q+=8}if(_>=0){var X=[];X[1]=_+1,X[0]=(1<<_+1)-1,B(X)}return D(65497),void 0===t?new Uint8Array(v):e.from(v)},function(){(new Date).getTime();r||(r=50),function(){for(var e=String.fromCharCode,t=0;t<256;t++)E[t]=e(t)}(),n=P(S,k),i=P(R,L),s=P(C,I),o=P(O,M),function(){for(var e=1,t=2,r=1;r<=15;r++){for(var n=e;n<t;n++)d[32767+n]=r,f[32767+n]=[],f[32767+n][1]=r,f[32767+n][0]=n;for(var i=-(t-1);i<=-e;i++)d[32767+i]=r,f[32767+i]=[],f[32767+i][1]=r,f[32767+i][0]=t-1+i;e<<=1,t<<=1}}(),function(){for(var e=0;e<256;e++)T[e]=19595*e,T[e+256>>0]=38470*e,T[e+512>>0]=7471*e+32768,T[e+768>>0]=-11059*e,T[e+1024>>0]=-21709*e,T[e+1280>>0]=32768*e+8421375,T[e+1536>>0]=-27439*e,T[e+1792>>0]=-5329*e}(),j(r),(new Date).getTime()}()}function n(e,t){return void 0===t&&(t=50),{data:new r(t).encode(e,t),width:e.width,height:e.height}}void 0!==t?t.exports=n:"undefined"!=typeof window&&(window["jpeg-js"]=window["jpeg-js"]||{},window["jpeg-js"].encode=n)}).call(this,e("buffer").Buffer)},{buffer:299}],374:[function(e,t,r){var n,i;n="undefined"!=typeof self?self:this,i=function(){return 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}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get: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=3)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.width=t,this.height=e.length/t,this.data=e}return e.createEmpty=function(t,r){return new e(new Uint8ClampedArray(t*r),t)},e.prototype.get=function(e,t){return!(e<0||e>=this.width||t<0||t>=this.height)&&!!this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r?1:0},e.prototype.setRegion=function(e,t,r,n,i){for(var s=t;s<t+n;s++)for(var o=e;o<e+r;o++)this.set(o,s,!!i)},e}();t.BitMatrix=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.addOrSubtractGF=function(e,t){return e^t};var i=function(){function e(e,t,r){this.primitive=e,this.size=t,this.generatorBase=r,this.expTable=new Array(this.size),this.logTable=new Array(this.size);for(var i=1,s=0;s<this.size;s++)this.expTable[s]=i,(i*=2)>=this.size&&(i=(i^this.primitive)&this.size-1);for(s=0;s<this.size-1;s++)this.logTable[this.expTable[s]]=s;this.zero=new n.default(this,Uint8ClampedArray.from([0])),this.one=new n.default(this,Uint8ClampedArray.from([1]))}return e.prototype.multiply=function(e,t){return 0===e||0===t?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.size-1)]},e.prototype.inverse=function(e){if(0===e)throw new Error("Can't invert 0");return this.expTable[this.size-this.logTable[e]-1]},e.prototype.buildMonomial=function(e,t){if(e<0)throw new Error("Invalid monomial degree less than 0");if(0===t)return this.zero;var r=new Uint8ClampedArray(e+1);return r[0]=t,new n.default(this,r)},e.prototype.log=function(e){if(0===e)throw new Error("Can't take log(0)");return this.logTable[e]},e.prototype.exp=function(e){return this.expTable[e]},e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),i=function(){function e(e,t){if(0===t.length)throw new Error("No coefficients.");this.field=e;var r=t.length;if(r>1&&0===t[0]){for(var n=1;n<r&&0===t[n];)n++;if(n===r)this.coefficients=e.zero.coefficients;else{this.coefficients=new Uint8ClampedArray(r-n);for(var i=0;i<this.coefficients.length;i++)this.coefficients[i]=t[n+i]}}else this.coefficients=t}return e.prototype.degree=function(){return this.coefficients.length-1},e.prototype.isZero=function(){return 0===this.coefficients[0]},e.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},e.prototype.addOrSubtract=function(t){var r;if(this.isZero())return t;if(t.isZero())return this;var i=this.coefficients,s=t.coefficients;i.length>s.length&&(i=(r=[s,i])[0],s=r[1]);for(var o=new Uint8ClampedArray(s.length),a=s.length-i.length,u=0;u<a;u++)o[u]=s[u];for(u=a;u<s.length;u++)o[u]=n.addOrSubtractGF(i[u-a],s[u]);return new e(this.field,o)},e.prototype.multiply=function(t){if(0===t)return this.field.zero;if(1===t)return this;for(var r=this.coefficients.length,n=new Uint8ClampedArray(r),i=0;i<r;i++)n[i]=this.field.multiply(this.coefficients[i],t);return new e(this.field,n)},e.prototype.multiplyPoly=function(t){if(this.isZero()||t.isZero())return this.field.zero;for(var r=this.coefficients,i=r.length,s=t.coefficients,o=s.length,a=new Uint8ClampedArray(i+o-1),u=0;u<i;u++)for(var l=r[u],c=0;c<o;c++)a[u+c]=n.addOrSubtractGF(a[u+c],this.field.multiply(l,s[c]));return new e(this.field,a)},e.prototype.multiplyByMonomial=function(t,r){if(t<0)throw new Error("Invalid degree less than 0");if(0===r)return this.field.zero;for(var n=this.coefficients.length,i=new Uint8ClampedArray(n+t),s=0;s<n;s++)i[s]=this.field.multiply(this.coefficients[s],r);return new e(this.field,i)},e.prototype.evaluateAt=function(e){var t=0;if(0===e)return this.getCoefficient(0);var r=this.coefficients.length;if(1===e)return this.coefficients.forEach(function(e){t=n.addOrSubtractGF(t,e)}),t;t=this.coefficients[0];for(var i=1;i<r;i++)t=n.addOrSubtractGF(this.field.multiply(e,t),this.coefficients[i]);return t},e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(5),s=r(11),o=r(12);function a(e){var t=o.locate(e);if(!t)return null;for(var r=0,n=t;r<n.length;r++){var a=n[r],u=s.extract(e,a),l=i.decode(u.matrix);if(l)return{binaryData:l.bytes,data:l.text,chunks:l.chunks,version:l.version,location:{topRightCorner:u.mappingFunction(a.dimension,0),topLeftCorner:u.mappingFunction(0,0),bottomRightCorner:u.mappingFunction(a.dimension,a.dimension),bottomLeftCorner:u.mappingFunction(0,a.dimension),topRightFinderPattern:a.topRight,topLeftFinderPattern:a.topLeft,bottomLeftFinderPattern:a.bottomLeft,bottomRightAlignmentPattern:a.alignmentPattern}}}return null}var u={inversionAttempts:"attemptBoth"};function l(e,t,r,i){void 0===i&&(i={});var s=u;Object.keys(s||{}).forEach(function(e){s[e]=i[e]||s[e]});var o="attemptBoth"===s.inversionAttempts||"invertFirst"===s.inversionAttempts,l="onlyInvert"===s.inversionAttempts||"invertFirst"===s.inversionAttempts,c=n.binarize(e,t,r,o),h=c.binarized,p=c.inverted,f=a(l?p:h);return f||"attemptBoth"!==s.inversionAttempts&&"invertFirst"!==s.inversionAttempts||(f=a(l?h:p)),f}l.default=l,t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=8,s=24;function o(e,t,r){return e<t?t:e>r?r:e}var a=function(){function e(e,t){this.width=e,this.data=new Uint8ClampedArray(e*t)}return e.prototype.get=function(e,t){return this.data[t*this.width+e]},e.prototype.set=function(e,t,r){this.data[t*this.width+e]=r},e}();t.binarize=function(e,t,r,u){if(e.length!==t*r*4)throw new Error("Malformed data passed to binarizer.");for(var l=new a(t,r),c=0;c<t;c++)for(var h=0;h<r;h++){var p=e[4*(h*t+c)+0],f=e[4*(h*t+c)+1],d=e[4*(h*t+c)+2];l.set(c,h,.2126*p+.7152*f+.0722*d)}for(var m=Math.ceil(t/i),g=Math.ceil(r/i),v=new a(m,g),y=0;y<g;y++)for(var _=0;_<m;_++){var b=0,x=1/0,w=0;for(h=0;h<i;h++)for(c=0;c<i;c++){var E=l.get(_*i+c,y*i+h);b+=E,x=Math.min(x,E),w=Math.max(w,E)}var T=b/Math.pow(i,2);if(w-x<=s&&(T=x/2,y>0&&_>0)){var A=(v.get(_,y-1)+2*v.get(_-1,y)+v.get(_-1,y-1))/4;x<A&&(T=A)}v.set(_,y,T)}var S=n.BitMatrix.createEmpty(t,r),k=null;for(u&&(k=n.BitMatrix.createEmpty(t,r)),y=0;y<g;y++)for(_=0;_<m;_++){for(var C=o(_,2,m-3),I=o(y,2,g-3),R=(b=0,-2);R<=2;R++)for(var L=-2;L<=2;L++)b+=v.get(C+R,I+L);var O=b/25;for(R=0;R<i;R++)for(L=0;L<i;L++){c=_*i+R,h=y*i+L;var M=l.get(c,h);S.set(c,h,M<=O),u&&k.set(c,h,!(M<=O))}}return u?{binarized:S,inverted:k}:{binarized:S}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(6),s=r(9),o=r(10);function a(e,t){for(var r=e^t,n=0;r;)n++,r&=r-1;return n}function u(e,t){return t<<1|e}var l=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,dataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,formatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,dataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],c=[function(e){return(e.y+e.x)%2==0},function(e){return e.y%2==0},function(e){return e.x%3==0},function(e){return(e.y+e.x)%3==0},function(e){return(Math.floor(e.y/2)+Math.floor(e.x/3))%2==0},function(e){return e.x*e.y%2+e.x*e.y%3==0},function(e){return(e.y*e.x%2+e.y*e.x%3)%2==0},function(e){return((e.y+e.x)%2+e.y*e.x%3)%2==0}];function h(e,t,r){for(var i=c[r.dataMask],s=e.height,o=function(e){var t=17+4*e.versionNumber,r=n.BitMatrix.createEmpty(t,t);r.setRegion(0,0,9,9,!0),r.setRegion(t-8,0,8,9,!0),r.setRegion(0,t-8,9,8,!0);for(var i=0,s=e.alignmentPatternCenters;i<s.length;i++)for(var o=s[i],a=0,u=e.alignmentPatternCenters;a<u.length;a++){var l=u[a];6===o&&6===l||6===o&&l===t-7||o===t-7&&6===l||r.setRegion(o-2,l-2,5,5,!0)}return r.setRegion(6,9,1,t-17,!0),r.setRegion(9,6,t-17,1,!0),e.versionNumber>6&&(r.setRegion(t-11,0,3,6,!0),r.setRegion(0,t-11,6,3,!0)),r}(t),a=[],l=0,h=0,p=!0,f=s-1;f>0;f-=2){6===f&&f--;for(var d=0;d<s;d++)for(var m=p?s-1-d:d,g=0;g<2;g++){var v=f-g;if(!o.get(v,m)){h++;var y=e.get(v,m);i({y:m,x:v})&&(y=!y),l=u(y,l),8===h&&(a.push(l),h=0,l=0)}}p=!p}return a}function p(e){var t=function(e){var t=e.height,r=Math.floor((t-17)/4);if(r<=6)return o.VERSIONS[r-1];for(var n=0,i=5;i>=0;i--)for(var s=t-9;s>=t-11;s--)n=u(e.get(s,i),n);var l=0;for(s=5;s>=0;s--)for(i=t-9;i>=t-11;i--)l=u(e.get(s,i),l);for(var c,h=1/0,p=0,f=o.VERSIONS;p<f.length;p++){var d=f[p];if(d.infoBits===n||d.infoBits===l)return d;var m=a(n,d.infoBits);m<h&&(c=d,h=m),(m=a(l,d.infoBits))<h&&(c=d,h=m)}return h<=3?c:void 0}(e);if(!t)return null;var r=function(e){for(var t=0,r=0;r<=8;r++)6!==r&&(t=u(e.get(r,8),t));for(var n=7;n>=0;n--)6!==n&&(t=u(e.get(8,n),t));var i=e.height,s=0;for(n=i-1;n>=i-7;n--)s=u(e.get(8,n),s);for(r=i-8;r<i;r++)s=u(e.get(r,8),s);for(var o=1/0,c=null,h=0,p=l;h<p.length;h++){var f=p[h],d=f.bits,m=f.formatInfo;if(d===t||d===s)return m;var g=a(t,d);g<o&&(c=m,o=g),t!==s&&(g=a(s,d))<o&&(c=m,o=g)}return o<=3?c:null}(e);if(!r)return null;var n=function(e,t,r){var n=t.errorCorrectionLevels[r],i=[],s=0;if(n.ecBlocks.forEach(function(e){for(var t=0;t<e.numBlocks;t++)i.push({numDataCodewords:e.dataCodewordsPerBlock,codewords:[]}),s+=e.dataCodewordsPerBlock+n.ecCodewordsPerBlock}),e.length<s)return null;e=e.slice(0,s);for(var o=n.ecBlocks[0].dataCodewordsPerBlock,a=0;a<o;a++)for(var u=0,l=i;u<l.length;u++)l[u].codewords.push(e.shift());if(n.ecBlocks.length>1){var c=n.ecBlocks[0].numBlocks,h=n.ecBlocks[1].numBlocks;for(a=0;a<h;a++)i[c+a].codewords.push(e.shift())}for(;e.length>0;)for(var p=0,f=i;p<f.length;p++)f[p].codewords.push(e.shift());return i}(h(e,t,r),t,r.errorCorrectionLevel);if(!n)return null;for(var c=n.reduce(function(e,t){return e+t.numDataCodewords},0),p=new Uint8ClampedArray(c),f=0,d=0,m=n;d<m.length;d++){var g=m[d],v=s.decode(g.codewords,g.codewords.length-g.numDataCodewords);if(!v)return null;for(var y=0;y<g.numDataCodewords;y++)p[f++]=v[y]}try{return i.decode(p,t.versionNumber)}catch(e){return null}}t.decode=function(e){if(null==e)return null;var t=p(e);if(t)return t;for(var r=0;r<e.width;r++)for(var n=r+1;n<e.height;n++)e.get(r,n)!==e.get(n,r)&&(e.set(r,n,!e.get(r,n)),e.set(n,r,!e.get(n,r)));return p(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i,s=r(7),o=r(8);function a(e,t){for(var r=[],n="",i=[10,12,14][t],s=e.readBits(i);s>=3;){if((l=e.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var o=Math.floor(l/100),a=Math.floor(l/10)%10,u=l%10;r.push(48+o,48+a,48+u),n+=o.toString()+a.toString()+u.toString(),s-=3}if(2===s){if((l=e.readBits(7))>=100)throw new Error("Invalid numeric value above 99");o=Math.floor(l/10),a=l%10;r.push(48+o,48+a),n+=o.toString()+a.toString()}else if(1===s){var l;if((l=e.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+l),n+=l.toString()}return{bytes:r,text:n}}!function(e){e.Numeric="numeric",e.Alphanumeric="alphanumeric",e.Byte="byte",e.Kanji="kanji",e.ECI="eci"}(n=t.Mode||(t.Mode={})),function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"}(i||(i={}));var u=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function l(e,t){for(var r=[],n="",i=[9,11,13][t],s=e.readBits(i);s>=2;){var o=e.readBits(11),a=Math.floor(o/45),l=o%45;r.push(u[a].charCodeAt(0),u[l].charCodeAt(0)),n+=u[a]+u[l],s-=2}if(1===s){a=e.readBits(6);r.push(u[a].charCodeAt(0)),n+=u[a]}return{bytes:r,text:n}}function c(e,t){for(var r=[],n="",i=[8,16,16][t],s=e.readBits(i),o=0;o<s;o++){var a=e.readBits(8);r.push(a)}try{n+=decodeURIComponent(r.map(function(e){return"%"+("0"+e.toString(16)).substr(-2)}).join(""))}catch(e){}return{bytes:r,text:n}}function h(e,t){for(var r=[],n="",i=[8,10,12][t],s=e.readBits(i),a=0;a<s;a++){var u=e.readBits(13),l=Math.floor(u/192)<<8|u%192;l+=l<7936?33088:49472,r.push(l>>8,255&l),n+=String.fromCharCode(o.shiftJISTable[l])}return{bytes:r,text:n}}t.decode=function(e,t){for(var r,o,u,p,f=new s.BitStream(e),d=t<=9?0:t<=26?1:2,m={text:"",bytes:[],chunks:[],version:t};f.available()>=4;){var g=f.readBits(4);if(g===i.Terminator)return m;if(g===i.ECI)0===f.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:f.readBits(7)}):0===f.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:f.readBits(14)}):0===f.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:f.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(g===i.Numeric){var v=a(f,d);m.text+=v.text,(r=m.bytes).push.apply(r,v.bytes),m.chunks.push({type:n.Numeric,text:v.text})}else if(g===i.Alphanumeric){var y=l(f,d);m.text+=y.text,(o=m.bytes).push.apply(o,y.bytes),m.chunks.push({type:n.Alphanumeric,text:y.text})}else if(g===i.Byte){var _=c(f,d);m.text+=_.text,(u=m.bytes).push.apply(u,_.bytes),m.chunks.push({type:n.Byte,bytes:_.bytes,text:_.text})}else if(g===i.Kanji){var b=h(f,d);m.text+=b.text,(p=m.bytes).push.apply(p,b.bytes),m.chunks.push({type:n.Kanji,bytes:b.bytes,text:b.text})}}if(0===f.available()||0===f.readBits(f.available()))return m}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e){this.byteOffset=0,this.bitOffset=0,this.bytes=e}return e.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Error("Cannot read "+e.toString()+" bits");var t=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=e<r?e:r,i=255>>8-n<<(s=r-n);t=(this.bytes[this.byteOffset]&i)>>s,e-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(e>0){for(;e>=8;)t=t<<8|255&this.bytes[this.byteOffset],this.byteOffset++,e-=8;if(e>0){var s;i=255>>(s=8-e)<<s;t=t<<e|(this.bytes[this.byteOffset]&i)>>s,this.bitOffset+=e}}return t},e.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},e}();t.BitStream=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35000:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36000:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37000:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38000:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39000:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,40000:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58000:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59000:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,60000:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),i=r(2);t.decode=function(e,t){var r=new Uint8ClampedArray(e.length);r.set(e);for(var s=new n.default(285,256,0),o=new i.default(s,r),a=new Uint8ClampedArray(t),u=!1,l=0;l<t;l++){var c=o.evaluateAt(s.exp(l+s.generatorBase));a[a.length-1-l]=c,0!==c&&(u=!0)}if(!u)return r;var h=new i.default(s,a),p=function(e,t,r,n){var i;t.degree()<r.degree()&&(t=(i=[r,t])[0],r=i[1]);for(var s=t,o=r,a=e.zero,u=e.one;o.degree()>=n/2;){var l=s,c=a;if(a=u,(s=o).isZero())return null;o=l;for(var h=e.zero,p=s.getCoefficient(s.degree()),f=e.inverse(p);o.degree()>=s.degree()&&!o.isZero();){var d=o.degree()-s.degree(),m=e.multiply(o.getCoefficient(o.degree()),f);h=h.addOrSubtract(e.buildMonomial(d,m)),o=o.addOrSubtract(s.multiplyByMonomial(d,m))}if(u=h.multiplyPoly(a).addOrSubtract(c),o.degree()>=s.degree())return null}var g=u.getCoefficient(0);if(0===g)return null;var v=e.inverse(g);return[u.multiply(v),o.multiply(v)]}(s,s.buildMonomial(t,1),h,t);if(null===p)return null;var f=function(e,t){var r=t.degree();if(1===r)return[t.getCoefficient(1)];for(var n=new Array(r),i=0,s=1;s<e.size&&i<r;s++)0===t.evaluateAt(s)&&(n[i]=e.inverse(s),i++);return i!==r?null:n}(s,p[0]);if(null==f)return null;for(var d=function(e,t,r){for(var i=r.length,s=new Array(i),o=0;o<i;o++){for(var a=e.inverse(r[o]),u=1,l=0;l<i;l++)o!==l&&(u=e.multiply(u,n.addOrSubtractGF(1,e.multiply(r[l],a))));s[o]=e.multiply(t.evaluateAt(a),e.inverse(u)),0!==e.generatorBase&&(s[o]=e.multiply(s[o],a))}return s}(s,p[1],f),m=0;m<f.length;m++){var g=r.length-1-s.log(f[m]);if(g<0)return null;r[g]=n.addOrSubtractGF(r[g],d[m])}return r}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSIONS=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,versionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,dataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,versionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},{numBlocks:61,dataCodewordsPerBlock:16}]}]}]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);function i(e,t,r,n){var i=e.x-t.x+r.x-n.x,s=e.y-t.y+r.y-n.y;if(0===i&&0===s)return{a11:t.x-e.x,a12:t.y-e.y,a13:0,a21:r.x-t.x,a22:r.y-t.y,a23:0,a31:e.x,a32:e.y,a33:1};var o=t.x-r.x,a=n.x-r.x,u=t.y-r.y,l=n.y-r.y,c=o*l-a*u,h=(i*l-a*s)/c,p=(o*s-i*u)/c;return{a11:t.x-e.x+h*t.x,a12:t.y-e.y+h*t.y,a13:h,a21:n.x-e.x+p*n.x,a22:n.y-e.y+p*n.y,a23:p,a31:e.x,a32:e.y,a33:1}}t.extract=function(e,t){for(var r,s,o=function(e,t,r,n){var s=i(e,t,r,n);return{a11:s.a22*s.a33-s.a23*s.a32,a12:s.a13*s.a32-s.a12*s.a33,a13:s.a12*s.a23-s.a13*s.a22,a21:s.a23*s.a31-s.a21*s.a33,a22:s.a11*s.a33-s.a13*s.a31,a23:s.a13*s.a21-s.a11*s.a23,a31:s.a21*s.a32-s.a22*s.a31,a32:s.a12*s.a31-s.a11*s.a32,a33:s.a11*s.a22-s.a12*s.a21}}({x:3.5,y:3.5},{x:t.dimension-3.5,y:3.5},{x:t.dimension-6.5,y:t.dimension-6.5},{x:3.5,y:t.dimension-3.5}),a=i(t.topLeft,t.topRight,t.alignmentPattern,t.bottomLeft),u=(s=o,{a11:(r=a).a11*s.a11+r.a21*s.a12+r.a31*s.a13,a12:r.a12*s.a11+r.a22*s.a12+r.a32*s.a13,a13:r.a13*s.a11+r.a23*s.a12+r.a33*s.a13,a21:r.a11*s.a21+r.a21*s.a22+r.a31*s.a23,a22:r.a12*s.a21+r.a22*s.a22+r.a32*s.a23,a23:r.a13*s.a21+r.a23*s.a22+r.a33*s.a23,a31:r.a11*s.a31+r.a21*s.a32+r.a31*s.a33,a32:r.a12*s.a31+r.a22*s.a32+r.a32*s.a33,a33:r.a13*s.a31+r.a23*s.a32+r.a33*s.a33}),l=n.BitMatrix.createEmpty(t.dimension,t.dimension),c=function(e,t){var r=u.a13*e+u.a23*t+u.a33;return{x:(u.a11*e+u.a21*t+u.a31)/r,y:(u.a12*e+u.a22*t+u.a32)/r}},h=0;h<t.dimension;h++)for(var p=0;p<t.dimension;p++){var f=c(p+.5,h+.5);l.set(p,h,e.get(Math.floor(f.x),Math.floor(f.y)))}return{matrix:l,mappingFunction:c}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=4,i=.5,s=1.5,o=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};function a(e){return e.reduce(function(e,t){return e+t})}function u(e,t,r,n){var i,s,a,u,l=[{x:Math.floor(e.x),y:Math.floor(e.y)}],c=Math.abs(t.y-e.y)>Math.abs(t.x-e.x);c?(i=Math.floor(e.y),s=Math.floor(e.x),a=Math.floor(t.y),u=Math.floor(t.x)):(i=Math.floor(e.x),s=Math.floor(e.y),a=Math.floor(t.x),u=Math.floor(t.y));for(var h=Math.abs(a-i),p=Math.abs(u-s),f=Math.floor(-h/2),d=i<a?1:-1,m=s<u?1:-1,g=!0,v=i,y=s;v!==a+d;v+=d){var _=c?y:v,b=c?v:y;if(r.get(_,b)!==g&&(g=!g,l.push({x:_,y:b}),l.length===n+1))break;if((f+=p)>0){if(y===u)break;y+=m,f-=h}}for(var x=[],w=0;w<n;w++)l[w]&&l[w+1]?x.push(o(l[w],l[w+1])):x.push(0);return x}function l(e,t,r,n){var i,s=t.y-e.y,o=t.x-e.x,a=u(e,t,r,Math.ceil(n/2)),l=u(e,{x:e.x-o,y:e.y-s},r,Math.ceil(n/2)),c=a.shift()+l.shift()-1;return(i=l.concat(c)).concat.apply(i,a)}function c(e,t){var r=a(e)/a(t),n=0;return t.forEach(function(t,i){n+=Math.pow(e[i]-t*r,2)}),{averageSize:r,error:n}}function h(e,t,r){try{var n=l(e,{x:-1,y:e.y},r,t.length),i=l(e,{x:e.x,y:-1},r,t.length),s=l(e,{x:Math.max(0,e.x-e.y)-1,y:Math.max(0,e.y-e.x)-1},r,t.length),o=l(e,{x:Math.min(r.width,e.x+e.y)+1,y:Math.min(r.height,e.y+e.x)+1},r,t.length),a=c(n,t),u=c(i,t),h=c(s,t),p=c(o,t),f=Math.sqrt(a.error*a.error+u.error*u.error+h.error*h.error+p.error*p.error),d=(a.averageSize+u.averageSize+h.averageSize+p.averageSize)/4;return f+(Math.pow(a.averageSize-d,2)+Math.pow(u.averageSize-d,2)+Math.pow(h.averageSize-d,2)+Math.pow(p.averageSize-d,2))/d}catch(e){return 1/0}}function p(e,t){for(var r=Math.round(t.x);e.get(r,Math.round(t.y));)r--;for(var n=Math.round(t.x);e.get(n,Math.round(t.y));)n++;for(var i=(r+n)/2,s=Math.round(t.y);e.get(Math.round(i),s);)s--;for(var o=Math.round(t.y);e.get(Math.round(i),o);)o++;return{x:i,y:(s+o)/2}}function f(e,t,r,n,i){var s,u,c;try{s=function(e,t,r,n){var i=(a(l(e,r,n,5))/7+a(l(e,t,n,5))/7+a(l(r,e,n,5))/7+a(l(t,e,n,5))/7)/4;if(i<1)throw new Error("Invalid module size");var s=Math.round(o(e,t)/i),u=Math.round(o(e,r)/i),c=Math.floor((s+u)/2)+7;switch(c%4){case 0:c++;break;case 2:c--}return{dimension:c,moduleSize:i}}(n,r,i,e),u=s.dimension,c=s.moduleSize}catch(e){return null}var p=r.x-n.x+i.x,f=r.y-n.y+i.y,d=(o(n,i)+o(n,r))/2/c,m=1-3/d,g={x:n.x+m*(p-n.x),y:n.y+m*(f-n.y)},v=t.map(function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.floor(r),Math.floor(n))){var i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1];a(i);return{x:r,y:n,score:h({x:Math.floor(r),y:Math.floor(n)},[1,1,1],e)+o({x:r,y:n},g)}}}).filter(function(e){return!!e}).sort(function(e,t){return e.score-t.score});return{alignmentPattern:d>=15&&v.length?v[0]:g,dimension:u}}t.locate=function(e){for(var t=[],r=[],u=[],l=[],c=function(n){for(var o=0,c=!1,h=[0,0,0,0,0],p=function(t){var u=e.get(t,n);if(u===c)o++;else{h=[h[1],h[2],h[3],h[4],o],o=1,c=u;var p=a(h)/7,f=Math.abs(h[0]-p)<p&&Math.abs(h[1]-p)<p&&Math.abs(h[2]-3*p)<3*p&&Math.abs(h[3]-p)<p&&Math.abs(h[4]-p)<p&&!u,d=a(h.slice(-3))/3,m=Math.abs(h[2]-d)<d&&Math.abs(h[3]-d)<d&&Math.abs(h[4]-d)<d&&u;if(f){var g=t-h[3]-h[4],v=g-h[2],y={startX:v,endX:g,y:n};(_=r.filter(function(e){return v>=e.bottom.startX&&v<=e.bottom.endX||g>=e.bottom.startX&&v<=e.bottom.endX||v<=e.bottom.startX&&g>=e.bottom.endX&&h[2]/(e.bottom.endX-e.bottom.startX)<s&&h[2]/(e.bottom.endX-e.bottom.startX)>i})).length>0?_[0].bottom=y:r.push({top:y,bottom:y})}if(m){var _,b=t-h[4],x=b-h[3];y={startX:x,y:n,endX:b},(_=l.filter(function(e){return x>=e.bottom.startX&&x<=e.bottom.endX||b>=e.bottom.startX&&x<=e.bottom.endX||x<=e.bottom.startX&&b>=e.bottom.endX&&h[2]/(e.bottom.endX-e.bottom.startX)<s&&h[2]/(e.bottom.endX-e.bottom.startX)>i})).length>0?_[0].bottom=y:l.push({top:y,bottom:y})}}},f=-1;f<=e.width;f++)p(f);t.push.apply(t,r.filter(function(e){return e.bottom.y!==n&&e.bottom.y-e.top.y>=2})),r=r.filter(function(e){return e.bottom.y===n}),u.push.apply(u,l.filter(function(e){return e.bottom.y!==n})),l=l.filter(function(e){return e.bottom.y===n})},d=0;d<=e.height;d++)c(d);t.push.apply(t,r.filter(function(e){return e.bottom.y-e.top.y>=2})),u.push.apply(u,l);var m=t.filter(function(e){return e.bottom.y-e.top.y>=2}).map(function(t){var r=(t.top.startX+t.top.endX+t.bottom.startX+t.bottom.endX)/4,n=(t.top.y+t.bottom.y+1)/2;if(e.get(Math.round(r),Math.round(n))){var i=[t.top.endX-t.top.startX,t.bottom.endX-t.bottom.startX,t.bottom.y-t.top.y+1],s=a(i)/i.length;return{score:h({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],e),x:r,y:n,size:s}}}).filter(function(e){return!!e}).sort(function(e,t){return e.score-t.score}).map(function(e,t,r){if(t>n)return null;var i=r.filter(function(e,r){return t!==r}).map(function(t){return{x:t.x,y:t.y,score:t.score+Math.pow(t.size-e.size,2)/e.size,size:t.size}}).sort(function(e,t){return e.score-t.score});if(i.length<2)return null;var s=e.score+i[0].score+i[1].score;return{points:[e].concat(i.slice(0,2)),score:s}}).filter(function(e){return!!e}).sort(function(e,t){return e.score-t.score});if(0===m.length)return null;var g=function(e,t,r){var n,i,s,a,u,l,c,h=o(e,t),p=o(t,r),f=o(e,r);return p>=h&&p>=f?(u=(n=[t,e,r])[0],l=n[1],c=n[2]):f>=p&&f>=h?(u=(i=[e,t,r])[0],l=i[1],c=i[2]):(u=(s=[e,r,t])[0],l=s[1],c=s[2]),(c.x-l.x)*(u.y-l.y)-(c.y-l.y)*(u.x-l.x)<0&&(u=(a=[c,u])[0],c=a[1]),{bottomLeft:u,topLeft:l,topRight:c}}(m[0].points[0],m[0].points[1],m[0].points[2]),v=g.topRight,y=g.topLeft,_=g.bottomLeft,b=f(e,u,v,y,_),x=[];b&&x.push({alignmentPattern:{x:b.alignmentPattern.x,y:b.alignmentPattern.y},bottomLeft:{x:_.x,y:_.y},dimension:b.dimension,topLeft:{x:y.x,y:y.y},topRight:{x:v.x,y:v.y}});var w=p(e,v),E=p(e,y),T=p(e,_),A=f(e,u,w,E,T);return A&&x.push({alignmentPattern:{x:A.alignmentPattern.x,y:A.alignmentPattern.y},bottomLeft:{x:T.x,y:T.y},topLeft:{x:E.x,y:E.y},topRight:{x:w.x,y:w.y},dimension:A.dimension}),0===x.length?null:x}}]).default},"object"==typeof r&&"object"==typeof t?t.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof r?r.jsQR=i():n.jsQR=i()},{}],375:[function(e,t,r){"use strict";r.re=(()=>{throw new Error("`junk.re` was renamed to `junk.regex`")}),r.regex=new RegExp(["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"].join("|")),r.is=(e=>r.regex.test(e)),r.not=(e=>!r.is(e)),r.default=t.exports},{}],376:[function(e,t,r){(function(e){(function(){var n,i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",h=1,p=2,f=4,d=1,m=2,g=1,v=2,y=4,_=8,b=16,x=32,w=64,E=128,T=256,A=512,S=30,k="...",C=800,I=16,R=1,L=2,O=1/0,M=9007199254740991,P=1.7976931348623157e308,B=NaN,N=4294967295,D=N-1,F=N>>>1,j=[["ary",E],["bind",g],["bindKey",v],["curry",_],["curryRight",b],["flip",A],["partial",x],["partialRight",w],["rearg",T]],U="[object Arguments]",$="[object Array]",V="[object AsyncFunction]",G="[object Boolean]",z="[object Date]",W="[object DOMException]",H="[object Error]",K="[object Function]",q="[object GeneratorFunction]",X="[object Map]",Y="[object Number]",Z="[object Null]",J="[object Object]",Q="[object Proxy]",ee="[object RegExp]",te="[object Set]",re="[object String]",ne="[object Symbol]",ie="[object Undefined]",se="[object WeakMap]",oe="[object WeakSet]",ae="[object ArrayBuffer]",ue="[object DataView]",le="[object Float32Array]",ce="[object Float64Array]",he="[object Int8Array]",pe="[object Int16Array]",fe="[object Int32Array]",de="[object Uint8Array]",me="[object Uint8ClampedArray]",ge="[object Uint16Array]",ve="[object Uint32Array]",ye=/\b__p \+= '';/g,_e=/\b(__p \+=) '' \+/g,be=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xe=/&(?:amp|lt|gt|quot|#39);/g,we=/[&<>"']/g,Ee=RegExp(xe.source),Te=RegExp(we.source),Ae=/<%-([\s\S]+?)%>/g,Se=/<%([\s\S]+?)%>/g,ke=/<%=([\s\S]+?)%>/g,Ce=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/,Re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Le=/[\\^$.*+?()[\]{}|]/g,Oe=RegExp(Le.source),Me=/^\s+/,Pe=/\s/,Be=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ne=/\{\n\/\* \[wrapped with (.+)\] \*/,De=/,? & /,Fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,je=/[()=,{}\[\]\/\s]/,Ue=/\\(\\)?/g,$e=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ve=/\w*$/,Ge=/^[-+]0x[0-9a-f]+$/i,ze=/^0b[01]+$/i,We=/^\[object .+?Constructor\]$/,He=/^0o[0-7]+$/i,Ke=/^(?:0|[1-9]\d*)$/,qe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xe=/($^)/,Ye=/['\n\r\u2028\u2029\\]/g,Ze="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Je="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Qe="[\\ud800-\\udfff]",et="["+Je+"]",tt="["+Ze+"]",rt="\\d+",nt="[\\u2700-\\u27bf]",it="[a-z\\xdf-\\xf6\\xf8-\\xff]",st="[^\\ud800-\\udfff"+Je+rt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ot="\\ud83c[\\udffb-\\udfff]",at="[^\\ud800-\\udfff]",ut="(?:\\ud83c[\\udde6-\\uddff]){2}",lt="[\\ud800-\\udbff][\\udc00-\\udfff]",ct="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ht="(?:"+it+"|"+st+")",pt="(?:"+ct+"|"+st+")",ft="(?:"+tt+"|"+ot+")"+"?",dt="[\\ufe0e\\ufe0f]?"+ft+("(?:\\u200d(?:"+[at,ut,lt].join("|")+")[\\ufe0e\\ufe0f]?"+ft+")*"),mt="(?:"+[nt,ut,lt].join("|")+")"+dt,gt="(?:"+[at+tt+"?",tt,ut,lt,Qe].join("|")+")",vt=RegExp("['’]","g"),yt=RegExp(tt,"g"),_t=RegExp(ot+"(?="+ot+")|"+gt+dt,"g"),bt=RegExp([ct+"?"+it+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[et,ct,"$"].join("|")+")",pt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[et,ct+ht,"$"].join("|")+")",ct+"?"+ht+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ct+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rt,mt].join("|"),"g"),xt=RegExp("[\\u200d\\ud800-\\udfff"+Ze+"\\ufe0e\\ufe0f]"),wt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tt=-1,At={};At[le]=At[ce]=At[he]=At[pe]=At[fe]=At[de]=At[me]=At[ge]=At[ve]=!0,At[U]=At[$]=At[ae]=At[G]=At[ue]=At[z]=At[H]=At[K]=At[X]=At[Y]=At[J]=At[ee]=At[te]=At[re]=At[se]=!1;var St={};St[U]=St[$]=St[ae]=St[ue]=St[G]=St[z]=St[le]=St[ce]=St[he]=St[pe]=St[fe]=St[X]=St[Y]=St[J]=St[ee]=St[te]=St[re]=St[ne]=St[de]=St[me]=St[ge]=St[ve]=!0,St[H]=St[K]=St[se]=!1;var kt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ct=parseFloat,It=parseInt,Rt="object"==typeof e&&e&&e.Object===Object&&e,Lt="object"==typeof self&&self&&self.Object===Object&&self,Ot=Rt||Lt||Function("return this")(),Mt="object"==typeof r&&r&&!r.nodeType&&r,Pt=Mt&&"object"==typeof t&&t&&!t.nodeType&&t,Bt=Pt&&Pt.exports===Mt,Nt=Bt&&Rt.process,Dt=function(){try{var e=Pt&&Pt.require&&Pt.require("util").types;return e||Nt&&Nt.binding&&Nt.binding("util")}catch(e){}}(),Ft=Dt&&Dt.isArrayBuffer,jt=Dt&&Dt.isDate,Ut=Dt&&Dt.isMap,$t=Dt&&Dt.isRegExp,Vt=Dt&&Dt.isSet,Gt=Dt&&Dt.isTypedArray;function zt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Wt(e,t,r,n){for(var i=-1,s=null==e?0:e.length;++i<s;){var o=e[i];t(n,o,r(o),e)}return n}function Ht(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Kt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function qt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Xt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}function Yt(e,t){return!!(null==e?0:e.length)&&or(e,t,0)>-1}function Zt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Jt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Qt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function er(e,t,r,n){var i=-1,s=null==e?0:e.length;for(n&&s&&(r=e[++i]);++i<s;)r=t(r,e[i],i,e);return r}function tr(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function rr(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var nr=cr("length");function ir(e,t,r){var n;return r(e,function(e,r,i){if(t(e,r,i))return n=r,!1}),n}function sr(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function or(e,t,r){return t==t?function(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):sr(e,ur,r)}function ar(e,t,r,n){for(var i=r-1,s=e.length;++i<s;)if(n(e[i],t))return i;return-1}function ur(e){return e!=e}function lr(e,t){var r=null==e?0:e.length;return r?fr(e,t)/r:B}function cr(e){return function(t){return null==t?n:t[e]}}function hr(e){return function(t){return null==e?n:e[t]}}function pr(e,t,r,n,i){return i(e,function(e,i,s){r=n?(n=!1,e):t(r,e,i,s)}),r}function fr(e,t){for(var r,i=-1,s=e.length;++i<s;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function dr(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function mr(e){return e?e.slice(0,Or(e)+1).replace(Me,""):e}function gr(e){return function(t){return e(t)}}function vr(e,t){return Jt(t,function(t){return e[t]})}function yr(e,t){return e.has(t)}function _r(e,t){for(var r=-1,n=e.length;++r<n&&or(t,e[r],0)>-1;);return r}function br(e,t){for(var r=e.length;r--&&or(t,e[r],0)>-1;);return r}var xr=hr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),wr=hr({"&":"&","<":"<",">":">",'"':""","'":"'"});function Er(e){return"\\"+kt[e]}function Tr(e){return xt.test(e)}function Ar(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function Sr(e,t){return function(r){return e(t(r))}}function kr(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var o=e[r];o!==t&&o!==c||(e[r]=c,s[i++]=r)}return s}function Cr(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}function Ir(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}function Rr(e){return Tr(e)?function(e){var t=_t.lastIndex=0;for(;_t.test(e);)++t;return t}(e):nr(e)}function Lr(e){return Tr(e)?function(e){return e.match(_t)||[]}(e):function(e){return e.split("")}(e)}function Or(e){for(var t=e.length;t--&&Pe.test(e.charAt(t)););return t}var Mr=hr({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Pr=function e(t){var r,Pe=(t=null==t?Ot:Pr.defaults(Ot.Object(),t,Pr.pick(Ot,Et))).Array,Ze=t.Date,Je=t.Error,Qe=t.Function,et=t.Math,tt=t.Object,rt=t.RegExp,nt=t.String,it=t.TypeError,st=Pe.prototype,ot=Qe.prototype,at=tt.prototype,ut=t["__core-js_shared__"],lt=ot.toString,ct=at.hasOwnProperty,ht=0,pt=(r=/[^.]+$/.exec(ut&&ut.keys&&ut.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",ft=at.toString,dt=lt.call(tt),mt=Ot._,gt=rt("^"+lt.call(ct).replace(Le,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_t=Bt?t.Buffer:n,xt=t.Symbol,kt=t.Uint8Array,Rt=_t?_t.allocUnsafe:n,Lt=Sr(tt.getPrototypeOf,tt),Mt=tt.create,Pt=at.propertyIsEnumerable,Nt=st.splice,Dt=xt?xt.isConcatSpreadable:n,nr=xt?xt.iterator:n,hr=xt?xt.toStringTag:n,Br=function(){try{var e=Us(tt,"defineProperty");return e({},"",{}),e}catch(e){}}(),Nr=t.clearTimeout!==Ot.clearTimeout&&t.clearTimeout,Dr=Ze&&Ze.now!==Ot.Date.now&&Ze.now,Fr=t.setTimeout!==Ot.setTimeout&&t.setTimeout,jr=et.ceil,Ur=et.floor,$r=tt.getOwnPropertySymbols,Vr=_t?_t.isBuffer:n,Gr=t.isFinite,zr=st.join,Wr=Sr(tt.keys,tt),Hr=et.max,Kr=et.min,qr=Ze.now,Xr=t.parseInt,Yr=et.random,Zr=st.reverse,Jr=Us(t,"DataView"),Qr=Us(t,"Map"),en=Us(t,"Promise"),tn=Us(t,"Set"),rn=Us(t,"WeakMap"),nn=Us(tt,"create"),sn=rn&&new rn,on={},an=po(Jr),un=po(Qr),ln=po(en),cn=po(tn),hn=po(rn),pn=xt?xt.prototype:n,fn=pn?pn.valueOf:n,dn=pn?pn.toString:n;function mn(e){if(Ra(e)&&!_a(e)&&!(e instanceof _n)){if(e instanceof yn)return e;if(ct.call(e,"__wrapped__"))return fo(e)}return new yn(e)}var gn=function(){function e(){}return function(t){if(!Ia(t))return{};if(Mt)return Mt(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function vn(){}function yn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function _n(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=N,this.__views__=[]}function bn(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function xn(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function wn(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function En(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new wn;++t<r;)this.add(e[t])}function Tn(e){var t=this.__data__=new xn(e);this.size=t.size}function An(e,t){var r=_a(e),n=!r&&ya(e),i=!r&&!n&&Ea(e),s=!r&&!n&&!i&&Fa(e),o=r||n||i||s,a=o?dr(e.length,nt):[],u=a.length;for(var l in e)!t&&!ct.call(e,l)||o&&("length"==l||i&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ks(l,u))||a.push(l);return a}function Sn(e){var t=e.length;return t?e[Ei(0,t-1)]:n}function kn(e,t){return lo(is(e),Nn(t,0,e.length))}function Cn(e){return lo(is(e))}function In(e,t,r){(r===n||ma(e[t],r))&&(r!==n||t in e)||Pn(e,t,r)}function Rn(e,t,r){var i=e[t];ct.call(e,t)&&ma(i,r)&&(r!==n||t in e)||Pn(e,t,r)}function Ln(e,t){for(var r=e.length;r--;)if(ma(e[r][0],t))return r;return-1}function On(e,t,r,n){return $n(e,function(e,i,s){t(n,e,r(e),s)}),n}function Mn(e,t){return e&&ss(t,ou(t),e)}function Pn(e,t,r){"__proto__"==t&&Br?Br(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Bn(e,t){for(var r=-1,i=t.length,s=Pe(i),o=null==e;++r<i;)s[r]=o?n:tu(e,t[r]);return s}function Nn(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function Dn(e,t,r,i,s,o){var a,u=t&h,l=t&p,c=t&f;if(r&&(a=s?r(e,i,s,o):r(e)),a!==n)return a;if(!Ia(e))return e;var d=_a(e);if(d){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&ct.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!u)return is(e,a)}else{var m=Gs(e),g=m==K||m==q;if(Ea(e))return Ji(e,u);if(m==J||m==U||g&&!s){if(a=l||g?{}:Ws(e),!u)return l?function(e,t){return ss(e,Vs(e),t)}(e,function(e,t){return e&&ss(t,au(t),e)}(a,e)):function(e,t){return ss(e,$s(e),t)}(e,Mn(a,e))}else{if(!St[m])return s?e:{};a=function(e,t,r){var n,i,s,o=e.constructor;switch(t){case ae:return Qi(e);case G:case z:return new o(+e);case ue:return function(e,t){var r=t?Qi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case le:case ce:case he:case pe:case fe:case de:case me:case ge:case ve:return es(e,r);case X:return new o;case Y:case re:return new o(e);case ee:return(s=new(i=e).constructor(i.source,Ve.exec(i))).lastIndex=i.lastIndex,s;case te:return new o;case ne:return n=e,fn?tt(fn.call(n)):{}}}(e,m,u)}}o||(o=new Tn);var v=o.get(e);if(v)return v;o.set(e,a),Ba(e)?e.forEach(function(n){a.add(Dn(n,t,r,n,e,o))}):La(e)&&e.forEach(function(n,i){a.set(i,Dn(n,t,r,i,e,o))});var y=d?n:(c?l?Ms:Os:l?au:ou)(e);return Ht(y||e,function(n,i){y&&(n=e[i=n]),Rn(a,i,Dn(n,t,r,i,e,o))}),a}function Fn(e,t,r){var i=r.length;if(null==e)return!i;for(e=tt(e);i--;){var s=r[i],o=t[s],a=e[s];if(a===n&&!(s in e)||!o(a))return!1}return!0}function jn(e,t,r){if("function"!=typeof e)throw new it(o);return so(function(){e.apply(n,r)},t)}function Un(e,t,r,n){var s=-1,o=Yt,a=!0,u=e.length,l=[],c=t.length;if(!u)return l;r&&(t=Jt(t,gr(r))),n?(o=Zt,a=!1):t.length>=i&&(o=yr,a=!1,t=new En(t));e:for(;++s<u;){var h=e[s],p=null==r?h:r(h);if(h=n||0!==h?h:0,a&&p==p){for(var f=c;f--;)if(t[f]===p)continue e;l.push(h)}else o(t,p,n)||l.push(h)}return l}mn.templateSettings={escape:Ae,evaluate:Se,interpolate:ke,variable:"",imports:{_:mn}},mn.prototype=vn.prototype,mn.prototype.constructor=mn,yn.prototype=gn(vn.prototype),yn.prototype.constructor=yn,_n.prototype=gn(vn.prototype),_n.prototype.constructor=_n,bn.prototype.clear=function(){this.__data__=nn?nn(null):{},this.size=0},bn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},bn.prototype.get=function(e){var t=this.__data__;if(nn){var r=t[e];return r===u?n:r}return ct.call(t,e)?t[e]:n},bn.prototype.has=function(e){var t=this.__data__;return nn?t[e]!==n:ct.call(t,e)},bn.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nn&&t===n?u:t,this},xn.prototype.clear=function(){this.__data__=[],this.size=0},xn.prototype.delete=function(e){var t=this.__data__,r=Ln(t,e);return!(r<0||(r==t.length-1?t.pop():Nt.call(t,r,1),--this.size,0))},xn.prototype.get=function(e){var t=this.__data__,r=Ln(t,e);return r<0?n:t[r][1]},xn.prototype.has=function(e){return Ln(this.__data__,e)>-1},xn.prototype.set=function(e,t){var r=this.__data__,n=Ln(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},wn.prototype.clear=function(){this.size=0,this.__data__={hash:new bn,map:new(Qr||xn),string:new bn}},wn.prototype.delete=function(e){var t=Fs(this,e).delete(e);return this.size-=t?1:0,t},wn.prototype.get=function(e){return Fs(this,e).get(e)},wn.prototype.has=function(e){return Fs(this,e).has(e)},wn.prototype.set=function(e,t){var r=Fs(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},En.prototype.add=En.prototype.push=function(e){return this.__data__.set(e,u),this},En.prototype.has=function(e){return this.__data__.has(e)},Tn.prototype.clear=function(){this.__data__=new xn,this.size=0},Tn.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Tn.prototype.get=function(e){return this.__data__.get(e)},Tn.prototype.has=function(e){return this.__data__.has(e)},Tn.prototype.set=function(e,t){var r=this.__data__;if(r instanceof xn){var n=r.__data__;if(!Qr||n.length<i-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new wn(n)}return r.set(e,t),this.size=r.size,this};var $n=us(Xn),Vn=us(Yn,!0);function Gn(e,t){var r=!0;return $n(e,function(e,n,i){return r=!!t(e,n,i)}),r}function zn(e,t,r){for(var i=-1,s=e.length;++i<s;){var o=e[i],a=t(o);if(null!=a&&(u===n?a==a&&!Da(a):r(a,u)))var u=a,l=o}return l}function Wn(e,t){var r=[];return $n(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function Hn(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=Hs),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?Hn(a,t-1,r,n,i):Qt(i,a):n||(i[i.length]=a)}return i}var Kn=ls(),qn=ls(!0);function Xn(e,t){return e&&Kn(e,t,ou)}function Yn(e,t){return e&&qn(e,t,ou)}function Zn(e,t){return Xt(t,function(t){return Sa(e[t])})}function Jn(e,t){for(var r=0,i=(t=qi(t,e)).length;null!=e&&r<i;)e=e[ho(t[r++])];return r&&r==i?e:n}function Qn(e,t,r){var n=t(e);return _a(e)?n:Qt(n,r(e))}function ei(e){return null==e?e===n?ie:Z:hr&&hr in tt(e)?function(e){var t=ct.call(e,hr),r=e[hr];try{e[hr]=n;var i=!0}catch(e){}var s=ft.call(e);return i&&(t?e[hr]=r:delete e[hr]),s}(e):function(e){return ft.call(e)}(e)}function ti(e,t){return e>t}function ri(e,t){return null!=e&&ct.call(e,t)}function ni(e,t){return null!=e&&t in tt(e)}function ii(e,t,r){for(var i=r?Zt:Yt,s=e[0].length,o=e.length,a=o,u=Pe(o),l=1/0,c=[];a--;){var h=e[a];a&&t&&(h=Jt(h,gr(t))),l=Kr(h.length,l),u[a]=!r&&(t||s>=120&&h.length>=120)?new En(a&&h):n}h=e[0];var p=-1,f=u[0];e:for(;++p<s&&c.length<l;){var d=h[p],m=t?t(d):d;if(d=r||0!==d?d:0,!(f?yr(f,m):i(c,m,r))){for(a=o;--a;){var g=u[a];if(!(g?yr(g,m):i(e[a],m,r)))continue e}f&&f.push(m),c.push(d)}}return c}function si(e,t,r){var i=null==(e=ro(e,t=qi(t,e)))?e:e[ho(Ao(t))];return null==i?n:zt(i,e,r)}function oi(e){return Ra(e)&&ei(e)==U}function ai(e,t,r,i,s){return e===t||(null==e||null==t||!Ra(e)&&!Ra(t)?e!=e&&t!=t:function(e,t,r,i,s,o){var a=_a(e),u=_a(t),l=a?$:Gs(e),c=u?$:Gs(t),h=(l=l==U?J:l)==J,p=(c=c==U?J:c)==J,f=l==c;if(f&&Ea(e)){if(!Ea(t))return!1;a=!0,h=!1}if(f&&!h)return o||(o=new Tn),a||Fa(e)?Rs(e,t,r,i,s,o):function(e,t,r,n,i,s,o){switch(r){case ue:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ae:return!(e.byteLength!=t.byteLength||!s(new kt(e),new kt(t)));case G:case z:case Y:return ma(+e,+t);case H:return e.name==t.name&&e.message==t.message;case ee:case re:return e==t+"";case X:var a=Ar;case te:var u=n&d;if(a||(a=Cr),e.size!=t.size&&!u)return!1;var l=o.get(e);if(l)return l==t;n|=m,o.set(e,t);var c=Rs(a(e),a(t),n,i,s,o);return o.delete(e),c;case ne:if(fn)return fn.call(e)==fn.call(t)}return!1}(e,t,l,r,i,s,o);if(!(r&d)){var g=h&&ct.call(e,"__wrapped__"),v=p&&ct.call(t,"__wrapped__");if(g||v){var y=g?e.value():e,_=v?t.value():t;return o||(o=new Tn),s(y,_,r,i,o)}}return!!f&&(o||(o=new Tn),function(e,t,r,i,s,o){var a=r&d,u=Os(e),l=u.length,c=Os(t).length;if(l!=c&&!a)return!1;for(var h=l;h--;){var p=u[h];if(!(a?p in t:ct.call(t,p)))return!1}var f=o.get(e),m=o.get(t);if(f&&m)return f==t&&m==e;var g=!0;o.set(e,t),o.set(t,e);for(var v=a;++h<l;){p=u[h];var y=e[p],_=t[p];if(i)var b=a?i(_,y,p,t,e,o):i(y,_,p,e,t,o);if(!(b===n?y===_||s(y,_,r,i,o):b)){g=!1;break}v||(v="constructor"==p)}if(g&&!v){var x=e.constructor,w=t.constructor;x!=w&&"constructor"in e&&"constructor"in t&&!("function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w)&&(g=!1)}return o.delete(e),o.delete(t),g}(e,t,r,i,s,o))}(e,t,r,i,ai,s))}function ui(e,t,r,i){var s=r.length,o=s,a=!i;if(null==e)return!o;for(e=tt(e);s--;){var u=r[s];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++s<o;){var l=(u=r[s])[0],c=e[l],h=u[1];if(a&&u[2]){if(c===n&&!(l in e))return!1}else{var p=new Tn;if(i)var f=i(c,h,l,e,t,p);if(!(f===n?ai(h,c,d|m,i,p):f))return!1}}return!0}function li(e){return!(!Ia(e)||pt&&pt in e)&&(Sa(e)?gt:We).test(po(e))}function ci(e){return"function"==typeof e?e:null==e?Ou:"object"==typeof e?_a(e)?gi(e[0],e[1]):mi(e):$u(e)}function hi(e){if(!Js(e))return Wr(e);var t=[];for(var r in tt(e))ct.call(e,r)&&"constructor"!=r&&t.push(r);return t}function pi(e){if(!Ia(e))return function(e){var t=[];if(null!=e)for(var r in tt(e))t.push(r);return t}(e);var t=Js(e),r=[];for(var n in e)("constructor"!=n||!t&&ct.call(e,n))&&r.push(n);return r}function fi(e,t){return e<t}function di(e,t){var r=-1,n=xa(e)?Pe(e.length):[];return $n(e,function(e,i,s){n[++r]=t(e,i,s)}),n}function mi(e){var t=js(e);return 1==t.length&&t[0][2]?eo(t[0][0],t[0][1]):function(r){return r===e||ui(r,e,t)}}function gi(e,t){return Xs(e)&&Qs(t)?eo(ho(e),t):function(r){var i=tu(r,e);return i===n&&i===t?ru(r,e):ai(t,i,d|m)}}function vi(e,t,r,i,s){e!==t&&Kn(t,function(o,a){if(s||(s=new Tn),Ia(o))!function(e,t,r,i,s,o,a){var u=no(e,r),l=no(t,r),c=a.get(l);if(c)In(e,r,c);else{var h=o?o(u,l,r+"",e,t,a):n,p=h===n;if(p){var f=_a(l),d=!f&&Ea(l),m=!f&&!d&&Fa(l);h=l,f||d||m?_a(u)?h=u:wa(u)?h=is(u):d?(p=!1,h=Ji(l,!0)):m?(p=!1,h=es(l,!0)):h=[]:Ma(l)||ya(l)?(h=u,ya(u)?h=Ha(u):Ia(u)&&!Sa(u)||(h=Ws(l))):p=!1}p&&(a.set(l,h),s(h,l,i,o,a),a.delete(l)),In(e,r,h)}}(e,t,a,r,vi,i,s);else{var u=i?i(no(e,a),o,a+"",e,t,s):n;u===n&&(u=o),In(e,a,u)}},au)}function yi(e,t){var r=e.length;if(r)return Ks(t+=t<0?r:0,r)?e[t]:n}function _i(e,t,r){var n=-1;return t=Jt(t=t.length?Jt(t,function(e){return _a(e)?function(t){return Jn(t,1===e.length?e[0]:e)}:e}):[Ou],gr(Ds())),function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(di(e,function(e,r,i){return{criteria:Jt(t,function(t){return t(e)}),index:++n,value:e}}),function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,s=t.criteria,o=i.length,a=r.length;++n<o;){var u=ts(i[n],s[n]);if(u){if(n>=a)return u;var l=r[n];return u*("desc"==l?-1:1)}}return e.index-t.index}(e,t,r)})}function bi(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=Jn(e,o);r(a,o)&&Ci(s,qi(o,e),a)}return s}function xi(e,t,r,n){var i=n?ar:or,s=-1,o=t.length,a=e;for(e===t&&(t=is(t)),r&&(a=Jt(e,gr(r)));++s<o;)for(var u=0,l=t[s],c=r?r(l):l;(u=i(a,c,u,n))>-1;)a!==e&&Nt.call(a,u,1),Nt.call(e,u,1);return e}function wi(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==s){var s=i;Ks(i)?Nt.call(e,i,1):Ui(e,i)}}return e}function Ei(e,t){return e+Ur(Yr()*(t-e+1))}function Ti(e,t){var r="";if(!e||t<1||t>M)return r;do{t%2&&(r+=e),(t=Ur(t/2))&&(e+=e)}while(t);return r}function Ai(e,t){return oo(to(e,t,Ou),e+"")}function Si(e){return Sn(mu(e))}function ki(e,t){var r=mu(e);return lo(r,Nn(t,0,r.length))}function Ci(e,t,r,i){if(!Ia(e))return e;for(var s=-1,o=(t=qi(t,e)).length,a=o-1,u=e;null!=u&&++s<o;){var l=ho(t[s]),c=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(s!=a){var h=u[l];(c=i?i(h,l,u):n)===n&&(c=Ia(h)?h:Ks(t[s+1])?[]:{})}Rn(u,l,c),u=u[l]}return e}var Ii=sn?function(e,t){return sn.set(e,t),e}:Ou,Ri=Br?function(e,t){return Br(e,"toString",{configurable:!0,enumerable:!1,value:Iu(t),writable:!0})}:Ou;function Li(e){return lo(mu(e))}function Oi(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Pe(i);++n<i;)s[n]=e[n+t];return s}function Mi(e,t){var r;return $n(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function Pi(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=F){for(;n<i;){var s=n+i>>>1,o=e[s];null!==o&&!Da(o)&&(r?o<=t:o<t)?n=s+1:i=s}return i}return Bi(e,t,Ou,r)}function Bi(e,t,r,i){var s=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=r(t))!=t,u=null===t,l=Da(t),c=t===n;s<o;){var h=Ur((s+o)/2),p=r(e[h]),f=p!==n,d=null===p,m=p==p,g=Da(p);if(a)var v=i||m;else v=c?m&&(i||f):u?m&&f&&(i||!d):l?m&&f&&!d&&(i||!g):!d&&!g&&(i?p<=t:p<t);v?s=h+1:o=h}return Kr(o,D)}function Ni(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var o=e[r],a=t?t(o):o;if(!r||!ma(a,u)){var u=a;s[i++]=0===o?0:o}}return s}function Di(e){return"number"==typeof e?e:Da(e)?B:+e}function Fi(e){if("string"==typeof e)return e;if(_a(e))return Jt(e,Fi)+"";if(Da(e))return dn?dn.call(e):"";var t=e+"";return"0"==t&&1/e==-O?"-0":t}function ji(e,t,r){var n=-1,s=Yt,o=e.length,a=!0,u=[],l=u;if(r)a=!1,s=Zt;else if(o>=i){var c=t?null:Ts(e);if(c)return Cr(c);a=!1,s=yr,l=new En}else l=t?[]:u;e:for(;++n<o;){var h=e[n],p=t?t(h):h;if(h=r||0!==h?h:0,a&&p==p){for(var f=l.length;f--;)if(l[f]===p)continue e;t&&l.push(p),u.push(h)}else s(l,p,r)||(l!==u&&l.push(p),u.push(h))}return u}function Ui(e,t){return null==(e=ro(e,t=qi(t,e)))||delete e[ho(Ao(t))]}function $i(e,t,r,n){return Ci(e,t,r(Jn(e,t)),n)}function Vi(e,t,r,n){for(var i=e.length,s=n?i:-1;(n?s--:++s<i)&&t(e[s],s,e););return r?Oi(e,n?0:s,n?s+1:i):Oi(e,n?s+1:0,n?i:s)}function Gi(e,t){var r=e;return r instanceof _n&&(r=r.value()),er(t,function(e,t){return t.func.apply(t.thisArg,Qt([e],t.args))},r)}function zi(e,t,r){var n=e.length;if(n<2)return n?ji(e[0]):[];for(var i=-1,s=Pe(n);++i<n;)for(var o=e[i],a=-1;++a<n;)a!=i&&(s[i]=Un(s[i]||o,e[a],t,r));return ji(Hn(s,1),t,r)}function Wi(e,t,r){for(var i=-1,s=e.length,o=t.length,a={};++i<s;){var u=i<o?t[i]:n;r(a,e[i],u)}return a}function Hi(e){return wa(e)?e:[]}function Ki(e){return"function"==typeof e?e:Ou}function qi(e,t){return _a(e)?e:Xs(e,t)?[e]:co(Ka(e))}var Xi=Ai;function Yi(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Oi(e,t,r)}var Zi=Nr||function(e){return Ot.clearTimeout(e)};function Ji(e,t){if(t)return e.slice();var r=e.length,n=Rt?Rt(r):new e.constructor(r);return e.copy(n),n}function Qi(e){var t=new e.constructor(e.byteLength);return new kt(t).set(new kt(e)),t}function es(e,t){var r=t?Qi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ts(e,t){if(e!==t){var r=e!==n,i=null===e,s=e==e,o=Da(e),a=t!==n,u=null===t,l=t==t,c=Da(t);if(!u&&!c&&!o&&e>t||o&&a&&l&&!u&&!c||i&&a&&l||!r&&l||!s)return 1;if(!i&&!o&&!c&&e<t||c&&r&&s&&!i&&!o||u&&r&&s||!a&&s||!l)return-1}return 0}function rs(e,t,r,n){for(var i=-1,s=e.length,o=r.length,a=-1,u=t.length,l=Hr(s-o,0),c=Pe(u+l),h=!n;++a<u;)c[a]=t[a];for(;++i<o;)(h||i<s)&&(c[r[i]]=e[i]);for(;l--;)c[a++]=e[i++];return c}function ns(e,t,r,n){for(var i=-1,s=e.length,o=-1,a=r.length,u=-1,l=t.length,c=Hr(s-a,0),h=Pe(c+l),p=!n;++i<c;)h[i]=e[i];for(var f=i;++u<l;)h[f+u]=t[u];for(;++o<a;)(p||i<s)&&(h[f+r[o]]=e[i++]);return h}function is(e,t){var r=-1,n=e.length;for(t||(t=Pe(n));++r<n;)t[r]=e[r];return t}function ss(e,t,r,i){var s=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var u=t[o],l=i?i(r[u],e[u],u,r,e):n;l===n&&(l=e[u]),s?Pn(r,u,l):Rn(r,u,l)}return r}function os(e,t){return function(r,n){var i=_a(r)?Wt:On,s=t?t():{};return i(r,e,Ds(n,2),s)}}function as(e){return Ai(function(t,r){var i=-1,s=r.length,o=s>1?r[s-1]:n,a=s>2?r[2]:n;for(o=e.length>3&&"function"==typeof o?(s--,o):n,a&&qs(r[0],r[1],a)&&(o=s<3?n:o,s=1),t=tt(t);++i<s;){var u=r[i];u&&e(t,u,i,o)}return t})}function us(e,t){return function(r,n){if(null==r)return r;if(!xa(r))return e(r,n);for(var i=r.length,s=t?i:-1,o=tt(r);(t?s--:++s<i)&&!1!==n(o[s],s,o););return r}}function ls(e){return function(t,r,n){for(var i=-1,s=tt(t),o=n(t),a=o.length;a--;){var u=o[e?a:++i];if(!1===r(s[u],u,s))break}return t}}function cs(e){return function(t){var r=Tr(t=Ka(t))?Lr(t):n,i=r?r[0]:t.charAt(0),s=r?Yi(r,1).join(""):t.slice(1);return i[e]()+s}}function hs(e){return function(t){return er(Su(yu(t).replace(vt,"")),e,"")}}function ps(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=gn(e.prototype),n=e.apply(r,t);return Ia(n)?n:r}}function fs(e){return function(t,r,i){var s=tt(t);if(!xa(t)){var o=Ds(r,3);t=ou(t),r=function(e){return o(s[e],e,s)}}var a=e(t,r,i);return a>-1?s[o?t[a]:a]:n}}function ds(e){return Ls(function(t){var r=t.length,i=r,s=yn.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new it(o);if(s&&!u&&"wrapper"==Bs(a))var u=new yn([],!0)}for(i=u?i:r;++i<r;){var l=Bs(a=t[i]),c="wrapper"==l?Ps(a):n;u=c&&Ys(c[0])&&c[1]==(E|_|x|T)&&!c[4].length&&1==c[9]?u[Bs(c[0])].apply(u,c[3]):1==a.length&&Ys(a)?u[l]():u.thru(a)}return function(){var e=arguments,n=e[0];if(u&&1==e.length&&_a(n))return u.plant(n).value();for(var i=0,s=r?t[i].apply(this,e):n;++i<r;)s=t[i].call(this,s);return s}})}function ms(e,t,r,i,s,o,a,u,l,c){var h=t&E,p=t&g,f=t&v,d=t&(_|b),m=t&A,y=f?n:ps(e);return function g(){for(var v=arguments.length,_=Pe(v),b=v;b--;)_[b]=arguments[b];if(d)var x=Ns(g),w=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(_,x);if(i&&(_=rs(_,i,s,d)),o&&(_=ns(_,o,a,d)),v-=w,d&&v<c){var E=kr(_,x);return ws(e,t,ms,g.placeholder,r,_,E,u,l,c-v)}var T=p?r:this,A=f?T[e]:e;return v=_.length,u?_=function(e,t){for(var r=e.length,i=Kr(t.length,r),s=is(e);i--;){var o=t[i];e[i]=Ks(o,r)?s[o]:n}return e}(_,u):m&&v>1&&_.reverse(),h&&l<v&&(_.length=l),this&&this!==Ot&&this instanceof g&&(A=y||ps(A)),A.apply(T,_)}}function gs(e,t){return function(r,n){return function(e,t,r,n){return Xn(e,function(e,i,s){t(n,r(e),i,s)}),n}(r,e,t(n),{})}}function vs(e,t){return function(r,i){var s;if(r===n&&i===n)return t;if(r!==n&&(s=r),i!==n){if(s===n)return i;"string"==typeof r||"string"==typeof i?(r=Fi(r),i=Fi(i)):(r=Di(r),i=Di(i)),s=e(r,i)}return s}}function ys(e){return Ls(function(t){return t=Jt(t,gr(Ds())),Ai(function(r){var n=this;return e(t,function(e){return zt(e,n,r)})})})}function _s(e,t){var r=(t=t===n?" ":Fi(t)).length;if(r<2)return r?Ti(t,e):t;var i=Ti(t,jr(e/Rr(t)));return Tr(t)?Yi(Lr(i),0,e).join(""):i.slice(0,e)}function bs(e){return function(t,r,i){return i&&"number"!=typeof i&&qs(t,r,i)&&(r=i=n),t=Va(t),r===n?(r=t,t=0):r=Va(r),function(e,t,r,n){for(var i=-1,s=Hr(jr((t-e)/(r||1)),0),o=Pe(s);s--;)o[n?s:++i]=e,e+=r;return o}(t,r,i=i===n?t<r?1:-1:Va(i),e)}}function xs(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=Wa(t),r=Wa(r)),e(t,r)}}function ws(e,t,r,i,s,o,a,u,l,c){var h=t&_;t|=h?x:w,(t&=~(h?w:x))&y||(t&=~(g|v));var p=[e,t,s,h?o:n,h?a:n,h?n:o,h?n:a,u,l,c],f=r.apply(n,p);return Ys(e)&&io(f,p),f.placeholder=i,ao(f,e,t)}function Es(e){var t=et[e];return function(e,r){if(e=Wa(e),(r=null==r?0:Kr(Ga(r),292))&&Gr(e)){var n=(Ka(e)+"e").split("e");return+((n=(Ka(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Ts=tn&&1/Cr(new tn([,-0]))[1]==O?function(e){return new tn(e)}:Du;function As(e){return function(t){var r=Gs(t);return r==X?Ar(t):r==te?Ir(t):function(e,t){return Jt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ss(e,t,r,i,s,a,u,l){var h=t&v;if(!h&&"function"!=typeof e)throw new it(o);var p=i?i.length:0;if(p||(t&=~(x|w),i=s=n),u=u===n?u:Hr(Ga(u),0),l=l===n?l:Ga(l),p-=s?s.length:0,t&w){var f=i,d=s;i=s=n}var m=h?n:Ps(e),A=[e,t,r,i,s,f,d,a,u,l];if(m&&function(e,t){var r=e[1],n=t[1],i=r|n,s=i<(g|v|E),o=n==E&&r==_||n==E&&r==T&&e[7].length<=t[8]||n==(E|T)&&t[7].length<=t[8]&&r==_;if(!s&&!o)return e;n&g&&(e[2]=t[2],i|=r&g?0:y);var a=t[3];if(a){var u=e[3];e[3]=u?rs(u,a,t[4]):a,e[4]=u?kr(e[3],c):t[4]}(a=t[5])&&(u=e[5],e[5]=u?ns(u,a,t[6]):a,e[6]=u?kr(e[5],c):t[6]),(a=t[7])&&(e[7]=a),n&E&&(e[8]=null==e[8]?t[8]:Kr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(A,m),e=A[0],t=A[1],r=A[2],i=A[3],s=A[4],!(l=A[9]=A[9]===n?h?0:e.length:Hr(A[9]-p,0))&&t&(_|b)&&(t&=~(_|b)),t&&t!=g)S=t==_||t==b?function(e,t,r){var i=ps(e);return function s(){for(var o=arguments.length,a=Pe(o),u=o,l=Ns(s);u--;)a[u]=arguments[u];var c=o<3&&a[0]!==l&&a[o-1]!==l?[]:kr(a,l);return(o-=c.length)<r?ws(e,t,ms,s.placeholder,n,a,c,n,n,r-o):zt(this&&this!==Ot&&this instanceof s?i:e,this,a)}}(e,t,l):t!=x&&t!=(g|x)||s.length?ms.apply(n,A):function(e,t,r,n){var i=t&g,s=ps(e);return function t(){for(var o=-1,a=arguments.length,u=-1,l=n.length,c=Pe(l+a),h=this&&this!==Ot&&this instanceof t?s:e;++u<l;)c[u]=n[u];for(;a--;)c[u++]=arguments[++o];return zt(h,i?r:this,c)}}(e,t,r,i);else var S=function(e,t,r){var n=t&g,i=ps(e);return function t(){return(this&&this!==Ot&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return ao((m?Ii:io)(S,A),e,t)}function ks(e,t,r,i){return e===n||ma(e,at[r])&&!ct.call(i,r)?t:e}function Cs(e,t,r,i,s,o){return Ia(e)&&Ia(t)&&(o.set(t,e),vi(e,t,n,Cs,o),o.delete(t)),e}function Is(e){return Ma(e)?n:e}function Rs(e,t,r,i,s,o){var a=r&d,u=e.length,l=t.length;if(u!=l&&!(a&&l>u))return!1;var c=o.get(e),h=o.get(t);if(c&&h)return c==t&&h==e;var p=-1,f=!0,g=r&m?new En:n;for(o.set(e,t),o.set(t,e);++p<u;){var v=e[p],y=t[p];if(i)var _=a?i(y,v,p,t,e,o):i(v,y,p,e,t,o);if(_!==n){if(_)continue;f=!1;break}if(g){if(!rr(t,function(e,t){if(!yr(g,t)&&(v===e||s(v,e,r,i,o)))return g.push(t)})){f=!1;break}}else if(v!==y&&!s(v,y,r,i,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function Ls(e){return oo(to(e,n,bo),e+"")}function Os(e){return Qn(e,ou,$s)}function Ms(e){return Qn(e,au,Vs)}var Ps=sn?function(e){return sn.get(e)}:Du;function Bs(e){for(var t=e.name+"",r=on[t],n=ct.call(on,t)?r.length:0;n--;){var i=r[n],s=i.func;if(null==s||s==e)return i.name}return t}function Ns(e){return(ct.call(mn,"placeholder")?mn:e).placeholder}function Ds(){var e=mn.iteratee||Mu;return e=e===Mu?ci:e,arguments.length?e(arguments[0],arguments[1]):e}function Fs(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function js(e){for(var t=ou(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Qs(i)]}return t}function Us(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return li(r)?r:n}var $s=$r?function(e){return null==e?[]:(e=tt(e),Xt($r(e),function(t){return Pt.call(e,t)}))}:zu,Vs=$r?function(e){for(var t=[];e;)Qt(t,$s(e)),e=Lt(e);return t}:zu,Gs=ei;function zs(e,t,r){for(var n=-1,i=(t=qi(t,e)).length,s=!1;++n<i;){var o=ho(t[n]);if(!(s=null!=e&&r(e,o)))break;e=e[o]}return s||++n!=i?s:!!(i=null==e?0:e.length)&&Ca(i)&&Ks(o,i)&&(_a(e)||ya(e))}function Ws(e){return"function"!=typeof e.constructor||Js(e)?{}:gn(Lt(e))}function Hs(e){return _a(e)||ya(e)||!!(Dt&&e&&e[Dt])}function Ks(e,t){var r=typeof e;return!!(t=null==t?M:t)&&("number"==r||"symbol"!=r&&Ke.test(e))&&e>-1&&e%1==0&&e<t}function qs(e,t,r){if(!Ia(r))return!1;var n=typeof t;return!!("number"==n?xa(r)&&Ks(t,r.length):"string"==n&&t in r)&&ma(r[t],e)}function Xs(e,t){if(_a(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!Da(e))||Ie.test(e)||!Ce.test(e)||null!=t&&e in tt(t)}function Ys(e){var t=Bs(e),r=mn[t];if("function"!=typeof r||!(t in _n.prototype))return!1;if(e===r)return!0;var n=Ps(r);return!!n&&e===n[0]}(Jr&&Gs(new Jr(new ArrayBuffer(1)))!=ue||Qr&&Gs(new Qr)!=X||en&&"[object Promise]"!=Gs(en.resolve())||tn&&Gs(new tn)!=te||rn&&Gs(new rn)!=se)&&(Gs=function(e){var t=ei(e),r=t==J?e.constructor:n,i=r?po(r):"";if(i)switch(i){case an:return ue;case un:return X;case ln:return"[object Promise]";case cn:return te;case hn:return se}return t});var Zs=ut?Sa:Wu;function Js(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||at)}function Qs(e){return e==e&&!Ia(e)}function eo(e,t){return function(r){return null!=r&&r[e]===t&&(t!==n||e in tt(r))}}function to(e,t,r){return t=Hr(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=Hr(n.length-t,0),o=Pe(s);++i<s;)o[i]=n[t+i];i=-1;for(var a=Pe(t+1);++i<t;)a[i]=n[i];return a[t]=r(o),zt(e,this,a)}}function ro(e,t){return t.length<2?e:Jn(e,Oi(t,0,-1))}function no(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var io=uo(Ii),so=Fr||function(e,t){return Ot.setTimeout(e,t)},oo=uo(Ri);function ao(e,t,r){var n=t+"";return oo(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(Be,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ht(j,function(r){var n="_."+r[0];t&r[1]&&!Yt(e,n)&&e.push(n)}),e.sort()}(function(e){var t=e.match(Ne);return t?t[1].split(De):[]}(n),r)))}function uo(e){var t=0,r=0;return function(){var i=qr(),s=I-(i-r);if(r=i,s>0){if(++t>=C)return arguments[0]}else t=0;return e.apply(n,arguments)}}function lo(e,t){var r=-1,i=e.length,s=i-1;for(t=t===n?i:t;++r<t;){var o=Ei(r,s),a=e[o];e[o]=e[r],e[r]=a}return e.length=t,e}var co=function(e){var t=la(e,function(e){return r.size===l&&r.clear(),e}),r=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Re,function(e,r,n,i){t.push(n?i.replace(Ue,"$1"):r||e)}),t});function ho(e){if("string"==typeof e||Da(e))return e;var t=e+"";return"0"==t&&1/e==-O?"-0":t}function po(e){if(null!=e){try{return lt.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function fo(e){if(e instanceof _n)return e.clone();var t=new yn(e.__wrapped__,e.__chain__);return t.__actions__=is(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var mo=Ai(function(e,t){return wa(e)?Un(e,Hn(t,1,wa,!0)):[]}),go=Ai(function(e,t){var r=Ao(t);return wa(r)&&(r=n),wa(e)?Un(e,Hn(t,1,wa,!0),Ds(r,2)):[]}),vo=Ai(function(e,t){var r=Ao(t);return wa(r)&&(r=n),wa(e)?Un(e,Hn(t,1,wa,!0),n,r):[]});function yo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:Ga(r);return i<0&&(i=Hr(n+i,0)),sr(e,Ds(t,3),i)}function _o(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var s=i-1;return r!==n&&(s=Ga(r),s=r<0?Hr(i+s,0):Kr(s,i-1)),sr(e,Ds(t,3),s,!0)}function bo(e){return null!=e&&e.length?Hn(e,1):[]}function xo(e){return e&&e.length?e[0]:n}var wo=Ai(function(e){var t=Jt(e,Hi);return t.length&&t[0]===e[0]?ii(t):[]}),Eo=Ai(function(e){var t=Ao(e),r=Jt(e,Hi);return t===Ao(r)?t=n:r.pop(),r.length&&r[0]===e[0]?ii(r,Ds(t,2)):[]}),To=Ai(function(e){var t=Ao(e),r=Jt(e,Hi);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?ii(r,n,t):[]});function Ao(e){var t=null==e?0:e.length;return t?e[t-1]:n}var So=Ai(ko);function ko(e,t){return e&&e.length&&t&&t.length?xi(e,t):e}var Co=Ls(function(e,t){var r=null==e?0:e.length,n=Bn(e,t);return wi(e,Jt(t,function(e){return Ks(e,r)?+e:e}).sort(ts)),n});function Io(e){return null==e?e:Zr.call(e)}var Ro=Ai(function(e){return ji(Hn(e,1,wa,!0))}),Lo=Ai(function(e){var t=Ao(e);return wa(t)&&(t=n),ji(Hn(e,1,wa,!0),Ds(t,2))}),Oo=Ai(function(e){var t=Ao(e);return t="function"==typeof t?t:n,ji(Hn(e,1,wa,!0),n,t)});function Mo(e){if(!e||!e.length)return[];var t=0;return e=Xt(e,function(e){if(wa(e))return t=Hr(e.length,t),!0}),dr(t,function(t){return Jt(e,cr(t))})}function Po(e,t){if(!e||!e.length)return[];var r=Mo(e);return null==t?r:Jt(r,function(e){return zt(t,n,e)})}var Bo=Ai(function(e,t){return wa(e)?Un(e,t):[]}),No=Ai(function(e){return zi(Xt(e,wa))}),Do=Ai(function(e){var t=Ao(e);return wa(t)&&(t=n),zi(Xt(e,wa),Ds(t,2))}),Fo=Ai(function(e){var t=Ao(e);return t="function"==typeof t?t:n,zi(Xt(e,wa),n,t)}),jo=Ai(Mo);var Uo=Ai(function(e){var t=e.length,r=t>1?e[t-1]:n;return Po(e,r="function"==typeof r?(e.pop(),r):n)});function $o(e){var t=mn(e);return t.__chain__=!0,t}function Vo(e,t){return t(e)}var Go=Ls(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,s=function(t){return Bn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof _n&&Ks(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:Vo,args:[s],thisArg:n}),new yn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(s)});var zo=os(function(e,t,r){ct.call(e,r)?++e[r]:Pn(e,r,1)});var Wo=fs(yo),Ho=fs(_o);function Ko(e,t){return(_a(e)?Ht:$n)(e,Ds(t,3))}function qo(e,t){return(_a(e)?Kt:Vn)(e,Ds(t,3))}var Xo=os(function(e,t,r){ct.call(e,r)?e[r].push(t):Pn(e,r,[t])});var Yo=Ai(function(e,t,r){var n=-1,i="function"==typeof t,s=xa(e)?Pe(e.length):[];return $n(e,function(e){s[++n]=i?zt(t,e,r):si(e,t,r)}),s}),Zo=os(function(e,t,r){Pn(e,r,t)});function Jo(e,t){return(_a(e)?Jt:di)(e,Ds(t,3))}var Qo=os(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});var ea=Ai(function(e,t){if(null==e)return[];var r=t.length;return r>1&&qs(e,t[0],t[1])?t=[]:r>2&&qs(t[0],t[1],t[2])&&(t=[t[0]]),_i(e,Hn(t,1),[])}),ta=Dr||function(){return Ot.Date.now()};function ra(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Ss(e,E,n,n,n,n,t)}function na(e,t){var r;if("function"!=typeof t)throw new it(o);return e=Ga(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var ia=Ai(function(e,t,r){var n=g;if(r.length){var i=kr(r,Ns(ia));n|=x}return Ss(e,n,t,r,i)}),sa=Ai(function(e,t,r){var n=g|v;if(r.length){var i=kr(r,Ns(sa));n|=x}return Ss(t,n,e,r,i)});function oa(e,t,r){var i,s,a,u,l,c,h=0,p=!1,f=!1,d=!0;if("function"!=typeof e)throw new it(o);function m(t){var r=i,o=s;return i=s=n,h=t,u=e.apply(o,r)}function g(e){var r=e-c;return c===n||r>=t||r<0||f&&e-h>=a}function v(){var e=ta();if(g(e))return y(e);l=so(v,function(e){var r=t-(e-c);return f?Kr(r,a-(e-h)):r}(e))}function y(e){return l=n,d&&i?m(e):(i=s=n,u)}function _(){var e=ta(),r=g(e);if(i=arguments,s=this,c=e,r){if(l===n)return function(e){return h=e,l=so(v,t),p?m(e):u}(c);if(f)return Zi(l),l=so(v,t),m(c)}return l===n&&(l=so(v,t)),u}return t=Wa(t)||0,Ia(r)&&(p=!!r.leading,a=(f="maxWait"in r)?Hr(Wa(r.maxWait)||0,t):a,d="trailing"in r?!!r.trailing:d),_.cancel=function(){l!==n&&Zi(l),h=0,i=c=s=l=n},_.flush=function(){return l===n?u:y(ta())},_}var aa=Ai(function(e,t){return jn(e,1,t)}),ua=Ai(function(e,t,r){return jn(e,Wa(t)||0,r)});function la(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new it(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(la.Cache||wn),r}function ca(e){if("function"!=typeof e)throw new it(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}la.Cache=wn;var ha=Xi(function(e,t){var r=(t=1==t.length&&_a(t[0])?Jt(t[0],gr(Ds())):Jt(Hn(t,1),gr(Ds()))).length;return Ai(function(n){for(var i=-1,s=Kr(n.length,r);++i<s;)n[i]=t[i].call(this,n[i]);return zt(e,this,n)})}),pa=Ai(function(e,t){var r=kr(t,Ns(pa));return Ss(e,x,n,t,r)}),fa=Ai(function(e,t){var r=kr(t,Ns(fa));return Ss(e,w,n,t,r)}),da=Ls(function(e,t){return Ss(e,T,n,n,n,t)});function ma(e,t){return e===t||e!=e&&t!=t}var ga=xs(ti),va=xs(function(e,t){return e>=t}),ya=oi(function(){return arguments}())?oi:function(e){return Ra(e)&&ct.call(e,"callee")&&!Pt.call(e,"callee")},_a=Pe.isArray,ba=Ft?gr(Ft):function(e){return Ra(e)&&ei(e)==ae};function xa(e){return null!=e&&Ca(e.length)&&!Sa(e)}function wa(e){return Ra(e)&&xa(e)}var Ea=Vr||Wu,Ta=jt?gr(jt):function(e){return Ra(e)&&ei(e)==z};function Aa(e){if(!Ra(e))return!1;var t=ei(e);return t==H||t==W||"string"==typeof e.message&&"string"==typeof e.name&&!Ma(e)}function Sa(e){if(!Ia(e))return!1;var t=ei(e);return t==K||t==q||t==V||t==Q}function ka(e){return"number"==typeof e&&e==Ga(e)}function Ca(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=M}function Ia(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ra(e){return null!=e&&"object"==typeof e}var La=Ut?gr(Ut):function(e){return Ra(e)&&Gs(e)==X};function Oa(e){return"number"==typeof e||Ra(e)&&ei(e)==Y}function Ma(e){if(!Ra(e)||ei(e)!=J)return!1;var t=Lt(e);if(null===t)return!0;var r=ct.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&<.call(r)==dt}var Pa=$t?gr($t):function(e){return Ra(e)&&ei(e)==ee};var Ba=Vt?gr(Vt):function(e){return Ra(e)&&Gs(e)==te};function Na(e){return"string"==typeof e||!_a(e)&&Ra(e)&&ei(e)==re}function Da(e){return"symbol"==typeof e||Ra(e)&&ei(e)==ne}var Fa=Gt?gr(Gt):function(e){return Ra(e)&&Ca(e.length)&&!!At[ei(e)]};var ja=xs(fi),Ua=xs(function(e,t){return e<=t});function $a(e){if(!e)return[];if(xa(e))return Na(e)?Lr(e):is(e);if(nr&&e[nr])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[nr]());var t=Gs(e);return(t==X?Ar:t==te?Cr:mu)(e)}function Va(e){return e?(e=Wa(e))===O||e===-O?(e<0?-1:1)*P:e==e?e:0:0===e?e:0}function Ga(e){var t=Va(e),r=t%1;return t==t?r?t-r:t:0}function za(e){return e?Nn(Ga(e),0,N):0}function Wa(e){if("number"==typeof e)return e;if(Da(e))return B;if(Ia(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ia(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=mr(e);var r=ze.test(e);return r||He.test(e)?It(e.slice(2),r?2:8):Ge.test(e)?B:+e}function Ha(e){return ss(e,au(e))}function Ka(e){return null==e?"":Fi(e)}var qa=as(function(e,t){if(Js(t)||xa(t))ss(t,ou(t),e);else for(var r in t)ct.call(t,r)&&Rn(e,r,t[r])}),Xa=as(function(e,t){ss(t,au(t),e)}),Ya=as(function(e,t,r,n){ss(t,au(t),e,n)}),Za=as(function(e,t,r,n){ss(t,ou(t),e,n)}),Ja=Ls(Bn);var Qa=Ai(function(e,t){e=tt(e);var r=-1,i=t.length,s=i>2?t[2]:n;for(s&&qs(t[0],t[1],s)&&(i=1);++r<i;)for(var o=t[r],a=au(o),u=-1,l=a.length;++u<l;){var c=a[u],h=e[c];(h===n||ma(h,at[c])&&!ct.call(e,c))&&(e[c]=o[c])}return e}),eu=Ai(function(e){return e.push(n,Cs),zt(lu,n,e)});function tu(e,t,r){var i=null==e?n:Jn(e,t);return i===n?r:i}function ru(e,t){return null!=e&&zs(e,t,ni)}var nu=gs(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ft.call(t)),e[t]=r},Iu(Ou)),iu=gs(function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ft.call(t)),ct.call(e,t)?e[t].push(r):e[t]=[r]},Ds),su=Ai(si);function ou(e){return xa(e)?An(e):hi(e)}function au(e){return xa(e)?An(e,!0):pi(e)}var uu=as(function(e,t,r){vi(e,t,r)}),lu=as(function(e,t,r,n){vi(e,t,r,n)}),cu=Ls(function(e,t){var r={};if(null==e)return r;var n=!1;t=Jt(t,function(t){return t=qi(t,e),n||(n=t.length>1),t}),ss(e,Ms(e),r),n&&(r=Dn(r,h|p|f,Is));for(var i=t.length;i--;)Ui(r,t[i]);return r});var hu=Ls(function(e,t){return null==e?{}:function(e,t){return bi(e,t,function(t,r){return ru(e,r)})}(e,t)});function pu(e,t){if(null==e)return{};var r=Jt(Ms(e),function(e){return[e]});return t=Ds(t),bi(e,r,function(e,r){return t(e,r[0])})}var fu=As(ou),du=As(au);function mu(e){return null==e?[]:vr(e,ou(e))}var gu=hs(function(e,t,r){return t=t.toLowerCase(),e+(r?vu(t):t)});function vu(e){return Au(Ka(e).toLowerCase())}function yu(e){return(e=Ka(e))&&e.replace(qe,xr).replace(yt,"")}var _u=hs(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),bu=hs(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),xu=cs("toLowerCase");var wu=hs(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()});var Eu=hs(function(e,t,r){return e+(r?" ":"")+Au(t)});var Tu=hs(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Au=cs("toUpperCase");function Su(e,t,r){return e=Ka(e),(t=r?n:t)===n?function(e){return wt.test(e)}(e)?function(e){return e.match(bt)||[]}(e):function(e){return e.match(Fe)||[]}(e):e.match(t)||[]}var ku=Ai(function(e,t){try{return zt(e,n,t)}catch(e){return Aa(e)?e:new Je(e)}}),Cu=Ls(function(e,t){return Ht(t,function(t){t=ho(t),Pn(e,t,ia(e[t],e))}),e});function Iu(e){return function(){return e}}var Ru=ds(),Lu=ds(!0);function Ou(e){return e}function Mu(e){return ci("function"==typeof e?e:Dn(e,h))}var Pu=Ai(function(e,t){return function(r){return si(r,e,t)}}),Bu=Ai(function(e,t){return function(r){return si(e,r,t)}});function Nu(e,t,r){var n=ou(t),i=Zn(t,n);null!=r||Ia(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Zn(t,ou(t)));var s=!(Ia(r)&&"chain"in r&&!r.chain),o=Sa(e);return Ht(i,function(r){var n=t[r];e[r]=n,o&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__);return(r.__actions__=is(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Qt([this.value()],arguments))})}),e}function Du(){}var Fu=ys(Jt),ju=ys(qt),Uu=ys(rr);function $u(e){return Xs(e)?cr(ho(e)):function(e){return function(t){return Jn(t,e)}}(e)}var Vu=bs(),Gu=bs(!0);function zu(){return[]}function Wu(){return!1}var Hu=vs(function(e,t){return e+t},0),Ku=Es("ceil"),qu=vs(function(e,t){return e/t},1),Xu=Es("floor");var Yu,Zu=vs(function(e,t){return e*t},1),Ju=Es("round"),Qu=vs(function(e,t){return e-t},0);return mn.after=function(e,t){if("function"!=typeof t)throw new it(o);return e=Ga(e),function(){if(--e<1)return t.apply(this,arguments)}},mn.ary=ra,mn.assign=qa,mn.assignIn=Xa,mn.assignInWith=Ya,mn.assignWith=Za,mn.at=Ja,mn.before=na,mn.bind=ia,mn.bindAll=Cu,mn.bindKey=sa,mn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return _a(e)?e:[e]},mn.chain=$o,mn.chunk=function(e,t,r){t=(r?qs(e,t,r):t===n)?1:Hr(Ga(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var s=0,o=0,a=Pe(jr(i/t));s<i;)a[o++]=Oi(e,s,s+=t);return a},mn.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var s=e[t];s&&(i[n++]=s)}return i},mn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Pe(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Qt(_a(r)?is(r):[r],Hn(t,1))},mn.cond=function(e){var t=null==e?0:e.length,r=Ds();return e=t?Jt(e,function(e){if("function"!=typeof e[1])throw new it(o);return[r(e[0]),e[1]]}):[],Ai(function(r){for(var n=-1;++n<t;){var i=e[n];if(zt(i[0],this,r))return zt(i[1],this,r)}})},mn.conforms=function(e){return function(e){var t=ou(e);return function(r){return Fn(r,e,t)}}(Dn(e,h))},mn.constant=Iu,mn.countBy=zo,mn.create=function(e,t){var r=gn(e);return null==t?r:Mn(r,t)},mn.curry=function e(t,r,i){var s=Ss(t,_,n,n,n,n,n,r=i?n:r);return s.placeholder=e.placeholder,s},mn.curryRight=function e(t,r,i){var s=Ss(t,b,n,n,n,n,n,r=i?n:r);return s.placeholder=e.placeholder,s},mn.debounce=oa,mn.defaults=Qa,mn.defaultsDeep=eu,mn.defer=aa,mn.delay=ua,mn.difference=mo,mn.differenceBy=go,mn.differenceWith=vo,mn.drop=function(e,t,r){var i=null==e?0:e.length;return i?Oi(e,(t=r||t===n?1:Ga(t))<0?0:t,i):[]},mn.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?Oi(e,0,(t=i-(t=r||t===n?1:Ga(t)))<0?0:t):[]},mn.dropRightWhile=function(e,t){return e&&e.length?Vi(e,Ds(t,3),!0,!0):[]},mn.dropWhile=function(e,t){return e&&e.length?Vi(e,Ds(t,3),!0):[]},mn.fill=function(e,t,r,i){var s=null==e?0:e.length;return s?(r&&"number"!=typeof r&&qs(e,t,r)&&(r=0,i=s),function(e,t,r,i){var s=e.length;for((r=Ga(r))<0&&(r=-r>s?0:s+r),(i=i===n||i>s?s:Ga(i))<0&&(i+=s),i=r>i?0:za(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},mn.filter=function(e,t){return(_a(e)?Xt:Wn)(e,Ds(t,3))},mn.flatMap=function(e,t){return Hn(Jo(e,t),1)},mn.flatMapDeep=function(e,t){return Hn(Jo(e,t),O)},mn.flatMapDepth=function(e,t,r){return r=r===n?1:Ga(r),Hn(Jo(e,t),r)},mn.flatten=bo,mn.flattenDeep=function(e){return null!=e&&e.length?Hn(e,O):[]},mn.flattenDepth=function(e,t){return null!=e&&e.length?Hn(e,t=t===n?1:Ga(t)):[]},mn.flip=function(e){return Ss(e,A)},mn.flow=Ru,mn.flowRight=Lu,mn.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},mn.functions=function(e){return null==e?[]:Zn(e,ou(e))},mn.functionsIn=function(e){return null==e?[]:Zn(e,au(e))},mn.groupBy=Xo,mn.initial=function(e){return null!=e&&e.length?Oi(e,0,-1):[]},mn.intersection=wo,mn.intersectionBy=Eo,mn.intersectionWith=To,mn.invert=nu,mn.invertBy=iu,mn.invokeMap=Yo,mn.iteratee=Mu,mn.keyBy=Zo,mn.keys=ou,mn.keysIn=au,mn.map=Jo,mn.mapKeys=function(e,t){var r={};return t=Ds(t,3),Xn(e,function(e,n,i){Pn(r,t(e,n,i),e)}),r},mn.mapValues=function(e,t){var r={};return t=Ds(t,3),Xn(e,function(e,n,i){Pn(r,n,t(e,n,i))}),r},mn.matches=function(e){return mi(Dn(e,h))},mn.matchesProperty=function(e,t){return gi(e,Dn(t,h))},mn.memoize=la,mn.merge=uu,mn.mergeWith=lu,mn.method=Pu,mn.methodOf=Bu,mn.mixin=Nu,mn.negate=ca,mn.nthArg=function(e){return e=Ga(e),Ai(function(t){return yi(t,e)})},mn.omit=cu,mn.omitBy=function(e,t){return pu(e,ca(Ds(t)))},mn.once=function(e){return na(2,e)},mn.orderBy=function(e,t,r,i){return null==e?[]:(_a(t)||(t=null==t?[]:[t]),_a(r=i?n:r)||(r=null==r?[]:[r]),_i(e,t,r))},mn.over=Fu,mn.overArgs=ha,mn.overEvery=ju,mn.overSome=Uu,mn.partial=pa,mn.partialRight=fa,mn.partition=Qo,mn.pick=hu,mn.pickBy=pu,mn.property=$u,mn.propertyOf=function(e){return function(t){return null==e?n:Jn(e,t)}},mn.pull=So,mn.pullAll=ko,mn.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?xi(e,t,Ds(r,2)):e},mn.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?xi(e,t,n,r):e},mn.pullAt=Co,mn.range=Vu,mn.rangeRight=Gu,mn.rearg=da,mn.reject=function(e,t){return(_a(e)?Xt:Wn)(e,ca(Ds(t,3)))},mn.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],s=e.length;for(t=Ds(t,3);++n<s;){var o=e[n];t(o,n,e)&&(r.push(o),i.push(n))}return wi(e,i),r},mn.rest=function(e,t){if("function"!=typeof e)throw new it(o);return Ai(e,t=t===n?t:Ga(t))},mn.reverse=Io,mn.sampleSize=function(e,t,r){return t=(r?qs(e,t,r):t===n)?1:Ga(t),(_a(e)?kn:ki)(e,t)},mn.set=function(e,t,r){return null==e?e:Ci(e,t,r)},mn.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Ci(e,t,r,i)},mn.shuffle=function(e){return(_a(e)?Cn:Li)(e)},mn.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&qs(e,t,r)?(t=0,r=i):(t=null==t?0:Ga(t),r=r===n?i:Ga(r)),Oi(e,t,r)):[]},mn.sortBy=ea,mn.sortedUniq=function(e){return e&&e.length?Ni(e):[]},mn.sortedUniqBy=function(e,t){return e&&e.length?Ni(e,Ds(t,2)):[]},mn.split=function(e,t,r){return r&&"number"!=typeof r&&qs(e,t,r)&&(t=r=n),(r=r===n?N:r>>>0)?(e=Ka(e))&&("string"==typeof t||null!=t&&!Pa(t))&&!(t=Fi(t))&&Tr(e)?Yi(Lr(e),0,r):e.split(t,r):[]},mn.spread=function(e,t){if("function"!=typeof e)throw new it(o);return t=null==t?0:Hr(Ga(t),0),Ai(function(r){var n=r[t],i=Yi(r,0,t);return n&&Qt(i,n),zt(e,this,i)})},mn.tail=function(e){var t=null==e?0:e.length;return t?Oi(e,1,t):[]},mn.take=function(e,t,r){return e&&e.length?Oi(e,0,(t=r||t===n?1:Ga(t))<0?0:t):[]},mn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?Oi(e,(t=i-(t=r||t===n?1:Ga(t)))<0?0:t,i):[]},mn.takeRightWhile=function(e,t){return e&&e.length?Vi(e,Ds(t,3),!1,!0):[]},mn.takeWhile=function(e,t){return e&&e.length?Vi(e,Ds(t,3)):[]},mn.tap=function(e,t){return t(e),e},mn.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new it(o);return Ia(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),oa(e,t,{leading:n,maxWait:t,trailing:i})},mn.thru=Vo,mn.toArray=$a,mn.toPairs=fu,mn.toPairsIn=du,mn.toPath=function(e){return _a(e)?Jt(e,ho):Da(e)?[e]:is(co(Ka(e)))},mn.toPlainObject=Ha,mn.transform=function(e,t,r){var n=_a(e),i=n||Ea(e)||Fa(e);if(t=Ds(t,4),null==r){var s=e&&e.constructor;r=i?n?new s:[]:Ia(e)&&Sa(s)?gn(Lt(e)):{}}return(i?Ht:Xn)(e,function(e,n,i){return t(r,e,n,i)}),r},mn.unary=function(e){return ra(e,1)},mn.union=Ro,mn.unionBy=Lo,mn.unionWith=Oo,mn.uniq=function(e){return e&&e.length?ji(e):[]},mn.uniqBy=function(e,t){return e&&e.length?ji(e,Ds(t,2)):[]},mn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ji(e,n,t):[]},mn.unset=function(e,t){return null==e||Ui(e,t)},mn.unzip=Mo,mn.unzipWith=Po,mn.update=function(e,t,r){return null==e?e:$i(e,t,Ki(r))},mn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:$i(e,t,Ki(r),i)},mn.values=mu,mn.valuesIn=function(e){return null==e?[]:vr(e,au(e))},mn.without=Bo,mn.words=Su,mn.wrap=function(e,t){return pa(Ki(t),e)},mn.xor=No,mn.xorBy=Do,mn.xorWith=Fo,mn.zip=jo,mn.zipObject=function(e,t){return Wi(e||[],t||[],Rn)},mn.zipObjectDeep=function(e,t){return Wi(e||[],t||[],Ci)},mn.zipWith=Uo,mn.entries=fu,mn.entriesIn=du,mn.extend=Xa,mn.extendWith=Ya,Nu(mn,mn),mn.add=Hu,mn.attempt=ku,mn.camelCase=gu,mn.capitalize=vu,mn.ceil=Ku,mn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=Wa(r))==r?r:0),t!==n&&(t=(t=Wa(t))==t?t:0),Nn(Wa(e),t,r)},mn.clone=function(e){return Dn(e,f)},mn.cloneDeep=function(e){return Dn(e,h|f)},mn.cloneDeepWith=function(e,t){return Dn(e,h|f,t="function"==typeof t?t:n)},mn.cloneWith=function(e,t){return Dn(e,f,t="function"==typeof t?t:n)},mn.conformsTo=function(e,t){return null==t||Fn(e,t,ou(t))},mn.deburr=yu,mn.defaultTo=function(e,t){return null==e||e!=e?t:e},mn.divide=qu,mn.endsWith=function(e,t,r){e=Ka(e),t=Fi(t);var i=e.length,s=r=r===n?i:Nn(Ga(r),0,i);return(r-=t.length)>=0&&e.slice(r,s)==t},mn.eq=ma,mn.escape=function(e){return(e=Ka(e))&&Te.test(e)?e.replace(we,wr):e},mn.escapeRegExp=function(e){return(e=Ka(e))&&Oe.test(e)?e.replace(Le,"\\$&"):e},mn.every=function(e,t,r){var i=_a(e)?qt:Gn;return r&&qs(e,t,r)&&(t=n),i(e,Ds(t,3))},mn.find=Wo,mn.findIndex=yo,mn.findKey=function(e,t){return ir(e,Ds(t,3),Xn)},mn.findLast=Ho,mn.findLastIndex=_o,mn.findLastKey=function(e,t){return ir(e,Ds(t,3),Yn)},mn.floor=Xu,mn.forEach=Ko,mn.forEachRight=qo,mn.forIn=function(e,t){return null==e?e:Kn(e,Ds(t,3),au)},mn.forInRight=function(e,t){return null==e?e:qn(e,Ds(t,3),au)},mn.forOwn=function(e,t){return e&&Xn(e,Ds(t,3))},mn.forOwnRight=function(e,t){return e&&Yn(e,Ds(t,3))},mn.get=tu,mn.gt=ga,mn.gte=va,mn.has=function(e,t){return null!=e&&zs(e,t,ri)},mn.hasIn=ru,mn.head=xo,mn.identity=Ou,mn.includes=function(e,t,r,n){e=xa(e)?e:mu(e),r=r&&!n?Ga(r):0;var i=e.length;return r<0&&(r=Hr(i+r,0)),Na(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&or(e,t,r)>-1},mn.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:Ga(r);return i<0&&(i=Hr(n+i,0)),or(e,t,i)},mn.inRange=function(e,t,r){return t=Va(t),r===n?(r=t,t=0):r=Va(r),function(e,t,r){return e>=Kr(t,r)&&e<Hr(t,r)}(e=Wa(e),t,r)},mn.invoke=su,mn.isArguments=ya,mn.isArray=_a,mn.isArrayBuffer=ba,mn.isArrayLike=xa,mn.isArrayLikeObject=wa,mn.isBoolean=function(e){return!0===e||!1===e||Ra(e)&&ei(e)==G},mn.isBuffer=Ea,mn.isDate=Ta,mn.isElement=function(e){return Ra(e)&&1===e.nodeType&&!Ma(e)},mn.isEmpty=function(e){if(null==e)return!0;if(xa(e)&&(_a(e)||"string"==typeof e||"function"==typeof e.splice||Ea(e)||Fa(e)||ya(e)))return!e.length;var t=Gs(e);if(t==X||t==te)return!e.size;if(Js(e))return!hi(e).length;for(var r in e)if(ct.call(e,r))return!1;return!0},mn.isEqual=function(e,t){return ai(e,t)},mn.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?ai(e,t,n,r):!!i},mn.isError=Aa,mn.isFinite=function(e){return"number"==typeof e&&Gr(e)},mn.isFunction=Sa,mn.isInteger=ka,mn.isLength=Ca,mn.isMap=La,mn.isMatch=function(e,t){return e===t||ui(e,t,js(t))},mn.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,ui(e,t,js(t),r)},mn.isNaN=function(e){return Oa(e)&&e!=+e},mn.isNative=function(e){if(Zs(e))throw new Je(s);return li(e)},mn.isNil=function(e){return null==e},mn.isNull=function(e){return null===e},mn.isNumber=Oa,mn.isObject=Ia,mn.isObjectLike=Ra,mn.isPlainObject=Ma,mn.isRegExp=Pa,mn.isSafeInteger=function(e){return ka(e)&&e>=-M&&e<=M},mn.isSet=Ba,mn.isString=Na,mn.isSymbol=Da,mn.isTypedArray=Fa,mn.isUndefined=function(e){return e===n},mn.isWeakMap=function(e){return Ra(e)&&Gs(e)==se},mn.isWeakSet=function(e){return Ra(e)&&ei(e)==oe},mn.join=function(e,t){return null==e?"":zr.call(e,t)},mn.kebabCase=_u,mn.last=Ao,mn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var s=i;return r!==n&&(s=(s=Ga(r))<0?Hr(i+s,0):Kr(s,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,s):sr(e,ur,s,!0)},mn.lowerCase=bu,mn.lowerFirst=xu,mn.lt=ja,mn.lte=Ua,mn.max=function(e){return e&&e.length?zn(e,Ou,ti):n},mn.maxBy=function(e,t){return e&&e.length?zn(e,Ds(t,2),ti):n},mn.mean=function(e){return lr(e,Ou)},mn.meanBy=function(e,t){return lr(e,Ds(t,2))},mn.min=function(e){return e&&e.length?zn(e,Ou,fi):n},mn.minBy=function(e,t){return e&&e.length?zn(e,Ds(t,2),fi):n},mn.stubArray=zu,mn.stubFalse=Wu,mn.stubObject=function(){return{}},mn.stubString=function(){return""},mn.stubTrue=function(){return!0},mn.multiply=Zu,mn.nth=function(e,t){return e&&e.length?yi(e,Ga(t)):n},mn.noConflict=function(){return Ot._===this&&(Ot._=mt),this},mn.noop=Du,mn.now=ta,mn.pad=function(e,t,r){e=Ka(e);var n=(t=Ga(t))?Rr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return _s(Ur(i),r)+e+_s(jr(i),r)},mn.padEnd=function(e,t,r){e=Ka(e);var n=(t=Ga(t))?Rr(e):0;return t&&n<t?e+_s(t-n,r):e},mn.padStart=function(e,t,r){e=Ka(e);var n=(t=Ga(t))?Rr(e):0;return t&&n<t?_s(t-n,r)+e:e},mn.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),Xr(Ka(e).replace(Me,""),t||0)},mn.random=function(e,t,r){if(r&&"boolean"!=typeof r&&qs(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=Va(e),t===n?(t=e,e=0):t=Va(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var s=Yr();return Kr(e+s*(t-e+Ct("1e-"+((s+"").length-1))),t)}return Ei(e,t)},mn.reduce=function(e,t,r){var n=_a(e)?er:pr,i=arguments.length<3;return n(e,Ds(t,4),r,i,$n)},mn.reduceRight=function(e,t,r){var n=_a(e)?tr:pr,i=arguments.length<3;return n(e,Ds(t,4),r,i,Vn)},mn.repeat=function(e,t,r){return t=(r?qs(e,t,r):t===n)?1:Ga(t),Ti(Ka(e),t)},mn.replace=function(){var e=arguments,t=Ka(e[0]);return e.length<3?t:t.replace(e[1],e[2])},mn.result=function(e,t,r){var i=-1,s=(t=qi(t,e)).length;for(s||(s=1,e=n);++i<s;){var o=null==e?n:e[ho(t[i])];o===n&&(i=s,o=r),e=Sa(o)?o.call(e):o}return e},mn.round=Ju,mn.runInContext=e,mn.sample=function(e){return(_a(e)?Sn:Si)(e)},mn.size=function(e){if(null==e)return 0;if(xa(e))return Na(e)?Rr(e):e.length;var t=Gs(e);return t==X||t==te?e.size:hi(e).length},mn.snakeCase=wu,mn.some=function(e,t,r){var i=_a(e)?rr:Mi;return r&&qs(e,t,r)&&(t=n),i(e,Ds(t,3))},mn.sortedIndex=function(e,t){return Pi(e,t)},mn.sortedIndexBy=function(e,t,r){return Bi(e,t,Ds(r,2))},mn.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=Pi(e,t);if(n<r&&ma(e[n],t))return n}return-1},mn.sortedLastIndex=function(e,t){return Pi(e,t,!0)},mn.sortedLastIndexBy=function(e,t,r){return Bi(e,t,Ds(r,2),!0)},mn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=Pi(e,t,!0)-1;if(ma(e[r],t))return r}return-1},mn.startCase=Eu,mn.startsWith=function(e,t,r){return e=Ka(e),r=null==r?0:Nn(Ga(r),0,e.length),t=Fi(t),e.slice(r,r+t.length)==t},mn.subtract=Qu,mn.sum=function(e){return e&&e.length?fr(e,Ou):0},mn.sumBy=function(e,t){return e&&e.length?fr(e,Ds(t,2)):0},mn.template=function(e,t,r){var i=mn.templateSettings;r&&qs(e,t,r)&&(t=n),e=Ka(e),t=Ya({},t,i,ks);var s,o,u=Ya({},t.imports,i.imports,ks),l=ou(u),c=vr(u,l),h=0,p=t.interpolate||Xe,f="__p += '",d=rt((t.escape||Xe).source+"|"+p.source+"|"+(p===ke?$e:Xe).source+"|"+(t.evaluate||Xe).source+"|$","g"),m="//# sourceURL="+(ct.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tt+"]")+"\n";e.replace(d,function(t,r,n,i,a,u){return n||(n=i),f+=e.slice(h,u).replace(Ye,Er),r&&(s=!0,f+="' +\n__e("+r+") +\n'"),a&&(o=!0,f+="';\n"+a+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),h=u+t.length,t}),f+="';\n";var g=ct.call(t,"variable")&&t.variable;if(g){if(je.test(g))throw new Je(a)}else f="with (obj) {\n"+f+"\n}\n";f=(o?f.replace(ye,""):f).replace(_e,"$1").replace(be,"$1;"),f="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var v=ku(function(){return Qe(l,m+"return "+f).apply(n,c)});if(v.source=f,Aa(v))throw v;return v},mn.times=function(e,t){if((e=Ga(e))<1||e>M)return[];var r=N,n=Kr(e,N);t=Ds(t),e-=N;for(var i=dr(n,t);++r<e;)t(r);return i},mn.toFinite=Va,mn.toInteger=Ga,mn.toLength=za,mn.toLower=function(e){return Ka(e).toLowerCase()},mn.toNumber=Wa,mn.toSafeInteger=function(e){return e?Nn(Ga(e),-M,M):0===e?e:0},mn.toString=Ka,mn.toUpper=function(e){return Ka(e).toUpperCase()},mn.trim=function(e,t,r){if((e=Ka(e))&&(r||t===n))return mr(e);if(!e||!(t=Fi(t)))return e;var i=Lr(e),s=Lr(t);return Yi(i,_r(i,s),br(i,s)+1).join("")},mn.trimEnd=function(e,t,r){if((e=Ka(e))&&(r||t===n))return e.slice(0,Or(e)+1);if(!e||!(t=Fi(t)))return e;var i=Lr(e);return Yi(i,0,br(i,Lr(t))+1).join("")},mn.trimStart=function(e,t,r){if((e=Ka(e))&&(r||t===n))return e.replace(Me,"");if(!e||!(t=Fi(t)))return e;var i=Lr(e);return Yi(i,_r(i,Lr(t))).join("")},mn.truncate=function(e,t){var r=S,i=k;if(Ia(t)){var s="separator"in t?t.separator:s;r="length"in t?Ga(t.length):r,i="omission"in t?Fi(t.omission):i}var o=(e=Ka(e)).length;if(Tr(e)){var a=Lr(e);o=a.length}if(r>=o)return e;var u=r-Rr(i);if(u<1)return i;var l=a?Yi(a,0,u).join(""):e.slice(0,u);if(s===n)return l+i;if(a&&(u+=l.length-u),Pa(s)){if(e.slice(u).search(s)){var c,h=l;for(s.global||(s=rt(s.source,Ka(Ve.exec(s))+"g")),s.lastIndex=0;c=s.exec(h);)var p=c.index;l=l.slice(0,p===n?u:p)}}else if(e.indexOf(Fi(s),u)!=u){var f=l.lastIndexOf(s);f>-1&&(l=l.slice(0,f))}return l+i},mn.unescape=function(e){return(e=Ka(e))&&Ee.test(e)?e.replace(xe,Mr):e},mn.uniqueId=function(e){var t=++ht;return Ka(e)+t},mn.upperCase=Tu,mn.upperFirst=Au,mn.each=Ko,mn.eachRight=qo,mn.first=xo,Nu(mn,(Yu={},Xn(mn,function(e,t){ct.call(mn.prototype,t)||(Yu[t]=e)}),Yu),{chain:!1}),mn.VERSION="4.17.21",Ht(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){mn[e].placeholder=mn}),Ht(["drop","take"],function(e,t){_n.prototype[e]=function(r){r=r===n?1:Hr(Ga(r),0);var i=this.__filtered__&&!t?new _n(this):this.clone();return i.__filtered__?i.__takeCount__=Kr(r,i.__takeCount__):i.__views__.push({size:Kr(r,N),type:e+(i.__dir__<0?"Right":"")}),i},_n.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Ht(["filter","map","takeWhile"],function(e,t){var r=t+1,n=r==R||3==r;_n.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ds(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),Ht(["head","last"],function(e,t){var r="take"+(t?"Right":"");_n.prototype[e]=function(){return this[r](1).value()[0]}}),Ht(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");_n.prototype[e]=function(){return this.__filtered__?new _n(this):this[r](1)}}),_n.prototype.compact=function(){return this.filter(Ou)},_n.prototype.find=function(e){return this.filter(e).head()},_n.prototype.findLast=function(e){return this.reverse().find(e)},_n.prototype.invokeMap=Ai(function(e,t){return"function"==typeof e?new _n(this):this.map(function(r){return si(r,e,t)})}),_n.prototype.reject=function(e){return this.filter(ca(Ds(e)))},_n.prototype.slice=function(e,t){e=Ga(e);var r=this;return r.__filtered__&&(e>0||t<0)?new _n(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=Ga(t))<0?r.dropRight(-t):r.take(t-e)),r)},_n.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},_n.prototype.toArray=function(){return this.take(N)},Xn(_n.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=mn[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);s&&(mn.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,u=t instanceof _n,l=a[0],c=u||_a(t),h=function(e){var t=s.apply(mn,Qt([e],a));return i&&p?t[0]:t};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var p=this.__chain__,f=!!this.__actions__.length,d=o&&!p,m=u&&!f;if(!o&&c){t=m?t:new _n(this);var g=e.apply(t,a);return g.__actions__.push({func:Vo,args:[h],thisArg:n}),new yn(g,p)}return d&&m?e.apply(this,a):(g=this.thru(h),d?i?g.value()[0]:g.value():g)})}),Ht(["pop","push","shift","sort","splice","unshift"],function(e){var t=st[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);mn.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(_a(i)?i:[],e)}return this[r](function(r){return t.apply(_a(r)?r:[],e)})}}),Xn(_n.prototype,function(e,t){var r=mn[t];if(r){var n=r.name+"";ct.call(on,n)||(on[n]=[]),on[n].push({name:t,func:r})}}),on[ms(n,v).name]=[{name:"wrapper",func:n}],_n.prototype.clone=function(){var e=new _n(this.__wrapped__);return e.__actions__=is(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=is(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=is(this.__views__),e},_n.prototype.reverse=function(){if(this.__filtered__){var e=new _n(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},_n.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=_a(e),n=t<0,i=r?e.length:0,s=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var s=r[n],o=s.size;switch(s.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=Kr(t,e+o);break;case"takeRight":e=Hr(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=s.start,a=s.end,u=a-o,l=n?a:o-1,c=this.__iteratees__,h=c.length,p=0,f=Kr(u,this.__takeCount__);if(!r||!n&&i==u&&f==u)return Gi(e,this.__actions__);var d=[];e:for(;u--&&p<f;){for(var m=-1,g=e[l+=t];++m<h;){var v=c[m],y=v.iteratee,_=v.type,b=y(g);if(_==L)g=b;else if(!b){if(_==R)continue e;break e}}d[p++]=g}return d},mn.prototype.at=Go,mn.prototype.chain=function(){return $o(this)},mn.prototype.commit=function(){return new yn(this.value(),this.__chain__)},mn.prototype.next=function(){this.__values__===n&&(this.__values__=$a(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},mn.prototype.plant=function(e){for(var t,r=this;r instanceof vn;){var i=fo(r);i.__index__=0,i.__values__=n,t?s.__wrapped__=i:t=i;var s=i;r=r.__wrapped__}return s.__wrapped__=e,t},mn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof _n){var t=e;return this.__actions__.length&&(t=new _n(this)),(t=t.reverse()).__actions__.push({func:Vo,args:[Io],thisArg:n}),new yn(t,this.__chain__)}return this.thru(Io)},mn.prototype.toJSON=mn.prototype.valueOf=mn.prototype.value=function(){return Gi(this.__wrapped__,this.__actions__)},mn.prototype.first=mn.prototype.head,nr&&(mn.prototype[nr]=function(){return this}),mn}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ot._=Pr,define(function(){return Pr})):Pt?((Pt.exports=Pr)._=Pr,Mt._=Pr):Ot._=Pr}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],377:[function(e,t,r){(function(r){"use strict";t.exports=v;var n,i=e("pseudomap"),s=e("util"),o=e("yallist"),a=(n="function"==typeof Symbol&&"1"!==r.env._nodeLRUCacheForceNoSymbol?function(e){return Symbol(e)}:function(e){return"_"+e})("max"),u=n("length"),l=n("lengthCalculator"),c=n("allowStale"),h=n("maxAge"),p=n("dispose"),f=n("noDisposeOnSet"),d=n("lruList"),m=n("cache");function g(){return 1}function v(e){if(!(this instanceof v))return new v(e);"number"==typeof e&&(e={max:e}),e||(e={});var t=this[a]=e.max;(!t||"number"!=typeof t||t<=0)&&(this[a]=1/0);var r=e.length||g;"function"!=typeof r&&(r=g),this[l]=r,this[c]=e.stale||!1,this[h]=e.maxAge||0,this[p]=e.dispose,this[f]=e.noDisposeOnSet||!1,this.reset()}function y(e,t,r,n){var i=r.value;b(e,i)&&(w(e,r),e[c]||(i=void 0)),i&&t.call(n,i.value,i.key,e)}function _(e,t,r){var n=e[m].get(t);if(n){var i=n.value;b(e,i)?(w(e,n),e[c]||(i=void 0)):r&&e[d].unshiftNode(n),i&&(i=i.value)}return i}function b(e,t){if(!t||!t.maxAge&&!e[h])return!1;var r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[h]&&r>e[h]}function x(e){if(e[u]>e[a])for(var t=e[d].tail;e[u]>e[a]&&null!==t;){var r=t.prev;w(e,t),t=r}}function w(e,t){if(t){var r=t.value;e[p]&&e[p](r.key,r.value),e[u]-=r.length,e[m].delete(r.key),e[d].removeNode(t)}}Object.defineProperty(v.prototype,"max",{set:function(e){(!e||"number"!=typeof e||e<=0)&&(e=1/0),this[a]=e,x(this)},get:function(){return this[a]},enumerable:!0}),Object.defineProperty(v.prototype,"allowStale",{set:function(e){this[c]=!!e},get:function(){return this[c]},enumerable:!0}),Object.defineProperty(v.prototype,"maxAge",{set:function(e){(!e||"number"!=typeof e||e<0)&&(e=0),this[h]=e,x(this)},get:function(){return this[h]},enumerable:!0}),Object.defineProperty(v.prototype,"lengthCalculator",{set:function(e){"function"!=typeof e&&(e=g),e!==this[l]&&(this[l]=e,this[u]=0,this[d].forEach(function(e){e.length=this[l](e.value,e.key),this[u]+=e.length},this)),x(this)},get:function(){return this[l]},enumerable:!0}),Object.defineProperty(v.prototype,"length",{get:function(){return this[u]},enumerable:!0}),Object.defineProperty(v.prototype,"itemCount",{get:function(){return this[d].length},enumerable:!0}),v.prototype.rforEach=function(e,t){t=t||this;for(var r=this[d].tail;null!==r;){var n=r.prev;y(this,e,r,t),r=n}},v.prototype.forEach=function(e,t){t=t||this;for(var r=this[d].head;null!==r;){var n=r.next;y(this,e,r,t),r=n}},v.prototype.keys=function(){return this[d].toArray().map(function(e){return e.key},this)},v.prototype.values=function(){return this[d].toArray().map(function(e){return e.value},this)},v.prototype.reset=function(){this[p]&&this[d]&&this[d].length&&this[d].forEach(function(e){this[p](e.key,e.value)},this),this[m]=new i,this[d]=new o,this[u]=0},v.prototype.dump=function(){return this[d].map(function(e){if(!b(this,e))return{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}},this).toArray().filter(function(e){return e})},v.prototype.dumpLru=function(){return this[d]},v.prototype.inspect=function(e,t){var r="LRUCache {",n=!1;this[c]&&(r+="\n allowStale: true",n=!0);var i=this[a];i&&i!==1/0&&(n&&(r+=","),r+="\n max: "+s.inspect(i,t),n=!0);var o=this[h];o&&(n&&(r+=","),r+="\n maxAge: "+s.inspect(o,t),n=!0);var p=this[l];p&&p!==g&&(n&&(r+=","),r+="\n length: "+s.inspect(this[u],t),n=!0);var f=!1;return this[d].forEach(function(e){f?r+=",\n ":(n&&(r+=",\n"),f=!0,r+="\n ");var i=s.inspect(e.key).split("\n").join("\n "),a={value:e.value};e.maxAge!==o&&(a.maxAge=e.maxAge),p!==g&&(a.length=e.length),b(this,e)&&(a.stale=!0),a=s.inspect(a,t).split("\n").join("\n "),r+=i+" => "+a}),(f||n)&&(r+="\n"),r+="}"},v.prototype.set=function(e,t,r){var n=(r=r||this[h])?Date.now():0,i=this[l](t,e);if(this[m].has(e)){if(i>this[a])return w(this,this[m].get(e)),!1;var s=this[m].get(e).value;return this[p]&&(this[f]||this[p](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[u]+=i-s.length,s.length=i,this.get(e),x(this),!0}var o=new function(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}(e,t,i,n,r);return o.length>this[a]?(this[p]&&this[p](e,t),!1):(this[u]+=o.length,this[d].unshift(o),this[m].set(e,this[d].head),x(this),!0)},v.prototype.has=function(e){return!!this[m].has(e)&&!b(this,this[m].get(e).value)},v.prototype.get=function(e){return _(this,e,!0)},v.prototype.peek=function(e){return _(this,e,!1)},v.prototype.pop=function(){var e=this[d].tail;return e?(w(this,e),e.value):null},v.prototype.del=function(e){w(this,this[m].get(e))},v.prototype.load=function(e){this.reset();for(var t=Date.now(),r=e.length-1;r>=0;r--){var n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{var s=i-t;s>0&&this.set(n.k,n.v,s)}}},v.prototype.prune=function(){var e=this;this[m].forEach(function(t,r){_(e,r,!1)})}}).call(this,e("_process"))},{_process:437,pseudomap:438,util:523,yallist:533}],378:[function(e,t,r){(function(r){"use strict";const n=e("fs"),i=e("path"),{promisify:s}=e("util"),o=e("semver").satisfies(r.version,">=10.12.0"),a=e=>{if("win32"===r.platform){if(/[<>:"|?*]/.test(e.replace(i.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}},u=e=>{return{...{mode:511,fs:n},...e}},l=e=>{const t=new Error(`operation not permitted, mkdir '${e}'`);return t.code="EPERM",t.errno=-4048,t.path=e,t.syscall="mkdir",t};t.exports=(async(e,t)=>{a(e),t=u(t);const r=s(t.fs.mkdir),c=s(t.fs.stat);if(o&&t.fs.mkdir===n.mkdir){const n=i.resolve(e);return await r(n,{mode:t.mode,recursive:!0}),n}const h=async e=>{try{return await r(e,t.mode),e}catch(t){if("EPERM"===t.code)throw t;if("ENOENT"===t.code){if(i.dirname(e)===e)throw l(e);if(t.message.includes("null bytes"))throw t;return await h(i.dirname(e)),h(e)}try{if(!(await c(e)).isDirectory())throw new Error("The path is not a directory")}catch(e){throw t}return e}};return h(i.resolve(e))}),t.exports.sync=((e,t)=>{if(a(e),t=u(t),o&&t.fs.mkdirSync===n.mkdirSync){const r=i.resolve(e);return n.mkdirSync(r,{mode:t.mode,recursive:!0}),r}const r=e=>{try{t.fs.mkdirSync(e,t.mode)}catch(n){if("EPERM"===n.code)throw n;if("ENOENT"===n.code){if(i.dirname(e)===e)throw l(e);if(n.message.includes("null bytes"))throw n;return r(i.dirname(e)),r(e)}try{if(!t.fs.statSync(e).isDirectory())throw new Error("The path is not a directory")}catch(e){throw n}}return e};return r(i.resolve(e))})}).call(this,e("_process"))},{_process:437,fs:298,path:404,semver:379,util:523}],379:[function(e,t,r){(function(e){var n;r=t.exports=f,n="object"==typeof e&&e.env&&e.env.NODE_DEBUG&&/\bsemver\b/i.test(e.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},r.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,o=r.re=[],a=r.src=[],u=r.tokens={},l=0;function c(e){u[e]=l++}c("NUMERICIDENTIFIER"),a[u.NUMERICIDENTIFIER]="0|[1-9]\\d*",c("NUMERICIDENTIFIERLOOSE"),a[u.NUMERICIDENTIFIERLOOSE]="[0-9]+",c("NONNUMERICIDENTIFIER"),a[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",c("MAINVERSION"),a[u.MAINVERSION]="("+a[u.NUMERICIDENTIFIER]+")\\.("+a[u.NUMERICIDENTIFIER]+")\\.("+a[u.NUMERICIDENTIFIER]+")",c("MAINVERSIONLOOSE"),a[u.MAINVERSIONLOOSE]="("+a[u.NUMERICIDENTIFIERLOOSE]+")\\.("+a[u.NUMERICIDENTIFIERLOOSE]+")\\.("+a[u.NUMERICIDENTIFIERLOOSE]+")",c("PRERELEASEIDENTIFIER"),a[u.PRERELEASEIDENTIFIER]="(?:"+a[u.NUMERICIDENTIFIER]+"|"+a[u.NONNUMERICIDENTIFIER]+")",c("PRERELEASEIDENTIFIERLOOSE"),a[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+a[u.NUMERICIDENTIFIERLOOSE]+"|"+a[u.NONNUMERICIDENTIFIER]+")",c("PRERELEASE"),a[u.PRERELEASE]="(?:-("+a[u.PRERELEASEIDENTIFIER]+"(?:\\."+a[u.PRERELEASEIDENTIFIER]+")*))",c("PRERELEASELOOSE"),a[u.PRERELEASELOOSE]="(?:-?("+a[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+a[u.PRERELEASEIDENTIFIERLOOSE]+")*))",c("BUILDIDENTIFIER"),a[u.BUILDIDENTIFIER]="[0-9A-Za-z-]+",c("BUILD"),a[u.BUILD]="(?:\\+("+a[u.BUILDIDENTIFIER]+"(?:\\."+a[u.BUILDIDENTIFIER]+")*))",c("FULL"),c("FULLPLAIN"),a[u.FULLPLAIN]="v?"+a[u.MAINVERSION]+a[u.PRERELEASE]+"?"+a[u.BUILD]+"?",a[u.FULL]="^"+a[u.FULLPLAIN]+"$",c("LOOSEPLAIN"),a[u.LOOSEPLAIN]="[v=\\s]*"+a[u.MAINVERSIONLOOSE]+a[u.PRERELEASELOOSE]+"?"+a[u.BUILD]+"?",c("LOOSE"),a[u.LOOSE]="^"+a[u.LOOSEPLAIN]+"$",c("GTLT"),a[u.GTLT]="((?:<|>)?=?)",c("XRANGEIDENTIFIERLOOSE"),a[u.XRANGEIDENTIFIERLOOSE]=a[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",c("XRANGEIDENTIFIER"),a[u.XRANGEIDENTIFIER]=a[u.NUMERICIDENTIFIER]+"|x|X|\\*",c("XRANGEPLAIN"),a[u.XRANGEPLAIN]="[v=\\s]*("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:"+a[u.PRERELEASE]+")?"+a[u.BUILD]+"?)?)?",c("XRANGEPLAINLOOSE"),a[u.XRANGEPLAINLOOSE]="[v=\\s]*("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:"+a[u.PRERELEASELOOSE]+")?"+a[u.BUILD]+"?)?)?",c("XRANGE"),a[u.XRANGE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAIN]+"$",c("XRANGELOOSE"),a[u.XRANGELOOSE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAINLOOSE]+"$",c("COERCE"),a[u.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",c("COERCERTL"),o[u.COERCERTL]=new RegExp(a[u.COERCE],"g"),c("LONETILDE"),a[u.LONETILDE]="(?:~>?)",c("TILDETRIM"),a[u.TILDETRIM]="(\\s*)"+a[u.LONETILDE]+"\\s+",o[u.TILDETRIM]=new RegExp(a[u.TILDETRIM],"g");c("TILDE"),a[u.TILDE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAIN]+"$",c("TILDELOOSE"),a[u.TILDELOOSE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAINLOOSE]+"$",c("LONECARET"),a[u.LONECARET]="(?:\\^)",c("CARETTRIM"),a[u.CARETTRIM]="(\\s*)"+a[u.LONECARET]+"\\s+",o[u.CARETTRIM]=new RegExp(a[u.CARETTRIM],"g");c("CARET"),a[u.CARET]="^"+a[u.LONECARET]+a[u.XRANGEPLAIN]+"$",c("CARETLOOSE"),a[u.CARETLOOSE]="^"+a[u.LONECARET]+a[u.XRANGEPLAINLOOSE]+"$",c("COMPARATORLOOSE"),a[u.COMPARATORLOOSE]="^"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+")$|^$",c("COMPARATOR"),a[u.COMPARATOR]="^"+a[u.GTLT]+"\\s*("+a[u.FULLPLAIN]+")$|^$",c("COMPARATORTRIM"),a[u.COMPARATORTRIM]="(\\s*)"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+"|"+a[u.XRANGEPLAIN]+")",o[u.COMPARATORTRIM]=new RegExp(a[u.COMPARATORTRIM],"g");c("HYPHENRANGE"),a[u.HYPHENRANGE]="^\\s*("+a[u.XRANGEPLAIN]+")\\s+-\\s+("+a[u.XRANGEPLAIN]+")\\s*$",c("HYPHENRANGELOOSE"),a[u.HYPHENRANGELOOSE]="^\\s*("+a[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[u.XRANGEPLAINLOOSE]+")\\s*$",c("STAR"),a[u.STAR]="(<|>)?=?\\s*\\*";for(var h=0;h<l;h++)n(h,a[h]),o[h]||(o[h]=new RegExp(a[h]));function p(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof f)return e;if("string"!=typeof e)return null;if(e.length>i)return null;if(!(t.loose?o[u.LOOSE]:o[u.FULL]).test(e))return null;try{return new f(e,t)}catch(e){return null}}function f(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof f){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof f))return new f(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?o[u.LOOSE]:o[u.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<s)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}r.parse=p,r.valid=function(e,t){var r=p(e,t);return r?r.version:null},r.clean=function(e,t){var r=p(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null},r.SemVer=f,f.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},f.prototype.toString=function(){return this.version},f.prototype.compare=function(e){return n("SemVer.compare",this.version,this.options,e),e instanceof f||(e=new f(e,this.options)),this.compareMain(e)||this.comparePre(e)},f.prototype.compareMain=function(e){return e instanceof f||(e=new f(e,this.options)),m(this.major,e.major)||m(this.minor,e.minor)||m(this.patch,e.patch)},f.prototype.comparePre=function(e){if(e instanceof f||(e=new f(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return m(r,i)}while(++t)},f.prototype.compareBuild=function(e){e instanceof f||(e=new f(e,this.options));var t=0;do{var r=this.build[t],i=e.build[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return m(r,i)}while(++t)},f.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var r=this.prerelease.length;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},r.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new f(e,r).inc(t,n).version}catch(e){return null}},r.diff=function(e,t){if(_(e,t))return null;var r=p(e),n=p(t),i="";if(r.prerelease.length||n.prerelease.length){i="pre";var s="prerelease"}for(var o in r)if(("major"===o||"minor"===o||"patch"===o)&&r[o]!==n[o])return i+o;return s},r.compareIdentifiers=m;var d=/^[0-9]+$/;function m(e,t){var r=d.test(e),n=d.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1}function g(e,t,r){return new f(e,r).compare(new f(t,r))}function v(e,t,r){return g(e,t,r)>0}function y(e,t,r){return g(e,t,r)<0}function _(e,t,r){return 0===g(e,t,r)}function b(e,t,r){return 0!==g(e,t,r)}function x(e,t,r){return g(e,t,r)>=0}function w(e,t,r){return g(e,t,r)<=0}function E(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return _(e,r,n);case"!=":return b(e,r,n);case">":return v(e,r,n);case">=":return x(e,r,n);case"<":return y(e,r,n);case"<=":return w(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function T(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof T){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof T))return new T(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===A?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}r.rcompareIdentifiers=function(e,t){return m(t,e)},r.major=function(e,t){return new f(e,t).major},r.minor=function(e,t){return new f(e,t).minor},r.patch=function(e,t){return new f(e,t).patch},r.compare=g,r.compareLoose=function(e,t){return g(e,t,!0)},r.compareBuild=function(e,t,r){var n=new f(e,r),i=new f(t,r);return n.compare(i)||n.compareBuild(i)},r.rcompare=function(e,t,r){return g(t,e,r)},r.sort=function(e,t){return e.sort(function(e,n){return r.compareBuild(e,n,t)})},r.rsort=function(e,t){return e.sort(function(e,n){return r.compareBuild(n,e,t)})},r.gt=v,r.lt=y,r.eq=_,r.neq=b,r.gte=x,r.lte=w,r.cmp=E,r.Comparator=T;var A={};function S(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof S)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new S(e.raw,t);if(e instanceof T)return new S(e.value,t);if(!(this instanceof S))return new S(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function k(e,t){for(var r=!0,n=e.slice(),i=n.pop();r&&n.length;)r=n.every(function(e){return i.intersects(e,t)}),i=n.pop();return r}function C(e){return!e||"x"===e.toLowerCase()||"*"===e}function I(e,t,r,n,i,s,o,a,u,l,c,h,p){return((t=C(r)?"":C(n)?">="+r+".0.0":C(i)?">="+r+"."+n+".0":">="+t)+" "+(a=C(u)?"":C(l)?"<"+(+u+1)+".0.0":C(c)?"<"+u+"."+(+l+1)+".0":h?"<="+u+"."+l+"."+c+"-"+h:"<="+a)).trim()}function R(e,t,r){for(var i=0;i<e.length;i++)if(!e[i].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(i=0;i<e.length;i++)if(n(e[i].semver),e[i].semver!==A&&e[i].semver.prerelease.length>0){var s=e[i].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}function L(e,t,r){try{t=new S(t,r)}catch(e){return!1}return t.test(e)}function O(e,t,r,n){var i,s,o,a,u;switch(e=new f(e,n),t=new S(t,n),r){case">":i=v,s=w,o=y,a=">",u=">=";break;case"<":i=y,s=x,o=v,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(L(e,t,n))return!1;for(var l=0;l<t.set.length;++l){var c=null,h=null;if(t.set[l].forEach(function(e){e.semver===A&&(e=new T(">=0.0.0")),c=c||e,h=h||e,i(e.semver,c.semver,n)?c=e:o(e.semver,h.semver,n)&&(h=e)}),c.operator===a||c.operator===u)return!1;if((!h.operator||h.operator===a)&&s(e,h.semver))return!1;if(h.operator===u&&o(e,h.semver))return!1}return!0}T.prototype.parse=function(e){var t=this.options.loose?o[u.COMPARATORLOOSE]:o[u.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new f(r[2],this.options.loose):this.semver=A},T.prototype.toString=function(){return this.value},T.prototype.test=function(e){if(n("Comparator.test",e,this.options.loose),this.semver===A||e===A)return!0;if("string"==typeof e)try{e=new f(e,this.options)}catch(e){return!1}return E(e,this.operator,this.semver,this.options)},T.prototype.intersects=function(e,t){if(!(e instanceof T))throw new TypeError("a Comparator is required");var r;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new S(e.value,t),L(this.value,r,t));if(""===e.operator)return""===e.value||(r=new S(this.value,t),L(e.semver,r,t));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),s=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=E(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=E(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||s&&o||a||u},r.Range=S,S.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},S.prototype.toString=function(){return this.range},S.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?o[u.HYPHENRANGELOOSE]:o[u.HYPHENRANGE];e=e.replace(r,I),n("hyphen replace",e),e=e.replace(o[u.COMPARATORTRIM],"$1$2$3"),n("comparator trim",e,o[u.COMPARATORTRIM]),e=(e=(e=e.replace(o[u.TILDETRIM],"$1~")).replace(o[u.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=t?o[u.COMPARATORLOOSE]:o[u.COMPARATOR],s=e.split(" ").map(function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){n("caret",e,t);var r=t.loose?o[u.CARETLOOSE]:o[u.CARET];return e.replace(r,function(t,r,i,s,o){var a;return n("caret",e,t,r,i,s,o),C(r)?a="":C(i)?a=">="+r+".0.0 <"+(+r+1)+".0.0":C(s)?a="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":o?(n("replaceCaret pr",o),a="0"===r?"0"===i?">="+r+"."+i+"."+s+"-"+o+" <"+r+"."+i+"."+(+s+1):">="+r+"."+i+"."+s+"-"+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+s+"-"+o+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===i?">="+r+"."+i+"."+s+" <"+r+"."+i+"."+(+s+1):">="+r+"."+i+"."+s+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+s+" <"+(+r+1)+".0.0"),n("caret return",a),a})}(e,t)}).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){var r=t.loose?o[u.TILDELOOSE]:o[u.TILDE];return e.replace(r,function(t,r,i,s,o){var a;return n("tilde",e,t,r,i,s,o),C(r)?a="":C(i)?a=">="+r+".0.0 <"+(+r+1)+".0.0":C(s)?a=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":o?(n("replaceTilde pr",o),a=">="+r+"."+i+"."+s+"-"+o+" <"+r+"."+(+i+1)+".0"):a=">="+r+"."+i+"."+s+" <"+r+"."+(+i+1)+".0",n("tilde return",a),a})}(e,t)}).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return function(e,t){e=e.trim();var r=t.loose?o[u.XRANGELOOSE]:o[u.XRANGE];return e.replace(r,function(r,i,s,o,a,u){n("xRange",e,r,i,s,o,a,u);var l=C(s),c=l||C(o),h=c||C(a),p=h;return"="===i&&p&&(i=""),u=t.includePrerelease?"-0":"",l?r=">"===i||"<"===i?"<0.0.0-0":"*":i&&p?(c&&(o=0),a=0,">"===i?(i=">=",c?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):"<="===i&&(i="<",c?s=+s+1:o=+o+1),r=i+s+"."+o+"."+a+u):c?r=">="+s+".0.0"+u+" <"+(+s+1)+".0.0"+u:h&&(r=">="+s+"."+o+".0"+u+" <"+s+"."+(+o+1)+".0"+u),n("xRange return",r),r})}(e,t)}).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(o[u.STAR],"")}(e,t),n("stars",e),e}(e,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter(function(e){return!!e.match(i)})),s=s.map(function(e){return new T(e,this.options)},this)},S.prototype.intersects=function(e,t){if(!(e instanceof S))throw new TypeError("a Range is required");return this.set.some(function(r){return k(r,t)&&e.set.some(function(e){return k(e,t)&&r.every(function(r){return e.every(function(e){return r.intersects(e,t)})})})})},r.toComparators=function(e,t){return new S(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})},S.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new f(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(R(this.set[t],e,this.options))return!0;return!1},r.satisfies=L,r.maxSatisfying=function(e,t,r){var n=null,i=null;try{var s=new S(t,r)}catch(e){return null}return e.forEach(function(e){s.test(e)&&(n&&-1!==i.compare(e)||(i=new f(n=e,r)))}),n},r.minSatisfying=function(e,t,r){var n=null,i=null;try{var s=new S(t,r)}catch(e){return null}return e.forEach(function(e){s.test(e)&&(n&&1!==i.compare(e)||(i=new f(n=e,r)))}),n},r.minVersion=function(e,t){e=new S(e,t);var r=new f("0.0.0");if(e.test(r))return r;if(r=new f("0.0.0-0"),e.test(r))return r;r=null;for(var n=0;n<e.set.length;++n){var i=e.set[n];i.forEach(function(e){var t=new f(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!v(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}})}if(r&&e.test(r))return r;return null},r.validRange=function(e,t){try{return new S(e,t).range||"*"}catch(e){return null}},r.ltr=function(e,t,r){return O(e,t,"<",r)},r.gtr=function(e,t,r){return O(e,t,">",r)},r.outside=O,r.prerelease=function(e,t){var r=p(e,t);return r&&r.prerelease.length?r.prerelease:null},r.intersects=function(e,t,r){return e=new S(e,r),t=new S(t,r),e.intersects(t)},r.coerce=function(e,t){if(e instanceof f)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=o[u.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),o[u.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;o[u.COERCERTL].lastIndex=-1}else r=e.match(o[u.COERCE]);if(null===r)return null;return p(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}}).call(this,e("_process"))},{_process:437}],380:[function(e,t,r){"use strict";const{PassThrough:n}=e("stream");t.exports=function(){var e=[],t=new n({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=function(){return 0==e.length},t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(r),t;function r(n){return Array.isArray(n)?(n.forEach(r),this):(e.push(n),n.once("end",i.bind(null,n)),n.once("error",t.emit.bind(t,"error")),n.pipe(t,{end:!1}),this)}function i(r){!(e=e.filter(function(e){return e!==r})).length&&t.readable&&t.end()}}},{stream:503}],381:[function(e,t,r){(function(r){"use strict";const n=e("stream").PassThrough,i=Array.prototype.slice;function s(e,t){if(Array.isArray(e))for(let r=0,n=e.length;r<n;r++)e[r]=s(e[r],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(n(t))),!e._readableState||!e.pause||!e.pipe)throw new Error("Only readable stream can be merged.");e.pause()}return e}t.exports=function(){const e=[];let t=!1;const o=i.call(arguments);let a=o[o.length-1];a&&!Array.isArray(a)&&null==a.pipe?o.pop():a={};const u=!1!==a.end;null==a.objectMode&&(a.objectMode=!0);null==a.highWaterMark&&(a.highWaterMark=65536);const l=n(a);function c(){for(let t=0,r=arguments.length;t<r;t++)e.push(s(arguments[t],a));return function n(){if(t)return;t=!0;let i=e.shift();if(!i)return void r.nextTick(h);Array.isArray(i)||(i=[i]);let s=i.length+1;function o(){--s>0||(t=!1,n())}function a(e){function t(){e.removeListener("merge2UnpipeEnd",t),e.removeListener("end",t),o()}if(e._readableState.endEmitted)return o();e.on("merge2UnpipeEnd",t),e.on("end",t),e.pipe(l,{end:!1}),e.resume()}for(let e=0;e<i.length;e++)a(i[e]);o()}(),this}function h(){return t=!1,l.emit("queueDrain"),u&&l.end()}l.setMaxListeners(0),l.add=c,l.on("unpipe",function(e){e.emit("merge2UnpipeEnd")}),o.length&&c.apply(null,o);return l}}).call(this,e("_process"))},{_process:437,stream:503}],382:[function(e,t,r){(function(r){e("path");var n=e("fs");function i(){this.types=Object.create(null),this.extensions=Object.create(null)}i.prototype.define=function(e){for(var t in e){for(var n=e[t],i=0;i<n.length;i++)r.env.DEBUG_MIME&&this.types[n[i]]&&console.warn((this._loading||"define()").replace(/.*\//,""),'changes "'+n[i]+'" extension type from '+this.types[n[i]]+" to "+t),this.types[n[i]]=t;this.extensions[t]||(this.extensions[t]=n[0])}},i.prototype.load=function(e){this._loading=e;var t={};n.readFileSync(e,"ascii").split(/[\r\n]+/).forEach(function(e){var r=e.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);t[r.shift()]=r}),this.define(t),this._loading=null},i.prototype.lookup=function(e,t){var r=e.replace(/^.*[\.\/\\]/,"").toLowerCase();return this.types[r]||t||this.default_type},i.prototype.extension=function(e){var t=e.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[t]};var s=new i;s.define(e("./types.json")),s.default_type=s.lookup("bin"),s.Mime=i,s.charsets={lookup:function(e,t){return/^text\/|^application\/(javascript|json)/.test(e)?"UTF-8":t}},t.exports=s}).call(this,e("_process"))},{"./types.json":383,_process:437,fs:298,path:404}],383:[function(e,t,r){t.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},{}],384:[function(e,t,r){"use strict";const n=(e,t)=>{for(const r of Reflect.ownKeys(t))Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e};t.exports=n,t.exports.default=n},{}],385:[function(e,t,r){t.exports=d,d.Minimatch=m;var n={sep:"/"};try{n=e("path")}catch(e){}var i=d.GLOBSTAR=m.GLOBSTAR={},s=e("brace-expansion"),o={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},a="[^/]",u=a+"*?",l="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",c="(?:(?!(?:\\/|^)\\.).)*?",h="().*{}+?[]^$\\!".split("").reduce(function(e,t){return e[t]=!0,e},{});var p=/\/+/;function f(e,t){e=e||{},t=t||{};var r={};return Object.keys(t).forEach(function(e){r[e]=t[e]}),Object.keys(e).forEach(function(t){r[t]=e[t]}),r}function d(e,t,r){if("string"!=typeof t)throw new TypeError("glob pattern string required");return r||(r={}),!(!r.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new m(t,r).match(e))}function m(e,t){if(!(this instanceof m))return new m(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==n.sep&&(e=e.split(n.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function g(e,t){if(t||(t=this instanceof m?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:s(e)}d.filter=function(e,t){return t=t||{},function(r,n,i){return d(r,e,t)}},d.defaults=function(e){if(!e||!Object.keys(e).length)return d;var t=d,r=function(r,n,i){return t.minimatch(r,n,f(e,i))};return r.Minimatch=function(r,n){return new t.Minimatch(r,f(e,n))},r},m.defaults=function(e){return e&&Object.keys(e).length?d.defaults(e).Minimatch:m},m.prototype.debug=function(){},m.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var r=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,r),r=this.globParts=r.map(function(e){return e.split(p)}),this.debug(this.pattern,r),r=r.map(function(e,t,r){return e.map(this.parse,this)},this),this.debug(this.pattern,r),r=r.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,r),this.set=r},m.prototype.parseNegate=function(){var e=this.pattern,t=!1,r=0;if(this.options.nonegate)return;for(var n=0,i=e.length;n<i&&"!"===e.charAt(n);n++)t=!t,r++;r&&(this.pattern=e.substr(r));this.negate=t},d.braceExpand=function(e,t){return g(e,t)},m.prototype.braceExpand=g,m.prototype.parse=function(e,t){if(e.length>65536)throw new TypeError("pattern is too long");var r=this.options;if(!r.noglobstar&&"**"===e)return i;if(""===e)return"";var n,s="",l=!!r.nocase,c=!1,p=[],f=[],d=!1,m=-1,g=-1,y="."===e.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",_=this;function b(){if(n){switch(n){case"*":s+=u,l=!0;break;case"?":s+=a,l=!0;break;default:s+="\\"+n}_.debug("clearStateChar %j %j",n,s),n=!1}}for(var x,w=0,E=e.length;w<E&&(x=e.charAt(w));w++)if(this.debug("%s\t%s %s %j",e,w,s,x),c&&h[x])s+="\\"+x,c=!1;else switch(x){case"/":return!1;case"\\":b(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,w,s,x),d){this.debug(" in class"),"!"===x&&w===g+1&&(x="^"),s+=x;continue}_.debug("call clearStateChar %j",n),b(),n=x,r.noext&&b();continue;case"(":if(d){s+="(";continue}if(!n){s+="\\(";continue}p.push({type:n,start:w-1,reStart:s.length,open:o[n].open,close:o[n].close}),s+="!"===n?"(?:(?!(?:":"(?:",this.debug("plType %j %j",n,s),n=!1;continue;case")":if(d||!p.length){s+="\\)";continue}b(),l=!0;var T=p.pop();s+=T.close,"!"===T.type&&f.push(T),T.reEnd=s.length;continue;case"|":if(d||!p.length||c){s+="\\|",c=!1;continue}b(),s+="|";continue;case"[":if(b(),d){s+="\\"+x;continue}d=!0,g=w,m=s.length,s+=x;continue;case"]":if(w===g+1||!d){s+="\\"+x,c=!1;continue}if(d){var A=e.substring(g+1,w);try{RegExp("["+A+"]")}catch(e){var S=this.parse(A,v);s=s.substr(0,m)+"\\["+S[0]+"\\]",l=l||S[1],d=!1;continue}}l=!0,d=!1,s+=x;continue;default:b(),c?c=!1:!h[x]||"^"===x&&d||(s+="\\"),s+=x}d&&(A=e.substr(g+1),S=this.parse(A,v),s=s.substr(0,m)+"\\["+S[0],l=l||S[1]);for(T=p.pop();T;T=p.pop()){var k=s.slice(T.reStart+T.open.length);this.debug("setting tail",s,T),k=k.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(e,t,r){return r||(r="\\"),t+t+r+"|"}),this.debug("tail=%j\n %s",k,k,T,s);var C="*"===T.type?u:"?"===T.type?a:"\\"+T.type;l=!0,s=s.slice(0,T.reStart)+C+"\\("+k}b(),c&&(s+="\\\\");var I=!1;switch(s.charAt(0)){case".":case"[":case"(":I=!0}for(var R=f.length-1;R>-1;R--){var L=f[R],O=s.slice(0,L.reStart),M=s.slice(L.reStart,L.reEnd-8),P=s.slice(L.reEnd-8,L.reEnd),B=s.slice(L.reEnd);P+=B;var N=O.split("(").length-1,D=B;for(w=0;w<N;w++)D=D.replace(/\)[+*?]?/,"");var F="";""===(B=D)&&t!==v&&(F="$");var j=O+M+B+F+P;s=j}""!==s&&l&&(s="(?=.)"+s);I&&(s=y+s);if(t===v)return[s,l];if(!l)return e.replace(/\\(.)/g,"$1");var U=r.nocase?"i":"";try{var $=new RegExp("^"+s+"$",U)}catch(e){return new RegExp("$.")}return $._glob=e,$._src=s,$};var v={};d.makeRe=function(e,t){return new m(e,t||{}).makeRe()},m.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,r=t.noglobstar?u:t.dot?l:c,n=t.nocase?"i":"",s=e.map(function(e){return e.map(function(e){return e===i?r:"string"==typeof e?e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):e._src}).join("\\/")}).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,n)}catch(e){this.regexp=!1}return this.regexp},d.match=function(e,t,r){var n=new m(t,r=r||{});return e=e.filter(function(e){return n.match(e)}),n.options.nonull&&!e.length&&e.push(t),e},m.prototype.match=function(e,t){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var r=this.options;"/"!==n.sep&&(e=e.split(n.sep).join("/"));e=e.split(p),this.debug(this.pattern,"split",e);var i,s,o=this.set;for(this.debug(this.pattern,"set",o),s=e.length-1;s>=0&&!(i=e[s]);s--);for(s=0;s<o.length;s++){var a=o[s],u=e;r.matchBase&&1===a.length&&(u=[i]);var l=this.matchOne(u,a,t);if(l)return!!r.flipNegate||!this.negate}return!r.flipNegate&&this.negate},m.prototype.matchOne=function(e,t,r){var n=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var s=0,o=0,a=e.length,u=t.length;s<a&&o<u;s++,o++){this.debug("matchOne loop");var l,c=t[o],h=e[s];if(this.debug(t,c,h),!1===c)return!1;if(c===i){this.debug("GLOBSTAR",[t,c,h]);var p=s,f=o+1;if(f===u){for(this.debug("** at the end");s<a;s++)if("."===e[s]||".."===e[s]||!n.dot&&"."===e[s].charAt(0))return!1;return!0}for(;p<a;){var d=e[p];if(this.debug("\nglobstar while",e,p,t,f,d),this.matchOne(e.slice(p),t.slice(f),r))return this.debug("globstar found match!",p,a,d),!0;if("."===d||".."===d||!n.dot&&"."===d.charAt(0)){this.debug("dot detected!",e,p,t,f);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!r||(this.debug("\n>>> no match, partial?",e,p,t,f),p!==a))}if("string"==typeof c?(l=n.nocase?h.toLowerCase()===c.toLowerCase():h===c,this.debug("string match",c,h,l)):(l=h.match(c),this.debug("pattern match",c,h,l)),!l)return!1}if(s===a&&o===u)return!0;if(s===a)return r;if(o===u)return s===a-1&&""===e[s];throw new Error("wtf?")}},{"brace-expansion":34,path:404}],386:[function(e,t,r){"use strict";var n=e("cwise-compiler"),i={body:"",args:[],thisVars:[],localVars:[]};function s(e){if(!e)return i;for(var t=0;t<e.args.length;++t){var r=e.args[t];e.args[t]=0===t?{name:r,lvalue:!0,rvalue:!!e.rvalue,count:e.count||1}:{name:r,lvalue:!1,rvalue:!0,count:1}}return e.thisVars||(e.thisVars=[]),e.localVars||(e.localVars=[]),e}function o(e){for(var t=[],r=0;r<e.args.length;++r)t.push("a"+r);return new Function("P",["return function ",e.funcName,"_ndarrayops(",t.join(","),") {P(",t.join(","),");return a0}"].join(""))(function(e){return n({args:e.args,pre:s(e.pre),body:s(e.body),post:s(e.proc),funcName:e.funcName})}(e))}var a={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var e in a){var t=a[e];r[e]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),r[e+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+t+"=b"},rvalue:!0,funcName:e+"eq"}),r[e+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),r[e+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+t+"=s"},rvalue:!0,funcName:e+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var e in u){var t=u[e];r[e]=o({args:["array","array"],body:{args:["a","b"],body:"a="+t+"b"},funcName:e}),r[e+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+t+"a"},rvalue:!0,count:2,funcName:e+"eq"})}}();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var e in l){var t=l[e];r[e]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+t+"c"},funcName:e}),r[e+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+t+"s"},funcName:e+"s"}),r[e+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+t+"b"},rvalue:!0,count:2,funcName:e+"eq"}),r[e+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+t+"s"},rvalue:!0,count:2,funcName:e+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var e=0;e<c.length;++e){var t=c[e];r[t]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:t}),r[t+"eq"]=o({args:["array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"eq"})}}();var h=["max","min","atan2","pow"];!function(){for(var e=0;e<h.length;++e){var t=h[e];r[t]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:t}),r[t+"s"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:t+"s"}),r[t+"eq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"seq"})}}();var p=["atan2","pow"];!function(){for(var e=0;e<p.length;++e){var t=p[e];r[t+"op"]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:t+"op"}),r[t+"ops"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:t+"ops"}),r[t+"opeq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"opeq"}),r[t+"opseq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+t,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:t+"opseq"})}}(),r.any=n({args:["array"],pre:i,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),r.all=n({args:["array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),r.sum=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),r.prod=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),r.norm2squared=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),r.norm2=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),r.norminf=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=n({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.argmin=n({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.argmax=n({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":48}],387:[function(e,t,r){"use strict";var n=e("ndarray"),i=e("./doConvert.js");t.exports=function(e,t){for(var r=[],s=e,o=1;Array.isArray(s);)r.push(s.length),o*=s.length,s=s[0];return 0===r.length?n():(t||(t=n(new Float64Array(o),r)),i(t,e),t)}},{"./doConvert.js":388,ndarray:389}],388:[function(e,t,r){t.exports=e("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":48}],389:[function(e,t,r){var n=e("iota-array"),i=e("is-buffer"),s="undefined"!=typeof Float64Array;function o(e,t){return e[0]-t[0]}function a(){var e,t=this.stride,r=new Array(t.length);for(e=0;e<r.length;++e)r[e]=[Math.abs(t[e]),e];r.sort(o);var n=new Array(r.length);for(e=0;e<n.length;++e)n[e]=r[e][1];return n}function u(e,t){var r=["View",t,"d",e].join("");t<0&&(r="View_Nil"+e);var i="generic"===e;if(-1===t){var s="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+e+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}";return new Function(s)()}if(0===t){s="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+e+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(i?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(i?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}";return new Function("TrivialArray",s)(l[e][0])}s=["'use strict'"];var o=n(t),u=o.map(function(e){return"i"+e}),c="this.offset+"+o.map(function(e){return"this.stride["+e+"]*i"+e}).join("+"),h=o.map(function(e){return"b"+e}).join(","),p=o.map(function(e){return"c"+e}).join(",");s.push("function "+r+"(a,"+h+","+p+",d){this.data=a","this.shape=["+h+"]","this.stride=["+p+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+e+"'","proto.dimension="+t),s.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+o.map(function(e){return"this.shape["+e+"]"}).join("*"),"}})"),1===t?s.push("proto.order=[0]"):(s.push("Object.defineProperty(proto,'order',{get:"),t<4?(s.push("function "+r+"_order(){"),2===t?s.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&s.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):s.push("ORDER})")),s.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),i?s.push("return this.data.set("+c+",v)}"):s.push("return this.data["+c+"]=v}"),s.push("proto.get=function "+r+"_get("+u.join(",")+"){"),i?s.push("return this.data.get("+c+")}"):s.push("return this.data["+c+"]}"),s.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),s.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+o.map(function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")}).join(",")+","+o.map(function(e){return"this.stride["+e+"]"}).join(",")+",this.offset)}");var f=o.map(function(e){return"a"+e+"=this.shape["+e+"]"}),d=o.map(function(e){return"c"+e+"=this.stride["+e+"]"});s.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+f.join(",")+","+d.join(","));for(var m=0;m<t;++m)s.push("if(typeof i"+m+"==='number'&&i"+m+">=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");s.push("return new "+r+"(this.data,"+o.map(function(e){return"a"+e}).join(",")+","+o.map(function(e){return"c"+e}).join(",")+",b)}"),s.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+o.map(function(e){return"a"+e+"=this.shape["+e+"]"}).join(",")+","+o.map(function(e){return"b"+e+"=this.stride["+e+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m<t;++m)s.push("if(typeof i"+m+"==='number'){d=i"+m+"|0;if(d<0){c+=b"+m+"*(a"+m+"-1);a"+m+"=ceil(-a"+m+"/d)}else{a"+m+"=ceil(a"+m+"/d)}b"+m+"*=d}");s.push("return new "+r+"(this.data,"+o.map(function(e){return"a"+e}).join(",")+","+o.map(function(e){return"b"+e}).join(",")+",c)}");var g=new Array(t),v=new Array(t);for(m=0;m<t;++m)g[m]="a[i"+m+"]",v[m]="b[i"+m+"]";s.push("proto.transpose=function "+r+"_transpose("+u+"){"+u.map(function(e,t){return e+"=("+e+"===undefined?"+t+":"+e+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+g.join(",")+","+v.join(",")+",this.offset)}"),s.push("proto.pick=function "+r+"_pick("+u+"){var a=[],b=[],c=this.offset");for(m=0;m<t;++m)s.push("if(typeof i"+m+"==='number'&&i"+m+">=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");return s.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),s.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map(function(e){return"shape["+e+"]"}).join(",")+","+o.map(function(e){return"stride["+e+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",s.join("\n"))(l[e],a)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};t.exports=function(e,t,r,n){if(void 0===e)return(0,l.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var o=t.length;if(void 0===r){r=new Array(o);for(var a=o-1,c=1;a>=0;--a)r[a]=c,c*=t[a]}if(void 0===n)for(n=0,a=0;a<o;++a)r[a]<0&&(n-=(t[a]-1)*r[a]);for(var h=function(e){if(i(e))return"buffer";if(s)switch(Object.prototype.toString.call(e)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(e)?"array":"generic"}(e),p=l[h];p.length<=o+1;)p.push(u(h,p.length-1));return(0,p[o+1])(e,t,r,n)}},{"iota-array":360,"is-buffer":361}],390:[function(e,t,r){(function(r,n){"use strict";var i=e("util"),s=e("stream"),o=t.exports=function(){s.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};i.inherits(o,s),o.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t}),r.nextTick(function(){this._process(),this._paused&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},o.prototype.write=function(e,t){return this.writable?(n.isBuffer(e)||(e=new n(e,t||this._encoding)),this._buffers.push(e),this._buffered+=e.length,this._process(),this._reads&&0==this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1)},o.prototype.end=function(e,t){e&&this.write(e,t),this.writable=!1,this._buffers&&(0==this._buffers.length?this._end():(this._buffers.push(null),this._process()))},o.prototype.destroySoon=o.prototype.end,o.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waitng on finished stream")),this.destroy()},o.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},o.prototype._process=function(){for(;this._buffered>0&&this._reads&&this._reads.length>0;){var e=this._reads[0];if(e.allowLess){this._reads.shift(),(s=this._buffers[0]).length>e.length?(this._buffered-=e.length,this._buffers[0]=s.slice(e.length),e.func.call(this,s.slice(0,e.length))):(this._buffered-=s.length,this._buffers.shift(),e.func.call(this,s))}else{if(!(this._buffered>=e.length))break;this._reads.shift();for(var t=0,r=0,i=new n(e.length);t<e.length;){var s=this._buffers[r++],o=Math.min(s.length,e.length-t);s.copy(i,t,0,o),t+=o,o!=s.length&&(this._buffers[--r]=s.slice(o))}r>0&&this._buffers.splice(0,r),this._buffered-=e.length,e.func.call(this,i)}}this._buffers&&this._buffers.length>0&&null==this._buffers[0]&&this._end()}}).call(this,e("_process"),e("buffer").Buffer)},{_process:437,buffer:299,stream:503,util:523}],391:[function(e,t,r){"use strict";t.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLOR_PALETTE:1,COLOR_COLOR:2,COLOR_ALPHA:4}},{}],392:[function(e,t,r){"use strict";var n=e("util"),i=e("stream"),s=t.exports=function(){i.call(this),this._crc=-1,this.writable=!0};n.inherits(s,i),s.prototype.write=function(e){for(var t=0;t<e.length;t++)this._crc=o[255&(this._crc^e[t])]^this._crc>>>8;return!0},s.prototype.end=function(e){e&&this.write(e),this.emit("crc",this.crc32())},s.prototype.crc32=function(){return-1^this._crc},s.crc32=function(e){for(var t=-1,r=0;r<e.length;r++)t=o[255&(t^e[r])]^t>>>8;return-1^t};for(var o=[],a=0;a<256;a++){for(var u=a,l=0;l<8;l++)1&u?u=3988292384^u>>>1:u>>>=1;o[a]=u}},{stream:503,util:523}],393:[function(e,t,r){(function(r){"use strict";var n=e("util"),i=(e("zlib"),e("./chunkstream")),s=t.exports=function(e,t,r,n,s){i.call(this),this._width=e,this._height=t,this._Bpp=r,this._data=n,this._options=s,this._line=0,"filterType"in s&&-1!=s.filterType?"number"==typeof s.filterType&&(s.filterType=[s.filterType]):s.filterType=[0,1,2,3,4],this._filters={0:this._filterNone.bind(this),1:this._filterSub.bind(this),2:this._filterUp.bind(this),3:this._filterAvg.bind(this),4:this._filterPaeth.bind(this)},this.read(this._width*r+1,this._reverseFilterLine.bind(this))};n.inherits(s,i);var o={1:{0:0,1:0,2:0,3:255},2:{0:0,1:0,2:0,3:1},3:{0:0,1:1,2:2,3:255},4:{0:0,1:1,2:2,3:3}};s.prototype._reverseFilterLine=function(e){var t=this._data,r=this._width<<2,n=this._line*r,i=e[0];if(0==i)for(var s=0;s<this._width;s++)for(var u=n+(s<<2),l=1+s*this._Bpp,c=0;c<4;c++){var h=o[this._Bpp][c];t[u+c]=255!=h?e[l+h]:255}else if(1==i)for(s=0;s<this._width;s++)for(u=n+(s<<2),l=1+s*this._Bpp,c=0;c<4;c++){h=o[this._Bpp][c];var p=s>0?t[u+c-4]:0;t[u+c]=255!=h?e[l+h]+p:255}else if(2==i)for(s=0;s<this._width;s++)for(u=n+(s<<2),l=1+s*this._Bpp,c=0;c<4;c++){h=o[this._Bpp][c];var f=this._line>0?t[u-r+c]:0;t[u+c]=255!=h?e[l+h]+f:255}else if(3==i)for(s=0;s<this._width;s++)for(u=n+(s<<2),l=1+s*this._Bpp,c=0;c<4;c++){h=o[this._Bpp][c],p=s>0?t[u+c-4]:0,f=this._line>0?t[u-r+c]:0;var d=Math.floor((p+f)/2);t[u+c]=255!=h?e[l+h]+d:255}else if(4==i)for(s=0;s<this._width;s++)for(u=n+(s<<2),l=1+s*this._Bpp,c=0;c<4;c++){h=o[this._Bpp][c],p=s>0?t[u+c-4]:0,f=this._line>0?t[u-r+c]:0;var m=s>0&&this._line>0?t[u-r+c-4]:0;d=a(p,f,m);t[u+c]=255!=h?e[l+h]+d:255}this._line++,this._line<this._height?this.read(this._width*this._Bpp+1,this._reverseFilterLine.bind(this)):this.emit("complete",this._data,this._width,this._height)},s.prototype.filter=function(){for(var e=this._data,t=new r((1+(this._width<<2))*this._height),n=0;n<this._height;n++){for(var i=this._options.filterType,s=1/0,o=0,a=0;a<i.length;a++){var u=this._filters[i[a]](e,n,null);u<s&&(o=i[a],s=u)}this._filters[o](e,n,t)}return t},s.prototype._filterNone=function(e,t,r){var n=this._width<<2,i=n+1,s=0;if(r)r[t*i]=0,e.copy(r,i*t+1,n*t,n*(t+1));else for(var o=0;o<n;o++)s+=Math.abs(e[t*n+o]);return s},s.prototype._filterSub=function(e,t,r){var n=this._width<<2,i=n+1,s=0;r&&(r[t*i]=1);for(var o=0;o<n;o++){var a=o>=4?e[t*n+o-4]:0,u=e[t*n+o]-a;r?r[t*i+1+o]=u:s+=Math.abs(u)}return s},s.prototype._filterUp=function(e,t,r){var n=this._width<<2,i=n+1,s=0;r&&(r[t*i]=2);for(var o=0;o<n;o++){var a=t>0?e[(t-1)*n+o]:0,u=e[t*n+o]-a;r?r[t*i+1+o]=u:s+=Math.abs(u)}return s},s.prototype._filterAvg=function(e,t,r){var n=this._width<<2,i=n+1,s=0;r&&(r[t*i]=3);for(var o=0;o<n;o++){var a=o>=4?e[t*n+o-4]:0,u=t>0?e[(t-1)*n+o]:0,l=e[t*n+o]-(a+u>>1);r?r[t*i+1+o]=l:s+=Math.abs(l)}return s},s.prototype._filterPaeth=function(e,t,r){var n=this._width<<2,i=n+1,s=0;r&&(r[t*i]=4);for(var o=0;o<n;o++){var u=o>=4?e[t*n+o-4]:0,l=t>0?e[(t-1)*n+o]:0,c=o>=4&&t>0?e[(t-1)*n+o-4]:0,h=e[t*n+o]-a(u,l,c);r?r[t*i+1+o]=h:s+=Math.abs(h)}return s};var a=function(e,t,r){var n=e+t-r,i=Math.abs(n-e),s=Math.abs(n-t),o=Math.abs(n-r);return i<=s&&i<=o?e:s<=o?t:r}}).call(this,e("buffer").Buffer)},{"./chunkstream":390,buffer:299,util:523,zlib:297}],394:[function(e,t,r){(function(r){"use strict";var n=e("util"),i=e("stream"),s=e("zlib"),o=e("./filter"),a=e("./crc"),u=e("./constants"),l=t.exports=function(e){i.call(this),this._options=e,e.deflateChunkSize=e.deflateChunkSize||32768,e.deflateLevel=e.deflateLevel||9,e.deflateStrategy=e.deflateStrategy||3,this.readable=!0};n.inherits(l,i),l.prototype.pack=function(e,t,n){this.emit("data",new r(u.PNG_SIGNATURE)),this.emit("data",this._packIHDR(t,n));e=new o(t,n,4,e,this._options).filter();var i=s.createDeflate({chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy});i.on("error",this.emit.bind(this,"error")),i.on("data",function(e){this.emit("data",this._packIDAT(e))}.bind(this)),i.on("end",function(){this.emit("data",this._packIEND()),this.emit("end")}.bind(this)),i.end(e)},l.prototype._packChunk=function(e,t){var n=t?t.length:0,i=new r(n+12);return i.writeUInt32BE(n,0),i.writeUInt32BE(e,4),t&&t.copy(i,8),i.writeInt32BE(a.crc32(i.slice(4,i.length-4)),i.length-4),i},l.prototype._packIHDR=function(e,t){var n=new r(13);return n.writeUInt32BE(e,0),n.writeUInt32BE(t,4),n[8]=8,n[9]=6,n[10]=0,n[11]=0,n[12]=0,this._packChunk(u.TYPE_IHDR,n)},l.prototype._packIDAT=function(e){return this._packChunk(u.TYPE_IDAT,e)},l.prototype._packIEND=function(){return this._packChunk(u.TYPE_IEND,null)}}).call(this,e("buffer").Buffer)},{"./constants":391,"./crc":392,"./filter":393,buffer:299,stream:503,util:523,zlib:297}],395:[function(e,t,r){(function(r){"use strict";var n=e("util"),i=e("zlib"),s=e("./crc"),o=e("./chunkstream"),a=e("./constants"),u=e("./filter"),l=t.exports=function(e){o.call(this),this._options=e,e.checkCRC=!1!==e.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._inflate=null,this._filter=null,this._crc=null,this._palette=[],this._colorType=0,this._chunks={},this._chunks[a.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[a.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[a.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[a.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[a.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[a.TYPE_gAMA]=this._handleGAMA.bind(this),this.writable=!0,this.on("error",this._handleError.bind(this)),this._handleSignature()};n.inherits(l,o),l.prototype._handleError=function(){this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy()},l.prototype._handleSignature=function(){this.read(a.PNG_SIGNATURE.length,this._parseSignature.bind(this))},l.prototype._parseSignature=function(e){for(var t=a.PNG_SIGNATURE,r=0;r<t.length;r++)if(e[r]!=t[r])return void this.emit("error",new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},l.prototype._parseChunkBegin=function(e){for(var t=e.readUInt32BE(0),n=e.readUInt32BE(4),i="",o=4;o<8;o++)i+=String.fromCharCode(e[o]);var u=!!(32&e[4]);e[5],e[7];if(this._hasIHDR||n==a.TYPE_IHDR){if(this._crc=new s,this._crc.write(new r(i)),this._chunks[n])return this._chunks[n](t);u?this.read(t+4,this._skipChunk.bind(this)):this.emit("error",new Error("Unsupported critical chunk type "+i))}else this.emit("error",new Error("Expected IHDR on beggining"))},l.prototype._skipChunk=function(e){this.read(8,this._parseChunkBegin.bind(this))},l.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},l.prototype._parseChunkEnd=function(e){var t=e.readInt32BE(0),r=this._crc.crc32();this._options.checkCRC&&r!=t?this.emit("error",new Error("Crc error")):this._hasIEND?this.destroySoon():this.read(8,this._parseChunkBegin.bind(this))},l.prototype._handleIHDR=function(e){this.read(e,this._parseIHDR.bind(this))},l.prototype._parseIHDR=function(e){this._crc.write(e);var t=e.readUInt32BE(0),n=e.readUInt32BE(4),i=e[8],s=e[9],o=e[10],l=e[11],h=e[12];8==i?s in c?0==o?0==l?0==h?(this._colorType=s,this._data=new r(t*n*4),this._filter=new u(t,n,c[this._colorType],this._data,this._options),this._hasIHDR=!0,this.emit("metadata",{width:t,height:n,palette:!!(s&a.COLOR_PALETTE),color:!!(s&a.COLOR_COLOR),alpha:!!(s&a.COLOR_ALPHA),data:this._data}),this._handleChunkEnd()):this.emit("error",new Error("Unsupported interlace method")):this.emit("error",new Error("Unsupported filter method")):this.emit("error",new Error("Unsupported compression method")):this.emit("error",new Error("Unsupported color type")):this.emit("error",new Error("Unsupported bit depth "+i))},l.prototype._handlePLTE=function(e){this.read(e,this._parsePLTE.bind(this))},l.prototype._parsePLTE=function(e){this._crc.write(e);for(var t=Math.floor(e.length/3),r=0;r<t;r++)this._palette.push([e.readUInt8(3*r),e.readUInt8(3*r+1),e.readUInt8(3*r+2),255]);this._handleChunkEnd()},l.prototype._handleTRNS=function(e){this.read(e,this._parseTRNS.bind(this))},l.prototype._parseTRNS=function(e){if(this._crc.write(e),3==this._colorType){if(0==this._palette.length)return void this.emit("error",new Error("Transparency chunk must be after palette"));if(e.length>this._palette.length)return void this.emit("error",new Error("More transparent colors than palette size"));for(var t=0;t<this._palette.length;t++)this._palette[t][3]=t<e.length?e.readUInt8(t):255}this._handleChunkEnd()},l.prototype._handleGAMA=function(e){this.read(e,this._parseGAMA.bind(this))},l.prototype._parseGAMA=function(e){this._crc.write(e),this.emit("gamma",e.readUInt32BE(0)/1e5),this._handleChunkEnd()},l.prototype._handleIDAT=function(e){this.read(-e,this._parseIDAT.bind(this,e))},l.prototype._parseIDAT=function(e,t){if(this._crc.write(t),3==this._colorType&&0==this._palette.length)throw new Error("Expected palette not found");this._inflate||(this._inflate=i.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._reverseFiltered.bind(this)),this._inflate.pipe(this._filter)),this._inflate.write(t),(e-=t.length)>0?this._handleIDAT(e):this._handleChunkEnd()},l.prototype._handleIEND=function(e){this.read(e,this._parseIEND.bind(this))},l.prototype._parseIEND=function(e){this._crc.write(e),this._inflate.end(),this._hasIEND=!0,this._handleChunkEnd()};var c={0:1,2:3,3:1,4:2,6:4};l.prototype._reverseFiltered=function(e,t,r){if(3==this._colorType)for(var n=t<<2,i=0;i<r;i++)for(var s=i*n,o=0;o<t;o++)for(var a=s+(o<<2),u=this._palette[e[a]],l=0;l<4;l++)e[a+l]=u[l];this.emit("parsed",e)}}).call(this,e("buffer").Buffer)},{"./chunkstream":390,"./constants":391,"./crc":392,"./filter":393,buffer:299,util:523,zlib:297}],396:[function(e,t,r){(function(t,n){"use strict";var i=e("util"),s=e("stream"),o=e("./parser"),a=e("./packer"),u=r.PNG=function(e){s.call(this),e=e||{},this.width=e.width||0,this.height=e.height||0,this.data=this.width>0&&this.height>0?new n(4*this.width*this.height):null,e.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new o(e||{}),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new a(e),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(u,s),u.prototype.pack=function(){return t.nextTick(function(){this._packer.pack(this.data,this.width,this.height)}.bind(this)),this},u.prototype.parse=function(e,t){if(t){var r,n=null;this.once("parsed",r=function(e){this.removeListener("error",n),this.data=e,t(null,this)}.bind(this)),this.once("error",n=function(e){this.removeListener("parsed",r),t(e,null)}.bind(this))}return this.end(e),this},u.prototype.write=function(e){return this._parser.write(e),!0},u.prototype.end=function(e){this._parser.end(e)},u.prototype._metadata=function(e){this.width=e.width,this.height=e.height,this.data=e.data,delete e.data,this.emit("metadata",e)},u.prototype._gamma=function(e){this.gamma=e},u.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},u.prototype.bitblt=function(e,t,r,n,i,s,o){if(t>this.width||r>this.height||t+n>this.width||r+i>this.height)throw new Error("bitblt reading outside image");if(s>e.width||o>e.height||s+n>e.width||o+i>e.height)throw new Error("bitblt writing outside image");for(var a=0;a<i;a++)this.data.copy(e.data,(o+a)*e.width+s<<2,(r+a)*this.width+t<<2,(r+a)*this.width+t+n<<2);return this}}).call(this,e("_process"),e("buffer").Buffer)},{"./packer":394,"./parser":395,_process:437,buffer:299,stream:503,util:523}],397:[function(e,t,r){(function(r){"use strict";const n=e("path"),i=e("path-key");t.exports=(e=>{let t;e=Object.assign({cwd:r.cwd(),path:r.env[i()]},e);let s=n.resolve(e.cwd);const o=[];for(;t!==s;)o.push(n.join(s,"node_modules/.bin")),t=s,s=n.resolve(s,"..");return o.push(n.dirname(r.execPath)),o.concat(e.path).join(n.delimiter)}),t.exports.env=(e=>{e=Object.assign({env:r.env},e);const n=Object.assign({},e.env),s=i({env:n});return e.path=n[s],n[s]=t.exports(e),n})}).call(this,e("_process"))},{_process:437,path:404,"path-key":406}],398:[function(e,t,r){"use strict";function n(e,t,r,n){for(var i=e[t++],s=1<<i,o=s+1,a=o+1,u=i+1,l=(1<<u)-1,c=0,h=0,p=0,f=e[t++],d=new Int32Array(4096),m=null;;){for(;c<16&&0!==f;)h|=e[t++]<<c,c+=8,1===f?f=e[t++]:--f;if(c<u)break;var g=h&l;if(h>>=u,c-=u,g!==s){if(g===o)break;for(var v=g<a?g:m,y=0,_=v;_>s;)_=d[_]>>8,++y;var b=_;if(p+y+(v!==g?1:0)>n)return void console.log("Warning, gif stream longer than expected.");r[p++]=b;var x=p+=y;for(v!==g&&(r[p++]=b),_=v;y--;)_=d[_],r[--x]=255&_,_>>=8;null!==m&&a<4096&&(d[a++]=m<<8|b,a>=l+1&&u<12&&(++u,l=l<<1|1)),m=g}else a=o+1,l=(1<<(u=i+1))-1,m=null}return p!==n&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(e,t,r,n){var i=0,s=void 0===(n=void 0===n?{}:n).loop?null:n.loop,o=void 0===n.palette?null:n.palette;if(t<=0||r<=0||t>65535||r>65535)throw new Error("Width/Height invalid.");function a(e){var t=e.length;if(t<2||t>256||t&t-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return t}e[i++]=71,e[i++]=73,e[i++]=70,e[i++]=56,e[i++]=57,e[i++]=97;var u=0,l=0;if(null!==o){for(var c=a(o);c>>=1;)++u;if(c=1<<u,--u,void 0!==n.background){if((l=n.background)>=c)throw new Error("Background index out of range.");if(0===l)throw new Error("Background index explicitly passed as 0.")}}if(e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=(null!==o?128:0)|u,e[i++]=l,e[i++]=0,null!==o)for(var h=0,p=o.length;h<p;++h){var f=o[h];e[i++]=f>>16&255,e[i++]=f>>8&255,e[i++]=255&f}if(null!==s){if(s<0||s>65535)throw new Error("Loop count invalid.");e[i++]=33,e[i++]=255,e[i++]=11,e[i++]=78,e[i++]=69,e[i++]=84,e[i++]=83,e[i++]=67,e[i++]=65,e[i++]=80,e[i++]=69,e[i++]=50,e[i++]=46,e[i++]=48,e[i++]=3,e[i++]=1,e[i++]=255&s,e[i++]=s>>8&255,e[i++]=0}var d=!1;this.addFrame=function(t,r,n,s,u,l){if(!0===d&&(--i,d=!1),l=void 0===l?{}:l,t<0||r<0||t>65535||r>65535)throw new Error("x/y invalid.");if(n<=0||s<=0||n>65535||s>65535)throw new Error("Width/Height invalid.");if(u.length<n*s)throw new Error("Not enough pixels for the frame size.");var c=!0,h=l.palette;if(void 0!==h&&null!==h||(c=!1,h=o),void 0===h||null===h)throw new Error("Must supply either a local or global palette.");for(var p=a(h),f=0;p>>=1;)++f;p=1<<f;var m=void 0===l.delay?0:l.delay,g=void 0===l.disposal?0:l.disposal;if(g<0||g>3)throw new Error("Disposal out of range.");var v=!1,y=0;if(void 0!==l.transparent&&null!==l.transparent&&(v=!0,(y=l.transparent)<0||y>=p))throw new Error("Transparent color index.");if((0!==g||v||0!==m)&&(e[i++]=33,e[i++]=249,e[i++]=4,e[i++]=g<<2|(!0===v?1:0),e[i++]=255&m,e[i++]=m>>8&255,e[i++]=y,e[i++]=0),e[i++]=44,e[i++]=255&t,e[i++]=t>>8&255,e[i++]=255&r,e[i++]=r>>8&255,e[i++]=255&n,e[i++]=n>>8&255,e[i++]=255&s,e[i++]=s>>8&255,e[i++]=!0===c?128|f-1:0,!0===c)for(var _=0,b=h.length;_<b;++_){var x=h[_];e[i++]=x>>16&255,e[i++]=x>>8&255,e[i++]=255&x}return i=function(e,t,r,n){e[t++]=r;var i=t++,s=1<<r,o=s-1,a=s+1,u=a+1,l=r+1,c=0,h=0;function p(r){for(;c>=r;)e[t++]=255&h,h>>=8,c-=8,t===i+256&&(e[i]=255,i=t++)}function f(e){h|=e<<c,c+=l,p(8)}var d=n[0]&o,m={};f(s);for(var g=1,v=n.length;g<v;++g){var y=n[g]&o,_=d<<8|y,b=m[_];if(void 0===b){for(h|=d<<c,c+=l;c>=8;)e[t++]=255&h,h>>=8,c-=8,t===i+256&&(e[i]=255,i=t++);4096===u?(f(s),u=a+1,l=r+1,m={}):(u>=1<<l&&++l,m[_]=u++),d=y}else d=b}return f(d),f(a),p(1),i+1===t?e[i]=0:(e[i]=t-i-1,e[t++]=0),t}(e,i,f<2?2:f,u)},this.end=function(){return!1===d&&(e[i++]=59,d=!0),i},this.getOutputBuffer=function(){return e},this.setOutputBuffer=function(t){e=t},this.getOutputBufferPosition=function(){return i},this.setOutputBufferPosition=function(e){i=e}},r.GifReader=function(e){var t=0;if(71!==e[t++]||73!==e[t++]||70!==e[t++]||56!==e[t++]||56!=(e[t++]+1&253)||97!==e[t++])throw new Error("Invalid GIF 87a/89a header.");var r=e[t++]|e[t++]<<8,i=e[t++]|e[t++]<<8,s=e[t++],o=s>>7,a=1<<1+(7&s);e[t++],e[t++];var u=null,l=null;o&&(u=t,l=a,t+=3*a);var c=!0,h=[],p=0,f=null,d=0,m=null;for(this.width=r,this.height=i;c&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(11!==e[t]||78==e[t+1]&&69==e[t+2]&&84==e[t+3]&&83==e[t+4]&&67==e[t+5]&&65==e[t+6]&&80==e[t+7]&&69==e[t+8]&&50==e[t+9]&&46==e[t+10]&&48==e[t+11]&&3==e[t+12]&&1==e[t+13]&&0==e[t+16])t+=14,m=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((C=e[t++])>=0))throw Error("Invalid block size");if(0===C)break;t+=C}break;case 249:if(4!==e[t++]||0!==e[t+4])throw new Error("Invalid graphics extension block.");var g=e[t++];p=e[t++]|e[t++]<<8,f=e[t++],0==(1&g)&&(f=null),d=g>>2&7,t++;break;case 254:for(;;){if(!((C=e[t++])>=0))throw Error("Invalid block size");if(0===C)break;t+=C}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var v=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,_=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,x=e[t++],w=x>>6&1,E=1<<1+(7&x),T=u,A=l,S=!1;x>>7&&(S=!0,T=t,A=E,t+=3*E);var k=t;for(t++;;){var C;if(!((C=e[t++])>=0))throw Error("Invalid block size");if(0===C)break;t+=C}h.push({x:v,y:y,width:_,height:b,has_local_palette:S,palette_offset:T,palette_size:A,data_offset:k,data_length:t-k,transparent_index:f,interlaced:!!w,delay:p,disposal:d});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return h.length},this.loopCount=function(){return m},this.frameInfo=function(e){if(e<0||e>=h.length)throw new Error("Frame index out of range.");return h[e]},this.decodeAndBlitFrameBGRA=function(t,i){var s=this.frameInfo(t),o=s.width*s.height,a=new Uint8Array(o);n(e,s.data_offset,a,o);var u=s.palette_offset,l=s.transparent_index;null===l&&(l=256);var c=s.width,h=r-c,p=c,f=4*(s.y*r+s.x),d=4*((s.y+s.height)*r+s.x),m=f,g=4*h;!0===s.interlaced&&(g+=4*r*7);for(var v=8,y=0,_=a.length;y<_;++y){var b=a[y];if(0===p&&(p=c,(m+=g)>=d&&(g=4*h+4*r*(v-1),m=f+(c+h)*(v<<1),v>>=1)),b===l)m+=4;else{var x=e[u+3*b],w=e[u+3*b+1],E=e[u+3*b+2];i[m++]=E,i[m++]=w,i[m++]=x,i[m++]=255}--p}},this.decodeAndBlitFrameRGBA=function(t,i){var s=this.frameInfo(t),o=s.width*s.height,a=new Uint8Array(o);n(e,s.data_offset,a,o);var u=s.palette_offset,l=s.transparent_index;null===l&&(l=256);var c=s.width,h=r-c,p=c,f=4*(s.y*r+s.x),d=4*((s.y+s.height)*r+s.x),m=f,g=4*h;!0===s.interlaced&&(g+=4*r*7);for(var v=8,y=0,_=a.length;y<_;++y){var b=a[y];if(0===p&&(p=c,(m+=g)>=d&&(g=4*h+4*r*(v-1),m=f+(c+h)*(v<<1),v>>=1)),b===l)m+=4;else{var x=e[u+3*b],w=e[u+3*b+1],E=e[u+3*b+2];i[m++]=x,i[m++]=w,i[m++]=E,i[m++]=255}--p}}}}catch(e){}},{}],399:[function(e,t,r){var n=e("wrappy");function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function s(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}t.exports=n(i),t.exports.strict=n(s),i.proto=i(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s(this)},configurable:!0})})},{wrappy:531}],400:[function(e,t,r){"use strict";const n=e("mimic-fn"),i=new WeakMap,s=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let r,s=!1,o=0;const a=e.displayName||e.name||"<anonymous>",u=function(...n){if(i.set(u,++o),s){if(!0===t.throw)throw new Error(`Function \`${a}\` can only be called once`);return r}return s=!0,r=e.apply(this,n),e=null,r};return n(u,e),i.set(u,o),u};t.exports=s,t.exports.default=s,t.exports.callCount=(e=>{if(!i.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return i.get(e)})},{"mimic-fn":384}],401:[function(e,t,r){(function(r,n){t.exports=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}return 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=4)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(6),s=r(15),o=r(2);t.validatorSymbol=Symbol("validators"),t.Predicate=class{constructor(e,t={}){this.type=e,this.options=t,this.context={validators:[]},this.context={...this.context,...this.options};const r=this.type[0].toLowerCase()+this.type.slice(1);this.addValidator({message:(e,t)=>`Expected ${(null==t?void 0:t.slice(this.type.length+1))||"argument"} to be of type \`${this.type}\` but received type \`${n.default(e)}\``,validator:e=>n.default[r](e)})}[o.testSymbol](e,t,r){for(const{validator:n,message:s}of this.context.validators){if(!0===this.options.optional&&void 0===e)continue;const o=n(e);if(!0===o)continue;let a=r;throw"function"==typeof r&&(a=r()),a=a?`${this.type} \`${a}\``:this.type,new i.ArgumentError(s(e,a,o),t)}}get[t.validatorSymbol](){return this.context.validators}get not(){return s.not(this)}validate(e){return this.addValidator({message:(e,t,r)=>"string"==typeof r?`(${t}) ${r}`:r(t),validator:t=>{const{message:r,validator:n}=e(t);return!!n||r}})}is(e){return this.addValidator({message:(e,t,r)=>r?`(${t}) ${r}`:`Expected ${t} \`${e}\` to pass custom validation function`,validator:e})}addValidator(e){return this.context.validators.push(e),this}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const{toString:n}=Object.prototype,i=e=>t=>typeof t===e,s=e=>{const t=n.call(e).slice(8,-1);if(t)return t},o=e=>t=>s(t)===e;function a(e){switch(e){case null:return"null";case!0:case!1:return"boolean"}switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"bigint":return"bigint";case"symbol":return"symbol"}if(a.function_(e))return"Function";if(a.observable(e))return"Observable";if(a.array(e))return"Array";if(a.buffer(e))return"Buffer";const t=s(e);if(t)return t;if(e instanceof String||e instanceof Boolean||e instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}a.undefined=i("undefined"),a.string=i("string");const u=i("number");a.number=(e=>u(e)&&!a.nan(e)),a.bigint=i("bigint"),a.function_=i("function"),a.null_=(e=>null===e),a.class_=(e=>a.function_(e)&&e.toString().startsWith("class ")),a.boolean=(e=>!0===e||!1===e),a.symbol=i("symbol"),a.numericString=(e=>a.string(e)&&e.length>0&&!Number.isNaN(Number(e))),a.array=Array.isArray,a.buffer=(e=>!a.nullOrUndefined(e)&&!a.nullOrUndefined(e.constructor)&&a.function_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)),a.nullOrUndefined=(e=>a.null_(e)||a.undefined(e)),a.object=(e=>!a.null_(e)&&("object"==typeof e||a.function_(e))),a.iterable=(e=>!a.nullOrUndefined(e)&&a.function_(e[Symbol.iterator])),a.asyncIterable=(e=>!a.nullOrUndefined(e)&&a.function_(e[Symbol.asyncIterator])),a.generator=(e=>a.iterable(e)&&a.function_(e.next)&&a.function_(e.throw)),a.asyncGenerator=(e=>a.asyncIterable(e)&&a.function_(e.next)&&a.function_(e.throw)),a.nativePromise=(e=>o("Promise")(e)),a.promise=(e=>a.nativePromise(e)||(e=>a.object(e)&&a.function_(e.then)&&a.function_(e.catch))(e)),a.generatorFunction=o("GeneratorFunction"),a.asyncGeneratorFunction=(e=>"AsyncGeneratorFunction"===s(e)),a.asyncFunction=(e=>"AsyncFunction"===s(e)),a.boundFunction=(e=>a.function_(e)&&!e.hasOwnProperty("prototype")),a.regExp=o("RegExp"),a.date=o("Date"),a.error=o("Error"),a.map=(e=>o("Map")(e)),a.set=(e=>o("Set")(e)),a.weakMap=(e=>o("WeakMap")(e)),a.weakSet=(e=>o("WeakSet")(e)),a.int8Array=o("Int8Array"),a.uint8Array=o("Uint8Array"),a.uint8ClampedArray=o("Uint8ClampedArray"),a.int16Array=o("Int16Array"),a.uint16Array=o("Uint16Array"),a.int32Array=o("Int32Array"),a.uint32Array=o("Uint32Array"),a.float32Array=o("Float32Array"),a.float64Array=o("Float64Array"),a.bigInt64Array=o("BigInt64Array"),a.bigUint64Array=o("BigUint64Array"),a.arrayBuffer=o("ArrayBuffer"),a.sharedArrayBuffer=o("SharedArrayBuffer"),a.dataView=o("DataView"),a.directInstanceOf=((e,t)=>Object.getPrototypeOf(e)===t.prototype),a.urlInstance=(e=>o("URL")(e)),a.urlString=(e=>{if(!a.string(e))return!1;try{return new URL(e),!0}catch(e){return!1}}),a.truthy=(e=>Boolean(e)),a.falsy=(e=>!e),a.nan=(e=>Number.isNaN(e));const l=new Set(["undefined","string","number","bigint","boolean","symbol"]);a.primitive=(e=>a.null_(e)||l.has(typeof e)),a.integer=(e=>Number.isInteger(e)),a.safeInteger=(e=>Number.isSafeInteger(e)),a.plainObject=(e=>{if("Object"!==s(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.getPrototypeOf({})});const c=new Set(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]);a.typedArray=(e=>{const t=s(e);return void 0!==t&&c.has(t)}),a.arrayLike=(e=>!a.nullOrUndefined(e)&&!a.function_(e)&&(e=>a.safeInteger(e)&&e>=0)(e.length)),a.inRange=((e,t)=>{if(a.number(t))return e>=Math.min(0,t)&&e<=Math.max(t,0);if(a.array(t)&&2===t.length)return e>=Math.min(...t)&&e<=Math.max(...t);throw new TypeError(`Invalid range: ${JSON.stringify(t)}`)});const h=["innerHTML","ownerDocument","style","attributes","nodeValue"];a.domElement=(e=>a.object(e)&&1===e.nodeType&&a.string(e.nodeName)&&!a.plainObject(e)&&h.every(t=>t in e)),a.observable=(e=>!!(e&&(e[Symbol.observable]&&e===e[Symbol.observable]()||e["@@observable"]&&e===e["@@observable"]()))),a.nodeStream=(e=>a.object(e)&&a.function_(e.pipe)&&!a.observable(e)),a.infinite=(e=>e===1/0||e===-1/0);const p=e=>t=>a.integer(t)&&Math.abs(t%2)===e;a.evenInteger=p(0),a.oddInteger=p(1),a.emptyArray=(e=>a.array(e)&&0===e.length),a.nonEmptyArray=(e=>a.array(e)&&e.length>0),a.emptyString=(e=>a.string(e)&&0===e.length),a.nonEmptyString=(e=>a.string(e)&&e.length>0),a.emptyStringOrWhitespace=(e=>a.emptyString(e)||(e=>a.string(e)&&!1===/\S/.test(e))(e)),a.emptyObject=(e=>a.object(e)&&!a.map(e)&&!a.set(e)&&0===Object.keys(e).length),a.nonEmptyObject=(e=>a.object(e)&&!a.map(e)&&!a.set(e)&&Object.keys(e).length>0),a.emptySet=(e=>a.set(e)&&0===e.size),a.nonEmptySet=(e=>a.set(e)&&e.size>0),a.emptyMap=(e=>a.map(e)&&0===e.size),a.nonEmptyMap=(e=>a.map(e)&&e.size>0);const f=(e,t,r)=>{if(!1===a.function_(t))throw new TypeError(`Invalid predicate: ${JSON.stringify(t)}`);if(0===r.length)throw new TypeError("Invalid number of values");return e.call(r,t)};a.any=((e,...t)=>(a.array(e)?e:[e]).some(e=>f(Array.prototype.some,e,t))),a.all=((e,...t)=>f(Array.prototype.every,e,t));const d=(e,t,r)=>{if(!e)throw new TypeError(`Expected value which is \`${t}\`, received value of type \`${a(r)}\`.`)};t.assert={undefined:e=>d(a.undefined(e),"undefined",e),string:e=>d(a.string(e),"string",e),number:e=>d(a.number(e),"number",e),bigint:e=>d(a.bigint(e),"bigint",e),function_:e=>d(a.function_(e),"Function",e),null_:e=>d(a.null_(e),"null",e),class_:e=>d(a.class_(e),"Class",e),boolean:e=>d(a.boolean(e),"boolean",e),symbol:e=>d(a.symbol(e),"symbol",e),numericString:e=>d(a.numericString(e),"string with a number",e),array:e=>d(a.array(e),"Array",e),buffer:e=>d(a.buffer(e),"Buffer",e),nullOrUndefined:e=>d(a.nullOrUndefined(e),"null or undefined",e),object:e=>d(a.object(e),"Object",e),iterable:e=>d(a.iterable(e),"Iterable",e),asyncIterable:e=>d(a.asyncIterable(e),"AsyncIterable",e),generator:e=>d(a.generator(e),"Generator",e),asyncGenerator:e=>d(a.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>d(a.nativePromise(e),"native Promise",e),promise:e=>d(a.promise(e),"Promise",e),generatorFunction:e=>d(a.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>d(a.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>d(a.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>d(a.boundFunction(e),"Function",e),regExp:e=>d(a.regExp(e),"RegExp",e),date:e=>d(a.date(e),"Date",e),error:e=>d(a.error(e),"Error",e),map:e=>d(a.map(e),"Map",e),set:e=>d(a.set(e),"Set",e),weakMap:e=>d(a.weakMap(e),"WeakMap",e),weakSet:e=>d(a.weakSet(e),"WeakSet",e),int8Array:e=>d(a.int8Array(e),"Int8Array",e),uint8Array:e=>d(a.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>d(a.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>d(a.int16Array(e),"Int16Array",e),uint16Array:e=>d(a.uint16Array(e),"Uint16Array",e),int32Array:e=>d(a.int32Array(e),"Int32Array",e),uint32Array:e=>d(a.uint32Array(e),"Uint32Array",e),float32Array:e=>d(a.float32Array(e),"Float32Array",e),float64Array:e=>d(a.float64Array(e),"Float64Array",e),bigInt64Array:e=>d(a.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>d(a.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>d(a.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>d(a.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>d(a.dataView(e),"DataView",e),urlInstance:e=>d(a.urlInstance(e),"URL",e),urlString:e=>d(a.urlString(e),"string with a URL",e),truthy:e=>d(a.truthy(e),"truthy",e),falsy:e=>d(a.falsy(e),"falsy",e),nan:e=>d(a.nan(e),"NaN",e),primitive:e=>d(a.primitive(e),"primitive",e),integer:e=>d(a.integer(e),"integer",e),safeInteger:e=>d(a.safeInteger(e),"integer",e),plainObject:e=>d(a.plainObject(e),"plain object",e),typedArray:e=>d(a.typedArray(e),"TypedArray",e),arrayLike:e=>d(a.arrayLike(e),"array-like",e),domElement:e=>d(a.domElement(e),"Element",e),observable:e=>d(a.observable(e),"Observable",e),nodeStream:e=>d(a.nodeStream(e),"Node.js Stream",e),infinite:e=>d(a.infinite(e),"infinite number",e),emptyArray:e=>d(a.emptyArray(e),"empty array",e),nonEmptyArray:e=>d(a.nonEmptyArray(e),"non-empty array",e),emptyString:e=>d(a.emptyString(e),"empty string",e),nonEmptyString:e=>d(a.nonEmptyString(e),"non-empty string",e),emptyStringOrWhitespace:e=>d(a.emptyStringOrWhitespace(e),"empty string or whitespace",e),emptyObject:e=>d(a.emptyObject(e),"empty object",e),nonEmptyObject:e=>d(a.nonEmptyObject(e),"non-empty object",e),emptySet:e=>d(a.emptySet(e),"empty set",e),nonEmptySet:e=>d(a.nonEmptySet(e),"non-empty set",e),emptyMap:e=>d(a.emptyMap(e),"empty map",e),nonEmptyMap:e=>d(a.nonEmptyMap(e),"non-empty map",e),evenInteger:e=>d(a.evenInteger(e),"even integer",e),oddInteger:e=>d(a.oddInteger(e),"odd integer",e),directInstanceOf:(e,t)=>d(a.directInstanceOf(e,t),"T",e),inRange:(e,t)=>d(a.inRange(e,t),"in range",e),any:(e,...t)=>d(a.any(e,...t),"predicate returns truthy for any value",t),all:(e,...t)=>d(a.all(e,...t),"predicate returns truthy for all values",t)},Object.defineProperties(a,{class:{value:a.class_},function:{value:a.function_},null:{value:a.null_}}),Object.defineProperties(t.assert,{class:{value:t.assert.class_},function:{value:t.assert.function_},null:{value:t.assert.null_}}),t.default=a,e.exports=a,e.exports.default=a,e.exports.assert=t.assert},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.testSymbol=Symbol("test"),t.isPredicate=(e=>Boolean(e[t.testSymbol]))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=((e,t,r=5)=>{const n=[];for(const i of t)if(!e.has(i)&&(n.push(i),n.length===r))return n;return 0===n.length||n})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(10),i=r(11),s=r(0);t.Predicate=s.Predicate;const o=r(2),a=r(17),u=r(7),l=r(9),c=(e,t,r)=>{if(!o.isPredicate(t)&&"string"!=typeof t)throw new TypeError(`Expected second argument to be a predicate or a string, got \`${typeof t}\``);if(o.isPredicate(t)){const r=n.default();l.default(e,()=>i.inferLabel(r),t)}else l.default(e,t,r)};Object.defineProperties(c,{isValid:{value:(e,t)=>{try{return c(e,t),!0}catch(e){return!1}}},create:{value:(e,t)=>(r,s)=>{if(o.isPredicate(e)){const t=n.default();l.default(r,null!=s?s:()=>i.inferLabel(t),e)}else l.default(r,null!=s?s:e,t)}}}),t.default=u.default(a.default(c));var h=r(7);t.StringPredicate=h.StringPredicate,t.NumberPredicate=h.NumberPredicate,t.BooleanPredicate=h.BooleanPredicate,t.ArrayPredicate=h.ArrayPredicate,t.ObjectPredicate=h.ObjectPredicate,t.DatePredicate=h.DatePredicate,t.ErrorPredicate=h.ErrorPredicate,t.MapPredicate=h.MapPredicate,t.WeakMapPredicate=h.WeakMapPredicate,t.SetPredicate=h.SetPredicate,t.WeakSetPredicate=h.WeakSetPredicate,t.TypedArrayPredicate=h.TypedArrayPredicate,t.ArrayBufferPredicate=h.ArrayBufferPredicate,t.DataViewPredicate=h.DataViewPredicate,t.AnyPredicate=h.AnyPredicate;var p=r(6);t.ArgumentError=p.ArgumentError},function(e,t,r){(function(e){var r="[object Arguments]",i="[object Map]",s="[object Object]",o="[object Set]",a=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[r]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l["[object Function]"]=l[i]=l["[object Number]"]=l[s]=l["[object RegExp]"]=l[o]=l["[object String]"]=l["[object WeakMap]"]=!1;var c="object"==typeof n&&n&&n.Object===Object&&n,h="object"==typeof self&&self&&self.Object===Object&&self,p=c||h||Function("return this")(),f=t&&!t.nodeType&&t,d=f&&"object"==typeof e&&e&&!e.nodeType&&e,m=d&&d.exports===f,g=m&&c.process,v=function(){try{return g&&g.binding&&g.binding("util")}catch(e){}}(),y=v&&v.isTypedArray;function _(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function b(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function x(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var w,E,T,A=Array.prototype,S=Function.prototype,k=Object.prototype,C=p["__core-js_shared__"],I=S.toString,R=k.hasOwnProperty,L=(w=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+w:"",O=k.toString,M=RegExp("^"+I.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=m?p.Buffer:void 0,B=p.Symbol,N=p.Uint8Array,D=k.propertyIsEnumerable,F=A.splice,j=B?B.toStringTag:void 0,U=Object.getOwnPropertySymbols,$=P?P.isBuffer:void 0,V=(E=Object.keys,T=Object,function(e){return E(T(e))}),G=de(p,"DataView"),z=de(p,"Map"),W=de(p,"Promise"),H=de(p,"Set"),K=de(p,"WeakMap"),q=de(Object,"create"),X=ye(G),Y=ye(z),Z=ye(W),J=ye(H),Q=ye(K),ee=B?B.prototype:void 0,te=ee?ee.valueOf:void 0;function re(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function se(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new ie;++t<r;)this.add(e[t])}function oe(e){var t=this.__data__=new ne(e);this.size=t.size}function ae(e,t){for(var r=e.length;r--;)if(_e(e[r][0],t))return r;return-1}function ue(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?function(e){var t=R.call(e,j),r=e[j];try{e[j]=void 0;var n=!0}catch(e){}var i=O.call(e);return n&&(t?e[j]=r:delete e[j]),i}(e):function(e){return O.call(e)}(e)}function le(e){return Se(e)&&ue(e)==r}function ce(e,t,n,a,u){return e===t||(null==e||null==t||!Se(e)&&!Se(t)?e!=e&&t!=t:function(e,t,n,a,u,l){var c=xe(e),h=xe(t),p=c?"[object Array]":ge(e),f=h?"[object Array]":ge(t),d=(p=p==r?s:p)==s,m=(f=f==r?s:f)==s,g=p==f;if(g&&we(e)){if(!we(t))return!1;c=!0,d=!1}if(g&&!d)return l||(l=new oe),c||ke(e)?he(e,t,n,a,u,l):function(e,t,r,n,s,a,u){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new N(e),new N(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return _e(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case i:var l=b;case o:var c=1&n;if(l||(l=x),e.size!=t.size&&!c)return!1;var h=u.get(e);if(h)return h==t;n|=2,u.set(e,t);var p=he(l(e),l(t),n,s,a,u);return u.delete(e),p;case"[object Symbol]":if(te)return te.call(e)==te.call(t)}return!1}(e,t,p,n,a,u,l);if(!(1&n)){var v=d&&R.call(e,"__wrapped__"),y=m&&R.call(t,"__wrapped__");if(v||y){var _=v?e.value():e,w=y?t.value():t;return l||(l=new oe),u(_,w,n,a,l)}}return!!g&&(l||(l=new oe),function(e,t,r,n,i,s){var o=1&r,a=pe(e),u=a.length;if(u!=pe(t).length&&!o)return!1;for(var l=u;l--;){var c=a[l];if(!(o?c in t:R.call(t,c)))return!1}var h=s.get(e);if(h&&s.get(t))return h==t;var p=!0;s.set(e,t),s.set(t,e);for(var f=o;++l<u;){var d=e[c=a[l]],m=t[c];if(n)var g=o?n(m,d,c,t,e,s):n(d,m,c,e,t,s);if(!(void 0===g?d===m||i(d,m,r,n,s):g)){p=!1;break}f||(f="constructor"==c)}if(p&&!f){var v=e.constructor,y=t.constructor;v!=y&&"constructor"in e&&"constructor"in t&&!("function"==typeof v&&v instanceof v&&"function"==typeof y&&y instanceof y)&&(p=!1)}return s.delete(e),s.delete(t),p}(e,t,n,a,u,l))}(e,t,n,a,ce,u))}function he(e,t,r,n,i,s){var o=1&r,a=e.length,u=t.length;if(a!=u&&!(o&&u>a))return!1;var l=s.get(e);if(l&&s.get(t))return l==t;var c=-1,h=!0,p=2&r?new se:void 0;for(s.set(e,t),s.set(t,e);++c<a;){var f=e[c],d=t[c];if(n)var m=o?n(d,f,c,t,e,s):n(f,d,c,e,t,s);if(void 0!==m){if(m)continue;h=!1;break}if(p){if(!_(t,function(e,t){if(o=t,!p.has(o)&&(f===e||i(f,e,r,n,s)))return p.push(t);var o})){h=!1;break}}else if(f!==d&&!i(f,d,r,n,s)){h=!1;break}}return s.delete(e),s.delete(t),h}function pe(e){return function(e,t,r){var n=Ce(e);return xe(e)?n:function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}(n,r(e))}(e,0,me)}function fe(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function de(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ae(e)||function(e){return!!L&&L in e}(e))&&(Ee(e)?M:a).test(ye(e))}(r)?r:void 0}re.prototype.clear=function(){this.__data__=q?q(null):{},this.size=0},re.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},re.prototype.get=function(e){var t=this.__data__;if(q){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return R.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return q?void 0!==t[e]:R.call(t,e)},re.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=q&&void 0===t?"__lodash_hash_undefined__":t,this},ne.prototype.clear=function(){this.__data__=[],this.size=0},ne.prototype.delete=function(e){var t=this.__data__,r=ae(t,e);return!(r<0||(r==t.length-1?t.pop():F.call(t,r,1),--this.size,0))},ne.prototype.get=function(e){var t=this.__data__,r=ae(t,e);return r<0?void 0:t[r][1]},ne.prototype.has=function(e){return ae(this.__data__,e)>-1},ne.prototype.set=function(e,t){var r=this.__data__,n=ae(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ie.prototype.clear=function(){this.size=0,this.__data__={hash:new re,map:new(z||ne),string:new re}},ie.prototype.delete=function(e){var t=fe(this,e).delete(e);return this.size-=t?1:0,t},ie.prototype.get=function(e){return fe(this,e).get(e)},ie.prototype.has=function(e){return fe(this,e).has(e)},ie.prototype.set=function(e,t){var r=fe(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},se.prototype.add=se.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},se.prototype.has=function(e){return this.__data__.has(e)},oe.prototype.clear=function(){this.__data__=new ne,this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},oe.prototype.get=function(e){return this.__data__.get(e)},oe.prototype.has=function(e){return this.__data__.has(e)},oe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ne){var n=r.__data__;if(!z||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ie(n)}return r.set(e,t),this.size=r.size,this};var me=U?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o)&&(s[i++]=o)}return s}(U(e),function(t){return D.call(e,t)}))}:function(){return[]},ge=ue;function ve(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||u.test(e))&&e>-1&&e%1==0&&e<t}function ye(e){if(null!=e){try{return I.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function _e(e,t){return e===t||e!=e&&t!=t}(G&&"[object DataView]"!=ge(new G(new ArrayBuffer(1)))||z&&ge(new z)!=i||W&&"[object Promise]"!=ge(W.resolve())||H&&ge(new H)!=o||K&&"[object WeakMap]"!=ge(new K))&&(ge=function(e){var t=ue(e),r=t==s?e.constructor:void 0,n=r?ye(r):"";if(n)switch(n){case X:return"[object DataView]";case Y:return i;case Z:return"[object Promise]";case J:return o;case Q:return"[object WeakMap]"}return t});var be=le(function(){return arguments}())?le:function(e){return Se(e)&&R.call(e,"callee")&&!D.call(e,"callee")},xe=Array.isArray,we=$||function(){return!1};function Ee(e){if(!Ae(e))return!1;var t=ue(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Te(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ae(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Se(e){return null!=e&&"object"==typeof e}var ke=y?function(e){return function(t){return e(t)}}(y):function(e){return Se(e)&&Te(e.length)&&!!l[ue(e)]};function Ce(e){return null!=(t=e)&&Te(t.length)&&!Ee(t)?function(e,t){var r=xe(e),n=!r&&be(e),i=!r&&!n&&we(e),s=!r&&!n&&!i&&ke(e),o=r||n||i||s,a=o?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],u=a.length;for(var l in e)!t&&!R.call(e,l)||o&&("length"==l||i&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ve(l,u))||a.push(l);return a}(e):function(e){if(r=(t=e)&&t.constructor,t!==("function"==typeof r&&r.prototype||k))return V(e);var t,r,n=[];for(var i in Object(e))R.call(e,i)&&"constructor"!=i&&n.push(i);return n}(e);var t}e.exports=function(e,t){return ce(e,t)}}).call(this,r(23)(e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ArgumentError=class extends Error{constructor(e,t){super(e),Error.captureStackTrace?Error.captureStackTrace(this,t):this.stack=(new Error).stack,this.name="ArgumentError"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(18);t.StringPredicate=n.StringPredicate;const i=r(20);t.NumberPredicate=i.NumberPredicate;const s=r(21);t.BooleanPredicate=s.BooleanPredicate;const o=r(0),a=r(22);t.ArrayPredicate=a.ArrayPredicate;const u=r(24);t.ObjectPredicate=u.ObjectPredicate;const l=r(29);t.DatePredicate=l.DatePredicate;const c=r(30);t.ErrorPredicate=c.ErrorPredicate;const h=r(31);t.MapPredicate=h.MapPredicate;const p=r(32);t.WeakMapPredicate=p.WeakMapPredicate;const f=r(33);t.SetPredicate=f.SetPredicate;const d=r(34);t.WeakSetPredicate=d.WeakSetPredicate;const m=r(35);t.TypedArrayPredicate=m.TypedArrayPredicate;const g=r(36);t.ArrayBufferPredicate=g.ArrayBufferPredicate;const v=r(37);t.DataViewPredicate=v.DataViewPredicate;const y=r(38);t.AnyPredicate=y.AnyPredicate,t.default=((e,t)=>(Object.defineProperties(e,{string:{get:()=>new n.StringPredicate(t)},number:{get:()=>new i.NumberPredicate(t)},boolean:{get:()=>new s.BooleanPredicate(t)},undefined:{get:()=>new o.Predicate("undefined",t)},null:{get:()=>new o.Predicate("null",t)},nullOrUndefined:{get:()=>new o.Predicate("nullOrUndefined",t)},nan:{get:()=>new o.Predicate("nan",t)},symbol:{get:()=>new o.Predicate("symbol",t)},array:{get:()=>new a.ArrayPredicate(t)},object:{get:()=>new u.ObjectPredicate(t)},date:{get:()=>new l.DatePredicate(t)},error:{get:()=>new c.ErrorPredicate(t)},map:{get:()=>new h.MapPredicate(t)},weakMap:{get:()=>new p.WeakMapPredicate(t)},set:{get:()=>new f.SetPredicate(t)},weakSet:{get:()=>new d.WeakSetPredicate(t)},function:{get:()=>new o.Predicate("Function",t)},buffer:{get:()=>new o.Predicate("Buffer",t)},regExp:{get:()=>new o.Predicate("RegExp",t)},promise:{get:()=>new o.Predicate("Promise",t)},typedArray:{get:()=>new m.TypedArrayPredicate("TypedArray",t)},int8Array:{get:()=>new m.TypedArrayPredicate("Int8Array",t)},uint8Array:{get:()=>new m.TypedArrayPredicate("Uint8Array",t)},uint8ClampedArray:{get:()=>new m.TypedArrayPredicate("Uint8ClampedArray",t)},int16Array:{get:()=>new m.TypedArrayPredicate("Int16Array",t)},uint16Array:{get:()=>new m.TypedArrayPredicate("Uint16Array",t)},int32Array:{get:()=>new m.TypedArrayPredicate("Int32Array",t)},uint32Array:{get:()=>new m.TypedArrayPredicate("Uint32Array",t)},float32Array:{get:()=>new m.TypedArrayPredicate("Float32Array",t)},float64Array:{get:()=>new m.TypedArrayPredicate("Float64Array",t)},arrayBuffer:{get:()=>new g.ArrayBufferPredicate("ArrayBuffer",t)},sharedArrayBuffer:{get:()=>new g.ArrayBufferPredicate("SharedArrayBuffer",t)},dataView:{get:()=>new v.DataViewPredicate(t)},iterable:{get:()=>new o.Predicate("Iterable",t)},any:{value:(...e)=>new y.AnyPredicate(e,t)}}),e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4);t.default=((e,t)=>{try{for(const r of e)n.default(r,t);return!0}catch(e){return e.message}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2);t.default=function e(t,r,i){i[n.testSymbol](t,e,r)}},function(e,t,r){"use strict";const n=()=>{const e=Error.prepareStackTrace;Error.prepareStackTrace=((e,t)=>t);const t=(new Error).stack.slice(1);return Error.prepareStackTrace=e,t};e.exports=n,e.exports.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(12),i=r(13),s=r(14),o=/^.*?\((?<label>.*?)[,)]/;t.inferLabel=(e=>{var t;if(!s.default)return;const r=e[1],a=r.getFileName(),u=r.getLineNumber(),l=r.getColumnNumber();if(null===a||null===u||null===l)return;let c=[];try{c=n.readFileSync(a,"utf8").split("\n")}catch(e){return}let h=c[u-1];if(!h)return;h=h.slice(l-1);const p=o.exec(h);if(!(null===(t=null==p?void 0:p.groups)||void 0===t?void 0:t.label))return;const f=p.groups.label;return i.default(f)||i.default(f.split(".").pop())?f:void 0})},function(t,r){t.exports=e("fs")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=/^[a-z$_][a-z$_\d]*$/i,i=new Set(["undefined","null","true","false","super","this","Infinity","NaN"]);t.default=(e=>e&&!i.has(e)&&n.test(e))},function(e,t,n){"use strict";var i;Object.defineProperty(t,"__esModule",{value:!0}),t.default=Boolean(null===(i=null===r||void 0===r?void 0:r.versions)||void 0===i?void 0:i.node)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(16),i=r(0);t.not=(e=>{const t=e.addValidator;return e.addValidator=(r=>{const{validator:s,message:o,negatedMessage:a}=r,u=n.default();return r.message=((e,t)=>a?a(e,t):o(e,u).replace(/ to /,"$¬ ").replace(u,t)),r.validator=(e=>!s(e)),e[i.validatorSymbol].push(r),e.addValidator=t,e}),e})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(()=>Math.random().toString(16).slice(2))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(7);t.default=(e=>(Object.defineProperties(e,{optional:{get:()=>n.default({},{optional:!0})}}),e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(19),s=r(0);t.StringPredicate=class extends s.Predicate{constructor(e){super("string",e)}length(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have length \`${e}\`, got \`${t}\``,validator:t=>t.length===e})}minLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a minimum length of \`${e}\`, got \`${t}\``,validator:t=>t.length>=e,negatedMessage:(t,r)=>`Expected ${r} to have a maximum length of \`${e-1}\`, got \`${t}\``})}maxLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a maximum length of \`${e}\`, got \`${t}\``,validator:t=>t.length<=e,negatedMessage:(t,r)=>`Expected ${r} to have a minimum length of \`${e+1}\`, got \`${t}\``})}matches(e){return this.addValidator({message:(t,r)=>`Expected ${r} to match \`${e}\`, got \`${t}\``,validator:t=>e.test(t)})}startsWith(e){return this.addValidator({message:(t,r)=>`Expected ${r} to start with \`${e}\`, got \`${t}\``,validator:t=>t.startsWith(e)})}endsWith(e){return this.addValidator({message:(t,r)=>`Expected ${r} to end with \`${e}\`, got \`${t}\``,validator:t=>t.endsWith(e)})}includes(e){return this.addValidator({message:(t,r)=>`Expected ${r} to include \`${e}\`, got \`${t}\``,validator:t=>t.includes(e)})}oneOf(e){return this.addValidator({message:(t,r)=>{let n=JSON.stringify(e);if(e.length>10){const t=e.length-10;n=JSON.stringify(e.slice(0,10)).replace(/]$/,`,…+${t} more]`)}return`Expected ${r} to be one of \`${n}\`, got \`${t}\``},validator:t=>e.includes(t)})}get empty(){return this.addValidator({message:(e,t)=>`Expected ${t} to be empty, got \`${e}\``,validator:e=>""===e})}get nonEmpty(){return this.addValidator({message:(e,t)=>`Expected ${t} to not be empty`,validator:e=>""!==e})}equals(e){return this.addValidator({message:(t,r)=>`Expected ${r} to be equal to \`${e}\`, got \`${t}\``,validator:t=>t===e})}get alphanumeric(){return this.addValidator({message:(e,t)=>`Expected ${t} to be alphanumeric, got \`${e}\``,validator:e=>/^[a-z\d]+$/i.test(e)})}get alphabetical(){return this.addValidator({message:(e,t)=>`Expected ${t} to be alphabetical, got \`${e}\``,validator:e=>/^[a-z]+$/gi.test(e)})}get numeric(){return this.addValidator({message:(e,t)=>`Expected ${t} to be numeric, got \`${e}\``,validator:e=>/^(?:\+|-)?\d+$/i.test(e)})}get date(){return this.addValidator({message:(e,t)=>`Expected ${t} to be a date, got \`${e}\``,validator:i})}get lowercase(){return this.addValidator({message:(e,t)=>`Expected ${t} to be lowercase, got \`${e}\``,validator:e=>""!==e.trim()&&e===e.toLowerCase()})}get uppercase(){return this.addValidator({message:(e,t)=>`Expected ${t} to be uppercase, got \`${e}\``,validator:e=>""!==e.trim()&&e===e.toUpperCase()})}get url(){return this.addValidator({message:(e,t)=>`Expected ${t} to be a URL, got \`${e}\``,validator:n.default.urlString})}}},function(e,t,r){"use strict";e.exports=function(e){return!isNaN(Date.parse(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(0);t.NumberPredicate=class extends i.Predicate{constructor(e){super("number",e)}inRange(e,t){return this.addValidator({message:(r,n)=>`Expected ${n} to be in range [${e}..${t}], got ${r}`,validator:r=>n.default.inRange(r,[e,t])})}greaterThan(e){return this.addValidator({message:(t,r)=>`Expected ${r} to be greater than ${e}, got ${t}`,validator:t=>t>e})}greaterThanOrEqual(e){return this.addValidator({message:(t,r)=>`Expected ${r} to be greater than or equal to ${e}, got ${t}`,validator:t=>t>=e})}lessThan(e){return this.addValidator({message:(t,r)=>`Expected ${r} to be less than ${e}, got ${t}`,validator:t=>t<e})}lessThanOrEqual(e){return this.addValidator({message:(t,r)=>`Expected ${r} to be less than or equal to ${e}, got ${t}`,validator:t=>t<=e})}equal(e){return this.addValidator({message:(t,r)=>`Expected ${r} to be equal to ${e}, got ${t}`,validator:t=>t===e})}oneOf(e){return this.addValidator({message:(t,r)=>{let n=JSON.stringify(e);if(e.length>10){const t=e.length-10;n=JSON.stringify(e.slice(0,10)).replace(/]$/,`,…+${t} more]`)}return`Expected ${r} to be one of \`${n}\`, got ${t}`},validator:t=>e.includes(t)})}get integer(){return this.addValidator({message:(e,t)=>`Expected ${t} to be an integer, got ${e}`,validator:e=>n.default.integer(e)})}get finite(){return this.addValidator({message:(e,t)=>`Expected ${t} to be finite, got ${e}`,validator:e=>!n.default.infinite(e)})}get infinite(){return this.addValidator({message:(e,t)=>`Expected ${t} to be infinite, got ${e}`,validator:e=>n.default.infinite(e)})}get positive(){return this.addValidator({message:(e,t)=>`Expected ${t} to be positive, got ${e}`,validator:e=>e>0})}get negative(){return this.addValidator({message:(e,t)=>`Expected ${t} to be negative, got ${e}`,validator:e=>e<0})}get integerOrInfinite(){return this.addValidator({message:(e,t)=>`Expected ${t} to be an integer or infinite, got ${e}`,validator:e=>n.default.integer(e)||n.default.infinite(e)})}get uint8(){return this.integer.inRange(0,255)}get uint16(){return this.integer.inRange(0,65535)}get uint32(){return this.integer.inRange(0,4294967295)}get int8(){return this.integer.inRange(-128,127)}get int16(){return this.integer.inRange(-32768,32767)}get int32(){return this.integer.inRange(-2147483648,2147483647)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0);t.BooleanPredicate=class extends n.Predicate{constructor(e){super("boolean",e)}get true(){return this.addValidator({message:(e,t)=>`Expected ${t} to be true, got ${e}`,validator:e=>e})}get false(){return this.addValidator({message:(e,t)=>`Expected ${t} to be false, got ${e}`,validator:e=>!e})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),i=r(0),s=r(4);t.ArrayPredicate=class extends i.Predicate{constructor(e){super("array",e)}length(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have length \`${e}\`, got \`${t.length}\``,validator:t=>t.length===e})}minLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a minimum length of \`${e}\`, got \`${t.length}\``,validator:t=>t.length>=e,negatedMessage:(t,r)=>`Expected ${r} to have a maximum length of \`${e-1}\`, got \`${t.length}\``})}maxLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a maximum length of \`${e}\`, got \`${t.length}\``,validator:t=>t.length<=e,negatedMessage:(t,r)=>`Expected ${r} to have a minimum length of \`${e+1}\`, got \`${t.length}\``})}startsWith(e){return this.addValidator({message:(t,r)=>`Expected ${r} to start with \`${e}\`, got \`${t[0]}\``,validator:t=>t[0]===e})}endsWith(e){return this.addValidator({message:(t,r)=>`Expected ${r} to end with \`${e}\`, got \`${t[t.length-1]}\``,validator:t=>t[t.length-1]===e})}includes(...e){return this.addValidator({message:(t,r)=>`Expected ${r} to include all elements of \`${JSON.stringify(e)}\`, got \`${JSON.stringify(t)}\``,validator:t=>e.every(e=>t.includes(e))})}includesAny(...e){return this.addValidator({message:(t,r)=>`Expected ${r} to include any element of \`${JSON.stringify(e)}\`, got \`${JSON.stringify(t)}\``,validator:t=>e.some(e=>t.includes(e))})}get empty(){return this.addValidator({message:(e,t)=>`Expected ${t} to be empty, got \`${JSON.stringify(e)}\``,validator:e=>0===e.length})}get nonEmpty(){return this.addValidator({message:(e,t)=>`Expected ${t} to not be empty`,validator:e=>e.length>0})}deepEqual(e){return this.addValidator({message:(t,r)=>`Expected ${r} to be deeply equal to \`${JSON.stringify(e)}\`, got \`${JSON.stringify(t)}\``,validator:t=>n(t,e)})}ofType(e){let t;return this.addValidator({message:(e,r)=>`(${r}) ${t}`,validator:r=>{try{for(const t of r)s.default(t,e);return!0}catch(e){return t=e.message,!1}}})}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(25),s=r(5),o=r(3),a=r(8),u=r(27),l=r(28),c=r(0);t.ObjectPredicate=class extends c.Predicate{constructor(e){super("object",e)}get plain(){return this.addValidator({message:(e,t)=>`Expected ${t} to be a plain object`,validator:e=>n.default.plainObject(e)})}get empty(){return this.addValidator({message:(e,t)=>`Expected ${t} to be empty, got \`${JSON.stringify(e)}\``,validator:e=>0===Object.keys(e).length})}get nonEmpty(){return this.addValidator({message:(e,t)=>`Expected ${t} to not be empty`,validator:e=>Object.keys(e).length>0})}valuesOfType(e){return this.addValidator({message:(e,t,r)=>`(${t}) ${r}`,validator:t=>a.default(Object.values(t),e)})}deepValuesOfType(e){return this.addValidator({message:(e,t,r)=>`(${t}) ${r}`,validator:t=>u.default(t,e)})}deepEqual(e){return this.addValidator({message:(t,r)=>`Expected ${r} to be deeply equal to \`${JSON.stringify(e)}\`, got \`${JSON.stringify(t)}\``,validator:t=>s(t,e)})}instanceOf(e){return this.addValidator({message:(t,r)=>{let{name:n}=t.constructor;return n&&"Object"!==n||(n=JSON.stringify(t)),`Expected ${r} \`${n}\` to be of type \`${e.name}\``},validator:t=>t instanceof e})}hasKeys(...e){return this.addValidator({message:(e,t,r)=>`Expected ${t} to have keys \`${JSON.stringify(r)}\``,validator:t=>o.default({has:e=>i.has(t,e)},e)})}hasAnyKeys(...e){return this.addValidator({message:(t,r)=>`Expected ${r} to have any key of \`${JSON.stringify(e)}\``,validator:t=>e.some(e=>i.has(t,e))})}partialShape(e){return this.addValidator({message:(e,t,r)=>`${r.replace("Expected","Expected property")} in ${t}`,validator:t=>l.partial(t,e)})}exactShape(e){return this.addValidator({message:(e,t,r)=>`${r.replace("Expected","Expected property")} in ${t}`,validator:t=>l.exact(t,e)})}}},function(e,t,r){"use strict";const n=r(26),i=["__proto__","prototype","constructor"];function s(e){const t=e.split("."),r=[];for(let e=0;e<t.length;e++){let n=t[e];for(;"\\"===n[n.length-1]&&void 0!==t[e+1];)n=n.slice(0,-1)+".",n+=t[++e];r.push(n)}return r.some(e=>i.includes(e))?[]:r}e.exports={get(e,t,r){if(!n(e)||"string"!=typeof t)return void 0===r?e:r;const i=s(t);if(0!==i.length){for(let t=0;t<i.length;t++){if(!Object.prototype.propertyIsEnumerable.call(e,i[t]))return r;if(null==(e=e[i[t]])){if(t!==i.length-1)return r;break}}return e}},set(e,t,r){if(!n(e)||"string"!=typeof t)return e;const i=e,o=s(t);for(let t=0;t<o.length;t++){const i=o[t];n(e[i])||(e[i]={}),t===o.length-1&&(e[i]=r),e=e[i]}return i},delete(e,t){if(!n(e)||"string"!=typeof t)return;const r=s(t);for(let t=0;t<r.length;t++){const i=r[t];if(t===r.length-1)return void delete e[i];if(e=e[i],!n(e))return}},has(e,t){if(!n(e)||"string"!=typeof t)return!1;const r=s(t);if(0===r.length)return!1;for(let t=0;t<r.length;t++){if(!n(e))return!1;if(!(r[t]in e))return!1;e=e[r[t]]}return!0}}},function(e,t,r){"use strict";e.exports=(e=>{const t=typeof e;return null!==e&&("object"===t||"function"===t)})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(4),s=(e,t)=>n.default.plainObject(e)?Object.values(e).every(e=>s(e,t)):(i.default(e,t),!0);t.default=((e,t)=>{try{return s(e,t)}catch(e){return e.message}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(9),s=r(2);t.partial=function e(t,r,o){try{for(const a of Object.keys(r)){const u=o?`${o}.${a}`:a;if(s.isPredicate(r[a]))i.default(t[a],u,r[a]);else if(n.default.plainObject(r[a])){const n=e(t[a],r[a],u);if(!0!==n)return n}}return!0}catch(e){return e.message}},t.exact=function e(t,r,o){try{const a=new Set(Object.keys(t));for(const u of Object.keys(r)){a.delete(u);const l=o?`${o}.${u}`:u;if(s.isPredicate(r[u]))i.default(t[u],l,r[u]);else if(n.default.plainObject(r[u])){if(!Object.prototype.hasOwnProperty.call(t,u))return`Expected \`${l}\` to exist`;const n=e(t[u],r[u],l);if(!0!==n)return n}}if(a.size>0){const e=[...a.keys()][0];return`Did not expect property \`${o?`${o}.${e}`:e}\` to exist, got \`${t[e]}\``}return!0}catch(e){return e.message}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0);t.DatePredicate=class extends n.Predicate{constructor(e){super("date",e)}before(e){return this.addValidator({message:(t,r)=>`Expected ${r} ${t.toISOString()} to be before ${e.toISOString()}`,validator:t=>t.getTime()<e.getTime()})}after(e){return this.addValidator({message:(t,r)=>`Expected ${r} ${t.toISOString()} to be after ${e.toISOString()}`,validator:t=>t.getTime()>e.getTime()})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0);t.ErrorPredicate=class extends n.Predicate{constructor(e){super("error",e)}name(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have name \`${e}\`, got \`${t.name}\``,validator:t=>t.name===e})}message(e){return this.addValidator({message:(t,r)=>`Expected ${r} message to be \`${e}\`, got \`${t.message}\``,validator:t=>t.message===e})}messageIncludes(e){return this.addValidator({message:(t,r)=>`Expected ${r} message to include \`${e}\`, got \`${t.message}\``,validator:t=>t.message.includes(e)})}hasKeys(...e){return this.addValidator({message:(t,r)=>`Expected ${r} message to have keys \`${e.join("`, `")}\``,validator:t=>e.every(e=>Object.prototype.hasOwnProperty.call(t,e))})}instanceOf(e){return this.addValidator({message:(t,r)=>`Expected ${r} \`${t.name}\` to be of type \`${e.name}\``,validator:t=>t instanceof e})}get typeError(){return this.instanceOf(TypeError)}get evalError(){return this.instanceOf(EvalError)}get rangeError(){return this.instanceOf(RangeError)}get referenceError(){return this.instanceOf(ReferenceError)}get syntaxError(){return this.instanceOf(SyntaxError)}get uriError(){return this.instanceOf(URIError)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),i=r(3),s=r(8),o=r(0);t.MapPredicate=class extends o.Predicate{constructor(e){super("Map",e)}size(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have size \`${e}\`, got \`${t.size}\``,validator:t=>t.size===e})}minSize(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a minimum size of \`${e}\`, got \`${t.size}\``,validator:t=>t.size>=e,negatedMessage:(t,r)=>`Expected ${r} to have a maximum size of \`${e-1}\`, got \`${t.size}\``})}maxSize(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a maximum size of \`${e}\`, got \`${t.size}\``,validator:t=>t.size<=e,negatedMessage:(t,r)=>`Expected ${r} to have a minimum size of \`${e+1}\`, got \`${t.size}\``})}hasKeys(...e){return this.addValidator({message:(e,t,r)=>`Expected ${t} to have keys \`${JSON.stringify(r)}\``,validator:t=>i.default(t,e)})}hasAnyKeys(...e){return this.addValidator({message:(t,r)=>`Expected ${r} to have any key of \`${JSON.stringify(e)}\``,validator:t=>e.some(e=>t.has(e))})}hasValues(...e){return this.addValidator({message:(e,t,r)=>`Expected ${t} to have values \`${JSON.stringify(r)}\``,validator:t=>i.default(new Set(t.values()),e)})}hasAnyValues(...e){return this.addValidator({message:(t,r)=>`Expected ${r} to have any value of \`${JSON.stringify(e)}\``,validator:t=>{const r=new Set(t.values());return e.some(e=>r.has(e))}})}keysOfType(e){return this.addValidator({message:(e,t,r)=>`(${t}) ${r}`,validator:t=>s.default(t.keys(),e)})}valuesOfType(e){return this.addValidator({message:(e,t,r)=>`(${t}) ${r}`,validator:t=>s.default(t.values(),e)})}get empty(){return this.addValidator({message:(e,t)=>`Expected ${t} to be empty, got \`${JSON.stringify([...e])}\``,validator:e=>0===e.size})}get nonEmpty(){return this.addValidator({message:(e,t)=>`Expected ${t} to not be empty`,validator:e=>e.size>0})}deepEqual(e){return this.addValidator({message:(t,r)=>`Expected ${r} to be deeply equal to \`${JSON.stringify([...e])}\`, got \`${JSON.stringify([...t])}\``,validator:t=>n(t,e)})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3),i=r(0);t.WeakMapPredicate=class extends i.Predicate{constructor(e){super("WeakMap",e)}hasKeys(...e){return this.addValidator({message:(e,t,r)=>`Expected ${t} to have keys \`${JSON.stringify(r)}\``,validator:t=>n.default(t,e)})}hasAnyKeys(...e){return this.addValidator({message:(t,r)=>`Expected ${r} to have any key of \`${JSON.stringify(e)}\``,validator:t=>e.some(e=>t.has(e))})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),i=r(3),s=r(8),o=r(0);t.SetPredicate=class extends o.Predicate{constructor(e){super("Set",e)}size(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have size \`${e}\`, got \`${t.size}\``,validator:t=>t.size===e})}minSize(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a minimum size of \`${e}\`, got \`${t.size}\``,validator:t=>t.size>=e,negatedMessage:(t,r)=>`Expected ${r} to have a maximum size of \`${e-1}\`, got \`${t.size}\``})}maxSize(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a maximum size of \`${e}\`, got \`${t.size}\``,validator:t=>t.size<=e,negatedMessage:(t,r)=>`Expected ${r} to have a minimum size of \`${e+1}\`, got \`${t.size}\``})}has(...e){return this.addValidator({message:(e,t,r)=>`Expected ${t} to have items \`${JSON.stringify(r)}\``,validator:t=>i.default(t,e)})}hasAny(...e){return this.addValidator({message:(t,r)=>`Expected ${r} to have any item of \`${JSON.stringify(e)}\``,validator:t=>e.some(e=>t.has(e))})}ofType(e){return this.addValidator({message:(e,t,r)=>`(${t}) ${r}`,validator:t=>s.default(t,e)})}get empty(){return this.addValidator({message:(e,t)=>`Expected ${t} to be empty, got \`${JSON.stringify([...e])}\``,validator:e=>0===e.size})}get nonEmpty(){return this.addValidator({message:(e,t)=>`Expected ${t} to not be empty`,validator:e=>e.size>0})}deepEqual(e){return this.addValidator({message:(t,r)=>`Expected ${r} to be deeply equal to \`${JSON.stringify([...e])}\`, got \`${JSON.stringify([...t])}\``,validator:t=>n(t,e)})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3),i=r(0);t.WeakSetPredicate=class extends i.Predicate{constructor(e){super("WeakSet",e)}has(...e){return this.addValidator({message:(e,t,r)=>`Expected ${t} to have items \`${JSON.stringify(r)}\``,validator:t=>n.default(t,e)})}hasAny(...e){return this.addValidator({message:(t,r)=>`Expected ${r} to have any item of \`${JSON.stringify(e)}\``,validator:t=>e.some(e=>t.has(e))})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0);t.TypedArrayPredicate=class extends n.Predicate{byteLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have byte length of \`${e}\`, got \`${t.byteLength}\``,validator:t=>t.byteLength===e})}minByteLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a minimum byte length of \`${e}\`, got \`${t.byteLength}\``,validator:t=>t.byteLength>=e,negatedMessage:(t,r)=>`Expected ${r} to have a maximum byte length of \`${e-1}\`, got \`${t.byteLength}\``})}maxByteLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a maximum byte length of \`${e}\`, got \`${t.byteLength}\``,validator:t=>t.byteLength<=e,negatedMessage:(t,r)=>`Expected ${r} to have a minimum byte length of \`${e+1}\`, got \`${t.byteLength}\``})}length(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have length \`${e}\`, got \`${t.length}\``,validator:t=>t.length===e})}minLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a minimum length of \`${e}\`, got \`${t.length}\``,validator:t=>t.length>=e,negatedMessage:(t,r)=>`Expected ${r} to have a maximum length of \`${e-1}\`, got \`${t.length}\``})}maxLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a maximum length of \`${e}\`, got \`${t.length}\``,validator:t=>t.length<=e,negatedMessage:(t,r)=>`Expected ${r} to have a minimum length of \`${e+1}\`, got \`${t.length}\``})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0);t.ArrayBufferPredicate=class extends n.Predicate{byteLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have byte length of \`${e}\`, got \`${t.byteLength}\``,validator:t=>t.byteLength===e})}minByteLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a minimum byte length of \`${e}\`, got \`${t.byteLength}\``,validator:t=>t.byteLength>=e,negatedMessage:(t,r)=>`Expected ${r} to have a maximum byte length of \`${e-1}\`, got \`${t.byteLength}\``})}maxByteLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a maximum byte length of \`${e}\`, got \`${t.byteLength}\``,validator:t=>t.byteLength<=e,negatedMessage:(t,r)=>`Expected ${r} to have a minimum byte length of \`${e+1}\`, got \`${t.byteLength}\``})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0);t.DataViewPredicate=class extends n.Predicate{constructor(e){super("DataView",e)}byteLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have byte length of \`${e}\`, got \`${t.byteLength}\``,validator:t=>t.byteLength===e})}minByteLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a minimum byte length of \`${e}\`, got \`${t.byteLength}\``,validator:t=>t.byteLength>=e,negatedMessage:(t,r)=>`Expected ${r} to have a maximum byte length of \`${e-1}\`, got \`${t.byteLength}\``})}maxByteLength(e){return this.addValidator({message:(t,r)=>`Expected ${r} to have a maximum byte length of \`${e}\`, got \`${t.byteLength}\``,validator:t=>t.byteLength<=e,negatedMessage:(t,r)=>`Expected ${r} to have a minimum byte length of \`${e+1}\`, got \`${t.byteLength}\``})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6),i=r(2);t.AnyPredicate=class{constructor(e,t={}){this.predicates=e,this.options=t}[i.testSymbol](e,t,r){const i=["Any predicate failed with the following errors:"];for(const n of this.predicates)try{return void t(e,r,n)}catch(t){if(void 0===e&&!0===this.options.optional)return;i.push(`- ${t.message}`)}throw new n.ArgumentError(i.join("\n"),t)}}}]);const i=t.exports;t.exports=i.default,Object.assign(t.exports,i)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:437,fs:298}],402:[function(e,t,r){"use strict";t.exports=((e,t)=>(t=t||(()=>{}),e.then(e=>new Promise(e=>{e(t())}).then(()=>e),e=>new Promise(e=>{e(t())}).then(()=>{throw e}))))},{}],403:[function(e,t,r){"use strict";t.exports=((...e)=>{if(0===e.length)throw new Error("Expected at least one argument");return async t=>{let r=t;for(const t of e)r=await t(r);return r}})},{}],404:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}r.resolve=function(){for(var r="",i=!1,s=arguments.length-1;s>=-1&&!i;s--){var o=s>=0?arguments[s]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(e){var s=r.isAbsolute(e),o="/"===i(e,-1);return(e=t(n(e.split("/"),function(e){return!!e}),!s).join("/"))||s||(e="."),e&&o&&(e+="/"),(s?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),s=n(t.split("/")),o=Math.min(i.length,s.length),a=o,u=0;u<o;u++)if(i[u]!==s[u]){a=u;break}var l=[];for(u=a;u<i.length;u++)l.push("..");return(l=l.concat(s.slice(a))).join("/")},r.sep="/",r.delimiter=":",r.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!i){n=s;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},r.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,n=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){r=t+1;break}}else-1===n&&(i=!1,n=t+1);return-1===n?"":e.slice(r,n)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,i=!0,s=0,o=e.length-1;o>=0;--o){var a=e.charCodeAt(o);if(47!==a)-1===n&&(i=!1,n=o+1),46===a?-1===t?t=o:1!==s&&(s=1):-1!==t&&(s=-1);else if(!i){r=o+1;break}}return-1===t||-1===n||0===s||1===s&&t===n-1&&t===r+1?"":e.slice(t,n)};var i="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,e("_process"))},{_process:437}],405:[function(e,t,r){(function(e){"use strict";function r(e){return"/"===e.charAt(0)}function n(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),r=t[1]||"",n=Boolean(r&&":"!==r.charAt(1));return Boolean(t[2]||n)}t.exports="win32"===e.platform?n:r,t.exports.posix=r,t.exports.win32=n}).call(this,e("_process"))},{_process:437}],406:[function(e,t,r){(function(e){"use strict";t.exports=(t=>{const r=(t=t||{}).env||e.env;return"win32"!==(t.platform||e.platform)?"PATH":Object.keys(r).find(e=>"PATH"===e.toUpperCase())||"Path"})}).call(this,e("_process"))},{_process:437}],407:[function(e,t,r){"use strict";t.exports=e("./lib/picomatch")},{"./lib/picomatch":410}],408:[function(e,t,r){"use strict";const n=e("path"),i={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},s={...i,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"};t.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:n.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?s:i}},{path:404}],409:[function(e,t,r){"use strict";const n=e("./constants"),i=e("./utils"),{MAX_LENGTH:s,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:u,REPLACEMENTS:l}=n,c=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map(e=>i.escapeRegex(e)).join("..")}return r},h=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,p=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=l[e]||e;const r={...t},p="number"==typeof r.maxLength?Math.min(s,r.maxLength):s;let f=e.length;if(f>p)throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${p}`);const d={type:"bos",value:"",output:r.prepend||""},m=[d],g=r.capture?"":"?:",v=i.isWindows(t),y=n.globChars(v),_=n.extglobChars(y),{DOT_LITERAL:b,PLUS_LITERAL:x,SLASH_LITERAL:w,ONE_CHAR:E,DOTS_SLASH:T,NO_DOT:A,NO_DOT_SLASH:S,NO_DOTS_SLASH:k,QMARK:C,QMARK_NO_DOT:I,STAR:R,START_ANCHOR:L}=y,O=e=>`(${g}(?:(?!${L}${e.dot?T:b}).)*?)`,M=r.dot?"":A,P=r.dot?C:I;let B=!0===r.bash?O(r):R;r.capture&&(B=`(${B})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const N={input:e,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};e=i.removePrefix(e,N),f=e.length;const D=[],F=[],j=[];let U,$=d;const V=()=>N.index===f-1,G=N.peek=((t=1)=>e[N.index+t]),z=N.advance=(()=>e[++N.index]),W=()=>e.slice(N.index+1),H=(e="",t=0)=>{N.consumed+=e,N.index+=t},K=e=>{N.output+=null!=e.output?e.output:e.value,H(e.value)},q=()=>{let e=1;for(;"!"===G()&&("("!==G(2)||"?"===G(3));)z(),N.start++,e++;return e%2!=0&&(N.negated=!0,N.start++,!0)},X=e=>{N[e]++,j.push(e)},Y=e=>{N[e]--,j.pop()},Z=e=>{if("globstar"===$.type){const t=N.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||D.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(N.output=N.output.slice(0,-$.output.length),$.type="star",$.value="*",$.output=B,N.output+=$.output)}if(D.length&&"paren"!==e.type&&!_[e.value]&&(D[D.length-1].inner+=e.value),(e.value||e.output)&&K(e),$&&"text"===$.type&&"text"===e.type)return $.value+=e.value,void($.output=($.output||"")+e.value);e.prev=$,m.push(e),$=e},J=(e,t)=>{const n={..._[t],conditions:1,inner:""};n.prev=$,n.parens=N.parens,n.output=N.output;const i=(r.capture?"(":"")+n.open;X("parens"),Z({type:e,value:t,output:N.output?"":E}),Z({type:"paren",extglob:!0,value:z(),output:i}),D.push(n)},Q=e=>{let t=e.close+(r.capture?")":"");if("negate"===e.type){let n=B;e.inner&&e.inner.length>1&&e.inner.includes("/")&&(n=O(r)),(n!==B||V()||/^\)+$/.test(W()))&&(t=e.close=`)$))${n}`),"bos"===e.prev.type&&V()&&(N.negatedExtglob=!0)}Z({type:"paren",extglob:!0,value:U,output:t}),Y("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,s=e.replace(u,(e,t,r,i,s,o)=>"\\"===i?(n=!0,e):"?"===i?t?t+i+(s?C.repeat(s.length):""):0===o?P+(s?C.repeat(s.length):""):C.repeat(r.length):"."===i?b.repeat(r.length):"*"===i?t?t+i+(s?B:""):B:t?e:`\\${e}`);return!0===n&&(s=!0===r.unescape?s.replace(/\\/g,""):s.replace(/\\+/g,e=>e.length%2==0?"\\\\":e?"\\":"")),s===e&&!0===r.contains?(N.output=e,N):(N.output=i.wrapOutput(s,N,t),N)}for(;!V();){if("\0"===(U=z()))continue;if("\\"===U){const e=G();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){Z({type:"text",value:U+="\\"});continue}const t=/^\\+/.exec(W());let n=0;if(t&&t[0].length>2&&(n=t[0].length,N.index+=n,n%2!=0&&(U+="\\")),!0===r.unescape?U=z()||"":U+=z()||"",0===N.brackets){Z({type:"text",value:U});continue}}if(N.brackets>0&&("]"!==U||"["===$.value||"[^"===$.value)){if(!1!==r.posix&&":"===U){const e=$.value.slice(1);if(e.includes("[")&&($.posix=!0,e.includes(":"))){const e=$.value.lastIndexOf("["),t=$.value.slice(0,e),r=$.value.slice(e+2),n=o[r];if(n){$.value=t+n,N.backtrack=!0,z(),d.output||1!==m.indexOf($)||(d.output=E);continue}}}("["===U&&":"!==G()||"-"===U&&"]"===G())&&(U=`\\${U}`),"]"!==U||"["!==$.value&&"[^"!==$.value||(U=`\\${U}`),!0===r.posix&&"!"===U&&"["===$.value&&(U="^"),$.value+=U,K({value:U});continue}if(1===N.quotes&&'"'!==U){U=i.escapeRegex(U),$.value+=U,K({value:U});continue}if('"'===U){N.quotes=1===N.quotes?0:1,!0===r.keepQuotes&&Z({type:"text",value:U});continue}if("("===U){X("parens"),Z({type:"paren",value:U});continue}if(")"===U){if(0===N.parens&&!0===r.strictBrackets)throw new SyntaxError(h("opening","("));const e=D[D.length-1];if(e&&N.parens===e.parens+1){Q(D.pop());continue}Z({type:"paren",value:U,output:N.parens?")":"\\)"}),Y("parens");continue}if("["===U){if(!0!==r.nobracket&&W().includes("]"))X("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));U=`\\${U}`}Z({type:"bracket",value:U});continue}if("]"===U){if(!0===r.nobracket||$&&"bracket"===$.type&&1===$.value.length){Z({type:"text",value:U,output:`\\${U}`});continue}if(0===N.brackets){if(!0===r.strictBrackets)throw new SyntaxError(h("opening","["));Z({type:"text",value:U,output:`\\${U}`});continue}Y("brackets");const e=$.value.slice(1);if(!0===$.posix||"^"!==e[0]||e.includes("/")||(U=`/${U}`),$.value+=U,K({value:U}),!1===r.literalBrackets||i.hasRegexChars(e))continue;const t=i.escapeRegex($.value);if(N.output=N.output.slice(0,-$.value.length),!0===r.literalBrackets){N.output+=t,$.value=t;continue}$.value=`(${g}${t}|${$.value})`,N.output+=$.value;continue}if("{"===U&&!0!==r.nobrace){X("braces");const e={type:"brace",value:U,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};F.push(e),Z(e);continue}if("}"===U){const e=F[F.length-1];if(!0===r.nobrace||!e){Z({type:"text",value:U,output:U});continue}let t=")";if(!0===e.dots){const e=m.slice(),n=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&n.unshift(e[t].value);t=c(n,r),N.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=N.output.slice(0,e.outputIndex),n=N.tokens.slice(e.tokensIndex);e.value=e.output="\\{",U=t="\\}",N.output=r;for(const e of n)N.output+=e.output||e.value}Z({type:"brace",value:U,output:t}),Y("braces"),F.pop();continue}if("|"===U){D.length>0&&D[D.length-1].conditions++,Z({type:"text",value:U});continue}if(","===U){let e=U;const t=F[F.length-1];t&&"braces"===j[j.length-1]&&(t.comma=!0,e="|"),Z({type:"comma",value:U,output:e});continue}if("/"===U){if("dot"===$.type&&N.index===N.start+1){N.start=N.index+1,N.consumed="",N.output="",m.pop(),$=d;continue}Z({type:"slash",value:U,output:w});continue}if("."===U){if(N.braces>0&&"dot"===$.type){"."===$.value&&($.output=b);const e=F[F.length-1];$.type="dots",$.output+=U,$.value+=U,e.dots=!0;continue}if(N.braces+N.parens===0&&"bos"!==$.type&&"slash"!==$.type){Z({type:"text",value:U,output:b});continue}Z({type:"dot",value:U,output:b});continue}if("?"===U){if(!($&&"("===$.value)&&!0!==r.noextglob&&"("===G()&&"?"!==G(2)){J("qmark",U);continue}if($&&"paren"===$.type){const e=G();let t=U;if("<"===e&&!i.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===$.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(W()))&&(t=`\\${U}`),Z({type:"text",value:U,output:t});continue}if(!0!==r.dot&&("slash"===$.type||"bos"===$.type)){Z({type:"qmark",value:U,output:I});continue}Z({type:"qmark",value:U,output:C});continue}if("!"===U){if(!0!==r.noextglob&&"("===G()&&("?"!==G(2)||!/[!=<:]/.test(G(3)))){J("negate",U);continue}if(!0!==r.nonegate&&0===N.index){q();continue}}if("+"===U){if(!0!==r.noextglob&&"("===G()&&"?"!==G(2)){J("plus",U);continue}if($&&"("===$.value||!1===r.regex){Z({type:"plus",value:U,output:x});continue}if($&&("bracket"===$.type||"paren"===$.type||"brace"===$.type)||N.parens>0){Z({type:"plus",value:U});continue}Z({type:"plus",value:x});continue}if("@"===U){if(!0!==r.noextglob&&"("===G()&&"?"!==G(2)){Z({type:"at",extglob:!0,value:U,output:""});continue}Z({type:"text",value:U});continue}if("*"!==U){"$"!==U&&"^"!==U||(U=`\\${U}`);const e=a.exec(W());e&&(U+=e[0],N.index+=e[0].length),Z({type:"text",value:U});continue}if($&&("globstar"===$.type||!0===$.star)){$.type="star",$.star=!0,$.value+=U,$.output=B,N.backtrack=!0,N.globstar=!0,H(U);continue}let t=W();if(!0!==r.noextglob&&/^\([^?]/.test(t)){J("star",U);continue}if("star"===$.type){if(!0===r.noglobstar){H(U);continue}const n=$.prev,i=n.prev,s="slash"===n.type||"bos"===n.type,o=i&&("star"===i.type||"globstar"===i.type);if(!0===r.bash&&(!s||t[0]&&"/"!==t[0])){Z({type:"star",value:U,output:""});continue}const a=N.braces>0&&("comma"===n.type||"brace"===n.type),u=D.length&&("pipe"===n.type||"paren"===n.type);if(!s&&"paren"!==n.type&&!a&&!u){Z({type:"star",value:U,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[N.index+4];if(r&&"/"!==r)break;t=t.slice(3),H("/**",3)}if("bos"===n.type&&V()){$.type="globstar",$.value+=U,$.output=O(r),N.output=$.output,N.globstar=!0,H(U);continue}if("slash"===n.type&&"bos"!==n.prev.type&&!o&&V()){N.output=N.output.slice(0,-(n.output+$.output).length),n.output=`(?:${n.output}`,$.type="globstar",$.output=O(r)+(r.strictSlashes?")":"|$)"),$.value+=U,N.globstar=!0,N.output+=n.output+$.output,H(U);continue}if("slash"===n.type&&"bos"!==n.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";N.output=N.output.slice(0,-(n.output+$.output).length),n.output=`(?:${n.output}`,$.type="globstar",$.output=`${O(r)}${w}|${w}${e})`,$.value+=U,N.output+=n.output+$.output,N.globstar=!0,H(U+z()),Z({type:"slash",value:"/",output:""});continue}if("bos"===n.type&&"/"===t[0]){$.type="globstar",$.value+=U,$.output=`(?:^|${w}|${O(r)}${w})`,N.output=$.output,N.globstar=!0,H(U+z()),Z({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-$.output.length),$.type="globstar",$.output=O(r),$.value+=U,N.output+=$.output,N.globstar=!0,H(U);continue}const n={type:"star",value:U,output:B};!0!==r.bash?!$||"bracket"!==$.type&&"paren"!==$.type||!0!==r.regex?(N.index!==N.start&&"slash"!==$.type&&"dot"!==$.type||("dot"===$.type?(N.output+=S,$.output+=S):!0===r.dot?(N.output+=k,$.output+=k):(N.output+=M,$.output+=M),"*"!==G()&&(N.output+=E,$.output+=E)),Z(n)):(n.output=U,Z(n)):(n.output=".*?","bos"!==$.type&&"slash"!==$.type||(n.output=M+n.output),Z(n))}for(;N.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","]"));N.output=i.escapeLast(N.output,"["),Y("brackets")}for(;N.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing",")"));N.output=i.escapeLast(N.output,"("),Y("parens")}for(;N.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(h("closing","}"));N.output=i.escapeLast(N.output,"{"),Y("braces")}if(!0===r.strictSlashes||"star"!==$.type&&"bracket"!==$.type||Z({type:"maybe_slash",value:"",output:`${w}?`}),!0===N.backtrack){N.output="";for(const e of N.tokens)N.output+=null!=e.output?e.output:e.value,e.suffix&&(N.output+=e.suffix)}return N};p.fastpaths=((e,t)=>{const r={...t},o="number"==typeof r.maxLength?Math.min(s,r.maxLength):s,a=e.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=l[e]||e;const u=i.isWindows(t),{DOT_LITERAL:c,SLASH_LITERAL:h,ONE_CHAR:p,DOTS_SLASH:f,NO_DOT:d,NO_DOTS:m,NO_DOTS_SLASH:g,STAR:v,START_ANCHOR:y}=n.globChars(u),_=r.dot?m:d,b=r.dot?g:d,x=r.capture?"":"?:";let w=!0===r.bash?".*?":v;r.capture&&(w=`(${w})`);const E=e=>!0===e.noglobstar?w:`(${x}(?:(?!${y}${e.dot?f:c}).)*?)`,T=e=>{switch(e){case"*":return`${_}${p}${w}`;case".*":return`${c}${p}${w}`;case"*.*":return`${_}${w}${c}${p}${w}`;case"*/*":return`${_}${w}${h}${p}${b}${w}`;case"**":return _+E(r);case"**/*":return`(?:${_}${E(r)}${h})?${b}${p}${w}`;case"**/*.*":return`(?:${_}${E(r)}${h})?${b}${w}${c}${p}${w}`;case"**/.*":return`(?:${_}${E(r)}${h})?${c}${p}${w}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=T(t[1]);if(!r)return;return r+c+t[2]}}},A=i.removePrefix(e,{negated:!1,prefix:""});let S=T(A);return S&&!0!==r.strictSlashes&&(S+=`${h}?`),S}),t.exports=p},{"./constants":408,"./utils":412}],410:[function(e,t,r){"use strict";const n=e("path"),i=e("./scan"),s=e("./parse"),o=e("./utils"),a=e("./constants"),u=(e,t,r=!1)=>{if(Array.isArray(e)){const n=e.map(e=>u(e,t,r));return e=>{for(const t of n){const r=t(e);if(r)return r}return!1}}const n=(e=>e&&"object"==typeof e&&!Array.isArray(e))(e)&&e.tokens&&e.input;if(""===e||"string"!=typeof e&&!n)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},s=o.isWindows(t),a=n?u.compileRe(e,t):u.makeRe(e,t,!1,!0),l=a.state;delete a.state;let c=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};c=u(i.ignore,e,r)}const h=(r,n=!1)=>{const{isMatch:o,match:h,output:p}=u.test(r,a,t,{glob:e,posix:s}),f={glob:e,state:l,regex:a,posix:s,input:r,output:p,match:h,isMatch:o};return"function"==typeof i.onResult&&i.onResult(f),!1===o?(f.isMatch=!1,!!n&&f):c(r)?("function"==typeof i.onIgnore&&i.onIgnore(f),f.isMatch=!1,!!n&&f):("function"==typeof i.onMatch&&i.onMatch(f),!n||f)};return r&&(h.state=l),h};u.test=((e,t,r,{glob:n,posix:i}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const s=r||{},a=s.format||(i?o.toPosixSlashes:null);let l=e===n,c=l&&a?a(e):e;return!1===l&&(l=(c=a?a(e):e)===n),!1!==l&&!0!==s.capture||(l=!0===s.matchBase||!0===s.basename?u.matchBase(e,t,r,i):t.exec(c)),{isMatch:Boolean(l),match:l,output:c}}),u.matchBase=((e,t,r,i=o.isWindows(r))=>{return(t instanceof RegExp?t:u.makeRe(t,r)).test(n.basename(e))}),u.isMatch=((e,t,r)=>u(t,r)(e)),u.parse=((e,t)=>Array.isArray(e)?e.map(e=>u.parse(e,t)):s(e,{...t,fastpaths:!1})),u.scan=((e,t)=>i(e,t)),u.compileRe=((e,t,r=!1,n=!1)=>{if(!0===r)return e.output;const i=t||{},s=i.contains?"":"^",o=i.contains?"":"$";let a=`${s}(?:${e.output})${o}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const l=u.toRegex(a,t);return!0===n&&(l.state=e),l}),u.makeRe=((e,t,r=!1,n=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");const i=t||{};let o,a={negated:!1,fastpaths:!0},l="";return e.startsWith("./")&&(e=e.slice(2),l=a.prefix="./"),!1===i.fastpaths||"."!==e[0]&&"*"!==e[0]||(o=s.fastpaths(e,t)),void 0===o?(a=s(e,t)).prefix=l+(a.prefix||""):a.output=o,u.compileRe(a,t,r,n)}),u.toRegex=((e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}}),u.constants=a,t.exports=u},{"./constants":408,"./parse":409,"./scan":411,"./utils":412,path:404}],411:[function(e,t,r){"use strict";const n=e("./utils"),{CHAR_ASTERISK:i,CHAR_AT:s,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:u,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:h,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:d,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:v,CHAR_RIGHT_SQUARE_BRACKET:y}=e("./constants"),_=e=>e===c||e===o,b=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};t.exports=((e,t)=>{const r=t||{},x=e.length-1,w=!0===r.parts||!0===r.scanToEnd,E=[],T=[],A=[];let S,k,C=e,I=-1,R=0,L=0,O=!1,M=!1,P=!1,B=!1,N=!1,D=!1,F=!1,j=!1,U=!1,$=0,V={value:"",depth:0,isGlob:!1};const G=()=>I>=x,z=()=>C.charCodeAt(I+1),W=()=>(S=k,C.charCodeAt(++I));for(;I<x;){let e;if((k=W())!==o){if(!0===D||k===h){for($++;!0!==G()&&(k=W());)if(k!==o)if(k!==h){if(!0!==D&&k===u&&(k=W())===u){if(O=V.isBrace=!0,P=V.isGlob=!0,U=!0,!0===w)continue;break}if(!0!==D&&k===a){if(O=V.isBrace=!0,P=V.isGlob=!0,U=!0,!0===w)continue;break}if(k===g&&0==--$){D=!1,O=V.isBrace=!0,U=!0;break}}else $++;else F=V.backslashes=!0,W();if(!0===w)continue;break}if(k!==c){if(!0!==r.noext&&!0==(k===d||k===s||k===i||k===m||k===l)&&z()===p){if(P=V.isGlob=!0,B=V.isExtglob=!0,U=!0,!0===w){for(;!0!==G()&&(k=W());)if(k!==o){if(k===v){P=V.isGlob=!0,U=!0;break}}else F=V.backslashes=!0,k=W();continue}break}if(k===i){if(S===i&&(N=V.isGlobstar=!0),P=V.isGlob=!0,U=!0,!0===w)continue;break}if(k===m){if(P=V.isGlob=!0,U=!0,!0===w)continue;break}if(k===f)for(;!0!==G()&&(e=W());)if(e!==o){if(e===y){if(M=V.isBracket=!0,P=V.isGlob=!0,U=!0,!0===w)continue;break}}else F=V.backslashes=!0,W();if(!0===r.nonegate||k!==l||I!==R){if(!0!==r.noparen&&k===p){if(P=V.isGlob=!0,!0===w){for(;!0!==G()&&(k=W());)if(k!==p){if(k===v){U=!0;break}}else F=V.backslashes=!0,k=W();continue}break}if(!0===P){if(U=!0,!0===w)continue;break}}else j=V.negated=!0,R++}else{if(E.push(I),T.push(V),V={value:"",depth:0,isGlob:!1},!0===U)continue;if(S===u&&I===R+1){R+=2;continue}L=I+1}}else F=V.backslashes=!0,(k=W())===h&&(D=!0)}!0===r.noext&&(B=!1,P=!1);let H=C,K="",q="";R>0&&(K=C.slice(0,R),C=C.slice(R),L-=R),H&&!0===P&&L>0?(H=C.slice(0,L),q=C.slice(L)):!0===P?(H="",q=C):H=C,H&&""!==H&&"/"!==H&&H!==C&&_(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),!0===r.unescape&&(q&&(q=n.removeBackslashes(q)),H&&!0===F&&(H=n.removeBackslashes(H)));const X={prefix:K,input:e,start:R,base:H,glob:q,isBrace:O,isBracket:M,isGlob:P,isExtglob:B,isGlobstar:N,negated:j};if(!0===r.tokens&&(X.maxDepth=0,_(k)||T.push(V),X.tokens=T),!0===r.parts||!0===r.tokens){let t;for(let n=0;n<E.length;n++){const i=t?t+1:R,s=E[n],o=e.slice(i,s);r.tokens&&(0===n&&0!==R?(T[n].isPrefix=!0,T[n].value=K):T[n].value=o,b(T[n]),X.maxDepth+=T[n].depth),0===n&&""===o||A.push(o),t=s}if(t&&t+1<e.length){const n=e.slice(t+1);A.push(n),r.tokens&&(T[T.length-1].value=n,b(T[T.length-1]),X.maxDepth+=T[T.length-1].depth)}X.slashes=E,X.parts=A}return X})},{"./constants":408,"./utils":412}],412:[function(e,t,r){(function(t){"use strict";const n=e("path"),i="win32"===t.platform,{REGEX_BACKSLASH:s,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:u}=e("./constants");r.isObject=(e=>null!==e&&"object"==typeof e&&!Array.isArray(e)),r.hasRegexChars=(e=>a.test(e)),r.isRegexChar=(e=>1===e.length&&r.hasRegexChars(e)),r.escapeRegex=(e=>e.replace(u,"\\$1")),r.toPosixSlashes=(e=>e.replace(s,"/")),r.removeBackslashes=(e=>e.replace(o,e=>"\\"===e?"":e)),r.supportsLookbehinds=(()=>{const e=t.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10}),r.isWindows=(e=>e&&"boolean"==typeof e.windows?e.windows:!0===i||"\\"===n.sep),r.escapeLast=((e,t,n)=>{const i=e.lastIndexOf(t,n);return-1===i?e:"\\"===e[i-1]?r.escapeLast(e,t,i-1):`${e.slice(0,i)}\\${e.slice(i)}`}),r.removePrefix=((e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r}),r.wrapOutput=((e,t={},r={})=>{let n=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(n=`(?:^(?!${n}).*$)`),n})}).call(this,e("_process"))},{"./constants":408,_process:437,path:404}],413:[function(e,t,r){(function(t){"use strict";var n=e("./interlace"),i={1:{0:0,1:0,2:0,3:255},2:{0:0,1:0,2:0,3:1},3:{0:0,1:1,2:2,3:255},4:{0:0,1:1,2:2,3:3}};function s(e,t,r,n,s,o){for(var a=e.width,u=e.height,l=e.index,c=0;c<u;c++)for(var h=0;h<a;h++){for(var p=r(h,c,l),f=0;f<4;f++){var d=i[n][f];if(f===s.length)throw new Error("Ran out of data");t[p+f]=255!==d?s[d+o]:255}o+=n}return o}function o(e,t,r,n,s,o){for(var a=e.width,u=e.height,l=e.index,c=0;c<u;c++){for(var h=0;h<a;h++)for(var p=s.get(n),f=r(h,c,l),d=0;d<4;d++){var m=i[n][d];t[f+d]=255!==m?p[m]:o}s.resetAfterLine()}}r.dataToBitMap=function(e,r){var i,a=r.width,u=r.height,l=r.depth,c=r.bpp,h=r.interlace;if(8!==l)var p=function(e,t){var r=[],n=0;function i(){if(n===e.length)throw new Error("Ran out of data");var i,s,o,a,u,l,c,h,p=e[n];switch(n++,t){default:throw new Error("unrecognised depth");case 16:c=e[n],n++,r.push((p<<8)+c);break;case 4:c=15&p,h=p>>4,r.push(h,c);break;case 2:u=3&p,l=p>>2&3,c=p>>4&3,h=p>>6&3,r.push(h,c,l,u);break;case 1:i=1&p,s=p>>1&1,o=p>>2&1,a=p>>3&1,u=p>>4&1,l=p>>5&1,c=p>>6&1,h=p>>7&1,r.push(h,c,l,u,a,o,s,i)}}return{get:function(e){for(;r.length<e;)i();var t=r.slice(0,e);return r=r.slice(e),t},resetAfterLine:function(){r.length=0},end:function(){if(n!==e.length)throw new Error("extra data found")}}}(e,l);i=l<=8?new t(a*u*4):new Uint16Array(a*u*4);var f,d,m=Math.pow(2,l)-1,g=0;if(h)f=n.getImagePasses(a,u),d=n.getInterlaceIterator(a,u);else{var v=0;d=function(){var e=v;return v+=4,e},f=[{width:a,height:u}]}for(var y=0;y<f.length;y++)8===l?g=s(f[y],i,d,c,e,g):o(f[y],i,d,c,p,m);if(8===l){if(g!==e.length)throw new Error("extra data found")}else p.end();return i}}).call(this,e("buffer").Buffer)},{"./interlace":423,buffer:299}],414:[function(e,t,r){(function(r){"use strict";var n=e("./constants");t.exports=function(e,t,i,s){var o=s.colorType===n.COLORTYPE_COLOR_ALPHA;if(s.inputHasAlpha&&o)return e;if(!s.inputHasAlpha&&!o)return e;var a=o?4:3,u=new r(t*i*a),l=s.inputHasAlpha?4:3,c=0,h=0,p=s.bgColor||{};void 0===p.red&&(p.red=255),void 0===p.green&&(p.green=255),void 0===p.blue&&(p.blue=255);for(var f=0;f<i;f++)for(var d=0;d<t;d++){var m,g=e[c],v=e[c+1],y=e[c+2];s.inputHasAlpha?(m=e[c+3],o||(m/=255,g=Math.min(Math.max(Math.round((1-m)*p.red+m*g),0),255),v=Math.min(Math.max(Math.round((1-m)*p.green+m*v),0),255),y=Math.min(Math.max(Math.round((1-m)*p.blue+m*y),0),255))):m=255,u[h]=g,u[h+1]=v,u[h+2]=y,o&&(u[h+3]=m),c+=l,h+=a}return u}}).call(this,e("buffer").Buffer)},{"./constants":416,buffer:299}],415:[function(e,t,r){(function(r,n){"use strict";var i=e("util"),s=e("stream"),o=t.exports=function(){s.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};i.inherits(o,s),o.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t}),r.nextTick(function(){this._process(),this._paused&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},o.prototype.write=function(e,t){return this.writable?(r=n.isBuffer(e)?e:new n(e,t||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1);var r},o.prototype.end=function(e,t){e&&this.write(e,t),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},o.prototype.destroySoon=o.prototype.end,o.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waitng on finished stream")),this.destroy()},o.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},o.prototype._processReadAllowingLess=function(e){this._reads.shift();var t=this._buffers[0];t.length>e.length?(this._buffered-=e.length,this._buffers[0]=t.slice(e.length),e.func.call(this,t.slice(0,e.length))):(this._buffered-=t.length,this._buffers.shift(),e.func.call(this,t))},o.prototype._processRead=function(e){this._reads.shift();for(var t=0,r=0,i=new n(e.length);t<e.length;){var s=this._buffers[r++],o=Math.min(s.length,e.length-t);s.copy(i,t,0,o),t+=o,o!==s.length&&(this._buffers[--r]=s.slice(o))}r>0&&this._buffers.splice(0,r),this._buffered-=e.length,e.func.call(this,i)},o.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){var e=this._reads[0];if(e.allowLess)this._processReadAllowingLess(e);else{if(!(this._buffered>=e.length))break;this._processRead(e)}}this._buffers&&this._buffers.length>0&&null===this._buffers[0]&&this._end()}catch(e){this.emit("error",e)}}}).call(this,e("_process"),e("buffer").Buffer)},{_process:437,buffer:299,stream:503,util:523}],416:[function(e,t,r){"use strict";t.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},{}],417:[function(e,t,r){"use strict";var n=[];!function(){for(var e=0;e<256;e++){for(var t=e,r=0;r<8;r++)1&t?t=3988292384^t>>>1:t>>>=1;n[e]=t}}();var i=t.exports=function(){this._crc=-1};i.prototype.write=function(e){for(var t=0;t<e.length;t++)this._crc=n[255&(this._crc^e[t])]^this._crc>>>8;return!0},i.prototype.crc32=function(){return-1^this._crc},i.crc32=function(e){for(var t=-1,r=0;r<e.length;r++)t=n[255&(t^e[r])]^t>>>8;return-1^t}},{}],418:[function(e,t,r){(function(r){"use strict";var n=e("./paeth-predictor");var i={0:function(e,t,r,n,i){e.copy(n,i,t,t+r)},1:function(e,t,r,n,i,s){for(var o=0;o<r;o++){var a=o>=s?e[t+o-s]:0,u=e[t+o]-a;n[i+o]=u}},2:function(e,t,r,n,i){for(var s=0;s<r;s++){var o=t>0?e[t+s-r]:0,a=e[t+s]-o;n[i+s]=a}},3:function(e,t,r,n,i,s){for(var o=0;o<r;o++){var a=o>=s?e[t+o-s]:0,u=t>0?e[t+o-r]:0,l=e[t+o]-(a+u>>1);n[i+o]=l}},4:function(e,t,r,i,s,o){for(var a=0;a<r;a++){var u=a>=o?e[t+a-o]:0,l=t>0?e[t+a-r]:0,c=t>0&&a>=o?e[t+a-(r+o)]:0,h=e[t+a]-n(u,l,c);i[s+a]=h}}},s={0:function(e,t,r){for(var n=0,i=t+r,s=t;s<i;s++)n+=Math.abs(e[s]);return n},1:function(e,t,r,n){for(var i=0,s=0;s<r;s++){var o=s>=n?e[t+s-n]:0,a=e[t+s]-o;i+=Math.abs(a)}return i},2:function(e,t,r){for(var n=0,i=t+r,s=t;s<i;s++){var o=t>0?e[s-r]:0,a=e[s]-o;n+=Math.abs(a)}return n},3:function(e,t,r,n){for(var i=0,s=0;s<r;s++){var o=s>=n?e[t+s-n]:0,a=t>0?e[t+s-r]:0,u=e[t+s]-(o+a>>1);i+=Math.abs(u)}return i},4:function(e,t,r,i){for(var s=0,o=0;o<r;o++){var a=o>=i?e[t+o-i]:0,u=t>0?e[t+o-r]:0,l=t>0&&o>=i?e[t+o-(r+i)]:0,c=e[t+o]-n(a,u,l);s+=Math.abs(c)}return s}};t.exports=function(e,t,n,o,a){var u;if("filterType"in o&&-1!==o.filterType){if("number"!=typeof o.filterType)throw new Error("unrecognised filter types");u=[o.filterType]}else u=[0,1,2,3,4];for(var l=t*a,c=0,h=0,p=new r((l+1)*n),f=u[0],d=0;d<n;d++){if(u.length>1)for(var m=1/0,g=0;g<u.length;g++){var v=s[u[g]](e,h,l,a);v<m&&(f=u[g],m=v)}p[c]=f,c++,i[f](e,h,l,p,c,a),c+=l,h+=l}return p}}).call(this,e("buffer").Buffer)},{"./paeth-predictor":427,buffer:299}],419:[function(e,t,r){(function(r){"use strict";var n=e("util"),i=e("./chunkstream"),s=e("./filter-parse"),o=t.exports=function(e){i.call(this);var t=[],n=this;this._filter=new s(e,{read:this.read.bind(this),write:function(e){t.push(e)},complete:function(){n.emit("complete",r.concat(t))}}),this._filter.start()};n.inherits(o,i)}).call(this,e("buffer").Buffer)},{"./chunkstream":415,"./filter-parse":421,buffer:299,util:523}],420:[function(e,t,r){(function(t){"use strict";var n=e("./sync-reader"),i=e("./filter-parse");r.process=function(e,r){var s=[],o=new n(e);return new i(r,{read:o.read.bind(o),write:function(e){s.push(e)},complete:function(){}}).start(),o.process(),t.concat(s)}}).call(this,e("buffer").Buffer)},{"./filter-parse":421,"./sync-reader":433,buffer:299}],421:[function(e,t,r){(function(r){"use strict";var n=e("./interlace"),i=e("./paeth-predictor");function s(e,t,r){var n=e*t;return 8!==r&&(n=Math.ceil(n/(8/r))),n}var o=t.exports=function(e,t){var r=e.width,i=e.height,o=e.interlace,a=e.bpp,u=e.depth;if(this.read=t.read,this.write=t.write,this.complete=t.complete,this._imageIndex=0,this._images=[],o)for(var l=n.getImagePasses(r,i),c=0;c<l.length;c++)this._images.push({byteWidth:s(l[c].width,a,u),height:l[c].height,lineIndex:0});else this._images.push({byteWidth:s(r,a,u),height:i,lineIndex:0});this._xComparison=8===u?a:16===u?2*a:1};o.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},o.prototype._unFilterType1=function(e,t,r){for(var n=this._xComparison,i=n-1,s=0;s<r;s++){var o=e[1+s],a=s>i?t[s-n]:0;t[s]=o+a}},o.prototype._unFilterType2=function(e,t,r){for(var n=this._lastLine,i=0;i<r;i++){var s=e[1+i],o=n?n[i]:0;t[i]=s+o}},o.prototype._unFilterType3=function(e,t,r){for(var n=this._xComparison,i=n-1,s=this._lastLine,o=0;o<r;o++){var a=e[1+o],u=s?s[o]:0,l=o>i?t[o-n]:0,c=Math.floor((l+u)/2);t[o]=a+c}},o.prototype._unFilterType4=function(e,t,r){for(var n=this._xComparison,s=n-1,o=this._lastLine,a=0;a<r;a++){var u=e[1+a],l=o?o[a]:0,c=a>s?t[a-n]:0,h=a>s&&o?o[a-n]:0,p=i(c,l,h);t[a]=u+p}},o.prototype._reverseFilterLine=function(e){var t,n=e[0],i=this._images[this._imageIndex],s=i.byteWidth;if(0===n)t=e.slice(1,s+1);else switch(t=new r(s),n){case 1:this._unFilterType1(e,t,s);break;case 2:this._unFilterType2(e,t,s);break;case 3:this._unFilterType3(e,t,s);break;case 4:this._unFilterType4(e,t,s);break;default:throw new Error("Unrecognised filter type - "+n)}this.write(t),i.lineIndex++,i.lineIndex>=i.height?(this._lastLine=null,this._imageIndex++,i=this._images[this._imageIndex]):this._lastLine=t,i?this.read(i.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}}).call(this,e("buffer").Buffer)},{"./interlace":423,"./paeth-predictor":427,buffer:299}],422:[function(e,t,r){(function(e){"use strict";t.exports=function(t,r){var n=r.depth,i=r.width,s=r.height,o=r.colorType,a=r.transColor,u=r.palette,l=t;return 3===o?function(e,t,r,n,i){for(var s=0,o=0;o<n;o++)for(var a=0;a<r;a++){var u=i[e[s]];if(!u)throw new Error("index "+e[s]+" not in palette");for(var l=0;l<4;l++)t[s+l]=u[l];s+=4}}(t,l,i,s,u):(a&&function(e,t,r,n,i){for(var s=0,o=0;o<n;o++)for(var a=0;a<r;a++){var u=!1;if(1===i.length?i[0]===e[s]&&(u=!0):i[0]===e[s]&&i[1]===e[s+1]&&i[2]===e[s+2]&&(u=!0),u)for(var l=0;l<4;l++)t[s+l]=0;s+=4}}(t,l,i,s,a),8!==n&&(16===n&&(l=new e(i*s*4)),function(e,t,r,n,i){for(var s=Math.pow(2,i)-1,o=0,a=0;a<n;a++)for(var u=0;u<r;u++){for(var l=0;l<4;l++)t[o+l]=Math.floor(255*e[o+l]/s+.5);o+=4}}(t,l,i,s,n))),l}}).call(this,e("buffer").Buffer)},{buffer:299}],423:[function(e,t,r){"use strict";var n=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];r.getImagePasses=function(e,t){for(var r=[],i=e%8,s=t%8,o=(e-i)/8,a=(t-s)/8,u=0;u<n.length;u++){for(var l=n[u],c=o*l.x.length,h=a*l.y.length,p=0;p<l.x.length&&l.x[p]<i;p++)c++;for(p=0;p<l.y.length&&l.y[p]<s;p++)h++;c>0&&h>0&&r.push({width:c,height:h,index:u})}return r},r.getInterlaceIterator=function(e){return function(t,r,i){var s=t%n[i].x.length,o=(t-s)/n[i].x.length*8+n[i].x[s],a=r%n[i].y.length;return 4*o+((r-a)/n[i].y.length*8+n[i].y[a])*e*4}}},{}],424:[function(e,t,r){(function(r){"use strict";var n=e("util"),i=e("stream"),s=e("./constants"),o=e("./packer"),a=t.exports=function(e){i.call(this);var t=e||{};this._packer=new o(t),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(a,i),a.prototype.pack=function(e,t,n,i){this.emit("data",new r(s.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(t,n)),i&&this.emit("data",this._packer.packGAMA(i));var o=this._packer.filterData(e,t,n);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(e){this.emit("data",this._packer.packIDAT(e))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(o)}}).call(this,e("buffer").Buffer)},{"./constants":416,"./packer":426,buffer:299,stream:503,util:523}],425:[function(e,t,r){(function(r){"use strict";var n=!0,i=e("zlib");i.deflateSync||(n=!1);var s=e("./constants"),o=e("./packer");t.exports=function(e,t){if(!n)throw new Error("To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport");var a=new o(t||{}),u=[];u.push(new r(s.PNG_SIGNATURE)),u.push(a.packIHDR(e.width,e.height)),e.gamma&&u.push(a.packGAMA(e.gamma));var l=a.filterData(e.data,e.width,e.height),c=i.deflateSync(l,a.getDeflateOptions());if(l=null,!c||!c.length)throw new Error("bad png - invalid compressed data response");return u.push(a.packIDAT(c)),u.push(a.packIEND()),r.concat(u)}}).call(this,e("buffer").Buffer)},{"./constants":416,"./packer":426,buffer:299,zlib:297}],426:[function(e,t,r){(function(r){"use strict";var n=e("./constants"),i=e("./crc"),s=e("./bitpacker"),o=e("./filter-pack"),a=e("zlib"),u=t.exports=function(e){if(this._options=e,e.deflateChunkSize=e.deflateChunkSize||32768,e.deflateLevel=null!=e.deflateLevel?e.deflateLevel:9,e.deflateStrategy=null!=e.deflateStrategy?e.deflateStrategy:3,e.inputHasAlpha=null==e.inputHasAlpha||e.inputHasAlpha,e.deflateFactory=e.deflateFactory||a.createDeflate,e.bitDepth=e.bitDepth||8,e.colorType="number"==typeof e.colorType?e.colorType:n.COLORTYPE_COLOR_ALPHA,e.colorType!==n.COLORTYPE_COLOR&&e.colorType!==n.COLORTYPE_COLOR_ALPHA)throw new Error("option color type:"+e.colorType+" is not supported at present");if(8!==e.bitDepth)throw new Error("option bit depth:"+e.bitDepth+" is not supported at present")};u.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},u.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},u.prototype.filterData=function(e,t,r){var i=s(e,t,r,this._options),a=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return o(i,t,r,this._options,a)},u.prototype._packChunk=function(e,t){var n=t?t.length:0,s=new r(n+12);return s.writeUInt32BE(n,0),s.writeUInt32BE(e,4),t&&t.copy(s,8),s.writeInt32BE(i.crc32(s.slice(4,s.length-4)),s.length-4),s},u.prototype.packGAMA=function(e){var t=new r(4);return t.writeUInt32BE(Math.floor(e*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,t)},u.prototype.packIHDR=function(e,t){var i=new r(13);return i.writeUInt32BE(e,0),i.writeUInt32BE(t,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(n.TYPE_IHDR,i)},u.prototype.packIDAT=function(e){return this._packChunk(n.TYPE_IDAT,e)},u.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}}).call(this,e("buffer").Buffer)},{"./bitpacker":414,"./constants":416,"./crc":417,"./filter-pack":418,buffer:299,zlib:297}],427:[function(e,t,r){"use strict";t.exports=function(e,t,r){var n=e+t-r,i=Math.abs(n-e),s=Math.abs(n-t),o=Math.abs(n-r);return i<=s&&i<=o?e:s<=o?t:r}},{}],428:[function(e,t,r){"use strict";var n=e("util"),i=e("zlib"),s=e("./chunkstream"),o=e("./filter-parse-async"),a=e("./parser"),u=e("./bitmapper"),l=e("./format-normaliser"),c=t.exports=function(e){s.call(this),this._parser=new a(e,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this)}),this._options=e,this.writable=!0,this._parser.start()};n.inherits(c,s),c.prototype._handleError=function(e){this.emit("error",e),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this.errord=!0},c.prototype._inflateData=function(e){this._inflate||(this._inflate=i.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter)),this._inflate.write(e)},c.prototype._handleMetaData=function(e){this.emit("metadata",e),this._bitmapInfo=Object.create(e),this._filter=new o(this._bitmapInfo)},c.prototype._handleTransColor=function(e){this._bitmapInfo.transColor=e},c.prototype._handlePalette=function(e){this._bitmapInfo.palette=e},c.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"),this.destroySoon())},c.prototype._complete=function(e){if(!this.errord){try{var t=u.dataToBitMap(e,this._bitmapInfo),r=l(t,this._bitmapInfo);t=null}catch(e){return void this._handleError(e)}this.emit("parsed",r)}}},{"./bitmapper":413,"./chunkstream":415,"./filter-parse-async":419,"./format-normaliser":422,"./parser":430,util:523,zlib:297}],429:[function(e,t,r){(function(r){"use strict";var n=!0,i=e("zlib");i.deflateSync||(n=!1);var s=e("./sync-reader"),o=e("./filter-parse-sync"),a=e("./parser"),u=e("./bitmapper"),l=e("./format-normaliser");t.exports=function(e,t){if(!n)throw new Error("To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport");var c,h,p;var f=[];var d=new s(e);if(new a(t,{read:d.read.bind(d),error:function(e){c=e},metadata:function(e){h=e},gamma:function(e){p=e},palette:function(e){h.palette=e},transColor:function(e){h.transColor=e},inflateData:function(e){f.push(e)}}).start(),d.process(),c)throw c;var m=r.concat(f);f.length=0;var g=i.inflateSync(m);if(m=null,!g||!g.length)throw new Error("bad png - invalid inflate data response");var v=o.process(g,h);m=null;var y=u.dataToBitMap(v,h);v=null;var _=l(y,h);return h.data=_,h.gamma=p||0,h}}).call(this,e("buffer").Buffer)},{"./bitmapper":413,"./filter-parse-sync":420,"./format-normaliser":422,"./parser":430,"./sync-reader":433,buffer:299,zlib:297}],430:[function(e,t,r){(function(r){"use strict";var n=e("./constants"),i=e("./crc"),s=t.exports=function(e,t){this._options=e,e.checkCRC=!1!==e.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=t.read,this.error=t.error,this.metadata=t.metadata,this.gamma=t.gamma,this.transColor=t.transColor,this.palette=t.palette,this.parsed=t.parsed,this.inflateData=t.inflateData,this.inflateData=t.inflateData,this.finished=t.finished};s.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},s.prototype._parseSignature=function(e){for(var t=n.PNG_SIGNATURE,r=0;r<t.length;r++)if(e[r]!==t[r])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},s.prototype._parseChunkBegin=function(e){for(var t=e.readUInt32BE(0),s=e.readUInt32BE(4),o="",a=4;a<8;a++)o+=String.fromCharCode(e[a]);var u=Boolean(32&e[4]);if(this._hasIHDR||s===n.TYPE_IHDR){if(this._crc=new i,this._crc.write(new r(o)),this._chunks[s])return this._chunks[s](t);u?this.read(t+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+o))}else this.error(new Error("Expected IHDR on beggining"))},s.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},s.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},s.prototype._parseChunkEnd=function(e){var t=e.readInt32BE(0),r=this._crc.crc32();this._options.checkCRC&&r!==t?this.error(new Error("Crc error - "+t+" - "+r)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},s.prototype._handleIHDR=function(e){this.read(e,this._parseIHDR.bind(this))},s.prototype._parseIHDR=function(e){this._crc.write(e);var t=e.readUInt32BE(0),r=e.readUInt32BE(4),i=e[8],s=e[9],o=e[10],a=e[11],u=e[12];if(8===i||4===i||2===i||1===i||16===i)if(s in n.COLORTYPE_TO_BPP_MAP)if(0===o)if(0===a)if(0===u||1===u){this._colorType=s;var l=n.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:t,height:r,depth:i,interlace:Boolean(u),palette:Boolean(s&n.COLORTYPE_PALETTE),color:Boolean(s&n.COLORTYPE_COLOR),alpha:Boolean(s&n.COLORTYPE_ALPHA),bpp:l,colorType:s}),this._handleChunkEnd()}else this.error(new Error("Unsupported interlace method"));else this.error(new Error("Unsupported filter method"));else this.error(new Error("Unsupported compression method"));else this.error(new Error("Unsupported color type"));else this.error(new Error("Unsupported bit depth "+i))},s.prototype._handlePLTE=function(e){this.read(e,this._parsePLTE.bind(this))},s.prototype._parsePLTE=function(e){this._crc.write(e);for(var t=Math.floor(e.length/3),r=0;r<t;r++)this._palette.push([e[3*r],e[3*r+1],e[3*r+2],255]);this.palette(this._palette),this._handleChunkEnd()},s.prototype._handleTRNS=function(e){this.read(e,this._parseTRNS.bind(this))},s.prototype._parseTRNS=function(e){if(this._crc.write(e),this._colorType===n.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(e.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(var t=0;t<e.length;t++)this._palette[t][3]=e[t];this.palette(this._palette)}this._colorType===n.COLORTYPE_GRAYSCALE&&this.transColor([e.readUInt16BE(0)]),this._colorType===n.COLORTYPE_COLOR&&this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)]),this._handleChunkEnd()},s.prototype._handleGAMA=function(e){this.read(e,this._parseGAMA.bind(this))},s.prototype._parseGAMA=function(e){this._crc.write(e),this.gamma(e.readUInt32BE(0)/n.GAMMA_DIVISION),this._handleChunkEnd()},s.prototype._handleIDAT=function(e){this.read(-e,this._parseIDAT.bind(this,e))},s.prototype._parseIDAT=function(e,t){if(this._crc.write(t),this._colorType===n.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(t);var r=e-t.length;r>0?this._handleIDAT(r):this._handleChunkEnd()},s.prototype._handleIEND=function(e){this.read(e,this._parseIEND.bind(this))},s.prototype._parseIEND=function(e){this._crc.write(e),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}}).call(this,e("buffer").Buffer)},{"./constants":416,"./crc":417,buffer:299}],431:[function(e,t,r){"use strict";var n=e("./parser-sync"),i=e("./packer-sync");r.read=function(e,t){return n(e,t||{})},r.write=function(e){return i(e)}},{"./packer-sync":425,"./parser-sync":429}],432:[function(e,t,r){(function(t,n){"use strict";var i=e("util"),s=e("stream"),o=e("./parser-async"),a=e("./packer-async"),u=e("./png-sync"),l=r.PNG=function(e){s.call(this),e=e||{},this.width=e.width||0,this.height=e.height||0,this.data=this.width>0&&this.height>0?new n(4*this.width*this.height):null,e.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new o(e),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new a(e),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(l,s),l.sync=u,l.prototype.pack=function(){return this.data&&this.data.length?(t.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},l.prototype.parse=function(e,t){var r,n;t&&(r=function(e){this.removeListener("error",n),this.data=e,t(null,this)}.bind(this),n=function(e){this.removeListener("parsed",r),t(e,null)}.bind(this),this.once("parsed",r),this.once("error",n));return this.end(e),this},l.prototype.write=function(e){return this._parser.write(e),!0},l.prototype.end=function(e){this._parser.end(e)},l.prototype._metadata=function(e){this.width=e.width,this.height=e.height,this.emit("metadata",e)},l.prototype._gamma=function(e){this.gamma=e},l.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},l.bitblt=function(e,t,r,n,i,s,o,a){if(r>e.width||n>e.height||r+i>e.width||n+s>e.height)throw new Error("bitblt reading outside image");if(o>t.width||a>t.height||o+i>t.width||a+s>t.height)throw new Error("bitblt writing outside image");for(var u=0;u<s;u++)e.data.copy(t.data,(a+u)*t.width+o<<2,(n+u)*e.width+r<<2,(n+u)*e.width+r+i<<2)},l.prototype.bitblt=function(e,t,r,n,i,s,o){return l.bitblt(this,e,t,r,n,i,s,o),this},l.adjustGamma=function(e){if(e.gamma){for(var t=0;t<e.height;t++)for(var r=0;r<e.width;r++)for(var n=e.width*t+r<<2,i=0;i<3;i++){var s=e.data[n+i]/255;s=Math.pow(s,1/2.2/e.gamma),e.data[n+i]=Math.round(255*s)}e.gamma=0}},l.prototype.adjustGamma=function(){l.adjustGamma(this)}}).call(this,e("_process"),e("buffer").Buffer)},{"./packer-async":424,"./parser-async":428,"./png-sync":431,_process:437,buffer:299,stream:503,util:523}],433:[function(e,t,r){"use strict";var n=t.exports=function(e){this._buffer=e,this._reads=[]};n.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t})},n.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){var e=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=e.length||e.allowLess))break;this._reads.shift();var t=this._buffer;this._buffer=t.slice(e.length),e.func.call(this,t.slice(0,e.length))}return this._reads.length>0?new Error("There are some read requests waitng on finished stream"):this._buffer.length>0?new Error("unrecognised content at end of stream"):void 0}},{}],434:[function(e,t,r){arguments[4][327][0].apply(r,arguments)},{"./lib":435,dup:327}],435:[function(e,t,r){(function(r,n){"use strict";const i=e("path"),s=e("bin-wrapper"),o=`https://raw.githubusercontent.com/imagemin/pngquant-bin/v${e("../package.json").version}/vendor/`;t.exports=(new s).src(`${o}macos/pngquant`,"darwin").src(`${o}linux/x86/pngquant`,"linux","x86").src(`${o}linux/x64/pngquant`,"linux","x64").src(`${o}freebsd/x64/pngquant`,"freebsd","x64").src(`${o}win/pngquant.exe`,"win32").dest(i.resolve(n,"../vendor")).use("win32"===r.platform?"pngquant.exe":"pngquant")}).call(this,e("_process"),"/node_modules/pngquant-bin/lib")},{"../package.json":436,_process:437,"bin-wrapper":29,path:404}],436:[function(e,t,r){t.exports={name:"pngquant-bin",version:"6.0.0",description:"`pngquant` wrapper that makes it seamlessly available as a local dependency",license:"GPL-3.0+",repository:"imagemin/pngquant-bin",author:{name:"Kevin Mårtensson",email:"kevinmartensson@gmail.com",url:"github.com/kevva"},maintainers:[{name:"Sindre Sorhus",email:"sindresorhus@gmail.com",url:"sindresorhus.com"},{name:"Shinnosuke Watanabe",url:"github.com/shinnn"}],bin:{pngquant:"cli.js"},engines:{node:">=10"},scripts:{postinstall:"node lib/install.js",test:"xo && ava"},files:["cli.js","index.js","lib","vendor/source"],keywords:["imagemin","compress","image","img","minify","optimize","png","pngquant"],dependencies:{"bin-build":"^3.0.0","bin-wrapper":"^4.0.1",execa:"^4.0.0",logalot:"^2.0.0"},devDependencies:{ava:"^3.8.0","bin-check":"^4.0.1","compare-size":"^3.0.0",tempy:"^0.5.0",xo:"^0.30.0"}}},{}],437:[function(e,t,r){var n,i,s=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var l,c=[],h=!1,p=-1;function f(){h&&l&&(h=!1,l.length?c=l.concat(c):p=-1,c.length&&d())}function d(){if(!h){var e=u(f);h=!0;for(var t=c.length;t;){for(l=c,c=[];++p<t;)l&&l[p].run();p=-1,t=c.length}l=null,h=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function g(){}s.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];c.push(new m(e,t)),1!==c.length||h||u(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=g,s.addListener=g,s.once=g,s.off=g,s.removeListener=g,s.removeAllListeners=g,s.emit=g,s.prependListener=g,s.prependOnceListener=g,s.listeners=function(e){return[]},s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],438:[function(e,t,r){(function(r){"pseudomap"===r.env.npm_package_name&&"test"===r.env.npm_lifecycle_script&&(r.env.TEST_PSEUDOMAP="true"),"function"!=typeof Map||r.env.TEST_PSEUDOMAP?t.exports=e("./pseudomap"):t.exports=Map}).call(this,e("_process"))},{"./pseudomap":439,_process:437}],439:[function(e,t,r){var n=Object.prototype.hasOwnProperty;function i(e){if(!(this instanceof i))throw new TypeError("Constructor PseudoMap requires 'new'");if(this.clear(),e)if(e instanceof i||"function"==typeof Map&&e instanceof Map)e.forEach(function(e,t){this.set(t,e)},this);else{if(!Array.isArray(e))throw new TypeError("invalid argument");e.forEach(function(e){this.set(e[0],e[1])},this)}}function s(e,t){return e===t||e!=e&&t!=t}function o(e,t){for(var r=0,i="_"+t,o=i;n.call(e,o);o=i+r++)if(s(e[o].key,t))return e[o]}t.exports=i,i.prototype.forEach=function(e,t){t=t||this,Object.keys(this._data).forEach(function(r){"size"!==r&&e.call(t,this._data[r].value,this._data[r].key)},this)},i.prototype.has=function(e){return!!o(this._data,e)},i.prototype.get=function(e){var t=o(this._data,e);return t&&t.value},i.prototype.set=function(e,t){!function(e,t,r){for(var i=0,o="_"+t,a=o;n.call(e,a);a=o+i++)if(s(e[a].key,t))return void(e[a].value=r);e.size++,e[a]=new function(e,t,r){this.key=e,this.value=t,this._index=r}(t,r,a)}(this._data,e,t)},i.prototype.delete=function(e){var t=o(this._data,e);t&&(delete this._data[t._index],this._data.size--)},i.prototype.clear=function(){var e=Object.create(null);e.size=0,Object.defineProperty(this,"_data",{value:e,enumerable:!1,configurable:!0,writable:!1})},Object.defineProperty(i.prototype,"size",{get:function(){return this._data.size},set:function(e){},enumerable:!0,configurable:!0}),i.prototype.values=i.prototype.keys=i.prototype.entries=function(){throw new Error("iterators are not implemented in this version")}},{}],440:[function(e,t,r){(function(r){var n=e("once"),i=e("end-of-stream"),s=e("fs"),o=function(){},a=/^v?\.0/.test(r.version),u=function(e){return"function"==typeof e},l=function(e,t,r,l){l=n(l);var c=!1;e.on("close",function(){c=!0}),i(e,{readable:t,writable:r},function(e){if(e)return l(e);c=!0,l()});var h=!1;return function(t){if(!c&&!h)return h=!0,function(e){return!!a&&!!s&&(e instanceof(s.ReadStream||o)||e instanceof(s.WriteStream||o))&&u(e.close)}(e)?e.close(o):function(e){return e.setHeader&&u(e.abort)}(e)?e.abort():u(e.destroy)?e.destroy():void l(t||new Error("stream was destroyed"))}},c=function(e){e()},h=function(e,t){return e.pipe(t)};t.exports=function(){var e,t=Array.prototype.slice.call(arguments),r=u(t[t.length-1]||o)&&t.pop()||o;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var n=t.map(function(i,s){var o=s<t.length-1;return l(i,o,s>0,function(t){e||(e=t),t&&n.forEach(c),o||(n.forEach(c),r(e))})});return t.reduce(h)}}).call(this,e("_process"))},{_process:437,"end-of-stream":56,fs:35,once:399}],441:[function(e,t,r){(function(e){!function(n){var i="object"==typeof r&&r&&!r.nodeType&&r,s="object"==typeof t&&t&&!t.nodeType&&t,o="object"==typeof e&&e;o.global!==o&&o.window!==o&&o.self!==o||(n=o);var a,u,l=2147483647,c=36,h=1,p=26,f=38,d=700,m=72,g=128,v="-",y=/^xn--/,_=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-h,E=Math.floor,T=String.fromCharCode;function A(e){throw new RangeError(x[e])}function S(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function k(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+S((e=e.replace(b,".")).split("."),t).join(".")}function C(e){for(var t,r,n=[],i=0,s=e.length;i<s;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<s?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function I(e){return S(e,function(e){var t="";return e>65535&&(t+=T((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=T(e)}).join("")}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function L(e,t,r){var n=0;for(e=r?E(e/d):e>>1,e+=E(e/t);e>w*p>>1;n+=c)e=E(e/w);return E(n+(w+1)*e/(e+f))}function O(e){var t,r,n,i,s,o,a,u,f,d,y,_=[],b=e.length,x=0,w=g,T=m;for((r=e.lastIndexOf(v))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&A("not-basic"),_.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<b;){for(s=x,o=1,a=c;i>=b&&A("invalid-input"),((u=(y=e.charCodeAt(i++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:c)>=c||u>E((l-x)/o))&&A("overflow"),x+=u*o,!(u<(f=a<=T?h:a>=T+p?p:a-T));a+=c)o>E(l/(d=c-f))&&A("overflow"),o*=d;T=L(x-s,t=_.length+1,0==s),E(x/t)>l-w&&A("overflow"),w+=E(x/t),x%=t,_.splice(x++,0,w)}return I(_)}function M(e){var t,r,n,i,s,o,a,u,f,d,y,_,b,x,w,S=[];for(_=(e=C(e)).length,t=g,r=0,s=m,o=0;o<_;++o)(y=e[o])<128&&S.push(T(y));for(n=i=S.length,i&&S.push(v);n<_;){for(a=l,o=0;o<_;++o)(y=e[o])>=t&&y<a&&(a=y);for(a-t>E((l-r)/(b=n+1))&&A("overflow"),r+=(a-t)*b,t=a,o=0;o<_;++o)if((y=e[o])<t&&++r>l&&A("overflow"),y==t){for(u=r,f=c;!(u<(d=f<=s?h:f>=s+p?p:f-s));f+=c)w=u-d,x=c-d,S.push(T(R(d+w%x,0))),u=E(w/x);S.push(T(R(u,0))),s=L(r,b,n==i),r=0,++n}++r,++t}return S.join("")}if(a={version:"1.4.1",ucs2:{decode:C,encode:I},decode:O,encode:M,toASCII:function(e){return k(e,function(e){return _.test(e)?"xn--"+M(e):e})},toUnicode:function(e){return k(e,function(e){return y.test(e)?O(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return a});else if(i&&s)if(t.exports==i)s.exports=a;else for(u in a)a.hasOwnProperty(u)&&(i[u]=a[u]);else n.punycode=a}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],442:[function(e,t,r){const n=e("./can-promise"),i=e("./core/qrcode"),s=e("./renderer/canvas"),o=e("./renderer/svg-tag.js");function a(e,t,r,s,o){const a=[].slice.call(arguments,1),u=a.length,l="function"==typeof a[u-1];if(!l&&!n())throw new Error("Callback required as last argument");if(!l){if(u<1)throw new Error("Too few arguments provided");return 1===u?(r=t,t=s=void 0):2!==u||t.getContext||(s=r,r=t,t=void 0),new Promise(function(n,o){try{const a=i.create(r,s);n(e(a,t,s))}catch(e){o(e)}})}if(u<2)throw new Error("Too few arguments provided");2===u?(o=r,r=t,t=s=void 0):3===u&&(t.getContext&&void 0===o?(o=s,s=void 0):(o=s,s=r,r=t,t=void 0));try{const n=i.create(r,s);o(null,e(n,t,s))}catch(e){o(e)}}r.create=i.create,r.toCanvas=a.bind(null,s.render),r.toDataURL=a.bind(null,s.renderToDataURL),r.toString=a.bind(null,function(e,t,r){return o.render(e,r)})},{"./can-promise":443,"./core/qrcode":459,"./renderer/canvas":466,"./renderer/svg-tag.js":467}],443:[function(e,t,r){t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},{}],444:[function(e,t,r){const n=e("./utils").getSymbolSize;r.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=n(e),i=145===r?26:2*Math.ceil((r-13)/(2*t-2)),s=[r-7];for(let e=1;e<t-1;e++)s[e]=s[e-1]-i;return s.push(6),s.reverse()},r.getPositions=function(e){const t=[],n=r.getRowColCoords(e),i=n.length;for(let e=0;e<i;e++)for(let r=0;r<i;r++)0===e&&0===r||0===e&&r===i-1||e===i-1&&0===r||t.push([n[e],n[r]]);return t}},{"./utils":463}],445:[function(e,t,r){const n=e("./mode"),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function s(e){this.mode=n.ALPHANUMERIC,this.data=e}s.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*i.indexOf(this.data[t]);r+=i.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(i.indexOf(this.data[t]),6)},t.exports=s},{"./mode":456}],446:[function(e,t,r){function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n},{}],447:[function(e,t,r){function n(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,r,n){const i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n},{}],448:[function(e,t,r){const n=e("encode-utf8"),i=e("./mode");function s(e){this.mode=i.BYTE,this.data=new Uint8Array(n(e))}s.getBitsLength=function(e){return 8*e},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},t.exports=s},{"./mode":456,"encode-utf8":55}],449:[function(e,t,r){const n=e("./error-correction-level"),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],s=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];r.getBlocksCount=function(e,t){switch(t){case n.L:return i[4*(e-1)+0];case n.M:return i[4*(e-1)+1];case n.Q:return i[4*(e-1)+2];case n.H:return i[4*(e-1)+3];default:return}},r.getTotalCodewordsCount=function(e,t){switch(t){case n.L:return s[4*(e-1)+0];case n.M:return s[4*(e-1)+1];case n.Q:return s[4*(e-1)+2];case n.H:return s[4*(e-1)+3];default:return}}},{"./error-correction-level":450}],450:[function(e,t,r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2},r.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},r.from=function(e,t){if(r.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return t}}},{}],451:[function(e,t,r){const n=e("./utils").getSymbolSize;r.getPositions=function(e){const t=n(e);return[[0,0],[t-7,0],[0,t-7]]}},{"./utils":463}],452:[function(e,t,r){const n=e("./utils"),i=n.getBCHDigit(1335);r.getEncodedBits=function(e,t){const r=e.bit<<3|t;let s=r<<10;for(;n.getBCHDigit(s)-i>=0;)s^=1335<<n.getBCHDigit(s)-i;return 21522^(r<<10|s)}},{"./utils":463}],453:[function(e,t,r){const n=new Uint8Array(512),i=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)n[t]=e,i[e]=t,256&(e<<=1)&&(e^=285);for(let e=255;e<512;e++)n[e]=n[e-255]}(),r.log=function(e){if(e<1)throw new Error("log("+e+")");return i[e]},r.exp=function(e){return n[e]},r.mul=function(e,t){return 0===e||0===t?0:n[i[e]+i[t]]}},{}],454:[function(e,t,r){const n=e("./mode"),i=e("./utils");function s(e){this.mode=n.KANJI,this.data=e}s.getBitsLength=function(e){return 13*e},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=i.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},t.exports=s},{"./mode":456,"./utils":463}],455:[function(e,t,r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const n=3,i=3,s=40,o=10;function a(e,t,n){switch(e){case r.Patterns.PATTERN000:return(t+n)%2==0;case r.Patterns.PATTERN001:return t%2==0;case r.Patterns.PATTERN010:return n%3==0;case r.Patterns.PATTERN011:return(t+n)%3==0;case r.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case r.Patterns.PATTERN101:return t*n%2+t*n%3==0;case r.Patterns.PATTERN110:return(t*n%2+t*n%3)%2==0;case r.Patterns.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}r.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},r.from=function(e){return r.isValid(e)?parseInt(e,10):void 0},r.getPenaltyN1=function(e){const t=e.size;let r=0,i=0,s=0,o=null,a=null;for(let u=0;u<t;u++){i=s=0,o=a=null;for(let l=0;l<t;l++){let t=e.get(u,l);t===o?i++:(i>=5&&(r+=n+(i-5)),o=t,i=1),(t=e.get(l,u))===a?s++:(s>=5&&(r+=n+(s-5)),a=t,s=1)}i>=5&&(r+=n+(i-5)),s>=5&&(r+=n+(s-5))}return r},r.getPenaltyN2=function(e){const t=e.size;let r=0;for(let n=0;n<t-1;n++)for(let i=0;i<t-1;i++){const t=e.get(n,i)+e.get(n,i+1)+e.get(n+1,i)+e.get(n+1,i+1);4!==t&&0!==t||r++}return r*i},r.getPenaltyN3=function(e){const t=e.size;let r=0,n=0,i=0;for(let s=0;s<t;s++){n=i=0;for(let o=0;o<t;o++)n=n<<1&2047|e.get(s,o),o>=10&&(1488===n||93===n)&&r++,i=i<<1&2047|e.get(o,s),o>=10&&(1488===i||93===i)&&r++}return r*s},r.getPenaltyN4=function(e){let t=0;const r=e.data.length;for(let n=0;n<r;n++)t+=e.data[n];return Math.abs(Math.ceil(100*t/r/5)-10)*o},r.applyMask=function(e,t){const r=t.size;for(let n=0;n<r;n++)for(let i=0;i<r;i++)t.isReserved(i,n)||t.xor(i,n,a(e,i,n))},r.getBestMask=function(e,t){const n=Object.keys(r.Patterns).length;let i=0,s=1/0;for(let o=0;o<n;o++){t(o),r.applyMask(o,e);const n=r.getPenaltyN1(e)+r.getPenaltyN2(e)+r.getPenaltyN3(e)+r.getPenaltyN4(e);r.applyMask(o,e),n<s&&(s=n,i=o)}return i}},{}],456:[function(e,t,r){const n=e("./version-check"),i=e("./regex");r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!n.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},r.getBestModeForData=function(e){return i.testNumeric(e)?r.NUMERIC:i.testAlphanumeric(e)?r.ALPHANUMERIC:i.testKanji(e)?r.KANJI:r.BYTE},r.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},r.isValid=function(e){return e&&e.bit&&e.ccBits},r.from=function(e,t){if(r.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return t}}},{"./regex":461,"./version-check":464}],457:[function(e,t,r){const n=e("./mode");function i(e){this.mode=n.NUMERIC,this.data=e.toString()}i.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),n=parseInt(r,10),e.put(n,10);const i=this.data.length-t;i>0&&(r=this.data.substr(t),n=parseInt(r,10),e.put(n,3*i+1))},t.exports=i},{"./mode":456}],458:[function(e,t,r){const n=e("./galois-field");r.mul=function(e,t){const r=new Uint8Array(e.length+t.length-1);for(let i=0;i<e.length;i++)for(let s=0;s<t.length;s++)r[i+s]^=n.mul(e[i],t[s]);return r},r.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){const e=r[0];for(let i=0;i<t.length;i++)r[i]^=n.mul(t[i],e);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},r.generateECPolynomial=function(e){let t=new Uint8Array([1]);for(let i=0;i<e;i++)t=r.mul(t,new Uint8Array([1,n.exp(i)]));return t}},{"./galois-field":453}],459:[function(e,t,r){const n=e("./utils"),i=e("./error-correction-level"),s=e("./bit-buffer"),o=e("./bit-matrix"),a=e("./alignment-pattern"),u=e("./finder-pattern"),l=e("./mask-pattern"),c=e("./error-correction-code"),h=e("./reed-solomon-encoder"),p=e("./version"),f=e("./format-info"),d=e("./mode"),m=e("./segments");function g(e,t,r){const n=e.size,i=f.getEncodedBits(t,r);let s,o;for(s=0;s<15;s++)o=1==(i>>s&1),s<6?e.set(s,8,o,!0):s<8?e.set(s+1,8,o,!0):e.set(n-15+s,8,o,!0),s<8?e.set(8,n-s-1,o,!0):s<9?e.set(8,15-s-1+1,o,!0):e.set(8,15-s-1,o,!0);e.set(n-8,8,1,!0)}function v(e,t,r){const i=new s;r.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),d.getCharCountIndicator(t.mode,e)),t.write(i)});const o=8*(n.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,t));for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const a=(o-i.getLengthInBits())/8;for(let e=0;e<a;e++)i.put(e%2?17:236,8);return function(e,t,r){const i=n.getSymbolTotalCodewords(t),s=c.getTotalCodewordsCount(t,r),o=i-s,a=c.getBlocksCount(t,r),u=a-i%a,l=Math.floor(i/a),p=Math.floor(o/a),f=p+1,d=l-p,m=new h(d);let g=0;const v=new Array(a),y=new Array(a);let _=0;const b=new Uint8Array(e.buffer);for(let e=0;e<a;e++){const t=e<u?p:f;v[e]=b.slice(g,g+t),y[e]=m.encode(v[e]),g+=t,_=Math.max(_,t)}const x=new Uint8Array(i);let w,E,T=0;for(w=0;w<_;w++)for(E=0;E<a;E++)w<v[E].length&&(x[T++]=v[E][w]);for(w=0;w<d;w++)for(E=0;E<a;E++)x[T++]=y[E][w];return x}(i,e,t)}function y(e,t,r,i){let s;if(Array.isArray(e))s=m.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=m.rawSplit(e);n=p.getBestVersionForData(t,r)}s=m.fromString(e,n||40)}}const c=p.getBestVersionForData(s,r);if(!c)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<c)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+c+".\n")}else t=c;const h=v(t,r,s),f=n.getSymbolSize(t),d=new o(f);return function(e,t){const r=e.size,n=u.getPositions(t);for(let t=0;t<n.length;t++){const i=n[t][0],s=n[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||r<=i+t))for(let n=-1;n<=7;n++)s+n<=-1||r<=s+n||(t>=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(i+t,s+n,!0,!0):e.set(i+t,s+n,!1,!0))}}(d,t),function(e){const t=e.size;for(let r=8;r<t-8;r++){const t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}(d),function(e,t){const r=a.getPositions(t);for(let t=0;t<r.length;t++){const n=r[t][0],i=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(n+t,i+r,!0,!0):e.set(n+t,i+r,!1,!0)}}(d,t),g(d,r,0),t>=7&&function(e,t){const r=e.size,n=p.getEncodedBits(t);let i,s,o;for(let t=0;t<18;t++)i=Math.floor(t/3),s=t%3+r-8-3,o=1==(n>>t&1),e.set(i,s,o,!0),e.set(s,i,o,!0)}(d,t),function(e,t){const r=e.size;let n=-1,i=r-1,s=7,o=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,a-r)){let n=!1;o<t.length&&(n=1==(t[o]>>>s&1)),e.set(i,a-r,n),-1==--s&&(o++,s=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(d,h),isNaN(i)&&(i=l.getBestMask(d,g.bind(null,d,r))),l.applyMask(i,d),g(d,r,i),{modules:d,version:t,errorCorrectionLevel:r,maskPattern:i,segments:s}}r.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let r,s,o=i.M;return void 0!==t&&(o=i.from(t.errorCorrectionLevel,i.M),r=p.from(t.version),s=l.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),y(e,r,o,s)}},{"./alignment-pattern":444,"./bit-buffer":446,"./bit-matrix":447,"./error-correction-code":449,"./error-correction-level":450,"./finder-pattern":451,"./format-info":452,"./mask-pattern":455,"./mode":456,"./reed-solomon-encoder":460,"./segments":462,"./utils":463,"./version":465}],460:[function(e,t,r){const n=e("./polynomial");function i(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},i.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){const e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=i},{"./polynomial":458}],461:[function(e,t,r){let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";const i="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";r.KANJI=new RegExp(n,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=new RegExp(i,"g"),r.NUMERIC=new RegExp("[0-9]+","g"),r.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const s=new RegExp("^"+n+"$"),o=new RegExp("^[0-9]+$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(e){return s.test(e)},r.testNumeric=function(e){return o.test(e)},r.testAlphanumeric=function(e){return a.test(e)}},{}],462:[function(e,t,r){const n=e("./mode"),i=e("./numeric-data"),s=e("./alphanumeric-data"),o=e("./byte-data"),a=e("./kanji-data"),u=e("./regex"),l=e("./utils"),c=e("dijkstrajs");function h(e){return unescape(encodeURIComponent(e)).length}function p(e,t,r){const n=[];let i;for(;null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function f(e){const t=p(u.NUMERIC,n.NUMERIC,e),r=p(u.ALPHANUMERIC,n.ALPHANUMERIC,e);let i,s;return l.isKanjiModeEnabled()?(i=p(u.BYTE,n.BYTE,e),s=p(u.KANJI,n.KANJI,e)):(i=p(u.BYTE_KANJI,n.BYTE,e),s=[]),t.concat(r,i,s).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function d(e,t){switch(t){case n.NUMERIC:return i.getBitsLength(e);case n.ALPHANUMERIC:return s.getBitsLength(e);case n.KANJI:return a.getBitsLength(e);case n.BYTE:return o.getBitsLength(e)}}function m(e,t){let r;const u=n.getBestModeForData(e);if((r=n.from(t,u))!==n.BYTE&&r.bit<u.bit)throw new Error('"'+e+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(u));switch(r!==n.KANJI||l.isKanjiModeEnabled()||(r=n.BYTE),r){case n.NUMERIC:return new i(e);case n.ALPHANUMERIC:return new s(e);case n.KANJI:return new a(e);case n.BYTE:return new o(e)}}r.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(m(t,null)):t.data&&e.push(m(t.data,t.mode)),e},[])},r.fromString=function(e,t){const i=function(e,t){const r={},i={start:{}};let s=["start"];for(let o=0;o<e.length;o++){const a=e[o],u=[];for(let e=0;e<a.length;e++){const l=a[e],c=""+o+e;u.push(c),r[c]={node:l,lastCount:0},i[c]={};for(let e=0;e<s.length;e++){const o=s[e];r[o]&&r[o].node.mode===l.mode?(i[o][c]=d(r[o].lastCount+l.length,l.mode)-d(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][c]=d(l.length,l.mode)+4+n.getCharCountIndicator(l.mode,t))}}s=u}for(let e=0;e<s.length;e++)i[s[e]].end=0;return{map:i,table:r}}(function(e){const t=[];for(let r=0;r<e.length;r++){const i=e[r];switch(i.mode){case n.NUMERIC:t.push([i,{data:i.data,mode:n.ALPHANUMERIC,length:i.length},{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.ALPHANUMERIC:t.push([i,{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.KANJI:t.push([i,{data:i.data,mode:n.BYTE,length:h(i.data)}]);break;case n.BYTE:t.push([{data:i.data,mode:n.BYTE,length:h(i.data)}])}}return t}(f(e,l.isKanjiModeEnabled())),t),s=c.find_path(i.map,"start","end"),o=[];for(let e=1;e<s.length-1;e++)o.push(i.table[s[e]].node);return r.fromArray(function(e){return e.reduce(function(e,t){const r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}(o))},r.rawSplit=function(e){return r.fromArray(f(e,l.isKanjiModeEnabled()))}},{"./alphanumeric-data":445,"./byte-data":448,"./kanji-data":454,"./mode":456,"./numeric-data":457,"./regex":461,"./utils":463,dijkstrajs:52}],463:[function(e,t,r){let n;const i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},r.getSymbolTotalCodewords=function(e){return i[e]},r.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},r.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');n=e},r.isKanjiModeEnabled=function(){return void 0!==n},r.toSJIS=function(e){return n(e)}},{}],464:[function(e,t,r){r.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},{}],465:[function(e,t,r){const n=e("./utils"),i=e("./error-correction-code"),s=e("./error-correction-level"),o=e("./mode"),a=e("./version-check"),u=n.getBCHDigit(7973);function l(e,t){return o.getCharCountIndicator(e,t)+4}function c(e,t){let r=0;return e.forEach(function(e){const n=l(e.mode,t);r+=n+e.getBitsLength()}),r}r.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},r.getCapacity=function(e,t,r){if(!a.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=o.BYTE);const s=8*(n.getSymbolTotalCodewords(e)-i.getTotalCodewordsCount(e,t));if(r===o.MIXED)return s;const u=s-l(r,e);switch(r){case o.NUMERIC:return Math.floor(u/10*3);case o.ALPHANUMERIC:return Math.floor(u/11*2);case o.KANJI:return Math.floor(u/13);case o.BYTE:default:return Math.floor(u/8)}},r.getBestVersionForData=function(e,t){let n;const i=s.from(t,s.M);if(Array.isArray(e)){if(e.length>1)return function(e,t){for(let n=1;n<=40;n++)if(c(e,n)<=r.getCapacity(n,t,o.MIXED))return n}(e,i);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,t,n){for(let i=1;i<=40;i++)if(t<=r.getCapacity(i,n,e))return i}(n.mode,n.getLength(),i)},r.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;n.getBCHDigit(t)-u>=0;)t^=7973<<n.getBCHDigit(t)-u;return e<<12|t}},{"./error-correction-code":449,"./error-correction-level":450,"./mode":456,"./utils":463,"./version-check":464}],466:[function(e,t,r){const n=e("./utils");r.render=function(e,t,r){let i=r,s=t;void 0!==i||t&&t.getContext||(i=t,t=void 0),t||(s=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),i=n.getOptions(i);const o=n.getImageWidth(e.modules.size,i),a=s.getContext("2d"),u=a.createImageData(o,o);return n.qrToImageData(u.data,e,i),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(a,s,o),a.putImageData(u,0,0),s},r.renderToDataURL=function(e,t,n){let i=n;void 0!==i||t&&t.getContext||(i=t,t=void 0),i||(i={});const s=r.render(e,t,i),o=i.type||"image/png",a=i.rendererOpts||{};return s.toDataURL(o,a.quality)}},{"./utils":468}],467:[function(e,t,r){const n=e("./utils");function i(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function s(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}r.render=function(e,t,r){const o=n.getOptions(t),a=e.modules.size,u=e.modules.data,l=a+2*o.margin,c=o.color.light.a?"<path "+i(o.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",h="<path "+i(o.color.dark,"stroke")+' d="'+function(e,t,r){let n="",i=0,o=!1,a=0;for(let u=0;u<e.length;u++){const l=Math.floor(u%t),c=Math.floor(u/t);l||o||(o=!0),e[u]?(a++,u>0&&l>0&&e[u-1]||(n+=o?s("M",l+r,.5+c+r):s("m",i,0),i=0,o=!1),l+1<t&&e[u+1]||(n+=s("h",a),a=0)):i++}return n}(u,a,o.margin)+'"/>',p='viewBox="0 0 '+l+" "+l+'"',f='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+p+' shape-rendering="crispEdges">'+c+h+"</svg>\n";return"function"==typeof r&&r(null,f),f}},{"./utils":468}],468:[function(e,t,r){function n(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");const r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}r.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:t,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},r.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},r.getImageWidth=function(e,t){const n=r.getScale(e,t);return Math.floor((e+2*t.margin)*n)},r.qrToImageData=function(e,t,n){const i=t.modules.size,s=t.modules.data,o=r.getScale(i,n),a=Math.floor((i+2*n.margin)*o),u=n.margin*o,l=[n.color.light,n.color.dark];for(let t=0;t<a;t++)for(let r=0;r<a;r++){let c=4*(t*a+r),h=n.color.light;if(t>=u&&r>=u&&t<a-u&&r<a-u){h=l[s[Math.floor((t-u)/o)*i+Math.floor((r-u)/o)]?1:0]}e[c++]=h.r,e[c++]=h.g,e[c++]=h.b,e[c]=h.a}}},{}],469:[function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,s){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(t);var u=1e3;s&&"number"==typeof s.maxKeys&&(u=s.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var c=0;c<l;++c){var h,p,f,d,m=e[c].replace(a,"%20"),g=m.indexOf(r);g>=0?(h=m.substr(0,g),p=m.substr(g+1)):(h=m,p=""),f=decodeURIComponent(h),d=decodeURIComponent(p),n(o,f)?i(o[f])?o[f].push(d):o[f]=[o[f],d]:o[f]=d}return o};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],470:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,a){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?s(o(e),function(o){var a=encodeURIComponent(n(o))+r;return i(e[o])?s(e[o],function(e){return a+encodeURIComponent(n(e))}).join(t):a+encodeURIComponent(n(e[o]))}).join(t):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function s(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var o=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},{}],471:[function(e,t,r){"use strict";r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":469,"./encode":470}],472:[function(e,t,r){t.exports=e("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":473}],473:[function(e,t,r){"use strict";var n=e("process-nextick-args"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=h;var s=e("core-util-is");s.inherits=e("inherits");var o=e("./_stream_readable"),a=e("./_stream_writable");s.inherits(h,o);for(var u=i(a.prototype),l=0;l<u.length;l++){var c=u[l];h.prototype[c]||(h.prototype[c]=a.prototype[c])}function h(e){if(!(this instanceof h))return new h(e);o.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",p)}function p(){this.allowHalfOpen||this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),h.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},{"./_stream_readable":475,"./_stream_writable":477,"core-util-is":47,inherits:359,"process-nextick-args":482}],474:[function(e,t,r){"use strict";t.exports=s;var n=e("./_stream_transform"),i=e("core-util-is");function s(e){if(!(this instanceof s))return new s(e);n.call(this,e)}i.inherits=e("inherits"),i.inherits(s,n),s.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":476,"core-util-is":47,inherits:359}],475:[function(e,t,r){(function(r,n){"use strict";var i=e("process-nextick-args");t.exports=_;var s,o=e("isarray");_.ReadableState=y;e("events").EventEmitter;var a=function(e,t){return e.listeners(t).length},u=e("./internal/streams/stream"),l=e("safe-buffer").Buffer,c=n.Uint8Array||function(){};var h=e("core-util-is");h.inherits=e("inherits");var p=e("util"),f=void 0;f=p&&p.debuglog?p.debuglog("stream"):function(){};var d,m=e("./internal/streams/BufferList"),g=e("./internal/streams/destroy");h.inherits(_,u);var v=["error","close","destroy","pause","resume"];function y(t,r){s=s||e("./_stream_duplex"),t=t||{};var n=r instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=e("string_decoder/").StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function _(t){if(s=s||e("./_stream_duplex"),!(this instanceof _))return new _(t);this._readableState=new y(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function b(e,t,r,n,i){var s,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,T(e)}(e,o)):(i||(s=function(e,t){var r;n=t,l.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(o,t)),s?e.emit("error",s):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?x(e,o,t,!1):S(e,o)):x(e,o,t,!1))):n||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function x(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),S(e,t)}Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=g.destroy,_.prototype._undestroy=g.undestroy,_.prototype._destroy=function(e,t){this.push(null),t(e)},_.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=l.from(e,t),t=""),r=!0),b(this,e,t,!1,r)},_.prototype.unshift=function(e){return b(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(t){return d||(d=e("string_decoder/").StringDecoder),this._readableState.decoder=new d(t),this._readableState.encoding=t,this};var w=8388608;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=w?e=w:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(f("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){f("emit readable"),e.emit("readable"),R(e)}function S(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(f("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function C(e){f("readable nexttick read 0"),e.read(0)}function I(e,t){t.reading||(f("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(f("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var s=r.data,o=e>s.length?s.length:e;if(o===s.length?i+=s:i+=s.slice(0,e),0===(e-=o)){o===s.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=s.slice(o));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=l.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var s=n.data,o=e>s.length?s.length:e;if(s.copy(r,r.length-e,0,o),0===(e-=o)){o===s.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=s.slice(o));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}_.prototype.read=function(e){f("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return f("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):T(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&O(this),null;var n,i=t.needReadable;return f("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&f("length less than watermark",i=!0),t.ended||t.reading?f("reading or ended",i=!1):i&&(f("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?L(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&O(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,t){var n=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=e;break;case 1:s.pipes=[s.pipes,e];break;default:s.pipes.push(e)}s.pipesCount+=1,f("pipe count=%d opts=%j",s.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:_;function l(t,r){f("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),e.removeListener("close",v),e.removeListener("finish",y),e.removeListener("drain",h),e.removeListener("error",g),e.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",_),n.removeListener("data",m),p=!0,!s.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function c(){f("onend"),e.end()}s.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",l);var h=function(e){return function(){var t=e._readableState;f("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,R(e))}}(n);e.on("drain",h);var p=!1;var d=!1;function m(t){f("ondata"),d=!1,!1!==e.write(t)||d||((1===s.pipesCount&&s.pipes===e||s.pipesCount>1&&-1!==P(s.pipes,e))&&!p&&(f("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function g(t){f("onerror",t),_(),e.removeListener("error",g),0===a(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",y),_()}function y(){f("onfinish"),e.removeListener("close",v),_()}function _(){f("unpipe"),n.unpipe(e)}return n.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",g),e.once("close",v),e.once("finish",y),e.emit("pipe",n),s.flowing||(f("pipe resume"),n.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,r);return this}var o=P(t.pipes,e);return-1===o?this:(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)},_.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&T(this):i.nextTick(C,this))}return r},_.prototype.addListener=_.prototype.on,_.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(I,e,t))}(this,e)),this},_.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this},_.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(f("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){(f("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause())))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<v.length;s++)e.on(v[s],this.emit.bind(this,v[s]));return this._read=function(t){f("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),_._fromList=L}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":473,"./internal/streams/BufferList":478,"./internal/streams/destroy":479,"./internal/streams/stream":480,_process:437,"core-util-is":47,events:300,inherits:359,isarray:481,"process-nextick-args":482,"safe-buffer":495,"string_decoder/":483,util:35}],476:[function(e,t,r){"use strict";t.exports=s;var n=e("./_stream_duplex"),i=e("core-util-is");function s(e){if(!(this instanceof s))return new s(e);n.call(this,e),this._transformState={afterTransform:function(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){a(e,t,r)}):a(this,null,null)}function a(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=e("inherits"),i.inherits(s,n),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},s.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},s.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},s.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},{"./_stream_duplex":473,"core-util-is":47,inherits:359}],477:[function(e,t,r){(function(r,n,i){"use strict";var s=e("process-nextick-args");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}t.exports=y;var a,u=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:s.nextTick;y.WritableState=v;var l=e("core-util-is");l.inherits=e("inherits");var c={deprecate:e("util-deprecate")},h=e("./internal/streams/stream"),p=e("safe-buffer").Buffer,f=n.Uint8Array||function(){};var d,m=e("./internal/streams/destroy");function g(){}function v(t,r){a=a||e("./_stream_duplex"),t=t||{};var n=r instanceof a;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,l=t.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(s.nextTick(i,n),s.nextTick(T,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),T(e,t))}(e,r,n,t,i);else{var o=w(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),n?u(b,e,r,o,i):b(e,r,o,i)}}(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(t){if(a=a||e("./_stream_duplex"),!(d.call(y,this)||this instanceof a))return new y(t);this._writableState=new v(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),h.call(this)}function _(e,t,r,n,i,s,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function b(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),T(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,_(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,h=r.callback;if(_(e,t,!1,t.objectMode?1:l.length,l,c,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function w(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}function T(e,t){var r=w(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,s.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}l.inherits(y,h),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===y&&(e&&e._writableState instanceof v)}})):d=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,a=!i.objectMode&&(n=e,p.isBuffer(n)||n instanceof f);return a&&!p.isBuffer(e)&&(e=function(e){return p.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=g),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),s.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),s.nextTick(n,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,s){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=p.from(t,r));return t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _(e,t,!1,a,n,i,s);return u}(this,i,a,e,t,r)),o},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||x(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,T(e,t),r&&(t.finished?s.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{"./_stream_duplex":473,"./internal/streams/destroy":479,"./internal/streams/stream":480,_process:437,"core-util-is":47,inherits:359,"process-nextick-args":482,"safe-buffer":495,timers:514,"util-deprecate":521}],478:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=e("util");t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,s=n.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=s,i=a,t.copy(r,i),a+=o.data.length,o=o.next;return s},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":495,util:35}],479:[function(e,t,r){"use strict";var n=e("process-nextick-args");function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return s||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":482}],480:[function(e,t,r){t.exports=e("events").EventEmitter},{events:300}],481:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],482:[function(e,t,r){(function(e){"use strict";!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var s,o,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,r)});case 3:return e.nextTick(function(){t.call(null,r,n)});case 4:return e.nextTick(function(){t.call(null,r,n,i)});default:for(s=new Array(a-1),o=0;o<s.length;)s[o++]=arguments[o];return e.nextTick(function(){t.apply(null,s)})}}}:t.exports=e}).call(this,e("_process"))},{_process:437}],483:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:return this.write=p,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"<22>";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"<22>";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"<22>"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}r.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>":t},s.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=o(t[n]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=o(t[n]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":495}],484:[function(e,t,r){t.exports=e("./readable").PassThrough},{"./readable":485}],485:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":473,"./lib/_stream_passthrough.js":474,"./lib/_stream_readable.js":475,"./lib/_stream_transform.js":476,"./lib/_stream_writable.js":477}],486:[function(e,t,r){t.exports=e("./readable").Transform},{"./readable":485}],487:[function(e,t,r){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":477}],488:[function(e,t,r){"use strict";var n=e("path");t.exports=function(e,t){if("string"!=typeof e)return e;if(0===e.length)return e;var r=n.basename(e,n.extname(e))+t;return n.join(n.dirname(e),r)}},{path:404}],489:[function(e,t,r){"use strict";t.exports=function(e){var t=new e,r=t;return{get:function(){var n=t;return n.next?t=n.next:(t=new e,r=t),n.next=null,n},release:function(e){r.next=e,r=e}}}},{}],490:[function(e,t,r){arguments[4][171][0].apply(r,arguments)},{_process:437,dup:171,minimatch:385,path:404,"path-is-absolute":405}],491:[function(e,t,r){arguments[4][172][0].apply(r,arguments)},{"./common.js":490,"./sync.js":492,_process:437,assert:292,dup:172,events:300,fs:298,"fs.realpath":121,inflight:358,inherits:359,minimatch:385,once:399,path:404,"path-is-absolute":405,util:523}],492:[function(e,t,r){arguments[4][173][0].apply(r,arguments)},{"./common.js":490,"./glob.js":491,_process:437,assert:292,dup:173,fs:298,"fs.realpath":121,minimatch:385,path:404,"path-is-absolute":405,util:523}],493:[function(e,t,r){(function(r){t.exports=p,p.sync=v;var n=e("assert"),i=e("path"),s=e("fs"),o=e("glob"),a=parseInt("666",8),u={nosort:!0,silent:!0},l=0,c="win32"===r.platform;function h(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(function(t){e[t]=e[t]||s[t],e[t+="Sync"]=e[t]||s[t]}),e.maxBusyTries=e.maxBusyTries||3,e.emfileWait=e.emfileWait||1e3,!1===e.glob&&(e.disableGlob=!0),e.disableGlob=e.disableGlob||!1,e.glob=e.glob||u}function p(e,t,r){"function"==typeof t&&(r=t,t={}),n(e,"rimraf: missing path"),n.equal(typeof e,"string","rimraf: path should be a string"),n.equal(typeof r,"function","rimraf: callback function required"),n(t,"rimraf: invalid options argument provided"),n.equal(typeof t,"object","rimraf: options should be object"),h(t);var i=0,s=null,a=0;if(t.disableGlob||!o.hasMagic(e))return u(null,[e]);function u(e,n){return e?r(e):0===(a=n.length)?r():void n.forEach(function(e){f(e,t,function n(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&i<t.maxBusyTries)return i++,setTimeout(function(){f(e,t,n)},100*i);if("EMFILE"===o.code&&l<t.emfileWait)return setTimeout(function(){f(e,t,n)},l++);"ENOENT"===o.code&&(o=null)}l=0,function(e){s=s||e,0==--a&&r(s)}(o)})})}t.lstat(e,function(r,n){if(!r)return u(null,[e]);o(e,t.glob,u)})}function f(e,t,r){n(e),n(t),n("function"==typeof r),t.lstat(e,function(n,i){return n&&"ENOENT"===n.code?r(null):(n&&"EPERM"===n.code&&c&&d(e,t,n,r),i&&i.isDirectory()?g(e,t,n,r):void t.unlink(e,function(n){if(n){if("ENOENT"===n.code)return r(null);if("EPERM"===n.code)return c?d(e,t,n,r):g(e,t,n,r);if("EISDIR"===n.code)return g(e,t,n,r)}return r(n)}))})}function d(e,t,r,i){n(e),n(t),n("function"==typeof i),r&&n(r instanceof Error),t.chmod(e,a,function(n){n?i("ENOENT"===n.code?null:r):t.stat(e,function(n,s){n?i("ENOENT"===n.code?null:r):s.isDirectory()?g(e,t,r,i):t.unlink(e,i)})})}function m(e,t,r){n(e),n(t),r&&n(r instanceof Error);try{t.chmodSync(e,a)}catch(e){if("ENOENT"===e.code)return;throw r}try{var i=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw r}i.isDirectory()?y(e,t,r):t.unlinkSync(e)}function g(e,t,r,s){n(e),n(t),r&&n(r instanceof Error),n("function"==typeof s),t.rmdir(e,function(o){!o||"ENOTEMPTY"!==o.code&&"EEXIST"!==o.code&&"EPERM"!==o.code?o&&"ENOTDIR"===o.code?s(r):s(o):function(e,t,r){n(e),n(t),n("function"==typeof r),t.readdir(e,function(n,s){if(n)return r(n);var o,a=s.length;if(0===a)return t.rmdir(e,r);s.forEach(function(n){p(i.join(e,n),t,function(n){if(!o)return n?r(o=n):void(0==--a&&t.rmdir(e,r))})})})}(e,t,s)})}function v(e,t){var r;if(h(t=t||{}),n(e,"rimraf: missing path"),n.equal(typeof e,"string","rimraf: path should be a string"),n(t,"rimraf: missing options"),n.equal(typeof t,"object","rimraf: options should be object"),t.disableGlob||!o.hasMagic(e))r=[e];else try{t.lstatSync(e),r=[e]}catch(n){r=o.sync(e,t.glob)}if(r.length)for(var i=0;i<r.length;i++){e=r[i];try{var s=t.lstatSync(e)}catch(r){if("ENOENT"===r.code)return;"EPERM"===r.code&&c&&m(e,t,r)}try{s&&s.isDirectory()?y(e,t,null):t.unlinkSync(e)}catch(r){if("ENOENT"===r.code)return;if("EPERM"===r.code)return c?m(e,t,r):y(e,t,r);if("EISDIR"!==r.code)throw r;y(e,t,r)}}}function y(e,t,r){n(e),n(t),r&&n(r instanceof Error);try{t.rmdirSync(e)}catch(s){if("ENOENT"===s.code)return;if("ENOTDIR"===s.code)throw r;"ENOTEMPTY"!==s.code&&"EEXIST"!==s.code&&"EPERM"!==s.code||function(e,t){n(e),n(t),t.readdirSync(e).forEach(function(r){v(i.join(e,r),t)});var r=c?100:1,s=0;for(;;){var o=!0;try{var a=t.rmdirSync(e,t);return o=!1,a}finally{if(++s<r&&o)continue}}}(e,t)}}}).call(this,e("_process"))},{_process:437,assert:292,fs:298,glob:491,path:404}],494:[function(e,t,r){(function(e){t.exports=function(t,r){var n,i,s,o=!0;Array.isArray(t)?(n=[],i=t.length):(s=Object.keys(t),n={},i=s.length);function a(t){function i(){r&&r(t,n),r=null}o?e.nextTick(i):i()}function u(e,t,r){n[e]=r,(0==--i||t)&&a(t)}i?s?s.forEach(function(e){t[e](function(t,r){u(e,t,r)})}):t.forEach(function(e,t){e(function(e,r){u(t,e,r)})}):a(null);o=!1}}).call(this,e("_process"))},{_process:437}],495:[function(e,t,r){var n=e("buffer"),i=n.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(s(n,r),r.Buffer=o),s(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:299}],496:[function(e,t,r){(function(r){"use strict";var n=e("contentstream"),i=e("gif-encoder"),s=e("jpeg-js"),o=e("pngjs-nozlib").PNG,a=e("ndarray"),u=e("ndarray-ops"),l=e("through");function c(e,t,r){if(4===e.shape.length)return c(e.pick(r),t,0);if(3===e.shape.length)if(3===e.shape[2])u.assign(a(t,[e.shape[0],e.shape[1],3],[4,4*e.shape[0],1]),e),u.assigns(a(t,[e.shape[0]*e.shape[1]],[4],3),255);else if(4===e.shape[2])u.assign(a(t,[e.shape[0],e.shape[1],4],[4,4*e.shape[0],1]),e);else{if(1!==e.shape[2])return new Error("Incompatible array shape");u.assign(a(t,[e.shape[0],e.shape[1],3],[4,4*e.shape[0],1]),a(e.data,[e.shape[0],e.shape[1],3],[e.stride[0],e.stride[1],0],e.offset)),u.assigns(a(t,[e.shape[0]*e.shape[1]],[4],3),255)}else{if(2!==e.shape.length)return new Error("Incompatible array shape");u.assign(a(t,[e.shape[0],e.shape[1],3],[4,4*e.shape[0],1]),a(e.data,[e.shape[0],e.shape[1],3],[e.stride[0],e.stride[1],0],e.offset)),u.assigns(a(t,[e.shape[0]*e.shape[1]],[4],3),255)}return t}function h(e){var t=l();return t.emit("error",e),t}t.exports=function(e,t,a){switch(a=a||{},t.toUpperCase()){case"JPG":case".JPG":case"JPEG":case".JPEG":case"JPE":case".JPE":var u=e.shape[0],l=e.shape[1],p={data:m=c(e,m=new r(u*l*4)),width:u,height:l},f=s.encode(p,a.quality);return new n(f.data);case"GIF":case".GIF":var d=4===e.shape.length?e.shape[0]:1,m=(u=4===e.shape.length?e.shape[1]:e.shape[0],l=4===e.shape.length?e.shape[2]:e.shape[1],new r(u*l*4)),g=new i(u,l);g.writeHeader();for(var v=0;v<d;v++)m=c(e,m,v),g.addFrame(m);return g.finish(),g;case"PNG":case".PNG":var y=new o({width:e.shape[0],height:e.shape[1]});return"Error"==typeof(m=c(e,y.data))?h(m):(y.data=m,y.pack());case"CANVAS":var _=document.createElement("canvas"),b=_.getContext("2d");_.width=e.shape[0],_.height=e.shape[1];var x=b.getImageData(0,0,_.width,_.height);return"Error"==typeof(m=c(e,m=x.data))?h(m):(b.putImageData(x,0,0),_);default:return h(new Error("Unsupported file type: "+t))}}}).call(this,e("buffer").Buffer)},{buffer:299,contentstream:40,"gif-encoder":125,"jpeg-js":371,ndarray:389,"ndarray-ops":386,"pngjs-nozlib":432,through:513}],497:[function(e,t,r){"use strict";var n=e("shebang-regex");t.exports=function(e){var t=e.match(n);if(!t)return null;var r=t[0].replace(/#! ?/,"").split(" "),i=r[0].split("/").pop(),s=r[1];return"env"===i?s:i+(s?" "+s:"")}},{"shebang-regex":498}],498:[function(e,t,r){"use strict";t.exports=/^#!.*/},{}],499:[function(e,t,r){(function(r){var n,i=e("assert"),s=e("./signals.js"),o=e("events");function a(){c&&(c=!1,s.forEach(function(e){try{r.removeListener(e,l[e])}catch(e){}}),r.emit=d,r.reallyExit=p,n.count-=1)}function u(e,t,r){n.emitted[e]||(n.emitted[e]=!0,n.emit(e,t,r))}"function"!=typeof o&&(o=o.EventEmitter),r.__signal_exit_emitter__?n=r.__signal_exit_emitter__:((n=r.__signal_exit_emitter__=new o).count=0,n.emitted={}),n.infinite||(n.setMaxListeners(1/0),n.infinite=!0),t.exports=function(e,t){i.equal(typeof e,"function","a callback must be provided for exit handler"),!1===c&&h();var r="exit";t&&t.alwaysLast&&(r="afterexit");return n.on(r,e),function(){n.removeListener(r,e),0===n.listeners("exit").length&&0===n.listeners("afterexit").length&&a()}},t.exports.unload=a;var l={};s.forEach(function(e){l[e]=function(){r.listeners(e).length===n.count&&(a(),u("exit",null,e),u("afterexit",null,e),r.kill(r.pid,e))}}),t.exports.signals=function(){return s},t.exports.load=h;var c=!1;function h(){c||(c=!0,n.count+=1,s=s.filter(function(e){try{return r.on(e,l[e]),!0}catch(e){return!1}}),r.emit=m,r.reallyExit=f)}var p=r.reallyExit;function f(e){r.exitCode=e||0,u("exit",r.exitCode,null),u("afterexit",r.exitCode,null),p.call(r,r.exitCode)}var d=r.emit;function m(e,t){if("exit"===e){void 0!==t&&(r.exitCode=t);var n=d.apply(this,arguments);return u("exit",r.exitCode,null),u("afterexit",r.exitCode,null),n}return d.apply(this,arguments)}}).call(this,e("_process"))},{"./signals.js":500,_process:437,assert:292,events:300}],500:[function(e,t,r){(function(e){t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==e.platform&&t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===e.platform&&t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}).call(this,e("_process"))},{_process:437}],501:[function(e,t,r){"use strict";t.exports=(e=>{const t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r?e:e.replace(/\\/g,"/")})},{}],502:[function(e,t,r){"use strict";if(t.exports=e("child_process").spawnSync,!t.exports)throw new Error("spawnSync not supported by this version of node. Please upgrade to at least node@6")},{child_process:298}],503:[function(e,t,r){t.exports=i;var n=e("events").EventEmitter;function i(){n.call(this)}e("inherits")(i,n),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function s(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",s),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",u));var o=!1;function a(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",s),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",l),e.on("error",l),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},{events:300,inherits:359,"readable-stream/duplex.js":472,"readable-stream/passthrough.js":484,"readable-stream/readable.js":485,"readable-stream/transform.js":486,"readable-stream/writable.js":487}],504:[function(e,t,r){(function(t){var n=e("./lib/request"),i=e("./lib/response"),s=e("xtend"),o=e("builtin-status-codes"),a=e("url"),u=r;u.request=function(e,r){e="string"==typeof e?a.parse(e):s(e);var i=-1===t.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||i,u=e.hostname||e.host,l=e.port,c=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?o+"//"+u:"")+(l?":"+l:"")+c,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var h=new n(e);return r&&h.on("response",r),h},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=o,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":506,"./lib/response":507,"builtin-status-codes":36,url:519,xtend:532}],505:[function(e,t,r){(function(e){r.fetch=a(e.fetch)&&a(e.ReadableStream),r.writableStream=a(e.WritableStream),r.abortController=a(e.AbortController),r.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),r.blobConstructor=!0}catch(e){}var t;function n(){if(void 0!==t)return t;if(e.XMLHttpRequest){t=new e.XMLHttpRequest;try{t.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var s=void 0!==e.ArrayBuffer,o=s&&a(e.ArrayBuffer.prototype.slice);function a(e){return"function"==typeof e}r.arraybuffer=r.fetch||s&&i("arraybuffer"),r.msstream=!r.fetch&&o&&i("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&s&&i("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!n()&&a(n().overrideMimeType),r.vbArray=a(e.VBArray),t=null}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],506:[function(e,t,r){(function(r,n,i){var s=e("./capability"),o=e("inherits"),a=e("./response"),u=e("readable-stream"),l=e("to-arraybuffer"),c=a.IncomingMessage,h=a.readyStates;var p=t.exports=function(e){var t,r=this;u.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+new i(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){r.setHeader(t,e.headers[t])});var n=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!s.abortController)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!s.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return s.fetch&&t?"fetch":s.mozchunkedarraybuffer?"moz-chunked-arraybuffer":s.msstream?"ms-stream":s.arraybuffer&&e?"arraybuffer":s.vbArray&&e?"text:vbarray":"text"}(t,n),r._fetchTimer=null,r.on("finish",function(){r._onFinish()})};o(p,u.Writable),p.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===f.indexOf(r)&&(this._headers[r]={name:e,value:t})},p.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},p.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},p.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,o=e._headers,a=null;"GET"!==t.method&&"HEAD"!==t.method&&(a=s.arraybuffer?l(i.concat(e._body)):s.blobConstructor?new n.Blob(e._body.map(function(e){return l(e)}),{type:(o["content-type"]||{}).value||""}):i.concat(e._body).toString());var u=[];if(Object.keys(o).forEach(function(e){var t=o[e].name,r=o[e].value;Array.isArray(r)?r.forEach(function(e){u.push([t,e])}):u.push([t,r])}),"fetch"===e._mode){var c=null;if(s.abortController){var p=new AbortController;c=p.signal,e._fetchAbortController=p,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=n.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}n.fetch(e._opts.url,{method:e._opts.method,headers:u,body:a||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:c}).then(function(t){e._fetchResponse=t,e._connect()},function(t){n.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)})}else{var f=e._xhr=new n.XMLHttpRequest;try{f.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick(function(){e.emit("error",t)})}"responseType"in f&&(f.responseType=e._mode.split(":")[0]),"withCredentials"in f&&(f.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in f&&f.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(f.timeout=t.requestTimeout,f.ontimeout=function(){e.emit("requestTimeout")}),u.forEach(function(e){f.setRequestHeader(e[0],e[1])}),e._response=null,f.onreadystatechange=function(){switch(f.readyState){case h.LOADING:case h.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(f.onprogress=function(){e._onXHRProgress()}),f.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{f.send(a)}catch(t){return void r.nextTick(function(){e.emit("error",t)})}}}},p.prototype._onXHRProgress=function(){(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},p.prototype._connect=function(){var e=this;e._destroyed||(e._response=new c(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},p.prototype._write=function(e,t,r){this._body.push(e),r()},p.prototype.abort=p.prototype.destroy=function(){this._destroyed=!0,n.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},p.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(this,e,t,r)},p.prototype.flushHeaders=function(){},p.prototype.setTimeout=function(){},p.prototype.setNoDelay=function(){},p.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":505,"./response":507,_process:437,buffer:299,inherits:359,"readable-stream":485,"to-arraybuffer":515}],507:[function(e,t,r){(function(t,n,i){var s=e("./capability"),o=e("inherits"),a=e("readable-stream"),u=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=r.IncomingMessage=function(e,r,o,u){var l=this;if(a.Readable.call(l),l._mode=o,l.headers={},l.rawHeaders=[],l.trailers={},l.rawTrailers=[],l.on("end",function(){t.nextTick(function(){l.emit("close")})}),"fetch"===o){if(l._fetchResponse=r,l.url=r.url,l.statusCode=r.status,l.statusMessage=r.statusText,r.headers.forEach(function(e,t){l.headers[t.toLowerCase()]=e,l.rawHeaders.push(t,e)}),s.writableStream){var c=new WritableStream({write:function(e){return new Promise(function(t,r){l._destroyed?r():l.push(new i(e))?t():l._resumeFetch=t})},close:function(){n.clearTimeout(u),l._destroyed||l.push(null)},abort:function(e){l._destroyed||l.emit("error",e)}});try{return void r.body.pipeTo(c).catch(function(e){n.clearTimeout(u),l._destroyed||l.emit("error",e)})}catch(e){}}var h=r.body.getReader();!function e(){h.read().then(function(t){if(!l._destroyed){if(t.done)return n.clearTimeout(u),void l.push(null);l.push(new i(t.value)),e()}}).catch(function(e){n.clearTimeout(u),l._destroyed||l.emit("error",e)})}()}else{if(l._xhr=e,l._pos=0,l.url=e.responseURL,l.statusCode=e.status,l.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===l.headers[r]&&(l.headers[r]=[]),l.headers[r].push(t[2])):void 0!==l.headers[r]?l.headers[r]+=", "+t[2]:l.headers[r]=t[2],l.rawHeaders.push(t[1],t[2])}}),l._charset="x-user-defined",!s.overrideMimeType){var p=l.rawHeaders["mime-type"];if(p){var f=p.match(/;\s*charset=([^;])(;|$)/);f&&(l._charset=f[1].toLowerCase())}l._charset||(l._charset="utf-8")}}};o(l,a.Readable),l.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},l.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==u.DONE)break;try{r=new n.VBArray(t.responseBody).toArray()}catch(e){}if(null!==r){e.push(new i(r));break}case"text":try{r=t.responseText}catch(t){e._mode="text:vbarray";break}if(r.length>e._pos){var s=r.substr(e._pos);if("x-user-defined"===e._charset){for(var o=new i(s.length),a=0;a<s.length;a++)o[a]=255&s.charCodeAt(a);e.push(o)}else e.push(s,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==u.DONE||!t.response)break;r=t.response,e.push(new i(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==u.LOADING||!r)break;e.push(new i(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==u.LOADING)break;var l=new n.MSStreamReader;l.onprogress=function(){l.result.byteLength>e._pos&&(e.push(new i(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){e.push(null)},l.readAsArrayBuffer(r)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":505,_process:437,buffer:299,inherits:359,"readable-stream":485}],508:[function(e,t,r){var n=e("buffer").Buffer,i=n.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var s=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!i(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=o)}this.charBuffer=new n(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function a(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}s.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!((i=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),e.copy(this.charBuffer,0,0,s),t.substring(0,n)}return t},s.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},s.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t}},{buffer:299}],509:[function(e,t,r){"use strict";t.exports=function(e){var t="string"==typeof e?"\n":"\n".charCodeAt(),r="string"==typeof e?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===r&&(e=e.slice(0,e.length-1)),e}},{}],510:[function(e,t,r){"use strict";t.exports=(e=>{const t="string"==typeof e?"\n":"\n".charCodeAt(),r="string"==typeof e?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===r&&(e=e.slice(0,e.length-1)),e})},{}],511:[function(e,t,r){(function(r){"use strict";const n=e("fs"),i=e("os"),s="__RESOLVED_TMP_DIR__";r[s]||Object.defineProperty(r,s,{value:n.realpathSync(i.tmpdir())}),t.exports=r[s]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{fs:298,os:301}],512:[function(e,t,r){"use strict";const n=e("path"),i=e("uuid"),s=e("temp-dir");t.exports=(e=>n.join(s,i.v4()+(e||"")))},{path:404,"temp-dir":511,uuid:525}],513:[function(e,t,r){(function(r){var n=e("stream");function i(e,t,i){e=e||function(e){this.queue(e)},t=t||function(){this.queue(null)};var s=!1,o=!1,a=[],u=!1,l=new n;function c(){for(;a.length&&!l.paused;){var e=a.shift();if(null===e)return l.emit("end");l.emit("data",e)}}return l.readable=l.writable=!0,l.paused=!1,l.autoDestroy=!(i&&!1===i.autoDestroy),l.write=function(t){return e.call(this,t),!l.paused},l.queue=l.push=function(e){return u?l:(null===e&&(u=!0),a.push(e),c(),l)},l.on("end",function(){l.readable=!1,!l.writable&&l.autoDestroy&&r.nextTick(function(){l.destroy()})}),l.end=function(e){if(!s)return s=!0,arguments.length&&l.write(e),l.writable=!1,t.call(l),!l.readable&&l.autoDestroy&&l.destroy(),l},l.destroy=function(){if(!o)return o=!0,s=!0,a.length=0,l.writable=l.readable=!1,l.emit("close"),l},l.pause=function(){if(!l.paused)return l.paused=!0,l},l.resume=function(){return l.paused&&(l.paused=!1,l.emit("resume")),c(),l.paused||l.emit("drain"),l},l}t.exports=i,i.through=i}).call(this,e("_process"))},{_process:437,stream:503}],514:[function(e,t,r){(function(t,n){var i=e("process/browser.js").nextTick,s=Function.prototype.apply,o=Array.prototype.slice,a={},u=0;function l(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new l(s.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new l(s.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=u++,n=!(arguments.length<2)&&o.call(arguments,1);return a[t]=!0,i(function(){a[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof n?n:function(e){delete a[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":437,timers:514}],515:[function(e,t,r){var n=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(n.isBuffer(e)){for(var t=new Uint8Array(e.length),r=e.length,i=0;i<r;i++)t[i]=e[i];return t.buffer}throw new Error("Argument must be a Buffer")}},{buffer:299}],516:[function(e,t,r){(function(){var e=this,n=e._,i={},s=Array.prototype,o=Object.prototype,a=Function.prototype,u=s.push,l=s.slice,c=s.concat,h=o.toString,p=o.hasOwnProperty,f=s.forEach,d=s.map,m=s.reduce,g=s.reduceRight,v=s.filter,y=s.every,_=s.some,b=s.indexOf,x=s.lastIndexOf,w=Array.isArray,E=Object.keys,T=a.bind,A=function(e){return e instanceof A?e:this instanceof A?void(this._wrapped=e):new A(e)};void 0!==r?(void 0!==t&&t.exports&&(r=t.exports=A),r._=A):e._=A,A.VERSION="1.4.4";var S=A.each=A.forEach=function(e,t,r){if(null!=e)if(f&&e.forEach===f)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,s=e.length;n<s;n++)if(t.call(r,e[n],n,e)===i)return}else for(var o in e)if(A.has(e,o)&&t.call(r,e[o],o,e)===i)return};A.map=A.collect=function(e,t,r){var n=[];return null==e?n:d&&e.map===d?e.map(t,r):(S(e,function(e,i,s){n[n.length]=t.call(r,e,i,s)}),n)};var k="Reduce of empty array with no initial value";A.reduce=A.foldl=A.inject=function(e,t,r,n){var i=arguments.length>2;if(null==e&&(e=[]),m&&e.reduce===m)return n&&(t=A.bind(t,n)),i?e.reduce(t,r):e.reduce(t);if(S(e,function(e,s,o){i?r=t.call(n,r,e,s,o):(r=e,i=!0)}),!i)throw new TypeError(k);return r},A.reduceRight=A.foldr=function(e,t,r,n){var i=arguments.length>2;if(null==e&&(e=[]),g&&e.reduceRight===g)return n&&(t=A.bind(t,n)),i?e.reduceRight(t,r):e.reduceRight(t);var s=e.length;if(s!==+s){var o=A.keys(e);s=o.length}if(S(e,function(a,u,l){u=o?o[--s]:--s,i?r=t.call(n,r,e[u],u,l):(r=e[u],i=!0)}),!i)throw new TypeError(k);return r},A.find=A.detect=function(e,t,r){var n;return C(e,function(e,i,s){if(t.call(r,e,i,s))return n=e,!0}),n},A.filter=A.select=function(e,t,r){var n=[];return null==e?n:v&&e.filter===v?e.filter(t,r):(S(e,function(e,i,s){t.call(r,e,i,s)&&(n[n.length]=e)}),n)},A.reject=function(e,t,r){return A.filter(e,function(e,n,i){return!t.call(r,e,n,i)},r)},A.every=A.all=function(e,t,r){t||(t=A.identity);var n=!0;return null==e?n:y&&e.every===y?e.every(t,r):(S(e,function(e,s,o){if(!(n=n&&t.call(r,e,s,o)))return i}),!!n)};var C=A.some=A.any=function(e,t,r){t||(t=A.identity);var n=!1;return null==e?n:_&&e.some===_?e.some(t,r):(S(e,function(e,s,o){if(n||(n=t.call(r,e,s,o)))return i}),!!n)};A.contains=A.include=function(e,t){return null!=e&&(b&&e.indexOf===b?-1!=e.indexOf(t):C(e,function(e){return e===t}))},A.invoke=function(e,t){var r=l.call(arguments,2),n=A.isFunction(t);return A.map(e,function(e){return(n?t:e[t]).apply(e,r)})},A.pluck=function(e,t){return A.map(e,function(e){return e[t]})},A.where=function(e,t,r){return A.isEmpty(t)?r?null:[]:A[r?"find":"filter"](e,function(e){for(var r in t)if(t[r]!==e[r])return!1;return!0})},A.findWhere=function(e,t){return A.where(e,t,!0)},A.max=function(e,t,r){if(!t&&A.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&A.isEmpty(e))return-1/0;var n={computed:-1/0,value:-1/0};return S(e,function(e,i,s){var o=t?t.call(r,e,i,s):e;o>=n.computed&&(n={value:e,computed:o})}),n.value},A.min=function(e,t,r){if(!t&&A.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&A.isEmpty(e))return 1/0;var n={computed:1/0,value:1/0};return S(e,function(e,i,s){var o=t?t.call(r,e,i,s):e;o<n.computed&&(n={value:e,computed:o})}),n.value},A.shuffle=function(e){var t,r=0,n=[];return S(e,function(e){t=A.random(r++),n[r-1]=n[t],n[t]=e}),n};var I=function(e){return A.isFunction(e)?e:function(t){return t[e]}};A.sortBy=function(e,t,r){var n=I(t);return A.pluck(A.map(e,function(e,t,i){return{value:e,index:t,criteria:n.call(r,e,t,i)}}).sort(function(e,t){var r=e.criteria,n=t.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return e.index<t.index?-1:1}),"value")};var R=function(e,t,r,n){var i={},s=I(t||A.identity);return S(e,function(t,o){var a=s.call(r,t,o,e);n(i,a,t)}),i};A.groupBy=function(e,t,r){return R(e,t,r,function(e,t,r){(A.has(e,t)?e[t]:e[t]=[]).push(r)})},A.countBy=function(e,t,r){return R(e,t,r,function(e,t){A.has(e,t)||(e[t]=0),e[t]++})},A.sortedIndex=function(e,t,r,n){for(var i=(r=null==r?A.identity:I(r)).call(n,t),s=0,o=e.length;s<o;){var a=s+o>>>1;r.call(n,e[a])<i?s=a+1:o=a}return s},A.toArray=function(e){return e?A.isArray(e)?l.call(e):e.length===+e.length?A.map(e,A.identity):A.values(e):[]},A.size=function(e){return null==e?0:e.length===+e.length?e.length:A.keys(e).length},A.first=A.head=A.take=function(e,t,r){if(null!=e)return null==t||r?e[0]:l.call(e,0,t)},A.initial=function(e,t,r){return l.call(e,0,e.length-(null==t||r?1:t))},A.last=function(e,t,r){if(null!=e)return null==t||r?e[e.length-1]:l.call(e,Math.max(e.length-t,0))},A.rest=A.tail=A.drop=function(e,t,r){return l.call(e,null==t||r?1:t)},A.compact=function(e){return A.filter(e,A.identity)};var L=function(e,t,r){return S(e,function(e){A.isArray(e)?t?u.apply(r,e):L(e,t,r):r.push(e)}),r};A.flatten=function(e,t){return L(e,t,[])},A.without=function(e){return A.difference(e,l.call(arguments,1))},A.uniq=A.unique=function(e,t,r,n){A.isFunction(t)&&(n=r,r=t,t=!1);var i=r?A.map(e,r,n):e,s=[],o=[];return S(i,function(r,n){(t?n&&o[o.length-1]===r:A.contains(o,r))||(o.push(r),s.push(e[n]))}),s},A.union=function(){return A.uniq(c.apply(s,arguments))},A.intersection=function(e){var t=l.call(arguments,1);return A.filter(A.uniq(e),function(e){return A.every(t,function(t){return A.indexOf(t,e)>=0})})},A.difference=function(e){var t=c.apply(s,l.call(arguments,1));return A.filter(e,function(e){return!A.contains(t,e)})},A.zip=function(){for(var e=l.call(arguments),t=A.max(A.pluck(e,"length")),r=new Array(t),n=0;n<t;n++)r[n]=A.pluck(e,""+n);return r},A.object=function(e,t){if(null==e)return{};for(var r={},n=0,i=e.length;n<i;n++)t?r[e[n]]=t[n]:r[e[n][0]]=e[n][1];return r},A.indexOf=function(e,t,r){if(null==e)return-1;var n=0,i=e.length;if(r){if("number"!=typeof r)return e[n=A.sortedIndex(e,t)]===t?n:-1;n=r<0?Math.max(0,i+r):r}if(b&&e.indexOf===b)return e.indexOf(t,r);for(;n<i;n++)if(e[n]===t)return n;return-1},A.lastIndexOf=function(e,t,r){if(null==e)return-1;var n=null!=r;if(x&&e.lastIndexOf===x)return n?e.lastIndexOf(t,r):e.lastIndexOf(t);for(var i=n?r:e.length;i--;)if(e[i]===t)return i;return-1},A.range=function(e,t,r){arguments.length<=1&&(t=e||0,e=0),r=arguments[2]||1;for(var n=Math.max(Math.ceil((t-e)/r),0),i=0,s=new Array(n);i<n;)s[i++]=e,e+=r;return s},A.bind=function(e,t){if(e.bind===T&&T)return T.apply(e,l.call(arguments,1));var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}},A.partial=function(e){var t=l.call(arguments,1);return function(){return e.apply(this,t.concat(l.call(arguments)))}},A.bindAll=function(e){var t=l.call(arguments,1);return 0===t.length&&(t=A.functions(e)),S(t,function(t){e[t]=A.bind(e[t],e)}),e},A.memoize=function(e,t){var r={};return t||(t=A.identity),function(){var n=t.apply(this,arguments);return A.has(r,n)?r[n]:r[n]=e.apply(this,arguments)}},A.delay=function(e,t){var r=l.call(arguments,2);return setTimeout(function(){return e.apply(null,r)},t)},A.defer=function(e){return A.delay.apply(A,[e,1].concat(l.call(arguments,1)))},A.throttle=function(e,t){var r,n,i,s,o=0,a=function(){o=new Date,i=null,s=e.apply(r,n)};return function(){var u=new Date,l=t-(u-o);return r=this,n=arguments,l<=0?(clearTimeout(i),i=null,o=u,s=e.apply(r,n)):i||(i=setTimeout(a,l)),s}},A.debounce=function(e,t,r){var n,i;return function(){var s=this,o=arguments,a=r&&!n;return clearTimeout(n),n=setTimeout(function(){n=null,r||(i=e.apply(s,o))},t),a&&(i=e.apply(s,o)),i}},A.once=function(e){var t,r=!1;return function(){return r?t:(r=!0,t=e.apply(this,arguments),e=null,t)}},A.wrap=function(e,t){return function(){var r=[e];return u.apply(r,arguments),t.apply(this,r)}},A.compose=function(){var e=arguments;return function(){for(var t=arguments,r=e.length-1;r>=0;r--)t=[e[r].apply(this,t)];return t[0]}},A.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},A.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var r in e)A.has(e,r)&&(t[t.length]=r);return t},A.values=function(e){var t=[];for(var r in e)A.has(e,r)&&t.push(e[r]);return t},A.pairs=function(e){var t=[];for(var r in e)A.has(e,r)&&t.push([r,e[r]]);return t},A.invert=function(e){var t={};for(var r in e)A.has(e,r)&&(t[e[r]]=r);return t},A.functions=A.methods=function(e){var t=[];for(var r in e)A.isFunction(e[r])&&t.push(r);return t.sort()},A.extend=function(e){return S(l.call(arguments,1),function(t){if(t)for(var r in t)e[r]=t[r]}),e},A.pick=function(e){var t={},r=c.apply(s,l.call(arguments,1));return S(r,function(r){r in e&&(t[r]=e[r])}),t},A.omit=function(e){var t={},r=c.apply(s,l.call(arguments,1));for(var n in e)A.contains(r,n)||(t[n]=e[n]);return t},A.defaults=function(e){return S(l.call(arguments,1),function(t){if(t)for(var r in t)null==e[r]&&(e[r]=t[r])}),e},A.clone=function(e){return A.isObject(e)?A.isArray(e)?e.slice():A.extend({},e):e},A.tap=function(e,t){return t(e),e};var O=function(e,t,r,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof A&&(e=e._wrapped),t instanceof A&&(t=t._wrapped);var i=h.call(e);if(i!=h.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(var s=r.length;s--;)if(r[s]==e)return n[s]==t;r.push(e),n.push(t);var o=0,a=!0;if("[object Array]"==i){if(a=(o=e.length)==t.length)for(;o--&&(a=O(e[o],t[o],r,n)););}else{var u=e.constructor,l=t.constructor;if(u!==l&&!(A.isFunction(u)&&u instanceof u&&A.isFunction(l)&&l instanceof l))return!1;for(var c in e)if(A.has(e,c)&&(o++,!(a=A.has(t,c)&&O(e[c],t[c],r,n))))break;if(a){for(c in t)if(A.has(t,c)&&!o--)break;a=!o}}return r.pop(),n.pop(),a};A.isEqual=function(e,t){return O(e,t,[],[])},A.isEmpty=function(e){if(null==e)return!0;if(A.isArray(e)||A.isString(e))return 0===e.length;for(var t in e)if(A.has(e,t))return!1;return!0},A.isElement=function(e){return!(!e||1!==e.nodeType)},A.isArray=w||function(e){return"[object Array]"==h.call(e)},A.isObject=function(e){return e===Object(e)},S(["Arguments","Function","String","Number","Date","RegExp"],function(e){A["is"+e]=function(t){return h.call(t)=="[object "+e+"]"}}),A.isArguments(arguments)||(A.isArguments=function(e){return!(!e||!A.has(e,"callee"))}),"function"!=typeof/./&&(A.isFunction=function(e){return"function"==typeof e}),A.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},A.isNaN=function(e){return A.isNumber(e)&&e!=+e},A.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"==h.call(e)},A.isNull=function(e){return null===e},A.isUndefined=function(e){return void 0===e},A.has=function(e,t){return p.call(e,t)},A.noConflict=function(){return e._=n,this},A.identity=function(e){return e},A.times=function(e,t,r){for(var n=Array(e),i=0;i<e;i++)n[i]=t.call(r,i);return n},A.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=A.invert(M.escape);var P={escape:new RegExp("["+A.keys(M.escape).join("")+"]","g"),unescape:new RegExp("("+A.keys(M.unescape).join("|")+")","g")};A.each(["escape","unescape"],function(e){A[e]=function(t){return null==t?"":(""+t).replace(P[e],function(t){return M[e][t]})}}),A.result=function(e,t){if(null==e)return null;var r=e[t];return A.isFunction(r)?r.call(e):r},A.mixin=function(e){S(A.functions(e),function(t){var r=A[t]=e[t];A.prototype[t]=function(){var e=[this._wrapped];return u.apply(e,arguments),j.call(this,r.apply(A,e))}})};var B=0;A.uniqueId=function(e){var t=++B+"";return e?e+t:t},A.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,D={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},F=/\\|'|\r|\n|\t|\u2028|\u2029/g;A.template=function(e,t,r){var n;r=A.defaults({},r,A.templateSettings);var i=new RegExp([(r.escape||N).source,(r.interpolate||N).source,(r.evaluate||N).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,r,n,i,a){return o+=e.slice(s,a).replace(F,function(e){return"\\"+D[e]}),r&&(o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),n&&(o+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=a+t.length,t}),o+="';\n",r.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{n=new Function(r.variable||"obj","_",o)}catch(e){throw e.source=o,e}if(t)return n(t,A);var a=function(e){return n.call(this,e,A)};return a.source="function("+(r.variable||"obj")+"){\n"+o+"}",a},A.chain=function(e){return A(e).chain()};var j=function(e){return this._chain?A(e).chain():e};A.mixin(A),S(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=s[e];A.prototype[e]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=e&&"splice"!=e||0!==r.length||delete r[0],j.call(this,r)}}),S(["concat","join","slice"],function(e){var t=s[e];A.prototype[e]=function(){return j.call(this,t.apply(this._wrapped,arguments))}}),A.extend(A.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)},{}],517:[function(e,t,r){"use strict";t.exports=function(e,t,r){return 0===e.length?e:t?(r||e.sort(t),function(e,t){for(var r=1,n=e.length,i=e[0],s=e[0],o=1;o<n;++o)if(s=i,t(i=e[o],s)){if(o===r){r++;continue}e[r++]=i}return e.length=r,e}(e,t)):(r||e.sort(),function(e){for(var t=1,r=e.length,n=e[0],i=e[0],s=1;s<r;++s,i=n)if(i=n,(n=e[s])!==i){if(s===t){t++;continue}e[t++]=n}return e.length=t,e}(e))}},{}],518:[function(e,t,r){var n=e("mime"),i=e("fs");t.exports=function(e){return"data:"+n.lookup(e)+";base64,"+i.readFileSync(e,"base64")}},{fs:298,mime:382}],519:[function(e,t,r){"use strict";var n=e("punycode"),i=e("./util");function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=_,r.resolve=function(e,t){return _(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?_(e,!1,!0).resolveObject(t):t},r.format=function(e){i.isString(e)&&(e=_(e));return e instanceof s?e.format():s.prototype.format.call(e)},r.Url=s;var o=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),h=["%","/","?",";","#"].concat(c),p=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=e("querystring");function _(e,t,r){if(e&&i.isObject(e)&&e instanceof s)return e;var n=new s;return n.parse(e,t,r),n}s.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),a=-1!==s&&s<e.indexOf("#")?"?":"#",l=e.split(a);l[0]=l[0].replace(/\\/g,"/");var _=e=l.join(a);if(_=_.trim(),!r&&1===e.split("#").length){var b=u.exec(_);if(b)return this.path=_,this.href=_,this.pathname=b[1],b[2]?(this.search=b[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var x=o.exec(_);if(x){var w=(x=x[0]).toLowerCase();this.protocol=w,_=_.substr(x.length)}if(r||x||_.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===_.substr(0,2);!E||x&&g[x]||(_=_.substr(2),this.slashes=!0)}if(!g[x]&&(E||x&&!v[x])){for(var T,A,S=-1,k=0;k<p.length;k++){-1!==(C=_.indexOf(p[k]))&&(-1===S||C<S)&&(S=C)}-1!==(A=-1===S?_.lastIndexOf("@"):_.lastIndexOf("@",S))&&(T=_.slice(0,A),_=_.slice(A+1),this.auth=decodeURIComponent(T)),S=-1;for(k=0;k<h.length;k++){var C;-1!==(C=_.indexOf(h[k]))&&(-1===S||C<S)&&(S=C)}-1===S&&(S=_.length),this.host=_.slice(0,S),_=_.slice(S),this.parseHost(),this.hostname=this.hostname||"";var I="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!I)for(var R=this.hostname.split(/\./),L=(k=0,R.length);k<L;k++){var O=R[k];if(O&&!O.match(f)){for(var M="",P=0,B=O.length;P<B;P++)O.charCodeAt(P)>127?M+="x":M+=O[P];if(!M.match(f)){var N=R.slice(0,k),D=R.slice(k+1),F=O.match(d);F&&(N.push(F[1]),D.unshift(F[2])),D.length&&(_="/"+D.join(".")+_),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=n.toASCII(this.hostname));var j=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+j,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!m[w])for(k=0,L=c.length;k<L;k++){var $=c[k];if(-1!==_.indexOf($)){var V=encodeURIComponent($);V===$&&(V=escape($)),_=_.split($).join(V)}}var G=_.indexOf("#");-1!==G&&(this.hash=_.substr(G),_=_.slice(0,G));var z=_.indexOf("?");if(-1!==z?(this.search=_.substr(z),this.query=_.substr(z+1),t&&(this.query=y.parse(this.query)),_=_.slice(0,z)):t&&(this.search="",this.query={}),_&&(this.pathname=_),v[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){j=this.pathname||"";var W=this.search||"";this.path=j+W}return this.href=this.format(),this},s.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",s=!1,o="";this.host?s=e+this.host:this.hostname&&(s=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(o=y.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==s?(s="//"+(s||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):s||(s=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),t+s+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(a=a.replace("#","%23"))+n},s.prototype.resolve=function(e){return this.resolveObject(_(e,!1,!0)).format()},s.prototype.resolveObject=function(e){if(i.isString(e)){var t=new s;t.parse(e,!1,!0),e=t}for(var r=new s,n=Object.keys(this),o=0;o<n.length;o++){var a=n[o];r[a]=this[a]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),l=0;l<u.length;l++){var c=u[l];"protocol"!==c&&(r[c]=e[c])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!v[e.protocol]){for(var h=Object.keys(e),p=0;p<h.length;p++){var f=h[p];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||g[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var m=r.pathname||"",y=r.search||"";r.path=m+y}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var _=r.pathname&&"/"===r.pathname.charAt(0),b=e.host||e.pathname&&"/"===e.pathname.charAt(0),x=b||_||r.host&&e.pathname,w=x,E=r.pathname&&r.pathname.split("/")||[],T=(d=e.pathname&&e.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(T&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),x=x&&(""===d[0]||""===E[0])),b)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,E=d;else if(d.length)E||(E=[]),E.pop(),E=E.concat(d),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(T)r.hostname=r.host=E.shift(),(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=E.slice(-1)[0],S=(r.host||e.host||E.length>1)&&("."===A||".."===A)||""===A,k=0,C=E.length;C>=0;C--)"."===(A=E[C])?E.splice(C,1):".."===A?(E.splice(C,1),k++):k&&(E.splice(C,1),k--);if(!x&&!w)for(;k--;k)E.unshift("..");!x||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),S&&"/"!==E.join("/").substr(-1)&&E.push("");var I,R=""===E[0]||E[0]&&"/"===E[0].charAt(0);T&&(r.hostname=r.host=R?"":E.length?E.shift():"",(I=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=I.shift(),r.host=r.hostname=I.shift()));return(x=x||r.host&&E.length)&&!R&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},s.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":520,punycode:441,querystring:471}],520:[function(e,t,r){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],521:[function(e,t,r){(function(e){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],522:[function(e,t,r){arguments[4][294][0].apply(r,arguments)},{dup:294}],523:[function(e,t,r){arguments[4][295][0].apply(r,arguments)},{"./support/isBuffer":522,_process:437,dup:295,inherits:359}],524:[function(e,t,r){(function(t){var n=e("util"),i=Object.prototype.toString,s="win32"===t.platform;function o(e){return"[object Object]"===i.call(e)}function a(e,t){var r;for(var n in t)r=t[n],Array.isArray(r)?(Array.isArray(e[n])||(e[n]=[]),a(e[n],r)):o(r)?(o(e[n])||(e[n]={}),a(e[n],r)):e[n]=r;return e}if(["Function","String","Number","Date","RegExp"].forEach(function(e){r["is"+e]=function(t){return i.call(t)==="[object "+e+"]"}}),a(r,n),r.isObject=o,r.extend=function(){var e=Array.prototype.slice.call(arguments,0),t=e.shift();return e.forEach(function(e){a(t,e)}),t},r.isArray=Array.isArray,r.isUndefined=function(e){return void 0===e},r.noop=function(){},r.unique=function(e){var t=[];return e.forEach(function(e){-1==t.indexOf(e)&&t.push(e)}),t},r.escape=function(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},r.unescape=function(e){return String(e).replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},r.hrtime=function(e){if(e){var r=t.hrtime(e);return r=1e3*(r[0]+r[1]/1e9)+"ms"}return t.hrtime()},r.pick=function(e,t){var n={};if(r.isFunction(t))for(var i in e){var s=e[i];t(s,i,e)&&(n[i]=s)}else Array.prototype.slice.call(arguments,1).forEach(function(t){t in e&&(n[t]=e[t])});return n},r.path={},s){var u=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;r.path.isAbsolute=function(e){var t=u.exec(e),r=t[1]||"",n=!!r&&":"!==r.charAt(1);return!!t[2]||n},r.path.unixifyPath=function(e){return e.replace(/\\/g,"/")}}else r.path.isAbsolute=function(e){return"/"===e.charAt(0)},r.path.unixifyPath=function(e){return e}}).call(this,e("_process"))},{_process:437,util:523}],525:[function(e,t,r){var n=e("./v1"),i=e("./v4"),s=i;s.v1=n,s.v4=i,t.exports=s},{"./v1":528,"./v4":529}],526:[function(e,t,r){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},{}],527:[function(e,t,r){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var i=new Uint8Array(16);t.exports=function(){return n(i),i}}else{var s=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),s[t]=e>>>((3&t)<<3)&255;return s}}},{}],528:[function(e,t,r){var n,i,s=e("./lib/rng"),o=e("./lib/bytesToUuid"),a=0,u=0;t.exports=function(e,t,r){var l=t&&r||0,c=t||[],h=(e=e||{}).node||n,p=void 0!==e.clockseq?e.clockseq:i;if(null==h||null==p){var f=s();null==h&&(h=n=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==p&&(p=i=16383&(f[6]<<8|f[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:u+1,g=d-a+(m-u)/1e4;if(g<0&&void 0===e.clockseq&&(p=p+1&16383),(g<0||d>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=d,u=m,i=p;var v=(1e4*(268435455&(d+=122192928e5))+m)%4294967296;c[l++]=v>>>24&255,c[l++]=v>>>16&255,c[l++]=v>>>8&255,c[l++]=255&v;var y=d/4294967296*1e4&268435455;c[l++]=y>>>8&255,c[l++]=255&y,c[l++]=y>>>24&15|16,c[l++]=y>>>16&255,c[l++]=p>>>8|128,c[l++]=255&p;for(var _=0;_<6;++_)c[l+_]=h[_];return t||o(c)}},{"./lib/bytesToUuid":526,"./lib/rng":527}],529:[function(e,t,r){var n=e("./lib/rng"),i=e("./lib/bytesToUuid");t.exports=function(e,t,r){var s=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var a=0;a<16;++a)t[s+a]=o[a];return t||i(o)}},{"./lib/bytesToUuid":526,"./lib/rng":527}],530:[function(e,t,r){(function(r){t.exports=l,l.sync=function(e,t){for(var r=u(e,t=t||{}),n=r.env,s=r.ext,l=r.extExe,c=[],h=0,p=n.length;h<p;h++){var f=n[h];'"'===f.charAt(0)&&'"'===f.slice(-1)&&(f=f.slice(1,-1));var d=i.join(f,e);!f&&/^\.[\\\/]/.test(e)&&(d=e.slice(0,2)+d);for(var m=0,g=s.length;m<g;m++){var v=d+s[m];try{if(o.sync(v,{pathExt:l})){if(!t.all)return v;c.push(v)}}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw a(e)};var n="win32"===r.platform||"cygwin"===r.env.OSTYPE||"msys"===r.env.OSTYPE,i=e("path"),s=n?";":":",o=e("isexe");function a(e){var t=new Error("not found: "+e);return t.code="ENOENT",t}function u(e,t){var i=t.colon||s,o=t.path||r.env.PATH||"",a=[""];o=o.split(i);var u="";return n&&(o.unshift(r.cwd()),a=(u=t.pathExt||r.env.PATHEXT||".EXE;.CMD;.BAT;.COM").split(i),-1!==e.indexOf(".")&&""!==a[0]&&a.unshift("")),(e.match(/\//)||n&&e.match(/\\/))&&(o=[""]),{env:o,ext:a,extExe:u}}function l(e,t,r){"function"==typeof t&&(r=t,t={});var n=u(e,t),s=n.env,l=n.ext,c=n.extExe,h=[];!function n(u,p){if(u===p)return t.all&&h.length?r(null,h):r(a(e));var f=s[u];'"'===f.charAt(0)&&'"'===f.slice(-1)&&(f=f.slice(1,-1));var d=i.join(f,e);!f&&/^\.[\\\/]/.test(e)&&(d=e.slice(0,2)+d),function e(i,s){if(i===s)return n(u+1,p);var a=l[i];o(d+a,{pathExt:c},function(n,o){if(!n&&o){if(!t.all)return r(null,d+a);h.push(d+a)}return e(i+1,s)})}(0,l.length)}(0,s.length)}}).call(this,e("_process"))},{_process:437,isexe:368,path:404}],531:[function(e,t,r){t.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");Object.keys(t).forEach(function(e){n[e]=t[e]});return n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach(function(e){n[e]=i[e]}),n}}},{}],532:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},{}],533:[function(e,t,r){function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t){e.tail=new o(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new o(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function o(e,t,r,n){if(!(this instanceof o))return new o(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}t.exports=n,n.Node=o,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,s=this.head;null!==s&&i<e;i++)s=s.next;for(;null!==s&&i<t;i++,s=s.next)r.push(s.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,s=this.tail;null!==s&&i>t;i--)s=s.prev;for(;null!==s&&i>e;i--,s=s.prev)r.push(s.value);return r},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this}},{}],534:[function(e,t,r){t.exports=function(t,r,n){return e("./InsertStep")(t,-1,r,n)}},{"./InsertStep":538}],535:[function(e,t,r){var n=e("fs");t.exports=function(t="./output/",r,i,s){if(t="/"==t[t.length-1]?t:t+"/",r.options.inBrowser)return!1;if(n.access(t,function(e){e&&console.error(e)}),s&&i){var o=r.steps,a=o.slice(-1)[0].output.src,u=(o.slice(-1)[0].output.format,e("data-uri-to-buffer")(a));n.writeFile(t+s,u,function(){})}else l=t,c=function(s){var o=1;for(var a in s)if(null!=s[a].match(/^sequencer(.*)$/)){var u=parseInt(s[a].match(/^sequencer(.*)$/)[1]);o=u>=o?u+1:o}n.mkdir(t+"sequencer"+o,function(){var s=t+"sequencer"+o+"/",a=r.steps;if(i){var u=a.slice(-1)[0].output.src,l=a.slice(-1)[0].output.format,c=e("data-uri-to-buffer")(u);n.writeFile(s+"image_"+(a.length-1)+"."+l,c,function(){})}else for(var h in a){u=a[h].output.src,l=a[h].output.format,c=e("data-uri-to-buffer")(u);n.writeFile(s+"image_"+h+"."+l,c,function(){})}})},n.readdir(l,function(e,t){var r=[];if(void 0===t||0==t.length)return c(r),[];for(var i=0;i<t.length;++i){var s=t[i];if("."!==s[0]){var o=l+"/"+s;n.stat(o,function(e,n){if(n.isDirectory()&&r.push(this.file),t.length===this.index+1)return c(r)}.bind({index:i,file:s}))}}});var l,c}},{"data-uri-to-buffer":51,fs:298}],536:[function(e,t,r){function n(e){return Object.prototype.toString.call(e).split(" ")[1].slice(0,-1)}function i(e){if("Array"==n(e))return e.slice();if("Object"==n(e)){var t={};for(var r in e)t[r]=i(e[r]);return t}return e}t.exports=function(e,t,r){var s,o={},a=t;if("+"==t?t=["string_a","o_object"]:"-"==t?t=["number_a"]:"^"==t?t=["number","string","o_object"]:"r"==t?t=["o_number"]:"l"==t&&(t=["string","o_function"]),"o_object"==t[t.length-1]?"Object"!=n(e[e.length-1])&&e.push({}):"o_number"==t[t.length-1]?"number"!=typeof e[e.length-1]&&"Object"!=n(e[0])&&e.push(1):"o_function"==t[t.length-1]&&"Function"!=n(e[e.length-1])&&"Object"!=n(e[0])&&e.push(function(){}),e.length==t.length)for(var u in t)"_a"==t[u].substr(t[u].length-2,2)&&(e[u]="Array"==n(s=e[u])?s:[s]);if(1==e.length)"r"==a?o={0:i(e[0])}:"-"==a&&(o=[],o=i(e[0]));else if("r"==a)for(var l in e[0])o={0:e[0]};else if("l"==a)o={image:e[0],callback:e[1]};else{if(o=[],"+"==a)for(var c in e[0])o.push({name:e[0][c],o:e[1]});if("^"==a){var h=this.steps.length,p=e[0];(p=p==h?p:p%h)<0&&(p+=h+1),o.push({index:p,name:e[1],o:e[2]})}}return o}},{}],537:[function(e,t,r){if("undefined"!=typeof window)n=!0;else var n=!1;e("./util/getStep.js"),ImageSequencer=function(t){var r=e("./Strings.js")(this.steps,g,d,a),i="ImageSequencer"==this.name?this:this.sequencer;function s(e){return Object.prototype.toString.call(e).split(" ")[1].slice(0,-1)}function a(e){if("Array"==s(e))return e.slice();if("Object"==s(e)){var t={};for(var r in e)t[r]=a(e[r]);return t}return e}(t=t||{}).inBrowser=void 0===t.inBrowser?n:t.inBrowser,t.sequencerCounter=0;var u=e("./Modules"),l=e("./SavedSequences.json"),c=e("./FormatInput"),h=[],p=e("./ui/UserInterface")(),f=e("fs");if(t.inBrowser){for(o in i)u[o]=i[o];(l=JSON.parse(window.localStorage.getItem("sequences")))||(l={},window.localStorage.setItem("sequences",JSON.stringify(l)))}function d(){var t,r="ImageSequencer"==this.name?this:this.sequencer,n=[];for(var i in arguments)n.push(a(arguments[i]));for(var s in t=c.call(r,n,"+"),h.push({method:"addSteps",json_q:a(t)}),t)e("./AddStep")(r,t[s].name,t[s].o);return this}function m(){var t=[],r=this.getSteps().slice(1).map(e=>e.options.name),n=this;for(var i in n.image=arguments[0],arguments)t.push(a(arguments[i]));var s=c.call(this,t,"l");0!=this.getSteps().length&&(this.options.sequencerCounter=0,h=[],this.steps=[]),h.push({method:"loadImages",json_q:a(s)});var o={name:"ImageSequencer Wrapper",sequencer:this,addSteps:this.addSteps,removeSteps:this.removeSteps,insertSteps:this.insertSteps,run:this.run,UI:this.UI,setUI:this.setUI};e("./ui/LoadImage")(n,"image",s.image,function(){var e;e=n,0!=r.length&&(e.addSteps(r),r=[]),s.callback.call(o)})}function g(e){var t={};if("load-image"==e)return{};if(0==arguments.length){for(var r in this.modules)t[r]=u[r][1];for(var n in this.sequences)t[n]={name:n,steps:this.sequences[n]}}else t=u[e]?u[e][1]:{inputs:l[e].options};return t}return{name:"ImageSequencer",options:t,inputlog:h,modules:u,sequences:l,events:p,steps:[],image:void 0,loadImages:m,loadImage:m,addSteps:d,removeSteps:function(){var e,t="ImageSequencer"==this.name?this:this.sequencer,r=[];for(var n in arguments)r.push(a(arguments[n]));var i,s,o=c.call(t,r,"-");for(var u in h.push({method:"removeSteps",json_q:a(o)}),e=o.sort(function(e,t){return t-e}))i=t,(s=e[u])>0&&(thisStep=i.steps[s],thisStep.UI.onRemove(thisStep.options.step),i.steps.splice(s,1));return this},insertSteps:function(){var t="ImageSequencer"==this.name?this:this.sequencer,r=[];for(var n in arguments)r.push(arguments[n]);var i=c.call(t,r,"^");h.push({method:"insertSteps",json_q:a(i)});var s=i;for(var o in s=s.sort(function(e,t){return t.index-e.index}))e("./InsertStep")(t,s[o].index,s[o].name,s[o].o);return this},replaceImage:function(t,r,n){return(n=n||{}).callback=n.callback||function(){},e("./ReplaceImage")(this,t,r,n)},run:function(t){var r,n=0;(t=t||{mode:"no-arg"}).index&&(n=t.index),"no-arg"!=t.mode&&"function"!=typeof t&&(t.progressObj&&(r=t.progressObj),delete arguments[0]);var i="ImageSequencer"==this.name?this:this.sequencer,o=[];for(var u in arguments)o.push(a(arguments[u]));var l=function(){};for(var u in o)"Function"==s(o[u])&&(l=o.splice(u,1)[0]);var h=c.call(i,o,"r");return e("./Run")(i,h,l,n,r),!0},setUI:function(t){this.events=e("./ui/UserInterface")(t)},exportBin:function(t,r,n){return e("./ExportBin")(t,this,r,n)},modulesInfo:g,toCliString:r.toCliString,detectStringSyntax:r.detectStringSyntax,parseStringSyntax:r.parseStringSyntax,stringToSteps:r.stringToSteps,toString:r.toString,stepToString:r.stepToString,toJSON:r.toJSON,stringToJSON:r.stringToJSON,stringToJSONstep:r.stringToJSONstep,importString:r.importString,importJSON:r.importJSON,loadNewModule:function(t,r){if(!r)return this;if(Array.isArray(r))this.modules[t]=r;else if(r.func&&r.info)this.modules[t]=[r.func,r.info];else if(r.path&&!this.inBrowser){const n=[e(`${r.path}/Module.js`),e(`${r.path}/info.json`)];this.modules[t]=n}return this},saveNewModule:function(e,r){if(!t.inBrowser){var n=f.readFileSync("./src/Modules.js").toString();n=n.substr(0,n.length-1)+" '"+e+"': require('"+r+"'),\n}",f.writeFileSync("./src/Modules.js",n)}},createMetaModule:e("./util/createMetaModule"),saveSequence:function(n,i){const s=r.stringToJSON(i);var o;t.inBrowser?((o=JSON.parse(window.localStorage.getItem("sequences")))[n]=s,window.localStorage.setItem("sequences",JSON.stringify(o))):((o=e("./SavedSequences.json"))[n]=s,f.writeFileSync("./src/SavedSequences.json",JSON.stringify(o)))},loadModules:function(){this.modules=e("./Modules"),t.inBrowser?this.sequences=JSON.parse(window.localStorage.getItem("sequences")):this.sequences=e("./SavedSequences.json")},getSteps:function(){return this.steps},log:function(e,r){"none"!=t.ui&&(1==arguments.length?console.log(arguments[0]):2==arguments.length&&console.log(e,r))},objTypeOf:s,copy:a,getImageDimensions:e("./util/getImageDimensions"),setInputStep:e("./ui/SetInputStep")(i)}},t.exports=ImageSequencer},{"./AddStep":534,"./ExportBin":535,"./FormatInput":536,"./InsertStep":538,"./Modules":539,"./ReplaceImage":540,"./Run":541,"./SavedSequences.json":543,"./Strings.js":544,"./ui/LoadImage":715,"./ui/SetInputStep":716,"./ui/UserInterface":717,"./util/createMetaModule":719,"./util/getImageDimensions":722,"./util/getStep.js":723,fs:298}],538:[function(e,t,r){e("./util/getStep.js");t.exports=function(e,t,r,n){if(e.sequences[r])return e.importJSON(e.sequences[r]);if(e.detectStringSyntax(r))return e.stringToSteps(r);!function(t,r,n){if(e.modules[r])var i=e.modules[r][1];else console.log("Module "+r+" not found.");var s=e.copy(n);s.number=e.options.sequencerCounter++,s.name=n.name||r||i.name,s.description=n.description||i.description,s.moduleInfo=n.moduleInfo||i,s.selector=n.selector||"ismod-"+r,s.container=n.container||e.options.selector,s.inBrowser=e.options.inBrowser,s.useWasm=!1!==e.options.useWasm,-1==t&&(t=e.steps.length),s.step={name:s.name,description:s.description,moduleInfo:s.moduleInfo,ID:s.number,inBrowser:e.options.inBrowser,ui:e.options.ui,options:s};var o=e.events;e.modules[r].expandSteps=function(r){for(var n in r){let i=r[n];e.insertSteps(t+Number.parseInt(n),i.name,i.options)}},s=s||{},e.modules[r][1].length?e.modules[r][0](s,o):(o.onSetup(s.step,{index:t}),e.steps.splice(t,0,e.modules[r][0](s,o)))}(t,r,n),e.steps=e.steps}},{"./util/getStep.js":723}],539:[function(e,t,r){t.exports={"add-qr":e("./modules/AddQR"),average:e("./modules/Average"),blend:e("./modules/Blend"),"blob-analysis":e("./modules/BlobAnalysis"),blur:e("./modules/Blur"),brightness:e("./modules/Brightness"),"canvas-resize":e("./modules/CanvasResize"),channel:e("./modules/Channel"),colorbar:e("./modules/Colorbar"),"color-halftone":e("./modules/ColorHalftone"),"color-temperature":e("./modules/ColorTemperature"),colormap:e("./modules/Colormap"),"constrained-crop":e("./modules/ConstrainedCrop"),contrast:e("./modules/Contrast"),convolution:e("./modules/Convolution"),crop:e("./modules/Crop"),"decode-qr":e("./modules/DecodeQr"),dither:e("./modules/Dither"),"draw-rectangle":e("./modules/DrawRectangle"),dynamic:e("./modules/Dynamic"),"edge-detect":e("./modules/EdgeDetect"),exposure:e("./modules/Exposure"),"flip-image":e("./modules/FlipImage"),"fisheye-gl":e("./modules/FisheyeGl"),histogram:e("./modules/Histogram"),"gamma-correction":e("./modules/GammaCorrection"),gradient:e("./modules/Gradient"),"grid-overlay":e("./modules/GridOverlay"),"import-image":e("./modules/ImportImage"),mask:e("./modules/Mask"),"minify-image":e("./modules/MinifyImage"),invert:e("./modules/Invert"),ndvi:e("./modules/Ndvi"),"ndvi-colormap":e("./modules/NdviColormap"),"noise-reduction":e("./modules/NoiseReduction"),overlay:e("./modules/Overlay"),"paint-bucket":e("./modules/PaintBucket"),"replace-color":e("./modules/ReplaceColor"),resize:e("./modules/Resize"),rotate:e("./modules/Rotate"),saturation:e("./modules/Saturation"),shadow:e("./modules/Shadow"),sharpen:e("./modules/Sharpen"),"text-overlay":e("./modules/TextOverlay"),threshold:e("./modules/Threshold"),tint:e("./modules/Tint"),"webgl-distort":e("./modules/WebglDistort"),"white-balance":e("./modules/WhiteBalance")}},{"./modules/AddQR":547,"./modules/Average":550,"./modules/Blend":553,"./modules/BlobAnalysis":557,"./modules/Blur":561,"./modules/Brightness":564,"./modules/CanvasResize":567,"./modules/Channel":570,"./modules/ColorHalftone":573,"./modules/ColorTemperature":576,"./modules/Colorbar":579,"./modules/Colormap":583,"./modules/ConstrainedCrop":586,"./modules/Contrast":589,"./modules/Convolution":593,"./modules/Crop":598,"./modules/DecodeQr":601,"./modules/Dither":605,"./modules/DrawRectangle":609,"./modules/Dynamic":612,"./modules/EdgeDetect":616,"./modules/Exposure":619,"./modules/FisheyeGl":622,"./modules/FlipImage":626,"./modules/GammaCorrection":629,"./modules/Gradient":632,"./modules/GridOverlay":636,"./modules/Histogram":639,"./modules/ImportImage":643,"./modules/Invert":646,"./modules/Mask":649,"./modules/MinifyImage":652,"./modules/Ndvi":656,"./modules/NdviColormap":659,"./modules/NoiseReduction":663,"./modules/Overlay":667,"./modules/PaintBucket":671,"./modules/ReplaceColor":675,"./modules/Resize":679,"./modules/Rotate":683,"./modules/Saturation":686,"./modules/Shadow":689,"./modules/Sharpen":693,"./modules/TextOverlay":697,"./modules/Threshold":701,"./modules/Tint":704,"./modules/WebglDistort":707,"./modules/WhiteBalance":710}],540:[function(e,t,r){t.exports=function(e,t,r,n){if(!e.options.inBrowser)return!1;var i=ImageSequencer({ui:!1});if(window.hasOwnProperty("$"))var s=$(t);else s=document.querySelectorAll(t);for(var o=[],a=0;a<s.length;a++)s[a]instanceof HTMLImageElement&&o.push(s[a]);function u(t,r){var n=t.src,s=n.split("?")[0].split(".").pop(),o=new XMLHttpRequest;function a(n){i.loadImage(n,function(){var n=this.addSteps(r);e.detectStringSyntax(r)&&(n=this.stringToSteps(r)),n.run({stop:function(){}},function(e){t.src=e})})}o.open("GET",n,!0),o.responseType="arraybuffer",o.onload=function(e){var t,r,n,i=new Uint8Array(this.response),o="";for(t=0,r=i.length;t<r;t+=5e3)n=i.subarray(t,t+5e3),o+=String.fromCharCode.apply(null,n);var u=btoa(o);a("data:image/"+s+";base64,"+u)},"data:image/"!=n.substr(0,11).toLowerCase()?o.send():a(n)}for(a=0;a<o.length;a++)u(o[a],r),a==o.length-1&&n.callback()}},{}],541:[function(e,t,r){const n=e("./util/getStep.js");t.exports=function(t,r,i,s,o){return o||(o={stop:function(){}}),function(r){for(var a=[],u=t.steps.length,l=r[0],c=0;c<u-l;c++)a.push({i:l+c});!function r(s,a){if(a==s.length&&void 0!==s[a-1]&&"Function"==t.objTypeOf(i)&&t.steps.slice(-1)[0].output){var u=t.steps,l=u[u.length-1].output.src;return i(l),!0}if(void 0!==s[a]){var c=s[a].i,h=t.steps[c-1].output,p=t.steps[c];for(var f in p.getStep=function(e){return c+e>=t.steps.length?{options:{name:void 0}}:t.steps.slice(c+e)[0]},p.getIndex=function(){return c},n)n.hasOwnProperty(f)&&(p[f]=n[f]);p.UI.onDraw(p.options.step);var d=e("./RunToolkit")(t.copy(h));p.draw(d,function(){t.steps[c].options.step.output=t.steps[c].output.src,t.steps[c].options.step.wasmSuccess=t.steps[c].output.wasmSuccess||!1,t.steps[c].options.step.useWasm=t.steps[c].output.useWasm||!1,t.steps[c].UI.onComplete(t.steps[c].options.step),r(s,++a)},o)}}(a,s)}(r=function(e){0==e[0]&&1==t.steps.length?delete e[0]:0==e[0]&&e[0]++;for(var r=t.steps[e[0]-1];void 0===r||void 0===r.output;)r=t.steps[--e[0]-1];return e}(r))}},{"./RunToolkit":542,"./util/getStep.js":723}],542:[function(e,t,r){const n=e("get-pixels"),i=e("./modules/_nomodule/PixelManipulation"),s=e("lodash"),o=e("data-uri-to-buffer"),a=e("save-pixels");t.exports=function(e){return e.getPixels=n,e.pixelManipulation=i,e.lodash=s,e.dataUriToBuffer=o,e.savePixels=a,e}},{"./modules/_nomodule/PixelManipulation":712,"data-uri-to-buffer":51,"get-pixels":123,lodash:376,"save-pixels":496}],543:[function(e,t,r){t.exports={sample:[{name:"invert",options:{}},{name:"channel",options:{channel:"red"}},{name:"blur",options:{blur:"5"}}]}},{}],544:[function(e,t,r){t.exports=function(e,t,r,n){function i(e){return!(!e.includes(",")&&!e.includes("{"))}function s(e){return e.replace(/\s/g,"").split(",")}function o(e){var r=e.name?e.name:e.options.name;let n=t(r).inputs||{},i={};for(let t in n)e.options[t]&&e.options[t]!=n[t].default&&(i[t]=e.options[t],i[t]=encodeURIComponent(i[t]));return`${r}{${Object.keys(i).map(e=>e+":"+i[e]).join("|")}}`}function a(e){let t;return(t=i(e)?s(e):[e]).map(u)}function u(e){var t;if(t=e.includes("{")?e.includes("(")&&e.indexOf("(")<e.indexOf("{")?["(",")"]:["{","}"]:["(",")"],-1===e.indexOf(t[0])){var r=e.substr(0);stepSettings=""}else{r=e.substr(0,e.indexOf(t[0]));stepSettings=e.slice(e.indexOf(t[0])+1,-1)}return stepSettings=stepSettings.split("|").reduce(function(e,t,r){var n=t.substr(0,t.indexOf(":")),i=t.substr(t.indexOf(":")+1);return i=(i=i.replace(/^\(/,"")).replace(/^\{/,"").replace(/\}$/,""),t=[n,i=decodeURIComponent(i)],n&&(e[n]=i),e},{}),{name:r,options:stepSettings}}return{toCliString:function(){var e='"',r={};for(var n in this.steps){var i=void 0!==this.steps[n].options?this.steps[n].options.name:this.steps[n].name;for(var s in"load-image"!==i&&(e+=`${i} `),t(i).inputs)r[s]=this.steps[n].options[s]}return`sequencer -i [PATH] -s ${e=e.substr(0,e.length-1)+'"'} -d '${JSON.stringify(r)}'`},detectStringSyntax:i,parseStringSyntax:s,stringToSteps:function(e){let t=this,r=[];"ImageSequencer"!=this.name&&(t=this.sequencer),i(e)&&(r=a(e)),r.forEach(function(e){t.addSteps(e.name,e.options)})},toString:function(e){return e?o(e):n(this.steps.map(o).slice(1).join(","))},stepToString:o,toJSON:function(){return this.stringToJSON(this.toString())},stringToJSON:a,stringToJSONstep:u,importString:function(e){let t=this;"ImageSequencer"!=this.name&&(t=this.sequencer),a(e).forEach(function(e){t.addSteps(e.name,e.options)})},importJSON:function(e){let t=this;"ImageSequencer"!=this.name&&(t=this.sequencer),e.forEach(function(e){t.addSteps(e.name,e.options)})}}}},{}],545:[function(e,t,r){const n=e("lodash"),i=e("../../util/ParseInputCoordinates");t.exports=function(t,r){var s=e("./../../util/getDefaults.js")(e("./info.json"));return getPixels=e("get-pixels"),{options:t,draw:function(r,o,a){t.size=Number(t.size||s.size),t.qrCodeString=t.qrCodeString||s.qrCodeString,t.startingX=t.startingX||s.startingX,t.startingY=t.startingY||s.startingY,a.stop(!0),a.overrideFlag=!0;var u=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){u.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(r,s,o){let a=r.shape[0],u=r.shape[1];const l=n.cloneDeep(r);s(!1),i({iw:a,ih:u},{startingX:{valInp:t.startingX,type:"horizontal"},startingY:{valInp:t.startingY,type:"vertical"}},function(e,r){t.startingX=Math.floor(r.startingX.valInp),t.startingY=Math.floor(r.startingY.valInp)}),e("./QR")(t,r,l,()=>{s(!0),o()})},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:o,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../../util/ParseInputCoordinates":718,"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./QR":546,"./info.json":548,"get-pixels":123,lodash:376}],546:[function(e,t,r){const n=e("../../util/pixelSetter.js"),i=e("get-pixels"),s=e("qrcode");t.exports=function(e,t,r,o){s.toDataURL(e.qrCodeString,{width:e.size,scale:1},function(s,a){i(a,function(i,s){i&&console.log("get-pixels error: ",i);const a=r.shape[0],u=r.shape[1],l=Math.min(e.startingX,a-e.size),c=Math.min(e.startingY,u-e.size);for(let r=l;r<Math.min(l+e.size,a);r++)for(let i=c;i<Math.min(c+e.size,u);i++)n(r,i,[s.get(r-l,i-c,0),s.get(r-l,i-c,1),s.get(r-l,i-c,2),s.get(r-l,i-c,3)],t);o&&o()})})}},{"../../util/pixelSetter.js":725,"get-pixels":123,qrcode:442}],547:[function(e,t,r){t.exports=[e("./Module"),e("./info.json")]},{"./Module":545,"./info.json":548}],548:[function(e,t,r){t.exports={name:"add-qr",description:"Adds QR corresponding to the given string",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{size:{type:"integer",desc:"size of QR code in pixels",default:200},qrCodeString:{type:"string",desc:"input string to generate QR code",default:"https://github.com/publiclab/image-sequencer"},startingX:{type:"string",desc:"X-position (measured from left) from where QR starts",default:"0"},startingY:{type:"string",desc:"Y-position (measured from top) from where QR starts",default:"0"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#add-qr-module"}},{}],549:[function(e,t,r){t.exports=function(t,r){return t.step.metadata=t.step.metadata||{},{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,inBrowser:t.inBrowser,extraManipulation:function(e){for(var r=0,n=[0,0,0,0];r<e.data.length;)n[0]+=e.data[r++],n[1]+=e.data[r++],n[2]+=e.data[r++],n[3]+=e.data[r++];let i=e.data.length/4;for(n[0]=Math.floor(n[0]/i),n[1]=Math.floor(n[1]/i),n[2]=Math.floor(n[2]/i),n[3]=Math.floor(n[3]/i),r=0;r<e.data.length;)e.data[r++]=n[0],e.data[r++]=n[1],e.data[r++]=n[2],e.data[r++]=n[3];return t.step.metadata.averages=n,void 0===t.step.average&&(t.step.average=""),t.step.average+="rgba("+n.join(", ")+")",e},format:r.format,image:t.image,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712}],550:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":549,"./info.json":551,dup:547}],551:[function(e,t,r){t.exports={name:"average",description:"Average all pixel color",inputs:{},outputs:{average:{type:"string",desc:"The average value of all the pixels."}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#average-module"}},{}],552:[function(require,module,exports){module.exports=function Blend(options,UI,util){var defaults=require("./../../util/getDefaults.js")(require("./info.json")),output;function draw(input,callback,progressObj){progressObj.stop(!0),progressObj.overrideFlag=!0;var step=this,getPixels=require("get-pixels");"string"==typeof options.offset&&(options.offset=parseInt(options.offset));var priorStep=this.getStep(options.offset);void 0===priorStep.output&&(this.output=input,UI.notify("Offset Unavailable","offset-notification"),callback());const multiply_mode=function(e,t){return~~(e*t/255)},divide_mode=function(e,t){return~~(256*e/(t+1))},overlay_mode=function(e,t){return~~(e/255*(e+2*t/255*(255-e)))},screen_mode=function(e,t){return~~(255-(255-t)*(255-e)/255)},sof_light_mode=function(e,t){return~~(((255-e)*t+screen_mode(e,t))*e/255)},color_dodge=function(e,t){return~~(256*e/(255-t+1))},burn_mode=function(e,t){return~~(255-256*(255-e)/(t+1))},grain_extract_mode=function(e,t){return~~(e-t+128)},grain_merge_mode=function(e,t){return~~(e+t-128)};getPixels(priorStep.output.src,function(err,pixels){function changePixel(e,t,r,n,i,s){let o=options.firstImagePixels,a=o.get(i,s,0),u=o.get(i,s,1),l=o.get(i,s,2),c=o.get(i,s,3);const h={"Color Dodge":()=>[color_dodge(e,a),color_dodge(t,u),color_dodge(r,l),255],Multiply:()=>[multiply_mode(e,a),multiply_mode(t,u),multiply_mode(r,l),multiply_mode(n,c)],Divide:()=>[divide_mode(e,a),divide_mode(t,u),divide_mode(r,l),255],Overlay:()=>[overlay_mode(e,a),overlay_mode(t,u),overlay_mode(r,l),255],Screen:()=>[screen_mode(e,a),screen_mode(t,u),screen_mode(r,l),255],"Soft Light":()=>[sof_light_mode(e,a),sof_light_mode(t,u),sof_light_mode(r,l),255],"Color Burn":()=>[burn_mode(e,a),burn_mode(t,u),burn_mode(r,l),255],"Grain Extract":()=>[grain_extract_mode(e,a),grain_extract_mode(t,u),grain_extract_mode(r,l),255],"Grain Merge":()=>[grain_merge_mode(e,a),grain_merge_mode(t,u),grain_merge_mode(r,l),255]};return"custom"==options.blendMode?options.func(e,t,r,n,a,u,l,c):h[options.blendMode]()}function output(e,t,r,n){step.output={src:t,format:r,wasmSuccess:n,useWasm:options.useWasm}}return options.firstImagePixels=pixels,"string"==typeof options.func&&eval("options.func = "+options.func),require("../_nomodule/PixelManipulation.js")(input,{output:output,ui:options.step.ui,changePixel:changePixel,format:input.format,image:options.image,inBrowser:options.inBrowser,callback:callback,useWasm:options.useWasm})})}return options.func=options.blend||defaults.blend,options.offset=options.offset||defaults.offset,options.blendMode=options.blendMode||defaults.blendMode,{options:options,draw:draw,output:output,UI:UI}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":554,"get-pixels":123}],553:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":552,"./info.json":554,dup:547}],554:[function(e,t,r){t.exports={name:"blend",description:"Blend two chosen image steps with the given function. Defaults to using the red channel from image 1 and the green and blue and alpha channels of image 2.",inputs:{offset:{type:"integer",desc:"Choose which image to blend the current image with. Two steps back is -2, three steps back is -3 etc.",default:-2},blendMode:{type:"select",desc:"Name of the Blend Mode to use",default:"custom",values:["custom","Multiply","Divide","Overlay","Screen","Soft Light","Color Burn","Color Dodge","Grain Extract","Grain Merge"]},blend:{type:"string",desc:"Function to use to blend the two images.",default:"function(r1, g1, b1, a1, r2, g2, b2, a2, x, y) { return [ r2, g2, b2, a2 ] }"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#blend-module"}},{}],555:[function(e,t,r){t.exports=function(e){var t=document.createElement("canvas");t.width=e.shape[0],t.height=e.shape[1];var r=t.getContext("2d");r.putImageData(new ImageData(new Uint8ClampedArray(e.data),e.shape[0],e.shape[1]),0,0);let n=r.getImageData(0,0,t.width,t.height),i=cv.matFromImageData(n),s=new cv.Mat,o=new cv.Mat,a=new cv.Mat,u=new cv.Mat,l=new cv.Mat,c=new cv.Mat,h=new cv.Mat,p=new cv.Mat;cv.cvtColor(i,o,cv.COLOR_RGBA2GRAY,0),cv.threshold(o,o,0,255,cv.THRESH_BINARY_INV+cv.THRESH_OTSU);let f=cv.Mat.ones(3,3,cv.CV_8U);cv.erode(o,o,f),cv.dilate(o,a,f),cv.dilate(a,u,f,new cv.Point(-1,-1),3),cv.distanceTransform(a,c,cv.DIST_L2,5),cv.normalize(c,c,1,0,cv.NORM_INF),cv.threshold(c,l,.7,255,cv.THRESH_BINARY),l.convertTo(l,cv.CV_8U,1,0),cv.subtract(u,l,h),cv.connectedComponents(l,p);for(let e=0;e<p.rows;e++)for(let t=0;t<p.cols;t++)p.intPtr(e,t)[0]=p.ucharPtr(e,t)[0]+1,255==h.ucharPtr(e,t)[0]&&(p.intPtr(e,t)[0]=0);cv.cvtColor(i,i,cv.COLOR_RGBA2RGB,0),cv.watershed(i,p);for(let e=0;e<p.rows;e++)for(let t=0;t<p.cols;t++)-1==p.intPtr(e,t)[0]&&(i.ucharPtr(e,t)[0]=255,i.ucharPtr(e,t)[1]=0,i.ucharPtr(e,t)[2]=0);cv.imshow(t,i),i.delete(),s.delete(),o.delete(),a.delete(),u.delete(),l.delete(),c.delete(),h.delete(),p.delete(),f.delete();var d=r.getImageData(0,0,t.width,t.height);return e.data=d.data,e}},{}],556:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},extraManipulation:function(t){return t=e("./BlobAnalysis")(t)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./BlobAnalysis":555}],557:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":556,"./info.json":558,dup:547}],558:[function(e,t,r){t.exports={name:"Blob Analysis",description:"Blob/Region identification for microscopic images.",inputs:{},requires:["webgl","browser"],"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#blob-analysis"}},{}],559:[function(e,t,r){t.exports=function(t,r){const n=e("../../util/pixelSetter.js");let i=function(e=1){let t=[],r=0;0==e&&(e+=.05);const n=2*Math.pow(e,2);for(let e=-2;e<=2;e++){t.push([]);for(let i=-2;i<=2;i++){let s=Math.sqrt(Math.pow(i,2)+Math.pow(e,2));t[e+2].push(Math.exp(-s/n)),r+=t[e+2][i+2]}}for(let e=0;e<5;e++)for(let n=0;n<5;n++)t[n][e]=t[n][e]/r;return t}(r),s={r:[],g:[],b:[]};for(let e=0;e<t.shape[1];e++){s.r.push([]),s.g.push([]),s.b.push([]);for(let r=0;r<t.shape[0];r++)s.r[e].push(t.get(r,e,0)),s.g[e].push(t.get(r,e,1)),s.b[e].push(t.get(r,e,2))}const o=(0,e("../_nomodule/gpuUtils").convolve)([s.r,s.g,s.b],i);for(let e=0;e<t.shape[1];e++)for(let r=0;r<t.shape[0];r++){n(r,e,[Math.max(0,Math.min(o[0][e][r],255)),Math.max(0,Math.min(o[1][e][r],255)),Math.max(0,Math.min(o[2][e][r],255))],t)}return t}},{"../../util/pixelSetter.js":725,"../_nomodule/gpuUtils":714}],560:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return t.blur=t.blur||n.blur,t.blur=parseFloat(t.blur),{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,inBrowser:t.inBrowser,extraManipulation:function(r){return r=e("./Blur")(r,t.blur)},format:r.format,image:t.image,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./Blur":559,"./info.json":562}],561:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":560,"./info.json":562,dup:547}],562:[function(e,t,r){t.exports={name:"blur",description:"Applies a Gaussian blur given by the intensity value",inputs:{blur:{type:"float",desc:"Amount of gaussian blur(Less blur gives more detail, typically 0-5)",default:2,min:0,max:5,step:.05}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#blur-module"}},{}],563:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return{options:t,draw:function(r,i,s){t.brightness=t.brightness||n.brightness,s.stop(!0),s.overrideFlag=!0;var o=this,a=t.brightness/100;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){return[e=Math.min(a*e,255),t=Math.min(a*t,255),r=Math.min(a*r,255),n]},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":565}],564:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":563,"./info.json":565,dup:547}],565:[function(e,t,r){t.exports={name:"brightness",description:"Change the brightness of the image by given percent value",inputs:{brightness:{type:"integer",desc:"% brightness for the new image",default:"175",min:"0",max:"200"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#brightness-module"}},{}],566:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));const i=e("../../util/pixelSetter.js");return{options:t,draw:function(r,s,o){t.width=parseInt(t.width||n.width),t.height=parseInt(t.height||n.height),t.x=parseInt(t.x||n.x),t.y=parseInt(t.y||n.y),o.stop(!0),o.overrideFlag=!0;var a=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){a.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(r){let n=e("ndarray")(new Uint8Array(4*t.width*t.height).fill(0),[t.width,t.height,4]),s=t.width-t.x,o=t.height-t.y;for(let e=0;e<s&&e<r.shape[0];e++)for(let s=0;s<o&&s<r.shape[1];s++){let o=e+t.x,a=s+t.y;i(o,a,[r.get(e,s,0),r.get(e,s,1),r.get(e,s,2),r.get(e,s,3)],n)}return n},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:s,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../../util/pixelSetter.js":725,"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":568,ndarray:389}],567:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":566,"./info.json":568,dup:547}],568:[function(e,t,r){t.exports={name:"canvas-resize",description:"This module resizes the canvas and overlays the ouput of the previous step at given location",inputs:{width:{type:"integer",desc:"Final width of the canvas",default:1e3},height:{type:"integer",desc:"Final height of the canvas",default:1e3},x:{type:"integer",desc:"X-cord of the top left corner of the image on the canvas",default:500},y:{type:"float",desc:"Y-cord of the top left corner of the image on the canvas",default:500}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#canvas-resize-module"}},{}],569:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return t.channel=t.channel||n.channel,{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,r,n,i){return"red"===t.channel?[e,0,0,i]:"green"===t.channel?[0,r,0,i]:"blue"===t.channel?[0,0,n,i]:void 0},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":571}],570:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":569,"./info.json":571,dup:547}],571:[function(e,t,r){t.exports={name:"channel",description:"Displays only one color channel of an image -- default is green",inputs:{channel:{type:"select",desc:"Color channel",default:"green",values:["red","green","blue"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#channel-module"}},{}],572:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json")),i=e("glfx"),s=function(e){var t=function(e){var t;t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):unescape(e.split(",")[1]);for(var r=e.split(",")[0].split(":")[1].split(";")[0],n=new Uint8Array(t.length),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return new Blob([n],{type:r})}(e.toDataURL("image/png"));return window.URL.createObjectURL(t)},o=function(e,t,r){try{var n=i.canvas(1500,1500)}catch(e){return void alert(e)}var o=document.getElementById(e),a=new Image;a.onload=function(){var e=n.texture(a);n.draw(e,a.width,a.height),n.colorHalftone(a.width/2,a.height/2,parseFloat(t.angle),parseFloat(t.size)).update();var i=s(n);r?window.open(i):o.src=i},$(a).hide(),a.src=o.src};return{options:t,draw:function(r,i){var s=this;if(t.angle=t.angle||n.angle,t.size=t.size||n.size,t.inBrowser){var a=document.createElement("img");a.onload=(()=>{o("img",t),a.onload=(()=>{var e=document.createElement("canvas");e.width=a.naturalWidth,e.height=a.naturalHeight,e.getContext("2d").drawImage(a,0,0),s.output={src:e.toDataURL("image/png"),format:"png"},a.remove(),i()})}),a.src=r.src,a.id="img",document.body.appendChild(a)}else e("../_nomodule/gl-context")(r,i,s,t)},output:void 0,UI:r}}},{"../_nomodule/gl-context":713,"./../../util/getDefaults.js":721,"./info.json":574,glfx:168}],573:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":572,"./info.json":574,dup:547}],574:[function(e,t,r){t.exports={name:"color-halftone",requires:["webgl"],description:"Generate halftone versions of CMYK channels and blend them with varying rotations as in analog print color separation processes.",inputs:{angle:{type:"float",desc:"angle of rotation of the halftone patterns in radians",default:"0.25",min:"0",max:"1.57",step:"0.05"},size:{type:"integer",desc:"the diameter of a dot in pixels",default:"4",min:"3",max:"20"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#color-halftone-module"}},{}],575:[function(e,t,r){t.exports=function(t,r){const n=e("../../util/pixelSetter.js");var i=e("./../../util/getDefaults.js")(e("./info.json"));return{options:t,draw:function(r,s,o){t.temperature=t.temperature||i.temperature,t.temperature=t.temperature>4e4?4e4:t.temperature,t.temperature=t.temperature<0?0:t.temperature,o.stop(!0),o.overrideFlag=!0;var a=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){a.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(e){let r,i,s,o=parseInt(t.temperature);(o/=100)<=66?(r=255,i=Math.min(Math.max(99.4708025861*Math.log(o)-161.1195681661,0),255)):(r=Math.min(Math.max(329.698727446*Math.pow(o-60,-.1332047592),0),255),i=Math.min(Math.max(288.1221695283*Math.pow(o-60,-.0755148492),0),255)),o>=66?s=255:o<=19?s=0:(s=o-10,s=Math.min(Math.max(138.5177312231*Math.log(s)-305.0447927307,0),255));for(let t=0;t<e.shape[0];t++)for(let o=0;o<e.shape[1];o++){var a=[e.get(t,o,0),e.get(t,o,1),e.get(t,o,2)];a[0]=255/r*a[0],a[1]=255/i*a[1],a[2]=255/s*a[2],n(t,o,a,e)}return e},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:s,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../../util/pixelSetter.js":725,"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":577}],576:[function(e,t,r){t.exports=[e("./Module"),e("./info.json")]},{"./Module":575,"./info.json":577}],577:[function(e,t,r){t.exports={name:"color-temperature",description:"Changes the color temperature of the image.",inputs:{temperature:{type:"integer",desc:"Temperature between 0 - 40,000 Kelvin",default:6e3}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#color-temperature"}},{}],578:[function(e,t,r){t.exports=e("../../util/createMetaModule.js")(function(t){var r=e("./../../util/getDefaults.js")(e("./info.json"));return[{name:"gradient",options:{}},{name:"colormap",options:{colormap:t.colormap||r.colormap}},{name:"crop",options:{y:0,w:"100%",h:t.h||r.h}},{name:"overlay",options:{x:t.x||r.x,y:t.y||r.y,offset:-4}}]},{infoJson:e("./info.json")})[0]},{"../../util/createMetaModule.js":719,"./../../util/getDefaults.js":721,"./info.json":580}],579:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":578,"./info.json":580,dup:547}],580:[function(e,t,r){t.exports={name:"colorbar",description:"Generates a colorbar to lay over the image",inputs:{colormap:{type:"select",desc:"Name of the Colormap",default:"default",values:["default","greyscale","stretched","fastie"]},x:{type:"integer",desc:"X-position of the image on which the new image is overlayed",default:0},y:{type:"integer",desc:"Y-position of the image on which the new image is overlayed",default:0},h:{type:"integer",desc:"height of the colorbar",default:10}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#colorbar-module"}},{}],581:[function(e,t,r){function n(e){return function(t){var r,n,i,s,o,a,u,l,c,h,p,f,d,m;if(a=(p=[0,0])[0],u=p[1],s=(f=[e[0][0],1])[1],t<(i=f[0]))return a;for(r=l=0,h=e.length;l<h;r=++l){if(o=(d=e[r])[0],a=d[1],u=d[2],i=o,r===e.length-1){s=1;break}if(s=e[r+1][0],o<=t&&t<s)break}for(n=[],r=c=0,m=a.length;0<=m?c<m:c>m;r=0<=m?++c:--c)n[r]=(t-i)/(s-i)*(u[r]-a[r])+a[r];return n}}t.exports=function(t,r){var s=e("./../../util/getDefaults.js")(e("./info.json"));return r.colormap=r.colormap||s.colormap,"object"==typeof r.colormap?colormapFunction=n(r.colormap):i.hasOwnProperty(r.colormap)?colormapFunction=i[r.colormap]:colormapFunction=i.default,colormapFunction(t/255)};var i={greyscale:n([[0,[0,0,0],[255,255,255]],[1,[255,255,255],[255,255,255]]]),bluwhtgrngis:n([[0,[6,23,86],[6,25,84]],[.0625,[6,25,84],[6,25,84]],[.125,[6,25,84],[6,25,84]],[.1875,[6,25,84],[6,25,84]],[.25,[6,25,84],[6,25,84]],[.3125,[6,25,84],[9,24,84]],[.3438,[9,24,84],[119,120,162]],[.375,[119,129,162],[249,250,251]],[.406,[249,250,251],[255,255,255]],[.4375,[255,255,255],[255,255,255]],[.5,[255,255,255],[214,205,191]],[.52,[214,205,191],[178,175,96]],[.5625,[178,175,96],[151,176,53]],[.593,[151,176,53],[146,188,12]],[.625,[146,188,12],[96,161,1]],[.6875,[96,161,1],[30,127,3]],[.75,[30,127,3],[0,99,1]],[.8125,[0,99,1],[0,74,1]],[.875,[0,74,1],[0,52,0]],[.9375,[0,52,0],[0,34,0]],[.968,[0,34,0],[68,70,67]]]),brntogrn:n([[0,[110,12,3],[118,6,1]],[.0625,[118,6,1],[141,19,6]],[.125,[141,19,6],[165,35,13]],[.1875,[165,35,13],[177,59,25]],[.2188,[177,59,25],[192,91,36]],[.25,[192,91,36],[214,145,76]],[.3125,[214,145,76],[230,183,134]],[.375,[230,183,134],[243,224,194]],[.4375,[243,224,194],[250,252,229]],[.5,[250,252,229],[217,235,185]],[.5625,[217,235,185],[184,218,143]],[.625,[184,218,143],[141,202,89]],[.6875,[141,202,89],[80,176,61]],[.75,[80,176,61],[0,147,32]],[.8125,[0,147,32],[1,122,22]],[.875,[1,122,22],[0,114,19]],[.9,[0,114,19],[0,105,18]],[.9375,[0,105,18],[7,70,14]]]),blutoredjet:n([[0,[0,0,140],[1,1,186]],[.0625,[1,1,186],[0,1,248]],[.125,[0,1,248],[0,70,254]],[.1875,[0,70,254],[0,130,255]],[.25,[0,130,255],[2,160,255]],[.2813,[2,160,255],[0,187,255]],[.3125,[0,187,255],[6,250,255]],[.375,[8,252,251],[27,254,228]],[.406,[27,254,228],[70,255,187]],[.4375,[70,255,187],[104,254,151]],[.47,[104,254,151],[132,255,19]],[.5,[132,255,19],[195,255,60]],[.5625,[195,255,60],[231,254,25]],[.5976,[231,254,25],[253,246,1]],[.625,[253,246,1],[252,210,1]],[.657,[252,210,1],[255,183,0]],[.6875,[255,183,0],[255,125,2]],[.75,[255,125,2],[255,65,1]],[.8125,[255,65,1],[247,1,1]],[.875,[247,1,1],[200,1,3]],[.9375,[200,1,3],[122,3,2]]]),colors16:n([[0,[0,0,0],[0,0,0]],[.0625,[3,1,172],[3,1,172]],[.125,[3,1,222],[3,1,222]],[.1875,[0,111,255],[0,111,255]],[.25,[3,172,255],[3,172,255]],[.3125,[1,226,255],[1,226,255]],[.375,[2,255,0],[2,255,0]],[.4375,[198,254,0],[190,254,0]],[.5,[252,255,0],[252,255,0]],[.5625,[255,223,3],[255,223,3]],[.625,[255,143,3],[255,143,3]],[.6875,[255,95,3],[255,95,3]],[.75,[242,0,1],[242,0,1]],[.8125,[245,0,170],[245,0,170]],[.875,[223,180,225],[223,180,225]],[.9375,[255,255,255],[255,255,255]]]),default:n([[0,[45,1,121],[25,1,137]],[.125,[25,1,137],[0,6,156]],[.1875,[0,6,156],[7,41,172]],[.25,[7,41,172],[22,84,187]],[.3125,[22,84,187],[25,125,194]],[.375,[25,125,194],[26,177,197]],[.4375,[26,177,197],[23,199,193]],[.47,[23,199,193],[25,200,170]],[.5,[25,200,170],[21,209,27]],[.5625,[21,209,27],[108,215,18]],[.625,[108,215,18],[166,218,19]],[.6875,[166,218,19],[206,221,20]],[.75,[206,221,20],[222,213,19]],[.7813,[222,213,19],[222,191,19]],[.8125,[222,191,19],[227,133,17]],[.875,[227,133,17],[231,83,16]],[.9375,[231,83,16],[220,61,48]]]),fastie:n([[0,[255,255,255],[0,0,0]],[.167,[0,0,0],[255,255,255]],[.33,[255,255,255],[0,0,0]],[.5,[0,0,0],[140,140,255]],[.55,[140,140,255],[0,255,0]],[.63,[0,255,0],[255,255,0]],[.75,[255,255,0],[255,0,0]],[.95,[255,0,0],[255,0,255]]]),stretched:n([[0,[0,0,255],[0,0,255]],[.1,[0,0,255],[38,195,195]],[.5,[0,150,0],[255,255,0]],[.7,[255,255,0],[255,50,50]],[.9,[255,50,50],[255,50,50]]])}},{"./../../util/getDefaults.js":721,"./info.json":584}],582:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(r,n,i,s){var o=(r+n+i)/3,a=e("./Colormap")(o,t);return[a[0],a[1],a[2],255]},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./Colormap":581}],583:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":582,"./info.json":584,dup:547}],584:[function(e,t,r){t.exports={name:"colormap",description:"Maps brightness values (average of red, green & blue) to a given color lookup table, made up of a set of one more color gradients.\n\nFor example, 'cooler' colors like blue could represent low values, while 'hot' colors like red could represent high values.",inputs:{colormap:{type:"select",desc:"Name of the Colormap",default:"default",values:["default","greyscale","bluwhtgrngis","stretched","fastie","brntogrn","blutoredjet","colors16"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#colormap-module"}},{}],585:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return{options:t,draw:function(r,i){var s=this,o=Number(t.startingX||n.startingX),a=Number(t.startingY||n.startingY),u=(t.aspectRatio||n.aspectRatio).split(":"),l=Number(u[0]),c=Number(u[1]);return e("../_nomodule/PixelManipulation")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(t){var r,n,i=t.shape[0],s=t.shape[1];return(i-o)/l*c<=s-a?(r=i,n=(i-o)/l*c+a):(r=(s-a)/c*l+o,n=s),e("../Crop/Crop")(t,{x:o,y:a,w:r-o,h:n-a},function(){})},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../Crop/Crop":595,"../_nomodule/PixelManipulation":712,"./../../util/getDefaults.js":721,"./info.json":587}],586:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":585,"./info.json":587,dup:547}],587:[function(e,t,r){t.exports={name:"constrained-crop",description:"Crops an image in a particular aspect-ratio",inputs:{startingX:{type:"integer",desc:"X-position (measured from left) from where cropping starts",default:0},startingY:{type:"integer",desc:"Y-position (measured from top) from where cropping starts",default:0},aspectRatio:{type:"string",desc:"Enter aspect ratio in following format width:height",default:"1:1"}},"docs-link":""}},{}],588:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return t.contrast=t.contrast||n.contrast,{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;let o=t.contrast;function a(e){return e-=.5,e*=o,e+=.5,e*=255,e=Math.max(0,e),e=Math.min(e,255)}return(o=Number(o))<-100&&(o=-100),o>100&&(o=100),o=(100+o)/100,o*=o,e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){return[a(e/255),a(t/255),a(r/255),n]},format:r.format,image:t.image,callback:n,inBrowser:t.inBrowser,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":590}],589:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":588,"./info.json":590,dup:547}],590:[function(e,t,r){t.exports={name:"contrast",description:"Change the contrast of the image by given value",inputs:{contrast:{type:"integer",desc:"contrast for the new image, typically -100 to 100",default:70,min:-100,max:100}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#contrast-module"}},{}],591:[function(e,t,r){e("lodash");const n=e("../../util/pixelSetter.js");t.exports=function(t,r,s,o){let a=function(e,t){for(t=t.split(" "),i=0;i<9;i++)t[i]=Number(t[i])*e;let r=0,n=[];for(y=0;y<3;y++)for(n.push([]),x=0;x<3;x++)n[y].push(t[r]),r+=1;return n}(r,s),u={r:[],g:[],b:[]};for(let e=0;e<t.shape[1];e++){u.r.push([]),u.g.push([]),u.b.push([]);for(let r=0;r<t.shape[0];r++)u.r[e].push(t.get(r,e,0)),u.g[e].push(t.get(r,e,1)),u.b[e].push(t.get(r,e,2))}const l=(0,e("../_nomodule/gpuUtils").convolve)([u.r,u.g,u.b],a,t.shape[0]*t.shape[1]<4e5);for(let e=0;e<t.shape[1];e++)for(let r=0;r<t.shape[0];r++){var c=[Math.max(0,Math.min(l[0][e][r],255)),Math.max(0,Math.min(l[1][e][r],255)),Math.max(0,Math.min(l[2][e][r],255))];n(r,e,c,t)}return t}},{"../../util/pixelSetter.js":725,"../_nomodule/gpuUtils":714,lodash:376}],592:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return t.kernelValues=t.kernelValues||n.kernelValues,t.constantFactor=t.constantFactor||n.constantFactor,t.texMode=t.texMode||n.texMode,{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(r){return r=e("./Convolution")(r,t.constantFactor,t.kernelValues,t.texMode)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./Convolution":591,"./info.json":594}],593:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":592,"./info.json":594,dup:547}],594:[function(e,t,r){t.exports={name:"convolution",description:"Image Convolution using a given 3x3 kernel matrix <a href='https://en.wikipedia.org/wiki/Kernel_(image_processing)'>Read more</a>",inputs:{constantFactor:{type:"float",desc:"a constant factor, multiplies all the kernel values by that factor",default:.111,min:.001,max:2,step:.001},kernelValues:{type:"string",desc:"nine space separated numbers representing the kernel values in left to right and top to bottom format.",default:"1 1 1 1 1 1 1 1 1",placeholder:"1 1 1 1 1 1 1 1 1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#convolution-module"}},{}],595:[function(e,t,r){const n=e("ndarray"),i=e("../../util/pixelSetter"),s=e("../../util/ParseInputCoordinates");t.exports=function(t,r,o){var a=e("./../../util/getDefaults.js")(e("./info.json"));r.x=r.x||a.x,r.y=r.y||a.y,r.w=r.w||a.w,r.h=r.h||a.h,r.backgroundColor=r.backgroundColor||a.backgroundColor;const u=r.backgroundColor.replace("rgba","").replace("(","").replace(")","").split(",");let l,c,h,p,f=t.shape[0],d=t.shape[1];s({iw:f,ih:d},{x:{valInp:r.x,type:"horizontal"},y:{valInp:r.y,type:"vertical"},w:{valInp:r.w,type:"horizontal"},h:{valInp:r.h,type:"vertical"}},function(e,t){l=Math.floor(t.x.valInp),c=Math.floor(t.y.valInp),h=Math.floor(t.w.valInp),p=Math.floor(t.h.valInp)});const m=new n([],[h,p,4]);for(let e=0;e<h;e++)for(let t=0;t<p;t++)i(e,t,u,m);for(let e=0;e<Math.min(h-1,l+f-1);e++)for(let r=0;r<Math.min(p-1,c+d-1);r++){const n=e+l,s=r+c;i(e,r,[t.get(n,s,0),t.get(n,s,1),t.get(n,s,2),t.get(n,s,3)],m)}return o&&o(),m}},{"../../util/ParseInputCoordinates":718,"../../util/pixelSetter":725,"./../../util/getDefaults.js":721,"./info.json":599,ndarray:389}],596:[function(e,t,r){const n=e("../_nomodule/PixelManipulation");t.exports=function(t,r){if(t.step.inBrowser&&!t.noUI)var i=e("./Ui.js")(t.step,r);var s=!1;return{options:t,draw:function(r,o){var a=this;return t.step.input=r.src,i&&i.hide&&i.hide(),n(r,{output:function(e,r,n,i){a.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(r){return e("./Crop")(r,t,function(){!1===s&&t.step.inBrowser&&!t.noUI&&(s=!0,i.setup())})},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:o,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation":712,"./Crop":595,"./Ui.js":597}],597:[function(e,t,r){t.exports=function(e,t){let r=0,n=0;function i(){return e.imgElement}function s(e,t,r,n){let s=$($(i()).parents()[3]).find("input");s[0].value=e,s[1].value=t,s[2].value=r,s[3].value=n}return{setup:function(){e.imgElement.src=e.input,r=Math.floor(i().naturalWidth),n=Math.floor(i().naturalHeight),s(0,0,r,n),$(i()).imgAreaSelect({handles:!0,x1:0,y1:0,x2:0+r/2,y2:0+n/2,onSelectEnd:function(e,t){let o=function(e,t,s,o){let a=$(i()).width(),u=$(i()).height();return[Math.floor(e/a*r),Math.floor(t/u*n),Math.floor(s/a*r),Math.floor(o/u*n)]}(t.x1,t.y1,t.width,t.height);s(o[0],o[1],o[2],o[3]),$($(i()).parents()[3]).find("input").trigger("change")}})},hide:function(){$(i()).imgAreaSelect({hide:!0})}}}},{}],598:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":596,"./info.json":599,dup:547}],599:[function(e,t,r){t.exports={name:"crop",description:"Crop image to given x, y, w, h in pixels or % , measured from top left",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{x:{type:"string",desc:"X-position (measured from left) from where cropping starts",default:0},y:{type:"string",desc:"Y-position (measured from top) from where cropping starts",default:0},w:{type:"string",desc:"Width of crop",default:"100%"},h:{type:"string",desc:"Height of crop",default:"100%"},backgroundColor:{type:"text",desc:"Background Color",default:"rgba(255,255,255,255)",id:"color-picker"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#crop-module"}},{}],600:[function(e,t,r){t.exports=function(t,r){var n=e("jsqr"),i=e("get-pixels");return{options:t,draw:function(r,s,o){o.stop(!0),o.overrideFlag=!0;var a=this;return i(r.src,function(e,r){if(e)throw e;var i=r.shape[0],s=r.shape[1],o=n(r.data,i,s);t.step.qrval=o?o.data:"undefined"}),e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){a.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,format:r.format,image:t.image,inBrowser:t.inBrowser,callback:s,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"get-pixels":123,jsqr:374}],601:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":600,"./info.json":602,dup:547}],602:[function(e,t,r){t.exports={name:"decode-qr",description:"Search for and decode a QR code in the image",inputs:{},outputs:{qrval:{type:"string"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#decodeqr-module"}},{}],603:[function(e,t,r){t.exports=function(e,t){t=t;let r=[[15,135,45,165],[195,75,225,105],[60,180,30,150],[240,120,210,90]],n=[],i=[],s=[];for(let e=0;e<256;e++)n[e]=.299*e,i[e]=.587*e,s[e]=.114*e;let o=e.data.length;for(let t=0;t<=o;t++)e.data[t]=Math.floor(n[e.data[t++]]+i[e.data[t++]]+s[e.data[t++]]);let a,u,l=e.shape[0];for(let n=0;n<=o;n+=4){if("none"===t)e.data[n]=e.data[n]<129?0:255;else if("bayer"===t){let t=n/4%l,i=Math.floor(n/4/l),s=Math.floor((e.data[n]+r[t%4][i%4])/2);e.data[n]=s<129?0:255}else"floydsteinberg"===t?(a=e.data[n]<129?0:255,u=Math.floor((e.data[n]-a)/16),e.data[n]=a,e.data[n+4]+=7*u,e.data[n+4*l-4]+=3*u,e.data[n+4*l]+=5*u,e.data[n+4*l+4]+=1*u):(a=e.data[n]<129?0:255,u=Math.floor((e.data[n]-a)/8),e.data[n]=a,e.data[n+4]+=u,e.data[n+8]+=u,e.data[n+4*l-4]+=u,e.data[n+4*l]+=u,e.data[n+4*l+4]+=u,e.data[n+8*l]+=u);e.data[n+1]=e.data[n+2]=e.data[n]}return e}},{}],604:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return{options:t,draw:function(r,i,s){s.stop(!0),s.overrideFlag=!0;var o=this;return t.dither=t.dither||n.dither,e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(r){return r=e("./Dither")(r,t.dither)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./Dither":603,"./info.json":606}],605:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":604,"./info.json":606,dup:547}],606:[function(e,t,r){t.exports={name:"dither",description:"Approximates a color from a mixture of other colors when the required color is not available, creating illusions of the color that is not present actually.<a href='https://en.wikipedia.org/wiki/Dither'>Read more</a>",inputs:{dither:{type:"select",desc:"Name of the Dithering Algorithm",default:"none",values:["none","floydsteinberg","bayer","Atkinson"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#dither-module"}},{}],607:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));const i=e("../../util/pixelSetter.js");r.startingX=r.startingX||n.startingX,r.startingY=r.startingY||n.startingY;var s=Number(r.startingX),o=Number(r.startingY),a=t.shape[0],u=t.shape[1],l=Number(r.thickness)||n.thickness,c=Number(r.endX||n.endX)-l||a-1,h=Number(r.endY||n.endY)-l||u-1,p=r.color||n.color;p=(p=p.substring(p.indexOf("(")+1,p.length-1)).split(",");var f=function(e,r,n,s){for(var o=e;o<=n+l;o++)for(var a=r;a<=s+l;a++)i(o,a,[p[0],p[1],p[2]],t)};return f(s,o,s,h),f(c,o,c,h),f(s,o,c,o),f(s,h,c,h),t}},{"../../util/pixelSetter.js":725,"./../../util/getDefaults.js":721,"./info.json":610}],608:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){return[e,t,r,n]},extraManipulation:function(r){return r=e("./DrawRectangle")(r,t)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./DrawRectangle":607}],609:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":608,"./info.json":610,dup:547}],610:[function(e,t,r){t.exports={name:"draw-rectangle",description:"It draws a rectangle on the image",inputs:{startingX:{type:"integer",desc:"starting x position of the rectangle",default:0},startingY:{type:"integer",desc:"starting y position of the rectangle",default:0},endX:{type:"integer",desc:"last x position of the rectangle",default:10},endY:{type:"integer",desc:"last y position of the rectangle",default:10},thickness:{type:"integer",desc:"thickness of border",default:1},color:{type:"text",desc:"Select color",default:"rgba(20,20,20,1)",id:"color-picker"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#draw-rectangle-module"}},{}],611:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return{options:t,draw:function(r,i,s){s.stop(!0),s.overrideFlag=!0;var o=this;t.red=t.red||n.red,t.blue=t.blue||n.blue,t.green=t.green||n.green;const a=e("expr-eval").Parser;function u(e,t,r,n,i){return[e.get(t+n,r+i,0),e.get(t+n,r+i,1),e.get(t+n,r+i,2),e.get(t+n,r+i,3)]}return["red","green","blue","alpha"].forEach(function(e){var r;"alpha"===e?t.alpha_function=function(){return 255}:t[e+"_function"]=(r=t[e],a.parse("R = r; G = g; B = b; A = a; "+r).toJSFunction("r,g,b,a,R,G,B,A"))}),e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,r,n,i){return[t.red_function(e,r,n,i),t.green_function(e,r,n,i),t.blue_function(e,r,n,i),t.alpha_function(e,r,n,i)]},getNeighbourPixel:u,getNeighborPixel:u,format:r.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":613,"expr-eval":72}],612:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":611,"./info.json":613,dup:547}],613:[function(e,t,r){t.exports={name:"dynamic",description:"A module which accepts JavaScript math expressions to produce each color channel based on the original image's color. See <a href='https://publiclab.org/wiki/infragram-sandbox'>Infragrammar</a>.",inputs:{red:{type:"string",desc:"Expression to return for red channel with R, G, B, and A inputs",default:"r"},green:{type:"string",desc:"Expression to return for green channel with R, G, B, and A inputs",default:"g"},blue:{type:"string",desc:"Expression to return for blue channel with R, G, B, and A inputs",default:"b"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#dynamic-module"}},{}],614:[function(e,t,r){const n=e("../../util/pixelSetter.js"),i=[[-1,0,1],[-2,0,2],[-1,0,1]],s=[[-1,-2,-1],[0,0,0],[1,2,1]];function o(e,t){n(t[0],t[1],[0,0,0,255],e)}function a(e,t,r){let n=e.get(t,r,0),o=0,a=0;for(let n=0;n<3;n++)for(let u=0;u<3;u++){let c=t+n-1,h=r+u-1;l(e,c,h)?(o+=e.get(c+1,h+1,0)*i[n][u],a+=e.get(c+1,h+1,0)*s[n][u]):(o+=e.get(c,h,0)*i[n][u],a+=e.get(c,h,0)*s[n][u])}return{pixel:[n,n,n,Math.sqrt(Math.pow(o,2)+Math.pow(a,2))],angle:Math.atan2(a,o)}}function u(e){const t=Math.PI;return(e=e>0?e:t-Math.abs(e))<=t/8||e>7*t/8?1:e>t/8&&e<=3*t/8?2:e>3*t/8&&e<=5*t/8?3:e>5*t/8&&e<=7*t/8?4:void 0}function l(e,t,r){return t<0||r<0||t>=e.shape[0]||r>=e.shape[1]}t.exports=function(e,t,r,i){let s=[],p=[],f=[],d=[],m=[];for(var g=0;g<e.shape[0];g++){p.push([]),s.push([]);for(var v=0;v<e.shape[1];v++){var y=a(e,g,v);let t=y.pixel;p.slice(-1)[0].push(t[3]),s.slice(-1)[0].push(y.angle)}}return function(e,t,r,n){for(let i=0;i<e.shape[0];i++)for(let s=0;s<e.shape[1];s++){let o=u(r[i][s]);if(!l(e,i-1,s-1)&&!l(e,i+1,s+1))switch(o){case 1:t[i][s]>=t[i][s+1]&&t[i][s]>=t[i][s-1]||n.push([i,s]);break;case 2:t[i][s]>=t[i+1][s+1]&&t[i][s]>=t[i-1][s-1]||n.push([i,s]);break;case 3:t[i][s]>=t[i+1][s]&&t[i][s]>=t[i-1][s]||n.push([i,s]);break;case 4:t[i][s]>=t[i+1][s-1]&&t[i][s]>=t[i-1][s+1]||n.push([i,s])}}}(e,p,s,m),function(e,t,r,n,i,s,o){const a=h(n)*t,u=a*r;for(let t=0;t<e.shape[0];t++)for(let r=0;r<e.shape[1];r++){let e=[t,r];n[t][r]>u?n[t][r]>a?i.push(e):s.push(e):o.push(e)}}(e,t,r,p,f,d,m),"true"==i.toLowerCase()&&function(e,t){e.forEach(e=>{let r=e[0],n=e[1];t.includes([r+1,n])?c(t,[r+1,n]):t.includes([r-1,n])?c(t,[r-1,n]):t.includes([r,n+1])?c(t,[r,n+1]):t.includes([r,n-1])&&c(t,[r,n-1])})}(f,d),f.forEach(t=>(function(e,t){n(t[0],t[1],[255,255,255,255],e)})(e,t)),d.forEach(t=>o(e,t)),m.forEach(t=>o(e,t)),e};const c=(e=[],t)=>e.filter(e=>e!==t);var h=e=>Math.max(...e.map(e=>e.map(e=>e||0)).map(e=>Math.max(...e)))},{"../../util/pixelSetter.js":725}],615:[function(e,t,r){const n=e("../Blur/Blur");t.exports=function(t,r){var i=e("./../../util/getDefaults.js")(e("./info.json"));return t.blur=t.blur||i.blur,t.highThresholdRatio=t.highThresholdRatio||i.highThresholdRatio,t.lowThresholdRatio=t.lowThresholdRatio||i.lowThresholdRatio,t.hysteresis=t.hysteresis||i.hysteresis,{options:t,draw:function(r,i,s){s.stop(!0),s.overrideFlag=!0;var o=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){return[(e+t+r)/3,(e+t+r)/3,(e+t+r)/3,n]},extraManipulation:function(r){const i=n(r,t.blur);return e("./EdgeUtils")(i,t.highThresholdRatio,t.lowThresholdRatio,t.hysteresis)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../Blur/Blur":559,"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./EdgeUtils":614,"./info.json":617}],616:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":615,"./info.json":617,dup:547}],617:[function(e,t,r){t.exports={name:"edge-detect",description:"Edge Detect module detects edges using the Canny method, which first blurs the image to reduce noise (amount of blur configurable in settings as `options.blur`), then applies a number of steps to highlight edges, resulting in a greyscale image where the brighter the pixel, the stronger the detected edge. [Read more](https://en.wikipedia.org/wiki/Canny_edge_detector)",inputs:{blur:{type:"float",desc:"Amount of gaussian blur(Less blur gives more detail, typically 0-5)",default:2,min:.05,max:5,step:.05},highThresholdRatio:{type:"float",desc:"The high threshold ratio for the image",default:.2,min:0,max:1,step:.01},lowThresholdRatio:{type:"float",desc:"The low threshold value for the image",default:.15,min:0,max:1,step:.01},hysteresis:{type:"select",desc:"Toggle Hysteresis",values:["false","true"],default:"false"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#edge-detect-module"}},{}],618:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return{options:t,draw:function(r,i,s){t.exposure=t.exposure||n.exposure;var o=Math.pow(2,t.exposure);s.stop(!0),s.overrideFlag=!0;var a=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){a.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){return[e=Math.min(255,e*o),t=Math.min(255,t*o),r=Math.min(255,r*o),n]},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":620}],619:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":618,"./info.json":620,dup:547}],620:[function(e,t,r){t.exports={name:"exposure",description:"Change the exposure of the image by given exposure value",inputs:{exposure:{type:"float",desc:"exposure value for the new image",default:1,min:-3,max:4,step:.05}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#exposure-module"}},{}],621:[function(e,t,r){t.exports=function(t,r){e("fisheyegl");return{options:t,draw:function(r,n){var i=this;if(t.inBrowser){if(document.querySelector("#image-sequencer-canvas"))var s=document.querySelector("#image-sequencer-canvas");else(s=document.createElement("canvas")).style.display="none",s.setAttribute("id","image-sequencer-canvas"),document.body.append(s);distorter=FisheyeGl({selector:"#image-sequencer-canvas"}),t.a=parseFloat(t.a)||distorter.lens.a,t.b=parseFloat(t.b)||distorter.lens.b,t.Fx=parseFloat(t.Fx)||distorter.lens.Fx,t.Fy=parseFloat(t.Fy)||distorter.lens.Fy,t.scale=parseFloat(t.scale)||distorter.lens.scale,t.x=parseFloat(t.x)||distorter.fov.x,t.y=parseFloat(t.y)||distorter.fov.y,distorter.lens.a=t.a,distorter.lens.b=t.b,distorter.lens.Fx=t.Fx,distorter.lens.Fy=t.Fy,distorter.lens.scale=t.scale,distorter.fov.x=t.x,distorter.fov.y=t.y,distorter.setImage(r.src,function(){i.output={src:s.toDataURL(),format:r.format},n()})}else e("../_nomodule/gl-context")(r,n,i,t)},output:void 0,UI:r}}},{"../_nomodule/gl-context":713,fisheyegl:113}],622:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":621,"./info.json":623,dup:547}],623:[function(e,t,r){t.exports={name:"fisheye-gl",description:"Correct fisheye, or barrel distortion, in images (with WebGL -- adapted from fisheye-correction-webgl by @bluemir).",requires:["webgl"],inputs:{a:{type:"float",desc:"a parameter",default:1,min:1,max:4},b:{type:"float",desc:"b parameter",default:1,min:1,max:4},Fx:{type:"float",desc:"Fx parameter",default:0,min:0,max:4},Fy:{type:"float",desc:"Fy parameter",default:0,min:0,max:4},scale:{type:"float",desc:"Image Scaling",default:1.5,min:0,max:20},x:{type:"float",desc:"FOV x parameter",default:1.5,min:0,max:20},y:{type:"float",desc:"FOV y parameter",default:1.5,min:0,max:20},fragmentSrc:{type:"PATH",desc:"Path to a WebGL fragment shader file",default:"(inbuilt)"},vertexSrc:{type:"PATH",desc:"Path to a WebGL vertex shader file",default:"(inbuilt)"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#fisheyegl-module"}},{}],624:[function(e,t,r){const n=e("lodash");t.exports=function(t,r){var i=e("./../../util/getDefaults.js")(e("./info.json"));return t.Axis=t.Axis||i.Axis,{options:t,draw:function(r,i,s){s.stop(!0),s.overrideFlag=!0;var o=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){return[e,t,r,n]},extraManipulation:function(r){const i=n.cloneDeep(r);return e("./flipImage")(i,r,t.Axis)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./flipImage":625,"./info.json":627,lodash:376}],625:[function(e,t,r){t.exports=function(t,r,n){const i=e("../../util/pixelSetter.js");var s=t.shape[0],o=t.shape[1];function a(e,n,s,o){i(e,n,[t.get(s,o,0),t.get(s,o,1),t.get(s,o,2),t.get(s,o,3)],r)}return function(){if("vertical"==n.toLowerCase())for(var e=0;e<s;e++)for(var t=0;t<o;t++)a(e,t,e,o-t-1);else for(e=0;e<s;e++)for(t=0;t<o;t++)a(e,t,s-e-1,t)}(),r}},{"../../util/pixelSetter.js":725}],626:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":624,"./info.json":627,dup:547}],627:[function(e,t,r){t.exports={name:"flip-image",description:"Flip The Image On The Specified Axis.",inputs:{Axis:{type:"select",desc:"Axis",default:"Vertical",values:["Horizontal","Vertical"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#flipimage-module"}},{}],628:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this,o=e("./../../util/getDefaults.js")(e("./info.json")),a=t.adjustment||o.adjustment;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){return[e=255*Math.pow(e/255,a),t=255*Math.pow(t/255,a),r=255*Math.pow(r/255,a),n]},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":630}],629:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":628,"./info.json":630,dup:547}],630:[function(e,t,r){t.exports={name:"gamma-correction",description:"Apply gamma correction on the image <a href='https://en.wikipedia.org/wiki/Gamma_correction'>Read more</a>",inputs:{adjustment:{type:"float",desc:"gamma correction (inverse of actual gamma factor) for the new image",default:.5,min:0,max:5,step:.1}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#gamma-correction-module"}},{}],631:[function(e,t,r){const n=e("../../util/pixelSetter.js"),i=e("../_nomodule/PixelManipulation");t.exports=function(t,r){var s=e("./../../util/getDefaults.js")(e("./info.json"));return t.gradientType=t.gradientType||s.gradientType,{options:t,draw:function(e,r){var s=this;return i(e,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},extraManipulation:function(e){const[r,i]=e.shape;if("linear"===t.gradientType)for(var s=0;s<r;s++)for(var o=0;o<i;o++){let t=s/r*255;n(s,o,[t,t,t,255],e)}else for(s=0;s<r;s++)for(o=0;o<i;o++){var a=Math.abs(r/2-s),u=Math.abs(i/2-o),l=Math.sqrt(Math.pow(a,2)+Math.pow(u,2));val=l/e.shape[0]*255,n(s,o,[val,val,val,255],e)}return e},callback:r,format:e.format,image:t.image,inBrowser:t.inBrowser,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../../util/pixelSetter.js":725,"../_nomodule/PixelManipulation":712,"./../../util/getDefaults.js":721,"./info.json":633}],632:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":631,"./info.json":633,dup:547}],633:[function(e,t,r){t.exports={name:"gradient",description:"Gives a gradient of the image",inputs:{gradientType:{type:"select",desc:"Choose between linear or circular gradient",default:"linear",values:["linear","circular"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#gradient-module"}},{}],634:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));const i=e("../../util/pixelSetter.js");0==Number(r.x)&&(r.x=1),0==Number(r.y)&&(r.y=1),r.x=Math.abs(Number(r.x))||n.x,r.y=Math.abs(Number(r.y))||n.y,color=r.color||n.color,color=color.substring(color.indexOf("(")+1,color.length-1),color=color.split(",");for(var s=0;s<t.shape[0];s+=r.x)for(var o=0;o<t.shape[1];o++)i(s,o,[color[0],color[1],color[2]],t);for(o=0;o<t.shape[1];o+=r.y)for(s=0;s<t.shape[0];s++)i(s,o,[color[0],color[1],color[2]],t);return t}},{"../../util/pixelSetter.js":725,"./../../util/getDefaults.js":721,"./info.json":637}],635:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(r){return r=e("./GridOverlay")(r,t)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./GridOverlay":634}],636:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":635,"./info.json":637,dup:547}],637:[function(e,t,r){t.exports={name:"grid-overlay",description:"Overlays a grid over an Image",inputs:{x:{type:"integer",desc:"X-position (measured from left) from where grid starts",default:100},y:{type:"integer",desc:"Y-position (measured from top) from where grid starts",default:100},color:{type:"string",desc:"Pick color",default:"rgba(0,0,0,1)",id:"color-picker"}},only:"browser"}},{}],638:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){const s=e("./../../util/getDefaults.js")(e("./info.json")),o=e("../../util/pixelSetter.js");t.gradient=t.gradient||s.gradient,t.gradient=String(JSON.parse(t.gradient)),i.stop(!0),i.overrideFlag=!0;var a=this,u=new Array(256).fill(0);return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){a.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){let i=Math.round((e+t+r)/3);return u[i]++,[e,t,r,n]},extraManipulation:function(e){var r=new Uint8Array(262144);e.data=r,e.shape=[256,256,4],e.stride[1]=1024;for(let t=0;t<256;t++)for(let r=0;r<256;r++)o(t,r,[255,255,255,255],e);let n=t.gradient?10:0;if(t.gradient)for(let t=0;t<256;t++)for(let r=0;r<10;r++)o(t,255-r,[t,t,t],e);let i=(256-n)/Math.max(...u);for(let t=0;t<256;t++){let r=Math.round(i*u[t]);for(let i=n;i<r;i++)o(t,255-i,[204,255,153],e)}return e},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../../util/pixelSetter.js":725,"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":640}],639:[function(e,t,r){t.exports=[e("./Module.js"),e("./info.json")]},{"./Module.js":638,"./info.json":640}],640:[function(e,t,r){t.exports={name:"histogram",description:"Calculates the histogram for the image",inputs:{gradient:{type:"select",desc:"Toggle the gradient along x-axis",default:"true",values:["true","false"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#histogram-module"}},{}],641:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));(t.imageUrl=t.inBrowser?t.url||n.url:t.url||"./examples/images/monarch.png",t.step.inBrowser)&&e("./Ui.js")(t.step,r).setup();return{options:t,draw:function(e,r){var n=this;n.metadata=n.metadata||{},n.metadata.input=e;var i=ImageSequencer({inBrowser:t.inBrowser,ui:!1,useWasm:t.useWasm});i.loadImages(t.imageUrl,()=>{n.output=i.steps[0].output,r()})},output:void 0,UI:r}}},{"./../../util/getDefaults.js":721,"./Ui.js":642,"./info.json":644}],642:[function(e,t,r){t.exports=function(e,t){return{setup:function(t,r){var n="dropzone-import-image-"+e.ID,i=' <div class="dropzone import-image-zone" id="'+n+'"> <p> <i>Select or drag in an image to overlay.</i> </p> <center> <input type="file" class="file-input" value=""> </center> </div>';$(e.ui).find(".details").prepend(i),sequencer.setInputStep({dropZoneSelector:"#"+n,fileInputSelector:"#"+n+" .file-input",onLoad:function(t){var r=t.target;e.options.imageUrl=r.result,e.options.url=r.result,sequencer.run(),setUrlHashParameter("steps",sequencer.toString())}}),$(e.ui).find(".btn-save").on("click",function(){var t=$(e.ui).find(".det input").val();e.options.imageUrl=t,sequencer.run()})}}}},{}],643:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":641,"./info.json":644,dup:547}],644:[function(e,t,r){t.exports={name:"import-image",description:"Import a new image and replace the original with it. Future versions may enable a blend mode. Specify an image by URL or by file selector.",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{url:{type:"string",desc:"URL of image to import",default:"./images/monarch.png"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#import-image-module"}},{}],645:[function(e,t,r){const n=e("../_nomodule/PixelManipulation");t.exports=function(e,t){return{options:e,draw:function(t,r,i){i.stop(!0),i.overrideFlag=!0;var s=this;return n(t,{output:function(t,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:e.useWasm}},changePixel:function(e,t,r,n){return[255-e,255-t,255-r,n]},format:t.format,image:e.image,inBrowser:e.inBrowser,callback:r,useWasm:e.useWasm})},output:void 0,UI:t}}},{"../_nomodule/PixelManipulation":712}],646:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":645,"./info.json":647,dup:547}],647:[function(e,t,r){t.exports={name:"invert",description:"Inverts the image.",inputs:{},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#invert-module"}},{}],648:[function(e,t,r){t.exports=function(t,r,n){var i=e("./../../util/getDefaults.js")(e("./info.json"));return t.offset=t.offset||i.offset,t.resize=t.resize||i.resize,{options:t,draw:function(n,i,s){s.stop(!0),s.overrideFlag=!0;var o=this,a=e("get-pixels");"string"==typeof t.offset&&(t.offset=parseInt(t.offset));var u=this.getStep(t.offset);void 0===u.output&&(this.output=n,r.notify("Offset Unavailable","offset-notification"),i());const l=function(e,t){return(t*e+(255-t)*e)/255},c=ImageSequencer({inBrowser:!1,ui:!1});c.loadImage(u.output.src,function(){c.importJSON([{name:"resize",options:{resize:t.resize}}]),c.run(function(r){a(r,function(r,s){return t.firstImagePixels=s,e("../_nomodule/PixelManipulation.js")(n,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,r,n,i,s,o){let a=t.firstImagePixels,u=a.get(s,o,0),c=a.get(s,o,1),h=a.get(s,o,2);return a.get(s,o,3),[l(u,i),l(c,i),l(h,i)]},format:n.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})})})})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":650,"get-pixels":123}],649:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":648,"./info.json":650,dup:547}],650:[function(e,t,r){t.exports={name:"mask",description:"Masks two images according to their Alpha values",inputs:{offset:{type:"integer",desc:"Choose which image to mask the current image with. Two steps back is -2, three steps back is -3 etc.",default:-2},resize:{type:"string",desc:"Percentage value by which first image is to be resized",default:"125%"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],651:[function(e,t,r){(function(r){t.exports=function(t,n){return t.inBrowser||(base64Img=e("base64-img"),imagemin=e("imagemin"),imageminJpegtran=e("imagemin-jpegtran"),imageminPngquant=e("imagemin-pngquant")),{options:t,draw:function(n,i,s){s.stop(!0),s.overrideFlag=!0;var o=this;if(t.inBrowser)new(e("compressorjs"))(function(e){for(var t=atob(e.split(",")[1]),r=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),i=new Uint8Array(n),s=0;s<t.length;s++)i[s]=t.charCodeAt(s);return new Blob([n],{type:r})}(n.src),{quality:t.quality||.5,success(e){var t=new FileReader;t.readAsDataURL(e),t.onloadend=function(){base64data=t.result,u(0,base64data,n.format,!1),i&&i()}},error(e){console.log(e.message)}});else{let e=r+"/images/";var a=base64Img.imgSync(n.src,e,"test");(async()=>{await imagemin([a],{destination:r+"/results/",plugins:[imageminJpegtran(),imageminPngquant({quality:[.6,.8]})]});var e=r+"/results/test."+n.format;u(0,base64Img.base64Sync(e),n.format,!1),i&&i()})().catch(e=>console.log(e))}function u(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}}},output:void 0,UI:n}}}).call(this,"/src/modules/MinifyImage")},{"base64-img":27,compressorjs:37,imagemin:352,"imagemin-jpegtran":326,"imagemin-pngquant":330}],652:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":651,"./info.json":653,dup:547}],653:[function(e,t,r){t.exports={name:"minify-image",description:"Minifies the given image (Works for jpg/jpeg/webp images in browser)",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{quality:{type:"float",desc:"quality aspect of the given image",default:"0.5"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#add-qr-module"}},{}],654:[function(e,t,r){t.exports=function(t,r){if(t.step.inBrowser)var n=e("./Ui.js")(t.step,r);var i=e("./../../util/getDefaults.js")(e("./info.json"));return t.filter=t.filter||i.filter,{options:t,draw:function(r,i,s){s.stop(!0),s.overrideFlag=!0;var o=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,r,n,i){if("red"==t.filter)var s=(n-e)/(1*n+e);"blue"==t.filter&&(s=(e-n)/(1*n+e));var o=255*(s+1)/2;return[o,o,o,i]},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:function(){t.step.inBrowser&&n.setup(),i()},useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./Ui.js":655,"./info.json":657}],655:[function(e,t,r){t.exports=function(e,t){return{setup:function(){var t=$(e.imgElement);t.mousemove(function(e){var r=document.createElement("canvas");r.width=t.width(),r.height=t.height(),r.getContext("2d").drawImage(this,0,0);var n=$(this).offset(),i=e.pageX-n.left,s=e.pageY-n.top,o=r.getContext("2d").getImageData(i,s,1,1).data[0];o=(o=o/127.5-1).toFixed(2),t[0].title="NDVI: "+o})}}}},{}],656:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":654,"./info.json":657,dup:547}],657:[function(e,t,r){t.exports={name:"ndvi",description:"Normalized Difference Vegetation Index, or NDVI, is an image analysis technique used with aerial photography. It's a way to visualize the amounts of infrared and other wavelengths of light reflected from vegetation by comparing ratios of blue and red light absorbed versus green and IR light reflected. NDVI is used to evaluate the health of vegetation in satellite imagery, where it correlates with how much photosynthesis is happening. This is helpful in assessing vegetative health or stress. <a href='https://publiclab.org/ndvi'>Read more</a>.<br /><br/>This is designed for use with red-filtered single camera <a href='http://publiclab.org/infragram'>DIY Infragram cameras</a>; change to 'blue' for blue filters",inputs:{filter:{type:"select",desc:"Filter color",default:"red",values:["red","blue"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#ndvi-module"}},{}],658:[function(e,t,r){t.exports=e("../../util/createMetaModule.js")(function(e){return[{name:"ndvi",options:{}},{name:"colormap",options:{colormap:e.colormap}}]},{infoJson:e("./info.json")})[0]},{"../../util/createMetaModule.js":719,"./info.json":660}],659:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":658,"./info.json":660,dup:547}],660:[function(e,t,r){t.exports={name:"ndvi-colormap",description:"Sequentially Applies NDVI and Colormap steps",inputs:{filter:{type:"select",desc:"Filter color",default:"red",values:["red","blue"]},colormap:{type:"select",desc:"Name of the Colormap",default:"default",values:["default","greyscale","stretched","fastie"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#ndvi-colormap-module"}},{}],661:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return{options:t,draw:function(r,i,s){s.stop(!0),s.overrideFlag=!0;var o=this;return t.method=t.method||n.method,e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(r){return r=e("./NoiseReduction.js")(r,t.method)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./NoiseReduction.js":662,"./info.json":664}],662:[function(e,t,r){t.exports=function(e,t){let r=[-1,-1,-1,0,0,0,1,1,1],n=[-1,0,1,-1,0,1,-1,0,1];if("Median Filtering"==t)for(let t=0;t<e.shape[1];t++)for(let i=0;i<e.shape[0];i++){let s=0,o=0,a=[],u=[],l=[];for(;o<=8;){let c=i+r[o],h=t+n[o];c>=0&&c<e.shape[0]&&h>=0&&h<e.shape[1]&&(a[s]=e.get(c,h,0),u[s]=e.get(c,h,1),l[s]=e.get(c,h,2),s++),o++}if(a.sort(),u.sort(),l.sort(),s%2==0){let r=a[s/2]+a[s/2-1];e.set(i,t,0,r),r=u[s/2]+u[s/2-1],e.set(i,t,1,r),r=l[s/2]+l[s/2-1],e.set(i,t,2,r)}else e.set(i,t,0,a[Math.floor(s/2)]),e.set(i,t,1,u[Math.floor(s/2)]),e.set(i,t,2,l[Math.floor(s/2)])}else if("Mean Filtering"==t)for(let t=0;t<e.shape[1];t++)for(let i=0;i<e.shape[0];i++){let s=0,o=0,a=0,u=0,l=0;for(;o<=8;){let c=i+r[o],h=t+n[o];c>=0&&c<e.shape[0]&&h>=0&&h<e.shape[1]&&(a+=e.get(c,h,0),u+=e.get(c,h,1),l+=e.get(c,h,2),s++),o++}e.set(i,t,0,a/s),e.set(i,t,1,u/s),e.set(i,t,2,l/s)}return e}},{}],663:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":661,"./info.json":664,dup:547}],664:[function(e,t,r){t.exports={name:"Noise Reduction",description:"Reduces noise from Image",inputs:{method:{type:"select",desc:"Select the noise filtering method",default:"Median Filtering",values:["Mean Filtering","Median Filtering"]}},"docs-link":""}},{}],665:[function(e,t,r){t.exports=function(t,r,n){const i=e("./../../util/getDefaults.js")(e("./info.json"));let s;return t.x=t.x||i.x,t.y=t.y||i.y,t.step.inBrowser&&!t.noUI&&sequencer.getSteps().length<2&&(t.offset=-1),t.step.inBrowser&&!t.noUI&&(s=e("./Ui.js")(t.step,r)),{options:t,draw:function(r,n,o){t.offset=parseInt(t.offset||i.offset),o.stop(!0),o.overrideFlag=!0;const a=this,u=e("../../util/ParseInputCoordinates"),l=this.getStep(t.offset).image,c=this.getOutput(t.offset);e("get-pixels")(r.src,function(r,i){return u({iw:i.shape[0],ih:i.shape[1]},{x:{valInp:t.x,type:"horizontal"},y:{valInp:t.y,type:"vertical"}},function(e,r){t.x=parseInt(r.x.valInp),t.y=parseInt(r.y.valInp)}),t.secondImagePixels=i,e("../_nomodule/PixelManipulation.js")(c,{output:function(e,r,n,i){a.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,r,n,i,s,o){const a=[e,r,n,i],u=t.secondImagePixels;if(s>=t.x&&s-t.x<u.shape[0]&&o>=t.y&&o-t.y<u.shape[1]){const e=[u.get(s-t.x,o-t.y,0),u.get(s-t.x,o-t.y,1),u.get(s-t.x,o-t.y,2),u.get(s-t.x,o-t.y,3)];return 0===e[3]?a:e}return a},format:c.format,image:l,inBrowser:t.inBrowser,callback:function(){t.step.inBrowser&&!t.noUI&&s.setup(),n()},useWasm:t.useWasm})})},output:void 0,UI:r}}},{"../../util/ParseInputCoordinates":718,"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./Ui.js":666,"./info.json":668,"get-pixels":123}],666:[function(e,t,r){t.exports=function(e,t){return{setup:function(){sequencer.getSteps().forEach(function(t,r){t.options&&e.options.number===t.options.number&&(1===r?(e.ui.querySelector("input[type=range]").value=-1,e.ui.querySelector("input[type=range]").min=-1):e.ui.querySelector("input[type=range]").min=-r)})}}}},{}],667:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":665,"./info.json":668,dup:547}],668:[function(e,t,r){t.exports={name:"overlay",description:"Overlays an Image over another at a given position(x,y) in pixels or in %",inputs:{x:{type:"integer",desc:"X-position of the image on which the new image is overlayed",default:0},y:{type:"integer",desc:"Y-position of the image on which the new image is overlayed",default:0},offset:{type:"integer",desc:"offset to the output of the step on which the output of the last step is overlayed",default:-2,min:-2,max:-1,step:1}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#overlay-module"}},{}],669:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(r){return r=e("./PaintBucket")(r,t)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./PaintBucket":670}],670:[function(e,t,r){t.exports=function(t,r){let n=e("./../../util/getDefaults.js")(e("./info.json"));const i=e("../../util/pixelSetter.js");let s,o,a,u,l,c=r.fillColor||n.fillColor,h=parseInt(r.startingX)||n.startingX,p=parseInt(r.startingY)||n.startingY,f=t.shape[1],d=(t.shape[0],t.get(h,p,0)),m=t.get(h,p,1),g=t.get(h,p,2),v=t.get(h,p,3),y=[h],_=[p],b=r.tolerance||n.tolerance,x=1+b/100,w=1-b/100;function E(e,r){return t.get(e,r,0)>=d*w&&t.get(e,r,0)<=d*x&&t.get(e,r,1)>=m*w&&t.get(e,r,1)<=m*x&&t.get(e,r,2)>=g*w&&t.get(e,r,2)<=g*x&&t.get(e,r,3)>=v*w&&t.get(e,r,3)<=v*x}for((c=(c=c.substring(c.indexOf("(")+1,c.length-1)).split(","))[3]=255*c[3];_.length;)if(E(o=y.pop(),s=_.pop())){a=u=s;do{a-=1}while(E(o,a)&&a>=0);do{u+=1}while(E(o,u)&&u<f);for(l=a+1;l<u;l+=1)i(o,l,c,t),E(o-1,l)&&(y.push(o-1),_.push(l)),E(o+1,l)&&(y.push(o+1),_.push(l))}return t}},{"../../util/pixelSetter.js":725,"./../../util/getDefaults.js":721,"./info.json":672}],671:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":669,"./info.json":672,dup:547}],672:[function(e,t,r){t.exports={name:"paint-bucket",description:"Fill color in pixels",inputs:{startingX:{type:"integer",desc:"value of the starting x-coordinate",default:"10"},startingY:{type:"integer",desc:"value of the starting y-coordinate",default:"10"},fillColor:{type:"String",desc:"Pick color to fill",default:"rgba(100,100,100,1)",id:"color-picker"},tolerance:{type:"range",desc:"% tolerance",default:"10",min:"0",max:"100",step:"1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#paint-bucket-module"}},{}],673:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){return[e,t,r,n]},extraManipulation:function(r){return r=e("./ReplaceColor")(r,t)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./ReplaceColor":674}],674:[function(e,t,r){t.exports=function(t,r){const n=e("../../util/pixelSetter.js");var i=e("./../../util/getDefaults.js")(e("./info.json")),s=r.color||i.color;s=s.substring(s.indexOf("(")+1,s.length-1);var o=r.replaceColor||i.replaceColor;o=o.substring(o.indexOf("(")+1,o.length-1);var a=r.replaceMethod||i.replaceMethod;s=s.split(","),o=o.split(",");var u=s[0],l=s[1],c=s[2],h=r.tolerance||i.tolerance,p=1+h/100,f=1-h/100;function d(e,t,r){return e>=u*f&&e<=u*p&&t>=l*f&&t<=l*p&&r>=c*f&&r<=c*p}for(var m=0;m<t.shape[0];m++)for(var g=0;g<t.shape[1];g++){var v=t.get(m,g,0),y=t.get(m,g,1),_=t.get(m,g,2);if(d(v,y,_))if("greyscale"==a){var b=(v+y+_)/3;n(m,g,[b,b,b],t)}else n(m,g,o,t)}return t}},{"../../util/pixelSetter.js":725,"./../../util/getDefaults.js":721,"./info.json":676}],675:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":673,"./info.json":676,dup:547}],676:[function(e,t,r){t.exports={name:"replace-color",description:"Replace color with grey or your desired color",inputs:{replaceMethod:{type:"select",desc:"Replace Method",default:"greyscale",values:["greyscale","replaceByColor"]},replaceColor:{type:"String",desc:"Pick color to be filled",default:"rgb(0,0,255)",id:"color-picker"},color:{type:"String",desc:"Pick color to be replaced",default:"rgb(228,86,81)",id:"color-picker"},tolerance:{type:"range",desc:"% tolerance",default:"50",min:"0",max:"100",step:"1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#replacecolor-module"}},{}],677:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){const s=e("./../../util/getDefaults.js")(e("./info.json"));t.resize=t.resize||s.resize,i.stop(!0),i.overrideFlag=!0;const o=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(r){return e("./Resize")(r,t)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./Resize":678,"./info.json":680}],678:[function(e,t,r){const n=e("imagejs"),i=e("../../util/pixelSetter"),s=e("ndarray");t.exports=function(e,t){const r=parseFloat(t.resize);if(100==r)return e;const o=Math.round(e.shape[0]*(r/100)),a=Math.round(e.shape[1]*(r/100)),u=new n.Bitmap({width:e.shape[0],height:e.shape[1]});for(let t=0;t<e.shape[0];t++)for(let r=0;r<e.shape[1];r++){let n=e.get(t,r,0),i=e.get(t,r,1),s=e.get(t,r,2),o=e.get(t,r,3);u.setPixel(t,r,n,i,s,o)}const l=u.resize({width:o,height:a,algorithm:"bicubicInterpolation"}),c=new s([],[o,a,4]);for(let e=0;e<o;e++)for(let t=0;t<a;t++){const{r:r,g:n,b:s,a:o}=l.getPixel(e,t);i(e,t,[r,n,s,o],c)}return c}},{"../../util/pixelSetter":725,imagejs:318,ndarray:389}],679:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":677,"./info.json":680,dup:547}],680:[function(e,t,r){t.exports={name:"resize",description:"Resize image by given percentage value",inputs:{resize:{type:"string",desc:"Percentage value of the resize",default:"125%"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#resize-module"}},{}],681:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){const s=e("./../../util/getDefaults.js")(e("./info.json"));t.rotate=t.rotate||s.rotate,i.stop(!0),i.overrideFlag=!0;const o=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){return[e,t,r,n]},extraManipulation:function(r){const n=t.rotate%360;radians=Math.PI*n/180,width=r.shape[0],height=r.shape[1],cos=Math.cos(radians),sin=Math.sin(radians);const i=e("ndarray")(new Uint8Array(Math.floor(Math.abs(width*cos)+Math.abs(height*sin)+5)*(Math.floor(Math.abs(width*sin)+Math.abs(height*cos))+5)*4).fill(255),[Math.floor(Math.abs(width*cos)+Math.abs(height*sin))+5,Math.floor(Math.abs(width*sin)+Math.abs(height*cos))+4,4]);return r=e("./Rotate")(r,i,n,width,height,cos,sin)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./Rotate":682,"./info.json":684,ndarray:389}],682:[function(e,t,r){const n=e("imagejs"),i=e("ndarray"),s=e("../../util/pixelSetter");t.exports=function(e,t,r,o,a,u,l){const c=Math.floor(a/2),h=Math.floor(o/2);if(dimension=o+a,r%360==0)return e;function p(e,t,r,n,i,s){i.set(e,t,0,s.get(r,n,0)),i.set(e,t,1,s.get(r,n,1)),i.set(e,t,2,s.get(r,n,2)),i.set(e,t,3,s.get(r,n,3))}const f=new i(new Uint8Array(4*dimension*dimension).fill(255),[dimension,dimension,4]);for(let t=0;t<e.shape[0];t++)for(let r=0;r<e.shape[1];r++)p(t+c,r+h,t,r,f,e);const d=new n.Bitmap({width:f.shape[0],height:f.shape[1]});for(let e=0;e<f.shape[0];e++)for(let t=0;t<f.shape[1];t++){let r=f.get(e,t,0),n=f.get(e,t,1),i=f.get(e,t,2),s=f.get(e,t,3);d.setPixel(e,t,r,n,i,s)}const m=d.rotate({degrees:r});for(let e=0;e<f.shape[0];e++)for(let t=0;t<f.shape[1];t++){const{r:r,g:n,b:i,a:o}=m.getPixel(e,t);s(e,t,[r,n,i,o],f)}for(let e=0;e<t.shape[0];e++)for(let r=0;r<t.shape[1];r++)p(e,r,e+Math.floor(dimension/2-Math.abs(o*u/2)-Math.abs(a*l/2))-1,r+Math.floor(dimension/2-Math.abs(a*u/2)-Math.abs(o*l/2))-1,t,f);return t}},{"../../util/pixelSetter":725,imagejs:318,ndarray:389}],683:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":681,"./info.json":684,dup:547}],684:[function(e,t,r){t.exports={name:"rotate",description:"Rotates image by specified degrees",inputs:{rotate:{type:"integer",desc:"Angular value for rotation in degrees",default:"90",min:"0",max:"360",step:"1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#rotate-modul"}},{}],685:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return{options:t,draw:function(r,i,s){t.saturation=t.saturation||n.saturation,s.stop(!0),s.overrideFlag=!0;var o=this,a=.299,u=.587,l=.114;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){o.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,r,n,i){var s=Math.sqrt(a*(e*e)+u*(r*r)+l*(r*r));return e=s+(e-s)*t.saturation,r=s+(r-s)*t.saturation,n=s+(n-s)*t.saturation,[Math.round(e),Math.round(r),Math.round(n),i]},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":687}],686:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":685,"./info.json":687,dup:547}],687:[function(e,t,r){t.exports={name:"saturation",description:"Change the saturation of the image by given value, from 0-1, with 1 being 100% saturated.",inputs:{saturation:{type:"float",desc:"saturation for the new image between 0 and 2, 0 being black and white and 2 being highly saturated",default:.5,min:0,max:2,step:.1}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#saturation-module"}},{}],688:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));const i=e("../../util/pixelSetter.js");return{options:t,draw:function(r,s,o){t.X_value=parseInt(t.X_value||n.X_value),t.Y_value=parseInt(t.Y_value||n.Y_value),o.stop(!0),o.overrideFlag=!0;var a=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){a.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(r){let[n,s]=r.shape,o=e("ndarray")(new Uint8Array(4*(n+Math.abs(t.X_value))*(s+Math.abs(t.Y_value))).fill(0),[n+Math.abs(t.X_value),s+Math.abs(t.Y_value),4]),a=n,u=s;if(t.X_value<0&&t.Y_value<0){for(var l=0;l<Math.abs(t.X_value);l++)for(var c=0;c<s+Math.abs(t.Y_value);c++){let e=255-l/Math.abs(t.X_value)*255;i(l,c,[e,e,e,255],o)}for(l=0;l<n+Math.abs(t.X_value);l++)for(c=0;c<Math.abs(t.Y_value);c++){if(l<Math.abs(t.X_value)&&l<c)continue;let e=255-c/Math.abs(t.Y_value)*255;i(l,c,[e,e,e,255],o)}for(let e=0;e<a&&e<n;e++)for(let n=0;n<u&&n<s;n++){let s=e+Math.abs(t.X_value),a=n+Math.abs(t.Y_value);i(s,a,[r.get(e,n,0),r.get(e,n,1),r.get(e,n,2),r.get(e,n,3)],o)}}else if(t.X_value>=0&&t.Y_value>=0){for(l=n;l<n+t.X_value;l++)for(c=0;c<s+t.Y_value;c++){let e=(l-n)/t.X_value*255;i(l,c,[e,e,e,255],o)}for(l=0;l<n+t.X_value;l++)for(c=s;c<s+t.Y_value;c++){if(l>=n&&c>=s&&l-n>=c-s)continue;let e=(c-s)/t.Y_value*255;i(l,c,[e,e,e,255],o)}for(let e=0;e<a&&e<n;e++)for(let t=0;t<u&&t<s;t++)i(e,t,[r.get(e,t,0),r.get(e,t,1),r.get(e,t,2),r.get(e,t,3)],o)}else if(t.X_value<0&&t.Y_value>=0){for(l=0;l<n+Math.abs(t.X_value);l++)for(c=s;c<s+t.Y_value;c++){let e=(c-s)/t.Y_value*255;i(l,c,[e,e,e,255],o)}for(l=0;l<Math.abs(t.X_value);l++)for(c=0;c<s+t.Y_value;c++){if(c+l*(t.Y_value/Math.abs(t.X_value))-(t.Y_value+s)>0&&c>=s)continue;let e=255-l/Math.abs(t.X_value)*255;i(l,c,[e,e,e,255],o)}for(let e=0;e<a&&e<n;e++)for(let n=0;n<u&&n<s;n++){let s=e+Math.abs(t.X_value);i(s,n,[r.get(e,n,0),r.get(e,n,1),r.get(e,n,2),r.get(e,n,3)],o)}}else if(t.X_value>=0&&t.Y_value<0){for(l=n;l<n+t.X_value;l++)for(c=0;c<s+Math.abs(t.Y_value);c++){let e=(l-n)/t.X_value*255;i(l,c,[e,e,e,255],o)}for(l=0;l<n+t.X_value;l++)for(c=0;c<Math.abs(t.Y_value);c++){if(c>=t.X_value/Math.abs(t.Y_value)*(n+t.X_value-l)&&l>=n)continue;let e=255-c/Math.abs(t.Y_value)*255;i(l,c,[e,e,e,255],o)}for(let e=0;e<a&&e<n;e++)for(let n=0;n<u&&n<s;n++){let s=e,a=n+Math.abs(t.Y_value);i(s,a,[r.get(e,n,0),r.get(e,n,1),r.get(e,n,2),r.get(e,n,3)],o)}}return o},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:s,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../../util/pixelSetter.js":725,"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":690,ndarray:389}],689:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":688,"./info.json":690,dup:547}],690:[function(e,t,r){t.exports={name:"shadow",description:"Creates a two sided shadow.",inputs:{X_value:{type:"integer",desc:"X-value",default:20},Y_value:{type:"integer",desc:"Y-value",default:20}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#shadow-module"}},{}],691:[function(e,t,r){t.exports=function(t,r){let n=e("./../../util/getDefaults.js")(e("./info.json"));return t.sharpenStrength=t.sharpenStrength||n.sharpenStrength,t.sharpenStrength=parseFloat(t.sharpenStrength),{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;let s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,inBrowser:t.inBrowser,extraManipulation:function(r){return r=e("./Sharpen")(r,t.sharpenStrength)},format:r.format,image:t.image,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./Sharpen":692,"./info.json":694}],692:[function(e,t,r){t.exports=function(t,r){const n=e("../../util/pixelSetter.js");let i=function(e=1){return[[0,-1*e,0],[-1*e,5*e,-1*e],[0,-1*e,0]]}(r),s={r:[],g:[],b:[]};for(let e=0;e<t.shape[1];e++){s.r.push([]),s.g.push([]),s.b.push([]);for(let r=0;r<t.shape[0];r++)s.r[e].push(t.get(r,e,0)),s.g[e].push(t.get(r,e,1)),s.b[e].push(t.get(r,e,2))}const o=(0,e("../_nomodule/gpuUtils").convolve)([s.r,s.g,s.b],i);for(let e=0;e<t.shape[1];e++)for(let r=0;r<t.shape[0];r++){n(r,e,[Math.max(0,Math.min(o[0][e][r],255)),Math.max(0,Math.min(o[1][e][r],255)),Math.max(0,Math.min(o[2][e][r],255))],t)}return t}},{"../../util/pixelSetter.js":725,"../_nomodule/gpuUtils":714}],693:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":691,"./info.json":694,dup:547}],694:[function(e,t,r){t.exports={name:"sharpen",description:"Applies a sharpening filter given by the intensity value",inputs:{sharpenStrength:{type:"float",desc:"Amount of sharpening (More sharpening gives more detail, but may lead to overexposure)",default:1,min:1,max:1.5,step:.05}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#sharpen-module"}},{}],695:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n){var i=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,s){i.output={src:r,format:n,wasmSuccess:s,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(n,i,s){e("../../util/getDataUri")(n,r.format).then(r=>{i(!1),n=e("./TextOverlay")(n,t,r,()=>{i(!0),s()})})},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../../util/getDataUri":720,"../_nomodule/PixelManipulation.js":712,"./TextOverlay":696}],696:[function(e,t,r){const n=e("get-pixels"),i=e("../../util/pixelSetter.js");t.exports=function(t,r,s,o){var a=e("./../../util/getDefaults.js")(e("./info.json"));r.text=r.text||a.text,r.x=r.x||a.x,r.y=r.y||a.y,r.font=r.font||a.font,r.color=r.color||a.color,r.size=r.size||a.size;var u=document.createElement("canvas");u.width=t.shape[0],u.height=t.shape[1];var l=u.getContext("2d"),c=new Image;c.src=s,c.onload=function(){l.drawImage(c,0,0),l.fillStyle=r.color,l.font=r.size+"px "+r.font,l.fillText(r.text,r.x,r.y),n(u.toDataURL(),function(e,r){e&&console.log("get-pixels error: ",e);for(let e=0;e<t.shape[0];e++)for(let n=0;n<t.shape[1];n++)i(e,n,[r.get(e,n,0),r.get(e,n,1),r.get(e,n,2),r.get(e,n,3)],t);o&&o()})}}},{"../../util/pixelSetter.js":725,"./../../util/getDefaults.js":721,"./info.json":698,"get-pixels":123}],697:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":695,"./info.json":698,dup:547}],698:[function(e,t,r){t.exports={name:"text-overlay",description:"Overlay text on image.",requires:["webgl","browser"],inputs:{text:{type:"string",desc:"Enter the text to overlay.",default:"Lorem ipsum"},"Custom-Coordinates":{type:"coordinate-input",desc:"Click to fill Coordinates"},x:{type:"integer",desc:"Starting text horizontal position.",default:"20"},y:{type:"integer",desc:"Starting text vertical position.",default:"20"},font:{type:"select",desc:"Select the font style.",default:"serif",values:["serif","arial","times","courier","Montserrat"]},color:{type:"text",desc:"Select the text color.",default:"rgba(20,120,90,1)",id:"color-picker"},size:{type:"integer",desc:"Enter the font size in pixels.",default:"12"}}}},{}],699:[function(e,t,r){t.exports=function(t,r){return{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this,o=new Array(256).fill(0);return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){let i=Math.round((e+t+r)/3);return o[i]++,[e,t,r,n]},extraManipulation:function(r){return r=e("./Threshold")(r,t,o)},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./Threshold":700}],700:[function(e,t,r){t.exports=function(t,r,n){var i=e("./../../util/getDefaults.js")(e("./info.json"));type=r.threshold||i.threshold,threshold=parseInt(r.input)||i.input;for(var s=[],o=[],a=[],u=0;u<256;u++)s[u]=.299*u,o[u]=.587*u,a[u]=.114*u;var l=t.data.length;for(u=0;u<=l;u++)t.data[u]=Math.floor(s[t.data[u++]]+o[t.data[u++]]+a[t.data[u++]]);"Automatic Thresholding"===type&&(threshold=function(e){let t=0;for(let r=0;r<256;r++)t+=e[r];let r=0;for(let t=0;t<256;t++)r+=t*e[t];let n=0,i=0,s=0,o=0,a=0;for(let u=0;u<256;u++){if(0==(i+=e[u]))continue;if(0==(s=t-i))break;let l=(n+=u*e[u])/i,c=(r-n)/s,h=i*s*(l-c)*(l-c);h>o&&(o=h,a=u)}return a}(n));for(var c=0;c<=l;c+=4)t.data[c]=t.data[c]<threshold?0:255,t.data[c+1]=t.data[c+2]=t.data[c];return t}},{"./../../util/getDefaults.js":721,"./info.json":702}],701:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":699,"./info.json":702,dup:547}],702:[function(e,t,r){t.exports={name:"threshold",description:"Thresholding is used to create binary images",inputs:{threshold:{type:"select",desc:"Type of Thresholding",default:"Manual Thresholding",values:["Manual Thresholding","Automatic Thresholding"]},input:{type:"range",desc:"Threshold Value",default:"120",min:"0",max:"255",step:"1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#threshold"}},{}],703:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return{options:t,draw:function(r,i,s){var o=t.color||n.color;o=(o=o.substring(o.indexOf("(")+1,o.length-1)).split(",");var a=t.factor||n.factor;s.stop(!0),s.overrideFlag=!0;var u=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){u.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,changePixel:function(e,t,r,n){return[e-=(e-o[0])*a,t-=(t-o[1])*a,r-=(r-o[2])*a,n]},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:i,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":705}],704:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":703,"./info.json":705,dup:547}],705:[function(e,t,r){t.exports={name:"tint",description:"Add color tint to an image",inputs:{color:{type:"text",desc:"Select color",default:"rgb(0,0,255)",id:"color-picker"},factor:{type:"range",desc:"Amount of tint",default:"0.5",min:"0",max:"1",step:"0.01"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#tint"}},{}],706:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json")),i=e("glfx"),s=function(e){var t=function(e){var t;t=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):unescape(e.split(",")[1]);for(var r=e.split(",")[0].split(":")[1].split(";")[0],n=new Uint8Array(t.length),i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return new Blob([n],{type:r})}(e.toDataURL("image/png"));return window.URL.createObjectURL(t)},o=function(e,t,r,n){try{var o=i.canvas(1500,1500)}catch(e){return void alert(e)}var a=document.getElementById(e),u=new Image;u.onload=function(){var e=o.texture(u),i=[],l=[];for(let e=0;e<t.length;e+=2)i.push(t[e]);for(let e=1;e<t.length;e+=2)l.push(t[e]);var c=Math.min.apply(null,l);matrix1southmost=Math.max.apply(null,l),matrix1westmost=Math.min.apply(null,i),matrix1eastmost=Math.max.apply(null,i);var h=[],p=[];for(let e=0;e<r.length;e+=2)h.push(r[e]);for(let e=1;e<r.length;e+=2)p.push(r[e]);var f=Math.min.apply(null,p);matrix2southmost=Math.max.apply(null,p),matrix2westmost=Math.min.apply(null,h),matrix2eastmost=Math.max.apply(null,h);var d=matrix2westmost-matrix1westmost,m=f-c;o.draw(e,u.width,u.height);for(var g=(matrix2southmost-f)/(matrix1southmost-c),v=(matrix2eastmost-matrix2westmost)/(matrix1eastmost-matrix1westmost),y=Math.max(v,g),_=0;_<r.length;_+=2)r[_]-=d,r[_]/=y;for(let e=1;e<r.length;e+=2)r[e]-=m,r[e]/=y;o.perspective(t,r).update();var b=s(o);n?window.open(b):a.src=b},u.src=a.src};return{options:t,draw:function(r,i){var s=this;t.nw=t.nw||n.nw,t.ne=t.ne||n.ne,t.se=t.se||n.se,t.sw=t.sw||n.sw;var a=e("../../util/parseDistortCoordinates.js")(t);if(t.inBrowser){var u=document.createElement("img");u.onload=(()=>{o("img",[0,0,u.naturalWidth,0,u.naturalWidth,u.naturalHeight,0,u.naturalHeight],a),u.onload=(()=>{var e=document.createElement("canvas");e.width=u.naturalWidth,e.height=u.naturalHeight,e.getContext("2d").drawImage(u,0,0),s.output={src:e.toDataURL("image/png"),format:"png"},u.remove(),i()})}),u.src=r.src,u.id="img",document.body.appendChild(u)}else e("../_nomodule/gl-context")(r,i,s,t)},output:void 0,UI:r}}},{"../../util/parseDistortCoordinates.js":724,"../_nomodule/gl-context":713,"./../../util/getDefaults.js":721,"./info.json":708,glfx:168}],707:[function(e,t,r){arguments[4][547][0].apply(r,arguments)},{"./Module":706,"./info.json":708,dup:547}],708:[function(e,t,r){t.exports={name:"webgl-distort",requires:["webgl"],description:"Transform perspective of an image based on corner coordinates",inputs:{nw:{type:"String",desc:"Comma separated X and Y coordinates of top-left corner",default:"0,100"},ne:{type:"String",desc:"Comma separated X and Y coordinates of top-right corner",default:"1023,-50"},se:{type:"String",desc:"Comma separated X and Y coordinates of bottom-right corner",default:"1223,867"},sw:{type:"String",desc:"Comma separated X and Y coordinates of bottom-left corner",default:"100,767"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#webgl-distort-module"}},{}],709:[function(e,t,r){t.exports=function(t,r){var n=e("./../../util/getDefaults.js")(e("./info.json"));return t.red=t.red||n.red,t.green=t.green||n.green,t.blue=t.blue||n.blue,{options:t,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var s=this;return e("../_nomodule/PixelManipulation.js")(r,{output:function(e,r,n,i){s.output={src:r,format:n,wasmSuccess:i,useWasm:t.useWasm}},ui:t.step.ui,extraManipulation:function(e){for(var r=0,n=255/t.red,i=255/t.green,s=255/t.blue;r<e.data.length;)e.data[r]=Math.min(255,e.data[r]*n),e.data[r+1]=Math.min(255,e.data[r+1]*i),e.data[r+2]=Math.min(255,e.data[r+2]*s),r+=4;return e},format:r.format,image:t.image,inBrowser:t.inBrowser,callback:n,useWasm:t.useWasm})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":712,"./../../util/getDefaults.js":721,"./info.json":711}],710:[function(e,t,r){arguments[4][576][0].apply(r,arguments)},{"./Module":709,"./info.json":711,dup:576}],711:[function(e,t,r){t.exports={name:"white-balance",description:"Render neutral colours correctly based on the whitest pixel in the image.",inputs:{red:{type:"integer",desc:"Red component of the whitest pixel ",default:255},green:{type:"integer",desc:"Green component of the whitest pixel ",default:255},blue:{type:"integer",desc:"Blue component of the whitest pixel ",default:255}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md#white-balance-module"}},{}],712:[function(require,module,exports){(function(process,__dirname){const pixelSetter=require("../../util/pixelSetter.js"),getPixels=require("get-pixels"),savePixels=require("save-pixels"),ndarray=require("ndarray"),gifshot=require("gifshot"),fs=require("fs"),path=require("path"),getDataUri=require("../../util/getDataUri");module.exports=function PixelManipulation(image,options){const isGIF=image.src.includes("image/gif");let numFrames=1,frames=[],perFrameShape,wasmSuccess,renderableFrames,resolvedFrames=0;function setRenderState(e){return renderableFrames+=e?1:-1}arguments.length<=1&&(options=image,image=this),options=options||{},getPixels(image.src,function(err,pixels){if(err)console.log("get-pixels error: ",err);else{if(isGIF){const{shape:e}=pixels,[t,r,n,i]=e;numFrames=t,renderableFrames=t,perFrameShape=[r,n,i];const s=r*n;for(let e=0;e<numFrames;++e)if(e>0){const t=pixels.index(e,0,0,0),r=pixels.index(e-1,0,0,0);for(let e=0;e<s;++e){const n=t+e*i;if(0===pixels.data[n+i-1]){const t=r+e*i;for(let e=0;e<i;++e)pixels.data[n+e]=pixels.data[t+e]}}}for(let e=0;e<numFrames;e++){frames.push(new ndarray(new Uint8Array(perFrameShape[0]*perFrameShape[1]*perFrameShape[2]),perFrameShape));for(let t=0;t<r;t++)for(let r=0;r<n;r++)for(let n=0;n<i;n++)frames[e].set(t,r,n,pixels.get(e,t,r,n))}}else frames.push(pixels);for(let e=0;e<numFrames;e++){let t=frames[e];if(options.getNeighbourPixel&&(options.getNeighbourPixel.fun=function(e,r){return options.getNeighbourPixel(t,x,y,e,r)}),options.preProcess&&(frames[e]=options.preProcess(t,setRenderState)||t,perFrameShape=frames[e].shape),options.changePixel){const e={env:{consoleLog:console.log,perform:function(e,r){let n=options.changePixel(t.get(e,r,0),t.get(e,r,1),t.get(e,r,2),t.get(e,r,3),e,r);pixelSetter(e,r,n,t)}}};function perPixelManipulation(){for(var r=0;r<t.shape[0];r++)for(var n=0;n<t.shape[1];n++)e.env.perform(r,n)}const r=options.inBrowser?1:0,n=process.env.TEST?1:0;if(options.useWasm)if(options.inBrowser)fetch("../../../dist/manipulation.wasm").then(e=>e.arrayBuffer()).then(t=>WebAssembly.instantiate(t,e)).then(e=>{e.instance.exports.manipulatePixel(t.shape[0],t.shape[1],r,n),wasmSuccess=!0,resolvedFrames++,generateOutput()}).catch(e=>{console.log(e),console.log("WebAssembly acceleration errored; falling back to JavaScript in PixelManipulation"),perPixelManipulation(),wasmSuccess=!1,resolvedFrames++,generateOutput()});else try{const i=path.join(__dirname,"../../../","dist","manipulation.wasm"),s=fs.readFileSync(i);WebAssembly.instantiate(s,e).then(e=>{e.instance.exports.manipulatePixel(t.shape[0],t.shape[1],r,n),wasmSuccess=!0,resolvedFrames++,generateOutput()})}catch(err){console.log(err),console.log("WebAssembly acceleration errored; falling back to JavaScript in PixelManipulation"),perPixelManipulation(),wasmSuccess=!1,resolvedFrames++,generateOutput()}else perPixelManipulation(),wasmSuccess=!1,resolvedFrames++,generateOutput()}else resolvedFrames++;options.extraManipulation&&(frames[e]=options.extraManipulation(t,setRenderState,generateOutput)||t,perFrameShape=frames[e].shape),generateOutput()}}function generateOutput(){if(!(renderableFrames<numFrames||resolvedFrames<numFrames))if(isGIF){const dataPromises=[];for(let e=0;e<numFrames;e++)dataPromises.push(getDataUri(frames[e],options.format));Promise.all(dataPromises).then(datauris=>{const gifshotOptions={images:datauris,frameDuration:1,numFrames:datauris.length,gifWidth:perFrameShape[0],gifHeight:perFrameShape[1]},gifshotCb=e=>{e.error&&console.log("gifshot error: ",e.errorMsg),options.output&&options.output(options.image,e.image,"gif",wasmSuccess),options.callback&&options.callback()};if(options.inBrowser)gifshot.createGIF(gifshotOptions,gifshotCb);else{const nodejsGIFShot=eval("require")("./node-gifshot");nodejsGIFShot(gifshotOptions,gifshotCb)}})}else getDataUri(frames[0],options.format).then(e=>{options.output&&options.output(options.image,e,options.format,wasmSuccess),options.callback&&options.callback()})}})}}).call(this,require("_process"),"/src/modules/_nomodule")},{"../../util/getDataUri":720,"../../util/pixelSetter.js":725,_process:437,fs:298,"get-pixels":123,gifshot:134,ndarray:389,path:404,"save-pixels":496}],713:[function(require,module,exports){(function(__dirname){module.exports=function runInBrowserContext(input,callback,step,options){const puppeteer=eval("require")("puppeteer");var minOptions=require("lodash").cloneDeep(options);minOptions.step=options.step.name;var obj={input:input,modOptions:minOptions};puppeteer.launch({headless:!0,args:["--no-sandbox","--disable-setuid-sandbox"]}).then(function(e){e.newPage().then(t=>{t.goto("https://google.com").then(()=>{t.addScriptTag({path:require("path").join(__dirname,"../../../dist/image-sequencer.js")}).then(()=>{t.evaluate(e=>new Promise((t,r)=>{var n=ImageSequencer();n.loadImage(e.input.src),n.addSteps(e.modOptions.step,e.modOptions),n.run(function(e){t(n.steps[1].output.src)})}),obj).then(t=>{e.close().then(()=>{step.output={src:t,format:input.format},callback()})})})})})})}}).call(this,"/src/modules/_nomodule")},{lodash:376,path:404}],714:[function(e,t,r){const{GPU:n}=e("gpu.js");t.exports={convolve:(e,t,r={})=>{const i=r.pipeMode||!1,s=r.mode||"gpu",o=new n("gpu"!=s?{mode:s}:{}),a=e[0][0].length,u=e[0].length,l=t[0].length,c=t.length,h=Math.floor(l/2),p=Math.floor(c/2),f=`function (array, kernel) {\n let sum = 0;\n for (let i = 0; i < ${l}; i++){\n for (let j = 0; j < ${c}; j++){\n sum += kernel[j][i] * array[this.thread.y + j][this.thread.x + i];\n }\n }\n return sum;\n }`,d=e=>{let t=[];for(var r=0;r<e.length+2*p;r++){t.push([]);for(var n=0;n<e[0].length+2*h;n++){const i=Math.min(Math.max(n-h,0),e[0].length-1),s=Math.min(Math.max(r-p,0),e.length-1);t[r].push(e[s][i])}}return t},m=o.createKernel(f,{output:[a,u],pipeline:i});let g=[];for(var v=0;v<e.length;v++){const r=m(d(e[v]),t);i?g.push(r.toArray()):g.push(r)}return g},compute:(e,t,r,n)=>{t=t.toString();const i=gpu.createKernel(t,{output:e,constants:r,pipeline:n});return i.build(),n?i().toArray():i()}}},{"gpu.js":"gpu.js"}],715:[function(e,t,r){t.exports=function(t,r,n,i){function s(r,n,i){var s;if(r.match(/^data:/i))i(s=r,n);else if(!t.options.inBrowser&&r.match(/^https?:\/\//i))e(r.match(/^(https?):\/\//i)[1]).get(r,function(e){var t="",r=e.headers["content-type"];e.setEncoding("base64"),e.on("data",function(e){t+=e}),e.on("end",function(){i("data:"+r+";base64,"+t,n)})});else if(t.options.inBrowser){let e=document.querySelector("div.notify-box"),t=document.getElementById("close-popup");if(0!==r.indexOf("images/")&&0!==r.indexOf("./images/")&&fetch(r).then(function(e){return!e}).catch(function(e){return e&&console.log("Error occured because of image URL ",e),!0}))e&&(e.classList.remove("d-none"),e.classList.add("d-block")),t&&t.addEventListener("click",function(){e&&(e.classList.remove("d-block"),e.classList.add("d-none")),document.querySelector("button.remove")&&document.querySelector("button.remove").click(),location.reload()});else{var o=r.split(".").pop(),a=document.createElement("img"),u=document.createElement("canvas"),l=u.getContext("2d");a.onload=function(){u.width=a.naturalWidth,u.height=a.naturalHeight,l.drawImage(a,0,0),s=u.toDataURL(o),i(s,n)},a.src=r}}else s=e("urify")(r),i(s,n)}return function(e,r){s(r,{name:"load-image",description:"This initial step loads and displays the original image without any modifications.",ID:t.options.sequencerCounter++,inBrowser:t.options.inBrowser,ui:t.options.ui,UI:t.events,output:""},function(e,r){var n=function(e){return{src:e,format:e.split(":")[1].split(";")[0].split("/")[1]}}(e);return t.steps.push(r),t.steps[0].output=n,t.steps[0].UI.onSetup(t.steps[0]),t.steps[0].UI.onDraw(t.steps[0]),t.steps[0].UI.onComplete(t.steps[0]),i(),!0})}(0,n)}},{urify:518}],716:[function(e,t,r){t.exports=function(){return function(e){var t=$(e.dropZoneSelector),r=$(e.fileInputSelector),n=$(e.takePhotoSelector),i=e.onLoad;function s(e){if(e.preventDefault(),e.stopPropagation(),e.target&&e.target.files)var t=e.target.files[0];else t=e.dataTransfer.files[0];if(t){var r=new FileReader;r.onload=i,r.readAsDataURL(t)}}e.onTakePhoto,new FileReader,r.on("change",s),n.on("click",function(){document.getElementById("video").style.display="inline",document.getElementById("capture").style.display="inline",document.getElementById("close").style.display="inline",r.css("display","none"),n.css("display","none"),document.getElementById("dropzone-text").style.display="none";var t=document.getElementById("video");function i(e){e.getVideoTracks().forEach(function(e){e.stop()}),document.getElementById("video").style.display="none",document.getElementById("capture").style.display="none",document.getElementById("close").style.display="none",r.css("display","block"),n.css("display","block"),document.getElementById("dropzone-text").style.display="block"}canvas=document.getElementById("canvas"),context=canvas.getContext("2d"),vendorUrl=window.URL||window.webkitURL,navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(function(r){window.stream=r,t.srcObject=r,t.onloadedmetadata=function(e){t.play()},document.getElementById("capture").addEventListener("click",function(){context.drawImage(t,0,0,400,300),e.onTakePhoto(canvas.toDataURL()),setTimeout(i(r),1)}),document.getElementById("close").addEventListener("click",function(){i(r)})}).catch(function(e){console.log("navigator.getUserMedia error: ",e),"Permission denied"!=e.message&&"NotAllowedError"!=e.message&&"PermissionDismissedError"!=e.message||document.getElementById("capture").addEventListener("click",function(e){alert("Enable camera access in order to take picture")}),"NotFoundError"!=e.message&&"DevicesNotFoundError"!=e.message||alert("You do not have appropriate devices to use this Functionality"),"NotReadableError"!=e.message&&"TrackStartError"!=e.message&&"Concurrent mic process limit"!=e.message||alert("Your webcam is already in use by some other application"),"OverconstrainedError"!=e.message&&"ConstraintNotSatisfiedError"!=e.message||console.log("Requested Constraints can not be satisfied ",e)}),document.getElementById("close").addEventListener("click",function(){t.style.display="none"})}),t[0].addEventListener("drop",s,!1),t.on("dragover",function(e){t.addClass("hover"),e.preventDefault(),e.stopPropagation()}),t.on("dragenter",function(e){t.addClass("hover")}),t.on("dragleave",function(e){t.removeClass("hover")}),t.on("drop",function(e){t.removeClass("hover"),e.preventDefault()})}}},{}],717:[function(e,t,r){t.exports=function(e={}){return e.onSetup=e.onSetup||function(e){0==e.ui||(e.inBrowser?console.log('Added Step "'+e.name+'"'):console.log("[36m%s[0m",'Added Step "'+e.name+'"'))},e.onDraw=e.onDraw||function(e){0==e.ui||(e.inBrowser?console.log('Drawing Step "'+e.name+'"'):console.log("[33m%s[0m",'Drawing Step "'+e.name+'"'))},e.onComplete=e.onComplete||function(e){0==e.ui||(e.inBrowser?console.log('Drawn Step "'+e.name+'"'):console.log("[32m%s[0m",'Drawn Step "'+e.name+'"'))},e.onRemove=e.onRemove||function(e){0==e.ui||(e.inBrowser?console.log('Removing Step "'+e.name+'"'):console.log("[31m%s[0m",'Removing Step "'+e.name+'"'))},e.notify=e.notify||function(e){console.log(e)},e}},{}],718:[function(e,t,r){t.exports=function(e,t,r){const{iw:n,ih:i}=e;Object.keys(t).forEach(function(e){var r=t[e];r.valInp=r.valInp.toString(),r.valInp=r.valInp.replace(/[\)\(]/g,""),r.valInp&&"%"===r.valInp.slice(-1)?(r.valInp=r.valInp.replace("%",""),r.valInp=parseInt(r.valInp),"horizontal"===r.type?r.valInp=r.valInp*n/100:r.valInp=r.valInp*i/100):r.valInp=parseInt(r.valInp)}),r(e,t)}},{}],719:[function(e,t,r){t.exports=function(t,r){return(r=r||{}).infoJson=r.infoJson||{},[function(n,i){var s=e("./getDefaults.js")(r.infoJson);for(key in r.infoJson.inputs)r.infoJson.inputs.hasOwnProperty(key)&&(n[key]=n[key]||s[key]);return{options:n,draw:function(e,r){var i=this,s=t(n),o=ImageSequencer({inBrowser:!1,ui:!1});o.loadImage(e.src,function(){o.importJSON(s),o.run(function(t){i.output={src:t,format:e.format},r()})})},output:void 0,UI:i}},r.infoJson]}},{"./getDefaults.js":721}],720:[function(e,t,r){(function(r){const n=e("save-pixels");t.exports=getDataUri=((e,t)=>new Promise(i=>{let s=[],o=0,a=n(e,t,{quality:100});a.on("data",function(e){o+=e.length,s.push(e)}),a.on("end",function(){let e=r.concat(s,o).toString("base64");i("data:image/"+t+";base64,"+e)})}))}).call(this,e("buffer").Buffer)},{buffer:299,"save-pixels":496}],721:[function(e,t,r){t.exports=function(e){var t={};for(var r in e.inputs)e.inputs.hasOwnProperty(r)&&(t[r]=e.inputs[r].default);return t}},{}],722:[function(e,t,r){const n=e("get-pixels");t.exports=function(e,t){let r;n(e,function(e,n){if(4===n.shape.length){const[e,t,i]=n.shape;r={frames:e,width:t,height:i}}else{const[e,t]=n.shape;r={width:e,height:t}}t&&t(r)})}},{"get-pixels":123}],723:[function(e,t,r){t.exports={getPreviousStep:function(){return this.getStep(-1)},getNextStep:function(){return this.getStep(1)},getInput:function(e){return e+this.getIndex()===0&&e++,this.getStep(e-1).output},getOutput:function(e){return this.getStep(e).output},getOptions:function(){return this.getStep(0).options},setOptions:function(e){let t=this.getStep(0).options;for(let r in e)t[r]&&(t[r]=e[r])},getFormat:function(){return this.getStep(-1).output.format},getHeight:function(e){let t=new Image;t.onload=function(){e(t.height)},t.src=this.getInput(0).src},getWidth:function(e){let t=new Image;t.onload=function(){e(t.width)},t.src=this.getInput(0).src}}},{}],724:[function(e,t,r){t.exports=function(e){let t=[];return t.push(e.nw.split(",")),t.push(e.ne.split(",")),t.push(e.se.split(",")),t.push(e.sw.split(",")),t.reduce((e,t)=>(e.push(parseInt(t[0])),e.push(parseInt(t[1])),e),[])}},{}],725:[function(e,t,r){t.exports=function(e,t,r,n){for(let i=0;i<r.length;i++)n.set(e,t,i,r[i])}},{}],"gpu.js":[function(e,t,r){const{GPU:n}=e("./gpu"),{alias:i}=e("./alias"),{utils:s}=e("./utils"),{Input:o,input:a}=e("./input"),{Texture:u}=e("./texture"),{FunctionBuilder:l}=e("./backend/function-builder"),{FunctionNode:c}=e("./backend/function-node"),{CPUFunctionNode:h}=e("./backend/cpu/function-node"),{CPUKernel:p}=e("./backend/cpu/kernel"),{HeadlessGLKernel:f}=e("./backend/headless-gl/kernel"),{WebGLFunctionNode:d}=e("./backend/web-gl/function-node"),{WebGLKernel:m}=e("./backend/web-gl/kernel"),{kernelValueMaps:g}=e("./backend/web-gl/kernel-value-maps"),{WebGL2FunctionNode:v}=e("./backend/web-gl2/function-node"),{WebGL2Kernel:y}=e("./backend/web-gl2/kernel"),{kernelValueMaps:_}=e("./backend/web-gl2/kernel-value-maps"),{GLKernel:b}=e("./backend/gl/kernel"),{Kernel:x}=e("./backend/kernel"),{FunctionTracer:w}=e("./backend/function-tracer"),E=e("./plugins/math-random-uniformly-distributed");t.exports={alias:i,CPUFunctionNode:h,CPUKernel:p,GPU:n,FunctionBuilder:l,FunctionNode:c,HeadlessGLKernel:f,Input:o,input:a,Texture:u,utils:s,WebGL2FunctionNode:v,WebGL2Kernel:y,webGL2KernelValueMaps:_,WebGLFunctionNode:d,WebGLKernel:m,webGLKernelValueMaps:g,GLKernel:b,Kernel:x,FunctionTracer:w,plugins:{mathRandom:E}}},{"./alias":184,"./backend/cpu/function-node":185,"./backend/cpu/kernel":187,"./backend/function-builder":188,"./backend/function-node":189,"./backend/function-tracer":190,"./backend/gl/kernel":192,"./backend/headless-gl/kernel":213,"./backend/kernel":215,"./backend/web-gl/function-node":217,"./backend/web-gl/kernel":249,"./backend/web-gl/kernel-value-maps":218,"./backend/web-gl2/function-node":252,"./backend/web-gl2/kernel":284,"./backend/web-gl2/kernel-value-maps":253,"./gpu":286,"./input":287,"./plugins/math-random-uniformly-distributed":289,"./texture":290,"./utils":291}]},{},[537]); |